uploadVNormalTaskPhoto.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <template>
  2. <div class="questionNamep">
  3. <!-- 0=企业微信,1=H5相机 -->
  4. <!-- 企业微信拍照 -->
  5. <div class="cameraDiv" @click="uploadImg" v-if="userInfo.photoMethod == '0'">
  6. <van-icon class="photo photos" name="plus" size="22px" color="#969696" />
  7. <span style="font-size: 10px">添加图片</span>
  8. </div>
  9. <!-- 原生自带拍照 -->
  10. <H5Camera
  11. @getImg="getImg"
  12. ref="H5Camera"
  13. :objectType="objectType"
  14. :capture="pictureSource == '1' ? '' : 'camera'"
  15. v-else />
  16. <div id="allmap"></div>
  17. <imageAIVerifyErr
  18. v-if="imageAIVerifyFlag"
  19. :imageAIVerifyFlag="imageAIVerifyFlag"
  20. :imageAIVerifyData="imageAIVerifyData"
  21. @confirmUpload="confirmUpload"
  22. @uploadImgFun="uploadImgFun"
  23. :source="'visit'"
  24. @normalFlow="normalFlow"
  25. @close="close"></imageAIVerifyErr>
  26. <!-- 图像识别白名单弹框提示 -->
  27. <imageWhiteStore
  28. v-if="imageWhiteStoreFlag"
  29. :imageWhiteStoreFlag="imageWhiteStoreFlag"
  30. :imageWhiteStoreData="imageWhiteStoreData"
  31. @normalFlow="normalFlow"
  32. @close="close">
  33. </imageWhiteStore>
  34. <!-- 上传动画 -->
  35. <div class="uploadImgDemoMask" v-show="uploadImgFlag">
  36. <div class="uploadImgDemo">
  37. <div class="ring-area" id="d2area">
  38. <div class="ring-wrap">
  39. <svg width="90" height="90" viewBox="0 0 90 90">
  40. <circle class="ring-bg" cx="45" cy="45" r="40" />
  41. <circle class="ring-progress" id="d2ring" cx="45" cy="45" r="40" />
  42. </svg>
  43. <div class="ring-text">
  44. <span class="ring-pct" id="d2pct">0%</span>
  45. <span class="ring-sub" id="d2sub">上传中</span>
  46. </div>
  47. </div>
  48. <div class="ring-info">
  49. <div class="ring-filename" id="d2name">-</div>
  50. <div class="ring-list" id="d2dots"></div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. import { addPhotoBatch, addVisitsPosition, addPhotoToDB } from '@/api/index';
  59. import imageAIVerifyErr from './imageAIVerifyErr';
  60. import imageWhiteStore from './imageWhiteStore';
  61. import H5Camera from '@/components/H5Camera';
  62. import axios from 'axios';
  63. import uploadAliOss from '@/utils/uploadAliOss';
  64. import { addH5Photo } from '@/api/H5Camera';
  65. import { mapState } from 'vuex';
  66. export default {
  67. name: 'uploadImg',
  68. components: { imageAIVerifyErr, H5Camera, imageWhiteStore },
  69. props: {
  70. storeGroupId: {
  71. type: String,
  72. default: '',
  73. },
  74. visitsId: {
  75. type: String,
  76. default: '',
  77. },
  78. taskList: {
  79. type: Array,
  80. default() {
  81. return [];
  82. },
  83. },
  84. objectType: {
  85. type: String,
  86. default: '',
  87. },
  88. putInCode: {
  89. type: String,
  90. default: '',
  91. },
  92. photoIdentifyType: {
  93. // 图匠识别目的(1:店招内容识别(不能连拍和多选),3:调色机识别(不能连拍和多选),6:陈列SKU图片识别(不需要图匠实时识别))
  94. type: String,
  95. default: '',
  96. },
  97. pictureSource: {
  98. // 是否允许从相册选择图片 1:允许;0:不允许
  99. type: String,
  100. default: '0',
  101. },
  102. continuousShoot: {
  103. // 是否允许连拍/相册多选 1:允许;0:不允许
  104. type: String,
  105. default: '0',
  106. },
  107. collectionItemId: {
  108. type: [String, Number],
  109. default: '',
  110. },
  111. formData: {
  112. type: Object,
  113. default() {
  114. return {};
  115. },
  116. },
  117. },
  118. computed: {
  119. ...mapState({
  120. userInfo: (state) => state.user.userInfo,
  121. }),
  122. },
  123. data() {
  124. return {
  125. shows: false,
  126. url: '',
  127. imageAIVerifyFlag: false,
  128. imageAIVerifyData: null, //图匠校验返回的数据
  129. mediaId: '', //当前上传图片id
  130. addressesRemark: '', //当前位置信息
  131. controller: null, //取消请求状态
  132. fileUrl: '',
  133. imageWhiteStoreData: null,
  134. imageWhiteStoreFlag: false,
  135. localIdsArr: [],
  136. uploadImgFlag: false, //上传图片中
  137. uploadImgTotal: 0, // 上传图片总数
  138. d2running: false,
  139. d2count: 0,
  140. d2timer: null,
  141. };
  142. },
  143. methods: {
  144. // 原生H5拍照图片
  145. // url: base64
  146. getImg(base64) {
  147. // 图片名称:用户名-时间戳
  148. let username = localStorage.getItem('loginName');
  149. let imgName = username + '-' + new Date().getTime();
  150. uploadAliOss(base64, imgName)
  151. .then((res) => {
  152. if (res.url && res.url.indexOf('http') != -1) {
  153. this.fileUrl = res.url;
  154. this.uploadImagev();
  155. }
  156. })
  157. .catch((err) => {
  158. console.log('err:' + err);
  159. });
  160. },
  161. uploadImgFun() {
  162. // 0=企业微信,1=H5相机
  163. if (this.userInfo.photoMethod == '0') {
  164. this.uploadImg();
  165. } else {
  166. this.$refs.H5Camera.camera();
  167. }
  168. },
  169. uploadImg() {
  170. var map = new TMap.Map('allmap', {
  171. zoom: 14,
  172. center: new TMap.LatLng(39.986785, 116.301012),
  173. });
  174. var geocoder = new TMap.service.Geocoder(); // 新建一个正逆地址解析类
  175. var markers = new TMap.MultiMarker({
  176. map: map,
  177. geometries: [],
  178. });
  179. markers.setGeometries([]);
  180. let url = window.location.href;
  181. let that = this;
  182. let wx = this.wx;
  183. let qiyeData;
  184. this.addressesRemark = '';
  185. const instance = axios.create();
  186. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  187. instance
  188. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  189. params: {
  190. url: url,
  191. },
  192. })
  193. .then((response) => {
  194. if (response.status == 200) {
  195. qiyeData = response.data.data;
  196. wx.config({
  197. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  198. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  199. appId: qiyeData.appId, // 必填,企业微信的corpID
  200. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  201. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  202. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  203. jsApiList: ['ready', 'chooseImage', 'uploadImage', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  204. });
  205. wx.ready(function () {
  206. wx.getLocation({
  207. type: 'gcj02',
  208. success: function (res) {
  209. var location = new TMap.LatLng(res.latitude, res.longitude);
  210. map.setCenter(location);
  211. markers.updateGeometries([
  212. {
  213. id: 'main', // 点标注数据数组
  214. position: location,
  215. },
  216. ]);
  217. geocoder.getAddress({ location: location }).then(
  218. function (result) {
  219. var addresses = result.result.formatted_addresses;
  220. that.addressesRemark = addresses.recommend;
  221. },
  222. function (err) {
  223. that.addressesRemark = '';
  224. },
  225. );
  226. },
  227. fail: function () {
  228. that.$dialog.alert({
  229. message: 'GPS未开启',
  230. });
  231. },
  232. });
  233. console.log(that.pictureSource);
  234. let sourceType = that.pictureSource == '1' ? ['album', 'camera'] : ['camera'];
  235. let count = 1;
  236. // 1:店招内容识别(不能连拍和多选),3:调色机识别(不能连拍和多选) 需要实时识别的不支持连拍和多选
  237. if (that.photoIdentifyType != 1 && that.photoIdentifyType != 3) {
  238. count = that.continuousShoot == '1' ? 20 : 1; //是否允许连拍/相册多选 最多5张
  239. }
  240. wx.chooseImage({
  241. count: count,
  242. sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
  243. sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
  244. defaultCameraMode: count == 1 ? 'normal' : 'batch', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
  245. // defaultCameraMode: 'normal', //表示进入拍照界面的默认模式,目前有normal与batch两种选择,normal表示普通单拍模式,batch表示连拍模式,不传该参数则为normal模式。从3.0.26版本开始支持front和batch_front两种值,其中front表示默认为前置摄像头单拍模式,batch_front表示默认为前置摄像头连拍模式。(注:用户进入拍照界面仍然可自由切换两种模式)
  246. isSaveToAlbum: 0, //整型值,0表示拍照时不保存到系统相册,1表示自动保存,默认值是1
  247. success: function (res) {
  248. let localIds = res.localIds;
  249. that.localIdsArr = [];
  250. // that.$emit('newimgarr', {
  251. // localIds: localIds,
  252. // locationRemark: that.addressesRemark,
  253. // collectionItemId: that.collectionItemId,
  254. // source: 'weixin',
  255. // });
  256. that.uploadImgFlag = true;
  257. that.uploadImgTotal = localIds.length;
  258. that.startDemo2();
  259. that.syncUpload(localIds);
  260. },
  261. });
  262. });
  263. }
  264. });
  265. },
  266. syncUpload(localIds) {
  267. if (!localIds.length) {
  268. this.uploadImagev();
  269. } else {
  270. var localId = localIds.pop();
  271. wx.uploadImage({
  272. localId: localId,
  273. isShowProgressTips: 1, // 默认为1,显示进度提示
  274. success: (res) => {
  275. this.localIdsArr.push(res.serverId);
  276. this.syncUpload(localIds);
  277. },
  278. });
  279. }
  280. },
  281. uploadImagev() {
  282. this.close();
  283. var that = this;
  284. var form = {
  285. mediaIds: [], // 是 List<String> 图片素材id集合
  286. visitSource: '1', // 是 Long 拜访模式
  287. storeGroupId: that.storeGroupId, // 是 string 门店任务组,多个用逗号隔开
  288. visitsId: that.visitsId, // 是 string 拜访id
  289. taskList: that.taskList, // 是 List 任务id数组
  290. collectionItemId: that.collectionItemId, // 是 string 采集项id
  291. objectType: that.objectType, // 是 string 照片类型,取任务上的照片类型,如果没有则取手动选择的照片类型
  292. locationRemark: that.addressesRemark, // 是 String 当前地址信息
  293. firstCollectionId: '', // 否 Long 第一级采集项id,取当前采集项的字段就行
  294. secondCollectionId: '', // 否 Long 第二级采集项id,取当前采集项的字段就行
  295. putInCode: that.putInCode, //投放编号
  296. deviceCode: '', // 否 String 当前任务对应的设备编号
  297. photoIdentifyType: that.photoIdentifyType, // 否 String 图片识别类型:字典-photo_identify_type
  298. equipmentCode: '', // 否 String 当前任务对应的资产编号
  299. inStore: '否', // 否 String 机器是否在店:传选项中文内容,是、否
  300. };
  301. // 0=企业微信,1=H5相机
  302. if (this.userInfo.photoMethod == '0') {
  303. form.mediaIds = this.localIdsArr; // string 图片素材id
  304. } else {
  305. form.fileUrl = this.fileUrl; // string 图片素材id
  306. }
  307. this.controller = null;
  308. // 需要图匠校验的添加参数和loading
  309. if (
  310. this.photoIdentifyType &&
  311. (this.photoIdentifyType == '1' || this.photoIdentifyType == '3')
  312. ) {
  313. form.photoIdentifyType = this.photoIdentifyType;
  314. this.controller = new AbortController(); //取消请求
  315. } else {
  316. this.toastLoading(0, '上传中...', true);
  317. }
  318. addPhotoBatch(form, this.controller ? this.controller.signal : null)
  319. .then((res) => {
  320. this.requestThen(res);
  321. })
  322. .catch((error) => {
  323. this.requestCatch(error);
  324. });
  325. },
  326. // 公用请求then
  327. requestThen(res) {
  328. this.toastLoading().clear();
  329. if (res.code == -1) {
  330. // 图匠图片校验接口超时
  331. this.requestTimeOut(res);
  332. } else if (res.code == 200) {
  333. // 图匠校验结果返回
  334. if (
  335. this.photoIdentifyType &&
  336. (this.photoIdentifyType == '1' || this.photoIdentifyType == '3')
  337. ) {
  338. this.imageAIVerifyFlag = true;
  339. this.imageAIVerifyData = res.data[0];
  340. } else {
  341. // 正常流程
  342. // 图像识别白名单用户弹出框提示
  343. if (res.data[0].whiteStore) {
  344. this.imageWhiteStoreFlag = true;
  345. this.imageWhiteStoreData = res.data[0];
  346. } else {
  347. this.normalFlow(res);
  348. }
  349. }
  350. } else {
  351. that.$toast('上传失败!');
  352. }
  353. },
  354. // 公用请求catch
  355. requestCatch(error) {
  356. if (error.message === 'canceled') {
  357. this.$toast('取消上传');
  358. console.log('请求被取消:', error.message);
  359. }
  360. },
  361. // 正常流程
  362. normalFlow(res) {
  363. this.runD2(100);
  364. this.$nextTick(() => {
  365. clearTimeout(this.d2timer);
  366. this.uploadImgFlag = false;
  367. this.$toast('上传成功!');
  368. let fileInfoList = [];
  369. res.data.forEach((val) => {
  370. fileInfoList.push({
  371. fileUrl: val.url,
  372. id: val.fileId,
  373. type: 2,
  374. });
  375. });
  376. this.$emit('newimgarr', {
  377. fileInfoList: fileInfoList,
  378. photoIdentifyType: this.photoIdentifyType,
  379. source: 'H5',
  380. });
  381. });
  382. },
  383. // 照片是否入库,1.照片识别三次不通过仍要上传,2.照片识别通过
  384. // isUpdate:是否更新店招照片,只有门店店招需要更新
  385. confirmUpload(res) {
  386. if (
  387. this.photoIdentifyType &&
  388. (this.photoIdentifyType != '6' || this.photoIdentifyType != '7')
  389. ) {
  390. var form = {
  391. mediaIds: [], // 是 List<String> 图片素材id集合
  392. visitSource: '1', // 是 Long 拜访模式
  393. storeGroupId: this.storeGroupId, // 是 string 门店任务组,多个用逗号隔开
  394. visitsId: that.visitsId, // 是 string 拜访id
  395. taskList: this.taskList, // 是 List 任务id数组
  396. collectionItemId: that.collectionItemId, // 是 string 采集项id
  397. objectType: that.objectType, // 是 string 照片类型,取任务上的照片类型,如果没有则取手动选择的照片类型
  398. locationRemark: this.addressesRemark, // 是 String 当前地址信息
  399. firstCollectionId: '', // 否 Long 第一级采集项id,取当前采集项的字段就行
  400. secondCollectionId: '', // 否 Long 第二级采集项id,取当前采集项的字段就行
  401. putInCode: that.putInCode, //投放编号
  402. deviceCode: '', // 否 String 当前任务对应的设备编号
  403. photoIdentifyType: that.photoIdentifyType, // 否 String 图片识别类型:字典-photo_identify_type
  404. equipmentCode: '', // 否 String 当前任务对应的资产编号
  405. inStore: '否', // 否 String 机器是否在店:传选项中文内容,是、否
  406. };
  407. // 0=企业微信,1=H5相机
  408. if (this.userInfo.photoMethod == '0') {
  409. form.mediaIds = this.localIdsArr; // string 图片素材id
  410. } else {
  411. form.fileUrl = this.fileUrl; // string 图片素材id
  412. }
  413. if (res.isUpdate) {
  414. form.isUpdate = 'true';
  415. }
  416. addPhotoToDB(form).then((resData) => {
  417. if (resData.code == 200) {
  418. console.log(resData);
  419. res.data.fileId = resData.data[0].fileId;
  420. res.data = [res.data];
  421. this.normalFlow(res);
  422. }
  423. });
  424. }
  425. },
  426. close() {
  427. this.imageAIVerifyFlag = false;
  428. this.imageWhiteStoreFlag = false;
  429. },
  430. requestTimeOut(res) {
  431. this.close();
  432. this.$dialog
  433. .confirm({
  434. title: '系统提示',
  435. message: res.msg,
  436. showCancelButton: false,
  437. })
  438. .then(() => {
  439. this.confirmUpload(res);
  440. });
  441. },
  442. // ===== Demo 2 =====
  443. startDemo2() {
  444. if (this.d2running) return;
  445. this.d2running = true;
  446. this.d2count = 0;
  447. const area = document.getElementById('d2area');
  448. area.style.display = 'flex';
  449. const dots = document.getElementById('d2dots');
  450. dots.innerHTML = '';
  451. for (let i = 0; i < this.uploadImgDemo; i++) {
  452. const d = document.createElement('div');
  453. d.className = 'ring-dot';
  454. d.id = `dot${i}`;
  455. dots.appendChild(d);
  456. }
  457. this.runD2(1000);
  458. },
  459. runD2(delay) {
  460. // this.NAMES = Array.from(
  461. // { length: this.uploadImgDemo },
  462. // (_, i) => `IMG_${String(2001 + i).padStart(4, '0')}.jpg`,
  463. // );
  464. if (this.d2count >= this.uploadImgDemo) {
  465. document.getElementById('d2sub').textContent = '完成';
  466. document.getElementById('d2name').textContent = '全部上传成功 ✅';
  467. return;
  468. }
  469. if (this.uploadImgDemo >= 2) {
  470. this.d2timer = setTimeout(() => {
  471. if (this.d2count > 0)
  472. document.getElementById(`dot${this.d2count - 1}`).className = 'ring-dot done';
  473. document.getElementById(`dot${this.d2count}`).className = 'ring-dot active';
  474. document.getElementById('d2name').textContent = '正在上传。。。';
  475. this.d2count++;
  476. const pct = Math.round((this.d2count / this.uploadImgDemo) * 100);
  477. document.getElementById('d2pct').textContent = pct + '%';
  478. const offset = 251.2 * (1 - this.d2count / this.uploadImgDemo);
  479. document.getElementById('d2ring').style.strokeDashoffset = offset;
  480. document.getElementById('d2sub').textContent = `${this.d2count}/${this.uploadImgDemo}`;
  481. if (this.d2count >= this.uploadImgDemo * 0.7) {
  482. clearTimeout(this.d2timer);
  483. }
  484. this.runD2();
  485. }, delay);
  486. } else {
  487. document.getElementById(`dot${this.d2count - 1}`).className = 'ring-dot done';
  488. document.getElementById(`dot${this.d2count}`).className = 'ring-dot active';
  489. document.getElementById('d2name').textContent = '正在上传。。。';
  490. document.getElementById('d2pct').textContent = '30%';
  491. document.getElementById('d2ring').style.strokeDashoffset = 30;
  492. document.getElementById('d2sub').textContent = `0/${this.uploadImgDemo}`;
  493. }
  494. },
  495. },
  496. };
  497. </script>
  498. <style lang="scss" scoped>
  499. .questionNamep {
  500. font-size: 16px;
  501. color: #484848;
  502. box-sizing: border-box;
  503. position: relative;
  504. .cameraDiv {
  505. flex: 1;
  506. display: flex;
  507. flex-direction: column;
  508. align-items: center;
  509. justify-content: center;
  510. .photo {
  511. /*margin-top: 9px;*/
  512. float: right;
  513. }
  514. .camera {
  515. width: 60px;
  516. height: 100%;
  517. position: absolute;
  518. right: 0;
  519. top: 0;
  520. opacity: 0;
  521. z-index: 89;
  522. }
  523. }
  524. }
  525. #allmap {
  526. width: 10px;
  527. height: 10px;
  528. left: -1000px;
  529. position: absolute;
  530. }
  531. </style>
  532. <style lang="scss">
  533. /* ===== 样例2:圆形进度环 ===== */
  534. .uploadImgDemoMask {
  535. position: fixed;
  536. inset: 0;
  537. background: rgba(0, 0, 0, 0.3);
  538. z-index: 9998;
  539. }
  540. .uploadImgDemo {
  541. width: 90%;
  542. height: 200px;
  543. position: fixed;
  544. top: 50%;
  545. left: 50%;
  546. transform: translate(-50%, -50%);
  547. z-index: 9999;
  548. background: #fff;
  549. }
  550. .uploadImgDemo .ring-area {
  551. display: none;
  552. margin-top: 16px;
  553. align-items: center;
  554. gap: 20px;
  555. }
  556. .uploadImgDemo .ring-wrap {
  557. position: relative;
  558. width: 90px;
  559. height: 90px;
  560. flex-shrink: 0;
  561. }
  562. .uploadImgDemo .ring-wrap svg {
  563. transform: rotate(-90deg);
  564. }
  565. .uploadImgDemo .ring-bg {
  566. fill: none;
  567. stroke: #e0f7f4;
  568. stroke-width: 8;
  569. }
  570. .uploadImgDemo .ring-progress {
  571. fill: none;
  572. stroke: url(#greenGrad);
  573. stroke-width: 8;
  574. stroke-linecap: round;
  575. stroke-dasharray: 251.2;
  576. stroke-dashoffset: 251.2;
  577. transition: stroke-dashoffset 0.35s ease;
  578. }
  579. .uploadImgDemo .ring-text {
  580. position: absolute;
  581. inset: 0;
  582. display: flex;
  583. flex-direction: column;
  584. align-items: center;
  585. justify-content: center;
  586. }
  587. .uploadImgDemo .ring-pct {
  588. font-size: 18px;
  589. font-weight: 700;
  590. color: #11998e;
  591. }
  592. .uploadImgDemo .ring-sub {
  593. font-size: 10px;
  594. color: #aaa;
  595. }
  596. .uploadImgDemo .ring-info {
  597. flex: 1;
  598. }
  599. .uploadImgDemo .ring-filename {
  600. font-size: 13px;
  601. font-weight: 500;
  602. color: #333;
  603. margin-bottom: 6px;
  604. white-space: nowrap;
  605. overflow: hidden;
  606. text-overflow: ellipsis;
  607. max-width: 160px;
  608. }
  609. .uploadImgDemo .ring-list {
  610. display: flex;
  611. flex-wrap: wrap;
  612. gap: 4px;
  613. margin-top: 8px;
  614. }
  615. .uploadImgDemo .ring-dot {
  616. width: 10px;
  617. height: 10px;
  618. border-radius: 50%;
  619. background: #e0e0e0;
  620. transition: background 0.3s;
  621. }
  622. .uploadImgDemo .ring-dot.done {
  623. background: #11998e;
  624. }
  625. .uploadImgDemo .ring-dot.active {
  626. background: #38ef7d;
  627. animation: pulse2 0.8s infinite;
  628. }
  629. @keyframes pulse2 {
  630. 0%,
  631. 100% {
  632. transform: scale(1);
  633. }
  634. 50% {
  635. transform: scale(1.4);
  636. }
  637. }
  638. </style>