@tmagic/form 1.8.0-manmanyu.9 → 1.8.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/es/Form.vue_vue_type_script_setup_true_lang.js +88 -107
- package/dist/es/FormBox.vue_vue_type_script_setup_true_lang.js +21 -5
- package/dist/es/FormDialog.vue_vue_type_script_setup_true_lang.js +21 -5
- package/dist/es/FormDrawer.vue_vue_type_script_setup_true_lang.js +46 -12
- package/dist/es/containers/Col.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/es/containers/Container.vue_vue_type_script_setup_true_lang.js +44 -47
- package/dist/es/containers/Fieldset.vue_vue_type_script_setup_true_lang.js +7 -1
- package/dist/es/containers/FlexLayout.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/containers/FormLabel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/GroupList.vue_vue_type_script_setup_true_lang.js +59 -22
- package/dist/es/containers/GroupListItem.vue_vue_type_script_setup_true_lang.js +118 -100
- package/dist/es/containers/Panel.vue_vue_type_script_setup_true_lang.js +8 -3
- package/dist/es/containers/Row.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/containers/Step.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/containers/Tabs.vue_vue_type_script_setup_true_lang.js +8 -1
- package/dist/es/containers/table/ActionsColumn.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/table/SortColumn.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/containers/table/Table.vue_vue_type_script_setup_true_lang.js +14 -10
- package/dist/es/containers/table/useTableColumns.js +10 -15
- package/dist/es/containers/table-group-list/TableGroupList.vue_vue_type_script_setup_true_lang.js +72 -79
- package/dist/es/containers/table-group-list/useAdd.js +26 -16
- package/dist/es/containers/table-group-list/useScrollLastItemIntoView.js +72 -0
- package/dist/es/fields/Cascader.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/fields/Checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/CheckboxGroup/Index.js +5 -0
- package/dist/es/fields/{CheckboxGroup.vue_vue_type_script_setup_true_lang.js → CheckboxGroup/Index.vue_vue_type_script_setup_true_lang.js} +6 -7
- package/dist/es/fields/CheckboxGroup/effect.js +8 -0
- package/dist/es/fields/ColorPicker.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/Date/Index.js +5 -0
- package/dist/es/fields/{Date.vue_vue_type_script_setup_true_lang.js → Date/Index.vue_vue_type_script_setup_true_lang.js} +5 -7
- package/dist/es/fields/Date/effect.js +10 -0
- package/dist/es/fields/DateTime/Index.js +5 -0
- package/dist/es/fields/{DateTime.vue_vue_type_script_setup_true_lang.js → DateTime/Index.vue_vue_type_script_setup_true_lang.js} +5 -9
- package/dist/es/fields/DateTime/effect.js +15 -0
- package/dist/es/fields/Daterange.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/fields/Display/Index.js +5 -0
- package/dist/es/fields/{Display.vue_vue_type_script_setup_true_lang.js → Display/Index.vue_vue_type_script_setup_true_lang.js} +6 -7
- package/dist/es/fields/Display/effect.js +8 -0
- package/dist/es/fields/DynamicField/Index.js +5 -0
- package/dist/es/fields/{DynamicField.vue_vue_type_script_setup_true_lang.js → DynamicField/Index.vue_vue_type_script_setup_true_lang.js} +11 -15
- package/dist/es/fields/DynamicField/effect.js +40 -0
- package/dist/es/fields/Hidden.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/Link.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/es/fields/Number.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/es/fields/NumberRange/Index.js +5 -0
- package/dist/es/fields/{NumberRange.vue_vue_type_script_setup_true_lang.js → NumberRange/Index.vue_vue_type_script_setup_true_lang.js} +5 -6
- package/dist/es/fields/NumberRange/effect.js +8 -0
- package/dist/es/fields/RadioGroup.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/Select.vue_vue_type_script_setup_true_lang.js +14 -6
- package/dist/es/fields/Switch.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/Text.vue_vue_type_script_setup_true_lang.js +13 -10
- package/dist/es/fields/Textarea.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/Time.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/Timerange.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/headless.js +13 -0
- package/dist/es/index.js +19 -12
- package/dist/es/plugin.js +57 -39
- package/dist/es/schema.js +11 -2
- package/dist/es/style.css +123 -3
- package/dist/es/submitForm.js +270 -72
- package/dist/es/utils/builtInFields.js +49 -0
- package/dist/es/utils/collectFields.js +407 -0
- package/dist/es/utils/config.js +4 -8
- package/dist/es/utils/fieldInnerConfig.js +42 -0
- package/dist/es/utils/fieldValueEffects.js +80 -0
- package/dist/es/utils/form.js +154 -19
- package/dist/es/utils/formStateProxy.js +111 -0
- package/dist/es/utils/registerField.js +158 -0
- package/dist/es/utils/submitHeadless.js +54 -0
- package/dist/es/utils/tableGroupList.js +104 -0
- package/dist/es/utils/typeMatch.js +532 -0
- package/dist/es/utils/validateError.js +57 -0
- package/dist/es/utils/validateValues.js +115 -0
- package/dist/style.css +123 -3
- package/dist/themes/magic-admin.css +576 -14
- package/dist/tmagic-form-headless.umd.cjs +4515 -0
- package/dist/tmagic-form.umd.cjs +3444 -983
- package/package.json +16 -10
- package/src/Form.vue +113 -129
- package/src/FormBox.vue +16 -4
- package/src/FormDialog.vue +16 -5
- package/src/FormDrawer.vue +41 -13
- package/src/containers/Col.vue +3 -0
- package/src/containers/Container.vue +40 -45
- package/src/containers/Fieldset.vue +5 -0
- package/src/containers/FlexLayout.vue +2 -0
- package/src/containers/GroupList.vue +64 -13
- package/src/containers/GroupListItem.vue +88 -81
- package/src/containers/Panel.vue +3 -0
- package/src/containers/Row.vue +2 -0
- package/src/containers/Step.vue +2 -0
- package/src/containers/Tabs.vue +13 -0
- package/src/containers/table/ActionsColumn.vue +1 -1
- package/src/containers/table/Table.vue +5 -3
- package/src/containers/table/usePagination.ts +1 -1
- package/src/containers/table/useSortable.ts +1 -1
- package/src/containers/table/useTableColumns.ts +15 -22
- package/src/containers/table-group-list/TableGroupList.vue +46 -72
- package/src/containers/table-group-list/useAdd.ts +40 -25
- package/src/containers/table-group-list/useScrollLastItemIntoView.ts +94 -0
- package/src/fields/{CheckboxGroup.vue → CheckboxGroup/Index.vue} +3 -8
- package/src/fields/CheckboxGroup/effect.ts +27 -0
- package/src/fields/{Date.vue → Date/Index.vue} +2 -5
- package/src/fields/Date/effect.ts +29 -0
- package/src/fields/{DateTime.vue → DateTime/Index.vue} +2 -16
- package/src/fields/DateTime/effect.ts +36 -0
- package/src/fields/{Display.vue → Display/Index.vue} +3 -7
- package/src/fields/Display/effect.ts +28 -0
- package/src/fields/{DynamicField.vue → DynamicField/Index.vue} +11 -11
- package/src/fields/DynamicField/effect.ts +74 -0
- package/src/fields/Link.vue +3 -4
- package/src/fields/Number.vue +2 -1
- package/src/fields/{NumberRange.vue → NumberRange/Index.vue} +2 -6
- package/src/fields/NumberRange/effect.ts +27 -0
- package/src/fields/RadioGroup.vue +13 -1
- package/src/fields/Select.vue +13 -4
- package/src/headless.ts +78 -0
- package/src/index.ts +46 -9
- package/src/plugin.ts +68 -37
- package/src/schema.ts +13 -2
- package/src/submitForm.ts +410 -131
- package/src/theme/fieldset.scss +1 -0
- package/src/theme/form-box.scss +5 -0
- package/src/theme/form-dialog.scss +1 -1
- package/src/theme/group-list.scss +143 -2
- package/src/theme/table.scss +11 -1
- package/src/theme/themes/magic-admin/index.scss +27 -16
- package/src/utils/builtInFields.ts +69 -0
- package/src/utils/collectFields.ts +561 -0
- package/src/utils/config.ts +7 -15
- package/src/utils/fieldInnerConfig.ts +127 -0
- package/src/utils/fieldValueEffects.ts +140 -0
- package/src/utils/form.ts +230 -30
- package/src/utils/formStateProxy.ts +149 -0
- package/src/utils/registerField.ts +308 -0
- package/src/utils/submitHeadless.ts +206 -0
- package/src/utils/tableGroupList.ts +147 -0
- package/src/utils/typeMatch.ts +948 -0
- package/src/utils/validateError.ts +92 -0
- package/src/utils/validateValues.ts +177 -0
- package/types/headless.d.ts +682 -0
- package/types/index.d.ts +900 -180
- package/dist/es/_virtual/_rolldown/runtime.js +0 -27
- package/dist/es/fields/CheckboxGroup.js +0 -5
- package/dist/es/fields/Date.js +0 -5
- package/dist/es/fields/DateTime.js +0 -5
- package/dist/es/fields/Display.js +0 -5
- package/dist/es/fields/DynamicField.js +0 -5
- package/dist/es/fields/NumberRange.js +0 -5
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { filterFunction } from "../utils/form.js";
|
|
1
|
+
import { appendProp, filterFunction } from "../utils/form.js";
|
|
2
|
+
import { getGroupListRowConfig } from "../utils/tableGroupList.js";
|
|
2
3
|
import Container_default from "./Container.js";
|
|
3
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, openBlock, ref, unref, vShow, withCtx, withDirectives } from "vue";
|
|
4
|
-
import { TMagicButton, TMagicCard, TMagicIcon, TMagicInputNumber, TMagicPopover } from "@tmagic/design";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, openBlock, ref, renderSlot, unref, vShow, withCtx, withDirectives } from "vue";
|
|
5
|
+
import { TMagicButton, TMagicCard, TMagicIcon, TMagicInputNumber, TMagicPopover, TMagicTooltip } from "@tmagic/design";
|
|
5
6
|
import { ArrowDown, ArrowRight, Bottom, Delete, DocumentCopy, Position, Top } from "@element-plus/icons-vue";
|
|
6
7
|
//#region packages/form/src/containers/GroupListItem.vue?vue&type=script&setup=true&lang.ts
|
|
7
8
|
var _hoisted_1 = { class: "m-fields-group-list-item-header" };
|
|
8
|
-
var _hoisted_2 =
|
|
9
|
-
var _hoisted_3 =
|
|
9
|
+
var _hoisted_2 = { class: "m-fields-group-list-item-title" };
|
|
10
|
+
var _hoisted_3 = ["innerHTML"];
|
|
11
|
+
var _hoisted_4 = { class: "m-fields-group-list-item-actions" };
|
|
12
|
+
var _hoisted_5 = { style: {
|
|
10
13
|
"text-align": "right",
|
|
11
14
|
"margin-top": "20px"
|
|
12
15
|
} };
|
|
13
|
-
var
|
|
14
|
-
var GroupListItem_vue_vue_type_script_setup_true_lang_default =
|
|
16
|
+
var _hoisted_6 = ["innerHTML"];
|
|
17
|
+
var GroupListItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
15
18
|
name: "MFormGroupListItem",
|
|
16
19
|
__name: "GroupListItem",
|
|
17
20
|
props: {
|
|
@@ -21,6 +24,7 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
21
24
|
groupModel: {},
|
|
22
25
|
config: {},
|
|
23
26
|
labelWidth: {},
|
|
27
|
+
labelPosition: {},
|
|
24
28
|
prop: {},
|
|
25
29
|
size: {},
|
|
26
30
|
index: {},
|
|
@@ -39,15 +43,13 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
39
43
|
const mForm = inject("mForm");
|
|
40
44
|
const defaultExpandQuantity = props.config.defaultExpandQuantity ?? 7;
|
|
41
45
|
const expand = ref(props.config.expandAll || defaultExpandQuantity > props.index);
|
|
42
|
-
const rowConfig = computed(() => (
|
|
43
|
-
|
|
44
|
-
span: props.config.span || 24,
|
|
45
|
-
items: props.config.items,
|
|
46
|
-
labelWidth: props.config.labelWidth,
|
|
47
|
-
[mForm?.keyProp || "__key"]: `${props.config[mForm?.keyProp || "__key"]}${String(props.index)}`
|
|
48
|
-
}));
|
|
46
|
+
const rowConfig = computed(() => getGroupListRowConfig(props.config, props.index, mForm?.keyProp));
|
|
47
|
+
const rowProp = computed(() => appendProp(props.prop, props.index));
|
|
49
48
|
const title = computed(() => {
|
|
50
|
-
if (props.config.titleKey && props.model[props.config.titleKey])
|
|
49
|
+
if (props.config.titleKey && props.model[props.config.titleKey]) {
|
|
50
|
+
const { titlePrefix } = props.config;
|
|
51
|
+
return titlePrefix ? `${titlePrefix} ${String(props.index + 1)}: ${props.model[props.config.titleKey]}` : `${props.model[props.config.titleKey]}`;
|
|
52
|
+
}
|
|
51
53
|
if (props.config.title) return filterFunction(mForm, props.config.title, props);
|
|
52
54
|
return `${props.config.titlePrefix || "组"} ${String(props.index + 1)}`;
|
|
53
55
|
});
|
|
@@ -102,98 +104,112 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
102
104
|
})]),
|
|
103
105
|
_: 1
|
|
104
106
|
}, 8, ["disabled"]),
|
|
105
|
-
createElementVNode("
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
copyable.value && !__props.isCompare ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
116
|
-
key: 1,
|
|
117
|
-
link: "",
|
|
118
|
-
size: "default",
|
|
119
|
-
type: "primary",
|
|
120
|
-
icon: unref(DocumentCopy),
|
|
121
|
-
disabled: __props.disabled,
|
|
122
|
-
onClick: copyHandler
|
|
123
|
-
}, {
|
|
124
|
-
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("复制", -1)])]),
|
|
125
|
-
_: 1
|
|
126
|
-
}, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true),
|
|
127
|
-
movable.value && !__props.isCompare ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [withDirectives(createVNode(unref(TMagicButton), {
|
|
128
|
-
link: "",
|
|
129
|
-
size: "default",
|
|
130
|
-
disabled: __props.disabled,
|
|
131
|
-
icon: unref(Top),
|
|
132
|
-
onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
|
|
133
|
-
}, {
|
|
134
|
-
default: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("上移", -1)])]),
|
|
135
|
-
_: 1
|
|
136
|
-
}, 8, ["disabled", "icon"]), [[vShow, __props.index !== 0]]), withDirectives(createVNode(unref(TMagicButton), {
|
|
137
|
-
link: "",
|
|
138
|
-
size: "default",
|
|
139
|
-
disabled: __props.disabled,
|
|
140
|
-
icon: unref(Bottom),
|
|
141
|
-
onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
|
|
142
|
-
}, {
|
|
143
|
-
default: withCtx(() => [..._cache[8] || (_cache[8] = [createTextVNode("下移", -1)])]),
|
|
144
|
-
_: 1
|
|
145
|
-
}, 8, ["disabled", "icon"]), [[vShow, __props.index !== length.value - 1]])], 64)) : createCommentVNode("v-if", true),
|
|
146
|
-
__props.config.moveSpecifyLocation && !__props.isCompare ? (openBlock(), createBlock(unref(TMagicPopover), {
|
|
147
|
-
key: 3,
|
|
148
|
-
trigger: "click",
|
|
149
|
-
placement: "top",
|
|
150
|
-
width: "200",
|
|
151
|
-
visible: moveSpecifyLocationVisible.value
|
|
152
|
-
}, {
|
|
153
|
-
reference: withCtx(() => [createVNode(unref(TMagicButton), {
|
|
107
|
+
createElementVNode("div", _hoisted_2, [renderSlot(_ctx.$slots, "title", {
|
|
108
|
+
model: __props.model,
|
|
109
|
+
index: __props.index,
|
|
110
|
+
lastValues: __props.lastValues,
|
|
111
|
+
prop: rowProp.value,
|
|
112
|
+
title: title.value
|
|
113
|
+
}, () => [createElementVNode("span", { innerHTML: title.value }, null, 8, _hoisted_3)])]),
|
|
114
|
+
createElementVNode("div", _hoisted_4, [
|
|
115
|
+
copyable.value && !__props.isCompare ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
116
|
+
key: 0,
|
|
154
117
|
link: "",
|
|
155
|
-
size: "
|
|
118
|
+
size: "default",
|
|
156
119
|
type: "primary",
|
|
157
|
-
icon: unref(
|
|
120
|
+
icon: unref(DocumentCopy),
|
|
158
121
|
disabled: __props.disabled,
|
|
159
|
-
onClick:
|
|
122
|
+
onClick: copyHandler
|
|
160
123
|
}, {
|
|
161
|
-
default: withCtx(() => [..._cache[
|
|
124
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("复制", -1)])]),
|
|
162
125
|
_: 1
|
|
163
|
-
}, 8, ["icon", "disabled"])
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
size: "small",
|
|
171
|
-
min: 1,
|
|
172
|
-
disabled: __props.disabled
|
|
173
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
174
|
-
_cache[11] || (_cache[11] = createTextVNode("行 ", -1))
|
|
175
|
-
]), createElementVNode("div", _hoisted_3, [createVNode(unref(TMagicButton), {
|
|
176
|
-
size: "small",
|
|
177
|
-
text: "",
|
|
178
|
-
onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
|
|
126
|
+
}, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true),
|
|
127
|
+
movable.value && !__props.isCompare ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [withDirectives(createVNode(unref(TMagicButton), {
|
|
128
|
+
link: "",
|
|
129
|
+
size: "default",
|
|
130
|
+
disabled: __props.disabled,
|
|
131
|
+
icon: unref(Top),
|
|
132
|
+
onClick: _cache[0] || (_cache[0] = ($event) => changeOrder(-1))
|
|
179
133
|
}, {
|
|
180
|
-
default: withCtx(() => [..._cache[
|
|
134
|
+
default: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("上移", -1)])]),
|
|
181
135
|
_: 1
|
|
182
|
-
}), createVNode(unref(TMagicButton), {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
136
|
+
}, 8, ["disabled", "icon"]), [[vShow, __props.index !== 0]]), withDirectives(createVNode(unref(TMagicButton), {
|
|
137
|
+
link: "",
|
|
138
|
+
size: "default",
|
|
139
|
+
disabled: __props.disabled,
|
|
140
|
+
icon: unref(Bottom),
|
|
141
|
+
onClick: _cache[1] || (_cache[1] = ($event) => changeOrder(1))
|
|
186
142
|
}, {
|
|
187
|
-
default: withCtx(() => [..._cache[
|
|
143
|
+
default: withCtx(() => [..._cache[8] || (_cache[8] = [createTextVNode("下移", -1)])]),
|
|
188
144
|
_: 1
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
145
|
+
}, 8, ["disabled", "icon"]), [[vShow, __props.index !== length.value - 1]])], 64)) : createCommentVNode("v-if", true),
|
|
146
|
+
__props.config.moveSpecifyLocation && !__props.isCompare ? (openBlock(), createBlock(unref(TMagicPopover), {
|
|
147
|
+
key: 2,
|
|
148
|
+
trigger: "click",
|
|
149
|
+
placement: "top",
|
|
150
|
+
width: "200",
|
|
151
|
+
visible: moveSpecifyLocationVisible.value
|
|
152
|
+
}, {
|
|
153
|
+
reference: withCtx(() => [createVNode(unref(TMagicButton), {
|
|
154
|
+
link: "",
|
|
155
|
+
size: "small",
|
|
156
|
+
type: "primary",
|
|
157
|
+
icon: unref(Position),
|
|
158
|
+
disabled: __props.disabled,
|
|
159
|
+
onClick: _cache[2] || (_cache[2] = ($event) => moveSpecifyLocationVisible.value = true)
|
|
160
|
+
}, {
|
|
161
|
+
default: withCtx(() => [..._cache[9] || (_cache[9] = [createTextVNode("移动至", -1)])]),
|
|
162
|
+
_: 1
|
|
163
|
+
}, 8, ["icon", "disabled"])]),
|
|
164
|
+
default: withCtx(() => [createElementVNode("div", null, [createElementVNode("div", null, [
|
|
165
|
+
_cache[10] || (_cache[10] = createTextVNode(" 第", -1)),
|
|
166
|
+
createVNode(unref(TMagicInputNumber), {
|
|
167
|
+
style: { "margin": "0 5px" },
|
|
168
|
+
modelValue: moveSpecifyLocationIndex.value,
|
|
169
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => moveSpecifyLocationIndex.value = $event),
|
|
170
|
+
size: "small",
|
|
171
|
+
min: 1,
|
|
172
|
+
disabled: __props.disabled
|
|
173
|
+
}, null, 8, ["modelValue", "disabled"]),
|
|
174
|
+
_cache[11] || (_cache[11] = createTextVNode("行 ", -1))
|
|
175
|
+
]), createElementVNode("div", _hoisted_5, [createVNode(unref(TMagicButton), {
|
|
176
|
+
size: "small",
|
|
177
|
+
text: "",
|
|
178
|
+
onClick: _cache[4] || (_cache[4] = ($event) => moveSpecifyLocationVisible.value = false)
|
|
179
|
+
}, {
|
|
180
|
+
default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode("取消", -1)])]),
|
|
181
|
+
_: 1
|
|
182
|
+
}), createVNode(unref(TMagicButton), {
|
|
183
|
+
size: "small",
|
|
184
|
+
type: "primary",
|
|
185
|
+
onClick: moveSpecifyLocationHandler
|
|
186
|
+
}, {
|
|
187
|
+
default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode("确认", -1)])]),
|
|
188
|
+
_: 1
|
|
189
|
+
})])])]),
|
|
190
|
+
_: 1
|
|
191
|
+
}, 8, ["visible"])) : createCommentVNode("v-if", true),
|
|
192
|
+
createCommentVNode(" v-if 必须挂在 Tooltip 上:子节点为 false 时 ElOnlyChild 会报 no valid child node found "),
|
|
193
|
+
!__props.isCompare ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
194
|
+
key: 3,
|
|
195
|
+
content: `删除 ${title.value}`
|
|
196
|
+
}, {
|
|
197
|
+
default: withCtx(() => [withDirectives(createVNode(unref(TMagicButton), {
|
|
198
|
+
size: "default",
|
|
199
|
+
link: "",
|
|
200
|
+
class: "delete-button",
|
|
201
|
+
icon: unref(Delete),
|
|
202
|
+
disabled: __props.disabled,
|
|
203
|
+
onClick: removeHandler
|
|
204
|
+
}, null, 8, ["icon", "disabled"]), [[vShow, showDelete.value]])]),
|
|
205
|
+
_: 1
|
|
206
|
+
}, 8, ["content"])) : createCommentVNode("v-if", true),
|
|
207
|
+
itemExtra.value ? (openBlock(), createElementBlock("span", {
|
|
208
|
+
key: 4,
|
|
209
|
+
innerHTML: itemExtra.value,
|
|
210
|
+
class: "m-form-tip"
|
|
211
|
+
}, null, 8, _hoisted_6)) : createCommentVNode("v-if", true)
|
|
212
|
+
])
|
|
197
213
|
])]),
|
|
198
214
|
default: withCtx(() => [expand.value ? (openBlock(), createBlock(Container_default, {
|
|
199
215
|
key: 0,
|
|
@@ -202,7 +218,8 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
202
218
|
lastValues: __props.lastValues,
|
|
203
219
|
"is-compare": __props.isCompare,
|
|
204
220
|
labelWidth: __props.labelWidth,
|
|
205
|
-
|
|
221
|
+
labelPosition: __props.labelPosition,
|
|
222
|
+
prop: rowProp.value,
|
|
206
223
|
size: __props.size,
|
|
207
224
|
disabled: __props.disabled,
|
|
208
225
|
onChange: changeHandler,
|
|
@@ -213,11 +230,12 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
|
|
|
213
230
|
"lastValues",
|
|
214
231
|
"is-compare",
|
|
215
232
|
"labelWidth",
|
|
233
|
+
"labelPosition",
|
|
216
234
|
"prop",
|
|
217
235
|
"size",
|
|
218
236
|
"disabled"
|
|
219
237
|
])) : createCommentVNode("v-if", true)]),
|
|
220
|
-
_:
|
|
238
|
+
_: 3
|
|
221
239
|
}, 8, ["flat", "body-style"]);
|
|
222
240
|
};
|
|
223
241
|
}
|
|
@@ -16,7 +16,7 @@ var _hoisted_3 = {
|
|
|
16
16
|
};
|
|
17
17
|
var _hoisted_4 = { style: { "flex": "1" } };
|
|
18
18
|
var _hoisted_5 = ["src"];
|
|
19
|
-
var Panel_vue_vue_type_script_setup_true_lang_default =
|
|
19
|
+
var Panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
20
20
|
name: "MFormPanel",
|
|
21
21
|
__name: "Panel",
|
|
22
22
|
props: {
|
|
@@ -26,6 +26,7 @@ var Panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
26
26
|
config: {},
|
|
27
27
|
name: {},
|
|
28
28
|
labelWidth: {},
|
|
29
|
+
labelPosition: {},
|
|
29
30
|
prop: {},
|
|
30
31
|
size: {},
|
|
31
32
|
disabled: { type: Boolean },
|
|
@@ -88,6 +89,7 @@ var Panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
88
89
|
size: __props.size,
|
|
89
90
|
disabled: __props.disabled,
|
|
90
91
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
92
|
+
"label-position": __props.config.labelPosition || __props.labelPosition,
|
|
91
93
|
onChange: changeHandler,
|
|
92
94
|
onAddDiffCount: _cache[2] || (_cache[2] = ($event) => onAddDiffCount())
|
|
93
95
|
}, null, 8, [
|
|
@@ -98,7 +100,8 @@ var Panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
98
100
|
"prop",
|
|
99
101
|
"size",
|
|
100
102
|
"disabled",
|
|
101
|
-
"label-width"
|
|
103
|
+
"label-width",
|
|
104
|
+
"label-position"
|
|
102
105
|
]);
|
|
103
106
|
}), 128))]), createElementVNode("img", {
|
|
104
107
|
class: "m-form-schematic",
|
|
@@ -114,6 +117,7 @@ var Panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
114
117
|
size: __props.size,
|
|
115
118
|
disabled: __props.disabled,
|
|
116
119
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
120
|
+
"label-position": __props.config.labelPosition || __props.labelPosition,
|
|
117
121
|
onChange: changeHandler,
|
|
118
122
|
onAddDiffCount: _cache[3] || (_cache[3] = ($event) => onAddDiffCount())
|
|
119
123
|
}, null, 8, [
|
|
@@ -124,7 +128,8 @@ var Panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
124
128
|
"prop",
|
|
125
129
|
"size",
|
|
126
130
|
"disabled",
|
|
127
|
-
"label-width"
|
|
131
|
+
"label-width",
|
|
132
|
+
"label-position"
|
|
128
133
|
]);
|
|
129
134
|
}), 128))])]),
|
|
130
135
|
_: 3
|
|
@@ -2,7 +2,7 @@ import Col_default from "./Col.js";
|
|
|
2
2
|
import { Fragment, createBlock, createElementBlock, defineComponent, inject, openBlock, renderList, unref, withCtx } from "vue";
|
|
3
3
|
import { TMagicRow } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/containers/Row.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var Row_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var Row_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "MFormRow",
|
|
7
7
|
__name: "Row",
|
|
8
8
|
props: {
|
|
@@ -12,6 +12,7 @@ var Row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComp
|
|
|
12
12
|
config: {},
|
|
13
13
|
name: {},
|
|
14
14
|
labelWidth: {},
|
|
15
|
+
labelPosition: {},
|
|
15
16
|
prop: {},
|
|
16
17
|
size: {},
|
|
17
18
|
expandMore: { type: Boolean },
|
|
@@ -34,6 +35,7 @@ var Row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComp
|
|
|
34
35
|
span: col.span || __props.config.span || 24 / __props.config.items.length,
|
|
35
36
|
config: col,
|
|
36
37
|
labelWidth: __props.config.labelWidth || __props.labelWidth,
|
|
38
|
+
labelPosition: __props.config.labelPosition || __props.labelPosition,
|
|
37
39
|
expandMore: __props.expandMore,
|
|
38
40
|
model: __props.name ? __props.model[__props.name] : __props.model,
|
|
39
41
|
lastValues: __props.name ? __props.lastValues[__props.name] : __props.lastValues,
|
|
@@ -47,6 +49,7 @@ var Row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComp
|
|
|
47
49
|
"span",
|
|
48
50
|
"config",
|
|
49
51
|
"labelWidth",
|
|
52
|
+
"labelPosition",
|
|
50
53
|
"expandMore",
|
|
51
54
|
"model",
|
|
52
55
|
"lastValues",
|
|
@@ -2,7 +2,7 @@ import Container_default from "./Container.js";
|
|
|
2
2
|
import { Fragment, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, inject, openBlock, ref, renderList, unref, vShow, watchEffect, withCtx, withDirectives } from "vue";
|
|
3
3
|
import { TMagicStep, TMagicSteps } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/containers/Step.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var Step_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var Step_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "MFormStep",
|
|
7
7
|
__name: "Step",
|
|
8
8
|
props: {
|
|
@@ -13,6 +13,7 @@ var Step_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
13
13
|
config: {},
|
|
14
14
|
stepActive: { default: 1 },
|
|
15
15
|
labelWidth: {},
|
|
16
|
+
labelPosition: {},
|
|
16
17
|
size: {},
|
|
17
18
|
disabled: { type: Boolean }
|
|
18
19
|
},
|
|
@@ -64,6 +65,7 @@ var Step_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
64
65
|
size: __props.size,
|
|
65
66
|
disabled: __props.disabled,
|
|
66
67
|
"label-width": __props.config.labelWidth || __props.labelWidth,
|
|
68
|
+
"label-position": __props.config.labelPosition || __props.labelPosition,
|
|
67
69
|
onChange: changeHandler,
|
|
68
70
|
onAddDiffCount: _cache[0] || (_cache[0] = ($event) => onAddDiffCount())
|
|
69
71
|
}, null, 8, [
|
|
@@ -74,7 +76,8 @@ var Step_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
74
76
|
"prop",
|
|
75
77
|
"size",
|
|
76
78
|
"disabled",
|
|
77
|
-
"label-width"
|
|
79
|
+
"label-width",
|
|
80
|
+
"label-position"
|
|
78
81
|
])), [[vShow, active.value - 1 === index]]) : createCommentVNode("v-if", true)], 64);
|
|
79
82
|
}), 256))], 64);
|
|
80
83
|
}), 256))]);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { display, filterFunction, initValue } from "../utils/form.js";
|
|
2
|
+
import { applyMountValueEffects } from "../utils/collectFields.js";
|
|
2
3
|
import Container_default from "./Container.js";
|
|
3
4
|
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, mergeProps, openBlock, ref, renderList, resolveDynamicComponent, toDisplayString, unref, watch, watchEffect, withCtx } from "vue";
|
|
4
5
|
import { isEmpty } from "lodash-es";
|
|
5
6
|
import { TMagicBadge, getDesignConfig } from "@tmagic/design";
|
|
6
7
|
//#region packages/form/src/containers/Tabs.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var Tabs_vue_vue_type_script_setup_true_lang_default =
|
|
8
|
+
var Tabs_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
8
9
|
name: "MFormTabs",
|
|
9
10
|
__name: "Tabs",
|
|
10
11
|
props: {
|
|
@@ -18,6 +19,7 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
18
19
|
name: {},
|
|
19
20
|
size: {},
|
|
20
21
|
labelWidth: {},
|
|
22
|
+
labelPosition: {},
|
|
21
23
|
prop: { default: "" },
|
|
22
24
|
expandMore: { type: Boolean },
|
|
23
25
|
disabled: { type: Boolean }
|
|
@@ -94,12 +96,15 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
94
96
|
prop: props.prop,
|
|
95
97
|
config: props.config
|
|
96
98
|
});
|
|
99
|
+
const tabsModel = props.model[props.name];
|
|
100
|
+
if (Array.isArray(tabsModel) && Array.isArray(props.config.items)) for (const tab of tabsModel) applyMountValueEffects(mForm, props.config.items, tab);
|
|
97
101
|
emit("change", props.model[props.name]);
|
|
98
102
|
} else {
|
|
99
103
|
const newObj = await initValue(mForm, {
|
|
100
104
|
config: props.config.items,
|
|
101
105
|
initValues: {}
|
|
102
106
|
});
|
|
107
|
+
applyMountValueEffects(mForm, props.config.items, newObj);
|
|
103
108
|
newObj.title = `标签${tabs.value.length + 1}`;
|
|
104
109
|
props.model[props.name].push(newObj);
|
|
105
110
|
emit("change", props.model[props.name], { changeRecords: [{
|
|
@@ -169,6 +174,7 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
169
174
|
prop: __props.config.dynamic ? `${__props.prop}${__props.prop ? "." : ""}${String(tabIndex)}` : tab.name ? `${__props.prop}${__props.prop ? "." : ""}${tab.name}` : __props.prop,
|
|
170
175
|
size: __props.size,
|
|
171
176
|
"label-width": tab.labelWidth || __props.labelWidth,
|
|
177
|
+
"label-position": tab.labelPosition || __props.labelPosition,
|
|
172
178
|
"expand-more": __props.expandMore,
|
|
173
179
|
onChange: changeHandler,
|
|
174
180
|
onAddDiffCount: ($event) => onAddDiffCount(Number(tabIndex))
|
|
@@ -181,6 +187,7 @@ var Tabs_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
181
187
|
"prop",
|
|
182
188
|
"size",
|
|
183
189
|
"label-width",
|
|
190
|
+
"label-position",
|
|
184
191
|
"expand-more",
|
|
185
192
|
"onAddDiffCount"
|
|
186
193
|
]);
|
|
@@ -3,7 +3,7 @@ import { cloneDeep } from "lodash-es";
|
|
|
3
3
|
import { TMagicButton, TMagicTooltip } from "@tmagic/design";
|
|
4
4
|
import { Delete, DocumentCopy, Sort } from "@element-plus/icons-vue";
|
|
5
5
|
//#region packages/form/src/containers/table/ActionsColumn.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var ActionsColumn_vue_vue_type_script_setup_true_lang_default =
|
|
6
|
+
var ActionsColumn_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
7
7
|
__name: "ActionsColumn",
|
|
8
8
|
props: {
|
|
9
9
|
config: {},
|
|
@@ -2,7 +2,7 @@ import { Fragment, createBlock, createCommentVNode, createElementBlock, createVN
|
|
|
2
2
|
import { TMagicButton, TMagicTooltip } from "@tmagic/design";
|
|
3
3
|
import { ArrowDown, ArrowUp } from "@element-plus/icons-vue";
|
|
4
4
|
//#region packages/form/src/containers/table/SortColumn.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var SortColumn_vue_vue_type_script_setup_true_lang_default =
|
|
5
|
+
var SortColumn_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
__name: "SortColumn",
|
|
7
7
|
props: {
|
|
8
8
|
index: {},
|
|
@@ -17,11 +17,11 @@ var _hoisted_2 = { style: {
|
|
|
17
17
|
} };
|
|
18
18
|
var _hoisted_3 = { style: { "display": "flex" } };
|
|
19
19
|
var _hoisted_4 = {
|
|
20
|
-
key:
|
|
20
|
+
key: 2,
|
|
21
21
|
class: "bottom",
|
|
22
22
|
style: { "text-align": "right" }
|
|
23
23
|
};
|
|
24
|
-
var Table_vue_vue_type_script_setup_true_lang_default =
|
|
24
|
+
var Table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
25
25
|
name: "MFormTable",
|
|
26
26
|
__name: "Table",
|
|
27
27
|
props: {
|
|
@@ -82,12 +82,14 @@ var Table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
82
82
|
style: { "color": "rgba(0, 0, 0, 0.45)" },
|
|
83
83
|
innerHTML: __props.config.extra
|
|
84
84
|
}, null, 8, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
85
|
-
|
|
85
|
+
createCommentVNode(" v-if 必须挂在 Tooltip 上:表格未就绪时 ElOnlyChild 会报 no valid child node found "),
|
|
86
|
+
__props.model[modelName.value] ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
87
|
+
key: 1,
|
|
86
88
|
content: "拖拽可排序",
|
|
87
89
|
placement: "left-start",
|
|
88
90
|
disabled: __props.config.dropSort !== true || __props.config.dropSortHandle
|
|
89
91
|
}, {
|
|
90
|
-
default: withCtx(() => [
|
|
92
|
+
default: withCtx(() => [(openBlock(), createBlock(unref(TMagicTable), {
|
|
91
93
|
ref: "tMagicTable",
|
|
92
94
|
style: { "width": "100%" },
|
|
93
95
|
"show-header": "",
|
|
@@ -99,20 +101,22 @@ var Table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
99
101
|
"default-expand-all": true,
|
|
100
102
|
key: updateKey.value,
|
|
101
103
|
onSelect: unref(selectHandle),
|
|
102
|
-
onSortChange: sortChangeHandler
|
|
104
|
+
onSortChange: sortChangeHandler,
|
|
105
|
+
"empty-text": `暂无${__props.config.titlePrefix || ""}数据`
|
|
103
106
|
}, null, 8, [
|
|
104
107
|
"row-key",
|
|
105
108
|
"columns",
|
|
106
109
|
"data",
|
|
107
110
|
"border",
|
|
108
111
|
"max-height",
|
|
109
|
-
"onSelect"
|
|
110
|
-
|
|
112
|
+
"onSelect",
|
|
113
|
+
"empty-text"
|
|
114
|
+
]))]),
|
|
111
115
|
_: 1
|
|
112
|
-
}, 8, ["disabled"]),
|
|
116
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true),
|
|
113
117
|
renderSlot(_ctx.$slots, "default"),
|
|
114
118
|
createElementVNode("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [
|
|
115
|
-
!unref(isFullscreen) ? renderSlot(_ctx.$slots, "toggle-button", {
|
|
119
|
+
!unref(isFullscreen) ? renderSlot(_ctx.$slots, "toggle-button", {}, void 0, void 0, 0) : createCommentVNode("v-if", true),
|
|
116
120
|
__props.config.enableFullscreen !== false ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
117
121
|
key: 1,
|
|
118
122
|
icon: unref(FullScreen),
|
|
@@ -153,7 +157,7 @@ var Table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
153
157
|
default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode("清空", -1)])]),
|
|
154
158
|
_: 1
|
|
155
159
|
}, 8, ["disabled", "onClick"])) : createCommentVNode("v-if", true)
|
|
156
|
-
]), !__props.isCompare ? renderSlot(_ctx.$slots, "add-button", {
|
|
160
|
+
]), !__props.isCompare ? renderSlot(_ctx.$slots, "add-button", {}, void 0, void 0, 0) : createCommentVNode("v-if", true)]),
|
|
157
161
|
__props.config.pagination ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(unref(TMagicPagination), {
|
|
158
162
|
layout: "total, sizes, prev, pager, next, jumper",
|
|
159
163
|
"hide-on-single-page": __props.model[modelName.value].length < unref(pageSize),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isGlobalFlat } from "../../utils/config.js";
|
|
2
|
+
import { appendProp, display, getDataByPage, sortArray } from "../../utils/form.js";
|
|
3
|
+
import { isTableColumnRendered, makeTableColumnConfig } from "../../utils/tableGroupList.js";
|
|
2
4
|
import Container_default from "../Container.js";
|
|
3
5
|
import ActionsColumn_default from "./ActionsColumn.js";
|
|
4
6
|
import SortColumn_default from "./SortColumn.js";
|
|
5
7
|
import { computed, h, inject } from "vue";
|
|
6
|
-
import { cloneDeep } from "lodash-es";
|
|
7
8
|
import { TMagicIcon, TMagicTooltip } from "@tmagic/design";
|
|
8
9
|
import { WarningFilled } from "@element-plus/icons-vue";
|
|
9
10
|
//#region packages/form/src/containers/table/useTableColumns.ts
|
|
@@ -34,15 +35,7 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
34
35
|
if (typeof props.config.selection === "function") return props.config.selection(mForm, { model: props.model[modelName.value] });
|
|
35
36
|
return props.config.selection;
|
|
36
37
|
});
|
|
37
|
-
const getProp = (index) =>
|
|
38
|
-
return `${props.prop}${props.prop ? "." : ""}${index + 1 + currentPage.value * pageSize.value - 1}`;
|
|
39
|
-
};
|
|
40
|
-
const makeConfig = (config, row) => {
|
|
41
|
-
const newConfig = cloneDeep(config);
|
|
42
|
-
if (typeof config.itemsFunction === "function") newConfig.items = config.itemsFunction(row);
|
|
43
|
-
delete newConfig.display;
|
|
44
|
-
return newConfig;
|
|
45
|
-
};
|
|
38
|
+
const getProp = (index) => appendProp(props.prop, index + currentPage.value * pageSize.value);
|
|
46
39
|
const changeHandler = (v, eventData) => {
|
|
47
40
|
emit("change", props.model, eventData);
|
|
48
41
|
};
|
|
@@ -66,8 +59,10 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
66
59
|
type: "selection",
|
|
67
60
|
width: 45
|
|
68
61
|
} });
|
|
69
|
-
|
|
62
|
+
const defaultFixed = isGlobalFlat.value ? "right" : "left";
|
|
63
|
+
let actionFixed = props.config.fixed === false ? void 0 : defaultFixed;
|
|
70
64
|
if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) actionFixed = props.config.fixed;
|
|
65
|
+
const actionFlat = props.config.flat === void 0 && isGlobalFlat.value ? true : props.config.flat;
|
|
71
66
|
const actionColumn = {
|
|
72
67
|
props: {
|
|
73
68
|
label: "操作",
|
|
@@ -77,7 +72,7 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
77
72
|
},
|
|
78
73
|
cell: ({ row, $index }) => h(ActionsColumn_default, {
|
|
79
74
|
row,
|
|
80
|
-
flat:
|
|
75
|
+
flat: actionFlat,
|
|
81
76
|
index: $index,
|
|
82
77
|
model: props.model,
|
|
83
78
|
config: props.config,
|
|
@@ -119,7 +114,7 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
119
114
|
},
|
|
120
115
|
cell: ({ $index }) => h("span", $index + 1 + currentPage.value * pageSize.value)
|
|
121
116
|
});
|
|
122
|
-
for (const column of props.config.items) if (column
|
|
117
|
+
for (const column of props.config.items) if (isTableColumnRendered(column, display$1)) {
|
|
123
118
|
const titleTipValue = titleTip(column.titleTip);
|
|
124
119
|
columns.push({
|
|
125
120
|
props: {
|
|
@@ -135,7 +130,7 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
135
130
|
disabled: props.disabled,
|
|
136
131
|
prop: getProp($index),
|
|
137
132
|
rules: column.rules,
|
|
138
|
-
config:
|
|
133
|
+
config: makeTableColumnConfig(column, row),
|
|
139
134
|
model: row,
|
|
140
135
|
lastValues: lastData.value[$index],
|
|
141
136
|
isCompare: props.isCompare,
|