update 字典项

qianlishi 4 years ago
parent e4136e79a7
commit ad756a2ae0

@ -1,33 +1,18 @@
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption"> </anji-crud>
<!-- <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>
</template> </template>
<script> <script>
import { dictItemDetail, dictItemPageList, dictItemAdd, dictItemEdit, dictsItemDelect } from '@/api/dictItem' import {
dictItemDetail,
dictItemPageList,
dictItemAdd,
dictItemEdit,
dictsItemDelect
} from "@/api/dictItem";
export default { export default {
name: 'DictItem', name: "DictItem",
components: { components: {
anjiCrud: require('@/components/AnjiPlus/anji-crud/anji-crud').default, anjiCrud: require("@/components/AnjiPlus/anji-crud/anji-crud").default
}, },
data() { data() {
return { return {
@ -39,201 +24,217 @@ export default {
itemValue: null, itemValue: null,
remark: null, remark: null,
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10
}, },
crudOption: { crudOption: {
// 使 // 使
title: '字典项', title: "字典项",
// //
labelWidth: '120px', labelWidth: "120px",
// //
queryFormFields: [ queryFormFields: [
{ {
inputType: 'input', inputType: "input",
label: '字典编码', label: "字典编码",
field: 'dictCode', field: "dictCode",
disabled: this.isBlank(this.$route.query['dictCode']) == false, disabled: this.isBlank(this.$route.query["dictCode"]) == false,
defaultValue: this.$route.query['dictCode'], defaultValue: this.$route.query["dictCode"]
}, },
{ {
inputType: 'input', inputType: "input",
label: '显示文字', label: "显示文字",
field: 'itemLabel', field: "itemLabel"
}, },
{ {
inputType: 'input', inputType: "input",
label: '提交值', label: "提交值",
field: 'itemValue', field: "itemValue"
}, },
{ {
inputType: 'input', inputType: "input",
label: '备注', label: "备注",
field: 'remark', field: "remark"
}, },
{ {
label: '语言标识', label: "语言标识",
inputType: 'anji-select', inputType: "anji-select",
anjiSelectOption: { anjiSelectOption: {
dictCode: 'LOCALE', dictCode: "LOCALE"
}, },
field: 'locale', field: "locale"
}, }
], ],
// //
buttons: { buttons: {
query: { query: {
api: dictItemPageList, api: dictItemPageList,
permission: 'dictItemManage:query', permission: "dictItemManage:query"
}, },
queryByPrimarykey: { queryByPrimarykey: {
api: dictItemDetail, api: dictItemDetail,
permission: 'dictItemManage:query', permission: "dictItemManage:query"
}, },
add: { add: {
api: dictItemAdd, api: dictItemAdd,
permission: 'dictItemManage:insert', permission: "dictItemManage:insert"
}, },
delete: { delete: {
api: dictsItemDelect, api: dictsItemDelect,
permission: 'dictItemManage:delete', permission: "dictItemManage:delete"
}, },
edit: { edit: {
api: dictItemEdit, api: dictItemEdit,
permission: 'dictItemManage:update', permission: "dictItemManage:update"
}, },
customButton: {
operationWidth: "150px"
}
}, },
// //
columns: [ columns: [
{ {
label: '', label: "",
field: 'id', field: "id",
primaryKey: true, // , primaryKey: true, // ,
tableHide: true, // tableHide: true, //
editHide: true, // editHide: true //
}, },
{ {
label: '字典编码', // label: "字典编码", //
placeholder: '', placeholder: "",
field: 'dictCode', field: "dictCode",
editField: 'dictCode', editField: "dictCode",
inputType: 'input', inputType: "input",
rules: [ rules: [
{ required: true, message: '字典编码不能为空', trigger: 'blur' }, { required: true, message: "字典编码不能为空", trigger: "blur" },
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' } { min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
], ],
// disabled: false, disabled: this.isBlank(this.$route.query["dictCode"]) == false,
disabled: this.isBlank(this.$route.query['dictCode']) == false, defaultValue: this.$route.query["dictCode"]
defaultValue: this.$route.query['dictCode'],
}, },
{ {
label: '字典项名称', // label: "字典项名称", //
placeholder: '', placeholder: "",
field: 'itemName', field: "itemName",
editField: 'itemName', editField: "itemName",
inputType: 'input', inputType: "input",
rules: [ 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: false
}, },
{ {
label: '提交值', // label: "提交值", //
placeholder: '', placeholder: "",
field: 'itemValue', field: "itemValue",
editField: 'itemValue', editField: "itemValue",
inputType: 'input', inputType: "input",
rules: [ rules: [
{ required: true, message: '提交值不能为空', trigger: 'blur' }, { required: true, message: "提交值不能为空", trigger: "blur" },
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }, { min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
], ],
disabled: 'disableOnEdit', disabled: "disableOnEdit"
}, },
{ {
label: '语言标识', // label: "语言标识", //
placeholder: '', placeholder: "",
field: 'locale', field: "locale",
editField: 'locale', editField: "locale",
fieldTableRowRenderer: (row) => { fieldTableRowRenderer: row => {
return this.getDictLabelByCode('LOCALE', row['locale']) return this.getDictLabelByCode("LOCALE", row["locale"]);
}, },
inputType: 'anji-select', inputType: "anji-select",
anjiSelectOption: { anjiSelectOption: {
dictCode: 'LOCALE', dictCode: "LOCALE"
}, },
rules: [{ required: true, message: '语言标识不能为空', trigger: 'blur' }], rules: [
{ required: true, message: "语言标识不能为空", trigger: "blur" }
],
disabled: false, disabled: false,
defaultValue: 'zh' defaultValue: "zh"
}, },
{ {
label: '状态',//0-- 1-- DIC_NAME=ENABLE_FLAG label: "状态", //0-- 1-- DIC_NAME=ENABLE_FLAG
placeholder: '', placeholder: "",
field: 'enabled', field: "enabled",
fieldTableRowRenderer: (row) => { fieldTableRowRenderer: row => {
return this.getDictLabelByCode('ENABLE_FLAG', row['enabled']) return this.getDictLabelByCode("ENABLE_FLAG", row["enabled"]);
}, },
colorStyle: { colorStyle: {
0: 'table-danger', //keyeditField'': 'danger','': 'primary','绿': 'success','': 'warning','': 'info','''' 0: "table-danger", //keyeditField'': 'danger','': 'primary','绿': 'success','': 'warning','': 'info',''''
1: 'table-success', 1: "table-success"
}, },
editField: 'enabled', editField: "enabled",
inputType: 'anji-select', inputType: "anji-select",
anjiSelectOption: { anjiSelectOption: {
dictCode: "ENABLE_FLAG" // dictCode: "ENABLE_FLAG" //
}, },
rules: [ rules: [
{ required: true, message: '状态不能为空', trigger: 'blur' }, { required: true, message: "状态不能为空", trigger: "blur" }
], ],
disabled: false, disabled: false
}, },
{ {
label: '排序', // label: "排序", //
placeholder: '', placeholder: "",
field: 'sort', field: "sort",
editField: 'sort', editField: "sort",
inputType: 'input', inputType: "input",
rules: [], rules: [],
disabled: false, disabled: false
}, },
{ {
label: '描述', // label: "描述", //
placeholder: '', placeholder: "",
field: 'remark', field: "remark",
editField: 'remark', editField: "remark",
inputType: 'input', inputType: "input",
rules: [{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' }], rules: [
{ min: 1, max: 64, message: "不超过64个字符", trigger: "blur" }
],
disabled: false, disabled: false,
tableHide: true, // tableHide: true //
}, },
{ {
label: '扩展项', // label: "扩展项", //
placeholder: '', placeholder: "",
field: 'itemExtend', field: "itemExtend",
editField: 'itemExtend', editField: "itemExtend",
inputType: 'input', inputType: "input",
rules: [{ min: 1, max: 2048, message: '不超过2048个字符', trigger: 'blur' }], rules: [
{
min: 1,
max: 2048,
message: "不超过2048个字符",
trigger: "blur"
}
],
disabled: false, disabled: false,
tableHide: true, // tableHide: true //
}, },
{ {
label: '创建人', label: "创建人",
placeholder: '', placeholder: "",
field: 'updateBy', field: "updateBy",
editField: 'updateBy', editField: "updateBy",
inputType: 'input', inputType: "input",
disabled: false, disabled: false,
editHide: true, // editHide: true //
}, }
], ]
}, }
} };
}, },
created() { created() {
console.log(this.searchForm.dictCode) console.log(this.searchForm.dictCode);
}, },
methods: {}, methods: {}
} };
</script> </script>

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

Loading…
Cancel
Save