Browse Source

模块类型bug修改

feature/syp_points
songyunpeng 5 years ago
parent
commit
4c4e7ce9ee
  1. 7
      src/views/modules/news/notice-add-or-update.vue
  2. 6
      src/views/modules/news/notice.vue

7
src/views/modules/news/notice-add-or-update.vue

@ -36,7 +36,7 @@
</el-row> </el-row>
<el-form-item label="所属模块" prop="noticeCategory"> <el-form-item label="所属模块" prop="noticeCategory">
<div class="block"> <div class="block">
<el-cascader v-model="noticeCategoryList" placeholder="试试搜索:一键服务" :props="optionProps" :options="moduleCategoryList" filterable></el-cascader> <el-cascader v-model="noticeCategoryList" placeholder="试试搜索:一键服务" :props="optionProps" :options="moduleCategoryList" filterable clearable></el-cascader>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="通知标题" <el-form-item label="通知标题"
@ -158,6 +158,8 @@ export default {
'noticeCategoryList': function (val) { 'noticeCategoryList': function (val) {
if (val.length !== 0) { if (val.length !== 0) {
this.dataForm.noticeCategory = val[val.length - 1] this.dataForm.noticeCategory = val[val.length - 1]
} else {
this.dataForm.noticeCategory = ''
} }
} }
}, },
@ -249,6 +251,7 @@ export default {
this.getInfo() this.getInfo()
} else { } else {
this.dataForm = {} this.dataForm = {}
this.noticeCategoryList = []
} }
}) })
}, },
@ -380,7 +383,7 @@ export default {
}).catch(() => {}) }).catch(() => {})
}, },
getModuleCategoryList () { getModuleCategoryList () {
this.$http.get('/news/modulecategory/list').then(({ data: res }) => { this.$http.get('/news/modulecategory/getListToShow').then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }

6
src/views/modules/news/notice.vue

@ -12,7 +12,7 @@
</el-form-item> </el-form-item>
<el-form-item label="所属模块:" prop="noticeCategory"> <el-form-item label="所属模块:" prop="noticeCategory">
<div class="block"> <div class="block">
<el-cascader v-model="noticeCategoryList" placeholder="试试搜索:一键服务" :props="optionProps" :options="moduleCategoryList" filterable></el-cascader> <el-cascader v-model="noticeCategoryList" placeholder="试试搜索:一键服务" :props="optionProps" :options="moduleCategoryList" filterable clearable></el-cascader>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -135,6 +135,8 @@ export default {
'noticeCategoryList': function (val) { 'noticeCategoryList': function (val) {
if (val.length !== 0) { if (val.length !== 0) {
this.dataForm.noticeCategory = val[val.length - 1] this.dataForm.noticeCategory = val[val.length - 1]
} else {
this.dataForm.noticeCategory = ''
} }
} }
}, },
@ -194,7 +196,7 @@ export default {
}).catch(() => {}) }).catch(() => {})
}, },
getModuleCategoryList () { getModuleCategoryList () {
this.$http.get('/news/modulecategory/list').then(({ data: res }) => { this.$http.get('/news/modulecategory/getListToShow').then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }

Loading…
Cancel
Save