upload.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. .vxe-upload {
  2. position: relative;
  3. color: var(--vxe-ui-font-color);
  4. font-family: var(--vxe-ui-font-family);
  5. &.show--error {
  6. .vxe-upload--file-item {
  7. &.is--error {
  8. color: var(--vxe-ui-status-error-color);
  9. &:hover {
  10. .vxe-upload--file-item-name {
  11. color: var(--vxe-ui-status-error-color);
  12. }
  13. }
  14. .vxe-upload--file-item-name {
  15. text-decoration: line-through;
  16. }
  17. }
  18. }
  19. }
  20. }
  21. .vxe-upload,
  22. .vxe-upload--more-popup {
  23. &.is--active {
  24. .vxe-upload--image-action-box {
  25. border-color: var(--vxe-ui-font-primary-color);
  26. }
  27. .vxe-upload--file-action-btn {
  28. & > .vxe-button {
  29. border-color: var(--vxe-ui-font-primary-color);
  30. border-style: var(--vxe-ui-upload-file-button-border-style);
  31. }
  32. }
  33. }
  34. &.is--disabled {
  35. .vxe-upload--file-action-btn,
  36. .vxe-upload--image-action-box {
  37. cursor: no-drop;
  38. }
  39. }
  40. }
  41. .vxe-upload--drag-placeholder {
  42. display: flex;
  43. flex-direction: row;
  44. align-items: center;
  45. justify-content: center;
  46. position: absolute;
  47. top: 0;
  48. left: 0;
  49. width: 100%;
  50. height: 100%;
  51. font-weight: 700;
  52. font-weight: var(--vxe-ui-font-darken-color);
  53. font-size: 1.2em;
  54. border-radius: var(--vxe-ui-base-border-radius);
  55. background-color: var(--vxe-ui-upload-drag-over-background-color);
  56. border: 1px dotted var(--vxe-ui-font-lighten-color);
  57. z-index: 9;
  58. }
  59. .vxe-upload--file-list-wrapper {
  60. &.is--horizontal {
  61. display: flex;
  62. flex-direction: row;
  63. & > .vxe-upload--file-list {
  64. flex-grow: 1;
  65. display: flex;
  66. flex-direction: column;
  67. justify-content: center;
  68. }
  69. & > .vxe-upload--file-action {
  70. flex-shrink: 0;
  71. }
  72. }
  73. }
  74. .vxe-upload--file-list {
  75. max-height: 294px;
  76. overflow: auto;
  77. outline: 0;
  78. }
  79. .vxe-upload--file-item {
  80. position: relative;
  81. display: flex;
  82. flex-direction: row;
  83. align-items: center;
  84. line-height: 1.5em;
  85. padding: var(--vxe-ui-layout-padding-half);
  86. &:hover {
  87. background-color: var(--vxe-ui-base-hover-background-color);
  88. .vxe-upload--file-item-name {
  89. color: var(--vxe-ui-font-primary-color);
  90. }
  91. }
  92. &:last-child {
  93. margin-bottom: 0;
  94. }
  95. &.is--preview {
  96. .vxe-upload--file-item-name {
  97. cursor: pointer;
  98. }
  99. }
  100. &.is--loading {
  101. cursor: progress;
  102. color: var(--vxe-ui-input-placeholder-color);
  103. &:hover {
  104. .vxe-upload--file-item-name {
  105. color: var(--vxe-ui-input-placeholder-color);
  106. }
  107. }
  108. }
  109. &.is--pending {
  110. color: var(--vxe-ui-input-placeholder-color);
  111. }
  112. }
  113. .vxe-upload--file-over-more {
  114. display: flex;
  115. align-items: center;
  116. justify-content: center;
  117. flex-shrink: 0;
  118. .vxe-button {
  119. padding-top: 0;
  120. padding-bottom: 0;
  121. }
  122. }
  123. .vxe-upload--file-action-btn {
  124. display: inline-block;
  125. & > .vxe-button {
  126. border-style: var(--vxe-ui-upload-file-button-border-style);
  127. }
  128. }
  129. .vxe-upload--file-action-button {
  130. &:hover {
  131. border-color: var(--vxe-ui-font-primary-color);
  132. }
  133. }
  134. .vxe-upload--file-action-tip {
  135. font-size: 0.9em;
  136. padding: var(--vxe-ui-layout-padding-half);
  137. color: var(--vxe-ui-input-placeholder-color);
  138. }
  139. .vxe-upload--file-item-rebtn {
  140. padding-right: 0.4em;
  141. color: var(--vxe-ui-status-error-color);
  142. text-decoration: none;
  143. cursor: help;
  144. }
  145. .vxe-upload--file-item-icon {
  146. flex-shrink: 0;
  147. padding-right: 0.2em;
  148. }
  149. .vxe-upload--file-item-name {
  150. flex-grow: 1;
  151. overflow: hidden;
  152. text-overflow: ellipsis;
  153. white-space: nowrap;
  154. padding: 0 0.2em;
  155. }
  156. .vxe-upload--file-item-btn-wrapper {
  157. display: inline-flex;
  158. flex-direction: row;
  159. justify-content: center;
  160. }
  161. .vxe-upload--file-item-loading-icon {
  162. padding-right: 0.2em;
  163. }
  164. .vxe-upload--file-item-loading-icon,
  165. .vxe-upload--file-item-loading-text {
  166. color: var(--vxe-ui-loading-color);
  167. flex-shrink: 0;
  168. }
  169. .vxe-upload--file-item-corner,
  170. .vxe-upload--file-item-download-btn,
  171. .vxe-upload--file-item-remove-btn {
  172. flex-shrink: 0;
  173. }
  174. .vxe-upload--file-item-download-btn,
  175. .vxe-upload--file-item-remove-btn {
  176. padding-left: 0.5em;
  177. cursor: pointer;
  178. }
  179. .vxe-upload--file-item-download-btn {
  180. color: var(--vxe-ui-font-primary-color);
  181. &:hover {
  182. color: var(--vxe-ui-font-primary-lighten-color);
  183. }
  184. }
  185. .vxe-upload--file-item-remove-btn {
  186. color: var(--vxe-ui-status-error-color);
  187. &:hover {
  188. color: var(--vxe-ui-status-error-lighten-color);
  189. }
  190. }
  191. .vxe-upload--image-list,
  192. .vxe-upload--image-more-list {
  193. display: flex;
  194. flex-direction: row;
  195. flex-wrap: wrap;
  196. }
  197. .vxe-upload--image-item,
  198. .vxe-upload--image-action,
  199. .vxe-upload--image-over-more {
  200. flex-shrink: 0;
  201. text-align: center;
  202. padding: var(--vxe-ui-layout-padding-half);
  203. }
  204. .vxe-upload--image-over-more {
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. }
  209. .vxe-upload--image-action-icon {
  210. font-size: 1.2em;
  211. padding-bottom: 0.1em;
  212. }
  213. .vxe-upload--image-action-content {
  214. font-size: 0.9em;
  215. padding: 0 0.15em 0.5em 0.15em;
  216. }
  217. .vxe-upload--image-item-box,
  218. .vxe-upload--image-action-box {
  219. position: relative;
  220. border-radius: var(--vxe-ui-base-border-radius);
  221. }
  222. .vxe-upload--image-item-box {
  223. display: flex;
  224. flex-direction: row;
  225. align-items: center;
  226. justify-content: center;
  227. }
  228. .vxe-upload--image-action-box {
  229. display: flex;
  230. flex-direction: column;
  231. align-items: center;
  232. justify-content: center;
  233. border: 1px var(--vxe-ui-upload-image-button-border-style) var(--vxe-ui-input-border-color);
  234. cursor: pointer;
  235. &:hover {
  236. color: var(--vxe-ui-font-primary-color);
  237. border-color: var(--vxe-ui-font-primary-color);
  238. }
  239. }
  240. .vxe-upload {
  241. &.is--disabled {
  242. .vxe-upload--file-action-btn,
  243. .vxe-upload--image-action-box {
  244. color: var(--vxe-ui-font-disabled-color);
  245. cursor: no-drop;
  246. }
  247. .vxe-upload--image-action-box {
  248. &:hover {
  249. color: var(--vxe-ui-font-disabled-color);
  250. border-color: var(--vxe-ui-input-border-color);
  251. }
  252. }
  253. }
  254. }
  255. .vxe-upload--image-item {
  256. &.is--loading {
  257. .vxe-upload--image-item-box {
  258. cursor: progress;
  259. }
  260. }
  261. &:hover,
  262. &.is--error,
  263. &.is--pending {
  264. .vxe-upload--image-item-img-wrapper {
  265. &::after {
  266. content: "";
  267. position: absolute;
  268. top: 0;
  269. left: 0;
  270. width: 100%;
  271. height: 100%;
  272. pointer-events: none;
  273. }
  274. }
  275. }
  276. &:hover {
  277. .vxe-upload--image-item-img-wrapper {
  278. &::after {
  279. background-color: rgba(0, 0, 0, 0.1);
  280. }
  281. }
  282. }
  283. &.is--error,
  284. &.is--pending {
  285. .vxe-upload--image-item-img-wrapper {
  286. &::after {
  287. background-color: rgba(0, 0, 0, 0.4);
  288. }
  289. }
  290. &:hover {
  291. .vxe-upload--image-item-img-wrapper {
  292. &::after {
  293. background-color: rgba(0, 0, 0, 0.5);
  294. }
  295. }
  296. }
  297. }
  298. &.is--error {
  299. .vxe-upload--image-item-img-wrapper {
  300. border-color: var(--vxe-ui-status-error-color);
  301. }
  302. }
  303. &.is--preview {
  304. .vxe-upload--image-item-box {
  305. cursor: pointer;
  306. }
  307. }
  308. &.is--circle {
  309. .vxe-upload--image-item-img-wrapper {
  310. border-radius: 50%;
  311. overflow: hidden;
  312. &::after {
  313. border-radius: 50%;
  314. }
  315. }
  316. .vxe-upload--image-item-loading,
  317. .vxe-upload--image-item-rebtn {
  318. border-radius: 50%;
  319. }
  320. }
  321. }
  322. .vxe-upload--image-item-img-wrapper {
  323. display: flex;
  324. flex-direction: row;
  325. align-items: center;
  326. justify-content: center;
  327. width: 100%;
  328. height: 100%;
  329. border-radius: var(--vxe-ui-base-border-radius);
  330. border: 1px solid var(--vxe-ui-input-border-color);
  331. }
  332. .vxe-upload--image-item-img {
  333. max-width: 100%;
  334. max-height: 100%;
  335. }
  336. .vxe-upload--image-item-loading {
  337. position: absolute;
  338. display: flex;
  339. flex-direction: column;
  340. align-items: center;
  341. justify-content: center;
  342. top: 0;
  343. left: 0;
  344. width: 100%;
  345. height: 100%;
  346. color: var(--vxe-ui-loading-color);
  347. background-color: rgba(0, 0, 0, 0.6);
  348. z-index: 1;
  349. user-select: none;
  350. }
  351. .vxe-upload--image-item-rebtn {
  352. position: absolute;
  353. display: flex;
  354. flex-direction: row;
  355. justify-content: center;
  356. align-items: center;
  357. top: 0;
  358. left: 0;
  359. width: 100%;
  360. height: 100%;
  361. background-color: rgba(0, 0, 0, 0.6);
  362. }
  363. .vxe-upload--image-action-hint {
  364. font-size: 0.8em;
  365. word-break: break-all;
  366. color: var(--vxe-ui-input-placeholder-color);
  367. }
  368. .vxe-upload--image-item-btn-wrapper {
  369. display: inline-flex;
  370. flex-direction: row;
  371. justify-content: center;
  372. position: absolute;
  373. top: calc(var(--vxe-ui-layout-padding-half) * -1);
  374. right: calc(var(--vxe-ui-layout-padding-half) * -1);
  375. }
  376. .vxe-upload--file-item-,
  377. .vxe-upload--image-item-remove-btn {
  378. flex-shrink: 0;
  379. }
  380. .vxe-upload--image-item-remove-btn {
  381. display: flex;
  382. flex-direction: row;
  383. justify-content: center;
  384. align-items: center;
  385. width: 1.8em;
  386. height: 1.8em;
  387. font-size: 0.8em;
  388. border-radius: 50%;
  389. color: #fff;
  390. background-color: var(--vxe-ui-status-error-color);
  391. z-index: 3;
  392. cursor: pointer;
  393. &:hover {
  394. background-color: var(--vxe-ui-status-error-lighten-color);
  395. }
  396. }
  397. .vxe-upload--file-message-over-error {
  398. .vxe-upload--file-message-over-extra {
  399. margin-top: 0.5em;
  400. max-height: 160px;
  401. max-width: 380px;
  402. overflow: auto;
  403. border: 1px solid var(--vxe-ui-input-border-color);
  404. padding: var(--vxe-ui-layout-padding-half) var(--vxe-ui-layout-padding-default);
  405. outline: 0;
  406. }
  407. .vxe-upload--file-message-over-extra-item {
  408. overflow: hidden;
  409. text-overflow: ellipsis;
  410. white-space: nowrap;
  411. }
  412. }
  413. /*拖拽排序*/
  414. .vxe-upload--drag-line {
  415. display: none;
  416. position: absolute;
  417. top: 0;
  418. left: 0;
  419. z-index: 3;
  420. pointer-events: none;
  421. }
  422. .vxe-upload--drag-line {
  423. width: 1px;
  424. height: 1px;
  425. border: 2px solid transparent;
  426. &[drag-pos="top"] {
  427. border-top-color: var(--vxe-ui-font-primary-color);
  428. }
  429. &[drag-pos="bottom"] {
  430. border-bottom-color: var(--vxe-ui-font-primary-color);
  431. }
  432. &[drag-pos="left"] {
  433. border-left-color: var(--vxe-ui-font-primary-color);
  434. }
  435. &[drag-pos="right"] {
  436. border-right-color: var(--vxe-ui-font-primary-color);
  437. }
  438. }
  439. .vxe-upload--drag-list-move {
  440. transition: transform 0.2s;
  441. }
  442. .vxe-upload--more-popup {
  443. position: relative;
  444. .vxe-upload--file-list {
  445. max-height: none;
  446. }
  447. .vxe-upload--file-action-btn {
  448. width: 100%;
  449. & > .vxe-button {
  450. width: 100%;
  451. max-width: 100%;
  452. }
  453. }
  454. }
  455. .vxe-upload,
  456. .vxe-upload--more-popup {
  457. font-size: var(--vxe-ui-font-size-default);
  458. .vxe-upload--image-item-box,
  459. .vxe-upload--image-action-box {
  460. width: var(--vxe-ui-upload-image-wh-default);
  461. height: var(--vxe-ui-upload-image-wh-default);
  462. }
  463. &.size--medium {
  464. font-size: var(--vxe-ui-font-size-medium);
  465. .vxe-upload--image-item-box,
  466. .vxe-upload--image-action-box {
  467. width: var(--vxe-ui-upload-image-wh-medium);
  468. height: var(--vxe-ui-upload-image-wh-medium);
  469. }
  470. }
  471. &.size--small {
  472. font-size: var(--vxe-ui-font-size-small);
  473. .vxe-upload--image-item-box,
  474. .vxe-upload--image-action-box {
  475. width: var(--vxe-ui-upload-image-wh-small);
  476. height: var(--vxe-ui-upload-image-wh-small);
  477. }
  478. }
  479. &.size--mini {
  480. font-size: var(--vxe-ui-font-size-mini);
  481. .vxe-upload--image-item-box,
  482. .vxe-upload--image-action-box {
  483. width: var(--vxe-ui-upload-image-wh-mini);
  484. height: var(--vxe-ui-upload-image-wh-mini);
  485. }
  486. }
  487. }
  488. .vxe-upload--image-more-list {
  489. .vxe-upload--image-item-box {
  490. width: var(--vxe-ui-upload-image-wh-default);
  491. height: var(--vxe-ui-upload-image-wh-default);
  492. }
  493. }