| | |
| | | |
| | | // 获取当前分类的文件列表 |
| | | const getCurrentFiles = () => { |
| | | console.log('currentUploadType',currentUploadType.value) |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | console.log('beforeModelValue',beforeModelValue.value) |
| | | return beforeModelValue.value |
| | | case 'after': |
| | | return afterModelValue.value |
| | |
| | | infoData.value.storageBlobDTO = arr; |
| | | // 添加异常状态信息 |
| | | infoData.value.hasException = hasException.value; |
| | | |
| | | const result = await uploadInspectionTask({...infoData.value}); |
| | | |
| | | // 检查提交结果 |
| | |
| | | const getAttachmentsByType = (typeValue) => { |
| | | return attachmentList.value.filter(file => file.type === typeValue) || [] |
| | | } |
| | | |
| | | // 获取type值 |
| | | const getTabType = () => { |
| | | switch (currentUploadType.value) { |
| | | case 'before': |
| | | return 0 |
| | | case 'after': |
| | | return 1 |
| | | case 'issue': |
| | | return 2 |
| | | default: |
| | | return 0 |
| | | } |
| | | } |
| | | // 获取当前查看类型的附件 |
| | | const getCurrentViewAttachments = () => { |
| | | switch (currentViewType.value) { |
| | |
| | | filePath: filePath, |
| | | name: 'files', |
| | | formData: { |
| | | type: uploadStatusType.value || 0 |
| | | type: getTabType() || 0 |
| | | }, |
| | | header: { |
| | | 'Authorization': `Bearer ${token}` |
| | | } |
| | | }; |
| | | console.log('uploadParams',uploadParams) |
| | | const uploadTask = uni.uploadFile({ |
| | | ...uploadParams, |
| | | success: (res) => { |
| | |
| | | |
| | | // 上传成功回调 |
| | | const handleUploadSuccess = (res, file) => { |
| | | console.log(res,file) |
| | | if (res.code === 200 && res.data && Array.isArray(res.data) && res.data.length > 0) { |
| | | const uploadedFile = res.data[0]; |
| | | |