部门字典管理完成
This commit is contained in:
@@ -20,6 +20,16 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网站类型" prop="status">
|
||||
<el-select v-model="queryParams.attribute2" placeholder="数据状态" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in attribute2Options"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
|
||||
<el-option
|
||||
@@ -85,10 +95,12 @@
|
||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="类型编码" align="center" prop="dictCode" />
|
||||
<el-table-column label="网站类型" align="center" prop="attribute2" :formatter="attribute2Format" />
|
||||
<el-table-column label="类型名" align="center" prop="dictLabel" />
|
||||
<el-table-column label="类型键值" align="center" prop="dictValue" />
|
||||
<el-table-column label="类型排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
|
||||
<el-table-column label="缩略图" align="center" prop="attribute1" :formatter="attribute1Format" />
|
||||
<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">
|
||||
@@ -146,6 +158,15 @@
|
||||
>{{dict.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="网站类型" prop="attribute2">
|
||||
<el-radio-group v-model="form.attribute2">
|
||||
<el-radio
|
||||
v-for="dict in attribute2Options"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictValue"
|
||||
>{{dict.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
@@ -197,6 +218,7 @@ export default {
|
||||
// 状态数据字典
|
||||
statusOptions: [],
|
||||
attribute1Options: [],
|
||||
attribute2Options: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -217,6 +239,9 @@ export default {
|
||||
attribute1: [
|
||||
{ required: true, message: "有无缩略图不能为空", trigger: "blur" }
|
||||
],
|
||||
attribute2: [
|
||||
{ required: true, message: "网站类型不能为空", trigger: "blur" }
|
||||
],
|
||||
dictSort: [
|
||||
{ required: true, message: "数据顺序不能为空", trigger: "blur" }
|
||||
]
|
||||
@@ -231,6 +256,9 @@ export default {
|
||||
this.getDicts("thumbnail").then(response => {
|
||||
this.attribute1Options = response.data;
|
||||
});
|
||||
this.getDicts("unencrypted_site_type").then(response => {
|
||||
this.attribute2Options = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询字典数据列表 */
|
||||
@@ -246,6 +274,14 @@ export default {
|
||||
statusFormat(row, column) {
|
||||
return this.selectDictLabel(this.statusOptions, row.status);
|
||||
},
|
||||
// 数据状态字典翻译
|
||||
attribute1Format(row, column) {
|
||||
return this.selectDictLabel(this.attribute1Options, row.attribute1);
|
||||
},
|
||||
// 数据状态字典翻译
|
||||
attribute2Format(row, column) {
|
||||
return this.selectDictLabel(this.attribute2Options, row.attribute2);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@@ -260,6 +296,7 @@ export default {
|
||||
dictSort: 0,
|
||||
status: "0",
|
||||
attribute1: "1",
|
||||
attribute2: "1",
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
|
||||
@@ -10,6 +10,16 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="网站类型" prop="status">
|
||||
<el-select v-model="queryParams.attribute2" placeholder="数据状态" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in attribute2Options"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
|
||||
<el-option
|
||||
@@ -75,6 +85,7 @@
|
||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="名录类型编码" align="center" prop="dictCode" />
|
||||
<el-table-column label="网站类型" align="center" prop="attribute2" :formatter="attribute2Format" />
|
||||
<el-table-column label="名录类型" align="center" prop="dictLabel" />
|
||||
<el-table-column label="名录类型键值" align="center" prop="dictValue" />
|
||||
<el-table-column label="名录类型排序" align="center" prop="dictSort" />
|
||||
@@ -127,6 +138,15 @@
|
||||
<el-form-item label="显示排序" prop="dictSort">
|
||||
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="网站类型" prop="attribute2">
|
||||
<el-radio-group v-model="form.attribute2">
|
||||
<el-radio
|
||||
v-for="dict in attribute2Options"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictValue"
|
||||
>{{dict.dictLabel}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
@@ -177,6 +197,7 @@ export default {
|
||||
open: false,
|
||||
// 状态数据字典
|
||||
statusOptions: [],
|
||||
attribute2Options: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -194,6 +215,9 @@ export default {
|
||||
dictValue: [
|
||||
{ required: true, message: "名录类型键值不能为空", trigger: "blur" }
|
||||
],
|
||||
attribute2: [
|
||||
{ required: true, message: "网站类型不能为空", trigger: "blur" }
|
||||
],
|
||||
dictSort: [
|
||||
{ required: true, message: "数据顺序不能为空", trigger: "blur" }
|
||||
]
|
||||
@@ -205,6 +229,9 @@ export default {
|
||||
this.getDicts("sys_normal_disable").then(response => {
|
||||
this.statusOptions = response.data;
|
||||
});
|
||||
this.getDicts("unencrypted_site_type").then(response => {
|
||||
this.attribute2Options = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询字典数据列表 */
|
||||
@@ -220,6 +247,10 @@ export default {
|
||||
statusFormat(row, column) {
|
||||
return this.selectDictLabel(this.statusOptions, row.status);
|
||||
},
|
||||
// 数据状态字典翻译
|
||||
attribute2Format(row, column) {
|
||||
return this.selectDictLabel(this.attribute2Options, row.attribute2);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@@ -233,6 +264,7 @@ export default {
|
||||
dictValue: undefined,
|
||||
dictSort: 0,
|
||||
status: "0",
|
||||
attribute2: "1",
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
|
||||
Reference in New Issue
Block a user