form-custom-test 3.0.195 → 3.0.196

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.
@@ -69045,13 +69045,13 @@ function registerIcon(app) {
69045
69045
  if (typeof window !== "undefined") {
69046
69046
  let loadSvg = function() {
69047
69047
  var body = document.body;
69048
- var svgDom = document.getElementById("__svg__icons__dom__1780624786015__");
69048
+ var svgDom = document.getElementById("__svg__icons__dom__1780627772452__");
69049
69049
  if (!svgDom) {
69050
69050
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
69051
69051
  svgDom.style.position = "absolute";
69052
69052
  svgDom.style.width = "0";
69053
69053
  svgDom.style.height = "0";
69054
- svgDom.id = "__svg__icons__dom__1780624786015__";
69054
+ svgDom.id = "__svg__icons__dom__1780627772452__";
69055
69055
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
69056
69056
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
69057
69057
  }
@@ -77938,6 +77938,13 @@ const _sfc_main$c = {
77938
77938
  });
77939
77939
  }
77940
77940
  }
77941
+ if (this.isTextColumn(col) && col.maxLength) {
77942
+ colRules.push({
77943
+ max: col.maxLength,
77944
+ message: `${col.label}\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7${col.maxLength}\u4E2A\u5B57\u7B26`,
77945
+ trigger: ["blur", "change"]
77946
+ });
77947
+ }
77941
77948
  if (colRules.length > 0) {
77942
77949
  rules[col.prop] = colRules;
77943
77950
  }
@@ -78018,6 +78025,12 @@ const _sfc_main$c = {
78018
78025
  this.dialogFormData._columnOptions = {};
78019
78026
  }
78020
78027
  },
78028
+ isTextColumn(col) {
78029
+ return !col.type || col.type === "input" || col.type === "textarea";
78030
+ },
78031
+ getColMaxLength(col) {
78032
+ return col.maxLength && col.maxLength > 0 ? col.maxLength : void 0;
78033
+ },
78021
78034
  getValue() {
78022
78035
  return this.tableData;
78023
78036
  },
@@ -78310,8 +78323,10 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78310
78323
  "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
78311
78324
  placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
78312
78325
  disabled: $props.widget.options.disabled,
78326
+ maxlength: $options.getColMaxLength(col),
78327
+ "show-word-limit": !!col.showWordLimit && !!col.maxLength,
78313
78328
  onChange: ($event) => $options.handleInputChange(col)
78314
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "number" ? (openBlock(), createBlock(_component_el_input_number, {
78329
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "maxlength", "show-word-limit", "onChange"])) : col.type === "number" ? (openBlock(), createBlock(_component_el_input_number, {
78315
78330
  key: 1,
78316
78331
  modelValue: $data.dialogFormData[col.prop],
78317
78332
  "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
@@ -78376,8 +78391,10 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78376
78391
  placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
78377
78392
  disabled: $props.widget.options.disabled,
78378
78393
  rows: col.rows || 3,
78394
+ maxlength: $options.getColMaxLength(col),
78395
+ "show-word-limit": !!col.showWordLimit && !!col.maxLength,
78379
78396
  onChange: ($event) => $options.handleInputChange(col)
78380
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "rows", "onChange"])) : createCommentVNode("", true)
78397
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "rows", "maxlength", "show-word-limit", "onChange"])) : createCommentVNode("", true)
78381
78398
  ]),
78382
78399
  _: 2
78383
78400
  }, 1032, ["label", "prop", "required"]);
@@ -78395,7 +78412,7 @@ function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
78395
78412
  _: 1
78396
78413
  }, 8, ["widget"]);
78397
78414
  }
78398
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-407a6f2b"]]);
78415
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-70478d6d"]]);
78399
78416
  var subTableColumnsEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
78400
78417
  const _sfc_main$b = {
78401
78418
  name: "sub-table-columns-editor",
@@ -78442,6 +78459,17 @@ const _sfc_main$b = {
78442
78459
  }
78443
78460
  },
78444
78461
  methods: {
78462
+ isTextColumn(col) {
78463
+ return !col.type || col.type === "input" || col.type === "textarea";
78464
+ },
78465
+ handleMaxLengthInput(col, val) {
78466
+ if (!val || isNaN(val)) {
78467
+ col.maxLength = null;
78468
+ col.showWordLimit = false;
78469
+ } else {
78470
+ col.maxLength = Number(val);
78471
+ }
78472
+ },
78445
78473
  addNewColumn() {
78446
78474
  if (!this.optionModel.columns) {
78447
78475
  this.optionModel.columns = [];
@@ -78453,6 +78481,8 @@ const _sfc_main$b = {
78453
78481
  width: "",
78454
78482
  minWidth: "",
78455
78483
  placeholder: "",
78484
+ maxLength: null,
78485
+ showWordLimit: false,
78456
78486
  required: false,
78457
78487
  validation: "",
78458
78488
  validationHint: "",
@@ -78782,6 +78812,36 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78782
78812
  ]),
78783
78813
  _: 2
78784
78814
  }, 1024),
78815
+ $options.isTextColumn(col) ? (openBlock(), createBlock(_component_el_form_item, {
78816
+ key: 1,
78817
+ label: _ctx.i18nt("designer.setting.maxLength")
78818
+ }, {
78819
+ default: withCtx(() => [
78820
+ createVNode(_component_el_input, {
78821
+ type: "number",
78822
+ class: "hide-spin-button",
78823
+ min: "1",
78824
+ "model-value": col.maxLength,
78825
+ placeholder: "\u4E0D\u9650",
78826
+ onInput: (val) => $options.handleMaxLengthInput(col, val),
78827
+ onChange: $options.handleColumnChange
78828
+ }, null, 8, ["model-value", "onInput", "onChange"])
78829
+ ]),
78830
+ _: 2
78831
+ }, 1032, ["label"])) : createCommentVNode("", true),
78832
+ $options.isTextColumn(col) && col.maxLength ? (openBlock(), createBlock(_component_el_form_item, {
78833
+ key: 2,
78834
+ label: _ctx.i18nt("designer.setting.showWordLimit")
78835
+ }, {
78836
+ default: withCtx(() => [
78837
+ createVNode(_component_el_switch, {
78838
+ modelValue: col.showWordLimit,
78839
+ "onUpdate:modelValue": ($event) => col.showWordLimit = $event,
78840
+ onChange: $options.handleColumnChange
78841
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
78842
+ ]),
78843
+ _: 2
78844
+ }, 1032, ["label"])) : createCommentVNode("", true),
78785
78845
  createVNode(_component_el_form_item, { label: "\u662F\u5426\u5FC5\u586B" }, {
78786
78846
  default: withCtx(() => [
78787
78847
  createVNode(_component_el_switch, {
@@ -78818,7 +78878,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78818
78878
  _: 2
78819
78879
  }, 1024),
78820
78880
  col.validation ? (openBlock(), createBlock(_component_el_form_item, {
78821
- key: 1,
78881
+ key: 3,
78822
78882
  label: "\u6821\u9A8C\u5931\u8D25\u63D0\u793A"
78823
78883
  }, {
78824
78884
  default: withCtx(() => [
@@ -78832,7 +78892,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78832
78892
  _: 2
78833
78893
  }, 1024)) : createCommentVNode("", true),
78834
78894
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78835
- key: 2,
78895
+ key: 4,
78836
78896
  label: "\u9009\u9879\u6570\u636E"
78837
78897
  }, {
78838
78898
  default: withCtx(() => [
@@ -78849,7 +78909,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78849
78909
  _: 2
78850
78910
  }, 1024)) : createCommentVNode("", true),
78851
78911
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78852
- key: 3,
78912
+ key: 5,
78853
78913
  label: "onMounted\u4E8B\u4EF6"
78854
78914
  }, {
78855
78915
  default: withCtx(() => [
@@ -78877,7 +78937,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78877
78937
  _: 2
78878
78938
  }, 1024)) : createCommentVNode("", true),
78879
78939
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78880
- key: 4,
78940
+ key: 6,
78881
78941
  label: "\u4F9D\u8D56\u5217\uFF08\u8054\u52A8\uFF09"
78882
78942
  }, {
78883
78943
  default: withCtx(() => [
@@ -78910,7 +78970,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78910
78970
  _: 2
78911
78971
  }, 1024)) : createCommentVNode("", true),
78912
78972
  col.type === "select" && col.dependOn ? (openBlock(), createBlock(_component_el_form_item, {
78913
- key: 5,
78973
+ key: 7,
78914
78974
  label: "\u8054\u52A8\u5904\u7406\u51FD\u6570"
78915
78975
  }, {
78916
78976
  default: withCtx(() => [
@@ -78994,7 +79054,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
78994
79054
  _: 2
78995
79055
  }, 1024),
78996
79056
  col.type === "textarea" ? (openBlock(), createBlock(_component_el_form_item, {
78997
- key: 6,
79057
+ key: 8,
78998
79058
  label: "\u884C\u6570"
78999
79059
  }, {
79000
79060
  default: withCtx(() => [
@@ -79075,7 +79135,7 @@ function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
79075
79135
  }, 8, ["modelValue", "title"])
79076
79136
  ], 64);
79077
79137
  }
79078
- var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-2d1b4989"]]);
79138
+ var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-2401420e"]]);
79079
79139
  const _sfc_main$a = {
79080
79140
  name: "current-user-widget",
79081
79141
  componentName: "FieldWidget",