智慧水务管理系统 - 精河县供水工程综合管理平台

upload.scss 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/utils' as *;
  3. @use 'common/var' as *;
  4. @mixin upload-success($color: null) {
  5. right: -15px;
  6. top: -6px;
  7. width: 40px;
  8. height: 24px;
  9. background: getCssVar('color-success');
  10. text-align: center;
  11. transform: rotate(45deg);
  12. i {
  13. font-size: 12px;
  14. margin-top: 11px;
  15. transform: rotate(-45deg);
  16. color: $color;
  17. }
  18. }
  19. @include b(upload) {
  20. @include set-component-css-var('upload', $upload);
  21. }
  22. @include b(upload) {
  23. @include utils-inline-flex-center;
  24. cursor: pointer;
  25. outline: none;
  26. @include when(disabled) {
  27. cursor: not-allowed;
  28. &:focus {
  29. border-color: getCssVar('border-color', 'darker');
  30. color: inherit;
  31. .#{$namespace}-upload-dragger {
  32. border-color: getCssVar('border-color', 'darker');
  33. }
  34. }
  35. .#{$namespace}-upload-dragger {
  36. cursor: not-allowed;
  37. background-color: getCssVar('disabled-bg-color');
  38. .#{bem('upload', 'text')} {
  39. color: getCssVar('text-color-placeholder');
  40. em {
  41. color: getCssVar('disabled-text-color');
  42. }
  43. }
  44. &:hover {
  45. border-color: getCssVar('border-color', 'darker');
  46. }
  47. }
  48. }
  49. @include e(input) {
  50. display: none;
  51. }
  52. @include e(tip) {
  53. font-size: 12px;
  54. color: getCssVar('text-color', 'regular');
  55. margin-top: 7px;
  56. }
  57. iframe {
  58. position: absolute;
  59. z-index: -1;
  60. top: 0;
  61. left: 0;
  62. opacity: 0;
  63. filter: alpha(opacity=0);
  64. }
  65. /* Picture Card for Wall */
  66. @include m(picture-card) {
  67. background-color: getCssVar('fill-color', 'lighter');
  68. border: 1px dashed getCssVar('border-color', 'darker');
  69. border-radius: 6px;
  70. box-sizing: border-box;
  71. width: getCssVar('upload', 'picture-card', 'size');
  72. height: getCssVar('upload', 'picture-card', 'size');
  73. cursor: pointer;
  74. vertical-align: top;
  75. @include utils-inline-flex-center;
  76. > i {
  77. font-size: 28px;
  78. color: getCssVar('text-color', 'secondary');
  79. }
  80. &:hover {
  81. border-color: getCssVar('color-primary');
  82. color: getCssVar('color-primary');
  83. }
  84. }
  85. @include when(drag) {
  86. display: block;
  87. }
  88. &:focus {
  89. border-color: getCssVar('color-primary');
  90. color: getCssVar('color-primary');
  91. .#{$namespace}-upload-dragger {
  92. border-color: getCssVar('color-primary');
  93. }
  94. }
  95. }
  96. @include b(upload-dragger) {
  97. padding: getCssVar('upload-dragger-padding-vertical')
  98. getCssVar('upload-dragger-padding-horizontal');
  99. background-color: getCssVar('fill-color', 'blank');
  100. border: 1px dashed getCssVar('border-color');
  101. border-radius: 6px;
  102. box-sizing: border-box;
  103. text-align: center;
  104. cursor: pointer;
  105. position: relative;
  106. overflow: hidden;
  107. .#{bem('icon', '', 'upload')} {
  108. font-size: 67px;
  109. color: getCssVar('text-color', 'placeholder');
  110. margin-bottom: 16px;
  111. line-height: 50px;
  112. }
  113. + .#{bem('upload', 'tip')} {
  114. text-align: center;
  115. }
  116. ~ .#{bem('upload', 'files')} {
  117. border-top: getCssVar('border');
  118. margin-top: 7px;
  119. padding-top: 5px;
  120. }
  121. .#{bem('upload', 'text')} {
  122. color: getCssVar('text-color', 'regular');
  123. font-size: 14px;
  124. text-align: center;
  125. em {
  126. color: getCssVar('color-primary');
  127. font-style: normal;
  128. }
  129. }
  130. &:hover {
  131. border-color: getCssVar('color-primary');
  132. }
  133. @include when(dragover) {
  134. padding: calc(#{getCssVar('upload-dragger-padding-vertical')} - 1px)
  135. calc(#{getCssVar('upload-dragger-padding-horizontal')} - 1px);
  136. background-color: getCssVar('color', 'primary', 'light-9');
  137. border: 2px dashed getCssVar('color-primary');
  138. }
  139. }
  140. @include b(upload-list) {
  141. @include set-component-css-var('upload', $upload);
  142. }
  143. @include b(upload-list) {
  144. margin: 10px 0 0;
  145. padding: 0;
  146. list-style: none;
  147. position: relative;
  148. @include e(item) {
  149. transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
  150. font-size: 14px;
  151. color: getCssVar('text-color', 'regular');
  152. margin-bottom: 5px;
  153. position: relative;
  154. box-sizing: border-box;
  155. border-radius: 4px;
  156. width: 100%;
  157. .#{bem('progress')} {
  158. position: absolute;
  159. top: 20px;
  160. width: 100%;
  161. }
  162. .#{bem('progress', 'text')} {
  163. position: absolute;
  164. right: 0;
  165. top: -13px;
  166. }
  167. .#{bem('progress-bar')} {
  168. margin-right: 0;
  169. padding-right: 0;
  170. }
  171. & .#{bem('icon', '', 'upload-success')} {
  172. color: getCssVar('color-success');
  173. }
  174. .#{bem('icon', '', 'close')} {
  175. display: none;
  176. position: absolute;
  177. right: 5px;
  178. top: 50%;
  179. cursor: pointer;
  180. opacity: 0.75;
  181. color: getCssVar('text-color', 'regular');
  182. transition: opacity getCssVar('transition-duration');
  183. transform: translateY(-50%);
  184. &:hover {
  185. opacity: 1;
  186. color: getCssVar('color-primary');
  187. }
  188. }
  189. & .#{bem('icon', '', 'close-tip')} {
  190. display: none;
  191. position: absolute;
  192. top: 1px;
  193. right: 5px;
  194. font-size: 12px;
  195. cursor: pointer;
  196. opacity: 1;
  197. color: getCssVar('color-primary');
  198. font-style: normal;
  199. }
  200. &:hover,
  201. &:focus-within {
  202. background-color: getCssVar('fill-color', 'light');
  203. .#{bem('icon', '', 'close')} {
  204. display: inline-flex;
  205. }
  206. .#{bem('icon', '', 'close-tip')} {
  207. right: 24px;
  208. }
  209. .#{bem('progress', 'text')} {
  210. display: none;
  211. }
  212. }
  213. .#{bem('upload-list', 'item-info')} {
  214. display: inline-flex;
  215. justify-content: center;
  216. flex-direction: column;
  217. width: calc(100% - 30px);
  218. margin-left: 4px;
  219. }
  220. @include when(success) {
  221. .#{bem('upload-list', 'item-status-label')} {
  222. display: inline-flex;
  223. }
  224. .#{bem('upload-list', 'item-name')}:hover,
  225. .#{bem('upload-list', 'item-name')}:focus {
  226. color: getCssVar('color-primary');
  227. cursor: pointer;
  228. }
  229. &:focus:not(:hover) {
  230. /* 键盘focus */
  231. .#{bem('icon', '', 'close-tip')} {
  232. display: inline-block;
  233. }
  234. }
  235. &:not(.focusing):focus,
  236. &:active {
  237. /* click时 */
  238. outline-width: 0;
  239. .#{bem('icon', '', 'close-tip')} {
  240. display: none;
  241. }
  242. }
  243. &:hover,
  244. &:focus,
  245. &:focus-within {
  246. .#{bem('upload-list', 'item-status-label')} {
  247. display: none;
  248. opacity: 0;
  249. }
  250. }
  251. }
  252. }
  253. @include e(item-name) {
  254. color: getCssVar('text-color', 'regular');
  255. display: inline-flex;
  256. text-align: center;
  257. align-items: center;
  258. padding: 0 4px;
  259. transition: color getCssVar('transition-duration');
  260. font-size: getCssVar('font-size', 'base');
  261. .#{$namespace}-icon {
  262. margin-right: 6px;
  263. color: getCssVar('text-color', 'secondary');
  264. }
  265. }
  266. @include e(item-file-name) {
  267. overflow: hidden;
  268. text-overflow: ellipsis;
  269. white-space: nowrap;
  270. }
  271. @include e(item-status-label) {
  272. position: absolute;
  273. right: 5px;
  274. top: 0;
  275. line-height: inherit;
  276. display: none;
  277. height: 100%;
  278. justify-content: center;
  279. align-items: center;
  280. transition: opacity getCssVar('transition-duration');
  281. }
  282. @include e(item-delete) {
  283. position: absolute;
  284. right: 10px;
  285. top: 0;
  286. font-size: 12px;
  287. color: getCssVar('text-color', 'regular');
  288. display: none;
  289. &:hover {
  290. color: getCssVar('color-primary');
  291. }
  292. }
  293. // upload-list
  294. @include m(picture-card) {
  295. display: inline-flex;
  296. flex-wrap: wrap;
  297. margin: 0;
  298. .#{bem('upload-list', 'item')} {
  299. overflow: hidden;
  300. background-color: getCssVar('fill-color', 'blank');
  301. border: 1px solid getCssVar('border-color');
  302. border-radius: 6px;
  303. box-sizing: border-box;
  304. width: getCssVar('upload-list', 'picture-card', 'size');
  305. height: getCssVar('upload-list', 'picture-card', 'size');
  306. margin: 0 8px 8px 0;
  307. padding: 0;
  308. display: inline-flex;
  309. .#{bem('icon', '' ,'check')},
  310. .#{bem('icon', '' ,'circle-check')} {
  311. color: $color-white;
  312. }
  313. .#{bem('icon', '', 'close')} {
  314. display: none;
  315. }
  316. &:hover {
  317. .#{bem('upload-list', 'item-status-label')} {
  318. opacity: 0;
  319. // for fade out
  320. display: block;
  321. }
  322. .#{$namespace}-progress__text {
  323. display: block;
  324. }
  325. }
  326. }
  327. .#{bem('upload-list', 'item')} {
  328. .#{bem('upload-list', 'item-name')} {
  329. display: none;
  330. }
  331. }
  332. .#{bem('upload-list', 'item-thumbnail')} {
  333. width: 100%;
  334. height: 100%;
  335. object-fit: contain;
  336. }
  337. .#{bem('upload-list', 'item-status-label')} {
  338. @include upload-success();
  339. }
  340. .#{bem('upload-list', 'item-actions')} {
  341. position: absolute;
  342. width: 100%;
  343. height: 100%;
  344. left: 0;
  345. top: 0;
  346. cursor: default;
  347. display: inline-flex;
  348. justify-content: center;
  349. align-items: center;
  350. color: #fff;
  351. opacity: 0;
  352. font-size: 20px;
  353. background-color: getCssVar('overlay-color', 'lighter');
  354. transition: opacity getCssVar('transition-duration');
  355. span {
  356. display: none;
  357. cursor: pointer;
  358. }
  359. span + span {
  360. margin-left: 16px;
  361. }
  362. .#{bem('upload-list', 'item-delete')} {
  363. position: static;
  364. font-size: inherit;
  365. color: inherit;
  366. }
  367. &:hover {
  368. opacity: 1;
  369. span {
  370. display: inline-flex;
  371. }
  372. }
  373. }
  374. .#{bem('progress')} {
  375. top: 50%;
  376. left: 50%;
  377. transform: translate(-50%, -50%);
  378. bottom: auto;
  379. width: 126px;
  380. .#{$namespace}-progress__text {
  381. top: 50%;
  382. }
  383. }
  384. }
  385. @include m(picture) {
  386. .#{bem('upload-list', 'item')} {
  387. overflow: hidden;
  388. z-index: 0;
  389. background-color: getCssVar('fill-color', 'blank');
  390. border: 1px solid getCssVar('border-color');
  391. border-radius: 6px;
  392. box-sizing: border-box;
  393. margin-top: 10px;
  394. padding: 10px;
  395. display: flex;
  396. align-items: center;
  397. .#{bem('icon', '' ,'check')},
  398. .#{bem('icon', '' ,'circle-check')} {
  399. color: $color-white;
  400. }
  401. &:hover {
  402. .#{bem('upload-list', 'item-status-label')} {
  403. opacity: 0;
  404. display: inline-flex;
  405. }
  406. .#{bem('progress', 'text')} {
  407. display: block;
  408. }
  409. }
  410. &.is-success {
  411. .#{bem('upload-list', 'item-name')} {
  412. i {
  413. display: none;
  414. }
  415. }
  416. }
  417. & .#{bem('icon', '' ,'close')} {
  418. top: 5px;
  419. transform: translateY(0);
  420. }
  421. }
  422. .#{bem('upload-list', 'item-thumbnail')} {
  423. $item-thumbnail-size: 70px;
  424. display: inline-flex;
  425. justify-content: center;
  426. align-items: center;
  427. width: $item-thumbnail-size;
  428. height: $item-thumbnail-size;
  429. object-fit: contain;
  430. position: relative;
  431. z-index: 1;
  432. background-color: getCssVar('color-white');
  433. }
  434. .#{bem('upload-list', 'item-status-label')} {
  435. position: absolute;
  436. right: -17px;
  437. top: -7px;
  438. width: 46px;
  439. height: 26px;
  440. background: getCssVar('color-success');
  441. text-align: center;
  442. transform: rotate(45deg);
  443. i {
  444. font-size: 12px;
  445. margin-top: 12px;
  446. transform: rotate(-45deg);
  447. }
  448. }
  449. .#{$namespace}-progress {
  450. position: relative;
  451. top: -7px;
  452. }
  453. }
  454. }
  455. @include b(upload-cover) {
  456. position: absolute;
  457. left: 0;
  458. top: 0;
  459. width: 100%;
  460. height: 100%;
  461. overflow: hidden;
  462. z-index: 10;
  463. cursor: default;
  464. @include utils-vertical-center;
  465. img {
  466. display: block;
  467. width: 100%;
  468. height: 100%;
  469. }
  470. @include e(label) {
  471. @include upload-success(#fff);
  472. }
  473. @include e(progress) {
  474. display: inline-block;
  475. vertical-align: middle;
  476. position: static;
  477. width: 243px;
  478. + .#{bem('upload', 'inner')} {
  479. opacity: 0;
  480. }
  481. }
  482. @include e(content) {
  483. position: absolute;
  484. top: 0;
  485. left: 0;
  486. width: 100%;
  487. height: 100%;
  488. }
  489. @include e(interact) {
  490. position: absolute;
  491. bottom: 0;
  492. left: 0;
  493. width: 100%;
  494. height: 100%;
  495. background-color: getCssVar('overlay-color', 'light');
  496. text-align: center;
  497. .btn {
  498. display: inline-block;
  499. color: $color-white;
  500. font-size: 14px;
  501. cursor: pointer;
  502. vertical-align: middle;
  503. transition: getCssVar('transition-md-fade');
  504. margin-top: 60px;
  505. i {
  506. margin-top: 0;
  507. }
  508. span {
  509. opacity: 0;
  510. transition: opacity 0.15s linear;
  511. }
  512. &:not(:first-child) {
  513. margin-left: 35px;
  514. }
  515. &:hover {
  516. transform: translateY(-13px);
  517. span {
  518. opacity: 1;
  519. }
  520. }
  521. i {
  522. color: $color-white;
  523. display: block;
  524. font-size: 24px;
  525. line-height: inherit;
  526. margin: 0 auto 5px;
  527. }
  528. }
  529. }
  530. @include e(title) {
  531. position: absolute;
  532. bottom: 0;
  533. left: 0;
  534. background-color: $color-white;
  535. height: 36px;
  536. width: 100%;
  537. overflow: hidden;
  538. text-overflow: ellipsis;
  539. white-space: nowrap;
  540. font-weight: normal;
  541. text-align: left;
  542. padding: 0 10px;
  543. margin: 0;
  544. line-height: 36px;
  545. font-size: 14px;
  546. color: getCssVar('text-color', 'primary');
  547. }
  548. + .#{bem('upload', 'inner')} {
  549. opacity: 0;
  550. position: relative;
  551. z-index: 1;
  552. }
  553. }