diff --git a/apps/web-ele/package.json b/apps/web-ele/package.json index c0ca03d4..750d7010 100644 --- a/apps/web-ele/package.json +++ b/apps/web-ele/package.json @@ -1,6 +1,6 @@ { "name": "@vben/web-ele", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/apps/web-naive/package.json b/apps/web-naive/package.json index 673d8299..7a223bc7 100644 --- a/apps/web-naive/package.json +++ b/apps/web-naive/package.json @@ -1,6 +1,6 @@ { "name": "@vben/web-naive", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/docs/package.json b/docs/package.json index fd830559..edf71519 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@vben/docs", - "version": "5.4.6", + "version": "5.4.7", "private": true, "scripts": { "build": "vitepress build", diff --git a/docs/src/en/guide/introduction/vben.md b/docs/src/en/guide/introduction/vben.md index caed4d3b..8a2ba1cc 100644 --- a/docs/src/en/guide/introduction/vben.md +++ b/docs/src/en/guide/introduction/vben.md @@ -18,7 +18,7 @@ - **Permission Validation**: Comprehensive permission validation solutions, including button-level permission control. - **Multi-Theme**: Built-in multiple theme configurations & dark mode to meet personalized needs. - **Dynamic Menu**: Supports dynamic menus that can display based on permissions. -- **Mock Data**: High-performance local Mock data solution based on Nitro. +- **Mock Data**: High-performance local Mock data solution based on `Nitro`. - **Rich Components**: Provides a wide range of components to meet most business needs. - **Standardization**: Code quality is ensured with tools like `ESLint`, `Prettier`, `Stylelint`, `Publint`, and `CSpell`. - **Engineering**: Development efficiency is improved with tools like `Pnpm Monorepo`, `TurboRepo`, and `Changeset`. @@ -26,9 +26,9 @@ ## Browser Support -**Local development** is recommended using the **latest version of Chrome**. **Versions below Chrome 80 are not supported**. +- **Local development** is recommended using the **latest version of Chrome**. **Versions below Chrome 80 are not supported**. -**Production environment** supports modern browsers, IE is not supported. +- **Production environment** supports modern browsers, IE is not supported. | [](http://godban.github.io/browsers-support-badges/)IE | [](http://godban.github.io/browsers-support-badges/)Edge | [](http://godban.github.io/browsers-support-badges/)Firefox | [](http://godban.github.io/browsers-support-badges/)Chrome | [](http://godban.github.io/browsers-support-badges/)Safari | | :-: | :-: | :-: | :-: | :-: | @@ -37,12 +37,10 @@ ## Contribution - [Vben Admin](https://github.com/vbenjs/vue-vben-admin) is still being actively updated. Contributions are welcome to help maintain and improve the project, aiming to create a better mid- to backend solution. -- If you wish to join us, you can provide suggestions or submit pull requests. We will invite you to join based on your activity. +- If you wish to join us, you can start by contributing in the following ways, and we will invite you to join based on your activity. ::: info Join Us -If you wish to join us, you can start by contributing in the following ways, and we will invite you to join based on your activity: - - Regularly submit `PRs`. - Provide valuable suggestions. - Participate in discussions and help resolve some `issues`. diff --git a/docs/src/guide/introduction/vben.md b/docs/src/guide/introduction/vben.md index 90dae052..a4a5f975 100644 --- a/docs/src/guide/introduction/vben.md +++ b/docs/src/guide/introduction/vben.md @@ -18,7 +18,7 @@ - **权限验证**:完善的权限验证方案,按钮级别权限控制。 - **多主题**:内置多种主题配置和黑暗模式,满足个性化需求。 - **动态菜单**:支持动态菜单,可以根据权限配置显示菜单。 -- **Mock 数据**:基于 Nitro 的本地高性能 Mock 数据方案。 +- **Mock 数据**:基于 `Nitro` 的本地高性能 Mock 数据方案。 - **组件丰富**:提供了丰富的组件,可以满足大部分的业务需求。 - **规范**:代码规范,使用 `ESLint`、`Prettier`、`Stylelint`、`Publint`、`CSpell` 等工具保证代码质量。 - **工程化**:使用 `Pnpm Monorepo`、`TurboRepo`、`Changeset` 等工具,提高开发效率。 @@ -26,9 +26,9 @@ ## 浏览器支持 -**本地开发**推荐使用`Chrome 最新版`浏览器,**不支持**`Chrome 80`以下版本。 +- **本地开发**推荐使用`Chrome 最新版`浏览器,**不支持**`Chrome 80`以下版本。 -**生产环境**支持现代浏览器,不支持 IE。 +- **生产环境**支持现代浏览器,不支持 IE。 | [](http://godban.github.io/browsers-support-badges/)IE | [](http://godban.github.io/browsers-support-badges/)Edge | [](http://godban.github.io/browsers-support-badges/)Firefox | [](http://godban.github.io/browsers-support-badges/)Chrome | [](http://godban.github.io/browsers-support-badges/)Safari | | :-: | :-: | :-: | :-: | :-: | @@ -37,13 +37,13 @@ ## 贡献 - [Vben Admin](https://github.com/vbenjs/vue-vben-admin) 还在持续更新中,本项目欢迎您的参与,共同维护,逐步完善,打造更好的中后台解决方案。 -- 如果你想加入我们,可以提供有价值的建议或者参与讨论,协助解决 issue,- 如果你想加入我们,可以提供有价值的建议或者参与讨论,协助解决 issue,我们会根据你的活跃度邀请你加入。。 +- 如果你有兴趣加入我们,可以通过以下方式开始,我们会根据你的活跃度邀请你加入。 ::: info 加入我们 - 长期提交 `PR`。 -- 提供一些好的建议。 -- 参与讨论,帮助解决一些 `issue`。 +- 提供有价值的建议。 +- 参与讨论,帮助解决 `issue`。 - 共同维护文档。 ::: diff --git a/internal/lint-configs/commitlint-config/package.json b/internal/lint-configs/commitlint-config/package.json index cc3122cb..4bc45269 100644 --- a/internal/lint-configs/commitlint-config/package.json +++ b/internal/lint-configs/commitlint-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/commitlint-config", - "version": "5.4.6", + "version": "5.4.7", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/lint-configs/eslint-config/src/configs/unicorn.ts b/internal/lint-configs/eslint-config/src/configs/unicorn.ts index 3ce6f81c..21b19025 100644 --- a/internal/lint-configs/eslint-config/src/configs/unicorn.ts +++ b/internal/lint-configs/eslint-config/src/configs/unicorn.ts @@ -18,6 +18,7 @@ export async function unicorn(): Promise { 'unicorn/better-regex': 'off', 'unicorn/consistent-destructuring': 'off', 'unicorn/consistent-function-scoping': 'off', + 'unicorn/expiring-todo-comments': 'off', 'unicorn/filename-case': 'off', 'unicorn/import-style': 'off', 'unicorn/no-array-for-each': 'off', diff --git a/internal/lint-configs/stylelint-config/package.json b/internal/lint-configs/stylelint-config/package.json index c5dc2d76..e9b9b00e 100644 --- a/internal/lint-configs/stylelint-config/package.json +++ b/internal/lint-configs/stylelint-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/stylelint-config", - "version": "5.4.6", + "version": "5.4.7", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/node-utils/package.json b/internal/node-utils/package.json index f82ce615..73282472 100644 --- a/internal/node-utils/package.json +++ b/internal/node-utils/package.json @@ -1,6 +1,6 @@ { "name": "@vben/node-utils", - "version": "5.4.6", + "version": "5.4.7", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/tailwind-config/package.json b/internal/tailwind-config/package.json index 06360aef..872a9dc4 100644 --- a/internal/tailwind-config/package.json +++ b/internal/tailwind-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/tailwind-config", - "version": "5.4.6", + "version": "5.4.7", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/tsconfig/package.json b/internal/tsconfig/package.json index 910d9c99..8389872a 100644 --- a/internal/tsconfig/package.json +++ b/internal/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "@vben/tsconfig", - "version": "5.4.6", + "version": "5.4.7", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/internal/vite-config/package.json b/internal/vite-config/package.json index b333989c..a247e6ec 100644 --- a/internal/vite-config/package.json +++ b/internal/vite-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/vite-config", - "version": "5.4.6", + "version": "5.4.7", "private": true, "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", diff --git a/package.json b/package.json index 302a7bfe..f35abe72 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vben-admin-monorepo", - "version": "5.4.6", + "version": "5.4.7", "private": true, "keywords": [ "monorepo", @@ -99,7 +99,7 @@ "node": ">=20.10.0", "pnpm": ">=9.12.0" }, - "packageManager": "pnpm@9.13.0", + "packageManager": "pnpm@9.13.2", "pnpm": { "peerDependencyRules": { "allowedVersions": { diff --git a/packages/@core/base/design/package.json b/packages/@core/base/design/package.json index 34a4e4ce..cb39f1e6 100644 --- a/packages/@core/base/design/package.json +++ b/packages/@core/base/design/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/design", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/base/icons/package.json b/packages/@core/base/icons/package.json index 77c958c4..c3cdb2d2 100644 --- a/packages/@core/base/icons/package.json +++ b/packages/@core/base/icons/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/icons", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/base/shared/package.json b/packages/@core/base/shared/package.json index 896f7c99..736b08c2 100644 --- a/packages/@core/base/shared/package.json +++ b/packages/@core/base/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/shared", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/base/typings/package.json b/packages/@core/base/typings/package.json index 39aff089..148a2a3f 100644 --- a/packages/@core/base/typings/package.json +++ b/packages/@core/base/typings/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/typings", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/composables/package.json b/packages/@core/composables/package.json index 6fc074e5..56f97cd7 100644 --- a/packages/@core/composables/package.json +++ b/packages/@core/composables/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/composables", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/preferences/package.json b/packages/@core/preferences/package.json index 791dcd7a..644c341a 100644 --- a/packages/@core/preferences/package.json +++ b/packages/@core/preferences/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/preferences", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/ui-kit/form-ui/package.json b/packages/@core/ui-kit/form-ui/package.json index 92c952f3..cd51fca5 100644 --- a/packages/@core/ui-kit/form-ui/package.json +++ b/packages/@core/ui-kit/form-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/form-ui", - "version": "5.2.1", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/ui-kit/form-ui/src/components/form-actions.vue b/packages/@core/ui-kit/form-ui/src/components/form-actions.vue index 40596609..26e426fe 100644 --- a/packages/@core/ui-kit/form-ui/src/components/form-actions.vue +++ b/packages/@core/ui-kit/form-ui/src/components/form-actions.vue @@ -91,18 +91,9 @@ function handleRangeTimeValue(values: Record) { fieldMappingTime.forEach( ([field, [startTimeKey, endTimeKey], format = 'YYYY-MM-DD']) => { - /** - * 时间字段为空 但是映射的start/end不为空 说明已经清理了组件的时间(组件右边的x) - * 需要删除对应的start/end字段 否则会被保留 - */ - if ( - values[field] === null && - values[startTimeKey] && - values[endTimeKey] - ) { + if (startTimeKey && endTimeKey && values[field] === null) { delete values[startTimeKey]; delete values[endTimeKey]; - return; } if (!values[field]) { diff --git a/packages/@core/ui-kit/form-ui/src/form-api.ts b/packages/@core/ui-kit/form-ui/src/form-api.ts index ebd2f736..07de5d75 100644 --- a/packages/@core/ui-kit/form-ui/src/form-api.ts +++ b/packages/@core/ui-kit/form-ui/src/form-api.ts @@ -13,13 +13,13 @@ import { toRaw } from 'vue'; import { Store } from '@vben-core/shared/store'; import { bindMethods, + createMerge, isFunction, + isObject, mergeWithArrayOverride, StateHandler, } from '@vben-core/shared/utils'; -import { objectPick } from '@vueuse/core'; - function getDefaultState(): VbenFormProps { return { actionWrapperClass: '', @@ -250,8 +250,17 @@ export class FormApi { form.setValues(fields, shouldValidate); return; } - const fieldNames = this.state?.schema?.map((item) => item.fieldName) ?? []; - const filteredFields = objectPick(fields, fieldNames); + + const fieldMergeFn = createMerge((obj, key, value) => { + if (key in obj) { + obj[key] = + !Array.isArray(obj[key]) && isObject(obj[key]) + ? fieldMergeFn(obj[key], value) + : value; + } + return true; + }); + const filteredFields = fieldMergeFn(fields, form.values); form.setValues(filteredFields, shouldValidate); } diff --git a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue index bd3acaeb..e9ee8f87 100644 --- a/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue +++ b/packages/@core/ui-kit/form-ui/src/form-render/form-field.vue @@ -209,8 +209,9 @@ function fieldBindEvent(slotProps: Record) { if (modelValue && isObject(modelValue) && bindEventField) { value = isEventObjectLike(modelValue) ? modelValue?.target?.[bindEventField] - : modelValue; + : (modelValue?.[bindEventField] ?? modelValue); } + if (bindEventField) { return { [`onUpdate:${bindEventField}`]: handler, @@ -223,6 +224,7 @@ function fieldBindEvent(slotProps: Record) { if (!shouldUnwrap) { return onChange?.(e); } + return onChange?.(e?.target?.[bindEventField] ?? e); }, onInput: () => {}, diff --git a/packages/@core/ui-kit/layout-ui/package.json b/packages/@core/ui-kit/layout-ui/package.json index 90758aef..9390444d 100644 --- a/packages/@core/ui-kit/layout-ui/package.json +++ b/packages/@core/ui-kit/layout-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/layout-ui", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/ui-kit/menu-ui/package.json b/packages/@core/ui-kit/menu-ui/package.json index 68616ee4..c7632166 100644 --- a/packages/@core/ui-kit/menu-ui/package.json +++ b/packages/@core/ui-kit/menu-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/menu-ui", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/@core/ui-kit/shadcn-ui/package.json b/packages/@core/ui-kit/shadcn-ui/package.json index 87f2753b..330378c6 100644 --- a/packages/@core/ui-kit/shadcn-ui/package.json +++ b/packages/@core/ui-kit/shadcn-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/shadcn-ui", - "version": "5.4.6", + "version": "5.4.7", "#main": "./dist/index.mjs", "#module": "./dist/index.mjs", "homepage": "https://github.com/vbenjs/vue-vben-admin", diff --git a/packages/@core/ui-kit/shadcn-ui/src/ui/dialog/DialogContent.vue b/packages/@core/ui-kit/shadcn-ui/src/ui/dialog/DialogContent.vue index 367795c3..2e374683 100644 --- a/packages/@core/ui-kit/shadcn-ui/src/ui/dialog/DialogContent.vue +++ b/packages/@core/ui-kit/shadcn-ui/src/ui/dialog/DialogContent.vue @@ -48,11 +48,14 @@ const delegatedProps = computed(() => { const forwarded = useForwardPropsEmits(delegatedProps, emits); const contentRef = ref | null>(null); -function onAnimationEnd() { - if (props.open) { - emits('opened'); - } else { - emits('closed'); +function onAnimationEnd(event: AnimationEvent) { + // 只有在 contentRef 的动画结束时才触发 opened/closed 事件 + if (event.target === contentRef.value?.$el) { + if (props.open) { + emits('opened'); + } else { + emits('closed'); + } } } defineExpose({ diff --git a/packages/@core/ui-kit/tabs-ui/package.json b/packages/@core/ui-kit/tabs-ui/package.json index 5c9de91e..a16e65f9 100644 --- a/packages/@core/ui-kit/tabs-ui/package.json +++ b/packages/@core/ui-kit/tabs-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/tabs-ui", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/constants/package.json b/packages/constants/package.json index 4983975e..92a87725 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -1,6 +1,6 @@ { "name": "@vben/constants", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/access/package.json b/packages/effects/access/package.json index 2c53c3b3..b3e75140 100644 --- a/packages/effects/access/package.json +++ b/packages/effects/access/package.json @@ -1,6 +1,6 @@ { "name": "@vben/access", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/common-ui/package.json b/packages/effects/common-ui/package.json index 0891dbee..03d8a99c 100644 --- a/packages/effects/common-ui/package.json +++ b/packages/effects/common-ui/package.json @@ -1,6 +1,6 @@ { "name": "@vben/common-ui", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/common-ui/src/components/icon-picker/icon-picker.vue b/packages/effects/common-ui/src/components/icon-picker/icon-picker.vue index ed3493d0..131eb8ea 100644 --- a/packages/effects/common-ui/src/components/icon-picker/icon-picker.vue +++ b/packages/effects/common-ui/src/components/icon-picker/icon-picker.vue @@ -41,6 +41,7 @@ const emit = defineEmits<{ const refTrigger = useTemplateRef('refTrigger'); const currentSelect = ref(''); const currentList = ref(props.icons); +const currentPage = ref(1); watch( () => props.icons, @@ -72,6 +73,7 @@ const handleClick = (icon: string) => { }; const handlePageChange = (page: number) => { + currentPage.value = page; setCurrentPage(page); }; @@ -114,7 +116,6 @@ defineExpose({ changeOpenState }); class="flex-center flex justify-end overflow-hidden border-t py-2 pr-3" > {{ item.value }} diff --git a/packages/effects/hooks/package.json b/packages/effects/hooks/package.json index a59f6925..8dcf66ab 100644 --- a/packages/effects/hooks/package.json +++ b/packages/effects/hooks/package.json @@ -1,6 +1,6 @@ { "name": "@vben/hooks", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/hooks/src/use-watermark.ts b/packages/effects/hooks/src/use-watermark.ts index 765cdfb5..c3f56eaf 100644 --- a/packages/effects/hooks/src/use-watermark.ts +++ b/packages/effects/hooks/src/use-watermark.ts @@ -1,8 +1,11 @@ import type { Watermark, WatermarkOptions } from 'watermark-js-plus'; -import { nextTick, onUnmounted, ref } from 'vue'; +import { nextTick, onUnmounted, readonly, ref } from 'vue'; + +import { updatePreferences } from '@vben/preferences'; const watermark = ref(); +const unmountedHooked = ref(false); const cachedOptions = ref>({ advancedStyle: { colorStops: [ @@ -45,7 +48,7 @@ export function useWatermark() { ...options, }; watermark.value = new Watermark(cachedOptions.value); - + updatePreferences({ app: { watermark: true } }); await watermark.value?.create(); } @@ -62,16 +65,24 @@ export function useWatermark() { } function destroyWatermark() { - watermark.value?.destroy(); + if (watermark.value) { + watermark.value.destroy(); + watermark.value = undefined; + } + updatePreferences({ app: { watermark: false } }); } - onUnmounted(() => { - destroyWatermark(); - }); + // 只在第一次调用时注册卸载钩子,防止重复注册以致于在路由切换时销毁了水印 + if (!unmountedHooked.value) { + unmountedHooked.value = true; + onUnmounted(() => { + destroyWatermark(); + }); + } return { destroyWatermark, updateWatermark, - watermark, + watermark: readonly(watermark), }; } diff --git a/packages/effects/layouts/package.json b/packages/effects/layouts/package.json index bff30405..139ef74b 100644 --- a/packages/effects/layouts/package.json +++ b/packages/effects/layouts/package.json @@ -1,6 +1,6 @@ { "name": "@vben/layouts", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/plugins/package.json b/packages/effects/plugins/package.json index ec79eee5..81eb3147 100644 --- a/packages/effects/plugins/package.json +++ b/packages/effects/plugins/package.json @@ -1,6 +1,6 @@ { "name": "@vben/plugins", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/effects/request/package.json b/packages/effects/request/package.json index fddc4e81..67f41d3e 100644 --- a/packages/effects/request/package.json +++ b/packages/effects/request/package.json @@ -1,6 +1,6 @@ { "name": "@vben/request", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/icons/package.json b/packages/icons/package.json index 38f9af36..f74d41e2 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -1,6 +1,6 @@ { "name": "@vben/icons", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/locales/package.json b/packages/locales/package.json index 22620fcd..2a1a8354 100644 --- a/packages/locales/package.json +++ b/packages/locales/package.json @@ -1,6 +1,6 @@ { "name": "@vben/locales", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/preferences/package.json b/packages/preferences/package.json index e9b019f1..295a9413 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -1,6 +1,6 @@ { "name": "@vben/preferences", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/stores/package.json b/packages/stores/package.json index fb7df48b..fcf934d7 100644 --- a/packages/stores/package.json +++ b/packages/stores/package.json @@ -1,6 +1,6 @@ { "name": "@vben/stores", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/styles/package.json b/packages/styles/package.json index 2ea2e0af..78d33627 100644 --- a/packages/styles/package.json +++ b/packages/styles/package.json @@ -1,6 +1,6 @@ { "name": "@vben/styles", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/types/package.json b/packages/types/package.json index cd997707..031d64bb 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@vben/types", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/packages/utils/package.json b/packages/utils/package.json index a7f08e21..31bed123 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@vben/utils", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://github.com/vbenjs/vue-vben-admin", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/playground/package.json b/playground/package.json index d0d80583..3a602ea0 100644 --- a/playground/package.json +++ b/playground/package.json @@ -1,6 +1,6 @@ { "name": "@vben/playground", - "version": "5.4.6", + "version": "5.4.7", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/playground/src/views/demos/features/watermark/index.vue b/playground/src/views/demos/features/watermark/index.vue index 9f819e51..77b3f179 100644 --- a/playground/src/views/demos/features/watermark/index.vue +++ b/playground/src/views/demos/features/watermark/index.vue @@ -4,7 +4,12 @@ import { useWatermark } from '@vben/hooks'; import { Button, Card } from 'ant-design-vue'; -const { destroyWatermark, updateWatermark } = useWatermark(); +const { destroyWatermark, updateWatermark, watermark } = useWatermark(); + +async function recreateWaterMark() { + destroyWatermark(); + await updateWatermark({}); +} async function createWaterMark() { await updateWatermark({ @@ -21,7 +26,7 @@ async function createWaterMark() { ], type: 'linear', }, - content: 'hello my watermark', + content: `hello my watermark\n${new Date().toLocaleString()}`, globalAlpha: 0.5, gridLayoutOptions: { cols: 2, @@ -57,10 +62,25 @@ async function createWaterMark() { - + 创建水印 - 移除水印 + + 更新水印 + + + 移除水印 + diff --git a/playground/src/views/examples/resize/basic.vue b/playground/src/views/examples/resize/basic.vue index a8fcd0dc..6295839a 100644 --- a/playground/src/views/examples/resize/basic.vue +++ b/playground/src/views/examples/resize/basic.vue @@ -3,42 +3,56 @@ import { ref } from 'vue'; import { Page, VResize } from '@vben/common-ui'; -const width = ref(200); -const height = ref(200); -const top = ref(200); -const left = ref(200); +const colorMap = ['red', 'green', 'yellow', 'gray']; -const resize = (newRect: { +type TSize = { height: number; left: number; top: number; width: number; -}) => { - width.value = newRect.width; - height.value = newRect.height; - top.value = newRect.top; - left.value = newRect.left; +}; + +const sizeList = ref([ + { height: 200, left: 200, top: 200, width: 200 }, + { height: 300, left: 300, top: 300, width: 300 }, + { height: 400, left: 400, top: 400, width: 400 }, + { height: 500, left: 500, top: 500, width: 500 }, +]); + +const resize = (size?: TSize, rect?: TSize) => { + if (!size || !rect) return; + + size.height = rect.height; + size.left = rect.left; + size.top = rect.top; + size.width = rect.width; }; - {{ - `width: ${width}px, height: ${height}px, top: ${top}px, left: ${left}px` - }} + + {{ + `width: ${size.width}px, height: ${size.height}px, top: ${size.top}px, left: ${size.left}px` + }} + - - - + + resize(sizeList[idx], rect)" + @resizing="(rect) => resize(sizeList[idx], rect)" + > + + + diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 95d9b1d1..b62260e8 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -17,17 +17,17 @@ catalog: '@changesets/changelog-github': ^0.5.0 '@changesets/cli': ^2.27.9 '@changesets/git': ^3.0.1 - '@clack/prompts': ^0.7.0 + '@clack/prompts': ^0.8.1 '@commitlint/cli': ^19.5.0 '@commitlint/config-conventional': ^19.5.0 '@ctrl/tinycolor': ^4.1.0 - '@eslint/js': ^9.14.0 + '@eslint/js': ^9.15.0 '@faker-js/faker': ^9.2.0 - '@iconify/json': ^2.2.271 + '@iconify/json': ^2.2.273 '@iconify/tailwind': ^1.1.3 '@iconify/vue': ^4.1.2 '@intlify/core-base': ^10.0.4 - '@intlify/unplugin-vue-i18n': ^5.3.1 + '@intlify/unplugin-vue-i18n': ^6.0.0 '@jspm/generator': ^2.4.1 '@manypkg/get-packages': ^2.2.2 '@nolebase/vitepress-plugin-git-changelog': ^2.9.0 @@ -36,7 +36,7 @@ catalog: '@stylistic/stylelint-plugin': ^3.1.1 '@tailwindcss/nesting': 0.0.0-insiders.565cd3e '@tailwindcss/typography': ^0.5.15 - '@tanstack/vue-query': ^5.59.20 + '@tanstack/vue-query': ^5.60.5 '@tanstack/vue-store': ^0.5.7 '@types/archiver': ^6.0.3 '@types/eslint': ^9.6.1 @@ -55,8 +55,8 @@ catalog: '@vite-pwa/vitepress': ^0.5.3 '@vitejs/plugin-vue': ^5.2.0 '@vitejs/plugin-vue-jsx': ^4.1.0 - '@vue/reactivity': ^3.5.12 - '@vue/shared': ^3.5.12 + '@vue/reactivity': ^3.5.13 + '@vue/shared': ^3.5.13 '@vue/test-utils': ^2.4.6 '@vueuse/core': ^11.2.0 '@vueuse/integrations': ^11.2.0 @@ -83,19 +83,19 @@ catalog: depcheck: ^1.4.7 dotenv: ^16.4.5 echarts: ^5.5.1 - element-plus: ^2.8.7 - eslint: ^9.14.0 - eslint-config-turbo: ^2.2.3 + element-plus: ^2.8.8 + eslint: ^9.15.0 + eslint-config-turbo: ^2.3.0 eslint-plugin-command: ^0.2.6 eslint-plugin-eslint-comments: ^3.2.0 eslint-plugin-import-x: ^4.4.2 eslint-plugin-jsdoc: ^50.5.0 eslint-plugin-jsonc: ^2.18.1 - eslint-plugin-n: ^17.13.1 + eslint-plugin-n: ^17.13.2 eslint-plugin-no-only-tests: ^3.3.0 eslint-plugin-perfectionist: ^3.9.1 eslint-plugin-prettier: ^5.2.1 - eslint-plugin-regexp: ^2.6.0 + eslint-plugin-regexp: ^2.7.0 eslint-plugin-unicorn: ^56.0.0 eslint-plugin-unused-imports: ^4.1.4 eslint-plugin-vitest: ^0.5.4 @@ -105,7 +105,7 @@ catalog: get-port: ^7.1.0 globals: ^15.12.0 h3: ^1.13.0 - happy-dom: ^15.11.4 + happy-dom: ^15.11.6 html-minifier-terser: ^7.2.0 husky: ^9.1.6 is-ci: ^3.0.1 @@ -114,7 +114,7 @@ catalog: lint-staged: ^15.2.10 lodash.clonedeep: ^4.5.0 lodash.get: ^4.4.2 - lucide-vue-next: ^0.456.0 + lucide-vue-next: ^0.460.0 medium-zoom: ^1.1.0 naive-ui: ^2.40.1 nitropack: ^2.10.4 @@ -137,7 +137,7 @@ catalog: radix-vue: ^1.9.9 resolve.exports: ^2.0.2 rimraf: ^6.0.1 - rollup: ^4.26.0 + rollup: ^4.27.2 rollup-plugin-visualizer: ^5.12.0 sass: 1.80.6 sortablejs: ^1.15.3 @@ -151,10 +151,10 @@ catalog: stylelint-prettier: ^5.0.2 stylelint-scss: ^6.9.0 tailwind-merge: ^2.5.4 - tailwindcss: ^3.4.14 + tailwindcss: ^3.4.15 tailwindcss-animate: ^1.0.7 theme-colors: ^0.1.0 - turbo: ^2.2.3 + turbo: ^2.3.0 typescript: ^5.6.3 unbuild: ^3.0.0-rc.11 unplugin-element-plus: ^0.8.0 @@ -168,13 +168,13 @@ catalog: vite-plugin-vue-devtools: ^7.6.4 vitepress: ^1.5.0 vitepress-plugin-group-icons: ^1.3.0 - vitest: ^2.1.4 - vue: ^3.5.12 + vitest: ^2.1.5 + vue: ^3.5.13 vue-eslint-parser: ^9.4.3 vue-i18n: ^10.0.4 vue-router: ^4.4.5 vue-tsc: ^2.1.10 - vxe-pc-ui: ^4.2.53 + vxe-pc-ui: ^4.2.55 vxe-table: ^4.8.14 watermark-js-plus: ^1.5.7 zod: ^3.23.8 diff --git a/scripts/turbo-run/package.json b/scripts/turbo-run/package.json index 4a67fce2..e4311f21 100644 --- a/scripts/turbo-run/package.json +++ b/scripts/turbo-run/package.json @@ -1,6 +1,6 @@ { "name": "@vben/turbo-run", - "version": "5.4.6", + "version": "5.4.7", "private": true, "license": "MIT", "type": "module", diff --git a/scripts/vsh/package.json b/scripts/vsh/package.json index 60433c10..fa48fd5e 100644 --- a/scripts/vsh/package.json +++ b/scripts/vsh/package.json @@ -1,6 +1,6 @@ { "name": "@vben/vsh", - "version": "5.4.6", + "version": "5.4.7", "private": true, "license": "MIT", "type": "module",