使用vue-data-dict,简化数据字典使用

This commit is contained in:
RuoYi
2021-09-17 15:36:54 +08:00
parent 23270c60bc
commit 12ab8b03d9
28 changed files with 503 additions and 325 deletions

View File

@ -13,20 +13,20 @@
<el-form-item label="任务组名" prop="jobGroup">
<el-select v-model="queryParams.jobGroup" placeholder="请选择任务组名" clearable size="small">
<el-option
v-for="dict in jobGroupOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_job_group"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="任务状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择任务状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_job_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -99,7 +99,7 @@
<el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
<el-table-column label="任务组名" align="center" prop="jobGroup">
<template slot-scope="scope">
<dict-tag :options="jobGroupOptions" :value="scope.row.jobGroup"/>
<dict-tag :options="dict.type.sys_job_group" :value="scope.row.jobGroup"/>
</template>
</el-table-column>
<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
@ -168,10 +168,10 @@
<el-form-item label="任务分组" prop="jobGroup">
<el-select v-model="form.jobGroup" placeholder="请选择">
<el-option
v-for="dict in jobGroupOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_job_group"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
@ -225,10 +225,10 @@
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_job_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -301,6 +301,7 @@ import Crontab from '@/components/Crontab'
export default {
components: { Crontab },
name: "Job",
dicts: ['sys_job_group', 'sys_job_status'],
data() {
return {
// 遮罩层
@ -329,10 +330,6 @@ export default {
openCron: false,
// 传入的表达式
expression: "",
// 任务组名字典
jobGroupOptions: [],
// 状态字典
statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
@ -359,12 +356,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_job_group").then(response => {
this.jobGroupOptions = response.data;
});
this.getDicts("sys_job_status").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询定时任务列表 */
@ -378,7 +369,7 @@ export default {
},
// 任务组名字典翻译
jobGroupFormat(row, column) {
return this.selectDictLabel(this.jobGroupOptions, row.jobGroup);
return this.selectDictLabel(this.dict.type.sys_job_group, row.jobGroup);
},
// 取消按钮
cancel() {

View File

@ -20,10 +20,10 @@
style="width: 240px"
>
<el-option
v-for="dict in jobGroupOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_job_group"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -36,10 +36,10 @@
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_common_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -112,14 +112,14 @@
<el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
<el-table-column label="任务组名" align="center" prop="jobGroup" :show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="jobGroupOptions" :value="scope.row.jobGroup"/>
<dict-tag :options="dict.type.sys_job_group" :value="scope.row.jobGroup"/>
</template>
</el-table-column>
<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
<el-table-column label="日志信息" align="center" prop="jobMessage" :show-overflow-tooltip="true" />
<el-table-column label="执行状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="执行时间" align="center" prop="createTime" width="180">
@ -190,6 +190,7 @@ import { listJobLog, delJobLog, exportJobLog, cleanJobLog } from "@/api/monitor/
export default {
name: "JobLog",
dicts: ['sys_common_status', 'sys_job_group'],
data() {
return {
// 遮罩层
@ -212,10 +213,6 @@ export default {
dateRange: [],
// 表单参数
form: {},
// 执行状态字典
statusOptions: [],
// 任务组名字典
jobGroupOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
@ -237,12 +234,6 @@ export default {
} else {
this.getList();
}
this.getDicts("sys_common_status").then(response => {
this.statusOptions = response.data;
});
this.getDicts("sys_job_group").then(response => {
this.jobGroupOptions = response.data;
});
},
methods: {
/** 查询调度日志列表 */

View File

@ -30,10 +30,10 @@
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_common_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -101,7 +101,7 @@
<el-table-column label="操作系统" align="center" prop="os" />
<el-table-column label="登录状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="操作信息" align="center" prop="msg" />
@ -127,6 +127,7 @@ import { list, delLogininfor, cleanLogininfor, exportLogininfor } from "@/api/mo
export default {
name: "Logininfor",
dicts: ['sys_common_status'],
data() {
return {
// 遮罩层
@ -143,8 +144,6 @@ export default {
total: 0,
// 表格数据
list: [],
// 状态数据字典
statusOptions: [],
// 日期范围
dateRange: [],
// 默认排序
@ -161,9 +160,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_common_status").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询登录日志列表 */

View File

@ -30,10 +30,10 @@
style="width: 240px"
>
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_oper_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -46,10 +46,10 @@
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_common_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -113,7 +113,7 @@
<el-table-column label="系统模块" align="center" prop="title" />
<el-table-column label="操作类型" align="center" prop="businessType">
<template slot-scope="scope">
<dict-tag :options="typeOptions" :value="scope.row.businessType"/>
<dict-tag :options="dict.type.sys_oper_type" :value="scope.row.businessType"/>
</template>
</el-table-column>
<el-table-column label="请求方式" align="center" prop="requestMethod" />
@ -122,7 +122,7 @@
<el-table-column label="操作地点" align="center" prop="operLocation" :show-overflow-tooltip="true" />
<el-table-column label="操作状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="操作日期" align="center" prop="operTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
@ -200,6 +200,7 @@ import { list, delOperlog, cleanOperlog, exportOperlog } from "@/api/monitor/ope
export default {
name: "Operlog",
dicts: ['sys_oper_type', 'sys_common_status'],
data() {
return {
// 遮罩层
@ -218,10 +219,6 @@ export default {
list: [],
// 是否显示弹出层
open: false,
// 类型数据字典
typeOptions: [],
// 类型数据字典
statusOptions: [],
// 日期范围
dateRange: [],
// 默认排序
@ -241,12 +238,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_oper_type").then(response => {
this.typeOptions = response.data;
});
this.getDicts("sys_common_status").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询登录日志 */
@ -261,7 +252,7 @@ export default {
},
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.typeOptions, row.businessType);
return this.selectDictLabel(this.dict.type.sys_oper_type, row.businessType);
},
/** 搜索按钮操作 */
handleQuery() {

View File

@ -24,10 +24,10 @@
<el-form-item label="系统内置" prop="configType">
<el-select v-model="queryParams.configType" placeholder="系统内置" clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -114,7 +114,7 @@
<el-table-column label="参数键值" align="center" prop="configValue" />
<el-table-column label="系统内置" align="center" prop="configType">
<template slot-scope="scope">
<dict-tag :options="typeOptions" :value="scope.row.configType"/>
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
@ -166,10 +166,10 @@
<el-form-item label="系统内置" prop="configType">
<el-radio-group v-model="form.configType">
<el-radio
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
@ -189,6 +189,7 @@ import { listConfig, getConfig, delConfig, addConfig, updateConfig, exportConfig
export default {
name: "Config",
dicts: ['sys_yes_no'],
data() {
return {
// 遮罩层
@ -211,8 +212,6 @@ export default {
title: "",
// 是否显示弹出层
open: false,
// 类型数据字典
typeOptions: [],
// 日期范围
dateRange: [],
// 查询参数
@ -241,9 +240,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_yes_no").then(response => {
this.typeOptions = response.data;
});
},
methods: {
/** 查询参数列表 */

View File

@ -13,10 +13,10 @@
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="部门状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -61,7 +61,7 @@
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
@ -135,10 +135,10 @@
<el-form-item label="部门状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -159,6 +159,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Dept",
dicts: ['sys_normal_disable'],
components: { Treeselect },
data() {
return {
@ -180,8 +181,6 @@ export default {
refreshTable: true,
// 是否展开
expand: false,
// 状态数据字典
statusOptions: [],
// 查询参数
queryParams: {
deptName: undefined,
@ -219,9 +218,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询部门列表 */

View File

@ -23,10 +23,10 @@
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -96,7 +96,7 @@
<el-table-column label="字典排序" align="center" prop="dictSort" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
@ -164,10 +164,10 @@
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
@ -188,6 +188,7 @@ import { listType, getType } from "@/api/system/dict/type";
export default {
name: "Data",
dicts: ['sys_normal_disable'],
data() {
return {
// 遮罩层
@ -239,8 +240,6 @@ export default {
label: "危险"
}
],
// 状态数据字典
statusOptions: [],
// 类型数据字典
typeOptions: [],
// 查询参数
@ -271,9 +270,6 @@ export default {
const dictId = this.$route.params && this.$route.params.dictId;
this.getType(dictId);
this.getTypeList();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询字典类型详细 */

View File

@ -30,10 +30,10 @@
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -125,7 +125,7 @@
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
@ -174,10 +174,10 @@
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
@ -197,6 +197,7 @@ import { listType, getType, delType, addType, updateType, exportType, refreshCac
export default {
name: "Dict",
dicts: ['sys_normal_disable'],
data() {
return {
// 遮罩层
@ -219,8 +220,6 @@ export default {
title: "",
// 是否显示弹出层
open: false,
// 状态数据字典
statusOptions: [],
// 日期范围
dateRange: [],
// 查询参数
@ -246,9 +245,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询字典类型列表 */

View File

@ -13,10 +13,10 @@
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="菜单状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -68,7 +68,7 @@
<el-table-column prop="component" label="组件路径" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="status" label="状态" width="80">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime">
@ -240,10 +240,10 @@
</span>
<el-radio-group v-model="form.visible">
<el-radio
v-for="dict in visibleOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_show_hide"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -257,10 +257,10 @@
</span>
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -282,6 +282,7 @@ import IconSelect from "@/components/IconSelect";
export default {
name: "Menu",
dicts: ['sys_show_hide', 'sys_normal_disable'],
components: { Treeselect, IconSelect },
data() {
return {
@ -301,10 +302,6 @@ export default {
isExpandAll: false,
// 重新渲染表格状态
refreshTable: true,
// 显示状态数据字典
visibleOptions: [],
// 菜单状态数据字典
statusOptions: [],
// 查询参数
queryParams: {
menuName: undefined,
@ -328,12 +325,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_show_hide").then(response => {
this.visibleOptions = response.data;
});
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
},
methods: {
// 选择图标

View File

@ -22,10 +22,10 @@
<el-form-item label="类型" prop="noticeType">
<el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable size="small">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -82,12 +82,12 @@
/>
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
<template slot-scope="scope">
<dict-tag :options="typeOptions" :value="scope.row.noticeType"/>
<dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status" width="100">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
@ -137,10 +137,10 @@
<el-form-item label="公告类型" prop="noticeType">
<el-select v-model="form.noticeType" placeholder="请选择">
<el-option
v-for="dict in typeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_notice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
@ -149,10 +149,10 @@
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_notice_status"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -176,6 +176,7 @@ import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api
export default {
name: "Notice",
dicts: ['sys_notice_status', 'sys_notice_type'],
data() {
return {
// 遮罩层
@ -196,10 +197,6 @@ export default {
title: "",
// 是否显示弹出层
open: false,
// 类型数据字典
statusOptions: [],
// 状态数据字典
typeOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
@ -223,12 +220,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_notice_status").then(response => {
this.statusOptions = response.data;
});
this.getDicts("sys_notice_type").then(response => {
this.typeOptions = response.data;
});
},
methods: {
/** 查询公告列表 */

View File

@ -22,10 +22,10 @@
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="岗位状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -90,7 +90,7 @@
<el-table-column label="岗位排序" align="center" prop="postSort" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
@ -141,10 +141,10 @@
<el-form-item label="岗位状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
@ -164,6 +164,7 @@ import { listPost, getPost, delPost, addPost, updatePost, exportPost } from "@/a
export default {
name: "Post",
dicts: ['sys_normal_disable'],
data() {
return {
// 遮罩层
@ -186,8 +187,6 @@ export default {
title: "",
// 是否显示弹出层
open: false,
// 状态数据字典
statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
@ -214,9 +213,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询岗位列表 */

View File

@ -69,7 +69,7 @@
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
@ -107,6 +107,7 @@ import selectUser from "./selectUser";
export default {
name: "AuthUser",
dicts: ['sys_normal_disable'],
components: { selectUser },
data() {
return {
@ -122,8 +123,6 @@ export default {
total: 0,
// 用户表格数据
userList: [],
// 状态数据字典
statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
@ -139,9 +138,6 @@ export default {
if (roleId) {
this.queryParams.roleId = roleId;
this.getList();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
}
},
methods: {

View File

@ -30,10 +30,10 @@
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -183,10 +183,10 @@
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="菜单权限">
@ -265,6 +265,7 @@ import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/d
export default {
name: "Role",
dicts: ['sys_normal_disable'],
data() {
return {
// 遮罩层
@ -295,8 +296,6 @@ export default {
deptNodeAll: false,
// 日期范围
dateRange: [],
// 状态数据字典
statusOptions: [],
// 数据范围选项
dataScopeOptions: [
{
@ -354,9 +353,6 @@ export default {
},
created() {
this.getList();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
},
methods: {
/** 查询角色列表 */

View File

@ -34,7 +34,7 @@
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
@ -61,6 +61,7 @@
<script>
import { unallocatedUserList, authUserSelectAll } from "@/api/system/role";
export default {
dicts: ['sys_normal_disable'],
props: {
// 角色编号
roleId: {
@ -77,8 +78,6 @@ export default {
total: 0,
// 未授权用户数据
userList: [],
// 状态数据字典
statusOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
@ -89,11 +88,6 @@ export default {
}
};
},
created() {
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
},
methods: {
// 显示弹框
show() {

View File

@ -57,10 +57,10 @@
style="width: 240px"
>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
@ -251,10 +251,10 @@
<el-form-item label="用户性别">
<el-select v-model="form.sex" placeholder="请选择">
<el-option
v-for="dict in sexOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
@ -263,10 +263,10 @@
<el-form-item label="状态">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictValue"
>{{dict.dictLabel}}</el-radio>
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
@ -354,6 +354,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "User",
dicts: ['sys_normal_disable', 'sys_user_sex'],
components: { Treeselect },
data() {
return {
@ -385,10 +386,6 @@ export default {
initPassword: undefined,
// 日期范围
dateRange: [],
// 状态数据字典
statusOptions: [],
// 性别状态字典
sexOptions: [],
// 岗位选项
postOptions: [],
// 角色选项
@ -472,12 +469,6 @@ export default {
created() {
this.getList();
this.getTreeselect();
this.getDicts("sys_normal_disable").then(response => {
this.statusOptions = response.data;
});
this.getDicts("sys_user_sex").then(response => {
this.sexOptions = response.data;
});
this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg;
});