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.
@@ -1437,6 +1437,10 @@ const basicFields = [
1437
1437
  disabled: false,
1438
1438
  hidden: false,
1439
1439
  showCheckbox: false,
1440
+ checkStrictly: false,
1441
+ labelKey: "label",
1442
+ valueKey: "value",
1443
+ childrenKey: "children",
1440
1444
  clearable: true,
1441
1445
  filterable: false,
1442
1446
  allowCreate: false,
@@ -25276,6 +25280,17 @@ const _sfc_main$38 = {
25276
25280
  };
25277
25281
  },
25278
25282
  computed: {
25283
+ treeSelectProps() {
25284
+ const opts = this.field.options || {};
25285
+ return {
25286
+ label: opts.labelKey || "label",
25287
+ value: opts.valueKey || "value",
25288
+ children: opts.childrenKey || "children"
25289
+ };
25290
+ },
25291
+ treeNodeKey() {
25292
+ return this.field.options && this.field.options.valueKey || "value";
25293
+ },
25279
25294
  allowDefaultFirstOption() {
25280
25295
  return !!this.field.options.filterable && !!this.field.options.allowCreate;
25281
25296
  },
@@ -25332,8 +25347,9 @@ function _sfc_render$38(_ctx, _cache, $props, $setup, $data, $options) {
25332
25347
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
25333
25348
  class: "full-width-input",
25334
25349
  data: $props.field.options.optionItems,
25350
+ props: $options.treeSelectProps,
25335
25351
  "show-checkbox": $props.field.options.showCheckbox,
25336
- "node-key": "value",
25352
+ "node-key": $options.treeNodeKey,
25337
25353
  "default-expand-all": true,
25338
25354
  "expand-on-click-node": false,
25339
25355
  disabled: _ctx.getDisabled(),
@@ -25352,7 +25368,7 @@ function _sfc_render$38(_ctx, _cache, $props, $setup, $data, $options) {
25352
25368
  onBlur: _ctx.handleBlurCustomEvent,
25353
25369
  onChange: $options.handleTreeSelectChange,
25354
25370
  "check-strictly": $props.field.options.checkStrictly || false
25355
- }, 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"])
25371
+ }, 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"])
25356
25372
  ]),
25357
25373
  _: 1
25358
25374
  }, 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"]);
@@ -56377,6 +56393,19 @@ const _sfc_main$2h = {
56377
56393
  value: opts.valueKey || "value",
56378
56394
  children: opts.childrenKey || "children"
56379
56395
  };
56396
+ },
56397
+ designerTreeProps() {
56398
+ const opts = this.optionModel || {};
56399
+ const childrenKey = opts.childrenKey || "children";
56400
+ const labelKey = opts.labelKey || "label";
56401
+ return {
56402
+ children: childrenKey,
56403
+ label: labelKey
56404
+ };
56405
+ },
56406
+ designerTreeNodeKey() {
56407
+ const opts = this.optionModel || {};
56408
+ return opts.valueKey || "value";
56380
56409
  }
56381
56410
  },
56382
56411
  watch: {
@@ -56752,9 +56781,9 @@ function _sfc_render$2h(_ctx, _cache, $props, $setup, $data, $options) {
56752
56781
  ])) : $props.selectedWidget.type === "select-tree" ? (openBlock(), createElementBlock("div", _hoisted_3$g, [
56753
56782
  createVNode(_component_el_tree, {
56754
56783
  data: $options.optionModel.optionItems,
56755
- props: { children: "children", label: "label" },
56784
+ props: $options.designerTreeProps,
56756
56785
  "show-checkbox": "",
56757
- "node-key": "value",
56786
+ "node-key": $options.designerTreeNodeKey,
56758
56787
  "default-expand-all": true,
56759
56788
  "expand-on-click-node": false
56760
56789
  }, {
@@ -56790,7 +56819,7 @@ function _sfc_render$2h(_ctx, _cache, $props, $setup, $data, $options) {
56790
56819
  ])
56791
56820
  ]),
56792
56821
  _: 1
56793
- }, 8, ["data"])
56822
+ }, 8, ["data", "props", "node-key"])
56794
56823
  ])) : createCommentVNode("", true),
56795
56824
  $props.selectedWidget.type === "cascader" ? (openBlock(), createElementBlock("div", _hoisted_6$a, [
56796
56825
  createVNode(_component_el_button, {
@@ -57060,7 +57089,7 @@ function _sfc_render$2h(_ctx, _cache, $props, $setup, $data, $options) {
57060
57089
  ]) : createCommentVNode("", true)
57061
57090
  ]);
57062
57091
  }
57063
- var OptionItemsSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$2h, [["render", _sfc_render$2h], ["__scopeId", "data-v-1b1072d8"]]);
57092
+ var OptionItemsSetting = /* @__PURE__ */ _export_sfc$1(_sfc_main$2h, [["render", _sfc_render$2h], ["__scopeId", "data-v-66966c40"]]);
57064
57093
  const _sfc_main$2g = {
57065
57094
  name: "optionItems-editor",
57066
57095
  mixins: [i18n$1],
@@ -68896,13 +68925,13 @@ function registerIcon(app) {
68896
68925
  if (typeof window !== "undefined") {
68897
68926
  let loadSvg = function() {
68898
68927
  var body = document.body;
68899
- var svgDom = document.getElementById("__svg__icons__dom__1779671607460__");
68928
+ var svgDom = document.getElementById("__svg__icons__dom__1779707068811__");
68900
68929
  if (!svgDom) {
68901
68930
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
68902
68931
  svgDom.style.position = "absolute";
68903
68932
  svgDom.style.width = "0";
68904
68933
  svgDom.style.height = "0";
68905
- svgDom.id = "__svg__icons__dom__1779671607460__";
68934
+ svgDom.id = "__svg__icons__dom__1779707068811__";
68906
68935
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
68907
68936
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
68908
68937
  }
@@ -77757,14 +77786,36 @@ const _sfc_main$9 = {
77757
77786
  const rules = {};
77758
77787
  if (this.widget.options.columns && this.widget.options.columns.length > 0) {
77759
77788
  this.widget.options.columns.forEach((col) => {
77789
+ if (!col.prop)
77790
+ return;
77791
+ const colRules = [];
77760
77792
  if (col.required) {
77761
- rules[col.prop] = [
77762
- {
77763
- required: true,
77764
- message: `\u8BF7\u8F93\u5165${col.label}`,
77765
- trigger: "blur"
77766
- }
77767
- ];
77793
+ colRules.push({
77794
+ required: true,
77795
+ message: col.requiredHint || `\u8BF7\u8F93\u5165${col.label}`,
77796
+ trigger: "blur"
77797
+ });
77798
+ }
77799
+ if (col.validation) {
77800
+ if (FormValidators[col.validation]) {
77801
+ colRules.push({
77802
+ validator: FormValidators[col.validation],
77803
+ trigger: ["blur", "change"],
77804
+ label: col.label,
77805
+ errorMsg: col.validationHint
77806
+ });
77807
+ } else {
77808
+ colRules.push({
77809
+ validator: FormValidators.regExp,
77810
+ trigger: ["blur", "change"],
77811
+ regExp: col.validation,
77812
+ label: col.label,
77813
+ errorMsg: col.validationHint
77814
+ });
77815
+ }
77816
+ }
77817
+ if (colRules.length > 0) {
77818
+ rules[col.prop] = colRules;
77768
77819
  }
77769
77820
  });
77770
77821
  }
@@ -78220,7 +78271,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
78220
78271
  _: 1
78221
78272
  }, 8, ["widget"]);
78222
78273
  }
78223
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-758a2ba6"]]);
78274
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-607d749e"]]);
78224
78275
  var subTableColumnsEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
78225
78276
  const _sfc_main$8 = {
78226
78277
  name: "sub-table-columns-editor",
@@ -78239,7 +78290,26 @@ const _sfc_main$8 = {
78239
78290
  currentEventName: "",
78240
78291
  currentColumn: null,
78241
78292
  columnEventHandlerCode: "",
78242
- eventHeader: ""
78293
+ eventHeader: "",
78294
+ fieldValidators: [
78295
+ { value: "number", label: this.i18nt("designer.hint.numberValidator") },
78296
+ { value: "letter", label: this.i18nt("designer.hint.letterValidator") },
78297
+ { value: "letterAndNumber", label: this.i18nt("designer.hint.letterAndNumberValidator") },
78298
+ { value: "mobilePhone", label: this.i18nt("designer.hint.mobilePhoneValidator") },
78299
+ { value: "email", label: this.i18nt("designer.hint.emailValidator") },
78300
+ { value: "url", label: this.i18nt("designer.hint.urlValidator") },
78301
+ { value: "noChinese", label: this.i18nt("designer.hint.noChineseValidator") },
78302
+ { value: "chinese", label: this.i18nt("designer.hint.chineseValidator") },
78303
+ { value: "maxLen12Decimals6", label: this.i18nt("designer.hint.maxLen12Decimals6Validator") },
78304
+ { value: "isPositiveIntegerLength", label: this.i18nt("designer.hint.isPositiveIntegerLengthValidator") },
78305
+ { value: "isPositiveIntegerZero", label: this.i18nt("designer.hint.isPositiveIntegerZeroValidator") },
78306
+ { value: "maxLen10Decimals2", label: this.i18nt("designer.hint.maxLen10Decimals2Validator") },
78307
+ { value: "maxLen12Decimals2", label: this.i18nt("designer.hint.maxLen12Decimals2Validator") },
78308
+ { value: "latitude", label: this.i18nt("designer.hint.latitude") },
78309
+ { value: "longitude", label: this.i18nt("designer.hint.longitude") },
78310
+ { value: "sixFigures", label: this.i18nt("designer.hint.sixFigures") },
78311
+ { value: "percentage", label: this.i18nt("designer.hint.percentage") }
78312
+ ]
78243
78313
  };
78244
78314
  },
78245
78315
  created() {
@@ -78260,6 +78330,8 @@ const _sfc_main$8 = {
78260
78330
  minWidth: "",
78261
78331
  placeholder: "",
78262
78332
  required: false,
78333
+ validation: "",
78334
+ validationHint: "",
78263
78335
  defaultValue: ""
78264
78336
  };
78265
78337
  this.optionModel.columns.push(newColumn);
@@ -78272,6 +78344,12 @@ const _sfc_main$8 = {
78272
78344
  handleColumnChange() {
78273
78345
  this.designer.saveCurrentHistoryStep();
78274
78346
  },
78347
+ handleValidationChange(col) {
78348
+ if (!col.validation) {
78349
+ col.validationHint = "";
78350
+ }
78351
+ this.handleColumnChange();
78352
+ },
78275
78353
  handleSelectOptionsChange(col, optionsText) {
78276
78354
  try {
78277
78355
  if (optionsText && optionsText.trim()) {
@@ -78590,8 +78668,47 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
78590
78668
  ]),
78591
78669
  _: 2
78592
78670
  }, 1024),
78593
- col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78671
+ createVNode(_component_el_form_item, { label: "\u6821\u9A8C\u89C4\u5219" }, {
78672
+ default: withCtx(() => [
78673
+ createVNode(_component_el_select, {
78674
+ modelValue: col.validation,
78675
+ "onUpdate:modelValue": ($event) => col.validation = $event,
78676
+ placeholder: "\u8BF7\u9009\u62E9\u6821\u9A8C\u89C4\u5219",
78677
+ filterable: "",
78678
+ clearable: "",
78679
+ style: { "width": "100%" },
78680
+ onChange: ($event) => $options.handleValidationChange(col)
78681
+ }, {
78682
+ default: withCtx(() => [
78683
+ (openBlock(true), createElementBlock(Fragment, null, renderList($data.fieldValidators, (fv, fvIdx) => {
78684
+ return openBlock(), createBlock(_component_el_option, {
78685
+ key: fvIdx,
78686
+ label: fv.label,
78687
+ value: fv.value
78688
+ }, null, 8, ["label", "value"]);
78689
+ }), 128))
78690
+ ]),
78691
+ _: 1
78692
+ }, 8, ["modelValue", "onUpdate:modelValue", "onChange"])
78693
+ ]),
78694
+ _: 2
78695
+ }, 1024),
78696
+ col.validation ? (openBlock(), createBlock(_component_el_form_item, {
78594
78697
  key: 1,
78698
+ label: "\u6821\u9A8C\u5931\u8D25\u63D0\u793A"
78699
+ }, {
78700
+ default: withCtx(() => [
78701
+ createVNode(_component_el_input, {
78702
+ modelValue: col.validationHint,
78703
+ "onUpdate:modelValue": ($event) => col.validationHint = $event,
78704
+ placeholder: "\u53EF\u9009\uFF0C\u4E0D\u586B\u5219\u4F7F\u7528\u9ED8\u8BA4\u63D0\u793A",
78705
+ onInput: $options.handleColumnChange
78706
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "onInput"])
78707
+ ]),
78708
+ _: 2
78709
+ }, 1024)) : createCommentVNode("", true),
78710
+ col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78711
+ key: 2,
78595
78712
  label: "\u9009\u9879\u6570\u636E"
78596
78713
  }, {
78597
78714
  default: withCtx(() => [
@@ -78608,7 +78725,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
78608
78725
  _: 2
78609
78726
  }, 1024)) : createCommentVNode("", true),
78610
78727
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78611
- key: 2,
78728
+ key: 3,
78612
78729
  label: "onMounted\u4E8B\u4EF6"
78613
78730
  }, {
78614
78731
  default: withCtx(() => [
@@ -78636,7 +78753,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
78636
78753
  _: 2
78637
78754
  }, 1024)) : createCommentVNode("", true),
78638
78755
  col.type === "select" ? (openBlock(), createBlock(_component_el_form_item, {
78639
- key: 3,
78756
+ key: 4,
78640
78757
  label: "\u4F9D\u8D56\u5217\uFF08\u8054\u52A8\uFF09"
78641
78758
  }, {
78642
78759
  default: withCtx(() => [
@@ -78669,7 +78786,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
78669
78786
  _: 2
78670
78787
  }, 1024)) : createCommentVNode("", true),
78671
78788
  col.type === "select" && col.dependOn ? (openBlock(), createBlock(_component_el_form_item, {
78672
- key: 4,
78789
+ key: 5,
78673
78790
  label: "\u8054\u52A8\u5904\u7406\u51FD\u6570"
78674
78791
  }, {
78675
78792
  default: withCtx(() => [
@@ -78753,7 +78870,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
78753
78870
  _: 2
78754
78871
  }, 1024),
78755
78872
  col.type === "textarea" ? (openBlock(), createBlock(_component_el_form_item, {
78756
- key: 5,
78873
+ key: 6,
78757
78874
  label: "\u884C\u6570"
78758
78875
  }, {
78759
78876
  default: withCtx(() => [
@@ -78834,7 +78951,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
78834
78951
  }, 8, ["modelValue", "title"])
78835
78952
  ], 64);
78836
78953
  }
78837
- var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-514d67ae"]]);
78954
+ var SubTableColumnsEditor = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-66b4c9ce"]]);
78838
78955
  const _sfc_main$7 = {
78839
78956
  name: "current-user-widget",
78840
78957
  componentName: "FieldWidget",
@@ -80253,7 +80370,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
80253
80370
  }),
80254
80371
  createVNode(_component_el_table_column, {
80255
80372
  prop: "originalValue",
80256
- label: "\u539F\u503C"
80373
+ label: "\u539F\u503C(\u4E07\u5143)"
80257
80374
  }, {
80258
80375
  default: withCtx(({ row }) => [
80259
80376
  createTextVNode(toDisplayString(row.originalValue), 1)
@@ -80262,7 +80379,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
80262
80379
  }),
80263
80380
  createVNode(_component_el_table_column, {
80264
80381
  prop: "netValue",
80265
- label: "\u51C0\u503C"
80382
+ label: "\u51C0\u503C(\u4E07\u5143)"
80266
80383
  }, {
80267
80384
  default: withCtx(({ row }) => [
80268
80385
  createTextVNode(toDisplayString(row.netValue), 1)