拆分详情新增有时无回显问题
This commit is contained in:
@@ -332,22 +332,11 @@
|
|||||||
this.$message.success(this.$t('OperationSuccessful'))
|
this.$message.success(this.$t('OperationSuccessful'))
|
||||||
// this.loadData()
|
// this.loadData()
|
||||||
this.$emit('addFormClick')
|
this.$emit('addFormClick')
|
||||||
eventBUs.$emit('searchReset')
|
// eventBUs.$emit('searchReset')
|
||||||
}else{
|
}else{
|
||||||
this.$message.warning(this.$t('operationFailed'))
|
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 {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,7 +184,7 @@
|
|||||||
immediate:true,
|
immediate:true,
|
||||||
handler(val){
|
handler(val){
|
||||||
this.menu_id=val
|
this.menu_id=val
|
||||||
console.log('menuId',this.menu_id)
|
// console.log('menuId',this.menu_id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
menu_id:'',
|
menu_id:'',
|
||||||
info_id:this.infoId
|
info_id:this.infoId
|
||||||
}
|
}
|
||||||
console.log('queryparamssss',this.queryParam)
|
// console.log('queryparamssss',this.queryParam)
|
||||||
this.$emit('resetSearch')
|
this.$emit('resetSearch')
|
||||||
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
|
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(this.queryParam)))
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -291,13 +291,28 @@
|
|||||||
>
|
>
|
||||||
<div class="title-wraper">
|
<div class="title-wraper">
|
||||||
<div class="title-top">
|
<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-text" :class="{'title-flex-active':selected=='TEXT'}" @click="selectTitle('TEXT')">{{$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-pic" :class="{'title-flex-active':selected=='IMG'}" @click="selectTitle('IMG')">{{$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-table" :class="{'title-flex-active':selected=='TABLE'}" @click="selectTitle('TABLE')">{{$t('table')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="title-num" v-if="selectedNum">
|
<div class="title-num" v-if="selectedNum">
|
||||||
<span class="title-num-add">{{$t('addQuantity')}}</span>
|
<a-form>
|
||||||
<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-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>
|
||||||
</div>
|
</div>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
@@ -369,9 +384,9 @@
|
|||||||
TitlePreImg:'',
|
TitlePreImg:'',
|
||||||
contentList:[],
|
contentList:[],
|
||||||
content:{},
|
content:{},
|
||||||
selected:1,
|
selected:'TEXT',
|
||||||
selectedNum:true,
|
selectedNum:true,
|
||||||
textNumber:1,
|
textNumber:null,
|
||||||
Title:this.$t('add'),
|
Title:this.$t('add'),
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
visible:false,
|
visible:false,
|
||||||
@@ -518,7 +533,14 @@
|
|||||||
loading:false,
|
loading:false,
|
||||||
token:Vue.ls.get(ACCESS_TOKEN),
|
token:Vue.ls.get(ACCESS_TOKEN),
|
||||||
submitFlag:false,
|
submitFlag:false,
|
||||||
deleteIds:[]
|
deleteIds:[],
|
||||||
|
numberForm:{},
|
||||||
|
validatorRules:{
|
||||||
|
textNumber:[
|
||||||
|
{ required: true, message: this.$t('enterQuantity'),trigger: 'blur'},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
numberFlag:false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props:{
|
props:{
|
||||||
@@ -557,7 +579,7 @@
|
|||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
selected(val){
|
selected(val){
|
||||||
if(this.selected==1){
|
if(this.selected==='TEXT'){
|
||||||
this.selectedNum=true
|
this.selectedNum=true
|
||||||
}else{
|
}else{
|
||||||
this.selectedNum=false
|
this.selectedNum=false
|
||||||
@@ -606,6 +628,7 @@
|
|||||||
//增加按钮
|
//增加按钮
|
||||||
splitAdd(val){
|
splitAdd(val){
|
||||||
this.addConVisible=true
|
this.addConVisible=true
|
||||||
|
// this.numberForm.textNumber=null
|
||||||
if(val=='-1'){
|
if(val=='-1'){
|
||||||
this.addIndex=this.contentList.length-1
|
this.addIndex=this.contentList.length-1
|
||||||
}else{
|
}else{
|
||||||
@@ -689,22 +712,6 @@
|
|||||||
this.submitFlag=false
|
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(){
|
handleOk(){
|
||||||
this.addConVisible=false
|
// console.log('seletype',this.selected)
|
||||||
let contentLength=this.contentList.length
|
let contentLength=this.contentList.length
|
||||||
if(this.selected==1){ //文本类型
|
if(this.selected=='TEXT'){ //文本类型
|
||||||
for(let i=this.contentList.length;i>this.addIndex;i--){
|
// console.log('contentList111111',this.contentList)
|
||||||
this.contentList[i+contentLength-1]=this.contentList[i-1]
|
this.$refs.numberForm.validate(valid=>{
|
||||||
}
|
if(valid){
|
||||||
for(let j=0;j<this.textNumber;j++){
|
this.numberFlag=true
|
||||||
this.contentList[++this.addIndex]={
|
if(this.numberFlag){
|
||||||
id:'',
|
for(let i=this.contentList.length;i>this.addIndex;i--){
|
||||||
type:'TEXT',
|
this.contentList[i+this.numberForm.textNumber-1]=this.contentList[i-1]
|
||||||
itemContent:''
|
}
|
||||||
|
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.$refs.uploadFile2.visible=true
|
||||||
this.splitVisible=true
|
this.splitVisible=true
|
||||||
|
this.addConVisible=false
|
||||||
}else if(this.selected==3){ //表格类型
|
}else if(this.selected=='TABLE'){ //表格类型
|
||||||
this.tableColVisible=true
|
this.tableColVisible=true
|
||||||
|
this.addConVisible=false
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -1122,8 +1141,6 @@
|
|||||||
.title-num {
|
.title-num {
|
||||||
margin: 20px 20px 0;
|
margin: 20px 20px 0;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
display: flex;
|
|
||||||
justify-content: start;
|
|
||||||
|
|
||||||
.title-num-add {
|
.title-num-add {
|
||||||
min-width: 70px;
|
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>
|
</style>
|
||||||
@@ -756,6 +756,12 @@
|
|||||||
//批量设置确定提交
|
//批量设置确定提交
|
||||||
addFormClick(){
|
addFormClick(){
|
||||||
this.batSetVisible=false
|
this.batSetVisible=false
|
||||||
|
let queryParam={
|
||||||
|
menu_id:this.menuId,
|
||||||
|
info_id: this.infoId,
|
||||||
|
|
||||||
|
}
|
||||||
|
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||||
},
|
},
|
||||||
//批量删除
|
//批量删除
|
||||||
handleBatCancel(){
|
handleBatCancel(){
|
||||||
|
|||||||
Reference in New Issue
Block a user