meixioacomponent 0.4.39 → 0.4.42
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/lib/meixioacomponent.common.js +369 -269
- package/lib/meixioacomponent.umd.js +369 -269
- package/lib/meixioacomponent.umd.min.js +14 -14
- package/package.json +1 -1
- package/packages/components/base/baseNumberInput/index.vue +6 -4
- package/packages/components/base/baseStoreSelect/index.vue +99 -0
- package/packages/components/base/baseUpload/baseUpload.vue +1 -0
- package/packages/components/proForm/dialogForm/baseDialogForm.vue +26 -23
- package/packages/components/proForm/proForm/pro_form_item.vue +22 -52
- package/src/component/test.vue +165 -214
- package/src/component/testSelectStore.js +1 -1
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="pro-number-wrap">
|
|
3
3
|
<el-input-number
|
|
4
|
-
:size="size"
|
|
5
|
-
ref="target"
|
|
6
|
-
:controls="false"
|
|
7
4
|
:class="{
|
|
8
5
|
unit: unit,
|
|
9
6
|
}"
|
|
7
|
+
:size="size"
|
|
8
|
+
ref="target"
|
|
9
|
+
:controls="controls"
|
|
10
10
|
:precision="precision"
|
|
11
11
|
v-model.number="module"
|
|
12
12
|
:disabled="disabled"
|
|
13
13
|
:maxlength="maxlength"
|
|
14
14
|
style="width: 100%; height: 100%;"
|
|
15
15
|
></el-input-number>
|
|
16
|
-
<div class="number-unit" v-if="unit">
|
|
16
|
+
<div class="number-unit" v-if="unit && !controls">
|
|
17
17
|
<span>{{ unit }}</span>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
@@ -39,6 +39,8 @@ export default {
|
|
|
39
39
|
maxlength: {},
|
|
40
40
|
|
|
41
41
|
size: {},
|
|
42
|
+
|
|
43
|
+
controls: { default: false },
|
|
42
44
|
},
|
|
43
45
|
computed: {
|
|
44
46
|
module: {
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-select
|
|
3
|
+
:size="size"
|
|
4
|
+
ref="target"
|
|
5
|
+
v-if="selectStore"
|
|
6
|
+
v-model="module"
|
|
7
|
+
:filterable="true"
|
|
8
|
+
placeholder="请选择"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
:multiple="multiple"
|
|
11
|
+
:loading="selectLoading"
|
|
12
|
+
:multipleLimit="multipleLimit"
|
|
13
|
+
@visible-change="visibleChange"
|
|
14
|
+
style="width: 100%; height: 100%;"
|
|
15
|
+
>
|
|
16
|
+
<el-option
|
|
17
|
+
v-for="item in selectData"
|
|
18
|
+
:key="item.value"
|
|
19
|
+
:label="item[`${selectConfig.label}`]"
|
|
20
|
+
:value="item[`${selectConfig.value}`]"
|
|
21
|
+
></el-option>
|
|
22
|
+
</el-select>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import componentConfig from '../../../config/componentConfig'
|
|
27
|
+
export default {
|
|
28
|
+
name: 'baseStoreSelect',
|
|
29
|
+
data() {
|
|
30
|
+
return {}
|
|
31
|
+
},
|
|
32
|
+
created() {
|
|
33
|
+
this.loadSelectData()
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
size: {},
|
|
37
|
+
value: {},
|
|
38
|
+
multiple: {},
|
|
39
|
+
disabled: {},
|
|
40
|
+
multipleLimit: {},
|
|
41
|
+
useStore: {},
|
|
42
|
+
useSlot: {
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
computed: {
|
|
48
|
+
module: {
|
|
49
|
+
set(val) {
|
|
50
|
+
this.$emit('input', val)
|
|
51
|
+
},
|
|
52
|
+
get() {
|
|
53
|
+
return this.$props.value
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
selectLoading() {
|
|
57
|
+
return this.selectStore?.getLoading()
|
|
58
|
+
},
|
|
59
|
+
selectStore() {
|
|
60
|
+
const { useStore } = this.$props
|
|
61
|
+
return componentConfig.selectStore.getStore(useStore)
|
|
62
|
+
},
|
|
63
|
+
selectData() {
|
|
64
|
+
return this.selectStore.getData()
|
|
65
|
+
},
|
|
66
|
+
selectConfig() {
|
|
67
|
+
return this.selectStore.getConfig()
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
methods: {
|
|
72
|
+
visibleChange() {},
|
|
73
|
+
|
|
74
|
+
focus() {
|
|
75
|
+
this.$refs.target.focus()
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
getSelectData() {
|
|
79
|
+
return this.selectData
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
getSelectConfig() {
|
|
83
|
+
return this.selectConfig
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
loadSelectData() {
|
|
87
|
+
this.selectStore.loadData()
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
visibleChange(visible) {
|
|
91
|
+
if (!visible) return
|
|
92
|
+
if (this.selectData.length > 0) return
|
|
93
|
+
this.loadSelectData()
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style lang="less" scoped></style>
|
|
@@ -169,7 +169,7 @@ export default {
|
|
|
169
169
|
},
|
|
170
170
|
methods: {
|
|
171
171
|
createSlots() {
|
|
172
|
-
this.slotList=[]
|
|
172
|
+
this.slotList = []
|
|
173
173
|
for (let i = 0; i < this.module.length; i++) {
|
|
174
174
|
let item = this.module[i]
|
|
175
175
|
for (let j = 0; j < item.formList.length; j++) {
|
|
@@ -181,33 +181,36 @@ export default {
|
|
|
181
181
|
}
|
|
182
182
|
},
|
|
183
183
|
disableWatcherResult(params) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
console.log(params)
|
|
185
|
+
this.$nextTick(() => {
|
|
186
|
+
const { result, type, key } = params
|
|
187
|
+
let index = 0
|
|
188
|
+
let cindex = -1
|
|
187
189
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
for (let i = 0; i < this.module.length; i++) {
|
|
191
|
+
let item = this.module[i]
|
|
192
|
+
for (let j = 0; j < item.formList.length; j++) {
|
|
193
|
+
let citem = item.formList[j]
|
|
194
|
+
if (citem.key == key) {
|
|
195
|
+
index = i
|
|
196
|
+
cindex = j
|
|
197
|
+
break
|
|
198
|
+
}
|
|
196
199
|
}
|
|
197
200
|
}
|
|
198
|
-
}
|
|
199
201
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
if (cindex > -1) {
|
|
203
|
+
let formItem = this.module[index].formList[cindex]
|
|
204
|
+
if (type == 'hide') {
|
|
205
|
+
this.$set(formItem, 'renderHide', result)
|
|
206
|
+
} else if (type == 'disable') {
|
|
207
|
+
this.$set(formItem, 'disabled', result)
|
|
208
|
+
} else if (type == 'template') {
|
|
209
|
+
formItem.type = result
|
|
210
|
+
this.createSlots()
|
|
211
|
+
}
|
|
209
212
|
}
|
|
210
|
-
}
|
|
213
|
+
})
|
|
211
214
|
},
|
|
212
215
|
setLabelPosition(type) {
|
|
213
216
|
if (!type) {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
'form-item-wrap': true,
|
|
9
9
|
}"
|
|
10
10
|
>
|
|
11
|
-
<div class="item-content" v-if="!typeOftemplate
|
|
11
|
+
<div class="item-content" v-if="!typeOftemplate" v-show="!isEdit">
|
|
12
12
|
<p
|
|
13
|
-
v-if="!spContentType"
|
|
13
|
+
v-if="!spContentType && selectMounted"
|
|
14
14
|
class="content-value"
|
|
15
15
|
@click="handleClick('content')"
|
|
16
16
|
:class="[`${config.click ? 'click' : config.color}`]"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
></base-icon>
|
|
72
72
|
</div>
|
|
73
73
|
|
|
74
|
-
<div class="item-handle-wrap" :class="[`${config.type}`]" v-
|
|
74
|
+
<div class="item-handle-wrap" :class="[`${config.type}`]" v-show="isEdit">
|
|
75
75
|
<!-- input输入框 -->
|
|
76
76
|
<el-input
|
|
77
77
|
ref="target"
|
|
@@ -107,28 +107,19 @@
|
|
|
107
107
|
></BaseNumberInput>
|
|
108
108
|
|
|
109
109
|
<!-- select选择器 -->
|
|
110
|
-
|
|
110
|
+
|
|
111
|
+
<baseStoreSelect
|
|
111
112
|
:size="size"
|
|
112
113
|
ref="target"
|
|
113
114
|
v-model="module"
|
|
114
|
-
placeholder="请选择"
|
|
115
115
|
:multiple="multiple"
|
|
116
|
-
:filterable="true"
|
|
117
|
-
:loading="selectLoading"
|
|
118
116
|
:disabled="isDisabled"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
:useStore="config.useStore"
|
|
118
|
+
v-else-if="config.type == 'select'"
|
|
119
|
+
@hook:mounted="selectMounted = true"
|
|
122
120
|
:multipleLimit="config.multipleLimit"
|
|
123
|
-
>
|
|
124
|
-
|
|
125
|
-
v-for="item in selectData"
|
|
126
|
-
:key="item.value"
|
|
127
|
-
:label="item[`${selectConfig.label}`]"
|
|
128
|
-
:value="item[`${selectConfig.value}`]"
|
|
129
|
-
></el-option>
|
|
130
|
-
</el-select>
|
|
131
|
-
<!-- 单时间选择器 -->
|
|
121
|
+
></baseStoreSelect>
|
|
122
|
+
|
|
132
123
|
<el-date-picker
|
|
133
124
|
align="right"
|
|
134
125
|
v-model="module"
|
|
@@ -221,14 +212,14 @@
|
|
|
221
212
|
</template>
|
|
222
213
|
|
|
223
214
|
<script>
|
|
224
|
-
//
|
|
225
|
-
import componentConfig from '../../../config/componentConfig'
|
|
226
215
|
import BaseNumberInput from '../../base/baseNumberInput/index.vue'
|
|
216
|
+
import baseStoreSelect from '../../base/baseStoreSelect/index.vue'
|
|
227
217
|
export default {
|
|
228
218
|
data() {
|
|
229
219
|
return {
|
|
230
220
|
isEdit: false,
|
|
231
221
|
oldValue: null,
|
|
222
|
+
selectMounted: false,
|
|
232
223
|
}
|
|
233
224
|
},
|
|
234
225
|
created() {
|
|
@@ -279,18 +270,7 @@ export default {
|
|
|
279
270
|
multiple() {
|
|
280
271
|
return this.$props.config.multipleLimit ? true : false
|
|
281
272
|
},
|
|
282
|
-
|
|
283
|
-
return this.selectStore?.getLoading()
|
|
284
|
-
},
|
|
285
|
-
selectStore() {
|
|
286
|
-
return componentConfig.selectStore.getStore(this.$props.config.useStore)
|
|
287
|
-
},
|
|
288
|
-
selectData() {
|
|
289
|
-
return this.selectStore.getData()
|
|
290
|
-
},
|
|
291
|
-
selectConfig() {
|
|
292
|
-
return this.selectStore.getConfig()
|
|
293
|
-
},
|
|
273
|
+
|
|
294
274
|
spContentType() {
|
|
295
275
|
let configType = this.$props.config.type
|
|
296
276
|
if (
|
|
@@ -317,8 +297,8 @@ export default {
|
|
|
317
297
|
case 'textarea':
|
|
318
298
|
return this.module
|
|
319
299
|
case 'select':
|
|
320
|
-
let list = this.
|
|
321
|
-
const selectConfig = this.
|
|
300
|
+
let list = this.$refs.target.getSelectData()
|
|
301
|
+
const selectConfig = this.$refs.target.getSelectConfig()
|
|
322
302
|
if (list.length > 0) {
|
|
323
303
|
if (!this.multiple) {
|
|
324
304
|
if (this.module) {
|
|
@@ -342,7 +322,7 @@ export default {
|
|
|
342
322
|
return text
|
|
343
323
|
}
|
|
344
324
|
} else {
|
|
345
|
-
this.loadSelectData()
|
|
325
|
+
this.$refs.target.loadSelectData()
|
|
346
326
|
return this.$props.config.value
|
|
347
327
|
}
|
|
348
328
|
// case "time":
|
|
@@ -384,12 +364,6 @@ export default {
|
|
|
384
364
|
},
|
|
385
365
|
module: {
|
|
386
366
|
get() {
|
|
387
|
-
let type = this.$props.config.type
|
|
388
|
-
if (type == 'select') {
|
|
389
|
-
if (this.selectData.length <= 0) {
|
|
390
|
-
this.loadSelectData()
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
367
|
return this.$props.value
|
|
394
368
|
},
|
|
395
369
|
set(val) {
|
|
@@ -449,14 +423,7 @@ export default {
|
|
|
449
423
|
handleConfirm() {
|
|
450
424
|
this.isEdit = false
|
|
451
425
|
},
|
|
452
|
-
|
|
453
|
-
this.selectStore.loadData()
|
|
454
|
-
},
|
|
455
|
-
visibleChange(visible) {
|
|
456
|
-
if (!visible) return
|
|
457
|
-
if (this.selectData.length > 0) return
|
|
458
|
-
this.loadSelectData()
|
|
459
|
-
},
|
|
426
|
+
|
|
460
427
|
triggerDisable(val) {
|
|
461
428
|
let effects = this.$props.disableWatcher.effects
|
|
462
429
|
effects.forEach((item) => {
|
|
@@ -465,8 +432,11 @@ export default {
|
|
|
465
432
|
type: item.type,
|
|
466
433
|
result: item.fn(val),
|
|
467
434
|
}
|
|
468
|
-
|
|
435
|
+
|
|
436
|
+
|
|
469
437
|
this.$emit('disableWatcherResult', obj)
|
|
438
|
+
|
|
439
|
+
|
|
470
440
|
})
|
|
471
441
|
},
|
|
472
442
|
},
|
|
@@ -475,7 +445,7 @@ export default {
|
|
|
475
445
|
this.init()
|
|
476
446
|
},
|
|
477
447
|
},
|
|
478
|
-
components: { BaseNumberInput },
|
|
448
|
+
components: { BaseNumberInput, baseStoreSelect },
|
|
479
449
|
}
|
|
480
450
|
</script>
|
|
481
451
|
|