宣传资讯

This commit is contained in:
liuye
2022-04-25 14:37:24 +08:00
parent ac99e83459
commit 9521730bae
4 changed files with 66 additions and 40 deletions

View File

@@ -12,7 +12,7 @@
<el-form-item label="发布地区" prop="areaId">
<ai-area-get :instance="instance" v-model="form.areaId" :root="rootArea" />
</el-form-item>
<el-form-item label="文章类型" prop="moduleId" style="width:50%;">
<el-form-item label="文章类型" prop="moduleId" style="width:50%;" v-if="miniTypeList.length">
<ai-select v-model="form.moduleId" :selectList="miniTypeList" @change="getNewTypeList"/>
</el-form-item>
<el-form-item label="分类" prop="categoryId" style="width:50%;">
@@ -106,7 +106,7 @@ export default {
files: []
},
miniTypeList: [],
newTypeList: []
newTypeList: [],
}
},
methods: {
@@ -161,17 +161,14 @@ export default {
},
getDetail() {
let {id} = this.$route.query
if(!id) {
return
}
id && this.instance.post("/app/apppreventionreturntopoverty/queryDetailById", null, {
id && this.instance.post("/app/apppublicityinfo/queryDetailById", null, {
params: {id}
}).then(res => {
if (res?.data) {
if(res.data.pictureUrl) {
res.data.pictureUrlList = [{url: res.data.pictureUrl}]
}
this.form = res.data
this.form = {...res.data}
this.getNewTypeList()
}
})
@@ -180,29 +177,35 @@ export default {
let {parentId} = this.$route.query
this.instance.post(`/app/apppublicitycategory/list?categoryType=1&size=100&parentId=${parentId}`).then(res => {
if (res.code == 0) {
res.data.records.map((item) => {
item.dictName = item.categoryName
item.dictValue = item.id
this.miniTypeList = res.data.records.map((item) => {
return {
dictName: item.categoryName,
dictValue: item.id
}
})
this.miniTypeList = res.data.records
console.log(this.miniTypeList)
if(this.$route.query.id) {
this.getDetail()
}
}
})
},
getNewTypeList() {
this.instance.post(`/app/apppublicitycategory/list?categoryType=2&size=100&parentId=${this.form.moduleId}`).then(res => {
if (res.code == 0) {
res.data.records.map((item) => {
item.dictName = item.categoryName
item.dictValue = item.id
res.data.records
this.newTypeList = res.data.records.map((item) => {
return {
dictName: item.categoryName,
dictValue: item.id
}
})
this.newTypeList = res.data.records
}
})
},
},
created() {
this.getTypeList()
this.getDetail()
}
}
</script>