|
@@ -149,7 +149,6 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$nextTick(()=>{
|
|
|
- if(this.type){this.searchTagList()}
|
|
|
if(this.options.id){
|
|
|
if(this.options && this.options.data && this.options.data.length>0){
|
|
|
let reviewList = this.options.data
|
|
@@ -170,17 +169,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.rightTagsList = reviewList
|
|
|
- console.log(reviewList,'xiugai')
|
|
|
}
|
|
|
this.$emit('changeActionData', this.rightTagsList, false);
|
|
|
this.getSubTemplate()
|
|
|
}else{
|
|
|
this.getSubTemplate()
|
|
|
}
|
|
|
+ this.searchTagList()
|
|
|
})
|
|
|
},
|
|
|
watch: {
|
|
|
type(newVal, preVal) {
|
|
|
+ this.searchTagList() //重新获取标签池数据
|
|
|
if(newVal != preVal){
|
|
|
this.form = {region: ''}
|
|
|
this.subTmpList = [] //子模板的id用于去重
|
|
@@ -191,7 +191,6 @@ export default {
|
|
|
this.selectRightTagsListIndex = []
|
|
|
this.searchVal = ''
|
|
|
this.getSubTemplate() //重新获取子模板
|
|
|
- this.searchTagList() //重新获取标签池数据
|
|
|
}
|
|
|
},
|
|
|
searchVal(newVal, preVal) {
|
|
@@ -327,7 +326,7 @@ export default {
|
|
|
return this.isHasTag(item, this.selectRightTagsList)
|
|
|
},
|
|
|
toLeftList() {
|
|
|
- if (this.selectRightTagsList.length>0 && this.selectRightTagsList[0].type !== 'sub' && this.selectRightTagsList[0].type !== 'input') { //往左的是子模板不变或者输入框,是输入框或者标签就删除
|
|
|
+ if (this.selectRightTagsList.length>0 && this.selectRightTagsList[0].type !== 'sub') { //往左的是子模板不变或者输入框,是输入框或者标签就删除
|
|
|
for (let i = 0; i < this.selectRightTagsList.length; i++) {
|
|
|
this.rightTagsList = this.rightTagsList.filter(item => item.id !== this.selectRightTagsList[0].id)
|
|
|
}
|
|
@@ -350,12 +349,15 @@ export default {
|
|
|
},
|
|
|
searchTagList() {
|
|
|
let notIds = []
|
|
|
- for (let i = 0; i < this.rightTagsList.length; i++) {
|
|
|
- notIds.push(this.rightTagsList[i].id)
|
|
|
+ let tmpArr = this.rightTagsList.slice();
|
|
|
+ for (let i = 0; i < tmpArr.length; i++) {
|
|
|
+ if(tmpArr[i].type != 'sub' && tmpArr[i].type != 'input'){
|
|
|
+ notIds.push(tmpArr[i].id)
|
|
|
+ }
|
|
|
}
|
|
|
let param = {
|
|
|
"tagName": this.searchVal,
|
|
|
- "type": 1,
|
|
|
+ "type": this.type == 4?3:1,
|
|
|
"noIds": notIds,
|
|
|
}
|
|
|
api.getQuestionInfos(param).then((res) => {
|
|
@@ -372,7 +374,6 @@ export default {
|
|
|
}
|
|
|
api.getModuleInfoSub(param).then((res) => {
|
|
|
if (res.data.code === '0') {
|
|
|
- console.log(res.data.data)
|
|
|
this.Adscriptions = res.data.data
|
|
|
}
|
|
|
})
|