From 699b174f95ffb26d50210a3d938eabd1f265eb98 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Mon, 15 Apr 2024 11:15:57 +0800 Subject: [PATCH 1/5] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=A1=B6=E7=BA=A7=E8=8F=9C=E5=8D=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/utils.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/router/utils.ts b/src/router/utils.ts index ba5a29d32..35065c723 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -367,9 +367,23 @@ function hasAuth(value: string | Array): boolean { return isAuths ? true : false; } +function handleTopMenu(route) { + if (route?.children && route.children.length > 1) { + if (route.redirect) { + return route.children.filter(cur => cur.path === route.redirect)[0]; + } else { + return route.children[0]; + } + } else { + return route; + } +} + /** 获取所有菜单中的第一个菜单(顶级菜单)*/ function getTopMenu(tag = false): menuType { - const topMenu = usePermissionStoreHook().wholeMenus[0]?.children[0]; + const topMenu = handleTopMenu( + usePermissionStoreHook().wholeMenus[0]?.children[0] + ); tag && useMultiTagsStoreHook().handleTags("push", topMenu); return topMenu; } From a5b57908ec13811dcaafd2992dac8dad3c425060 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Mon, 15 Apr 2024 11:40:15 +0800 Subject: [PATCH 2/5] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E7=99=BD=E5=90=8D=E5=8D=95=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=9B=B4=E5=A4=9A=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/http/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/http/index.ts b/src/utils/http/index.ts index 5f40e6969..594a8bc96 100644 --- a/src/utils/http/index.ts +++ b/src/utils/http/index.ts @@ -74,7 +74,7 @@ class PureHttp { } /** 请求白名单,放置一些不需要token的接口(通过设置请求白名单,防止token过期后再请求造成的死循环问题) */ const whiteList = ["/refresh-token", "/login"]; - return whiteList.find(url => url === config.url) + return whiteList.some(url => config.url.endsWith(url)) ? config : new Promise(resolve => { const data = getToken(); From ea36e260e201e0947cba1059115e0b016ad2c11b Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Mon, 15 Apr 2024 12:52:01 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BD=93=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E9=A1=B5=E9=9D=A2=E5=AD=98=E5=9C=A8=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?`RePureTableBar`=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=88=97=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E5=B8=B8=E6=8B=96=E5=8A=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/RePureTableBar/src/bar.tsx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/RePureTableBar/src/bar.tsx b/src/components/RePureTableBar/src/bar.tsx index b2a755567..615785249 100644 --- a/src/components/RePureTableBar/src/bar.tsx +++ b/src/components/RePureTableBar/src/bar.tsx @@ -1,7 +1,15 @@ import Sortable from "sortablejs"; import { transformI18n } from "@/plugins/i18n"; import { useEpThemeStoreHook } from "@/store/modules/epTheme"; -import { defineComponent, ref, computed, type PropType, nextTick } from "vue"; +import { + type PropType, + ref, + unref, + computed, + nextTick, + defineComponent, + getCurrentInstance +} from "vue"; import { delay, cloneDeep, @@ -34,6 +42,10 @@ const props = { isExpandAll: { type: Boolean, default: true + }, + tableKey: { + type: [String, Number] as PropType, + default: "0" } }; @@ -46,6 +58,7 @@ export default defineComponent({ const loading = ref(false); const checkAll = ref(true); const isIndeterminate = ref(false); + const instance = getCurrentInstance()!; const isExpandAll = ref(props.isExpandAll); const filterColumns = cloneDeep(props?.columns).filter(column => isBoolean(column?.hide) @@ -170,9 +183,9 @@ export default defineComponent({ const rowDrop = (event: { preventDefault: () => void }) => { event.preventDefault(); nextTick(() => { - const wrapper: HTMLElement = document.querySelector( - ".el-checkbox-group>div" - ); + const wrapper: HTMLElement = ( + instance?.proxy?.$refs[`GroupRef${unref(props.tableKey)}`] as any + ).$el.firstElementChild; Sortable.create(wrapper, { animation: 300, handle: ".drag-btn", @@ -299,6 +312,7 @@ export default defineComponent({
handleCheckedColumnsChange(value)} > From dbb05f416642bbf44263dc29da209c273301e549 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Mon, 15 Apr 2024 16:25:01 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=89=E7=BA=A7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E5=90=91=E5=B7=A6=E6=8A=98=E5=8F=A0=E5=90=8E?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/sidebar/sidebarItem.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/layout/components/sidebar/sidebarItem.vue b/src/layout/components/sidebar/sidebarItem.vue index 8aa67d777..f9d16018a 100644 --- a/src/layout/components/sidebar/sidebarItem.vue +++ b/src/layout/components/sidebar/sidebarItem.vue @@ -145,7 +145,7 @@ function resolvePath(routePath) { props.item?.pathList?.length === 2) " truncated - class="!px-4 !text-inherit" + class="!w-full !px-4 !text-inherit" > {{ transformI18n(onlyOneChild.meta.title) }} @@ -157,7 +157,7 @@ function resolvePath(routePath) { offset: [0, -10], theme: tooltipEffect }" - class="!text-inherit" + class="!w-full !text-inherit" > {{ transformI18n(onlyOneChild.meta.title) }} @@ -185,18 +185,21 @@ function resolvePath(routePath) {
- +