form-custom-test 3.0.233 → 3.0.234

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/dist/render.es.js CHANGED
@@ -26648,13 +26648,13 @@ function registerIcon(app) {
26648
26648
  if (typeof window !== "undefined") {
26649
26649
  let loadSvg = function() {
26650
26650
  var body = document.body;
26651
- var svgDom = document.getElementById("__svg__icons__dom__1783570275335__");
26651
+ var svgDom = document.getElementById("__svg__icons__dom__1784188326988__");
26652
26652
  if (!svgDom) {
26653
26653
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26654
26654
  svgDom.style.position = "absolute";
26655
26655
  svgDom.style.width = "0";
26656
26656
  svgDom.style.height = "0";
26657
- svgDom.id = "__svg__icons__dom__1783570275335__";
26657
+ svgDom.id = "__svg__icons__dom__1784188326988__";
26658
26658
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26659
26659
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26660
26660
  }
@@ -36374,7 +36374,16 @@ const _sfc_main$m = {
36374
36374
  SvgIcon
36375
36375
  },
36376
36376
  props: {
36377
- widget: Object
36377
+ widget: Object,
36378
+ parentWidget: Object,
36379
+ subFormRowIndex: {
36380
+ type: Number,
36381
+ default: -1
36382
+ },
36383
+ subFormRowId: {
36384
+ type: String,
36385
+ default: ""
36386
+ }
36378
36387
  },
36379
36388
  inject: ["refList", "sfRefList", "globalModel"],
36380
36389
  data() {
@@ -36458,6 +36467,24 @@ const _sfc_main$m = {
36458
36467
  }
36459
36468
  });
36460
36469
  },
36470
+ handleWidgetOnChange(value2, oldValue) {
36471
+ var _a, _b, _c, _d, _e;
36472
+ const onChange = (_b = (_a = this.widget) == null ? void 0 : _a.options) == null ? void 0 : _b.onChange;
36473
+ if (!onChange || !onChange.trim()) {
36474
+ return;
36475
+ }
36476
+ try {
36477
+ let subFormData;
36478
+ let rowId;
36479
+ if (this.subFormRowIndex >= 0 && ((_c = this.parentWidget) == null ? void 0 : _c.type) === "sub-form") {
36480
+ subFormData = (_e = (_d = this.globalModel) == null ? void 0 : _d.formModel) == null ? void 0 : _e[this.parentWidget.options.name];
36481
+ rowId = this.subFormRowId;
36482
+ }
36483
+ new Function("value", "oldValue", "subFormData", "rowId", onChange).call(this, value2, oldValue, subFormData, rowId);
36484
+ } catch (e) {
36485
+ console.error("\u6267\u884C\u5B50\u8868\u683C onChange \u4E8B\u4EF6\u5931\u8D25:", e);
36486
+ }
36487
+ },
36461
36488
  updateFormModel(data2) {
36462
36489
  if (this.globalModel && this.globalModel.formModel) {
36463
36490
  this.globalModel.formModel[this.widget.options.name] = deepClone(data2);
@@ -36505,8 +36532,10 @@ const _sfc_main$m = {
36505
36532
  cancelButtonText: "\u53D6\u6D88",
36506
36533
  type: "warning"
36507
36534
  }).then(() => {
36535
+ const oldTableData = deepClone(this.tableData);
36508
36536
  this.tableData.splice(index2, 1);
36509
36537
  this.updateFormModel(this.tableData);
36538
+ this.handleWidgetOnChange(deepClone(this.tableData), oldTableData);
36510
36539
  this.$message.success("\u5220\u9664\u6210\u529F");
36511
36540
  if (this.widget.options.onRowDelete) {
36512
36541
  try {
@@ -36609,6 +36638,7 @@ const _sfc_main$m = {
36609
36638
  this.$refs.dialogFormRef.validate((valid) => {
36610
36639
  if (valid) {
36611
36640
  const rowData = deepClone(this.dialogFormData);
36641
+ const oldTableData = deepClone(this.tableData);
36612
36642
  if (rowData._columnOptions)
36613
36643
  ;
36614
36644
  if (this.editingIndex === -1) {
@@ -36633,6 +36663,7 @@ const _sfc_main$m = {
36633
36663
  }
36634
36664
  }
36635
36665
  this.updateFormModel(this.tableData);
36666
+ this.handleWidgetOnChange(deepClone(this.tableData), oldTableData);
36636
36667
  this.dialogVisible = false;
36637
36668
  } else {
36638
36669
  this.$message.warning("\u8BF7\u586B\u5199\u5B8C\u6574\u4FE1\u606F");
@@ -37045,7 +37076,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
37045
37076
  _: 1
37046
37077
  }, 8, ["widget"]);
37047
37078
  }
37048
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-7ee123a5"]]);
37079
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-758078c3"]]);
37049
37080
  var ace$2 = { exports: {} };
37050
37081
  (function(module, exports) {
37051
37082
  (function() {