meixioacomponent 0.3.72 → 0.3.73
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 +122 -115
- package/lib/meixioacomponent.umd.js +122 -115
- package/lib/meixioacomponent.umd.min.js +9 -9
- package/package.json +1 -1
- package/packages/components/proForm/dialogForm/baseDialogForm.vue +55 -54
- package/packages/components/proForm/proForm/pro_form.vue +7 -2
package/package.json
CHANGED
|
@@ -27,7 +27,9 @@
|
|
|
27
27
|
:form="true"
|
|
28
28
|
:size="size"
|
|
29
29
|
:footer="false"
|
|
30
|
+
ref="proFormVue"
|
|
30
31
|
:formConfig="item"
|
|
32
|
+
:isDialogForm="true"
|
|
31
33
|
:disables="disables"
|
|
32
34
|
:rowNumber="rowNumber"
|
|
33
35
|
:labelWidth="labelWidth"
|
|
@@ -35,7 +37,6 @@
|
|
|
35
37
|
:rules="returnRules(item.key)"
|
|
36
38
|
:labelPosition="setLabelPosition(item.formType)"
|
|
37
39
|
:formType="item.formType ? item.formType : 'default'"
|
|
38
|
-
ref="proFormVue"
|
|
39
40
|
@disableWatcherResult="disableWatcherResult"
|
|
40
41
|
>
|
|
41
42
|
<template v-for="slotItem in slotList">
|
|
@@ -59,20 +60,20 @@
|
|
|
59
60
|
</template>
|
|
60
61
|
|
|
61
62
|
<script>
|
|
62
|
-
import pro_formVue from
|
|
63
|
-
import baseButtonHandleVue from
|
|
63
|
+
import pro_formVue from '../proForm/pro_form.vue'
|
|
64
|
+
import baseButtonHandleVue from '../../base/baseButtonHandle/baseButtonHandle.vue'
|
|
64
65
|
export default {
|
|
65
|
-
name:
|
|
66
|
+
name: 'baseDialogForm',
|
|
66
67
|
data() {
|
|
67
68
|
return {
|
|
68
69
|
slotList: [],
|
|
69
|
-
}
|
|
70
|
+
}
|
|
70
71
|
},
|
|
71
72
|
created() {
|
|
72
|
-
this.createSlots()
|
|
73
|
+
this.createSlots()
|
|
73
74
|
},
|
|
74
75
|
beforeDestroy() {
|
|
75
|
-
this.$parent.$destroy()
|
|
76
|
+
this.$parent.$destroy()
|
|
76
77
|
},
|
|
77
78
|
mounted() {},
|
|
78
79
|
props: {
|
|
@@ -83,7 +84,7 @@ export default {
|
|
|
83
84
|
top: {
|
|
84
85
|
type: Number,
|
|
85
86
|
default: () => {
|
|
86
|
-
return document.documentElement.clientHeight * 0.15
|
|
87
|
+
return document.documentElement.clientHeight * 0.15
|
|
87
88
|
},
|
|
88
89
|
},
|
|
89
90
|
// 是否开启拖拽
|
|
@@ -108,7 +109,7 @@ export default {
|
|
|
108
109
|
// 每一个itemlabel的宽度
|
|
109
110
|
labelWidth: {
|
|
110
111
|
type: String,
|
|
111
|
-
default:
|
|
112
|
+
default: '100px',
|
|
112
113
|
},
|
|
113
114
|
// 弹框尾部
|
|
114
115
|
footerHandleConfig: {
|
|
@@ -121,7 +122,7 @@ export default {
|
|
|
121
122
|
},
|
|
122
123
|
size: {
|
|
123
124
|
type: String,
|
|
124
|
-
default:
|
|
125
|
+
default: 'small',
|
|
125
126
|
},
|
|
126
127
|
rowNumber: {
|
|
127
128
|
type: Number,
|
|
@@ -130,12 +131,12 @@ export default {
|
|
|
130
131
|
|
|
131
132
|
footerButtonSize: {
|
|
132
133
|
type: String,
|
|
133
|
-
default:
|
|
134
|
+
default: 'small',
|
|
134
135
|
},
|
|
135
136
|
|
|
136
137
|
contentHeight: {
|
|
137
138
|
type: String,
|
|
138
|
-
default:
|
|
139
|
+
default: '50vh',
|
|
139
140
|
},
|
|
140
141
|
labelPosition: {
|
|
141
142
|
type: String,
|
|
@@ -149,102 +150,102 @@ export default {
|
|
|
149
150
|
computed: {
|
|
150
151
|
module: {
|
|
151
152
|
set(val) {
|
|
152
|
-
this.$emit(
|
|
153
|
+
this.$emit('input', val)
|
|
153
154
|
},
|
|
154
155
|
get() {
|
|
155
|
-
return this.$props.value
|
|
156
|
+
return this.$props.value
|
|
156
157
|
},
|
|
157
158
|
},
|
|
158
159
|
},
|
|
159
160
|
methods: {
|
|
160
161
|
createSlots() {
|
|
161
162
|
for (let i = 0; i < this.module.length; i++) {
|
|
162
|
-
let item = this.module[i]
|
|
163
|
+
let item = this.module[i]
|
|
163
164
|
for (let j = 0; j < item.formList.length; j++) {
|
|
164
|
-
let citem = item.formList[j]
|
|
165
|
-
if (citem.type ==
|
|
166
|
-
this.slotList.push(citem.key)
|
|
165
|
+
let citem = item.formList[j]
|
|
166
|
+
if (citem.type == 'template') {
|
|
167
|
+
this.slotList.push(citem.key)
|
|
167
168
|
}
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
},
|
|
171
172
|
disableWatcherResult(params) {
|
|
172
|
-
const { result, type, key } = params
|
|
173
|
-
let index = 0
|
|
174
|
-
let cindex = -1
|
|
173
|
+
const { result, type, key } = params
|
|
174
|
+
let index = 0
|
|
175
|
+
let cindex = -1
|
|
175
176
|
|
|
176
177
|
for (let i = 0; i < this.module.length; i++) {
|
|
177
|
-
let item = this.module[i]
|
|
178
|
+
let item = this.module[i]
|
|
178
179
|
for (let j = 0; j < item.formList.length; j++) {
|
|
179
|
-
let citem = item.formList[j]
|
|
180
|
+
let citem = item.formList[j]
|
|
180
181
|
if (citem.key == key) {
|
|
181
|
-
index = i
|
|
182
|
-
cindex = j
|
|
183
|
-
break
|
|
182
|
+
index = i
|
|
183
|
+
cindex = j
|
|
184
|
+
break
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
|
|
188
189
|
if (cindex > -1) {
|
|
189
|
-
let formItem = this.module[index].formList[cindex]
|
|
190
|
-
if (type ==
|
|
191
|
-
this.$set(formItem,
|
|
192
|
-
} else if (type ==
|
|
193
|
-
this.$set(formItem,
|
|
190
|
+
let formItem = this.module[index].formList[cindex]
|
|
191
|
+
if (type == 'hide') {
|
|
192
|
+
this.$set(formItem, 'renderHide', result)
|
|
193
|
+
} else if (type == 'disable') {
|
|
194
|
+
this.$set(formItem, 'disabled', result)
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
},
|
|
197
198
|
setLabelPosition(type) {
|
|
198
199
|
if (!type) {
|
|
199
|
-
return this.$props.labelPosition
|
|
200
|
-
} else if (type ==
|
|
201
|
-
return
|
|
200
|
+
return this.$props.labelPosition
|
|
201
|
+
} else if (type == 'upload') {
|
|
202
|
+
return 'top'
|
|
202
203
|
}
|
|
203
204
|
},
|
|
204
205
|
returnRules(key) {
|
|
205
|
-
let rulesList = this.$props.rulesList
|
|
206
|
-
if (!rulesList) return null
|
|
207
|
-
let listItem = rulesList[`${key}`] ? rulesList[`${key}`] : null
|
|
206
|
+
let rulesList = this.$props.rulesList
|
|
207
|
+
if (!rulesList) return null
|
|
208
|
+
let listItem = rulesList[`${key}`] ? rulesList[`${key}`] : null
|
|
208
209
|
if (listItem) {
|
|
209
|
-
return listItem
|
|
210
|
+
return listItem
|
|
210
211
|
}
|
|
211
|
-
return null
|
|
212
|
+
return null
|
|
212
213
|
},
|
|
213
214
|
showDialog() {
|
|
214
|
-
this.$refs.dialog.showDialog()
|
|
215
|
+
this.$refs.dialog.showDialog()
|
|
215
216
|
},
|
|
216
217
|
closeDialog() {
|
|
217
|
-
this.$refs.dialog.closeDialog()
|
|
218
|
+
this.$refs.dialog.closeDialog()
|
|
218
219
|
},
|
|
219
220
|
|
|
220
221
|
getFormValue() {
|
|
221
|
-
let obj = {}
|
|
222
|
+
let obj = {}
|
|
222
223
|
for (let i = 0; i < this.module.length; i++) {
|
|
223
|
-
let result = this.$refs.proFormVue[i].returnFormValue()
|
|
224
|
+
let result = this.$refs.proFormVue[i].returnFormValue()
|
|
224
225
|
// obj[`${this.module[i].key}`] = result;
|
|
225
|
-
obj = { ...obj, ...result }
|
|
226
|
+
obj = { ...obj, ...result }
|
|
226
227
|
}
|
|
227
|
-
return obj
|
|
228
|
+
return obj
|
|
228
229
|
},
|
|
229
230
|
async checkValidate() {
|
|
230
|
-
let refs = this.$refs.proFormVue
|
|
231
|
-
let validateResult = true
|
|
231
|
+
let refs = this.$refs.proFormVue
|
|
232
|
+
let validateResult = true
|
|
232
233
|
for (let i = 0; i < refs.length; i++) {
|
|
233
|
-
let validate = await refs[i].checkValidate()
|
|
234
|
-
validateResult = validate.result
|
|
234
|
+
let validate = await refs[i].checkValidate()
|
|
235
|
+
validateResult = validate.result
|
|
235
236
|
//console.log(result);
|
|
236
237
|
if (!validateResult) {
|
|
237
|
-
return validateResult
|
|
238
|
+
return validateResult
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
|
-
return validateResult
|
|
241
|
+
return validateResult
|
|
241
242
|
},
|
|
242
243
|
destroyForDialog() {
|
|
243
|
-
this.$destroy()
|
|
244
|
+
this.$destroy()
|
|
244
245
|
},
|
|
245
246
|
},
|
|
246
247
|
watch: {},
|
|
247
|
-
}
|
|
248
|
+
}
|
|
248
249
|
</script>
|
|
249
250
|
|
|
250
251
|
<style lang="less" scoped>
|
|
@@ -265,7 +266,7 @@ export default {
|
|
|
265
266
|
justify-content: flex-start;
|
|
266
267
|
margin-bottom: var(--margin-4);
|
|
267
268
|
&::before {
|
|
268
|
-
content:
|
|
269
|
+
content: '';
|
|
269
270
|
top: 0px;
|
|
270
271
|
width: 4px;
|
|
271
272
|
height: 100%;
|
|
@@ -173,6 +173,11 @@ export default {
|
|
|
173
173
|
default: 'small',
|
|
174
174
|
},
|
|
175
175
|
|
|
176
|
+
isDialogForm: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: false,
|
|
179
|
+
},
|
|
180
|
+
|
|
176
181
|
footButtonText: { type: Array, default: () => ['取消', '确定'] },
|
|
177
182
|
},
|
|
178
183
|
components: {
|
|
@@ -370,8 +375,8 @@ export default {
|
|
|
370
375
|
},
|
|
371
376
|
|
|
372
377
|
disableWatcherResult(params) {
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
378
|
+
const { isDialogForm } = this.$props
|
|
379
|
+
if (isDialogForm) {
|
|
375
380
|
this.$emit('disableWatcherResult', params)
|
|
376
381
|
} else {
|
|
377
382
|
const { result, type, key } = params
|