@fecp/designer 5.2.2 → 5.2.3

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.
@@ -289,14 +289,15 @@ const _sfc_main = {
289
289
  });
290
290
  return btnArr;
291
291
  });
292
- function formFooterClick(button) {
292
+ async function formFooterClick(button) {
293
293
  var _a;
294
294
  const formData = dialogFormRef.value.getFormData();
295
- handleEvent.value(
295
+ await handleEvent.value(
296
296
  formData,
297
297
  button,
298
298
  (_a = button.eventConfig) == null ? void 0 : _a.find((item) => item.name == "Click")
299
299
  );
300
+ emit("confirm");
300
301
  }
301
302
  return (_ctx, _cache) => {
302
303
  const _component_el_button = index$3.ElButton;
@@ -411,5 +412,5 @@ const _sfc_main = {
411
412
  };
412
413
  }
413
414
  };
414
- const DialogRenderer = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-1e8ea0b4"]]);
415
+ const DialogRenderer = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-dd10a495"]]);
415
416
  exports.default = DialogRenderer;
@@ -45,12 +45,12 @@ function openDialog(displayField, dialogConfig, instance, componentCtx, fieldsLi
45
45
  }
46
46
  },
47
47
  onConfirm: (data) => {
48
- resolve(data);
49
48
  cleanupDialog();
49
+ resolve(data);
50
50
  },
51
51
  onCancel: () => {
52
- reject(new Error("用户取消"));
53
52
  cleanupDialog();
53
+ reject(new Error("用户取消"));
54
54
  }
55
55
  });
56
56
  vnode.appContext = instance.appContext;
@@ -504,9 +504,23 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
504
504
  result[fieldName] = value.join("|");
505
505
  }
506
506
  } else if (fieldName && fieldType === "date" && value) {
507
+ const dateValueType = field.dateValueType;
507
508
  const valueFormat = valueFormatMap[field.dateType] || "YYYYMMDD";
508
509
  const formValueFormat = formValueFormatMap[field.dateType] || "YYYY-MM-DD";
509
- result[fieldName] = moment.default(value, formValueFormat).format(valueFormat);
510
+ switch (dateValueType) {
511
+ case "date":
512
+ result[fieldName] = moment.default(value, formValueFormat).toDate();
513
+ break;
514
+ case "timestamp":
515
+ result[fieldName] = moment.default(value, formValueFormat).valueOf();
516
+ break;
517
+ case "string":
518
+ default:
519
+ result[fieldName] = moment.default(value, formValueFormat).format(
520
+ valueFormat
521
+ );
522
+ break;
523
+ }
510
524
  }
511
525
  };
512
526
  if (fieldsData.value) {
@@ -668,5 +682,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
668
682
  };
669
683
  }
670
684
  });
671
- const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-263c93f9"]]);
685
+ const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-42af7e52"]]);
672
686
  exports.default = _Form;
@@ -257,7 +257,7 @@ const _sfc_main = {
257
257
  };
258
258
  const optColumnWidth = vue.computed(() => {
259
259
  const padding = 20;
260
- const btnWidth = 40;
260
+ const btnWidth = 60;
261
261
  if (!props.tableData || props.tableData.length === 0) {
262
262
  return props.optBtns.length * btnWidth + padding;
263
263
  }
@@ -379,5 +379,5 @@ const _sfc_main = {
379
379
  };
380
380
  }
381
381
  };
382
- const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-df099102"]]);
382
+ const TableColumn = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-82ffe38c"]]);
383
383
  exports.default = TableColumn;
@@ -461,22 +461,29 @@ async function handleDialog(node, data, fields, context) {
461
461
  console.error("ui-dialog: 未找到匹配的弹层配置," + (basic == null ? void 0 : basic.dialogId));
462
462
  return;
463
463
  }
464
- index$1.openDialog(
465
- basic.displayFieldName,
466
- dialog,
467
- context.instance,
468
- context.ctx,
469
- fields,
470
- data
471
- ).then((result) => {
472
- console.log("确定", result);
473
- }).catch(() => {
474
- console.log("取消");
475
- });
476
- return {
477
- success: true,
478
- message: `弹层 ${dialog.name} 已打开`
479
- };
464
+ try {
465
+ await index$1.openDialog(
466
+ basic.displayFieldName,
467
+ dialog,
468
+ context.instance,
469
+ context.ctx,
470
+ fields,
471
+ data
472
+ );
473
+ return {
474
+ success: true,
475
+ message: "用户已确认",
476
+ shouldShowError: false
477
+ };
478
+ } catch (error) {
479
+ return {
480
+ success: false,
481
+ message: "用户已取消",
482
+ confirmed: false,
483
+ shouldShowError: false
484
+ // 用户取消不提示错误
485
+ };
486
+ }
480
487
  }
481
488
  const defaultActionHandlers = {
482
489
  "page-jump": handlePageJump,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.2.2",
3
+ "version": "5.2.3",
4
4
  "main": "lib/packages/designer/index.js",
5
5
  "module": "es/packages/designer/index.mjs",
6
6
  "files": [