+
-
+
{
if (route.meta?.hidden) {
- // 过滤不显示的子路由
return false;
} else {
route.meta!.hidden = false;
- // 临时变量(多个子路由 onlyOneChild 变量是用不上的)
onlyOneChild.value = route;
return true;
}
});
- // 如果只有一个子路由, 返回 true
+ // 如果只有一个或没有显示的子路由
if (showingChildren.length === 1) {
return true;
}
@@ -121,9 +121,10 @@ function hasOneShowingChild(
}
/**
- * 解析路由路径(相对路径 → 绝对路径)
+ * 解析路由路径,将相对路径转换为绝对路径
*
* @param routePath 路由路径
+ * @returns 绝对路径
*/
function resolvePath(routePath: string) {
if (isExternal(routePath)) {
From b60d11ed4d36e822093007afca575def1c43143e Mon Sep 17 00:00:00 2001
From: hxr <1490493387@qq.com>
Date: Tue, 25 Jun 2024 00:23:40 +0800
Subject: [PATCH 21/35] =?UTF-8?q?chore:=20:hammer:=20=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E5=8F=B7=E5=8D=87=E7=BA=A7=202.12.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 0cd539bc..ed6f20f5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "vue3-element-admin",
- "version": "2.11.5",
+ "version": "2.12.0",
"private": true,
"type": "module",
"scripts": {
From 3767d2d4b27ae24a4ea9ae4492a144a02e247a59 Mon Sep 17 00:00:00 2001
From: hxr <1490493387@qq.com>
Date: Tue, 25 Jun 2024 00:29:17 +0800
Subject: [PATCH 22/35] =?UTF-8?q?docs:=20:memo:=20=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E7=B2=BE=E7=AE=80=E7=89=88=20git=20=E4=BB=93=E5=BA=93=E5=9C=B0?=
=?UTF-8?q?=E5=9D=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 5822d321..5566178c 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@
- **基础设施**:动态路由、按钮权限、国际化、代码规范、Git 提交规范、常用组件封装。
-- **持续更新**:自2021年起,该项目持续开源更新,实时更新工具和依赖,积累了广泛的用户群体。
+- **持续更新**:项目持续开源更新,实时更新工具和依赖。
@@ -44,10 +44,11 @@
## 项目地址
-| 项目 | Gitee | Github | GitCode |
-| ---- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
+| 项目 | Gitee | Github |
+| ---- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 前端 | [vue3-element-admin](https://gitee.com/youlaiorg/vue3-element-admin) | [vue3-element-admin](https://github.com/youlaitech/vue3-element-admin) | [vue3-element-admin](https://gitcode.net/youlai/vue3-element-admin) |
-| 后端 | [youlai-boot](https://gitee.com/youlaiorg/youlai-boot) | [youlai-boot](https://github.com/haoxianrui/youlai-boot.git) | [youlai-boot](https://gitcode.net/youlai/youlai-boot) |
+| 精简版 | [vue3-element-admin-thin](https://gitee.com/cshaptx4869/vue3-element-admin-thin) | [vue3-element-admin-thin](https://github.com/youlaitech/vue3-element-admin-thin) |
+| 后端 | [youlai-boot](https://gitee.com/youlaiorg/youlai-boot) | [youlai-boot](https://github.com/haoxianrui/youlai-boot.git) |
## 环境准备
From 1ee3460ca9118ba1ed5fff65c88db1c024c3e1a2 Mon Sep 17 00:00:00 2001
From: hxr <1490493387@qq.com>
Date: Tue, 25 Jun 2024 00:34:50 +0800
Subject: [PATCH 23/35] =?UTF-8?q?chore:=20:hammer:=20=E8=B0=83=E6=95=B4=20?=
=?UTF-8?q?API=20=E5=9C=B0=E5=9D=80=E9=BB=98=E8=AE=A4=E7=BA=BF=E4=B8=8A?=
=?UTF-8?q?=E7=8E=AF=E5=A2=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.env.development b/.env.development
index 6268a702..548fc857 100644
--- a/.env.development
+++ b/.env.development
@@ -5,9 +5,9 @@ VITE_APP_PORT = 3000
VITE_APP_BASE_API = '/dev-api'
# 线上接口地址
-# VITE_APP_API_URL = http://vapi.youlai.tech
+VITE_APP_API_URL = http://vapi.youlai.tech
# 开发接口地址
-VITE_APP_API_URL = http://localhost:8989
+# VITE_APP_API_URL = http://localhost:8989
# 是否启用 Mock 服务
VITE_MOCK_DEV_SERVER = false
From 8e41161ba84a703bb54ee2e8e70dc8da414a7be2 Mon Sep 17 00:00:00 2001
From: hxr <1490493387@qq.com>
Date: Tue, 25 Jun 2024 07:33:09 +0800
Subject: [PATCH 24/35] =?UTF-8?q?docs:=20:memo:=20=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E5=8D=87=E7=BA=A7=E8=AF=B4=E6=98=8E=E8=A1=A5=E5=85=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
CHANGELOG.md | 39 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d4b8a4ba..fd2cef30 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,9 +1,46 @@
+# 2.11.5 (2024/6/18)
+
+## ✨ feat
+
+- 支持后端文件导入([#142](https://github.com/youlaitech/vue3-element-admin/pull/142)) [@cshaptx4869](https://github.com/cshaptx4869)
+
+
+## 🐛 fix
+- vue-dev-tools 插件导致菜单路由切换卡死,暂时关闭 ([28349e](https://github.com/youlaitech/vue3-element-admin/commit/28349efe147afab36531ba148eaac3a448fe6c71)) [@haoxianrui](https://github.com/haoxianrui)
+
+
+
+# 2.11.4 (2024/6/16)
+
+## ✨ feat
+
+- 操作栏增加render配置参数([#138](https://github.com/youlaitech/vue3-element-admin/pull/140)) [@cshaptx4869](https://github.com/cshaptx4869)
+- 左侧工具栏增加type配置参数([#141](https://github.com/youlaitech/vue3-element-admin/pull/141)) [@diamont1001](https://github.com/diamont1001)
+
+## ♻️ refactor
+- 更换权限分配弹窗类型为 drawer 并添加父子联动开关([2d9193](https://github.com/youlaitech/vue3-element-admin/commit/2d9193c47fd224f01f82b9c0b2bbeb5e7cb33584)) [@haoxianrui](https://github.com/haoxianrui)
+
+
+
+# 2.11.3 (2024/6/11)
+
+## ✨ feat
+
+- 支持默认工具栏的导入([#138](https://github.com/youlaitech/vue3-element-admin/pull/138)) [@cshaptx4869](https://github.com/cshaptx4869)
+- 添加CURD导入示例([19e7bb](https://github.com/youlaitech/vue3-element-admin/commit/eab91effd6a01d5a3d9257249c8d06aa252b3bf8)) [@cshaptx4869](https://github.com/cshaptx4869)
+
+## ♻️ refactor
+- 修改导出全量数据选项文本([904fec](https://github.com/youlaitech/vue3-element-admin/commit/904fecad65217650482fcdbb10ffb7f3d27eb9ea)) [@cshaptx4869](https://github.com/cshaptx4869)
+
+## 🐛 fix
+- 菜单列表未适配el-icon导致图标不显示问题修复([e72b68](https://github.com/youlaitech/vue3-element-admin/commit/e72b68337562b5a7ea24ad55bbe00023e1266b40)) [@haoxianrui](https://github.com/haoxianrui)
+
# 2.11.2 (2024/6/8)
## ✨ feat
-- 支持表格远程筛选([#131](https://github.com/youlaitech/vue3-element-admin/pull/119)) [@cshaptx4869](https://github.com/cshaptx4869)
+- 支持表格远程筛选([#131](https://github.com/youlaitech/vue3-element-admin/pull/131)) [@cshaptx4869](https://github.com/cshaptx4869)
- 支持标签输入框([#132](https://github.com/youlaitech/vue3-element-admin/pull/132)) [@cshaptx4869](https://github.com/cshaptx4869)
- 表单项支持tips配置([#133](https://github.com/youlaitech/vue3-element-admin/pull/133)) [@cshaptx4869](https://github.com/cshaptx4869)
- 前端导出支持全量数据([#134](https://github.com/youlaitech/vue3-element-admin/pull/134)) [@cshaptx4869](https://github.com/cshaptx4869)
From 34599901c77f4f9381be95b56c9dcd2fec414465 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=83=A1=E5=B0=91=E7=BF=94?= <971366405@qq.com>
Date: Tue, 25 Jun 2024 11:57:28 +0800
Subject: [PATCH 25/35] =?UTF-8?q?feat(tagView):=20:sparkles:=20=E5=A2=9E?=
=?UTF-8?q?=E5=8A=A0=E5=85=B3=E9=97=AD=E5=BD=93=E5=89=8DtagView=E6=96=B9?=
=?UTF-8?q?=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
增加关闭当前tagView方法
---
src/layout/components/TagsView/index.vue | 32 ++++-------------
src/store/modules/tagsView.ts | 44 +++++++++++++++++++++++-
2 files changed, 49 insertions(+), 27 deletions(-)
diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue
index 7d2096fe..031d8641 100644
--- a/src/layout/components/TagsView/index.vue
+++ b/src/layout/components/TagsView/index.vue
@@ -9,7 +9,7 @@
ref="tagRef"
v-for="tag in visitedViews"
:key="tag.fullPath"
- :class="'tags-item ' + (isActive(tag) ? 'active' : '')"
+ :class="'tags-item ' + (tagsViewStore.isActive(tag) ? 'active' : '')"
:to="{ path: tag.path, query: tag.query }"
@click.middle="!isAffix(tag) ? closeSelectedTag(tag) : ''"
@contextmenu.prevent="openContentMenu(tag, $event)"
@@ -190,10 +190,6 @@ function moveToCurrentTag() {
});
}
-function isActive(tag: TagView) {
- return tag.path === route.path;
-}
-
function isAffix(tag: TagView) {
return tag?.affix;
}
@@ -228,26 +224,10 @@ function refreshSelectedTag(view: TagView) {
});
}
-function toLastView(visitedViews: TagView[], view?: TagView) {
- const latestView = visitedViews.slice(-1)[0];
- if (latestView && latestView.fullPath) {
- router.push(latestView.fullPath);
- } else {
- // now the default is to redirect to the home page if there is no tags-view,
- // you can adjust it according to your needs.
- if (view?.name === "Dashboard") {
- // to reload home page
- router.replace("/redirect" + view.fullPath);
- } else {
- router.push("/");
- }
- }
-}
-
function closeSelectedTag(view: TagView) {
tagsViewStore.delView(view).then((res: any) => {
- if (isActive(view)) {
- toLastView(res.visitedViews, view);
+ if (tagsViewStore.isActive(view)) {
+ tagsViewStore.toLastView(res.visitedViews, view);
}
});
}
@@ -255,14 +235,14 @@ function closeSelectedTag(view: TagView) {
function closeLeftTags() {
tagsViewStore.delLeftViews(selectedTag.value).then((res: any) => {
if (!res.visitedViews.find((item: any) => item.path === route.path)) {
- toLastView(res.visitedViews);
+ tagsViewStore.toLastView(res.visitedViews);
}
});
}
function closeRightTags() {
tagsViewStore.delRightViews(selectedTag.value).then((res: any) => {
if (!res.visitedViews.find((item: any) => item.path === route.path)) {
- toLastView(res.visitedViews);
+ tagsViewStore.toLastView(res.visitedViews);
}
});
}
@@ -276,7 +256,7 @@ function closeOtherTags() {
function closeAllTags(view: TagView) {
tagsViewStore.delAllViews().then((res: any) => {
- toLastView(res.visitedViews, view);
+ tagsViewStore.toLastView(res.visitedViews, view);
});
}
diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts
index 9e66c10e..a92e4fe8 100644
--- a/src/store/modules/tagsView.ts
+++ b/src/store/modules/tagsView.ts
@@ -1,7 +1,8 @@
export const useTagsViewStore = defineStore("tagsView", () => {
const visitedViews = ref([]);
const cachedViews = ref([]);
-
+ const router = useRouter();
+ const route = useRoute();
/**
* 添加已访问视图到已访问视图列表中
*/
@@ -189,6 +190,44 @@ export const useTagsViewStore = defineStore("tagsView", () => {
});
}
+ /**
+ * 关闭当前tagView
+ */
+ function closeCurrentView() {
+ const tags: TagView = {
+ name: route.name as string,
+ title: route.meta.title as string,
+ path: route.path,
+ fullPath: route.fullPath,
+ affix: route.meta?.affix,
+ keepAlive: route.meta?.keepAlive,
+ query: route.query,
+ };
+ delView(tags).then((res: any) => {
+ if (isActive(tags)) {
+ toLastView(res.visitedViews, tags);
+ }
+ });
+ }
+ function isActive(tag: TagView) {
+ return tag.path === route.path;
+ }
+
+ function toLastView(visitedViews: TagView[], view?: TagView) {
+ const latestView = visitedViews.slice(-1)[0];
+ if (latestView && latestView.fullPath) {
+ router.push(latestView.fullPath);
+ } else {
+ // now the default is to redirect to the home page if there is no tags-view,
+ // you can adjust it according to your needs.
+ if (view?.name === "Dashboard") {
+ // to reload home page
+ router.replace("/redirect" + view.fullPath);
+ } else {
+ router.push("/");
+ }
+ }
+ }
return {
visitedViews,
cachedViews,
@@ -207,5 +246,8 @@ export const useTagsViewStore = defineStore("tagsView", () => {
delAllViews,
delAllVisitedViews,
delAllCachedViews,
+ closeCurrentView,
+ isActive,
+ toLastView,
};
});
From 035497f76015e5ab0ffc0071a3e246fdd5538135 Mon Sep 17 00:00:00 2001
From: hxr <1490493387@qq.com>
Date: Tue, 25 Jun 2024 21:00:23 +0800
Subject: [PATCH 26/35] =?UTF-8?q?fix:=20:bug:=20=E7=B1=BB=E5=9E=8B?=
=?UTF-8?q?=E5=AF=BC=E5=85=A5=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
IA879P #IA879P
---
src/store/modules/permission.ts | 3 +--
src/views/login/index.vue | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts
index f2e6f932..25306e68 100644
--- a/src/store/modules/permission.ts
+++ b/src/store/modules/permission.ts
@@ -1,8 +1,7 @@
import { RouteRecordRaw } from "vue-router";
import { constantRoutes } from "@/router";
import { store } from "@/store";
-import MenuAPI from "@/api/menu";
-import { RouteVO } from "@/api/menu/types";
+import MenuAPI, { RouteVO } from "@/api/menu";
const modules = import.meta.glob("../../views/**/**.vue");
const Layout = () => import("@/layout/index.vue");
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 42561365..6ac0c3ac 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -115,8 +115,7 @@
-
+
From 8729a1fb683d575786e86a19abf0f58046bc5f4b Mon Sep 17 00:00:00 2001
From: hxr <1490493387@qq.com>
Date: Wed, 26 Jun 2024 20:58:16 +0800
Subject: [PATCH 34/35] =?UTF-8?q?fix:=20:bug:=20=E7=99=BB=E5=BD=95?=
=?UTF-8?q?=E9=A1=B5=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96=E5=90=8E=E5=BC=95?=
=?UTF-8?q?=E5=8F=91=E7=9A=84=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/styles/login.scss | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/styles/login.scss b/src/styles/login.scss
index 84dc054e..19778763 100644
--- a/src/styles/login.scss
+++ b/src/styles/login.scss
@@ -10,11 +10,13 @@
.top-bar {
position: absolute;
- top: 1rem;
- left: 1rem;
+ top: 0;
+ left: 0;
display: flex;
+ align-items: center;
justify-content: flex-end;
width: 100%;
+ padding: 12px;
}
.lang-select {
From 593e098b2e0ecbc21d824a049f78c85d71192aa0 Mon Sep 17 00:00:00 2001
From: hxr <1490493387@qq.com>
Date: Thu, 27 Jun 2024 08:24:53 +0800
Subject: [PATCH 35/35] =?UTF-8?q?refactor:=20:recycle:=20=E7=99=BB?=
=?UTF-8?q?=E5=BD=95=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F=E7=B2=BE=E7=AE=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/styles/login.scss | 7 +------
src/views/login/index.vue | 2 +-
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/styles/login.scss b/src/styles/login.scss
index 19778763..ede34896 100644
--- a/src/styles/login.scss
+++ b/src/styles/login.scss
@@ -16,12 +16,7 @@
align-items: center;
justify-content: flex-end;
width: 100%;
- padding: 12px;
- }
-
- .lang-select {
- margin-left: 0.5rem;
- cursor: pointer;
+ padding: 10px;
}
.login-card {
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 172b74e0..87eca0eb 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -9,7 +9,7 @@
inactive-icon="Sunny"
@change="toggleTheme"
/>
-
+