|
@@ -26,6 +26,14 @@ export default {
|
|
|
auditFormLoading: false,
|
|
|
currentClaimRow: null,
|
|
|
auditFormMode: 'add', // 'add' | 'edit'
|
|
|
+ // 图片预览相关状态
|
|
|
+ imagePreviewVisible: false,
|
|
|
+ previewImageUrl: '',
|
|
|
+ previewImageList: [],
|
|
|
+ currentPreviewIndex: 0,
|
|
|
+ // 视频预览相关状态
|
|
|
+ videoPreviewVisible: false,
|
|
|
+ previewVideoUrl: '',
|
|
|
auditForm: {
|
|
|
id: null,
|
|
|
claimId: null,
|
|
@@ -61,11 +69,6 @@ export default {
|
|
|
{ required: true, message: '请选择审核时间', trigger: 'change' }
|
|
|
]
|
|
|
},
|
|
|
- // 添加图片预览相关状态
|
|
|
- imagePreviewVisible: false,
|
|
|
- previewImageUrl: '',
|
|
|
- previewImageList: [],
|
|
|
- currentPreviewIndex: 0,
|
|
|
option: {
|
|
|
height: 'auto',
|
|
|
calcHeight: 30,
|
|
@@ -458,12 +461,18 @@ export default {
|
|
|
* @param {number} index - 当前图片索引
|
|
|
*/
|
|
|
previewImage(file, index = 0) {
|
|
|
- // 获取所有图片文件
|
|
|
- const imageFiles = this.attachmentList.filter(item => this.isImageFile(item.fileName))
|
|
|
- this.previewImageList = imageFiles.map(item => item.fileUrl)
|
|
|
- this.currentPreviewIndex = imageFiles.findIndex(item => item.id === file.id)
|
|
|
- this.previewImageUrl = file.fileUrl
|
|
|
- this.imagePreviewVisible = true
|
|
|
+ if (this.isVideoFile(file.fileName)) {
|
|
|
+ // 视频预览
|
|
|
+ this.previewVideoUrl = file.fileUrl
|
|
|
+ this.videoPreviewVisible = true
|
|
|
+ } else if (this.isImageFile(file.fileName)) {
|
|
|
+ // 图片预览
|
|
|
+ const imageFiles = this.attachmentList.filter(item => this.isImageFile(item.fileName))
|
|
|
+ this.previewImageList = imageFiles.map(item => item.fileUrl)
|
|
|
+ this.currentPreviewIndex = imageFiles.findIndex(item => item.id === file.id)
|
|
|
+ this.previewImageUrl = file.fileUrl
|
|
|
+ this.imagePreviewVisible = true
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|
|
@@ -477,6 +486,14 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
+ * 关闭视频预览
|
|
|
+ */
|
|
|
+ closeVideoPreview() {
|
|
|
+ this.videoPreviewVisible = false
|
|
|
+ this.previewVideoUrl = ''
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
* 处理图片加载错误
|
|
|
* @param {Event} event - 错误事件
|
|
|
*/
|
|
@@ -529,6 +546,15 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
+ * 处理视频加载错误
|
|
|
+ * @param {Event} event - 错误事件
|
|
|
+ */
|
|
|
+ handleVideoError(event) {
|
|
|
+ console.error('视频加载失败:', event)
|
|
|
+ this.$message.error('视频加载失败,请检查视频文件')
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取审核结果文本
|
|
|
* @param {number} result - 审核结果
|
|
|
* @returns {string} 结果文本
|