@tmagic/form 1.2.0-beta.9 → 1.2.1
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} +313 -129
- package/dist/tmagic-form.js.map +1 -0
- package/dist/{tmagic-form.umd.js → tmagic-form.umd.cjs} +312 -127
- package/dist/tmagic-form.umd.cjs.map +1 -0
- package/package.json +10 -8
- package/src/Form.vue +2 -2
- package/src/FormDialog.vue +3 -1
- package/src/containers/Col.vue +3 -1
- package/src/containers/Container.vue +6 -3
- 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 +46 -19
- 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/index.ts +1 -1
- package/src/schema.ts +25 -9
- package/src/theme/form.scss +1 -1
- package/src/utils/config.ts +1 -1
- package/src/utils/containerProps.ts +1 -1
- package/src/utils/createForm.ts +1 -1
- package/src/utils/form.ts +6 -6
- package/src/utils/useAddField.ts +1 -1
- 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 +10 -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 +23 -8
- 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);
|
|
@@ -159,7 +159,7 @@
|
|
|
159
159
|
const initValue = async (mForm, { initValues, config }) => {
|
|
160
160
|
if (!Array.isArray(config))
|
|
161
161
|
throw new Error("config\u5E94\u8BE5\u4E3A\u6570\u7EC4");
|
|
162
|
-
let valuesTmp =
|
|
162
|
+
let valuesTmp = createValues(mForm, config, vue.toRaw(initValues), {});
|
|
163
163
|
const [firstForm] = config;
|
|
164
164
|
if (firstForm && typeof firstForm.onInitValue === "function") {
|
|
165
165
|
valuesTmp = await firstForm.onInitValue(mForm, {
|
|
@@ -178,12 +178,16 @@
|
|
|
178
178
|
key: 4,
|
|
179
179
|
style: { "text-align": "center" }
|
|
180
180
|
};
|
|
181
|
+
const __default__$v = vue.defineComponent({
|
|
182
|
+
name: "MFormContainer"
|
|
183
|
+
});
|
|
181
184
|
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
182
|
-
|
|
185
|
+
...__default__$v,
|
|
183
186
|
props: {
|
|
184
187
|
model: null,
|
|
185
188
|
config: null,
|
|
186
189
|
prop: { default: "" },
|
|
190
|
+
disabled: { type: Boolean },
|
|
187
191
|
labelWidth: null,
|
|
188
192
|
expandMore: { type: Boolean, default: false },
|
|
189
193
|
stepActive: null,
|
|
@@ -214,7 +218,7 @@
|
|
|
214
218
|
return component;
|
|
215
219
|
return "m-fields-text";
|
|
216
220
|
});
|
|
217
|
-
const disabled = vue.computed(() => filterFunction(mForm, props.config.disabled, props));
|
|
221
|
+
const disabled = vue.computed(() => props.disabled || filterFunction(mForm, props.config.disabled, props));
|
|
218
222
|
const tooltip = vue.computed(() => filterFunction(mForm, props.config.tooltip, props));
|
|
219
223
|
const extra = vue.computed(() => filterFunction(mForm, props.config.extra, props));
|
|
220
224
|
const rule = vue.computed(() => getRules(mForm, props.config.rules, props));
|
|
@@ -311,13 +315,14 @@
|
|
|
311
315
|
size: __props.size,
|
|
312
316
|
model: __props.model,
|
|
313
317
|
config: __props.config,
|
|
318
|
+
disabled: vue.unref(disabled),
|
|
314
319
|
name: vue.unref(name),
|
|
315
320
|
prop: vue.unref(itemProp),
|
|
316
321
|
"step-active": __props.stepActive,
|
|
317
322
|
"expand-more": expand.value,
|
|
318
323
|
"label-width": vue.unref(itemLabelWidth),
|
|
319
324
|
onChange: onChangeHandler
|
|
320
|
-
}, 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 }, [
|
|
321
326
|
vue.createVNode(vue.unref(design.TMagicFormItem), {
|
|
322
327
|
style: vue.normalizeStyle(__props.config.tip ? "flex: 1" : ""),
|
|
323
328
|
class: vue.normalizeClass({ hidden: `${vue.unref(itemLabelWidth)}` === "0" || !__props.config.text }),
|
|
@@ -392,18 +397,20 @@
|
|
|
392
397
|
model: vue.unref(name) || vue.unref(name) === 0 ? __props.model[vue.unref(name)] : __props.model,
|
|
393
398
|
config: item,
|
|
394
399
|
size: __props.size,
|
|
400
|
+
disabled: vue.unref(disabled),
|
|
395
401
|
"step-active": __props.stepActive,
|
|
396
402
|
"expand-more": expand.value,
|
|
397
403
|
"label-width": vue.unref(itemLabelWidth),
|
|
398
404
|
prop: vue.unref(itemProp),
|
|
399
405
|
onChange: onChangeHandler
|
|
400
|
-
}, 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"]);
|
|
401
407
|
}), 128)) : vue.createCommentVNode("", true)
|
|
402
408
|
], 64)) : vue.createCommentVNode("", true),
|
|
403
409
|
__props.config.expand && vue.unref(type) !== "fieldset" ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$4, [
|
|
404
410
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
405
411
|
type: "primary",
|
|
406
412
|
size: "small",
|
|
413
|
+
disabled: false,
|
|
407
414
|
text: "",
|
|
408
415
|
onClick: expandHandler
|
|
409
416
|
}, {
|
|
@@ -429,15 +436,19 @@
|
|
|
429
436
|
};
|
|
430
437
|
const _hoisted_7$2 = { style: { "flex": "1" } };
|
|
431
438
|
const _hoisted_8$1 = ["src"];
|
|
439
|
+
const __default__$u = vue.defineComponent({
|
|
440
|
+
name: "MFormFieldset"
|
|
441
|
+
});
|
|
432
442
|
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
433
|
-
|
|
443
|
+
...__default__$u,
|
|
434
444
|
props: {
|
|
435
445
|
labelWidth: null,
|
|
436
446
|
prop: { default: "" },
|
|
437
447
|
size: null,
|
|
438
448
|
model: null,
|
|
439
449
|
config: null,
|
|
440
|
-
rules: { default: {} }
|
|
450
|
+
rules: { default: {} },
|
|
451
|
+
disabled: { type: Boolean }
|
|
441
452
|
},
|
|
442
453
|
emits: ["change"],
|
|
443
454
|
setup(__props, { emit }) {
|
|
@@ -516,10 +527,11 @@
|
|
|
516
527
|
rules: vue.unref(name) ? __props.rules[vue.unref(name)] : [],
|
|
517
528
|
config: item,
|
|
518
529
|
prop: __props.prop,
|
|
530
|
+
disabled: __props.disabled,
|
|
519
531
|
labelWidth: vue.unref(lWidth),
|
|
520
532
|
size: __props.size,
|
|
521
533
|
onChange: change
|
|
522
|
-
}, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size"]);
|
|
534
|
+
}, null, 8, ["model", "rules", "config", "prop", "disabled", "labelWidth", "size"]);
|
|
523
535
|
}), 128))
|
|
524
536
|
]),
|
|
525
537
|
vue.createElementVNode("img", {
|
|
@@ -535,8 +547,9 @@
|
|
|
535
547
|
prop: __props.prop,
|
|
536
548
|
labelWidth: vue.unref(lWidth),
|
|
537
549
|
size: __props.size,
|
|
550
|
+
disabled: __props.disabled,
|
|
538
551
|
onChange: change
|
|
539
|
-
}, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size"]);
|
|
552
|
+
}, null, 8, ["model", "rules", "config", "prop", "labelWidth", "size", "disabled"]);
|
|
540
553
|
}), 128)) : vue.createCommentVNode("", true)
|
|
541
554
|
], 4)) : vue.createCommentVNode("", true);
|
|
542
555
|
};
|
|
@@ -547,8 +560,11 @@
|
|
|
547
560
|
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u79FB");
|
|
548
561
|
const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u79FB");
|
|
549
562
|
const _hoisted_4$4 = ["innerHTML"];
|
|
563
|
+
const __default__$t = vue.defineComponent({
|
|
564
|
+
name: "MFormGroupListItem"
|
|
565
|
+
});
|
|
550
566
|
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
551
|
-
|
|
567
|
+
...__default__$t,
|
|
552
568
|
props: {
|
|
553
569
|
model: null,
|
|
554
570
|
groupModel: null,
|
|
@@ -556,7 +572,8 @@
|
|
|
556
572
|
labelWidth: null,
|
|
557
573
|
prop: null,
|
|
558
574
|
size: null,
|
|
559
|
-
index: null
|
|
575
|
+
index: null,
|
|
576
|
+
disabled: { type: Boolean }
|
|
560
577
|
},
|
|
561
578
|
emits: ["swap-item", "remove-item", "change"],
|
|
562
579
|
setup(__props, { emit }) {
|
|
@@ -617,24 +634,27 @@
|
|
|
617
634
|
}),
|
|
618
635
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
619
636
|
text: "",
|
|
637
|
+
disabled: __props.disabled,
|
|
620
638
|
onClick: expandHandler
|
|
621
639
|
}, {
|
|
622
640
|
default: vue.withCtx(() => [
|
|
623
641
|
vue.createTextVNode(vue.toDisplayString(vue.unref(title)), 1)
|
|
624
642
|
]),
|
|
625
643
|
_: 1
|
|
626
|
-
}),
|
|
644
|
+
}, 8, ["disabled"]),
|
|
627
645
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
646
|
+
style: { "color": "#f56c6c" },
|
|
628
647
|
text: "",
|
|
629
648
|
icon: vue.unref(iconsVue.Delete),
|
|
630
|
-
|
|
649
|
+
disabled: __props.disabled,
|
|
631
650
|
onClick: removeHandler
|
|
632
|
-
}, null, 8, ["icon"]), [
|
|
651
|
+
}, null, 8, ["icon", "disabled"]), [
|
|
633
652
|
[vue.vShow, showDelete(parseInt(String(__props.index)))]
|
|
634
653
|
]),
|
|
635
654
|
movable() ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
636
655
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
637
656
|
text: "",
|
|
657
|
+
disabled: __props.disabled,
|
|
638
658
|
size: "small",
|
|
639
659
|
onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
|
|
640
660
|
}, {
|
|
@@ -648,10 +668,11 @@
|
|
|
648
668
|
})
|
|
649
669
|
]),
|
|
650
670
|
_: 1
|
|
651
|
-
},
|
|
671
|
+
}, 8, ["disabled"]), [
|
|
652
672
|
[vue.vShow, __props.index !== 0]
|
|
653
673
|
]),
|
|
654
674
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicButton), {
|
|
675
|
+
disabled: __props.disabled,
|
|
655
676
|
text: "",
|
|
656
677
|
size: "small",
|
|
657
678
|
onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
|
|
@@ -666,7 +687,7 @@
|
|
|
666
687
|
})
|
|
667
688
|
]),
|
|
668
689
|
_: 1
|
|
669
|
-
},
|
|
690
|
+
}, 8, ["disabled"]), [
|
|
670
691
|
[vue.vShow, __props.index !== vue.unref(length) - 1]
|
|
671
692
|
])
|
|
672
693
|
], 64)) : vue.createCommentVNode("", true),
|
|
@@ -683,8 +704,9 @@
|
|
|
683
704
|
labelWidth: __props.labelWidth,
|
|
684
705
|
prop: `${__props.prop}${__props.prop ? "." : ""}${String(__props.index)}`,
|
|
685
706
|
size: __props.size,
|
|
707
|
+
disabled: __props.disabled,
|
|
686
708
|
onChange: changeHandler
|
|
687
|
-
}, null, 8, ["config", "model", "labelWidth", "prop", "size"])) : vue.createCommentVNode("", true)
|
|
709
|
+
}, null, 8, ["config", "model", "labelWidth", "prop", "size", "disabled"])) : vue.createCommentVNode("", true)
|
|
688
710
|
]);
|
|
689
711
|
};
|
|
690
712
|
}
|
|
@@ -702,15 +724,19 @@
|
|
|
702
724
|
];
|
|
703
725
|
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("\u6DFB\u52A0\u7EC4");
|
|
704
726
|
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("\u5207\u6362\u4E3A\u8868\u683C");
|
|
727
|
+
const __default__$s = vue.defineComponent({
|
|
728
|
+
name: "MFormGroupList"
|
|
729
|
+
});
|
|
705
730
|
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
706
|
-
|
|
731
|
+
...__default__$s,
|
|
707
732
|
props: {
|
|
708
733
|
model: null,
|
|
709
734
|
config: null,
|
|
710
735
|
name: null,
|
|
711
736
|
labelWidth: null,
|
|
712
737
|
prop: null,
|
|
713
|
-
size: null
|
|
738
|
+
size: null,
|
|
739
|
+
disabled: { type: Boolean }
|
|
714
740
|
},
|
|
715
741
|
emits: ["change"],
|
|
716
742
|
setup(__props, { emit }) {
|
|
@@ -792,22 +818,24 @@
|
|
|
792
818
|
index,
|
|
793
819
|
"label-width": __props.labelWidth,
|
|
794
820
|
size: __props.size,
|
|
821
|
+
disabled: __props.disabled,
|
|
795
822
|
"group-model": __props.model[__props.name],
|
|
796
823
|
onRemoveItem: removeHandler,
|
|
797
824
|
onSwapItem: swapHandler,
|
|
798
825
|
onChange: changeHandler
|
|
799
|
-
}, null, 8, ["model", "config", "prop", "index", "label-width", "size", "group-model"]);
|
|
826
|
+
}, null, 8, ["model", "config", "prop", "index", "label-width", "size", "disabled", "group-model"]);
|
|
800
827
|
}), 128)),
|
|
801
828
|
vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
802
829
|
key: 3,
|
|
803
830
|
onClick: addHandler,
|
|
804
|
-
size: "small"
|
|
831
|
+
size: "small",
|
|
832
|
+
disabled: __props.disabled
|
|
805
833
|
}, {
|
|
806
834
|
default: vue.withCtx(() => [
|
|
807
835
|
_hoisted_6$1
|
|
808
836
|
]),
|
|
809
837
|
_: 1
|
|
810
|
-
})) : vue.createCommentVNode("", true),
|
|
838
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
811
839
|
__props.config.enableToggleMode ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
812
840
|
key: 4,
|
|
813
841
|
icon: vue.unref(iconsVue.Grid),
|
|
@@ -832,15 +860,19 @@
|
|
|
832
860
|
};
|
|
833
861
|
const _hoisted_4$2 = { style: { "flex": "1" } };
|
|
834
862
|
const _hoisted_5$1 = ["src"];
|
|
863
|
+
const __default__$r = vue.defineComponent({
|
|
864
|
+
name: "MFormPanel"
|
|
865
|
+
});
|
|
835
866
|
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
836
|
-
|
|
867
|
+
...__default__$r,
|
|
837
868
|
props: {
|
|
838
869
|
model: null,
|
|
839
870
|
config: null,
|
|
840
871
|
name: null,
|
|
841
872
|
labelWidth: null,
|
|
842
873
|
prop: null,
|
|
843
|
-
size: null
|
|
874
|
+
size: null,
|
|
875
|
+
disabled: { type: Boolean }
|
|
844
876
|
},
|
|
845
877
|
emits: ["change"],
|
|
846
878
|
setup(__props, { emit }) {
|
|
@@ -890,9 +922,10 @@
|
|
|
890
922
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
891
923
|
prop: __props.prop,
|
|
892
924
|
size: __props.size,
|
|
925
|
+
disabled: __props.disabled,
|
|
893
926
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
894
927
|
onChange: changeHandler
|
|
895
|
-
}, null, 8, ["config", "model", "prop", "size", "label-width"]);
|
|
928
|
+
}, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"]);
|
|
896
929
|
}), 128))
|
|
897
930
|
]),
|
|
898
931
|
vue.createElementVNode("img", {
|
|
@@ -906,9 +939,10 @@
|
|
|
906
939
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
907
940
|
prop: __props.prop,
|
|
908
941
|
size: __props.size,
|
|
942
|
+
disabled: __props.disabled,
|
|
909
943
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
910
944
|
onChange: changeHandler
|
|
911
|
-
}, null, 8, ["config", "model", "prop", "size", "label-width"]);
|
|
945
|
+
}, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"]);
|
|
912
946
|
}), 128))
|
|
913
947
|
])
|
|
914
948
|
]),
|
|
@@ -918,8 +952,11 @@
|
|
|
918
952
|
}
|
|
919
953
|
});
|
|
920
954
|
|
|
955
|
+
const __default__$q = vue.defineComponent({
|
|
956
|
+
name: "MFormCol"
|
|
957
|
+
});
|
|
921
958
|
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
922
|
-
|
|
959
|
+
...__default__$q,
|
|
923
960
|
props: {
|
|
924
961
|
model: null,
|
|
925
962
|
config: null,
|
|
@@ -927,7 +964,8 @@
|
|
|
927
964
|
expandMore: { type: Boolean },
|
|
928
965
|
span: null,
|
|
929
966
|
size: null,
|
|
930
|
-
prop: null
|
|
967
|
+
prop: null,
|
|
968
|
+
disabled: { type: Boolean }
|
|
931
969
|
},
|
|
932
970
|
emits: ["change"],
|
|
933
971
|
setup(__props, { emit }) {
|
|
@@ -945,8 +983,9 @@
|
|
|
945
983
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
946
984
|
"expand-more": __props.expandMore,
|
|
947
985
|
size: __props.size,
|
|
986
|
+
disabled: __props.disabled,
|
|
948
987
|
onChange: changeHandler
|
|
949
|
-
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size"])
|
|
988
|
+
}, null, 8, ["model", "config", "prop", "label-width", "expand-more", "size", "disabled"])
|
|
950
989
|
]),
|
|
951
990
|
_: 1
|
|
952
991
|
}, 8, ["span"])), [
|
|
@@ -956,8 +995,11 @@
|
|
|
956
995
|
}
|
|
957
996
|
});
|
|
958
997
|
|
|
998
|
+
const __default__$p = vue.defineComponent({
|
|
999
|
+
name: "MFormRow"
|
|
1000
|
+
});
|
|
959
1001
|
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
960
|
-
|
|
1002
|
+
...__default__$p,
|
|
961
1003
|
props: {
|
|
962
1004
|
model: null,
|
|
963
1005
|
config: null,
|
|
@@ -965,7 +1007,8 @@
|
|
|
965
1007
|
labelWidth: null,
|
|
966
1008
|
prop: null,
|
|
967
1009
|
size: null,
|
|
968
|
-
expandMore: { type: Boolean }
|
|
1010
|
+
expandMore: { type: Boolean },
|
|
1011
|
+
disabled: { type: Boolean }
|
|
969
1012
|
},
|
|
970
1013
|
emits: ["change"],
|
|
971
1014
|
setup(__props, { emit }) {
|
|
@@ -985,8 +1028,9 @@
|
|
|
985
1028
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
986
1029
|
prop: __props.prop,
|
|
987
1030
|
size: __props.size,
|
|
1031
|
+
disabled: __props.disabled,
|
|
988
1032
|
onChange: changeHandler
|
|
989
|
-
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size"]);
|
|
1033
|
+
}, null, 8, ["span", "config", "labelWidth", "expandMore", "model", "prop", "size", "disabled"]);
|
|
990
1034
|
}), 128))
|
|
991
1035
|
]),
|
|
992
1036
|
_: 1
|
|
@@ -995,14 +1039,18 @@
|
|
|
995
1039
|
}
|
|
996
1040
|
});
|
|
997
1041
|
|
|
1042
|
+
const __default__$o = vue.defineComponent({
|
|
1043
|
+
name: "MFormStep"
|
|
1044
|
+
});
|
|
998
1045
|
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
999
|
-
|
|
1046
|
+
...__default__$o,
|
|
1000
1047
|
props: {
|
|
1001
1048
|
model: null,
|
|
1002
1049
|
config: null,
|
|
1003
1050
|
stepActive: { default: 1 },
|
|
1004
1051
|
labelWidth: null,
|
|
1005
|
-
size: null
|
|
1052
|
+
size: null,
|
|
1053
|
+
disabled: { type: Boolean }
|
|
1006
1054
|
},
|
|
1007
1055
|
emits: ["change"],
|
|
1008
1056
|
setup(__props, { emit }) {
|
|
@@ -1048,9 +1096,10 @@
|
|
|
1048
1096
|
model: step.name ? __props.model[step.name] : __props.model,
|
|
1049
1097
|
prop: `${step.name}`,
|
|
1050
1098
|
size: __props.size,
|
|
1099
|
+
disabled: __props.disabled,
|
|
1051
1100
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
1052
1101
|
onChange: changeHandler
|
|
1053
|
-
}, null, 8, ["config", "model", "prop", "size", "label-width"])), [
|
|
1102
|
+
}, null, 8, ["config", "model", "prop", "size", "disabled", "label-width"])), [
|
|
1054
1103
|
[vue.vShow, active.value - 1 === index]
|
|
1055
1104
|
]) : vue.createCommentVNode("", true)
|
|
1056
1105
|
], 64);
|
|
@@ -1072,11 +1121,15 @@
|
|
|
1072
1121
|
const _hoisted_8 = /* @__PURE__ */ vue.createTextVNode("\xA0 ");
|
|
1073
1122
|
const _hoisted_9 = /* @__PURE__ */ vue.createTextVNode("\u6E05\u7A7A");
|
|
1074
1123
|
const _hoisted_10 = {
|
|
1124
|
+
key: 1,
|
|
1075
1125
|
class: "bottom",
|
|
1076
1126
|
style: { "text-align": "right" }
|
|
1077
1127
|
};
|
|
1128
|
+
const __default__$n = vue.defineComponent({
|
|
1129
|
+
name: "MFormTable"
|
|
1130
|
+
});
|
|
1078
1131
|
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
1079
|
-
|
|
1132
|
+
...__default__$n,
|
|
1080
1133
|
props: {
|
|
1081
1134
|
model: null,
|
|
1082
1135
|
config: null,
|
|
@@ -1084,6 +1137,7 @@
|
|
|
1084
1137
|
prop: { default: "" },
|
|
1085
1138
|
labelWidth: null,
|
|
1086
1139
|
sort: { type: Boolean },
|
|
1140
|
+
disabled: { type: Boolean },
|
|
1087
1141
|
sortKey: { default: "" },
|
|
1088
1142
|
text: null,
|
|
1089
1143
|
size: null,
|
|
@@ -1103,6 +1157,11 @@
|
|
|
1103
1157
|
const updateKey = vue.ref(1);
|
|
1104
1158
|
const isFullscreen = vue.ref(false);
|
|
1105
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
|
+
);
|
|
1106
1165
|
const sortChange = ({ prop, order }) => {
|
|
1107
1166
|
if (order === "ascending") {
|
|
1108
1167
|
props.model[modelName.value] = props.model[modelName.value].sort((a, b) => a[prop] - b[prop]);
|
|
@@ -1128,10 +1187,10 @@
|
|
|
1128
1187
|
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
1129
1188
|
};
|
|
1130
1189
|
const rowDrop = () => {
|
|
1131
|
-
const tableEl = tMagicTable.value
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
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, {
|
|
1135
1194
|
onEnd: ({ newIndex, oldIndex }) => {
|
|
1136
1195
|
if (typeof newIndex === "undefined")
|
|
1137
1196
|
return;
|
|
@@ -1143,11 +1202,11 @@
|
|
|
1143
1202
|
sortable.destroy();
|
|
1144
1203
|
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
1145
1204
|
utils.sleep(1e3).then(() => {
|
|
1146
|
-
const
|
|
1147
|
-
if (
|
|
1148
|
-
|
|
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)";
|
|
1149
1208
|
utils.sleep(1e3).then(() => {
|
|
1150
|
-
|
|
1209
|
+
elTrs[newIndex].style.backgroundColor = "";
|
|
1151
1210
|
});
|
|
1152
1211
|
}
|
|
1153
1212
|
});
|
|
@@ -1218,6 +1277,8 @@
|
|
|
1218
1277
|
if (props.sort && props.sortKey) {
|
|
1219
1278
|
props.model[modelName.value].sort((a, b) => b[props.sortKey] - a[props.sortKey]);
|
|
1220
1279
|
}
|
|
1280
|
+
});
|
|
1281
|
+
vue.watchEffect(() => {
|
|
1221
1282
|
if (props.config.dropSort) {
|
|
1222
1283
|
rowDrop();
|
|
1223
1284
|
}
|
|
@@ -1264,6 +1325,8 @@
|
|
|
1264
1325
|
return fuc;
|
|
1265
1326
|
};
|
|
1266
1327
|
const removeHandler = (index) => {
|
|
1328
|
+
if (props.disabled)
|
|
1329
|
+
return;
|
|
1267
1330
|
props.model[modelName.value].splice(index, 1);
|
|
1268
1331
|
emit("change", props.model[modelName.value]);
|
|
1269
1332
|
};
|
|
@@ -1280,8 +1343,11 @@
|
|
|
1280
1343
|
const toggleRowSelection = (row, selected) => {
|
|
1281
1344
|
tMagicTable.value?.toggleRowSelection.call(tMagicTable.value, row, selected);
|
|
1282
1345
|
};
|
|
1283
|
-
const makeConfig = (config) => {
|
|
1346
|
+
const makeConfig = (config, row) => {
|
|
1284
1347
|
const newConfig = lodashEs.cloneDeep(config);
|
|
1348
|
+
if (typeof config.itemsFunction === "function") {
|
|
1349
|
+
newConfig.items = config.itemsFunction(row);
|
|
1350
|
+
}
|
|
1285
1351
|
delete newConfig.display;
|
|
1286
1352
|
return newConfig;
|
|
1287
1353
|
};
|
|
@@ -1339,8 +1405,8 @@
|
|
|
1339
1405
|
}
|
|
1340
1406
|
const reader = new FileReader();
|
|
1341
1407
|
reader.onload = () => {
|
|
1342
|
-
const
|
|
1343
|
-
const pdata = globalThis.XLSX.read(
|
|
1408
|
+
const data2 = reader.result;
|
|
1409
|
+
const pdata = globalThis.XLSX.read(data2, { type: "array" });
|
|
1344
1410
|
pdata.SheetNames.forEach((sheetName) => {
|
|
1345
1411
|
const arr = globalThis.XLSX.utils.sheet_to_json(pdata.Sheets[sheetName], { header: 1 });
|
|
1346
1412
|
if (arr?.[0]) {
|
|
@@ -1422,7 +1488,8 @@
|
|
|
1422
1488
|
ref_key: "tMagicTable",
|
|
1423
1489
|
ref: tMagicTable,
|
|
1424
1490
|
style: { "width": "100%" },
|
|
1425
|
-
|
|
1491
|
+
"row-key": __props.config.rowKey || "id",
|
|
1492
|
+
data: vue.unref(data),
|
|
1426
1493
|
border: __props.config.border,
|
|
1427
1494
|
"max-height": __props.config.maxHeight,
|
|
1428
1495
|
"default-expand-all": true,
|
|
@@ -1447,11 +1514,12 @@
|
|
|
1447
1514
|
})) : vue.createCommentVNode("", true),
|
|
1448
1515
|
vue.createVNode(vue.unref(design.TMagicTableColumn), {
|
|
1449
1516
|
label: "\u64CD\u4F5C",
|
|
1450
|
-
width:
|
|
1517
|
+
width: __props.config.operateColWidth || 55,
|
|
1451
1518
|
align: "center",
|
|
1452
1519
|
fixed: __props.config.fixed === false ? void 0 : "left"
|
|
1453
1520
|
}, {
|
|
1454
1521
|
default: vue.withCtx((scope) => [
|
|
1522
|
+
vue.renderSlot(_ctx.$slots, "operateCol", { scope }),
|
|
1455
1523
|
vue.withDirectives(vue.createVNode(vue.unref(design.TMagicIcon), {
|
|
1456
1524
|
class: "m-table-delete-icon",
|
|
1457
1525
|
onClick: ($event) => removeHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
@@ -1464,8 +1532,8 @@
|
|
|
1464
1532
|
[vue.vShow, showDelete(scope.$index + 1 + pagecontext.value * pagesize.value - 1)]
|
|
1465
1533
|
])
|
|
1466
1534
|
]),
|
|
1467
|
-
_:
|
|
1468
|
-
}, 8, ["fixed"]),
|
|
1535
|
+
_: 3
|
|
1536
|
+
}, 8, ["width", "fixed"]),
|
|
1469
1537
|
__props.sort && __props.model[vue.unref(modelName)] && __props.model[vue.unref(modelName)].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1470
1538
|
key: 1,
|
|
1471
1539
|
label: "\u6392\u5E8F",
|
|
@@ -1483,10 +1551,11 @@
|
|
|
1483
1551
|
size: "small",
|
|
1484
1552
|
type: "primary",
|
|
1485
1553
|
icon: vue.unref(iconsVue.ArrowUp),
|
|
1554
|
+
disabled: __props.disabled,
|
|
1486
1555
|
text: "",
|
|
1487
1556
|
onClick: ($event) => upHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1488
1557
|
onDblclick: ($event) => topHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1489
|
-
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
1558
|
+
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1490
1559
|
]),
|
|
1491
1560
|
_: 2
|
|
1492
1561
|
}, 1024)) : vue.createCommentVNode("", true),
|
|
@@ -1501,10 +1570,11 @@
|
|
|
1501
1570
|
size: "small",
|
|
1502
1571
|
type: "primary",
|
|
1503
1572
|
icon: vue.unref(iconsVue.ArrowDown),
|
|
1573
|
+
disabled: __props.disabled,
|
|
1504
1574
|
text: "",
|
|
1505
1575
|
onClick: ($event) => downHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1),
|
|
1506
1576
|
onDblclick: ($event) => bottomHandler(scope.$index + 1 + pagecontext.value * pagesize.value - 1)
|
|
1507
|
-
}, null, 8, ["icon", "onClick", "onDblclick"])
|
|
1577
|
+
}, null, 8, ["icon", "disabled", "onClick", "onDblclick"])
|
|
1508
1578
|
]),
|
|
1509
1579
|
_: 2
|
|
1510
1580
|
}, 1024)) : vue.createCommentVNode("", true)
|
|
@@ -1543,29 +1613,31 @@
|
|
|
1543
1613
|
scope.$index > -1 ? (vue.openBlock(), vue.createBlock(_sfc_main$v, {
|
|
1544
1614
|
key: 0,
|
|
1545
1615
|
labelWidth: "0",
|
|
1616
|
+
disabled: __props.disabled,
|
|
1546
1617
|
prop: getProp(scope.$index),
|
|
1547
1618
|
rules: column.rules,
|
|
1548
|
-
config: makeConfig(column),
|
|
1619
|
+
config: makeConfig(column, scope.row),
|
|
1549
1620
|
model: scope.row,
|
|
1550
1621
|
size: __props.size,
|
|
1551
1622
|
onChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("change", __props.model[vue.unref(modelName)]))
|
|
1552
|
-
}, null, 8, ["prop", "rules", "config", "model", "size"])) : vue.createCommentVNode("", true)
|
|
1623
|
+
}, null, 8, ["disabled", "prop", "rules", "config", "model", "size"])) : vue.createCommentVNode("", true)
|
|
1553
1624
|
]),
|
|
1554
1625
|
_: 2
|
|
1555
1626
|
}, 1032, ["prop", "width", "label", "sortable", "class-name"])) : vue.createCommentVNode("", true)
|
|
1556
1627
|
], 64);
|
|
1557
1628
|
}), 256))
|
|
1558
1629
|
]),
|
|
1559
|
-
_:
|
|
1560
|
-
}, 8, ["data", "border", "max-height"])) : vue.createCommentVNode("", true)
|
|
1630
|
+
_: 3
|
|
1631
|
+
}, 8, ["row-key", "data", "border", "max-height"])) : vue.createCommentVNode("", true)
|
|
1561
1632
|
]),
|
|
1562
|
-
_:
|
|
1633
|
+
_: 3
|
|
1563
1634
|
}, 8, ["disabled"]),
|
|
1564
1635
|
vue.renderSlot(_ctx.$slots, "default"),
|
|
1565
1636
|
vue.unref(addable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1566
1637
|
key: 0,
|
|
1567
1638
|
size: "small",
|
|
1568
1639
|
type: "primary",
|
|
1640
|
+
disabled: __props.disabled,
|
|
1569
1641
|
plain: "",
|
|
1570
1642
|
onClick: _cache[1] || (_cache[1] = ($event) => newHandler())
|
|
1571
1643
|
}, {
|
|
@@ -1573,7 +1645,7 @@
|
|
|
1573
1645
|
_hoisted_4$1
|
|
1574
1646
|
]),
|
|
1575
1647
|
_: 1
|
|
1576
|
-
})) : vue.createCommentVNode("", true),
|
|
1648
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1577
1649
|
_hoisted_5,
|
|
1578
1650
|
__props.enableToggleMode && !isFullscreen.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1579
1651
|
key: 1,
|
|
@@ -1601,32 +1673,35 @@
|
|
|
1601
1673
|
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
1602
1674
|
vue.unref(importable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicUpload), {
|
|
1603
1675
|
key: 3,
|
|
1676
|
+
style: { "display": "inline-block" },
|
|
1604
1677
|
ref_key: "excelBtn",
|
|
1605
1678
|
ref: excelBtn,
|
|
1606
1679
|
action: "/noop",
|
|
1680
|
+
disabled: __props.disabled,
|
|
1607
1681
|
"on-change": excelHandler,
|
|
1608
|
-
"auto-upload": false
|
|
1609
|
-
style: { "display": "inline-block" }
|
|
1682
|
+
"auto-upload": false
|
|
1610
1683
|
}, {
|
|
1611
1684
|
default: vue.withCtx(() => [
|
|
1612
1685
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
1613
1686
|
size: "small",
|
|
1614
1687
|
type: "success",
|
|
1688
|
+
disabled: __props.disabled,
|
|
1615
1689
|
plain: ""
|
|
1616
1690
|
}, {
|
|
1617
1691
|
default: vue.withCtx(() => [
|
|
1618
1692
|
_hoisted_7
|
|
1619
1693
|
]),
|
|
1620
1694
|
_: 1
|
|
1621
|
-
})
|
|
1695
|
+
}, 8, ["disabled"])
|
|
1622
1696
|
]),
|
|
1623
1697
|
_: 1
|
|
1624
|
-
},
|
|
1698
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true),
|
|
1625
1699
|
_hoisted_8,
|
|
1626
1700
|
vue.unref(importable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
1627
1701
|
key: 4,
|
|
1628
1702
|
size: "small",
|
|
1629
1703
|
type: "warning",
|
|
1704
|
+
disabled: __props.disabled,
|
|
1630
1705
|
plain: "",
|
|
1631
1706
|
onClick: _cache[2] || (_cache[2] = ($event) => clearHandler())
|
|
1632
1707
|
}, {
|
|
@@ -1634,9 +1709,9 @@
|
|
|
1634
1709
|
_hoisted_9
|
|
1635
1710
|
]),
|
|
1636
1711
|
_: 1
|
|
1637
|
-
})) : vue.createCommentVNode("", true)
|
|
1712
|
+
}, 8, ["disabled"])) : vue.createCommentVNode("", true)
|
|
1638
1713
|
]),
|
|
1639
|
-
vue.
|
|
1714
|
+
__props.config.pagination ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10, [
|
|
1640
1715
|
vue.createVNode(vue.unref(design.TMagicPagination), {
|
|
1641
1716
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
1642
1717
|
"hide-on-single-page": __props.model[vue.unref(modelName)].length < pagesize.value,
|
|
@@ -1647,14 +1722,17 @@
|
|
|
1647
1722
|
onSizeChange: handleSizeChange,
|
|
1648
1723
|
onCurrentChange: handleCurrentChange
|
|
1649
1724
|
}, null, 8, ["hide-on-single-page", "current-page", "page-sizes", "page-size", "total"])
|
|
1650
|
-
])
|
|
1725
|
+
])) : vue.createCommentVNode("", true)
|
|
1651
1726
|
], 2);
|
|
1652
1727
|
};
|
|
1653
1728
|
}
|
|
1654
1729
|
});
|
|
1655
1730
|
|
|
1731
|
+
const __default__$m = vue.defineComponent({
|
|
1732
|
+
name: "MFormTabs"
|
|
1733
|
+
});
|
|
1656
1734
|
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
1657
|
-
|
|
1735
|
+
...__default__$m,
|
|
1658
1736
|
props: {
|
|
1659
1737
|
model: null,
|
|
1660
1738
|
config: null,
|
|
@@ -1662,11 +1740,13 @@
|
|
|
1662
1740
|
size: null,
|
|
1663
1741
|
labelWidth: null,
|
|
1664
1742
|
prop: null,
|
|
1665
|
-
expandMore: { type: Boolean }
|
|
1743
|
+
expandMore: { type: Boolean },
|
|
1744
|
+
disabled: { type: Boolean }
|
|
1666
1745
|
},
|
|
1667
1746
|
emits: ["change"],
|
|
1668
1747
|
setup(__props, { emit }) {
|
|
1669
1748
|
const props = __props;
|
|
1749
|
+
const uiComponent = design.getConfig("components").tabPane;
|
|
1670
1750
|
const getActive = (mForm2, props2, activeTabName2) => {
|
|
1671
1751
|
const { config, model, prop } = props2;
|
|
1672
1752
|
const { active } = config;
|
|
@@ -1768,7 +1848,7 @@
|
|
|
1768
1848
|
default: vue.withCtx(() => [
|
|
1769
1849
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tabs), (tab, tabIndex) => {
|
|
1770
1850
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
1771
|
-
display$1(tab.display) && tabItems(tab).length ? (vue.openBlock(), vue.createBlock(vue.unref(
|
|
1851
|
+
display$1(tab.display) && tabItems(tab).length ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(uiComponent).component), {
|
|
1772
1852
|
key: tab[vue.unref(mForm)?.keyProp || "__key"] ?? tabIndex,
|
|
1773
1853
|
name: filter(tab.status) || tabIndex.toString(),
|
|
1774
1854
|
label: filter(tab.title),
|
|
@@ -1779,13 +1859,14 @@
|
|
|
1779
1859
|
return vue.openBlock(), vue.createBlock(_sfc_main$v, {
|
|
1780
1860
|
key: item[vue.unref(mForm)?.keyProp || "__key"],
|
|
1781
1861
|
config: item,
|
|
1862
|
+
disabled: __props.disabled,
|
|
1782
1863
|
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,
|
|
1783
1864
|
prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
|
|
1784
1865
|
size: __props.size,
|
|
1785
1866
|
"label-width": tab.labelWidth || __props.labelWidth,
|
|
1786
1867
|
"expand-more": __props.expandMore,
|
|
1787
1868
|
onChange: changeHandler
|
|
1788
|
-
}, null, 8, ["config", "model", "prop", "size", "label-width", "expand-more"]);
|
|
1869
|
+
}, null, 8, ["config", "disabled", "model", "prop", "size", "label-width", "expand-more"]);
|
|
1789
1870
|
}), 128))
|
|
1790
1871
|
]),
|
|
1791
1872
|
_: 2
|
|
@@ -1825,8 +1906,11 @@
|
|
|
1825
1906
|
);
|
|
1826
1907
|
};
|
|
1827
1908
|
|
|
1909
|
+
const __default__$l = vue.defineComponent({
|
|
1910
|
+
name: "MFormCascader"
|
|
1911
|
+
});
|
|
1828
1912
|
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
1829
|
-
|
|
1913
|
+
...__default__$l,
|
|
1830
1914
|
props: {
|
|
1831
1915
|
config: null,
|
|
1832
1916
|
model: null,
|
|
@@ -1909,8 +1993,11 @@
|
|
|
1909
1993
|
}
|
|
1910
1994
|
});
|
|
1911
1995
|
|
|
1996
|
+
const __default__$k = vue.defineComponent({
|
|
1997
|
+
name: "MFormCheckbox"
|
|
1998
|
+
});
|
|
1912
1999
|
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
1913
|
-
|
|
2000
|
+
...__default__$k,
|
|
1914
2001
|
props: {
|
|
1915
2002
|
config: null,
|
|
1916
2003
|
model: null,
|
|
@@ -1967,8 +2054,11 @@
|
|
|
1967
2054
|
}
|
|
1968
2055
|
});
|
|
1969
2056
|
|
|
2057
|
+
const __default__$j = vue.defineComponent({
|
|
2058
|
+
name: "MFormCheckGroup"
|
|
2059
|
+
});
|
|
1970
2060
|
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
1971
|
-
|
|
2061
|
+
...__default__$j,
|
|
1972
2062
|
props: {
|
|
1973
2063
|
config: null,
|
|
1974
2064
|
model: null,
|
|
@@ -2009,6 +2099,7 @@
|
|
|
2009
2099
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(options), (option) => {
|
|
2010
2100
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCheckbox), {
|
|
2011
2101
|
label: option.value,
|
|
2102
|
+
value: option.value,
|
|
2012
2103
|
key: option.value,
|
|
2013
2104
|
disabled: option.disabled
|
|
2014
2105
|
}, {
|
|
@@ -2016,7 +2107,7 @@
|
|
|
2016
2107
|
vue.createTextVNode(vue.toDisplayString(option.text), 1)
|
|
2017
2108
|
]),
|
|
2018
2109
|
_: 2
|
|
2019
|
-
}, 1032, ["label", "disabled"]);
|
|
2110
|
+
}, 1032, ["label", "value", "disabled"]);
|
|
2020
2111
|
}), 128))
|
|
2021
2112
|
]),
|
|
2022
2113
|
_: 1
|
|
@@ -2025,8 +2116,11 @@
|
|
|
2025
2116
|
}
|
|
2026
2117
|
});
|
|
2027
2118
|
|
|
2119
|
+
const __default__$i = vue.defineComponent({
|
|
2120
|
+
name: "MFormColorPicker"
|
|
2121
|
+
});
|
|
2028
2122
|
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
2029
|
-
|
|
2123
|
+
...__default__$i,
|
|
2030
2124
|
props: {
|
|
2031
2125
|
config: null,
|
|
2032
2126
|
model: null,
|
|
@@ -2055,8 +2149,11 @@
|
|
|
2055
2149
|
}
|
|
2056
2150
|
});
|
|
2057
2151
|
|
|
2152
|
+
const __default__$h = vue.defineComponent({
|
|
2153
|
+
name: "MFormDate"
|
|
2154
|
+
});
|
|
2058
2155
|
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
2059
|
-
|
|
2156
|
+
...__default__$h,
|
|
2060
2157
|
props: {
|
|
2061
2158
|
config: null,
|
|
2062
2159
|
model: null,
|
|
@@ -2084,15 +2181,18 @@
|
|
|
2084
2181
|
placeholder: __props.config.placeholder,
|
|
2085
2182
|
disabled: __props.disabled,
|
|
2086
2183
|
format: __props.config.format,
|
|
2087
|
-
"value-format": __props.config.
|
|
2184
|
+
"value-format": __props.config.valueFormat || "YYYY-MM-DD HH:mm:ss",
|
|
2088
2185
|
onChange: changeHandler
|
|
2089
2186
|
}, null, 8, ["modelValue", "size", "placeholder", "disabled", "format", "value-format"]);
|
|
2090
2187
|
};
|
|
2091
2188
|
}
|
|
2092
2189
|
});
|
|
2093
2190
|
|
|
2191
|
+
const __default__$g = vue.defineComponent({
|
|
2192
|
+
name: "MFormDateRange"
|
|
2193
|
+
});
|
|
2094
2194
|
const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
|
|
2095
|
-
|
|
2195
|
+
...__default__$g,
|
|
2096
2196
|
props: {
|
|
2097
2197
|
config: null,
|
|
2098
2198
|
model: null,
|
|
@@ -2189,8 +2289,11 @@
|
|
|
2189
2289
|
}
|
|
2190
2290
|
});
|
|
2191
2291
|
|
|
2292
|
+
const __default__$f = vue.defineComponent({
|
|
2293
|
+
name: "MFormDateTime"
|
|
2294
|
+
});
|
|
2192
2295
|
const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
|
|
2193
|
-
|
|
2296
|
+
...__default__$f,
|
|
2194
2297
|
props: {
|
|
2195
2298
|
config: null,
|
|
2196
2299
|
model: null,
|
|
@@ -2235,8 +2338,11 @@
|
|
|
2235
2338
|
});
|
|
2236
2339
|
|
|
2237
2340
|
const _hoisted_1$5 = { key: 0 };
|
|
2341
|
+
const __default__$e = vue.defineComponent({
|
|
2342
|
+
name: "MFormDisplay"
|
|
2343
|
+
});
|
|
2238
2344
|
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
2239
|
-
|
|
2345
|
+
...__default__$e,
|
|
2240
2346
|
props: {
|
|
2241
2347
|
config: null,
|
|
2242
2348
|
model: null,
|
|
@@ -2258,8 +2364,11 @@
|
|
|
2258
2364
|
});
|
|
2259
2365
|
|
|
2260
2366
|
const _hoisted_1$4 = { class: "m-fields-dynamic-field" };
|
|
2367
|
+
const __default__$d = vue.defineComponent({
|
|
2368
|
+
name: "MFormDynamicField"
|
|
2369
|
+
});
|
|
2261
2370
|
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
2262
|
-
|
|
2371
|
+
...__default__$d,
|
|
2263
2372
|
props: {
|
|
2264
2373
|
config: null,
|
|
2265
2374
|
model: null,
|
|
@@ -2346,8 +2455,11 @@
|
|
|
2346
2455
|
}
|
|
2347
2456
|
});
|
|
2348
2457
|
|
|
2458
|
+
const __default__$c = vue.defineComponent({
|
|
2459
|
+
name: "MFormHidden"
|
|
2460
|
+
});
|
|
2349
2461
|
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
2350
|
-
|
|
2462
|
+
...__default__$c,
|
|
2351
2463
|
props: {
|
|
2352
2464
|
config: null,
|
|
2353
2465
|
model: null,
|
|
@@ -2371,8 +2483,11 @@
|
|
|
2371
2483
|
}
|
|
2372
2484
|
});
|
|
2373
2485
|
|
|
2486
|
+
const __default__$b = vue.defineComponent({
|
|
2487
|
+
name: "MForm"
|
|
2488
|
+
});
|
|
2374
2489
|
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
2375
|
-
|
|
2490
|
+
...__default__$b,
|
|
2376
2491
|
props: {
|
|
2377
2492
|
config: { default: () => [] },
|
|
2378
2493
|
initValues: { default: () => ({}) },
|
|
@@ -2476,7 +2591,6 @@
|
|
|
2476
2591
|
ref: tMagicForm,
|
|
2477
2592
|
model: values.value,
|
|
2478
2593
|
"label-width": __props.labelWidth,
|
|
2479
|
-
disabled: __props.disabled,
|
|
2480
2594
|
style: vue.normalizeStyle(`height: ${__props.height}`),
|
|
2481
2595
|
inline: __props.inline,
|
|
2482
2596
|
"label-position": __props.labelPosition
|
|
@@ -2484,6 +2598,7 @@
|
|
|
2484
2598
|
default: vue.withCtx(() => [
|
|
2485
2599
|
initialized.value && Array.isArray(__props.config) ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(__props.config, (item, index) => {
|
|
2486
2600
|
return vue.openBlock(), vue.createBlock(_sfc_main$v, {
|
|
2601
|
+
disabled: __props.disabled,
|
|
2487
2602
|
key: item[__props.keyProp] ?? index,
|
|
2488
2603
|
config: item,
|
|
2489
2604
|
model: values.value,
|
|
@@ -2491,11 +2606,11 @@
|
|
|
2491
2606
|
"step-active": __props.stepActive,
|
|
2492
2607
|
size: __props.size,
|
|
2493
2608
|
onChange: changeHandler
|
|
2494
|
-
}, null, 8, ["config", "model", "label-width", "step-active", "size"]);
|
|
2609
|
+
}, null, 8, ["disabled", "config", "model", "label-width", "step-active", "size"]);
|
|
2495
2610
|
}), 128)) : vue.createCommentVNode("", true)
|
|
2496
2611
|
]),
|
|
2497
2612
|
_: 1
|
|
2498
|
-
}, 8, ["model", "label-width", "
|
|
2613
|
+
}, 8, ["model", "label-width", "style", "inline", "label-position"]);
|
|
2499
2614
|
};
|
|
2500
2615
|
}
|
|
2501
2616
|
});
|
|
@@ -2504,8 +2619,11 @@
|
|
|
2504
2619
|
const _hoisted_2$1 = /* @__PURE__ */ vue.createTextVNode("\u53D6 \u6D88");
|
|
2505
2620
|
const _hoisted_3$1 = /* @__PURE__ */ vue.createTextVNode("\u4E0A\u4E00\u6B65");
|
|
2506
2621
|
const _hoisted_4 = /* @__PURE__ */ vue.createTextVNode("\u4E0B\u4E00\u6B65");
|
|
2622
|
+
const __default__$a = vue.defineComponent({
|
|
2623
|
+
name: "MFormDialog"
|
|
2624
|
+
});
|
|
2507
2625
|
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
2508
|
-
|
|
2626
|
+
...__default__$a,
|
|
2509
2627
|
props: {
|
|
2510
2628
|
config: { default: () => [] },
|
|
2511
2629
|
values: { default: () => ({}) },
|
|
@@ -2513,6 +2631,7 @@
|
|
|
2513
2631
|
width: null,
|
|
2514
2632
|
labelWidth: null,
|
|
2515
2633
|
fullscreen: { type: Boolean },
|
|
2634
|
+
disabled: { type: Boolean },
|
|
2516
2635
|
title: null,
|
|
2517
2636
|
zIndex: null,
|
|
2518
2637
|
size: null,
|
|
@@ -2668,12 +2787,13 @@
|
|
|
2668
2787
|
ref_key: "form",
|
|
2669
2788
|
ref: form,
|
|
2670
2789
|
size: __props.size,
|
|
2790
|
+
disabled: __props.disabled,
|
|
2671
2791
|
config: __props.config,
|
|
2672
2792
|
"init-values": __props.values,
|
|
2673
2793
|
"parent-values": __props.parentValues,
|
|
2674
2794
|
"label-width": __props.labelWidth,
|
|
2675
2795
|
onChange: changeHandler
|
|
2676
|
-
}, null, 8, ["modelValue", "size", "config", "init-values", "parent-values", "label-width"]),
|
|
2796
|
+
}, null, 8, ["modelValue", "size", "disabled", "config", "init-values", "parent-values", "label-width"]),
|
|
2677
2797
|
vue.renderSlot(_ctx.$slots, "default")
|
|
2678
2798
|
], 4)) : vue.createCommentVNode("", true)
|
|
2679
2799
|
]),
|
|
@@ -2689,8 +2809,11 @@
|
|
|
2689
2809
|
class: "m-fields-link"
|
|
2690
2810
|
};
|
|
2691
2811
|
const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("\u70B9\u51FB\u7F16\u8F91");
|
|
2812
|
+
const __default__$9 = vue.defineComponent({
|
|
2813
|
+
name: "MFormLink"
|
|
2814
|
+
});
|
|
2692
2815
|
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
2693
|
-
|
|
2816
|
+
...__default__$9,
|
|
2694
2817
|
props: {
|
|
2695
2818
|
config: null,
|
|
2696
2819
|
model: null,
|
|
@@ -2783,8 +2906,11 @@
|
|
|
2783
2906
|
}
|
|
2784
2907
|
});
|
|
2785
2908
|
|
|
2909
|
+
const __default__$8 = vue.defineComponent({
|
|
2910
|
+
name: "MFormNumber"
|
|
2911
|
+
});
|
|
2786
2912
|
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
2787
|
-
|
|
2913
|
+
...__default__$8,
|
|
2788
2914
|
props: {
|
|
2789
2915
|
config: null,
|
|
2790
2916
|
model: null,
|
|
@@ -2827,8 +2953,11 @@
|
|
|
2827
2953
|
}
|
|
2828
2954
|
});
|
|
2829
2955
|
|
|
2956
|
+
const __default__$7 = vue.defineComponent({
|
|
2957
|
+
name: "MFormRadioGroup"
|
|
2958
|
+
});
|
|
2830
2959
|
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
2831
|
-
|
|
2960
|
+
...__default__$7,
|
|
2832
2961
|
props: {
|
|
2833
2962
|
config: null,
|
|
2834
2963
|
model: null,
|
|
@@ -2859,13 +2988,14 @@
|
|
|
2859
2988
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.config.options, (option) => {
|
|
2860
2989
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicRadio), {
|
|
2861
2990
|
label: option.value,
|
|
2991
|
+
value: option.value,
|
|
2862
2992
|
key: `${option.value}`
|
|
2863
2993
|
}, {
|
|
2864
2994
|
default: vue.withCtx(() => [
|
|
2865
2995
|
vue.createTextVNode(vue.toDisplayString(option.text), 1)
|
|
2866
2996
|
]),
|
|
2867
2997
|
_: 2
|
|
2868
|
-
}, 1032, ["label"]);
|
|
2998
|
+
}, 1032, ["label", "value"]);
|
|
2869
2999
|
}), 128))
|
|
2870
3000
|
]),
|
|
2871
3001
|
_: 1
|
|
@@ -2874,8 +3004,11 @@
|
|
|
2874
3004
|
}
|
|
2875
3005
|
});
|
|
2876
3006
|
|
|
3007
|
+
const __default__$6 = vue.defineComponent({
|
|
3008
|
+
name: "MFormSelectOptionGroups"
|
|
3009
|
+
});
|
|
2877
3010
|
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
2878
|
-
|
|
3011
|
+
...__default__$6,
|
|
2879
3012
|
props: {
|
|
2880
3013
|
options: null
|
|
2881
3014
|
},
|
|
@@ -2905,8 +3038,11 @@
|
|
|
2905
3038
|
}
|
|
2906
3039
|
});
|
|
2907
3040
|
|
|
3041
|
+
const __default__$5 = vue.defineComponent({
|
|
3042
|
+
name: "MFormSelectOptions"
|
|
3043
|
+
});
|
|
2908
3044
|
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
2909
|
-
|
|
3045
|
+
...__default__$5,
|
|
2910
3046
|
props: {
|
|
2911
3047
|
options: null,
|
|
2912
3048
|
valueKey: null
|
|
@@ -2926,8 +3062,11 @@
|
|
|
2926
3062
|
});
|
|
2927
3063
|
|
|
2928
3064
|
const _hoisted_1$1 = { key: 2 };
|
|
3065
|
+
const __default__$4 = vue.defineComponent({
|
|
3066
|
+
name: "MFormSelect"
|
|
3067
|
+
});
|
|
2929
3068
|
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
2930
|
-
|
|
3069
|
+
...__default__$4,
|
|
2931
3070
|
props: {
|
|
2932
3071
|
config: null,
|
|
2933
3072
|
model: null,
|
|
@@ -2982,30 +3121,32 @@
|
|
|
2982
3121
|
let items = [];
|
|
2983
3122
|
const { config } = props;
|
|
2984
3123
|
const { option } = config;
|
|
2985
|
-
|
|
3124
|
+
const { root = "", totalKey = "total" } = option;
|
|
3125
|
+
let { body = {}, url } = option;
|
|
3126
|
+
if (typeof url === "function") {
|
|
3127
|
+
url = await url(mForm, { model: props.model, formValue: mForm?.values });
|
|
3128
|
+
}
|
|
2986
3129
|
let postOptions = {
|
|
2987
3130
|
method: option.method || "POST",
|
|
2988
|
-
url
|
|
3131
|
+
url,
|
|
2989
3132
|
cache: option.cache,
|
|
2990
3133
|
timeout: option.timeout,
|
|
2991
3134
|
mode: option.mode,
|
|
2992
3135
|
headers: option.headers || {},
|
|
2993
3136
|
json: option.json || false
|
|
2994
3137
|
};
|
|
2995
|
-
if (body) {
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
});
|
|
3003
|
-
}
|
|
3004
|
-
body.query = query.value;
|
|
3005
|
-
body.pgSize = pgSize.value;
|
|
3006
|
-
body.pgIndex = pgIndex.value;
|
|
3007
|
-
postOptions.data = body;
|
|
3138
|
+
if (typeof body === "function") {
|
|
3139
|
+
body = body(mForm, {
|
|
3140
|
+
model: props.model,
|
|
3141
|
+
formValue: mForm?.values,
|
|
3142
|
+
formValues: mForm?.values,
|
|
3143
|
+
config: props.config
|
|
3144
|
+
});
|
|
3008
3145
|
}
|
|
3146
|
+
body.query = query.value;
|
|
3147
|
+
body.pgSize = pgSize.value;
|
|
3148
|
+
body.pgIndex = pgIndex.value;
|
|
3149
|
+
postOptions.data = body;
|
|
3009
3150
|
const requestFuc = getConfig("request");
|
|
3010
3151
|
if (typeof option.beforeRequest === "function") {
|
|
3011
3152
|
postOptions = option.beforeRequest(mForm, postOptions, {
|
|
@@ -3025,9 +3166,13 @@
|
|
|
3025
3166
|
config: props.config
|
|
3026
3167
|
});
|
|
3027
3168
|
}
|
|
3028
|
-
const optionsData =
|
|
3029
|
-
|
|
3030
|
-
|
|
3169
|
+
const optionsData = root.split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res);
|
|
3170
|
+
const resTotal = globalThis.parseInt(
|
|
3171
|
+
totalKey.split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res),
|
|
3172
|
+
10
|
|
3173
|
+
);
|
|
3174
|
+
if (resTotal > 0) {
|
|
3175
|
+
total.value = resTotal;
|
|
3031
3176
|
}
|
|
3032
3177
|
remoteData.value = remoteData.value.concat(optionsData);
|
|
3033
3178
|
if (optionsData) {
|
|
@@ -3076,6 +3221,8 @@
|
|
|
3076
3221
|
return [];
|
|
3077
3222
|
const { config } = props;
|
|
3078
3223
|
const { option } = config;
|
|
3224
|
+
const { root = "", initRoot = "" } = option;
|
|
3225
|
+
let { initBody = {} } = option;
|
|
3079
3226
|
let options2 = [];
|
|
3080
3227
|
let url = option.initUrl;
|
|
3081
3228
|
if (!url) {
|
|
@@ -3084,22 +3231,45 @@
|
|
|
3084
3231
|
if (typeof url === "function") {
|
|
3085
3232
|
url = await url(mForm, { model: props.model, formValue: mForm?.values });
|
|
3086
3233
|
}
|
|
3087
|
-
|
|
3234
|
+
if (typeof initBody === "function") {
|
|
3235
|
+
initBody = initBody(mForm, {
|
|
3236
|
+
model: props.model,
|
|
3237
|
+
formValue: mForm?.values,
|
|
3238
|
+
formValues: mForm?.values,
|
|
3239
|
+
config: props.config
|
|
3240
|
+
});
|
|
3241
|
+
}
|
|
3242
|
+
let postOptions = {
|
|
3088
3243
|
method: option.method || "POST",
|
|
3089
3244
|
url,
|
|
3090
3245
|
data: {
|
|
3091
|
-
id: props.model[props.name]
|
|
3246
|
+
id: props.model[props.name],
|
|
3247
|
+
...initBody
|
|
3092
3248
|
},
|
|
3093
3249
|
mode: option.mode,
|
|
3094
3250
|
headers: option.headers || {},
|
|
3095
3251
|
json: option.json || false
|
|
3096
3252
|
};
|
|
3253
|
+
if (typeof option.beforeInitRequest === "function") {
|
|
3254
|
+
postOptions = option.beforeInitRequest(mForm, postOptions, {
|
|
3255
|
+
model: props.model,
|
|
3256
|
+
formValue: mForm?.values
|
|
3257
|
+
});
|
|
3258
|
+
}
|
|
3097
3259
|
if (option.method?.toLocaleLowerCase() === "jsonp") {
|
|
3098
3260
|
postOptions.jsonpCallback = option.jsonpCallback || "callback";
|
|
3099
3261
|
}
|
|
3100
3262
|
const requestFuc = getConfig("request");
|
|
3101
|
-
|
|
3102
|
-
|
|
3263
|
+
let res = await requestFuc(postOptions);
|
|
3264
|
+
if (typeof option.afterRequest === "function") {
|
|
3265
|
+
res = option.afterRequest(mForm, res, {
|
|
3266
|
+
model: props.model,
|
|
3267
|
+
formValue: mForm?.values,
|
|
3268
|
+
formValues: mForm?.values,
|
|
3269
|
+
config: props.config
|
|
3270
|
+
});
|
|
3271
|
+
}
|
|
3272
|
+
let initData = (initRoot || root).split(".").reduce((accumulator, currentValue) => accumulator[currentValue], res);
|
|
3103
3273
|
if (initData) {
|
|
3104
3274
|
if (!Array.isArray(initData)) {
|
|
3105
3275
|
initData = [initData];
|
|
@@ -3234,8 +3404,11 @@
|
|
|
3234
3404
|
}
|
|
3235
3405
|
});
|
|
3236
3406
|
|
|
3407
|
+
const __default__$3 = vue.defineComponent({
|
|
3408
|
+
name: "MFormSwitch"
|
|
3409
|
+
});
|
|
3237
3410
|
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
3238
|
-
|
|
3411
|
+
...__default__$3,
|
|
3239
3412
|
props: {
|
|
3240
3413
|
config: null,
|
|
3241
3414
|
model: null,
|
|
@@ -3288,8 +3461,11 @@
|
|
|
3288
3461
|
});
|
|
3289
3462
|
|
|
3290
3463
|
const _hoisted_1 = { key: 0 };
|
|
3464
|
+
const __default__$2 = vue.defineComponent({
|
|
3465
|
+
name: "MFormText"
|
|
3466
|
+
});
|
|
3291
3467
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
3292
|
-
|
|
3468
|
+
...__default__$2,
|
|
3293
3469
|
props: {
|
|
3294
3470
|
config: null,
|
|
3295
3471
|
model: null,
|
|
@@ -3408,8 +3584,11 @@
|
|
|
3408
3584
|
}
|
|
3409
3585
|
});
|
|
3410
3586
|
|
|
3587
|
+
const __default__$1 = vue.defineComponent({
|
|
3588
|
+
name: "MFormTextarea"
|
|
3589
|
+
});
|
|
3411
3590
|
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
3412
|
-
|
|
3591
|
+
...__default__$1,
|
|
3413
3592
|
props: {
|
|
3414
3593
|
config: null,
|
|
3415
3594
|
model: null,
|
|
@@ -3448,8 +3627,11 @@
|
|
|
3448
3627
|
}
|
|
3449
3628
|
});
|
|
3450
3629
|
|
|
3630
|
+
const __default__ = vue.defineComponent({
|
|
3631
|
+
name: "MFormTime"
|
|
3632
|
+
});
|
|
3451
3633
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
3452
|
-
|
|
3634
|
+
...__default__,
|
|
3453
3635
|
props: {
|
|
3454
3636
|
config: null,
|
|
3455
3637
|
model: null,
|
|
@@ -3471,11 +3653,13 @@
|
|
|
3471
3653
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTimePicker), {
|
|
3472
3654
|
modelValue: __props.model[__props.name],
|
|
3473
3655
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
3656
|
+
"value-format": __props.config.valueFormat || "HH:mm:ss",
|
|
3657
|
+
format: __props.config.format || "HH:mm:ss",
|
|
3474
3658
|
size: __props.size,
|
|
3475
3659
|
placeholder: __props.config.placeholder,
|
|
3476
3660
|
disabled: __props.disabled,
|
|
3477
3661
|
onChange: changeHandler
|
|
3478
|
-
}, null, 8, ["modelValue", "size", "placeholder", "disabled"]);
|
|
3662
|
+
}, null, 8, ["modelValue", "value-format", "format", "size", "placeholder", "disabled"]);
|
|
3479
3663
|
};
|
|
3480
3664
|
}
|
|
3481
3665
|
});
|
|
@@ -3547,6 +3731,7 @@
|
|
|
3547
3731
|
exports.MText = _sfc_main$2;
|
|
3548
3732
|
exports.MTextarea = _sfc_main$1;
|
|
3549
3733
|
exports.MTime = _sfc_main;
|
|
3734
|
+
exports.createValues = createValues;
|
|
3550
3735
|
exports.default = index;
|
|
3551
3736
|
exports.display = display;
|
|
3552
3737
|
exports.filterFunction = filterFunction;
|
|
@@ -3557,4 +3742,4 @@
|
|
|
3557
3742
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
3558
3743
|
|
|
3559
3744
|
}));
|
|
3560
|
-
//# sourceMappingURL=tmagic-form.umd.
|
|
3745
|
+
//# sourceMappingURL=tmagic-form.umd.cjs.map
|