meixioacomponent 0.4.39 → 0.4.40
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 +238 -143
- package/lib/meixioacomponent.umd.js +238 -143
- package/lib/meixioacomponent.umd.min.js +11 -11
- package/package.json +1 -1
- package/packages/components/base/baseStoreSelect/index.vue +99 -0
- package/packages/components/base/baseUpload/baseUpload.vue +1 -0
- package/packages/components/proForm/proForm/pro_form_item.vue +18 -51
- package/src/component/test.vue +4 -25
- package/src/component/testSelectStore.js +1 -1
package/package.json
CHANGED
|
@@ -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>
|
|
@@ -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) => {
|
|
@@ -475,7 +442,7 @@ export default {
|
|
|
475
442
|
this.init()
|
|
476
443
|
},
|
|
477
444
|
},
|
|
478
|
-
components: { BaseNumberInput },
|
|
445
|
+
components: { BaseNumberInput, baseStoreSelect },
|
|
479
446
|
}
|
|
480
447
|
</script>
|
|
481
448
|
|
package/src/component/test.vue
CHANGED
|
@@ -544,7 +544,7 @@ export default {
|
|
|
544
544
|
<!-- 普通表单 -->
|
|
545
545
|
|
|
546
546
|
<!-- 上传表单 -->
|
|
547
|
-
<template>
|
|
547
|
+
<!-- <template>
|
|
548
548
|
<base-dialog-form
|
|
549
549
|
ref="dialogFormVue"
|
|
550
550
|
:title="`测试表格`"
|
|
@@ -559,9 +559,6 @@ export default {
|
|
|
559
559
|
<el-input v-model="data.scope[0].value"></el-input>
|
|
560
560
|
</template>
|
|
561
561
|
|
|
562
|
-
<!-- <template slot="formWrap-test2">
|
|
563
|
-
<div style="width: 100%; height: 100px; background: red;"></div>
|
|
564
|
-
</template> -->
|
|
565
562
|
</base-dialog-form>
|
|
566
563
|
</template>
|
|
567
564
|
|
|
@@ -813,9 +810,9 @@ export default {
|
|
|
813
810
|
}
|
|
814
811
|
</script>
|
|
815
812
|
|
|
816
|
-
<style></style>
|
|
813
|
+
<style></style> -->
|
|
817
814
|
|
|
818
|
-
|
|
815
|
+
<template>
|
|
819
816
|
<base-form-wrap
|
|
820
817
|
:rowNumber="2"
|
|
821
818
|
:disables="disables"
|
|
@@ -831,18 +828,6 @@ export default {
|
|
|
831
828
|
data() {
|
|
832
829
|
return {
|
|
833
830
|
formList: [
|
|
834
|
-
{
|
|
835
|
-
value: '',
|
|
836
|
-
key: 'legalPerson',
|
|
837
|
-
type: 'input',
|
|
838
|
-
label: '法人名称',
|
|
839
|
-
},
|
|
840
|
-
{
|
|
841
|
-
value: '',
|
|
842
|
-
key: 'idCard',
|
|
843
|
-
type: 'input',
|
|
844
|
-
label: '法人身份证',
|
|
845
|
-
},
|
|
846
831
|
{
|
|
847
832
|
value: 1,
|
|
848
833
|
key: 'businessLicense',
|
|
@@ -850,12 +835,6 @@ export default {
|
|
|
850
835
|
label: '营业执照号',
|
|
851
836
|
useStore: 'testSelectStore',
|
|
852
837
|
},
|
|
853
|
-
{
|
|
854
|
-
value: 'sdakjsdkajk',
|
|
855
|
-
key: 'businessLicenseFile',
|
|
856
|
-
type: 'textarea',
|
|
857
|
-
label: '营业执照电子版',
|
|
858
|
-
},
|
|
859
838
|
],
|
|
860
839
|
disables: {
|
|
861
840
|
businessLicense: {
|
|
@@ -875,4 +854,4 @@ export default {
|
|
|
875
854
|
}
|
|
876
855
|
</script>
|
|
877
856
|
|
|
878
|
-
<style lang="less" scoped></style>
|
|
857
|
+
<style lang="less" scoped></style>
|