From a51d4732a524a62f9ee92e8c164179956db6035f Mon Sep 17 00:00:00 2001 From: smallchill Date: Mon, 6 Mar 2023 16:23:03 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=AD=97=E6=AE=B5=E9=BB=98=E8=AE=A4=E9=9A=90?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/model.vue | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/views/tool/model.vue b/src/views/tool/model.vue index 764ecc8..d94e486 100644 --- a/src/views/tool/model.vue +++ b/src/views/tool/model.vue @@ -100,6 +100,8 @@ export default { formStep: {}, fields: [], selectionModelList: [], + // 默认不需要显示的字段名 + hideFields: ["id", "tenant_id", "create_user", "create_dept", "create_time", "update_user", "update_time", "status", "is_deleted"] }; }, watch: { @@ -290,19 +292,10 @@ export default { this.fields.forEach(item => { item.$cellEdit = true; item.modelId = this.modelId; - // 首次加载配置默认值 - if (validatenull(item.id)) { - item.isList = 1; - item.isForm = 1; - item.isRow = 0; - item.isRequired = 0; - item.isQuery = 0; - item.componentType = "input"; - } + // 根据字段物理类型自动适配实体类型 if (!validatenull(item.name)) { item.jdbcName = item.name; item.jdbcType = item.propertyType; - // 根据字段物理类型自动适配实体类型 if (item.propertyType === "LocalDateTime") { item.propertyType = "Date"; item.propertyEntity = "java.util.Date"; @@ -315,6 +308,21 @@ export default { }); } } + // 首次加载配置默认值 + if (validatenull(item.id)) { + item.isList = 1; + item.isForm = 1; + item.isRow = 0; + item.isRequired = 0; + item.isQuery = 0; + item.componentType = "input"; + // 默认不需要显示的字段名配置 + if (this.hideFields.includes(item.jdbcName)) { + item.isList = 0; + item.isForm = 0; + item.isRequired = 0; + } + } }); this.loading = false; }