entertainmentLicense.vue 24 KB

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