|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<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-form-item :label="$t('page.system.dict.name')" prop="dictType"> |
|
|
|
<el-select v-model="queryParams.dictType"> |
|
|
|
<el-option |
|
|
|
v-for="item in typeOptions" |
|
|
|
@ -11,10 +11,10 @@ |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="标签" prop="dictLabel"> |
|
|
|
<el-form-item :label="$t('page.system.dict.bq')" prop="dictLabel"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.dictLabel" |
|
|
|
placeholder="请输入" |
|
|
|
:placeholder="$t('form.placeholderInput')" |
|
|
|
clearable |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
@ -30,8 +30,8 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> --> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button> |
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('form.search') }}</el-button> |
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">{{ $t('form.reset') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
@ -44,7 +44,7 @@ |
|
|
|
|
|
|
|
@click="handleAdd" |
|
|
|
v-hasPermi="['system:dict:add','system:dict:edit']" |
|
|
|
>新增</el-button> |
|
|
|
>{{$t('form.add')}}</el-button> |
|
|
|
</el-col> |
|
|
|
<!-- <el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
@ -85,7 +85,7 @@ |
|
|
|
icon="el-icon-close" |
|
|
|
|
|
|
|
@click="handleClose" |
|
|
|
>关闭</el-button> |
|
|
|
>{{$t('form.close')}}</el-button> |
|
|
|
</el-col> |
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
|
|
</el-row> |
|
|
|
@ -93,46 +93,46 @@ |
|
|
|
<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="dictLabel"> |
|
|
|
<el-table-column :label="$t('page.system.dict.bq')" align="center" prop="dictLabel"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="(scope.row.listClass == '' || scope.row.listClass == 'default') && (scope.row.cssClass == '' || scope.row.cssClass == null)">{{ scope.row.dictLabel }}</span> |
|
|
|
<el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass" :class="scope.row.cssClass">{{ scope.row.dictLabel }}</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="键值" align="center" prop="dictValue" /> |
|
|
|
<el-table-column label="排序" align="center" prop="dictSort" /> |
|
|
|
<el-table-column :label="$t('page.system.dict.jz')" align="center" prop="dictValue" /> |
|
|
|
<el-table-column :label="$t('page.system.dict.sort')" 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="$t('form.remark')" 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" class-name="small-padding fixed-width"> |
|
|
|
<el-table-column :label="$t('form.operate')" align="center" class-name="small-padding fixed-width"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
|
|
|
|
type="text" |
|
|
|
@click="handleUpdate(scope.row,false)" |
|
|
|
v-hasPermi="['system:dict:edit']" |
|
|
|
>编辑</el-button> |
|
|
|
>{{$t('form.edit')}}</el-button> |
|
|
|
<el-button |
|
|
|
|
|
|
|
type="text" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
v-hasPermi="['system:dict:remove']" |
|
|
|
>删除</el-button> |
|
|
|
>{{$t('form.delete')}}</el-button> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="text" |
|
|
|
@click="handleUpdate(scope.row,true)" |
|
|
|
v-hasPermi="['system:dict:query']" |
|
|
|
>详情</el-button> |
|
|
|
>{{$t('form.detail')}}</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
@ -148,20 +148,20 @@ |
|
|
|
|
|
|
|
<!-- 添加或修改参数配置对话框 --> |
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
|
|
<el-form-item label="字典类型"> |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
|
|
|
<el-form-item :label="$t('page.system.dict.type')+':'"> |
|
|
|
<el-input v-model="form.dictType" :disabled="true" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="标签" prop="dictLabel"> |
|
|
|
<el-input v-model="form.dictLabel" placeholder="请输入数据标签" :readonly="readonly" /> |
|
|
|
<el-form-item :label="$t('page.system.dict.bq')+':'" prop="dictLabel"> |
|
|
|
<el-input v-model="form.dictLabel" :placeholder="$t('form.placeholderInput')" :readonly="readonly" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="键值" prop="dictValue"> |
|
|
|
<el-input v-model="form.dictValue" placeholder="请输入数据键值" :readonly="readonly" /> |
|
|
|
<el-form-item :label="$t('page.system.dict.jz')+':'" prop="dictValue"> |
|
|
|
<el-input v-model="form.dictValue" :placeholder="$t('form.placeholderInput')" :readonly="readonly" /> |
|
|
|
</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-form-item :label="$t('page.system.dict.sort')+':'" prop="dictSort"> |
|
|
|
<el-input-number v-model="form.dictSort" controls-position="right" :min="0" :disabled="readonly" /> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item label="回显样式" prop="listClass"> |
|
|
|
@ -183,13 +183,13 @@ |
|
|
|
>{{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="请输入内容" :readonly="readonly"></el-input> |
|
|
|
<el-form-item :label="$t('form.remark')+':'" prop="remark"> |
|
|
|
<el-input v-model="form.remark" type="textarea" :placeholder="$t('form.placeholderInput')" :readonly="readonly"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer" v-if="!readonly"> |
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
|
<el-button @click="cancel">取 消</el-button> |
|
|
|
<el-button type="primary" @click="submitForm">{{$t('form.saveConfirm')}}</el-button> |
|
|
|
<el-button @click="cancel">{{$t('form.cancel')}}</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
@ -266,15 +266,17 @@ export default { |
|
|
|
// 表单校验 |
|
|
|
rules: { |
|
|
|
dictLabel: [ |
|
|
|
{ required: true, message: "标签不能为空", trigger: "blur" } |
|
|
|
{ required: true, message: this.$t('form.placeholderInput'), trigger: "blur" } |
|
|
|
], |
|
|
|
dictValue: [ |
|
|
|
{ required: true, message: "键值不能为空", trigger: "blur" } |
|
|
|
{ required: true, message: this.$t('form.placeholderInput'), trigger: "blur" } |
|
|
|
], |
|
|
|
dictSort: [ |
|
|
|
{ required: true, message: "顺序不能为空", trigger: "blur" } |
|
|
|
{ required: true, message: this.$t('form.placeholderInput'), trigger: "blur" } |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
readonly:false, |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
@ -343,9 +345,10 @@ export default { |
|
|
|
}, |
|
|
|
/** 新增按钮操作 */ |
|
|
|
handleAdd() { |
|
|
|
this.readonly = false |
|
|
|
this.reset() |
|
|
|
this.open = true |
|
|
|
this.title = "添加字典数据" |
|
|
|
this.title = this.$t('form.add') |
|
|
|
this.form.dictType = this.queryParams.dictType |
|
|
|
}, |
|
|
|
// 多选框选中数据 |
|
|
|
@ -357,12 +360,15 @@ export default { |
|
|
|
/** 修改按钮操作 */ |
|
|
|
handleUpdate(row,readonly) { |
|
|
|
this.readonly = readonly |
|
|
|
if(readonly){ |
|
|
|
this.saveSimpleLog({name:row.dictLabel,nameEn:row.dictLabel,jcmc:'字典数据详情',jcmcEn:'Term Book Data Detail'}) |
|
|
|
} |
|
|
|
this.reset() |
|
|
|
const dictCode = row.dictCode || this.ids |
|
|
|
getData(dictCode).then(response => { |
|
|
|
this.form = response.data |
|
|
|
this.open = true |
|
|
|
this.title = (readonly?'':'编辑')+"字典数据" |
|
|
|
this.title = readonly?this.$t('form.detail'):this.$t('form.edit') |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** 提交按钮 */ |
|
|
|
@ -388,7 +394,7 @@ export default { |
|
|
|
/** 删除按钮操作 */ |
|
|
|
handleDelete(row) { |
|
|
|
const dictCodes = row.dictCode || this.ids |
|
|
|
this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() { |
|
|
|
this.$modal.confirm(this.$t('form.confirmDelete')).then(function() { |
|
|
|
return delData(dictCodes) |
|
|
|
}).then(() => { |
|
|
|
this.getList() |
|
|
|
|