@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/style.css
CHANGED
|
@@ -47,7 +47,7 @@ div.m-fields-link {
|
|
|
47
47
|
|
|
48
48
|
fieldset.m-fieldset {
|
|
49
49
|
position: relative;
|
|
50
|
-
border: 1px solid
|
|
50
|
+
border: 1px solid #e5e5e5;
|
|
51
51
|
margin-top: 10px;
|
|
52
52
|
margin-bottom: 10px;
|
|
53
53
|
min-inline-size: auto;
|
|
@@ -61,7 +61,7 @@ fieldset.m-fieldset legend {
|
|
|
61
61
|
border: 0;
|
|
62
62
|
top: -10px;
|
|
63
63
|
left: 20px;
|
|
64
|
-
background:
|
|
64
|
+
background: white;
|
|
65
65
|
width: auto;
|
|
66
66
|
padding: 0px 3px;
|
|
67
67
|
font-weight: bold;
|
package/dist/tmagic-form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, watch, openBlock, createElementBlock, normalizeStyle, normalizeClass, unref, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, withDirectives, vShow, renderSlot, onMounted, toRefs, getCurrentInstance, reactive, onBeforeUnmount, vModelText, provide, onBeforeMount, resolveDirective, createSlots, withModifiers } from 'vue';
|
|
1
|
+
import { toRaw, defineComponent, inject, ref, computed, resolveComponent, watchEffect, watch, openBlock, createElementBlock, normalizeStyle, normalizeClass, unref, createBlock, resolveDynamicComponent, Fragment, createVNode, withCtx, createElementVNode, createCommentVNode, renderList, createTextVNode, toDisplayString, withDirectives, vShow, renderSlot, onMounted, toRefs, mergeProps, getCurrentInstance, reactive, onBeforeUnmount, vModelText, provide, onBeforeMount, resolveDirective, createSlots, withModifiers } from 'vue';
|
|
2
2
|
import { WarningFilled, CaretBottom, CaretRight, Delete, CaretTop, Grid, ArrowUp, ArrowDown, FullScreen } from '@element-plus/icons-vue';
|
|
3
3
|
import { cloneDeep, isEqual, isEmpty } from 'lodash-es';
|
|
4
|
-
import { TMagicFormItem, TMagicTooltip, TMagicIcon, TMagicButton, TMagicCheckbox, TMagicCard, TMagicCol, TMagicRow, TMagicSteps, TMagicStep, TMagicTable, TMagicTableColumn, TMagicUpload, TMagicPagination, tMagicMessage, getConfig as getConfig$1,
|
|
4
|
+
import { TMagicFormItem, TMagicTooltip, TMagicIcon, TMagicButton, TMagicCheckbox, TMagicCard, TMagicCol, TMagicRow, TMagicSteps, TMagicStep, TMagicTable, TMagicTableColumn, TMagicUpload, TMagicPagination, tMagicMessage, getConfig as getConfig$1, TMagicBadge, TMagicCascader, TMagicCheckboxGroup, TMagicColorPicker, TMagicDatePicker, TMagicForm, TMagicInput, TMagicDialog, TMagicInputNumber, TMagicRadioGroup, TMagicRadio, TMagicOptionGroup, TMagicOption, TMagicSelect, TMagicSwitch, TMagicTimePicker } from '@tmagic/design';
|
|
5
5
|
import Sortable from 'sortablejs';
|
|
6
6
|
import { asyncLoadJs, sleep, datetimeFormatter, isNumber } from '@tmagic/utils';
|
|
7
7
|
import cloneDeep$1 from 'lodash-es/cloneDeep';
|
|
@@ -154,7 +154,7 @@ const getRules = function(mForm, rules = [], props) {
|
|
|
154
154
|
};
|
|
155
155
|
const initValue = async (mForm, { initValues, config }) => {
|
|
156
156
|
if (!Array.isArray(config))
|
|
157
|
-
throw new Error("config
|
|
157
|
+
throw new Error("config应该为数组");
|
|
158
158
|
let valuesTmp = createValues(mForm, config, toRaw(initValues), {});
|
|
159
159
|
const [firstForm] = config;
|
|
160
160
|
if (firstForm && typeof firstForm.onInitValue === "function") {
|
|
@@ -589,7 +589,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
589
589
|
onClick: expandHandler
|
|
590
590
|
}, {
|
|
591
591
|
default: withCtx(() => [
|
|
592
|
-
createTextVNode(toDisplayString(expand.value ? "
|
|
592
|
+
createTextVNode(toDisplayString(expand.value ? "收起配置" : "展开更多配置"), 1)
|
|
593
593
|
]),
|
|
594
594
|
_: 1
|
|
595
595
|
})
|
|
@@ -647,14 +647,6 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
647
647
|
emit("change", props.model);
|
|
648
648
|
};
|
|
649
649
|
const key = (item, index) => item[mForm?.keyProp || "__key"] ?? index;
|
|
650
|
-
if (props.config.checkbox && name.value) {
|
|
651
|
-
watch(
|
|
652
|
-
() => props.model[name.value]?.value,
|
|
653
|
-
() => {
|
|
654
|
-
emit("change", props.model);
|
|
655
|
-
}
|
|
656
|
-
);
|
|
657
|
-
}
|
|
658
650
|
const onAddDiffCount = () => emit("addDiffCount");
|
|
659
651
|
return (_ctx, _cache) => {
|
|
660
652
|
return (unref(name) ? __props.model[unref(name)] : __props.model) ? (openBlock(), createElementBlock("fieldset", {
|
|
@@ -666,7 +658,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
666
658
|
default: withCtx(() => [
|
|
667
659
|
createVNode(unref(TMagicCheckbox), {
|
|
668
660
|
modelValue: __props.model[unref(name)].value,
|
|
669
|
-
"onUpdate:modelValue":
|
|
661
|
+
"onUpdate:modelValue": [
|
|
662
|
+
_cache[0] || (_cache[0] = ($event) => __props.model[unref(name)].value = $event),
|
|
663
|
+
change
|
|
664
|
+
],
|
|
670
665
|
prop: `${__props.prop}${__props.prop ? "." : ""}${__props.config.name}.value`,
|
|
671
666
|
"true-label": 1,
|
|
672
667
|
"false-label": 0
|
|
@@ -740,8 +735,8 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
740
735
|
});
|
|
741
736
|
|
|
742
737
|
const _hoisted_1$9 = { class: "m-fields-group-list-item" };
|
|
743
|
-
const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("
|
|
744
|
-
const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("
|
|
738
|
+
const _hoisted_2$5 = /* @__PURE__ */ createTextVNode("上移");
|
|
739
|
+
const _hoisted_3$5 = /* @__PURE__ */ createTextVNode("下移");
|
|
745
740
|
const _hoisted_4$4 = ["innerHTML"];
|
|
746
741
|
const __default__$t = defineComponent({
|
|
747
742
|
name: "MFormGroupListItem"
|
|
@@ -779,7 +774,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
779
774
|
if (props.config.titleKey && props.model[props.config.titleKey]) {
|
|
780
775
|
return props.model[props.config.titleKey];
|
|
781
776
|
}
|
|
782
|
-
return
|
|
777
|
+
return `组 ${String(props.index)}`;
|
|
783
778
|
});
|
|
784
779
|
const length = computed(() => props.groupModel?.length || 0);
|
|
785
780
|
const itemExtra = computed(() => filterFunction(mForm, props.config.itemExtra, props));
|
|
@@ -899,12 +894,12 @@ const _hoisted_3$4 = {
|
|
|
899
894
|
key: 1,
|
|
900
895
|
class: "el-table__empty-block"
|
|
901
896
|
};
|
|
902
|
-
const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("span", { class: "el-table__empty-text" }, "
|
|
897
|
+
const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("span", { class: "el-table__empty-text" }, "暂无数据", -1);
|
|
903
898
|
const _hoisted_5$2 = [
|
|
904
899
|
_hoisted_4$3
|
|
905
900
|
];
|
|
906
|
-
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("
|
|
907
|
-
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("
|
|
901
|
+
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("添加组");
|
|
902
|
+
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("切换为表格");
|
|
908
903
|
const __default__$s = defineComponent({
|
|
909
904
|
name: "MFormGroupList"
|
|
910
905
|
});
|
|
@@ -1325,12 +1320,12 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
1325
1320
|
const _hoisted_1$6 = ["innerHTML"];
|
|
1326
1321
|
const _hoisted_2$2 = { class: "el-form-item__content" };
|
|
1327
1322
|
const _hoisted_3$2 = ["innerHTML"];
|
|
1328
|
-
const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("
|
|
1329
|
-
const _hoisted_5 = /* @__PURE__ */ createTextVNode("
|
|
1330
|
-
const _hoisted_6 = /* @__PURE__ */ createTextVNode("
|
|
1331
|
-
const _hoisted_7 = /* @__PURE__ */ createTextVNode("
|
|
1332
|
-
const _hoisted_8 = /* @__PURE__ */ createTextVNode("
|
|
1333
|
-
const _hoisted_9 = /* @__PURE__ */ createTextVNode("
|
|
1323
|
+
const _hoisted_4$1 = /* @__PURE__ */ createTextVNode("添加");
|
|
1324
|
+
const _hoisted_5 = /* @__PURE__ */ createTextVNode(" ");
|
|
1325
|
+
const _hoisted_6 = /* @__PURE__ */ createTextVNode("展开配置");
|
|
1326
|
+
const _hoisted_7 = /* @__PURE__ */ createTextVNode("导入EXCEL");
|
|
1327
|
+
const _hoisted_8 = /* @__PURE__ */ createTextVNode(" ");
|
|
1328
|
+
const _hoisted_9 = /* @__PURE__ */ createTextVNode("清空");
|
|
1334
1329
|
const _hoisted_10 = {
|
|
1335
1330
|
key: 1,
|
|
1336
1331
|
class: "bottom",
|
|
@@ -1430,7 +1425,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1430
1425
|
};
|
|
1431
1426
|
const newHandler = async (row) => {
|
|
1432
1427
|
if (props.config.max && props.model[modelName.value].length >= props.config.max) {
|
|
1433
|
-
tMagicMessage.error(
|
|
1428
|
+
tMagicMessage.error(`最多新增配置不能超过${props.config.max}条`);
|
|
1434
1429
|
return;
|
|
1435
1430
|
}
|
|
1436
1431
|
const columns = props.config.items;
|
|
@@ -1614,7 +1609,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1614
1609
|
mForm?.$emit("field-change", props.prop, props.model[modelName.value]);
|
|
1615
1610
|
};
|
|
1616
1611
|
const excelHandler = (file) => {
|
|
1617
|
-
if (!file
|
|
1612
|
+
if (!file?.raw) {
|
|
1618
1613
|
return false;
|
|
1619
1614
|
}
|
|
1620
1615
|
const reader = new FileReader();
|
|
@@ -1694,7 +1689,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1694
1689
|
}, null, 8, _hoisted_1$6)) : createCommentVNode("", true),
|
|
1695
1690
|
createElementVNode("div", _hoisted_2$2, [
|
|
1696
1691
|
createVNode(unref(TMagicTooltip), {
|
|
1697
|
-
content: "
|
|
1692
|
+
content: "拖拽可排序",
|
|
1698
1693
|
placement: "left-start",
|
|
1699
1694
|
disabled: __props.config.dropSort !== true
|
|
1700
1695
|
}, {
|
|
@@ -1729,7 +1724,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1729
1724
|
_: 1
|
|
1730
1725
|
})) : createCommentVNode("", true),
|
|
1731
1726
|
createVNode(unref(TMagicTableColumn), {
|
|
1732
|
-
label: "
|
|
1727
|
+
label: "操作",
|
|
1733
1728
|
width: __props.config.operateColWidth || 55,
|
|
1734
1729
|
align: "center",
|
|
1735
1730
|
fixed: __props.config.fixed === false ? void 0 : "left"
|
|
@@ -1752,13 +1747,13 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1752
1747
|
}, 8, ["width", "fixed"]),
|
|
1753
1748
|
__props.sort && __props.model[unref(modelName)] && __props.model[unref(modelName)].length > 1 ? (openBlock(), createBlock(unref(TMagicTableColumn), {
|
|
1754
1749
|
key: 1,
|
|
1755
|
-
label: "
|
|
1750
|
+
label: "排序",
|
|
1756
1751
|
width: "60"
|
|
1757
1752
|
}, {
|
|
1758
1753
|
default: withCtx((scope) => [
|
|
1759
1754
|
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== 0 ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
1760
1755
|
key: 0,
|
|
1761
|
-
content: "
|
|
1756
|
+
content: "点击上移,双击置顶",
|
|
1762
1757
|
placement: "top"
|
|
1763
1758
|
}, {
|
|
1764
1759
|
default: withCtx(() => [
|
|
@@ -1777,7 +1772,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1777
1772
|
}, 1024)) : createCommentVNode("", true),
|
|
1778
1773
|
scope.$index + 1 + pagecontext.value * pagesize.value - 1 !== __props.model[unref(modelName)].length - 1 ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
1779
1774
|
key: 1,
|
|
1780
|
-
content: "
|
|
1775
|
+
content: "点击下移,双击置底",
|
|
1781
1776
|
placement: "top"
|
|
1782
1777
|
}, {
|
|
1783
1778
|
default: withCtx(() => [
|
|
@@ -1807,7 +1802,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1807
1802
|
__props.showIndex && __props.config.showIndex ? (openBlock(), createBlock(unref(TMagicTableColumn), {
|
|
1808
1803
|
key: 3,
|
|
1809
1804
|
width: "60",
|
|
1810
|
-
label: "
|
|
1805
|
+
label: "序号"
|
|
1811
1806
|
}, {
|
|
1812
1807
|
default: withCtx((scope) => [
|
|
1813
1808
|
createTextVNode(toDisplayString(scope.$index + 1 + pagecontext.value * pagesize.value), 1)
|
|
@@ -1886,7 +1881,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
1886
1881
|
onClick: toggleFullscreen
|
|
1887
1882
|
}, {
|
|
1888
1883
|
default: withCtx(() => [
|
|
1889
|
-
createTextVNode(toDisplayString(isFullscreen.value ? "
|
|
1884
|
+
createTextVNode(toDisplayString(isFullscreen.value ? "退出全屏" : "全屏编辑"), 1)
|
|
1890
1885
|
]),
|
|
1891
1886
|
_: 1
|
|
1892
1887
|
}, 8, ["icon"])) : createCommentVNode("", true),
|
|
@@ -1967,7 +1962,8 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1967
1962
|
emits: ["change", "addDiffCount"],
|
|
1968
1963
|
setup(__props, { emit }) {
|
|
1969
1964
|
const props = __props;
|
|
1970
|
-
const
|
|
1965
|
+
const tabPaneComponent = getConfig$1("components").tabPane;
|
|
1966
|
+
const tabsComponent = getConfig$1("components").tabs;
|
|
1971
1967
|
const getActive = (mForm2, props2, activeTabName2) => {
|
|
1972
1968
|
const { config, model, prop } = props2;
|
|
1973
1969
|
const { active } = config;
|
|
@@ -1996,10 +1992,10 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
1996
1992
|
const tabs = computed(() => {
|
|
1997
1993
|
if (props.config.dynamic) {
|
|
1998
1994
|
if (!props.config.name)
|
|
1999
|
-
throw new Error("dynamic tab
|
|
1995
|
+
throw new Error("dynamic tab 必须配置name");
|
|
2000
1996
|
return props.model[props.config.name] || [];
|
|
2001
1997
|
}
|
|
2002
|
-
return props.config.items;
|
|
1998
|
+
return props.config.items.filter((item) => display(mForm, item.display, props));
|
|
2003
1999
|
});
|
|
2004
2000
|
const filter = (config) => filterFunction(mForm, config, props);
|
|
2005
2001
|
watchEffect(() => {
|
|
@@ -2014,7 +2010,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2014
2010
|
const tabClickHandler = (tab) => tabClick(mForm, tab, props);
|
|
2015
2011
|
const onTabAdd = () => {
|
|
2016
2012
|
if (!props.config.name)
|
|
2017
|
-
throw new Error("dynamic tab
|
|
2013
|
+
throw new Error("dynamic tab 必须配置name");
|
|
2018
2014
|
if (typeof props.config.onTabAdd === "function") {
|
|
2019
2015
|
props.config.onTabAdd(mForm, {
|
|
2020
2016
|
model: props.model,
|
|
@@ -2023,7 +2019,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2023
2019
|
});
|
|
2024
2020
|
} else if (tabs.value.length > 0) {
|
|
2025
2021
|
const newObj = cloneDeep(tabs.value[0]);
|
|
2026
|
-
newObj.title =
|
|
2022
|
+
newObj.title = `标签${tabs.value.length + 1}`;
|
|
2027
2023
|
props.model[props.config.name].push(newObj);
|
|
2028
2024
|
}
|
|
2029
2025
|
emit("change", props.model);
|
|
@@ -2031,7 +2027,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2031
2027
|
};
|
|
2032
2028
|
const onTabRemove = (tabName) => {
|
|
2033
2029
|
if (!props.config.name)
|
|
2034
|
-
throw new Error("dynamic tab
|
|
2030
|
+
throw new Error("dynamic tab 必须配置name");
|
|
2035
2031
|
if (typeof props.config.onTabRemove === "function") {
|
|
2036
2032
|
props.config.onTabRemove(mForm, tabName, {
|
|
2037
2033
|
model: props.model,
|
|
@@ -2048,7 +2044,6 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2048
2044
|
emit("change", props.model);
|
|
2049
2045
|
mForm?.$emit("field-change", props.prop, props.model[props.config.name]);
|
|
2050
2046
|
};
|
|
2051
|
-
const display$1 = (displayConfig) => display(mForm, displayConfig, props);
|
|
2052
2047
|
const changeHandler = () => {
|
|
2053
2048
|
emit("change", props.model);
|
|
2054
2049
|
if (typeof props.config.onChange === "function") {
|
|
@@ -2064,61 +2059,62 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
2064
2059
|
emit("addDiffCount");
|
|
2065
2060
|
};
|
|
2066
2061
|
return (_ctx, _cache) => {
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2062
|
+
return openBlock(), createBlock(resolveDynamicComponent(unref(tabsComponent).component), mergeProps(
|
|
2063
|
+
{
|
|
2064
|
+
modelValue: activeTabName.value,
|
|
2065
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event)
|
|
2066
|
+
},
|
|
2067
|
+
unref(tabsComponent).props({
|
|
2068
|
+
type: __props.config.tabType,
|
|
2069
|
+
editable: __props.config.editable || false,
|
|
2070
|
+
tabPosition: __props.config.tabPosition || "top"
|
|
2071
|
+
}),
|
|
2072
|
+
{
|
|
2073
|
+
class: `tmagic-design-tabs ${__props.config.dynamic ? "magic-form-dynamic-tab" : "magic-form-tab"}`,
|
|
2074
|
+
onTabClick: tabClickHandler,
|
|
2075
|
+
onTabAdd,
|
|
2076
|
+
onTabRemove
|
|
2077
|
+
}
|
|
2078
|
+
), {
|
|
2079
2079
|
default: withCtx(() => [
|
|
2080
2080
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabs), (tab, tabIndex) => {
|
|
2081
|
-
return openBlock(),
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
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
|
-
_: 2
|
|
2116
|
-
}, 1032, ["name", "lazy"])) : createCommentVNode("", true)
|
|
2117
|
-
], 64);
|
|
2118
|
-
}), 256))
|
|
2081
|
+
return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent).component), mergeProps({
|
|
2082
|
+
key: tab[unref(mForm)?.keyProp || "__key"] ?? tabIndex
|
|
2083
|
+
}, unref(tabPaneComponent).props({ name: filter(tab.status) || tabIndex.toString(), lazy: tab.lazy || false })), {
|
|
2084
|
+
label: withCtx(() => [
|
|
2085
|
+
createElementVNode("span", null, [
|
|
2086
|
+
createTextVNode(toDisplayString(filter(tab.title)), 1),
|
|
2087
|
+
createVNode(unref(TMagicBadge), {
|
|
2088
|
+
hidden: !diffCount.value[tabIndex],
|
|
2089
|
+
value: diffCount.value[tabIndex],
|
|
2090
|
+
class: "diff-count-badge"
|
|
2091
|
+
}, null, 8, ["hidden", "value"])
|
|
2092
|
+
])
|
|
2093
|
+
]),
|
|
2094
|
+
default: withCtx(() => [
|
|
2095
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(tabItems(tab), (item) => {
|
|
2096
|
+
return openBlock(), createBlock(_sfc_main$v, {
|
|
2097
|
+
key: item[unref(mForm)?.keyProp || "__key"],
|
|
2098
|
+
config: item,
|
|
2099
|
+
disabled: __props.disabled,
|
|
2100
|
+
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,
|
|
2101
|
+
"last-values": unref(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,
|
|
2102
|
+
"is-compare": __props.isCompare,
|
|
2103
|
+
prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : __props.prop,
|
|
2104
|
+
size: __props.size,
|
|
2105
|
+
"label-width": tab.labelWidth || __props.labelWidth,
|
|
2106
|
+
"expand-more": __props.expandMore,
|
|
2107
|
+
onChange: changeHandler,
|
|
2108
|
+
onAddDiffCount: ($event) => onAddDiffCount(tabIndex)
|
|
2109
|
+
}, null, 8, ["config", "disabled", "model", "last-values", "is-compare", "prop", "size", "label-width", "expand-more", "onAddDiffCount"]);
|
|
2110
|
+
}), 128))
|
|
2111
|
+
]),
|
|
2112
|
+
_: 2
|
|
2113
|
+
}, 1040);
|
|
2114
|
+
}), 128))
|
|
2119
2115
|
]),
|
|
2120
2116
|
_: 1
|
|
2121
|
-
},
|
|
2117
|
+
}, 16, ["modelValue", "class"]);
|
|
2122
2118
|
};
|
|
2123
2119
|
}
|
|
2124
2120
|
});
|
|
@@ -2520,8 +2516,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
2520
2516
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
2521
2517
|
type: "datetimerange",
|
|
2522
2518
|
"range-separator": "-",
|
|
2523
|
-
"start-placeholder": "
|
|
2524
|
-
"end-placeholder": "
|
|
2519
|
+
"start-placeholder": "开始日期",
|
|
2520
|
+
"end-placeholder": "结束日期",
|
|
2525
2521
|
size: __props.size,
|
|
2526
2522
|
"unlink-panels": true,
|
|
2527
2523
|
disabled: __props.disabled,
|
|
@@ -2836,7 +2832,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2836
2832
|
if (field && message)
|
|
2837
2833
|
error.push(`${field} -> ${message}`);
|
|
2838
2834
|
if (field && !message)
|
|
2839
|
-
error.push(`${field} ->
|
|
2835
|
+
error.push(`${field} -> 出现错误`);
|
|
2840
2836
|
if (!field && message)
|
|
2841
2837
|
error.push(`${message}`);
|
|
2842
2838
|
});
|
|
@@ -2879,9 +2875,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2879
2875
|
});
|
|
2880
2876
|
|
|
2881
2877
|
const _hoisted_1$3 = { style: { "min-height": "1px" } };
|
|
2882
|
-
const _hoisted_2$1 = /* @__PURE__ */ createTextVNode("
|
|
2883
|
-
const _hoisted_3$1 = /* @__PURE__ */ createTextVNode("
|
|
2884
|
-
const _hoisted_4 = /* @__PURE__ */ createTextVNode("
|
|
2878
|
+
const _hoisted_2$1 = /* @__PURE__ */ createTextVNode("取 消");
|
|
2879
|
+
const _hoisted_3$1 = /* @__PURE__ */ createTextVNode("上一步");
|
|
2880
|
+
const _hoisted_4 = /* @__PURE__ */ createTextVNode("下一步");
|
|
2885
2881
|
const __default__$a = defineComponent({
|
|
2886
2882
|
name: "MFormDialog"
|
|
2887
2883
|
});
|
|
@@ -2898,7 +2894,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2898
2894
|
title: null,
|
|
2899
2895
|
zIndex: null,
|
|
2900
2896
|
size: null,
|
|
2901
|
-
confirmText: { default: "
|
|
2897
|
+
confirmText: { default: "确定" }
|
|
2902
2898
|
},
|
|
2903
2899
|
emits: ["close", "submit", "error", "change"],
|
|
2904
2900
|
setup(__props, { expose, emit }) {
|
|
@@ -3071,7 +3067,7 @@ const _hoisted_2 = {
|
|
|
3071
3067
|
key: 2,
|
|
3072
3068
|
class: "m-fields-link"
|
|
3073
3069
|
};
|
|
3074
|
-
const _hoisted_3 = /* @__PURE__ */ createTextVNode("
|
|
3070
|
+
const _hoisted_3 = /* @__PURE__ */ createTextVNode("点击编辑");
|
|
3075
3071
|
const __default__$9 = defineComponent({
|
|
3076
3072
|
name: "MFormLink"
|
|
3077
3073
|
});
|
|
@@ -3119,7 +3115,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
3119
3115
|
if (props.config.displayText) {
|
|
3120
3116
|
return props.config.displayText;
|
|
3121
3117
|
}
|
|
3122
|
-
return "
|
|
3118
|
+
return "跳转";
|
|
3123
3119
|
});
|
|
3124
3120
|
const editHandler = () => {
|
|
3125
3121
|
init();
|
|
@@ -3156,7 +3152,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
3156
3152
|
createVNode(_sfc_main$a, {
|
|
3157
3153
|
ref_key: "editor",
|
|
3158
3154
|
ref: editor,
|
|
3159
|
-
title: __props.config.formTitle || "
|
|
3155
|
+
title: __props.config.formTitle || "编辑扩展配置",
|
|
3160
3156
|
width: __props.config.formWidth,
|
|
3161
3157
|
values: formValue.value,
|
|
3162
3158
|
config: unref(formConfig),
|
|
@@ -3344,7 +3340,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3344
3340
|
setup(__props, { emit }) {
|
|
3345
3341
|
const props = __props;
|
|
3346
3342
|
if (!props.model)
|
|
3347
|
-
throw new Error("
|
|
3343
|
+
throw new Error("不能没有model");
|
|
3348
3344
|
useAddField(props.prop);
|
|
3349
3345
|
const tMagicSelect = ref();
|
|
3350
3346
|
const mForm = inject("mForm");
|
|
@@ -3646,8 +3642,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3646
3642
|
class: "m-select",
|
|
3647
3643
|
ref_key: "tMagicSelect",
|
|
3648
3644
|
ref: tMagicSelect,
|
|
3649
|
-
clearable: "",
|
|
3650
|
-
filterable: "",
|
|
3645
|
+
clearable: typeof __props.config.clearable !== "undefined" ? __props.config.clearable : true,
|
|
3646
|
+
filterable: typeof __props.config.filterable !== "undefined" ? __props.config.filterable : true,
|
|
3651
3647
|
"popper-class": `m-select-popper ${unref(popperClass)}`,
|
|
3652
3648
|
size: __props.size,
|
|
3653
3649
|
remote: remote.value,
|
|
@@ -3673,7 +3669,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3673
3669
|
]) : createCommentVNode("", true)
|
|
3674
3670
|
]),
|
|
3675
3671
|
_: 1
|
|
3676
|
-
}, 8, ["modelValue", "popper-class", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method"])), [
|
|
3672
|
+
}, 8, ["modelValue", "clearable", "filterable", "popper-class", "size", "remote", "placeholder", "multiple", "value-key", "allow-create", "disabled", "remote-method"])), [
|
|
3677
3673
|
[_directive_loading, loading.value]
|
|
3678
3674
|
]) : createCommentVNode("", true);
|
|
3679
3675
|
};
|
|
@@ -3826,7 +3822,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3826
3822
|
emit("change", props.model[props.name]);
|
|
3827
3823
|
};
|
|
3828
3824
|
return (_ctx, _cache) => {
|
|
3829
|
-
const _component_el_button = resolveComponent("el-button");
|
|
3830
3825
|
return openBlock(), createBlock(unref(TMagicInput), {
|
|
3831
3826
|
modelValue: __props.model[__props.name],
|
|
3832
3827
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => __props.model[__props.name] = $event),
|
|
@@ -3842,7 +3837,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3842
3837
|
name: "append",
|
|
3843
3838
|
fn: withCtx(() => [
|
|
3844
3839
|
typeof __props.config.append === "string" ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.config.append), 1)) : createCommentVNode("", true),
|
|
3845
|
-
typeof __props.config.append === "object" && __props.config.append.type === "button" ? (openBlock(), createBlock(
|
|
3840
|
+
typeof __props.config.append === "object" && __props.config.append.type === "button" ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
3846
3841
|
key: 1,
|
|
3847
3842
|
style: { "color": "#409eff" },
|
|
3848
3843
|
size: __props.size,
|