form-custom-test 3.0.165 → 3.0.167

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
@@ -23502,6 +23502,17 @@ const _sfc_main$K = {
23502
23502
  };
23503
23503
  },
23504
23504
  computed: {
23505
+ treeSelectProps() {
23506
+ const opts = this.field.options || {};
23507
+ return {
23508
+ label: opts.labelKey || "label",
23509
+ value: opts.valueKey || "value",
23510
+ children: opts.childrenKey || "children"
23511
+ };
23512
+ },
23513
+ treeNodeKey() {
23514
+ return this.field.options && this.field.options.valueKey || "value";
23515
+ },
23505
23516
  allowDefaultFirstOption() {
23506
23517
  return !!this.field.options.filterable && !!this.field.options.allowCreate;
23507
23518
  },
@@ -23558,8 +23569,9 @@ function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
23558
23569
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
23559
23570
  class: "full-width-input",
23560
23571
  data: $props.field.options.optionItems,
23572
+ props: $options.treeSelectProps,
23561
23573
  "show-checkbox": $props.field.options.showCheckbox,
23562
- "node-key": "value",
23574
+ "node-key": $options.treeNodeKey,
23563
23575
  "default-expand-all": true,
23564
23576
  "expand-on-click-node": false,
23565
23577
  disabled: _ctx.getDisabled(),
@@ -23578,7 +23590,7 @@ function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
23578
23590
  onBlur: _ctx.handleBlurCustomEvent,
23579
23591
  onChange: $options.handleTreeSelectChange,
23580
23592
  "check-strictly": $props.field.options.checkStrictly || false
23581
- }, null, 8, ["modelValue", "data", "show-checkbox", "disabled", "size", "clearable", "filterable", "allow-create", "default-first-option", "automatic-dropdown", "multiple", "multiple-limit", "placeholder", "remote", "remote-method", "onFocus", "onBlur", "onChange", "check-strictly"])
23593
+ }, null, 8, ["modelValue", "data", "props", "show-checkbox", "node-key", "disabled", "size", "clearable", "filterable", "allow-create", "default-first-option", "automatic-dropdown", "multiple", "multiple-limit", "placeholder", "remote", "remote-method", "onFocus", "onBlur", "onChange", "check-strictly"])
23582
23594
  ]),
23583
23595
  _: 1
23584
23596
  }, 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"]);
@@ -26464,13 +26476,13 @@ function registerIcon(app) {
26464
26476
  if (typeof window !== "undefined") {
26465
26477
  let loadSvg = function() {
26466
26478
  var body = document.body;
26467
- var svgDom = document.getElementById("__svg__icons__dom__1779671617385__");
26479
+ var svgDom = document.getElementById("__svg__icons__dom__1779707079167__");
26468
26480
  if (!svgDom) {
26469
26481
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26470
26482
  svgDom.style.position = "absolute";
26471
26483
  svgDom.style.width = "0";
26472
26484
  svgDom.style.height = "0";
26473
- svgDom.id = "__svg__icons__dom__1779671617385__";
26485
+ svgDom.id = "__svg__icons__dom__1779707079167__";
26474
26486
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26475
26487
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26476
26488
  }
@@ -36325,14 +36337,36 @@ const _sfc_main$a = {
36325
36337
  const rules = {};
36326
36338
  if (this.widget.options.columns && this.widget.options.columns.length > 0) {
36327
36339
  this.widget.options.columns.forEach((col) => {
36340
+ if (!col.prop)
36341
+ return;
36342
+ const colRules = [];
36328
36343
  if (col.required) {
36329
- rules[col.prop] = [
36330
- {
36331
- required: true,
36332
- message: `\u8BF7\u8F93\u5165${col.label}`,
36333
- trigger: "blur"
36334
- }
36335
- ];
36344
+ colRules.push({
36345
+ required: true,
36346
+ message: col.requiredHint || `\u8BF7\u8F93\u5165${col.label}`,
36347
+ trigger: "blur"
36348
+ });
36349
+ }
36350
+ if (col.validation) {
36351
+ if (FormValidators[col.validation]) {
36352
+ colRules.push({
36353
+ validator: FormValidators[col.validation],
36354
+ trigger: ["blur", "change"],
36355
+ label: col.label,
36356
+ errorMsg: col.validationHint
36357
+ });
36358
+ } else {
36359
+ colRules.push({
36360
+ validator: FormValidators.regExp,
36361
+ trigger: ["blur", "change"],
36362
+ regExp: col.validation,
36363
+ label: col.label,
36364
+ errorMsg: col.validationHint
36365
+ });
36366
+ }
36367
+ }
36368
+ if (colRules.length > 0) {
36369
+ rules[col.prop] = colRules;
36336
36370
  }
36337
36371
  });
36338
36372
  }
@@ -36788,7 +36822,7 @@ function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
36788
36822
  _: 1
36789
36823
  }, 8, ["widget"]);
36790
36824
  }
36791
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-758a2ba6"]]);
36825
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-607d749e"]]);
36792
36826
  var ace$2 = { exports: {} };
36793
36827
  (function(module, exports) {
36794
36828
  (function() {
@@ -61354,7 +61388,26 @@ const _sfc_main$8 = {
61354
61388
  currentEventName: "",
61355
61389
  currentColumn: null,
61356
61390
  columnEventHandlerCode: "",
61357
- eventHeader: ""
61391
+ eventHeader: "",
61392
+ fieldValidators: [
61393
+ { value: "number", label: this.i18nt("designer.hint.numberValidator") },
61394
+ { value: "letter", label: this.i18nt("designer.hint.letterValidator") },
61395
+ { value: "letterAndNumber", label: this.i18nt("designer.hint.letterAndNumberValidator") },
61396
+ { value: "mobilePhone", label: this.i18nt("designer.hint.mobilePhoneValidator") },
61397
+ { value: "email", label: this.i18nt("designer.hint.emailValidator") },
61398
+ { value: "url", label: this.i18nt("designer.hint.urlValidator") },
61399
+ { value: "noChinese", label: this.i18nt("designer.hint.noChineseValidator") },
61400
+ { value: "chinese", label: this.i18nt("designer.hint.chineseValidator") },
61401
+ { value: "maxLen12Decimals6", label: this.i18nt("designer.hint.maxLen12Decimals6Validator") },
61402
+ { value: "isPositiveIntegerLength", label: this.i18nt("designer.hint.isPositiveIntegerLengthValidator") },
61403
+ { value: "isPositiveIntegerZero", label: this.i18nt("designer.hint.isPositiveIntegerZeroValidator") },
61404
+ { value: "maxLen10Decimals2", label: this.i18nt("designer.hint.maxLen10Decimals2Validator") },
61405
+ { value: "maxLen12Decimals2", label: this.i18nt("designer.hint.maxLen12Decimals2Validator") },
61406
+ { value: "latitude", label: this.i18nt("designer.hint.latitude") },
61407
+ { value: "longitude", label: this.i18nt("designer.hint.longitude") },
61408
+ { value: "sixFigures", label: this.i18nt("designer.hint.sixFigures") },
61409
+ { value: "percentage", label: this.i18nt("designer.hint.percentage") }
61410
+ ]
61358
61411
  };
61359
61412
  },
61360
61413
  created() {
@@ -61375,6 +61428,8 @@ const _sfc_main$8 = {
61375
61428
  minWidth: "",
61376
61429
  placeholder: "",
61377
61430
  required: false,
61431
+ validation: "",
61432
+ validationHint: "",
61378
61433
  defaultValue: ""
61379
61434
  };
61380
61435
  this.optionModel.columns.push(newColumn);
@@ -61387,6 +61442,12 @@ const _sfc_main$8 = {
61387
61442
  handleColumnChange() {
61388
61443
  this.designer.saveCurrentHistoryStep();
61389
61444
  },
61445
+ handleValidationChange(col) {
61446
+ if (!col.validation) {
61447
+ col.validationHint = "";
61448
+ }
61449
+ this.handleColumnChange();
61450
+ },
61390
61451
  handleSelectOptionsChange(col, optionsText) {
61391
61452
  try {
61392
61453
  if (optionsText && optionsText.trim()) {
@@ -61705,8 +61766,47 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61705
61766
  ]),
61706
61767
  _: 2
61707
61768
  }, 1024),
61708
- col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61769
+ createVNode(_component_el_form_item, { label: "\u6821\u9A8C\u89C4\u5219" }, {
61770
+ default: withCtx(() => [
61771
+ createVNode(_component_el_select, {
61772
+ modelValue: col.validation,
61773
+ "onUpdate:modelValue": ($event) => col.validation = $event,
61774
+ placeholder: "\u8BF7\u9009\u62E9\u6821\u9A8C\u89C4\u5219",
61775
+ filterable: "",
61776
+ clearable: "",
61777
+ style: { "width": "100%" },
61778
+ onChange: ($event) => $options.handleValidationChange(col)
61779
+ }, {
61780
+ default: withCtx(() => [
61781
+ (openBlock(true), createElementBlock(Fragment, null, renderList($data.fieldValidators, (fv, fvIdx) => {
61782
+ return openBlock(), createBlock(_component_el_option, {
61783
+ key: fvIdx,
61784
+ label: fv.label,
61785
+ value: fv.value
61786
+ }, null, 8, ["label", "value"]);
61787
+ }), 128))
61788
+ ]),
61789
+ _: 1
61790
+ }, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
61791
+ ]),
61792
+ _: 2
61793
+ }, 1024),
61794
+ col.validation ? (openBlock(), createBlock(_component_el_form_item, {
61709
61795
  key: 1,
61796
+ label: "\u6821\u9A8C\u5931\u8D25\u63D0\u793A"
61797
+ }, {
61798
+ default: withCtx(() => [
61799
+ createVNode(_component_el_input, {
61800
+ modelValue: col.validationHint,
61801
+ "onUpdate:modelValue": ($event) => col.validationHint = $event,
61802
+ placeholder: "\u53EF\u9009\uFF0C\u4E0D\u586B\u5219\u4F7F\u7528\u9ED8\u8BA4\u63D0\u793A",
61803
+ onInput: $options.handleColumnChange
61804
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput"])
61805
+ ]),
61806
+ _: 2
61807
+ }, 1024)) : createCommentVNode("", true),
61808
+ col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61809
+ key: 2,
61710
61810
  label: "\u9009\u9879\u6570\u636E"
61711
61811
  }, {
61712
61812
  default: withCtx(() => [
@@ -61723,7 +61823,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61723
61823
  _: 2
61724
61824
  }, 1024)) : createCommentVNode("", true),
61725
61825
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61726
- key: 2,
61826
+ key: 3,
61727
61827
  label: "onMounted\u4E8B\u4EF6"
61728
61828
  }, {
61729
61829
  default: withCtx(() => [
@@ -61751,7 +61851,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61751
61851
  _: 2
61752
61852
  }, 1024)) : createCommentVNode("", true),
61753
61853
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
61754
- key: 3,
61854
+ key: 4,
61755
61855
  label: "\u4F9D\u8D56\u5217\uFF08\u8054\u52A8\uFF09"
61756
61856
  }, {
61757
61857
  default: withCtx(() => [
@@ -61784,7 +61884,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61784
61884
  _: 2
61785
61885
  }, 1024)) : createCommentVNode("", true),
61786
61886
  col.type === "select" && col.dependOn ? (openBlock(), createBlock(_component_el_form_item, {
61787
- key: 4,
61887
+ key: 5,
61788
61888
  label: "\u8054\u52A8\u5904\u7406\u51FD\u6570"
61789
61889
  }, {
61790
61890
  default: withCtx(() => [
@@ -61868,7 +61968,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61868
61968
  _: 2
61869
61969
  }, 1024),
61870
61970
  col.type === "textarea" ? (openBlock(), createBlock(_component_el_form_item, {
61871
- key: 5,
61971
+ key: 6,
61872
61972
  label: "\u884C\u6570"
61873
61973
  }, {
61874
61974
  default: withCtx(() => [
@@ -61949,7 +62049,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
61949
62049
  }, 8, ["modelValue", "title"])
61950
62050
  ], 64);
61951
62051
  }
61952
- var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-514d67ae"]]);
62052
+ var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-66b4c9ce"]]);
61953
62053
  const _sfc_main$7 = {
61954
62054
  name: "current-user-widget",
61955
62055
  componentName: "FieldWidget",
@@ -63368,7 +63468,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
63368
63468
  }),
63369
63469
  createVNode(_component_el_table_column, {
63370
63470
  prop: "originalValue",
63371
- label: "\u539F\u503C"
63471
+ label: "\u539F\u503C(\u4E07\u5143)"
63372
63472
  }, {
63373
63473
  default: withCtx(({ row }) => [
63374
63474
  createTextVNode(toDisplayString(row.originalValue), 1)
@@ -63377,7 +63477,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
63377
63477
  }),
63378
63478
  createVNode(_component_el_table_column, {
63379
63479
  prop: "netValue",
63380
- label: "\u51C0\u503C"
63480
+ label: "\u51C0\u503C(\u4E07\u5143)"
63381
63481
  }, {
63382
63482
  default: withCtx(({ row }) => [
63383
63483
  createTextVNode(toDisplayString(row.netValue), 1)