使用vue-data-dict,简化数据字典使用
This commit is contained in:
@ -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: {
|
||||
/** 查询登录日志列表 */
|
||||
|
Reference in New Issue
Block a user