form-custom-test 3.0.83 → 3.0.85

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
@@ -26025,13 +26025,13 @@ function registerIcon(app) {
26025
26025
  if (typeof window !== "undefined") {
26026
26026
  let loadSvg = function() {
26027
26027
  var body = document.body;
26028
- var svgDom = document.getElementById("__svg__icons__dom__1775562133472__");
26028
+ var svgDom = document.getElementById("__svg__icons__dom__1775622342022__");
26029
26029
  if (!svgDom) {
26030
26030
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26031
26031
  svgDom.style.position = "absolute";
26032
26032
  svgDom.style.width = "0";
26033
26033
  svgDom.style.height = "0";
26034
- svgDom.id = "__svg__icons__dom__1775562133472__";
26034
+ svgDom.id = "__svg__icons__dom__1775622342022__";
26035
26035
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26036
26036
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26037
26037
  }
@@ -32471,7 +32471,6 @@ const _sfc_main$i = {
32471
32471
  return {
32472
32472
  fieldModel: null,
32473
32473
  oldFieldValue: null,
32474
- radioValue: null,
32475
32474
  rules: [],
32476
32475
  inputValue: ""
32477
32476
  };
@@ -32491,6 +32490,21 @@ const _sfc_main$i = {
32491
32490
  ];
32492
32491
  }
32493
32492
  },
32493
+ watch: {
32494
+ fieldModel: {
32495
+ handler(newVal) {
32496
+ if (typeof newVal === "string" && newVal.includes("_RADIO_OTHER_")) {
32497
+ this.radioValue = "_RADIO_OTHER_";
32498
+ this.inputValue = newVal.split("_RADIO_OTHER_")[1];
32499
+ } else {
32500
+ this.radioValue = newVal;
32501
+ this.inputValue = "";
32502
+ }
32503
+ }
32504
+ },
32505
+ immediate: true,
32506
+ deep: true
32507
+ },
32494
32508
  created() {
32495
32509
  this.initOptionItems();
32496
32510
  this.initFieldModel();
@@ -32512,8 +32526,8 @@ const _sfc_main$i = {
32512
32526
  this.inputValue = "";
32513
32527
  if (value2 === "_RADIO_OTHER_") {
32514
32528
  this.fieldModel = value2;
32515
- if (this.otherValue) {
32516
- this.syncUpdateFormModel(`${value2}${this.otherValue}`);
32529
+ if (this.inputValue) {
32530
+ this.syncUpdateFormModel(`${value2}&${this.inputValue}`);
32517
32531
  } else {
32518
32532
  this.syncUpdateFormModel(value2);
32519
32533
  }
@@ -32527,8 +32541,9 @@ const _sfc_main$i = {
32527
32541
  this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]);
32528
32542
  },
32529
32543
  handleOtherValueChange() {
32530
- if (this.fieldModel === "_RADIO_OTHER_") {
32531
- const newValue = this.otherValue ? `${this.fieldModel}${this.otherValue}` : this.fieldModel;
32544
+ if (this.radioValue === "_RADIO_OTHER_") {
32545
+ const newValue = this.inputValue ? `${this.radioValue}&${this.inputValue}` : this.radioValue;
32546
+ console.log(newValue, "newValue");
32532
32547
  this.oldFieldValue = this.fieldModel;
32533
32548
  this.syncUpdateFormModel(newValue);
32534
32549
  this.emitFieldDataChange(newValue, this.oldFieldValue);
@@ -32538,9 +32553,9 @@ const _sfc_main$i = {
32538
32553
  }
32539
32554
  };
32540
32555
  function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
32541
- const _component_el_input = resolveComponent("el-input");
32542
32556
  const _component_el_radio = resolveComponent("el-radio");
32543
32557
  const _component_el_radio_group = resolveComponent("el-radio-group");
32558
+ const _component_el_input = resolveComponent("el-input");
32544
32559
  const _component_form_item_wrapper = resolveComponent("form-item-wrapper");
32545
32560
  return openBlock(), createBlock(_component_form_item_wrapper, {
32546
32561
  designer: $props.designer,
@@ -32556,8 +32571,8 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
32556
32571
  }, {
32557
32572
  default: withCtx(() => [
32558
32573
  createVNode(_component_el_radio_group, {
32559
- modelValue: $data.fieldModel,
32560
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.fieldModel = $event),
32574
+ modelValue: _ctx.radioValue,
32575
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.radioValue = $event),
32561
32576
  class: normalizeClass({ "radio-group-block": $props.field.options.displayStyle === "block" }),
32562
32577
  disabled: $props.field.options.disabled,
32563
32578
  size: $options.widgetSize,
@@ -32573,22 +32588,22 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
32573
32588
  style: normalizeStyle({ display: $props.field.options.displayStyle })
32574
32589
  }, {
32575
32590
  default: withCtx(() => [
32576
- createElementVNode("span", null, toDisplayString(item.label), 1),
32577
- $data.radioValue === "_RADIO_OTHER_" && item.value === "_RADIO_OTHER_" ? (openBlock(), createBlock(_component_el_input, {
32578
- key: 0,
32579
- class: "w-[200px] ml-10px",
32580
- modelValue: $data.inputValue,
32581
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.inputValue = $event),
32582
- onChange: ($event) => $options.handleOtherValueChange(item.value),
32583
- placeholder: "\u8BF7\u8F93\u5165\u5176\u4ED6\u9009\u9879"
32584
- }, null, 8, ["modelValue", "onChange"])) : createCommentVNode("", true)
32591
+ createElementVNode("span", null, toDisplayString(item.label), 1)
32585
32592
  ]),
32586
32593
  _: 2
32587
32594
  }, 1032, ["label", "disabled", "border", "style"]);
32588
32595
  }), 128))
32589
32596
  ]),
32590
32597
  _: 1
32591
- }, 8, ["modelValue", "class", "disabled", "size", "onChange"])
32598
+ }, 8, ["modelValue", "class", "disabled", "size", "onChange"]),
32599
+ _ctx.radioValue === "_RADIO_OTHER_" ? (openBlock(), createBlock(_component_el_input, {
32600
+ key: 0,
32601
+ class: "w-[200px] ml-10px",
32602
+ modelValue: $data.inputValue,
32603
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.inputValue = $event),
32604
+ onInput: _cache[2] || (_cache[2] = ($event) => $options.handleOtherValueChange()),
32605
+ placeholder: "\u8BF7\u8F93\u5165"
32606
+ }, null, 8, ["modelValue"])) : createCommentVNode("", true)
32592
32607
  ]),
32593
32608
  _: 1
32594
32609
  }, 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"]);
@@ -61532,15 +61547,7 @@ const _sfc_main = {
61532
61547
  method: "get",
61533
61548
  url: "unified-system/employee/loginInfo?accessType=0"
61534
61549
  });
61535
- const { data: personList } = await service$1({
61536
- method: "get",
61537
- url: "/unified-system/employee/queryList",
61538
- params: {
61539
- userId: data2.id
61540
- }
61541
- });
61542
- const userInfo = personList ? personList[0] : {};
61543
- this.fieldModel = __spreadValues(__spreadValues({}, data2), userInfo);
61550
+ this.fieldModel = data2;
61544
61551
  this.syncUpdateFormModel(this.fieldModel);
61545
61552
  this.emitFieldDataChange(this.fieldModel, this.oldFieldValue);
61546
61553
  }