lw-cdp-ui 1.4.12 → 1.4.13
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/lwBiChart/page.vue +52 -51
- package/dist/components/lwLayout/components/sideM.vue +176 -126
- package/dist/components/lwTour/index.vue +90 -90
- package/dist/lw-cdp-ui.esm.js +2488 -2480
- package/dist/lw-cdp-ui.umd.js +13 -13
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -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>
|