政策申办
This commit is contained in:
@@ -13,10 +13,10 @@
|
||||
<ai-area-get :instance="instance" v-model="form.areaId" :root="rootArea" valueLevel="5"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文章类型" prop="moduleId" style="width:50%;">
|
||||
<ai-select v-model="form.moduleId" :selectList="dict.getDict('sex')"/>
|
||||
<ai-select v-model="form.moduleId" :selectList="miniTypeList" @change="getNewTypeList"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类" prop="categoryId" style="width:50%;">
|
||||
<ai-select v-model="form.categoryId" :selectList="dict.getDict('sex')"/>
|
||||
<ai-select v-model="form.categoryId" :selectList="newTypeList"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="正文" prop="content" style="width: 100%;">
|
||||
<ai-editor v-model="form.content" :instance="instance"/>
|
||||
@@ -98,10 +98,12 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
householdRelation: "",
|
||||
healthyStatus: [],
|
||||
pictureUrlList: [],
|
||||
pictureUrl: '',
|
||||
file: []
|
||||
},
|
||||
miniTypeList: [],
|
||||
newTypeList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -152,6 +154,9 @@ export default {
|
||||
submit() {
|
||||
this.$refs.ruleForm.validate(v => {
|
||||
if (v) {
|
||||
if(this.form.pictureUrlList.length) {
|
||||
this.form.pictureUrl = this.form.pictureUrlList[0].url
|
||||
}
|
||||
this.instance.post(`/app/apppublicityinfo/addOrUpdate`, this.form).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('提交成功!');
|
||||
@@ -160,10 +165,34 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
getTypeList() {
|
||||
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
|
||||
}
|
||||
})
|
||||
},
|
||||
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
|
||||
})
|
||||
this.newTypeList = res.data.records
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getDetail()
|
||||
this.getTypeList()
|
||||
// this.getDetail()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</ai-search-bar>
|
||||
<ai-search-bar>
|
||||
<template #left>
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="showEdit('')">添加</el-button>
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="showEdit('')" v-if="typeList.length && miniTypeList.length">添加</el-button>
|
||||
<!-- <el-button icon="iconfont iconDelete" :disabled="!ids.length" @click="handleDelete(ids)">删除</el-button> -->
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
|
||||
Reference in New Issue
Block a user