form-custom-test 3.0.165 → 3.0.166

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
@@ -26464,13 +26464,13 @@ function registerIcon(app) {
26464
26464
  if (typeof window !== "undefined") {
26465
26465
  let loadSvg = function() {
26466
26466
  var body = document.body;
26467
- var svgDom = document.getElementById("__svg__icons__dom__1779671617385__");
26467
+ var svgDom = document.getElementById("__svg__icons__dom__1779690464308__");
26468
26468
  if (!svgDom) {
26469
26469
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26470
26470
  svgDom.style.position = "absolute";
26471
26471
  svgDom.style.width = "0";
26472
26472
  svgDom.style.height = "0";
26473
- svgDom.id = "__svg__icons__dom__1779671617385__";
26473
+ svgDom.id = "__svg__icons__dom__1779690464308__";
26474
26474
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26475
26475
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26476
26476
  }
@@ -36325,14 +36325,36 @@ const _sfc_main$a = {
36325
36325
  const rules = {};
36326
36326
  if (this.widget.options.columns && this.widget.options.columns.length > 0) {
36327
36327
  this.widget.options.columns.forEach((col) => {
36328
+ if (!col.prop)
36329
+ return;
36330
+ const colRules = [];
36328
36331
  if (col.required) {
36329
- rules[col.prop] = [
36330
- {
36331
- required: true,
36332
- message: `\u8BF7\u8F93\u5165${col.label}`,
36333
- trigger: "blur"
36334
- }
36335
- ];
36332
+ colRules.push({
36333
+ required: true,
36334
+ message: col.requiredHint || `\u8BF7\u8F93\u5165${col.label}`,
36335
+ trigger: "blur"
36336
+ });
36337
+ }
36338
+ if (col.validation) {
36339
+ if (FormValidators[col.validation]) {
36340
+ colRules.push({
36341
+ validator: FormValidators[col.validation],
36342
+ trigger: ["blur", "change"],
36343
+ label: col.label,
36344
+ errorMsg: col.validationHint
36345
+ });
36346
+ } else {
36347
+ colRules.push({
36348
+ validator: FormValidators.regExp,
36349
+ trigger: ["blur", "change"],
36350
+ regExp: col.validation,
36351
+ label: col.label,
36352
+ errorMsg: col.validationHint
36353
+ });
36354
+ }
36355
+ }
36356
+ if (colRules.length > 0) {
36357
+ rules[col.prop] = colRules;
36336
36358
  }
36337
36359
  });
36338
36360
  }
@@ -36788,7 +36810,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
36788
36810
  _: 1
36789
36811
  }, 8, ["widget"]);
36790
36812
  }
36791
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-758a2ba6"]]);
36813
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-607d749e"]]);
36792
36814
  var ace$2 = { exports: {} };
36793
36815
  (function(module, exports) {
36794
36816
  (function() {
@@ -61354,7 +61376,26 @@ const _sfc_main$8 = {
61354
61376
  currentEventName: "",
61355
61377
  currentColumn: null,
61356
61378
  columnEventHandlerCode: "",
61357
- eventHeader: ""
61379
+ eventHeader: "",
61380
+ fieldValidators: [
61381
+ { value: "number", label: this.i18nt("designer.hint.numberValidator") },
61382
+ { value: "letter", label: this.i18nt("designer.hint.letterValidator") },
61383
+ { value: "letterAndNumber", label: this.i18nt("designer.hint.letterAndNumberValidator") },
61384
+ { value: "mobilePhone", label: this.i18nt("designer.hint.mobilePhoneValidator") },
61385
+ { value: "email", label: this.i18nt("designer.hint.emailValidator") },
61386
+ { value: "url", label: this.i18nt("designer.hint.urlValidator") },
61387
+ { value: "noChinese", label: this.i18nt("designer.hint.noChineseValidator") },
61388
+ { value: "chinese", label: this.i18nt("designer.hint.chineseValidator") },
61389
+ { value: "maxLen12Decimals6", label: this.i18nt("designer.hint.maxLen12Decimals6Validator") },
61390
+ { value: "isPositiveIntegerLength", label: this.i18nt("designer.hint.isPositiveIntegerLengthValidator") },
61391
+ { value: "isPositiveIntegerZero", label: this.i18nt("designer.hint.isPositiveIntegerZeroValidator") },
61392
+ { value: "maxLen10Decimals2", label: this.i18nt("designer.hint.maxLen10Decimals2Validator") },
61393
+ { value: "maxLen12Decimals2", label: this.i18nt("designer.hint.maxLen12Decimals2Validator") },
61394
+ { value: "latitude", label: this.i18nt("designer.hint.latitude") },
61395
+ { value: "longitude", label: this.i18nt("designer.hint.longitude") },
61396
+ { value: "sixFigures", label: this.i18nt("designer.hint.sixFigures") },
61397
+ { value: "percentage", label: this.i18nt("designer.hint.percentage") }
61398
+ ]
61358
61399
  };
61359
61400
  },
61360
61401
  created() {
@@ -61375,6 +61416,8 @@ const _sfc_main$8 = {
61375
61416
  minWidth: "",
61376
61417
  placeholder: "",
61377
61418
  required: false,
61419
+ validation: "",
61420
+ validationHint: "",
61378
61421
  defaultValue: ""
61379
61422
  };
61380
61423
  this.optionModel.columns.push(newColumn);
@@ -61387,6 +61430,12 @@ const _sfc_main$8 = {
61387
61430
  handleColumnChange() {
61388
61431
  this.designer.saveCurrentHistoryStep();
61389
61432
  },
61433
+ handleValidationChange(col) {
61434
+ if (!col.validation) {
61435
+ col.validationHint = "";
61436
+ }
61437
+ this.handleColumnChange();
61438
+ },
61390
61439
  handleSelectOptionsChange(col, optionsText) {
61391
61440
  try {
61392
61441
  if (optionsText && optionsText.trim()) {
@@ -61705,8 +61754,47 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61705
61754
  ]),
61706
61755
  _: 2
61707
61756
  }, 1024),
61708
- col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61757
+ createVNode(_component_el_form_item, { label: "\u6821\u9A8C\u89C4\u5219" }, {
61758
+ default: withCtx(() => [
61759
+ createVNode(_component_el_select, {
61760
+ modelValue: col.validation,
61761
+ "onUpdate:modelValue": ($event) => col.validation = $event,
61762
+ placeholder: "\u8BF7\u9009\u62E9\u6821\u9A8C\u89C4\u5219",
61763
+ filterable: "",
61764
+ clearable: "",
61765
+ style: { "width": "100%" },
61766
+ onChange: ($event) => $options.handleValidationChange(col)
61767
+ }, {
61768
+ default: withCtx(() => [
61769
+ (openBlock(true), createElementBlock(Fragment, null, renderList($data.fieldValidators, (fv, fvIdx) => {
61770
+ return openBlock(), createBlock(_component_el_option, {
61771
+ key: fvIdx,
61772
+ label: fv.label,
61773
+ value: fv.value
61774
+ }, null, 8, ["label", "value"]);
61775
+ }), 128))
61776
+ ]),
61777
+ _: 1
61778
+ }, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
61779
+ ]),
61780
+ _: 2
61781
+ }, 1024),
61782
+ col.validation ? (openBlock(), createBlock(_component_el_form_item, {
61709
61783
  key: 1,
61784
+ label: "\u6821\u9A8C\u5931\u8D25\u63D0\u793A"
61785
+ }, {
61786
+ default: withCtx(() => [
61787
+ createVNode(_component_el_input, {
61788
+ modelValue: col.validationHint,
61789
+ "onUpdate:modelValue": ($event) => col.validationHint = $event,
61790
+ placeholder: "\u53EF\u9009\uFF0C\u4E0D\u586B\u5219\u4F7F\u7528\u9ED8\u8BA4\u63D0\u793A",
61791
+ onInput: $options.handleColumnChange
61792
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput"])
61793
+ ]),
61794
+ _: 2
61795
+ }, 1024)) : createCommentVNode("", true),
61796
+ col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61797
+ key: 2,
61710
61798
  label: "\u9009\u9879\u6570\u636E"
61711
61799
  }, {
61712
61800
  default: withCtx(() => [
@@ -61723,7 +61811,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61723
61811
  _: 2
61724
61812
  }, 1024)) : createCommentVNode("", true),
61725
61813
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61726
- key: 2,
61814
+ key: 3,
61727
61815
  label: "onMounted\u4E8B\u4EF6"
61728
61816
  }, {
61729
61817
  default: withCtx(() => [
@@ -61751,7 +61839,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61751
61839
  _: 2
61752
61840
  }, 1024)) : createCommentVNode("", true),
61753
61841
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61754
- key: 3,
61842
+ key: 4,
61755
61843
  label: "\u4F9D\u8D56\u5217\uFF08\u8054\u52A8\uFF09"
61756
61844
  }, {
61757
61845
  default: withCtx(() => [
@@ -61784,7 +61872,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61784
61872
  _: 2
61785
61873
  }, 1024)) : createCommentVNode("", true),
61786
61874
  col.type === "select" && col.dependOn ? (openBlock(), createBlock(_component_el_form_item, {
61787
- key: 4,
61875
+ key: 5,
61788
61876
  label: "\u8054\u52A8\u5904\u7406\u51FD\u6570"
61789
61877
  }, {
61790
61878
  default: withCtx(() => [
@@ -61868,7 +61956,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61868
61956
  _: 2
61869
61957
  }, 1024),
61870
61958
  col.type === "textarea" ? (openBlock(), createBlock(_component_el_form_item, {
61871
- key: 5,
61959
+ key: 6,
61872
61960
  label: "\u884C\u6570"
61873
61961
  }, {
61874
61962
  default: withCtx(() => [
@@ -61949,7 +62037,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61949
62037
  }, 8, ["modelValue", "title"])
61950
62038
  ], 64);
61951
62039
  }
61952
- var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-514d67ae"]]);
62040
+ var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-66b4c9ce"]]);
61953
62041
  const _sfc_main$7 = {
61954
62042
  name: "current-user-widget",
61955
62043
  componentName: "FieldWidget",
@@ -63368,7 +63456,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
63368
63456
  }),
63369
63457
  createVNode(_component_el_table_column, {
63370
63458
  prop: "originalValue",
63371
- label: "\u539F\u503C"
63459
+ label: "\u539F\u503C\uFF08\u4E07\u5143\uFF09"
63372
63460
  }, {
63373
63461
  default: withCtx(({ row }) => [
63374
63462
  createTextVNode(toDisplayString(row.originalValue), 1)
@@ -63377,7 +63465,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
63377
63465
  }),
63378
63466
  createVNode(_component_el_table_column, {
63379
63467
  prop: "netValue",
63380
- label: "\u51C0\u503C"
63468
+ label: "\u51C0\u503C\uFF08\u4E07\u5143\uFF09"
63381
63469
  }, {
63382
63470
  default: withCtx(({ row }) => [
63383
63471
  createTextVNode(toDisplayString(row.netValue), 1)