|
@@ -2,15 +2,7 @@
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
<el-form-item label="字典名称" prop="dictType">
|
|
|
- <el-select v-model="queryParams.dictType"><el-option v-for="item in typeOptions" :key="item.dictId" :label="item.dictName" :value="item.dictType" /></el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="字典标签" prop="dictLabel">
|
|
|
- <el-input v-model="queryParams.dictLabel" placeholder="请输入字典标签" clearable @keyup.enter.native="handleQuery" class="se"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-select v-model="queryParams.status" placeholder="数据状态" clearable>
|
|
|
- <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
- </el-select>
|
|
|
+ <el-select v-model="queryParams.dictType"><el-option v-for="item in typeOptions" :key="item.dictId" :label="item.dictName" :value="item.dictType"/></el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
@@ -21,13 +13,11 @@
|
|
|
<el-col :span="1.5"><el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-hasPermi="['system:dict:add']">新增</el-button></el-col>
|
|
|
<el-col :span="1.5"><el-button type="success" icon="el-icon-edit" :disabled="single" @click="handleUpdate" v-hasPermi="['system:dict:edit']">修改</el-button></el-col>
|
|
|
<el-col :span="1.5"><el-button type="danger" icon="el-icon-delete" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:dict:remove']">删除</el-button></el-col>
|
|
|
- <el-col :span="1.5"><el-button type="warning" plain icon="el-icon-download" @click="handleExport" v-hasPermi="['system:dict:export']">导出</el-button></el-col>
|
|
|
- <el-col :span="1.5"><el-button type="warning" plain icon="el-icon-close" @click="handleClose">关闭</el-button></el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
<el-table border :data="dataList" @selection-change="handleSelectionChange" height="calc(100vh - 273px)">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="字典编码" align="center" prop="dictCode" />
|
|
|
+ <el-table-column type="index" label="序号" align="center" width="80" />
|
|
|
<el-table-column label="字典标签" align="center" prop="dictLabel">
|
|
|
<template slot-scope="scope">
|
|
|
<span v-if="scope.row.listClass == '' || scope.row.listClass == 'default'">{{ scope.row.dictLabel }}</span>
|
|
@@ -36,18 +26,12 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="字典键值" align="center" prop="dictValue" />
|
|
|
<el-table-column label="字典排序" align="center" prop="dictSort" />
|
|
|
- <el-table-column label="状态" align="center" prop="status">
|
|
|
- <template slot-scope="scope">
|
|
|
- <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" />
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
|
<template slot-scope="scope">
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" >
|
|
|
+ <el-table-column label="操作" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button>
|
|
@@ -64,19 +48,7 @@
|
|
|
<el-form-item label="字典类型"><el-input v-model="form.dictType" :disabled="true" /></el-form-item>
|
|
|
<el-form-item label="数据标签" prop="dictLabel"><el-input v-model="form.dictLabel" placeholder="请输入数据标签" /></el-form-item>
|
|
|
<el-form-item label="数据键值" prop="dictValue"><el-input v-model="form.dictValue" placeholder="请输入数据键值" /></el-form-item>
|
|
|
- <el-form-item label="样式属性" prop="cssClass"><el-input v-model="form.cssClass" placeholder="请输入样式属性" /></el-form-item>
|
|
|
<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="listClass">
|
|
|
- <el-select v-model="form.listClass">
|
|
|
- <el-option v-for="item in listClassOptions" :key="item.value" :label="item.label + '(' + item.value + ')'" :value="item.value"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
- <el-radio-group v-model="form.status">
|
|
|
- <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"><el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input></el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -168,7 +140,7 @@ export default {
|
|
|
methods: {
|
|
|
/** 查询字典类型详细 */
|
|
|
getType(dictId) {
|
|
|
- getType(dictId).then(response => {
|
|
|
+ getType(dictId).then((response) => {
|
|
|
this.queryParams.dictType = response.data.dictType;
|
|
|
this.defaultDictType = response.data.dictType;
|
|
|
this.getList();
|
|
@@ -176,13 +148,13 @@ export default {
|
|
|
},
|
|
|
/** 查询字典类型列表 */
|
|
|
getTypeList() {
|
|
|
- getDictOptionselect().then(response => {
|
|
|
+ getDictOptionselect().then((response) => {
|
|
|
this.typeOptions = response.data;
|
|
|
});
|
|
|
},
|
|
|
/** 查询字典数据列表 */
|
|
|
getList() {
|
|
|
- listData(this.queryParams).then(response => {
|
|
|
+ listData(this.queryParams).then((response) => {
|
|
|
this.dataList = response.rows;
|
|
|
this.total = response.total;
|
|
|
});
|
|
@@ -231,7 +203,7 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.dictCode);
|
|
|
+ this.ids = selection.map((item) => item.dictCode);
|
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
|
},
|
|
@@ -241,23 +213,23 @@ export default {
|
|
|
this.open = true;
|
|
|
this.title = '修改字典数据';
|
|
|
const dictCode = row.dictCode || this.ids;
|
|
|
- getData(dictCode).then(response => {
|
|
|
+ getData(dictCode).then((response) => {
|
|
|
this.form = response.data;
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
- submitForm: function() {
|
|
|
- this.$refs['form'].validate(valid => {
|
|
|
+ submitForm: function () {
|
|
|
+ this.$refs['form'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.dictCode != undefined) {
|
|
|
- updateData(this.form).then(response => {
|
|
|
+ updateData(this.form).then((response) => {
|
|
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
|
|
|
this.$modal.msgSuccess('修改成功');
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addData(this.form).then(response => {
|
|
|
+ addData(this.form).then((response) => {
|
|
|
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
|
|
|
this.$modal.msgSuccess('新增成功');
|
|
|
this.open = false;
|
|
@@ -272,7 +244,7 @@ export default {
|
|
|
const dictCodes = row.dictCode || this.ids;
|
|
|
this.$modal
|
|
|
.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?')
|
|
|
- .then(function() {
|
|
|
+ .then(function () {
|
|
|
return delData(dictCodes);
|
|
|
})
|
|
|
.then(() => {
|