form-custom-test 3.0.136 → 3.0.138

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
@@ -25866,6 +25866,69 @@ const _sfc_main$v = {
25866
25866
  getStaticTextRefs() {
25867
25867
  return Object.values(this.widgetRefList).filter((ref2) => ref2 && ref2.field && ref2.field.type === "static-text");
25868
25868
  },
25869
+ updateFieldLabel(fieldName, newLabel) {
25870
+ if (!fieldName)
25871
+ return false;
25872
+ const labelText = newLabel == null ? "" : String(newLabel);
25873
+ const seen = new Set();
25874
+ const refsToUpdate = [];
25875
+ const pushRef = (r) => {
25876
+ if (!r || !r.field || !r.field.options || seen.has(r))
25877
+ return;
25878
+ if (r.field.options.name !== fieldName)
25879
+ return;
25880
+ seen.add(r);
25881
+ refsToUpdate.push(r);
25882
+ };
25883
+ Object.keys(this.widgetRefList).forEach((k) => {
25884
+ if (k === "v_form_ref")
25885
+ return;
25886
+ if (k === fieldName || k.startsWith(fieldName + "@row")) {
25887
+ pushRef(this.widgetRefList[k]);
25888
+ }
25889
+ });
25890
+ if (refsToUpdate.length > 0) {
25891
+ refsToUpdate.forEach((r) => {
25892
+ r.field.options.label = labelText;
25893
+ });
25894
+ this.$forceUpdate();
25895
+ return true;
25896
+ }
25897
+ const formJson = this.getFormJson();
25898
+ let updated = false;
25899
+ const walk = (list) => {
25900
+ if (!Array.isArray(list) || updated)
25901
+ return;
25902
+ list.forEach((w) => {
25903
+ if (updated || !w)
25904
+ return;
25905
+ if (w.options && w.options.name === fieldName) {
25906
+ w.options.label = labelText;
25907
+ updated = true;
25908
+ return;
25909
+ }
25910
+ if (Array.isArray(w.widgetList))
25911
+ walk(w.widgetList);
25912
+ if (Array.isArray(w.cols)) {
25913
+ w.cols.forEach((c) => walk(c && c.widgetList));
25914
+ }
25915
+ if (Array.isArray(w.rows)) {
25916
+ w.rows.forEach((r) => Array.isArray(r && r.cols) && r.cols.forEach((c) => walk(c && c.widgetList)));
25917
+ }
25918
+ if (Array.isArray(w.tabs)) {
25919
+ w.tabs.forEach((t) => walk(t && t.widgetList));
25920
+ }
25921
+ });
25922
+ };
25923
+ walk(formJson && formJson.widgetList);
25924
+ if (!updated)
25925
+ return false;
25926
+ this.setFormJson(formJson);
25927
+ return true;
25928
+ },
25929
+ setFieldLabel(fieldName, newLabel) {
25930
+ return this.updateFieldLabel(fieldName, newLabel);
25931
+ },
25869
25932
  clearFormDataModel() {
25870
25933
  for (let pkey in this.formDataModel) {
25871
25934
  delete this.formDataModel[pkey];
@@ -26212,7 +26275,7 @@ function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
26212
26275
  _: 3
26213
26276
  }, 8, ["label-position", "size", "class", "label-width", "model"]);
26214
26277
  }
26215
- var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["render", _sfc_render$v], ["__scopeId", "data-v-6b16d674"]]);
26278
+ var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["render", _sfc_render$v], ["__scopeId", "data-v-4626d18a"]]);
26216
26279
  function registerIcon(app) {
26217
26280
  app.component("el-icon-edit", edit);
26218
26281
  app.component("el-icon-minus", minus);
@@ -26227,13 +26290,13 @@ function registerIcon(app) {
26227
26290
  if (typeof window !== "undefined") {
26228
26291
  let loadSvg = function() {
26229
26292
  var body = document.body;
26230
- var svgDom = document.getElementById("__svg__icons__dom__1778663230306__");
26293
+ var svgDom = document.getElementById("__svg__icons__dom__1778742103201__");
26231
26294
  if (!svgDom) {
26232
26295
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26233
26296
  svgDom.style.position = "absolute";
26234
26297
  svgDom.style.width = "0";
26235
26298
  svgDom.style.height = "0";
26236
- svgDom.id = "__svg__icons__dom__1778663230306__";
26299
+ svgDom.id = "__svg__icons__dom__1778742103201__";
26237
26300
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26238
26301
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26239
26302
  }
@@ -62861,8 +62924,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
62861
62924
  title: "\u5904\u7F6E\u8BE6\u60C5",
62862
62925
  width: "1200px",
62863
62926
  onClose: $options.handleClose,
62864
- "body-class": "person-tree-dialog-body",
62865
- "header-class": "person-tree-dialog-header"
62927
+ "body-class": "person-tree-dialog-body"
62866
62928
  }, {
62867
62929
  footer: withCtx(() => [
62868
62930
  createElementVNode("div", _hoisted_3, [
@@ -62898,7 +62960,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
62898
62960
  _: 1
62899
62961
  }, 8, ["modelValue", "onClose"]);
62900
62962
  }
62901
- var DetailDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-c6770b7c"]]);
62963
+ var DetailDialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-63f1467e"]]);
62902
62964
  var index_vue_vue_type_style_index_0_lang = "";
62903
62965
  const _sfc_main$3 = {
62904
62966
  name: "asset-table-widget",