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

@@ -108,7 +108,7 @@ import { listData, getData, delData, addData, updateData, exportData } from "@/a
import { listAllSimple, getType } from "@/api/system/dict/type";
import { CommonStatusEnum } from '@/utils/constants'
import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
export default {
name: "Data",

View File

@@ -44,7 +44,11 @@
</router-link>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
<el-table-column label="状态" align="center" prop="status">
<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="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
@@ -94,7 +98,7 @@
import { listType, getType, delType, addType, updateType, exportType } from "@/api/system/dict/type";
import { CommonStatusEnum } from '@/utils/constants'
import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
import { getDictDatas, DICT_TYPE } from '@/utils/dict'
export default {
name: "Dict",
@@ -161,10 +165,6 @@ export default {
this.loading = false;
});
},
// 字典状态字典翻译
statusFormat(row, column) {
return getDictDataLabel(DICT_TYPE.COMMON_STATUS, row.status)
},
// 取消按钮
cancel() {
this.open = false;