diff --git a/README.md b/README.md index cf45b101..e205e28c 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,9 @@ - [启动文档](https://doc.iocoder.cn/quick-start/) - [视频教程](https://doc.iocoder.cn/video/) -## 交流群 +## 交流群 && 外包項目 -index.vue +- [Star 点击查看](https://gitee.com/yudaocode/yudao-ui-admin-vben/issues/I6R8J0) ## 开发进度 @@ -39,7 +39,7 @@ | --- | --- | --- | | [Vue](https://staging-cn.vuejs.org/) | Vue 框架 | 3.2.47 | | [Vite](https://cn.vitejs.dev//) | 开发与构建工具 | 4.3.1 | -| [ant-design-vue](https://antdv.com/) | ant-design-vue | 3.2.18 | +| [ant-design-vue](https://antdv.com/) | ant-design-vue | 3.2.19 | | [TypeScript](https://www.typescriptlang.org/docs/) | JavaScript 的超集 | 5.0.4 | | [pinia](https://pinia.vuejs.org/) | Vue 存储库 替代 vuex5 | 2.0.35 | | [vueuse](https://vueuse.org/) | 常用工具集 | 10.1.0 | diff --git a/package.json b/package.json index 48819377..8eca6faf 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@vue/runtime-core": "^3.2.47", "@vueuse/core": "^10.1.0", "@zxcvbn-ts/core": "^2.2.1", - "ant-design-vue": "^3.2.18", + "ant-design-vue": "^3.2.19", "axios": "^1.3.6", "codemirror": "^5.65.3", "cropperjs": "^1.5.13", @@ -99,16 +99,16 @@ "esno": "^0.16.3", "fs-extra": "^11.1.1", "husky": "^8.0.3", - "inquirer": "^9.1.5", + "inquirer": "^9.2.0", "less": "^4.1.3", "lint-staged": "^13.2.1", "picocolors": "^1.0.0", "postcss": "^8.4.23", "postcss-html": "^1.5.0", "postcss-less": "^6.0.0", - "prettier": "^2.8.7", + "prettier": "^2.8.8", "rimraf": "^5.0.0", - "rollup": "^3.20.7", + "rollup": "^3.21.0", "rollup-plugin-visualizer": "^5.9.0", "stylelint": "^15.6.0", "stylelint-config-recommended": "^12.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3a7daac..f0d6cc14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,8 +20,8 @@ dependencies: specifier: ^2.2.1 version: 2.2.1 ant-design-vue: - specifier: ^3.2.18 - version: 3.2.18(vue@3.2.47) + specifier: ^3.2.19 + version: 3.2.19(vue@3.2.47) axios: specifier: ^1.3.6 version: 1.3.6(debug@4.3.4) @@ -182,7 +182,7 @@ devDependencies: version: 8.8.0(eslint@8.39.0) eslint-plugin-prettier: specifier: ^4.2.1 - version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.39.0)(prettier@2.8.7) + version: 4.2.1(eslint-config-prettier@8.8.0)(eslint@8.39.0)(prettier@2.8.8) eslint-plugin-vue: specifier: ^9.11.0 version: 9.11.0(eslint@8.39.0) @@ -196,8 +196,8 @@ devDependencies: specifier: ^8.0.3 version: 8.0.3 inquirer: - specifier: ^9.1.5 - version: 9.1.5 + specifier: ^9.2.0 + version: 9.2.0 less: specifier: ^4.1.3 version: 4.1.3 @@ -217,17 +217,17 @@ devDependencies: specifier: ^6.0.0 version: 6.0.0(postcss@8.4.23) prettier: - specifier: ^2.8.7 - version: 2.8.7 + specifier: ^2.8.8 + version: 2.8.8 rimraf: specifier: ^5.0.0 version: 5.0.0 rollup: - specifier: ^3.20.7 - version: 3.20.7 + specifier: ^3.21.0 + version: 3.21.0 rollup-plugin-visualizer: specifier: ^5.9.0 - version: 5.9.0(rollup@3.20.7) + version: 5.9.0(rollup@3.21.0) stylelint: specifier: ^15.6.0 version: 15.6.0 @@ -281,7 +281,7 @@ devDependencies: version: 1.8.10(vite@4.3.1) vite-vue-plugin-html: specifier: ^1.0.1 - version: 1.0.1(rollup@3.20.7)(vite@4.3.1) + version: 1.0.1(rollup@3.21.0)(vite@4.3.1) vite-vue-plugin-theme: specifier: ^1.0.0 version: 1.0.0(vite@4.3.1) @@ -2326,7 +2326,7 @@ packages: rollup: 2.79.1 dev: true - /@rollup/plugin-replace@5.0.2(rollup@3.20.7): + /@rollup/plugin-replace@5.0.2(rollup@3.21.0): resolution: {integrity: sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2335,9 +2335,9 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.7) + '@rollup/pluginutils': 5.0.2(rollup@3.21.0) magic-string: 0.27.0 - rollup: 3.20.7 + rollup: 3.21.0 dev: true /@rollup/pluginutils@3.1.0(rollup@2.79.1): @@ -2360,7 +2360,7 @@ packages: picomatch: 2.3.1 dev: true - /@rollup/pluginutils@5.0.2(rollup@3.20.7): + /@rollup/pluginutils@5.0.2(rollup@3.21.0): resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2372,7 +2372,7 @@ packages: '@types/estree': 1.0.0 estree-walker: 2.0.2 picomatch: 2.3.1 - rollup: 3.20.7 + rollup: 3.21.0 dev: true /@simonwep/pickr@1.8.2: @@ -3010,8 +3010,8 @@ packages: engines: {node: '>=12'} dev: true - /ant-design-vue@3.2.18(vue@3.2.47): - resolution: {integrity: sha512-8jqy2on2W7E2JQ/bxGsrHz6f/nwXLvOJV11Js1TIFJOlcHRKOzhomt0QArew88Tx1IL8KjXQbRHlN/h0qBdbLw==} + /ant-design-vue@3.2.19(vue@3.2.47): + resolution: {integrity: sha512-weizTa70qNhyj8tOoplTcpt85OkVHpnreK2skdTmORFAGDGvF15zyoqCNg2tByzn2xxf2DloQQvZYKlN/i0CGw==} engines: {node: '>=12.22.0'} peerDependencies: vue: '>=3.2.0' @@ -4480,7 +4480,7 @@ packages: eslint: 8.39.0 dev: true - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.39.0)(prettier@2.8.7): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.8.0)(eslint@8.39.0)(prettier@2.8.8): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -4493,7 +4493,7 @@ packages: dependencies: eslint: 8.39.0 eslint-config-prettier: 8.8.0(eslint@8.39.0) - prettier: 2.8.7 + prettier: 2.8.8 prettier-linter-helpers: 1.0.0 dev: true @@ -5395,8 +5395,8 @@ packages: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} dev: true - /inquirer@9.1.5: - resolution: {integrity: sha512-3ygAIh8gcZavV9bj6MTdYddG2zPSYswP808fKS46NOwlF0zZljVpnLCHODDqItWJDbDpLb3aouAxGaJbkxoppA==} + /inquirer@9.2.0: + resolution: {integrity: sha512-WWERbVqjsTXjXub1ZW0ZHDit1dyHqy0T9XIkky9TnmKAPrjU9Jkd59nZPK0dUuM3s73GZAZu2Jo4iFU3XSPVLA==} engines: {node: '>=14.18.0'} dependencies: ansi-escapes: 6.1.0 @@ -6998,8 +6998,8 @@ packages: fast-diff: 1.2.0 dev: true - /prettier@2.8.7: - resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==} + /prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} hasBin: true dev: true @@ -7352,7 +7352,7 @@ packages: terser: 5.17.1 dev: true - /rollup-plugin-visualizer@5.9.0(rollup@3.20.7): + /rollup-plugin-visualizer@5.9.0(rollup@3.21.0): resolution: {integrity: sha512-bbDOv47+Bw4C/cgs0czZqfm8L82xOZssk4ayZjG40y9zbXclNk7YikrZTDao6p7+HDiGxrN0b65SgZiVm9k1Cg==} engines: {node: '>=14'} hasBin: true @@ -7364,7 +7364,7 @@ packages: dependencies: open: 8.4.2 picomatch: 2.3.1 - rollup: 3.20.7 + rollup: 3.21.0 source-map: 0.7.4 yargs: 17.7.1 dev: true @@ -7377,8 +7377,8 @@ packages: fsevents: 2.3.2 dev: true - /rollup@3.20.7: - resolution: {integrity: sha512-P7E2zezKSLhWnTz46XxjSmInrbOCiul1yf+kJccMxT56vxjHwCbDfoLbiqFgu+WQoo9ij2PkraYaBstgB2prBA==} + /rollup@3.21.0: + resolution: {integrity: sha512-ANPhVcyeHvYdQMUyCbczy33nbLzI7RzrBje4uvNiTDJGIMtlKoOStmympwr9OtS1LZxiDmE2wvxHyVhoLtf1KQ==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -8522,11 +8522,11 @@ packages: workbox-build: ^6.5.4 workbox-window: ^6.5.4 dependencies: - '@rollup/plugin-replace': 5.0.2(rollup@3.20.7) + '@rollup/plugin-replace': 5.0.2(rollup@3.21.0) debug: 4.3.4 fast-glob: 3.2.12 pretty-bytes: 6.1.0 - rollup: 3.20.7 + rollup: 3.21.0 vite: 4.3.1(@types/node@18.16.0)(less@4.1.3)(terser@5.17.1) workbox-build: 6.5.4 workbox-window: 6.5.4 @@ -8581,12 +8581,12 @@ packages: - supports-color dev: true - /vite-vue-plugin-html@1.0.1(rollup@3.20.7)(vite@4.3.1): + /vite-vue-plugin-html@1.0.1(rollup@3.21.0)(vite@4.3.1): resolution: {integrity: sha512-jbN7p8pOR0aiYndFuPgyQwRAyEp8kIoy6EL741wMh3nDLVjHn4Atfby0k0Jg0aDfWCjoAc9paKdoLoEqOAC9PA==} peerDependencies: vite: '>=4.2.0' dependencies: - '@rollup/pluginutils': 5.0.2(rollup@3.20.7) + '@rollup/pluginutils': 5.0.2(rollup@3.21.0) colorette: 2.0.19 connect-history-api-fallback: 2.0.0 consola: 2.15.3 @@ -8650,7 +8650,7 @@ packages: esbuild: 0.17.15 less: 4.1.3 postcss: 8.4.23 - rollup: 3.20.7 + rollup: 3.21.0 terser: 5.17.1 optionalDependencies: fsevents: 2.3.2 diff --git a/src/router/helper/routeHelper.ts b/src/router/helper/routeHelper.ts index 2d12bfce..83f7af0d 100644 --- a/src/router/helper/routeHelper.ts +++ b/src/router/helper/routeHelper.ts @@ -8,7 +8,7 @@ import { isUrl } from '@/utils/is' export type LayoutMapKey = 'LAYOUT' const IFRAME = () => import('@/views/base/iframe/FrameBlank.vue') - +const URL_HASH_TAB = `__AGWE4H__HASH__TAG__PWHRG__` const LayoutMap = new Map Promise>() LayoutMap.set('LAYOUT', LAYOUT) @@ -21,6 +21,18 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) { dynamicViewsModules = dynamicViewsModules || import.meta.glob('../../views/**/*.{vue,tsx}') if (!routes) return routes.forEach((item) => { + if (/^\/?http(s)?/.test(item.component as string)) { + item.component = item.component.substring(1, item.component.length) + } + if (/^http(s)?/.test(item.component as string)) { + if (item.meta?.internalOrExternal) { + item.path = item.component + item.path = item.path.replace('#', URL_HASH_TAB) + } else { + item.meta.frameSrc = item.component + } + delete item.component + } if (!item.component && item.meta?.frameSrc) { item.component = 'IFRAME' } diff --git a/src/router/index.ts b/src/router/index.ts index ab4214e8..5bbfeb34 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,7 +1,7 @@ import type { RouteRecordRaw } from 'vue-router' import type { App } from 'vue' -import { createRouter, createWebHashHistory } from 'vue-router' +import { createRouter, createWebHistory } from 'vue-router' import { basicRoutes } from './routes' // 白名单应该包含基本静态路由 @@ -17,7 +17,7 @@ getRouteNames(basicRoutes) // 创建一个可以被 Vue 应用程序使用的路由实例 export const router = createRouter({ // 创建一个 hash 历史记录。 - history: createWebHashHistory(import.meta.env.VITE_PUBLIC_PATH), + history: createWebHistory(import.meta.env.VITE_PUBLIC_PATH), // createWebHashHistory // 应该添加到路由的初始路由列表。 routes: basicRoutes as unknown as RouteRecordRaw[], // 是否应该禁止尾部斜杠。默认为假 diff --git a/src/router/routes/modules/menu.ts b/src/router/routes/modules/menu.ts new file mode 100644 index 00000000..bc4c1d0a --- /dev/null +++ b/src/router/routes/modules/menu.ts @@ -0,0 +1,30 @@ +import type { AppRouteModule } from '@/router/types' + +import { LAYOUT } from '@/router/constant' + +const menu: AppRouteModule = { + path: '/sysmenu', + name: 'SysMenu', + component: LAYOUT, + redirect: '/sysmenu/index', + meta: { + hideChildrenInMenu: true, + icon: 'ant-design:bank-twotone', + title: '系统菜单', + orderNo: 9999 + }, + children: [ + { + path: 'index', + name: 'SystemMenu', + component: () => import('@/views/system/menu/index.vue'), + meta: { + title: '系统菜单', + icon: 'ant-design:bank-twotone', + hideMenu: true + } + } + ] +} + +export default menu diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 2a0a1727..5e99cd9a 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -8,6 +8,7 @@ import { useUserStore } from './user' import { useAppStoreWithOut } from './app' import { asyncRoutes } from '@/router/routes' import about from '@/router/routes/modules/about' +import menu from '@/router/routes/modules/menu' import dashboard from '@/router/routes/modules/dashboard' import { PAGE_NOT_FOUND_ROUTE } from '@/router/routes/basic' import { transformRouteToMenu } from '@/router/helper/menuHelper' @@ -227,7 +228,7 @@ export const usePermissionStore = defineStore('app-permission', { // Background routing to menu structure // 后台路由到菜单结构 - const backMenuList = transformRouteToMenu([dashboard, ...routeList, about]) + const backMenuList = transformRouteToMenu([dashboard, ...routeList, menu, about]) this.setBackMenuList(backMenuList) // remove meta.ignoreRoute item @@ -235,7 +236,7 @@ export const usePermissionStore = defineStore('app-permission', { routeList = filter(routeList, routeRemoveIgnoreFilter) routeList = routeList.filter(routeRemoveIgnoreFilter) routeList = flatMultiLevelRoutes(routeList) - routes = [PAGE_NOT_FOUND_ROUTE, dashboard, ...routeList, about] + routes = [PAGE_NOT_FOUND_ROUTE, dashboard, ...routeList, menu, about] break } diff --git a/src/views/infra/codegen/components/ImportTableModal.vue b/src/views/infra/codegen/components/ImportTableModal.vue index 166bd891..9c86d7c2 100644 --- a/src/views/infra/codegen/components/ImportTableModal.vue +++ b/src/views/infra/codegen/components/ImportTableModal.vue @@ -11,7 +11,7 @@ import { createCodegenList, getSchemaTableList } from '@/api/infra/codegen' const emit = defineEmits(['success', 'register']) -const [registerTable, { getSelectRowKeys }] = useTable({ +const [registerTable, { getSelectRowKeys, getForm }] = useTable({ api: getSchemaTableList, columns: importTableColumns, formConfig: { @@ -32,8 +32,8 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async () => async function handleSubmit() { const datas = await getSelectRowKeys() - console.info(datas) - await createCodegenList({ dataSourceConfigId: 0, tableNames: datas }) + const form = await getForm() + await createCodegenList({ dataSourceConfigId: form.getFieldsValue().dataSourceConfigId, tableNames: datas }) closeModal() emit('success') }