Browse Source

级联菜单BUG

redesign
zhangyuan 5 years ago
parent
commit
3764384504
  1. 15
      src/views/modules/honest/newshonest-list.vue
  2. 15
      src/views/modules/honest/newshonest.vue

15
src/views/modules/honest/newshonest-list.vue

@ -33,7 +33,7 @@
placeholder="新闻栏目" @change="resetPage" clearable>
<el-option v-for="item in newsSubCateroryIds"
:key="item.id"
:label="item.title"
:label="item.categoryName"
:value="item.id">
</el-option>
</el-select>
@ -115,8 +115,11 @@ export default {
deleteIsBatch: true
},
dataForm: {
id: '',
newsUpDownState: ''
newsTitle: '',
businessId: '',
newsCateroryId: '',
newsSubCateroryId: '',
newsApprovalState: ''
},
approvalOptions: [
{
@ -149,6 +152,7 @@ export default {
},
businessChange (item) {
this.resetPage()
this.dataForm.newsCateroryId = ''
//
this.$http
.get(`/news/newssection/options/` + item)
@ -165,15 +169,16 @@ export default {
},
categoryChange (item) {
this.resetPage()
this.dataForm.newsSubCateroryId = ''
//
this.$http
.get(`/news/newssection/options/` + item)
.get(`/news/newssection/suboptions/` + item)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.loading = false
this.newsCateroryIds = res.data
this.newsSubCateroryIds = res.data
})
.catch(() => {
this.loading = false

15
src/views/modules/honest/newshonest.vue

@ -33,7 +33,7 @@
placeholder="新闻栏目" @change="resetPage" clearable>
<el-option v-for="item in newsSubCateroryIds"
:key="item.id"
:label="item.title"
:label="item.categoryName"
:value="item.id">
</el-option>
</el-select>
@ -106,8 +106,11 @@ export default {
deleteIsBatch: true
},
dataForm: {
id: '',
newsUpDownState: ''
newsTitle: '',
businessId: '',
newsCateroryId: '',
newsSubCateroryId: '',
newsApprovalState: ''
},
reviewVisible: false,
newsCateroryIds: [],
@ -129,6 +132,7 @@ export default {
},
businessChange (item) {
this.resetPage()
this.dataForm.newsCateroryId = ''
//
this.$http
.get(`/news/newssection/options/` + item)
@ -145,15 +149,16 @@ export default {
},
categoryChange (item) {
this.resetPage()
this.dataForm.newsSubCateroryId = ''
//
this.$http
.get(`/news/newssection/options/` + item)
.get(`/news/newssection/suboptions/` + item)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.loading = false
this.newsCateroryIds = res.data
this.newsSubCateroryIds = res.data
})
.catch(() => {
this.loading = false

Loading…
Cancel
Save