From 99d9216d1b1e3185bffe79c4c68ff215e10785f0 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期一, 25 五月 2026 11:15:20 +0800
Subject: [PATCH] 巡检图片上传问题
---
src/pages/inspectionUpload/attachment.vue | 750 +++++++++++++++++++++++++++-------------------------
src/pages/inspectionUpload/upload.vue | 22
src/pages/inspectionUpload/index.vue | 10
3 files changed, 407 insertions(+), 375 deletions(-)
diff --git a/src/pages/inspectionUpload/attachment.vue b/src/pages/inspectionUpload/attachment.vue
index c94efa5..1530cad 100644
--- a/src/pages/inspectionUpload/attachment.vue
+++ b/src/pages/inspectionUpload/attachment.vue
@@ -1,53 +1,46 @@
<template>
<view class="attachment-page">
<!-- 椤甸潰澶撮儴 -->
- <PageHeader :title="`鏌ョ湅闄勪欢 - ${taskInfo?.taskName || ''}`" @back="goBack" />
-
+ <PageHeader :title="`鏌ョ湅闄勪欢 - ${taskInfo?.taskName || ''}`"
+ @back="goBack" />
<!-- 椤甸潰鍐呭 -->
<view class="attachment-content">
<!-- 鍒嗙被鏍囩椤� -->
<view class="attachment-tabs">
- <view
- class="tab-item"
- :class="{ active: currentViewType === 'before' }"
- @click="switchViewType('before')"
- >
+ <view class="tab-item"
+ :class="{ active: currentViewType === 'before' }"
+ @click="switchViewType('before')">
鐢熶骇鍓� ({{ getAttachmentsByType(0).length }})
</view>
- <view
- class="tab-item"
- :class="{ active: currentViewType === 'after' }"
- @click="switchViewType('after')"
- >
+ <view class="tab-item"
+ :class="{ active: currentViewType === 'after' }"
+ @click="switchViewType('after')">
鐢熶骇涓� ({{ getAttachmentsByType(1).length }})
</view>
- <view
- class="tab-item"
- :class="{ active: currentViewType === 'issue' }"
- @click="switchViewType('issue')"
- >
+ <view class="tab-item"
+ :class="{ active: currentViewType === 'issue' }"
+ @click="switchViewType('issue')">
鐢熶骇鍚� ({{ getAttachmentsByType(2).length }})
</view>
</view>
-
<!-- 褰撳墠鍒嗙被鐨勯檮浠跺垪琛� -->
<view class="attachment-list-container">
- <view v-if="getCurrentViewAttachments().length > 0" class="attachment-list">
- <view
- v-for="(file, index) in getCurrentViewAttachments()"
- :key="index"
- class="attachment-item"
- @click="previewAttachment(file)"
- >
+ <view v-if="getCurrentViewAttachments().length > 0"
+ class="attachment-list">
+ <view v-for="(file, index) in getCurrentViewAttachments()"
+ :key="index"
+ class="attachment-item"
+ @click="previewAttachment(file)">
<view class="attachment-preview-container">
- <image
- v-if="isImageFile(file)"
- :src="file.url || file.downloadUrl"
- class="attachment-preview"
- mode="aspectFill"
- />
- <view v-else class="attachment-video-preview">
- <u-icon name="video" size="40" color="#409eff"></u-icon>
+ <image v-if="isImageFile(file)"
+ :src="file.url || file.downloadUrl"
+ class="attachment-preview"
+ mode="aspectFill" />
+ <view v-else
+ class="attachment-video-preview">
+ <u-icon name="video"
+ size="40"
+ color="#409eff"></u-icon>
<text class="video-text">瑙嗛</text>
</view>
</view>
@@ -57,31 +50,37 @@
</view>
</view>
</view>
- <view v-else class="attachment-empty">
- <u-icon name="folder-open" size="60" color="#ccc"></u-icon>
+ <view v-else
+ class="attachment-empty">
+ <u-icon name="folder-open"
+ size="60"
+ color="#ccc"></u-icon>
<text class="empty-text">璇ュ垎绫绘殏鏃犻檮浠�</text>
</view>
</view>
</view>
-
<!-- 瑙嗛棰勮寮圭獥 -->
- <view v-if="showVideoDialog" class="video-modal-overlay" @click="closeVideoPreview">
- <view class="video-modal-container" @click.stop>
+ <view v-if="showVideoDialog"
+ class="video-modal-overlay"
+ @click="closeVideoPreview">
+ <view class="video-modal-container"
+ @click.stop>
<view class="video-modal-header">
<text class="video-modal-title">{{ currentVideoFile?.originalFilename || '瑙嗛棰勮' }}</text>
- <view class="close-btn-video" @click="closeVideoPreview">
- <u-icon name="close" size="20" color="#fff"></u-icon>
+ <view class="close-btn-video"
+ @click="closeVideoPreview">
+ <u-icon name="close"
+ size="20"
+ color="#fff"></u-icon>
</view>
</view>
<view class="video-modal-body">
- <video
- v-if="currentVideoFile"
- :src="currentVideoFile.url || currentVideoFile.downloadUrl"
- class="video-player"
- controls
- autoplay
- @error="handleVideoError"
- ></video>
+ <video v-if="currentVideoFile"
+ :src="currentVideoFile.url || currentVideoFile.downloadUrl"
+ class="video-player"
+ controls
+ autoplay
+ @error="handleVideoError"></video>
</view>
</view>
</view>
@@ -89,372 +88,401 @@
</template>
<script setup>
-import { ref } from 'vue';
-import { onLoad } from '@dcloudio/uni-app';
-import PageHeader from '@/components/PageHeader.vue';
-import config from '@/config';
+ import { ref } from "vue";
+ import { onLoad } from "@dcloudio/uni-app";
+ import PageHeader from "@/components/PageHeader.vue";
+ import config from "@/config";
-// 浠诲姟淇℃伅
-const taskInfo = ref(null);
+ // 浠诲姟淇℃伅
+ const taskInfo = ref(null);
-// 闄勪欢鍒楄〃
-const attachmentList = ref([]);
+ // 闄勪欢鍒楄〃
+ const attachmentList = ref([]);
-// 褰撳墠鏌ョ湅绫诲瀷
-const currentViewType = ref('before'); // 'before', 'after', 'issue'
+ // 褰撳墠鏌ョ湅绫诲瀷
+ const currentViewType = ref("before"); // 'before', 'after', 'issue'
-// 瑙嗛棰勮鐩稿叧鐘舵��
-const showVideoDialog = ref(false);
-const currentVideoFile = ref(null);
+ // 瑙嗛棰勮鐩稿叧鐘舵��
+ const showVideoDialog = ref(false);
+ const currentVideoFile = ref(null);
-// 鏂囦欢璁块棶鍩虹鍩�
-const filePreviewBase = config.fileUrl;
+ // 鏂囦欢璁块棶鍩虹鍩�
+ const filePreviewBase = config.fileUrl;
-// 椤甸潰鍔犺浇
-onLoad((options) => {
- if (options.taskInfo) {
- try {
- taskInfo.value = JSON.parse(decodeURIComponent(options.taskInfo));
- loadAttachments();
- } catch (e) {
- console.error('瑙f瀽浠诲姟淇℃伅澶辫触:', e);
- uni.showToast({
- title: '鍔犺浇澶辫触',
- icon: 'error'
- });
+ // 椤甸潰鍔犺浇
+ onLoad(options => {
+ if (options.taskInfo) {
+ try {
+ taskInfo.value = JSON.parse(decodeURIComponent(options.taskInfo));
+ loadAttachments();
+ } catch (e) {
+ console.error("瑙f瀽浠诲姟淇℃伅澶辫触:", e);
+ uni.showToast({
+ title: "鍔犺浇澶辫触",
+ icon: "error",
+ });
+ }
}
- }
-});
+ });
-// 鍔犺浇闄勪欢鏁版嵁
-const loadAttachments = () => {
- const task = taskInfo.value;
- if (!task) return;
+ // 鍔犺浇闄勪欢鏁版嵁
+ const loadAttachments = () => {
+ const task = taskInfo.value;
+ if (!task) return;
- attachmentList.value = [];
+ attachmentList.value = [];
- // 鍚庣鍙嶆樉瀛楁
- const allList = Array.isArray(task?.commonFileList) ? task.commonFileList : [];
- const beforeList = Array.isArray(task?.commonFileListBefore)
- ? task.commonFileListBefore
- : allList.filter((f) => f?.type === 10);
- const afterList = Array.isArray(task?.commonFileListAfter)
- ? task.commonFileListAfter
- : allList.filter((f) => f?.type === 11);
- const issueList = Array.isArray(task?.commonFileListIssue)
- ? task.commonFileListIssue
- : allList.filter((f) => f?.type === 12);
+ // 鍚庣鍙嶆樉瀛楁 (VO浼樺厛)
+ const beforeList = Array.isArray(task?.commonFileListBeforeVO)
+ ? task.commonFileListBeforeVO
+ : Array.isArray(task?.commonFileListBefore)
+ ? task.commonFileListBefore
+ : [];
- const mapToViewFile = (file, viewType) => {
- const u = normalizeFileUrl(file?.url || file?.downloadUrl || '');
- return {
- ...file,
- type: viewType,
- name: file?.name || file?.originalFilename || file?.bucketFilename,
- bucketFilename: file?.bucketFilename || file?.name,
- originalFilename: file?.originalFilename || file?.name,
- url: u,
- downloadUrl: u,
- size: file?.size || file?.byteSize,
+ const duringList = Array.isArray(task?.commonFileListVO)
+ ? task.commonFileListVO
+ : Array.isArray(task?.commonFileListAfter)
+ ? task.commonFileListAfter
+ : []; // 鍏煎鏃ч�昏緫鎴栧懡鍚嶄笉涓�鑷�
+
+ const afterList = Array.isArray(task?.commonFileListAfterVO)
+ ? task.commonFileListAfterVO
+ : Array.isArray(task?.commonFileListIssue)
+ ? task.commonFileListIssue
+ : [];
+
+ // 濡傛灉 VO 閮芥病鏈夛紝灏濊瘯浠� commonFileList 杩囨护
+ const allList = Array.isArray(task?.commonFileList)
+ ? task.commonFileList
+ : [];
+
+ const finalBefore =
+ beforeList.length > 0 ? beforeList : allList.filter(f => f?.type === 10);
+ const finalDuring =
+ duringList.length > 0 ? duringList : allList.filter(f => f?.type === 11);
+ const finalAfter =
+ afterList.length > 0 ? afterList : allList.filter(f => f?.type === 12);
+
+ const mapToViewFile = (file, viewType) => {
+ // 鍏煎 previewURL, previewUrl, url, downloadURL, downloadUrl
+ const rawUrl =
+ file?.previewURL ||
+ file?.previewUrl ||
+ file?.url ||
+ file?.downloadURL ||
+ file?.downloadUrl ||
+ "";
+ const u = normalizeFileUrl(rawUrl);
+
+ return {
+ ...file,
+ type: viewType,
+ name:
+ file?.originalFilename || file?.bucketFilename || file?.name || "闄勪欢",
+ bucketFilename: file?.bucketFilename || file?.name,
+ originalFilename: file?.originalFilename || file?.name,
+ url: u,
+ downloadUrl: u,
+ size: file?.byteSize || file?.size || 0,
+ };
};
+
+ attachmentList.value.push(...finalBefore.map(f => mapToViewFile(f, 0)));
+ attachmentList.value.push(...finalDuring.map(f => mapToViewFile(f, 1)));
+ attachmentList.value.push(...finalAfter.map(f => mapToViewFile(f, 2)));
};
- attachmentList.value.push(...beforeList.map((f) => mapToViewFile(f, 0)));
- attachmentList.value.push(...afterList.map((f) => mapToViewFile(f, 1)));
- attachmentList.value.push(...issueList.map((f) => mapToViewFile(f, 2)));
-};
+ // 灏嗗悗绔繑鍥炵殑鏂囦欢鍦板潃瑙勮寖鎴愬彲璁块棶URL
+ const normalizeFileUrl = rawUrl => {
+ try {
+ if (!rawUrl || typeof rawUrl !== "string") return "";
+ const url = rawUrl.trim();
+ if (!url) return "";
+ if (/^https?:\/\//i.test(url)) return url;
+ if (url.startsWith("/")) return `${filePreviewBase}${url}`;
-// 灏嗗悗绔繑鍥炵殑鏂囦欢鍦板潃瑙勮寖鎴愬彲璁块棶URL
-const normalizeFileUrl = (rawUrl) => {
- try {
- if (!rawUrl || typeof rawUrl !== 'string') return '';
- const url = rawUrl.trim();
- if (!url) return '';
- if (/^https?:\/\//i.test(url)) return url;
- if (url.startsWith('/')) return `${filePreviewBase}${url}`;
-
- // Windows path -> web path
- if (/^[a-zA-Z]:\\/.test(url)) {
- const normalized = url.replace(/\\/g, '/');
- const idx = normalized.indexOf('/prod/');
- if (idx >= 0) {
- const relative = normalized.slice(idx + '/prod/'.length);
- return `${filePreviewBase}/${relative}`;
+ // Windows path -> web path
+ if (/^[a-zA-Z]:\\/.test(url)) {
+ const normalized = url.replace(/\\/g, "/");
+ const idx = normalized.indexOf("/prod/");
+ if (idx >= 0) {
+ const relative = normalized.slice(idx + "/prod/".length);
+ return `${filePreviewBase}/${relative}`;
+ }
+ return normalized;
}
- return normalized;
+
+ return `${filePreviewBase}/${url.replace(/^\//, "")}`;
+ } catch (e) {
+ return rawUrl || "";
}
+ };
- return `${filePreviewBase}/${url.replace(/^\//, '')}`;
- } catch (e) {
- return rawUrl || '';
- }
-};
+ // 杩斿洖涓婁竴椤�
+ const goBack = () => {
+ uni.navigateBack();
+ };
-// 杩斿洖涓婁竴椤�
-const goBack = () => {
- uni.navigateBack();
-};
+ // 鍒囨崲鏌ョ湅绫诲瀷
+ const switchViewType = type => {
+ currentViewType.value = type;
+ };
-// 鍒囨崲鏌ョ湅绫诲瀷
-const switchViewType = (type) => {
- currentViewType.value = type;
-};
+ // 鏍规嵁type鑾峰彇瀵瑰簲鍒嗙被鐨勯檮浠�
+ const getAttachmentsByType = typeValue => {
+ return attachmentList.value.filter(file => file.type === typeValue) || [];
+ };
-// 鏍规嵁type鑾峰彇瀵瑰簲鍒嗙被鐨勯檮浠�
-const getAttachmentsByType = (typeValue) => {
- return attachmentList.value.filter((file) => file.type === typeValue) || [];
-};
+ // 鑾峰彇褰撳墠鏌ョ湅绫诲瀷鐨勯檮浠�
+ const getCurrentViewAttachments = () => {
+ switch (currentViewType.value) {
+ case "before":
+ return getAttachmentsByType(0);
+ case "after":
+ return getAttachmentsByType(1);
+ case "issue":
+ return getAttachmentsByType(2);
+ default:
+ return [];
+ }
+ };
-// 鑾峰彇褰撳墠鏌ョ湅绫诲瀷鐨勯檮浠�
-const getCurrentViewAttachments = () => {
- switch (currentViewType.value) {
- case 'before':
- return getAttachmentsByType(0);
- case 'after':
- return getAttachmentsByType(1);
- case 'issue':
- return getAttachmentsByType(2);
- default:
- return [];
- }
-};
+ // 鍒ゆ柇鏄惁涓哄浘鐗囨枃浠�
+ const isImageFile = file => {
+ if (file.contentType && file.contentType.startsWith("image/")) {
+ return true;
+ }
+ if (file.type === "image") return true;
-// 鍒ゆ柇鏄惁涓哄浘鐗囨枃浠�
-const isImageFile = (file) => {
- if (file.contentType && file.contentType.startsWith('image/')) {
- return true;
- }
- if (file.type === 'image') return true;
+ const name = file.bucketFilename || file.originalFilename || file.name || "";
+ const ext = name.split(".").pop()?.toLowerCase();
+ return ["jpg", "jpeg", "png", "gif", "webp"].includes(ext);
+ };
- const name = file.bucketFilename || file.originalFilename || file.name || '';
- const ext = name.split('.').pop()?.toLowerCase();
- return ['jpg', 'jpeg', 'png', 'gif', 'webp'].includes(ext);
-};
+ // 棰勮闄勪欢
+ const previewAttachment = file => {
+ if (isImageFile(file)) {
+ const imageUrls = getCurrentViewAttachments()
+ .filter(f => isImageFile(f))
+ .map(f => f.url || f.downloadUrl);
-// 棰勮闄勪欢
-const previewAttachment = (file) => {
- if (isImageFile(file)) {
- const imageUrls = getCurrentViewAttachments()
- .filter((f) => isImageFile(f))
- .map((f) => f.url || f.downloadUrl);
+ uni.previewImage({
+ urls: imageUrls,
+ current: file.url || file.downloadUrl,
+ });
+ } else {
+ showVideoPreview(file);
+ }
+ };
- uni.previewImage({
- urls: imageUrls,
- current: file.url || file.downloadUrl,
+ // 鏄剧ず瑙嗛棰勮
+ const showVideoPreview = file => {
+ currentVideoFile.value = file;
+ showVideoDialog.value = true;
+ };
+
+ // 鍏抽棴瑙嗛棰勮
+ const closeVideoPreview = () => {
+ showVideoDialog.value = false;
+ currentVideoFile.value = null;
+ };
+
+ // 瑙嗛鎾斁閿欒澶勭悊
+ const handleVideoError = () => {
+ uni.showToast({
+ title: "瑙嗛鎾斁澶辫触",
+ icon: "error",
});
- } else {
- showVideoPreview(file);
- }
-};
+ };
-// 鏄剧ず瑙嗛棰勮
-const showVideoPreview = (file) => {
- currentVideoFile.value = file;
- showVideoDialog.value = true;
-};
-
-// 鍏抽棴瑙嗛棰勮
-const closeVideoPreview = () => {
- showVideoDialog.value = false;
- currentVideoFile.value = null;
-};
-
-// 瑙嗛鎾斁閿欒澶勭悊
-const handleVideoError = () => {
- uni.showToast({
- title: '瑙嗛鎾斁澶辫触',
- icon: 'error',
- });
-};
-
-// 鏍煎紡鍖栨枃浠跺ぇ灏�
-const formatFileSize = (size) => {
- if (!size) return '';
- if (size < 1024) return size + 'B';
- if (size < 1024 * 1024) return (size / 1024).toFixed(1) + 'KB';
- return (size / (1024 * 1024)).toFixed(1) + 'MB';
-};
+ // 鏍煎紡鍖栨枃浠跺ぇ灏�
+ const formatFileSize = size => {
+ if (!size) return "";
+ if (size < 1024) return size + "B";
+ if (size < 1024 * 1024) return (size / 1024).toFixed(1) + "KB";
+ return (size / (1024 * 1024)).toFixed(1) + "MB";
+ };
</script>
<style scoped>
-.attachment-page {
- min-height: 100vh;
- background-color: #f5f5f5;
-}
+ .attachment-page {
+ min-height: 100vh;
+ background-color: #f5f5f5;
+ }
-.attachment-content {
- padding: 15px;
-}
+ .attachment-content {
+ padding: 15px;
+ }
-/* 鏍囩椤垫牱寮� */
-.attachment-tabs {
- display: flex;
- background: #fff;
- border-radius: 12px;
- margin-bottom: 15px;
- padding: 4px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
-}
+ /* 鏍囩椤垫牱寮� */
+ .attachment-tabs {
+ display: flex;
+ background: #fff;
+ border-radius: 12px;
+ margin-bottom: 15px;
+ padding: 4px;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+ }
-.tab-item {
- flex: 1;
- text-align: center;
- padding: 12px 8px;
- font-size: 14px;
- color: #666;
- border-radius: 8px;
- transition: all 0.3s ease;
-}
+ .tab-item {
+ flex: 1;
+ text-align: center;
+ padding: 12px 8px;
+ font-size: 14px;
+ color: #666;
+ border-radius: 8px;
+ transition: all 0.3s ease;
+ }
-.tab-item.active {
- background: #409eff;
- color: #fff;
- font-weight: 500;
-}
+ .tab-item.active {
+ background: #409eff;
+ color: #fff;
+ font-weight: 500;
+ }
-/* 闄勪欢鍒楄〃鏍峰紡 */
-.attachment-list-container {
- background: #fff;
- border-radius: 12px;
- padding: 15px;
- min-height: 400px;
-}
+ /* 闄勪欢鍒楄〃鏍峰紡 */
+ .attachment-list-container {
+ background: #fff;
+ border-radius: 12px;
+ padding: 15px;
+ min-height: 400px;
+ }
-.attachment-list {
- display: flex;
- flex-wrap: wrap;
- gap: 15px;
-}
+ .attachment-list {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 15px;
+ }
-.attachment-item {
- width: calc(33.33% - 10px);
- background: #f8f9fa;
- border-radius: 12px;
- overflow: hidden;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
- transition: all 0.3s ease;
-}
+ .attachment-item {
+ width: calc(33.33% - 10px);
+ background: #f8f9fa;
+ border-radius: 12px;
+ overflow: hidden;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
+ transition: all 0.3s ease;
+ }
-.attachment-item:active {
- transform: scale(0.98);
-}
+ .attachment-item:active {
+ transform: scale(0.98);
+ }
-.attachment-preview-container {
- width: 100%;
- height: 120px;
- background: #e9ecef;
- display: flex;
- align-items: center;
- justify-content: center;
-}
+ .attachment-preview-container {
+ width: 100%;
+ height: 120px;
+ background: #e9ecef;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
-.attachment-preview {
- width: 100%;
- height: 100%;
- object-fit: cover;
-}
+ .attachment-preview {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ }
-.attachment-video-preview {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 8px;
-}
+ .attachment-video-preview {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ }
-.video-text {
- font-size: 12px;
- color: #666;
-}
+ .video-text {
+ font-size: 12px;
+ color: #666;
+ }
-.attachment-info {
- padding: 10px;
-}
+ .attachment-info {
+ padding: 10px;
+ }
-.attachment-name {
- font-size: 12px;
- color: #333;
- display: block;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- margin-bottom: 4px;
-}
+ .attachment-name {
+ font-size: 12px;
+ color: #333;
+ display: block;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ margin-bottom: 4px;
+ }
-.attachment-size {
- font-size: 10px;
- color: #999;
-}
+ .attachment-size {
+ font-size: 10px;
+ color: #999;
+ }
-/* 绌虹姸鎬佹牱寮� */
-.attachment-empty {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- padding: 80px 20px;
- color: #999;
-}
+ /* 绌虹姸鎬佹牱寮� */
+ .attachment-empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 80px 20px;
+ color: #999;
+ }
-.empty-text {
- margin-top: 15px;
- font-size: 14px;
-}
+ .empty-text {
+ margin-top: 15px;
+ font-size: 14px;
+ }
-/* 瑙嗛寮圭獥鏍峰紡 */
-.video-modal-overlay {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background: rgba(0, 0, 0, 0.9);
- z-index: 10000;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 20px;
-}
+ /* 瑙嗛寮圭獥鏍峰紡 */
+ .video-modal-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: rgba(0, 0, 0, 0.9);
+ z-index: 10000;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 20px;
+ }
-.video-modal-container {
- width: 100%;
- max-width: 800px;
- background: #000;
- border-radius: 12px;
- overflow: hidden;
-}
+ .video-modal-container {
+ width: 100%;
+ max-width: 800px;
+ background: #000;
+ border-radius: 12px;
+ overflow: hidden;
+ }
-.video-modal-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 15px 20px;
- background: #1a1a1a;
-}
+ .video-modal-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 15px 20px;
+ background: #1a1a1a;
+ }
-.video-modal-title {
- font-size: 16px;
- color: #fff;
- font-weight: 500;
-}
+ .video-modal-title {
+ font-size: 16px;
+ color: #fff;
+ font-weight: 500;
+ }
-.close-btn-video {
- width: 32px;
- height: 32px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: rgba(255, 255, 255, 0.1);
- border-radius: 50%;
-}
+ .close-btn-video {
+ width: 32px;
+ height: 32px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: rgba(255, 255, 255, 0.1);
+ border-radius: 50%;
+ }
-.video-modal-body {
- padding: 20px;
-}
+ .video-modal-body {
+ padding: 20px;
+ }
-.video-player {
- width: 100%;
- height: 400px;
- border-radius: 8px;
-}
+ .video-player {
+ width: 100%;
+ height: 400px;
+ border-radius: 8px;
+ }
</style>
diff --git a/src/pages/inspectionUpload/index.vue b/src/pages/inspectionUpload/index.vue
index bedc38f..80c4c76 100644
--- a/src/pages/inspectionUpload/index.vue
+++ b/src/pages/inspectionUpload/index.vue
@@ -297,11 +297,15 @@
const getFileStatus = record => {
let _beforeProduction =
- record.beforeProduction && record.beforeProduction.length;
+ (record.commonFileListBeforeVO && record.commonFileListBeforeVO.length) ||
+ (record.commonFileListBefore && record.commonFileListBefore.length);
let _afterProduction =
- record.afterProduction && record.afterProduction.length;
+ (record.commonFileListVO && record.commonFileListVO.length) ||
+ (record.commonFileListAfter && record.commonFileListAfter.length);
let _productionIssues =
- record.productionIssues && record.productionIssues.length;
+ (record.commonFileListAfterVO && record.commonFileListAfterVO.length) ||
+ (record.commonFileListIssue && record.commonFileListIssue.length);
+
if (_beforeProduction && _afterProduction && _productionIssues) {
return 2;
} else if (_beforeProduction || _afterProduction || _productionIssues) {
diff --git a/src/pages/inspectionUpload/upload.vue b/src/pages/inspectionUpload/upload.vue
index 6d95785..27ba41f 100644
--- a/src/pages/inspectionUpload/upload.vue
+++ b/src/pages/inspectionUpload/upload.vue
@@ -258,12 +258,12 @@
});
};
- // 鏍规嵁鐢ㄦ埛瑕佹眰鏄犲皠锛欰fterDTO(鐢熶骇鍓�), DTO(鐢熶骇涓�), BeforeDTO(鐢熶骇鍚�)
+ // 淇瀛楁鏄犲皠锛欱eforeVO(鐢熶骇鍓�), VO(鐢熶骇涓�), AfterVO(鐢熶骇鍚�)
if (
- info.commonFileListAfterVO &&
- Array.isArray(info.commonFileListAfterVO)
+ info.commonFileListBeforeVO &&
+ Array.isArray(info.commonFileListBeforeVO)
) {
- beforeModelValue.value = mapFiles(info.commonFileListAfterVO);
+ beforeModelValue.value = mapFiles(info.commonFileListBeforeVO);
}
console.log(beforeModelValue.value, "beforeModelValue");
@@ -271,10 +271,10 @@
afterModelValue.value = mapFiles(info.commonFileListVO);
}
if (
- info.commonFileListBeforeVO &&
- Array.isArray(info.commonFileListBeforeVO)
+ info.commonFileListAfterVO &&
+ Array.isArray(info.commonFileListAfterVO)
) {
- issueModelValue.value = mapFiles(info.commonFileListBeforeVO);
+ issueModelValue.value = mapFiles(info.commonFileListAfterVO);
}
// 濡傛灉鏈夊紓甯告弿杩帮紝涔熸仮澶�
@@ -360,9 +360,9 @@
inspector: taskInfo.value?.inspector,
hasException: hasException.value,
inspectionResult: hasException.value ? 0 : 1, // 0-寮傚父锛�1-姝e父
- commonFileListAfterDTO: beforeModelValue.value,
+ commonFileListBeforeDTO: beforeModelValue.value,
commonFileListDTO: afterModelValue.value,
- commonFileListBeforeDTO: issueModelValue.value,
+ commonFileListAfterDTO: issueModelValue.value,
uploadedFiles: {
before: beforeModelValue.value,
after: afterModelValue.value,
@@ -443,9 +443,9 @@
// 鎻愪氦鏁版嵁
const submitData = {
...taskInfo.value,
- commonFileListAfterDTO: beforeModelValue.value, // 鐢熶骇鍓�
+ commonFileListBeforeDTO: beforeModelValue.value, // 鐢熶骇鍓�
commonFileListDTO: afterModelValue.value, // 鐢熶骇涓�
- commonFileListBeforeDTO: issueModelValue.value, // 鐢熶骇鍚�
+ commonFileListAfterDTO: issueModelValue.value, // 鐢熶骇鍚�
hasException: hasException.value,
inspectionResult: hasException.value ? 0 : 1, // 0-寮傚父锛�1-姝e父
abnormalDescription: abnormalDescription.value,
--
Gitblit v1.9.3