拆分图片上传问题

This commit is contained in:
caoyang
2022-04-01 18:19:53 +08:00
parent 9fafb83c43
commit c146d817b1
5 changed files with 110 additions and 62 deletions
@@ -194,7 +194,7 @@
<j-dict-select-tag v-model="formInline[item.db_field_name]"
:disabled="disabled"
@input="handleInput(item.db_field_name)"
:placeholder="$t('selectStatus')"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
:type="'radio'" :triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
@@ -228,7 +228,8 @@
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<j-multi-select-tag class="box-input" v-model="formInline[item.db_field_name]"
:disabled="disabled"
:placeholder="$t('selectStatus')" :type="'checkbox'"
:placeholder="$t('PleaseSelect')+item.db_field_txt"
:type="'checkbox'"
:triggerChange="false" :dictCode="item.dict_field"/>
</a-form-model-item>
</div>
@@ -301,7 +302,7 @@
</div>
</a-modal>
<!-- 上传图片弹框-->
<split-upload v-if="splitVisible" ref="uploadFile2" :disabled="disabled" :title="titleImg" :listType='listType' :splitVisible="splitVisible" @uploadSuccess="uploadSuccess1"></split-upload>
<split-upload v-if="splitVisible" ref="uploadFile2" :disabled="disabled" :title="titleImg" :listType='listType' :splitVisible="splitVisible" :accept="accept" @coloseHandle="coloseHandle" @uploadSuccess="uploadSuccess1"></split-upload>
<!-- 输入表格行数列数-->
<a-modal
@@ -723,7 +724,7 @@
}
}else if(this.selected==2){ //图片类型
// this.$refs.uploadFile2.visible=true
this.splitVisible=true
}else if(this.selected==3){ //表格类型
@@ -741,7 +742,7 @@
},
//上传文件
uploadSuccess1(data,imgs) {
// console.log('dataimg',data,imgs)
console.log('dataimg',data,imgs)
let lengthImg=imgs.length
for(let i = this.contentList.length;i>this.addIndex;i--){
this.contentList[i+lengthImg-1]=this.contentList[i-1]
@@ -751,10 +752,12 @@
this.contentList[++this.addIndex]={
id:'',
type:'IMG',
itemContent:item.id
itemContent:item.id,
thumbUrl:item.thumbUrl
}
})
}
// this.$refs.uploadFile2.visible=false
this.splitVisible=false
// console.log('conteend',this.contentList)
},
@@ -770,6 +773,11 @@
//表格确认按钮
handleOkTable(){
this.tableVisible=false
this.contentList[this.addIndex+1]= {
id:'',
type:'TABLE',
itemContent:this.ueContent
}
},
//表格取消按钮
handleCancelTable(){
@@ -788,6 +796,8 @@
//取消行数列数按钮
handleColCancel(){
this.tableColVisible=false
this.rowCount=''
this.colCount=''
},
//确定行数列数按钮
handleColOk(){
@@ -814,14 +824,12 @@
}
tableStr+=`</table>`
this.ueContent=tableStr
this.contentList[this.addIndex+1]= {
id:'',
type:'TABLE',
itemContent:tableStr
}
this.$nextTick(() => {
this.$refs.ueditor.setContent(this.ueContent)
})
this.rowCount=''
this.colCount=''
}
// console.log('cont1111',this.addIndex,this.contentList)
},
@@ -849,6 +857,7 @@
},
/** 上传文件的回调 */
uploadSuccess(data) {
console.log('dataaaaa',data)
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
@@ -859,6 +868,10 @@
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
},
//关闭上传
coloseHandle(){
this.splitVisible=false
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
@@ -957,9 +970,11 @@
this.getForm(() => {
getAction(this.url.getDocumentInfo, { id: item.id }).then((res) => {
if (res.success) {
this.formInline = res.result[0]
this.formInline = res.result
console.log('form11111',this.formInline)
}
})
})
},
add() {
@@ -977,6 +992,7 @@
this.formInline[value + '_id'] = id
this.formInline = { ...this.formInline }
},
//正则替换小数点
limitNumber(value) {
if (typeof value === 'string') {
@@ -1179,4 +1195,13 @@
width: 100%;
}
}
.split-img{
.ant-modal-body{
img{
margin-top: 20px;
width: 470px;
height: 100%;
}
}
}
</style>