leisure-core 0.5.40 → 0.5.43
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/le-list-form/src/main.vue +27 -1
- package/package.json +1 -1
|
@@ -175,7 +175,15 @@ export default {
|
|
|
175
175
|
};
|
|
176
176
|
},
|
|
177
177
|
},
|
|
178
|
-
mounted() {
|
|
178
|
+
mounted() {
|
|
179
|
+
this.$nextTick(() => {
|
|
180
|
+
this.$emit("form-ready", {
|
|
181
|
+
setFieldValue: this.setFieldValue,
|
|
182
|
+
getFormData: this.getFormData,
|
|
183
|
+
initFormData: this.initFormData,
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
},
|
|
179
187
|
methods: {
|
|
180
188
|
componentType(type) {
|
|
181
189
|
if (!this.dynamicComponentMap[type]) {
|
|
@@ -207,6 +215,9 @@ export default {
|
|
|
207
215
|
EventBus.$emit("closeDialog");
|
|
208
216
|
this.$emit("closeDialog");
|
|
209
217
|
},
|
|
218
|
+
setValue(ele, eleValue) {
|
|
219
|
+
this.formPop[ele] = eleValue;
|
|
220
|
+
},
|
|
210
221
|
saveData() {
|
|
211
222
|
this.$refs["ruleForm"].validate((valid) => {
|
|
212
223
|
if (valid) {
|
|
@@ -216,6 +227,21 @@ export default {
|
|
|
216
227
|
}
|
|
217
228
|
});
|
|
218
229
|
},
|
|
230
|
+
|
|
231
|
+
initFormData(additionalData = {}) {
|
|
232
|
+
this.formPop = {
|
|
233
|
+
...this.formPop,
|
|
234
|
+
...additionalData,
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
setFieldValue(field, value) {
|
|
239
|
+
this.$set(this.formPop, field, value);
|
|
240
|
+
},
|
|
241
|
+
|
|
242
|
+
getFormData() {
|
|
243
|
+
return { ...this.formPop };
|
|
244
|
+
},
|
|
219
245
|
},
|
|
220
246
|
};
|
|
221
247
|
</script>
|