ylwl-cpscoms 1.0.0
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/README.md +15 -0
- package/es/SlAlert/index.vue.js +58 -0
- package/es/SlAlert/index.vue2.js +37 -0
- package/es/SlAlert/index.vue3.js +6 -0
- package/es/SlDescriptions/index.vue.js +55 -0
- package/es/SlDescriptions/index.vue2.js +57 -0
- package/es/SlDescriptions/index.vue3.js +6 -0
- package/es/SlDescriptions/renderOptions.vue.js +25 -0
- package/es/SlDescriptions/renderOptions.vue2.js +31 -0
- package/es/SlDialog/dialogPlus.js +159 -0
- package/es/SlDialog/index.js +202 -0
- package/es/SlDrawer/index.js +54 -0
- package/es/SlForm/index.vue.js +26 -0
- package/es/SlForm/index.vue2.js +433 -0
- package/es/SlForm/index.vue3.js +6 -0
- package/es/SlForm/mixinRender.js +239 -0
- package/es/SlForm/otherItem/titleItem.vue.js +39 -0
- package/es/SlForm/otherItem/titleItem.vue2.js +20 -0
- package/es/SlForm/otherItem/titleItem.vue3.js +6 -0
- package/es/SlGuide/index.vue.js +38 -0
- package/es/SlGuide/index.vue2.js +133 -0
- package/es/SlGuide/index.vue3.js +6 -0
- package/es/SlGuide/index.vue4.js +6 -0
- package/es/SlMessageBox/index.js +46 -0
- package/es/SlPage/index.vue.js +147 -0
- package/es/SlPage/index.vue2.js +312 -0
- package/es/SlPage/index.vue3.js +6 -0
- package/es/SlTable/components/colSetting.vue.js +94 -0
- package/es/SlTable/components/colSetting.vue2.js +66 -0
- package/es/SlTable/components/colSetting.vue3.js +6 -0
- package/es/SlTable/index.vue.js +171 -0
- package/es/SlTable/index.vue2.js +390 -0
- package/es/SlTable/index.vue3.js +6 -0
- package/es/SlTitle/index.vue.js +41 -0
- package/es/SlTitle/index.vue2.js +26 -0
- package/es/SlTitle/index.vue3.js +6 -0
- package/es/_virtual/_rollupPluginBabelHelpers.js +247 -0
- package/es/index.js +41 -0
- package/es/node_modules/shepherd.js/dist/css/shepherd.css.js +7 -0
- package/es/node_modules/style-inject/dist/style-inject.es.js +28 -0
- package/es/node_modules/vue-runtime-helpers/dist/normalize-component.js +76 -0
- package/es/utils/index.js +51 -0
- package/package.json +106 -0
- package/src/SlAlert/SlAlert.stories.js +108 -0
- package/src/SlAlert/index.vue +54 -0
- package/src/SlAlert/remark.md +16 -0
- package/src/SlDescriptions/SlDescriptions.stories.js +119 -0
- package/src/SlDescriptions/index.vue +60 -0
- package/src/SlDescriptions/renderOptions.vue +27 -0
- package/src/SlDialog/README-PLUS.md +74 -0
- package/src/SlDialog/README.md +114 -0
- package/src/SlDialog/dialogPlus.js +160 -0
- package/src/SlDialog/index.js +170 -0
- package/src/SlDrawer/SlDrawer.stories.js +154 -0
- package/src/SlDrawer/index.js +62 -0
- package/src/SlForm/SlForm.stories.js +120 -0
- package/src/SlForm/index.css +141 -0
- package/src/SlForm/index.vue +365 -0
- package/src/SlForm/mixinRender.js +228 -0
- package/src/SlForm/otherItem/titleItem.vue +31 -0
- package/src/SlForm/remark.md +607 -0
- package/src/SlGuide/SlGuide.stories.js +100 -0
- package/src/SlGuide/index.vue +166 -0
- package/src/SlGuide/remark.md +90 -0
- package/src/SlMessageBox/index.js +35 -0
- package/src/SlPage/README.md +515 -0
- package/src/SlPage/SlPage.stories.js +125 -0
- package/src/SlPage/index.css +38 -0
- package/src/SlPage/index.vue +266 -0
- package/src/SlPage/remark.md +283 -0
- package/src/SlTable/SlTable.stories.js +118 -0
- package/src/SlTable/components/colSetting.vue +86 -0
- package/src/SlTable/index.vue +541 -0
- package/src/SlTitle/SlTitle.stories.js +98 -0
- package/src/SlTitle/index.vue +49 -0
- package/src/global.css +5 -0
- package/src/index.js +47 -0
- package/src/store/index.js +20 -0
- package/src/utils/index.js +47 -0
- package/src/utils/tableConfig.js +33 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div></div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
// 运行时动态加载 shepherd.js
|
|
7
|
+
// 使用 webpackIgnore 注释避免消费项目的 webpack 在构建时解析此可选依赖
|
|
8
|
+
let Shepherd = null
|
|
9
|
+
|
|
10
|
+
async function loadShepherd() {
|
|
11
|
+
try {
|
|
12
|
+
const shepherdModule = await import(/* webpackIgnore: true */ 'shepherd.js')
|
|
13
|
+
Shepherd = shepherdModule.default || shepherdModule
|
|
14
|
+
await import(/* webpackIgnore: true */ 'shepherd.js/dist/css/shepherd.css')
|
|
15
|
+
return true
|
|
16
|
+
} catch (e) {
|
|
17
|
+
console.warn('[SlGuide] shepherd.js 未安装,引导功能不可用。请执行 npm install shepherd.js 安装依赖。')
|
|
18
|
+
return false
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'Guide',
|
|
24
|
+
props: {
|
|
25
|
+
steps: {
|
|
26
|
+
type: Array,
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
options: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: () => ({})
|
|
32
|
+
},
|
|
33
|
+
onNext: {
|
|
34
|
+
type: Function,
|
|
35
|
+
default: () => {}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
async mounted() {
|
|
39
|
+
// 仅在 shepherd.js 已安装时初始化引导
|
|
40
|
+
const loaded = await loadShepherd()
|
|
41
|
+
if (loaded) {
|
|
42
|
+
this.initTour()
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
initTour() {
|
|
47
|
+
const tour = new Shepherd.Tour({
|
|
48
|
+
...this.options,
|
|
49
|
+
defaultStepOptions: {
|
|
50
|
+
classes: 'shadow-md bg-purple-dark text-light shepherd-has-title',
|
|
51
|
+
scrollTo: true,
|
|
52
|
+
cancelIcon: {
|
|
53
|
+
enabled: false
|
|
54
|
+
},
|
|
55
|
+
highlightClass: 'highlight-custom-class'
|
|
56
|
+
},
|
|
57
|
+
exitOnEsc: true,
|
|
58
|
+
keyboardNavigation: true,
|
|
59
|
+
showCancelLink: false,
|
|
60
|
+
useModalOverlay: true
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
this.steps.forEach((step, index) => {
|
|
64
|
+
const customButtons = step.buttons.map(button => ({
|
|
65
|
+
...button,
|
|
66
|
+
action: () => {
|
|
67
|
+
if (button.actionType === 'next') {
|
|
68
|
+
button.action && button.action(tour)
|
|
69
|
+
|
|
70
|
+
tour.next()
|
|
71
|
+
} else {
|
|
72
|
+
button.action(tour)
|
|
73
|
+
}
|
|
74
|
+
return false
|
|
75
|
+
}
|
|
76
|
+
}))
|
|
77
|
+
|
|
78
|
+
tour.addStep({
|
|
79
|
+
...step,
|
|
80
|
+
buttons: customButtons,
|
|
81
|
+
beforeShowPromise: () => {
|
|
82
|
+
return new Promise(resolve => {
|
|
83
|
+
if (step.attachTo && step.attachTo.element) {
|
|
84
|
+
const el = document.querySelector(step.attachTo.element)
|
|
85
|
+
if (el) {
|
|
86
|
+
el.style.pointerEvents = 'none'
|
|
87
|
+
el.classList.add('disabled-by-shepherd')
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
resolve()
|
|
91
|
+
})
|
|
92
|
+
},
|
|
93
|
+
showOn: () => {
|
|
94
|
+
const el = document.querySelector(step.attachTo.element || '')
|
|
95
|
+
return Boolean(el)
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
tour.start()
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
</script>
|
|
105
|
+
<style lang="css">
|
|
106
|
+
.shepherd-element {
|
|
107
|
+
background-color: #158dff;
|
|
108
|
+
}
|
|
109
|
+
.shepherd-element[data-popper-placement=bottom] {
|
|
110
|
+
margin-top: 60px !important;
|
|
111
|
+
}
|
|
112
|
+
.shepherd-element[data-popper-placement=bottom] .shepherd-arrow {
|
|
113
|
+
width: 60px;
|
|
114
|
+
height: 60px;
|
|
115
|
+
/* background: url("~@/assets/images/u11370.svg") center no-repeat; */
|
|
116
|
+
left: -60px;
|
|
117
|
+
top: -61px;
|
|
118
|
+
}
|
|
119
|
+
.shepherd-element[data-popper-placement=bottom] .shepherd-arrow::before {
|
|
120
|
+
display: none;
|
|
121
|
+
}
|
|
122
|
+
.shepherd-element .shepherd-header {
|
|
123
|
+
height: 40px;
|
|
124
|
+
line-height: 40px;
|
|
125
|
+
background-color: #158dff;
|
|
126
|
+
}
|
|
127
|
+
.shepherd-element .shepherd-header .shepherd-title {
|
|
128
|
+
font-size: 16px;
|
|
129
|
+
font-weight: bold;
|
|
130
|
+
color: #fff;
|
|
131
|
+
}
|
|
132
|
+
.shepherd-element .shepherd-text {
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
padding: 1em;
|
|
135
|
+
line-height: 1.6;
|
|
136
|
+
color: #fff;
|
|
137
|
+
}
|
|
138
|
+
.shepherd-element .shepherd-footer {
|
|
139
|
+
padding: 0 1em 1em;
|
|
140
|
+
color: #fff;
|
|
141
|
+
}
|
|
142
|
+
.shepherd-element .shepherd-footer .shepherd-button {
|
|
143
|
+
height: 32px;
|
|
144
|
+
padding: 0 1.5rem;
|
|
145
|
+
line-height: 32px;
|
|
146
|
+
background-color: #fff;
|
|
147
|
+
color: #158dff;
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
}
|
|
150
|
+
.shepherd-element .shepherd-button-quit {
|
|
151
|
+
background: none !important;
|
|
152
|
+
color: rgb(201, 202, 202) !important;
|
|
153
|
+
}
|
|
154
|
+
.shepherd-element .disabled-by-shepherd {
|
|
155
|
+
pointer-events: none;
|
|
156
|
+
opacity: 0.6;
|
|
157
|
+
cursor: not-allowed;
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
160
|
+
<style scoped lang="css">
|
|
161
|
+
@charset "UTF-8";
|
|
162
|
+
/* 自定义高亮样式 */
|
|
163
|
+
.highlight-custom-class {
|
|
164
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
165
|
+
}
|
|
166
|
+
</style>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
|
|
3
|
+
<div>
|
|
4
|
+
<el-button id="aaaa" size="small" type="primary" @click="vvvv = true">vvvv</el-button>
|
|
5
|
+
<button class="yourButtonClass" id="firstButton">第一个按钮</button>
|
|
6
|
+
<button class="yourButtonClass" id="secondButton">第二个按钮</button>
|
|
7
|
+
|
|
8
|
+
<Guidess v-if="vvvv" :steps="steps" :options="options" @onNext="handleNext" />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
</template>
|
|
13
|
+
<script>
|
|
14
|
+
import Guidess from '@/components/global/SlGuide'
|
|
15
|
+
export default {
|
|
16
|
+
components: {
|
|
17
|
+
SlPage,
|
|
18
|
+
SlTable,
|
|
19
|
+
SlMessage,
|
|
20
|
+
Guide,
|
|
21
|
+
Guidess
|
|
22
|
+
},
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
vvvv: false,
|
|
26
|
+
currentStepIndex: 0,
|
|
27
|
+
steps: [
|
|
28
|
+
{
|
|
29
|
+
id: 'first-step',
|
|
30
|
+
text: '这是引导的第一步!',
|
|
31
|
+
attachTo: { element: '.yourButtonClass#firstButton', on: 'bottom' }, // 使用类名和ID
|
|
32
|
+
buttons: [
|
|
33
|
+
{
|
|
34
|
+
text: '上一步',
|
|
35
|
+
action: (tour) => tour.back(),
|
|
36
|
+
classes: 'shepherd-button-secondary'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
text: '下一步',
|
|
40
|
+
actionType: 'next', // 标记为下一步
|
|
41
|
+
classes: 'shepherd-button-primary'
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'second-step',
|
|
47
|
+
text: '这是引导的第二步!',
|
|
48
|
+
attachTo: { element: '.yourButtonClass#secondButton', on: 'bottom' }, // 使用类名和ID
|
|
49
|
+
buttons: [
|
|
50
|
+
{
|
|
51
|
+
text: '上一步',
|
|
52
|
+
action: (tour) => tour.back(),
|
|
53
|
+
classes: 'shepherd-button-secondary'
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
text: '完成',
|
|
57
|
+
actionType: 'next', // 标记为下一步
|
|
58
|
+
classes: 'shepherd-button-primary'
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
options: {
|
|
64
|
+
defaultStepOptions: {
|
|
65
|
+
classes: 'shepherd-theme-arrows',
|
|
66
|
+
scrollTo: true
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<!-- const targetColumnIndex = 1 // “姓名”列的索引
|
|
75
|
+
// 找到目标单元格元素
|
|
76
|
+
const targetCell = document.querySelector(`.el-table__body tr:nth-child(${1 + 1}) .el-table__cell:nth-child(${targetColumnIndex + 1})`)
|
|
77
|
+
const tour = new Shepherd.Tour({
|
|
78
|
+
defaultStepOptions: {
|
|
79
|
+
classes: 'shadow-md bg-purple-dark text-light',
|
|
80
|
+
scrollTo: true,
|
|
81
|
+
cancelIcon: {
|
|
82
|
+
enabled: true
|
|
83
|
+
},
|
|
84
|
+
highlightClass: 'highlight-custom-class'
|
|
85
|
+
},
|
|
86
|
+
exitOnEsc: true,
|
|
87
|
+
keyboardNavigation: true,
|
|
88
|
+
showCancelLink: false,
|
|
89
|
+
useModalOverlay: true
|
|
90
|
+
}) -->
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
import { MessageBox, Message } from 'element-ui'
|
|
3
|
+
|
|
4
|
+
export function showConfirmMessageBox(options) {
|
|
5
|
+
const defaultOptions = {
|
|
6
|
+
title: '提示',
|
|
7
|
+
confirmButtonText: '确定',
|
|
8
|
+
cancelButtonText: '取消',
|
|
9
|
+
type: 'warning',
|
|
10
|
+
successMessage: '操作成功'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const mergedOptions = { ...defaultOptions, ...options }
|
|
14
|
+
|
|
15
|
+
MessageBox.confirm(mergedOptions.message, mergedOptions.title, {
|
|
16
|
+
confirmButtonText: mergedOptions.confirmButtonText,
|
|
17
|
+
cancelButtonText: mergedOptions.cancelButtonText,
|
|
18
|
+
type: mergedOptions.type
|
|
19
|
+
}).then(async() => {
|
|
20
|
+
if (typeof mergedOptions.api === 'function') {
|
|
21
|
+
await mergedOptions.api(mergedOptions.params)
|
|
22
|
+
}
|
|
23
|
+
if (typeof mergedOptions.onConfirm === 'function') {
|
|
24
|
+
mergedOptions.onConfirm()
|
|
25
|
+
}
|
|
26
|
+
Message({
|
|
27
|
+
type: 'success',
|
|
28
|
+
message: mergedOptions.successMessage
|
|
29
|
+
})
|
|
30
|
+
}).catch(() => {
|
|
31
|
+
if (typeof mergedOptions.onCancel === 'function') {
|
|
32
|
+
mergedOptions.onCancel()
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
}
|