lw-cdp-ui 1.5.56 → 1.5.58
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/lwAi/index.vue +0 -2
- package/dist/components/lwTour/index.vue +13 -24
- package/dist/lw-cdp-ui.esm.js +2177 -2192
- package/dist/lw-cdp-ui.umd.js +16 -16
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
<script>
|
|
20
20
|
import axios from 'axios';
|
|
21
21
|
import { computed, getCurrentInstance, ref, watch } from 'vue';
|
|
22
|
-
import { useRouter } from 'vue-router';
|
|
23
22
|
import { FORM_DATA_GENERATION_RULES, SAFETY_RULES } from './doc/rules.js';
|
|
24
23
|
|
|
25
24
|
export default {
|
|
@@ -46,7 +45,6 @@ export default {
|
|
|
46
45
|
const {
|
|
47
46
|
proxy: { $http, $expression, t, $tool, $bus }
|
|
48
47
|
} = getCurrentInstance()
|
|
49
|
-
const router = useRouter()
|
|
50
48
|
const visible = ref(false)
|
|
51
49
|
const loading = ref(false)
|
|
52
50
|
const inputValue = ref('')
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
<script>
|
|
14
14
|
import { getCurrentInstance, nextTick, onMounted, onUnmounted, ref } from 'vue'
|
|
15
|
-
import { useRouter } from 'vue-router'
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
17
|
name: 'LwTour',
|
|
@@ -34,13 +33,17 @@ export default {
|
|
|
34
33
|
currentStep: {
|
|
35
34
|
type: Number,
|
|
36
35
|
default: 0
|
|
36
|
+
},
|
|
37
|
+
// 路由路径,用于记录用户是否已完成引导
|
|
38
|
+
routePath: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: ''
|
|
37
41
|
}
|
|
38
42
|
},
|
|
39
43
|
setup(props, { emit }) {
|
|
40
44
|
const {
|
|
41
45
|
proxy: { $api, $expression, t, $tool, $bus }
|
|
42
46
|
} = getCurrentInstance()
|
|
43
|
-
const router = useRouter()
|
|
44
47
|
$bus.$on(`lwTourChange`, () => {
|
|
45
48
|
startTour()
|
|
46
49
|
})
|
|
@@ -54,18 +57,6 @@ export default {
|
|
|
54
57
|
|
|
55
58
|
// 开始引导
|
|
56
59
|
const startTour = () => {
|
|
57
|
-
// 如果 router 未初始化,延迟执行
|
|
58
|
-
if (!router) {
|
|
59
|
-
setTimeout(() => {
|
|
60
|
-
startTour()
|
|
61
|
-
}, 100)
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const allElementsExist = props.steps.every((step) => {
|
|
66
|
-
return document.querySelector(step.css)
|
|
67
|
-
})
|
|
68
|
-
|
|
69
60
|
formattedSteps.value = props.steps.map((step) => {
|
|
70
61
|
const targetElement = document.querySelector(step.css)
|
|
71
62
|
return {
|
|
@@ -77,22 +68,20 @@ export default {
|
|
|
77
68
|
})
|
|
78
69
|
isOpen.value = true
|
|
79
70
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
LwTour[`${meta?.title || ''}${path}`] = true
|
|
71
|
+
// 使用传入的路由路径
|
|
72
|
+
if (props.routePath) {
|
|
73
|
+
let LwTour = $tool.data.get('LwTour') || {}
|
|
74
|
+
LwTour[props.routePath] = true
|
|
85
75
|
$tool.data.set('LwTour', LwTour)
|
|
86
76
|
}
|
|
87
77
|
}
|
|
88
78
|
|
|
89
79
|
// 组件挂载后自动开始引导
|
|
90
80
|
onMounted(() => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (!LwTour[`${meta?.title || ''}${path}`]) {
|
|
81
|
+
// 使用传入的路由路径
|
|
82
|
+
if (props.routePath) {
|
|
83
|
+
let LwTour = $tool.data.get('LwTour') || {}
|
|
84
|
+
if (!LwTour[props.routePath]) {
|
|
96
85
|
nextTick(() => {
|
|
97
86
|
startTour()
|
|
98
87
|
})
|