From 8e64ba67faff5b1eea1da40e5c89478b7490187c Mon Sep 17 00:00:00 2001
From: "meilin.huang" <954537473@qq.com>
Date: Fri, 7 Apr 2023 22:45:21 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=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
---
README.md | 3 ++
mayfly_go_web/package.json | 4 +-
.../src/components/contextmenu/index.vue | 3 --
.../layout/navBars/tagsView/tagsView.vue | 46 ++++++++-----------
mayfly_go_web/yarn.lock | 16 +++----
server/go.mod | 10 ++--
6 files changed, 38 insertions(+), 44 deletions(-)
diff --git a/README.md b/README.md
index c579674c..9a01a060 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,9 @@
+
+
+
diff --git a/mayfly_go_web/package.json b/mayfly_go_web/package.json
index 1b4dec96..da27942b 100644
--- a/mayfly_go_web/package.json
+++ b/mayfly_go_web/package.json
@@ -15,11 +15,11 @@
"countup.js": "^2.0.7",
"cropperjs": "^1.5.11",
"echarts": "^5.4.0",
- "element-plus": "^2.3.1",
+ "element-plus": "^2.3.2",
"jsencrypt": "^3.3.1",
"lodash": "^4.17.21",
"mitt": "^3.0.0",
- "monaco-editor": "^0.36.1",
+ "monaco-editor": "^0.37.1",
"monaco-sql-languages": "^0.11.0",
"monaco-themes": "^0.4.2",
"nprogress": "^0.2.0",
diff --git a/mayfly_go_web/src/components/contextmenu/index.vue b/mayfly_go_web/src/components/contextmenu/index.vue
index 131a8127..90bc2393 100644
--- a/mayfly_go_web/src/components/contextmenu/index.vue
+++ b/mayfly_go_web/src/components/contextmenu/index.vue
@@ -45,9 +45,6 @@ const state = reactive({
isShow: false,
dropdownList: [
{ contextMenuClickId: 0, txt: '刷新', affix: false, icon: 'RefreshRight' },
- { contextMenuClickId: 1, txt: '关闭', affix: false, icon: 'Close' },
- { contextMenuClickId: 2, txt: '关闭其他', affix: false, icon: 'CircleClose' },
- { contextMenuClickId: 3, txt: '关闭所有', affix: false, icon: 'FolderDelete' },
],
item: {} as any,
arrowLeft: 10,
diff --git a/mayfly_go_web/src/views/layout/navBars/tagsView/tagsView.vue b/mayfly_go_web/src/views/layout/navBars/tagsView/tagsView.vue
index 8f2f5563..0a34f379 100644
--- a/mayfly_go_web/src/views/layout/navBars/tagsView/tagsView.vue
+++ b/mayfly_go_web/src/views/layout/navBars/tagsView/tagsView.vue
@@ -36,7 +36,6 @@
import { reactive, onMounted, computed, ref, nextTick, onBeforeUpdate, onBeforeMount, onUnmounted, getCurrentInstance, watch } from 'vue';
import { useRoute, useRouter, onBeforeRouteUpdate } from 'vue-router';
import screenfull from 'screenfull';
-import pinia from '@/store/index';
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '@/store/themeConfig';
import { getSession, setSession, removeSession } from '@/common/utils/storage.ts';
@@ -52,13 +51,15 @@ const tagsUlRef = ref();
const { themeConfig } = storeToRefs(useThemeConfig());
const route = useRoute();
const router = useRouter();
-const state: any = reactive({
+
+const state = reactive({
routePath: route.fullPath,
dropdown: { x: '', y: '' },
tagsRefsIndex: 0,
- tagsViewList: [],
- sortable: '',
+ tagsViewList: [] as any,
+ sortable: '' as any,
});
+
// 动态设置 tagsView 风格样式
const setTagsStyle = computed(() => {
return themeConfig.value.tagsStyle;
@@ -81,7 +82,7 @@ const initTagsView = () => {
if (getSession('tagsViewList') && themeConfig.value.isCacheTagsView) {
state.tagsViewList = getSession('tagsViewList');
} else {
- state.tagsViews?.map((v: any) => {
+ state.tagsViewList?.map((v: any) => {
if (v.meta.isAffix && !v.meta.isHide) state.tagsViewList.push({ ...v });
});
addTagsView(route.fullPath);
@@ -127,28 +128,21 @@ const closeCurrentTagsView = (path: string) => {
if (v.fullPath === path) {
state.tagsViewList.splice(k, 1);
setTimeout(() => {
- if (state.tagsViewList.length === k && themeConfig.value.isShareTagsView ? state.routePath === path : state.routeActive === path) {
- // 最后一个且高亮时
- if (arr[arr.length - 1].meta.isDynamic) {
- // 动态路由(xxx/:id/:name")
- if (k !== arr.length) router.push({ name: arr[k].name, params: arr[k].params });
- else router.push({ name: arr[arr.length - 1].name, params: arr[arr.length - 1].params });
- } else {
- // 普通路由
- if (k !== arr.length) router.push({ path: arr[k].path, query: arr[k].query });
- else router.push({ path: arr[arr.length - 1].path, query: arr[arr.length - 1].query });
- }
+ if (state.routePath !== path) {
+ return;
+ }
+ let next;
+ // 最后一个且高亮时
+ if (state.tagsViewList.length === k) {
+ next = k !== arr.length ? arr[k] : arr[arr.length - 1]
} else {
- // 非最后一个且高亮时,跳转到下一个
- if (state.tagsViewList.length !== k && themeConfig.value.isShareTagsView ? state.routePath === path : state.routeActive === path) {
- if (arr[k].meta.isDynamic) {
- // 动态路由(xxx/:id/:name")
- router.push({ name: arr[k].name, params: arr[k].params });
- } else {
- // 普通路由
- router.push({ path: arr[k].path, query: arr[k].query });
- }
- }
+ next = arr[k];
+ }
+
+ if (next.meta.isDynamic) {
+ router.push({ name: next.name, params: next.params });
+ } else {
+ router.push({ path: next.path, query: next.query });
}
}, 0);
}
diff --git a/mayfly_go_web/yarn.lock b/mayfly_go_web/yarn.lock
index 3520f67c..290a514d 100644
--- a/mayfly_go_web/yarn.lock
+++ b/mayfly_go_web/yarn.lock
@@ -792,10 +792,10 @@ echarts@^5.4.0:
tslib "2.3.0"
zrender "5.4.0"
-element-plus@^2.3.1:
- version "2.3.1"
- resolved "https://registry.npmmirror.com/element-plus/-/element-plus-2.3.1.tgz#e4e13c28702709583ab978041145bc1367844842"
- integrity sha512-IBS7ic1mRyDXpOreRkredV4ByZSuax5HPb0zNOHm4qwKC4wm927yQv+Is0JbzxPzCW5zWaV4PLy9/Gl3E3v59w==
+element-plus@^2.3.2:
+ version "2.3.2"
+ resolved "https://registry.npmmirror.com/element-plus/-/element-plus-2.3.2.tgz#93abe96bcd5d00e96ef281e8d148391d698fb6e3"
+ integrity sha512-NIK0QckKKagdlMm3eLoVoD4Lkfj5ECzpZAxwrRLdm1Yi5qiTU9Guor33+IbIa52z4gHMuhMxgSVS2xAGmjLHsw==
dependencies:
"@ctrl/tinycolor" "^3.4.1"
"@element-plus/icons-vue" "^2.0.6"
@@ -1400,10 +1400,10 @@ mitt@^3.0.0:
resolved "https://registry.npmmirror.com/mitt/download/mitt-3.0.0.tgz"
integrity sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==
-monaco-editor@^0.36.1:
- version "0.36.1"
- resolved "https://registry.npmmirror.com/monaco-editor/-/monaco-editor-0.36.1.tgz#aad528c815605307473a1634612946921d8079b5"
- integrity sha512-/CaclMHKQ3A6rnzBzOADfwdSJ25BFoFT0Emxsc4zYVyav5SkK9iA6lEtIeuN/oRYbwPgviJT+t3l+sjFa28jYg==
+monaco-editor@^0.37.1:
+ version "0.37.1"
+ resolved "https://registry.npmmirror.com/monaco-editor/-/monaco-editor-0.37.1.tgz#d6f5ffb593e019e74e19bf8a2bdef5a691876f4e"
+ integrity sha512-jLXEEYSbqMkT/FuJLBZAVWGuhIb4JNwHE9kPTorAVmsdZ4UzHAfgWxLsVtD7pLRFaOwYPhNG9nUCpmFL1t/dIg==
monaco-sql-languages@^0.11.0:
version "0.11.0"
diff --git a/server/go.mod b/server/go.mod
index 8ed67adf..eaf70b53 100644
--- a/server/go.mod
+++ b/server/go.mod
@@ -14,8 +14,8 @@ require (
github.com/robfig/cron/v3 v3.0.1 // 定时任务
github.com/sirupsen/logrus v1.9.0
github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2
- go.mongodb.org/mongo-driver v1.11.3 // mongo
- golang.org/x/crypto v0.7.0 // ssh
+ go.mongodb.org/mongo-driver v1.11.4 // mongo
+ golang.org/x/crypto v0.8.0 // ssh
gopkg.in/yaml.v3 v3.0.1
// gorm
gorm.io/driver/mysql v1.4.7
@@ -55,9 +55,9 @@ require (
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/image v0.0.0-20220302094943-723b81ca9867 // indirect
- golang.org/x/net v0.8.0 // indirect
+ golang.org/x/net v0.9.0 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
- golang.org/x/sys v0.6.0 // indirect
- golang.org/x/text v0.8.0 // indirect
+ golang.org/x/sys v0.7.0 // indirect
+ golang.org/x/text v0.9.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)