From 10e432243e937699efba719afac02f0b3a73719d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E5=AE=87=E5=BA=86?=
Date: Tue, 15 Oct 2024 04:46:34 +0000
Subject: [PATCH 1/7] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?=
=?UTF-8?q?=E6=96=87=E7=AB=A0=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BAID?=
=?UTF-8?q?=E6=96=B9=E4=BE=BF=E6=9E=84=E9=80=A0=E9=93=BE=E6=8E=A5=EF=BC=8C?=
=?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=80=E6=AC=BE=E7=8A=B6=E6=80=81=E5=88=97?=
=?UTF-8?q?=E5=AE=BD=E6=98=BE=E7=A4=BA=E5=AE=8C=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 杨宇庆
---
src/views/mall/promotion/article/index.vue | 1 +
src/views/pay/refund/index.vue | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/views/mall/promotion/article/index.vue b/src/views/mall/promotion/article/index.vue
index 20ad4ce1..875168eb 100644
--- a/src/views/mall/promotion/article/index.vue
+++ b/src/views/mall/promotion/article/index.vue
@@ -80,6 +80,7 @@
+
diff --git a/src/views/pay/refund/index.vue b/src/views/pay/refund/index.vue
index eaa17b4c..2a985688 100644
--- a/src/views/pay/refund/index.vue
+++ b/src/views/pay/refund/index.vue
@@ -121,7 +121,7 @@
label="创建时间"
align="center"
prop="createTime"
- width="180"
+ width="170"
:formatter="dateFormatter"
/>
@@ -157,7 +157,7 @@
-
+
From 0a4a9e0e55ed49e76d8a96d8ae52d48e53e50660 Mon Sep 17 00:00:00 2001
From: hecongyuan <285121973@qq.com>
Date: Mon, 21 Oct 2024 17:05:05 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhash=E8=B7=AF=E7=94=B1?=
=?UTF-8?q?=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/is.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/utils/is.ts b/src/utils/is.ts
index cd2dcc37..f3dac65a 100644
--- a/src/utils/is.ts
+++ b/src/utils/is.ts
@@ -98,8 +98,9 @@ export const isServer = typeof window === 'undefined'
export const isClient = !isServer
export const isUrl = (path: string): boolean => {
+ //修复路由匹配带hash路由#的地址无法跳转的问题
const reg =
- /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/
+ /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%#\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/
return reg.test(path)
}
From 3859a48825002da8a1bb6c47b1d35cf0ee53bee3 Mon Sep 17 00:00:00 2001
From: hecongyuan <285121973@qq.com>
Date: Mon, 21 Oct 2024 17:10:36 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhash=E8=B7=AF=E7=94=B1?=
=?UTF-8?q?=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/is.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/utils/is.ts b/src/utils/is.ts
index cd2dcc37..24d7191f 100644
--- a/src/utils/is.ts
+++ b/src/utils/is.ts
@@ -98,8 +98,9 @@ export const isServer = typeof window === 'undefined'
export const isClient = !isServer
export const isUrl = (path: string): boolean => {
+ // fix:修复hash路由无法跳转的问题
const reg =
- /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/
+ /(((^https?:(?:\/\/)?)(?:[-:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%#\/.\w-_]*)?\??(?:[-\+=&%@.\w_]*)#?(?:[\w]*))?)$/
return reg.test(path)
}
From a401d8ede4032d2df844878ff6de3d448557505d Mon Sep 17 00:00:00 2001
From: preschooler
Date: Tue, 22 Oct 2024 17:19:55 +0800
Subject: [PATCH 4/7] =?UTF-8?q?=E2=9C=A8=20feat:TagsView=20=E6=94=AF?=
=?UTF-8?q?=E6=8C=81=E5=A4=9A=E4=B8=AA=20path=20=E7=9B=B8=E5=90=8C?=
=?UTF-8?q?=E4=BD=86=20fullPath=20=E4=B8=8D=E7=9B=B8=E5=90=8C=E6=83=85?=
=?UTF-8?q?=E5=86=B5=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/TagsView/src/TagsView.vue | 13 +++----
src/store/modules/tagsView.ts | 38 +++++++++++++------
types/router.d.ts | 3 ++
3 files changed, 35 insertions(+), 19 deletions(-)
diff --git a/src/layout/components/TagsView/src/TagsView.vue b/src/layout/components/TagsView/src/TagsView.vue
index e59695ea..dcbb90fd 100644
--- a/src/layout/components/TagsView/src/TagsView.vue
+++ b/src/layout/components/TagsView/src/TagsView.vue
@@ -127,12 +127,8 @@ const toLastView = () => {
const moveToCurrentTag = async () => {
await nextTick()
for (const v of unref(visitedViews)) {
- if (v.fullPath === unref(currentRoute).path) {
+ if (v.fullPath === unref(currentRoute).fullPath) {
moveToTarget(v)
- if (v.fullPath !== unref(currentRoute).fullPath) {
- tagsViewStore.updateVisitedView(unref(currentRoute))
- }
-
break
}
}
@@ -207,7 +203,7 @@ const moveToTarget = (currentTag: RouteLocationNormalizedLoaded) => {
// 是否是当前tag
const isActive = (route: RouteLocationNormalizedLoaded): boolean => {
- return route.path === unref(currentRoute).path
+ return route.fullPath === unref(currentRoute).fullPath
}
// 所有右键菜单组件的元素
@@ -373,7 +369,10 @@ watch(
:size="12"
class="mr-5px"
/>
- {{ t(item?.meta?.title as string) }}
+ {{
+ t(item?.meta?.title as string) +
+ (item?.meta?.titleSuffix ? ` (${item?.meta?.titleSuffix})` : '')
+ }}
v.path === view.path)) return
+ if (this.visitedViews.some((v) => v.fullPath === view.fullPath)) return
if (view.meta?.noTagsView) return
- this.visitedViews.push(
- Object.assign({}, view, {
- title: view.meta?.title || 'no-name'
+ const visitedView = Object.assign({}, view, { title: view.meta?.title || 'no-name' })
+
+ if (visitedView.meta) {
+ const titleSuffixList: string[] = []
+ this.visitedViews.forEach((v) => {
+ if (v.path === visitedView.path && v.meta?.title === visitedView.meta?.title) {
+ titleSuffixList.push(v.meta?.titleSuffix || '1')
+ }
})
- )
+ if (titleSuffixList.length) {
+ let titleSuffix = 1
+ while (titleSuffixList.includes(`${titleSuffix}`)) {
+ titleSuffix += 1
+ }
+ visitedView.meta.titleSuffix = titleSuffix === 1 ? undefined : `${titleSuffix}`
+ }
+ }
+
+ this.visitedViews.push(visitedView)
},
// 新增缓存
addCachedView() {
@@ -63,7 +77,7 @@ export const useTagsViewStore = defineStore('tagsView', {
// 删除tag
delVisitedView(view: RouteLocationNormalizedLoaded) {
for (const [i, v] of this.visitedViews.entries()) {
- if (v.path === view.path) {
+ if (v.fullPath === view.fullPath) {
this.visitedViews.splice(i, 1)
break
}
@@ -95,18 +109,18 @@ export const useTagsViewStore = defineStore('tagsView', {
// 删除其他tag
delOthersVisitedViews(view: RouteLocationNormalizedLoaded) {
this.visitedViews = this.visitedViews.filter((v) => {
- return v?.meta?.affix || v.path === view.path
+ return v?.meta?.affix || v.fullPath === view.fullPath
})
},
// 删除左侧
delLeftViews(view: RouteLocationNormalizedLoaded) {
const index = findIndex(
this.visitedViews,
- (v) => v.path === view.path
+ (v) => v.fullPath === view.fullPath
)
if (index > -1) {
this.visitedViews = this.visitedViews.filter((v, i) => {
- return v?.meta?.affix || v.path === view.path || i > index
+ return v?.meta?.affix || v.fullPath === view.fullPath || i > index
})
this.addCachedView()
}
@@ -115,18 +129,18 @@ export const useTagsViewStore = defineStore('tagsView', {
delRightViews(view: RouteLocationNormalizedLoaded) {
const index = findIndex(
this.visitedViews,
- (v) => v.path === view.path
+ (v) => v.fullPath === view.fullPath
)
if (index > -1) {
this.visitedViews = this.visitedViews.filter((v, i) => {
- return v?.meta?.affix || v.path === view.path || i < index
+ return v?.meta?.affix || v.fullPath === view.fullPath || i < index
})
this.addCachedView()
}
},
updateVisitedView(view: RouteLocationNormalizedLoaded) {
for (let v of this.visitedViews) {
- if (v.path === view.path) {
+ if (v.fullPath === view.fullPath) {
v = Object.assign(v, view)
break
}
diff --git a/types/router.d.ts b/types/router.d.ts
index 9b08b805..03e91f14 100644
--- a/types/router.d.ts
+++ b/types/router.d.ts
@@ -15,6 +15,8 @@ import { defineComponent } from 'vue'
title: 'title' 设置该路由在侧边栏和面包屑中展示的名字
+ titleSuffix: '2' 当 path 和 title 重复时的后缀或备注
+
icon: 'svg-name' 设置该路由的图标
noCache: true 如果设置为true,则不会被 缓存(默认 false)
@@ -37,6 +39,7 @@ declare module 'vue-router' {
hidden?: boolean
alwaysShow?: boolean
title?: string
+ titleSuffix?: string
icon?: string
noCache?: boolean
breadcrumb?: boolean
From 8a8ae557f701d49caef1da3ab89c54587b530130 Mon Sep 17 00:00:00 2001
From: preschooler
Date: Wed, 23 Oct 2024 10:52:51 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=90=9E=20fix:@import=20=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=20@use=20=E4=BB=A5=E5=BA=94=E5=AF=B9=20sass?=
=?UTF-8?q?=20=E5=8D=87=E7=BA=A7=E5=BC=83=E7=94=A8=20@import=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../package/theme/element-variables.scss | 2 +-
.../bpmnProcessDesigner/package/theme/index.scss | 4 ++--
.../package/theme/process-designer.scss | 6 +++---
src/styles/global.module.scss | 2 +-
src/styles/index.scss | 8 ++++----
vite.config.ts | 2 +-
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/components/bpmnProcessDesigner/package/theme/element-variables.scss b/src/components/bpmnProcessDesigner/package/theme/element-variables.scss
index 49bd326d..0646f8e1 100644
--- a/src/components/bpmnProcessDesigner/package/theme/element-variables.scss
+++ b/src/components/bpmnProcessDesigner/package/theme/element-variables.scss
@@ -5,7 +5,7 @@ $--color-danger: #ff4d4f;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
-@import '~element-ui/packages/theme-chalk/src/index';
+@use '~element-ui/packages/theme-chalk/src/index';
.el-table td,
.el-table th {
diff --git a/src/components/bpmnProcessDesigner/package/theme/index.scss b/src/components/bpmnProcessDesigner/package/theme/index.scss
index 2e60fad4..0c77cfa2 100644
--- a/src/components/bpmnProcessDesigner/package/theme/index.scss
+++ b/src/components/bpmnProcessDesigner/package/theme/index.scss
@@ -1,2 +1,2 @@
-@import './process-designer.scss';
-@import './process-panel.scss';
+@use './process-designer.scss';
+@use './process-panel.scss';
diff --git a/src/components/bpmnProcessDesigner/package/theme/process-designer.scss b/src/components/bpmnProcessDesigner/package/theme/process-designer.scss
index 6af945da..b1ff0af3 100644
--- a/src/components/bpmnProcessDesigner/package/theme/process-designer.scss
+++ b/src/components/bpmnProcessDesigner/package/theme/process-designer.scss
@@ -1,6 +1,6 @@
-@import 'bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css';
-@import 'bpmn-js-token-simulation/assets/css/font-awesome.min.css';
-@import 'bpmn-js-token-simulation/assets/css/normalize.css';
+@use 'bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css';
+@use 'bpmn-js-token-simulation/assets/css/font-awesome.min.css';
+@use 'bpmn-js-token-simulation/assets/css/normalize.css';
// 边框被 token-simulation 样式覆盖了
.djs-palette {
diff --git a/src/styles/global.module.scss b/src/styles/global.module.scss
index 8448a924..af793f03 100644
--- a/src/styles/global.module.scss
+++ b/src/styles/global.module.scss
@@ -1,4 +1,4 @@
-@import './variables.scss';
+@use './variables.scss' as *;
// 导出变量
:export {
namespace: $namespace;
diff --git a/src/styles/index.scss b/src/styles/index.scss
index 766f983e..7607941c 100644
--- a/src/styles/index.scss
+++ b/src/styles/index.scss
@@ -1,7 +1,7 @@
-@import './var.css';
-@import './FormCreate/index.scss';
-@import './theme.scss';
-@import 'element-plus/theme-chalk/dark/css-vars.css';
+@use './var.css';
+@use './FormCreate/index.scss';
+@use './theme.scss';
+@use 'element-plus/theme-chalk/dark/css-vars.css';
.reset-margin [class*='el-icon'] + span {
margin-left: 2px !important;
diff --git a/vite.config.ts b/vite.config.ts
index 3ef21f26..57611ce6 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -43,7 +43,7 @@ export default ({command, mode}: ConfigEnv): UserConfig => {
css: {
preprocessorOptions: {
scss: {
- additionalData: '@import "./src/styles/variables.scss";',
+ additionalData: '@use "@/styles/variables.scss" as *;',
javascriptEnabled: true
}
}
From 57ab87688694472c9dc74587fd2396793cf023ef Mon Sep 17 00:00:00 2001
From: ZG4vin
Date: Thu, 24 Oct 2024 17:48:35 +0800
Subject: [PATCH 6/7] =?UTF-8?q?=E5=B0=86=E8=B6=85=E7=BA=A7=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E5=91=98=E7=9A=84=E8=A7=92=E8=89=B2code=E7=94=B1admin?=
=?UTF-8?q?=E6=94=B9=E4=B8=BAsuper=5Fadmin?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/directives/permission/hasRole.ts | 2 +-
src/utils/permission.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/directives/permission/hasRole.ts b/src/directives/permission/hasRole.ts
index 31a352a7..a5de2b8d 100644
--- a/src/directives/permission/hasRole.ts
+++ b/src/directives/permission/hasRole.ts
@@ -7,7 +7,7 @@ export function hasRole(app: App) {
app.directive('hasRole', (el, binding) => {
const { wsCache } = useCache()
const { value } = binding
- const super_admin = 'admin'
+ const super_admin = 'super_admin'
const roles = wsCache.get(CACHE_KEY.USER).roles
if (value && value instanceof Array && value.length > 0) {
diff --git a/src/utils/permission.ts b/src/utils/permission.ts
index a63ee628..f6077d1a 100644
--- a/src/utils/permission.ts
+++ b/src/utils/permission.ts
@@ -32,7 +32,7 @@ export function checkRole(value: string[]) {
if (value && value instanceof Array && value.length > 0) {
const { wsCache } = useCache()
const permissionRoles = value
- const super_admin = 'admin'
+ const super_admin = 'super_admin'
const roles = wsCache.get(CACHE_KEY.USER).roles
const hasRole = roles.some((role) => {
return super_admin === role || permissionRoles.includes(role)
From 17225ef3df8ff87a8a331f7c6eebf8f2ff8ce245 Mon Sep 17 00:00:00 2001
From: preschooler
Date: Fri, 25 Oct 2024 10:11:42 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=90=9E=20fix:=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=E5=90=8E=E4=BE=9D=E6=97=A7?=
=?UTF-8?q?=E5=9C=A8=E8=BD=AE=E8=AF=A2=E6=B6=88=E6=81=AF=E6=9C=AA=E8=AF=BB?=
=?UTF-8?q?=E6=95=B0=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=8F=8D=E5=A4=8D=E5=BC=B9?=
=?UTF-8?q?=E7=AA=97=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/layout/components/Message/src/Message.vue | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/layout/components/Message/src/Message.vue b/src/layout/components/Message/src/Message.vue
index 6bd7724a..d769d88c 100644
--- a/src/layout/components/Message/src/Message.vue
+++ b/src/layout/components/Message/src/Message.vue
@@ -1,10 +1,12 @@