@tmagic/form 1.1.4 → 1.1.5

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.
@@ -1,4 +1,4 @@
1
- import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, watch, unref, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, withModifiers, provide } from 'vue';
1
+ import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, openBlock, createElementBlock, normalizeStyle, normalizeClass, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, watch, unref, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, reactive, onBeforeUnmount, vModelText, onBeforeMount, resolveDirective, createSlots, withModifiers, provide, Teleport } from 'vue';
2
2
  import { WarningFilled, CaretBottom, CaretRight, CaretTop, Delete, ArrowDown, ArrowUp, FullScreen, Grid } from '@element-plus/icons-vue';
3
3
  import { cloneDeep, isEqual } from 'lodash-es';
4
4
  import { ElMessage } from 'element-plus';
@@ -126,20 +126,24 @@ const getRules = function(mForm, rules = [], props) {
126
126
  return rules.map((item) => {
127
127
  if (typeof item.validator === "function") {
128
128
  const fnc = item.validator;
129
- item.validator = (rule, value, callback, source, options) => fnc({
130
- rule,
131
- value: props.config.names ? props.model : value,
132
- callback,
133
- source,
134
- options
135
- }, {
136
- values: mForm?.initValues || {},
137
- model: props.model,
138
- parent: mForm?.parentValues || {},
139
- formValue: mForm?.values || props.model,
140
- prop: props.prop,
141
- config: props.config
142
- }, mForm);
129
+ item.validator = (rule, value, callback, source, options) => fnc(
130
+ {
131
+ rule,
132
+ value: props.config.names ? props.model : value,
133
+ callback,
134
+ source,
135
+ options
136
+ },
137
+ {
138
+ values: mForm?.initValues || {},
139
+ model: props.model,
140
+ parent: mForm?.parentValues || {},
141
+ formValue: mForm?.values || props.model,
142
+ prop: props.prop,
143
+ config: props.config
144
+ },
145
+ mForm
146
+ );
143
147
  }
144
148
  return item;
145
149
  });
@@ -316,7 +320,7 @@ const _hoisted_1$c = ["innerHTML"];
316
320
  const _hoisted_2$7 = ["innerHTML"];
317
321
  const _hoisted_3$7 = ["innerHTML"];
318
322
  const _hoisted_4$6 = ["innerHTML"];
319
- const _hoisted_5$4 = {
323
+ const _hoisted_5$5 = {
320
324
  key: 4,
321
325
  style: { "text-align": "center" }
322
326
  };
@@ -434,7 +438,7 @@ function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
434
438
  }, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop", "onChange"]);
435
439
  }), 128)) : createCommentVNode("", true)
436
440
  ], 64)) : createCommentVNode("", true),
437
- _ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
441
+ _ctx.config.expand && _ctx.type !== "fieldset" ? (openBlock(), createElementBlock("div", _hoisted_5$5, [
438
442
  createVNode(_component_el_button, {
439
443
  text: "",
440
444
  onClick: _ctx.expandHandler
@@ -453,7 +457,7 @@ const _hoisted_1$b = ["innerHTML"];
453
457
  const _hoisted_2$6 = ["innerHTML"];
454
458
  const _hoisted_3$6 = { key: 1 };
455
459
  const _hoisted_4$5 = ["innerHTML"];
456
- const _hoisted_5$3 = ["innerHTML"];
460
+ const _hoisted_5$4 = ["innerHTML"];
457
461
  const _hoisted_6$2 = {
458
462
  key: 2,
459
463
  style: { "display": "flex" }
@@ -492,9 +496,12 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
492
496
  };
493
497
  const key = (item, index) => item[mForm?.keyProp || "__key"] ?? index;
494
498
  if (props.config.checkbox && name.value) {
495
- watch(() => props.model[name.value]?.value, () => {
496
- emit("change", props.model);
497
- });
499
+ watch(
500
+ () => props.model[name.value]?.value,
501
+ () => {
502
+ emit("change", props.model);
503
+ }
504
+ );
498
505
  }
499
506
  return (_ctx, _cache) => {
500
507
  const _component_el_checkbox = resolveComponent("el-checkbox");
@@ -535,7 +542,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
535
542
  key: 0,
536
543
  innerHTML: __props.config.extra,
537
544
  class: "m-form-tip"
538
- }, null, 8, _hoisted_5$3)) : createCommentVNode("", true)
545
+ }, null, 8, _hoisted_5$4)) : createCommentVNode("", true)
539
546
  ])),
540
547
  __props.config.schematic && unref(show) ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
541
548
  createElementVNode("div", _hoisted_7$2, [
@@ -858,7 +865,7 @@ const _hoisted_3$4 = {
858
865
  class: "el-table__empty-block"
859
866
  };
860
867
  const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("span", { class: "el-table__empty-text" }, "\u6682\u65E0\u6570\u636E", -1);
861
- const _hoisted_5$2 = [
868
+ const _hoisted_5$3 = [
862
869
  _hoisted_4$3
863
870
  ];
864
871
  const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0\u7EC4");
@@ -872,7 +879,7 @@ function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
872
879
  innerHTML: _ctx.config.extra,
873
880
  style: { "color": "rgba(0, 0, 0, 0.45)" }
874
881
  }, null, 8, _hoisted_2$4)) : createCommentVNode("", true),
875
- !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$4, _hoisted_5$2)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.model[_ctx.name], (item, index) => {
882
+ !_ctx.model[_ctx.name] || !_ctx.model[_ctx.name].length ? (openBlock(), createElementBlock("div", _hoisted_3$4, _hoisted_5$3)) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(_ctx.model[_ctx.name], (item, index) => {
876
883
  return openBlock(), createBlock(_component_m_fields_group_list_item, {
877
884
  key: index,
878
885
  model: item,
@@ -953,7 +960,7 @@ const _hoisted_3$3 = {
953
960
  style: { "display": "flex" }
954
961
  };
955
962
  const _hoisted_4$2 = { style: { "flex": "1" } };
956
- const _hoisted_5$1 = ["src"];
963
+ const _hoisted_5$2 = ["src"];
957
964
  function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
958
965
  const _component_caret_bottom = resolveComponent("caret-bottom");
959
966
  const _component_caret_right = resolveComponent("caret-right");
@@ -1007,7 +1014,7 @@ function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
1007
1014
  createElementVNode("img", {
1008
1015
  class: "m-form-schematic",
1009
1016
  src: _ctx.config.schematic
1010
- }, null, 8, _hoisted_5$1)
1017
+ }, null, 8, _hoisted_5$2)
1011
1018
  ])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.items, (item, index) => {
1012
1019
  return openBlock(), createBlock(_component_m_form_container, {
1013
1020
  key: item[_ctx.mForm?.keyProp || "__key"] ?? index,
@@ -1276,7 +1283,11 @@ const _sfc_main$m = defineComponent({
1276
1283
  setTimeout(() => rowDrop());
1277
1284
  };
1278
1285
  const swapArray = (index1, index2) => {
1279
- [props.model[modelName.value][index1]] = props.model[modelName.value].splice(index2, 1, props.model[modelName.value][index1]);
1286
+ [props.model[modelName.value][index1]] = props.model[modelName.value].splice(
1287
+ index2,
1288
+ 1,
1289
+ props.model[modelName.value][index1]
1290
+ );
1280
1291
  if (props.sortKey) {
1281
1292
  for (let i = props.model[modelName.value].length - 1, v = 0; i >= 0; i--, v++) {
1282
1293
  props.model[modelName.value][v][props.sortKey] = i;
@@ -1398,7 +1409,11 @@ const _sfc_main$m = defineComponent({
1398
1409
  Delete,
1399
1410
  FullScreen,
1400
1411
  Grid,
1401
- data: computed(() => props.model[modelName.value].filter((item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value)),
1412
+ data: computed(
1413
+ () => props.model[modelName.value].filter(
1414
+ (item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value
1415
+ )
1416
+ ),
1402
1417
  addable: computed(() => {
1403
1418
  if (!props.model[modelName.value].length) {
1404
1419
  return true;
@@ -1586,7 +1601,7 @@ const _hoisted_1$7 = ["innerHTML"];
1586
1601
  const _hoisted_2$2 = { class: "el-form-item__content" };
1587
1602
  const _hoisted_3$2 = ["innerHTML"];
1588
1603
  const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("\u6DFB\u52A0");
1589
- const _hoisted_5 = /* @__PURE__ */ createTextVNode(" \xA0 ");
1604
+ const _hoisted_5$1 = /* @__PURE__ */ createTextVNode(" \xA0 ");
1590
1605
  const _hoisted_6 = /* @__PURE__ */ createTextVNode("\u5C55\u5F00\u914D\u7F6E");
1591
1606
  const _hoisted_7 = /* @__PURE__ */ createTextVNode("\u5BFC\u5165EXCEL");
1592
1607
  const _hoisted_8 = /* @__PURE__ */ createTextVNode("\xA0 ");
@@ -1769,7 +1784,7 @@ function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
1769
1784
  ]),
1770
1785
  _: 1
1771
1786
  })) : createCommentVNode("", true),
1772
- _hoisted_5,
1787
+ _hoisted_5$1,
1773
1788
  _ctx.enableToggleMode && !_ctx.isFullscreen ? (openBlock(), createBlock(_component_el_button, {
1774
1789
  key: 1,
1775
1790
  icon: _ctx.Grid,
@@ -2043,15 +2058,19 @@ const useAddField = (prop) => {
2043
2058
  return;
2044
2059
  const mForm = inject("mForm");
2045
2060
  const instance = getCurrentInstance();
2046
- watch(() => instance?.proxy, (vm) => {
2047
- if (vm) {
2048
- mForm?.setField(prop, vm);
2049
- } else {
2050
- mForm?.deleteField(prop);
2061
+ watch(
2062
+ () => instance?.proxy,
2063
+ (vm) => {
2064
+ if (vm) {
2065
+ mForm?.setField(prop, vm);
2066
+ } else {
2067
+ mForm?.deleteField(prop);
2068
+ }
2069
+ },
2070
+ {
2071
+ immediate: true
2051
2072
  }
2052
- }, {
2053
- immediate: true
2054
- });
2073
+ );
2055
2074
  };
2056
2075
 
2057
2076
  const _sfc_main$l = defineComponent({
@@ -2103,7 +2122,9 @@ const _sfc_main$l = defineComponent({
2103
2122
  }
2104
2123
  };
2105
2124
  if (typeof props.config.options === "function" && props.model && mForm) {
2106
- watchEffect(() => options.value = props.config.options(vm, { model: props.model, formValues: mForm.values }));
2125
+ watchEffect(
2126
+ () => options.value = props.config.options(vm, { model: props.model, formValues: mForm.values })
2127
+ );
2107
2128
  } else if (!props.config.options || !props.config.options.length || props.config.remote) {
2108
2129
  Promise.resolve(setRemoteOptions());
2109
2130
  }
@@ -2367,26 +2388,34 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2367
2388
  const value = ref([]);
2368
2389
  if (props.model !== void 0) {
2369
2390
  if (names?.length) {
2370
- watch([() => props.model[names[0]], () => props.model[names[1]]], ([start, end], [preStart, preEnd]) => {
2371
- if (!value.value) {
2372
- value.value = [];
2391
+ watch(
2392
+ [() => props.model[names[0]], () => props.model[names[1]]],
2393
+ ([start, end], [preStart, preEnd]) => {
2394
+ if (!value.value) {
2395
+ value.value = [];
2396
+ }
2397
+ if (!start || !end)
2398
+ value.value = [];
2399
+ if (start !== preStart)
2400
+ value.value[0] = new Date(start);
2401
+ if (end !== preEnd)
2402
+ value.value[1] = new Date(end);
2403
+ },
2404
+ {
2405
+ immediate: true
2373
2406
  }
2374
- if (!start || !end)
2375
- value.value = [];
2376
- if (start !== preStart)
2377
- value.value[0] = new Date(start);
2378
- if (end !== preEnd)
2379
- value.value[1] = new Date(end);
2380
- }, {
2381
- immediate: true
2382
- });
2407
+ );
2383
2408
  } else if (props.name && props.model[props.name]) {
2384
- watch(() => props.model[props.name], (start, preStart) => {
2385
- if (start !== preStart)
2386
- value.value = start.map((item) => item ? new Date(item) : void 0);
2387
- }, {
2388
- immediate: true
2389
- });
2409
+ watch(
2410
+ () => props.model[props.name],
2411
+ (start, preStart) => {
2412
+ if (start !== preStart)
2413
+ value.value = start.map((item) => item ? new Date(item) : void 0);
2414
+ },
2415
+ {
2416
+ immediate: true
2417
+ }
2418
+ );
2390
2419
  }
2391
2420
  }
2392
2421
  const setValue = (v) => {
@@ -2404,11 +2433,14 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
2404
2433
  const changeHandler = (v) => {
2405
2434
  const value2 = v || [];
2406
2435
  if (props.name) {
2407
- emit("change", value2.map((item) => {
2408
- if (item)
2409
- return datetimeFormatter(item, "");
2410
- return void 0;
2411
- }));
2436
+ emit(
2437
+ "change",
2438
+ value2.map((item) => {
2439
+ if (item)
2440
+ return datetimeFormatter(item, "");
2441
+ return void 0;
2442
+ })
2443
+ );
2412
2444
  } else {
2413
2445
  if (names?.length) {
2414
2446
  setValue(value2);
@@ -2542,13 +2574,17 @@ const _sfc_main$d = defineComponent({
2542
2574
  fieldLabelMap.value[v.name] = v.label || "";
2543
2575
  });
2544
2576
  };
2545
- const unwatch = watch(() => props.model?.[props.config.dynamicKey], (val) => {
2546
- if (val !== "") {
2547
- changeFieldMap();
2577
+ const unwatch = watch(
2578
+ () => props.model?.[props.config.dynamicKey],
2579
+ (val) => {
2580
+ if (val !== "") {
2581
+ changeFieldMap();
2582
+ }
2583
+ },
2584
+ {
2585
+ immediate: true
2548
2586
  }
2549
- }, {
2550
- immediate: true
2551
- });
2587
+ );
2552
2588
  onBeforeUnmount(() => {
2553
2589
  if (typeof unwatch === "function") {
2554
2590
  unwatch();
@@ -3013,12 +3049,18 @@ const _sfc_main$6 = defineComponent({
3013
3049
  remote.value = false;
3014
3050
  if (config.group) {
3015
3051
  if (config.multiple && value.findIndex) {
3016
- return localOptions.value.filter((group) => group.options.findIndex((item) => value.find((v) => equalValue(item.value, v)) > -1) > -1);
3052
+ return localOptions.value.filter(
3053
+ (group) => group.options.findIndex((item) => value.find((v) => equalValue(item.value, v)) > -1) > -1
3054
+ );
3017
3055
  }
3018
- return localOptions.value.filter((group) => group.options.findIndex((item) => equalValue(item.value, value)) > -1);
3056
+ return localOptions.value.filter(
3057
+ (group) => group.options.findIndex((item) => equalValue(item.value, value)) > -1
3058
+ );
3019
3059
  }
3020
3060
  if (config.multiple && value.findIndex) {
3021
- return localOptions.value.filter((item) => value.findIndex((v) => equalValue(item.value, v)) > -1);
3061
+ return localOptions.value.filter(
3062
+ (item) => value.findIndex((v) => equalValue(item.value, v)) > -1
3063
+ );
3022
3064
  }
3023
3065
  return localOptions.value.filter((item) => equalValue(item.value, value));
3024
3066
  };
@@ -3064,24 +3106,34 @@ const _sfc_main$6 = defineComponent({
3064
3106
  return options2;
3065
3107
  };
3066
3108
  if (typeof props.config.options === "function") {
3067
- watch(() => mForm?.values, () => {
3068
- typeof props.config.options === "function" && Promise.resolve(props.config.options(mForm, {
3069
- model: props.model,
3070
- prop: props.prop,
3071
- formValues: mForm?.values,
3072
- formValue: mForm?.values,
3073
- config: props.config
3074
- })).then((data) => {
3075
- options.value = data;
3076
- });
3077
- }, {
3078
- deep: true,
3079
- immediate: true
3080
- });
3109
+ watch(
3110
+ () => mForm?.values,
3111
+ () => {
3112
+ typeof props.config.options === "function" && Promise.resolve(
3113
+ props.config.options(mForm, {
3114
+ model: props.model,
3115
+ prop: props.prop,
3116
+ formValues: mForm?.values,
3117
+ formValue: mForm?.values,
3118
+ config: props.config
3119
+ })
3120
+ ).then((data) => {
3121
+ options.value = data;
3122
+ });
3123
+ },
3124
+ {
3125
+ deep: true,
3126
+ immediate: true
3127
+ }
3128
+ );
3081
3129
  } else if (Array.isArray(props.config.options)) {
3082
- watch(() => props.config.options, () => {
3083
- options.value = props.config.options;
3084
- }, { immediate: true });
3130
+ watch(
3131
+ () => props.config.options,
3132
+ () => {
3133
+ options.value = props.config.options;
3134
+ },
3135
+ { immediate: true }
3136
+ );
3085
3137
  } else if (props.config.option) {
3086
3138
  onBeforeMount(() => {
3087
3139
  if (!props.model)
@@ -3548,18 +3600,22 @@ const _sfc_main$1 = defineComponent({
3548
3600
  }
3549
3601
  });
3550
3602
  provide("mForm", formState);
3551
- watch([() => props.config, () => props.initValues], ([config], [preConfig]) => {
3552
- if (!isEqual(toRaw(config), toRaw(preConfig))) {
3553
- initialized.value = false;
3554
- }
3555
- initValue(formState, {
3556
- initValues: props.initValues,
3557
- config: props.config
3558
- }).then((value) => {
3559
- values.value = value;
3560
- initialized.value = true;
3561
- });
3562
- }, { immediate: true });
3603
+ watch(
3604
+ [() => props.config, () => props.initValues],
3605
+ ([config], [preConfig]) => {
3606
+ if (!isEqual(toRaw(config), toRaw(preConfig))) {
3607
+ initialized.value = false;
3608
+ }
3609
+ initValue(formState, {
3610
+ initValues: props.initValues,
3611
+ config: props.config
3612
+ }).then((value) => {
3613
+ values.value = value;
3614
+ initialized.value = true;
3615
+ });
3616
+ },
3617
+ { immediate: true }
3618
+ );
3563
3619
  return {
3564
3620
  initialized,
3565
3621
  values,
@@ -3630,6 +3686,9 @@ const _sfc_main = defineComponent({
3630
3686
  type: Object,
3631
3687
  default: () => ({})
3632
3688
  },
3689
+ parentValues: {
3690
+ type: Object
3691
+ },
3633
3692
  width: [Number, String],
3634
3693
  fullscreen: Boolean,
3635
3694
  title: String,
@@ -3712,116 +3771,120 @@ const _sfc_main = defineComponent({
3712
3771
  }
3713
3772
  });
3714
3773
 
3715
- const _hoisted_1 = { style: { "min-height": "1px" } };
3716
- const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u53D6 \u6D88");
3717
- const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u4E0A\u4E00\u6B65");
3718
- const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u4E0B\u4E00\u6B65");
3774
+ const _hoisted_1 = { class: "m-form-dialog" };
3775
+ const _hoisted_2 = { style: { "min-height": "1px" } };
3776
+ const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u53D6 \u6D88");
3777
+ const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u4E0A\u4E00\u6B65");
3778
+ const _hoisted_5 = /* @__PURE__ */ createTextVNode("\u4E0B\u4E00\u6B65");
3719
3779
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
3720
3780
  const _component_m_form = resolveComponent("m-form");
3721
3781
  const _component_el_col = resolveComponent("el-col");
3722
3782
  const _component_el_button = resolveComponent("el-button");
3723
3783
  const _component_el_row = resolveComponent("el-row");
3724
3784
  const _component_el_dialog = resolveComponent("el-dialog");
3725
- return openBlock(), createElementBlock("div", null, [
3726
- createVNode(_component_el_dialog, {
3727
- modelValue: _ctx.dialogVisible,
3728
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.dialogVisible = $event),
3729
- class: "m-form-dialog",
3730
- top: "20px",
3731
- title: _ctx.title,
3732
- appendToBody: true,
3733
- width: _ctx.width,
3734
- fullscreen: _ctx.fullscreen,
3735
- "close-on-click-modal": false,
3736
- onClose: _ctx.closeHandler
3737
- }, {
3738
- footer: withCtx(() => [
3739
- createVNode(_component_el_row, { class: "dialog-footer" }, {
3740
- default: withCtx(() => [
3741
- createVNode(_component_el_col, {
3742
- span: 12,
3743
- style: { "text-align": "left" }
3744
- }, {
3745
- default: withCtx(() => [
3746
- createElementVNode("div", _hoisted_1, [
3747
- renderSlot(_ctx.$slots, "left")
3748
- ])
3749
- ]),
3750
- _: 3
3751
- }),
3752
- createVNode(_component_el_col, { span: 12 }, {
3753
- default: withCtx(() => [
3754
- renderSlot(_ctx.$slots, "footer", {}, () => [
3755
- createVNode(_component_el_button, {
3756
- onClick: _ctx.cancel,
3757
- size: "small"
3758
- }, {
3759
- default: withCtx(() => [
3760
- _hoisted_2
3761
- ]),
3762
- _: 1
3763
- }, 8, ["onClick"]),
3764
- _ctx.hasStep && _ctx.stepActive > 1 ? (openBlock(), createBlock(_component_el_button, {
3765
- key: 0,
3766
- type: "info",
3767
- size: "small",
3768
- onClick: _ctx.preStep
3769
- }, {
3770
- default: withCtx(() => [
3771
- _hoisted_3
3772
- ]),
3773
- _: 1
3774
- }, 8, ["onClick"])) : createCommentVNode("", true),
3775
- _ctx.hasStep && _ctx.stepCount > _ctx.stepActive ? (openBlock(), createBlock(_component_el_button, {
3776
- key: 1,
3777
- type: "info",
3778
- size: "small",
3779
- onClick: _ctx.nextStep
3780
- }, {
3781
- default: withCtx(() => [
3782
- _hoisted_4
3783
- ]),
3784
- _: 1
3785
- }, 8, ["onClick"])) : (openBlock(), createBlock(_component_el_button, {
3786
- key: 2,
3787
- type: "primary",
3788
- size: "small",
3789
- loading: _ctx.saveFetch,
3790
- onClick: _ctx.save
3791
- }, {
3792
- default: withCtx(() => [
3793
- createTextVNode(toDisplayString(_ctx.confirmText), 1)
3794
- ]),
3795
- _: 1
3796
- }, 8, ["loading", "onClick"]))
3797
- ])
3798
- ]),
3799
- _: 3
3800
- })
3801
- ]),
3802
- _: 3
3803
- })
3804
- ]),
3805
- default: withCtx(() => [
3806
- createElementVNode("div", {
3807
- class: "m-dialog-body",
3808
- style: normalizeStyle(`max-height: ${_ctx.bodyHeight}; overflow-y: auto; overflow-x: hidden;`)
3809
- }, [
3810
- createVNode(_component_m_form, {
3811
- modelValue: _ctx.stepActive,
3812
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.stepActive = $event),
3813
- ref: "form",
3814
- size: _ctx.size,
3815
- config: _ctx.config,
3816
- "init-values": _ctx.values,
3817
- "label-width": _ctx.labelWidth,
3818
- onChange: _ctx.changeHandler
3819
- }, null, 8, ["modelValue", "size", "config", "init-values", "label-width", "onChange"]),
3820
- renderSlot(_ctx.$slots, "default")
3821
- ], 4)
3822
- ]),
3823
- _: 3
3824
- }, 8, ["modelValue", "title", "width", "fullscreen", "onClose"])
3785
+ return openBlock(), createBlock(Teleport, { to: "body" }, [
3786
+ withDirectives(createElementVNode("div", _hoisted_1, [
3787
+ createVNode(_component_el_dialog, {
3788
+ modelValue: _ctx.dialogVisible,
3789
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.dialogVisible = $event),
3790
+ top: "20px",
3791
+ title: _ctx.title,
3792
+ width: _ctx.width,
3793
+ fullscreen: _ctx.fullscreen,
3794
+ "close-on-click-modal": false,
3795
+ onClose: _ctx.closeHandler
3796
+ }, {
3797
+ footer: withCtx(() => [
3798
+ createVNode(_component_el_row, { class: "dialog-footer" }, {
3799
+ default: withCtx(() => [
3800
+ createVNode(_component_el_col, {
3801
+ span: 12,
3802
+ style: { "text-align": "left" }
3803
+ }, {
3804
+ default: withCtx(() => [
3805
+ createElementVNode("div", _hoisted_2, [
3806
+ renderSlot(_ctx.$slots, "left")
3807
+ ])
3808
+ ]),
3809
+ _: 3
3810
+ }),
3811
+ createVNode(_component_el_col, { span: 12 }, {
3812
+ default: withCtx(() => [
3813
+ renderSlot(_ctx.$slots, "footer", {}, () => [
3814
+ createVNode(_component_el_button, {
3815
+ onClick: _ctx.cancel,
3816
+ size: "small"
3817
+ }, {
3818
+ default: withCtx(() => [
3819
+ _hoisted_3
3820
+ ]),
3821
+ _: 1
3822
+ }, 8, ["onClick"]),
3823
+ _ctx.hasStep && _ctx.stepActive > 1 ? (openBlock(), createBlock(_component_el_button, {
3824
+ key: 0,
3825
+ type: "info",
3826
+ size: "small",
3827
+ onClick: _ctx.preStep
3828
+ }, {
3829
+ default: withCtx(() => [
3830
+ _hoisted_4
3831
+ ]),
3832
+ _: 1
3833
+ }, 8, ["onClick"])) : createCommentVNode("", true),
3834
+ _ctx.hasStep && _ctx.stepCount > _ctx.stepActive ? (openBlock(), createBlock(_component_el_button, {
3835
+ key: 1,
3836
+ type: "info",
3837
+ size: "small",
3838
+ onClick: _ctx.nextStep
3839
+ }, {
3840
+ default: withCtx(() => [
3841
+ _hoisted_5
3842
+ ]),
3843
+ _: 1
3844
+ }, 8, ["onClick"])) : (openBlock(), createBlock(_component_el_button, {
3845
+ key: 2,
3846
+ type: "primary",
3847
+ size: "small",
3848
+ loading: _ctx.saveFetch,
3849
+ onClick: _ctx.save
3850
+ }, {
3851
+ default: withCtx(() => [
3852
+ createTextVNode(toDisplayString(_ctx.confirmText), 1)
3853
+ ]),
3854
+ _: 1
3855
+ }, 8, ["loading", "onClick"]))
3856
+ ])
3857
+ ]),
3858
+ _: 3
3859
+ })
3860
+ ]),
3861
+ _: 3
3862
+ })
3863
+ ]),
3864
+ default: withCtx(() => [
3865
+ createElementVNode("div", {
3866
+ class: "m-dialog-body",
3867
+ style: normalizeStyle(`max-height: ${_ctx.bodyHeight}; overflow-y: auto; overflow-x: hidden;`)
3868
+ }, [
3869
+ createVNode(_component_m_form, {
3870
+ modelValue: _ctx.stepActive,
3871
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.stepActive = $event),
3872
+ ref: "form",
3873
+ size: _ctx.size,
3874
+ config: _ctx.config,
3875
+ "init-values": _ctx.values,
3876
+ "parent-values": _ctx.parentValues,
3877
+ "label-width": _ctx.labelWidth,
3878
+ onChange: _ctx.changeHandler
3879
+ }, null, 8, ["modelValue", "size", "config", "init-values", "parent-values", "label-width", "onChange"]),
3880
+ renderSlot(_ctx.$slots, "default")
3881
+ ], 4)
3882
+ ]),
3883
+ _: 3
3884
+ }, 8, ["modelValue", "title", "width", "fullscreen", "onClose"])
3885
+ ], 512), [
3886
+ [vShow, _ctx.dialogVisible]
3887
+ ])
3825
3888
  ]);
3826
3889
  }
3827
3890
  const FormDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);