|
|
@ -10,16 +10,11 @@ |
|
|
|
placeholder="通知标题" |
|
|
|
clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属模块" prop="noticeCategory"> |
|
|
|
<el-select v-model="dataForm.noticeCategory" placeholder="请选择模块" clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in optionNoticeCategoryCode" |
|
|
|
:key="item.dictValue" |
|
|
|
:label="item.dictName" |
|
|
|
:value="item.dictValue"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属模块:" prop="noticeCategory"> |
|
|
|
<div class="block"> |
|
|
|
<el-cascader v-model="noticeCategoryList" placeholder="试试搜索:一键服务" :props="optionProps" :options="moduleCategoryList" filterable></el-cascader> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|
|
|
</el-form-item> |
|
|
@ -48,12 +43,12 @@ |
|
|
|
align="center" |
|
|
|
show-overflow-tooltip |
|
|
|
min-width="200"></el-table-column> |
|
|
|
<el-table-column prop="noticeCategory" |
|
|
|
<el-table-column prop="categoryName" |
|
|
|
label="所属模块" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="150" |
|
|
|
:formatter="noticeCategoryFormat"></el-table-column> |
|
|
|
></el-table-column> |
|
|
|
<el-table-column prop="mobile" |
|
|
|
label="联系电话" |
|
|
|
header-align="center" |
|
|
@ -127,7 +122,20 @@ export default { |
|
|
|
dataForm: { |
|
|
|
noticeTitle: '' |
|
|
|
}, |
|
|
|
optionNoticeCategoryCode: [] |
|
|
|
optionNoticeCategoryCode: [], |
|
|
|
moduleCategoryList: [], |
|
|
|
noticeCategoryList: [], |
|
|
|
optionProps: { |
|
|
|
checkStrictly: true, |
|
|
|
value: 'categoryCode' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
'noticeCategoryList': function (val) { |
|
|
|
if (val.length !== 0) { |
|
|
|
this.dataForm.noticeCategory = val[val.length - 1] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
@ -135,7 +143,7 @@ export default { |
|
|
|
}, |
|
|
|
created () { |
|
|
|
// 根据数据字典类型notice_category 获取简版数据字典列表,用于页面下拉菜单 |
|
|
|
this.getListSimpleByDictType() |
|
|
|
this.getModuleCategoryList() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 发布通知 |
|
|
@ -185,12 +193,23 @@ export default { |
|
|
|
this.optionNoticeCategoryCode = res.data |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
noticeCategoryFormat (row, column) { |
|
|
|
for (var property in this.optionNoticeCategoryCode) { |
|
|
|
if (row.noticeCategory === this.optionNoticeCategoryCode[property].dictValue) { |
|
|
|
return this.optionNoticeCategoryCode[property].dictName |
|
|
|
getModuleCategoryList () { |
|
|
|
this.$http.get('/news/modulecategory/list').then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
} |
|
|
|
this.getSelectedNode(res.data, res.data) |
|
|
|
this.moduleCategoryList = res.data |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
getSelectedNode (nodeData, parent) { |
|
|
|
nodeData.forEach(item => { |
|
|
|
if ('children' in item && item.children.length === 0) { |
|
|
|
delete item.children |
|
|
|
} else if ('children' in item && item.children.length) { |
|
|
|
this.getSelectedNode(item.children, item) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|