| | |
| | | <template> |
| | | <view class="inspection-upload-page"> |
| | | <!-- 页面头部 --> |
| | | <PageHeader title="巡检上传" @back="goBack"/> |
| | | |
| | | <PageHeader title="巡检上传" @back="goBack" /> |
| | | |
| | | <!-- 数据列表 --> |
| | | <view class="table-section"> |
| | | <!-- 生产巡检列表 --> |
| | | <view class="task-list"> |
| | | <view |
| | | v-for="(item, index) in taskTableData" |
| | | :key="index" |
| | | class="task-item" |
| | | > |
| | | <view v-for="(item, index) in taskTableData" :key="index" class="task-item"> |
| | | <view class="task-header"> |
| | | <view class="task-info"> |
| | | <text class="task-name">{{ item.taskName }}</text> |
| | | <text class="task-location">{{ item.inspectionLocation }}</text> |
| | | </view> |
| | | <view class="task-actions"> |
| | | <u-button |
| | | type="primary" |
| | | size="small" |
| | | @click.stop="startScanForTask(item)" |
| | | :customStyle="{ |
| | | borderRadius: '15px', |
| | | height: '30px', |
| | | fontSize: '12px', |
| | | marginRight: '8px' |
| | | }" |
| | | > |
| | | <u-button type="primary" size="small" @click.stop="startScanForTask(item)" :customStyle="{ |
| | | borderRadius: '15px', |
| | | height: '30px', |
| | | fontSize: '12px', |
| | | marginRight: '8px' |
| | | }"> |
| | | 扫码上传 |
| | | </u-button> |
| | | <u-button |
| | | type="success" |
| | | size="small" |
| | | @click.stop="viewAttachments(item)" |
| | | :customStyle="{ |
| | | borderRadius: '15px', |
| | | height: '30px', |
| | | fontSize: '12px' |
| | | }" |
| | | > |
| | | <u-button type="success" size="small" @click.stop="viewAttachments(item)" :customStyle="{ |
| | | borderRadius: '15px', |
| | | height: '30px', |
| | | fontSize: '12px' |
| | | }"> |
| | | 查看附件 |
| | | </u-button> |
| | | </view> |
| | |
| | | <text class="detail-label">执行人</text> |
| | | <text class="detail-value">{{ item.inspector }}</text> |
| | | </view> |
| | | <view class="detail-item"> |
| | | <text class="detail-label">任务下发日期</text> |
| | | <text class="detail-value">{{ item.dateStr }}</text> |
| | | </view> |
| | | <view class="detail-item"> |
| | | <text class="detail-label">巡检状态</text> |
| | | <view class="detail-value"> |
| | | <uni-tag v-if="item.fileStatus==2" text="已完成" size="small" type="success" inverted></uni-tag> |
| | | <uni-tag v-else-if="item.fileStatus==1" text="巡检中" size="small" type="primary" inverted></uni-tag> |
| | | <uni-tag v-else="" text="未巡检" size="small" type="warning" inverted></uni-tag> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <uni-load-more :status="loadMoreStatus"></uni-load-more> |
| | | </view> |
| | | |
| | | |
| | | <!-- 空状态 --> |
| | | <view v-if="taskTableData.length === 0" class="no-data"> |
| | | <view v-if="taskTableData?.length === 0" class="no-data"> |
| | | <text>暂无数据</text> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | |
| | | |
| | | <!-- 扫码区域 - 全局弹窗 --> |
| | | <view v-if="isScanning" class="qr-scan-overlay"> |
| | | <view class="qr-scan-container"> |
| | | <view class="scan-header"> |
| | | <text class="scan-title">扫描二维码</text> |
| | | <u-button |
| | | type="error" |
| | | size="small" |
| | | @click.stop="stopScan" |
| | | :customStyle="{ |
| | | borderRadius: '15px', |
| | | height: '30px', |
| | | fontSize: '12px' |
| | | }" |
| | | > |
| | | <u-button type="error" size="small" @click.stop="stopScan" :customStyle="{ |
| | | borderRadius: '15px', |
| | | height: '30px', |
| | | fontSize: '12px' |
| | | }"> |
| | | 关闭 |
| | | </u-button> |
| | | </view> |
| | | <camera |
| | | class="qr-camera" |
| | | device-position="back" |
| | | flash="off" |
| | | @scancode="handleScanCode" |
| | | @error="handleCameraError" |
| | | ></camera> |
| | | <camera class="qr-camera" device-position="back" flash="off" @scancode="handleScanCode" |
| | | @error="handleCameraError"></camera> |
| | | <view class="scan-frame-wrapper"> |
| | | <view class="scan-frame"></view> |
| | | <view class="scan-tip">请将二维码放入框内</view> |
| | | </view> |
| | | <u-alert |
| | | v-if="cameraError" |
| | | :title="cameraError" |
| | | type="error" |
| | | :showIcon="true" |
| | | :closable="true" |
| | | @close="cameraError = ''" |
| | | :customStyle="{ |
| | | <u-alert v-if="cameraError" :title="cameraError" type="error" :showIcon="true" :closable="true" |
| | | @close="cameraError = ''" :customStyle="{ |
| | | margin: '10px 0' |
| | | }" |
| | | ></u-alert> |
| | | }"></u-alert> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <!-- 图片上传弹窗 - 原生实现 --> |
| | | <view v-if="showUploadDialog" class="custom-modal-overlay" @click="closeUploadDialog"> |
| | | <view class="custom-modal-container" @click.stop> |
| | |
| | | <view class="upload-popup-header"> |
| | | <text class="upload-popup-title">上传巡检记录</text> |
| | | </view> |
| | | |
| | | <view class="upload-popup-body"> |
| | | <!-- 分类标签页 --> |
| | | <view class="upload-tabs"> |
| | | <view |
| | | class="tab-item" |
| | | :class="{ active: currentUploadType === 'before' }" |
| | | @click="switchUploadType('before')" |
| | | > |
| | | 生产前 |
| | | </view> |
| | | <view |
| | | class="tab-item" |
| | | :class="{ active: currentUploadType === 'after' }" |
| | | @click="switchUploadType('after')" |
| | | > |
| | | 生产中 |
| | | </view> |
| | | <view |
| | | class="tab-item" |
| | | :class="{ active: currentUploadType === 'issue' }" |
| | | @click="switchUploadType('issue')" |
| | | > |
| | | 生产后 |
| | | </view> |
| | | |
| | | <view class="upload-popup-body"> |
| | | <!-- 分类标签页 --> |
| | | <view class="upload-tabs"> |
| | | <view class="tab-item" :class="{ active: currentUploadType === 'before' }" |
| | | @click="switchUploadType('before')"> |
| | | 生产前 |
| | | </view> |
| | | |
| | | <!-- 当前分类的上传区域 --> |
| | | <view class="simple-upload-area"> |
| | | <view class="upload-buttons"> |
| | | <u-button |
| | | type="primary" |
| | | @click="chooseImage" |
| | | :loading="uploading" |
| | | :disabled="getCurrentFiles().length >= uploadConfig.limit" |
| | | :customStyle="{ marginRight: '10px', flex: 1 }" |
| | | > |
| | | <u-icon name="camera" size="18" color="#fff" style="margin-right: 5px;"></u-icon> |
| | | {{ uploading ? '上传中...' : '拍照' }} |
| | | </u-button> |
| | | <u-button |
| | | type="success" |
| | | @click="chooseVideo" |
| | | :loading="uploading" |
| | | :disabled="getCurrentFiles().length >= uploadConfig.limit" |
| | | :customStyle="{ flex: 1 }" |
| | | > |
| | | <u-icon name="video" size="18" color="#fff" style="margin-right: 5px;"></u-icon> |
| | | {{ uploading ? '上传中...' : '拍视频' }} |
| | | </u-button> |
| | | <view class="tab-item" :class="{ active: currentUploadType === 'after' }" |
| | | @click="switchUploadType('after')"> |
| | | 生产中 |
| | | </view> |
| | | <view class="tab-item" :class="{ active: currentUploadType === 'issue' }" |
| | | @click="switchUploadType('issue')"> |
| | | 生产后 |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 异常状态选择 --> |
| | | <view class="exception-section"> |
| | | <text class="section-title">是否存在异常?</text> |
| | | <view class="exception-options"> |
| | | <view class="exception-option" :class="{ active: hasException === false }" |
| | | @click="setExceptionStatus(false)"> |
| | | <u-icon name="checkmark-circle" size="20" color="#52c41a"></u-icon> |
| | | <text>正常</text> |
| | | </view> |
| | | |
| | | <!-- 上传进度 --> |
| | | <view v-if="uploading" class="upload-progress"> |
| | | <u-line-progress |
| | | :percentage="uploadProgress" |
| | | :showText="true" |
| | | activeColor="#409eff" |
| | | ></u-line-progress> |
| | | </view> |
| | | |
| | | <!-- 当前分类的文件列表 --> |
| | | <view v-if="getCurrentFiles().length > 0" class="file-list"> |
| | | <view |
| | | v-for="(file, index) in getCurrentFiles()" |
| | | :key="index" |
| | | class="file-item" |
| | | > |
| | | <view class="file-preview-container"> |
| | | <image |
| | | v-if="file.type === 'image'" |
| | | :src="file.url || file.tempFilePath || file.path" |
| | | class="file-preview" |
| | | mode="aspectFill" |
| | | /> |
| | | <view v-else class="video-preview"> |
| | | <u-icon name="video" size="24" color="#409eff"></u-icon> |
| | | <text class="video-text">视频</text> |
| | | </view> |
| | | |
| | | <!-- 删除按钮 --> |
| | | <view class="delete-btn" @click="removeFile(index)"> |
| | | <u-icon name="close" size="12" color="#fff"></u-icon> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="file-info"> |
| | | <text class="file-name">{{ file.bucketFilename || file.name || (file.type === 'image' ? '图片' : '视频') }}</text> |
| | | <text class="file-size">{{ formatFileSize(file.size) }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-if="getCurrentFiles().length === 0" class="empty-state"> |
| | | <text>请选择要上传的{{ getUploadTypeText() }}图片或视频</text> |
| | | </view> |
| | | |
| | | <!-- 统计信息 --> |
| | | <view class="upload-summary"> |
| | | <text class="summary-text"> |
| | | 生产前: {{ beforeModelValue.length }}个文件 | |
| | | 生产中: {{ afterModelValue.length }}个文件 | |
| | | 生产后: {{ issueModelValue.length }}个文件 |
| | | </text> |
| | | <view class="exception-option" :class="{ active: hasException === true }" |
| | | @click="setExceptionStatus(true)"> |
| | | <u-icon name="close-circle" size="20" color="#ff4d4f"></u-icon> |
| | | <text>存在异常</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <!-- 当前分类的上传区域 --> |
| | | <view class="simple-upload-area"> |
| | | <view class="upload-buttons"> |
| | | <u-button type="primary" @click="chooseMedia('image')" :loading="uploading" |
| | | :disabled="getCurrentFiles().length >= uploadConfig.limit" |
| | | :customStyle="{ marginRight: '10px', flex: 1 }"> |
| | | <u-icon name="camera" size="18" color="#fff" style="margin-right: 5px;"></u-icon> |
| | | {{ uploading ? '上传中...' : '拍照' }} |
| | | </u-button> |
| | | <u-button type="success" @click="chooseMedia('video')" :loading="uploading" |
| | | :disabled="getCurrentFiles().length >= uploadConfig.limit" :customStyle="{ flex: 1 }"> |
| | | <uni-icons type="videocam" name="videocam" size="18" color="#fff" |
| | | style="margin-right: 5px;"></uni-icons> |
| | | {{ uploading ? '上传中...' : '拍视频' }} |
| | | </u-button> |
| | | </view> |
| | | |
| | | <!-- 上传进度 --> |
| | | <view v-if="uploading" class="upload-progress"> |
| | | <u-line-progress :percentage="uploadProgress" :showText="true" activeColor="#409eff"></u-line-progress> |
| | | </view> |
| | | |
| | | <!-- 当前分类的文件列表 --> |
| | | <view v-if="getCurrentFiles().length > 0" class="file-list"> |
| | | <view v-for="(file, index) in getCurrentFiles()" :key="index" class="file-item"> |
| | | <view class="file-preview-container"> |
| | | <image v-if="file?.path?.fileType === 'image'" |
| | | :src="file?.url || file?.tempFilePath?.tempFilePath || file?.path?.tempFilePath" |
| | | class="file-preview" mode="aspectFill" /> |
| | | <view v-else class="video-preview"> |
| | | <uni-icons type="videocam" name="videocam" size="18" color="#fff" |
| | | style="margin-right: 5px;"></uni-icons> |
| | | <text class="video-text">视频</text> |
| | | </view> |
| | | |
| | | <!-- 删除按钮 --> |
| | | <view class="delete-btn" @click="removeFile(index)"> |
| | | <u-icon name="close" size="12" color="#fff"></u-icon> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="file-info"> |
| | | <text class="file-name">{{ file.bucketFilename || file.name || (file.type === 'image' ? '图片' : '视频') |
| | | }}</text> |
| | | <text class="file-size">{{ formatFileSize(file.size) }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-if="getCurrentFiles().length === 0" class="empty-state"> |
| | | <text>请选择要上传的{{ getUploadTypeText() }}图片或视频</text> |
| | | </view> |
| | | |
| | | <!-- 统计信息 --> |
| | | <view class="upload-summary"> |
| | | <text class="summary-text"> |
| | | 生产前: {{ beforeModelValue.length }}个文件 | |
| | | 生产中: {{ afterModelValue.length }}个文件 | |
| | | 生产后: {{ issueModelValue.length }}个文件 |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="upload-popup-footer"> |
| | | <u-button @click="closeUploadDialog" :customStyle="{ marginRight: '10px' }">取消</u-button> |
| | | <u-button v-if="hasException === true" type="warning" @click="goToRepair" |
| | | :customStyle="{ marginRight: '10px' }"> |
| | | 新增报修 |
| | | </u-button> |
| | | <u-button type="primary" @click="submitUpload">提交</u-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <!-- 查看附件弹窗 --> |
| | | <view v-if="showAttachmentDialog" class="custom-modal-overlay" @click="closeAttachmentDialog"> |
| | | <view class="custom-modal-container" @click.stop> |
| | |
| | | <u-icon name="close" size="16" color="#666"></u-icon> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="attachment-popup-body"> |
| | | <!-- 分类标签页 --> |
| | | <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-content"> |
| | | <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-for="(file, index) in getCurrentViewAttachments()" :key="index" class="attachment-item" |
| | | @click="previewAttachment(file)"> |
| | | <view class="attachment-preview-container"> |
| | | <image |
| | | v-if="file.type === 'image' || isImageFile(file)" |
| | | :src="file.url || file.downloadUrl" |
| | | class="attachment-preview" |
| | | mode="aspectFill" |
| | | /> |
| | | <image v-if="file.type === 'image' || isImageFile(file)" :src="file.url || file.downloadUrl" |
| | | class="attachment-preview" mode="aspectFill" /> |
| | | <view v-else class="attachment-video-preview"> |
| | | <u-icon name="video" size="24" color="#409eff"></u-icon> |
| | | <text class="video-text">视频</text> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="attachment-info"> |
| | | <text class="attachment-name">{{ file.originalFilename || file.bucketFilename || file.name || '附件' }}</text> |
| | | <text class="attachment-name">{{ file.originalFilename || file.bucketFilename || file.name || '附件' |
| | | }}</text> |
| | | <text class="attachment-size">{{ formatFileSize(file.byteSize || file.size) }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view v-else class="attachment-empty"> |
| | | <text>该分类暂无附件</text> |
| | | </view> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <!-- 视频预览弹窗 --> |
| | | <view v-if="showVideoDialog" class="video-modal-overlay" @click="closeVideoPreview"> |
| | | <view class="video-modal-container" @click.stop> |
| | |
| | | </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> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, onUnmounted, ref, nextTick, computed } from 'vue' |
| | | import { onShow } from '@dcloudio/uni-app' |
| | | import { onMounted, onUnmounted, ref, nextTick, computed, reactive } from 'vue' |
| | | import { onShow, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app' |
| | | import PageHeader from '@/components/PageHeader.vue' |
| | | import { getLedgerById } from '@/api/equipmentManagement/ledger.js' |
| | | import {inspectionTaskList, uploadInspectionTask} from "@/api/inspectionManagement"; |
| | | import { inspectionTaskList, uploadInspectionTask } from "@/api/inspectionManagement"; |
| | | import { getToken } from "@/utils/auth"; |
| | | |
| | | // 组件引用已移除 |
| | |
| | | const showVideoDialog = ref(false) |
| | | const currentVideoFile = ref(null) |
| | | |
| | | // 异常状态 |
| | | const hasException = ref(null) // null: 未选择, true: 存在异常, false: 正常 |
| | | |
| | | // 上传配置 |
| | | const uploadConfig = { |
| | | action: "/common/minioUploads", |
| | |
| | | // 计算上传URL |
| | | const uploadFileUrl = computed(() => { |
| | | let baseUrl = ''; |
| | | |
| | | |
| | | if (process.env.VUE_APP_BASE_API) { |
| | | baseUrl = process.env.VUE_APP_BASE_API; |
| | | } else if (process.env.NODE_ENV === 'development') { |
| | | baseUrl = 'http://192.168.1.147:9036'; |
| | | baseUrl = 'http://114.132.189.42:9068'; |
| | | } else { |
| | | baseUrl = 'http://192.168.1.147:9036'; |
| | | baseUrl = 'http://114.132.189.42:9068'; |
| | | } |
| | | |
| | | |
| | | return baseUrl + uploadConfig.action; |
| | | }) |
| | | |
| | |
| | | const isScanning = ref(false) |
| | | const cameraError = ref('') |
| | | |
| | | const pagesPames = reactive({ |
| | | size: 10, |
| | | current:1 |
| | | }) |
| | | |
| | | const loadMoreStatus = computed(()=>{ |
| | | if(loading.value){ |
| | | return 'loading' |
| | | } |
| | | if(noMore.value){ |
| | | return 'noMore' |
| | | } |
| | | return 'more' |
| | | }) |
| | | const totalSize = ref(0) |
| | | const noMore = computed(()=>{ |
| | | return taskTableData.value.length>=totalSize.value |
| | | }) |
| | | const loading = ref(false) |
| | | |
| | | const reloadPage = ()=>{ |
| | | pagesPames.current = 1 |
| | | taskTableData.value = [] |
| | | getList() |
| | | } |
| | | const loadPage = ()=>{ |
| | | if(noMore.value||loading.value)return; |
| | | pagesPames.current += 1 |
| | | getList() |
| | | } |
| | | |
| | | // 生命周期 |
| | | onMounted(() => { |
| | | // 延迟初始化,确保DOM已渲染 |
| | | nextTick(() => { |
| | | getList() |
| | | }) |
| | | // nextTick(() => { |
| | | // getList() |
| | | // }) |
| | | }) |
| | | |
| | | onReachBottom(() => { |
| | | loadPage() |
| | | }) |
| | | onPullDownRefresh(() => { |
| | | reloadPage() |
| | | uni.stopPullDownRefresh() |
| | | }) |
| | | |
| | | onShow(() => { |
| | | // 页面显示时刷新数据 |
| | | getList() |
| | | reloadPage() |
| | | }) |
| | | |
| | | // 组件销毁时的清理 |
| | | onUnmounted(() => { |
| | | // 设置取消标志,阻止后续的异步操作 |
| | | isRequestCancelled = true |
| | | |
| | | |
| | | // 停止扫码 |
| | | if (isScanning.value) { |
| | | isScanning.value = false |
| | | } |
| | | |
| | | |
| | | // 关闭上传弹窗 |
| | | if (showUploadDialog.value) { |
| | | showUploadDialog.value = false |
| | |
| | | uni.navigateBack() |
| | | } |
| | | |
| | | // 查询数据 |
| | | const handleQuery = () => { |
| | | getList() |
| | | } |
| | | |
| | | // 获取列表数据 |
| | | const getList = () => { |
| | | // 显示加载提示 |
| | | showLoadingToast('加载中...') |
| | | |
| | | // showLoadingToast('加载中...') |
| | | |
| | | // 设置取消标志 |
| | | isRequestCancelled = false |
| | | |
| | | inspectionTaskList({}).then(res => { |
| | | loading.value = true |
| | | inspectionTaskList({...pagesPames}).then(res => { |
| | | // 检查组件是否还存在且请求未被取消 |
| | | if (!isRequestCancelled) { |
| | | console.log('生产巡检API返回数据:', res); |
| | | |
| | | // 处理不同的数据结构 |
| | | let records = []; |
| | | if (res && res.data) { |
| | | // 尝试多种可能的数据结构 |
| | | totalSize.value = res.data.total |
| | | if (Array.isArray(res.data.records)) { |
| | | records = res.data.records; |
| | | } else if (Array.isArray(res.data.rows)) { |
| | |
| | | records = res.data.list; |
| | | } |
| | | } |
| | | |
| | | |
| | | if (records.length > 0) { |
| | | taskTableData.value = records; |
| | | console.log('生产巡检数据设置成功,记录数:', records.length); |
| | | taskTableData.value = [...taskTableData.value,...records.map((record)=>{ |
| | | record.fileStatus = getFileStatus(record) |
| | | return record |
| | | })]; |
| | | } else { |
| | | console.warn('生产巡检数据为空或格式不正确:', res); |
| | | taskTableData.value = []; |
| | | uni.showToast({ |
| | | title: '暂无巡检任务数据', |
| | |
| | | }); |
| | | } |
| | | } |
| | | loading.value =false |
| | | // 关闭加载提示 |
| | | closeToast() |
| | | // closeToast() |
| | | }).catch(err => { |
| | | // 检查组件是否还存在且请求未被取消 |
| | | if (!isRequestCancelled) { |
| | | console.error('获取生产巡检数据失败:', err); |
| | | taskTableData.value = []; |
| | | // 添加错误提示 |
| | | uni.showToast({ |
| | |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | loading.value =false |
| | | // 关闭加载提示 |
| | | closeToast() |
| | | // closeToast() |
| | | }) |
| | | } |
| | | |
| | | const getFileStatus = (record)=>{ |
| | | let _beforeProduction = record.beforeProduction&&record.beforeProduction.length |
| | | let _afterProduction = record.afterProduction&&record.afterProduction.length |
| | | let _productionIssues = record.productionIssues&&record.productionIssues.length |
| | | if(_beforeProduction&&_afterProduction&&_productionIssues){ |
| | | return 2 |
| | | }else if(_beforeProduction||_afterProduction||_productionIssues){ |
| | | return 1 |
| | | }else{ |
| | | return 0 |
| | | } |
| | | } |
| | | |
| | | // 为指定任务开始扫码 |
| | |
| | | try { |
| | | // 记录当前扫描的任务 |
| | | currentScanningTask.value = task |
| | | console.log('为任务开始扫码,任务ID:', task.taskId || task.id, '任务名称:', task.taskName) |
| | | |
| | | |
| | | // 显示扫描界面 |
| | | isScanning.value = true |
| | | |
| | | |
| | | // 使用uniapp的扫码API |
| | | uni.scanCode({ |
| | | success: (res) => { |
| | | console.log('=== 扫码API成功回调 ===') |
| | | console.log('扫码结果:', res) |
| | | console.log('当前扫描任务:', currentScanningTask.value) |
| | | handleScanSuccess(res) |
| | | }, |
| | | fail: (err) => { |
| | | console.error('扫码失败:', err) |
| | | uni.showToast({ |
| | | title: '扫码失败', |
| | | icon: 'error' |
| | |
| | | // 关闭扫描界面 |
| | | isScanning.value = false |
| | | } |
| | | // 移除complete回调,避免干扰弹窗显示 |
| | | }) |
| | | } catch (e) { |
| | | console.error('启动扫码失败:', e) |
| | | uni.showToast({ |
| | | title: '启动扫码失败', |
| | | icon: 'error' |
| | |
| | | // 扫码成功处理 |
| | | const handleScanSuccess = async (result) => { |
| | | try { |
| | | console.log('处理扫码结果:', result) |
| | | console.log('当前关联任务:', currentScanningTask.value?.taskName) |
| | | |
| | | // 解析二维码数据,提取deviceId |
| | | let deviceId = '' |
| | | |
| | | |
| | | // 检查是否是URL格式 |
| | | if (result.result.includes('deviceId=')) { |
| | | // 从URL中提取deviceId |
| | |
| | | const match = url.match(/deviceId=(\d+)/) |
| | | if (match && match[1]) { |
| | | deviceId = match[1] |
| | | console.log('从URL中提取到deviceId:', deviceId) |
| | | } |
| | | } else { |
| | | // 尝试解析JSON格式 |
| | | try { |
| | | const qrData = JSON.parse(result.result) |
| | | console.log('解析的二维码数据:', qrData) |
| | | deviceId = qrData.deviceId || qrData.qrCodeId || '' |
| | | } catch (e) { |
| | | // 如果不是JSON格式,直接使用结果 |
| | | deviceId = result.result |
| | | } |
| | | } |
| | | |
| | | |
| | | if (!deviceId) { |
| | | uni.showToast({ |
| | | title: '未识别到设备ID', |
| | |
| | | isScanning.value = false |
| | | return |
| | | } |
| | | |
| | | |
| | | // 获取当前任务的taskId |
| | | const currentTaskId = currentScanningTask.value?.taskId || currentScanningTask.value?.id |
| | | console.log('当前任务ID:', currentTaskId, '扫码设备ID:', deviceId) |
| | | |
| | | |
| | | // 对比deviceId和taskId |
| | | if (deviceId === currentTaskId.toString()) { |
| | | console.log('=== 设备ID匹配成功 ===') |
| | | uni.showToast({ |
| | | title: '识别成功', |
| | | icon: 'success' |
| | | }) |
| | | |
| | | console.log('准备打开上传弹窗,当前任务:', currentScanningTask.value) |
| | | |
| | | |
| | | // 先关闭扫描界面 |
| | | isScanning.value = false |
| | | console.log('扫描界面已关闭') |
| | | |
| | | |
| | | // 延迟打开上传弹窗,确保扫描界面完全关闭 |
| | | setTimeout(() => { |
| | | console.log('延迟打开上传弹窗') |
| | | openUploadDialog(currentScanningTask.value) |
| | | }, 300) |
| | | } else { |
| | |
| | | title: '请扫描正确的设备', |
| | | icon: 'error' |
| | | }) |
| | | console.warn('设备ID不匹配,期望:', currentTaskId, '实际:', deviceId) |
| | | |
| | | |
| | | // 关闭扫描界面 |
| | | isScanning.value = false |
| | | } |
| | | |
| | | |
| | | } catch (error) { |
| | | console.error('处理扫码结果失败:', error) |
| | | uni.showToast({ |
| | | title: error.message || '数据解析失败', |
| | | icon: 'error' |
| | |
| | | |
| | | // 打开上传弹窗 |
| | | const openUploadDialog = (task) => { |
| | | console.log('=== 开始打开上传弹窗 ===') |
| | | console.log('传入的任务:', task) |
| | | console.log('任务名称:', task?.taskName || '未知任务') |
| | | console.log('当前showUploadDialog状态(调用前):', showUploadDialog.value) |
| | | |
| | | // 设置任务信息到infoData |
| | | if (task) { |
| | | infoData.value = { |
| | |
| | | taskId: task.taskId || task.id, |
| | | storageBlobDTO: [] // 初始化文件列表 |
| | | }; |
| | | console.log('设置infoData:', infoData.value); |
| | | } |
| | | |
| | | |
| | | // 设置上传状态类型(可以根据任务类型设置不同的状态) |
| | | uploadStatusType.value = 0 // 默认状态 |
| | | |
| | | |
| | | // 清空之前的文件 |
| | | uploadFiles.value = [] |
| | | |
| | | |
| | | // 显示上传弹窗 |
| | | showUploadDialog.value = true |
| | | |
| | | console.log('当前showUploadDialog状态(设置后):', showUploadDialog.value) |
| | | console.log('=== 上传弹窗设置完成 ===') |
| | | |
| | | // 延迟检查状态 |
| | | setTimeout(() => { |
| | | console.log('延迟检查showUploadDialog状态:', showUploadDialog.value) |
| | | }, 100) |
| | | } |
| | | |
| | | // 关闭上传弹窗 |
| | |
| | | afterModelValue.value = [] |
| | | issueModelValue.value = [] |
| | | currentUploadType.value = 'before' |
| | | hasException.value = null // 重置异常状态 |
| | | infoData.value = null // 清理任务数据 |
| | | console.log('上传弹窗已关闭,数据已清理') |
| | | } |
| | | |
| | | // 切换上传类型 |
| | | const switchUploadType = (type) => { |
| | | currentUploadType.value = type |
| | | console.log('切换到上传类型:', type) |
| | | } |
| | | |
| | | // 获取当前分类的文件列表 |
| | | const getCurrentFiles = () => { |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | return beforeModelValue.value |
| | | return beforeModelValue.value||[] |
| | | case 'after': |
| | | return afterModelValue.value |
| | | return afterModelValue.value||[] |
| | | case 'issue': |
| | | return issueModelValue.value |
| | | return issueModelValue.value||[] |
| | | default: |
| | | return [] |
| | | } |
| | |
| | | // 处理上传文件更新 |
| | | const handleUploadUpdate = (files) => { |
| | | uploadFiles.value = files |
| | | console.log('上传文件更新:', files) |
| | | } |
| | | |
| | | // 设置异常状态 |
| | | const setExceptionStatus = (status) => { |
| | | hasException.value = status |
| | | } |
| | | |
| | | // 跳转到新增报修页面 |
| | | const goToRepair = () => { |
| | | try { |
| | | // 存储当前任务信息到本地存储,供报修页面使用 |
| | | const taskInfo = { |
| | | taskId: infoData.value?.taskId || infoData.value?.id, |
| | | taskName: infoData.value?.taskName, |
| | | inspectionLocation: infoData.value?.inspectionLocation, |
| | | inspector: infoData.value?.inspector, |
| | | // 传递当前上传的文件信息 |
| | | uploadedFiles: { |
| | | before: beforeModelValue.value, |
| | | after: afterModelValue.value, |
| | | issue: issueModelValue.value |
| | | } |
| | | } |
| | | |
| | | uni.setStorageSync('repairTaskInfo', JSON.stringify(taskInfo)) |
| | | |
| | | // 跳转到新增报修页面 |
| | | uni.navigateTo({ |
| | | url: '/pages/equipmentManagement/repair/add' |
| | | }) |
| | | |
| | | // 关闭上传弹窗 |
| | | closeUploadDialog() |
| | | |
| | | } catch (error) { |
| | | console.error('跳转报修页面失败:', error) |
| | | uni.showToast({ |
| | | title: '跳转失败,请重试', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // 提交上传 |
| | | const submitUpload = async () => { |
| | | try { |
| | | // 检查是否选择了异常状态 |
| | | if (hasException.value === null) { |
| | | uni.showToast({ |
| | | title: '请选择是否存在异常', |
| | | icon: 'none' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // 检查是否有任何文件上传 |
| | | const totalFiles = beforeModelValue.value.length + afterModelValue.value.length + issueModelValue.value.length; |
| | | if (totalFiles === 0) { |
| | |
| | | if (issueModelValue.value.length > 0) { |
| | | arr.push(...issueModelValue.value); |
| | | } |
| | | |
| | | |
| | | // 提交数据 |
| | | infoData.value.storageBlobDTO = arr; |
| | | |
| | | console.log('准备提交巡检任务数据:', infoData.value); |
| | | console.log('合并的文件列表:', arr); |
| | | console.log('生产前文件(type=0):', beforeModelValue.value.length, beforeModelValue.value); |
| | | console.log('生产中文件(type=1):', afterModelValue.value.length, afterModelValue.value); |
| | | console.log('生产后文件(type=2):', issueModelValue.value.length, issueModelValue.value); |
| | | |
| | | const result = await uploadInspectionTask({...infoData.value}); |
| | | |
| | | console.log('巡检任务提交结果:', result); |
| | | |
| | | // 添加异常状态信息 |
| | | infoData.value.hasException = hasException.value; |
| | | const result = await uploadInspectionTask({ ...infoData.value }); |
| | | |
| | | // 检查提交结果 |
| | | if (result && (result.code === 200 || result.success)) { |
| | | // 提交成功 |
| | | closeToast(); // 关闭加载提示 |
| | | |
| | | |
| | | uni.showToast({ |
| | | title: '提交成功', |
| | | icon: 'success' |
| | | }) |
| | | |
| | | |
| | | // 关闭弹窗 |
| | | closeUploadDialog() |
| | | |
| | | |
| | | // 刷新列表 |
| | | setTimeout(() => { |
| | | getList() |
| | | reloadPage() |
| | | }, 500) |
| | | |
| | | |
| | | } else { |
| | | // 提交失败 |
| | | closeToast(); |
| | |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | |
| | | |
| | | } catch (error) { |
| | | console.error('提交上传失败:', error) |
| | | closeToast(); // 关闭加载提示 |
| | | |
| | | |
| | | let errorMessage = '提交失败'; |
| | | if (error.message) { |
| | | errorMessage = error.message; |
| | |
| | | } else if (typeof error === 'string') { |
| | | errorMessage = error; |
| | | } |
| | | |
| | | |
| | | uni.showToast({ |
| | | title: errorMessage, |
| | | icon: 'error' |
| | |
| | | |
| | | // 摄像头错误处理 |
| | | const handleCameraError = (error) => { |
| | | console.error('摄像头错误:', error) |
| | | cameraError.value = '摄像头访问失败,请检查权限设置' |
| | | } |
| | | |
| | | // 扫码事件处理 |
| | | const handleScanCode = (result) => { |
| | | console.log('扫码结果:', result) |
| | | handleScanSuccess(result) |
| | | } |
| | | |
| | | // 查看附件 |
| | | const viewAttachments = async (task) => { |
| | | try { |
| | | console.log('查看附件,任务:', task) |
| | | currentViewTask.value = task |
| | | currentViewType.value = 'before' |
| | | |
| | | |
| | | // 解析新的数据结构 |
| | | attachmentList.value = [] |
| | | |
| | | |
| | | // 生产前附件 (type=0) |
| | | if (task.beforeProduction && Array.isArray(task.beforeProduction)) { |
| | | const beforeFiles = task.beforeProduction.map(file => ({ |
| | |
| | | })) |
| | | attachmentList.value.push(...beforeFiles) |
| | | } |
| | | |
| | | |
| | | // 生产中附件 (type=1) |
| | | if (task.afterProduction && Array.isArray(task.afterProduction)) { |
| | | const afterFiles = task.afterProduction.map(file => ({ |
| | |
| | | })) |
| | | attachmentList.value.push(...afterFiles) |
| | | } |
| | | |
| | | |
| | | // 生产后附件 (type=2) |
| | | if (task.productionIssues && Array.isArray(task.productionIssues)) { |
| | | const issueFiles = task.productionIssues.map(file => ({ |
| | |
| | | })) |
| | | attachmentList.value.push(...issueFiles) |
| | | } |
| | | |
| | | console.log('解析后的附件列表:', attachmentList.value) |
| | | console.log('生产前附件:', task.beforeProduction?.length || 0) |
| | | console.log('生产中附件:', task.afterProduction?.length || 0) |
| | | console.log('生产后附件:', task.productionIssues?.length || 0) |
| | | |
| | | |
| | | showAttachmentDialog.value = true |
| | | |
| | | |
| | | } catch (error) { |
| | | console.error('获取附件列表失败:', error) |
| | | uni.showToast({ |
| | | title: '获取附件失败', |
| | | icon: 'error' |
| | |
| | | // 切换查看类型 |
| | | const switchViewType = (type) => { |
| | | currentViewType.value = type |
| | | console.log('切换查看类型到:', type) |
| | | } |
| | | |
| | | // 根据type获取对应分类的附件 |
| | | const getAttachmentsByType = (typeValue) => { |
| | | return attachmentList.value.filter(file => file.type === typeValue) || [] |
| | | } |
| | | |
| | | // 获取type值 |
| | | const getTabType = () => { |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | return 0 |
| | | case 'after': |
| | | return 1 |
| | | case 'issue': |
| | | return 2 |
| | | default: |
| | | return 0 |
| | | } |
| | | } |
| | | // 获取当前查看类型的附件 |
| | | const getCurrentViewAttachments = () => { |
| | | switch (currentViewType.value) { |
| | |
| | | if (file.contentType && file.contentType.startsWith('image/')) { |
| | | return true |
| | | } |
| | | |
| | | |
| | | // 检查原有的type字段 |
| | | if (file.type === 'image') return true |
| | | |
| | | |
| | | // 检查文件扩展名 |
| | | const name = file.bucketFilename || file.originalFilename || file.name || '' |
| | | const ext = name.split('.').pop()?.toLowerCase() |
| | |
| | | const imageUrls = getCurrentViewAttachments() |
| | | .filter(f => isImageFile(f)) |
| | | .map(f => f.url || f.downloadUrl) |
| | | |
| | | |
| | | uni.previewImage({ |
| | | urls: imageUrls, |
| | | current: file.url || file.downloadUrl |
| | |
| | | const showVideoPreview = (file) => { |
| | | currentVideoFile.value = file |
| | | showVideoDialog.value = true |
| | | console.log('播放视频:', file.url || file.downloadUrl) |
| | | } |
| | | |
| | | // 关闭视频预览 |
| | |
| | | |
| | | // 视频播放错误处理 |
| | | const handleVideoError = (error) => { |
| | | console.error('视频播放错误:', error) |
| | | uni.showToast({ |
| | | title: '视频播放失败', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | |
| | | // 使用相机 |
| | | const chooseMedia = (type) => { |
| | | let mediaPamaes = { |
| | | count: 1, |
| | | mediaType: [type || 'image'], |
| | | sizeType: ['compressed', 'original'], |
| | | sourceType: ['camera'], |
| | | } |
| | | uni.chooseMedia({ |
| | | ...mediaPamaes, |
| | | success: (res) => { |
| | | try { |
| | | if (!res.tempFiles || res.tempFiles.length === 0) { |
| | | throw new Error('未获取到图片文件'); |
| | | } |
| | | |
| | | const tempFilePath = res.tempFiles[0]; |
| | | const tempFile = res.tempFiles && res.tempFiles[0] ? res.tempFiles[0] : {}; |
| | | |
| | | const file = { |
| | | tempFilePath: tempFilePath, |
| | | path: tempFilePath, // 保持兼容性 |
| | | type: 'image', |
| | | name: `photo_${Date.now()}.jpg`, |
| | | size: tempFile.size || 0, |
| | | createTime: new Date().getTime(), |
| | | uid: Date.now() + Math.random() |
| | | }; |
| | | |
| | | handleBeforeUpload(file); |
| | | } catch (error) { |
| | | console.error('处理拍照结果失败:', error); |
| | | uni.showToast({ |
| | | title: '处理图片失败', |
| | | icon: 'error' |
| | | }); |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | console.error('拍照失败:', err); |
| | | uni.showToast({ |
| | | title: '拍照失败: ' + (err.errMsg || '未知错误'), |
| | | icon: 'error' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | uni.chooseImage({ |
| | | |
| | | uni.chooseMedia({ |
| | | count: 1, |
| | | mediaType: ['image', 'video'], |
| | | sizeType: ['compressed', 'original'], |
| | | sourceType: ['camera'], |
| | | success: (res) => { |
| | | try { |
| | | if (!res.tempFilePaths || res.tempFilePaths.length === 0) { |
| | | if (!res.tempFiles || res.tempFiles.length === 0) { |
| | | throw new Error('未获取到图片文件'); |
| | | } |
| | | |
| | | const tempFilePath = res.tempFilePaths[0]; |
| | | |
| | | const tempFilePath = res.tempFiles[0]; |
| | | const tempFile = res.tempFiles && res.tempFiles[0] ? res.tempFiles[0] : {}; |
| | | |
| | | |
| | | const file = { |
| | | tempFilePath: tempFilePath, |
| | | path: tempFilePath, // 保持兼容性 |
| | |
| | | createTime: new Date().getTime(), |
| | | uid: Date.now() + Math.random() |
| | | }; |
| | | |
| | | |
| | | handleBeforeUpload(file); |
| | | } catch (error) { |
| | | console.error('处理拍照结果失败:', error); |
| | |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | |
| | | uni.chooseVideo({ |
| | | sourceType: ['camera'], |
| | | maxDuration: uploadConfig.maxVideoDuration, |
| | |
| | | if (!res.tempFilePath) { |
| | | throw new Error('未获取到视频文件'); |
| | | } |
| | | |
| | | |
| | | const file = { |
| | | tempFilePath: res.tempFilePath, |
| | | path: res.tempFilePath, // 保持兼容性 |
| | |
| | | createTime: new Date().getTime(), |
| | | uid: Date.now() + Math.random() |
| | | }; |
| | | |
| | | |
| | | handleBeforeUpload(file); |
| | | } catch (error) { |
| | | console.error('处理拍视频结果失败:', error); |
| | |
| | | if (uploadConfig.fileType && Array.isArray(uploadConfig.fileType) && uploadConfig.fileType.length > 0) { |
| | | const fileName = file.name || ''; |
| | | const fileExtension = fileName ? fileName.split('.').pop().toLowerCase() : ''; |
| | | |
| | | |
| | | // 根据文件类型确定期望的扩展名 |
| | | let expectedTypes = []; |
| | | if (file.type === 'image') { |
| | |
| | | } else if (file.type === 'video') { |
| | | expectedTypes = ['mp4', 'mov', 'avi', 'wmv']; |
| | | } |
| | | |
| | | |
| | | // 检查文件扩展名是否在允许的类型中 |
| | | if (fileExtension && expectedTypes.length > 0) { |
| | | const isAllowed = expectedTypes.some(type => |
| | | const isAllowed = expectedTypes.some(type => |
| | | uploadConfig.fileType.includes(type) && type === fileExtension |
| | | ); |
| | | |
| | | |
| | | if (!isAllowed) { |
| | | uni.showToast({ |
| | | title: `文件格式不支持,请拍摄 ${expectedTypes.join('/')} 格式的文件`, |
| | |
| | | uploading.value = true; |
| | | uploadProgress.value = 0; |
| | | number.value++; // 增加上传计数 |
| | | |
| | | |
| | | // 确保文件路径正确 |
| | | const filePath = file.tempFilePath || file.path; |
| | | const filePath = file.tempFilePath?.tempFilePath || file.path?.tempFilePath || ''; |
| | | if (!filePath) { |
| | | handleUploadError('文件路径不存在'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 确保token存在 |
| | | const token = getToken(); |
| | | if (!token) { |
| | | handleUploadError('用户未登录'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // 准备上传参数 |
| | | const uploadParams = { |
| | | url: uploadFileUrl.value, |
| | | filePath: filePath, |
| | | name: 'files', |
| | | formData: { |
| | | type: uploadStatusType.value || 0 |
| | | type: getTabType() || 0 |
| | | }, |
| | | header: { |
| | | 'Authorization': `Bearer ${token}` |
| | | } |
| | | }; |
| | | |
| | | const uploadTask = uni.uploadFile({ |
| | | ...uploadParams, |
| | | success: (res) => { |
| | |
| | | fail: (err) => { |
| | | console.error('上传失败:', err.errMsg || err); |
| | | number.value--; // 上传失败时减少计数 |
| | | |
| | | |
| | | let errorMessage = '上传失败'; |
| | | if (err.errMsg) { |
| | | if (err.errMsg.includes('statusCode: null')) { |
| | |
| | | errorMessage = err.errMsg; |
| | | } |
| | | } |
| | | |
| | | |
| | | handleUploadError(errorMessage); |
| | | }, |
| | | complete: () => { |
| | |
| | | uploadProgress.value = 0; |
| | | } |
| | | }); |
| | | |
| | | |
| | | // 监听上传进度 |
| | | if (uploadTask && uploadTask.onProgressUpdate) { |
| | | uploadTask.onProgressUpdate((res) => { |
| | |
| | | const handleUploadSuccess = (res, file) => { |
| | | if (res.code === 200 && res.data && Array.isArray(res.data) && res.data.length > 0) { |
| | | const uploadedFile = res.data[0]; |
| | | |
| | | |
| | | // 根据当前上传类型设置type字段 |
| | | let typeValue = 0; // 默认为生产前 |
| | | switch (currentUploadType.value) { |
| | |
| | | typeValue = 2; |
| | | break; |
| | | } |
| | | |
| | | |
| | | // 确保上传的文件数据完整,包含id和type |
| | | const fileData = { |
| | | ...file, |
| | |
| | | createTime: uploadedFile.createTime || new Date().getTime(), |
| | | type: typeValue // 添加类型字段:0=生产前, 1=生产中, 2=生产后 |
| | | }; |
| | | |
| | | console.log(`${getUploadTypeText()}文件上传成功,类型值:`, typeValue, '文件数据:', fileData); |
| | | |
| | | |
| | | uploadList.value.push(fileData); |
| | | uploadedSuccessfully(); |
| | | } else { |
| | |
| | | issueModelValue.value = [...issueModelValue.value, ...uploadList.value]; |
| | | break; |
| | | } |
| | | |
| | | |
| | | // 重置状态 |
| | | uploadList.value = []; |
| | | number.value = 0; |
| | | |
| | | console.log(`${getUploadTypeText()}文件上传完成:`, getCurrentFiles()); |
| | | } |
| | | } |
| | | |
| | |
| | | color: #333; |
| | | } |
| | | |
| | | /* 异常状态选择样式 */ |
| | | .exception-section { |
| | | margin-bottom: 20px; |
| | | padding: 15px; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | border: 1px solid #e9ecef; |
| | | } |
| | | |
| | | .section-title { |
| | | display: block; |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .exception-options { |
| | | display: flex; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .exception-option { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | gap: 8px; |
| | | padding: 12px 16px; |
| | | background: #fff; |
| | | border: 2px solid #e9ecef; |
| | | border-radius: 8px; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | font-size: 14px; |
| | | color: #666; |
| | | } |
| | | |
| | | .exception-option.active { |
| | | border-color: #409eff; |
| | | background: #f0f8ff; |
| | | color: #409eff; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .exception-option:hover:not(.active) { |
| | | border-color: #d9d9d9; |
| | | background: #fafafa; |
| | | } |
| | | |
| | | /* 统计信息样式 */ |
| | | .upload-summary { |
| | | margin-top: 15px; |