yuanjia-form-pro-standard 1.1.6-beta5.7 → 1.1.6-beta5.9

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/designer.es.js CHANGED
@@ -121643,17 +121643,7 @@ const _sfc_main$59 = {
121643
121643
  apiKey: "c33dd711587b4b2aaede4556d0d87187.3AqWlEEZT8WXS4IE",
121644
121644
  model: "glm-4.7"
121645
121645
  }
121646
- },
121647
- menus: [
121648
- {
121649
- icon: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M15 5.25C16.7949 5.25 18.25 3.79493 18.25 2H19.75C19.75 3.79493 21.2051 5.25 23 5.25V6.75C21.2051 6.75 19.75 8.20507 19.75 10H18.25C18.25 8.20507 16.7949 6.75 15 6.75V5.25ZM4 7C4 5.89543 4.89543 5 6 5H13V3H6C3.79086 3 2 4.79086 2 7V17C2 19.2091 3.79086 21 6 21H18C20.2091 21 22 19.2091 22 17V12H20V17C20 18.1046 19.1046 19 18 19H6C4.89543 19 4 18.1046 4 17V7Z"></path></svg>`,
121650
- name: "AI \u603B\u7ED3",
121651
- model: "auto",
121652
- onClick: () => {
121653
- this.handleAISummaryClick();
121654
- }
121655
- }
121656
- ]
121646
+ }
121657
121647
  },
121658
121648
  image: {
121659
121649
  enabled: this.field.options.enableImageUpload !== false
@@ -121908,7 +121898,7 @@ function _sfc_render$59(_ctx, _cache, $props, $setup, $data, $options) {
121908
121898
  _: 1
121909
121899
  }, 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"]);
121910
121900
  }
121911
- var aiEditorWidget = /* @__PURE__ */ _export_sfc(_sfc_main$59, [["render", _sfc_render$59], ["__scopeId", "data-v-2737e176"]]);
121901
+ var aiEditorWidget = /* @__PURE__ */ _export_sfc(_sfc_main$59, [["render", _sfc_render$59], ["__scopeId", "data-v-1b097f26"]]);
121912
121902
  var __glob_0_0$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
121913
121903
  __proto__: null,
121914
121904
  "default": aiEditorWidget
@@ -176300,9 +176290,30 @@ const _sfc_main$4l = {
176300
176290
  this.formDataModel[propName] = deepClone(formDataObj[propName]);
176301
176291
  }
176302
176292
  });
176293
+ const fieldContentMap = {};
176294
+ if (this.formObj && Object.keys(this.formObj).length > 0) {
176295
+ Object.keys(this.formObj).forEach((fieldName) => {
176296
+ const fieldObj = this.formObj[fieldName];
176297
+ if (fieldObj && fieldObj.content !== void 0) {
176298
+ if (fieldObj.value !== void 0 && !Array.isArray(fieldObj.value)) {
176299
+ fieldContentMap[fieldName] = {
176300
+ value: fieldObj.value,
176301
+ content: fieldObj.content
176302
+ };
176303
+ } else if (Array.isArray(fieldObj.value) && Array.isArray(fieldObj.content)) {
176304
+ fieldContentMap[fieldName] = {};
176305
+ fieldObj.value.forEach((val, index2) => {
176306
+ if (fieldContentMap[fieldName][val] === void 0) {
176307
+ fieldContentMap[fieldName][val] = fieldObj.content[index2] || val;
176308
+ }
176309
+ });
176310
+ }
176311
+ }
176312
+ });
176313
+ }
176303
176314
  this.setCEOCDisabledFlag(disableChangeEvent);
176304
176315
  this.broadcast("ContainerItem", "setFormData", [this.formDataModel, disableChangeEvent, this.isCaseEdit]);
176305
- this.broadcast("FieldWidget", "setFormData", [this.formDataModel, disableChangeEvent, this.isCaseEdit]);
176316
+ this.broadcast("FieldWidget", "setFormData", [this.formDataModel, disableChangeEvent, this.isCaseEdit, fieldContentMap]);
176306
176317
  },
176307
176318
  setFormDataEx(formData, disableChangeEvent = false) {
176308
176319
  let formDataObj = formData;
@@ -176853,7 +176864,7 @@ function _sfc_render$4l(_ctx, _cache, $props, $setup, $data, $options) {
176853
176864
  [_directive_loading, $data.formLoading]
176854
176865
  ]);
176855
176866
  }
176856
- var VFormRender = /* @__PURE__ */ _export_sfc(_sfc_main$4l, [["render", _sfc_render$4l], ["__scopeId", "data-v-262aff17"]]);
176867
+ var VFormRender = /* @__PURE__ */ _export_sfc(_sfc_main$4l, [["render", _sfc_render$4l], ["__scopeId", "data-v-744f2dc0"]]);
176857
176868
  var ace$2 = { exports: {} };
176858
176869
  (function(module, exports) {
176859
176870
  (function() {
@@ -236218,13 +236229,13 @@ var Draggable = /* @__PURE__ */ getDefaultExportFromCjs(vuedraggable_umd.exports
236218
236229
  if (typeof window !== "undefined") {
236219
236230
  let loadSvg = function() {
236220
236231
  var body = document.body;
236221
- var svgDom = document.getElementById("__svg__icons__dom__1767691152625__");
236232
+ var svgDom = document.getElementById("__svg__icons__dom__1767697756187__");
236222
236233
  if (!svgDom) {
236223
236234
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
236224
236235
  svgDom.style.position = "absolute";
236225
236236
  svgDom.style.width = "0";
236226
236237
  svgDom.style.height = "0";
236227
- svgDom.id = "__svg__icons__dom__1767691152625__";
236238
+ svgDom.id = "__svg__icons__dom__1767697756187__";
236228
236239
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
236229
236240
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
236230
236241
  }
@@ -237247,6 +237258,35 @@ const _sfc_main$3 = {
237247
237258
  this.initEventHandler();
237248
237259
  this.buildFieldRules();
237249
237260
  this.handleOnCreated();
237261
+ this.$nextTick(() => {
237262
+ this.off$("setFormData");
237263
+ this.on$("setFormData", (params) => {
237264
+ const newFormData = params[0];
237265
+ const disableChangeEvent = params[1];
237266
+ const isCaseEdit = params[2];
237267
+ const fieldContentMap = params[3];
237268
+ if (!this.subFormItemFlag) {
237269
+ if (!!this.getObjectFieldFlag() && !this.designState) {
237270
+ const objectModel = this.getObjectModel();
237271
+ this.setValue(objectModel === void 0 ? null : objectModel[this.fieldKeyName], disableChangeEvent);
237272
+ } else {
237273
+ if (this.field.options.disabled === 1) {
237274
+ this.setDisabled(!!newFormData[this.fieldKeyName]);
237275
+ } else if (this.field.options.disabled === 2 && isCaseEdit) {
237276
+ this.setDisabled(!!newFormData[this.fieldKeyName]);
237277
+ } else {
237278
+ this.setDisabled(false);
237279
+ }
237280
+ const fieldValue = newFormData[this.fieldKeyName];
237281
+ if (fieldValue !== null && fieldValue !== void 0 && fieldValue !== "") {
237282
+ this.handleSetFormDataWithContent(fieldValue, fieldContentMap, disableChangeEvent);
237283
+ } else {
237284
+ this.setValue(fieldValue, disableChangeEvent);
237285
+ }
237286
+ }
237287
+ }
237288
+ });
237289
+ });
237250
237290
  },
237251
237291
  mounted() {
237252
237292
  this.handleOnMounted();
@@ -237354,6 +237394,57 @@ const _sfc_main$3 = {
237354
237394
  this.loading = false;
237355
237395
  }
237356
237396
  },
237397
+ handleSetFormDataWithContent(fieldValue, fieldContentMap, disableChangeEvent = false) {
237398
+ if (!fieldContentMap) {
237399
+ this.setValue(fieldValue, disableChangeEvent);
237400
+ return;
237401
+ }
237402
+ const fieldName = this.field.options.name;
237403
+ const contentInfo = fieldContentMap[fieldName];
237404
+ if (!contentInfo) {
237405
+ this.setValue(fieldValue, disableChangeEvent);
237406
+ return;
237407
+ }
237408
+ if (this.field.options.multiple && Array.isArray(fieldValue)) {
237409
+ const missingValues = fieldValue.filter((v) => v !== null && v !== void 0 && v !== "" && !this.isValueInOptions(v));
237410
+ if (missingValues.length > 0 && typeof contentInfo === "object" && !Array.isArray(contentInfo)) {
237411
+ missingValues.forEach((value2) => {
237412
+ const content2 = contentInfo[value2];
237413
+ if (content2 && !this.isValueInOptions(value2)) {
237414
+ this.addOptionFromContent(value2, content2);
237415
+ }
237416
+ });
237417
+ }
237418
+ } else if (!this.isValueInOptions(fieldValue)) {
237419
+ const content2 = typeof contentInfo === "object" && !Array.isArray(contentInfo) ? contentInfo[fieldValue] : contentInfo.content || contentInfo;
237420
+ if (content2) {
237421
+ this.addOptionFromContent(fieldValue, content2);
237422
+ }
237423
+ }
237424
+ this.setValue(fieldValue, disableChangeEvent);
237425
+ },
237426
+ addOptionFromContent(value2, content2) {
237427
+ if (!value2 || value2 === "") {
237428
+ return;
237429
+ }
237430
+ const existingIds = (this.field.options.optionItems || []).map((item) => item.Id || item.id);
237431
+ if (existingIds.includes(value2)) {
237432
+ return;
237433
+ }
237434
+ const newOption = {
237435
+ Id: value2,
237436
+ id: value2,
237437
+ Name: content2 || String(value2),
237438
+ name: content2 || String(value2),
237439
+ label: content2 || String(value2),
237440
+ value: value2,
237441
+ Avatar: this.defaultAvatarSrc
237442
+ };
237443
+ if (!this.field.options.optionItems) {
237444
+ this.field.options.optionItems = [];
237445
+ }
237446
+ this.field.options.optionItems.push(newOption);
237447
+ },
237357
237448
  setValue(newValue, disableChangeEvent = false) {
237358
237449
  if (!!this.field.formItemFlag) {
237359
237450
  this.isSettingValue = true;
@@ -237527,7 +237618,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
237527
237618
  __: [2]
237528
237619
  }, 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"]);
237529
237620
  }
237530
- var SelectWidget = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-298a6f95"]]);
237621
+ var SelectWidget = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-2408940e"]]);
237531
237622
  var DIYtableWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
237532
237623
  const _sfc_main$2 = {
237533
237624
  name: "DIYtable-widget",