From 340790dec4a080af91132d61c7579b47939c2d60 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 1 Aug 2022 09:47:11 +0800 Subject: [PATCH 1/2] chore: update deps --- sql/mysql/vue3-menu.sql | 2 ++ yudao-ui-admin-vue3/package.json | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sql/mysql/vue3-menu.sql b/sql/mysql/vue3-menu.sql index c5df92186..a92da0d1b 100644 --- a/sql/mysql/vue3-menu.sql +++ b/sql/mysql/vue3-menu.sql @@ -257,5 +257,7 @@ INSERT INTO `system_menu` VALUES (1264, '客户端查询', 'system:oauth2-client INSERT INTO `system_menu` VALUES (1265, '客户端创建', 'system:oauth2-client:create', 3, 2, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:23', b'0'); INSERT INTO `system_menu` VALUES (1266, '客户端更新', 'system:oauth2-client:update', 3, 3, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:28', b'0'); INSERT INTO `system_menu` VALUES (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'chart', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1282, '积木报表', '', 2, 1, 1281, 'jimu-report', 'example', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-28 21:17:34', b'0'); SET FOREIGN_KEY_CHECKS = 1; diff --git a/yudao-ui-admin-vue3/package.json b/yudao-ui-admin-vue3/package.json index 667a2f1a1..22024f5f0 100644 --- a/yudao-ui-admin-vue3/package.json +++ b/yudao-ui-admin-vue3/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi-vue-pro-vue3", - "version": "1.6.3.1601", + "version": "1.6.3.1611", "description": "基于vue3、element-plus、typesScript、vite3", "author": "xingyu", "private": false, @@ -69,7 +69,7 @@ "@typescript-eslint/parser": "^5.31.0", "@vitejs/plugin-vue": "^3.0.1", "@vitejs/plugin-vue-jsx": "^2.0.0", - "autoprefixer": "^10.4.7", + "autoprefixer": "^10.4.8", "eslint": "^8.20.0", "eslint-config-prettier": "^8.5.0", "eslint-define-config": "^1.5.1", @@ -92,15 +92,15 @@ "stylelint-order": "^5.0.0", "typescript": "4.7.4", "unplugin-vue-define-options": "^0.6.2", - "vite": "3.0.3", + "vite": "3.0.4", "vite-plugin-compression": "^0.5.1", "vite-plugin-eslint": "^1.7.0", "vite-plugin-html": "^3.2.0", "vite-plugin-purge-icons": "^0.8.2", - "vite-plugin-style-import": "^1.4.1", + "vite-plugin-style-import": "1.4.1", "vite-plugin-svg-icons": "^2.0.1", "vite-plugin-windicss": "^1.8.7", - "vue-tsc": "^0.39.2", + "vue-tsc": "^0.39.4", "windicss": "^3.5.6" }, "engines": { From 58cdc0be132964df2997195674a32aed915ca843 Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 1 Aug 2022 09:58:19 +0800 Subject: [PATCH 2/2] fix: fix menu active bug --- sql/mysql/vue3-menu.sql | 4 ++-- yudao-ui-admin-vue3/src/api/infra/codegen/types.ts | 1 + .../src/components/Menu/src/Menu.vue | 4 ++-- .../Menu/src/components/useRenderMenuItem.tsx | 14 ++++++-------- .../src/components/TagsView/src/TagsView.vue | 6 ++---- yudao-ui-admin-vue3/src/views/Home/Index.vue | 7 ++++++- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/sql/mysql/vue3-menu.sql b/sql/mysql/vue3-menu.sql index a92da0d1b..9e9c709b5 100644 --- a/sql/mysql/vue3-menu.sql +++ b/sql/mysql/vue3-menu.sql @@ -257,7 +257,7 @@ INSERT INTO `system_menu` VALUES (1264, '客户端查询', 'system:oauth2-client INSERT INTO `system_menu` VALUES (1265, '客户端创建', 'system:oauth2-client:create', 3, 2, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:23', b'0'); INSERT INTO `system_menu` VALUES (1266, '客户端更新', 'system:oauth2-client:update', 3, 3, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:28', b'0'); INSERT INTO `system_menu` VALUES (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'chart', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0'); -INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1282, '积木报表', '', 2, 1, 1281, 'jimu-report', 'example', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-28 21:17:34', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1281, '可视化报表', '', 1, 12, 0, '/visualization', 'ep:histogram', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-07-10 20:33:30', b'0'); +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `status`, `visible`, `keep_alive`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1282, '积木报表', '', 2, 1, 1281, 'jimu-report', 'ep:histogram', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-28 21:17:34', b'0'); SET FOREIGN_KEY_CHECKS = 1; diff --git a/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts b/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts index d4f87f3a9..57d9e3871 100644 --- a/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts +++ b/yudao-ui-admin-vue3/src/api/infra/codegen/types.ts @@ -1,4 +1,5 @@ export type CodegenTableVO = { + id: number tableId: number isParentMenuIdValid: boolean dataSourceConfigId: number diff --git a/yudao-ui-admin-vue3/src/components/Menu/src/Menu.vue b/yudao-ui-admin-vue3/src/components/Menu/src/Menu.vue index 78cede0c1..9fc79961e 100644 --- a/yudao-ui-admin-vue3/src/components/Menu/src/Menu.vue +++ b/yudao-ui-admin-vue3/src/components/Menu/src/Menu.vue @@ -94,8 +94,8 @@ export default defineComponent({ > {{ default: () => { - const { renderMenuItem } = useRenderMenuItem(unref(routers), unref(menuMode)) - return renderMenuItem() + const { renderMenuItem } = useRenderMenuItem(unref(menuMode)) + return renderMenuItem(unref(routers)) } }} diff --git a/yudao-ui-admin-vue3/src/components/Menu/src/components/useRenderMenuItem.tsx b/yudao-ui-admin-vue3/src/components/Menu/src/components/useRenderMenuItem.tsx index 4e785d232..17a520a61 100644 --- a/yudao-ui-admin-vue3/src/components/Menu/src/components/useRenderMenuItem.tsx +++ b/yudao-ui-admin-vue3/src/components/Menu/src/components/useRenderMenuItem.tsx @@ -1,23 +1,21 @@ import { ElSubMenu, ElMenuItem } from 'element-plus' import type { RouteMeta } from 'vue-router' -import { getAllParentPath, hasOneShowingChild } from '../helper' +import { hasOneShowingChild } from '../helper' import { isUrl } from '@/utils/is' import { useRenderMenuTitle } from './useRenderMenuTitle' import { useDesign } from '@/hooks/web/useDesign' import { pathResolve } from '@/utils/routerHelper' export const useRenderMenuItem = ( - allRouters: AppRouteRecordRaw[] = [], + // allRouters: AppRouteRecordRaw[] = [], menuMode: 'vertical' | 'horizontal' ) => { - const renderMenuItem = (routers?: AppRouteRecordRaw[]) => { - return (routers || allRouters).map((v) => { + const renderMenuItem = (routers: AppRouteRecordRaw[], parentPath = '/') => { + return routers.map((v) => { const meta = (v.meta ?? {}) as RouteMeta if (!meta.hidden) { const { oneShowingChild, onlyOneChild } = hasOneShowingChild(v.children, v) - const fullPath = isUrl(v.path) - ? v.path - : getAllParentPath(allRouters, v.path).join('/') + const fullPath = isUrl(v.path) ? v.path : pathResolve(parentPath, v.path) // getAllParentPath(allRouters, v.path).join('/') const { renderMenuTitle } = useRenderMenuTitle() @@ -46,7 +44,7 @@ export const useRenderMenuItem = ( > {{ title: () => renderMenuTitle(meta), - default: () => renderMenuItem(v.children) + default: () => renderMenuItem(v.children!, fullPath) }} ) diff --git a/yudao-ui-admin-vue3/src/components/TagsView/src/TagsView.vue b/yudao-ui-admin-vue3/src/components/TagsView/src/TagsView.vue index 64e701b6f..f5662dc42 100644 --- a/yudao-ui-admin-vue3/src/components/TagsView/src/TagsView.vue +++ b/yudao-ui-admin-vue3/src/components/TagsView/src/TagsView.vue @@ -492,15 +492,12 @@ watch( } } - &__item + &__item { - margin-left: 4px; - } - &__item { position: relative; top: 2px; height: calc(~'100% - 4px'); padding-right: 25px; + margin-left: 4px; font-size: 12px; cursor: pointer; border: 1px solid #d9d9d9; @@ -528,6 +525,7 @@ watch( &__item.is-active { color: var(--el-color-white); background-color: var(--el-color-primary); + border: 1px solid var(--el-color-primary); .@{prefix-cls}__item--close { :deep(span) { color: var(--el-color-white) !important; diff --git a/yudao-ui-admin-vue3/src/views/Home/Index.vue b/yudao-ui-admin-vue3/src/views/Home/Index.vue index 695e73c23..db371fb03 100644 --- a/yudao-ui-admin-vue3/src/views/Home/Index.vue +++ b/yudao-ui-admin-vue3/src/views/Home/Index.vue @@ -208,7 +208,12 @@ const getUserAccessSource = async () => { 'legend.data', data.map((v) => t(v.name)) ) - set(pieOptionsData, 'series.data', data) + pieOptionsData!.series![0].data = data.map((v) => { + return { + name: t(v.name), + value: v.value + } + }) } const barOptionsData = reactive(barOptions) as EChartsOption