meixioacomponent 0.4.49 → 0.4.50
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
CHANGED
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
:rules="rules"
|
|
24
24
|
:footer="false"
|
|
25
25
|
v-model="formList"
|
|
26
|
+
:formType="formType"
|
|
26
27
|
:disabled="disabled"
|
|
27
28
|
:rowNumber="rowNumber"
|
|
28
29
|
:labelWidth="labelWidth"
|
|
30
|
+
:labelPosition="labelPosition"
|
|
29
31
|
@formItemConfirm="formItemConfirm"
|
|
30
32
|
>
|
|
31
33
|
<template v-for="slotItem in slotList">
|
|
@@ -33,25 +35,26 @@
|
|
|
33
35
|
<slot :scope="formList" :name="`formslot-${slotItem}`"></slot>
|
|
34
36
|
</template>
|
|
35
37
|
</template>
|
|
36
|
-
</pro_formVue>
|
|
37
|
-
|
|
38
|
+
</pro_formVue>
|
|
39
|
+
</template>
|
|
40
|
+
</baseSectionVue>
|
|
38
41
|
</div>
|
|
39
42
|
</template>
|
|
40
43
|
|
|
41
44
|
<script>
|
|
42
|
-
import pro_formVue from
|
|
43
|
-
import baseSectionVue from
|
|
45
|
+
import pro_formVue from '../proForm/pro_form.vue'
|
|
46
|
+
import baseSectionVue from '../../base/baseSection/baseSection.vue'
|
|
44
47
|
export default {
|
|
45
|
-
name:
|
|
48
|
+
name: 'baseFormWrap',
|
|
46
49
|
data() {
|
|
47
50
|
return {
|
|
48
51
|
slotList: [],
|
|
49
52
|
sectionOpen: true,
|
|
50
|
-
}
|
|
53
|
+
}
|
|
51
54
|
},
|
|
52
55
|
created() {
|
|
53
|
-
this.createSlots()
|
|
54
|
-
console.log(this.slotList)
|
|
56
|
+
this.createSlots()
|
|
57
|
+
console.log(this.slotList)
|
|
55
58
|
},
|
|
56
59
|
props: {
|
|
57
60
|
disabled: {
|
|
@@ -66,10 +69,13 @@ export default {
|
|
|
66
69
|
type: String,
|
|
67
70
|
require: true,
|
|
68
71
|
},
|
|
69
|
-
|
|
72
|
+
labelPosition: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: `right`,
|
|
75
|
+
},
|
|
70
76
|
labelWidth: {
|
|
71
77
|
type: String,
|
|
72
|
-
default:
|
|
78
|
+
default: '100px',
|
|
73
79
|
},
|
|
74
80
|
|
|
75
81
|
formList: {
|
|
@@ -85,15 +91,19 @@ export default {
|
|
|
85
91
|
},
|
|
86
92
|
size: {
|
|
87
93
|
type: String,
|
|
88
|
-
default:
|
|
94
|
+
default: 'small',
|
|
95
|
+
},
|
|
96
|
+
formType: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: 'default',
|
|
89
99
|
},
|
|
90
100
|
},
|
|
91
101
|
computed: {
|
|
92
102
|
iconClass() {
|
|
93
103
|
if (this.sectionOpen) {
|
|
94
|
-
return
|
|
104
|
+
return 'meixicomponenticon-shouqi'
|
|
95
105
|
}
|
|
96
|
-
return
|
|
106
|
+
return 'meixicomponenticon-xiala'
|
|
97
107
|
},
|
|
98
108
|
},
|
|
99
109
|
components: {
|
|
@@ -102,38 +112,38 @@ export default {
|
|
|
102
112
|
},
|
|
103
113
|
methods: {
|
|
104
114
|
createSlots() {
|
|
105
|
-
let slotList = this.slotList
|
|
106
|
-
let formList = this.$props.formList
|
|
115
|
+
let slotList = this.slotList
|
|
116
|
+
let formList = this.$props.formList
|
|
107
117
|
for (let i = 0; i < formList.length; i++) {
|
|
108
|
-
let citem = formList[i]
|
|
109
|
-
if (citem.type ==
|
|
110
|
-
slotList.push(citem.key)
|
|
118
|
+
let citem = formList[i]
|
|
119
|
+
if (citem.type == 'template') {
|
|
120
|
+
slotList.push(citem.key)
|
|
111
121
|
}
|
|
112
122
|
}
|
|
113
123
|
},
|
|
114
124
|
|
|
115
125
|
async checkValidate() {
|
|
116
|
-
let refs = this.$refs.proForm
|
|
117
|
-
let validateResult = true
|
|
118
|
-
let validate = await refs.checkValidate()
|
|
119
|
-
validateResult = validate.result
|
|
126
|
+
let refs = this.$refs.proForm
|
|
127
|
+
let validateResult = true
|
|
128
|
+
let validate = await refs.checkValidate()
|
|
129
|
+
validateResult = validate.result
|
|
120
130
|
if (!validateResult) {
|
|
121
|
-
return validateResult
|
|
131
|
+
return validateResult
|
|
122
132
|
}
|
|
123
|
-
return validateResult
|
|
133
|
+
return validateResult
|
|
124
134
|
},
|
|
125
135
|
handleSection() {
|
|
126
|
-
this.sectionOpen = !this.sectionOpen
|
|
136
|
+
this.sectionOpen = !this.sectionOpen
|
|
127
137
|
},
|
|
128
138
|
formItemConfirm(configItem) {
|
|
129
|
-
this.$emit(
|
|
139
|
+
this.$emit('formItemConfirm', configItem)
|
|
130
140
|
},
|
|
131
141
|
|
|
132
142
|
getFormValue() {
|
|
133
|
-
return this.$refs.proForm.returnFormValue()
|
|
143
|
+
return this.$refs.proForm.returnFormValue()
|
|
134
144
|
},
|
|
135
145
|
},
|
|
136
|
-
}
|
|
146
|
+
}
|
|
137
147
|
</script>
|
|
138
148
|
|
|
139
149
|
<style lang="less" scoped>
|