Prechádzať zdrojové kódy

Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin

# Conflicts:
#	package.json
#	pnpm-lock.yaml
shizhongming 2 rokov pred
rodič
commit
f693136e59

+ 1 - 1
apps/test-server/service/FileService.ts

@@ -5,7 +5,7 @@ const uploadUrl = 'http://localhost:3300/static/upload';
 const filePath = path.join(__dirname, '../static/upload/');
 
 fs.ensureDir(filePath);
-export default class UserService {
+export default class FileService {
   async upload(ctx, files, isMultiple) {
     let fileReader, fileResource, writeStream;
 

+ 6 - 6
internal/eslint-config/package.json

@@ -37,14 +37,14 @@
     "stub": "pnpm unbuild --stub"
   },
   "devDependencies": {
-    "@typescript-eslint/eslint-plugin": "^6.17.0",
-    "@typescript-eslint/parser": "^6.17.0",
+    "@typescript-eslint/eslint-plugin": "^7.0.1",
+    "@typescript-eslint/parser": "^7.0.1",
     "eslint": "^8.56.0",
     "eslint-config-prettier": "^9.1.0",
     "eslint-plugin-import": "^2.29.1",
-    "eslint-plugin-prettier": "^5.1.2",
-    "eslint-plugin-simple-import-sort": "^10.0.0",
-    "eslint-plugin-vue": "^9.19.2",
-    "vue-eslint-parser": "^9.3.2"
+    "eslint-plugin-prettier": "^5.1.3",
+    "eslint-plugin-simple-import-sort": "^12.0.0",
+    "eslint-plugin-vue": "^9.21.1",
+    "vue-eslint-parser": "^9.4.2"
   }
 }

+ 4 - 4
internal/stylelint-config/package.json

@@ -32,12 +32,12 @@
     "stub": "pnpm unbuild --stub"
   },
   "devDependencies": {
-    "postcss": "^8.4.33",
-    "postcss-html": "^1.5.0",
+    "postcss": "^8.4.35",
+    "postcss-html": "^1.6.0",
     "postcss-less": "^6.0.0",
     "postcss-scss": "^4.0.9",
-    "prettier": "^3.1.1",
-    "stylelint": "^16.1.0",
+    "prettier": "^3.2.5",
+    "stylelint": "^16.2.1",
     "stylelint-config-property-sort-order-smacss": "^10.0.0",
     "stylelint-config-recommended-scss": "^14.0.0",
     "stylelint-config-recommended-vue": "^1.5.0",

+ 2 - 2
internal/ts-config/package.json

@@ -20,7 +20,7 @@
     "node-server.json"
   ],
   "dependencies": {
-    "@types/node": "^20.10.6",
-    "vite": "^5.0.10"
+    "@types/node": "^20.11.19",
+    "vite": "^5.1.3"
   }
 }

+ 8 - 8
internal/vite-config/package.json

@@ -33,25 +33,25 @@
   },
   "dependencies": {
     "@ant-design/colors": "^7.0.2",
-    "vite": "^5.0.10"
+    "vite": "^5.1.3"
   },
   "devDependencies": {
     "@types/fs-extra": "^11.0.4",
-    "@vitejs/plugin-vue": "^5.0.2",
+    "@vitejs/plugin-vue": "^5.0.4",
     "@vitejs/plugin-vue-jsx": "^3.1.0",
-    "ant-design-vue": "^4.0.8",
+    "ant-design-vue": "^4.1.2",
     "dayjs": "^1.11.10",
-    "dotenv": "^16.3.1",
+    "dotenv": "^16.4.4",
     "fs-extra": "^11.2.0",
     "less": "^4.2.0",
     "picocolors": "^1.0.0",
     "pkg-types": "^1.0.3",
     "rollup-plugin-visualizer": "^5.12.0",
-    "sass": "^1.69.7",
-    "unocss": "0.58.3",
+    "sass": "^1.71.0",
+    "unocss": "0.58.5",
     "vite-plugin-compression": "^0.5.1",
-    "vite-plugin-dts": "^3.7.0",
-    "vite-plugin-html": "^3.2.1",
+    "vite-plugin-dts": "^3.7.2",
+    "vite-plugin-html": "^3.2.2",
     "vite-plugin-mock": "^2.9.6",
     "vite-plugin-purge-icons": "^0.10.0",
     "vite-plugin-svg-icons": "^2.0.1"

+ 0 - 1
internal/vite-config/src/plugins/html.ts

@@ -8,7 +8,6 @@ import { createHtmlPlugin } from 'vite-plugin-html';
 export function configHtmlPlugin({ isBuild }: { isBuild: boolean }) {
   const htmlPlugin: PluginOption[] = createHtmlPlugin({
     minify: isBuild,
-    viteNext: true,
   });
   return htmlPlugin;
 }

+ 27 - 27
package.json

@@ -70,15 +70,15 @@
   "dependencies": {
     "@ant-design/icons-vue": "^7.0.1",
     "@iconify/iconify": "^3.1.1",
-    "@logicflow/core": "^1.2.18",
-    "@logicflow/extension": "^1.2.19",
+    "@logicflow/core": "^1.2.22",
+    "@logicflow/extension": "^1.2.22",
     "@smart/smart-ui-app": "workspace:*",
     "@vben/hooks": "workspace:*",
-    "@vue/shared": "^3.4.5",
-    "@vueuse/core": "^10.7.1",
+    "@vue/shared": "^3.4.19",
+    "@vueuse/core": "^10.7.2",
     "@zxcvbn-ts/core": "^3.0.4",
-    "ant-design-vue": "^4.0.8",
-    "axios": "^1.6.4",
+    "ant-design-vue": "^4.1.2",
+    "axios": "^1.6.7",
     "codemirror": "^5.65.16",
     "cropperjs": "^1.6.1",
     "crypto-js": "^4.2.0",
@@ -97,54 +97,54 @@
     "qs": "^6.11.2",
     "resize-observer-polyfill": "^1.5.1",
     "showdown": "^2.1.0",
-    "sortablejs": "^1.15.1",
+    "sortablejs": "^1.15.2",
     "tinymce": "^5.10.9",
-    "unocss": "0.58.3",
-    "vditor": "^3.9.8",
-    "vue": "3.3.4",
-    "vue-i18n": "^9.8.0",
+    "unocss": "^0.58.5",
+    "vditor": "^3.9.9",
+    "vue": "^3.4.19",
+    "vue-i18n": "^9.9.1",
     "vue-json-pretty": "^2.3.0",
     "vue-router": "^4.2.5",
     "vue-types": "^5.1.1",
     "vuedraggable": "^4.1.0",
-    "vxe-table": "^4.5.17",
-    "vxe-table-plugin-export-xlsx": "^3.1.0",
-    "xe-utils": "^3.5.14",
+    "vxe-table": "^4.5.18",
+    "vxe-table-plugin-export-xlsx": "^4.0.1",
+    "xe-utils": "^3.5.20",
     "xlsx": "^0.18.5"
   },
   "devDependencies": {
-    "@commitlint/cli": "^18.4.4",
-    "@commitlint/config-conventional": "^18.4.4",
-    "@iconify/json": "^2.2.164",
+    "@commitlint/cli": "^18.6.1",
+    "@commitlint/config-conventional": "^18.6.2",
+    "@iconify/json": "^2.2.183",
     "@purge-icons/generated": "^0.10.0",
     "@types/codemirror": "^5.60.15",
-    "@types/crypto-js": "^4.2.1",
+    "@types/crypto-js": "^4.2.2",
     "@types/lodash-es": "^4.17.12",
     "@types/mockjs": "^1.0.10",
     "@types/nprogress": "^0.2.3",
     "@types/qrcode": "^1.5.5",
     "@types/qs": "^6.9.11",
     "@types/showdown": "^2.0.6",
-    "@types/sortablejs": "^1.15.7",
+    "@types/sortablejs": "^1.15.8",
     "@vben/eslint-config": "workspace:*",
     "@vben/stylelint-config": "workspace:*",
     "@vben/ts-config": "workspace:*",
     "@vben/types": "workspace:*",
     "@vben/vite-config": "workspace:*",
-    "@vue/compiler-sfc": "^3.4.5",
-    "@vue/test-utils": "^2.4.3",
+    "@vue/compiler-sfc": "^3.4.19",
+    "@vue/test-utils": "^2.4.4",
     "cross-env": "^7.0.3",
     "cz-git": "^1.8.0",
     "czg": "^1.8.0",
-    "husky": "^8.0.3",
-    "lint-staged": "15.2.0",
-    "prettier": "^3.1.1",
-    "prettier-plugin-packagejson": "^2.4.8",
+    "husky": "^9.0.11",
+    "lint-staged": "15.2.2",
+    "prettier": "^3.2.5",
+    "prettier-plugin-packagejson": "^2.4.11",
     "rimraf": "^5.0.5",
-    "turbo": "^1.11.3",
+    "turbo": "^1.12.4",
     "typescript": "^5.3.3",
     "unbuild": "^2.0.0",
-    "vite": "^5.0.10",
+    "vite": "^5.1.3",
     "vite-plugin-mock": "^2.9.6",
     "vue-tsc": "^1.8.27"
   },

+ 2 - 2
packages/hooks/package.json

@@ -30,9 +30,9 @@
     "lint": "pnpm eslint ."
   },
   "dependencies": {
-    "@vueuse/core": "^10.7.1",
+    "@vueuse/core": "^10.7.2",
     "lodash-es": "^4.17.21",
-    "vue": "3.3.4"
+    "vue": "^3.4.19"
   },
   "devDependencies": {
     "@vben/types": "workspace:*"

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 235 - 235
pnpm-lock.yaml


+ 3 - 5
src/components/Button/src/PopConfirmButton.vue

@@ -38,8 +38,9 @@
       });
 
       return () => {
-        const bindValues = omit(unref(getBindValues), 'icon');
-        const btnBind = omit(bindValues, 'title') as any;
+        // 用 omit 剔除一些已知可能导致异常的属性
+        const bindValues = omit(unref(getBindValues), 'icon', 'color');
+        const btnBind = omit(unref(getBindValues), 'title') as any;
         if (btnBind.disabled) btnBind.color = '';
         const Button = h(BasicButton, btnBind, extendSlots(slots));
 
@@ -47,9 +48,6 @@
         if (!props.enable) {
           return Button;
         }
-        if (bindValues.color) {
-          delete bindValues.color;
-        }
         return h(Popconfirm, bindValues, { default: () => Button });
       };
     },

+ 1 - 1
src/components/Cropper/src/CropperModal.vue

@@ -152,7 +152,7 @@
   function handleBeforeUpload(file: File) {
     if (props.size && file.size > 1024 * 1024 * props.size) {
       emit('uploadError', { msg: t('component.cropper.imageTooBig') });
-      return;
+      return false;
     }
     const reader = new FileReader();
     reader.readAsDataURL(file);

+ 3 - 2
src/components/Table/src/components/TableAction.vue

@@ -2,12 +2,12 @@
   <div :class="[prefixCls, getAlign]" @click="onCellClick">
     <template v-for="(action, index) in getActions" :key="`${index}-${action.label}`">
       <Tooltip v-if="action.tooltip" v-bind="getTooltip(action.tooltip)">
-        <PopConfirmButton v-bind="action">
+        <PopConfirmButton v-bind="omit(action, 'icon')">
           <Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
           <template v-if="action.label">{{ action.label }}</template>
         </PopConfirmButton>
       </Tooltip>
-      <PopConfirmButton v-else v-bind="action">
+      <PopConfirmButton v-else v-bind="omit(action, 'icon')">
         <Icon :icon="action.icon" :class="{ 'mr-1': !!action.label }" v-if="action.icon" />
         <template v-if="action.label">{{ action.label }}</template>
       </PopConfirmButton>
@@ -44,6 +44,7 @@
   import { isBoolean, isFunction, isString } from '@/utils/is';
   import { propTypes } from '@/utils/propTypes';
   import { ACTION_COLUMN_FLAG } from '../const';
+  import { omit } from 'lodash-es';
 
   defineOptions({ name: 'TableAction' });
 

+ 1 - 2
src/components/Tree/style/index.less

@@ -6,8 +6,7 @@
   .ant-tree {
     .ant-tree-checkbox {
       margin-block-start: 0;
-      margin-inline-start: 4px;
-      margin-inline-end: 4px;
+      margin-inline: 4px 4px;
 
       & + span {
         padding-left: 4px;

+ 15 - 4
src/layouts/default/sider/LayoutSider.vue

@@ -4,17 +4,27 @@
     v-show="showClassSideBarRef"
     :style="getHiddenDomStyle"
   ></div>
+  <!-- 
+    针对场景:菜单折叠按钮为“底部”时:
+    关于 breakpoint,
+    组件定义的是 lg: '992px',
+    而 vben 定义的是 lg: '960px',
+    现把组件的 breakpoint 设为 md,
+    则组件的 md: '768px' < vben的 lg: '960px',
+    防止 collapsedWidth 在 960px ~ 992px 之间错误设置为 0,
+    从而防止出现浮动的 trigger(且breakpoint事件失效)
+  -->
   <Layout.Sider
     v-show="showClassSideBarRef"
     ref="sideRef"
-    breakpoint="lg"
+    :breakpoint="getTrigger === TriggerEnum.FOOTER ? 'md' : 'lg'"
     collapsible
     :class="getSiderClass"
     :width="getMenuWidth"
     :collapsed="getCollapsed"
     :collapsedWidth="getCollapsedWidth"
     :theme="getMenuTheme"
-    :trigger="getTrigger"
+    :trigger="triggerVNode"
     v-bind="getTriggerAttr"
     @breakpoint="onBreakpointChange"
   >
@@ -29,7 +39,7 @@
   import { Layout } from 'ant-design-vue';
   import { computed, CSSProperties, h, ref, unref } from 'vue';
 
-  import { MenuModeEnum, MenuSplitTyeEnum } from '@/enums/menuEnum';
+  import { MenuModeEnum, MenuSplitTyeEnum, TriggerEnum } from '@/enums/menuEnum';
   import { useMenuSetting } from '@/hooks/setting/useMenuSetting';
   import { useAppInject } from '@/hooks/web/useAppInject';
   import { useDesign } from '@/hooks/web/useDesign';
@@ -53,6 +63,7 @@
     getMenuHidden,
     getMenuFixed,
     getIsMixMode,
+    getTrigger,
   } = useMenuSetting();
 
   const { prefixCls } = useDesign('layout-sideBar');
@@ -101,7 +112,7 @@
 
   // 在此处使用计算量可能会导致sider异常
   // andv 更新后,如果trigger插槽可用,则此处代码可废弃
-  const getTrigger = h(LayoutTrigger);
+  const triggerVNode = h(LayoutTrigger);
 </script>
 <style lang="less">
   @prefix-cls: ~'@{namespace}-layout-sideBar';

+ 0 - 1
src/views/demo/system/account/account.data.ts

@@ -128,7 +128,6 @@ export const accountFormSchema: FormSchema[] = [
     componentProps: {
       fieldNames: {
         label: 'deptName',
-        key: 'id',
         value: 'id',
       },
       getPopupContainer: () => document.body,

+ 0 - 1
src/views/demo/system/dept/dept.data.ts

@@ -77,7 +77,6 @@ export const formSchema: FormSchema[] = [
     componentProps: {
       fieldNames: {
         label: 'deptName',
-        key: 'id',
         value: 'id',
       },
       getPopupContainer: () => document.body,

+ 0 - 1
src/views/demo/system/menu/menu.data.ts

@@ -105,7 +105,6 @@ export const formSchema: FormSchema[] = [
     componentProps: {
       fieldNames: {
         label: 'menuName',
-        key: 'id',
         value: 'id',
       },
       getPopupContainer: () => document.body,

+ 7 - 1
src/views/sys/exception/Exception.vue

@@ -122,7 +122,13 @@
                     {() => btnText}
                   </Button>
                 ),
-              icon: () => (icon ? <img src={icon} /> : null),
+              // antv 原来支持 status 可选: success | error | info | warning | 404 | 403 | 500
+              // 上面 ExceptionEnum 覆盖了 404 | 403 | 500,并增加其他状态值
+              // 增加下面判断,继续支持 success | error | info | warning
+              icon:
+                status && ExceptionEnum[status] === void 0
+                  ? () => (icon ? <img src={icon} /> : null)
+                  : undefined,
             }}
           </Result>
         );

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov