lw-cdp-ui 1.4.16 → 1.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/lwLayout/components/aside.vue +21 -23
- package/dist/components/lwLayout/index.vue +36 -22
- package/dist/components/lwTour/index.vue +90 -90
- package/dist/lw-cdp-ui.esm.js +3404 -3372
- package/dist/lw-cdp-ui.umd.js +10 -10
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="layout-aside">
|
|
3
3
|
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<el-popover placement="right"
|
|
9
|
-
|
|
10
|
-
trigger="click"
|
|
11
|
-
:show-arrow="false"
|
|
12
|
-
:offset="3"
|
|
13
|
-
popper-class="app-popper"
|
|
14
|
-
ref="popoverRef">
|
|
4
|
+
<slot name="logo">
|
|
5
|
+
<img class="logo" src="../../../assets/images/logo.svg" alt="" @click="openMneu">
|
|
6
|
+
</slot>
|
|
7
|
+
|
|
8
|
+
<el-popover placement="right" :width="180" trigger="click" :show-arrow="false" :offset="3" popper-class="app-popper"
|
|
9
|
+
ref="popoverRef">
|
|
15
10
|
<template #reference>
|
|
16
11
|
<p>
|
|
17
12
|
<el-icon class="menu-btn">
|
|
@@ -22,21 +17,15 @@
|
|
|
22
17
|
<div class="app-content">
|
|
23
18
|
<div class="app-title">
|
|
24
19
|
<span class="open" @click="openMneu">应用中心</span>
|
|
25
|
-
<el-icon class="iconClose"
|
|
26
|
-
@click="closePopover">
|
|
20
|
+
<el-icon class="iconClose" @click="closePopover">
|
|
27
21
|
<el-icon-close />
|
|
28
22
|
</el-icon>
|
|
29
23
|
</div>
|
|
30
24
|
<el-divider style="margin: 5px 0;" />
|
|
31
25
|
<template v-if="grantedApplications.length > 0">
|
|
32
|
-
<div class="menu-item"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
:key="item.resourceId">
|
|
36
|
-
<i class="iconfont"
|
|
37
|
-
:class="item.icon"
|
|
38
|
-
style="margin-right: 5px;"></i>
|
|
39
|
-
{{ item.name}}
|
|
26
|
+
<div class="menu-item" @click="switchMenu(item)" v-for="item in grantedApplications" :key="item.resourceId">
|
|
27
|
+
<i class="iconfont" :class="item.icon" style="margin-right: 5px;"></i>
|
|
28
|
+
{{ item?.aliasName || item.name }}
|
|
40
29
|
</div>
|
|
41
30
|
</template>
|
|
42
31
|
|
|
@@ -88,6 +77,7 @@ export default {
|
|
|
88
77
|
width: 100%;
|
|
89
78
|
height: 100%;
|
|
90
79
|
border-bottom: 1px solid var(--el-mask-color-extra-light);
|
|
80
|
+
|
|
91
81
|
.logo {
|
|
92
82
|
width: 100%;
|
|
93
83
|
height: auto;
|
|
@@ -99,12 +89,15 @@ export default {
|
|
|
99
89
|
font-size: 24px;
|
|
100
90
|
color: #95989d;
|
|
101
91
|
}
|
|
92
|
+
|
|
102
93
|
.el-tooltip__trigger {
|
|
103
94
|
text-align: center;
|
|
104
95
|
padding: 10px;
|
|
105
96
|
cursor: pointer;
|
|
97
|
+
|
|
106
98
|
&:hover {
|
|
107
99
|
background-color: var(--el-menu-hover-bg-color);
|
|
100
|
+
|
|
108
101
|
.menu-btn {
|
|
109
102
|
color: var(--el-menu-active-color);
|
|
110
103
|
}
|
|
@@ -134,11 +127,13 @@ export default {
|
|
|
134
127
|
width: inherit;
|
|
135
128
|
height: 100%;
|
|
136
129
|
}
|
|
130
|
+
|
|
137
131
|
.app-box {
|
|
138
132
|
width: 50px;
|
|
139
133
|
height: 50px;
|
|
140
134
|
color: #95989d;
|
|
141
135
|
}
|
|
136
|
+
|
|
142
137
|
.app-box:hover {
|
|
143
138
|
background: var(--el-menu-hover-bg-color);
|
|
144
139
|
color: var(--el-color-primary);
|
|
@@ -268,15 +263,18 @@ export default {
|
|
|
268
263
|
.app-popper {
|
|
269
264
|
padding: 10px 0 !important;
|
|
270
265
|
top: 50px !important;
|
|
266
|
+
|
|
271
267
|
.app-title {
|
|
272
268
|
font-size: 12px;
|
|
273
269
|
font-weight: bold;
|
|
274
270
|
line-height: 19px;
|
|
275
271
|
height: 19px;
|
|
276
272
|
padding: 0 10px 2px;
|
|
277
|
-
|
|
273
|
+
|
|
274
|
+
.open {
|
|
278
275
|
cursor: pointer;
|
|
279
276
|
}
|
|
277
|
+
|
|
280
278
|
.iconClose {
|
|
281
279
|
position: absolute;
|
|
282
280
|
top: 10px;
|
|
@@ -285,6 +283,7 @@ export default {
|
|
|
285
283
|
font-weight: normal;
|
|
286
284
|
cursor: pointer;
|
|
287
285
|
font-size: 16px;
|
|
286
|
+
|
|
288
287
|
&:hover {
|
|
289
288
|
color: var(--el-color-primary);
|
|
290
289
|
}
|
|
@@ -292,4 +291,3 @@ export default {
|
|
|
292
291
|
}
|
|
293
292
|
}
|
|
294
293
|
</style>
|
|
295
|
-
|
|
@@ -3,32 +3,34 @@
|
|
|
3
3
|
<template v-if="layout == 'menu'">
|
|
4
4
|
<section class="aminui-body-menu">
|
|
5
5
|
<div class="aminui-side-split-left">
|
|
6
|
-
<Aside
|
|
6
|
+
<Aside>
|
|
7
|
+
<!-- LOGO -->
|
|
8
|
+
<template #logo>
|
|
9
|
+
<slot name="logo"></slot>
|
|
10
|
+
</template>
|
|
11
|
+
</Aside>
|
|
7
12
|
</div>
|
|
8
13
|
|
|
9
14
|
<section class="aminui-wrapper">
|
|
10
|
-
<div v-if="!ismobile"
|
|
11
|
-
|
|
12
|
-
<div v-if="appName && appSimpleName"
|
|
13
|
-
class="aminui-title-name">
|
|
15
|
+
<div v-if="!ismobile" :class="menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'">
|
|
16
|
+
<div v-if="appName && appSimpleName" class="aminui-title-name">
|
|
14
17
|
{{ menuIsCollapse ? appSimpleName : appName }}
|
|
15
18
|
</div>
|
|
16
|
-
<div v-else
|
|
17
|
-
|
|
19
|
+
<div v-else-if="applicationName" class="aminui-title-name">
|
|
20
|
+
{{ menuIsCollapse ? applicationName.shortAliasName : applicationName.aliasName }}
|
|
21
|
+
</div>
|
|
22
|
+
<div v-else class="aminui-title-name">
|
|
18
23
|
{{ menuIsCollapse ? $config.APP_NAME.charAt(0) : $config.APP_NAME }}
|
|
19
24
|
</div>
|
|
20
25
|
<div class="adminui-side-scroll">
|
|
21
26
|
<el-scrollbar>
|
|
22
|
-
<el-menu :default-active="active"
|
|
23
|
-
|
|
24
|
-
:collapse="menuIsCollapse"
|
|
25
|
-
:unique-opened="$config.MENU_UNIQUE_OPENED">
|
|
27
|
+
<el-menu :default-active="active" router :collapse="menuIsCollapse"
|
|
28
|
+
:unique-opened="$config.MENU_UNIQUE_OPENED">
|
|
26
29
|
<NavMenu :navMenus="menu"></NavMenu>
|
|
27
30
|
</el-menu>
|
|
28
31
|
</el-scrollbar>
|
|
29
32
|
</div>
|
|
30
|
-
<div class="adminui-side-bottom"
|
|
31
|
-
@click="$store.commit('TOGGLE_menuIsCollapse')">
|
|
33
|
+
<div class="adminui-side-bottom" @click="$store.commit('TOGGLE_menuIsCollapse')">
|
|
32
34
|
<el-icon>
|
|
33
35
|
<el-icon-expand v-if="menuIsCollapse" />
|
|
34
36
|
<el-icon-fold v-else />
|
|
@@ -42,23 +44,18 @@
|
|
|
42
44
|
<span class="title">{{ $t("lwLayout.layout.topbar") }}:</span>
|
|
43
45
|
<Topbar v-if="!ismobile"></Topbar>
|
|
44
46
|
</div>
|
|
45
|
-
<userbar :isShowBu="isShowBu"
|
|
46
|
-
:isShowTask="isShowTask"
|
|
47
|
-
:isInitialized="isInitialized">
|
|
47
|
+
<userbar :isShowBu="isShowBu" :isShowTask="isShowTask" :isInitialized="isInitialized">
|
|
48
48
|
<template #userbarActionBox>
|
|
49
49
|
<slot name="userbarActionBox"></slot>
|
|
50
50
|
</template>
|
|
51
51
|
</userbar>
|
|
52
52
|
</div>
|
|
53
|
-
<Tags v-if="!ismobile && layoutTags"
|
|
54
|
-
:tagShowID="tagShowID"></Tags>
|
|
53
|
+
<Tags v-if="!ismobile && layoutTags" :tagShowID="tagShowID"></Tags>
|
|
55
54
|
<div class="adminui-main">
|
|
56
55
|
<slot name="routerView">
|
|
57
56
|
<router-view v-slot="{ Component }">
|
|
58
57
|
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
|
|
59
|
-
<component :is="Component"
|
|
60
|
-
:key="$route.fullPath"
|
|
61
|
-
v-if="$store.state.keepAlive.routeShow" />
|
|
58
|
+
<component :is="Component" :key="$route.fullPath" v-if="$store.state.keepAlive.routeShow" />
|
|
62
59
|
</keep-alive>
|
|
63
60
|
</router-view>
|
|
64
61
|
</slot>
|
|
@@ -197,6 +194,17 @@ export default {
|
|
|
197
194
|
},
|
|
198
195
|
menuIsCollapse() {
|
|
199
196
|
return this.$store.state.global.menuIsCollapse
|
|
197
|
+
},
|
|
198
|
+
applicationName() {
|
|
199
|
+
let userAuthInfo = localStorage.getItem('userAuthInfo')
|
|
200
|
+
let { grantedApplications } = JSON.parse(userAuthInfo) || {}
|
|
201
|
+
|
|
202
|
+
if (grantedApplications) {
|
|
203
|
+
let item = grantedApplications.find(x => x.code === this.$config.APP_NAME.toLowerCase())
|
|
204
|
+
return item?.aliasName ? item : ''
|
|
205
|
+
} else {
|
|
206
|
+
return ''
|
|
207
|
+
}
|
|
200
208
|
}
|
|
201
209
|
},
|
|
202
210
|
beforeCreate() {
|
|
@@ -251,6 +259,12 @@ export default {
|
|
|
251
259
|
// 获取用户信息
|
|
252
260
|
let user = await this.$api.auth.user()
|
|
253
261
|
|
|
262
|
+
// 判断密码是否过期
|
|
263
|
+
if (!user?.userAuthInfo && user?.loginPage?.includes("pwdChange")) {
|
|
264
|
+
this.$message.warning('您的密码已过期,请修改密码!')
|
|
265
|
+
return false
|
|
266
|
+
}
|
|
267
|
+
|
|
254
268
|
// 处理应用显示逻辑
|
|
255
269
|
let application = [...new Set(user.userAuthInfo.menus.map(permission => permission.split('.')[0].split('_')[0]))]
|
|
256
270
|
user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter(x =>
|
|
@@ -342,7 +356,7 @@ export default {
|
|
|
342
356
|
this.pmenu = route
|
|
343
357
|
this.nextMenu = this.filterUrl(route.children)
|
|
344
358
|
if ((!route.children || route.children.length == 0) && route.component) {
|
|
345
|
-
this.$router.push({path: route.path})
|
|
359
|
+
this.$router.push({ path: route.path })
|
|
346
360
|
}
|
|
347
361
|
},
|
|
348
362
|
//转换外部链接的路由
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-tour v-model="isOpen" :current="currentStep">
|
|
3
|
-
<el-tour-step v-for="(step, index) in formattedSteps" :key="index" :target="step.target" :title="step.title"
|
|
4
|
-
:description="step.description" />
|
|
5
|
-
</el-tour>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import { ref, getCurrentInstance, onMounted, nextTick, onUnmounted } from 'vue'
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
name: 'LwTour',
|
|
13
|
-
props: {
|
|
14
|
-
steps: {
|
|
15
|
-
type: Array,
|
|
16
|
-
required: true,
|
|
17
|
-
validator: (value) => {
|
|
18
|
-
return value.every(step => {
|
|
19
|
-
return step.css && step.title && step.description
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
// 是否在组件挂载后自动开始引导
|
|
24
|
-
autoStart: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
setup(props, { emit }) {
|
|
30
|
-
const {
|
|
31
|
-
proxy: { $api, $expression, t, $tool, $bus }
|
|
32
|
-
} = getCurrentInstance()
|
|
33
|
-
$bus.$emit(`lwTourOpen`, true)
|
|
34
|
-
$bus.$on(`lwTourChange`, () => {
|
|
35
|
-
startTour()
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
onUnmounted(() => {
|
|
39
|
-
$bus.$emit(`lwTourOpen`, false)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
const currentStep = ref(0)
|
|
43
|
-
const isOpen = ref(false)
|
|
44
|
-
const formattedSteps = ref([])
|
|
45
|
-
|
|
46
|
-
// 开始引导
|
|
47
|
-
const startTour = () => {
|
|
48
|
-
const allElementsExist = props.steps.every(step => {
|
|
49
|
-
return document.querySelector(step.css)
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
if (!allElementsExist) {
|
|
53
|
-
console.warn('元素未加载完成')
|
|
54
|
-
startTour()
|
|
55
|
-
return
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
formattedSteps.value = props.steps.map(step => {
|
|
59
|
-
const targetElement = document.querySelector(step.css)
|
|
60
|
-
return {
|
|
61
|
-
target: targetElement || undefined,
|
|
62
|
-
title: step.title,
|
|
63
|
-
description: step.description,
|
|
64
|
-
// 可以添加更多el-tour支持的配置项
|
|
65
|
-
placement: 'bottom'
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
currentStep.value = 0
|
|
69
|
-
isOpen.value = true
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// 组件挂载后自动开始引导
|
|
74
|
-
onMounted(() => {
|
|
75
|
-
if (props.autoStart) {
|
|
76
|
-
nextTick(() => {
|
|
77
|
-
startTour()
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
return {
|
|
83
|
-
currentStep,
|
|
84
|
-
formattedSteps,
|
|
85
|
-
isOpen,
|
|
86
|
-
startTour
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<el-tour v-model="isOpen" :current="currentStep">
|
|
3
|
+
<el-tour-step v-for="(step, index) in formattedSteps" :key="index" :target="step.target" :title="step.title"
|
|
4
|
+
:description="step.description" />
|
|
5
|
+
</el-tour>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { ref, getCurrentInstance, onMounted, nextTick, onUnmounted } from 'vue'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: 'LwTour',
|
|
13
|
+
props: {
|
|
14
|
+
steps: {
|
|
15
|
+
type: Array,
|
|
16
|
+
required: true,
|
|
17
|
+
validator: (value) => {
|
|
18
|
+
return value.every(step => {
|
|
19
|
+
return step.css && step.title && step.description
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
// 是否在组件挂载后自动开始引导
|
|
24
|
+
autoStart: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup(props, { emit }) {
|
|
30
|
+
const {
|
|
31
|
+
proxy: { $api, $expression, t, $tool, $bus }
|
|
32
|
+
} = getCurrentInstance()
|
|
33
|
+
$bus.$emit(`lwTourOpen`, true)
|
|
34
|
+
$bus.$on(`lwTourChange`, () => {
|
|
35
|
+
startTour()
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
onUnmounted(() => {
|
|
39
|
+
$bus.$emit(`lwTourOpen`, false)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const currentStep = ref(0)
|
|
43
|
+
const isOpen = ref(false)
|
|
44
|
+
const formattedSteps = ref([])
|
|
45
|
+
|
|
46
|
+
// 开始引导
|
|
47
|
+
const startTour = () => {
|
|
48
|
+
const allElementsExist = props.steps.every(step => {
|
|
49
|
+
return document.querySelector(step.css)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
if (!allElementsExist) {
|
|
53
|
+
console.warn('元素未加载完成')
|
|
54
|
+
startTour()
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
formattedSteps.value = props.steps.map(step => {
|
|
59
|
+
const targetElement = document.querySelector(step.css)
|
|
60
|
+
return {
|
|
61
|
+
target: targetElement || undefined,
|
|
62
|
+
title: step.title,
|
|
63
|
+
description: step.description,
|
|
64
|
+
// 可以添加更多el-tour支持的配置项
|
|
65
|
+
placement: 'bottom'
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
currentStep.value = 0
|
|
69
|
+
isOpen.value = true
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
// 组件挂载后自动开始引导
|
|
74
|
+
onMounted(() => {
|
|
75
|
+
if (props.autoStart) {
|
|
76
|
+
nextTick(() => {
|
|
77
|
+
startTour()
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
currentStep,
|
|
84
|
+
formattedSteps,
|
|
85
|
+
isOpen,
|
|
86
|
+
startTour
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|