form-custom-test 3.0.214 → 3.0.216

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
@@ -9050,6 +9050,9 @@ var fieldMixin = {
9050
9050
  if (!foundRef && (!this.subFormItemFlag || this.designState)) {
9051
9051
  foundRef = this.refList[widgetName];
9052
9052
  }
9053
+ if (!foundRef) {
9054
+ foundRef = this.refList[widgetName];
9055
+ }
9053
9056
  if (!foundRef && !!showError) {
9054
9057
  this.$message.error(this.i18nt("render.hint.refNotFound") + widgetName);
9055
9058
  }
@@ -9372,7 +9375,10 @@ const _sfc_main$1e = {
9372
9375
  },
9373
9376
  rules: Array
9374
9377
  },
9375
- inject: ["getFormConfig"],
9378
+ inject: {
9379
+ getFormConfig: { from: "getFormConfig" },
9380
+ getCustomSubFormFieldLabelHidden: { default: null }
9381
+ },
9376
9382
  computed: {
9377
9383
  formConfig() {
9378
9384
  return this.getFormConfig();
@@ -9381,13 +9387,13 @@ const _sfc_main$1e = {
9381
9387
  return !!this.designer && this.field.id === this.designer.selectedId;
9382
9388
  },
9383
9389
  label() {
9384
- if (!!this.field.options.labelHidden) {
9390
+ if (!!this.field.options.labelHidden || this.isParentSubFormLabelHidden) {
9385
9391
  return "";
9386
9392
  }
9387
9393
  return this.field.options.label;
9388
9394
  },
9389
9395
  labelWidth() {
9390
- if (!!this.field.options.labelHidden) {
9396
+ if (!!this.field.options.labelHidden || this.isParentSubFormLabelHidden) {
9391
9397
  return 0;
9392
9398
  }
9393
9399
  if (!!this.field.options.labelWidth) {
@@ -9417,6 +9423,12 @@ const _sfc_main$1e = {
9417
9423
  },
9418
9424
  subFormItemFlag() {
9419
9425
  return !!this.parentWidget ? this.parentWidget.type === "sub-form" || this.parentWidget.type === "custom-sub-form" : false;
9426
+ },
9427
+ isParentSubFormLabelHidden() {
9428
+ if (typeof this.getCustomSubFormFieldLabelHidden === "function") {
9429
+ return !!this.getCustomSubFormFieldLabelHidden();
9430
+ }
9431
+ return false;
9420
9432
  }
9421
9433
  },
9422
9434
  created() {
@@ -9608,7 +9620,7 @@ function _sfc_render$1e(_ctx, _cache, $props, $setup, $data, $options) {
9608
9620
  ], 64)) : createCommentVNode("", true)
9609
9621
  ], 2);
9610
9622
  }
9611
- var FormItemWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$1e, [["render", _sfc_render$1e], ["__scopeId", "data-v-a42827ee"]]);
9623
+ var FormItemWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$1e, [["render", _sfc_render$1e], ["__scopeId", "data-v-3cbbbdb2"]]);
9612
9624
  var __glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
9613
9625
  __proto__: null,
9614
9626
  "default": FormItemWrapper
@@ -26591,13 +26603,13 @@ function registerIcon(app) {
26591
26603
  if (typeof window !== "undefined") {
26592
26604
  let loadSvg = function() {
26593
26605
  var body = document.body;
26594
- var svgDom = document.getElementById("__svg__icons__dom__1782180404758__");
26606
+ var svgDom = document.getElementById("__svg__icons__dom__1782204519073__");
26595
26607
  if (!svgDom) {
26596
26608
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26597
26609
  svgDom.style.position = "absolute";
26598
26610
  svgDom.style.width = "0";
26599
26611
  svgDom.style.height = "0";
26600
- svgDom.id = "__svg__icons__dom__1782180404758__";
26612
+ svgDom.id = "__svg__icons__dom__1782204519073__";
26601
26613
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26602
26614
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26603
26615
  }
@@ -34683,6 +34695,15 @@ const _sfc_main$m = {
34683
34695
  return this.widget.options.customClass || "";
34684
34696
  }
34685
34697
  },
34698
+ provide() {
34699
+ const vm = this;
34700
+ return {
34701
+ getCustomSubFormFieldLabelHidden() {
34702
+ var _a, _b;
34703
+ return !!((_b = (_a = vm.widget) == null ? void 0 : _a.options) == null ? void 0 : _b.labelHidden);
34704
+ }
34705
+ };
34706
+ },
34686
34707
  created() {
34687
34708
  this.initRefList();
34688
34709
  },
@@ -34703,7 +34724,10 @@ const _sfc_main$m = {
34703
34724
  }
34704
34725
  };
34705
34726
  const _hoisted_1$j = { class: "sub-form-header" };
34706
- const _hoisted_2$e = { class: "sub-form-label" };
34727
+ const _hoisted_2$e = {
34728
+ key: 0,
34729
+ class: "sub-form-label"
34730
+ };
34707
34731
  const _hoisted_3$b = { class: "group-header" };
34708
34732
  const _hoisted_4$9 = { class: "group-title" };
34709
34733
  const _hoisted_5$7 = {
@@ -34740,7 +34764,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
34740
34764
  onClick: _cache[1] || (_cache[1] = withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
34741
34765
  }, [
34742
34766
  createElementVNode("div", _hoisted_1$j, [
34743
- createElementVNode("span", _hoisted_2$e, toDisplayString($props.widget.options.label || "\u81EA\u5B9A\u4E49\u5B50\u8868\u5355"), 1)
34767
+ !$props.widget.options.labelHidden ? (openBlock(), createElementBlock("span", _hoisted_2$e, toDisplayString($props.widget.options.label || "\u81EA\u5B9A\u4E49\u5B50\u8868\u5355"), 1)) : createCommentVNode("", true)
34744
34768
  ]),
34745
34769
  (openBlock(true), createElementBlock(Fragment, null, renderList($data.previewRows, (row, rowIdx) => {
34746
34770
  return openBlock(), createElementBlock("div", {
@@ -34828,7 +34852,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
34828
34852
  _: 1
34829
34853
  }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
34830
34854
  }
34831
- var CustomSubFormWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-787fff1a"]]);
34855
+ var CustomSubFormWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-0d784fb7"]]);
34832
34856
  var customSubFormItem_vue_vue_type_style_index_0_scoped_true_lang = "";
34833
34857
  const _sfc_main$l = {
34834
34858
  name: "custom-sub-form-item",
@@ -34843,6 +34867,15 @@ const _sfc_main$l = {
34843
34867
  widget: Object
34844
34868
  },
34845
34869
  inject: ["refList", "sfRefList", "globalModel"],
34870
+ provide() {
34871
+ const vm = this;
34872
+ return {
34873
+ getCustomSubFormFieldLabelHidden() {
34874
+ var _a, _b;
34875
+ return !!((_b = (_a = vm.widget) == null ? void 0 : _a.options) == null ? void 0 : _b.labelHidden);
34876
+ }
34877
+ };
34878
+ },
34846
34879
  data() {
34847
34880
  return {
34848
34881
  rowIdData: [],
@@ -35197,7 +35230,10 @@ const _sfc_main$l = {
35197
35230
  }
35198
35231
  }
35199
35232
  };
35200
- const _hoisted_1$i = { class: "sub-form-header" };
35233
+ const _hoisted_1$i = {
35234
+ key: 0,
35235
+ class: "sub-form-header"
35236
+ };
35201
35237
  const _hoisted_2$d = { class: "sub-form-label" };
35202
35238
  const _hoisted_3$a = { class: "group-header" };
35203
35239
  const _hoisted_4$8 = { class: "group-title" };
@@ -35205,29 +35241,25 @@ const _hoisted_5$6 = {
35205
35241
  key: 0,
35206
35242
  class: "row-number-span"
35207
35243
  };
35208
- const _hoisted_6$6 = {
35209
- key: 1,
35210
- class: "row-number-span"
35211
- };
35212
- const _hoisted_7$5 = { class: "group-actions" };
35213
- const _hoisted_8$3 = { class: "group-content" };
35214
- const _hoisted_9$2 = {
35244
+ const _hoisted_6$6 = { class: "group-actions" };
35245
+ const _hoisted_7$5 = { class: "group-content" };
35246
+ const _hoisted_8$3 = {
35215
35247
  key: 1,
35216
35248
  class: "field-loading",
35217
35249
  style: { "color": "#909399", "font-size": "12px", "padding": "8px" }
35218
35250
  };
35219
- const _hoisted_10$1 = {
35251
+ const _hoisted_9$2 = {
35220
35252
  key: 1,
35221
35253
  class: "empty-hint"
35222
35254
  };
35223
- const _hoisted_11 = { key: 0 };
35224
- const _hoisted_12 = { key: 1 };
35225
- const _hoisted_13 = {
35226
- key: 0,
35255
+ const _hoisted_10$1 = { key: 0 };
35256
+ const _hoisted_11 = { key: 1 };
35257
+ const _hoisted_12 = {
35258
+ key: 1,
35227
35259
  class: "empty-hint"
35228
35260
  };
35229
- const _hoisted_14 = {
35230
- key: 1,
35261
+ const _hoisted_13 = {
35262
+ key: 2,
35231
35263
  class: "empty-hint"
35232
35264
  };
35233
35265
  function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
@@ -35240,9 +35272,9 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
35240
35272
  key: $props.widget.id,
35241
35273
  class: normalizeClass(["custom-sub-form-container", $options.customClass])
35242
35274
  }, [
35243
- createElementVNode("div", _hoisted_1$i, [
35275
+ !$props.widget.options.labelHidden ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
35244
35276
  createElementVNode("span", _hoisted_2$d, toDisplayString($props.widget.options.label || "\u81EA\u5B9A\u4E49\u5B50\u8868\u5355"), 1)
35245
- ]),
35277
+ ])) : createCommentVNode("", true),
35246
35278
  (openBlock(true), createElementBlock(Fragment, null, renderList($data.rowIdData, (subFormRowId, sfrIdx) => {
35247
35279
  return openBlock(), createElementBlock("div", {
35248
35280
  class: "form-group-row",
@@ -35250,9 +35282,9 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
35250
35282
  }, [
35251
35283
  createElementVNode("div", _hoisted_3$a, [
35252
35284
  createElementVNode("div", _hoisted_4$8, [
35253
- $props.widget.options.showRowNumber ? (openBlock(), createElementBlock("span", _hoisted_5$6, toDisplayString($props.widget.options.label || "\u81EA\u5B9A\u4E49\u5B50\u8868\u5355") + " " + toDisplayString(sfrIdx + 1), 1)) : (openBlock(), createElementBlock("span", _hoisted_6$6, "\u8868\u5355\u7EC4"))
35285
+ $props.widget.options.showRowNumber && !$props.widget.options.labelHidden ? (openBlock(), createElementBlock("span", _hoisted_5$6, toDisplayString($props.widget.options.label || "\u81EA\u5B9A\u4E49\u5B50\u8868\u5355") + " " + toDisplayString(sfrIdx + 1), 1)) : createCommentVNode("", true)
35254
35286
  ]),
35255
- createElementVNode("div", _hoisted_7$5, [
35287
+ createElementVNode("div", _hoisted_6$6, [
35256
35288
  sfrIdx > 0 && !$props.widget.options.disabled ? (openBlock(), createBlock(_component_el_button, {
35257
35289
  key: 0,
35258
35290
  size: "small",
@@ -35268,7 +35300,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
35268
35300
  }, 8, ["onClick"])) : createCommentVNode("", true)
35269
35301
  ])
35270
35302
  ]),
35271
- createElementVNode("div", _hoisted_8$3, [
35303
+ createElementVNode("div", _hoisted_7$5, [
35272
35304
  $props.widget && $props.widget.widgetList && $props.widget.widgetList.length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList($props.widget.widgetList, (subWidget, swIdx) => {
35273
35305
  return openBlock(), createElementBlock(Fragment, {
35274
35306
  key: subWidget ? subWidget.id + "gc" + subFormRowId + "-" + swIdx : "gc" + subFormRowId + "-" + swIdx
@@ -35295,18 +35327,18 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
35295
35327
  "sub-form-row-index": sfrIdx,
35296
35328
  "sub-form-col-index": swIdx,
35297
35329
  "sub-form-disabled": $props.widget.options.disabled
35298
- }, null, 8, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "sub-form-disabled"])) : (openBlock(), createElementBlock("div", _hoisted_9$2, " \u5B57\u6BB5\u52A0\u8F7D\u4E2D... "))
35330
+ }, null, 8, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index", "sub-form-disabled"])) : (openBlock(), createElementBlock("div", _hoisted_8$3, " \u5B57\u6BB5\u52A0\u8F7D\u4E2D... "))
35299
35331
  ], 64)) : createCommentVNode("", true)
35300
35332
  ], 64);
35301
- }), 128)) : (openBlock(), createElementBlock("div", _hoisted_10$1, [
35302
- !$props.widget ? (openBlock(), createElementBlock("div", _hoisted_11, "\u7EC4\u4EF6\u672A\u521D\u59CB\u5316")) : !$props.widget.widgetList || $props.widget.widgetList.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_12, " \u8BF7\u5148\u5728\u8BBE\u8BA1\u5668\u4E2D\u62D6\u62FD\u7EC4\u4EF6\u5230\u5B50\u8868\u5355\u4E2D ")) : createCommentVNode("", true)
35333
+ }), 128)) : (openBlock(), createElementBlock("div", _hoisted_9$2, [
35334
+ !$props.widget ? (openBlock(), createElementBlock("div", _hoisted_10$1, "\u7EC4\u4EF6\u672A\u521D\u59CB\u5316")) : !$props.widget.widgetList || $props.widget.widgetList.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_11, " \u8BF7\u5148\u5728\u8BBE\u8BA1\u5668\u4E2D\u62D6\u62FD\u7EC4\u4EF6\u5230\u5B50\u8868\u5355\u4E2D ")) : createCommentVNode("", true)
35303
35335
  ]))
35304
35336
  ])
35305
35337
  ]);
35306
35338
  }), 128)),
35307
- !$props.widget.widgetList || $props.widget.widgetList.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_13, " \u8BF7\u5148\u5728\u8BBE\u8BA1\u5668\u4E2D\u62D6\u62FD\u7EC4\u4EF6\u5230\u5B50\u8868\u5355\u4E2D ")) : $data.rowIdData.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_14, ' \u70B9\u51FB"\u6DFB\u52A0"\u6309\u94AE\u6DFB\u52A0\u6570\u636E\u884C ')) : createCommentVNode("", true),
35339
+ !$props.widget.widgetList || $props.widget.widgetList.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_12, " \u8BF7\u5148\u5728\u8BBE\u8BA1\u5668\u4E2D\u62D6\u62FD\u7EC4\u4EF6\u5230\u5B50\u8868\u5355\u4E2D ")) : $data.rowIdData.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_13, ' \u70B9\u51FB"\u6DFB\u52A0"\u6309\u94AE\u6DFB\u52A0\u6570\u636E\u884C ')) : createCommentVNode("", true),
35308
35340
  !$props.widget.options.disabled ? (openBlock(), createBlock(_component_el_button, {
35309
- key: 2,
35341
+ key: 3,
35310
35342
  disabled: $data.actionDisabled,
35311
35343
  type: "primary",
35312
35344
  plain: "",
@@ -35326,7 +35358,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
35326
35358
  _: 1
35327
35359
  }, 8, ["widget"]);
35328
35360
  }
35329
- var CustomSubFormItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["render", _sfc_render$l], ["__scopeId", "data-v-6bd07e4e"]]);
35361
+ var CustomSubFormItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["render", _sfc_render$l], ["__scopeId", "data-v-09af068c"]]);
35330
35362
  var customTableCellWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
35331
35363
  const _sfc_main$k = {
35332
35364
  name: "custom-table-cell-widget",
@@ -63147,10 +63179,96 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
63147
63179
  }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
63148
63180
  }
63149
63181
  var AssetSelectWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["render", _sfc_render$a]]);
63182
+ const DEFAULT_DICT_API = "/unified-dict/sysItemDict/page";
63183
+ const DEFAULT_DICT_PARAMS = { current: 1, size: 1e4 };
63184
+ function normalizeDictRecords(records) {
63185
+ if (!Array.isArray(records)) {
63186
+ return {};
63187
+ }
63188
+ return records.reduce((prev, cur) => {
63189
+ var _a, _b, _c, _d, _e;
63190
+ const dictType = cur.dictType;
63191
+ if (!dictType) {
63192
+ return prev;
63193
+ }
63194
+ if (!prev[dictType]) {
63195
+ prev[dictType] = [];
63196
+ }
63197
+ prev[dictType].push(__spreadValues({
63198
+ label: (_b = (_a = cur.label) != null ? _a : cur.dictLabel) != null ? _b : "",
63199
+ value: (_e = (_d = (_c = cur.itemValue) != null ? _c : cur.dictValue) != null ? _d : cur.value) != null ? _e : ""
63200
+ }, cur));
63201
+ return prev;
63202
+ }, {});
63203
+ }
63150
63204
  class DictManager {
63151
63205
  constructor() {
63152
63206
  this.dictCache = {};
63153
63207
  this.loading = false;
63208
+ this._loaded = false;
63209
+ this._listeners = [];
63210
+ this._fetchPromise = null;
63211
+ }
63212
+ onLoaded(fn) {
63213
+ if (typeof fn !== "function") {
63214
+ return () => {
63215
+ };
63216
+ }
63217
+ if (this._loaded) {
63218
+ fn(this.dictCache);
63219
+ return () => {
63220
+ };
63221
+ }
63222
+ this._listeners.push(fn);
63223
+ return () => {
63224
+ this._listeners = this._listeners.filter((item) => item !== fn);
63225
+ };
63226
+ }
63227
+ _notifyLoaded() {
63228
+ this._loaded = true;
63229
+ this._listeners.forEach((fn) => {
63230
+ try {
63231
+ fn(this.dictCache);
63232
+ } catch (error) {
63233
+ console.error("[dictManager] onLoaded callback error:", error);
63234
+ }
63235
+ });
63236
+ }
63237
+ fetchFromApi(service2, options = {}) {
63238
+ const {
63239
+ url = DEFAULT_DICT_API,
63240
+ params = DEFAULT_DICT_PARAMS,
63241
+ force = false,
63242
+ customFetch
63243
+ } = options;
63244
+ if (this._fetchPromise && !force) {
63245
+ return this._fetchPromise;
63246
+ }
63247
+ if (this._loaded && Object.keys(this.dictCache).length > 0 && !force) {
63248
+ return Promise.resolve(this.dictCache);
63249
+ }
63250
+ this.loading = true;
63251
+ const requestPromise = typeof customFetch === "function" ? Promise.resolve().then(() => customFetch()).then((result) => {
63252
+ if (result && !Array.isArray(result) && typeof result === "object") {
63253
+ return result;
63254
+ }
63255
+ return normalizeDictRecords(Array.isArray(result) ? result : []);
63256
+ }) : service2.post(url, params).then((res) => {
63257
+ var _a, _b, _c, _d;
63258
+ const records = (_d = (_c = (_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.records) != null ? _b : res == null ? void 0 : res.records) != null ? _c : res == null ? void 0 : res.data) != null ? _d : [];
63259
+ return normalizeDictRecords(Array.isArray(records) ? records : []);
63260
+ });
63261
+ this._fetchPromise = requestPromise.then((dictData) => {
63262
+ this.init(dictData || {});
63263
+ this._notifyLoaded();
63264
+ return dictData;
63265
+ }).catch((error) => {
63266
+ console.warn("[form-custom-test] \u5B57\u5178\u6570\u636E\u52A0\u8F7D\u5931\u8D25:", error);
63267
+ return {};
63268
+ }).finally(() => {
63269
+ this.loading = false;
63270
+ });
63271
+ return this._fetchPromise;
63154
63272
  }
63155
63273
  init(dictData) {
63156
63274
  this.dictCache = dictData || {};
@@ -63203,7 +63321,6 @@ class DictManager {
63203
63321
  return this.mapToOptionItems(this.getDictData(dictCode));
63204
63322
  }
63205
63323
  getDictTypeOptions() {
63206
- console.log("this.dictCache", this.dictCache);
63207
63324
  return Object.keys(this.dictCache || {}).map((dictType) => ({
63208
63325
  label: dictType,
63209
63326
  value: dictType
@@ -63211,6 +63328,8 @@ class DictManager {
63211
63328
  }
63212
63329
  clear() {
63213
63330
  this.dictCache = {};
63331
+ this._loaded = false;
63332
+ this._fetchPromise = null;
63214
63333
  if (typeof window !== "undefined") {
63215
63334
  window.dictCache = {};
63216
63335
  }
@@ -63307,8 +63426,14 @@ const _sfc_main$9 = {
63307
63426
  },
63308
63427
  mounted() {
63309
63428
  this.handleOnMounted();
63429
+ this._offDictLoaded = dictManager.onLoaded(() => {
63430
+ this.loadDictOptions();
63431
+ });
63310
63432
  },
63311
63433
  beforeUnmount() {
63434
+ if (this._offDictLoaded) {
63435
+ this._offDictLoaded();
63436
+ }
63312
63437
  this.unregisterFromRefList();
63313
63438
  },
63314
63439
  methods: {
@@ -63505,7 +63630,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
63505
63630
  _: 1
63506
63631
  }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
63507
63632
  }
63508
- var DictSelectWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-07bda0ac"]]);
63633
+ var DictSelectWidget = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-6f18008b"]]);
63509
63634
  var dictSelectDictCodeEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
63510
63635
  const _sfc_main$8 = {
63511
63636
  name: "dict-select-dictCode-editor",
@@ -63534,6 +63659,15 @@ const _sfc_main$8 = {
63534
63659
  },
63535
63660
  mounted() {
63536
63661
  this.$nextTick(() => this.refreshDictTypeOptions());
63662
+ this._offDictLoaded = dictManager.onLoaded(() => {
63663
+ this.refreshDictTypeOptions();
63664
+ this.syncOptionItemsFromDict();
63665
+ });
63666
+ },
63667
+ beforeUnmount() {
63668
+ if (this._offDictLoaded) {
63669
+ this._offDictLoaded();
63670
+ }
63537
63671
  },
63538
63672
  methods: {
63539
63673
  refreshDictTypeOptions() {
@@ -63593,7 +63727,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
63593
63727
  _: 1
63594
63728
  }, 8, ["label"]);
63595
63729
  }
63596
- var DictSelectDictCodeEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-5b750108"]]);
63730
+ var DictSelectDictCodeEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-2dfeafae"]]);
63597
63731
  var detailDialog_vue_vue_type_style_index_0_scoped_true_lang = "";
63598
63732
  const _sfc_main$7 = {
63599
63733
  name: "detail-dialog",
@@ -65794,6 +65928,18 @@ const loadExtension = function(app) {
65794
65928
  registerCPEditor(app, "asset-type-assetTypeValue", "asset-type-assetTypeValue-editor", createInputTextEditor("assetTypeValue", "extension.setting.assetTypeAssetTypeValue"));
65795
65929
  app.component(CustomInputWidget.name, CustomInputWidget);
65796
65930
  };
65931
+ function setupDict(app, service2, options = {}) {
65932
+ const dictConfig = options.dict || {};
65933
+ app.config.globalProperties.$dictManager = dictManager;
65934
+ app.provide("dictManager", dictManager);
65935
+ if (typeof window !== "undefined") {
65936
+ window.dictManager = dictManager;
65937
+ }
65938
+ if (dictConfig.autoLoad !== false && service2) {
65939
+ dictManager.fetchFromApi(service2, dictConfig);
65940
+ }
65941
+ return dictManager;
65942
+ }
65797
65943
  function getElMessage(app) {
65798
65944
  var _a, _b, _c;
65799
65945
  try {
@@ -65806,7 +65952,7 @@ function getElMessage(app) {
65806
65952
  }
65807
65953
  return null;
65808
65954
  }
65809
- VFormRender.install = function(app) {
65955
+ VFormRender.install = function(app, options = {}) {
65810
65956
  loadExtension(app);
65811
65957
  app.use(ContainerItems);
65812
65958
  registerIcon(app);
@@ -65814,11 +65960,12 @@ VFormRender.install = function(app) {
65814
65960
  app.config.globalProperties.$service = service$1;
65815
65961
  app.provide("service", service$1);
65816
65962
  app.provide("ElMessage", getElMessage(app));
65963
+ setupDict(app, service$1, options);
65817
65964
  };
65818
65965
  const components = [
65819
65966
  VFormRender
65820
65967
  ];
65821
- const install = (app) => {
65968
+ const install = (app, options = {}) => {
65822
65969
  loadExtension(app);
65823
65970
  app.use(ContainerItems);
65824
65971
  registerIcon(app);
@@ -65831,9 +65978,11 @@ const install = (app) => {
65831
65978
  if (typeof window !== "undefined") {
65832
65979
  window.service = service$1;
65833
65980
  }
65981
+ setupDict(app, service$1, options);
65834
65982
  };
65835
65983
  var installRender = {
65836
65984
  install,
65837
- VFormRender
65985
+ VFormRender,
65986
+ dictManager
65838
65987
  };
65839
65988
  export { installRender as default };