@tmagic/form 1.2.0-beta.8 → 1.2.0
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/style.css +1 -1
- package/dist/{tmagic-form.mjs → tmagic-form.js} +322 -126
- package/dist/tmagic-form.js.map +1 -0
- package/dist/{tmagic-form.umd.js → tmagic-form.umd.cjs} +321 -124
- package/dist/tmagic-form.umd.cjs.map +1 -0
- package/package.json +10 -8
- package/src/Form.vue +11 -3
- package/src/FormDialog.vue +3 -1
- package/src/containers/Col.vue +3 -1
- package/src/containers/Container.vue +12 -6
- package/src/containers/Fieldset.vue +4 -1
- package/src/containers/GroupList.vue +4 -2
- package/src/containers/GroupListItem.vue +8 -5
- package/src/containers/Panel.vue +4 -1
- package/src/containers/Row.vue +3 -1
- package/src/containers/Step.vue +3 -1
- package/src/containers/Table.vue +44 -18
- package/src/containers/Tabs.vue +9 -4
- package/src/fields/Cascader.vue +2 -2
- package/src/fields/Checkbox.vue +2 -2
- package/src/fields/CheckboxGroup.vue +8 -3
- package/src/fields/ColorPicker.vue +2 -2
- package/src/fields/Date.vue +3 -3
- package/src/fields/DateTime.vue +2 -2
- package/src/fields/Daterange.vue +2 -2
- package/src/fields/Display.vue +1 -1
- package/src/fields/DynamicField.vue +2 -2
- package/src/fields/Hidden.vue +1 -1
- package/src/fields/Link.vue +2 -2
- package/src/fields/Number.vue +2 -2
- package/src/fields/RadioGroup.vue +9 -5
- package/src/fields/Select.vue +63 -24
- package/src/fields/SelectOptionGroups.vue +1 -1
- package/src/fields/SelectOptions.vue +1 -1
- package/src/fields/Switch.vue +2 -2
- package/src/fields/Text.vue +2 -2
- package/src/fields/Textarea.vue +2 -2
- package/src/fields/Time.vue +4 -2
- package/src/schema.ts +18 -4
- package/src/theme/form.scss +1 -1
- package/src/utils/form.ts +9 -5
- package/types/Form.vue.d.ts +32 -170
- package/types/FormDialog.vue.d.ts +4 -0
- package/types/containers/Col.vue.d.ts +12 -74
- package/types/containers/Container.vue.d.ts +17 -95
- package/types/containers/Fieldset.vue.d.ts +15 -87
- package/types/containers/GroupList.vue.d.ts +11 -71
- package/types/containers/GroupListItem.vue.d.ts +12 -80
- package/types/containers/Panel.vue.d.ts +4 -0
- package/types/containers/Row.vue.d.ts +12 -74
- package/types/containers/Step.vue.d.ts +13 -79
- package/types/containers/Table.vue.d.ts +4 -0
- package/types/containers/Tabs.vue.d.ts +12 -74
- package/types/fields/Cascader.vue.d.ts +12 -78
- package/types/fields/Checkbox.vue.d.ts +12 -78
- package/types/fields/CheckboxGroup.vue.d.ts +12 -78
- package/types/fields/ColorPicker.vue.d.ts +12 -78
- package/types/fields/Date.vue.d.ts +12 -78
- package/types/fields/DateTime.vue.d.ts +12 -78
- package/types/fields/Daterange.vue.d.ts +12 -78
- package/types/fields/Display.vue.d.ts +9 -65
- package/types/fields/DynamicField.vue.d.ts +12 -78
- package/types/fields/Hidden.vue.d.ts +9 -65
- package/types/fields/Link.vue.d.ts +12 -78
- package/types/fields/Number.vue.d.ts +12 -81
- package/types/fields/RadioGroup.vue.d.ts +12 -78
- package/types/fields/Select.vue.d.ts +12 -79
- package/types/fields/SelectOptionGroups.vue.d.ts +4 -50
- package/types/fields/SelectOptions.vue.d.ts +5 -53
- package/types/fields/Switch.vue.d.ts +12 -78
- package/types/fields/Text.vue.d.ts +12 -81
- package/types/fields/Textarea.vue.d.ts +12 -81
- package/types/fields/Time.vue.d.ts +12 -78
- package/types/schema.d.ts +17 -4
- package/types/utils/form.d.ts +2 -1
- package/dist/tmagic-form.mjs.map +0 -1
- package/dist/tmagic-form.umd.js.map +0 -1
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
const isMultipleValue = (type) => typeof type === "string" && ["checkbox-group", "checkboxGroup", "table", "cascader", "group-list", "groupList"].includes(type);
|
|
21
21
|
const initItemsValue = (mForm, value, initValue2, { items, name, extensible }) => {
|
|
22
22
|
if (Array.isArray(initValue2[name])) {
|
|
23
|
-
value[name] = initValue2[name].map((v, index) =>
|
|
23
|
+
value[name] = initValue2[name].map((v, index) => createValues(mForm, items, v, value[name]?.[index]));
|
|
24
24
|
} else {
|
|
25
|
-
value[name] =
|
|
25
|
+
value[name] = createValues(mForm, items, initValue2[name], value[name]);
|
|
26
26
|
if (extensible) {
|
|
27
27
|
value[name] = Object.assign({}, initValue2[name], value[name]);
|
|
28
28
|
}
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
return names.forEach((n) => value[n] = initValue2[n] || "");
|
|
68
68
|
}
|
|
69
69
|
if (!name) {
|
|
70
|
-
return
|
|
70
|
+
return createValues(mForm, items, initValue2, value);
|
|
71
71
|
}
|
|
72
72
|
setValue(mForm, value, initValue2, item);
|
|
73
73
|
return value;
|
|
74
74
|
};
|
|
75
|
-
const
|
|
75
|
+
const createValues = function(mForm, config = [], initValue2 = {}, value = {}) {
|
|
76
76
|
if (Array.isArray(config)) {
|
|
77
77
|
config.forEach((item) => {
|
|
78
78
|
initValueItem(mForm, item, initValue2, value);
|
|
@@ -115,6 +115,9 @@
|
|
|
115
115
|
});
|
|
116
116
|
};
|
|
117
117
|
const display = function(mForm, config, props) {
|
|
118
|
+
if (config === "expand") {
|
|
119
|
+
return config;
|
|
120
|
+
}
|
|
118
121
|
if (typeof config === "function") {
|
|
119
122
|
return filterFunction(mForm, config, props);
|
|
120
123
|
}
|
|
@@ -156,7 +159,7 @@
|
|
|
156
159
|
const initValue = async (mForm, { initValues, config }) => {
|
|
157
160
|
if (!Array.isArray(config))
|
|
158
161
|
throw new Error("config\u5E94\u8BE5\u4E3A\u6570\u7EC4");
|
|
159
|
-
let valuesTmp =
|
|
162
|
+
let valuesTmp = createValues(mForm, config, vue.toRaw(initValues), {});
|
|
160
163
|
const [firstForm] = config;
|
|
161
164
|
if (firstForm && typeof firstForm.onInitValue === "function") {
|
|
162
165
|
valuesTmp = await firstForm.onInitValue(mForm, {
|
|
@@ -175,12 +178,16 @@
|
|
|
175
178
|
key: 4,
|
|
176
179
|
style: { "text-align": "center" }
|
|
177
180
|
};
|
|
181
|
+
const __default__$v = vue.defineComponent({
|
|
182
|
+
name: "MFormContainer"
|
|
183
|
+
});
|
|
178
184
|
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
179
|
-
|
|
185
|
+
...__default__$v,
|
|
180
186
|
props: {
|
|
181
187
|
model: null,
|
|
182
188
|
config: null,
|
|
183
189
|
prop: { default: "" },
|
|
190
|
+
disabled: { type: Boolean },
|
|
184
191
|
labelWidth: null,
|
|
185
192
|
expandMore: { type: Boolean, default: false },
|
|
186
193
|
stepActive: null,
|
|
@@ -211,7 +218,7 @@
|
|
|
211
218
|
return component;
|
|
212
219
|
return "m-fields-text";
|
|
213
220
|
});
|
|
214
|
-
const disabled = vue.computed(() => filterFunction(mForm, props.config.disabled, props));
|
|
221
|
+
const disabled = vue.computed(() => props.disabled || filterFunction(mForm, props.config.disabled, props));
|
|
215
222
|
const tooltip = vue.computed(() => filterFunction(mForm, props.config.tooltip, props));
|
|
216
223
|
const extra = vue.computed(() => filterFunction(mForm, props.config.extra, props));
|
|
217
224
|
const rule = vue.computed(() => getRules(mForm, props.config.rules, props));
|
|
@@ -227,10 +234,11 @@
|
|
|
227
234
|
return type2?.replace(/([A-Z])/g, "-$1").toLowerCase() || (items.value ? "" : "text");
|
|
228
235
|
});
|
|
229
236
|
const display$1 = vue.computed(() => {
|
|
230
|
-
|
|
237
|
+
const value = display(mForm, props.config.display, props);
|
|
238
|
+
if (value === "expand") {
|
|
231
239
|
return expand.value;
|
|
232
240
|
}
|
|
233
|
-
return
|
|
241
|
+
return value;
|
|
234
242
|
});
|
|
235
243
|
const itemLabelWidth = vue.computed(() => props.config.labelWidth || props.labelWidth);
|
|
236
244
|
vue.watchEffect(() => {
|
|
@@ -307,13 +315,14 @@
|
|
|
307
315
|
size: __props.size,
|
|
308
316
|
model: __props.model,
|
|
309
317
|
config: __props.config,
|
|
318
|
+
disabled: vue.unref(disabled),
|
|
310
319
|
name: vue.unref(name),
|
|
311
320
|
prop: vue.unref(itemProp),
|
|
312
321
|
"step-active": __props.stepActive,
|
|
313
322
|
"expand-more": expand.value,
|
|
314
323
|
"label-width": vue.unref(itemLabelWidth),
|
|
315
324
|
onChange: onChangeHandler
|
|
316
|
-
}, null, 40, ["size", "model", "config", "name", "prop", "step-active", "expand-more", "label-width"])) : vue.unref(type) && vue.unref(display$1) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
325
|
+
}, null, 40, ["size", "model", "config", "disabled", "name", "prop", "step-active", "expand-more", "label-width"])) : vue.unref(type) && vue.unref(display$1) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
317
326
|
vue.createVNode(vue.unref(design.TMagicFormItem), {
|
|
318
327
|
style: vue.normalizeStyle(__props.config.tip ? "flex: 1" : ""),
|
|
319
328
|
class: vue.normalizeClass({ hidden: `${vue.unref(itemLabelWidth)}` === "0" || !__props.config.text }),
|
|
@@ -388,16 +397,20 @@
|
|
|
388
397
|
model: vue.unref(name) || vue.unref(name) === 0 ? __props.model[vue.unref(name)] : __props.model,
|
|
389
398
|
config: item,
|
|
390
399
|
size: __props.size,
|
|
400
|
+
disabled: vue.unref(disabled),
|
|
391
401
|
"step-active": __props.stepActive,
|
|
392
402
|
"expand-more": expand.value,
|
|
393
403
|
"label-width": vue.unref(itemLabelWidth),
|
|
394
404
|
prop: vue.unref(itemProp),
|
|
395
405
|
onChange: onChangeHandler
|
|
396
|
-
}, null, 8, ["model", "config", "size", "step-active", "expand-more", "label-width", "prop"]);
|
|
406
|
+
}, null, 8, ["model", "config", "size", "disabled", "step-active", "expand-more", "label-width", "prop"]);
|
|
397
407
|
}), 128)) : vue.createCommentVNode("", true)
|
|
398
408
|
], 64)) : vue.createCommentVNode("", true),
|
|
399
409
|
__props.config.expand && vue.unref(type) !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
|
|
400
410
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
411
|
+
type: "primary",
|
|
412
|
+
size: "small",
|
|
413
|
+
disabled: false,
|
|
401
414
|
text: "",
|
|
402
415
|
onClick: expandHandler
|
|
403
416
|
}, {
|
|
@@ -423,15 +436,19 @@
|
|
|
423
436
|
};
|
|
424
437
|
const _hoisted_7$2 = { style: { "flex": "1" } };
|
|
425
438
|
const _hoisted_8$1 = ["src"];
|
|
439
|
+
const __default__$u = vue.defineComponent({
|
|
440
|
+
name: "MFormFieldset"
|
|
441
|
+
});
|
|
426
442
|
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
427
|
-
|
|
443
|
+
...__default__$u,
|
|
428
444
|
props: {
|
|
429
445
|
labelWidth: null,
|
|
430
446
|
prop: { default: "" },
|
|
431
447
|
size: null,
|
|
432
448
|
model: null,
|
|
433
449
|
config: null,
|
|
434
|
-
rules: { default: {} }
|
|
450
|
+
rules: { default: {} },
|
|
451
|
+
disabled: { type: Boolean }
|
|
435
452
|
},
|
|
436
453
|
emits: ["change"],
|
|
437
454
|
setup(__props, { emit }) {
|
|
@@ -510,10 +527,11 @@
|
|
|
510
527
|
rules: vue.unref(name) ? __props.rules[vue.unref(name)] : [],
|
|
511
528
|
config: item,
|
|
512
529
|
prop: __props.prop,
|
|
530
|
+
disabled: __props.disabled,
|
|
513
531
|
labelWidth: vue.unref(lWidth),
|
|
514
532
|
size: __props.size,
|
|
515
533
|
onChange: change
|
|
516
|
-
}, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size"]);
|
|
534
|
+
}, null, 8, ["model", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
|
|
517
535
|
}), 128))
|
|
518
536
|
]),
|
|
519
537
|
vue.createElementVNode("img", {
|
|
@@ -529,8 +547,9 @@
|
|
|
529
547
|
prop: __props.prop,
|
|
530
548
|
labelWidth: vue.unref(lWidth),
|
|
531
549
|
size: __props.size,
|
|
550
|
+
disabled: __props.disabled,
|
|
532
551
|
onChange: change
|
|
533
|
-
}, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size"]);
|
|
552
|
+
}, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
|
|
534
553
|
}), 128)) : vue.createCommentVNode("", true)
|
|
535
554
|
], 4)) : vue.createCommentVNode("", true);
|
|
536
555
|
};
|
|
@@ -541,8 +560,11 @@
|
|
|
541
560
|
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u79FB");
|
|
542
561
|
const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u79FB");
|
|
543
562
|
const _hoisted_4$4 = ["innerHTML"];
|
|
563
|
+
const __default__$t = vue.defineComponent({
|
|
564
|
+
name: "MFormGroupListItem"
|
|
565
|
+
});
|
|
544
566
|
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
545
|
-
|
|
567
|
+
...__default__$t,
|
|
546
568
|
props: {
|
|
547
569
|
model: null,
|
|
548
570
|
groupModel: null,
|
|
@@ -550,7 +572,8 @@
|
|
|
550
572
|
labelWidth: null,
|
|
551
573
|
prop: null,
|
|
552
574
|
size: null,
|
|
553
|
-
index: null
|
|
575
|
+
index: null,
|
|
576
|
+
disabled: { type: Boolean }
|
|
554
577
|
},
|
|
555
578
|
emits: ["swap-item", "remove-item", "change"],
|
|
556
579
|
setup(__props, { emit }) {
|
|
@@ -611,24 +634,27 @@
|
|
|
611
634
|
}),
|
|
612
635
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
613
636
|
text: "",
|
|
637
|
+
disabled: __props.disabled,
|
|
614
638
|
onClick: expandHandler
|
|
615
639
|
}, {
|
|
616
640
|
default: vue.withCtx(() => [
|
|
617
641
|
vue.createTextVNode(vue.toDisplayString(vue.unref(title)), 1)
|
|
618
642
|
]),
|
|
619
643
|
_: 1
|
|
620
|
-
}),
|
|
644
|
+
}, 8, ["disabled"]),
|
|
621
645
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
646
|
+
style: { "color": "#f56c6c" },
|
|
622
647
|
text: "",
|
|
623
648
|
icon: vue.unref(iconsVue.Delete),
|
|
624
|
-
|
|
649
|
+
disabled: __props.disabled,
|
|
625
650
|
onClick: removeHandler
|
|
626
|
-
}, null, 8, ["icon"]), [
|
|
651
|
+
}, null, 8, ["icon", "disabled"]), [
|
|
627
652
|
[vue.vShow, showDelete(parseInt(String(__props.index)))]
|
|
628
653
|
]),
|
|
629
654
|
movable() ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
630
655
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
631
656
|
text: "",
|
|
657
|
+
disabled: __props.disabled,
|
|
632
658
|
size: "small",
|
|
633
659
|
onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
|
|
634
660
|
}, {
|
|
@@ -642,10 +668,11 @@
|
|
|
642
668
|
})
|
|
643
669
|
]),
|
|
644
670
|
_: 1
|
|
645
|
-
},
|
|
671
|
+
}, 8, ["disabled"]), [
|
|
646
672
|
[vue.vShow, __props.index !== 0]
|
|
647
673
|
]),
|
|
648
674
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
675
|
+
disabled: __props.disabled,
|
|
649
676
|
text: "",
|
|
650
677
|
size: "small",
|
|
651
678
|
onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
|
|
@@ -660,7 +687,7 @@
|
|
|
660
687
|
})
|
|
661
688
|
]),
|
|
662
689
|
_: 1
|
|
663
|
-
},
|
|
690
|
+
}, 8, ["disabled"]), [
|
|
664
691
|
[vue.vShow, __props.index !== vue.unref(length) - 1]
|
|
665
692
|
])
|
|
666
693
|
], 64)) : vue.createCommentVNode("", true),
|
|
@@ -677,8 +704,9 @@
|
|
|
677
704
|
labelWidth: __props.labelWidth,
|
|
678
705
|
prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
|
|
679
706
|
size: __props.size,
|
|
707
|
+
disabled: __props.disabled,
|
|
680
708
|
onChange: changeHandler
|
|
681
|
-
}, null, 8, ["config", "model", "labelWidth", "prop", "size"])) : vue.createCommentVNode("", true)
|
|
709
|
+
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "disabled"])) : vue.createCommentVNode("", true)
|
|
682
710
|
]);
|
|
683
711
|
};
|
|
684
712
|
}
|
|
@@ -696,15 +724,19 @@
|
|
|
696
724
|
];
|
|
697
725
|
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
698
726
|
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
727
|
+
const __default__$s = vue.defineComponent({
|
|
728
|
+
name: "MFormGroupList"
|
|
729
|
+
});
|
|
699
730
|
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
700
|
-
|
|
731
|
+
...__default__$s,
|
|
701
732
|
props: {
|
|
702
733
|
model: null,
|
|
703
734
|
config: null,
|
|
704
735
|
name: null,
|
|
705
736
|
labelWidth: null,
|
|
706
737
|
prop: null,
|
|
707
|
-
size: null
|
|
738
|
+
size: null,
|
|
739
|
+
disabled: { type: Boolean }
|
|
708
740
|
},
|
|
709
741
|
emits: ["change"],
|
|
710
742
|
setup(__props, { emit }) {
|
|
@@ -786,22 +818,24 @@
|
|
|
786
818
|
index,
|
|
787
819
|
"label-width": __props.labelWidth,
|
|
788
820
|
size: __props.size,
|
|
821
|
+
disabled: __props.disabled,
|
|
789
822
|
"group-model": __props.model[__props.name],
|
|
790
823
|
onRemoveItem: removeHandler,
|
|
791
824
|
onSwapItem: swapHandler,
|
|
792
825
|
onChange: changeHandler
|
|
793
|
-
}, null, 8, ["model", "config", "prop", "index", "label-width", "size", "group-model"]);
|
|
826
|
+
}, null, 8, ["model", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
|
|
794
827
|
}), 128)),
|
|
795
828
|
vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
796
829
|
key: 3,
|
|
797
830
|
onClick: addHandler,
|
|
798
|
-
size: "small"
|
|
831
|
+
size: "small",
|
|
832
|
+
disabled: __props.disabled
|
|
799
833
|
}, {
|
|
800
834
|
default: vue.withCtx(() => [
|
|
801
835
|
_hoisted_6$1
|
|
802
836
|
]),
|
|
803
837
|
_: 1
|
|
804
|
-
})) : vue.createCommentVNode("", true),
|
|
838
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
805
839
|
__props.config.enableToggleMode ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
806
840
|
key: 4,
|
|
807
841
|
icon: vue.unref(iconsVue.Grid),
|
|
@@ -826,15 +860,19 @@
|
|
|
826
860
|
};
|
|
827
861
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
828
862
|
const _hoisted_5$1 = ["src"];
|
|
863
|
+
const __default__$r = vue.defineComponent({
|
|
864
|
+
name: "MFormPanel"
|
|
865
|
+
});
|
|
829
866
|
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
830
|
-
|
|
867
|
+
...__default__$r,
|
|
831
868
|
props: {
|
|
832
869
|
model: null,
|
|
833
870
|
config: null,
|
|
834
871
|
name: null,
|
|
835
872
|
labelWidth: null,
|
|
836
873
|
prop: null,
|
|
837
|
-
size: null
|
|
874
|
+
size: null,
|
|
875
|
+
disabled: { type: Boolean }
|
|
838
876
|
},
|
|
839
877
|
emits: ["change"],
|
|
840
878
|
setup(__props, { emit }) {
|
|
@@ -884,9 +922,10 @@
|
|
|
884
922
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
885
923
|
prop: __props.prop,
|
|
886
924
|
size: __props.size,
|
|
925
|
+
disabled: __props.disabled,
|
|
887
926
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
888
927
|
onChange: changeHandler
|
|
889
|
-
}, null, 8, ["config", "model", "prop", "size", "label-width"]);
|
|
928
|
+
}, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"]);
|
|
890
929
|
}), 128))
|
|
891
930
|
]),
|
|
892
931
|
vue.createElementVNode("img", {
|
|
@@ -900,9 +939,10 @@
|
|
|
900
939
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
901
940
|
prop: __props.prop,
|
|
902
941
|
size: __props.size,
|
|
942
|
+
disabled: __props.disabled,
|
|
903
943
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
904
944
|
onChange: changeHandler
|
|
905
|
-
}, null, 8, ["config", "model", "prop", "size", "label-width"]);
|
|
945
|
+
}, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"]);
|
|
906
946
|
}), 128))
|
|
907
947
|
])
|
|
908
948
|
]),
|
|
@@ -912,8 +952,11 @@
|
|
|
912
952
|
}
|
|
913
953
|
});
|
|
914
954
|
|
|
955
|
+
const __default__$q = vue.defineComponent({
|
|
956
|
+
name: "MFormCol"
|
|
957
|
+
});
|
|
915
958
|
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
916
|
-
|
|
959
|
+
...__default__$q,
|
|
917
960
|
props: {
|
|
918
961
|
model: null,
|
|
919
962
|
config: null,
|
|
@@ -921,7 +964,8 @@
|
|
|
921
964
|
expandMore: { type: Boolean },
|
|
922
965
|
span: null,
|
|
923
966
|
size: null,
|
|
924
|
-
prop: null
|
|
967
|
+
prop: null,
|
|
968
|
+
disabled: { type: Boolean }
|
|
925
969
|
},
|
|
926
970
|
emits: ["change"],
|
|
927
971
|
setup(__props, { emit }) {
|
|
@@ -939,8 +983,9 @@
|
|
|
939
983
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
940
984
|
"expand-more": __props.expandMore,
|
|
941
985
|
size: __props.size,
|
|
986
|
+
disabled: __props.disabled,
|
|
942
987
|
onChange: changeHandler
|
|
943
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size"])
|
|
988
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "disabled"])
|
|
944
989
|
]),
|
|
945
990
|
_: 1
|
|
946
991
|
}, 8, ["span"])), [
|
|
@@ -950,8 +995,11 @@
|
|
|
950
995
|
}
|
|
951
996
|
});
|
|
952
997
|
|
|
998
|
+
const __default__$p = vue.defineComponent({
|
|
999
|
+
name: "MFormRow"
|
|
1000
|
+
});
|
|
953
1001
|
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
954
|
-
|
|
1002
|
+
...__default__$p,
|
|
955
1003
|
props: {
|
|
956
1004
|
model: null,
|
|
957
1005
|
config: null,
|
|
@@ -959,7 +1007,8 @@
|
|
|
959
1007
|
labelWidth: null,
|
|
960
1008
|
prop: null,
|
|
961
1009
|
size: null,
|
|
962
|
-
expandMore: { type: Boolean }
|
|
1010
|
+
expandMore: { type: Boolean },
|
|
1011
|
+
disabled: { type: Boolean }
|
|
963
1012
|
},
|
|
964
1013
|
emits: ["change"],
|
|
965
1014
|
setup(__props, { emit }) {
|
|
@@ -979,8 +1028,9 @@
|
|
|
979
1028
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
980
1029
|
prop: __props.prop,
|
|
981
1030
|
size: __props.size,
|
|
1031
|
+
disabled: __props.disabled,
|
|
982
1032
|
onChange: changeHandler
|
|
983
|
-
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size"]);
|
|
1033
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "disabled"]);
|
|
984
1034
|
}), 128))
|
|
985
1035
|
]),
|
|
986
1036
|
_: 1
|
|
@@ -989,14 +1039,18 @@
|
|
|
989
1039
|
}
|
|
990
1040
|
});
|
|
991
1041
|
|
|
1042
|
+
const __default__$o = vue.defineComponent({
|
|
1043
|
+
name: "MFormStep"
|
|
1044
|
+
});
|
|
992
1045
|
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
993
|
-
|
|
1046
|
+
...__default__$o,
|
|
994
1047
|
props: {
|
|
995
1048
|
model: null,
|
|
996
1049
|
config: null,
|
|
997
1050
|
stepActive: { default: 1 },
|
|
998
1051
|
labelWidth: null,
|
|
999
|
-
size: null
|
|
1052
|
+
size: null,
|
|
1053
|
+
disabled: { type: Boolean }
|
|
1000
1054
|
},
|
|
1001
1055
|
emits: ["change"],
|
|
1002
1056
|
setup(__props, { emit }) {
|
|
@@ -1042,9 +1096,10 @@
|
|
|
1042
1096
|
model: step.name ? __props.model[step.name] : __props.model,
|
|
1043
1097
|
prop: `${step.name}`,
|
|
1044
1098
|
size: __props.size,
|
|
1099
|
+
disabled: __props.disabled,
|
|
1045
1100
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
1046
1101
|
onChange: changeHandler
|
|
1047
|
-
}, null, 8, ["config", "model", "prop", "size", "label-width"])), [
|
|
1102
|
+
}, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"])), [
|
|
1048
1103
|
[vue.vShow, active.value - 1 === index]
|
|
1049
1104
|
]) : vue.createCommentVNode("", true)
|
|
1050
1105
|
], 64);
|
|
@@ -1066,11 +1121,15 @@
|
|
|
1066
1121
|
const _hoisted_8 = /* @__PURE__ */ vue.createTextVNode("\xA0 ");
|
|
1067
1122
|
const _hoisted_9 = /* @__PURE__ */ vue.createTextVNode("\u6E05\u7A7A");
|
|
1068
1123
|
const _hoisted_10 = {
|
|
1124
|
+
key: 1,
|
|
1069
1125
|
class: "bottom",
|
|
1070
1126
|
style: { "text-align": "right" }
|
|
1071
1127
|
};
|
|
1128
|
+
const __default__$n = vue.defineComponent({
|
|
1129
|
+
name: "MFormTable"
|
|
1130
|
+
});
|
|
1072
1131
|
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
1073
|
-
|
|
1132
|
+
...__default__$n,
|
|
1074
1133
|
props: {
|
|
1075
1134
|
model: null,
|
|
1076
1135
|
config: null,
|
|
@@ -1078,6 +1137,7 @@
|
|
|
1078
1137
|
prop: { default: "" },
|
|
1079
1138
|
labelWidth: null,
|
|
1080
1139
|
sort: { type: Boolean },
|
|
1140
|
+
disabled: { type: Boolean },
|
|
1081
1141
|
sortKey: { default: "" },
|
|
1082
1142
|
text: null,
|
|
1083
1143
|
size: null,
|
|
@@ -1097,6 +1157,11 @@
|
|
|
1097
1157
|
const updateKey = vue.ref(1);
|
|
1098
1158
|
const isFullscreen = vue.ref(false);
|
|
1099
1159
|
const modelName = vue.computed(() => props.name || props.config.name || "");
|
|
1160
|
+
const data = vue.computed(
|
|
1161
|
+
() => props.config.pagination ? props.model[modelName.value].filter(
|
|
1162
|
+
(item, index) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value
|
|
1163
|
+
) : props.model[modelName.value]
|
|
1164
|
+
);
|
|
1100
1165
|
const sortChange = ({ prop, order }) => {
|
|
1101
1166
|
if (order === "ascending") {
|
|
1102
1167
|
props.model[modelName.value] = props.model[modelName.value].sort((a, b) => a[prop] - b[prop]);
|
|
@@ -1122,10 +1187,10 @@
|
|
|
1122
1187
|
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
1123
1188
|
};
|
|
1124
1189
|
const rowDrop = () => {
|
|
1125
|
-
const tableEl = tMagicTable.value
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
const sortable = Sortable__default.default.create(
|
|
1190
|
+
const tableEl = tMagicTable.value?.instance.$el;
|
|
1191
|
+
const tBodyEl = tableEl?.querySelector(".el-table__body > tbody");
|
|
1192
|
+
if (tBodyEl) {
|
|
1193
|
+
const sortable = Sortable__default.default.create(tBodyEl, {
|
|
1129
1194
|
onEnd: ({ newIndex, oldIndex }) => {
|
|
1130
1195
|
if (typeof newIndex === "undefined")
|
|
1131
1196
|
return;
|
|
@@ -1137,11 +1202,11 @@
|
|
|
1137
1202
|
sortable.destroy();
|
|
1138
1203
|
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
1139
1204
|
utils.sleep(1e3).then(() => {
|
|
1140
|
-
const
|
|
1141
|
-
if (
|
|
1142
|
-
|
|
1205
|
+
const elTrs = tableEl.querySelectorAll(".el-table__body > tbody > tr");
|
|
1206
|
+
if (elTrs?.[newIndex]) {
|
|
1207
|
+
elTrs[newIndex].style.backgroundColor = "rgba(243, 89, 59, 0.2)";
|
|
1143
1208
|
utils.sleep(1e3).then(() => {
|
|
1144
|
-
|
|
1209
|
+
elTrs[newIndex].style.backgroundColor = "";
|
|
1145
1210
|
});
|
|
1146
1211
|
}
|
|
1147
1212
|
});
|
|
@@ -1212,6 +1277,8 @@
|
|
|
1212
1277
|
if (props.sort && props.sortKey) {
|
|
1213
1278
|
props.model[modelName.value].sort((a, b) => b[props.sortKey] - a[props.sortKey]);
|
|
1214
1279
|
}
|
|
1280
|
+
});
|
|
1281
|
+
vue.watchEffect(() => {
|
|
1215
1282
|
if (props.config.dropSort) {
|
|
1216
1283
|
rowDrop();
|
|
1217
1284
|
}
|
|
@@ -1258,6 +1325,8 @@
|
|
|
1258
1325
|
return fuc;
|
|
1259
1326
|
};
|
|
1260
1327
|
const removeHandler = (index) => {
|
|
1328
|
+
if (props.disabled)
|
|
1329
|
+
return;
|
|
1261
1330
|
props.model[modelName.value].splice(index, 1);
|
|
1262
1331
|
emit("change", props.model[modelName.value]);
|
|
1263
1332
|
};
|
|
@@ -1274,8 +1343,11 @@
|
|
|
1274
1343
|
const toggleRowSelection = (row, selected) => {
|
|
1275
1344
|
tMagicTable.value?.toggleRowSelection.call(tMagicTable.value, row, selected);
|
|
1276
1345
|
};
|
|
1277
|
-
const makeConfig = (config) => {
|
|
1346
|
+
const makeConfig = (config, row) => {
|
|
1278
1347
|
const newConfig = lodashEs.cloneDeep(config);
|
|
1348
|
+
if (typeof config.itemsFunction === "function") {
|
|
1349
|
+
newConfig.items = config.itemsFunction(row);
|
|
1350
|
+
}
|
|
1279
1351
|
delete newConfig.display;
|
|
1280
1352
|
return newConfig;
|
|
1281
1353
|
};
|
|
@@ -1333,8 +1405,8 @@
|
|
|
1333
1405
|
}
|
|
1334
1406
|
const reader = new FileReader();
|
|
1335
1407
|
reader.onload = () => {
|
|
1336
|
-
const
|
|
1337
|
-
const pdata = globalThis.XLSX.read(
|
|
1408
|
+
const data2 = reader.result;
|
|
1409
|
+
const pdata = globalThis.XLSX.read(data2, { type: "array" });
|
|
1338
1410
|
pdata.SheetNames.forEach((sheetName) => {
|
|
1339
1411
|
const arr = globalThis.XLSX.utils.sheet_to_json(pdata.Sheets[sheetName], { header: 1 });
|
|
1340
1412
|
if (arr?.[0]) {
|
|
@@ -1416,7 +1488,8 @@
|
|
|
1416
1488
|
ref_key: "tMagicTable",
|
|
1417
1489
|
ref: tMagicTable,
|
|
1418
1490
|
style: { "width": "100%" },
|
|
1419
|
-
|
|
1491
|
+
"row-key": __props.config.rowKey || "id",
|
|
1492
|
+
data: vue.unref(data),
|
|
1420
1493
|
border: __props.config.border,
|
|
1421
1494
|
"max-height": __props.config.maxHeight,
|
|
1422
1495
|
"default-expand-all": true,
|
|
@@ -1477,10 +1550,11 @@
|
|
|
1477
1550
|
size: "small",
|
|
1478
1551
|
type: "primary",
|
|
1479
1552
|
icon: vue.unref(iconsVue.ArrowUp),
|
|
1553
|
+
disabled: __props.disabled,
|
|
1480
1554
|
text: "",
|
|
1481
1555
|
onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1482
1556
|
onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1483
|
-
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
1557
|
+
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1484
1558
|
]),
|
|
1485
1559
|
_: 2
|
|
1486
1560
|
}, 1024)) : vue.createCommentVNode("", true),
|
|
@@ -1495,10 +1569,11 @@
|
|
|
1495
1569
|
size: "small",
|
|
1496
1570
|
type: "primary",
|
|
1497
1571
|
icon: vue.unref(iconsVue.ArrowDown),
|
|
1572
|
+
disabled: __props.disabled,
|
|
1498
1573
|
text: "",
|
|
1499
1574
|
onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1500
1575
|
onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1501
|
-
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
1576
|
+
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1502
1577
|
]),
|
|
1503
1578
|
_: 2
|
|
1504
1579
|
}, 1024)) : vue.createCommentVNode("", true)
|
|
@@ -1537,13 +1612,14 @@
|
|
|
1537
1612
|
scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$v, {
|
|
1538
1613
|
key: 0,
|
|
1539
1614
|
labelWidth: "0",
|
|
1615
|
+
disabled: __props.disabled,
|
|
1540
1616
|
prop: getProp(scope.$index),
|
|
1541
1617
|
rules: column.rules,
|
|
1542
|
-
config: makeConfig(column),
|
|
1618
|
+
config: makeConfig(column, scope.row),
|
|
1543
1619
|
model: scope.row,
|
|
1544
1620
|
size: __props.size,
|
|
1545
1621
|
onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", __props.model[vue.unref(modelName)]))
|
|
1546
|
-
}, null, 8, ["prop", "rules", "config", "model", "size"])) : vue.createCommentVNode("", true)
|
|
1622
|
+
}, null, 8, ["disabled", "prop", "rules", "config", "model", "size"])) : vue.createCommentVNode("", true)
|
|
1547
1623
|
]),
|
|
1548
1624
|
_: 2
|
|
1549
1625
|
}, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
|
|
@@ -1551,7 +1627,7 @@
|
|
|
1551
1627
|
}), 256))
|
|
1552
1628
|
]),
|
|
1553
1629
|
_: 1
|
|
1554
|
-
}, 8, ["data", "border", "max-height"])) : vue.createCommentVNode("", true)
|
|
1630
|
+
}, 8, ["row-key", "data", "border", "max-height"])) : vue.createCommentVNode("", true)
|
|
1555
1631
|
]),
|
|
1556
1632
|
_: 1
|
|
1557
1633
|
}, 8, ["disabled"]),
|
|
@@ -1560,6 +1636,7 @@
|
|
|
1560
1636
|
key: 0,
|
|
1561
1637
|
size: "small",
|
|
1562
1638
|
type: "primary",
|
|
1639
|
+
disabled: __props.disabled,
|
|
1563
1640
|
plain: "",
|
|
1564
1641
|
onClick: _cache[1] || (_cache[1] = ($event) => newHandler())
|
|
1565
1642
|
}, {
|
|
@@ -1567,7 +1644,7 @@
|
|
|
1567
1644
|
_hoisted_4$1
|
|
1568
1645
|
]),
|
|
1569
1646
|
_: 1
|
|
1570
|
-
})) : vue.createCommentVNode("", true),
|
|
1647
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1571
1648
|
_hoisted_5,
|
|
1572
1649
|
__props.enableToggleMode && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1573
1650
|
key: 1,
|
|
@@ -1595,32 +1672,35 @@
|
|
|
1595
1672
|
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
1596
1673
|
vue.unref(importable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
|
|
1597
1674
|
key: 3,
|
|
1675
|
+
style: { "display": "inline-block" },
|
|
1598
1676
|
ref_key: "excelBtn",
|
|
1599
1677
|
ref: excelBtn,
|
|
1600
1678
|
action: "/noop",
|
|
1679
|
+
disabled: __props.disabled,
|
|
1601
1680
|
"on-change": excelHandler,
|
|
1602
|
-
"auto-upload": false
|
|
1603
|
-
style: { "display": "inline-block" }
|
|
1681
|
+
"auto-upload": false
|
|
1604
1682
|
}, {
|
|
1605
1683
|
default: vue.withCtx(() => [
|
|
1606
1684
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1607
1685
|
size: "small",
|
|
1608
1686
|
type: "success",
|
|
1687
|
+
disabled: __props.disabled,
|
|
1609
1688
|
plain: ""
|
|
1610
1689
|
}, {
|
|
1611
1690
|
default: vue.withCtx(() => [
|
|
1612
1691
|
_hoisted_7
|
|
1613
1692
|
]),
|
|
1614
1693
|
_: 1
|
|
1615
|
-
})
|
|
1694
|
+
}, 8, ["disabled"])
|
|
1616
1695
|
]),
|
|
1617
1696
|
_: 1
|
|
1618
|
-
},
|
|
1697
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1619
1698
|
_hoisted_8,
|
|
1620
1699
|
vue.unref(importable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1621
1700
|
key: 4,
|
|
1622
1701
|
size: "small",
|
|
1623
1702
|
type: "warning",
|
|
1703
|
+
disabled: __props.disabled,
|
|
1624
1704
|
plain: "",
|
|
1625
1705
|
onClick: _cache[2] || (_cache[2] = ($event) => clearHandler())
|
|
1626
1706
|
}, {
|
|
@@ -1628,9 +1708,9 @@
|
|
|
1628
1708
|
_hoisted_9
|
|
1629
1709
|
]),
|
|
1630
1710
|
_: 1
|
|
1631
|
-
})) : vue.createCommentVNode("", true)
|
|
1711
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true)
|
|
1632
1712
|
]),
|
|
1633
|
-
vue.
|
|
1713
|
+
__props.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
|
|
1634
1714
|
vue.createVNode(vue.unref(design.TMagicPagination), {
|
|
1635
1715
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
1636
1716
|
"hide-on-single-page": __props.model[vue.unref(modelName)].length < pagesize.value,
|
|
@@ -1641,14 +1721,17 @@
|
|
|
1641
1721
|
onSizeChange: handleSizeChange,
|
|
1642
1722
|
onCurrentChange: handleCurrentChange
|
|
1643
1723
|
}, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
|
|
1644
|
-
])
|
|
1724
|
+
])) : vue.createCommentVNode("", true)
|
|
1645
1725
|
], 2);
|
|
1646
1726
|
};
|
|
1647
1727
|
}
|
|
1648
1728
|
});
|
|
1649
1729
|
|
|
1730
|
+
const __default__$m = vue.defineComponent({
|
|
1731
|
+
name: "MFormTabs"
|
|
1732
|
+
});
|
|
1650
1733
|
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
1651
|
-
|
|
1734
|
+
...__default__$m,
|
|
1652
1735
|
props: {
|
|
1653
1736
|
model: null,
|
|
1654
1737
|
config: null,
|
|
@@ -1656,11 +1739,13 @@
|
|
|
1656
1739
|
size: null,
|
|
1657
1740
|
labelWidth: null,
|
|
1658
1741
|
prop: null,
|
|
1659
|
-
expandMore: { type: Boolean }
|
|
1742
|
+
expandMore: { type: Boolean },
|
|
1743
|
+
disabled: { type: Boolean }
|
|
1660
1744
|
},
|
|
1661
1745
|
emits: ["change"],
|
|
1662
1746
|
setup(__props, { emit }) {
|
|
1663
1747
|
const props = __props;
|
|
1748
|
+
const uiComponent = design.getConfig("components").tabPane;
|
|
1664
1749
|
const getActive = (mForm2, props2, activeTabName2) => {
|
|
1665
1750
|
const { config, model, prop } = props2;
|
|
1666
1751
|
const { active } = config;
|
|
@@ -1762,7 +1847,7 @@
|
|
|
1762
1847
|
default: vue.withCtx(() => [
|
|
1763
1848
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tabs), (tab, tabIndex) => {
|
|
1764
1849
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
1765
|
-
display$1(tab.display) && tabItems(tab).length ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
1850
|
+
display$1(tab.display) && tabItems(tab).length ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(uiComponent).component), {
|
|
1766
1851
|
key: tab[vue.unref(mForm)?.keyProp || "__key"] ?? tabIndex,
|
|
1767
1852
|
name: filter(tab.status) || tabIndex.toString(),
|
|
1768
1853
|
label: filter(tab.title),
|
|
@@ -1773,13 +1858,14 @@
|
|
|
1773
1858
|
return vue.openBlock(), vue.createBlock(_sfc_main$v, {
|
|
1774
1859
|
key: item[vue.unref(mForm)?.keyProp || "__key"],
|
|
1775
1860
|
config: item,
|
|
1861
|
+
disabled: __props.disabled,
|
|
1776
1862
|
model: __props.config.dynamic ? (__props.name ? __props.model[__props.name] : __props.model)[tabIndex] : tab.name ? (__props.name ? __props.model[__props.name] : __props.model)[tab.name] : __props.name ? __props.model[__props.name] : __props.model,
|
|
1777
1863
|
prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
|
|
1778
1864
|
size: __props.size,
|
|
1779
1865
|
"label-width": tab.labelWidth || __props.labelWidth,
|
|
1780
1866
|
"expand-more": __props.expandMore,
|
|
1781
1867
|
onChange: changeHandler
|
|
1782
|
-
}, null, 8, ["config", "model", "prop", "size", "label-width", "expand-more"]);
|
|
1868
|
+
}, null, 8, ["config", "disabled", "model", "prop", "size", "label-width", "expand-more"]);
|
|
1783
1869
|
}), 128))
|
|
1784
1870
|
]),
|
|
1785
1871
|
_: 2
|
|
@@ -1819,8 +1905,11 @@
|
|
|
1819
1905
|
);
|
|
1820
1906
|
};
|
|
1821
1907
|
|
|
1908
|
+
const __default__$l = vue.defineComponent({
|
|
1909
|
+
name: "MFormCascader"
|
|
1910
|
+
});
|
|
1822
1911
|
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
1823
|
-
|
|
1912
|
+
...__default__$l,
|
|
1824
1913
|
props: {
|
|
1825
1914
|
config: null,
|
|
1826
1915
|
model: null,
|
|
@@ -1903,8 +1992,11 @@
|
|
|
1903
1992
|
}
|
|
1904
1993
|
});
|
|
1905
1994
|
|
|
1995
|
+
const __default__$k = vue.defineComponent({
|
|
1996
|
+
name: "MFormCheckbox"
|
|
1997
|
+
});
|
|
1906
1998
|
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
1907
|
-
|
|
1999
|
+
...__default__$k,
|
|
1908
2000
|
props: {
|
|
1909
2001
|
config: null,
|
|
1910
2002
|
model: null,
|
|
@@ -1961,8 +2053,11 @@
|
|
|
1961
2053
|
}
|
|
1962
2054
|
});
|
|
1963
2055
|
|
|
2056
|
+
const __default__$j = vue.defineComponent({
|
|
2057
|
+
name: "MFormCheckGroup"
|
|
2058
|
+
});
|
|
1964
2059
|
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
1965
|
-
|
|
2060
|
+
...__default__$j,
|
|
1966
2061
|
props: {
|
|
1967
2062
|
config: null,
|
|
1968
2063
|
model: null,
|
|
@@ -2003,6 +2098,7 @@
|
|
|
2003
2098
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(options), (option) => {
|
|
2004
2099
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
|
|
2005
2100
|
label: option.value,
|
|
2101
|
+
value: option.value,
|
|
2006
2102
|
key: option.value,
|
|
2007
2103
|
disabled: option.disabled
|
|
2008
2104
|
}, {
|
|
@@ -2010,7 +2106,7 @@
|
|
|
2010
2106
|
vue.createTextVNode(vue.toDisplayString(option.text), 1)
|
|
2011
2107
|
]),
|
|
2012
2108
|
_: 2
|
|
2013
|
-
}, 1032, ["label", "disabled"]);
|
|
2109
|
+
}, 1032, ["label", "value", "disabled"]);
|
|
2014
2110
|
}), 128))
|
|
2015
2111
|
]),
|
|
2016
2112
|
_: 1
|
|
@@ -2019,8 +2115,11 @@
|
|
|
2019
2115
|
}
|
|
2020
2116
|
});
|
|
2021
2117
|
|
|
2118
|
+
const __default__$i = vue.defineComponent({
|
|
2119
|
+
name: "MFormColorPicker"
|
|
2120
|
+
});
|
|
2022
2121
|
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
2023
|
-
|
|
2122
|
+
...__default__$i,
|
|
2024
2123
|
props: {
|
|
2025
2124
|
config: null,
|
|
2026
2125
|
model: null,
|
|
@@ -2049,8 +2148,11 @@
|
|
|
2049
2148
|
}
|
|
2050
2149
|
});
|
|
2051
2150
|
|
|
2151
|
+
const __default__$h = vue.defineComponent({
|
|
2152
|
+
name: "MFormDate"
|
|
2153
|
+
});
|
|
2052
2154
|
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
2053
|
-
|
|
2155
|
+
...__default__$h,
|
|
2054
2156
|
props: {
|
|
2055
2157
|
config: null,
|
|
2056
2158
|
model: null,
|
|
@@ -2078,15 +2180,18 @@
|
|
|
2078
2180
|
placeholder: __props.config.placeholder,
|
|
2079
2181
|
disabled: __props.disabled,
|
|
2080
2182
|
format: __props.config.format,
|
|
2081
|
-
"value-format": __props.config.
|
|
2183
|
+
"value-format": __props.config.valueFormat || "YYYY-MM-DD HH:mm:ss",
|
|
2082
2184
|
onChange: changeHandler
|
|
2083
2185
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format"]);
|
|
2084
2186
|
};
|
|
2085
2187
|
}
|
|
2086
2188
|
});
|
|
2087
2189
|
|
|
2190
|
+
const __default__$g = vue.defineComponent({
|
|
2191
|
+
name: "MFormDateRange"
|
|
2192
|
+
});
|
|
2088
2193
|
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
2089
|
-
|
|
2194
|
+
...__default__$g,
|
|
2090
2195
|
props: {
|
|
2091
2196
|
config: null,
|
|
2092
2197
|
model: null,
|
|
@@ -2183,8 +2288,11 @@
|
|
|
2183
2288
|
}
|
|
2184
2289
|
});
|
|
2185
2290
|
|
|
2291
|
+
const __default__$f = vue.defineComponent({
|
|
2292
|
+
name: "MFormDateTime"
|
|
2293
|
+
});
|
|
2186
2294
|
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
2187
|
-
|
|
2295
|
+
...__default__$f,
|
|
2188
2296
|
props: {
|
|
2189
2297
|
config: null,
|
|
2190
2298
|
model: null,
|
|
@@ -2229,8 +2337,11 @@
|
|
|
2229
2337
|
});
|
|
2230
2338
|
|
|
2231
2339
|
const _hoisted_1$5 = { key: 0 };
|
|
2340
|
+
const __default__$e = vue.defineComponent({
|
|
2341
|
+
name: "MFormDisplay"
|
|
2342
|
+
});
|
|
2232
2343
|
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
2233
|
-
|
|
2344
|
+
...__default__$e,
|
|
2234
2345
|
props: {
|
|
2235
2346
|
config: null,
|
|
2236
2347
|
model: null,
|
|
@@ -2252,8 +2363,11 @@
|
|
|
2252
2363
|
});
|
|
2253
2364
|
|
|
2254
2365
|
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2366
|
+
const __default__$d = vue.defineComponent({
|
|
2367
|
+
name: "MFormDynamicField"
|
|
2368
|
+
});
|
|
2255
2369
|
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
2256
|
-
|
|
2370
|
+
...__default__$d,
|
|
2257
2371
|
props: {
|
|
2258
2372
|
config: null,
|
|
2259
2373
|
model: null,
|
|
@@ -2340,8 +2454,11 @@
|
|
|
2340
2454
|
}
|
|
2341
2455
|
});
|
|
2342
2456
|
|
|
2457
|
+
const __default__$c = vue.defineComponent({
|
|
2458
|
+
name: "MFormHidden"
|
|
2459
|
+
});
|
|
2343
2460
|
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
2344
|
-
|
|
2461
|
+
...__default__$c,
|
|
2345
2462
|
props: {
|
|
2346
2463
|
config: null,
|
|
2347
2464
|
model: null,
|
|
@@ -2365,8 +2482,11 @@
|
|
|
2365
2482
|
}
|
|
2366
2483
|
});
|
|
2367
2484
|
|
|
2485
|
+
const __default__$b = vue.defineComponent({
|
|
2486
|
+
name: "MForm"
|
|
2487
|
+
});
|
|
2368
2488
|
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
2369
|
-
|
|
2489
|
+
...__default__$b,
|
|
2370
2490
|
props: {
|
|
2371
2491
|
config: { default: () => [] },
|
|
2372
2492
|
initValues: { default: () => ({}) },
|
|
@@ -2410,6 +2530,13 @@
|
|
|
2410
2530
|
}
|
|
2411
2531
|
}
|
|
2412
2532
|
});
|
|
2533
|
+
vue.watchEffect(() => {
|
|
2534
|
+
formState.initValues = props.initValues;
|
|
2535
|
+
formState.config = props.config;
|
|
2536
|
+
formState.keyProp = props.keyProp;
|
|
2537
|
+
formState.popperClass = props.popperClass;
|
|
2538
|
+
formState.parentValues = props.parentValues;
|
|
2539
|
+
});
|
|
2413
2540
|
vue.provide("mForm", formState);
|
|
2414
2541
|
vue.watch(
|
|
2415
2542
|
[() => props.config, () => props.initValues],
|
|
@@ -2463,7 +2590,6 @@
|
|
|
2463
2590
|
ref: tMagicForm,
|
|
2464
2591
|
model: values.value,
|
|
2465
2592
|
"label-width": __props.labelWidth,
|
|
2466
|
-
disabled: __props.disabled,
|
|
2467
2593
|
style: vue.normalizeStyle(`height: ${__props.height}`),
|
|
2468
2594
|
inline: __props.inline,
|
|
2469
2595
|
"label-position": __props.labelPosition
|
|
@@ -2471,6 +2597,7 @@
|
|
|
2471
2597
|
default: vue.withCtx(() => [
|
|
2472
2598
|
initialized.value && Array.isArray(__props.config) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(__props.config, (item, index) => {
|
|
2473
2599
|
return vue.openBlock(), vue.createBlock(_sfc_main$v, {
|
|
2600
|
+
disabled: __props.disabled,
|
|
2474
2601
|
key: item[__props.keyProp] ?? index,
|
|
2475
2602
|
config: item,
|
|
2476
2603
|
model: values.value,
|
|
@@ -2478,11 +2605,11 @@
|
|
|
2478
2605
|
"step-active": __props.stepActive,
|
|
2479
2606
|
size: __props.size,
|
|
2480
2607
|
onChange: changeHandler
|
|
2481
|
-
}, null, 8, ["config", "model", "label-width", "step-active", "size"]);
|
|
2608
|
+
}, null, 8, ["disabled", "config", "model", "label-width", "step-active", "size"]);
|
|
2482
2609
|
}), 128)) : vue.createCommentVNode("", true)
|
|
2483
2610
|
]),
|
|
2484
2611
|
_: 1
|
|
2485
|
-
}, 8, ["model", "label-width", "
|
|
2612
|
+
}, 8, ["model", "label-width", "style", "inline", "label-position"]);
|
|
2486
2613
|
};
|
|
2487
2614
|
}
|
|
2488
2615
|
});
|
|
@@ -2491,8 +2618,11 @@
|
|
|
2491
2618
|
const _hoisted_2$1 = /* @__PURE__ */ vue.createTextVNode("\u53D6 \u6D88");
|
|
2492
2619
|
const _hoisted_3$1 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u4E00\u6B65");
|
|
2493
2620
|
const _hoisted_4 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u4E00\u6B65");
|
|
2621
|
+
const __default__$a = vue.defineComponent({
|
|
2622
|
+
name: "MFormDialog"
|
|
2623
|
+
});
|
|
2494
2624
|
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
2495
|
-
|
|
2625
|
+
...__default__$a,
|
|
2496
2626
|
props: {
|
|
2497
2627
|
config: { default: () => [] },
|
|
2498
2628
|
values: { default: () => ({}) },
|
|
@@ -2500,6 +2630,7 @@
|
|
|
2500
2630
|
width: null,
|
|
2501
2631
|
labelWidth: null,
|
|
2502
2632
|
fullscreen: { type: Boolean },
|
|
2633
|
+
disabled: { type: Boolean },
|
|
2503
2634
|
title: null,
|
|
2504
2635
|
zIndex: null,
|
|
2505
2636
|
size: null,
|
|
@@ -2655,12 +2786,13 @@
|
|
|
2655
2786
|
ref_key: "form",
|
|
2656
2787
|
ref: form,
|
|
2657
2788
|
size: __props.size,
|
|
2789
|
+
disabled: __props.disabled,
|
|
2658
2790
|
config: __props.config,
|
|
2659
2791
|
"init-values": __props.values,
|
|
2660
2792
|
"parent-values": __props.parentValues,
|
|
2661
2793
|
"label-width": __props.labelWidth,
|
|
2662
2794
|
onChange: changeHandler
|
|
2663
|
-
}, null, 8, ["modelValue", "size", "config", "init-values", "parent-values", "label-width"]),
|
|
2795
|
+
}, null, 8, ["modelValue", "size", "disabled", "config", "init-values", "parent-values", "label-width"]),
|
|
2664
2796
|
vue.renderSlot(_ctx.$slots, "default")
|
|
2665
2797
|
], 4)) : vue.createCommentVNode("", true)
|
|
2666
2798
|
]),
|
|
@@ -2676,8 +2808,11 @@
|
|
|
2676
2808
|
class: "m-fields-link"
|
|
2677
2809
|
};
|
|
2678
2810
|
const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("\u70B9\u51FB\u7F16\u8F91");
|
|
2811
|
+
const __default__$9 = vue.defineComponent({
|
|
2812
|
+
name: "MFormLink"
|
|
2813
|
+
});
|
|
2679
2814
|
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
2680
|
-
|
|
2815
|
+
...__default__$9,
|
|
2681
2816
|
props: {
|
|
2682
2817
|
config: null,
|
|
2683
2818
|
model: null,
|
|
@@ -2770,8 +2905,11 @@
|
|
|
2770
2905
|
}
|
|
2771
2906
|
});
|
|
2772
2907
|
|
|
2908
|
+
const __default__$8 = vue.defineComponent({
|
|
2909
|
+
name: "MFormNumber"
|
|
2910
|
+
});
|
|
2773
2911
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
2774
|
-
|
|
2912
|
+
...__default__$8,
|
|
2775
2913
|
props: {
|
|
2776
2914
|
config: null,
|
|
2777
2915
|
model: null,
|
|
@@ -2814,8 +2952,11 @@
|
|
|
2814
2952
|
}
|
|
2815
2953
|
});
|
|
2816
2954
|
|
|
2955
|
+
const __default__$7 = vue.defineComponent({
|
|
2956
|
+
name: "MFormRadioGroup"
|
|
2957
|
+
});
|
|
2817
2958
|
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
2818
|
-
|
|
2959
|
+
...__default__$7,
|
|
2819
2960
|
props: {
|
|
2820
2961
|
config: null,
|
|
2821
2962
|
model: null,
|
|
@@ -2846,13 +2987,14 @@
|
|
|
2846
2987
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.options, (option) => {
|
|
2847
2988
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadio), {
|
|
2848
2989
|
label: option.value,
|
|
2990
|
+
value: option.value,
|
|
2849
2991
|
key: `${option.value}`
|
|
2850
2992
|
}, {
|
|
2851
2993
|
default: vue.withCtx(() => [
|
|
2852
2994
|
vue.createTextVNode(vue.toDisplayString(option.text), 1)
|
|
2853
2995
|
]),
|
|
2854
2996
|
_: 2
|
|
2855
|
-
}, 1032, ["label"]);
|
|
2997
|
+
}, 1032, ["label", "value"]);
|
|
2856
2998
|
}), 128))
|
|
2857
2999
|
]),
|
|
2858
3000
|
_: 1
|
|
@@ -2861,8 +3003,11 @@
|
|
|
2861
3003
|
}
|
|
2862
3004
|
});
|
|
2863
3005
|
|
|
3006
|
+
const __default__$6 = vue.defineComponent({
|
|
3007
|
+
name: "MFormSelectOptionGroups"
|
|
3008
|
+
});
|
|
2864
3009
|
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
2865
|
-
|
|
3010
|
+
...__default__$6,
|
|
2866
3011
|
props: {
|
|
2867
3012
|
options: null
|
|
2868
3013
|
},
|
|
@@ -2892,8 +3037,11 @@
|
|
|
2892
3037
|
}
|
|
2893
3038
|
});
|
|
2894
3039
|
|
|
3040
|
+
const __default__$5 = vue.defineComponent({
|
|
3041
|
+
name: "MFormSelectOptions"
|
|
3042
|
+
});
|
|
2895
3043
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
2896
|
-
|
|
3044
|
+
...__default__$5,
|
|
2897
3045
|
props: {
|
|
2898
3046
|
options: null,
|
|
2899
3047
|
valueKey: null
|
|
@@ -2913,8 +3061,11 @@
|
|
|
2913
3061
|
});
|
|
2914
3062
|
|
|
2915
3063
|
const _hoisted_1$1 = { key: 2 };
|
|
3064
|
+
const __default__$4 = vue.defineComponent({
|
|
3065
|
+
name: "MFormSelect"
|
|
3066
|
+
});
|
|
2916
3067
|
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
2917
|
-
|
|
3068
|
+
...__default__$4,
|
|
2918
3069
|
props: {
|
|
2919
3070
|
config: null,
|
|
2920
3071
|
model: null,
|
|
@@ -2969,30 +3120,32 @@
|
|
|
2969
3120
|
let items = [];
|
|
2970
3121
|
const { config } = props;
|
|
2971
3122
|
const { option } = config;
|
|
2972
|
-
|
|
3123
|
+
const { root = "", totalKey = "total" } = option;
|
|
3124
|
+
let { body = {}, url } = option;
|
|
3125
|
+
if (typeof url === "function") {
|
|
3126
|
+
url = await url(mForm, { model: props.model, formValue: mForm?.values });
|
|
3127
|
+
}
|
|
2973
3128
|
let postOptions = {
|
|
2974
3129
|
method: option.method || "POST",
|
|
2975
|
-
url
|
|
3130
|
+
url,
|
|
2976
3131
|
cache: option.cache,
|
|
2977
3132
|
timeout: option.timeout,
|
|
2978
3133
|
mode: option.mode,
|
|
2979
3134
|
headers: option.headers || {},
|
|
2980
3135
|
json: option.json || false
|
|
2981
3136
|
};
|
|
2982
|
-
if (body) {
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
});
|
|
2990
|
-
}
|
|
2991
|
-
body.query = query.value;
|
|
2992
|
-
body.pgSize = pgSize.value;
|
|
2993
|
-
body.pgIndex = pgIndex.value;
|
|
2994
|
-
postOptions.data = body;
|
|
3137
|
+
if (typeof body === "function") {
|
|
3138
|
+
body = body(mForm, {
|
|
3139
|
+
model: props.model,
|
|
3140
|
+
formValue: mForm?.values,
|
|
3141
|
+
formValues: mForm?.values,
|
|
3142
|
+
config: props.config
|
|
3143
|
+
});
|
|
2995
3144
|
}
|
|
3145
|
+
body.query = query.value;
|
|
3146
|
+
body.pgSize = pgSize.value;
|
|
3147
|
+
body.pgIndex = pgIndex.value;
|
|
3148
|
+
postOptions.data = body;
|
|
2996
3149
|
const requestFuc = getConfig("request");
|
|
2997
3150
|
if (typeof option.beforeRequest === "function") {
|
|
2998
3151
|
postOptions = option.beforeRequest(mForm, postOptions, {
|
|
@@ -3012,9 +3165,13 @@
|
|
|
3012
3165
|
config: props.config
|
|
3013
3166
|
});
|
|
3014
3167
|
}
|
|
3015
|
-
const optionsData =
|
|
3016
|
-
|
|
3017
|
-
|
|
3168
|
+
const optionsData = root.split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res);
|
|
3169
|
+
const resTotal = globalThis.parseInt(
|
|
3170
|
+
totalKey.split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res),
|
|
3171
|
+
10
|
|
3172
|
+
);
|
|
3173
|
+
if (resTotal > 0) {
|
|
3174
|
+
total.value = resTotal;
|
|
3018
3175
|
}
|
|
3019
3176
|
remoteData.value = remoteData.value.concat(optionsData);
|
|
3020
3177
|
if (optionsData) {
|
|
@@ -3063,6 +3220,8 @@
|
|
|
3063
3220
|
return [];
|
|
3064
3221
|
const { config } = props;
|
|
3065
3222
|
const { option } = config;
|
|
3223
|
+
const { root = "", initRoot = "" } = option;
|
|
3224
|
+
let { initBody = {} } = option;
|
|
3066
3225
|
let options2 = [];
|
|
3067
3226
|
let url = option.initUrl;
|
|
3068
3227
|
if (!url) {
|
|
@@ -3071,22 +3230,45 @@
|
|
|
3071
3230
|
if (typeof url === "function") {
|
|
3072
3231
|
url = await url(mForm, { model: props.model, formValue: mForm?.values });
|
|
3073
3232
|
}
|
|
3074
|
-
|
|
3233
|
+
if (typeof initBody === "function") {
|
|
3234
|
+
initBody = initBody(mForm, {
|
|
3235
|
+
model: props.model,
|
|
3236
|
+
formValue: mForm?.values,
|
|
3237
|
+
formValues: mForm?.values,
|
|
3238
|
+
config: props.config
|
|
3239
|
+
});
|
|
3240
|
+
}
|
|
3241
|
+
let postOptions = {
|
|
3075
3242
|
method: option.method || "POST",
|
|
3076
3243
|
url,
|
|
3077
3244
|
data: {
|
|
3078
|
-
id: props.model[props.name]
|
|
3245
|
+
id: props.model[props.name],
|
|
3246
|
+
...initBody
|
|
3079
3247
|
},
|
|
3080
3248
|
mode: option.mode,
|
|
3081
3249
|
headers: option.headers || {},
|
|
3082
3250
|
json: option.json || false
|
|
3083
3251
|
};
|
|
3252
|
+
if (typeof option.beforeInitRequest === "function") {
|
|
3253
|
+
postOptions = option.beforeInitRequest(mForm, postOptions, {
|
|
3254
|
+
model: props.model,
|
|
3255
|
+
formValue: mForm?.values
|
|
3256
|
+
});
|
|
3257
|
+
}
|
|
3084
3258
|
if (option.method?.toLocaleLowerCase() === "jsonp") {
|
|
3085
3259
|
postOptions.jsonpCallback = option.jsonpCallback || "callback";
|
|
3086
3260
|
}
|
|
3087
3261
|
const requestFuc = getConfig("request");
|
|
3088
|
-
|
|
3089
|
-
|
|
3262
|
+
let res = await requestFuc(postOptions);
|
|
3263
|
+
if (typeof option.afterRequest === "function") {
|
|
3264
|
+
res = option.afterRequest(mForm, res, {
|
|
3265
|
+
model: props.model,
|
|
3266
|
+
formValue: mForm?.values,
|
|
3267
|
+
formValues: mForm?.values,
|
|
3268
|
+
config: props.config
|
|
3269
|
+
});
|
|
3270
|
+
}
|
|
3271
|
+
let initData = (initRoot || root).split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res);
|
|
3090
3272
|
if (initData) {
|
|
3091
3273
|
if (!Array.isArray(initData)) {
|
|
3092
3274
|
initData = [initData];
|
|
@@ -3221,8 +3403,11 @@
|
|
|
3221
3403
|
}
|
|
3222
3404
|
});
|
|
3223
3405
|
|
|
3406
|
+
const __default__$3 = vue.defineComponent({
|
|
3407
|
+
name: "MFormSwitch"
|
|
3408
|
+
});
|
|
3224
3409
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
3225
|
-
|
|
3410
|
+
...__default__$3,
|
|
3226
3411
|
props: {
|
|
3227
3412
|
config: null,
|
|
3228
3413
|
model: null,
|
|
@@ -3275,8 +3460,11 @@
|
|
|
3275
3460
|
});
|
|
3276
3461
|
|
|
3277
3462
|
const _hoisted_1 = { key: 0 };
|
|
3463
|
+
const __default__$2 = vue.defineComponent({
|
|
3464
|
+
name: "MFormText"
|
|
3465
|
+
});
|
|
3278
3466
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
3279
|
-
|
|
3467
|
+
...__default__$2,
|
|
3280
3468
|
props: {
|
|
3281
3469
|
config: null,
|
|
3282
3470
|
model: null,
|
|
@@ -3395,8 +3583,11 @@
|
|
|
3395
3583
|
}
|
|
3396
3584
|
});
|
|
3397
3585
|
|
|
3586
|
+
const __default__$1 = vue.defineComponent({
|
|
3587
|
+
name: "MFormTextarea"
|
|
3588
|
+
});
|
|
3398
3589
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
3399
|
-
|
|
3590
|
+
...__default__$1,
|
|
3400
3591
|
props: {
|
|
3401
3592
|
config: null,
|
|
3402
3593
|
model: null,
|
|
@@ -3435,8 +3626,11 @@
|
|
|
3435
3626
|
}
|
|
3436
3627
|
});
|
|
3437
3628
|
|
|
3629
|
+
const __default__ = vue.defineComponent({
|
|
3630
|
+
name: "MFormTime"
|
|
3631
|
+
});
|
|
3438
3632
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
3439
|
-
|
|
3633
|
+
...__default__,
|
|
3440
3634
|
props: {
|
|
3441
3635
|
config: null,
|
|
3442
3636
|
model: null,
|
|
@@ -3458,11 +3652,13 @@
|
|
|
3458
3652
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTimePicker), {
|
|
3459
3653
|
modelValue: __props.model[__props.name],
|
|
3460
3654
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
3655
|
+
"value-format": __props.config.valueFormat || "HH:mm:ss",
|
|
3656
|
+
format: __props.config.format || "HH:mm:ss",
|
|
3461
3657
|
size: __props.size,
|
|
3462
3658
|
placeholder: __props.config.placeholder,
|
|
3463
3659
|
disabled: __props.disabled,
|
|
3464
3660
|
onChange: changeHandler
|
|
3465
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled"]);
|
|
3661
|
+
}, null, 8, ["modelValue", "value-format", "format", "size", "placeholder", "disabled"]);
|
|
3466
3662
|
};
|
|
3467
3663
|
}
|
|
3468
3664
|
});
|
|
@@ -3534,6 +3730,7 @@
|
|
|
3534
3730
|
exports.MText = _sfc_main$2;
|
|
3535
3731
|
exports.MTextarea = _sfc_main$1;
|
|
3536
3732
|
exports.MTime = _sfc_main;
|
|
3733
|
+
exports.createValues = createValues;
|
|
3537
3734
|
exports.default = index;
|
|
3538
3735
|
exports.display = display;
|
|
3539
3736
|
exports.filterFunction = filterFunction;
|
|
@@ -3544,4 +3741,4 @@
|
|
|
3544
3741
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
3545
3742
|
|
|
3546
3743
|
}));
|
|
3547
|
-
//# sourceMappingURL=tmagic-form.umd.
|
|
3744
|
+
//# sourceMappingURL=tmagic-form.umd.cjs.map
|