update 字典项

qianlishi 3 years ago
parent e4136e79a7
commit ad756a2ae0

@ -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', //keyeditField'': 'danger','': 'primary','绿': 'success','': 'warning','': 'info',''''
1: 'table-success',
0: "table-danger", //keyeditField'': '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>

@ -20,13 +20,6 @@
>设计</el-button
>
</template>
<!--自定义的卡片插槽将在编辑详情页面出现在底部新卡片-->
<!--这里可以将自定义的弹出框代码放入到page中
<template v-slot:pageSection>
<div>插入底部html片段</div>
</template>
-->
</anji-crud>
</template>
<script>
@ -209,17 +202,7 @@ export default {
// fieldName input name
// fieldVal input
// fieldExtend select
formChange: (formData, fieldName, fieldVal, fieldExtend) => {
// if (fieldName == "reportImage") {
// const fileIdList = [];
// fieldVal.forEach(el => {
// if (el.fileId) {
// fileIdList.push(el.fileId);
// }
// });
// formData["reportImage"] = fileIdList.join(",");
// }
}
formChange: (formData, fieldName, fieldVal, fieldExtend) => {}
}
};
},

Loading…
Cancel
Save