ylwl-cpscoms 1.1.0 → 1.2.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/package.json +2 -3
- package/src/DtTable/DtTable/347/273/204/344/273/266/344/275/277/347/224/250/346/226/207/346/241/243.md +0 -819
- package/src/DtTable/index.vue +0 -779
- package/src/SlAlert/SlAlert.stories.js +0 -108
- package/src/SlAlert/index.vue +0 -55
- package/src/SlAlert/remark.md +0 -16
- package/src/SlDescriptions/SlDescriptions.stories.js +0 -119
- package/src/SlDescriptions/index.vue +0 -60
- package/src/SlDescriptions/renderOptions.vue +0 -27
- package/src/SlDialog/README-PLUS.md +0 -74
- package/src/SlDialog/README.md +0 -114
- package/src/SlDialog/dialogPlus.js +0 -160
- package/src/SlDialog/index.js +0 -170
- package/src/SlDrawer/SlDrawer.stories.js +0 -154
- package/src/SlDrawer/index.js +0 -62
- package/src/SlForm/SlForm.stories.js +0 -120
- package/src/SlForm/index.vue +0 -506
- package/src/SlForm/mixinRender.js +0 -228
- package/src/SlForm/otherItem/titleItem.vue +0 -31
- package/src/SlForm/remark.md +0 -607
- package/src/SlGuide/SlGuide.stories.js +0 -100
- package/src/SlGuide/index.vue +0 -166
- package/src/SlGuide/remark.md +0 -90
- package/src/SlMessageBox/index.js +0 -35
- package/src/SlPage/README.md +0 -515
- package/src/SlPage/SlPage.stories.js +0 -125
- package/src/SlPage/index.vue +0 -303
- package/src/SlPage/remark.md +0 -283
- package/src/SlTable/SlTable.stories.js +0 -118
- package/src/SlTable/components/colSetting.vue +0 -86
- package/src/SlTable/index.vue +0 -541
- package/src/SlTitle/SlTitle.stories.js +0 -98
- package/src/SlTitle/index.vue +0 -49
- package/src/global.css +0 -5
- package/src/index.js +0 -49
- package/src/store/index.js +0 -20
- package/src/utils/index.js +0 -47
- package/src/utils/tableConfig.js +0 -33
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import titleItem from '@/components/global/SlForm/otherItem/titleItem.vue'
|
|
2
|
-
import EL from 'element-ui'
|
|
3
|
-
import { typeOf } from '@/components/global/utils'
|
|
4
|
-
export default {
|
|
5
|
-
components: {
|
|
6
|
-
titleItem
|
|
7
|
-
},
|
|
8
|
-
methods: {
|
|
9
|
-
renderTitle(ce, item) {
|
|
10
|
-
return ce(titleItem, {
|
|
11
|
-
props: {
|
|
12
|
-
item
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
},
|
|
17
|
-
renderSwitch(ce, item) {
|
|
18
|
-
return ce(EL.Switch, {
|
|
19
|
-
...this.initCommonProps(item)
|
|
20
|
-
})
|
|
21
|
-
},
|
|
22
|
-
renderDrawer(ce) {
|
|
23
|
-
return ce(
|
|
24
|
-
EL.Button,
|
|
25
|
-
{
|
|
26
|
-
props: {
|
|
27
|
-
icon: this.isDrawerOpen ? 'el-icon-top-right' : 'el-icon-rank',
|
|
28
|
-
type: 'primary'
|
|
29
|
-
},
|
|
30
|
-
on: {
|
|
31
|
-
click: () => {
|
|
32
|
-
this.isDrawerOpen = !this.isDrawerOpen
|
|
33
|
-
this.boxHeight = this.isDrawerOpen ? 'auto' : this.firstitemHeight
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
// this.isDrawerOpen ? 'shrink' : 'open'
|
|
38
|
-
)
|
|
39
|
-
},
|
|
40
|
-
renderText(ce, item) {
|
|
41
|
-
return ce('div', { style: { width: '100%' }}, this.form[item.model])
|
|
42
|
-
},
|
|
43
|
-
renderInput(ce, item) {
|
|
44
|
-
return ce('div', { style: { width: '100%' }}, [
|
|
45
|
-
ce(EL.Input, {
|
|
46
|
-
...this.initCommonProps(item, [], {}, item.privateAttrs)
|
|
47
|
-
}),
|
|
48
|
-
ce('div', { style: { color: 'red', lineHeight: 2, fontSize: '12px' }}, item.remark)
|
|
49
|
-
])
|
|
50
|
-
// return ce(EL.Input, {
|
|
51
|
-
// ...this.initCommonProps(item, [], {}, item.privateAttrs)
|
|
52
|
-
// })
|
|
53
|
-
},
|
|
54
|
-
renderInputNumber(ce, item) {
|
|
55
|
-
return ce('div', { style: { width: item.privateAttrs && item.privateAttrs.style && item.privateAttrs.style.width ? item.privateAttrs.style.width : '90%' }}, [
|
|
56
|
-
ce(EL.InputNumber, {
|
|
57
|
-
...this.initCommonProps(item, [], { 'controls-position': 'right' }, item.privateAttrs)
|
|
58
|
-
}),
|
|
59
|
-
ce('span', { style: { marginLeft: '10px' }}, item.privateAttrs && item.privateAttrs.unit ? item.privateAttrs.unit : ''),
|
|
60
|
-
ce('div', { style: { color: 'red', lineHeight: 2, fontSize: '12px' }}, item.remark)
|
|
61
|
-
])
|
|
62
|
-
// return ce(EL.Input, {
|
|
63
|
-
// ...this.initCommonProps(item, [], {}, item.privateAttrs)
|
|
64
|
-
// })
|
|
65
|
-
},
|
|
66
|
-
renderSelect(ce, item) {
|
|
67
|
-
const {
|
|
68
|
-
labelKey = 'label',
|
|
69
|
-
valueKey = 'value',
|
|
70
|
-
// options,
|
|
71
|
-
// remoteMethod,
|
|
72
|
-
// props = {},
|
|
73
|
-
model,
|
|
74
|
-
slots
|
|
75
|
-
// asycnOptions
|
|
76
|
-
// label
|
|
77
|
-
} = item
|
|
78
|
-
// const isopstr = typeOf(options, 'string')
|
|
79
|
-
// const isopsFun = typeOf(asycnOptions, 'function')
|
|
80
|
-
// const isremote = typeOf(remoteMethod, 'function')
|
|
81
|
-
// const op = (isopsFun ? (await asycnOptions()) : options) || []
|
|
82
|
-
// console.log(this.selectOptions, "this.selectOptions")
|
|
83
|
-
// if (isopsFun) {
|
|
84
|
-
// asycnOptions().then(result => {
|
|
85
|
-
// this.$set(this.selectOptions, model, result || [])
|
|
86
|
-
// // return result || []
|
|
87
|
-
// })
|
|
88
|
-
// } else {
|
|
89
|
-
// this.$set(this.selectOptions, model, options || [])
|
|
90
|
-
// }
|
|
91
|
-
const customOp = this.initCommonProps(
|
|
92
|
-
item,
|
|
93
|
-
['options', 'labelKey', 'valueKey'],
|
|
94
|
-
{
|
|
95
|
-
hitable: true,
|
|
96
|
-
defaultFirstOption: true
|
|
97
|
-
},
|
|
98
|
-
item.privateAttrs
|
|
99
|
-
)
|
|
100
|
-
const otherSlots = Object.entries(slots || {}).reduce(
|
|
101
|
-
(pre, [key, fun]) => {
|
|
102
|
-
typeOf(fun, 'function') &&
|
|
103
|
-
(pre[key] = () => {
|
|
104
|
-
return fun(ce)
|
|
105
|
-
})
|
|
106
|
-
return pre
|
|
107
|
-
},
|
|
108
|
-
{}
|
|
109
|
-
)
|
|
110
|
-
// return ce(bstSelect.SelectPro, {
|
|
111
|
-
return ce(EL.Select, {
|
|
112
|
-
...customOp,
|
|
113
|
-
scopedSlots: {
|
|
114
|
-
default: () => {
|
|
115
|
-
return this.selectOptions[model] && this.selectOptions[model].length ? this.selectOptions[model].map((o) =>
|
|
116
|
-
// ce(bstSelect.SelectOption, {
|
|
117
|
-
ce(EL.Option, {
|
|
118
|
-
props: Object.assign({}, o, {
|
|
119
|
-
key: 'id',
|
|
120
|
-
data: o,
|
|
121
|
-
label: o[labelKey],
|
|
122
|
-
value: o[valueKey]
|
|
123
|
-
})
|
|
124
|
-
})
|
|
125
|
-
) : []
|
|
126
|
-
// return op.map(o=>ce(EL.Option,{props:Object.assign({},o,{key:'id',data:o,label:o[labelKey],value:o[valueKey]})}))
|
|
127
|
-
},
|
|
128
|
-
...otherSlots
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
},
|
|
132
|
-
renderDatePicker(ce, item) {
|
|
133
|
-
return ce(EL.DatePicker, {
|
|
134
|
-
...this.initCommonProps(item, [], {
|
|
135
|
-
startPlaceholder: '开始时间',
|
|
136
|
-
endPlaceholder: '结束时间',
|
|
137
|
-
defaultTime: item.privateProps && item.privateProps.type === 'daterange' ? ['00:00:00', '23:59:59'] : undefined,
|
|
138
|
-
...item.privateProps
|
|
139
|
-
}, item.privateProps)
|
|
140
|
-
})
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
renderRadio(ce, item) {
|
|
144
|
-
const { labelKey = 'label', valueKey = 'value', model } = item
|
|
145
|
-
return ce(
|
|
146
|
-
EL.RadioGroup,
|
|
147
|
-
{
|
|
148
|
-
...this.initCommonProps(item, [
|
|
149
|
-
'options',
|
|
150
|
-
'labelKey',
|
|
151
|
-
'valueKey',
|
|
152
|
-
'label'
|
|
153
|
-
])
|
|
154
|
-
},
|
|
155
|
-
this.selectOptions[model] && this.selectOptions[model].length ? this.selectOptions[model].map((o) =>
|
|
156
|
-
ce(EL.Radio, { props: { label: o[valueKey] }}, [o[labelKey]])
|
|
157
|
-
) : []
|
|
158
|
-
)
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
renderSlider(ce, item) {
|
|
162
|
-
return ce('div', { class: 'yl-form-slider' }, [
|
|
163
|
-
ce('span', { class: 'yl-form-slider-span' }, [item.label]),
|
|
164
|
-
ce(EL.Slider, {
|
|
165
|
-
...this.initCommonProps(item, []),
|
|
166
|
-
style: 'width:200px'
|
|
167
|
-
})
|
|
168
|
-
])
|
|
169
|
-
},
|
|
170
|
-
renderRangeInput(ce, item) {
|
|
171
|
-
!typeOf(item.value, 'array') && (item.value = [])
|
|
172
|
-
// const target = item.callback ? this.transfer : this.form
|
|
173
|
-
const target = this.form
|
|
174
|
-
const val = target[item.model]
|
|
175
|
-
const style = ''
|
|
176
|
-
// 清空输入框的函数
|
|
177
|
-
const clearInputs = () => {
|
|
178
|
-
this.fomateValue(item, ['', ''])
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// 检查是否至少有一个输入框有值
|
|
182
|
-
const hasValue = val && (val[0] || val[1])
|
|
183
|
-
return ce('div', { class: 'yl-form-range-input' }, [
|
|
184
|
-
ce('span', { class: 'yl-form-slider-span' }, [item.label]),
|
|
185
|
-
ce('input', {
|
|
186
|
-
style,
|
|
187
|
-
domProps: { value: val[0], placeholder: '起始值', type: 'number' },
|
|
188
|
-
on: {
|
|
189
|
-
input: ({ target }) => {
|
|
190
|
-
this.fomateValue(item, [target.value, val[1]])
|
|
191
|
-
// this.$emit("input",this.form);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}),
|
|
195
|
-
'-',
|
|
196
|
-
ce('input', {
|
|
197
|
-
style,
|
|
198
|
-
domProps: { value: val[1], placeholder: '截止值', type: 'number' },
|
|
199
|
-
on: {
|
|
200
|
-
input: ({ target }) => {
|
|
201
|
-
this.fomateValue(item, [val[0], target.value])
|
|
202
|
-
// this.$emit("input",this.form);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
}),
|
|
206
|
-
hasValue && ce('button', {
|
|
207
|
-
class: 'range-input-clear-btn',
|
|
208
|
-
attrs: { type: 'button' },
|
|
209
|
-
style: {
|
|
210
|
-
marginLeft: '5px',
|
|
211
|
-
background: 'none',
|
|
212
|
-
border: 'none',
|
|
213
|
-
fontSize: '16px',
|
|
214
|
-
cursor: 'pointer',
|
|
215
|
-
color: '#999'
|
|
216
|
-
},
|
|
217
|
-
on: {
|
|
218
|
-
click: (e) => {
|
|
219
|
-
e.stopPropagation()
|
|
220
|
-
clearInputs()
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}, '×')
|
|
224
|
-
])
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<h3 class="title-item">
|
|
3
|
-
{{ item.label }}
|
|
4
|
-
</h3>
|
|
5
|
-
</template>
|
|
6
|
-
<script>
|
|
7
|
-
export default {
|
|
8
|
-
name: 'TitleItem',
|
|
9
|
-
props: {
|
|
10
|
-
item: {
|
|
11
|
-
type: Object,
|
|
12
|
-
default: () => {}
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
mounted() {
|
|
16
|
-
// console.log(this.item, "你的手")
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
</script>
|
|
20
|
-
<style scoped>
|
|
21
|
-
.title-item::before {
|
|
22
|
-
content: "|";
|
|
23
|
-
width: 3px;
|
|
24
|
-
background-color: #409EFF;
|
|
25
|
-
color: #409EFF;
|
|
26
|
-
}
|
|
27
|
-
.title-item {
|
|
28
|
-
margin-bottom: 20px;
|
|
29
|
-
}
|
|
30
|
-
</style>
|
|
31
|
-
|