leisure-core 0.4.47 → 0.4.48

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.
@@ -201,7 +201,6 @@ export default {
201
201
  data() {
202
202
  return {
203
203
  formPop: {},
204
-
205
204
  searchData: {
206
205
  pageNo: 1,
207
206
  total: 1,
@@ -215,6 +214,12 @@ export default {
215
214
  this.getList();
216
215
  },
217
216
  methods: {
217
+ initFormItem() {
218
+ this.formPop = this.formColumns.reduce((acc, item) => {
219
+ acc[item.prop] = item.default;
220
+ return acc;
221
+ }, {});
222
+ },
218
223
  onClickQuery() {
219
224
  this.searchData.pageNo = 1;
220
225
  this.getList();
@@ -237,7 +242,7 @@ export default {
237
242
  this.showDialog = true;
238
243
  },
239
244
  addItem() {
240
- this.formPop = {};
245
+ this.initFormItem();
241
246
  this.showDialog = true;
242
247
  },
243
248
  saveData() {
@@ -247,6 +252,7 @@ export default {
247
252
  if (valid) {
248
253
  this.$emit("saveForm", this.formPop, () => {
249
254
  this.getList();
255
+ this.closeDialog();
250
256
  });
251
257
  } else {
252
258
  return false;
@@ -254,7 +260,7 @@ export default {
254
260
  });
255
261
  },
256
262
  closeDialog() {
257
- this.formPop = {};
263
+ this.initFormItem();
258
264
  this.showDialog = false;
259
265
  },
260
266
  getOptions(prop) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "leisure-core",
3
- "version": "0.4.47",
3
+ "version": "0.4.48",
4
4
  "description": "leisure-core是leisure-ui-core的简称,是京心数据基于vue2.0开发的一套后台系统框架与js库,包含登录,首页框架等",
5
5
  "private": false,
6
6
  "author": "北方乐逍遥(zcx7878)",