v3.6.0 增加字典标签样式回显

This commit is contained in:
YunaiV
2022-02-16 13:27:17 +08:00
parent 986d1328e0
commit 08a35704e9
22 changed files with 101 additions and 126 deletions

View File

@ -29,8 +29,16 @@
<el-table v-loading="loading" :data="noticeList">
<el-table-column label="序号" align="center" prop="id" width="100" />
<el-table-column label="公告标题" align="center" prop="title" :show-overflow-tooltip="true"/>
<el-table-column label="公告类型" align="center" prop="type" :formatter="typeFormat" width="100"/>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" width="100"/>
<el-table-column label="公告类型" align="center" prop="type" width="100">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.SYSTEM_NOTICE_TYPE" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
<template slot-scope="scope">
@ -102,7 +110,7 @@ import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api
import Editor from '@/components/Editor';
import {CommonStatusEnum} from '@/utils/constants'
import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
export default {
name: "Notice",
@ -163,14 +171,6 @@ export default {
this.loading = false;
});
},
// 公告状态字典翻译
statusFormat(row, column) {
return getDictDataLabel(DICT_TYPE.COMMON_STATUS, row.status)
},
// 公告状态字典翻译
typeFormat(row, column) {
return getDictDataLabel(DICT_TYPE.SYSTEM_NOTICE_TYPE, row.type)
},
// 取消按钮
cancel() {
this.open = false;