form-custom-test 3.0.233 → 3.0.235

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__1784189603868__");
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__1784189603868__";
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() {
@@ -61666,7 +61697,8 @@ const _sfc_main$k = {
61666
61697
  required: false,
61667
61698
  validation: "",
61668
61699
  validationHint: "",
61669
- defaultValue: ""
61700
+ defaultValue: "",
61701
+ editable: true
61670
61702
  };
61671
61703
  this.optionModel.columns.push(newColumn);
61672
61704
  this.designer.saveCurrentHistoryStep();
@@ -62022,6 +62054,16 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
62022
62054
  ]),
62023
62055
  _: 2
62024
62056
  }, 1032, ["label"])) : createCommentVNode("", true),
62057
+ createVNode(_component_el_form_item, { label: "\u662F\u5426\u53EF\u7F16\u8F91" }, {
62058
+ default: withCtx(() => [
62059
+ createVNode(_component_el_switch, {
62060
+ modelValue: col.editable,
62061
+ "onUpdate:modelValue": ($event) => col.editable = $event,
62062
+ onChange: $options.handleColumnChange
62063
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
62064
+ ]),
62065
+ _: 2
62066
+ }, 1024),
62025
62067
  createVNode(_component_el_form_item, { label: "\u662F\u5426\u5FC5\u586B" }, {
62026
62068
  default: withCtx(() => [
62027
62069
  createVNode(_component_el_switch, {
@@ -62315,7 +62357,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
62315
62357
  }, 8, ["modelValue", "title"])
62316
62358
  ], 64);
62317
62359
  }
62318
- var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-2401420e"]]);
62360
+ var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-c70bc6ae"]]);
62319
62361
  const _sfc_main$j = {
62320
62362
  name: "current-user-widget",
62321
62363
  componentName: "FieldWidget",