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.
|
|
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.
|
|
263
|
+
this.initFormItem();
|
|
258
264
|
this.showDialog = false;
|
|
259
265
|
},
|
|
260
266
|
getOptions(prop) {
|