foodBusinessLicense.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  1. <template>
  2. <div class="card content-box">
  3. <div class="content-section">
  4. <div class="tip-text">
  5. 如需变更请在此处上传,重新上传之后需要重新进行审核,审核通过后,新的食品经营许可证将会覆盖之前的食品经营许可证
  6. </div>
  7. <div class="action-buttons">
  8. <el-button type="primary" @click="handleReplace"> 更换 </el-button>
  9. <el-button type="primary" @click="handleViewChangeRecord"> 查看变更记录 </el-button>
  10. </div>
  11. </div>
  12. <div class="license-container" v-if="licenseImage">
  13. <div class="license-display">
  14. <el-image :src="licenseImage" fit="contain" class="license-image" :preview-src-list="[licenseImage]" />
  15. </div>
  16. </div>
  17. <div v-else class="empty-license">
  18. <el-empty description="暂无食品经营许可证" :image-size="100" />
  19. </div>
  20. <!-- 更换食品经营许可证弹窗 -->
  21. <el-dialog
  22. v-model="replaceDialogVisible"
  23. title="更换食品经营许可证"
  24. width="600px"
  25. :before-close="handleReplaceDialogClose"
  26. :close-on-click-modal="false"
  27. :close-on-press-escape="false"
  28. >
  29. <div class="replace-upload-area" :class="{ 'upload-full': uploadedImageCount >= 1 }">
  30. <div class="upload-tip">只允许上传jpg,jpeg,png格式图片;上传图片不得超过20M</div>
  31. <el-upload
  32. v-model:file-list="fileList"
  33. list-type="picture-card"
  34. :accept="'.jpg,.jpeg,.png'"
  35. :limit="1"
  36. :auto-upload="false"
  37. :disabled="hasUnuploadedImages"
  38. :on-change="handleUploadChange"
  39. :on-exceed="handleUploadExceed"
  40. :on-preview="handlePictureCardPreview"
  41. :before-remove="handleBeforeRemove"
  42. :on-remove="handleRemove"
  43. :show-file-list="true"
  44. >
  45. <template #trigger>
  46. <div v-if="uploadedImageCount < 1" class="upload-trigger-card el-upload--picture-card">
  47. <el-icon>
  48. <Plus />
  49. </el-icon>
  50. <div class="upload-tip">({{ uploadedImageCount }}/1)</div>
  51. </div>
  52. </template>
  53. </el-upload>
  54. </div>
  55. <template #footer>
  56. <div class="dialog-footer">
  57. <el-button @click="handleCancelReplace" :disabled="hasUnuploadedImages"> 取消 </el-button>
  58. <el-button type="primary" @click="handleSubmitReplace" :disabled="hasUnuploadedImages"> 去审核 </el-button>
  59. </div>
  60. </template>
  61. </el-dialog>
  62. <!-- 图片预览 -->
  63. <el-image-viewer
  64. v-if="imageViewerVisible"
  65. :url-list="imageViewerUrlList"
  66. :initial-index="imageViewerInitialIndex"
  67. @close="imageViewerVisible = false"
  68. />
  69. <!-- 变更记录弹窗 -->
  70. <el-dialog v-model="changeRecordDialogVisible" title="变更记录" width="900px" :close-on-click-modal="false">
  71. <el-scrollbar height="400px" class="change-record-scrollbar">
  72. <div v-if="changeRecordList && changeRecordList.length > 0" class="change-record-content">
  73. <div v-for="(item, index) in changeRecordList" :key="index" class="record-group">
  74. <div class="record-date">
  75. {{ item.createdDateFormat }}
  76. </div>
  77. <div class="record-items">
  78. <div class="record-item">
  79. <div class="record-status-badge" :class="getStatusClass(item.licenseExecuteStatus)">
  80. {{ item.licenseExecuteName }}
  81. </div>
  82. <el-image
  83. :src="item.imgUrl"
  84. fit="cover"
  85. class="record-image"
  86. :preview-src-list="changeRecordList.map(record => record.imgUrl)"
  87. :initial-index="index"
  88. >
  89. <template #error>
  90. <div class="image-slot">
  91. <el-icon><Picture /></el-icon>
  92. </div>
  93. </template>
  94. </el-image>
  95. </div>
  96. </div>
  97. <div v-if="item.reasonRefusal" class="rejection-reason">拒绝原因: {{ item.reasonRefusal }}</div>
  98. </div>
  99. </div>
  100. <div v-else class="empty-record">
  101. <el-empty description="暂无变更记录" :image-size="100" />
  102. </div>
  103. </el-scrollbar>
  104. <template #footer>
  105. <div class="dialog-footer">
  106. <el-button type="primary" @click="changeRecordDialogVisible = false"> 关闭 </el-button>
  107. </div>
  108. </template>
  109. </el-dialog>
  110. </div>
  111. </template>
  112. <script setup lang="ts" name="foodBusinessLicense">
  113. import { ref, computed, onMounted } from "vue";
  114. import { ElMessage, ElMessageBox } from "element-plus";
  115. import { Picture, Plus } from "@element-plus/icons-vue";
  116. import type { UploadProps, UploadFile } from "element-plus";
  117. import {
  118. getFoodBusinessLicense,
  119. uploadContractImage,
  120. submitFoodLicenseReview,
  121. getChangeRecords,
  122. getStoreFoodLicenceStatus
  123. } from "@/api/modules/licenseManagement";
  124. import { localGet } from "@/utils";
  125. // 状态映射对象
  126. const statusMap: Record<number, { name: string; class: string }> = {
  127. 1: { name: "审核通过", class: "status-success" },
  128. 2: { name: "审核中", class: "status-pending" },
  129. 3: { name: "审核拒绝", class: "status-failed" }
  130. };
  131. const id = localGet("createdId");
  132. const licenseImage = ref<string>("");
  133. const replaceDialogVisible = ref(false);
  134. const changeRecordDialogVisible = ref(false);
  135. const fileList = ref<UploadFile[]>([]);
  136. const changeRecordList = ref<any>([]);
  137. // ==================== 图片上传相关变量 ====================
  138. const uploading = ref(false);
  139. const pendingUploadFiles = ref<UploadFile[]>([]);
  140. const imageUrlList = ref<string[]>([]); // 存储图片URL列表
  141. // 图片预览相关
  142. const imageViewerVisible = ref(false);
  143. const imageViewerUrlList = ref<string[]>([]);
  144. const imageViewerInitialIndex = ref(0);
  145. // 计算属性:获取已成功上传的图片数量
  146. const uploadedImageCount = computed(() => {
  147. return fileList.value.filter((file: any) => file.status === "success" && file.url).length;
  148. });
  149. // 计算属性:检查是否有未上传完成的图片
  150. const hasUnuploadedImages = computed(() => {
  151. // 检查是否有正在上传的文件
  152. if (uploading.value || pendingUploadFiles.value.length > 0) {
  153. return true;
  154. }
  155. // 检查文件列表中是否有状态为 "ready"(待上传)或 "uploading"(上传中)的图片
  156. if (fileList.value && fileList.value.length > 0) {
  157. return fileList.value.some((file: any) => {
  158. return file.status === "ready" || file.status === "uploading";
  159. });
  160. }
  161. return false;
  162. });
  163. onMounted(async () => {
  164. await initData();
  165. });
  166. const initData = async () => {
  167. const params = {
  168. id: id
  169. };
  170. const res: any = await getFoodBusinessLicense(params);
  171. if (res.code === 200) {
  172. licenseImage.value = res.data[0].imgUrl;
  173. }
  174. };
  175. const handleReplace = async () => {
  176. fileList.value = [];
  177. imageUrlList.value = [];
  178. pendingUploadFiles.value = [];
  179. uploading.value = false;
  180. const params = {
  181. id: localGet("createdId")
  182. };
  183. const res: any = await getStoreFoodLicenceStatus(params);
  184. if (res.data.foodLicenceStatus === 2) {
  185. ElMessage.warning("食品经营许可证审核中,请耐心等待");
  186. } else {
  187. replaceDialogVisible.value = true;
  188. }
  189. };
  190. const handleViewChangeRecord = async () => {
  191. try {
  192. const params = {
  193. storeId: localGet("createdId")
  194. };
  195. const res: any = await getChangeRecords(params);
  196. if (res.code === 200) {
  197. changeRecordList.value = res.data;
  198. } else {
  199. // 请求失败时清空数据
  200. changeRecordList.value = [];
  201. }
  202. changeRecordDialogVisible.value = true;
  203. } catch (error) {
  204. ElMessage.error("获取变更记录失败");
  205. // 发生错误时清空数据并显示空状态
  206. changeRecordList.value = [];
  207. changeRecordDialogVisible.value = true;
  208. }
  209. };
  210. /**
  211. * 检查文件是否在排队中(未上传)
  212. * @param file 文件对象
  213. * @returns 是否在排队中
  214. */
  215. const isFilePending = (file: any): boolean => {
  216. // 只检查 ready 状态(排队中),不包括 uploading(正在上传)
  217. if (file.status === "ready") {
  218. return true;
  219. }
  220. // 检查是否在待上传队列中
  221. if (pendingUploadFiles.value.some(item => item.uid === file.uid)) {
  222. return true;
  223. }
  224. return false;
  225. };
  226. /**
  227. * 图片上传 - 删除前确认
  228. * @param uploadFile 要删除的文件对象
  229. * @param uploadFiles 当前文件列表
  230. * @returns Promise<boolean>,true 允许删除,false 阻止删除
  231. */
  232. const handleBeforeRemove = async (uploadFile: any, uploadFiles: any[]): Promise<boolean> => {
  233. // 如果文件在排队中(未上传),禁止删除
  234. if (isFilePending(uploadFile)) {
  235. ElMessage.warning("图片尚未上传,请等待上传完成后再删除");
  236. return false;
  237. }
  238. try {
  239. await ElMessageBox.confirm("确定要删除这张图片吗?", "提示", {
  240. confirmButtonText: "确定",
  241. cancelButtonText: "取消",
  242. type: "warning"
  243. });
  244. // 用户确认删除,返回 true 允许删除
  245. return true;
  246. } catch {
  247. // 用户取消删除,返回 false 阻止删除
  248. return false;
  249. }
  250. };
  251. /**
  252. * 图片上传 - 移除图片回调(删除成功后调用)
  253. * @param uploadFile 已删除的文件对象
  254. * @param uploadFiles 删除后的文件列表
  255. */
  256. const handleRemove: UploadProps["onRemove"] = (uploadFile, uploadFiles) => {
  257. // 从被删除的文件对象中获取 url
  258. const file = uploadFile as any;
  259. const imageUrl = file.url;
  260. if (imageUrl) {
  261. // 从 imageUrl 数组中删除对应的 URL
  262. const urlIndex = imageUrlList.value.indexOf(imageUrl);
  263. if (urlIndex > -1) {
  264. imageUrlList.value.splice(urlIndex, 1);
  265. }
  266. }
  267. if (file.url && file.url.startsWith("blob:")) {
  268. URL.revokeObjectURL(file.url);
  269. }
  270. // 同步文件列表
  271. fileList.value = [...uploadFiles];
  272. // 删除成功后提示
  273. ElMessage.success("图片已删除");
  274. };
  275. /**
  276. * 上传文件超出限制提示
  277. */
  278. const handleUploadExceed: UploadProps["onExceed"] = () => {
  279. ElMessage.warning("最多只能上传1张图片");
  280. };
  281. /**
  282. * el-upload 文件变更(选中或移除)
  283. */
  284. const handleUploadChange: UploadProps["onChange"] = async (uploadFile, uploadFiles) => {
  285. // 检查文件类型,只允许 jpg 和 png
  286. if (uploadFile.raw) {
  287. const fileType = uploadFile.raw.type.toLowerCase();
  288. const fileName = uploadFile.name.toLowerCase();
  289. const validTypes = ["image/jpeg", "image/jpg", "image/png"];
  290. const validExtensions = [".jpg", ".jpeg", ".png"];
  291. // 检查 MIME 类型或文件扩展名
  292. const isValidType = validTypes.includes(fileType) || validExtensions.some(ext => fileName.endsWith(ext));
  293. if (!isValidType) {
  294. // 从文件列表中移除不符合类型的文件
  295. const index = fileList.value.findIndex((f: any) => f.uid === uploadFile.uid);
  296. if (index > -1) {
  297. fileList.value.splice(index, 1);
  298. }
  299. // 从 uploadFiles 中移除
  300. const uploadIndex = uploadFiles.findIndex((f: any) => f.uid === uploadFile.uid);
  301. if (uploadIndex > -1) {
  302. uploadFiles.splice(uploadIndex, 1);
  303. }
  304. // 如果文件有 blob URL,释放它
  305. if (uploadFile.url && uploadFile.url.startsWith("blob:")) {
  306. URL.revokeObjectURL(uploadFile.url);
  307. }
  308. ElMessage.warning("只支持上传 JPG、JPEG 和 PNG 格式的图片");
  309. return;
  310. }
  311. // 检查文件大小,不得超过20M
  312. const maxSize = 20 * 1024 * 1024; // 20MB
  313. if (uploadFile.raw.size > maxSize) {
  314. // 从文件列表中移除超过大小的文件
  315. const index = fileList.value.findIndex((f: any) => f.uid === uploadFile.uid);
  316. if (index > -1) {
  317. fileList.value.splice(index, 1);
  318. }
  319. // 从 uploadFiles 中移除
  320. const uploadIndex = uploadFiles.findIndex((f: any) => f.uid === uploadFile.uid);
  321. if (uploadIndex > -1) {
  322. uploadFiles.splice(uploadIndex, 1);
  323. }
  324. // 如果文件有 blob URL,释放它
  325. if (uploadFile.url && uploadFile.url.startsWith("blob:")) {
  326. URL.revokeObjectURL(uploadFile.url);
  327. }
  328. ElMessage.warning("上传图片不得超过20M");
  329. return;
  330. }
  331. }
  332. // 同步文件列表到表单数据(只添加通过验证的文件)
  333. const existingIndex = fileList.value.findIndex((f: any) => f.uid === uploadFile.uid);
  334. if (existingIndex === -1) {
  335. fileList.value.push(uploadFile);
  336. }
  337. const readyFiles = fileList.value.filter(file => file.status === "ready");
  338. if (readyFiles.length) {
  339. readyFiles.forEach(file => {
  340. if (!pendingUploadFiles.value.some(item => item.uid === file.uid)) {
  341. pendingUploadFiles.value.push(file);
  342. }
  343. });
  344. }
  345. processUploadQueue();
  346. };
  347. /**
  348. * 处理上传队列 - 逐个上传文件
  349. */
  350. const processUploadQueue = async () => {
  351. if (uploading.value || pendingUploadFiles.value.length === 0) {
  352. return;
  353. }
  354. // 每次只取一个文件进行上传
  355. const file = pendingUploadFiles.value.shift();
  356. if (file) {
  357. await uploadSingleFile(file);
  358. // 继续处理队列中的下一个文件
  359. processUploadQueue();
  360. }
  361. };
  362. /**
  363. * 单文件上传图片
  364. * @param file 待上传的文件
  365. */
  366. const uploadSingleFile = async (file: UploadFile) => {
  367. if (!file.raw) {
  368. return;
  369. }
  370. const rawFile = file.raw as File;
  371. const formData = new FormData();
  372. formData.append("file", rawFile);
  373. formData.append("user", "text");
  374. file.status = "uploading";
  375. file.percentage = 0;
  376. uploading.value = true;
  377. try {
  378. // 上传过程中保持进度为 0,避免接口异常时进度条误显示 100%
  379. const result: any = await uploadContractImage(formData);
  380. if (result?.code === 200 && result.data) {
  381. // 处理单个文件的上传结果
  382. let imageUrl = result.data[0];
  383. if (!imageUrl) {
  384. throw new Error("上传成功但未获取到图片URL");
  385. }
  386. file.status = "success";
  387. file.percentage = 100;
  388. // 保存图片URL到文件对象
  389. file.url = imageUrl;
  390. file.response = { url: imageUrl };
  391. // 保存图片URL
  392. if (!Array.isArray(imageUrlList.value)) {
  393. imageUrlList.value = [];
  394. }
  395. if (!imageUrlList.value.includes(imageUrl)) {
  396. imageUrlList.value.push(imageUrl);
  397. }
  398. } else {
  399. throw new Error(result?.msg || "图片上传失败");
  400. }
  401. } catch (error: any) {
  402. file.status = "fail";
  403. // 上传失败时保持进度条为 0
  404. file.percentage = 0;
  405. if (file.url && file.url.startsWith("blob:")) {
  406. URL.revokeObjectURL(file.url);
  407. }
  408. // 从文件列表中移除失败的文件
  409. const index = fileList.value.findIndex((f: any) => f.uid === file.uid);
  410. if (index > -1) {
  411. fileList.value.splice(index, 1);
  412. }
  413. // Error message handled by global upload method, except for specific business logic errors
  414. if (error?.message && error.message.includes("未获取到图片URL")) {
  415. ElMessage.error(error.message);
  416. }
  417. } finally {
  418. uploading.value = false;
  419. // 触发视图更新
  420. fileList.value = [...fileList.value];
  421. }
  422. };
  423. /**
  424. * 图片预览 - 使用 el-image-viewer 预览功能
  425. * @param file 上传文件对象
  426. */
  427. const handlePictureCardPreview = (file: any) => {
  428. // 如果文件在排队中(未上传),禁止预览
  429. if (isFilePending(file)) {
  430. ElMessage.warning("图片尚未上传,请等待上传完成后再预览");
  431. return;
  432. }
  433. // 如果文件正在上传中,允许预览(使用本地预览)
  434. if (file.status === "uploading" && file.url) {
  435. imageViewerUrlList.value = [file.url];
  436. imageViewerInitialIndex.value = 0;
  437. imageViewerVisible.value = true;
  438. return;
  439. }
  440. // 获取所有图片的 URL 列表(只包含已上传成功的图片)
  441. const urlList = fileList.value
  442. .filter((item: any) => item.status === "success" && (item.url || item.response?.data))
  443. .map((item: any) => item.url || item.response?.data);
  444. // 找到当前点击的图片索引
  445. const currentIndex = urlList.findIndex((url: string) => url === (file.url || file.response?.data));
  446. if (currentIndex < 0) {
  447. ElMessage.warning("图片尚未上传完成,无法预览");
  448. return;
  449. }
  450. imageViewerUrlList.value = urlList;
  451. imageViewerInitialIndex.value = currentIndex;
  452. imageViewerVisible.value = true;
  453. };
  454. const handleCancelReplace = async () => {
  455. // 如果有图片正在上传,阻止关闭
  456. if (hasUnuploadedImages.value) {
  457. ElMessage.warning("请等待图片上传完成后再关闭");
  458. return;
  459. }
  460. if (fileList.value.length > 0) {
  461. try {
  462. await ElMessageBox.confirm("确定要取消本次图片上传吗?已上传的图片将不保存", "提示", {
  463. confirmButtonText: "确定",
  464. cancelButtonText: "取消",
  465. type: "warning"
  466. });
  467. // 用户确认取消
  468. fileList.value = [];
  469. imageUrlList.value = [];
  470. pendingUploadFiles.value = [];
  471. uploading.value = false;
  472. replaceDialogVisible.value = false;
  473. } catch {
  474. // 用户取消操作,不做任何处理
  475. }
  476. } else {
  477. replaceDialogVisible.value = false;
  478. }
  479. };
  480. const handleReplaceDialogClose = async (done: () => void) => {
  481. // 如果有图片正在上传,阻止关闭
  482. if (hasUnuploadedImages.value) {
  483. ElMessage.warning("请等待图片上传完成后再关闭");
  484. return; // 不调用 done(),阻止关闭弹窗
  485. }
  486. if (fileList.value.length > 0) {
  487. try {
  488. await ElMessageBox.confirm("确定要取消本次图片上传吗?已上传的图片将不保存", "提示", {
  489. confirmButtonText: "确定",
  490. cancelButtonText: "取消",
  491. type: "warning"
  492. });
  493. // 用户确认取消,清空数据并关闭弹窗
  494. fileList.value = [];
  495. imageUrlList.value = [];
  496. pendingUploadFiles.value = [];
  497. uploading.value = false;
  498. done(); // 调用 done() 允许关闭弹窗
  499. } catch {
  500. // 用户取消操作,不调用 done(),阻止关闭弹窗
  501. }
  502. } else {
  503. // 没有文件,直接关闭
  504. done();
  505. }
  506. };
  507. const handleSubmitReplace = async () => {
  508. // 检查是否有未上传完成的图片
  509. if (hasUnuploadedImages.value) {
  510. ElMessage.warning("请等待图片上传完成后再提交");
  511. return;
  512. }
  513. if (fileList.value.length === 0) {
  514. ElMessage.warning("请先上传图片");
  515. return;
  516. }
  517. const uploadedFiles = fileList.value.filter(file => file.status === "success");
  518. if (uploadedFiles.length === 0) {
  519. ElMessage.warning("请先上传图片");
  520. return;
  521. }
  522. try {
  523. // 只提交单张图片,排序为0
  524. const imageDataWithSort = uploadedFiles.map((file, index) => ({
  525. imgUrl: file.url,
  526. imgSort: index,
  527. storeId: localGet("createdId")
  528. }));
  529. await submitFoodLicenseReview(imageDataWithSort[0]);
  530. ElMessage.success("提交审核成功");
  531. replaceDialogVisible.value = false;
  532. fileList.value = [];
  533. imageUrlList.value = [];
  534. pendingUploadFiles.value = [];
  535. uploading.value = false;
  536. await initData();
  537. } catch (error) {
  538. ElMessage.error("提交审核失败");
  539. }
  540. };
  541. const getStatusClass = (status: string) => {
  542. const statusInfo = statusMap[status];
  543. return statusInfo ? statusInfo.class : "";
  544. };
  545. const getStatusText = (status: string) => {
  546. const map: Record<string, string> = {
  547. pending: "审核中",
  548. success: "审核通过",
  549. failed: "审核拒绝"
  550. };
  551. return map[status] || "未知";
  552. };
  553. </script>
  554. <style lang="scss" scoped>
  555. .page-header {
  556. margin-bottom: 20px;
  557. }
  558. .store-title {
  559. margin: 0;
  560. font-size: 24px;
  561. font-weight: 600;
  562. color: var(--el-text-color-primary);
  563. }
  564. .content-section {
  565. display: flex;
  566. gap: 50px;
  567. align-items: center;
  568. justify-content: space-between;
  569. margin-top: 20px;
  570. margin-bottom: 50px;
  571. }
  572. .tip-text {
  573. font-size: 18px;
  574. color: var(--el-text-color-regular);
  575. }
  576. .action-buttons {
  577. display: flex;
  578. flex-shrink: 0;
  579. gap: 10px;
  580. }
  581. .license-container {
  582. padding: 20px;
  583. background-color: var(--el-bg-color-page);
  584. border-radius: 8px;
  585. }
  586. .license-display {
  587. display: flex;
  588. align-items: center;
  589. justify-content: center;
  590. width: 700px;
  591. height: 500px;
  592. }
  593. .license-image {
  594. width: 100%;
  595. height: 100%;
  596. border-radius: 8px;
  597. box-shadow: 0 2px 12px rgb(0 0 0 / 10%);
  598. }
  599. .empty-license {
  600. display: flex;
  601. align-items: center;
  602. justify-content: center;
  603. min-height: 570px;
  604. padding: 40px 20px;
  605. }
  606. .replace-upload-area {
  607. .upload-tip {
  608. margin-bottom: 10px;
  609. }
  610. min-height: 300px;
  611. // padding: 20px;
  612. :deep(.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label) {
  613. display: inline-flex !important;
  614. opacity: 1 !important;
  615. }
  616. :deep(.el-upload-list__item.is-success:focus .el-upload-list__item-status-label) {
  617. display: inline-flex !important;
  618. opacity: 1 !important;
  619. }
  620. :deep(.el-upload-list--picture-card .el-icon--close-tip) {
  621. display: none !important;
  622. }
  623. &.upload-full {
  624. :deep(.el-upload--picture-card) {
  625. display: none !important;
  626. }
  627. }
  628. }
  629. .dialog-footer {
  630. display: flex;
  631. gap: 10px;
  632. justify-content: center;
  633. }
  634. /* el-upload 图片预览铺满容器 */
  635. :deep(.el-upload-list--picture-card) {
  636. .el-upload-list__item {
  637. overflow: hidden;
  638. .el-upload-list__item-thumbnail {
  639. width: 100%;
  640. height: 100%;
  641. object-fit: fill;
  642. }
  643. }
  644. /* 排队中(未上传)的图片禁用样式 */
  645. .el-upload-list__item[data-status="ready"],
  646. .el-upload-list__item.is-ready {
  647. position: relative;
  648. pointer-events: none;
  649. cursor: not-allowed;
  650. opacity: 0.6;
  651. &::after {
  652. position: absolute;
  653. inset: 0;
  654. z-index: 1;
  655. content: "";
  656. background-color: rgb(0 0 0 / 30%);
  657. }
  658. .el-upload-list__item-actions {
  659. pointer-events: none;
  660. opacity: 0.5;
  661. }
  662. }
  663. }
  664. .upload-trigger-card {
  665. display: flex;
  666. flex-direction: column;
  667. align-items: center;
  668. justify-content: center;
  669. width: 100%;
  670. height: 100%;
  671. font-size: 28px;
  672. color: #8c939d;
  673. .upload-tip {
  674. margin-top: 8px;
  675. font-size: 14px;
  676. color: #8c939d;
  677. }
  678. }
  679. .change-record-scrollbar {
  680. :deep(.el-scrollbar__wrap) {
  681. overflow-x: hidden;
  682. }
  683. }
  684. .change-record-content {
  685. .record-group {
  686. padding: 20px;
  687. margin-bottom: 30px;
  688. background-color: var(--el-fill-color-lighter);
  689. &:last-child {
  690. margin-bottom: 0;
  691. }
  692. .record-date {
  693. margin-bottom: 15px;
  694. font-size: 16px;
  695. font-weight: 500;
  696. color: var(--el-text-color-primary);
  697. }
  698. .record-items {
  699. display: flex;
  700. flex-wrap: wrap;
  701. gap: 15px;
  702. }
  703. .record-item {
  704. position: relative;
  705. width: 150px;
  706. height: 150px;
  707. overflow: hidden;
  708. border-radius: 8px;
  709. .record-status-badge {
  710. position: absolute;
  711. right: 0;
  712. bottom: 0;
  713. left: 0;
  714. z-index: 1;
  715. padding: 4px 8px;
  716. font-size: 12px;
  717. font-weight: 500;
  718. text-align: center;
  719. border-radius: 0 0 8px 8px;
  720. &.status-pending {
  721. color: #e6a23c;
  722. background-color: rgb(253 246 236 / 90%);
  723. border-top: 1px solid #e6a23c;
  724. }
  725. &.status-success {
  726. color: #67c23a;
  727. background-color: rgb(240 249 255 / 90%);
  728. border-top: 1px solid #67c23a;
  729. }
  730. &.status-failed {
  731. color: #f56c6c;
  732. background-color: rgb(254 240 240 / 90%);
  733. border-top: 1px solid #f56c6c;
  734. }
  735. }
  736. .record-image {
  737. width: 100%;
  738. height: 100%;
  739. .image-slot {
  740. display: flex;
  741. align-items: center;
  742. justify-content: center;
  743. width: 100%;
  744. height: 100%;
  745. font-size: 30px;
  746. color: var(--el-text-color-placeholder);
  747. background: var(--el-fill-color-light);
  748. }
  749. }
  750. }
  751. .rejection-reason {
  752. margin-top: 15px;
  753. font-size: 14px;
  754. font-weight: 500;
  755. color: var(--el-text-color-regular);
  756. border-radius: 8px;
  757. }
  758. }
  759. }
  760. .empty-record {
  761. display: flex;
  762. align-items: center;
  763. justify-content: center;
  764. min-height: 300px;
  765. padding: 40px 20px;
  766. }
  767. </style>