|
|
|
@ -1,33 +1,18 @@
|
|
|
|
|
<template>
|
|
|
|
|
<anji-crud ref="listPage" :option="crudOption">
|
|
|
|
|
<!-- <template v-slot:buttonLeftOnTable>-->
|
|
|
|
|
<!-- <el-button type="primary" icon="el-icon-plus" @click="handleOpenDialog1">自定义按钮1</el-button>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
|
|
|
|
|
<!--自定义的卡片插槽,将在编辑详情页面,出现在底部新卡片-->
|
|
|
|
|
<!-- <template v-slot:cardInEditPage>-->
|
|
|
|
|
<!-- <div class="anji-card">-->
|
|
|
|
|
<!-- <div class="card-head">-->
|
|
|
|
|
<!-- 自定义标题-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <div class="card-body">-->
|
|
|
|
|
<!-- 自定义内容区-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!--这里可以将自定义的弹出框代码,放入到page中
|
|
|
|
|
<template v-slot:pageSection>
|
|
|
|
|
<div>插入底部html片段</div>
|
|
|
|
|
</template>
|
|
|
|
|
-->
|
|
|
|
|
</anji-crud>
|
|
|
|
|
<anji-crud ref="listPage" :option="crudOption"> </anji-crud>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { dictItemDetail, dictItemPageList, dictItemAdd, dictItemEdit, dictsItemDelect } from '@/api/dictItem'
|
|
|
|
|
import {
|
|
|
|
|
dictItemDetail,
|
|
|
|
|
dictItemPageList,
|
|
|
|
|
dictItemAdd,
|
|
|
|
|
dictItemEdit,
|
|
|
|
|
dictsItemDelect
|
|
|
|
|
} from "@/api/dictItem";
|
|
|
|
|
export default {
|
|
|
|
|
name: 'DictItem',
|
|
|
|
|
name: "DictItem",
|
|
|
|
|
components: {
|
|
|
|
|
anjiCrud: require('@/components/AnjiPlus/anji-crud/anji-crud').default,
|
|
|
|
|
anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -39,201 +24,217 @@ export default {
|
|
|
|
|
itemValue: null,
|
|
|
|
|
remark: null,
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageSize: 10
|
|
|
|
|
},
|
|
|
|
|
crudOption: {
|
|
|
|
|
// 使用菜单做为页面标题
|
|
|
|
|
title: '字典项',
|
|
|
|
|
title: "字典项",
|
|
|
|
|
// 详情页中输入框左边文字宽度
|
|
|
|
|
labelWidth: '120px',
|
|
|
|
|
labelWidth: "120px",
|
|
|
|
|
// 查询表单条件
|
|
|
|
|
queryFormFields: [
|
|
|
|
|
{
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: '字典编码',
|
|
|
|
|
field: 'dictCode',
|
|
|
|
|
disabled: this.isBlank(this.$route.query['dictCode']) == false,
|
|
|
|
|
defaultValue: this.$route.query['dictCode'],
|
|
|
|
|
inputType: "input",
|
|
|
|
|
label: "字典编码",
|
|
|
|
|
field: "dictCode",
|
|
|
|
|
disabled: this.isBlank(this.$route.query["dictCode"]) == false,
|
|
|
|
|
defaultValue: this.$route.query["dictCode"]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: '显示文字',
|
|
|
|
|
field: 'itemLabel',
|
|
|
|
|
inputType: "input",
|
|
|
|
|
label: "显示文字",
|
|
|
|
|
field: "itemLabel"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: '提交值',
|
|
|
|
|
field: 'itemValue',
|
|
|
|
|
inputType: "input",
|
|
|
|
|
label: "提交值",
|
|
|
|
|
field: "itemValue"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: '备注',
|
|
|
|
|
field: 'remark',
|
|
|
|
|
inputType: "input",
|
|
|
|
|
label: "备注",
|
|
|
|
|
field: "remark"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '语言标识',
|
|
|
|
|
inputType: 'anji-select',
|
|
|
|
|
label: "语言标识",
|
|
|
|
|
inputType: "anji-select",
|
|
|
|
|
anjiSelectOption: {
|
|
|
|
|
dictCode: 'LOCALE',
|
|
|
|
|
dictCode: "LOCALE"
|
|
|
|
|
},
|
|
|
|
|
field: 'locale',
|
|
|
|
|
},
|
|
|
|
|
field: "locale"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
// 操作按钮
|
|
|
|
|
buttons: {
|
|
|
|
|
query: {
|
|
|
|
|
api: dictItemPageList,
|
|
|
|
|
permission: 'dictItemManage:query',
|
|
|
|
|
permission: "dictItemManage:query"
|
|
|
|
|
},
|
|
|
|
|
queryByPrimarykey: {
|
|
|
|
|
api: dictItemDetail,
|
|
|
|
|
permission: 'dictItemManage:query',
|
|
|
|
|
permission: "dictItemManage:query"
|
|
|
|
|
},
|
|
|
|
|
add: {
|
|
|
|
|
api: dictItemAdd,
|
|
|
|
|
permission: 'dictItemManage:insert',
|
|
|
|
|
permission: "dictItemManage:insert"
|
|
|
|
|
},
|
|
|
|
|
delete: {
|
|
|
|
|
api: dictsItemDelect,
|
|
|
|
|
permission: 'dictItemManage:delete',
|
|
|
|
|
permission: "dictItemManage:delete"
|
|
|
|
|
},
|
|
|
|
|
edit: {
|
|
|
|
|
api: dictItemEdit,
|
|
|
|
|
permission: 'dictItemManage:update',
|
|
|
|
|
permission: "dictItemManage:update"
|
|
|
|
|
},
|
|
|
|
|
customButton: {
|
|
|
|
|
operationWidth: "150px"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 表格列
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
label: '',
|
|
|
|
|
field: 'id',
|
|
|
|
|
label: "",
|
|
|
|
|
field: "id",
|
|
|
|
|
primaryKey: true, // 根据主键查询详情或者根据主键删除时, 主键的
|
|
|
|
|
tableHide: true, // 表格中不显示
|
|
|
|
|
editHide: true, // 编辑弹框中不显示
|
|
|
|
|
editHide: true // 编辑弹框中不显示
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '字典编码', // 字典编码
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'dictCode',
|
|
|
|
|
editField: 'dictCode',
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: "字典编码", // 字典编码
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "dictCode",
|
|
|
|
|
editField: "dictCode",
|
|
|
|
|
inputType: "input",
|
|
|
|
|
rules: [
|
|
|
|
|
{ required: true, message: '字典编码不能为空', trigger: 'blur' },
|
|
|
|
|
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }
|
|
|
|
|
{ required: true, message: "字典编码不能为空", trigger: "blur" },
|
|
|
|
|
{ min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
// disabled: false,
|
|
|
|
|
disabled: this.isBlank(this.$route.query['dictCode']) == false,
|
|
|
|
|
defaultValue: this.$route.query['dictCode'],
|
|
|
|
|
disabled: this.isBlank(this.$route.query["dictCode"]) == false,
|
|
|
|
|
defaultValue: this.$route.query["dictCode"]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '字典项名称', // 字典项名称
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'itemName',
|
|
|
|
|
editField: 'itemName',
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: "字典项名称", // 字典项名称
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "itemName",
|
|
|
|
|
editField: "itemName",
|
|
|
|
|
inputType: "input",
|
|
|
|
|
rules: [
|
|
|
|
|
{ required: true, message: '字典项名称不能为空', trigger: 'blur' },
|
|
|
|
|
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }],
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "字典项名称不能为空",
|
|
|
|
|
trigger: "blur"
|
|
|
|
|
},
|
|
|
|
|
{ min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
disabled: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '提交值', // 字典项提交值
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'itemValue',
|
|
|
|
|
editField: 'itemValue',
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: "提交值", // 字典项提交值
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "itemValue",
|
|
|
|
|
editField: "itemValue",
|
|
|
|
|
inputType: "input",
|
|
|
|
|
rules: [
|
|
|
|
|
{ required: true, message: '提交值不能为空', trigger: 'blur' },
|
|
|
|
|
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
|
|
|
|
|
{ required: true, message: "提交值不能为空", trigger: "blur" },
|
|
|
|
|
{ min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
disabled: 'disableOnEdit',
|
|
|
|
|
disabled: "disableOnEdit"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '语言标识', // 语言标识
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'locale',
|
|
|
|
|
editField: 'locale',
|
|
|
|
|
fieldTableRowRenderer: (row) => {
|
|
|
|
|
return this.getDictLabelByCode('LOCALE', row['locale'])
|
|
|
|
|
label: "语言标识", // 语言标识
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "locale",
|
|
|
|
|
editField: "locale",
|
|
|
|
|
fieldTableRowRenderer: row => {
|
|
|
|
|
return this.getDictLabelByCode("LOCALE", row["locale"]);
|
|
|
|
|
},
|
|
|
|
|
inputType: 'anji-select',
|
|
|
|
|
inputType: "anji-select",
|
|
|
|
|
anjiSelectOption: {
|
|
|
|
|
dictCode: 'LOCALE',
|
|
|
|
|
dictCode: "LOCALE"
|
|
|
|
|
},
|
|
|
|
|
rules: [{ required: true, message: '语言标识不能为空', trigger: 'blur' }],
|
|
|
|
|
rules: [
|
|
|
|
|
{ required: true, message: "语言标识不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
disabled: false,
|
|
|
|
|
defaultValue: 'zh'
|
|
|
|
|
defaultValue: "zh"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '状态',//0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'enabled',
|
|
|
|
|
fieldTableRowRenderer: (row) => {
|
|
|
|
|
return this.getDictLabelByCode('ENABLE_FLAG', row['enabled'])
|
|
|
|
|
label: "状态", //0--已禁用 1--已启用 DIC_NAME=ENABLE_FLAG
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "enabled",
|
|
|
|
|
fieldTableRowRenderer: row => {
|
|
|
|
|
return this.getDictLabelByCode("ENABLE_FLAG", row["enabled"]);
|
|
|
|
|
},
|
|
|
|
|
colorStyle: {
|
|
|
|
|
0: 'table-danger', //key为editField渲染的值(字典的提交值)'红色': 'danger','蓝色': 'primary','绿色': 'success','黄色': 'warning','灰色': 'info','白色':''
|
|
|
|
|
1: 'table-success',
|
|
|
|
|
0: "table-danger", //key为editField渲染的值(字典的提交值)'红色': 'danger','蓝色': 'primary','绿色': 'success','黄色': 'warning','灰色': 'info','白色':''
|
|
|
|
|
1: "table-success"
|
|
|
|
|
},
|
|
|
|
|
editField: 'enabled',
|
|
|
|
|
inputType: 'anji-select',
|
|
|
|
|
editField: "enabled",
|
|
|
|
|
inputType: "anji-select",
|
|
|
|
|
anjiSelectOption: {
|
|
|
|
|
dictCode: "ENABLE_FLAG" //指定数据字典
|
|
|
|
|
},
|
|
|
|
|
rules: [
|
|
|
|
|
{ required: true, message: '状态不能为空', trigger: 'blur' },
|
|
|
|
|
{ required: true, message: "状态不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
disabled: false,
|
|
|
|
|
disabled: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '排序', // 排序
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'sort',
|
|
|
|
|
editField: 'sort',
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: "排序", // 排序
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "sort",
|
|
|
|
|
editField: "sort",
|
|
|
|
|
inputType: "input",
|
|
|
|
|
rules: [],
|
|
|
|
|
disabled: false,
|
|
|
|
|
disabled: false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '描述', // 描述
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'remark',
|
|
|
|
|
editField: 'remark',
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
rules: [{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }],
|
|
|
|
|
label: "描述", // 描述
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "remark",
|
|
|
|
|
editField: "remark",
|
|
|
|
|
inputType: "input",
|
|
|
|
|
rules: [
|
|
|
|
|
{ min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
disabled: false,
|
|
|
|
|
tableHide: true, // 表格中不显示
|
|
|
|
|
tableHide: true // 表格中不显示
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
label: '扩展项', // 字典扩展项
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'itemExtend',
|
|
|
|
|
editField: 'itemExtend',
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
rules: [{ min: 1, max: 2048, message: '不超过2048个字符', trigger: 'blur' }],
|
|
|
|
|
label: "扩展项", // 字典扩展项
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "itemExtend",
|
|
|
|
|
editField: "itemExtend",
|
|
|
|
|
inputType: "input",
|
|
|
|
|
rules: [
|
|
|
|
|
{
|
|
|
|
|
min: 1,
|
|
|
|
|
max: 2048,
|
|
|
|
|
message: "不超过2048个字符",
|
|
|
|
|
trigger: "blur"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
disabled: false,
|
|
|
|
|
tableHide: true, // 表格中不显示
|
|
|
|
|
tableHide: true // 表格中不显示
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '创建人',
|
|
|
|
|
placeholder: '',
|
|
|
|
|
field: 'updateBy',
|
|
|
|
|
editField: 'updateBy',
|
|
|
|
|
inputType: 'input',
|
|
|
|
|
label: "创建人",
|
|
|
|
|
placeholder: "",
|
|
|
|
|
field: "updateBy",
|
|
|
|
|
editField: "updateBy",
|
|
|
|
|
inputType: "input",
|
|
|
|
|
disabled: false,
|
|
|
|
|
editHide: true, // 编辑弹框中不显示
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
editHide: true // 编辑弹框中不显示
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
created() {
|
|
|
|
|
console.log(this.searchForm.dictCode)
|
|
|
|
|
console.log(this.searchForm.dictCode);
|
|
|
|
|
},
|
|
|
|
|
methods: {},
|
|
|
|
|
}
|
|
|
|
|
methods: {}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|