Commit 08a35704e96e19fffedb86103d55401859ada401

Authored by YunaiV
1 parent 986d1328

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

yudao-ui-admin/src/components/DictTag/index.vue
1 1 <template>
2   - <div>
  2 + <span>
3 3 <template v-for="(dict, index) in this.getDictDatas2(type, value)">
4 4 <!-- 默认样式 -->
5   - <span v-if="dict.colorType === 'default' || dict.colorType === '' || dict.color === undefined" :key="dict.value" :index="index"
  5 + <span v-if="dict.colorType === 'default' || dict.colorType === '' || dict.colorType === undefined" :key="dict.value" :index="index"
6 6 :class="dict.cssClass">{{ dict.label }}</span>
7 7 <!-- Tag 样式 -->
8 8 <el-tag v-else :key="dict.value" :index="index" :type="dict.colorType" :class="dict.cssClass">
9 9 {{ dict.label }}
10 10 </el-tag>
11 11 </template>
12   - </div>
  12 + </span>
13 13 </template>
14 14  
15 15 <script>
... ...
yudao-ui-admin/src/store/modules/dict.js
... ... @@ -33,7 +33,9 @@ const actions = {
33 33 // 处理 dictValue 层级
34 34 dictDataMap[dictData.dictType].push({
35 35 value: dictData.value,
36   - label: dictData.label
  36 + label: dictData.label,
  37 + colorType: dictData.colorType,
  38 + cssClass: dictData.cssClass,
37 39 })
38 40 })
39 41 // 存储到 Store 中
... ...
yudao-ui-admin/src/utils/dict.js
... ... @@ -95,6 +95,7 @@ export function getDictDatas2(dictType, values) {
95 95 results.push(dict);
96 96 }
97 97 }
  98 + // debugger
98 99 return results;
99 100 }
100 101  
... ... @@ -119,3 +120,5 @@ export function getDictDataLabel(dictType, value) {
119 120 return dict ? dict.label : '';
120 121 }
121 122  
  123 +export class getDictDataL {
  124 +}
... ...
yudao-ui-admin/src/views/bpm/form/index.vue
... ... @@ -27,7 +27,7 @@
27 27 <el-table-column label="表单名" align="center" prop="name" />
28 28 <el-table-column label="开启状态" align="center" prop="status">
29 29 <template slot-scope="scope">
30   - <span>{{ getDictDataLabel(DICT_TYPE.COMMON_STATUS, scope.row.status) }}</span>
  30 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
31 31 </template>
32 32 </el-table-column>
33 33 <el-table-column label="备注" align="center" prop="remark" />
... ...
yudao-ui-admin/src/views/bpm/oa/leave/detail.vue
... ... @@ -4,7 +4,9 @@
4 4 <el-form ref="form" :model="form" :rules="rules" label-width="100px">
5 5 <el-form-item label="开始时间:" prop="startTime"> {{parseTime(form.startTime, '{y}-{m}-{d}')}} </el-form-item>
6 6 <el-form-item label="结束时间:" prop="endTime"> {{parseTime(form.endTime, '{y}-{m}-{d}')}} </el-form-item>
7   - <el-form-item label="请假类型:" prop="type">{{ typeFormat(form) }}</el-form-item>
  7 + <el-form-item label="请假类型:" prop="type">
  8 + <dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="form.type"/>
  9 + </el-form-item>
8 10 <el-form-item label="原因:" prop="reason"> {{ form.reason }}</el-form-item>
9 11 </el-form>
10 12 </div>
... ... @@ -12,7 +14,7 @@
12 14  
13 15 <script>
14 16 import { getLeave} from "@/api/bpm/leave"
15   -import {getDictDatas, DICT_TYPE, getDictDataLabel} from '@/utils/dict'
  17 +import {getDictDatas, DICT_TYPE} from '@/utils/dict'
16 18 export default {
17 19 name: "LeaveDetail",
18 20 components: {
... ... @@ -46,9 +48,6 @@ export default {
46 48 this.form = response.data;
47 49 });
48 50 },
49   - typeFormat(row) {
50   - return getDictDataLabel(DICT_TYPE.BPM_OA_LEAVE_TYPE, row.type)
51   - }
52 51 }
53 52 };
54 53 </script>
... ...
yudao-ui-admin/src/views/bpm/oa/leave/index.vue
... ... @@ -39,7 +39,11 @@
39 39 <!-- 列表 -->
40 40 <el-table v-loading="loading" :data="list">
41 41 <el-table-column label="申请编号" align="center" prop="id" />
42   - <el-table-column label="状态" align="center" prop="result" :formatter="resultFormat" />
  42 + <el-table-column label="状态" align="center" prop="result">
  43 + <template slot-scope="scope">
  44 + <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="scope.row.result"/>
  45 + </template>
  46 + </el-table-column>
43 47 <el-table-column label="开始时间" align="center" prop="startTime" width="180">
44 48 <template slot-scope="scope">
45 49 <span>{{ parseTime(scope.row.startTime) }}</span>
... ... @@ -50,7 +54,11 @@
50 54 <span>{{ parseTime(scope.row.endTime) }}</span>
51 55 </template>
52 56 </el-table-column>
53   - <el-table-column label="请假类型" align="center" prop="type" :formatter="typeFormat" />
  57 + <el-table-column label="请假类型" align="center" prop="type">
  58 + <template slot-scope="scope">
  59 + <dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="scope.row.type"/>
  60 + </template>
  61 + </el-table-column>
54 62 <el-table-column label="原因" align="center" prop="reason" />
55 63 <el-table-column label="申请时间" align="center" prop="applyTime" width="180">
56 64 <template slot-scope="scope">
... ...
yudao-ui-admin/src/views/bpm/processInstance/index.vue
... ... @@ -76,20 +76,7 @@
76 76 </el-table-column>
77 77 <el-table-column label="结果" align="center" prop="result">
78 78 <template slot-scope="scope">
79   - <span>
80   - <el-tag type="primary" v-if="scope.row.result === 1"> <!-- 进行中 -->
81   - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, scope.row.result) }}
82   - </el-tag>
83   - <el-tag type="success" v-if="scope.row.result === 2"> <!-- 通过 -->
84   - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, scope.row.result) }}
85   - </el-tag>
86   - <el-tag type="danger" v-if="scope.row.result === 3"> <!-- 不通过 -->
87   - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, scope.row.result) }}
88   - </el-tag>
89   - <el-tag type="info" v-if="scope.row.result === 4"> <!-- 撤回 -->
90   - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, scope.row.result) }}
91   - </el-tag>
92   - </span>
  79 + <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="scope.row.result"/>
93 80 </template>
94 81 </el-table-column>
95 82 <el-table-column label="提交时间" align="center" prop="createTime" width="180">
... ...
yudao-ui-admin/src/views/bpm/task/done.vue
... ... @@ -24,20 +24,7 @@
24 24 <el-table-column label="流程发起人" align="center" prop="processInstance.startUserNickname" width="120" />
25 25 <el-table-column label="结果" align="center" prop="result">
26 26 <template slot-scope="scope">
27   - <span>
28   - <el-tag type="primary" v-if="scope.row.result === 1"> <!-- 进行中 -->
29   - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, scope.row.result) }}
30   - </el-tag>
31   - <el-tag type="success" v-if="scope.row.result === 2"> <!-- 通过 -->
32   - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, scope.row.result) }}
33   - </el-tag>
34   - <el-tag type="danger" v-if="scope.row.result === 3"> <!-- 不通过 -->
35   - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, scope.row.result) }}
36   - </el-tag>
37   - <el-tag type="info" v-if="scope.row.result === 4"> <!-- 撤回 -->
38   - {{ getDictDataLabel(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT, scope.row.result) }}
39   - </el-tag>
40   - </span>
  27 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.result"/>
41 28 </template>
42 29 </el-table-column>
43 30 <el-table-column label="审批意见" align="center" prop="comment" width="200" />
... ...
yudao-ui-admin/src/views/system/dept/index.vue
... ... @@ -25,9 +25,13 @@
25 25 <el-table v-loading="loading" :data="deptList" row-key="id" default-expand-all
26 26 :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
27 27 <el-table-column prop="name" label="部门名称" width="260"></el-table-column>
28   - <el-table-column prop="status" label="负责人" :formatter="userNicknameFormat" width="120"/>
  28 + <el-table-column prop="leader" label="负责人" :formatter="userNicknameFormat" width="120"/>
29 29 <el-table-column prop="sort" label="排序" width="200"></el-table-column>
30   - <el-table-column prop="status" label="状态" :formatter="statusFormat" width="100"/>
  30 + <el-table-column prop="status" label="状态" width="100">
  31 + <template slot-scope="scope">
  32 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
  33 + </template>
  34 + </el-table-column>
31 35 <el-table-column label="创建时间" align="center" prop="createTime" width="200">
32 36 <template slot-scope="scope">
33 37 <span>{{ parseTime(scope.row.createTime) }}</span>
... ... @@ -105,7 +109,7 @@ import Treeselect from &quot;@riophae/vue-treeselect&quot;;
105 109 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
106 110  
107 111 import {CommonStatusEnum} from '@/utils/constants'
108   -import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
  112 +import { getDictDatas, DICT_TYPE } from '@/utils/dict'
109 113 import {listSimpleUsers} from "@/api/system/user";
110 114  
111 115 export default {
... ... @@ -199,10 +203,6 @@ export default {
199 203 children: node.children
200 204 };
201 205 },
202   - // 字典状态字典翻译
203   - statusFormat(row, column) {
204   - return getDictDataLabel(DICT_TYPE.COMMON_STATUS, row.status)
205   - },
206 206 // 用户昵称展示
207 207 userNicknameFormat(row, column) {
208 208 if (!row.leaderUserId) {
... ...
yudao-ui-admin/src/views/system/dict/data.vue
... ... @@ -108,7 +108,7 @@ import { listData, getData, delData, addData, updateData, exportData } from &quot;@/a
108 108 import { listAllSimple, getType } from "@/api/system/dict/type";
109 109  
110 110 import { CommonStatusEnum } from '@/utils/constants'
111   -import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
  111 +import { getDictDatas, DICT_TYPE } from '@/utils/dict'
112 112  
113 113 export default {
114 114 name: "Data",
... ...
yudao-ui-admin/src/views/system/dict/index.vue
... ... @@ -44,7 +44,11 @@
44 44 </router-link>
45 45 </template>
46 46 </el-table-column>
47   - <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
  47 + <el-table-column label="状态" align="center" prop="status">
  48 + <template slot-scope="scope">
  49 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
  50 + </template>
  51 + </el-table-column>
48 52 <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
49 53 <el-table-column label="创建时间" align="center" prop="createTime" width="180">
50 54 <template slot-scope="scope">
... ... @@ -94,7 +98,7 @@
94 98 import { listType, getType, delType, addType, updateType, exportType } from "@/api/system/dict/type";
95 99  
96 100 import { CommonStatusEnum } from '@/utils/constants'
97   -import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
  101 +import { getDictDatas, DICT_TYPE } from '@/utils/dict'
98 102  
99 103 export default {
100 104 name: "Dict",
... ... @@ -161,10 +165,6 @@ export default {
161 165 this.loading = false;
162 166 });
163 167 },
164   - // 字典状态字典翻译
165   - statusFormat(row, column) {
166   - return getDictDataLabel(DICT_TYPE.COMMON_STATUS, row.status)
167   - },
168 168 // 取消按钮
169 169 cancel() {
170 170 this.open = false;
... ...
yudao-ui-admin/src/views/system/loginlog/index.vue
... ... @@ -37,7 +37,7 @@
37 37 <el-table-column label="访问编号" align="center" prop="id" />
38 38 <el-table-column label="日志类型" align="center" prop="logType">
39 39 <template slot-scope="scope">
40   - <span>{{ getDictDataLabel(DICT_TYPE.SYSTEM_LOGIN_TYPE, scope.row.logType) }}</span>
  40 + <dict-tag :type="DICT_TYPE.SYSTEM_LOGIN_TYPE" :value="scope.row.logType" />
41 41 </template>
42 42 </el-table-column>
43 43 <el-table-column label="用户名称" align="center" prop="username" />
... ... @@ -45,8 +45,7 @@
45 45 <el-table-column label="userAgent" align="center" prop="userAgent" width="400" :show-overflow-tooltip="true" />
46 46 <el-table-column label="结果" align="center" prop="status">
47 47 <template slot-scope="scope">
48   - <span v-if="scope.row.result === 0">成功</span>
49   - <span v-if="scope.row.result > 0">失败:{{ getDictDataLabel(DICT_TYPE.SYSTEM_LOGIN_RESULT, scope.row.result) }} </span>
  48 + <dict-tag :type="DICT_TYPE.SYSTEM_LOGIN_RESULT" :value="scope.row.result" />
50 49 </template>
51 50 </el-table-column>
52 51 <el-table-column label="登录日期" align="center" prop="loginTime" width="180">
... ... @@ -109,10 +108,6 @@ export default {
109 108 }
110 109 );
111 110 },
112   - // 登录状态字典翻译
113   - statusFormat(row, column) {
114   - return this.selectDictLabel(this.statusOptions, row.status);
115   - },
116 111 /** 搜索按钮操作 */
117 112 handleQuery() {
118 113 this.queryParams.pageNo = 1;
... ...
yudao-ui-admin/src/views/system/menu/index.vue
... ... @@ -34,7 +34,11 @@
34 34 <el-table-column prop="sort" label="排序" width="60"></el-table-column>
35 35 <el-table-column prop="permission" label="权限标识" :show-overflow-tooltip="true"></el-table-column>
36 36 <el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
37   - <el-table-column prop="status" label="状态" :formatter="statusFormat" width="80"></el-table-column>
  37 + <el-table-column prop="status" label="状态" width="80">
  38 + <template slot-scope="scope">
  39 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
  40 + </template>
  41 + </el-table-column>
38 42 <el-table-column label="创建时间" align="center" prop="createTime">
39 43 <template slot-scope="scope">
40 44 <span>{{ parseTime(scope.row.createTime) }}</span>
... ... @@ -132,7 +136,7 @@ import &quot;@riophae/vue-treeselect/dist/vue-treeselect.css&quot;;
132 136 import IconSelect from "@/components/IconSelect";
133 137  
134 138 import { SystemMenuTypeEnum, CommonStatusEnum } from '@/utils/constants'
135   -import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
  139 +import { getDictDatas, DICT_TYPE } from '@/utils/dict'
136 140  
137 141 export default {
138 142 name: "Menu",
... ... @@ -218,10 +222,6 @@ export default {
218 222 this.menuOptions.push(menu);
219 223 });
220 224 },
221   - // 菜单状态字典翻译
222   - statusFormat(row, column) {
223   - return getDictDataLabel(DICT_TYPE.COMMON_STATUS, row.status)
224   - },
225 225 // 取消按钮
226 226 cancel() {
227 227 this.open = false;
... ...
yudao-ui-admin/src/views/system/notice/index.vue
... ... @@ -29,8 +29,16 @@
29 29 <el-table v-loading="loading" :data="noticeList">
30 30 <el-table-column label="序号" align="center" prop="id" width="100" />
31 31 <el-table-column label="公告标题" align="center" prop="title" :show-overflow-tooltip="true"/>
32   - <el-table-column label="公告类型" align="center" prop="type" :formatter="typeFormat" width="100"/>
33   - <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" width="100"/>
  32 + <el-table-column label="公告类型" align="center" prop="type" width="100">
  33 + <template slot-scope="scope">
  34 + <dict-tag :type="DICT_TYPE.SYSTEM_NOTICE_TYPE" :value="scope.row.type"/>
  35 + </template>
  36 + </el-table-column>
  37 + <el-table-column label="状态" align="center" prop="status" width="100">
  38 + <template slot-scope="scope">
  39 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
  40 + </template>
  41 + </el-table-column>
34 42 <el-table-column label="创建者" align="center" prop="createBy" width="100" />
35 43 <el-table-column label="创建时间" align="center" prop="createTime" width="100">
36 44 <template slot-scope="scope">
... ... @@ -102,7 +110,7 @@ import { listNotice, getNotice, delNotice, addNotice, updateNotice } from &quot;@/api
102 110 import Editor from '@/components/Editor';
103 111  
104 112 import {CommonStatusEnum} from '@/utils/constants'
105   -import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
  113 +import { getDictDatas, DICT_TYPE } from '@/utils/dict'
106 114  
107 115 export default {
108 116 name: "Notice",
... ... @@ -163,14 +171,6 @@ export default {
163 171 this.loading = false;
164 172 });
165 173 },
166   - // 公告状态字典翻译
167   - statusFormat(row, column) {
168   - return getDictDataLabel(DICT_TYPE.COMMON_STATUS, row.status)
169   - },
170   - // 公告状态字典翻译
171   - typeFormat(row, column) {
172   - return getDictDataLabel(DICT_TYPE.SYSTEM_NOTICE_TYPE, row.type)
173   - },
174 174 // 取消按钮
175 175 cancel() {
176 176 this.open = false;
... ...
yudao-ui-admin/src/views/system/operatelog/index.vue
... ... @@ -45,7 +45,7 @@
45 45 <el-table-column label="操作名" align="center" prop="name" width="180" />
46 46 <el-table-column label="操作类型" align="center" prop="type">
47 47 <template slot-scope="scope">
48   - <span>{{ getDictDataLabel(DICT_TYPE.SYSTEM_OPERATE_TYPE, scope.row.type) }}</span>
  48 + <dict-tag :type="DICT_TYPE.SYSTEM_OPERATE_TYPE" :value="scope.row.type"/>
49 49 </template>
50 50 </el-table-column>
51 51 <el-table-column label="操作人" align="center" prop="userNickname" />
... ... @@ -72,13 +72,8 @@
72 72 </el-table-column>
73 73 </el-table>
74 74  
75   - <pagination
76   - v-show="total>0"
77   - :total="total"
78   - :page.sync="queryParams.pageNo"
79   - :limit.sync="queryParams.pageSize"
80   - @pagination="getList"
81   - />
  75 + <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
  76 + @pagination="getList" />
82 77  
83 78 <!-- 操作日志详细 -->
84 79 <el-dialog title="访问日志详细" :visible.sync="open" width="700px" append-to-body>
... ... @@ -95,7 +90,8 @@
95 90 </el-col>
96 91 <el-col :span="24">
97 92 <el-form-item label="操作信息:">
98   - {{ form.module }} | {{ form.name }} | {{ getDictDataLabel(DICT_TYPE.SYSTEM_OPERATE_TYPE, form.type) }}
  93 + {{ form.module }} | {{ form.name }}
  94 + <dict-tag :type="DICT_TYPE.SYSTEM_OPERATE_TYPE" :value="form.type"/>
99 95 <br /> {{ form.content }}
100 96 <br /> {{ form.exts }}
101 97 </el-form-item>
... ... @@ -184,14 +180,6 @@ export default {
184 180 }
185 181 );
186 182 },
187   - // 操作日志状态字典翻译
188   - statusFormat(row, column) {
189   - return this.selectDictLabel(this.statusOptions, row.status);
190   - },
191   - // 操作日志类型字典翻译
192   - typeFormat(row, column) {
193   - return this.selectDictLabel(this.typeOptions, row.businessType);
194   - },
195 183 /** 搜索按钮操作 */
196 184 handleQuery() {
197 185 this.queryParams.pageNo = 1;
... ...
yudao-ui-admin/src/views/system/post/index.vue
... ... @@ -35,7 +35,11 @@
35 35 <el-table-column label="岗位编码" align="center" prop="code" />
36 36 <el-table-column label="岗位名称" align="center" prop="name" />
37 37 <el-table-column label="岗位排序" align="center" prop="sort" />
38   - <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
  38 + <el-table-column label="状态" align="center" prop="status">
  39 + <template slot-scope="scope">
  40 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
  41 + </template>
  42 + </el-table-column>
39 43 <el-table-column label="创建时间" align="center" prop="createTime" width="180">
40 44 <template slot-scope="scope">
41 45 <span>{{ parseTime(scope.row.createTime) }}</span>
... ... @@ -88,7 +92,7 @@
88 92 import { listPost, getPost, delPost, addPost, updatePost, exportPost } from "@/api/system/post";
89 93  
90 94 import {CommonStatusEnum} from '@/utils/constants'
91   -import { getDictDataLabel, getDictDatas, DICT_TYPE } from '@/utils/dict'
  95 +import { getDictDatas, DICT_TYPE } from '@/utils/dict'
92 96  
93 97 export default {
94 98 name: "Post",
... ... @@ -152,10 +156,6 @@ export default {
152 156 this.loading = false;
153 157 });
154 158 },
155   - // 岗位状态字典翻译
156   - statusFormat(row, column) {
157   - return getDictDataLabel(DICT_TYPE.COMMON_STATUS, row.status)
158   - },
159 159 // 取消按钮
160 160 cancel() {
161 161 this.open = false;
... ...
yudao-ui-admin/src/views/system/role/index.vue
... ... @@ -40,7 +40,11 @@
40 40 <el-table-column label="角色编号" prop="id" width="120" />
41 41 <el-table-column label="角色名称" prop="name" :show-overflow-tooltip="true" width="150" />
42 42 <el-table-column label="角色标识" prop="code" :show-overflow-tooltip="true" width="150" />
43   - <el-table-column label="角色类型" prop="type" :formatter="typeFormat" width="80"></el-table-column>
  43 + <el-table-column label="角色类型" prop="type" width="80">
  44 + <template slot-scope="scope">
  45 + <dict-tag :type="DICT_TYPE.SYSTEM_ROLE_TYPE" :value="scope.row.type"/>
  46 + </template>
  47 + </el-table-column>
44 48 <el-table-column label="显示顺序" prop="sort" width="100" />
45 49 <el-table-column label="状态" align="center" width="100">
46 50 <template slot-scope="scope">
... ... @@ -180,7 +184,7 @@ import {listSimpleMenus} from &quot;@/api/system/menu&quot;;
180 184 import {assignRoleMenu, listRoleMenus, assignRoleDataScope} from "@/api/system/permission";
181 185 import {listSimpleDepts} from "@/api/system/dept";
182 186 import {CommonStatusEnum, SystemDataScopeEnum} from "@/utils/constants";
183   -import {DICT_TYPE, getDictDataLabel, getDictDatas} from "@/utils/dict";
  187 +import {DICT_TYPE, getDictDatas} from "@/utils/dict";
184 188  
185 189 export default {
186 190 name: "Role",
... ... @@ -287,10 +291,6 @@ export default {
287 291 : CommonStatusEnum.ENABLE;
288 292 });
289 293 },
290   - // 角色类型字典翻译
291   - typeFormat(row, column) {
292   - return getDictDataLabel(DICT_TYPE.SYSTEM_ROLE_TYPE, row.type)
293   - },
294 294 // 取消按钮
295 295 cancel() {
296 296 this.open = false;
... ...
yudao-ui-admin/src/views/system/sms/smsChannel.vue
... ... @@ -37,12 +37,12 @@
37 37 <el-table-column label="短信签名" align="center" prop="signature" />
38 38 <el-table-column label="渠道编码" align="center" prop="code">
39 39 <template slot-scope="scope">
40   - <span>{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, scope.row.code) }}</span>
  40 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="scope.row.code"/>
41 41 </template>
42 42 </el-table-column>>
43 43 <el-table-column label="启用状态" align="center" prop="status">
44 44 <template slot-scope="scope">
45   - <span>{{ getDictDataLabel(DICT_TYPE.COMMON_STATUS, scope.row.status) }}</span>
  45 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
46 46 </template>
47 47 </el-table-column>>
48 48 <el-table-column label="备注" align="center" prop="remark" />
... ...
yudao-ui-admin/src/views/system/sms/smsLog.vue
... ... @@ -67,33 +67,33 @@
67 67 <template slot-scope="scope">
68 68 <div>{{ scope.row.mobile }}</div>
69 69 <div v-if="scope.row.userType && scope.row.userId">
70   - {{ getDictDataLabel(DICT_TYPE.USER_TYPE, scope.row.userType) + '(' + scope.row.userId + ')' }}
  70 + <dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType"/>{{ '(' + scope.row.userId + ')' }}
71 71 </div>
72 72 </template>
73 73 </el-table-column>
74 74 <el-table-column label="短信内容" align="center" prop="templateContent" width="300" />
75 75 <el-table-column label="发送状态" align="center" width="180">
76 76 <template slot-scope="scope">
77   - <div>{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_SEND_STATUS, scope.row.sendStatus) }}</div>
  77 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_SEND_STATUS" :value="scope.row.sendStatus"/>
78 78 <div>{{ parseTime(scope.row.sendTime) }}</div>
79 79 </template>
80 80 </el-table-column>
81 81 <el-table-column label="接收状态" align="center" width="180">
82 82 <template slot-scope="scope">
83   - <div>{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS, scope.row.receiveStatus) }}</div>
  83 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS" :value="scope.row.receiveStatus"/>
84 84 <div>{{ parseTime(scope.row.receiveTime) }}</div>
85 85 </template>
86 86 </el-table-column>
87 87 <el-table-column label="短信渠道" align="center" width="120">
88 88 <template slot-scope="scope">
89 89 <div>{{ formatChannelSignature(scope.row.channelId) }}</div>
90   - <div>【{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, scope.row.channelCode) }}】</div>
  90 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="scope.row.channelCode"/>
91 91 </template>
92 92 </el-table-column>
93 93 <el-table-column label="模板编号" align="center" prop="templateId" />
94 94 <el-table-column label="短信类型" align="center" prop="templateType">
95 95 <template slot-scope="scope">
96   - <span>{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE, scope.row.templateType) }}</span>
  96 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE" :value="scope.row.templateType"/>
97 97 </template>
98 98 </el-table-column>
99 99 <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
... ... @@ -116,15 +116,14 @@
116 116 </el-col>
117 117 <el-col :span="24">
118 118 <el-form-item label="短信渠道:">
119   - {{
120   - formatChannelSignature(form.channelId)
121   - }}【{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, form.channelCode) }}】
  119 + {{formatChannelSignature(form.channelId) }}
  120 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="form.channelCode"/>
122 121 </el-form-item>
123 122 </el-col>
124 123 <el-col :span="24">
125 124 <el-form-item label="短信模板:">
126   - {{ form.templateId }} | {{ form.templateCode }} |
127   - {{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE, form.templateType) }}
  125 + {{ form.templateId }} | {{ form.templateCode }}
  126 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE" :value="form.templateType"/>
128 127 </el-form-item>
129 128 </el-col>
130 129 <el-col :span="24">
... ... @@ -132,7 +131,9 @@
132 131 </el-col>
133 132 <el-col :span="24">
134 133 <el-form-item label="用户信息:">{{ form.mobile }}
135   - <span v-if="form.userType && form.userId"> | {{ getDictDataLabel(DICT_TYPE.USER_TYPE, form.userType) }} | {{ form.userId }}</span>
  134 + <span v-if="form.userType && form.userId">
  135 + <dict-tag :type="DICT_TYPE.USER_TYPE" :value="form.userType"/>({{ form.userId }})
  136 + </span>
136 137 </el-form-item>
137 138 </el-col>
138 139 <el-col :span="24">
... ... @@ -145,7 +146,9 @@
145 146 <el-form-item label="创建时间:">{{ parseTime(form.createTime) }}</el-form-item>
146 147 </el-col>
147 148 <el-col :span="24">
148   - <el-form-item label="发送状态:">{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_SEND_STATUS, form.sendStatus) }}</el-form-item>
  149 + <el-form-item label="发送状态:">
  150 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_SEND_STATUS" :value="form.sendStatus"/>
  151 + </el-form-item>
149 152 </el-col>
150 153 <el-col :span="24">
151 154 <el-form-item label="发送时间:">{{ parseTime(form.sendTime) }}</el-form-item>
... ... @@ -164,7 +167,9 @@
164 167 <el-form-item label="API 请求编号:">{{ form.apiRequestId }}</el-form-item>
165 168 </el-col>
166 169 <el-col :span="24">
167   - <el-form-item label="接收状态:">{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS, form.receiveStatus) }}</el-form-item>
  170 + <el-form-item label="接收状态:">
  171 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_RECEIVE_STATUS" :value="form.receiveStatus"/>
  172 + </el-form-item>
168 173 </el-col>
169 174 <el-col :span="24">
170 175 <el-form-item label="接收时间:">{{ parseTime(form.receiveTime) }}</el-form-item>
... ...
yudao-ui-admin/src/views/system/sms/smsTemplate.vue
... ... @@ -58,12 +58,12 @@
58 58 <el-table-column label="模板内容" align="center" prop="content" width="300" />
59 59 <el-table-column label="短信类型" align="center" prop="type">
60 60 <template slot-scope="scope">
61   - <span>{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE, scope.row.type) }}</span>
  61 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_TEMPLATE_TYPE" :value="scope.row.type"/>
62 62 </template>
63 63 </el-table-column>
64 64 <el-table-column label="开启状态" align="center" prop="status">
65 65 <template slot-scope="scope">
66   - <span>{{ getDictDataLabel(DICT_TYPE.COMMON_STATUS, scope.row.status) }}</span>
  66 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
67 67 </template>
68 68 </el-table-column>
69 69 <el-table-column label="备注" align="center" prop="remark" />
... ... @@ -71,7 +71,7 @@
71 71 <el-table-column label="短信渠道" align="center" width="120">
72 72 <template slot-scope="scope">
73 73 <div>{{ formatChannelSignature(scope.row.channelId) }}</div>
74   - <div>【{{ getDictDataLabel(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE, scope.row.channelCode) }}】</div>
  74 + <dict-tag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="scope.row.channelCode"/>
75 75 </template>
76 76 </el-table-column>
77 77 <el-table-column label="创建时间" align="center" prop="createTime" width="180">
... ...
yudao-ui-admin/src/views/system/tenant/index.vue
... ... @@ -49,7 +49,7 @@
49 49 <el-table-column label="联系手机" align="center" prop="contactMobile" />
50 50 <el-table-column label="租户状态" align="center" prop="status">
51 51 <template slot-scope="scope">
52   - <span>{{ getDictDataLabel(DICT_TYPE.COMMON_STATUS, scope.row.status) }}</span>
  52 + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
53 53 </template>
54 54 </el-table-column>
55 55 <el-table-column label="创建时间" align="center" prop="createTime" width="180">
... ...
更新日志.md
... ... @@ -35,6 +35,7 @@
35 35 * 【新增】前端的表格右侧工具栏组件支持显隐列,具体可见【用户管理】功能 [commit](https://gitee.com/zhijiantianya/ruoyi-vue-pro/commit/20e34e35a3bdc48e6a4c58e3849aa729bd18efe5)
36 36 * 【新增】前端的菜单导航显示风格 TopNav(false 为 左侧导航菜单,true 为顶部导航菜单),支持布局的保存与重置 [commit1](https://gitee.com/zhijiantianya/ruoyi-vue-pro/commit/4bf5b04d542014a49c5a41b20935cef35033a518) [commit2](https://gitee.com/zhijiantianya/ruoyi-vue-pro/commit/cff4391f2d7830770731c0034085c0f77ea8c68e)
37 37 * 【新增】前端的网页标题支持根据选择的菜单,动态展示标题 [commit](https://gitee.com/zhijiantianya/ruoyi-vue-pro/commit/7bf9a85263e0c44b2bc88485b83557c129583f5c)
  38 +* 【新增】字典标签样式回显,例如说开启的状态展示为 primary 蓝色,禁用的状态为 info 灰色 [commit](https://gitee.com/zhijiantianya/ruoyi-vue-pro/commit/986d1328e0a0d37e2de2fb9d937faeed9d9bee7b)
38 39 * 【新增】前端的 iframe 组件,方便内嵌网页 [commit](https://gitee.com/zhijiantianya/ruoyi-vue-pro/commit/4a8129bffa9e3928c56333e29f5874f55a079764)
39 40  
40 41 ### 🐞 Bug Fixes
... ...