form-custom-test 3.0.235 → 3.0.237

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
@@ -26648,13 +26648,13 @@ function registerIcon(app) {
26648
26648
  if (typeof window !== "undefined") {
26649
26649
  let loadSvg = function() {
26650
26650
  var body = document.body;
26651
- var svgDom = document.getElementById("__svg__icons__dom__1784189603868__");
26651
+ var svgDom = document.getElementById("__svg__icons__dom__1784265165898__");
26652
26652
  if (!svgDom) {
26653
26653
  svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
26654
26654
  svgDom.style.position = "absolute";
26655
26655
  svgDom.style.width = "0";
26656
26656
  svgDom.style.height = "0";
26657
- svgDom.id = "__svg__icons__dom__1784189603868__";
26657
+ svgDom.id = "__svg__icons__dom__1784265165898__";
26658
26658
  svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
26659
26659
  svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
26660
26660
  }
@@ -36394,7 +36394,8 @@ const _sfc_main$m = {
36394
36394
  dialogFormData: {},
36395
36395
  dialogFormRules: {},
36396
36396
  editingIndex: -1,
36397
- syncFromFormModel: false
36397
+ syncFromFormModel: false,
36398
+ rules: []
36398
36399
  };
36399
36400
  },
36400
36401
  computed: {
@@ -36420,6 +36421,22 @@ const _sfc_main$m = {
36420
36421
  }
36421
36422
  },
36422
36423
  watch: {
36424
+ "widget.options.required"() {
36425
+ this.buildFieldRules();
36426
+ },
36427
+ "widget.options.validation"() {
36428
+ this.buildFieldRules();
36429
+ },
36430
+ "widget.options.onValidate"() {
36431
+ this.buildFieldRules();
36432
+ },
36433
+ "widget.options.hidden"(val) {
36434
+ if (val) {
36435
+ this.clearFieldRules();
36436
+ } else {
36437
+ this.buildFieldRules();
36438
+ }
36439
+ },
36423
36440
  formModel: {
36424
36441
  handler(newVal) {
36425
36442
  this.syncFromFormModel = true;
@@ -36449,11 +36466,96 @@ const _sfc_main$m = {
36449
36466
  created() {
36450
36467
  this.initRefList();
36451
36468
  this.initEventHandler();
36469
+ this.buildFieldRules();
36452
36470
  },
36453
36471
  beforeUnmount() {
36454
36472
  this.unregisterFromRefList();
36455
36473
  },
36456
36474
  methods: {
36475
+ getPropName() {
36476
+ var _a, _b;
36477
+ return ((_b = (_a = this.widget) == null ? void 0 : _a.options) == null ? void 0 : _b.name) || "";
36478
+ },
36479
+ clearFieldRules() {
36480
+ var _a;
36481
+ if (!((_a = this.widget) == null ? void 0 : _a.formItemFlag)) {
36482
+ return;
36483
+ }
36484
+ this.rules.splice(0, this.rules.length);
36485
+ },
36486
+ buildFieldRules() {
36487
+ var _a;
36488
+ if (!((_a = this.widget) == null ? void 0 : _a.formItemFlag)) {
36489
+ return;
36490
+ }
36491
+ this.rules.splice(0, this.rules.length);
36492
+ if (this.widget.options.hidden) {
36493
+ return;
36494
+ }
36495
+ if (this.widget.options.required) {
36496
+ const message = this.widget.options.requiredHint || this.i18nt("render.hint.fieldRequired") || `\u8BF7\u6DFB\u52A0${this.widget.options.label || "\u5B50\u8868\u683C"}\u6570\u636E`;
36497
+ this.rules.push({
36498
+ type: "array",
36499
+ required: true,
36500
+ min: 1,
36501
+ message,
36502
+ trigger: "change"
36503
+ });
36504
+ }
36505
+ if (this.widget.options.validation) {
36506
+ const vldName = this.widget.options.validation;
36507
+ if (FormValidators[vldName]) {
36508
+ this.rules.push({
36509
+ validator: FormValidators[vldName],
36510
+ trigger: ["blur", "change"],
36511
+ label: this.widget.options.label,
36512
+ errorMsg: this.widget.options.validationHint
36513
+ });
36514
+ } else {
36515
+ this.rules.push({
36516
+ validator: FormValidators.regExp,
36517
+ trigger: ["blur", "change"],
36518
+ regExp: vldName,
36519
+ label: this.widget.options.label,
36520
+ errorMsg: this.widget.options.validationHint
36521
+ });
36522
+ }
36523
+ }
36524
+ if (this.widget.options.onValidate) {
36525
+ const customFn = (rule2, value2, callback2) => {
36526
+ const tmpFunc = new Function("rule", "value", "callback", this.widget.options.onValidate);
36527
+ return tmpFunc.call(this, rule2, value2, callback2);
36528
+ };
36529
+ this.rules.push({
36530
+ validator: customFn,
36531
+ trigger: ["blur", "change"],
36532
+ label: this.widget.options.label
36533
+ });
36534
+ }
36535
+ },
36536
+ setRequired(flag) {
36537
+ this.widget.options.required = !!flag;
36538
+ this.buildFieldRules();
36539
+ },
36540
+ setHidden(flag) {
36541
+ if (!this.widget || !this.widget.options) {
36542
+ return;
36543
+ }
36544
+ this.widget.options.hidden = !!flag;
36545
+ if (flag) {
36546
+ this.clearFieldRules();
36547
+ } else {
36548
+ this.buildFieldRules();
36549
+ }
36550
+ },
36551
+ triggerFieldValidation() {
36552
+ const propName = this.getPropName();
36553
+ if (!propName)
36554
+ return;
36555
+ this.$nextTick(() => {
36556
+ this.dispatch("VFormRender", "fieldValidation", [propName]);
36557
+ });
36558
+ },
36457
36559
  initEventHandler() {
36458
36560
  this.on$("setFormData", (newFormData) => {
36459
36561
  var _a, _b;
@@ -36537,6 +36639,7 @@ const _sfc_main$m = {
36537
36639
  this.updateFormModel(this.tableData);
36538
36640
  this.handleWidgetOnChange(deepClone(this.tableData), oldTableData);
36539
36641
  this.$message.success("\u5220\u9664\u6210\u529F");
36642
+ this.triggerFieldValidation();
36540
36643
  if (this.widget.options.onRowDelete) {
36541
36644
  try {
36542
36645
  new Function("rowIndex", "rowData", this.widget.options.onRowDelete)(index2, this.tableData[index2]);
@@ -36664,6 +36767,7 @@ const _sfc_main$m = {
36664
36767
  }
36665
36768
  this.updateFormModel(this.tableData);
36666
36769
  this.handleWidgetOnChange(deepClone(this.tableData), oldTableData);
36770
+ this.triggerFieldValidation();
36667
36771
  this.dialogVisible = false;
36668
36772
  } else {
36669
36773
  this.$message.warning("\u8BF7\u586B\u5199\u5B8C\u6574\u4FE1\u606F");
@@ -36824,259 +36928,269 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
36824
36928
  const _component_container_item_wrapper = resolveComponent("container-item-wrapper");
36825
36929
  return openBlock(), createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
36826
36930
  default: withCtx(() => [
36827
- $props.widget ? withDirectives((openBlock(), createElementBlock("div", {
36931
+ $props.widget ? withDirectives((openBlock(), createBlock(_component_el_form_item, {
36828
36932
  key: $props.widget.id,
36829
- class: normalizeClass(["sub-table-container", $options.customClass])
36830
- }, [
36831
- $props.widget.options.label ? (openBlock(), createElementBlock("div", _hoisted_1$f, [
36832
- createElementVNode("span", {
36833
- class: normalizeClass($options.labelClass)
36834
- }, toDisplayString($props.widget.options.label), 3),
36835
- $props.widget.options.required ? (openBlock(), createElementBlock("span", _hoisted_2$c, "*")) : createCommentVNode("", true)
36836
- ])) : createCommentVNode("", true),
36837
- createElementVNode("div", _hoisted_3$9, [
36838
- !$props.widget.options.disabled ? (openBlock(), createBlock(_component_el_button, {
36839
- key: 0,
36840
- type: "primary",
36841
- size: "small",
36842
- disabled: $props.widget.options.disabled,
36843
- onClick: $options.handleAddRow,
36844
- icon: "el-icon-plus"
36845
- }, {
36846
- default: withCtx(() => [..._cache[2] || (_cache[2] = [
36847
- createTextVNode(" \u65B0\u589E ", -1)
36848
- ])]),
36849
- _: 1
36850
- }, 8, ["disabled", "onClick"])) : createCommentVNode("", true)
36851
- ]),
36852
- createVNode(_component_el_table, {
36853
- data: $data.tableData,
36854
- border: $props.widget.options.border,
36855
- stripe: $props.widget.options.stripe,
36856
- size: $props.widget.options.size,
36857
- "max-height": $options.tableMaxHeight,
36858
- style: { "width": "100%" },
36859
- disabled: $props.widget.options.disabled
36860
- }, {
36861
- empty: withCtx(() => [..._cache[5] || (_cache[5] = [
36862
- createElementVNode("div", { class: "empty-hint" }, [
36863
- createElementVNode("span", null, "\u6682\u65E0\u6570\u636E")
36864
- ], -1)
36865
- ])]),
36866
- default: withCtx(() => [
36867
- $props.widget.options.showIndex ? (openBlock(), createBlock(_component_el_table_column, {
36868
- key: 0,
36869
- type: "index",
36870
- label: "\u5E8F\u53F7",
36871
- width: "60",
36872
- align: "center"
36873
- })) : createCommentVNode("", true),
36874
- (openBlock(true), createElementBlock(Fragment, null, renderList($props.widget.options.columns, (col, colIdx) => {
36875
- return openBlock(), createBlock(_component_el_table_column, {
36876
- key: colIdx,
36877
- prop: col.prop,
36878
- label: col.label,
36879
- width: col.width,
36880
- "min-width": col.minWidth,
36881
- align: "left",
36882
- "show-overflow-tooltip": ""
36883
- }, {
36884
- default: withCtx(({ row, $index }) => [
36885
- createTextVNode(toDisplayString($options.getTableValue(row, col, $index)), 1)
36886
- ]),
36887
- _: 2
36888
- }, 1032, ["prop", "label", "width", "min-width"]);
36889
- }), 128)),
36890
- $props.widget.options.showOperation && !$props.widget.options.disabled ? (openBlock(), createBlock(_component_el_table_column, {
36891
- key: 1,
36892
- label: "\u64CD\u4F5C",
36893
- width: $props.widget.options.operationColumnWidth,
36894
- align: "center",
36895
- fixed: "right"
36896
- }, {
36897
- default: withCtx(({ row, $index }) => [
36898
- createVNode(_component_el_button, {
36899
- size: "small",
36900
- type: "primary",
36901
- link: "",
36902
- disabled: $props.widget.options.disabled,
36903
- onClick: ($event) => $options.handleEditRow($index, row)
36904
- }, {
36905
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
36906
- createTextVNode(" \u7F16\u8F91 ", -1)
36907
- ])]),
36908
- _: 1
36909
- }, 8, ["disabled", "onClick"]),
36910
- createVNode(_component_el_button, {
36911
- size: "small",
36912
- type: "danger",
36913
- link: "",
36914
- disabled: $props.widget.options.disabled,
36915
- onClick: ($event) => $options.handleDeleteRow($index)
36916
- }, {
36917
- default: withCtx(() => [..._cache[4] || (_cache[4] = [
36918
- createTextVNode(" \u5220\u9664 ", -1)
36919
- ])]),
36920
- _: 1
36921
- }, 8, ["disabled", "onClick"])
36922
- ]),
36923
- _: 1
36924
- }, 8, ["width"])) : createCommentVNode("", true)
36925
- ]),
36926
- _: 1
36927
- }, 8, ["data", "border", "stripe", "size", "max-height", "disabled"]),
36928
- createVNode(_component_el_dialog, {
36929
- modelValue: $data.dialogVisible,
36930
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.dialogVisible = $event),
36931
- title: $data.dialogTitle,
36932
- width: "800px",
36933
- "close-on-click-modal": false,
36934
- onClose: $options.handleDialogClose,
36935
- onOpened: $options.handleDialogOpened
36936
- }, {
36937
- footer: withCtx(() => [
36938
- createElementVNode("span", _hoisted_4$8, [
36939
- createVNode(_component_el_button, {
36940
- size: "default",
36941
- onClick: _cache[0] || (_cache[0] = ($event) => $data.dialogVisible = false)
36942
- }, {
36943
- default: withCtx(() => [..._cache[6] || (_cache[6] = [
36944
- createTextVNode("\u53D6\u6D88", -1)
36945
- ])]),
36946
- _: 1
36947
- }),
36948
- createVNode(_component_el_button, {
36949
- size: "default",
36933
+ prop: $options.getPropName(),
36934
+ rules: $data.rules,
36935
+ class: "sub-table-form-item",
36936
+ "label-width": "0"
36937
+ }, {
36938
+ default: withCtx(() => [
36939
+ createElementVNode("div", {
36940
+ class: normalizeClass(["sub-table-container", $options.customClass])
36941
+ }, [
36942
+ $props.widget.options.label ? (openBlock(), createElementBlock("div", _hoisted_1$f, [
36943
+ createElementVNode("span", {
36944
+ class: normalizeClass($options.labelClass)
36945
+ }, toDisplayString($props.widget.options.label), 3),
36946
+ $props.widget.options.required ? (openBlock(), createElementBlock("span", _hoisted_2$c, "*")) : createCommentVNode("", true)
36947
+ ])) : createCommentVNode("", true),
36948
+ createElementVNode("div", _hoisted_3$9, [
36949
+ !$props.widget.options.disabled ? (openBlock(), createBlock(_component_el_button, {
36950
+ key: 0,
36950
36951
  type: "primary",
36951
- onClick: $options.handleDialogConfirm
36952
+ size: "small",
36953
+ disabled: $props.widget.options.disabled,
36954
+ onClick: $options.handleAddRow,
36955
+ icon: "el-icon-plus"
36952
36956
  }, {
36953
- default: withCtx(() => [..._cache[7] || (_cache[7] = [
36954
- createTextVNode("\u786E\u5B9A", -1)
36957
+ default: withCtx(() => [..._cache[2] || (_cache[2] = [
36958
+ createTextVNode(" \u65B0\u589E ", -1)
36955
36959
  ])]),
36956
36960
  _: 1
36957
- }, 8, ["onClick"])
36958
- ])
36959
- ]),
36960
- default: withCtx(() => [
36961
- createVNode(_component_el_form, {
36962
- ref: "dialogFormRef",
36963
- model: $data.dialogFormData,
36964
- rules: $data.dialogFormRules,
36965
- "validate-on-rule-change": false,
36966
- "label-width": "auto"
36961
+ }, 8, ["disabled", "onClick"])) : createCommentVNode("", true)
36962
+ ]),
36963
+ createVNode(_component_el_table, {
36964
+ data: $data.tableData,
36965
+ border: $props.widget.options.border,
36966
+ stripe: $props.widget.options.stripe,
36967
+ size: $props.widget.options.size,
36968
+ "max-height": $options.tableMaxHeight,
36969
+ style: { "width": "100%" },
36970
+ disabled: $props.widget.options.disabled
36967
36971
  }, {
36972
+ empty: withCtx(() => [..._cache[5] || (_cache[5] = [
36973
+ createElementVNode("div", { class: "empty-hint" }, [
36974
+ createElementVNode("span", null, "\u6682\u65E0\u6570\u636E")
36975
+ ], -1)
36976
+ ])]),
36968
36977
  default: withCtx(() => [
36978
+ $props.widget.options.showIndex ? (openBlock(), createBlock(_component_el_table_column, {
36979
+ key: 0,
36980
+ type: "index",
36981
+ label: "\u5E8F\u53F7",
36982
+ width: "60",
36983
+ align: "center"
36984
+ })) : createCommentVNode("", true),
36969
36985
  (openBlock(true), createElementBlock(Fragment, null, renderList($props.widget.options.columns, (col, colIdx) => {
36970
- return openBlock(), createBlock(_component_el_form_item, {
36986
+ return openBlock(), createBlock(_component_el_table_column, {
36971
36987
  key: colIdx,
36972
- label: col.label,
36973
36988
  prop: col.prop,
36974
- required: col.required
36989
+ label: col.label,
36990
+ width: col.width,
36991
+ "min-width": col.minWidth,
36992
+ align: "left",
36993
+ "show-overflow-tooltip": ""
36975
36994
  }, {
36976
- default: withCtx(() => [
36977
- !col.type || col.type === "input" ? (openBlock(), createBlock(_component_el_input, {
36978
- key: 0,
36979
- modelValue: $data.dialogFormData[col.prop],
36980
- "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
36981
- placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
36982
- disabled: $props.widget.options.disabled,
36983
- maxlength: $options.getColMaxLength(col),
36984
- "show-word-limit": !!col.showWordLimit && !!col.maxLength,
36985
- onChange: ($event) => $options.handleInputChange(col),
36986
- clearable: ""
36987
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "maxlength", "show-word-limit", "onChange"])) : col.type === "number" ? (openBlock(), createBlock(_component_el_input_number, {
36988
- key: 1,
36989
- modelValue: $data.dialogFormData[col.prop],
36990
- "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
36991
- placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
36992
- disabled: $props.widget.options.disabled,
36993
- style: { "width": "100%" },
36994
- onChange: ($event) => $options.handleInputChange(col),
36995
- clearable: ""
36996
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "date" ? (openBlock(), createBlock(_component_el_date_picker, {
36997
- key: 2,
36998
- modelValue: $data.dialogFormData[col.prop],
36999
- "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37000
- type: "date",
37001
- placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
37002
- disabled: $props.widget.options.disabled,
37003
- style: { "width": "100%" },
37004
- "value-format": "YYYY-MM-DD",
37005
- onChange: ($event) => $options.handleInputChange(col),
37006
- clearable: ""
37007
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "datetime" ? (openBlock(), createBlock(_component_el_date_picker, {
37008
- key: 3,
37009
- modelValue: $data.dialogFormData[col.prop],
37010
- "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37011
- type: "datetime",
37012
- placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
37013
- disabled: $props.widget.options.disabled,
37014
- clearable: "",
37015
- style: { "width": "100%" },
37016
- "value-format": "YYYY-MM-DD HH:mm:ss"
37017
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : col.type === "month" ? (openBlock(), createBlock(_component_el_date_picker, {
37018
- key: 4,
37019
- modelValue: $data.dialogFormData[col.prop],
37020
- "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37021
- type: "month",
37022
- placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
37023
- disabled: $props.widget.options.disabled,
37024
- style: { "width": "100%" },
37025
- "value-format": "YYYY-MM",
37026
- clearable: "",
37027
- onChange: ($event) => $options.handleInputChange(col)
37028
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "select" ? (openBlock(), createBlock(_component_el_select, {
37029
- modelValue: $data.dialogFormData[col.prop],
37030
- "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37031
- placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
37032
- disabled: $props.widget.options.disabled,
37033
- clearable: "",
37034
- style: { "width": "100%" },
37035
- ref_for: true,
37036
- ref: (el) => $options.handleSelectMounted(el, col),
37037
- onChange: ($event) => $options.handleInputChange(col),
37038
- key: `select-${col.prop}-${$data.dialogFormData._columnOptions ? Object.keys($data.dialogFormData._columnOptions).length : 0}`
36995
+ default: withCtx(({ row, $index }) => [
36996
+ createTextVNode(toDisplayString($options.getTableValue(row, col, $index)), 1)
36997
+ ]),
36998
+ _: 2
36999
+ }, 1032, ["prop", "label", "width", "min-width"]);
37000
+ }), 128)),
37001
+ $props.widget.options.showOperation && !$props.widget.options.disabled ? (openBlock(), createBlock(_component_el_table_column, {
37002
+ key: 1,
37003
+ label: "\u64CD\u4F5C",
37004
+ width: $props.widget.options.operationColumnWidth,
37005
+ align: "center",
37006
+ fixed: "right"
37007
+ }, {
37008
+ default: withCtx(({ row, $index }) => [
37009
+ createVNode(_component_el_button, {
37010
+ size: "small",
37011
+ type: "primary",
37012
+ link: "",
37013
+ disabled: $props.widget.options.disabled,
37014
+ onClick: ($event) => $options.handleEditRow($index, row)
37015
+ }, {
37016
+ default: withCtx(() => [..._cache[3] || (_cache[3] = [
37017
+ createTextVNode(" \u7F16\u8F91 ", -1)
37018
+ ])]),
37019
+ _: 1
37020
+ }, 8, ["disabled", "onClick"]),
37021
+ createVNode(_component_el_button, {
37022
+ size: "small",
37023
+ type: "danger",
37024
+ link: "",
37025
+ disabled: $props.widget.options.disabled,
37026
+ onClick: ($event) => $options.handleDeleteRow($index)
37027
+ }, {
37028
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
37029
+ createTextVNode(" \u5220\u9664 ", -1)
37030
+ ])]),
37031
+ _: 1
37032
+ }, 8, ["disabled", "onClick"])
37033
+ ]),
37034
+ _: 1
37035
+ }, 8, ["width"])) : createCommentVNode("", true)
37036
+ ]),
37037
+ _: 1
37038
+ }, 8, ["data", "border", "stripe", "size", "max-height", "disabled"]),
37039
+ createVNode(_component_el_dialog, {
37040
+ modelValue: $data.dialogVisible,
37041
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.dialogVisible = $event),
37042
+ title: $data.dialogTitle,
37043
+ width: "800px",
37044
+ "close-on-click-modal": false,
37045
+ onClose: $options.handleDialogClose,
37046
+ onOpened: $options.handleDialogOpened
37047
+ }, {
37048
+ footer: withCtx(() => [
37049
+ createElementVNode("span", _hoisted_4$8, [
37050
+ createVNode(_component_el_button, {
37051
+ size: "default",
37052
+ onClick: _cache[0] || (_cache[0] = ($event) => $data.dialogVisible = false)
37053
+ }, {
37054
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [
37055
+ createTextVNode("\u53D6\u6D88", -1)
37056
+ ])]),
37057
+ _: 1
37058
+ }),
37059
+ createVNode(_component_el_button, {
37060
+ size: "default",
37061
+ type: "primary",
37062
+ onClick: $options.handleDialogConfirm
37063
+ }, {
37064
+ default: withCtx(() => [..._cache[7] || (_cache[7] = [
37065
+ createTextVNode("\u786E\u5B9A", -1)
37066
+ ])]),
37067
+ _: 1
37068
+ }, 8, ["onClick"])
37069
+ ])
37070
+ ]),
37071
+ default: withCtx(() => [
37072
+ createVNode(_component_el_form, {
37073
+ ref: "dialogFormRef",
37074
+ model: $data.dialogFormData,
37075
+ rules: $data.dialogFormRules,
37076
+ "validate-on-rule-change": false,
37077
+ "label-width": "auto"
37078
+ }, {
37079
+ default: withCtx(() => [
37080
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.widget.options.columns, (col, colIdx) => {
37081
+ return openBlock(), createBlock(_component_el_form_item, {
37082
+ key: colIdx,
37083
+ label: col.label,
37084
+ prop: col.prop,
37085
+ required: col.required
37039
37086
  }, {
37040
37087
  default: withCtx(() => [
37041
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.getColumnOptions(col), (option, optIdx) => {
37042
- return openBlock(), createBlock(_component_el_option, {
37043
- key: `${col.prop}-${optIdx}-${option.value}`,
37044
- label: option.label,
37045
- value: option.value
37046
- }, null, 8, ["label", "value"]);
37047
- }), 128))
37088
+ !col.type || col.type === "input" ? (openBlock(), createBlock(_component_el_input, {
37089
+ key: 0,
37090
+ modelValue: $data.dialogFormData[col.prop],
37091
+ "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37092
+ placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
37093
+ disabled: !col.editable,
37094
+ maxlength: $options.getColMaxLength(col),
37095
+ "show-word-limit": !!col.showWordLimit && !!col.maxLength,
37096
+ onChange: ($event) => $options.handleInputChange(col),
37097
+ clearable: ""
37098
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "maxlength", "show-word-limit", "onChange"])) : col.type === "number" ? (openBlock(), createBlock(_component_el_input_number, {
37099
+ key: 1,
37100
+ modelValue: $data.dialogFormData[col.prop],
37101
+ "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37102
+ placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
37103
+ disabled: !col.editable,
37104
+ style: { "width": "100%" },
37105
+ onChange: ($event) => $options.handleInputChange(col),
37106
+ clearable: ""
37107
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "date" ? (openBlock(), createBlock(_component_el_date_picker, {
37108
+ key: 2,
37109
+ modelValue: $data.dialogFormData[col.prop],
37110
+ "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37111
+ type: "date",
37112
+ placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
37113
+ style: { "width": "100%" },
37114
+ "value-format": "YYYY-MM-DD",
37115
+ onChange: ($event) => $options.handleInputChange(col),
37116
+ clearable: "",
37117
+ disabled: !col.editable
37118
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange", "disabled"])) : col.type === "datetime" ? (openBlock(), createBlock(_component_el_date_picker, {
37119
+ key: 3,
37120
+ modelValue: $data.dialogFormData[col.prop],
37121
+ "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37122
+ type: "datetime",
37123
+ placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
37124
+ clearable: "",
37125
+ style: { "width": "100%" },
37126
+ "value-format": "YYYY-MM-DD HH:mm:ss",
37127
+ disabled: !col.editable
37128
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : col.type === "month" ? (openBlock(), createBlock(_component_el_date_picker, {
37129
+ key: 4,
37130
+ modelValue: $data.dialogFormData[col.prop],
37131
+ "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37132
+ type: "month",
37133
+ placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
37134
+ style: { "width": "100%" },
37135
+ "value-format": "YYYY-MM",
37136
+ clearable: "",
37137
+ onChange: ($event) => $options.handleInputChange(col),
37138
+ disabled: !col.editable
37139
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange", "disabled"])) : col.type === "select" ? (openBlock(), createBlock(_component_el_select, {
37140
+ modelValue: $data.dialogFormData[col.prop],
37141
+ "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37142
+ placeholder: col.placeholder || `\u8BF7\u9009\u62E9${col.label}`,
37143
+ clearable: "",
37144
+ style: { "width": "100%" },
37145
+ ref_for: true,
37146
+ ref: (el) => $options.handleSelectMounted(el, col),
37147
+ onChange: ($event) => $options.handleInputChange(col),
37148
+ key: `select-${col.prop}-${$data.dialogFormData._columnOptions ? Object.keys($data.dialogFormData._columnOptions).length : 0}`,
37149
+ disabled: !col.editable
37150
+ }, {
37151
+ default: withCtx(() => [
37152
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.getColumnOptions(col), (option, optIdx) => {
37153
+ return openBlock(), createBlock(_component_el_option, {
37154
+ key: `${col.prop}-${optIdx}-${option.value}`,
37155
+ label: option.label,
37156
+ value: option.value
37157
+ }, null, 8, ["label", "value"]);
37158
+ }), 128))
37159
+ ]),
37160
+ _: 2
37161
+ }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "onChange", "disabled"])) : col.type === "textarea" ? (openBlock(), createBlock(_component_el_textarea, {
37162
+ key: 6,
37163
+ modelValue: $data.dialogFormData[col.prop],
37164
+ "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37165
+ placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
37166
+ rows: col.rows || 3,
37167
+ maxlength: $options.getColMaxLength(col),
37168
+ "show-word-limit": !!col.showWordLimit && !!col.maxLength,
37169
+ clearable: "",
37170
+ onChange: ($event) => $options.handleInputChange(col),
37171
+ disabled: !col.editable
37172
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "rows", "maxlength", "show-word-limit", "onChange", "disabled"])) : createCommentVNode("", true)
37048
37173
  ]),
37049
37174
  _: 2
37050
- }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "onChange"])) : col.type === "textarea" ? (openBlock(), createBlock(_component_el_textarea, {
37051
- key: 6,
37052
- modelValue: $data.dialogFormData[col.prop],
37053
- "onUpdate:modelValue": ($event) => $data.dialogFormData[col.prop] = $event,
37054
- placeholder: col.placeholder || `\u8BF7\u8F93\u5165${col.label}`,
37055
- disabled: $props.widget.options.disabled,
37056
- rows: col.rows || 3,
37057
- maxlength: $options.getColMaxLength(col),
37058
- "show-word-limit": !!col.showWordLimit && !!col.maxLength,
37059
- clearable: "",
37060
- onChange: ($event) => $options.handleInputChange(col)
37061
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled", "rows", "maxlength", "show-word-limit", "onChange"])) : createCommentVNode("", true)
37062
- ]),
37063
- _: 2
37064
- }, 1032, ["label", "prop", "required"]);
37065
- }), 128))
37175
+ }, 1032, ["label", "prop", "required"]);
37176
+ }), 128))
37177
+ ]),
37178
+ _: 1
37179
+ }, 8, ["model", "rules"])
37066
37180
  ]),
37067
37181
  _: 1
37068
- }, 8, ["model", "rules"])
37069
- ]),
37070
- _: 1
37071
- }, 8, ["modelValue", "title", "onClose", "onOpened"])
37072
- ], 2)), [
37182
+ }, 8, ["modelValue", "title", "onClose", "onOpened"])
37183
+ ], 2)
37184
+ ]),
37185
+ _: 1
37186
+ }, 8, ["prop", "rules"])), [
37073
37187
  [vShow, $props.widget && $props.widget.options && !$props.widget.options.hidden]
37074
37188
  ]) : createCommentVNode("", true)
37075
37189
  ]),
37076
37190
  _: 1
37077
37191
  }, 8, ["widget"]);
37078
37192
  }
37079
- var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-758078c3"]]);
37193
+ var SubTableItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-6f23dc7e"]]);
37080
37194
  var ace$2 = { exports: {} };
37081
37195
  (function(module, exports) {
37082
37196
  (function() {