From e019f75456e5a587a78284e7108342ee60d3d743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Tue, 10 Oct 2023 17:59:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- package.json | 2 +- packages/crud/package.json | 2 +- packages/crud/src/components/crud/helper.ts | 3 ++- packages/crud/src/components/form/index.tsx | 4 ++-- packages/crud/types/components/adv/search.d.ts | 4 ++-- packages/crud/types/components/form-tabs/index.d.ts | 4 ++-- packages/crud/types/components/search-key/index.d.ts | 4 ++-- src/modules/demo/components/form-btn.vue | 3 +++ src/modules/dict/types/index.d.ts | 7 ++++--- yarn.lock | 8 ++++---- 11 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 1e78202..cd65a64 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ node_modules dist dist-ssr *.local -pnpm-lock.yaml +pnpm-lock.yaml \ No newline at end of file diff --git a/package.json b/package.json index b67a502..2d4a867 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint:eslint": "eslint \"{src}/**/*.{vue,ts,tsx}\" --fix" }, "dependencies": { - "@cool-vue/crud": "^7.0.1-beta2", + "@cool-vue/crud": "^7.0.1-beta3", "@element-plus/icons-vue": "^2.1.0", "@vueuse/core": "^10.4.0", "@wangeditor/editor": "^5.1.23", diff --git a/packages/crud/package.json b/packages/crud/package.json index fc95190..3a9ef6a 100644 --- a/packages/crud/package.json +++ b/packages/crud/package.json @@ -1,6 +1,6 @@ { "name": "@cool-vue/crud", - "version": "7.0.1-beta2", + "version": "7.0.1-beta3", "private": false, "main": "./dist/index.umd.min.js", "typings": "types/index.d.ts", diff --git a/packages/crud/src/components/crud/helper.ts b/packages/crud/src/components/crud/helper.ts index 579a9a5..681252d 100644 --- a/packages/crud/src/components/crud/helper.ts +++ b/packages/crud/src/components/crud/helper.ts @@ -1,7 +1,8 @@ import { ElMessageBox, ElMessage } from "element-plus"; import { Mitt } from "../../utils/mitt"; import { ref } from "vue"; -import { isArray, isFunction, merge } from "lodash-es"; +import { isArray, isFunction } from "lodash-es"; +import { merge } from "../../utils"; interface Options { mitt: Mitt; diff --git a/packages/crud/src/components/form/index.tsx b/packages/crud/src/components/form/index.tsx index a458d1a..d8d2574 100644 --- a/packages/crud/src/components/form/index.tsx +++ b/packages/crud/src/components/form/index.tsx @@ -1,8 +1,8 @@ import { defineComponent, h, nextTick } from "vue"; -import { cloneDeep, isBoolean, isEmpty, merge } from "lodash-es"; +import { cloneDeep, isBoolean, isEmpty } from "lodash-es"; import { useAction, useForm, usePlugins, useTabs } from "./helper"; import { useBrowser, useConfig, useElApi } from "../../hooks"; -import { getValue } from "../../utils"; +import { getValue, merge } from "../../utils"; import formHook from "../../utils/form-hook"; import { renderNode } from "../../utils/vnode"; import { parseFormHidden } from "../../utils/parse"; diff --git a/packages/crud/types/components/adv/search.d.ts b/packages/crud/types/components/adv/search.d.ts index c2bc7e4..22f006e 100644 --- a/packages/crud/types/components/adv/search.d.ts +++ b/packages/crud/types/components/adv/search.d.ts @@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<{ }; title: StringConstructor; size: { - type: (StringConstructor | NumberConstructor)[]; + type: (NumberConstructor | StringConstructor)[]; default: string; }; op: { @@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{ }; title: StringConstructor; size: { - type: (StringConstructor | NumberConstructor)[]; + type: (NumberConstructor | StringConstructor)[]; default: string; }; op: { diff --git a/packages/crud/types/components/form-tabs/index.d.ts b/packages/crud/types/components/form-tabs/index.d.ts index 6e8079a..df60e9f 100644 --- a/packages/crud/types/components/form-tabs/index.d.ts +++ b/packages/crud/types/components/form-tabs/index.d.ts @@ -1,6 +1,6 @@ import { PropType } from "vue"; declare const _default: import("vue").DefineComponent<{ - modelValue: (StringConstructor | NumberConstructor)[]; + modelValue: (NumberConstructor | StringConstructor)[]; labels: { type: ArrayConstructor; default: () => never[]; @@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<{ default: string; }; }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly never[]; diff --git a/packages/crud/types/components/search-key/index.d.ts b/packages/crud/types/components/search-key/index.d.ts index d6ff5bc..12e1e3a 100644 --- a/packages/crud/types/components/search-key/index.d.ts +++ b/packages/crud/types/components/search-key/index.d.ts @@ -15,7 +15,7 @@ declare const _default: import("vue").DefineComponent<{ onSearch: FunctionConstructor; placeholder: StringConstructor; width: { - type: (StringConstructor | NumberConstructor)[]; + type: (NumberConstructor | StringConstructor)[]; default: number; }; }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue" | "field-change")[], "change" | "update:modelValue" | "field-change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly> & { diff --git a/src/modules/demo/components/form-btn.vue b/src/modules/demo/components/form-btn.vue index 39a5e14..4f1556a 100644 --- a/src/modules/demo/components/form-btn.vue +++ b/src/modules/demo/components/form-btn.vue @@ -129,6 +129,9 @@ function open() { } } ], + op: { + // buttons: ["save"] + }, on: { open() { refs.name.focus(); diff --git a/src/modules/dict/types/index.d.ts b/src/modules/dict/types/index.d.ts index 8434f0f..272f608 100644 --- a/src/modules/dict/types/index.d.ts +++ b/src/modules/dict/types/index.d.ts @@ -1,12 +1,13 @@ export namespace Dict { - type List = { + interface Item { id: string; label: string; value: any; + children?: Item[]; [key: string]: any; - }[]; + } interface Data { - [key: string]: List; + [key: string]: Item[]; } } diff --git a/yarn.lock b/yarn.lock index 833ad4f..38e0207 100644 --- a/yarn.lock +++ b/yarn.lock @@ -282,10 +282,10 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" -"@cool-vue/crud@^7.0.1-beta2": - version "7.0.1-beta2" - resolved "https://registry.yarnpkg.com/@cool-vue/crud/-/crud-7.0.1-beta2.tgz#1c43ad0d5af3fe009bfcfa312c71d8b99a676213" - integrity sha512-CN9hlfsWKOU/qf7E1COjgLqEqJBOd3v8v8bHeivFt7BHdDmwxrgqGZWXvZ6zp4LXSBq7dacF7dqn1FOe7TYzCQ== +"@cool-vue/crud@^7.0.1-beta3": + version "7.0.1-beta3" + resolved "https://registry.yarnpkg.com/@cool-vue/crud/-/crud-7.0.1-beta3.tgz#70d116bc81fcb665a8abfe7adee6d3951fdd318b" + integrity sha512-/vKd3WRdtwx6kD6H5YAqJt0bWPRdGhCElkx/i7QqUOszBKvpWVSeEvb+8NdVLG3w9s+xgz83+kTNJcq1L6PenQ== dependencies: array.prototype.flat "^1.2.4" core-js "^3.21.1"