Skip to content

Commit 2aa2b46

Browse files
committed
Merge branch 'master' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm
# Conflicts: # src/components/bpmnProcessDesigner/package/theme/index.scss
2 parents 066607a + bf87c46 commit 2aa2b46

File tree

19 files changed

+78
-48
lines changed

19 files changed

+78
-48
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@
6969

7070
支持 Spring Boot、Spring Cloud 两种架构:
7171

72-
① Spring Boot 单体架构:<https://github.com/YunaiV/ruoyi-vue-pro>
72+
① Spring Boot 单体架构:<https://doc.iocoder.cn>
7373

7474
![架构图](/.image/common/ruoyi-vue-pro-architecture.png)
7575

76-
② Spring Cloud 微服务架构:<https://github.com/YunaiV/yudao-cloud>
76+
② Spring Cloud 微服务架构:<https://cloud.iocoder.cn>
7777

7878
![架构图](/.image/common/yudao-cloud-architecture.png)
7979

src/components/bpmnProcessDesigner/package/theme/element-variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $--color-danger: #ff4d4f;
55
/* 改变 icon 字体路径变量,必需 */
66
$--font-path: '~element-ui/lib/theme-chalk/fonts';
77

8-
@import '~element-ui/packages/theme-chalk/src/index';
8+
@use '~element-ui/packages/theme-chalk/src/index';
99

1010
.el-table td,
1111
.el-table th {

src/components/bpmnProcessDesigner/package/theme/index.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import './process-designer.scss';
2-
@import './process-panel.scss';
1+
@use './process-designer.scss';
2+
@use './process-panel.scss';
33

44
$success-color: #4eb819;
55
$primary-color: #409EFF;

src/components/bpmnProcessDesigner/package/theme/process-designer.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@import 'bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css';
2-
@import 'bpmn-js-token-simulation/assets/css/font-awesome.min.css';
3-
@import 'bpmn-js-token-simulation/assets/css/normalize.css';
1+
@use 'bpmn-js-token-simulation/assets/css/bpmn-js-token-simulation.css';
2+
@use 'bpmn-js-token-simulation/assets/css/font-awesome.min.css';
3+
@use 'bpmn-js-token-simulation/assets/css/normalize.css';
44

55
// 边框被 token-simulation 样式覆盖了
66
.djs-palette {

src/directives/permission/hasPermi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export function hasPermi(app: App<Element>) {
88
const { wsCache } = useCache()
99
const { value } = binding
1010
const all_permission = '*:*:*'
11-
const permissions = wsCache.get(CACHE_KEY.USER).permissions
11+
const userInfo = wsCache.get(CACHE_KEY.USER)
12+
const permissions = userInfo?.permissions || []
1213

1314
if (value && value instanceof Array && value.length > 0) {
1415
const permissionFlag = value

src/directives/permission/hasRole.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ export function hasRole(app: App<Element>) {
77
app.directive('hasRole', (el, binding) => {
88
const { wsCache } = useCache()
99
const { value } = binding
10-
const super_admin = 'admin'
11-
const roles = wsCache.get(CACHE_KEY.USER).roles
10+
const super_admin = 'super_admin'
11+
const userInfo = wsCache.get(CACHE_KEY.USER)
12+
const roles = userInfo?.roles || []
1213

1314
if (value && value instanceof Array && value.length > 0) {
1415
const roleFlag = value

src/layout/components/Message/src/Message.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<script lang="ts" setup>
22
import { formatDate } from '@/utils/formatTime'
33
import * as NotifyMessageApi from '@/api/system/notify/message'
4+
import { useUserStoreWithOut } from '@/store/modules/user'
45
56
defineOptions({ name: 'Message' })
67
78
const { push } = useRouter()
9+
const userStore = useUserStoreWithOut()
810
const activeName = ref('notice')
911
const unreadCount = ref(0) // 未读消息数量
1012
const list = ref<any[]>([]) // 消息列表
@@ -37,7 +39,11 @@ onMounted(() => {
3739
// 轮询刷新小红点
3840
setInterval(
3941
() => {
40-
getUnreadCount()
42+
if (userStore.getIsSetUser) {
43+
getUnreadCount()
44+
} else {
45+
unreadCount.value = 0
46+
}
4147
},
4248
1000 * 60 * 2
4349
)

src/layout/components/TagsView/src/TagsView.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,8 @@ const toLastView = () => {
127127
const moveToCurrentTag = async () => {
128128
await nextTick()
129129
for (const v of unref(visitedViews)) {
130-
if (v.fullPath === unref(currentRoute).path) {
130+
if (v.fullPath === unref(currentRoute).fullPath) {
131131
moveToTarget(v)
132-
if (v.fullPath !== unref(currentRoute).fullPath) {
133-
tagsViewStore.updateVisitedView(unref(currentRoute))
134-
}
135-
136132
break
137133
}
138134
}
@@ -207,7 +203,7 @@ const moveToTarget = (currentTag: RouteLocationNormalizedLoaded) => {
207203
208204
// 是否是当前tag
209205
const isActive = (route: RouteLocationNormalizedLoaded): boolean => {
210-
return route.path === unref(currentRoute).path
206+
return route.fullPath === unref(currentRoute).fullPath
211207
}
212208
213209
// 所有右键菜单组件的元素
@@ -373,7 +369,10 @@ watch(
373369
:size="12"
374370
class="mr-5px"
375371
/>
376-
{{ t(item?.meta?.title as string) }}
372+
{{
373+
t(item?.meta?.title as string) +
374+
(item?.meta?.titleSuffix ? ` (${item?.meta?.titleSuffix})` : '')
375+
}}
377376
<Icon
378377
:class="`${prefixCls}__item--close`"
379378
:size="12"

src/store/modules/permission.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ export const usePermissionStore = defineStore('permission', {
3535
return new Promise<void>(async (resolve) => {
3636
// 获得菜单列表,它在登录的时候,setUserInfoAction 方法中已经进行获取
3737
let res: AppCustomRouteRecordRaw[] = []
38-
if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) {
39-
res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
38+
const roleRouters = wsCache.get(CACHE_KEY.ROLE_ROUTERS)
39+
if (roleRouters) {
40+
res = roleRouters as AppCustomRouteRecordRaw[]
4041
}
4142
const routerMap: AppRouteRecordRaw[] = generateRoute(res)
4243
// 动态路由,404一定要放到最后面

src/store/modules/tagsView.ts

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,27 @@ export const useTagsViewStore = defineStore('tagsView', {
3131
},
3232
// 新增tag
3333
addVisitedView(view: RouteLocationNormalizedLoaded) {
34-
if (this.visitedViews.some((v) => v.path === view.path)) return
34+
if (this.visitedViews.some((v) => v.fullPath === view.fullPath)) return
3535
if (view.meta?.noTagsView) return
36-
this.visitedViews.push(
37-
Object.assign({}, view, {
38-
title: view.meta?.title || 'no-name'
36+
const visitedView = Object.assign({}, view, { title: view.meta?.title || 'no-name' })
37+
38+
if (visitedView.meta) {
39+
const titleSuffixList: string[] = []
40+
this.visitedViews.forEach((v) => {
41+
if (v.path === visitedView.path && v.meta?.title === visitedView.meta?.title) {
42+
titleSuffixList.push(v.meta?.titleSuffix || '1')
43+
}
3944
})
40-
)
45+
if (titleSuffixList.length) {
46+
let titleSuffix = 1
47+
while (titleSuffixList.includes(`${titleSuffix}`)) {
48+
titleSuffix += 1
49+
}
50+
visitedView.meta.titleSuffix = titleSuffix === 1 ? undefined : `${titleSuffix}`
51+
}
52+
}
53+
54+
this.visitedViews.push(visitedView)
4155
},
4256
// 新增缓存
4357
addCachedView() {
@@ -63,7 +77,7 @@ export const useTagsViewStore = defineStore('tagsView', {
6377
// 删除tag
6478
delVisitedView(view: RouteLocationNormalizedLoaded) {
6579
for (const [i, v] of this.visitedViews.entries()) {
66-
if (v.path === view.path) {
80+
if (v.fullPath === view.fullPath) {
6781
this.visitedViews.splice(i, 1)
6882
break
6983
}
@@ -95,18 +109,18 @@ export const useTagsViewStore = defineStore('tagsView', {
95109
// 删除其他tag
96110
delOthersVisitedViews(view: RouteLocationNormalizedLoaded) {
97111
this.visitedViews = this.visitedViews.filter((v) => {
98-
return v?.meta?.affix || v.path === view.path
112+
return v?.meta?.affix || v.fullPath === view.fullPath
99113
})
100114
},
101115
// 删除左侧
102116
delLeftViews(view: RouteLocationNormalizedLoaded) {
103117
const index = findIndex<RouteLocationNormalizedLoaded>(
104118
this.visitedViews,
105-
(v) => v.path === view.path
119+
(v) => v.fullPath === view.fullPath
106120
)
107121
if (index > -1) {
108122
this.visitedViews = this.visitedViews.filter((v, i) => {
109-
return v?.meta?.affix || v.path === view.path || i > index
123+
return v?.meta?.affix || v.fullPath === view.fullPath || i > index
110124
})
111125
this.addCachedView()
112126
}
@@ -115,18 +129,18 @@ export const useTagsViewStore = defineStore('tagsView', {
115129
delRightViews(view: RouteLocationNormalizedLoaded) {
116130
const index = findIndex<RouteLocationNormalizedLoaded>(
117131
this.visitedViews,
118-
(v) => v.path === view.path
132+
(v) => v.fullPath === view.fullPath
119133
)
120134
if (index > -1) {
121135
this.visitedViews = this.visitedViews.filter((v, i) => {
122-
return v?.meta?.affix || v.path === view.path || i < index
136+
return v?.meta?.affix || v.fullPath === view.fullPath || i < index
123137
})
124138
this.addCachedView()
125139
}
126140
},
127141
updateVisitedView(view: RouteLocationNormalizedLoaded) {
128142
for (let v of this.visitedViews) {
129-
if (v.path === view.path) {
143+
if (v.fullPath === view.fullPath) {
130144
v = Object.assign(v, view)
131145
break
132146
}

0 commit comments

Comments
 (0)