拆分详情新增有时无回显问题
This commit is contained in:
@@ -332,22 +332,11 @@
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
// this.loadData()
|
||||
this.$emit('addFormClick')
|
||||
eventBUs.$emit('searchReset')
|
||||
// eventBUs.$emit('searchReset')
|
||||
}else{
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// postAction(url, formInline).then((res) => {
|
||||
// if (res.success) {
|
||||
// this.$message.success(this.$t('OperationSuccessful'))
|
||||
// eventBUs.$emit('searchReset')
|
||||
// this.$emit('addFormClick')
|
||||
// } else {
|
||||
// this.$message.warning(this.$t('operationFailed'))
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
immediate:true,
|
||||
handler(val){
|
||||
this.menu_id=val
|
||||
console.log('menuId',this.menu_id)
|
||||
// console.log('menuId',this.menu_id)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -206,7 +206,7 @@
|
||||
menu_id:'',
|
||||
info_id:this.infoId
|
||||
}
|
||||
console.log('queryparamssss',this.queryParam)
|
||||
// console.log('queryparamssss',this.queryParam)
|
||||
this.$emit('resetSearch')
|
||||
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
|
||||
},
|
||||
|
||||
@@ -291,13 +291,28 @@
|
||||
>
|
||||
<div class="title-wraper">
|
||||
<div class="title-top">
|
||||
<span class="title-flex title-text" :class="{'title-flex-active':selected==1}" @click="selectTitle(1)">{{$t('text')}}</span>
|
||||
<span class="title-flex title-pic" :class="{'title-flex-active':selected==2}" @click="selectTitle(2)">{{$t('picture')}}</span>
|
||||
<span class="title-flex title-table" :class="{'title-flex-active':selected==3}" @click="selectTitle(3)">{{$t('table')}}</span>
|
||||
<span class="title-flex title-text" :class="{'title-flex-active':selected=='TEXT'}" @click="selectTitle('TEXT')">{{$t('text')}}</span>
|
||||
<span class="title-flex title-pic" :class="{'title-flex-active':selected=='IMG'}" @click="selectTitle('IMG')">{{$t('picture')}}</span>
|
||||
<span class="title-flex title-table" :class="{'title-flex-active':selected=='TABLE'}" @click="selectTitle('TABLE')">{{$t('table')}}</span>
|
||||
</div>
|
||||
<div class="title-num" v-if="selectedNum">
|
||||
<span class="title-num-add">{{$t('addQuantity')}}</span>
|
||||
<a-input-number class="title-num-edit" :min="1" :max="100" v-model="textNumber" :placeholder="$t('enterQuantity')" :formatter="limitNumber" :parser="limitNumber" ></a-input-number>
|
||||
<a-form>
|
||||
<a-form-model
|
||||
class="number-content"
|
||||
:model="numberForm"
|
||||
:rules="validatorRules"
|
||||
ref="numberForm"
|
||||
>
|
||||
<a-form-model-item :label="$t('addQuantity')" prop="textNumber">
|
||||
<!-- <span class="title-num-add">{{$t('addQuantity')}}</span>-->
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<a-input-number class="title-num-edit" :min="1" :max="100" v-model="numberForm.textNumber" :placeholder="$t('enterQuantity')" :formatter="limitNumber" :parser="limitNumber" ></a-input-number>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-form>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
@@ -369,9 +384,9 @@
|
||||
TitlePreImg:'',
|
||||
contentList:[],
|
||||
content:{},
|
||||
selected:1,
|
||||
selected:'TEXT',
|
||||
selectedNum:true,
|
||||
textNumber:1,
|
||||
textNumber:null,
|
||||
Title:this.$t('add'),
|
||||
confirmLoading: false,
|
||||
visible:false,
|
||||
@@ -518,7 +533,14 @@
|
||||
loading:false,
|
||||
token:Vue.ls.get(ACCESS_TOKEN),
|
||||
submitFlag:false,
|
||||
deleteIds:[]
|
||||
deleteIds:[],
|
||||
numberForm:{},
|
||||
validatorRules:{
|
||||
textNumber:[
|
||||
{ required: true, message: this.$t('enterQuantity'),trigger: 'blur'},
|
||||
]
|
||||
},
|
||||
numberFlag:false,
|
||||
}
|
||||
},
|
||||
props:{
|
||||
@@ -557,7 +579,7 @@
|
||||
},
|
||||
watch:{
|
||||
selected(val){
|
||||
if(this.selected==1){
|
||||
if(this.selected==='TEXT'){
|
||||
this.selectedNum=true
|
||||
}else{
|
||||
this.selectedNum=false
|
||||
@@ -606,6 +628,7 @@
|
||||
//增加按钮
|
||||
splitAdd(val){
|
||||
this.addConVisible=true
|
||||
// this.numberForm.textNumber=null
|
||||
if(val=='-1'){
|
||||
this.addIndex=this.contentList.length-1
|
||||
}else{
|
||||
@@ -689,22 +712,6 @@
|
||||
this.submitFlag=false
|
||||
})
|
||||
}
|
||||
|
||||
// postAction(url, params).then((res) => {
|
||||
// if (res.success) {
|
||||
// this.confirmLoading = false
|
||||
// this.$message.success(this.$t('OperationSuccessful'))
|
||||
// eventBUs.$emit('searchReset')
|
||||
// this.$emit('addFormClick')
|
||||
// } else {
|
||||
// this.confirmLoading = false
|
||||
// if (res.message.indexOf('发布日期不能大于') >= 0) {
|
||||
// this.$message.warning(res.message)
|
||||
// } else {
|
||||
// this.$message.warning(this.$t('operationFailed'))
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -715,27 +722,39 @@
|
||||
},
|
||||
//确定增加的类型
|
||||
handleOk(){
|
||||
this.addConVisible=false
|
||||
// console.log('seletype',this.selected)
|
||||
let contentLength=this.contentList.length
|
||||
if(this.selected==1){ //文本类型
|
||||
for(let i=this.contentList.length;i>this.addIndex;i--){
|
||||
this.contentList[i+contentLength-1]=this.contentList[i-1]
|
||||
}
|
||||
for(let j=0;j<this.textNumber;j++){
|
||||
this.contentList[++this.addIndex]={
|
||||
id:'',
|
||||
type:'TEXT',
|
||||
itemContent:''
|
||||
if(this.selected=='TEXT'){ //文本类型
|
||||
// console.log('contentList111111',this.contentList)
|
||||
this.$refs.numberForm.validate(valid=>{
|
||||
if(valid){
|
||||
this.numberFlag=true
|
||||
if(this.numberFlag){
|
||||
for(let i=this.contentList.length;i>this.addIndex;i--){
|
||||
this.contentList[i+this.numberForm.textNumber-1]=this.contentList[i-1]
|
||||
}
|
||||
for(let j=0;j<this.numberForm.textNumber;j++){
|
||||
this.contentList[++this.addIndex]={
|
||||
id:'',
|
||||
type:'TEXT',
|
||||
itemContent:''
|
||||
}
|
||||
}
|
||||
this.addConVisible=false
|
||||
this.numberFlag=false
|
||||
this.numberForm.textNumber=null
|
||||
// console.log('contentList',this.contentList)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}else if(this.selected==2){ //图片类型
|
||||
}else if(this.selected=='IMG'){ //图片类型
|
||||
// this.$refs.uploadFile2.visible=true
|
||||
this.splitVisible=true
|
||||
|
||||
}else if(this.selected==3){ //表格类型
|
||||
this.addConVisible=false
|
||||
}else if(this.selected=='TABLE'){ //表格类型
|
||||
this.tableColVisible=true
|
||||
|
||||
this.addConVisible=false
|
||||
}
|
||||
|
||||
},
|
||||
@@ -1122,8 +1141,6 @@
|
||||
.title-num {
|
||||
margin: 20px 20px 0;
|
||||
line-height: 32px;
|
||||
display: flex;
|
||||
justify-content: start;
|
||||
|
||||
.title-num-add {
|
||||
min-width: 70px;
|
||||
@@ -1210,4 +1227,15 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.number-content{
|
||||
.ant-form-item{
|
||||
display: flex;
|
||||
.ant-form-item-control-wrapper{
|
||||
flex: 1;
|
||||
.title-num-edit{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -756,6 +756,12 @@
|
||||
//批量设置确定提交
|
||||
addFormClick(){
|
||||
this.batSetVisible=false
|
||||
let queryParam={
|
||||
menu_id:this.menuId,
|
||||
info_id: this.infoId,
|
||||
|
||||
}
|
||||
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
},
|
||||
//批量删除
|
||||
handleBatCancel(){
|
||||
|
||||
Reference in New Issue
Block a user