@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.
- package/dist/tmagic-form.mjs +267 -204
- package/dist/tmagic-form.mjs.map +1 -1
- package/dist/tmagic-form.umd.js +266 -203
- package/dist/tmagic-form.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/FormDialog.vue +53 -48
- package/src/schema.ts +1 -1
- package/types/FormDialog.vue.d.ts +6 -0
- package/types/fields/Link.vue.d.ts +9 -0
- package/types/schema.d.ts +1 -1
package/dist/tmagic-form.mjs
CHANGED
|
@@ -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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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$
|
|
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$
|
|
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$
|
|
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(
|
|
496
|
-
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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(
|
|
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(
|
|
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(
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
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(
|
|
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(
|
|
2371
|
-
|
|
2372
|
-
|
|
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
|
-
|
|
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(
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
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(
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
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(
|
|
2546
|
-
|
|
2547
|
-
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
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(
|
|
3083
|
-
|
|
3084
|
-
|
|
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(
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
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 = {
|
|
3716
|
-
const _hoisted_2 =
|
|
3717
|
-
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\
|
|
3718
|
-
const _hoisted_4 = /* @__PURE__ */ createTextVNode("\
|
|
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(),
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
])
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
])
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
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]]);
|