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.
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.5.40",
3
+ "version": "0.5.43",
4
4
  "description": "leisure-core是京心数据基于vue2.x开发的一套后台管理系统桌面端组件库,封装了大量实用的UI控件模板,非常方便开发者快速搭建前端应用",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",