拆分图片显示修改

This commit is contained in:
caoyang
2022-04-21 16:16:18 +08:00
parent 71f705c08a
commit ccc08a5cc2
6 changed files with 73 additions and 46 deletions
+2
View File
@@ -695,6 +695,8 @@ module.exports = {
incorrectsubmitted:'The data status is incorrect; Only data with status to be confirmed can be submitted', incorrectsubmitted:'The data status is incorrect; Only data with status to be confirmed can be submitted',
date:'date', date:'date',
time:'time', time:'time',
uploadMaximumATime:'upload a maximum of 20 images at a time',
confirmationOfRegulationsList:'Confirmation of regulations list', confirmationOfRegulationsList:'Confirmation of regulations list',
regulatoryTaskConfirmation:'Regulatory task confirmation', regulatoryTaskConfirmation:'Regulatory task confirmation',
certificationStart:'Certification start', certificationStart:'Certification start',
+3
View File
@@ -698,6 +698,9 @@ module.exports = {
finalizationTime:'定版时间', finalizationTime:'定版时间',
setting:'设定', setting:'设定',
date:'日期', date:'日期',
time:'时间',
uploadMaximumATime:'一次最多上传二十张图片',
time:'时间', time:'时间',
confirmationOfRegulationsList:'法规清单确认', confirmationOfRegulationsList:'法规清单确认',
regulatoryTaskConfirmation:'法规任务确认', regulatoryTaskConfirmation:'法规任务确认',
+25 -18
View File
@@ -35,7 +35,7 @@
data() { data() {
return { return {
visible: false, visible: false,
uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload', uploadAction: window._CONFIG['domianURL'] + '/split/sarFileSplitItems/upload',
upDataList: [], upDataList: [],
downLoadFileUrl: window._CONFIG['domianURL'] + '/sys/common/static', downLoadFileUrl: window._CONFIG['domianURL'] + '/sys/common/static',
fileList: [], fileList: [],
@@ -83,7 +83,10 @@
this.fileTypeSatus = false this.fileTypeSatus = false
}else{ }else{
// let thisFileType = this.thisFileType.replace(/\s+/g, ""); // let thisFileType = this.thisFileType.replace(/\s+/g, "");
this.uploadFileFlag++ if(this.uploadFileFlag<20){
this.uploadFileFlag++
}
this.fileTypeSatus = true this.fileTypeSatus = true
this.$message.destroy() this.$message.destroy()
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量! // 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
@@ -107,6 +110,7 @@
this.$message.error(val.response.message) this.$message.error(val.response.message)
info.fileList.splice(index, 1) info.fileList.splice(index, 1)
} }
}) })
if (this.fileTypeSatus) { if (this.fileTypeSatus) {
if (file.size > 1000000000) { if (file.size > 1000000000) {
@@ -138,7 +142,10 @@
this.uploadFileFlag-- this.uploadFileFlag--
this.fileList = [] this.fileList = []
this.myfileList = info.fileList this.myfileList = info.fileList
console.log('listLength11111',info.fileList.length)
if (info.fileList.length > 20) { if (info.fileList.length > 20) {
this.$message.destroy()
this.$message.error(this.$t('uploadMaximumATime'))
info.fileList.splice(20) info.fileList.splice(20)
this.myfileList = info.fileList this.myfileList = info.fileList
this.myfileList.forEach((res) => { this.myfileList.forEach((res) => {
@@ -148,25 +155,25 @@
this.fileList.push(res) this.fileList.push(res)
} }
}) })
this.$emit('uploadSuccess', this.fileList,fileList,this.uploadFileFlag)
this.$message.destroy()
this.$message.error('最多只能上传二十个')
return return
} }else{
this.myfileList.forEach((res) => {
if (res.response) { this.myfileList.forEach((res) => {
this.fileList.push(res.response.result) if (res.response) {
} else { this.fileList.push(res.response.result)
this.fileList.push(res) } else {
this.fileList.push(res)
}
})
// console.log('file111111',this.fileList,fileList,file,this.uploadFileFlag)
this.$emit('uploadSuccess',file, this.fileList,fileList,this.uploadFileFlag)
// console.log('uplossss',this.fileList,fileList)
if (this.myfileList.length > 0) {
this.$message.destroy()
this.$message.success(`${info.file.name} `+this.$t('uploadSuccessful'))
} }
})
console.log('file111111',this.fileList,fileList,file,this.uploadFileFlag)
this.$emit('uploadSuccess',file, this.fileList,fileList,this.uploadFileFlag)
// console.log('uplossss',this.fileList,fileList)
if (this.myfileList.length > 0) {
this.$message.destroy()
this.$message.success(`${info.file.name} `+this.$t('uploadSuccessful'))
} }
} else if (status === 'uploading') { } else if (status === 'uploading') {
// this.uploadFileFlag++ // this.uploadFileFlag++
this.myfileList = info.fileList this.myfileList = info.fileList
@@ -811,7 +811,7 @@
}, },
//上传文件 //上传文件
uploadSuccess1(file,data,imgs,uploadFileFlag) { uploadSuccess1(file,data,imgs ,uploadFileFlag) {
// console.log('dataimg',file,data,imgs,uploadFileFlag) // console.log('dataimg',file,data,imgs,uploadFileFlag)
for(let i = this.contentList.length;i>this.addIndex;i--){ for(let i = this.contentList.length;i>this.addIndex;i--){
@@ -821,7 +821,7 @@
id:'', id:'',
type:'IMG', type:'IMG',
itemContent:file.response.result.id, itemContent:file.response.result.id,
thumbUrl:file.thumbUrl thumbUrl:file.response.result.url
} }
// let lengthImg=imgs.length // let lengthImg=imgs.length
@@ -835,16 +835,17 @@
// id:'', // id:'',
// type:'IMG', // type:'IMG',
// itemContent:item.response.result.id, // itemContent:item.response.result.id,
// thumbUrl:item.thumbUrl // thumbUrl:item.response.result.url
// } // }
// }) // })
// } // }
// this.$refs.uploadFile2.visible=false // this.$refs.uploadFile2.visible=false
if(uploadFileFlag==0){ if(uploadFileFlag==0){
this.splitVisible=false this.splitVisible=false
} }
console.log('conteend',data,this.contentList) // console.log('conteend',imgs,this.contentList)
}, },
//点击图片预览 //点击图片预览
preImg(item){ preImg(item){
@@ -15,14 +15,19 @@
<p class="tag-info">{{$t('essentialInformation')}}</p> <p class="tag-info">{{$t('essentialInformation')}}</p>
<a-divider dashed /> <a-divider dashed />
<!-- 所属模块--> <!-- 所属模块-->
<a-col :span="24"> <a-col :span="24" v-if="submitKey == 1">
<a-form-model-item :label="$t('Module')" prop="isModel"> <a-form-model-item :label="$t('Module')" prop="isModel">
<!-- <j-dict-select-tag type="list" v-model="form.isModel" dictCode="module" :placeholder="$t('PleaseSelectModule')" />--> <a-select :placeholder="$t('PleaseSelectModule')" v-model="form.isModel">
<a-select :placeholder="$t('PleaseSelectModule')" v-model="form.isModel" @change="handleChange" :disabled="disableEdit"> <a-select-option :key="'1'" :value="'1'" >
<a-select-option :key="'1'" :value="'1'" v-if="submitKey == 1">
{{$t('DocumentLibrary')}} {{$t('DocumentLibrary')}}
</a-select-option> </a-select-option>
<a-select-option :key="'0'" :value="'0'" v-if="submitKey == 2"> </a-select>
</a-form-model-item>
</a-col>
<a-col :span="24" v-if="submitKey == 2">
<a-form-model-item :label="$t('Module')" prop="isModel">
<a-select :placeholder="$t('PleaseSelectModule')" v-model="form.isModel">
<a-select-option :key="'0'" :value="'0'">
{{$t('DocumentSplitting')}} {{$t('DocumentSplitting')}}
</a-select-option> </a-select-option>
</a-select> </a-select>
@@ -86,7 +91,7 @@
:placeholder="$t('selectDisplayList')" /> :placeholder="$t('selectDisplayList')" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="moduleShow"> <a-col :span="24" v-if="submitKey == 1">
<a-form-model-item :label="$t('DisplayArea')" prop="showArea"> <a-form-model-item :label="$t('DisplayArea')" prop="showArea">
<a-select :placeholder="$t('SelectDisplayArea')" v-model="form.showArea" @change="handleChange"> <a-select :placeholder="$t('SelectDisplayArea')" v-model="form.showArea" @change="handleChange">
<a-select-option v-for="(item,index) in areaOptions" :key="item.id" :value="item.id"> <a-select-option v-for="(item,index) in areaOptions" :key="item.id" :value="item.id">
@@ -102,14 +107,14 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<p class="tag-info" v-if="moduleShow">{{$t('DisplayOtherModules')}}</p> <p class="tag-info" v-if="submitKey == 1">{{$t('DisplayOtherModules')}}</p>
<a-divider dashed v-if="moduleShow" /> <a-divider dashed v-if="submitKey == 1" />
<a-col :span="24" v-if="moduleShow"> <a-col :span="24" v-if="submitKey == 1">
<a-form-model-item :label="$t('RegulationsListDisplay')" prop="isShowLawsList"> <a-form-model-item :label="$t('RegulationsListDisplay')" prop="isShowLawsList">
<j-dict-select-tag type="list" v-model="form.isShowLawsList" dictCode="yn" :placeholder="$t('selectDisplayListRegulations')" /> <j-dict-select-tag type="list" v-model="form.isShowLawsList" dictCode="yn" :placeholder="$t('selectDisplayListRegulations')" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="moduleShow"> <a-col :span="24" v-if="submitKey == 1">
<a-form-model-item :label="$t('SearchCenterDisplay')" prop="isShowSearch"> <a-form-model-item :label="$t('SearchCenterDisplay')" prop="isShowSearch">
<j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn" :placeholder="$t('selectSearchCenterDisplayed')" /> <j-dict-select-tag type="list" v-model="form.isShowSearch" dictCode="yn" :placeholder="$t('selectSearchCenterDisplayed')" />
</a-form-model-item> </a-form-model-item>
@@ -289,15 +294,7 @@ export default {
disableEdit(){ disableEdit(){
}, },
'form.isModel'(val){
console.log('val',val)
if(val=='1'){
this.moduleShow=true
}else if(val=='0'){
this.moduleShow=false
}
}
}, },
computed: { computed: {
changeType(val){ changeType(val){
@@ -329,18 +326,29 @@ export default {
// console.log('disableEdit',this.disableEdit) // console.log('disableEdit',this.disableEdit)
this.loadContent() this.loadContent()
this.loadShowArea() this.loadShowArea()
// console.log('edit',this.submitEdit) // console.log('edit',this.submitKey)
if(this.submitEdit==='add'){ if(this.submitEdit==='add'){
if(this.submitKey==='1'){ if(this.submitKey==='1'){
this.form.isModel='1' this.form.isModel='1'
}else if(this.submitKey==='2'){ this.moduleShow=true
}else if(this.submitKey=='2'){
this.form.isModel='0' this.form.isModel='0'
this.moduleShow=false
} }
this.disabledEdit=false // this.disabledEdit=false
}else if(this.submitEdit==='edit'){ }else if(this.submitEdit==='edit'){
this.disabledEdit=true if(this.submitKey==='1'){
this.form={...this.editData} this.form.isModel='1'
this.moduleShow=true
}else if(this.submitKey=='2'){
this.form.isModel='0'
this.moduleShow=false
}
// this.disabledEdit=true
} }
this.form={...this.editData}
// console.log('this.form.isModel',this.form.isModel)
}, },
methods: { methods: {
//获取选项内容 //获取选项内容
@@ -439,7 +447,7 @@ export default {
} }
}) })
// console.log('form',this.form) // console.log('form',this.form)
console.log('model',this.form.isModel) // console.log('model',this.form.isModel)
let onlineId='' let onlineId=''
let url='' let url=''
if(this.form.isModel=='1'){ if(this.form.isModel=='1'){
@@ -420,6 +420,12 @@
}, },
handleAddPop(val){ handleAddPop(val){
this.editData={} this.editData={}
if(this.submitKey=='1'){
this.editData.isModel='1'
}else if(this.submitKey=='2'){
this.editData.isModel='0'
}
this.disableEdit=false this.disableEdit=false
this.drawerVisible=true this.drawerVisible=true
this.titleTag=this.$t('NewLabelItem') this.titleTag=this.$t('NewLabelItem')