| | |
| | | <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="{ |
| | | <u-button type="primary" |
| | | size="small" |
| | | @click.stop="startScanForTask(item)" |
| | | :customStyle="{ |
| | | borderRadius: '15px', |
| | | height: '30px', |
| | | fontSize: '12px', |
| | |
| | | }"> |
| | | æ«ç ä¸ä¼ |
| | | </u-button> |
| | | <u-button type="success" size="small" @click.stop="viewAttachments(item)" :customStyle="{ |
| | | <u-button type="success" |
| | | size="small" |
| | | @click.stop="viewAttachments(item)" |
| | | :customStyle="{ |
| | | borderRadius: '15px', |
| | | height: '30px', |
| | | fontSize: '12px' |
| | |
| | | <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> |
| | | <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="showUploadDialog" class="custom-modal-overlay" @click="closeUploadDialog"> |
| | | <view class="custom-modal-container" @click.stop> |
| | | <view v-if="showUploadDialog" |
| | | class="custom-modal-overlay" |
| | | @click="closeUploadDialog"> |
| | | <view class="custom-modal-container" |
| | | @click.stop> |
| | | <view class="upload-popup-content"> |
| | | <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 class="tab-item" |
| | | :class="{ active: currentUploadType === 'before' }" |
| | | @click="switchUploadType('before')"> |
| | | ç产å |
| | | </view> |
| | | <view class="tab-item" :class="{ active: currentUploadType === 'after' }" |
| | | @click="switchUploadType('after')"> |
| | | <view class="tab-item" |
| | | :class="{ active: currentUploadType === 'after' }" |
| | | @click="switchUploadType('after')"> |
| | | çäº§ä¸ |
| | | </view> |
| | | <view class="tab-item" :class="{ active: currentUploadType === 'issue' }" |
| | | @click="switchUploadType('issue')"> |
| | | <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> |
| | | <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 class="exception-option" :class="{ active: hasException === true }" |
| | | @click="setExceptionStatus(true)"> |
| | | <u-icon name="close-circle" size="20" color="#ff4d4f"></u-icon> |
| | | <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> |
| | | <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> |
| | | <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 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 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' || (file.type !== 'video' && !file.type)" |
| | | :src="file.url || file.tempFilePath || file.path || file.downloadUrl" |
| | | class="file-preview" mode="aspectFill" /> |
| | | <view v-else-if="file.type === 'video'" class="video-preview"> |
| | | <uni-icons type="videocam" name="videocam" size="18" color="#fff" |
| | | style="margin-right: 5px;"></uni-icons> |
| | | :src="file.url || file.tempFilePath || file.path || file.downloadUrl" |
| | | class="file-preview" |
| | | mode="aspectFill" /> |
| | | <view v-else-if="file.type === 'video'" |
| | | 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 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> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-if="getCurrentFiles().length === 0" class="empty-state"> |
| | | <view v-if="getCurrentFiles().length === 0" |
| | | class="empty-state"> |
| | | <text>è¯·éæ©è¦ä¸ä¼ ç{{ getUploadTypeText() }}å¾çæè§é¢</text> |
| | | </view> |
| | | |
| | | <!-- ç»è®¡ä¿¡æ¯ --> |
| | | <view class="upload-summary"> |
| | | <text class="summary-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 @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> |
| | | <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> |
| | | <view v-if="showAttachmentDialog" |
| | | class="custom-modal-overlay" |
| | | @click="closeAttachmentDialog"> |
| | | <view class="custom-modal-container" |
| | | @click.stop> |
| | | <view class="attachment-popup-content"> |
| | | <view class="attachment-popup-header"> |
| | | <text class="attachment-popup-title">æ¥çéä»¶ - {{ currentViewTask?.taskName }}</text> |
| | | <view class="close-btn-attachment" @click="closeAttachmentDialog"> |
| | | <u-icon name="close" size="16" color="#666"></u-icon> |
| | | <view class="close-btn-attachment" |
| | | @click="closeAttachmentDialog"> |
| | | <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-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="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> |
| | | <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> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view v-else class="attachment-empty"> |
| | | <view v-else |
| | | class="attachment-empty"> |
| | | <text>该åç±»ææ éä»¶</text> |
| | | </view> |
| | | </view> |
| | |
| | | </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="16" color="#fff"></u-icon> |
| | | <view class="close-btn-video" |
| | | @click="closeVideoPreview"> |
| | | <u-icon name="close" |
| | | size="16" |
| | | 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> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | 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 { getToken } from "@/utils/auth"; |
| | | import config from '@/config' |
| | | 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 { getToken } from "@/utils/auth"; |
| | | import config from "@/config"; |
| | | |
| | | // ç»ä»¶å¼ç¨å·²ç§»é¤ |
| | | // ç»ä»¶å¼ç¨å·²ç§»é¤ |
| | | |
| | | // å è½½æç¤ºæ¹æ³ |
| | | const showLoadingToast = (message) => { |
| | | uni.showLoading({ |
| | | title: message, |
| | | mask: true |
| | | }) |
| | | } |
| | | const closeToast = () => { |
| | | uni.hideLoading() |
| | | } |
| | | |
| | | // è¡¨æ ¼æ°æ® |
| | | const taskTableData = ref([]) // çäº§å·¡æ£æ°æ® |
| | | |
| | | // å½åæ«æçä»»å¡ |
| | | const currentScanningTask = ref(null) |
| | | const infoData = ref(null); |
| | | |
| | | // ä¸ä¼ ç¸å
³ç¶æ |
| | | const showUploadDialog = ref(false) |
| | | const uploadFiles = ref([]) // ä¿çç¨äºå
¼å®¹æ§ |
| | | const uploadStatusType = ref(0) |
| | | const uploading = ref(false) |
| | | const uploadProgress = ref(0) |
| | | const number = ref(0) |
| | | const uploadList = ref([]) |
| | | |
| | | // ä¸ä¸ªåç±»çä¸ä¼ ç¶æ |
| | | const beforeModelValue = ref([]) // ç产å |
| | | const afterModelValue = ref([]) // çäº§ä¸ |
| | | const issueModelValue = ref([]) // ç产å |
| | | |
| | | // å½åæ¿æ´»çä¸ä¼ ç±»å |
| | | const currentUploadType = ref('before') // 'before', 'after', 'issue' |
| | | |
| | | // æ¥çéä»¶ç¸å
³ç¶æ |
| | | const showAttachmentDialog = ref(false) |
| | | const currentViewTask = ref(null) |
| | | const currentViewType = ref('before') // 'before', 'after', 'issue' |
| | | const attachmentList = ref([]) // å½åæ¥çä»»å¡çéä»¶å表 |
| | | |
| | | // è§é¢é¢è§ç¸å
³ç¶æ |
| | | const showVideoDialog = ref(false) |
| | | const currentVideoFile = ref(null) |
| | | |
| | | // å¼å¸¸ç¶æ |
| | | const hasException = ref(null) // null: æªéæ©, true: åå¨å¼å¸¸, false: æ£å¸¸ |
| | | |
| | | // ä¸ä¼ é
ç½® |
| | | const uploadConfig = { |
| | | action: "/file/upload", |
| | | limit: 10, |
| | | fileSize: 50, // MB |
| | | fileType: ['jpg', 'jpeg', 'png', 'mp4', 'mov'], |
| | | maxVideoDuration: 60 // ç§ |
| | | } |
| | | |
| | | // 计ç®ä¸ä¼ URL |
| | | const uploadFileUrl = computed(() => { |
| | | const baseUrl = 'http://114.132.189.42:9030'; |
| | | |
| | | return baseUrl + uploadConfig.action; |
| | | }) |
| | | |
| | | // 计ç®è¯·æ±å¤´ |
| | | const headers = computed(() => { |
| | | const token = getToken(); |
| | | return token ? { Authorization: "Bearer " + token } : {}; |
| | | }) |
| | | |
| | | // 请æ±åæ¶æ å¿ï¼ç¨äºåæ¶æ£å¨è¿è¡çè¯·æ± |
| | | let isRequestCancelled = false |
| | | |
| | | 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() |
| | | // }) |
| | | }) |
| | | |
| | | onReachBottom(() => { |
| | | loadPage() |
| | | }) |
| | | onPullDownRefresh(() => { |
| | | reloadPage() |
| | | uni.stopPullDownRefresh() |
| | | }) |
| | | |
| | | onShow(() => { |
| | | // 页颿¾ç¤ºæ¶å·æ°æ°æ® |
| | | reloadPage() |
| | | }) |
| | | |
| | | // ç»ä»¶éæ¯æ¶çæ¸
ç |
| | | onUnmounted(() => { |
| | | // è®¾ç½®åæ¶æ å¿ï¼é»æ¢åç»ç弿¥æä½ |
| | | isRequestCancelled = true |
| | | |
| | | // å
³éä¸ä¼ å¼¹çª |
| | | if (showUploadDialog.value) { |
| | | showUploadDialog.value = false |
| | | } |
| | | }) |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | |
| | | |
| | | // è·ååè¡¨æ°æ® |
| | | const getList = () => { |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | // showLoadingToast('å è½½ä¸...') |
| | | |
| | | // è®¾ç½®åæ¶æ å¿ |
| | | isRequestCancelled = false |
| | | loading.value = true |
| | | inspectionTaskList({...pagesPames}).then(res => { |
| | | // æ£æ¥ç»ä»¶æ¯å¦è¿åå¨ä¸è¯·æ±æªè¢«åæ¶ |
| | | if (!isRequestCancelled) { |
| | | // å¤çä¸åçæ°æ®ç»æ |
| | | 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.rows; |
| | | } else if (Array.isArray(res.data)) { |
| | | records = res.data; |
| | | } else if (Array.isArray(res.data.list)) { |
| | | records = res.data.list; |
| | | } |
| | | } |
| | | |
| | | if (records.length > 0) { |
| | | taskTableData.value = [...taskTableData.value,...records.map((record)=>{ |
| | | record.fileStatus = getFileStatus(record) |
| | | return record |
| | | })]; |
| | | } else { |
| | | taskTableData.value = []; |
| | | uni.showToast({ |
| | | title: 'ææ å·¡æ£ä»»å¡æ°æ®', |
| | | icon: 'none' |
| | | }); |
| | | } |
| | | } |
| | | loading.value =false |
| | | // å
³éå è½½æç¤º |
| | | // closeToast() |
| | | }).catch(err => { |
| | | // æ£æ¥ç»ä»¶æ¯å¦è¿åå¨ä¸è¯·æ±æªè¢«åæ¶ |
| | | if (!isRequestCancelled) { |
| | | taskTableData.value = []; |
| | | // æ·»å é误æç¤º |
| | | uni.showToast({ |
| | | title: 'è·åæ°æ®å¤±è´¥', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | loading.value =false |
| | | // å
³éå è½½æç¤º |
| | | // 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 |
| | | } |
| | | } |
| | | |
| | | // 为æå®ä»»å¡å¼å§æ«ç ï¼çæºï¼ |
| | | const startScanForTask = async (task) => { |
| | | try { |
| | | currentScanningTask.value = task |
| | | uni.scanCode({ |
| | | success: (res) => { |
| | | handleScanSuccess(res) |
| | | }, |
| | | fail: (err) => { |
| | | console.error('æ«ç 失败:', err) |
| | | uni.showToast({ |
| | | title: 'æ«ç 失败', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | }) |
| | | } catch (e) { |
| | | console.error('å¯å¨æ«ç 失败:', e) |
| | | uni.showToast({ |
| | | title: 'å¯å¨æ«ç 失败', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // æ«ç æåå¤çï¼æ ¡éªåæå¼ä¸ä¼ å¼¹çª |
| | | const handleScanSuccess = (result) => { |
| | | try { |
| | | // è§£æäºç»´ç æ°æ®ï¼æådeviceId |
| | | let deviceId = '' |
| | | |
| | | if (result?.result && typeof result.result === 'string') { |
| | | if (result.result.includes('deviceId=')) { |
| | | const match = result.result.match(/deviceId=(\d+)/) |
| | | if (match && match[1]) deviceId = match[1] |
| | | } else { |
| | | try { |
| | | const qrData = JSON.parse(result.result) |
| | | deviceId = qrData.deviceId || qrData.qrCodeId || '' |
| | | } catch (e) { |
| | | deviceId = result.result |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!deviceId) { |
| | | uni.showToast({ title: 'æªè¯å«å°è®¾å¤ID', icon: 'error' }) |
| | | return |
| | | } |
| | | |
| | | const currentTaskId = currentScanningTask.value?.taskId || currentScanningTask.value?.id |
| | | if (!currentTaskId) { |
| | | uni.showToast({ title: 'ä»»å¡ä¿¡æ¯ç¼ºå¤±', icon: 'error' }) |
| | | return |
| | | } |
| | | |
| | | if (deviceId === currentTaskId.toString()) { |
| | | uni.showToast({ title: 'è¯å«æå', icon: 'success' }) |
| | | openUploadDialog(currentScanningTask.value) |
| | | } else { |
| | | uni.showToast({ title: 'è¯·æ«ææ£ç¡®ç设å¤', icon: 'error' }) |
| | | } |
| | | } catch (error) { |
| | | console.error('æ«ç ç»æå¤ç失败:', error) |
| | | uni.showToast({ |
| | | title: error?.message || 'æ°æ®è§£æå¤±è´¥', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | // æå¼ä¸ä¼ å¼¹çª |
| | | const openUploadDialog = (task) => { |
| | | // 设置任å¡ä¿¡æ¯å°infoData |
| | | if (task) { |
| | | infoData.value = { |
| | | ...task, |
| | | taskId: task.taskId || task.id, |
| | | storageBlobDTO: [] // åå§åæä»¶å表 |
| | | }; |
| | | } |
| | | |
| | | // 设置ä¸ä¼ ç¶æç±»åï¼å¯ä»¥æ ¹æ®ä»»å¡ç±»å设置ä¸åçç¶æï¼ |
| | | uploadStatusType.value = 0 // é»è®¤ç¶æ |
| | | |
| | | // æ¸
空ä¹åçæä»¶ |
| | | uploadFiles.value = [] |
| | | |
| | | // æ¾ç¤ºä¸ä¼ å¼¹çª |
| | | showUploadDialog.value = true |
| | | } |
| | | |
| | | // å
³éä¸ä¼ å¼¹çª |
| | | const closeUploadDialog = () => { |
| | | showUploadDialog.value = false |
| | | uploadFiles.value = [] |
| | | // æ¸
çä¸ä¸ªåç±»çæ°æ® |
| | | beforeModelValue.value = [] |
| | | afterModelValue.value = [] |
| | | issueModelValue.value = [] |
| | | currentUploadType.value = 'before' |
| | | hasException.value = null // éç½®å¼å¸¸ç¶æ |
| | | infoData.value = null // æ¸
ç任塿°æ® |
| | | } |
| | | |
| | | // 忢ä¸ä¼ ç±»å |
| | | const switchUploadType = (type) => { |
| | | currentUploadType.value = type |
| | | } |
| | | |
| | | // è·åå½ååç±»çæä»¶å表 |
| | | const getCurrentFiles = () => { |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | return beforeModelValue.value||[] |
| | | case 'after': |
| | | return afterModelValue.value||[] |
| | | case 'issue': |
| | | return issueModelValue.value||[] |
| | | default: |
| | | return [] |
| | | } |
| | | } |
| | | |
| | | // è·åä¸ä¼ ç±»åææ¬ |
| | | const getUploadTypeText = () => { |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | return 'ç产å' |
| | | case 'after': |
| | | return 'ç产ä¸' |
| | | case 'issue': |
| | | return 'ç产å' |
| | | default: |
| | | return '' |
| | | } |
| | | } |
| | | |
| | | // å¤çä¸ä¼ æä»¶æ´æ° |
| | | const handleUploadUpdate = (files) => { |
| | | uploadFiles.value = 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) { |
| | | uni.showToast({ |
| | | title: '请å
ä¸ä¼ æä»¶', |
| | | icon: 'none' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // æ¾ç¤ºæäº¤ä¸çå è½½æç¤º |
| | | showLoadingToast('æäº¤ä¸...') |
| | | |
| | | // æç
§æ¨çé»è¾åå¹¶ææåç±»çæä»¶ |
| | | let arr = []; |
| | | if (beforeModelValue.value.length > 0) { |
| | | arr.push(...beforeModelValue.value); |
| | | } |
| | | if (afterModelValue.value.length > 0) { |
| | | arr.push(...afterModelValue.value); |
| | | } |
| | | if (issueModelValue.value.length > 0) { |
| | | arr.push(...issueModelValue.value); |
| | | } |
| | | |
| | | // ä¼ ç»å端çä¸´æ¶æä»¶IDå表ï¼tempFileIdsï¼ |
| | | // å
¼å®¹ï¼æäºæ¥å£å¯è½è¿å tempId / tempFileId / id |
| | | let tempFileIds = [] |
| | | if (arr !== null && arr.length > 0) { |
| | | tempFileIds = arr |
| | | .map((item) => item?.tempId ?? item?.tempFileId ?? item?.id) |
| | | .filter((v) => v !== undefined && v !== null && v !== '') |
| | | } |
| | | |
| | | // æäº¤æ°æ® |
| | | infoData.value.storageBlobDTO = arr; |
| | | // æ·»å å¼å¸¸ç¶æä¿¡æ¯ |
| | | infoData.value.hasException = hasException.value; |
| | | infoData.value.tempFileIds = tempFileIds; |
| | | const result = await uploadInspectionTask({ ...infoData.value }); |
| | | |
| | | // æ£æ¥æäº¤ç»æ |
| | | if (result && (result.code === 200 || result.success)) { |
| | | // æäº¤æå |
| | | closeToast(); // å
³éå è½½æç¤º |
| | | |
| | | uni.showToast({ |
| | | title: 'æäº¤æå', |
| | | icon: 'success' |
| | | }) |
| | | |
| | | // å
³éå¼¹çª |
| | | closeUploadDialog() |
| | | |
| | | // å·æ°å表 |
| | | setTimeout(() => { |
| | | reloadPage() |
| | | }, 500) |
| | | |
| | | } else { |
| | | // æäº¤å¤±è´¥ |
| | | closeToast(); |
| | | uni.showToast({ |
| | | title: result?.msg || result?.message || 'æäº¤å¤±è´¥', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | |
| | | } catch (error) { |
| | | console.error('æäº¤ä¸ä¼ 失败:', error) |
| | | closeToast(); // å
³éå è½½æç¤º |
| | | |
| | | let errorMessage = 'æäº¤å¤±è´¥'; |
| | | if (error.message) { |
| | | errorMessage = error.message; |
| | | } else if (error.msg) { |
| | | errorMessage = error.msg; |
| | | } else if (typeof error === 'string') { |
| | | errorMessage = error; |
| | | } |
| | | |
| | | uni.showToast({ |
| | | title: errorMessage, |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // æ¥çéä»¶ |
| | | const viewAttachments = async (task) => { |
| | | try { |
| | | currentViewTask.value = task |
| | | currentViewType.value = 'before' |
| | | |
| | | // è§£ææ°çæ°æ®ç»æ |
| | | attachmentList.value = [] |
| | | |
| | | // åç«¯åæ¾åæ®µï¼ä½ æä¾çæ°æ®ç»æï¼ï¼ |
| | | // - commonFileListBeforeï¼ç产åï¼é常 type=10ï¼ |
| | | // - commonFileListAfterï¼ç产ä¸ï¼é常 type=11ï¼ |
| | | // - commonFileListï¼å¯è½æ¯å
¨é¨/å
åºï¼è¥å
å«ç产åï¼ä¸è¬ type=12ï¼ |
| | | 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) |
| | | // 妿å端åç»è¡¥äº commonFileListIssueï¼åä¼å
ç¨ï¼å¦åä» commonFileList éæ type=12 å
åº |
| | | const issueList = Array.isArray(task?.commonFileListIssue) |
| | | ? task.commonFileListIssue |
| | | : allList.filter(f => f?.type === 12) |
| | | |
| | | const mapToViewFile = (file, viewType) => { |
| | | const u = normalizeFileUrl(file?.url || file?.downloadUrl || '') |
| | | return { |
| | | ...file, |
| | | // ç¨äºä¸æ ç¾é¡µåç»ï¼0=ç产å 1=çäº§ä¸ 2=ç产å |
| | | 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, |
| | | } |
| | | } |
| | | |
| | | 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))) |
| | | |
| | | showAttachmentDialog.value = true |
| | | |
| | | } catch (error) { |
| | | uni.showToast({ |
| | | title: 'è·åé件失败', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // å
³ééä»¶æ¥çå¼¹çª |
| | | const closeAttachmentDialog = () => { |
| | | showAttachmentDialog.value = false |
| | | currentViewTask.value = null |
| | | attachmentList.value = [] |
| | | currentViewType.value = 'before' |
| | | } |
| | | |
| | | // 忢æ¥çç±»å |
| | | const switchViewType = (type) => { |
| | | currentViewType.value = type |
| | | } |
| | | |
| | | // æ ¹æ®typeè·å对åºåç±»çéä»¶ |
| | | const getAttachmentsByType = (typeValue) => { |
| | | return attachmentList.value.filter(file => file.type === typeValue) || [] |
| | | } |
| | | // è·åtypeå¼ |
| | | const getTabType = () => { |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | return 10 |
| | | case 'after': |
| | | return 11 |
| | | case 'issue': |
| | | return 12 |
| | | default: |
| | | return 10 |
| | | } |
| | | } |
| | | // è·åå½åæ¥çç±»åçéä»¶ |
| | | 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) => { |
| | | // æ£æ¥contentTypeåæ®µ |
| | | 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() |
| | | return ['jpg', 'jpeg', 'png', 'gif', 'webp'].includes(ext) |
| | | } |
| | | |
| | | // æä»¶è®¿é®åºç¡åï¼åç«¯è¦æ±åç¼ï¼ |
| | | const filePreviewBase = 'http://114.132.189.42:9098' |
| | | |
| | | // å°å端è¿åçæä»¶å°åè§èæå¯è®¿é®URL |
| | | // å
¼å®¹åºæ¯ï¼ |
| | | // - å·²ç»æ¯ http/httpsï¼ç´æ¥è¿å |
| | | // - 以 / å¼å¤´ï¼æ¼æ¥ filePreviewBase |
| | | // - Windows æ¬å°è·¯å¾ï¼å¦ D:\ruoyi\prod\uploads...\xx.jpgï¼ï¼å°è¯æªå prod ä¹åçç¸å¯¹è·¯å¾å¹¶æ¼æ¥ filePreviewBase |
| | | 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}` |
| | | } |
| | | // å
åºï¼æ æ³æ¨ææ å°è§åæ¶ï¼è³å°æåææ åææ£ææ |
| | | return normalized |
| | | } |
| | | |
| | | // å
¶ä»ç¸å¯¹è·¯å¾ï¼ç´æ¥ç¨ baseUrl æ¼ä¸ä¸ |
| | | return `${filePreviewBase}/${url.replace(/^\//, '')}` |
| | | } catch (e) { |
| | | return rawUrl || '' |
| | | } |
| | | } |
| | | |
| | | // é¢è§éä»¶ |
| | | 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) |
| | | } |
| | | } |
| | | |
| | | // æ¾ç¤ºè§é¢é¢è§ |
| | | const showVideoPreview = (file) => { |
| | | currentVideoFile.value = file |
| | | showVideoDialog.value = true |
| | | } |
| | | |
| | | // å
³éè§é¢é¢è§ |
| | | const closeVideoPreview = () => { |
| | | showVideoDialog.value = false |
| | | currentVideoFile.value = null |
| | | } |
| | | |
| | | // è§é¢ææ¾é误å¤ç |
| | | const handleVideoError = (error) => { |
| | | uni.showToast({ |
| | | title: 'è§é¢ææ¾å¤±è´¥', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | |
| | | // æç
§/æè§é¢ï¼çæºä¼å
ç¨ chooseMediaï¼ä¸æ¯æåéçº§ï¼ |
| | | const chooseMedia = (type) => { |
| | | if (getCurrentFiles().length >= uploadConfig.limit) { |
| | | uni.showToast({ title: `æå¤åªè½éæ©${uploadConfig.limit}个æä»¶`, icon: 'none' }) |
| | | return |
| | | } |
| | | |
| | | const remaining = uploadConfig.limit - getCurrentFiles().length |
| | | |
| | | // ä¼å
ï¼chooseMediaï¼æ¯æ image/videoï¼ |
| | | if (typeof uni.chooseMedia === 'function') { |
| | | uni.chooseMedia({ |
| | | count: Math.min(remaining, 1), |
| | | mediaType: [type || 'image'], |
| | | sizeType: ['compressed', 'original'], |
| | | sourceType: ['camera'], |
| | | success: (res) => { |
| | | try { |
| | | const files = res?.tempFiles || [] |
| | | if (!files.length) throw new Error('æªè·åå°æä»¶') |
| | | |
| | | files.forEach((tf, idx) => { |
| | | const filePath = tf.tempFilePath || tf.path || '' |
| | | const fileType = tf.fileType || type || 'image' |
| | | const ext = fileType === 'video' ? 'mp4' : 'jpg' |
| | | const file = { |
| | | tempFilePath: filePath, |
| | | path: filePath, |
| | | type: fileType, |
| | | name: `${fileType}_${Date.now()}_${idx}.${ext}`, |
| | | size: tf.size || 0, |
| | | duration: tf.duration || 0, |
| | | createTime: Date.now(), |
| | | uid: Date.now() + Math.random() + idx |
| | | } |
| | | handleBeforeUpload(file) |
| | | }) |
| | | } catch (e) { |
| | | console.error('å¤çææç»æå¤±è´¥:', e) |
| | | uni.showToast({ title: 'å¤çæä»¶å¤±è´¥', icon: 'error' }) |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | console.error('ææå¤±è´¥:', err) |
| | | uni.showToast({ title: 'ææå¤±è´¥', icon: 'error' }) |
| | | } |
| | | }) |
| | | return |
| | | } |
| | | |
| | | // é级ï¼chooseImage / chooseVideo |
| | | if (type === 'video') { |
| | | chooseVideo() |
| | | } else { |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | sizeType: ['compressed', 'original'], |
| | | sourceType: ['camera'], |
| | | success: (res) => { |
| | | const tempFilePath = res?.tempFilePaths?.[0] |
| | | const tempFile = res?.tempFiles?.[0] || {} |
| | | if (!tempFilePath) return |
| | | handleBeforeUpload({ |
| | | tempFilePath, |
| | | path: tempFilePath, |
| | | type: 'image', |
| | | name: `photo_${Date.now()}.jpg`, |
| | | size: tempFile.size || 0, |
| | | createTime: Date.now(), |
| | | uid: Date.now() + Math.random() |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | // æç
§ |
| | | const chooseImage = () => { |
| | | if (uploadFiles.value.length >= uploadConfig.limit) { |
| | | uni.showToast({ |
| | | title: `æå¤åªè½ææ${uploadConfig.limit}个æä»¶`, |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | uni.chooseMedia({ |
| | | count: 1, |
| | | mediaType: ['image', 'video'], |
| | | sizeType: ['compressed', 'original'], |
| | | sourceType: ['camera'], |
| | | 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' |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // æè§é¢ |
| | | const chooseVideo = () => { |
| | | if (uploadFiles.value.length >= uploadConfig.limit) { |
| | | uni.showToast({ |
| | | title: `æå¤åªè½ææ${uploadConfig.limit}个æä»¶`, |
| | | icon: 'none' |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | uni.chooseVideo({ |
| | | sourceType: ['camera'], |
| | | maxDuration: uploadConfig.maxVideoDuration, |
| | | camera: 'back', |
| | | success: (res) => { |
| | | try { |
| | | if (!res.tempFilePath) { |
| | | throw new Error('æªè·åå°è§é¢æä»¶'); |
| | | } |
| | | |
| | | const file = { |
| | | tempFilePath: res.tempFilePath, |
| | | path: res.tempFilePath, // ä¿æå
¼å®¹æ§ |
| | | type: 'video', |
| | | name: `video_${Date.now()}.mp4`, |
| | | size: res.size || 0, |
| | | duration: res.duration || 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' |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // å 餿件 |
| | | const removeFile = (index) => { |
| | | uni.showModal({ |
| | | title: '确认å é¤', |
| | | content: 'ç¡®å®è¦å é¤è¿ä¸ªæä»¶åï¼', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | // æ ¹æ®å½åä¸ä¼ ç±»åå é¤å¯¹åºåç±»çæä»¶ |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | beforeModelValue.value.splice(index, 1); |
| | | break; |
| | | case 'after': |
| | | afterModelValue.value.splice(index, 1); |
| | | break; |
| | | case 'issue': |
| | | issueModelValue.value.splice(index, 1); |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: 'å 餿å', |
| | | icon: 'success' |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // æ£æ¥ç½ç»è¿æ¥ |
| | | const checkNetworkConnection = () => { |
| | | return new Promise((resolve) => { |
| | | uni.getNetworkType({ |
| | | success: (res) => { |
| | | if (res.networkType === 'none') { |
| | | resolve(false); |
| | | } else { |
| | | resolve(true); |
| | | } |
| | | }, |
| | | fail: () => { |
| | | resolve(false); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | // ä¸ä¼ åæ ¡éª |
| | | const handleBeforeUpload = async (file) => { |
| | | |
| | | // æ ¡éªæä»¶ç±»å |
| | | 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') { |
| | | expectedTypes = ['jpg', 'jpeg', 'png', 'gif', 'webp']; |
| | | } else if (file.type === 'video') { |
| | | expectedTypes = ['mp4', 'mov', 'avi', 'wmv']; |
| | | } |
| | | |
| | | // æ£æ¥æä»¶æ©å±åæ¯å¦å¨å
许çç±»åä¸ |
| | | if (fileExtension && expectedTypes.length > 0) { |
| | | const isAllowed = expectedTypes.some(type => |
| | | uploadConfig.fileType.includes(type) && type === fileExtension |
| | | ); |
| | | |
| | | if (!isAllowed) { |
| | | uni.showToast({ |
| | | title: `æä»¶æ ¼å¼ä¸æ¯æï¼è¯·ææ ${expectedTypes.join('/')} æ ¼å¼çæä»¶`, |
| | | icon: 'none' |
| | | }); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ ¡éªéè¿ï¼å¼å§ä¸ä¼ |
| | | uploadFile(file); |
| | | return true; |
| | | } |
| | | |
| | | // æä»¶ä¸ä¼ å¤çï¼çæºèµ° uni.uploadFileï¼ |
| | | const uploadFile = async (file) => { |
| | | uploading.value = true; |
| | | uploadProgress.value = 0; |
| | | number.value++; // å¢å ä¸ä¼ è®¡æ° |
| | | |
| | | // ç¡®ä¿tokenåå¨ |
| | | const token = getToken(); |
| | | if (!token) { |
| | | handleUploadError('ç¨æ·æªç»å½'); |
| | | return; |
| | | } |
| | | |
| | | const typeValue = getTabType(); // ç产å:10, ç产ä¸:11, ç产å:12 |
| | | |
| | | uploadWithUniUploadFile(file, file.tempFilePath || file.path || '', typeValue, token); |
| | | } |
| | | |
| | | // 使ç¨uni.uploadFileä¸ä¼ ï¼éH5ç¯å¢æH5åéæ¹æ¡ï¼ |
| | | const uploadWithUniUploadFile = (file, filePath, typeValue, token) => { |
| | | if (!filePath) { |
| | | handleUploadError('æä»¶è·¯å¾ä¸åå¨'); |
| | | return; |
| | | } |
| | | |
| | | const uploadTask = uni.uploadFile({ |
| | | url: uploadFileUrl.value, |
| | | filePath: filePath, |
| | | name: 'file', |
| | | formData: { |
| | | type: typeValue |
| | | }, |
| | | header: { |
| | | 'Authorization': `Bearer ${token}` |
| | | }, |
| | | success: (res) => { |
| | | try { |
| | | if (res.statusCode === 200) { |
| | | const response = JSON.parse(res.data); |
| | | if (response.code === 200) { |
| | | handleUploadSuccess(response, file); |
| | | uni.showToast({ |
| | | title: 'ä¸ä¼ æå', |
| | | icon: 'success' |
| | | }); |
| | | } else { |
| | | handleUploadError(response.msg || 'æå¡å¨è¿åé误'); |
| | | } |
| | | } else { |
| | | handleUploadError(`æå¡å¨é误ï¼ç¶æç : ${res.statusCode}`); |
| | | } |
| | | } catch (e) { |
| | | console.error('è§£æååºå¤±è´¥:', e); |
| | | console.error('åå§ååºæ°æ®:', res.data); |
| | | handleUploadError('ååºæ°æ®è§£æå¤±è´¥: ' + e.message); |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | console.error('ä¸ä¼ 失败:', err.errMsg || err); |
| | | number.value--; // ä¸ä¼ 失败æ¶åå°è®¡æ° |
| | | |
| | | let errorMessage = 'ä¸ä¼ 失败'; |
| | | if (err.errMsg) { |
| | | if (err.errMsg.includes('statusCode: null')) { |
| | | errorMessage = 'ç½ç»è¿æ¥å¤±è´¥ï¼è¯·æ£æ¥ç½ç»è®¾ç½®'; |
| | | } else if (err.errMsg.includes('timeout')) { |
| | | errorMessage = 'ä¸ä¼ è¶
æ¶ï¼è¯·éè¯'; |
| | | } else if (err.errMsg.includes('fail')) { |
| | | errorMessage = 'ä¸ä¼ 失败ï¼è¯·æ£æ¥ç½ç»è¿æ¥'; |
| | | } else { |
| | | errorMessage = err.errMsg; |
| | | } |
| | | } |
| | | |
| | | handleUploadError(errorMessage); |
| | | }, |
| | | complete: () => { |
| | | uploading.value = false; |
| | | uploadProgress.value = 0; |
| | | } |
| | | }); |
| | | |
| | | // çå¬ä¸ä¼ è¿åº¦ |
| | | if (uploadTask && uploadTask.onProgressUpdate) { |
| | | uploadTask.onProgressUpdate((res) => { |
| | | uploadProgress.value = res.progress; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // ä¸ä¼ 失败å¤ç |
| | | const handleUploadError = (message = 'ä¸ä¼ æä»¶å¤±è´¥', showRetry = false) => { |
| | | uploading.value = false; |
| | | uploadProgress.value = 0; |
| | | |
| | | if (showRetry) { |
| | | uni.showModal({ |
| | | title: 'ä¸ä¼ 失败', |
| | | content: message + 'ï¼æ¯å¦éè¯ï¼', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | // ç¨æ·éæ©éè¯ï¼è¿éå¯ä»¥éæ°è§¦åä¸ä¼ |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | // å è½½æç¤ºæ¹æ³ |
| | | const showLoadingToast = message => { |
| | | uni.showLoading({ |
| | | title: message, |
| | | icon: 'error' |
| | | mask: true, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // ä¸ä¼ æååè° |
| | | const handleUploadSuccess = (res, file) => { |
| | | console.log('ä¸ä¼ æåååº:', res); |
| | | |
| | | // å¤çä¸åçæ°æ®ç»æï¼å¯è½æ¯æ°ç»ï¼ä¹å¯è½æ¯å个对象 |
| | | let uploadedFile = null; |
| | | uploadedFile = res.data; |
| | | |
| | | if (!uploadedFile) { |
| | | console.error('æ æ³è§£æä¸ä¼ ååºæ°æ®:', res); |
| | | number.value--; // ä¸ä¼ 失败æ¶åå°è®¡æ° |
| | | handleUploadError('ä¸ä¼ ååºæ°æ®æ ¼å¼é误', false); |
| | | return; |
| | | } |
| | | |
| | | // æ ¹æ®å½åä¸ä¼ ç±»å设置typeåæ®µ |
| | | let typeValue = 0; // é»è®¤ä¸ºç产å |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | typeValue = 0; |
| | | break; |
| | | case 'after': |
| | | typeValue = 1; |
| | | break; |
| | | case 'issue': |
| | | typeValue = 2; |
| | | break; |
| | | } |
| | | |
| | | // ç¡®ä¿ä¸ä¼ çæä»¶æ°æ®å®æ´ï¼å
å«idåtype |
| | | const fileData = { |
| | | ...file, |
| | | id: uploadedFile.id, // æ·»å æå¡å¨è¿åçid |
| | | tempId: uploadedFile.tempId ?? uploadedFile.tempFileId ?? uploadedFile.id, |
| | | url: uploadedFile.url || uploadedFile.downloadUrl || file.tempFilePath || file.path, |
| | | bucketFilename: uploadedFile.bucketFilename || uploadedFile.originalFilename || file.name, |
| | | downloadUrl: uploadedFile.downloadUrl || uploadedFile.url, |
| | | size: uploadedFile.size || uploadedFile.byteSize || file.size, |
| | | createTime: uploadedFile.createTime || new Date().getTime(), |
| | | type: typeValue // æ·»å ç±»ååæ®µï¼0=ç产å, 1=ç产ä¸, 2=ç产å |
| | | }; |
| | | const closeToast = () => { |
| | | uni.hideLoading(); |
| | | }; |
| | | |
| | | uploadList.value.push(fileData); |
| | | |
| | | // ç«å³æ·»å å°å¯¹åºçåç±»ï¼ä¸çå¾
æææä»¶ä¸ä¼ 宿 |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | beforeModelValue.value.push(fileData); |
| | | break; |
| | | case 'after': |
| | | afterModelValue.value.push(fileData); |
| | | break; |
| | | case 'issue': |
| | | issueModelValue.value.push(fileData); |
| | | break; |
| | | } |
| | | |
| | | // éç½®ä¸ä¼ å表ï¼å ä¸ºå·²ç»æ·»å å°å¯¹åºåç±»äºï¼ |
| | | uploadList.value = []; |
| | | number.value = 0; |
| | | } |
| | | // è¡¨æ ¼æ°æ® |
| | | const taskTableData = ref([]); // çäº§å·¡æ£æ°æ® |
| | | |
| | | // ä¸ä¼ ç»æå¤çï¼å·²åºå¼ï¼ç°å¨å¨handleUploadSuccessä¸ç´æ¥å¤çï¼ |
| | | const uploadedSuccessfully = () => { |
| | | // æ¤å½æ°å·²ä¸å使ç¨ï¼æä»¶ä¸ä¼ æååç«å³æ·»å å°å¯¹åºåç±» |
| | | } |
| | | // å½åæ«æçä»»å¡ |
| | | const currentScanningTask = ref(null); |
| | | const infoData = ref(null); |
| | | |
| | | // æ ¼å¼åæä»¶å¤§å° |
| | | 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 showUploadDialog = ref(false); |
| | | const uploadFiles = ref([]); // ä¿çç¨äºå
¼å®¹æ§ |
| | | const uploadStatusType = ref(0); |
| | | const uploading = ref(false); |
| | | const uploadProgress = ref(0); |
| | | const number = ref(0); |
| | | const uploadList = ref([]); |
| | | |
| | | // ä¸ä¸ªåç±»çä¸ä¼ ç¶æ |
| | | const beforeModelValue = ref([]); // ç产å |
| | | const afterModelValue = ref([]); // çäº§ä¸ |
| | | const issueModelValue = ref([]); // ç产å |
| | | |
| | | // å½åæ¿æ´»çä¸ä¼ ç±»å |
| | | const currentUploadType = ref("before"); // 'before', 'after', 'issue' |
| | | |
| | | // æ¥çéä»¶ç¸å
³ç¶æ |
| | | const showAttachmentDialog = ref(false); |
| | | const currentViewTask = ref(null); |
| | | const currentViewType = ref("before"); // 'before', 'after', 'issue' |
| | | const attachmentList = ref([]); // å½åæ¥çä»»å¡çéä»¶å表 |
| | | |
| | | // è§é¢é¢è§ç¸å
³ç¶æ |
| | | const showVideoDialog = ref(false); |
| | | const currentVideoFile = ref(null); |
| | | |
| | | // å¼å¸¸ç¶æ |
| | | const hasException = ref(null); // null: æªéæ©, true: åå¨å¼å¸¸, false: æ£å¸¸ |
| | | |
| | | // ä¸ä¼ é
ç½® |
| | | const uploadConfig = { |
| | | action: "/file/upload", |
| | | limit: 10, |
| | | fileSize: 50, // MB |
| | | fileType: ["jpg", "jpeg", "png", "mp4", "mov"], |
| | | maxVideoDuration: 60, // ç§ |
| | | }; |
| | | |
| | | // 计ç®ä¸ä¼ URL |
| | | const uploadFileUrl = computed(() => { |
| | | const baseUrl = "http://114.132.189.42:9030"; |
| | | |
| | | return baseUrl + uploadConfig.action; |
| | | }); |
| | | |
| | | // 计ç®è¯·æ±å¤´ |
| | | const headers = computed(() => { |
| | | const token = getToken(); |
| | | return token ? { Authorization: "Bearer " + token } : {}; |
| | | }); |
| | | |
| | | // 请æ±åæ¶æ å¿ï¼ç¨äºåæ¶æ£å¨è¿è¡çè¯·æ± |
| | | let isRequestCancelled = false; |
| | | |
| | | 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() |
| | | // }) |
| | | }); |
| | | |
| | | onReachBottom(() => { |
| | | loadPage(); |
| | | }); |
| | | onPullDownRefresh(() => { |
| | | reloadPage(); |
| | | uni.stopPullDownRefresh(); |
| | | }); |
| | | |
| | | onShow(() => { |
| | | // 页颿¾ç¤ºæ¶å·æ°æ°æ® |
| | | reloadPage(); |
| | | }); |
| | | |
| | | // ç»ä»¶éæ¯æ¶çæ¸
ç |
| | | onUnmounted(() => { |
| | | // è®¾ç½®åæ¶æ å¿ï¼é»æ¢åç»ç弿¥æä½ |
| | | isRequestCancelled = true; |
| | | |
| | | // å
³éä¸ä¼ å¼¹çª |
| | | if (showUploadDialog.value) { |
| | | showUploadDialog.value = false; |
| | | } |
| | | }); |
| | | |
| | | // è¿åä¸ä¸é¡µ |
| | | const goBack = () => { |
| | | uni.navigateBack(); |
| | | }; |
| | | |
| | | // è·ååè¡¨æ°æ® |
| | | const getList = () => { |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | // showLoadingToast('å è½½ä¸...') |
| | | |
| | | // è®¾ç½®åæ¶æ å¿ |
| | | isRequestCancelled = false; |
| | | loading.value = true; |
| | | inspectionTaskList({ ...pagesPames }) |
| | | .then(res => { |
| | | // æ£æ¥ç»ä»¶æ¯å¦è¿åå¨ä¸è¯·æ±æªè¢«åæ¶ |
| | | if (!isRequestCancelled) { |
| | | // å¤çä¸åçæ°æ®ç»æ |
| | | 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.rows; |
| | | } else if (Array.isArray(res.data)) { |
| | | records = res.data; |
| | | } else if (Array.isArray(res.data.list)) { |
| | | records = res.data.list; |
| | | } |
| | | } |
| | | |
| | | if (records.length > 0) { |
| | | taskTableData.value = [ |
| | | ...taskTableData.value, |
| | | ...records.map(record => { |
| | | record.fileStatus = getFileStatus(record); |
| | | return record; |
| | | }), |
| | | ]; |
| | | } else { |
| | | taskTableData.value = []; |
| | | uni.showToast({ |
| | | title: "ææ å·¡æ£ä»»å¡æ°æ®", |
| | | icon: "none", |
| | | }); |
| | | } |
| | | } |
| | | loading.value = false; |
| | | // å
³éå è½½æç¤º |
| | | // closeToast() |
| | | }) |
| | | .catch(err => { |
| | | // æ£æ¥ç»ä»¶æ¯å¦è¿åå¨ä¸è¯·æ±æªè¢«åæ¶ |
| | | if (!isRequestCancelled) { |
| | | taskTableData.value = []; |
| | | // æ·»å é误æç¤º |
| | | uni.showToast({ |
| | | title: "è·åæ°æ®å¤±è´¥", |
| | | icon: "error", |
| | | }); |
| | | } |
| | | loading.value = false; |
| | | // å
³éå è½½æç¤º |
| | | // 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; |
| | | } |
| | | }; |
| | | |
| | | // 为æå®ä»»å¡å¼å§æ«ç ï¼çæºï¼ |
| | | const startScanForTask = async task => { |
| | | try { |
| | | currentScanningTask.value = task; |
| | | uni.scanCode({ |
| | | success: res => { |
| | | handleScanSuccess(res); |
| | | }, |
| | | fail: err => { |
| | | console.error("æ«ç 失败:", err); |
| | | uni.showToast({ |
| | | title: "æ«ç 失败", |
| | | icon: "error", |
| | | }); |
| | | }, |
| | | }); |
| | | } catch (e) { |
| | | console.error("å¯å¨æ«ç 失败:", e); |
| | | uni.showToast({ |
| | | title: "å¯å¨æ«ç 失败", |
| | | icon: "error", |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // æ«ç æåå¤çï¼æ ¡éªåæå¼ä¸ä¼ å¼¹çª |
| | | const handleScanSuccess = result => { |
| | | try { |
| | | // è§£æäºç»´ç æ°æ®ï¼æådeviceId |
| | | let deviceId = ""; |
| | | |
| | | if (result?.result && typeof result.result === "string") { |
| | | if (result.result.includes("deviceId=")) { |
| | | const match = result.result.match(/deviceId=(\d+)/); |
| | | if (match && match[1]) deviceId = match[1]; |
| | | } else { |
| | | try { |
| | | const qrData = JSON.parse(result.result); |
| | | deviceId = qrData.deviceId || qrData.qrCodeId || ""; |
| | | } catch (e) { |
| | | deviceId = result.result; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!deviceId) { |
| | | uni.showToast({ title: "æªè¯å«å°è®¾å¤ID", icon: "error" }); |
| | | return; |
| | | } |
| | | |
| | | const currentTaskId = |
| | | currentScanningTask.value?.taskId || currentScanningTask.value?.id; |
| | | if (!currentTaskId) { |
| | | uni.showToast({ title: "ä»»å¡ä¿¡æ¯ç¼ºå¤±", icon: "error" }); |
| | | return; |
| | | } |
| | | |
| | | if (deviceId === currentTaskId.toString()) { |
| | | uni.showToast({ title: "è¯å«æå", icon: "success" }); |
| | | openUploadDialog(currentScanningTask.value); |
| | | } else { |
| | | uni.showToast({ title: "è¯·æ«ææ£ç¡®ç设å¤", icon: "error" }); |
| | | } |
| | | } catch (error) { |
| | | console.error("æ«ç ç»æå¤ç失败:", error); |
| | | uni.showToast({ |
| | | title: error?.message || "æ°æ®è§£æå¤±è´¥", |
| | | icon: "error", |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // æå¼ä¸ä¼ å¼¹çª |
| | | const openUploadDialog = task => { |
| | | // 设置任å¡ä¿¡æ¯å°infoData |
| | | if (task) { |
| | | infoData.value = { |
| | | ...task, |
| | | taskId: task.taskId || task.id, |
| | | storageBlobDTO: [], // åå§åæä»¶å表 |
| | | }; |
| | | } |
| | | |
| | | // 设置ä¸ä¼ ç¶æç±»åï¼å¯ä»¥æ ¹æ®ä»»å¡ç±»å设置ä¸åçç¶æï¼ |
| | | uploadStatusType.value = 0; // é»è®¤ç¶æ |
| | | |
| | | // æ¸
空ä¹åçæä»¶ |
| | | uploadFiles.value = []; |
| | | |
| | | // æ¾ç¤ºä¸ä¼ å¼¹çª |
| | | showUploadDialog.value = true; |
| | | }; |
| | | |
| | | // å
³éä¸ä¼ å¼¹çª |
| | | const closeUploadDialog = () => { |
| | | showUploadDialog.value = false; |
| | | uploadFiles.value = []; |
| | | // æ¸
çä¸ä¸ªåç±»çæ°æ® |
| | | beforeModelValue.value = []; |
| | | afterModelValue.value = []; |
| | | issueModelValue.value = []; |
| | | currentUploadType.value = "before"; |
| | | hasException.value = null; // éç½®å¼å¸¸ç¶æ |
| | | infoData.value = null; // æ¸
ç任塿°æ® |
| | | }; |
| | | |
| | | // 忢ä¸ä¼ ç±»å |
| | | const switchUploadType = type => { |
| | | currentUploadType.value = type; |
| | | }; |
| | | |
| | | // è·åå½ååç±»çæä»¶å表 |
| | | const getCurrentFiles = () => { |
| | | switch (currentUploadType.value) { |
| | | case "before": |
| | | return beforeModelValue.value || []; |
| | | case "after": |
| | | return afterModelValue.value || []; |
| | | case "issue": |
| | | return issueModelValue.value || []; |
| | | default: |
| | | return []; |
| | | } |
| | | }; |
| | | |
| | | // è·åä¸ä¼ ç±»åææ¬ |
| | | const getUploadTypeText = () => { |
| | | switch (currentUploadType.value) { |
| | | case "before": |
| | | return "ç产å"; |
| | | case "after": |
| | | return "ç产ä¸"; |
| | | case "issue": |
| | | return "ç产å"; |
| | | default: |
| | | return ""; |
| | | } |
| | | }; |
| | | |
| | | // å¤çä¸ä¼ æä»¶æ´æ° |
| | | const handleUploadUpdate = files => { |
| | | uploadFiles.value = 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) { |
| | | uni.showToast({ |
| | | title: "请å
ä¸ä¼ æä»¶", |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // æ¾ç¤ºæäº¤ä¸çå è½½æç¤º |
| | | showLoadingToast("æäº¤ä¸..."); |
| | | |
| | | // æç
§æ¨çé»è¾åå¹¶ææåç±»çæä»¶ |
| | | let arr = []; |
| | | if (beforeModelValue.value.length > 0) { |
| | | arr.push(...beforeModelValue.value); |
| | | } |
| | | if (afterModelValue.value.length > 0) { |
| | | arr.push(...afterModelValue.value); |
| | | } |
| | | if (issueModelValue.value.length > 0) { |
| | | arr.push(...issueModelValue.value); |
| | | } |
| | | |
| | | // ä¼ ç»å端çä¸´æ¶æä»¶IDå表ï¼tempFileIdsï¼ |
| | | // å
¼å®¹ï¼æäºæ¥å£å¯è½è¿å tempId / tempFileId / id |
| | | let tempFileIds = []; |
| | | if (arr !== null && arr.length > 0) { |
| | | tempFileIds = arr |
| | | .map(item => item?.tempId ?? item?.tempFileId ?? item?.id) |
| | | .filter(v => v !== undefined && v !== null && v !== ""); |
| | | } |
| | | |
| | | // æäº¤æ°æ® |
| | | infoData.value.storageBlobDTO = arr; |
| | | // æ·»å å¼å¸¸ç¶æä¿¡æ¯ |
| | | infoData.value.hasException = hasException.value; |
| | | infoData.value.tempFileIds = tempFileIds; |
| | | const result = await uploadInspectionTask({ ...infoData.value }); |
| | | |
| | | // æ£æ¥æäº¤ç»æ |
| | | if (result && (result.code === 200 || result.success)) { |
| | | // æäº¤æå |
| | | closeToast(); // å
³éå è½½æç¤º |
| | | |
| | | uni.showToast({ |
| | | title: "æäº¤æå", |
| | | icon: "success", |
| | | }); |
| | | |
| | | // å
³éå¼¹çª |
| | | closeUploadDialog(); |
| | | |
| | | // å·æ°å表 |
| | | setTimeout(() => { |
| | | reloadPage(); |
| | | }, 500); |
| | | } else { |
| | | // æäº¤å¤±è´¥ |
| | | closeToast(); |
| | | uni.showToast({ |
| | | title: result?.msg || result?.message || "æäº¤å¤±è´¥", |
| | | icon: "error", |
| | | }); |
| | | } |
| | | } catch (error) { |
| | | console.error("æäº¤ä¸ä¼ 失败:", error); |
| | | closeToast(); // å
³éå è½½æç¤º |
| | | |
| | | let errorMessage = "æäº¤å¤±è´¥"; |
| | | if (error.message) { |
| | | errorMessage = error.message; |
| | | } else if (error.msg) { |
| | | errorMessage = error.msg; |
| | | } else if (typeof error === "string") { |
| | | errorMessage = error; |
| | | } |
| | | |
| | | uni.showToast({ |
| | | title: errorMessage, |
| | | icon: "error", |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // æ¥çéä»¶ |
| | | const viewAttachments = async task => { |
| | | try { |
| | | currentViewTask.value = task; |
| | | currentViewType.value = "before"; |
| | | |
| | | // è§£ææ°çæ°æ®ç»æ |
| | | attachmentList.value = []; |
| | | |
| | | // åç«¯åæ¾åæ®µï¼ä½ æä¾çæ°æ®ç»æï¼ï¼ |
| | | // - commonFileListBeforeï¼ç产åï¼é常 type=10ï¼ |
| | | // - commonFileListAfterï¼ç产ä¸ï¼é常 type=11ï¼ |
| | | // - commonFileListï¼å¯è½æ¯å
¨é¨/å
åºï¼è¥å
å«ç产åï¼ä¸è¬ type=12ï¼ |
| | | 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); |
| | | // 妿å端åç»è¡¥äº commonFileListIssueï¼åä¼å
ç¨ï¼å¦åä» commonFileList éæ type=12 å
åº |
| | | const issueList = Array.isArray(task?.commonFileListIssue) |
| | | ? task.commonFileListIssue |
| | | : allList.filter(f => f?.type === 12); |
| | | |
| | | const mapToViewFile = (file, viewType) => { |
| | | const u = normalizeFileUrl(file?.url || file?.downloadUrl || ""); |
| | | return { |
| | | ...file, |
| | | // ç¨äºä¸æ ç¾é¡µåç»ï¼0=ç产å 1=çäº§ä¸ 2=ç产å |
| | | 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, |
| | | }; |
| | | }; |
| | | |
| | | 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))); |
| | | |
| | | showAttachmentDialog.value = true; |
| | | } catch (error) { |
| | | uni.showToast({ |
| | | title: "è·åé件失败", |
| | | icon: "error", |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // å
³ééä»¶æ¥çå¼¹çª |
| | | const closeAttachmentDialog = () => { |
| | | showAttachmentDialog.value = false; |
| | | currentViewTask.value = null; |
| | | attachmentList.value = []; |
| | | currentViewType.value = "before"; |
| | | }; |
| | | |
| | | // 忢æ¥çç±»å |
| | | const switchViewType = type => { |
| | | currentViewType.value = type; |
| | | }; |
| | | |
| | | // æ ¹æ®typeè·å对åºåç±»çéä»¶ |
| | | const getAttachmentsByType = typeValue => { |
| | | return attachmentList.value.filter(file => file.type === typeValue) || []; |
| | | }; |
| | | // è·åtypeå¼ |
| | | const getTabType = () => { |
| | | switch (currentUploadType.value) { |
| | | case "before": |
| | | return 10; |
| | | case "after": |
| | | return 11; |
| | | case "issue": |
| | | return 12; |
| | | default: |
| | | return 10; |
| | | } |
| | | }; |
| | | // è·åå½åæ¥çç±»åçéä»¶ |
| | | 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 => { |
| | | // æ£æ¥contentTypeåæ®µ |
| | | 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(); |
| | | return ["jpg", "jpeg", "png", "gif", "webp"].includes(ext); |
| | | }; |
| | | |
| | | // æä»¶è®¿é®åºç¡åï¼åç«¯è¦æ±åç¼ï¼ |
| | | const filePreviewBase = "http://114.132.189.42:9098"; |
| | | |
| | | // å°å端è¿åçæä»¶å°åè§èæå¯è®¿é®URL |
| | | // å
¼å®¹åºæ¯ï¼ |
| | | // - å·²ç»æ¯ http/httpsï¼ç´æ¥è¿å |
| | | // - 以 / å¼å¤´ï¼æ¼æ¥ filePreviewBase |
| | | // - Windows æ¬å°è·¯å¾ï¼å¦ D:\ruoyi\prod\uploads...\xx.jpgï¼ï¼å°è¯æªå prod ä¹åçç¸å¯¹è·¯å¾å¹¶æ¼æ¥ filePreviewBase |
| | | 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}`; |
| | | } |
| | | // å
åºï¼æ æ³æ¨ææ å°è§åæ¶ï¼è³å°æåææ åææ£ææ |
| | | return normalized; |
| | | } |
| | | |
| | | // å
¶ä»ç¸å¯¹è·¯å¾ï¼ç´æ¥ç¨ baseUrl æ¼ä¸ä¸ |
| | | return `${filePreviewBase}/${url.replace(/^\//, "")}`; |
| | | } catch (e) { |
| | | return rawUrl || ""; |
| | | } |
| | | }; |
| | | |
| | | // é¢è§éä»¶ |
| | | 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); |
| | | } |
| | | }; |
| | | |
| | | // æ¾ç¤ºè§é¢é¢è§ |
| | | const showVideoPreview = file => { |
| | | currentVideoFile.value = file; |
| | | showVideoDialog.value = true; |
| | | }; |
| | | |
| | | // å
³éè§é¢é¢è§ |
| | | const closeVideoPreview = () => { |
| | | showVideoDialog.value = false; |
| | | currentVideoFile.value = null; |
| | | }; |
| | | |
| | | // è§é¢ææ¾é误å¤ç |
| | | const handleVideoError = error => { |
| | | uni.showToast({ |
| | | title: "è§é¢ææ¾å¤±è´¥", |
| | | icon: "error", |
| | | }); |
| | | }; |
| | | |
| | | // æç
§/æè§é¢ï¼çæºä¼å
ç¨ chooseMediaï¼ä¸æ¯æåéçº§ï¼ |
| | | const chooseMedia = type => { |
| | | if (getCurrentFiles().length >= uploadConfig.limit) { |
| | | uni.showToast({ |
| | | title: `æå¤åªè½éæ©${uploadConfig.limit}个æä»¶`, |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | const remaining = uploadConfig.limit - getCurrentFiles().length; |
| | | |
| | | // ä¼å
ï¼chooseMediaï¼æ¯æ image/videoï¼ |
| | | if (typeof uni.chooseMedia === "function") { |
| | | uni.chooseMedia({ |
| | | count: Math.min(remaining, 1), |
| | | mediaType: [type || "image"], |
| | | sizeType: ["compressed", "original"], |
| | | sourceType: ["camera"], |
| | | success: res => { |
| | | try { |
| | | const files = res?.tempFiles || []; |
| | | if (!files.length) throw new Error("æªè·åå°æä»¶"); |
| | | |
| | | files.forEach((tf, idx) => { |
| | | const filePath = tf.tempFilePath || tf.path || ""; |
| | | const fileType = tf.fileType || type || "image"; |
| | | const ext = fileType === "video" ? "mp4" : "jpg"; |
| | | const file = { |
| | | tempFilePath: filePath, |
| | | path: filePath, |
| | | type: fileType, |
| | | name: `${fileType}_${Date.now()}_${idx}.${ext}`, |
| | | size: tf.size || 0, |
| | | duration: tf.duration || 0, |
| | | createTime: Date.now(), |
| | | uid: Date.now() + Math.random() + idx, |
| | | }; |
| | | handleBeforeUpload(file); |
| | | }); |
| | | } catch (e) { |
| | | console.error("å¤çææç»æå¤±è´¥:", e); |
| | | uni.showToast({ title: "å¤çæä»¶å¤±è´¥", icon: "error" }); |
| | | } |
| | | }, |
| | | fail: err => { |
| | | console.error("ææå¤±è´¥:", err); |
| | | uni.showToast({ title: "ææå¤±è´¥", icon: "error" }); |
| | | }, |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | // é级ï¼chooseImage / chooseVideo |
| | | if (type === "video") { |
| | | chooseVideo(); |
| | | } else { |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | sizeType: ["compressed", "original"], |
| | | sourceType: ["camera"], |
| | | success: res => { |
| | | const tempFilePath = res?.tempFilePaths?.[0]; |
| | | const tempFile = res?.tempFiles?.[0] || {}; |
| | | if (!tempFilePath) return; |
| | | handleBeforeUpload({ |
| | | tempFilePath, |
| | | path: tempFilePath, |
| | | type: "image", |
| | | name: `photo_${Date.now()}.jpg`, |
| | | size: tempFile.size || 0, |
| | | createTime: Date.now(), |
| | | uid: Date.now() + Math.random(), |
| | | }); |
| | | }, |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // æç
§ |
| | | const chooseImage = () => { |
| | | if (uploadFiles.value.length >= uploadConfig.limit) { |
| | | uni.showToast({ |
| | | title: `æå¤åªè½ææ${uploadConfig.limit}个æä»¶`, |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | uni.chooseMedia({ |
| | | count: 1, |
| | | mediaType: ["image", "video"], |
| | | sizeType: ["compressed", "original"], |
| | | sourceType: ["camera"], |
| | | 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", |
| | | }); |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | // æè§é¢ |
| | | const chooseVideo = () => { |
| | | if (uploadFiles.value.length >= uploadConfig.limit) { |
| | | uni.showToast({ |
| | | title: `æå¤åªè½ææ${uploadConfig.limit}个æä»¶`, |
| | | icon: "none", |
| | | }); |
| | | return; |
| | | } |
| | | |
| | | uni.chooseVideo({ |
| | | sourceType: ["camera"], |
| | | maxDuration: uploadConfig.maxVideoDuration, |
| | | camera: "back", |
| | | success: res => { |
| | | try { |
| | | if (!res.tempFilePath) { |
| | | throw new Error("æªè·åå°è§é¢æä»¶"); |
| | | } |
| | | |
| | | const file = { |
| | | tempFilePath: res.tempFilePath, |
| | | path: res.tempFilePath, // ä¿æå
¼å®¹æ§ |
| | | type: "video", |
| | | name: `video_${Date.now()}.mp4`, |
| | | size: res.size || 0, |
| | | duration: res.duration || 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", |
| | | }); |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | // å 餿件 |
| | | const removeFile = index => { |
| | | uni.showModal({ |
| | | title: "确认å é¤", |
| | | content: "ç¡®å®è¦å é¤è¿ä¸ªæä»¶åï¼", |
| | | success: res => { |
| | | if (res.confirm) { |
| | | // æ ¹æ®å½åä¸ä¼ ç±»åå é¤å¯¹åºåç±»çæä»¶ |
| | | switch (currentUploadType.value) { |
| | | case "before": |
| | | beforeModelValue.value.splice(index, 1); |
| | | break; |
| | | case "after": |
| | | afterModelValue.value.splice(index, 1); |
| | | break; |
| | | case "issue": |
| | | issueModelValue.value.splice(index, 1); |
| | | break; |
| | | } |
| | | uni.showToast({ |
| | | title: "å 餿å", |
| | | icon: "success", |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | }; |
| | | |
| | | // æ£æ¥ç½ç»è¿æ¥ |
| | | const checkNetworkConnection = () => { |
| | | return new Promise(resolve => { |
| | | uni.getNetworkType({ |
| | | success: res => { |
| | | if (res.networkType === "none") { |
| | | resolve(false); |
| | | } else { |
| | | resolve(true); |
| | | } |
| | | }, |
| | | fail: () => { |
| | | resolve(false); |
| | | }, |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | // ä¸ä¼ åæ ¡éª |
| | | const handleBeforeUpload = async file => { |
| | | // æ ¡éªæä»¶ç±»å |
| | | 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") { |
| | | expectedTypes = ["jpg", "jpeg", "png", "gif", "webp"]; |
| | | } else if (file.type === "video") { |
| | | expectedTypes = ["mp4", "mov", "avi", "wmv"]; |
| | | } |
| | | |
| | | // æ£æ¥æä»¶æ©å±åæ¯å¦å¨å
许çç±»åä¸ |
| | | if (fileExtension && expectedTypes.length > 0) { |
| | | const isAllowed = expectedTypes.some( |
| | | type => uploadConfig.fileType.includes(type) && type === fileExtension |
| | | ); |
| | | |
| | | if (!isAllowed) { |
| | | uni.showToast({ |
| | | title: `æä»¶æ ¼å¼ä¸æ¯æï¼è¯·ææ ${expectedTypes.join("/")} æ ¼å¼çæä»¶`, |
| | | icon: "none", |
| | | }); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // æ ¡éªéè¿ï¼å¼å§ä¸ä¼ |
| | | uploadFile(file); |
| | | return true; |
| | | }; |
| | | |
| | | // æä»¶ä¸ä¼ å¤çï¼çæºèµ° uni.uploadFileï¼ |
| | | const uploadFile = async file => { |
| | | uploading.value = true; |
| | | uploadProgress.value = 0; |
| | | number.value++; // å¢å ä¸ä¼ è®¡æ° |
| | | |
| | | // ç¡®ä¿tokenåå¨ |
| | | const token = getToken(); |
| | | if (!token) { |
| | | handleUploadError("ç¨æ·æªç»å½"); |
| | | return; |
| | | } |
| | | |
| | | const typeValue = getTabType(); // ç产å:10, ç产ä¸:11, ç产å:12 |
| | | |
| | | uploadWithUniUploadFile( |
| | | file, |
| | | file.tempFilePath || file.path || "", |
| | | typeValue, |
| | | token |
| | | ); |
| | | }; |
| | | |
| | | // 使ç¨uni.uploadFileä¸ä¼ ï¼éH5ç¯å¢æH5åéæ¹æ¡ï¼ |
| | | const uploadWithUniUploadFile = (file, filePath, typeValue, token) => { |
| | | if (!filePath) { |
| | | handleUploadError("æä»¶è·¯å¾ä¸åå¨"); |
| | | return; |
| | | } |
| | | |
| | | const uploadTask = uni.uploadFile({ |
| | | url: uploadFileUrl.value, |
| | | filePath: filePath, |
| | | name: "file", |
| | | formData: { |
| | | type: typeValue, |
| | | }, |
| | | header: { |
| | | Authorization: `Bearer ${token}`, |
| | | }, |
| | | success: res => { |
| | | try { |
| | | if (res.statusCode === 200) { |
| | | const response = JSON.parse(res.data); |
| | | if (response.code === 200) { |
| | | handleUploadSuccess(response, file); |
| | | uni.showToast({ |
| | | title: "ä¸ä¼ æå", |
| | | icon: "success", |
| | | }); |
| | | } else { |
| | | handleUploadError(response.msg || "æå¡å¨è¿åé误"); |
| | | } |
| | | } else { |
| | | handleUploadError(`æå¡å¨é误ï¼ç¶æç : ${res.statusCode}`); |
| | | } |
| | | } catch (e) { |
| | | console.error("è§£æååºå¤±è´¥:", e); |
| | | console.error("åå§ååºæ°æ®:", res.data); |
| | | handleUploadError("ååºæ°æ®è§£æå¤±è´¥: " + e.message); |
| | | } |
| | | }, |
| | | fail: err => { |
| | | console.error("ä¸ä¼ 失败:", err.errMsg || err); |
| | | number.value--; // ä¸ä¼ 失败æ¶åå°è®¡æ° |
| | | |
| | | let errorMessage = "ä¸ä¼ 失败"; |
| | | if (err.errMsg) { |
| | | if (err.errMsg.includes("statusCode: null")) { |
| | | errorMessage = "ç½ç»è¿æ¥å¤±è´¥ï¼è¯·æ£æ¥ç½ç»è®¾ç½®"; |
| | | } else if (err.errMsg.includes("timeout")) { |
| | | errorMessage = "ä¸ä¼ è¶
æ¶ï¼è¯·éè¯"; |
| | | } else if (err.errMsg.includes("fail")) { |
| | | errorMessage = "ä¸ä¼ 失败ï¼è¯·æ£æ¥ç½ç»è¿æ¥"; |
| | | } else { |
| | | errorMessage = err.errMsg; |
| | | } |
| | | } |
| | | |
| | | handleUploadError(errorMessage); |
| | | }, |
| | | complete: () => { |
| | | uploading.value = false; |
| | | uploadProgress.value = 0; |
| | | }, |
| | | }); |
| | | |
| | | // çå¬ä¸ä¼ è¿åº¦ |
| | | if (uploadTask && uploadTask.onProgressUpdate) { |
| | | uploadTask.onProgressUpdate(res => { |
| | | uploadProgress.value = res.progress; |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // ä¸ä¼ 失败å¤ç |
| | | const handleUploadError = (message = "ä¸ä¼ æä»¶å¤±è´¥", showRetry = false) => { |
| | | uploading.value = false; |
| | | uploadProgress.value = 0; |
| | | |
| | | if (showRetry) { |
| | | uni.showModal({ |
| | | title: "ä¸ä¼ 失败", |
| | | content: message + "ï¼æ¯å¦éè¯ï¼", |
| | | success: res => { |
| | | if (res.confirm) { |
| | | // ç¨æ·éæ©éè¯ï¼è¿éå¯ä»¥éæ°è§¦åä¸ä¼ |
| | | } |
| | | }, |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: message, |
| | | icon: "error", |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // ä¸ä¼ æååè° |
| | | const handleUploadSuccess = (res, file) => { |
| | | console.log("ä¸ä¼ æåååº:", res); |
| | | |
| | | // å¤çä¸åçæ°æ®ç»æï¼å¯è½æ¯æ°ç»ï¼ä¹å¯è½æ¯å个对象 |
| | | let uploadedFile = null; |
| | | uploadedFile = res.data; |
| | | |
| | | if (!uploadedFile) { |
| | | console.error("æ æ³è§£æä¸ä¼ ååºæ°æ®:", res); |
| | | number.value--; // ä¸ä¼ 失败æ¶åå°è®¡æ° |
| | | handleUploadError("ä¸ä¼ ååºæ°æ®æ ¼å¼é误", false); |
| | | return; |
| | | } |
| | | |
| | | // æ ¹æ®å½åä¸ä¼ ç±»å设置typeåæ®µ |
| | | let typeValue = 0; // é»è®¤ä¸ºç产å |
| | | switch (currentUploadType.value) { |
| | | case "before": |
| | | typeValue = 0; |
| | | break; |
| | | case "after": |
| | | typeValue = 1; |
| | | break; |
| | | case "issue": |
| | | typeValue = 2; |
| | | break; |
| | | } |
| | | |
| | | // ç¡®ä¿ä¸ä¼ çæä»¶æ°æ®å®æ´ï¼å
å«idåtype |
| | | const fileData = { |
| | | ...file, |
| | | id: uploadedFile.id, // æ·»å æå¡å¨è¿åçid |
| | | tempId: uploadedFile.tempId ?? uploadedFile.tempFileId ?? uploadedFile.id, |
| | | url: |
| | | uploadedFile.url || |
| | | uploadedFile.downloadUrl || |
| | | file.tempFilePath || |
| | | file.path, |
| | | bucketFilename: |
| | | uploadedFile.bucketFilename || uploadedFile.originalFilename || file.name, |
| | | downloadUrl: uploadedFile.downloadUrl || uploadedFile.url, |
| | | size: uploadedFile.size || uploadedFile.byteSize || file.size, |
| | | createTime: uploadedFile.createTime || new Date().getTime(), |
| | | type: typeValue, // æ·»å ç±»ååæ®µï¼0=ç产å, 1=ç产ä¸, 2=ç产å |
| | | }; |
| | | |
| | | uploadList.value.push(fileData); |
| | | |
| | | // ç«å³æ·»å å°å¯¹åºçåç±»ï¼ä¸çå¾
æææä»¶ä¸ä¼ 宿 |
| | | switch (currentUploadType.value) { |
| | | case "before": |
| | | beforeModelValue.value.push(fileData); |
| | | break; |
| | | case "after": |
| | | afterModelValue.value.push(fileData); |
| | | break; |
| | | case "issue": |
| | | issueModelValue.value.push(fileData); |
| | | break; |
| | | } |
| | | |
| | | // éç½®ä¸ä¼ å表ï¼å ä¸ºå·²ç»æ·»å å°å¯¹åºåç±»äºï¼ |
| | | uploadList.value = []; |
| | | number.value = 0; |
| | | }; |
| | | |
| | | // ä¸ä¼ ç»æå¤çï¼å·²åºå¼ï¼ç°å¨å¨handleUploadSuccessä¸ç´æ¥å¤çï¼ |
| | | const uploadedSuccessfully = () => { |
| | | // æ¤å½æ°å·²ä¸å使ç¨ï¼æä»¶ä¸ä¼ æååç«å³æ·»å å°å¯¹åºåç±» |
| | | }; |
| | | |
| | | // æ ¼å¼åæä»¶å¤§å° |
| | | 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> |
| | | .inspection-upload-page { |
| | | min-height: 100vh; |
| | | background-color: #f5f5f5; |
| | | } |
| | | .inspection-upload-page { |
| | | min-height: 100vh; |
| | | background-color: #f5f5f5; |
| | | } |
| | | |
| | | .table-section { |
| | | padding: 15px; |
| | | } |
| | | .table-section { |
| | | padding: 15px; |
| | | } |
| | | |
| | | .task-list { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 12px; |
| | | } |
| | | .task-list { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .task-item { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 15px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | transition: all 0.3s ease; |
| | | } |
| | | .task-item { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 15px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .task-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: flex-start; |
| | | margin-bottom: 12px; |
| | | } |
| | | .task-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: flex-start; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .task-info { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 4px; |
| | | } |
| | | .task-info { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 4px; |
| | | } |
| | | |
| | | .task-name { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | } |
| | | .task-name { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | } |
| | | |
| | | .task-location { |
| | | font-size: 14px; |
| | | color: #666; |
| | | } |
| | | .task-location { |
| | | font-size: 14px; |
| | | color: #666; |
| | | } |
| | | |
| | | .task-actions { |
| | | display: flex; |
| | | gap: 8px; |
| | | } |
| | | .task-actions { |
| | | display: flex; |
| | | gap: 8px; |
| | | } |
| | | |
| | | .task-details { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 6px; |
| | | } |
| | | .task-details { |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 6px; |
| | | } |
| | | |
| | | .detail-item { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | .detail-item { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .detail-label { |
| | | font-size: 12px; |
| | | color: #999; |
| | | } |
| | | .detail-label { |
| | | font-size: 12px; |
| | | color: #999; |
| | | } |
| | | |
| | | .detail-value { |
| | | font-size: 12px; |
| | | color: #666; |
| | | font-weight: 500; |
| | | } |
| | | .detail-value { |
| | | font-size: 12px; |
| | | color: #666; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .no-data { |
| | | text-align: center; |
| | | padding: 40px 20px; |
| | | color: #999; |
| | | font-size: 14px; |
| | | } |
| | | .no-data { |
| | | text-align: center; |
| | | padding: 40px 20px; |
| | | color: #999; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* æ«ç å¼¹çªæ ·å¼ */ |
| | | .qr-scan-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0, 0, 0, 0.8); |
| | | z-index: 9999; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | /* æ«ç å¼¹çªæ ·å¼ */ |
| | | .qr-scan-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0, 0, 0, 0.8); |
| | | z-index: 9999; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .qr-scan-container { |
| | | width: 90vw; |
| | | max-width: 400px; |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 20px; |
| | | position: relative; |
| | | } |
| | | .qr-scan-container { |
| | | width: 90vw; |
| | | max-width: 400px; |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 20px; |
| | | position: relative; |
| | | } |
| | | |
| | | .scan-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 15px; |
| | | } |
| | | .scan-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .scan-title { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | } |
| | | .scan-title { |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | } |
| | | |
| | | .qr-camera { |
| | | width: 100%; |
| | | height: 300px; |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | margin-bottom: 15px; |
| | | } |
| | | .qr-camera { |
| | | width: 100%; |
| | | height: 300px; |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .scan-frame-wrapper { |
| | | position: relative; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | .scan-frame-wrapper { |
| | | position: relative; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | } |
| | | |
| | | .scan-frame { |
| | | width: 200px; |
| | | height: 200px; |
| | | border: 2px solid #409eff; |
| | | border-radius: 8px; |
| | | position: relative; |
| | | } |
| | | .scan-frame { |
| | | width: 200px; |
| | | height: 200px; |
| | | border: 2px solid #409eff; |
| | | border-radius: 8px; |
| | | position: relative; |
| | | } |
| | | |
| | | .scan-frame::before, |
| | | .scan-frame::after { |
| | | content: ''; |
| | | position: absolute; |
| | | width: 20px; |
| | | height: 20px; |
| | | border: 2px solid #409eff; |
| | | } |
| | | .scan-frame::before, |
| | | .scan-frame::after { |
| | | content: ""; |
| | | position: absolute; |
| | | width: 20px; |
| | | height: 20px; |
| | | border: 2px solid #409eff; |
| | | } |
| | | |
| | | .scan-frame::before { |
| | | top: -2px; |
| | | left: -2px; |
| | | border-right: none; |
| | | border-bottom: none; |
| | | } |
| | | .scan-frame::before { |
| | | top: -2px; |
| | | left: -2px; |
| | | border-right: none; |
| | | border-bottom: none; |
| | | } |
| | | |
| | | .scan-frame::after { |
| | | bottom: -2px; |
| | | right: -2px; |
| | | border-left: none; |
| | | border-top: none; |
| | | } |
| | | .scan-frame::after { |
| | | bottom: -2px; |
| | | right: -2px; |
| | | border-left: none; |
| | | border-top: none; |
| | | } |
| | | |
| | | .scan-tip { |
| | | margin-top: 10px; |
| | | font-size: 14px; |
| | | color: #666; |
| | | text-align: center; |
| | | } |
| | | .scan-tip { |
| | | margin-top: 10px; |
| | | font-size: 14px; |
| | | color: #666; |
| | | text-align: center; |
| | | } |
| | | |
| | | /* èªå®ä¹æ¨¡ææ¡æ ·å¼ */ |
| | | .custom-modal-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0, 0, 0, 0.5); |
| | | z-index: 10000; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 20px; |
| | | } |
| | | /* èªå®ä¹æ¨¡ææ¡æ ·å¼ */ |
| | | .custom-modal-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0, 0, 0, 0.5); |
| | | z-index: 10000; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 20px; |
| | | } |
| | | |
| | | .custom-modal-container { |
| | | width: 100%; |
| | | max-width: 500px; |
| | | max-height: 80vh; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .custom-modal-container { |
| | | width: 100%; |
| | | max-width: 500px; |
| | | max-height: 80vh; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | /* ä¸ä¼ å¼¹çªæ ·å¼ */ |
| | | .upload-popup-content { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | width: 100%; |
| | | min-height: 300px; |
| | | max-height: 70vh; |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-direction: column; |
| | | box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); |
| | | } |
| | | /* ä¸ä¼ å¼¹çªæ ·å¼ */ |
| | | .upload-popup-content { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | width: 100%; |
| | | min-height: 300px; |
| | | max-height: 70vh; |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-direction: column; |
| | | box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); |
| | | } |
| | | |
| | | .upload-popup-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 15px 20px; |
| | | border-bottom: 1px solid #eee; |
| | | } |
| | | .upload-popup-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 15px 20px; |
| | | border-bottom: 1px solid #eee; |
| | | } |
| | | |
| | | .upload-popup-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | } |
| | | .upload-popup-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | } |
| | | |
| | | .upload-popup-body { |
| | | flex: 1; |
| | | padding: 20px; |
| | | overflow-y: auto; |
| | | } |
| | | .upload-popup-body { |
| | | flex: 1; |
| | | padding: 20px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .upload-popup-footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | padding: 15px 20px; |
| | | border-top: 1px solid #eee; |
| | | gap: 10px; |
| | | } |
| | | .upload-popup-footer { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | padding: 15px 20px; |
| | | border-top: 1px solid #eee; |
| | | gap: 10px; |
| | | } |
| | | |
| | | /* ç®åä¸ä¼ ç»ä»¶æ ·å¼ */ |
| | | .simple-upload-area { |
| | | padding: 15px; |
| | | } |
| | | /* ç®åä¸ä¼ ç»ä»¶æ ·å¼ */ |
| | | .simple-upload-area { |
| | | padding: 15px; |
| | | } |
| | | |
| | | .upload-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-bottom: 15px; |
| | | } |
| | | .upload-buttons { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .file-list { |
| | | margin-top: 15px; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 12px; |
| | | } |
| | | .file-list { |
| | | margin-top: 15px; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .file-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 8px; |
| | | border: 1px solid #e9ecef; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | transition: all 0.3s ease; |
| | | width: calc(50% - 6px); |
| | | min-width: 120px; |
| | | } |
| | | .file-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 8px; |
| | | border: 1px solid #e9ecef; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | transition: all 0.3s ease; |
| | | width: calc(50% - 6px); |
| | | min-width: 120px; |
| | | } |
| | | |
| | | .file-item:hover { |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); |
| | | transform: translateY(-2px); |
| | | } |
| | | .file-item:hover { |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); |
| | | transform: translateY(-2px); |
| | | } |
| | | |
| | | .file-preview-container { |
| | | position: relative; |
| | | margin-bottom: 8px; |
| | | } |
| | | .file-preview-container { |
| | | position: relative; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .file-preview { |
| | | width: 80px; |
| | | height: 80px; |
| | | border-radius: 8px; |
| | | object-fit: cover; |
| | | border: 2px solid #f0f0f0; |
| | | } |
| | | .file-preview { |
| | | width: 80px; |
| | | height: 80px; |
| | | border-radius: 8px; |
| | | object-fit: cover; |
| | | border: 2px solid #f0f0f0; |
| | | } |
| | | |
| | | .video-preview { |
| | | width: 80px; |
| | | height: 80px; |
| | | background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); |
| | | border-radius: 8px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 2px solid #f0f0f0; |
| | | } |
| | | .video-preview { |
| | | width: 80px; |
| | | height: 80px; |
| | | background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); |
| | | border-radius: 8px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 2px solid #f0f0f0; |
| | | } |
| | | |
| | | .video-text { |
| | | font-size: 12px; |
| | | color: #666; |
| | | margin-top: 4px; |
| | | } |
| | | .video-text { |
| | | font-size: 12px; |
| | | color: #666; |
| | | margin-top: 4px; |
| | | } |
| | | |
| | | .delete-btn { |
| | | position: absolute; |
| | | top: -6px; |
| | | right: -6px; |
| | | width: 20px; |
| | | height: 20px; |
| | | background: #ff4757; |
| | | border-radius: 50%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3); |
| | | transition: all 0.3s ease; |
| | | } |
| | | .delete-btn { |
| | | position: absolute; |
| | | top: -6px; |
| | | right: -6px; |
| | | width: 20px; |
| | | height: 20px; |
| | | background: #ff4757; |
| | | border-radius: 50%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3); |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .delete-btn:hover { |
| | | background: #ff3742; |
| | | transform: scale(1.1); |
| | | } |
| | | .delete-btn:hover { |
| | | background: #ff3742; |
| | | transform: scale(1.1); |
| | | } |
| | | |
| | | .file-info { |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | .file-info { |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | |
| | | .file-name { |
| | | font-size: 12px; |
| | | color: #333; |
| | | font-weight: 500; |
| | | display: block; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | max-width: 100px; |
| | | } |
| | | .file-name { |
| | | font-size: 12px; |
| | | color: #333; |
| | | font-weight: 500; |
| | | display: block; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | max-width: 100px; |
| | | } |
| | | |
| | | .file-size { |
| | | font-size: 10px; |
| | | color: #999; |
| | | margin-top: 2px; |
| | | display: block; |
| | | } |
| | | .file-size { |
| | | font-size: 10px; |
| | | color: #999; |
| | | margin-top: 2px; |
| | | display: block; |
| | | } |
| | | |
| | | .empty-state { |
| | | text-align: center; |
| | | padding: 40px 20px; |
| | | color: #999; |
| | | font-size: 14px; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | border: 2px dashed #ddd; |
| | | } |
| | | .empty-state { |
| | | text-align: center; |
| | | padding: 40px 20px; |
| | | color: #999; |
| | | font-size: 14px; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | border: 2px dashed #ddd; |
| | | } |
| | | |
| | | .upload-progress { |
| | | margin: 15px 0; |
| | | padding: 0 10px; |
| | | } |
| | | .upload-progress { |
| | | margin: 15px 0; |
| | | padding: 0 10px; |
| | | } |
| | | |
| | | /* ä¸ä¼ æ ç¾é¡µæ ·å¼ */ |
| | | .upload-tabs { |
| | | display: flex; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | margin-bottom: 15px; |
| | | padding: 4px; |
| | | } |
| | | /* ä¸ä¼ æ ç¾é¡µæ ·å¼ */ |
| | | .upload-tabs { |
| | | display: flex; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | margin-bottom: 15px; |
| | | padding: 4px; |
| | | } |
| | | |
| | | .tab-item { |
| | | flex: 1; |
| | | text-align: center; |
| | | padding: 8px 12px; |
| | | font-size: 14px; |
| | | color: #666; |
| | | border-radius: 6px; |
| | | transition: all 0.3s ease; |
| | | cursor: pointer; |
| | | } |
| | | .tab-item { |
| | | flex: 1; |
| | | text-align: center; |
| | | padding: 8px 12px; |
| | | font-size: 14px; |
| | | color: #666; |
| | | border-radius: 6px; |
| | | transition: all 0.3s ease; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .tab-item.active { |
| | | background: #409eff; |
| | | color: #fff; |
| | | font-weight: 500; |
| | | } |
| | | .tab-item.active { |
| | | background: #409eff; |
| | | color: #fff; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .tab-item:hover:not(.active) { |
| | | background: #e9ecef; |
| | | color: #333; |
| | | } |
| | | .tab-item:hover:not(.active) { |
| | | background: #e9ecef; |
| | | color: #333; |
| | | } |
| | | |
| | | /* å¼å¸¸ç¶æéæ©æ ·å¼ */ |
| | | .exception-section { |
| | | margin-bottom: 20px; |
| | | padding: 15px; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | border: 1px solid #e9ecef; |
| | | } |
| | | /* å¼å¸¸ç¶æéæ©æ ·å¼ */ |
| | | .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; |
| | | } |
| | | .section-title { |
| | | display: block; |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .exception-options { |
| | | display: flex; |
| | | gap: 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 { |
| | | 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.active { |
| | | border-color: #409eff; |
| | | background: #f0f8ff; |
| | | color: #409eff; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .exception-option:hover:not(.active) { |
| | | border-color: #d9d9d9; |
| | | background: #fafafa; |
| | | } |
| | | .exception-option:hover:not(.active) { |
| | | border-color: #d9d9d9; |
| | | background: #fafafa; |
| | | } |
| | | |
| | | /* ç»è®¡ä¿¡æ¯æ ·å¼ */ |
| | | .upload-summary { |
| | | margin-top: 15px; |
| | | padding: 10px; |
| | | background: #f8f9fa; |
| | | border-radius: 6px; |
| | | border-left: 3px solid #409eff; |
| | | } |
| | | /* ç»è®¡ä¿¡æ¯æ ·å¼ */ |
| | | .upload-summary { |
| | | margin-top: 15px; |
| | | padding: 10px; |
| | | background: #f8f9fa; |
| | | border-radius: 6px; |
| | | border-left: 3px solid #409eff; |
| | | } |
| | | |
| | | .summary-text { |
| | | font-size: 12px; |
| | | color: #666; |
| | | line-height: 1.4; |
| | | } |
| | | .summary-text { |
| | | font-size: 12px; |
| | | color: #666; |
| | | line-height: 1.4; |
| | | } |
| | | |
| | | /* æ¥çéä»¶å¼¹çªæ ·å¼ */ |
| | | .attachment-popup-content { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | width: 100%; |
| | | min-height: 400px; |
| | | max-height: 70vh; |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-direction: column; |
| | | box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); |
| | | } |
| | | /* æ¥çéä»¶å¼¹çªæ ·å¼ */ |
| | | .attachment-popup-content { |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | width: 100%; |
| | | min-height: 400px; |
| | | max-height: 70vh; |
| | | overflow: hidden; |
| | | display: flex; |
| | | flex-direction: column; |
| | | box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); |
| | | } |
| | | |
| | | .attachment-popup-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 15px 20px; |
| | | border-bottom: 1px solid #eee; |
| | | background: #f8f9fa; |
| | | } |
| | | .attachment-popup-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 15px 20px; |
| | | border-bottom: 1px solid #eee; |
| | | background: #f8f9fa; |
| | | } |
| | | |
| | | .attachment-popup-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | } |
| | | .attachment-popup-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #333; |
| | | } |
| | | |
| | | .close-btn-attachment { |
| | | width: 28px; |
| | | height: 28px; |
| | | border-radius: 50%; |
| | | background: #f5f5f5; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | } |
| | | .close-btn-attachment { |
| | | width: 28px; |
| | | height: 28px; |
| | | border-radius: 50%; |
| | | background: #f5f5f5; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .close-btn-attachment:hover { |
| | | background: #e9ecef; |
| | | transform: scale(1.1); |
| | | } |
| | | .close-btn-attachment:hover { |
| | | background: #e9ecef; |
| | | transform: scale(1.1); |
| | | } |
| | | |
| | | .attachment-popup-body { |
| | | flex: 1; |
| | | padding: 15px 20px; |
| | | overflow-y: auto; |
| | | } |
| | | .attachment-popup-body { |
| | | flex: 1; |
| | | padding: 15px 20px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .attachment-tabs { |
| | | display: flex; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | margin-bottom: 15px; |
| | | padding: 4px; |
| | | } |
| | | .attachment-tabs { |
| | | display: flex; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | margin-bottom: 15px; |
| | | padding: 4px; |
| | | } |
| | | |
| | | .attachment-content { |
| | | min-height: 200px; |
| | | } |
| | | .attachment-content { |
| | | min-height: 200px; |
| | | } |
| | | |
| | | .attachment-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 12px; |
| | | } |
| | | .attachment-list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 12px; |
| | | } |
| | | |
| | | .attachment-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 8px; |
| | | border: 1px solid #e9ecef; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | transition: all 0.3s ease; |
| | | width: calc(33.33% - 8px); |
| | | min-width: 100px; |
| | | cursor: pointer; |
| | | } |
| | | .attachment-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | background: #fff; |
| | | border-radius: 12px; |
| | | padding: 8px; |
| | | border: 1px solid #e9ecef; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); |
| | | transition: all 0.3s ease; |
| | | width: calc(33.33% - 8px); |
| | | min-width: 100px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .attachment-item:hover { |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); |
| | | transform: translateY(-2px); |
| | | } |
| | | .attachment-item:hover { |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); |
| | | transform: translateY(-2px); |
| | | } |
| | | |
| | | .attachment-preview-container { |
| | | margin-bottom: 8px; |
| | | } |
| | | .attachment-preview-container { |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .attachment-preview { |
| | | width: 80px; |
| | | height: 80px; |
| | | border-radius: 8px; |
| | | object-fit: cover; |
| | | border: 2px solid #f0f0f0; |
| | | } |
| | | .attachment-preview { |
| | | width: 80px; |
| | | height: 80px; |
| | | border-radius: 8px; |
| | | object-fit: cover; |
| | | border: 2px solid #f0f0f0; |
| | | } |
| | | |
| | | .attachment-video-preview { |
| | | width: 80px; |
| | | height: 80px; |
| | | background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); |
| | | border-radius: 8px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 2px solid #f0f0f0; |
| | | } |
| | | .attachment-video-preview { |
| | | width: 80px; |
| | | height: 80px; |
| | | background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); |
| | | border-radius: 8px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: 2px solid #f0f0f0; |
| | | } |
| | | |
| | | .attachment-info { |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | .attachment-info { |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | |
| | | .attachment-name { |
| | | font-size: 12px; |
| | | color: #333; |
| | | font-weight: 500; |
| | | display: block; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | max-width: 80px; |
| | | } |
| | | .attachment-name { |
| | | font-size: 12px; |
| | | color: #333; |
| | | font-weight: 500; |
| | | display: block; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | max-width: 80px; |
| | | } |
| | | |
| | | .attachment-size { |
| | | font-size: 10px; |
| | | color: #999; |
| | | margin-top: 2px; |
| | | display: block; |
| | | } |
| | | .attachment-size { |
| | | font-size: 10px; |
| | | color: #999; |
| | | margin-top: 2px; |
| | | display: block; |
| | | } |
| | | |
| | | .attachment-empty { |
| | | text-align: center; |
| | | padding: 60px 20px; |
| | | color: #999; |
| | | font-size: 14px; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | border: 2px dashed #ddd; |
| | | } |
| | | .attachment-empty { |
| | | text-align: center; |
| | | padding: 60px 20px; |
| | | color: #999; |
| | | font-size: 14px; |
| | | background: #f8f9fa; |
| | | border-radius: 8px; |
| | | border: 2px dashed #ddd; |
| | | } |
| | | |
| | | /* è§é¢é¢è§å¼¹çªæ ·å¼ */ |
| | | .video-modal-overlay { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | right: 0; |
| | | bottom: 0; |
| | | background: rgba(0, 0, 0, 0.8); |
| | | z-index: 10001; |
| | | 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.8); |
| | | z-index: 10001; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 20px; |
| | | } |
| | | |
| | | .video-modal-container { |
| | | width: 90%; |
| | | max-width: 800px; |
| | | max-height: 80vh; |
| | | background: #000; |
| | | border-radius: 12px; |
| | | overflow: hidden; |
| | | box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); |
| | | } |
| | | .video-modal-container { |
| | | width: 90%; |
| | | max-width: 800px; |
| | | max-height: 80vh; |
| | | background: #000; |
| | | border-radius: 12px; |
| | | overflow: hidden; |
| | | box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); |
| | | } |
| | | |
| | | .video-modal-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 15px 20px; |
| | | background: rgba(0, 0, 0, 0.7); |
| | | color: #fff; |
| | | } |
| | | .video-modal-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 15px 20px; |
| | | background: rgba(0, 0, 0, 0.7); |
| | | color: #fff; |
| | | } |
| | | |
| | | .video-modal-title { |
| | | font-size: 16px; |
| | | font-weight: 500; |
| | | color: #fff; |
| | | } |
| | | .video-modal-title { |
| | | font-size: 16px; |
| | | font-weight: 500; |
| | | color: #fff; |
| | | } |
| | | |
| | | .close-btn-video { |
| | | width: 28px; |
| | | height: 28px; |
| | | border-radius: 50%; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | } |
| | | .close-btn-video { |
| | | width: 28px; |
| | | height: 28px; |
| | | border-radius: 50%; |
| | | background: rgba(255, 255, 255, 0.2); |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .close-btn-video:hover { |
| | | background: rgba(255, 255, 255, 0.3); |
| | | transform: scale(1.1); |
| | | } |
| | | .close-btn-video:hover { |
| | | background: rgba(255, 255, 255, 0.3); |
| | | transform: scale(1.1); |
| | | } |
| | | |
| | | .video-modal-body { |
| | | position: relative; |
| | | background: #000; |
| | | } |
| | | .video-modal-body { |
| | | position: relative; |
| | | background: #000; |
| | | } |
| | | |
| | | .video-player { |
| | | width: 100%; |
| | | height: auto; |
| | | max-height: 60vh; |
| | | display: block; |
| | | } |
| | | .video-player { |
| | | width: 100%; |
| | | height: auto; |
| | | max-height: 60vh; |
| | | display: block; |
| | | } |
| | | </style> |