[update 88204] 拆分上传多图片
This commit is contained in:
@@ -177,7 +177,7 @@
|
||||
<a-button type="primary" icon="plus" ghost @click="handleAddClauseContent(-1)">{{ $t('newlyAdded') }}</a-button>
|
||||
</div>
|
||||
<template v-if="contentList && contentList.length > 0">
|
||||
<div class="clause-item" v-for="(clause, index) in contentList" :key="index + 'clause'">
|
||||
<div class="clause-item" v-for="(clause, index) in contentList" :key="clause.uuid || (index + 'clause')">
|
||||
<div class="clause-item-content">
|
||||
<!--文本-->
|
||||
<a-input type="textarea"
|
||||
@@ -237,6 +237,7 @@ import { getAction } from '../../../../api/manage'
|
||||
import { getFormDictTreeList } from '../../../../api/api'
|
||||
import STreeSelect from '../../../../components/STreeSelect'
|
||||
import TreeSelection from '../../../../components/selection/TreeSelection'
|
||||
import { randomUUID } from '@/utils/util'
|
||||
|
||||
export default {
|
||||
name: 'SplitAddForm',
|
||||
@@ -491,6 +492,7 @@ export default {
|
||||
for (let i = 0; i < content; i++) {
|
||||
insertArr.push({
|
||||
id: '',
|
||||
uuid: randomUUID(),
|
||||
type: TypeOfClauseItem.TEXT.value,
|
||||
itemContent: ''
|
||||
})
|
||||
@@ -498,18 +500,32 @@ export default {
|
||||
break
|
||||
case TypeOfClauseItem.IMG.value:
|
||||
// 处理上传接口报错的情况
|
||||
if (content.file.response.result && content.file.response.result.url) {
|
||||
insertArr[0] = {
|
||||
id: '',
|
||||
type: TypeOfClauseItem.IMG.value,
|
||||
itemContent: content.file.response.result.url,
|
||||
thumbUrl: window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + content.file.response.result.fileName
|
||||
}
|
||||
if (content.imgs) {
|
||||
content.imgs.forEach(file => {
|
||||
insertArr.push({
|
||||
id: '',
|
||||
uuid: randomUUID(),
|
||||
type: TypeOfClauseItem.IMG.value,
|
||||
itemContent: file.response.result.url,
|
||||
thumbUrl: window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + file.response.result.fileName
|
||||
})
|
||||
})
|
||||
}
|
||||
// if (content.file.response.result && content.file.response.result.url) {
|
||||
// console.log(content.file.response.result.id)
|
||||
// insertArr[0] = {
|
||||
// id: '',
|
||||
// uuid: randomUUID(),
|
||||
// type: TypeOfClauseItem.IMG.value,
|
||||
// itemContent: content.file.response.result.url,
|
||||
// thumbUrl: window._CONFIG.domianURL + '/sys/split/file/getImage?fileName=' + content.file.response.result.fileName
|
||||
// }
|
||||
// }
|
||||
break
|
||||
case TypeOfClauseItem.TABLE.value:
|
||||
insertArr[0] = {
|
||||
id: '',
|
||||
uuid: randomUUID(),
|
||||
type: 'TABLE',
|
||||
itemContent: content[0]
|
||||
}
|
||||
|
||||
@@ -159,8 +159,11 @@ export default {
|
||||
},
|
||||
// 上传文件
|
||||
uploadSuccess (file, data, imgs) {
|
||||
this.$emit('ok', TypeOfClauseItem.IMG.value, { file, data, imgs })
|
||||
this.visible = false
|
||||
// 所有文件都上传完成再去关闭弹框
|
||||
if (Array.isArray(imgs) && imgs.every(item => item.status === 'done')) {
|
||||
this.$emit('ok', TypeOfClauseItem.IMG.value, { file, data, imgs })
|
||||
this.visible = false
|
||||
}
|
||||
// this.$emit('addImageOk', file, data, imgs)
|
||||
},
|
||||
// 确定增加的类型
|
||||
|
||||
Reference in New Issue
Block a user