From a54c42d2c74cf9b0173953876f4d8b110a280c2f Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Fri, 22 Jul 2022 12:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E7=BA=A7=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/cool/lib/eps/config.ts | 8 +++---- build/cool/lib/eps/index.ts | 4 +++- build/cool/lib/menu/index.ts | 8 ++++--- package.json | 2 +- .../base/views/components/menu/create.vue | 5 +++- .../base/views/components/menu/select.vue | 24 +++++++++++++------ src/modules/base/views/menu.vue | 8 +++++-- 7 files changed, 40 insertions(+), 19 deletions(-) diff --git a/build/cool/lib/eps/config.ts b/build/cool/lib/eps/config.ts index 138c8d3..316a126 100644 --- a/build/cool/lib/eps/config.ts +++ b/build/cool/lib/eps/config.ts @@ -12,19 +12,19 @@ export default { }, { type: "string", - includes: ["varchar", "text"] + test: ["varchar", "text"] }, { type: "Date", - includes: ["datetime", "date"] + test: ["datetime", "date"] }, { type: "number", - includes: ["tinyint", "int", "decimal"] + test: ["tinyint", "int", "decimal"] }, { type: "BigInt", - includes: ["bigint"] + test: ["bigint"] } ] } diff --git a/build/cool/lib/eps/index.ts b/build/cool/lib/eps/index.ts index 5c2a2b4..38cfd67 100644 --- a/build/cool/lib/eps/index.ts +++ b/build/cool/lib/eps/index.ts @@ -15,7 +15,9 @@ function getType({ entityName, propertyName, type }) { const resType = map.custom({ entityName, propertyName, type }); if (resType) return resType; } - if (map.includes?.includes(type)) return map.type; + if (map.test) { + if (map.test.includes(type)) return map.type; + } } return type; } diff --git a/build/cool/lib/menu/index.ts b/build/cool/lib/menu/index.ts index 20bbd98..f18baf6 100644 --- a/build/cool/lib/menu/index.ts +++ b/build/cool/lib/menu/index.ts @@ -106,9 +106,9 @@ const handler = { // 创建组件 function createComponent(item: any) { - const { propertyName: prop, comment: label } = item; - - let d: any = null; + const prop = item.propertyName; + let label = item.comment; + let d: any; rules.forEach((r: any) => { const s = r.test.find((e: any) => { @@ -145,6 +145,8 @@ function createComponent(item: any) { }); function parse(v: any) { + label = label.split(" ")[0]; + if (v?.name) { return { prop, diff --git a/package.json b/package.json index ef44792..44f03ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "front-next", - "version": "5.7.0", + "version": "5.7.1", "scripts": { "dev": "vite --host", "build": "vite build", diff --git a/src/modules/base/views/components/menu/create.vue b/src/modules/base/views/components/menu/create.vue index 1b149b4..879e950 100644 --- a/src/modules/base/views/components/menu/create.vue +++ b/src/modules/base/views/components/menu/create.vue @@ -113,7 +113,10 @@ async function create() { prop: "parentId", label: "上级节点", component: { - vm: MenuSelect + vm: MenuSelect, + props: { + type: 1 + } } }, { diff --git a/src/modules/base/views/components/menu/select.vue b/src/modules/base/views/components/menu/select.vue index 7f23f01..6f92ee4 100644 --- a/src/modules/base/views/components/menu/select.vue +++ b/src/modules/base/views/components/menu/select.vue @@ -2,7 +2,7 @@