diff --git a/.gitpod.yml b/.gitpod.yml index fb75b433..5fda2cf7 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -2,5 +2,5 @@ ports: - port: 5555 onOpen: open-preview tasks: - - init: corepack enable && pnpm install + - init: npm i -g corepack && pnpm install command: pnpm run dev:play diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs index 94b0192a..2a5a5a1a 100644 --- a/.lintstagedrc.mjs +++ b/.lintstagedrc.mjs @@ -15,6 +15,6 @@ export default { ], 'package.json': ['prettier --cache --write'], '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': [ - 'prettier --cache --write--parser json', + 'prettier --cache --write --parser json', ], }; diff --git a/.node-version b/.node-version index 48b14e6b..ee5c2446 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -20.14.0 +22.1.0 diff --git a/.vscode/settings.json b/.vscode/settings.json index bb2590be..82f3257a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,7 +14,7 @@ "editor.tabSize": 2, "editor.detectIndentation": false, "editor.cursorBlinking": "expand", - "editor.largeFileOptimizations": false, + "editor.largeFileOptimizations": true, "editor.accessibilitySupport": "off", "editor.cursorSmoothCaretAnimation": "on", "editor.guides.bracketPairs": "active", @@ -91,6 +91,7 @@ "**/bower_components": true, "**/.turbo": true, "**/.idea": true, + "**/.vitepress": true, "**/tmp": true, "**/.git": true, "**/.svn": true, @@ -113,6 +114,8 @@ "**/yarn.lock": true }, + "typescript.tsserver.exclude": ["**/node_modules", "**/dist", "**/.turbo"], + // search "search.searchEditor.singleClickBehaviour": "peekDefinition", "search.followSymlinks": false, diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d273a42..cfce1740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# 1.3.3 + +**BUG FIX** + +- 工作流list展示在开启缩放会有误差导致触底逻辑不会触发 + +**OTHER** + +- 代码生成预览对模板的提示...(下载都懒得点一下吗) + # 1.3.2 **REFACTOR** diff --git a/README.ja-JP.md b/README.ja-JP.md index baa4cc44..f7847a1d 100644 --- a/README.ja-JP.md +++ b/README.ja-JP.md @@ -1,8 +1,13 @@ -
VbenAdmin Logo

+
+ + VbenAdmin Logo + +
+
[![license](https://img.shields.io/github/license/anncwb/vue-vben-admin.svg)](LICENSE) -

Vue Vben Admin

+

Vue Vben Admin

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vbenjs_vue-vben-admin&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vbenjs_vue-vben-admin) ![codeql](https://github.com/vbenjs/vue-vben-admin/actions/workflows/codeql.yml/badge.svg) ![build](https://github.com/vbenjs/vue-vben-admin/actions/workflows/build.yml/badge.svg) ![ci](https://github.com/vbenjs/vue-vben-admin/actions/workflows/ci.yml/badge.svg) ![deploy](https://github.com/vbenjs/vue-vben-admin/actions/workflows/deploy.yml/badge.svg) @@ -15,27 +20,27 @@ Vue Vben Adminは、最新の`vue3`、`vite`、`TypeScript`などの主流技術 ## アップグレード通知 -これは最新バージョン5.0であり、以前のバージョンとは互換性がありません。新しいプロジェクトを開始する場合は、最新バージョンを使用することをお勧めします。古いバージョンを表示したい場合は、[v2ブランチ](https://github.com/vbenjs/vue-vben-admin/tree/v2)を使用してください。 +これは最新バージョン `5.0` であり、以前のバージョンとは互換性がありません。新しいプロジェクトを開始する場合は、最新バージョンを使用することをお勧めします。古いバージョンを表示したい場合は、[v2ブランチ](https://github.com/vbenjs/vue-vben-admin/tree/v2)を使用してください。 ## 特徴 -- **最新技術スタック**: Vue 3やViteなどの最先端フロントエンド技術で開発 -- **TypeScript**: アプリケーション規模のJavaScriptのための言語 -- **テーマ**: 複数のテーマカラーが利用可能で、カスタマイズオプションも豊富 -- **国際化**: 完全な内蔵国際化サポート -- **権限管理**: 動的ルートベースの権限生成ソリューションを内蔵 +- **最新技術スタック**:Vue 3やViteなどの最先端フロントエンド技術で開発 +- **TypeScript**:アプリケーション規模のJavaScriptのための言語 +- **テーマ**:複数のテーマカラーが利用可能で、カスタマイズオプションも豊富 +- **国際化**:完全な内蔵国際化サポート +- **権限管理**:動的ルートベースの権限生成ソリューションを内蔵 ## プレビュー - [Vben Admin](https://vben.pro/) - フルバージョンの中国語サイト -テストアカウント: vben/123456 +テストアカウント:vben/123456 -

- VbenAdmin Logo - VbenAdmin Logo - VbenAdmin Logo -

+
+ VbenAdmin Logo + VbenAdmin Logo + VbenAdmin Logo +
### Gitpodを使用 @@ -49,30 +54,27 @@ Gitpod(GitHub用の無料オンライン開発環境)でプロジェクト ## インストールと使用 -- プロジェクトコードを取得 +1. プロジェクトコードを取得 ```bash git clone https://github.com/vbenjs/vue-vben-admin.git ``` -- 依存関係のインストール +2. 依存関係のインストール ```bash cd vue-vben-admin - -corepack enable - +npm i -g corepack pnpm install - ``` -- 実行 +3. 実行 ```bash pnpm dev ``` -- ビルド +4. ビルド ```bash pnpm build @@ -86,40 +88,39 @@ pnpm build ご参加をお待ちしております![Issueを提出](https://github.com/anncwb/vue-vben-admin/issues/new/choose)するか、Pull Requestを送信してください。 -**Pull Request:** +**Pull Request プロセス:** -1. コードをフォーク! -2. 自分のブランチを作成: `git checkout -b feat/xxxx` -3. 変更をコミット: `git commit -am 'feat(function): add xxxxx'` -4. ブランチをプッシュ: `git push origin feat/xxxx` +1. コードをフォーク +2. 自分のブランチを作成:`git checkout -b feat/xxxx` +3. 変更をコミット:`git commit -am 'feat(function): add xxxxx'` +4. ブランチをプッシュ:`git push origin feat/xxxx` 5. `pull request`を送信 ## Git貢献提出規則 -- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 規則 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) +参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 規則 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) - - `feat` 新機能の追加 - - `fix` 問題/バグの修正 - - `style` コードスタイルに関連し、実行結果に影響しない - - `perf` 最適化/パフォーマンス向上 - - `refactor` リファクタリング - - `revert` 変更の取り消し - - `test` テスト関連 - - `docs` ドキュメント/注釈 - - `chore` 依存関係の更新/スキャフォールディング設定の変更など - - `ci` 継続的インテグレーション - - `types` 型定義ファイルの変更 - - `wip` 開発中 +- `feat` 新機能の追加 +- `fix` 問題/バグの修正 +- `style` コードスタイルに関連し、実行結果に影響しない +- `perf` 最適化/パフォーマンス向上 +- `refactor` リファクタリング +- `revert` 変更の取り消し +- `test` テスト関連 +- `docs` ドキュメント/注釈 +- `chore` 依存関係の更新/スキャフォールディング設定の変更など +- `ci` 継続的インテグレーション +- `types` 型定義ファイルの変更 ## ブラウザサポート -ローカル開発には`Chrome 80+`ブラウザを推奨します +ローカル開発には `Chrome 80+` ブラウザを推奨します モダンブラウザをサポートし、IEはサポートしません -| [ Edge](http://godban.github.io/browsers-support-badges/)
IE | [ Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| :-: | :-: | :-: | :-: | :-: | -| サポートしない | 最新2バージョン | 最新2バージョン | 最新2バージョン | 最新2バージョン | +| [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| :-: | :-: | :-: | :-: | +| 最新2バージョン | 最新2バージョン | 最新2バージョン | 最新2バージョン | ## メンテナー @@ -140,8 +141,7 @@ pnpm build ## 貢献者 - Contributors + Contributors ## Discord diff --git a/README.md b/README.md index e84c8392..e027949a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,13 @@ -
VbenAdmin Logo

+
+ + VbenAdmin Logo + +
+
[![license](https://img.shields.io/github/license/anncwb/vue-vben-admin.svg)](LICENSE) -

Vue Vben Admin

+

Vue Vben Admin

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=vbenjs_vue-vben-admin&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=vbenjs_vue-vben-admin) ![codeql](https://github.com/vbenjs/vue-vben-admin/actions/workflows/codeql.yml/badge.svg) ![build](https://github.com/vbenjs/vue-vben-admin/actions/workflows/build.yml/badge.svg) ![ci](https://github.com/vbenjs/vue-vben-admin/actions/workflows/ci.yml/badge.svg) ![deploy](https://github.com/vbenjs/vue-vben-admin/actions/workflows/deploy.yml/badge.svg) @@ -17,7 +22,7 @@ Vue Vben Admin is a free and open source middle and back-end template. Using the This is the latest version, 5.0, and it is not compatible with previous versions. If you are starting a new project, it is recommended to use the latest version. If you wish to view the old version, please use the [v2 branch](https://github.com/vbenjs/vue-vben-admin/tree/v2). -## Feature +## Features - **Latest Technology Stack**: Developed with cutting-edge front-end technologies like Vue 3 and Vite - **TypeScript**: A language for application-scale JavaScript @@ -31,11 +36,11 @@ This is the latest version, 5.0, and it is not compatible with previous versions Test Account: vben/123456 -

- VbenAdmin Logo - VbenAdmin Logo - VbenAdmin Logo -

+
+ VbenAdmin Logo + VbenAdmin Logo + VbenAdmin Logo +
### Use Gitpod @@ -47,31 +52,29 @@ Open the project in Gitpod (free online dev environment for GitHub) and start co [Document](https://doc.vben.pro/) -## Install and use +## Install and Use -- Get the project code +1. Get the project code ```bash git clone https://github.com/vbenjs/vue-vben-admin.git ``` -- Installation dependencies +2. Install dependencies ```bash cd vue-vben-admin - -corepack enable - +npm i -g corepack pnpm install ``` -- run +3. Run ```bash pnpm dev ``` -- build +4. Build ```bash pnpm build @@ -81,44 +84,43 @@ pnpm build [CHANGELOG](https://github.com/vbenjs/vue-vben-admin/releases) -## How to contribute +## How to Contribute -You are very welcome to join![Raise an issue](https://github.com/anncwb/vue-vben-admin/issues/new/choose) Or submit a Pull Request。 +You are very welcome to join! [Raise an issue](https://github.com/anncwb/vue-vben-admin/issues/new/choose) or submit a Pull Request. -**Pull Request:** +**Pull Request Process:** -1. Fork code! -2. Create your own branch: `git checkout -b feat/xxxx` +1. Fork the code +2. Create your branch: `git checkout -b feat/xxxx` 3. Submit your changes: `git commit -am 'feat(function): add xxxxx'` 4. Push your branch: `git push origin feat/xxxx` -5. submit`pull request` +5. Submit `pull request` -## Git Contribution submission specification +## Git Contribution Submission Specification -- reference [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) +Reference [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) specification ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) - - `feat` Add new features - - `fix` Fix the problem/BUG - - `style` The code style is related and does not affect the running result - - `perf` Optimization/performance improvement - - `refactor` Refactor - - `revert` Undo edit - - `test` Test related - - `docs` Documentation/notes - - `chore` Dependency update/scaffolding configuration modification etc. - - `ci` Continuous integration - - `types` Type definition file changes - - `wip` In development +- `feat` Add new features +- `fix` Fix the problem/BUG +- `style` The code style is related and does not affect the running result +- `perf` Optimization/performance improvement +- `refactor` Refactor +- `revert` Undo edit +- `test` Test related +- `docs` Documentation/notes +- `chore` Dependency update/scaffolding configuration modification etc. +- `ci` Continuous integration +- `types` Type definition file changes -## Browser support +## Browser Support The `Chrome 80+` browser is recommended for local development Support modern browsers, not IE -| [ Edge](http://godban.github.io/browsers-support-badges/)
IE | [ Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | -| :-: | :-: | :-: | :-: | :-: | -| not support | last 2 versions | last 2 versions | last 2 versions | last 2 versions | +| [Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| :-: | :-: | :-: | :-: | +| last 2 versions | last 2 versions | last 2 versions | last 2 versions | ## Maintainer @@ -136,11 +138,10 @@ If you think this project is helpful to you, you can help the author buy a cup o Paypal Me -## Contributor +## Contributors - Contributors + Contributors ## Discord diff --git a/README.zh-CN.md b/README.zh-CN.md index c7c577f2..2585dfee 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -76,7 +76,7 @@ admin 账号: admin admin123 git clone https://gitee.com/dapppp/ruoyi-plus-vben5.git ``` -- 安装依赖 +2. 安装依赖 ```bash cd ruoyi-plus-vben5 @@ -150,7 +150,7 @@ VITE_GLOB_WEBSOCKET_ENABLE=false pnpm dev:antd ``` -- 打包 +4. 打包 ```bash pnpm build:antd @@ -164,21 +164,21 @@ pnpm build:antd ## Git 贡献提交规范 -- 参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) +参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范 ([Angular](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular)) - - `feat` 增加新功能 - - `fix` 修复问题/BUG - - `style` 代码风格相关无影响运行结果的 - - `perf` 优化/性能提升 - - `refactor` 重构 - - `revert` 撤销修改 - - `test` 测试相关 - - `docs` 文档/注释 - - `chore` 依赖更新/脚手架配置修改等 - - `workflow` 工作流改进 - - `ci` 持续集成 - - `types` 类型定义文件更改 - - `wip` 开发中 +- `feat` 增加新功能 +- `fix` 修复问题/BUG +- `style` 代码风格相关无影响运行结果的 +- `perf` 优化/性能提升 +- `refactor` 重构 +- `revert` 撤销修改 +- `test` 测试相关 +- `docs` 文档/注释 +- `chore` 依赖更新/脚手架配置修改等 +- `workflow` 工作流改进 +- `ci` 持续集成 +- `types` 类型定义文件更改 +- `wip` 开发中 ## 浏览器支持 @@ -186,7 +186,7 @@ pnpm build:antd 本地开发推荐使用`Chrome` 最新版本浏览器 -支持现代浏览器, 不支持 IE +支持现代浏览器,不支持 IE | [ Edge](http://godban.github.io/browsers-support-badges/)
IE | [ Edge](http://godban.github.io/browsers-support-badges/)
Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | | :-: | :-: | :-: | :-: | :-: | diff --git a/apps/backend-mock/api/upload.ts b/apps/backend-mock/api/upload.ts new file mode 100644 index 00000000..1bb9e602 --- /dev/null +++ b/apps/backend-mock/api/upload.ts @@ -0,0 +1,13 @@ +import { verifyAccessToken } from '~/utils/jwt-utils'; +import { unAuthorizedResponse } from '~/utils/response'; + +export default eventHandler((event) => { + const userinfo = verifyAccessToken(event); + if (!userinfo) { + return unAuthorizedResponse(event); + } + return useResponseSuccess({ + url: 'https://unpkg.com/@vbenjs/static-source@0.1.7/source/logo-v1.webp', + }); + // return useResponseError("test") +}); diff --git a/apps/backend-mock/routes/[...].ts b/apps/backend-mock/routes/[...].ts index 70c5f7c7..99f544b6 100644 --- a/apps/backend-mock/routes/[...].ts +++ b/apps/backend-mock/routes/[...].ts @@ -7,6 +7,7 @@ export default defineEventHandler(() => {
  • /api/menu/all
  • /api/auth/codes
  • /api/auth/login
  • +
  • /api/upload
  • `; }); diff --git a/apps/web-antd/.env b/apps/web-antd/.env index 2c7c63ca..7227f14a 100644 --- a/apps/web-antd/.env +++ b/apps/web-antd/.env @@ -3,3 +3,6 @@ VITE_APP_TITLE=Plus Admin # 应用命名空间,用于缓存、store等功能的前缀,确保隔离 VITE_APP_NAMESPACE=vben-web-antd + +# 对store进行加密的密钥,在将store持久化到localStorage时会使用该密钥进行加密 +VITE_APP_STORE_SECURE_KEY=please-replace-me-with-your-own-key diff --git a/apps/web-antd/src/adapter/component/index.ts b/apps/web-antd/src/adapter/component/index.ts index 3cde8257..18617676 100644 --- a/apps/web-antd/src/adapter/component/index.ts +++ b/apps/web-antd/src/adapter/component/index.ts @@ -87,8 +87,8 @@ const withDefaultPlaceholder = ( componentProps: Recordable = {}, ) => { return defineComponent({ - inheritAttrs: false, name: component.name, + inheritAttrs: false, setup: (props: any, { attrs, expose, slots }) => { const placeholder = props?.placeholder || @@ -162,20 +162,34 @@ async function initComponentAdapter() { // 如果你的组件体积比较大,可以使用异步加载 // Button: () => // import('xxx').then((res) => res.Button), - ApiSelect: withDefaultPlaceholder(ApiComponent, 'select', { - component: Select, - loadingSlot: 'suffixIcon', - visibleEvent: 'onDropdownVisibleChange', - modelPropName: 'value', - }), - ApiTreeSelect: withDefaultPlaceholder(ApiComponent, 'select', { - component: TreeSelect, - fieldNames: { label: 'label', value: 'value', children: 'children' }, - loadingSlot: 'suffixIcon', - modelPropName: 'value', - optionsPropName: 'treeData', - visibleEvent: 'onVisibleChange', - }), + ApiSelect: withDefaultPlaceholder( + { + ...ApiComponent, + name: 'ApiSelect', + }, + 'select', + { + component: Select, + loadingSlot: 'suffixIcon', + visibleEvent: 'onDropdownVisibleChange', + modelPropName: 'value', + }, + ), + ApiTreeSelect: withDefaultPlaceholder( + { + ...ApiComponent, + name: 'ApiTreeSelect', + }, + 'select', + { + component: TreeSelect, + fieldNames: { label: 'label', value: 'value', children: 'children' }, + loadingSlot: 'suffixIcon', + modelPropName: 'value', + optionsPropName: 'treeData', + visibleEvent: 'onVisibleChange', + }, + ), AutoComplete, Checkbox, CheckboxGroup, diff --git a/apps/web-antd/src/components/upload/src/file-upload.vue b/apps/web-antd/src/components/upload/src/file-upload.vue index a09a9b5f..8873d4d1 100644 --- a/apps/web-antd/src/components/upload/src/file-upload.vue +++ b/apps/web-antd/src/components/upload/src/file-upload.vue @@ -98,7 +98,7 @@ Upload.Dragger只会影响样式 {{ $t('component.upload.upload') }}
    -
    +

    diff --git a/apps/web-antd/src/views/tool/gen/code-preview-modal.vue b/apps/web-antd/src/views/tool/gen/code-preview-modal.vue index 5b0176a3..3b0f6778 100644 --- a/apps/web-antd/src/views/tool/gen/code-preview-modal.vue +++ b/apps/web-antd/src/views/tool/gen/code-preview-modal.vue @@ -20,7 +20,7 @@ import { } from '@vben/icons'; import { useClipboard } from '@vueuse/core'; -import { Skeleton, Tree } from 'ant-design-vue'; +import { Alert, Skeleton, Tree } from 'ant-design-vue'; import { previewCode } from '#/api/tool/gen'; @@ -185,6 +185,11 @@ const { copy } = useClipboard({ legacy: true });
    +
    { // e.target.scrollHeight 是元素的总高度。 const { scrollTop, clientHeight, scrollHeight } = e.target as HTMLElement; // 判断是否滚动到底部 - const isBottom = scrollTop + clientHeight >= scrollHeight; + const isBottom = scrollTop + clientHeight >= scrollHeight - bottomOffset; + console.log('scrollTop + clientHeight', scrollTop + clientHeight); + console.log('scrollHeight', scrollHeight); // 滚动到底部且没有加载完成 if (isBottom && !isLoadComplete.value) { diff --git a/apps/web-antd/src/views/workflow/task/constant.ts b/apps/web-antd/src/views/workflow/task/constant.ts new file mode 100644 index 00000000..9fc943c7 --- /dev/null +++ b/apps/web-antd/src/views/workflow/task/constant.ts @@ -0,0 +1,7 @@ +/** + * 底部偏移量 + * 在缩放时会差大概0.5px 导致触底逻辑不会触发 + * 在这里设置手动补偿 + * @see https://gitee.com/dapppp/ruoyi-plus-vben5/issues/IC28RE#note_40175381 + */ +export const bottomOffset = 2; diff --git a/apps/web-antd/src/views/workflow/task/myDocument.vue b/apps/web-antd/src/views/workflow/task/myDocument.vue index 395cf012..12a39cf2 100644 --- a/apps/web-antd/src/views/workflow/task/myDocument.vue +++ b/apps/web-antd/src/views/workflow/task/myDocument.vue @@ -24,6 +24,7 @@ import { cloneDeep, debounce } from 'lodash-es'; import { pageByCurrent } from '#/api/workflow/instance'; import { ApprovalCard, ApprovalPanel } from '../components'; +import { bottomOffset } from './constant'; const emptyImage = Empty.PRESENTED_IMAGE_SIMPLE; @@ -95,7 +96,7 @@ const handleScroll = debounce(async (e: Event) => { // e.target.scrollHeight 是元素的总高度。 const { scrollTop, clientHeight, scrollHeight } = e.target as HTMLElement; // 判断是否滚动到底部 - const isBottom = scrollTop + clientHeight >= scrollHeight; + const isBottom = scrollTop + clientHeight >= scrollHeight - bottomOffset; // 滚动到底部且没有加载完成 if (isBottom && !isLoadComplete.value) { diff --git a/apps/web-antd/src/views/workflow/task/taskCopyList.vue b/apps/web-antd/src/views/workflow/task/taskCopyList.vue index f3abea85..3505f8fe 100644 --- a/apps/web-antd/src/views/workflow/task/taskCopyList.vue +++ b/apps/web-antd/src/views/workflow/task/taskCopyList.vue @@ -26,6 +26,7 @@ import { categoryTree } from '#/api/workflow/category'; import { pageByTaskCopy } from '#/api/workflow/task'; import { ApprovalCard, ApprovalPanel, CopyComponent } from '../components'; +import { bottomOffset } from './constant'; const emptyImage = Empty.PRESENTED_IMAGE_SIMPLE; @@ -99,7 +100,7 @@ const handleScroll = debounce(async (e: Event) => { // e.target.scrollHeight 是元素的总高度。 const { scrollTop, clientHeight, scrollHeight } = e.target as HTMLElement; // 判断是否滚动到底部 - const isBottom = scrollTop + clientHeight >= scrollHeight; + const isBottom = scrollTop + clientHeight >= scrollHeight - bottomOffset; // 滚动到底部且没有加载完成 if (isBottom && !isLoadComplete.value) { diff --git a/apps/web-antd/src/views/workflow/task/taskFinish.vue b/apps/web-antd/src/views/workflow/task/taskFinish.vue index 81729db1..d9641b0b 100644 --- a/apps/web-antd/src/views/workflow/task/taskFinish.vue +++ b/apps/web-antd/src/views/workflow/task/taskFinish.vue @@ -26,6 +26,7 @@ import { categoryTree } from '#/api/workflow/category'; import { pageByTaskFinish } from '#/api/workflow/task'; import { ApprovalCard, ApprovalPanel, CopyComponent } from '../components'; +import { bottomOffset } from './constant'; const emptyImage = Empty.PRESENTED_IMAGE_SIMPLE; @@ -99,7 +100,7 @@ const handleScroll = debounce(async (e: Event) => { // e.target.scrollHeight 是元素的总高度。 const { scrollTop, clientHeight, scrollHeight } = e.target as HTMLElement; // 判断是否滚动到底部 - const isBottom = scrollTop + clientHeight >= scrollHeight; + const isBottom = scrollTop + clientHeight >= scrollHeight - bottomOffset; // 滚动到底部且没有加载完成 if (isBottom && !isLoadComplete.value) { diff --git a/apps/web-antd/src/views/workflow/task/taskWaiting.vue b/apps/web-antd/src/views/workflow/task/taskWaiting.vue index bce8ea2e..4a2024af 100644 --- a/apps/web-antd/src/views/workflow/task/taskWaiting.vue +++ b/apps/web-antd/src/views/workflow/task/taskWaiting.vue @@ -27,6 +27,7 @@ import { categoryTree } from '#/api/workflow/category'; import { pageByTaskWait } from '#/api/workflow/task'; import { ApprovalCard, ApprovalPanel, CopyComponent } from '../components'; +import { bottomOffset } from './constant'; const emptyImage = Empty.PRESENTED_IMAGE_SIMPLE; @@ -100,7 +101,7 @@ const handleScroll = debounce(async (e: Event) => { // e.target.scrollHeight 是元素的总高度。 const { scrollTop, clientHeight, scrollHeight } = e.target as HTMLElement; // 判断是否滚动到底部 - const isBottom = scrollTop + clientHeight >= scrollHeight; + const isBottom = scrollTop + clientHeight >= scrollHeight - bottomOffset; // 滚动到底部且没有加载完成 if (isBottom && !isLoadComplete.value) { diff --git a/docs/package.json b/docs/package.json index 926cd44d..629a523e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "@vben/docs", - "version": "5.5.4", + "version": "5.5.5", "private": true, "scripts": { "build": "vitepress build", diff --git a/docs/src/components/common-ui/vben-modal.md b/docs/src/components/common-ui/vben-modal.md index 56ff6d3c..3c8200f9 100644 --- a/docs/src/components/common-ui/vben-modal.md +++ b/docs/src/components/common-ui/vben-modal.md @@ -59,7 +59,7 @@ Modal 内的内容一般业务中,会比较复杂,所以我们可以将 moda ::: info 注意 - `VbenModal` 组件对与参数的处理优先级是 `slot` > `props` > `state`(通过api更新的状态以及useVbenModal参数)。如果你已经传入了 `slot` 或者 `props`,那么 `setState` 将不会生效,这种情况下你可以通过 `slot` 或者 `props` 来更新状态。 -- 如果你使用到了 `connectedComponent` 参数,那么会存在 2 个`useVbenModal`, 此时,如果同时设置了相同的参数,那么以内部为准(也就是没有设置 connectedComponent 的代码)。比如 同时设置了 `onConfirm`,那么以内部的 `onConfirm` 为准。`onOpenChange`事件除外,内外都会触发。 +- 如果你使用到了 `connectedComponent` 参数,那么会存在 2 个`useVbenModal`, 此时,如果同时设置了相同的参数,那么以内部为准(也就是没有设置 connectedComponent 的代码)。比如 同时设置了 `onConfirm`,那么以内部的 `onConfirm` 为准。`onOpenChange`事件除外,内外都会触发。另外,如果设置了`destroyOnClose`,内部Modal及其子组件会在被关闭后完全销毁。 - 如果弹窗的默认行为不符合你的预期,可以在`src\bootstrap.ts`中修改`setDefaultModalProps`的参数来设置默认的属性,如默认隐藏全屏按钮,修改默认ZIndex等。 ::: diff --git a/docs/src/en/guide/introduction/quick-start.md b/docs/src/en/guide/introduction/quick-start.md index d4829dce..757679c3 100644 --- a/docs/src/en/guide/introduction/quick-start.md +++ b/docs/src/en/guide/introduction/quick-start.md @@ -58,7 +58,7 @@ Open a terminal in your code directory and execute the following commands: cd vue-vben-admin # Enable the project-specified version of pnpm -corepack enable +npm i -g corepack # Install dependencies pnpm install diff --git a/docs/src/guide/in-depth/access.md b/docs/src/guide/in-depth/access.md index be7d2ba0..0dbd0819 100644 --- a/docs/src/guide/in-depth/access.md +++ b/docs/src/guide/in-depth/access.md @@ -114,8 +114,6 @@ async function generateAccess(options: GenerateMenuAndRoutesOptions) { ```ts const dashboardMenus = [ { - // 这里固定写死 BasicLayout,不可更改 - component: 'BasicLayout', meta: { order: -1, title: 'page.dashboard.title', @@ -144,6 +142,16 @@ const dashboardMenus = [ }, ], }, + { + name: 'Test', + path: '/test', + component: '/test/index', + meta: { + title: 'page.test', + // 部分特殊页面如果不需要基础布局(页面顶部和侧边栏),可将noBasicLayout设置为true + noBasicLayout: true, + }, + }, ]; ``` diff --git a/docs/src/guide/introduction/quick-start.md b/docs/src/guide/introduction/quick-start.md index 79410895..6b451ddf 100644 --- a/docs/src/guide/introduction/quick-start.md +++ b/docs/src/guide/introduction/quick-start.md @@ -58,7 +58,7 @@ git clone https://gitee.com/annsion/vue-vben-admin.git cd vue-vben-admin # 使用项目指定的pnpm版本进行依赖安装 -corepack enable +npm i -g corepack # 安装依赖 pnpm install diff --git a/docs/src/guide/project/tailwindcss.md b/docs/src/guide/project/tailwindcss.md index cfab5964..837076cb 100644 --- a/docs/src/guide/project/tailwindcss.md +++ b/docs/src/guide/project/tailwindcss.md @@ -11,3 +11,7 @@ 当前只有对应的包下面存在 `tailwind.config.mjs` 文件才会启用 tailwindcss 的编译,否则不会启用 tailwindcss。如果你是纯粹的 SDK 包,不需要使用 tailwindcss,可以不用创建 `tailwind.config.mjs` 文件。 ::: + +## 提示 + +现`tailwindcss`已至v4.x版本,使用方法与`tailwindcss: ^3.4.17`有差异,v4.0无法与v3.x版本兼容,在开发前请确认`package.json`中的`tailwindcss`版本。 diff --git a/docs/src/index.md b/docs/src/index.md index 30aaa0ae..3a346d04 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -20,6 +20,9 @@ hero: - theme: alt text: 在 GitHub 查看 link: https://github.com/vbenjs/vue-vben-admin + - theme: alt + text: DeepWiki 文档 + link: https://deepwiki.com/vbenjs/vue-vben-admin features: - icon: 🚀 diff --git a/internal/lint-configs/commitlint-config/package.json b/internal/lint-configs/commitlint-config/package.json index 3f1037b1..a2f67a45 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.5.4", + "version": "5.5.5", "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/vue.ts b/internal/lint-configs/eslint-config/src/configs/vue.ts index d1c6521c..a64c55af 100644 --- a/internal/lint-configs/eslint-config/src/configs/vue.ts +++ b/internal/lint-configs/eslint-config/src/configs/vue.ts @@ -10,7 +10,15 @@ export async function vue(): Promise { interopDefault(import('@typescript-eslint/parser')), ] as const); + const flatEssential = pluginVue.configs?.['flat/essential'] || []; + const flatStronglyRecommended = + pluginVue.configs?.['flat/strongly-recommended'] || []; + const flatRecommended = pluginVue.configs?.['flat/recommended'] || []; + return [ + ...flatEssential, + ...flatStronglyRecommended, + ...flatRecommended, { files: ['**/*.vue'], languageOptions: { @@ -43,12 +51,9 @@ export async function vue(): Promise { plugins: { vue: pluginVue, }, - processor: pluginVue.processors['.vue'], + processor: pluginVue.processors?.['.vue'], rules: { - ...pluginVue.configs.base.rules, - ...pluginVue.configs['vue3-essential'].rules, - ...pluginVue.configs['vue3-strongly-recommended'].rules, - ...pluginVue.configs['vue3-recommended'].rules, + ...pluginVue.configs?.base?.rules, 'vue/attribute-hyphenation': [ 'error', @@ -131,7 +136,6 @@ export async function vue(): Promise { 'vue/require-default-prop': 'error', 'vue/require-explicit-emits': 'error', 'vue/require-prop-types': 'off', - 'vue/script-setup-uses-vars': 'error', 'vue/singleline-html-element-content-newline': 'off', 'vue/space-infix-ops': 'error', 'vue/space-unary-ops': ['error', { nonwords: false, words: true }], diff --git a/internal/lint-configs/stylelint-config/index.mjs b/internal/lint-configs/stylelint-config/index.mjs index 7ef175cc..08ac8238 100644 --- a/internal/lint-configs/stylelint-config/index.mjs +++ b/internal/lint-configs/stylelint-config/index.mjs @@ -43,6 +43,7 @@ export default { 'stylelint-scss', ], rules: { + 'at-rule-no-deprecated': null, 'at-rule-no-unknown': [ true, { diff --git a/internal/lint-configs/stylelint-config/package.json b/internal/lint-configs/stylelint-config/package.json index e9bd45d3..fb05a224 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.5.4", + "version": "5.5.5", "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 7783e353..4505f5bf 100644 --- a/internal/node-utils/package.json +++ b/internal/node-utils/package.json @@ -1,6 +1,6 @@ { "name": "@vben/node-utils", - "version": "5.5.4", + "version": "5.5.5", "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 86c41208..04550d33 100644 --- a/internal/tailwind-config/package.json +++ b/internal/tailwind-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/tailwind-config", - "version": "5.5.4", + "version": "5.5.5", "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 e2425691..bbb756ce 100644 --- a/internal/tsconfig/package.json +++ b/internal/tsconfig/package.json @@ -1,6 +1,6 @@ { "name": "@vben/tsconfig", - "version": "5.5.4", + "version": "5.5.5", "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 28655a56..934d64f0 100644 --- a/internal/vite-config/package.json +++ b/internal/vite-config/package.json @@ -1,6 +1,6 @@ { "name": "@vben/vite-config", - "version": "5.5.4", + "version": "5.5.5", "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/src/typing.ts b/internal/vite-config/src/typing.ts index 31683cc7..f730bdb9 100644 --- a/internal/vite-config/src/typing.ts +++ b/internal/vite-config/src/typing.ts @@ -3,149 +3,328 @@ import type { ConfigEnv, PluginOption, UserConfig } from 'vite'; import type { PluginOptions } from 'vite-plugin-dts'; import type { Options as PwaPluginOptions } from 'vite-plugin-pwa'; +/** + * ImportMap 配置接口 + * @description 用于配置模块导入映射,支持自定义导入路径和范围 + * @example + * ```typescript + * { + * imports: { + * 'vue': 'https://unpkg.com/vue@3.2.47/dist/vue.esm-browser.js' + * }, + * scopes: { + * 'https://site.com/': { + * 'vue': 'https://unpkg.com/vue@3.2.47/dist/vue.esm-browser.js' + * } + * } + * } + * ``` + */ interface IImportMap { + /** 模块导入映射 */ imports?: Record; + /** 作用域特定的导入映射 */ scopes?: { [scope: string]: Record; }; } + +/** + * 打印插件配置选项 + * @description 用于配置控制台打印信息 + */ interface PrintPluginOptions { /** - * 打印的数据 + * 打印的数据映射 + * @description 键值对形式的数据,将在控制台打印 + * @example + * ```typescript + * { + * 'App Version': '1.0.0', + * 'Build Time': '2024-01-01' + * } + * ``` */ infoMap?: Record; } +/** + * Nitro Mock 插件配置选项 + * @description 用于配置 Nitro Mock 服务器的行为 + */ interface NitroMockPluginOptions { /** - * mock server 包名 + * Mock 服务器包名 + * @default '@vbenjs/nitro-mock' */ mockServerPackage?: string; /** - * mock 服务端口 + * Mock 服务端口 + * @default 3000 */ port?: number; /** - * mock 日志是否打印 + * 是否打印 Mock 日志 + * @default false */ verbose?: boolean; } +/** + * 归档插件配置选项 + * @description 用于配置构建产物的压缩归档 + */ interface ArchiverPluginOptions { /** * 输出文件名 - * @default dist + * @default 'dist' */ name?: string; /** * 输出目录 - * @default . + * @default '.' */ outputDir?: string; } /** - * importmap 插件配置 + * ImportMap 插件配置 + * @description 用于配置模块的 CDN 导入 */ interface ImportmapPluginOptions { /** * CDN 供应商 - * @default jspm.io + * @default 'jspm.io' + * @description 支持 esm.sh 和 jspm.io 两种 CDN 供应商 */ defaultProvider?: 'esm.sh' | 'jspm.io'; - /** importmap 配置 */ + /** + * ImportMap 配置数组 + * @description 配置需要从 CDN 导入的包 + * @example + * ```typescript + * [ + * { name: 'vue' }, + * { name: 'pinia', range: '^2.0.0' } + * ] + * ``` + */ importmap?: Array<{ name: string; range?: string }>; - /** 手动配置importmap */ + /** + * 手动配置 ImportMap + * @description 自定义 ImportMap 配置 + */ inputMap?: IImportMap; } /** - * 用于判断是否需要加载插件 + * 条件插件配置 + * @description 用于根据条件动态加载插件 */ interface ConditionPlugin { - // 判断条件 + /** + * 判断条件 + * @description 当条件为 true 时加载插件 + */ condition?: boolean; - // 插件对象 + /** + * 插件对象 + * @description 返回插件数组或 Promise + */ plugins: () => PluginOption[] | PromiseLike; } +/** + * 通用插件配置选项 + * @description 所有插件共用的基础配置 + */ interface CommonPluginOptions { - /** 是否开启devtools */ + /** + * 是否开启开发工具 + * @default false + */ devtools?: boolean; - /** 环境变量 */ + /** + * 环境变量 + * @description 自定义环境变量 + */ env?: Record; - /** 是否注入metadata */ + /** + * 是否注入元数据 + * @default true + */ injectMetadata?: boolean; - /** 是否构建模式 */ + /** + * 是否为构建模式 + * @default false + */ isBuild?: boolean; - /** 构建模式 */ + /** + * 构建模式 + * @default 'development' + */ mode?: string; - /** 开启依赖分析 */ + /** + * 是否开启依赖分析 + * @default false + * @description 使用 rollup-plugin-visualizer 分析依赖 + */ visualizer?: boolean | PluginVisualizerOptions; } +/** + * 应用插件配置选项 + * @description 用于配置应用构建时的插件选项 + */ interface ApplicationPluginOptions extends CommonPluginOptions { - /** 开启后,会在打包dist同级生成dist.zip */ + /** + * 是否开启压缩归档 + * @default false + * @description 开启后会在打包目录生成 zip 文件 + */ archiver?: boolean; - /** 压缩归档插件配置 */ + /** + * 压缩归档插件配置 + * @description 配置压缩归档的行为 + */ archiverPluginOptions?: ArchiverPluginOptions; - /** 开启 gzip|brotli 压缩 */ + /** + * 是否开启压缩 + * @default false + * @description 支持 gzip 和 brotli 压缩 + */ compress?: boolean; - /** 压缩类型 */ + /** + * 压缩类型 + * @default ['gzip'] + * @description 可选的压缩类型 + */ compressTypes?: ('brotli' | 'gzip')[]; - /** 在构建的时候抽离配置文件 */ + /** + * 是否抽离配置文件 + * @default false + * @description 在构建时抽离配置文件 + */ extraAppConfig?: boolean; - /** 是否开启html插件 */ + /** + * 是否开启 HTML 插件 + * @default true + */ html?: boolean; - /** 是否开启i18n */ + /** + * 是否开启国际化 + * @default false + */ i18n?: boolean; - /** 是否开启 importmap CDN */ + /** + * 是否开启 ImportMap CDN + * @default false + */ importmap?: boolean; - /** importmap 插件配置 */ + /** + * ImportMap 插件配置 + */ importmapOptions?: ImportmapPluginOptions; - /** 是否注入app loading */ + /** + * 是否注入应用加载动画 + * @default true + */ injectAppLoading?: boolean; - /** 是否注入全局scss */ + /** + * 是否注入全局 SCSS + * @default true + */ injectGlobalScss?: boolean; - /** 是否注入版权信息 */ + /** + * 是否注入版权信息 + * @default true + */ license?: boolean; - /** 是否开启nitro mock */ + /** + * 是否开启 Nitro Mock + * @default false + */ nitroMock?: boolean; - /** nitro mock 插件配置 */ + /** + * Nitro Mock 插件配置 + */ nitroMockOptions?: NitroMockPluginOptions; - /** 开启控制台自定义打印 */ + /** + * 是否开启控制台打印 + * @default false + */ print?: boolean; - /** 打印插件配置 */ + /** + * 打印插件配置 + */ printInfoMap?: PrintPluginOptions['infoMap']; - /** 是否开启pwa */ + /** + * 是否开启 PWA + * @default false + */ pwa?: boolean; - /** pwa 插件配置 */ + /** + * PWA 插件配置 + */ pwaOptions?: Partial; - /** 是否开启vxe-table懒加载 */ + /** + * 是否开启 VXE Table 懒加载 + * @default false + */ vxeTableLazyImport?: boolean; } +/** + * 库插件配置选项 + * @description 用于配置库构建时的插件选项 + */ interface LibraryPluginOptions extends CommonPluginOptions { - /** 开启 dts 输出 */ + /** + * 是否开启 DTS 输出 + * @default true + * @description 生成 TypeScript 类型声明文件 + */ dts?: boolean | PluginOptions; } +/** + * 应用配置选项类型 + */ type ApplicationOptions = ApplicationPluginOptions; +/** + * 库配置选项类型 + */ type LibraryOptions = LibraryPluginOptions; +/** + * 应用配置定义函数类型 + * @description 用于定义应用构建配置 + */ type DefineApplicationOptions = (config?: ConfigEnv) => Promise<{ + /** 应用插件配置 */ application?: ApplicationOptions; + /** Vite 配置 */ vite?: UserConfig; }>; +/** + * 库配置定义函数类型 + * @description 用于定义库构建配置 + */ type DefineLibraryOptions = (config?: ConfigEnv) => Promise<{ + /** 库插件配置 */ library?: LibraryOptions; + /** Vite 配置 */ vite?: UserConfig; }>; +/** + * 配置定义类型 + * @description 应用或库的配置定义 + */ type DefineConfig = DefineApplicationOptions | DefineLibraryOptions; export type { diff --git a/package.json b/package.json index e571b5f1..c0a2792c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vben-admin-monorepo", - "version": "5.5.4", + "version": "5.5.5", "private": true, "keywords": [ "monorepo", @@ -96,7 +96,7 @@ "node": ">=20.10.0", "pnpm": ">=9.12.0" }, - "packageManager": "pnpm@9.15.9", + "packageManager": "pnpm@10.10.0", "pnpm": { "peerDependencyRules": { "allowedVersions": { @@ -107,7 +107,7 @@ "@ast-grep/napi": "catalog:", "@ctrl/tinycolor": "catalog:", "clsx": "catalog:", - "esbuild": "0.24.0", + "esbuild": "0.25.3", "pinia": "catalog:", "vue": "catalog:" }, diff --git a/packages/@core/base/design/package.json b/packages/@core/base/design/package.json index 11b585a2..8e4ea802 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.5.4", + "version": "5.5.5", "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 2fc39647..9f650e01 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.5.4", + "version": "5.5.5", "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 70ad17c3..18f28431 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.5.4", + "version": "5.5.5", "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/src/utils/inference.ts b/packages/@core/base/shared/src/utils/inference.ts index a9ace62c..195d071b 100644 --- a/packages/@core/base/shared/src/utils/inference.ts +++ b/packages/@core/base/shared/src/utils/inference.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line vue/prefer-import-from-vue import { isFunction, isObject, isString } from '@vue/shared'; /** diff --git a/packages/@core/base/typings/package.json b/packages/@core/base/typings/package.json index 6073fbcd..6bc1855a 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.5.4", + "version": "5.5.5", "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 31f3e783..d5fe193e 100644 --- a/packages/@core/composables/package.json +++ b/packages/@core/composables/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/composables", - "version": "5.5.4", + "version": "5.5.5", "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 886fbed3..90024c93 100644 --- a/packages/@core/preferences/package.json +++ b/packages/@core/preferences/package.json @@ -1,6 +1,6 @@ { "name": "@vben-core/preferences", - "version": "5.5.4", + "version": "5.5.5", "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 db6cbab5..09237896 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.5.4", + "version": "5.5.5", "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/form-render/expandable.ts b/packages/@core/ui-kit/form-ui/src/form-render/expandable.ts index a7b8ef41..9383064c 100644 --- a/packages/@core/ui-kit/form-ui/src/form-render/expandable.ts +++ b/packages/@core/ui-kit/form-ui/src/form-render/expandable.ts @@ -2,13 +2,18 @@ import type { FormRenderProps } from '../types'; import { computed, nextTick, onMounted, ref, useTemplateRef, watch } from 'vue'; -import { breakpointsTailwind, useBreakpoints } from '@vueuse/core'; +import { + breakpointsTailwind, + useBreakpoints, + useElementVisibility, +} from '@vueuse/core'; /** * 动态计算行数 */ export function useExpandable(props: FormRenderProps) { const wrapperRef = useTemplateRef('wrapperRef'); + const isVisible = useElementVisibility(wrapperRef); const rowMapping = ref>({}); // 是否已经计算过一次 const isCalculated = ref(false); @@ -31,6 +36,7 @@ export function useExpandable(props: FormRenderProps) { () => props.showCollapseButton, () => breakpoints.active().value, () => props.schema?.length, + () => isVisible.value, ], async ([val]) => { if (val) { diff --git a/packages/@core/ui-kit/layout-ui/package.json b/packages/@core/ui-kit/layout-ui/package.json index 0f26fa31..2074d594 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.5.4", + "version": "5.5.5", "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 f44097b4..16cabd11 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.5.4", + "version": "5.5.5", "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/src/components/sub-menu-content.vue b/packages/@core/ui-kit/menu-ui/src/components/sub-menu-content.vue index 31eead11..5622d413 100644 --- a/packages/@core/ui-kit/menu-ui/src/components/sub-menu-content.vue +++ b/packages/@core/ui-kit/menu-ui/src/components/sub-menu-content.vue @@ -10,7 +10,7 @@ import { VbenIcon } from '@vben-core/shadcn-ui'; import { useMenuContext } from '../hooks'; interface Props extends MenuItemProps { - isMenuMore: boolean; + isMenuMore?: boolean; isTopLevelMenuSubmenu: boolean; level?: number; } diff --git a/packages/@core/ui-kit/popup-ui/src/alert/alert.vue b/packages/@core/ui-kit/popup-ui/src/alert/alert.vue index a5b4d0da..6223ecd7 100644 --- a/packages/@core/ui-kit/popup-ui/src/alert/alert.vue +++ b/packages/@core/ui-kit/popup-ui/src/alert/alert.vue @@ -47,6 +47,10 @@ function onAlertClosed() { isConfirm.value = false; } +function onEscapeKeyDown() { + isConfirm.value = false; +} + const getIconRender = computed(() => { let iconRender: Component | null = null; if (props.icon) { @@ -91,14 +95,13 @@ const getIconRender = computed(() => { }); function doCancel() { - isConfirm.value = false; + handleCancel(); handleOpenChange(false); } function doConfirm() { - isConfirm.value = true; + handleConfirm(); handleOpenChange(false); - emits('confirm'); } provideAlertContext({ @@ -117,7 +120,7 @@ function handleCancel() { const loading = ref(false); async function handleOpenChange(val: boolean) { - await nextTick(); + await nextTick(); // 等待标记isConfirm状态 if (!val && props.beforeClose) { loading.value = true; try { @@ -141,6 +144,7 @@ async function handleOpenChange(val: boolean) { :overlay-blur="overlayBlur" @opened="emits('opened')" @closed="onAlertClosed" + @escape-key-down="onEscapeKeyDown" :class=" cn( containerClass, diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts index 30009a64..89cd3b5f 100644 --- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts +++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts @@ -52,6 +52,10 @@ export interface DrawerProps { * 弹窗描述 */ description?: string; + /** + * 在关闭时销毁抽屉 + */ + destroyOnClose?: boolean; /** * 是否显示底部 * @default true @@ -143,10 +147,6 @@ export interface DrawerApiOptions extends DrawerState { * 独立的抽屉组件 */ connectedComponent?: Component; - /** - * 在关闭时销毁抽屉。仅在使用 connectedComponent 时有效 - */ - destroyOnClose?: boolean; /** * 关闭前的回调,返回 false 可以阻止关闭 * @returns diff --git a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue index b5535ba4..25069979 100644 --- a/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue +++ b/packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue @@ -1,7 +1,7 @@