@tmagic/form 1.2.13 → 1.2.15
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 +2 -2
- package/dist/tmagic-form.js +103 -108
- package/dist/tmagic-form.js.map +1 -1
- package/dist/tmagic-form.umd.cjs +103 -113
- package/dist/tmagic-form.umd.cjs.map +1 -1
- package/package.json +7 -7
- package/src/containers/Fieldset.vue +2 -9
- package/src/containers/Table.vue +1 -1
- package/src/containers/Tabs.vue +65 -60
- package/src/fields/Select.vue +2 -2
- package/src/fields/Text.vue +3 -3
- package/src/schema.ts +1 -0
- package/types/Form.vue.d.ts +5 -5
- package/types/FormDialog.vue.d.ts +41 -743
- package/types/containers/Col.vue.d.ts +2 -2
- package/types/containers/Container.vue.d.ts +3 -3
- package/types/containers/Fieldset.vue.d.ts +3 -3
- package/types/containers/GroupList.vue.d.ts +2 -2
- package/types/containers/GroupListItem.vue.d.ts +2 -2
- package/types/containers/Panel.vue.d.ts +22 -90
- package/types/containers/Row.vue.d.ts +2 -2
- package/types/containers/Step.vue.d.ts +3 -3
- package/types/containers/Table.vue.d.ts +42 -155
- package/types/containers/Tabs.vue.d.ts +3 -3
- package/types/fields/Cascader.vue.d.ts +4 -4
- package/types/fields/Checkbox.vue.d.ts +4 -4
- package/types/fields/CheckboxGroup.vue.d.ts +4 -4
- package/types/fields/ColorPicker.vue.d.ts +4 -4
- package/types/fields/Date.vue.d.ts +4 -4
- package/types/fields/DateTime.vue.d.ts +4 -4
- package/types/fields/Daterange.vue.d.ts +4 -4
- package/types/fields/Display.vue.d.ts +2 -2
- package/types/fields/DynamicField.vue.d.ts +4 -4
- package/types/fields/Hidden.vue.d.ts +2 -2
- package/types/fields/Link.vue.d.ts +4 -4
- package/types/fields/Number.vue.d.ts +4 -4
- package/types/fields/RadioGroup.vue.d.ts +4 -4
- package/types/fields/Select.vue.d.ts +4 -4
- package/types/fields/SelectOptionGroups.vue.d.ts +2 -2
- package/types/fields/SelectOptions.vue.d.ts +2 -2
- package/types/fields/Switch.vue.d.ts +4 -4
- package/types/fields/Text.vue.d.ts +4 -4
- package/types/fields/Textarea.vue.d.ts +4 -4
- package/types/fields/Time.vue.d.ts +4 -4
- package/types/schema.d.ts +15 -14
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -4,11 +4,6 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicForm = {}, global.Vue, global.iconsVue, global.lodashEs, global.design, global.Sortable, global.utils, global.cloneDeep));
|
|
5
5
|
})(this, (function (exports, vue, iconsVue, lodashEs, design, Sortable, utils, cloneDeep) { 'use strict';
|
|
6
6
|
|
|
7
|
-
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
8
|
-
|
|
9
|
-
const Sortable__default = /*#__PURE__*/_interopDefaultLegacy(Sortable);
|
|
10
|
-
const cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep);
|
|
11
|
-
|
|
12
7
|
const isTableSelect = (type) => typeof type === "string" && ["table-select", "tableSelect"].includes(type);
|
|
13
8
|
const asyncLoadConfig = (value, initValue2, { asyncLoad, name, type }) => {
|
|
14
9
|
if (type === "html" && typeof asyncLoad === "object" && typeof name !== "undefined") {
|
|
@@ -157,7 +152,7 @@
|
|
|
157
152
|
};
|
|
158
153
|
const initValue = async (mForm, { initValues, config }) => {
|
|
159
154
|
if (!Array.isArray(config))
|
|
160
|
-
throw new Error("config
|
|
155
|
+
throw new Error("config应该为数组");
|
|
161
156
|
let valuesTmp = createValues(mForm, config, vue.toRaw(initValues), {});
|
|
162
157
|
const [firstForm] = config;
|
|
163
158
|
if (firstForm && typeof firstForm.onInitValue === "function") {
|
|
@@ -592,7 +587,7 @@
|
|
|
592
587
|
onClick: expandHandler
|
|
593
588
|
}, {
|
|
594
589
|
default: vue.withCtx(() => [
|
|
595
|
-
vue.createTextVNode(vue.toDisplayString(expand.value ? "
|
|
590
|
+
vue.createTextVNode(vue.toDisplayString(expand.value ? "收起配置" : "展开更多配置"), 1)
|
|
596
591
|
]),
|
|
597
592
|
_: 1
|
|
598
593
|
})
|
|
@@ -650,14 +645,6 @@
|
|
|
650
645
|
emit("change", props.model);
|
|
651
646
|
};
|
|
652
647
|
const key = (item, index) => item[mForm?.keyProp || "__key"] ?? index;
|
|
653
|
-
if (props.config.checkbox && name.value) {
|
|
654
|
-
vue.watch(
|
|
655
|
-
() => props.model[name.value]?.value,
|
|
656
|
-
() => {
|
|
657
|
-
emit("change", props.model);
|
|
658
|
-
}
|
|
659
|
-
);
|
|
660
|
-
}
|
|
661
648
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
662
649
|
return (_ctx, _cache) => {
|
|
663
650
|
return (vue.unref(name) ? __props.model[vue.unref(name)] : __props.model) ? (vue.openBlock(), vue.createElementBlock("fieldset", {
|
|
@@ -669,7 +656,10 @@
|
|
|
669
656
|
default: vue.withCtx(() => [
|
|
670
657
|
vue.createVNode(vue.unref(design.TMagicCheckbox), {
|
|
671
658
|
modelValue: __props.model[vue.unref(name)].value,
|
|
672
|
-
"onUpdate:modelValue":
|
|
659
|
+
"onUpdate:modelValue": [
|
|
660
|
+
_cache[0] || (_cache[0] = ($event) => __props.model[vue.unref(name)].value = $event),
|
|
661
|
+
change
|
|
662
|
+
],
|
|
673
663
|
prop: `${__props.prop}${__props.prop ? "." : ""}${__props.config.name}.value`,
|
|
674
664
|
"true-label": 1,
|
|
675
665
|
"false-label": 0
|
|
@@ -743,8 +733,8 @@
|
|
|
743
733
|
});
|
|
744
734
|
|
|
745
735
|
const _hoisted_1$9 = { class: "m-fields-group-list-item" };
|
|
746
|
-
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("
|
|
747
|
-
const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("
|
|
736
|
+
const _hoisted_2$5 = /* @__PURE__ */ vue.createTextVNode("上移");
|
|
737
|
+
const _hoisted_3$5 = /* @__PURE__ */ vue.createTextVNode("下移");
|
|
748
738
|
const _hoisted_4$4 = ["innerHTML"];
|
|
749
739
|
const __default__$t = vue.defineComponent({
|
|
750
740
|
name: "MFormGroupListItem"
|
|
@@ -782,7 +772,7 @@
|
|
|
782
772
|
if (props.config.titleKey && props.model[props.config.titleKey]) {
|
|
783
773
|
return props.model[props.config.titleKey];
|
|
784
774
|
}
|
|
785
|
-
return
|
|
775
|
+
return `组 ${String(props.index)}`;
|
|
786
776
|
});
|
|
787
777
|
const length = vue.computed(() => props.groupModel?.length || 0);
|
|
788
778
|
const itemExtra = vue.computed(() => filterFunction(mForm, props.config.itemExtra, props));
|
|
@@ -902,12 +892,12 @@
|
|
|
902
892
|
key: 1,
|
|
903
893
|
class: "el-table__empty-block"
|
|
904
894
|
};
|
|
905
|
-
const _hoisted_4$3 = /* @__PURE__ */ vue.createElementVNode("span", { class: "el-table__empty-text" }, "
|
|
895
|
+
const _hoisted_4$3 = /* @__PURE__ */ vue.createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
|
|
906
896
|
const _hoisted_5$2 = [
|
|
907
897
|
_hoisted_4$3
|
|
908
898
|
];
|
|
909
|
-
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("
|
|
910
|
-
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("
|
|
899
|
+
const _hoisted_6$1 = /* @__PURE__ */ vue.createTextVNode("添加组");
|
|
900
|
+
const _hoisted_7$1 = /* @__PURE__ */ vue.createTextVNode("切换为表格");
|
|
911
901
|
const __default__$s = vue.defineComponent({
|
|
912
902
|
name: "MFormGroupList"
|
|
913
903
|
});
|
|
@@ -1328,12 +1318,12 @@
|
|
|
1328
1318
|
const _hoisted_1$6 = ["innerHTML"];
|
|
1329
1319
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1330
1320
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1331
|
-
const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("
|
|
1332
|
-
const _hoisted_5 = /* @__PURE__ */ vue.createTextVNode("
|
|
1333
|
-
const _hoisted_6 = /* @__PURE__ */ vue.createTextVNode("
|
|
1334
|
-
const _hoisted_7 = /* @__PURE__ */ vue.createTextVNode("
|
|
1335
|
-
const _hoisted_8 = /* @__PURE__ */ vue.createTextVNode("
|
|
1336
|
-
const _hoisted_9 = /* @__PURE__ */ vue.createTextVNode("
|
|
1321
|
+
const _hoisted_4$1 = /* @__PURE__ */ vue.createTextVNode("添加");
|
|
1322
|
+
const _hoisted_5 = /* @__PURE__ */ vue.createTextVNode(" ");
|
|
1323
|
+
const _hoisted_6 = /* @__PURE__ */ vue.createTextVNode("展开配置");
|
|
1324
|
+
const _hoisted_7 = /* @__PURE__ */ vue.createTextVNode("导入EXCEL");
|
|
1325
|
+
const _hoisted_8 = /* @__PURE__ */ vue.createTextVNode(" ");
|
|
1326
|
+
const _hoisted_9 = /* @__PURE__ */ vue.createTextVNode("清空");
|
|
1337
1327
|
const _hoisted_10 = {
|
|
1338
1328
|
key: 1,
|
|
1339
1329
|
class: "bottom",
|
|
@@ -1407,7 +1397,7 @@
|
|
|
1407
1397
|
const tableEl = tMagicTable.value?.instance.$el;
|
|
1408
1398
|
const tBodyEl = tableEl?.querySelector(".el-table__body > tbody");
|
|
1409
1399
|
if (tBodyEl) {
|
|
1410
|
-
const sortable =
|
|
1400
|
+
const sortable = Sortable.create(tBodyEl, {
|
|
1411
1401
|
onEnd: ({ newIndex, oldIndex }) => {
|
|
1412
1402
|
if (typeof newIndex === "undefined")
|
|
1413
1403
|
return;
|
|
@@ -1433,7 +1423,7 @@
|
|
|
1433
1423
|
};
|
|
1434
1424
|
const newHandler = async (row) => {
|
|
1435
1425
|
if (props.config.max && props.model[modelName.value].length >= props.config.max) {
|
|
1436
|
-
design.tMagicMessage.error(
|
|
1426
|
+
design.tMagicMessage.error(`最多新增配置不能超过${props.config.max}条`);
|
|
1437
1427
|
return;
|
|
1438
1428
|
}
|
|
1439
1429
|
const columns = props.config.items;
|
|
@@ -1617,7 +1607,7 @@
|
|
|
1617
1607
|
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
1618
1608
|
};
|
|
1619
1609
|
const excelHandler = (file) => {
|
|
1620
|
-
if (!file
|
|
1610
|
+
if (!file?.raw) {
|
|
1621
1611
|
return false;
|
|
1622
1612
|
}
|
|
1623
1613
|
const reader = new FileReader();
|
|
@@ -1697,7 +1687,7 @@
|
|
|
1697
1687
|
}, null, 8, _hoisted_1$6)) : vue.createCommentVNode("", true),
|
|
1698
1688
|
vue.createElementVNode("div", _hoisted_2$2, [
|
|
1699
1689
|
vue.createVNode(vue.unref(design.TMagicTooltip), {
|
|
1700
|
-
content: "
|
|
1690
|
+
content: "拖拽可排序",
|
|
1701
1691
|
placement: "left-start",
|
|
1702
1692
|
disabled: __props.config.dropSort !== true
|
|
1703
1693
|
}, {
|
|
@@ -1732,7 +1722,7 @@
|
|
|
1732
1722
|
_: 1
|
|
1733
1723
|
})) : vue.createCommentVNode("", true),
|
|
1734
1724
|
vue.createVNode(vue.unref(design.TMagicTableColumn), {
|
|
1735
|
-
label: "
|
|
1725
|
+
label: "操作",
|
|
1736
1726
|
width: __props.config.operateColWidth || 55,
|
|
1737
1727
|
align: "center",
|
|
1738
1728
|
fixed: __props.config.fixed === false ? void 0 : "left"
|
|
@@ -1755,13 +1745,13 @@
|
|
|
1755
1745
|
}, 8, ["width", "fixed"]),
|
|
1756
1746
|
__props.sort && __props.model[vue.unref(modelName)] && __props.model[vue.unref(modelName)].length > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1757
1747
|
key: 1,
|
|
1758
|
-
label: "
|
|
1748
|
+
label: "排序",
|
|
1759
1749
|
width: "60"
|
|
1760
1750
|
}, {
|
|
1761
1751
|
default: vue.withCtx((scope) => [
|
|
1762
1752
|
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1763
1753
|
key: 0,
|
|
1764
|
-
content: "
|
|
1754
|
+
content: "点击上移,双击置顶",
|
|
1765
1755
|
placement: "top"
|
|
1766
1756
|
}, {
|
|
1767
1757
|
default: vue.withCtx(() => [
|
|
@@ -1780,7 +1770,7 @@
|
|
|
1780
1770
|
}, 1024)) : vue.createCommentVNode("", true),
|
|
1781
1771
|
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== __props.model[vue.unref(modelName)].length - 1 ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTooltip), {
|
|
1782
1772
|
key: 1,
|
|
1783
|
-
content: "
|
|
1773
|
+
content: "点击下移,双击置底",
|
|
1784
1774
|
placement: "top"
|
|
1785
1775
|
}, {
|
|
1786
1776
|
default: vue.withCtx(() => [
|
|
@@ -1810,7 +1800,7 @@
|
|
|
1810
1800
|
__props.showIndex && __props.config.showIndex ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTableColumn), {
|
|
1811
1801
|
key: 3,
|
|
1812
1802
|
width: "60",
|
|
1813
|
-
label: "
|
|
1803
|
+
label: "序号"
|
|
1814
1804
|
}, {
|
|
1815
1805
|
default: vue.withCtx((scope) => [
|
|
1816
1806
|
vue.createTextVNode(vue.toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
|
|
@@ -1889,7 +1879,7 @@
|
|
|
1889
1879
|
onClick: toggleFullscreen
|
|
1890
1880
|
}, {
|
|
1891
1881
|
default: vue.withCtx(() => [
|
|
1892
|
-
vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "
|
|
1882
|
+
vue.createTextVNode(vue.toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
|
|
1893
1883
|
]),
|
|
1894
1884
|
_: 1
|
|
1895
1885
|
}, 8, ["icon"])) : vue.createCommentVNode("", true),
|
|
@@ -1970,7 +1960,8 @@
|
|
|
1970
1960
|
emits: ["change", "addDiffCount"],
|
|
1971
1961
|
setup(__props, { emit }) {
|
|
1972
1962
|
const props = __props;
|
|
1973
|
-
const
|
|
1963
|
+
const tabPaneComponent = design.getConfig("components").tabPane;
|
|
1964
|
+
const tabsComponent = design.getConfig("components").tabs;
|
|
1974
1965
|
const getActive = (mForm2, props2, activeTabName2) => {
|
|
1975
1966
|
const { config, model, prop } = props2;
|
|
1976
1967
|
const { active } = config;
|
|
@@ -1999,10 +1990,10 @@
|
|
|
1999
1990
|
const tabs = vue.computed(() => {
|
|
2000
1991
|
if (props.config.dynamic) {
|
|
2001
1992
|
if (!props.config.name)
|
|
2002
|
-
throw new Error("dynamic tab
|
|
1993
|
+
throw new Error("dynamic tab 必须配置name");
|
|
2003
1994
|
return props.model[props.config.name] || [];
|
|
2004
1995
|
}
|
|
2005
|
-
return props.config.items;
|
|
1996
|
+
return props.config.items.filter((item) => display(mForm, item.display, props));
|
|
2006
1997
|
});
|
|
2007
1998
|
const filter = (config) => filterFunction(mForm, config, props);
|
|
2008
1999
|
vue.watchEffect(() => {
|
|
@@ -2017,7 +2008,7 @@
|
|
|
2017
2008
|
const tabClickHandler = (tab) => tabClick(mForm, tab, props);
|
|
2018
2009
|
const onTabAdd = () => {
|
|
2019
2010
|
if (!props.config.name)
|
|
2020
|
-
throw new Error("dynamic tab
|
|
2011
|
+
throw new Error("dynamic tab 必须配置name");
|
|
2021
2012
|
if (typeof props.config.onTabAdd === "function") {
|
|
2022
2013
|
props.config.onTabAdd(mForm, {
|
|
2023
2014
|
model: props.model,
|
|
@@ -2026,7 +2017,7 @@
|
|
|
2026
2017
|
});
|
|
2027
2018
|
} else if (tabs.value.length > 0) {
|
|
2028
2019
|
const newObj = lodashEs.cloneDeep(tabs.value[0]);
|
|
2029
|
-
newObj.title =
|
|
2020
|
+
newObj.title = `标签${tabs.value.length + 1}`;
|
|
2030
2021
|
props.model[props.config.name].push(newObj);
|
|
2031
2022
|
}
|
|
2032
2023
|
emit("change", props.model);
|
|
@@ -2034,7 +2025,7 @@
|
|
|
2034
2025
|
};
|
|
2035
2026
|
const onTabRemove = (tabName) => {
|
|
2036
2027
|
if (!props.config.name)
|
|
2037
|
-
throw new Error("dynamic tab
|
|
2028
|
+
throw new Error("dynamic tab 必须配置name");
|
|
2038
2029
|
if (typeof props.config.onTabRemove === "function") {
|
|
2039
2030
|
props.config.onTabRemove(mForm, tabName, {
|
|
2040
2031
|
model: props.model,
|
|
@@ -2051,7 +2042,6 @@
|
|
|
2051
2042
|
emit("change", props.model);
|
|
2052
2043
|
mForm?.$emit("field-change", props.prop, props.model[props.config.name]);
|
|
2053
2044
|
};
|
|
2054
|
-
const display$1 = (displayConfig) => display(mForm, displayConfig, props);
|
|
2055
2045
|
const changeHandler = () => {
|
|
2056
2046
|
emit("change", props.model);
|
|
2057
2047
|
if (typeof props.config.onChange === "function") {
|
|
@@ -2067,61 +2057,62 @@
|
|
|
2067
2057
|
emit("addDiffCount");
|
|
2068
2058
|
};
|
|
2069
2059
|
return (_ctx, _cache) => {
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2060
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabsComponent).component), vue.mergeProps(
|
|
2061
|
+
{
|
|
2062
|
+
modelValue: activeTabName.value,
|
|
2063
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event)
|
|
2064
|
+
},
|
|
2065
|
+
vue.unref(tabsComponent).props({
|
|
2066
|
+
type: __props.config.tabType,
|
|
2067
|
+
editable: __props.config.editable || false,
|
|
2068
|
+
tabPosition: __props.config.tabPosition || "top"
|
|
2069
|
+
}),
|
|
2070
|
+
{
|
|
2071
|
+
class: `tmagic-design-tabs ${__props.config.dynamic ? "magic-form-dynamic-tab" : "magic-form-tab"}`,
|
|
2072
|
+
onTabClick: tabClickHandler,
|
|
2073
|
+
onTabAdd,
|
|
2074
|
+
onTabRemove
|
|
2075
|
+
}
|
|
2076
|
+
), {
|
|
2082
2077
|
default: vue.withCtx(() => [
|
|
2083
2078
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(tabs), (tab, tabIndex) => {
|
|
2084
|
-
return vue.openBlock(), vue.
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
_: 2
|
|
2119
|
-
}, 1032, ["name", "lazy"])) : vue.createCommentVNode("", true)
|
|
2120
|
-
], 64);
|
|
2121
|
-
}), 256))
|
|
2079
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(tabPaneComponent).component), vue.mergeProps({
|
|
2080
|
+
key: tab[vue.unref(mForm)?.keyProp || "__key"] ?? tabIndex
|
|
2081
|
+
}, vue.unref(tabPaneComponent).props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false })), {
|
|
2082
|
+
label: vue.withCtx(() => [
|
|
2083
|
+
vue.createElementVNode("span", null, [
|
|
2084
|
+
vue.createTextVNode(vue.toDisplayString(filter(tab.title)), 1),
|
|
2085
|
+
vue.createVNode(vue.unref(design.TMagicBadge), {
|
|
2086
|
+
hidden: !diffCount.value[tabIndex],
|
|
2087
|
+
value: diffCount.value[tabIndex],
|
|
2088
|
+
class: "diff-count-badge"
|
|
2089
|
+
}, null, 8, ["hidden", "value"])
|
|
2090
|
+
])
|
|
2091
|
+
]),
|
|
2092
|
+
default: vue.withCtx(() => [
|
|
2093
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(tabItems(tab), (item) => {
|
|
2094
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$v, {
|
|
2095
|
+
key: item[vue.unref(mForm)?.keyProp || "__key"],
|
|
2096
|
+
config: item,
|
|
2097
|
+
disabled: __props.disabled,
|
|
2098
|
+
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,
|
|
2099
|
+
"last-values": vue.unref(lodashEs.isEmpty)(__props.lastValues) ? {} : __props.config.dynamic ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tabIndex] : tab.name ? (__props.name ? __props.lastValues[__props.name] : __props.lastValues)[tab.name] : __props.name ? __props.lastValues[__props.name] : __props.lastValues,
|
|
2100
|
+
"is-compare": __props.isCompare,
|
|
2101
|
+
prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
|
|
2102
|
+
size: __props.size,
|
|
2103
|
+
"label-width": tab.labelWidth || __props.labelWidth,
|
|
2104
|
+
"expand-more": __props.expandMore,
|
|
2105
|
+
onChange: changeHandler,
|
|
2106
|
+
onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
|
|
2107
|
+
}, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
|
|
2108
|
+
}), 128))
|
|
2109
|
+
]),
|
|
2110
|
+
_: 2
|
|
2111
|
+
}, 1040);
|
|
2112
|
+
}), 128))
|
|
2122
2113
|
]),
|
|
2123
2114
|
_: 1
|
|
2124
|
-
},
|
|
2115
|
+
}, 16, ["modelValue", "class"]);
|
|
2125
2116
|
};
|
|
2126
2117
|
}
|
|
2127
2118
|
});
|
|
@@ -2523,8 +2514,8 @@
|
|
|
2523
2514
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
2524
2515
|
type: "datetimerange",
|
|
2525
2516
|
"range-separator": "-",
|
|
2526
|
-
"start-placeholder": "
|
|
2527
|
-
"end-placeholder": "
|
|
2517
|
+
"start-placeholder": "开始日期",
|
|
2518
|
+
"end-placeholder": "结束日期",
|
|
2528
2519
|
size: __props.size,
|
|
2529
2520
|
"unlink-panels": true,
|
|
2530
2521
|
disabled: __props.disabled,
|
|
@@ -2831,7 +2822,7 @@
|
|
|
2831
2822
|
submitForm: async (native) => {
|
|
2832
2823
|
try {
|
|
2833
2824
|
await tMagicForm.value?.validate();
|
|
2834
|
-
return native ? values.value :
|
|
2825
|
+
return native ? values.value : cloneDeep(vue.toRaw(values.value));
|
|
2835
2826
|
} catch (invalidFields) {
|
|
2836
2827
|
const error = [];
|
|
2837
2828
|
Object.entries(invalidFields).forEach(([, ValidateError]) => {
|
|
@@ -2839,7 +2830,7 @@
|
|
|
2839
2830
|
if (field && message)
|
|
2840
2831
|
error.push(`${field} -> ${message}`);
|
|
2841
2832
|
if (field && !message)
|
|
2842
|
-
error.push(`${field} ->
|
|
2833
|
+
error.push(`${field} -> 出现错误`);
|
|
2843
2834
|
if (!field && message)
|
|
2844
2835
|
error.push(`${message}`);
|
|
2845
2836
|
});
|
|
@@ -2882,9 +2873,9 @@
|
|
|
2882
2873
|
});
|
|
2883
2874
|
|
|
2884
2875
|
const _hoisted_1$3 = { style: { "min-height": "1px" } };
|
|
2885
|
-
const _hoisted_2$1 = /* @__PURE__ */ vue.createTextVNode("
|
|
2886
|
-
const _hoisted_3$1 = /* @__PURE__ */ vue.createTextVNode("
|
|
2887
|
-
const _hoisted_4 = /* @__PURE__ */ vue.createTextVNode("
|
|
2876
|
+
const _hoisted_2$1 = /* @__PURE__ */ vue.createTextVNode("取 消");
|
|
2877
|
+
const _hoisted_3$1 = /* @__PURE__ */ vue.createTextVNode("上一步");
|
|
2878
|
+
const _hoisted_4 = /* @__PURE__ */ vue.createTextVNode("下一步");
|
|
2888
2879
|
const __default__$a = vue.defineComponent({
|
|
2889
2880
|
name: "MFormDialog"
|
|
2890
2881
|
});
|
|
@@ -2901,7 +2892,7 @@
|
|
|
2901
2892
|
title: null,
|
|
2902
2893
|
zIndex: null,
|
|
2903
2894
|
size: null,
|
|
2904
|
-
confirmText: { default: "
|
|
2895
|
+
confirmText: { default: "确定" }
|
|
2905
2896
|
},
|
|
2906
2897
|
emits: ["close", "submit", "error", "change"],
|
|
2907
2898
|
setup(__props, { expose, emit }) {
|
|
@@ -3074,7 +3065,7 @@
|
|
|
3074
3065
|
key: 2,
|
|
3075
3066
|
class: "m-fields-link"
|
|
3076
3067
|
};
|
|
3077
|
-
const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("
|
|
3068
|
+
const _hoisted_3 = /* @__PURE__ */ vue.createTextVNode("点击编辑");
|
|
3078
3069
|
const __default__$9 = vue.defineComponent({
|
|
3079
3070
|
name: "MFormLink"
|
|
3080
3071
|
});
|
|
@@ -3122,7 +3113,7 @@
|
|
|
3122
3113
|
if (props.config.displayText) {
|
|
3123
3114
|
return props.config.displayText;
|
|
3124
3115
|
}
|
|
3125
|
-
return "
|
|
3116
|
+
return "跳转";
|
|
3126
3117
|
});
|
|
3127
3118
|
const editHandler = () => {
|
|
3128
3119
|
init();
|
|
@@ -3159,7 +3150,7 @@
|
|
|
3159
3150
|
vue.createVNode(_sfc_main$a, {
|
|
3160
3151
|
ref_key: "editor",
|
|
3161
3152
|
ref: editor,
|
|
3162
|
-
title: __props.config.formTitle || "
|
|
3153
|
+
title: __props.config.formTitle || "编辑扩展配置",
|
|
3163
3154
|
width: __props.config.formWidth,
|
|
3164
3155
|
values: formValue.value,
|
|
3165
3156
|
config: vue.unref(formConfig),
|
|
@@ -3347,7 +3338,7 @@
|
|
|
3347
3338
|
setup(__props, { emit }) {
|
|
3348
3339
|
const props = __props;
|
|
3349
3340
|
if (!props.model)
|
|
3350
|
-
throw new Error("
|
|
3341
|
+
throw new Error("不能没有model");
|
|
3351
3342
|
useAddField(props.prop);
|
|
3352
3343
|
const tMagicSelect = vue.ref();
|
|
3353
3344
|
const mForm = vue.inject("mForm");
|
|
@@ -3649,8 +3640,8 @@
|
|
|
3649
3640
|
class: "m-select",
|
|
3650
3641
|
ref_key: "tMagicSelect",
|
|
3651
3642
|
ref: tMagicSelect,
|
|
3652
|
-
clearable: "",
|
|
3653
|
-
filterable: "",
|
|
3643
|
+
clearable: typeof __props.config.clearable !== "undefined" ? __props.config.clearable : true,
|
|
3644
|
+
filterable: typeof __props.config.filterable !== "undefined" ? __props.config.filterable : true,
|
|
3654
3645
|
"popper-class": `m-select-popper ${vue.unref(popperClass)}`,
|
|
3655
3646
|
size: __props.size,
|
|
3656
3647
|
remote: remote.value,
|
|
@@ -3676,7 +3667,7 @@
|
|
|
3676
3667
|
]) : vue.createCommentVNode("", true)
|
|
3677
3668
|
]),
|
|
3678
3669
|
_: 1
|
|
3679
|
-
}, 8, ["modelValue", "popper-class", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method"])), [
|
|
3670
|
+
}, 8, ["modelValue", "clearable", "filterable", "popper-class", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method"])), [
|
|
3680
3671
|
[_directive_loading, loading.value]
|
|
3681
3672
|
]) : vue.createCommentVNode("", true);
|
|
3682
3673
|
};
|
|
@@ -3829,7 +3820,6 @@
|
|
|
3829
3820
|
emit("change", props.model[props.name]);
|
|
3830
3821
|
};
|
|
3831
3822
|
return (_ctx, _cache) => {
|
|
3832
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
3833
3823
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicInput), {
|
|
3834
3824
|
modelValue: __props.model[__props.name],
|
|
3835
3825
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
@@ -3845,7 +3835,7 @@
|
|
|
3845
3835
|
name: "append",
|
|
3846
3836
|
fn: vue.withCtx(() => [
|
|
3847
3837
|
typeof __props.config.append === "string" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(__props.config.append), 1)) : vue.createCommentVNode("", true),
|
|
3848
|
-
typeof __props.config.append === "object" && __props.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(
|
|
3838
|
+
typeof __props.config.append === "object" && __props.config.append.type === "button" ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
3849
3839
|
key: 1,
|
|
3850
3840
|
style: { "color": "#409eff" },
|
|
3851
3841
|
size: __props.size,
|