form-custom-test 3.0.158 → 3.0.160

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.
@@ -31,7 +31,7 @@ var __objRest = (source2, exclude) => {
31
31
  };
32
32
  var _a, _b, _c;
33
33
  import * as vue from "vue";
34
- import { reactive, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, resolveComponent, createBlock, withCtx, createVNode, createTextVNode, Fragment, renderList, renderSlot, normalizeStyle, withModifiers, defineComponent, createSlots, watch, ref, onBeforeUnmount, onMounted, onUnmounted, withDirectives, mergeProps, resolveDynamicComponent, vShow, resolveDirective, isVNode } from "vue";
34
+ import { reactive, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, resolveComponent, createBlock, withCtx, createVNode, createTextVNode, Fragment, renderList, renderSlot, normalizeStyle, withModifiers, withDirectives, vShow, defineComponent, createSlots, watch, ref, onBeforeUnmount, onMounted, onUnmounted, mergeProps, resolveDynamicComponent, resolveDirective, isVNode } from "vue";
35
35
  import { ElMessage } from "element-plus";
36
36
  import require$$1 from "sortablejs";
37
37
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -11221,7 +11221,7 @@ function _sfc_render$3w(_ctx, _cache, $props, $setup, $data, $options) {
11221
11221
  return openBlock(), createElementBlock("div", {
11222
11222
  class: normalizeClass(["field-wrapper", { "design-time-bottom-margin": !!this.designer }])
11223
11223
  }, [
11224
- !!$props.field.formItemFlag && (!$props.field.options.hidden || $props.designState === true) ? (openBlock(), createBlock(_component_el_form_item, {
11224
+ !!$props.field.formItemFlag ? withDirectives((openBlock(), createBlock(_component_el_form_item, {
11225
11225
  key: 0,
11226
11226
  label: $options.label,
11227
11227
  "label-width": $options.labelWidth + "px",
@@ -11285,7 +11285,9 @@ function _sfc_render$3w(_ctx, _cache, $props, $setup, $data, $options) {
11285
11285
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
11286
11286
  ]),
11287
11287
  _: 3
11288
- }, 8, ["label", "label-width", "title", "rules", "prop", "class"])) : createCommentVNode("", true),
11288
+ }, 8, ["label", "label-width", "title", "rules", "prop", "class"])), [
11289
+ [vShow, $props.designState === true || !$props.field.options.hidden]
11290
+ ]) : createCommentVNode("", true),
11289
11291
  !!this.designer ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
11290
11292
  $props.designer.selectedId === $props.field.id ? (openBlock(), createElementBlock("div", _hoisted_2$B, [
11291
11293
  createElementVNode("i", {
@@ -11329,7 +11331,7 @@ function _sfc_render$3w(_ctx, _cache, $props, $setup, $data, $options) {
11329
11331
  ], 64)) : createCommentVNode("", true)
11330
11332
  ], 2);
11331
11333
  }
11332
- var FormItemWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$3w, [["render", _sfc_render$3w], ["__scopeId", "data-v-eed9a7f0"]]);
11334
+ var FormItemWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$3w, [["render", _sfc_render$3w], ["__scopeId", "data-v-a42827ee"]]);
11333
11335
  var __glob_0_8$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11334
11336
  __proto__: null,
11335
11337
  "default": FormItemWrapper
@@ -26598,9 +26600,9 @@ function _sfc_render$2X(_ctx, _cache, $props, $setup, $data, $options) {
26598
26600
  ref: $props.widget.id
26599
26601
  }, {
26600
26602
  default: withCtx(() => [
26601
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.widget.cols.filter((item) => !item.options.hidden) || [], (colWidget, colIdx) => {
26603
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.widget.cols || [], (colWidget, colIdx) => {
26602
26604
  return openBlock(), createBlock(_component_grid_col_item, {
26603
- key: colIdx,
26605
+ key: colWidget.id,
26604
26606
  widget: colWidget,
26605
26607
  "parent-list": $props.widget.cols,
26606
26608
  "index-of-parent-list": colIdx,
@@ -27581,13 +27583,70 @@ const _sfc_main$2S = {
27581
27583
  }
27582
27584
  });
27583
27585
  },
27586
+ findFieldByName(fieldName) {
27587
+ if (!fieldName || !this.widgetList)
27588
+ return null;
27589
+ let found = null;
27590
+ const walk = (list) => {
27591
+ if (!Array.isArray(list) || found)
27592
+ return;
27593
+ list.forEach((w) => {
27594
+ if (found || !w)
27595
+ return;
27596
+ if (w.formItemFlag && w.options && w.options.name === fieldName) {
27597
+ found = w;
27598
+ return;
27599
+ }
27600
+ if (Array.isArray(w.widgetList))
27601
+ walk(w.widgetList);
27602
+ if (Array.isArray(w.cols)) {
27603
+ w.cols.forEach((c) => walk(c && c.widgetList));
27604
+ }
27605
+ if (Array.isArray(w.rows)) {
27606
+ w.rows.forEach((r) => Array.isArray(r && r.cols) && r.cols.forEach((c) => walk(c && c.widgetList)));
27607
+ }
27608
+ if (Array.isArray(w.tabs)) {
27609
+ w.tabs.forEach((t) => walk(t && t.widgetList));
27610
+ }
27611
+ });
27612
+ };
27613
+ walk(this.widgetList);
27614
+ return found;
27615
+ },
27584
27616
  findWidgetAndSetHidden(widgetName, hiddenFlag) {
27585
27617
  let foundW = this.getWidgetRef(widgetName);
27586
27618
  if (!!foundW) {
27587
27619
  foundW.setHidden(hiddenFlag);
27588
- } else {
27589
- this.findWidgetOfSubFormAndSetHidden(widgetName, hiddenFlag);
27620
+ return;
27621
+ }
27622
+ const fieldSchema = this.findFieldByName(widgetName);
27623
+ if (fieldSchema && fieldSchema.options) {
27624
+ fieldSchema.options.hidden = !!hiddenFlag;
27625
+ this.$nextTick(() => this.$forceUpdate());
27626
+ return;
27627
+ }
27628
+ this.findWidgetOfSubFormAndSetHidden(widgetName, hiddenFlag);
27629
+ },
27630
+ setFieldRequired(fieldName, required) {
27631
+ const flag = !!required;
27632
+ const fieldRef = this.getWidgetRef(fieldName);
27633
+ if (fieldRef && typeof fieldRef.setRequired === "function") {
27634
+ fieldRef.setRequired(flag);
27635
+ if (typeof fieldRef.buildFieldRules === "function") {
27636
+ fieldRef.buildFieldRules();
27637
+ }
27638
+ return true;
27590
27639
  }
27640
+ const fieldSchema = this.findFieldByName(fieldName);
27641
+ if (fieldSchema && fieldSchema.options) {
27642
+ fieldSchema.options.required = flag;
27643
+ const refAfter = this.getWidgetRef(fieldName);
27644
+ if (refAfter && typeof refAfter.buildFieldRules === "function") {
27645
+ refAfter.buildFieldRules();
27646
+ }
27647
+ return true;
27648
+ }
27649
+ return false;
27591
27650
  },
27592
27651
  findWidgetOfSubFormAndSetHidden(widgetName, hiddenFlag) {
27593
27652
  this.findWidgetNameInSubForm(widgetName).forEach((wn) => {
@@ -28056,7 +28115,7 @@ function _sfc_render$2S(_ctx, _cache, $props, $setup, $data, $options) {
28056
28115
  _: 3
28057
28116
  }, 8, ["label-position", "size", "class", "label-width", "model"]);
28058
28117
  }
28059
- var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2S, [["render", _sfc_render$2S], ["__scopeId", "data-v-6e3bb628"]]);
28118
+ var VFormRender = /* @__PURE__ */ _export_sfc$1(_sfc_main$2S, [["render", _sfc_render$2S], ["__scopeId", "data-v-2bb5a9c0"]]);
28060
28119
  var ace$2 = { exports: {} };
28061
28120
  (function(module, exports) {
28062
28121
  (function() {
@@ -68622,13 +68681,13 @@ function registerIcon(app) {
68622
68681
  if (typeof window !== "undefined") {
68623
68682
  let loadSvg = function() {
68624
68683
  var body = document.body;
68625
- var svgDom = document.getElementById("__svg__icons__dom__1779189997705__");
68684
+ var svgDom = document.getElementById("__svg__icons__dom__1779271944729__");
68626
68685
  if (!svgDom) {
68627
68686
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
68628
68687
  svgDom.style.position = "absolute";
68629
68688
  svgDom.style.width = "0";
68630
68689
  svgDom.style.height = "0";
68631
- svgDom.id = "__svg__icons__dom__1779189997705__";
68690
+ svgDom.id = "__svg__icons__dom__1779271944729__";
68632
68691
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
68633
68692
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
68634
68693
  }
@@ -80317,6 +80376,7 @@ const _sfc_main$1 = {
80317
80376
  this.handleOnCreated();
80318
80377
  },
80319
80378
  mounted() {
80379
+ console.log(this.designState, this.modelValue, this.hasExistingValue(), "333333333");
80320
80380
  this.$nextTick(() => {
80321
80381
  this.tryLoadCurrentUserSecondCompany();
80322
80382
  });