@tmagic/form 1.8.0-manmanyu.10 → 1.8.0-manmanyu.11
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/containers/Container.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/es/containers/GroupList.vue_vue_type_script_setup_true_lang.js +6 -5
- package/dist/es/containers/GroupListItem.vue_vue_type_script_setup_true_lang.js +21 -15
- package/dist/es/containers/table/Table.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/es/containers/table/useTableColumns.js +2 -1
- package/dist/es/fields/Number.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/es/style.css +1 -0
- package/dist/style.css +1 -0
- package/dist/themes/magic-admin.css +1 -0
- package/dist/tmagic-form.umd.cjs +40 -27
- package/package.json +4 -4
- package/src/containers/Container.vue +2 -0
- package/src/containers/GroupList.vue +1 -1
- package/src/containers/GroupListItem.vue +17 -13
- package/src/containers/table/Table.vue +1 -0
- package/src/containers/table/useTableColumns.ts +3 -3
- package/src/fields/Number.vue +5 -2
- package/src/theme/group-list.scss +1 -0
|
@@ -148,7 +148,8 @@ var Container_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
148
148
|
labelWidth: itemLabelWidth.value,
|
|
149
149
|
labelPosition: props.config.labelPosition,
|
|
150
150
|
rules: rule.value,
|
|
151
|
-
extra: filterFunction(mForm, props.config.extra, props)
|
|
151
|
+
extra: filterFunction(mForm, props.config.extra, props),
|
|
152
|
+
extraTips: props.config.extraTips
|
|
152
153
|
}));
|
|
153
154
|
const itemLabelWidth = computed(() => props.config.labelWidth ?? props.labelWidth);
|
|
154
155
|
watchEffect(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import GroupListItem_default from "./GroupListItem.js";
|
|
2
|
-
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, renderList, renderSlot } from "vue";
|
|
2
|
+
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, renderList, renderSlot, toDisplayString } from "vue";
|
|
3
3
|
import { cloneDeep } from "lodash-es";
|
|
4
4
|
//#region packages/form/src/containers/GroupList.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var _hoisted_1 = { class: "m-fields-group-list" };
|
|
@@ -8,11 +8,12 @@ var _hoisted_3 = {
|
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "el-table__empty-block"
|
|
10
10
|
};
|
|
11
|
-
var _hoisted_4 = {
|
|
11
|
+
var _hoisted_4 = { class: "el-table__empty-text t-table__empty" };
|
|
12
|
+
var _hoisted_5 = {
|
|
12
13
|
key: 3,
|
|
13
14
|
class: "m-fields-group-list-footer"
|
|
14
15
|
};
|
|
15
|
-
var
|
|
16
|
+
var _hoisted_6 = { style: {
|
|
16
17
|
"display": "flex",
|
|
17
18
|
"justify-content": "flex-end",
|
|
18
19
|
"flex": "1"
|
|
@@ -63,7 +64,7 @@ var GroupList_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
63
64
|
innerHTML: __props.config.extra,
|
|
64
65
|
style: { "color": "rgba(0, 0, 0, 0.45)" }
|
|
65
66
|
}, null, 8, _hoisted_2)) : createCommentVNode("v-if", true),
|
|
66
|
-
!__props.model[__props.name] || !__props.model[__props.name].length ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
67
|
+
!__props.model[__props.name] || !__props.model[__props.name].length ? (openBlock(), createElementBlock("div", _hoisted_3, [createElementVNode("span", _hoisted_4, "暂无" + toDisplayString(__props.config.titlePrefix || "") + "数据", 1)])) : (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(__props.model[__props.name], (item, index) => {
|
|
67
68
|
return openBlock(), createBlock(GroupListItem_default, {
|
|
68
69
|
key: index,
|
|
69
70
|
model: item,
|
|
@@ -94,7 +95,7 @@ var GroupList_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
94
95
|
"group-model"
|
|
95
96
|
]);
|
|
96
97
|
}), 128)),
|
|
97
|
-
!__props.isCompare ? (openBlock(), createElementBlock("div",
|
|
98
|
+
!__props.isCompare ? (openBlock(), createElementBlock("div", _hoisted_5, [renderSlot(_ctx.$slots, "toggle-button"), createElementVNode("div", _hoisted_6, [renderSlot(_ctx.$slots, "add-button")])])) : createCommentVNode("v-if", true)
|
|
98
99
|
]);
|
|
99
100
|
};
|
|
100
101
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { filterFunction } from "../utils/form.js";
|
|
2
2
|
import Container_default from "./Container.js";
|
|
3
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 { TMagicButton, TMagicCard, TMagicIcon, TMagicInputNumber, TMagicPopover, TMagicTooltip } from "@tmagic/design";
|
|
5
5
|
import { ArrowDown, ArrowRight, Bottom, Delete, DocumentCopy, Position, Top } from "@element-plus/icons-vue";
|
|
6
6
|
//#region packages/form/src/containers/GroupListItem.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var _hoisted_1 = { class: "m-fields-group-list-item-header" };
|
|
@@ -47,7 +47,10 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
47
47
|
[mForm?.keyProp || "__key"]: `${props.config[mForm?.keyProp || "__key"]}${String(props.index)}`
|
|
48
48
|
}));
|
|
49
49
|
const title = computed(() => {
|
|
50
|
-
if (props.config.titleKey && props.model[props.config.titleKey])
|
|
50
|
+
if (props.config.titleKey && props.model[props.config.titleKey]) {
|
|
51
|
+
const { titlePrefix } = props.config;
|
|
52
|
+
return titlePrefix ? `${titlePrefix} ${String(props.index + 1)}: ${props.model[props.config.titleKey]}` : `${props.model[props.config.titleKey]}`;
|
|
53
|
+
}
|
|
51
54
|
if (props.config.title) return filterFunction(mForm, props.config.title, props);
|
|
52
55
|
return `${props.config.titlePrefix || "组"} ${String(props.index + 1)}`;
|
|
53
56
|
});
|
|
@@ -103,17 +106,20 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
103
106
|
_: 1
|
|
104
107
|
}, 8, ["disabled"]),
|
|
105
108
|
createElementVNode("span", { innerHTML: title.value }, null, 8, _hoisted_2),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
createVNode(unref(TMagicTooltip), { content: `删除 ${title.value}` }, {
|
|
110
|
+
default: withCtx(() => [!__props.isCompare ? withDirectives((openBlock(), createBlock(unref(TMagicButton), {
|
|
111
|
+
key: 0,
|
|
112
|
+
size: "default",
|
|
113
|
+
link: "",
|
|
114
|
+
class: "delete-button",
|
|
115
|
+
icon: unref(Delete),
|
|
116
|
+
disabled: __props.disabled,
|
|
117
|
+
onClick: removeHandler
|
|
118
|
+
}, null, 8, ["icon", "disabled"])), [[vShow, showDelete.value]]) : createCommentVNode("v-if", true)]),
|
|
119
|
+
_: 1
|
|
120
|
+
}, 8, ["content"]),
|
|
115
121
|
copyable.value && !__props.isCompare ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
116
|
-
key:
|
|
122
|
+
key: 0,
|
|
117
123
|
link: "",
|
|
118
124
|
size: "default",
|
|
119
125
|
type: "primary",
|
|
@@ -124,7 +130,7 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
124
130
|
default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode("复制", -1)])]),
|
|
125
131
|
_: 1
|
|
126
132
|
}, 8, ["icon", "disabled"])) : createCommentVNode("v-if", true),
|
|
127
|
-
movable.value && !__props.isCompare ? (openBlock(), createElementBlock(Fragment, { key:
|
|
133
|
+
movable.value && !__props.isCompare ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [withDirectives(createVNode(unref(TMagicButton), {
|
|
128
134
|
link: "",
|
|
129
135
|
size: "default",
|
|
130
136
|
disabled: __props.disabled,
|
|
@@ -144,7 +150,7 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
144
150
|
_: 1
|
|
145
151
|
}, 8, ["disabled", "icon"]), [[vShow, __props.index !== length.value - 1]])], 64)) : createCommentVNode("v-if", true),
|
|
146
152
|
__props.config.moveSpecifyLocation && !__props.isCompare ? (openBlock(), createBlock(unref(TMagicPopover), {
|
|
147
|
-
key:
|
|
153
|
+
key: 2,
|
|
148
154
|
trigger: "click",
|
|
149
155
|
placement: "top",
|
|
150
156
|
width: "200",
|
|
@@ -190,7 +196,7 @@ var GroupListItem_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
190
196
|
_: 1
|
|
191
197
|
}, 8, ["visible"])) : createCommentVNode("v-if", true),
|
|
192
198
|
itemExtra.value ? (openBlock(), createElementBlock("span", {
|
|
193
|
-
key:
|
|
199
|
+
key: 3,
|
|
194
200
|
innerHTML: itemExtra.value,
|
|
195
201
|
class: "m-form-tip"
|
|
196
202
|
}, null, 8, _hoisted_4)) : createCommentVNode("v-if", true)
|
|
@@ -99,14 +99,16 @@ var Table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
99
99
|
"default-expand-all": true,
|
|
100
100
|
key: updateKey.value,
|
|
101
101
|
onSelect: unref(selectHandle),
|
|
102
|
-
onSortChange: sortChangeHandler
|
|
102
|
+
onSortChange: sortChangeHandler,
|
|
103
|
+
"empty-text": `暂无${__props.config.titlePrefix || ""}数据`
|
|
103
104
|
}, null, 8, [
|
|
104
105
|
"row-key",
|
|
105
106
|
"columns",
|
|
106
107
|
"data",
|
|
107
108
|
"border",
|
|
108
109
|
"max-height",
|
|
109
|
-
"onSelect"
|
|
110
|
+
"onSelect",
|
|
111
|
+
"empty-text"
|
|
110
112
|
])) : createCommentVNode("v-if", true)]),
|
|
111
113
|
_: 1
|
|
112
114
|
}, 8, ["disabled"]),
|
|
@@ -70,6 +70,7 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
70
70
|
const defaultFixed = isMagicAdmin.value ? "right" : "left";
|
|
71
71
|
let actionFixed = props.config.fixed === false ? void 0 : defaultFixed;
|
|
72
72
|
if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) actionFixed = props.config.fixed;
|
|
73
|
+
const actionFlat = props.config.flat === void 0 && isMagicAdmin.value ? true : props.config.flat;
|
|
73
74
|
const actionColumn = {
|
|
74
75
|
props: {
|
|
75
76
|
label: "操作",
|
|
@@ -79,7 +80,7 @@ var useTableColumns = (props, emit, currentPage, pageSize, modelName) => {
|
|
|
79
80
|
},
|
|
80
81
|
cell: ({ row, $index }) => h(ActionsColumn_default, {
|
|
81
82
|
row,
|
|
82
|
-
flat:
|
|
83
|
+
flat: actionFlat,
|
|
83
84
|
index: $index,
|
|
84
85
|
model: props.model,
|
|
85
86
|
config: props.config,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useAddField } from "../utils/useAddField.js";
|
|
2
2
|
import { createBlock, createCommentVNode, defineComponent, inject, openBlock, ref, unref, watch } from "vue";
|
|
3
|
-
import { TMagicInputNumber } from "@tmagic/design";
|
|
3
|
+
import { TMagicInputNumber, isMagicAdminTheme } from "@tmagic/design";
|
|
4
4
|
//#region packages/form/src/fields/Number.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
6
|
name: "MFormNumber",
|
|
@@ -24,6 +24,7 @@ var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
24
24
|
setup(__props, { emit: __emit }) {
|
|
25
25
|
const props = __props;
|
|
26
26
|
const emit = __emit;
|
|
27
|
+
const isMagicAdmin = isMagicAdminTheme();
|
|
27
28
|
const value = ref();
|
|
28
29
|
watch(() => props.model[props.name], (v) => {
|
|
29
30
|
value.value = v;
|
|
@@ -43,7 +44,7 @@ var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
43
44
|
modelValue: value.value,
|
|
44
45
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
45
46
|
clearable: "",
|
|
46
|
-
"controls-position": "right",
|
|
47
|
+
"controls-position": unref(isMagicAdmin) ? "" : "right",
|
|
47
48
|
size: __props.size,
|
|
48
49
|
max: __props.config.max,
|
|
49
50
|
min: __props.config.min,
|
|
@@ -54,6 +55,7 @@ var Number_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
|
|
|
54
55
|
onInput: inputHandler
|
|
55
56
|
}, null, 8, [
|
|
56
57
|
"modelValue",
|
|
58
|
+
"controls-position",
|
|
57
59
|
"size",
|
|
58
60
|
"max",
|
|
59
61
|
"min",
|
package/dist/es/style.css
CHANGED
package/dist/style.css
CHANGED
package/dist/tmagic-form.umd.cjs
CHANGED
|
@@ -2893,7 +2893,7 @@
|
|
|
2893
2893
|
var _hoisted_3$7 = ["innerHTML"];
|
|
2894
2894
|
var _hoisted_4$6 = ["innerHTML"];
|
|
2895
2895
|
var _hoisted_5$4 = ["innerHTML"];
|
|
2896
|
-
var _hoisted_6$
|
|
2896
|
+
var _hoisted_6$3 = ["innerHTML"];
|
|
2897
2897
|
var _hoisted_7$2 = ["innerHTML"];
|
|
2898
2898
|
var _hoisted_8$2 = ["innerHTML"];
|
|
2899
2899
|
var _hoisted_9 = ["innerHTML"];
|
|
@@ -3026,7 +3026,8 @@
|
|
|
3026
3026
|
labelWidth: itemLabelWidth.value,
|
|
3027
3027
|
labelPosition: props.config.labelPosition,
|
|
3028
3028
|
rules: rule.value,
|
|
3029
|
-
extra: filterFunction(mForm, props.config.extra, props)
|
|
3029
|
+
extra: filterFunction(mForm, props.config.extra, props),
|
|
3030
|
+
extraTips: props.config.extraTips
|
|
3030
3031
|
}));
|
|
3031
3032
|
const itemLabelWidth = (0, vue.computed)(() => props.config.labelWidth ?? props.labelWidth);
|
|
3032
3033
|
(0, vue.watchEffect)(() => {
|
|
@@ -3305,7 +3306,7 @@
|
|
|
3305
3306
|
key: 0,
|
|
3306
3307
|
placement: tooltip.value.placement
|
|
3307
3308
|
}, {
|
|
3308
|
-
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_6$
|
|
3309
|
+
content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { innerHTML: tooltip.value.text }, null, 8, _hoisted_6$3)]),
|
|
3309
3310
|
default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(tagName.value), (0, vue.mergeProps)(fieldsProps.value, {
|
|
3310
3311
|
model: __props.lastValues,
|
|
3311
3312
|
onChange: onChangeHandler
|
|
@@ -4424,7 +4425,7 @@
|
|
|
4424
4425
|
var _hoisted_3$6 = { key: 1 };
|
|
4425
4426
|
var _hoisted_4$5 = ["innerHTML"];
|
|
4426
4427
|
var _hoisted_5$3 = ["innerHTML"];
|
|
4427
|
-
var _hoisted_6$
|
|
4428
|
+
var _hoisted_6$2 = {
|
|
4428
4429
|
key: 2,
|
|
4429
4430
|
style: { "display": "flex" }
|
|
4430
4431
|
};
|
|
@@ -4512,7 +4513,7 @@
|
|
|
4512
4513
|
key: 0,
|
|
4513
4514
|
innerHTML: __props.config.extra,
|
|
4514
4515
|
class: "m-form-tip"
|
|
4515
|
-
}, null, 8, _hoisted_5$3)) : (0, vue.createCommentVNode)("v-if", true)])), __props.config.schematic && show.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6$
|
|
4516
|
+
}, null, 8, _hoisted_5$3)) : (0, vue.createCommentVNode)("v-if", true)])), __props.config.schematic && show.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6$2, [(0, vue.createElementVNode)("div", _hoisted_7$1, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.config.items, (item, index) => {
|
|
4516
4517
|
return (0, vue.openBlock)(), (0, vue.createBlock)(Container_default, {
|
|
4517
4518
|
key: key(item, index),
|
|
4518
4519
|
model: name.value ? __props.model[name.value] : __props.model,
|
|
@@ -5117,7 +5118,10 @@
|
|
|
5117
5118
|
[mForm?.keyProp || "__key"]: `${props.config[mForm?.keyProp || "__key"]}${String(props.index)}`
|
|
5118
5119
|
}));
|
|
5119
5120
|
const title = (0, vue.computed)(() => {
|
|
5120
|
-
if (props.config.titleKey && props.model[props.config.titleKey])
|
|
5121
|
+
if (props.config.titleKey && props.model[props.config.titleKey]) {
|
|
5122
|
+
const { titlePrefix } = props.config;
|
|
5123
|
+
return titlePrefix ? `${titlePrefix} ${String(props.index + 1)}: ${props.model[props.config.titleKey]}` : `${props.model[props.config.titleKey]}`;
|
|
5124
|
+
}
|
|
5121
5125
|
if (props.config.title) return filterFunction(mForm, props.config.title, props);
|
|
5122
5126
|
return `${props.config.titlePrefix || "组"} ${String(props.index + 1)}`;
|
|
5123
5127
|
});
|
|
@@ -5173,17 +5177,20 @@
|
|
|
5173
5177
|
_: 1
|
|
5174
5178
|
}, 8, ["disabled"]),
|
|
5175
5179
|
(0, vue.createElementVNode)("span", { innerHTML: title.value }, null, 8, _hoisted_2$5),
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5180
|
+
(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicTooltip), { content: `删除 ${title.value}` }, {
|
|
5181
|
+
default: (0, vue.withCtx)(() => [!__props.isCompare ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
5182
|
+
key: 0,
|
|
5183
|
+
size: "default",
|
|
5184
|
+
link: "",
|
|
5185
|
+
class: "delete-button",
|
|
5186
|
+
icon: (0, vue.unref)(_element_plus_icons_vue.Delete),
|
|
5187
|
+
disabled: __props.disabled,
|
|
5188
|
+
onClick: removeHandler
|
|
5189
|
+
}, null, 8, ["icon", "disabled"])), [[vue.vShow, showDelete.value]]) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
5190
|
+
_: 1
|
|
5191
|
+
}, 8, ["content"]),
|
|
5185
5192
|
copyable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
5186
|
-
key:
|
|
5193
|
+
key: 0,
|
|
5187
5194
|
link: "",
|
|
5188
5195
|
size: "default",
|
|
5189
5196
|
type: "primary",
|
|
@@ -5194,7 +5201,7 @@
|
|
|
5194
5201
|
default: (0, vue.withCtx)(() => [..._cache[6] || (_cache[6] = [(0, vue.createTextVNode)("复制", -1)])]),
|
|
5195
5202
|
_: 1
|
|
5196
5203
|
}, 8, ["icon", "disabled"])) : (0, vue.createCommentVNode)("v-if", true),
|
|
5197
|
-
movable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key:
|
|
5204
|
+
movable.value && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
5198
5205
|
link: "",
|
|
5199
5206
|
size: "default",
|
|
5200
5207
|
disabled: __props.disabled,
|
|
@@ -5214,7 +5221,7 @@
|
|
|
5214
5221
|
_: 1
|
|
5215
5222
|
}, 8, ["disabled", "icon"]), [[vue.vShow, __props.index !== length.value - 1]])], 64)) : (0, vue.createCommentVNode)("v-if", true),
|
|
5216
5223
|
__props.config.moveSpecifyLocation && !__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicPopover), {
|
|
5217
|
-
key:
|
|
5224
|
+
key: 2,
|
|
5218
5225
|
trigger: "click",
|
|
5219
5226
|
placement: "top",
|
|
5220
5227
|
width: "200",
|
|
@@ -5260,7 +5267,7 @@
|
|
|
5260
5267
|
_: 1
|
|
5261
5268
|
}, 8, ["visible"])) : (0, vue.createCommentVNode)("v-if", true),
|
|
5262
5269
|
itemExtra.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
5263
|
-
key:
|
|
5270
|
+
key: 3,
|
|
5264
5271
|
innerHTML: itemExtra.value,
|
|
5265
5272
|
class: "m-form-tip"
|
|
5266
5273
|
}, null, 8, _hoisted_4$3)) : (0, vue.createCommentVNode)("v-if", true)
|
|
@@ -5300,11 +5307,12 @@
|
|
|
5300
5307
|
key: 1,
|
|
5301
5308
|
class: "el-table__empty-block"
|
|
5302
5309
|
};
|
|
5303
|
-
var _hoisted_4$2 = {
|
|
5310
|
+
var _hoisted_4$2 = { class: "el-table__empty-text t-table__empty" };
|
|
5311
|
+
var _hoisted_5$1 = {
|
|
5304
5312
|
key: 3,
|
|
5305
5313
|
class: "m-fields-group-list-footer"
|
|
5306
5314
|
};
|
|
5307
|
-
var
|
|
5315
|
+
var _hoisted_6$1 = { style: {
|
|
5308
5316
|
"display": "flex",
|
|
5309
5317
|
"justify-content": "flex-end",
|
|
5310
5318
|
"flex": "1"
|
|
@@ -5357,7 +5365,7 @@
|
|
|
5357
5365
|
innerHTML: __props.config.extra,
|
|
5358
5366
|
style: { "color": "rgba(0, 0, 0, 0.45)" }
|
|
5359
5367
|
}, null, 8, _hoisted_2$4)) : (0, vue.createCommentVNode)("v-if", true),
|
|
5360
|
-
!__props.model[__props.name] || !__props.model[__props.name].length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$3, [
|
|
5368
|
+
!__props.model[__props.name] || !__props.model[__props.name].length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$3, [(0, vue.createElementVNode)("span", _hoisted_4$2, "暂无" + (0, vue.toDisplayString)(__props.config.titlePrefix || "") + "数据", 1)])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, (0, vue.renderList)(__props.model[__props.name], (item, index) => {
|
|
5361
5369
|
return (0, vue.openBlock)(), (0, vue.createBlock)(GroupListItem_default, {
|
|
5362
5370
|
key: index,
|
|
5363
5371
|
model: item,
|
|
@@ -5388,7 +5396,7 @@
|
|
|
5388
5396
|
"group-model"
|
|
5389
5397
|
]);
|
|
5390
5398
|
}), 128)),
|
|
5391
|
-
!__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div",
|
|
5399
|
+
!__props.isCompare ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$1, [(0, vue.renderSlot)(_ctx.$slots, "toggle-button"), (0, vue.createElementVNode)("div", _hoisted_6$1, [(0, vue.renderSlot)(_ctx.$slots, "add-button")])])) : (0, vue.createCommentVNode)("v-if", true)
|
|
5392
5400
|
]);
|
|
5393
5401
|
};
|
|
5394
5402
|
}
|
|
@@ -5794,6 +5802,7 @@
|
|
|
5794
5802
|
const defaultFixed = isMagicAdmin.value ? "right" : "left";
|
|
5795
5803
|
let actionFixed = props.config.fixed === false ? void 0 : defaultFixed;
|
|
5796
5804
|
if (typeof props.config.fixed === "string" && ["left", "right"].includes(props.config.fixed)) actionFixed = props.config.fixed;
|
|
5805
|
+
const actionFlat = props.config.flat === void 0 && isMagicAdmin.value ? true : props.config.flat;
|
|
5797
5806
|
const actionColumn = {
|
|
5798
5807
|
props: {
|
|
5799
5808
|
label: "操作",
|
|
@@ -5803,7 +5812,7 @@
|
|
|
5803
5812
|
},
|
|
5804
5813
|
cell: ({ row, $index }) => (0, vue.h)(ActionsColumn_default, {
|
|
5805
5814
|
row,
|
|
5806
|
-
flat:
|
|
5815
|
+
flat: actionFlat,
|
|
5807
5816
|
index: $index,
|
|
5808
5817
|
model: props.model,
|
|
5809
5818
|
config: props.config,
|
|
@@ -5977,14 +5986,16 @@
|
|
|
5977
5986
|
"default-expand-all": true,
|
|
5978
5987
|
key: updateKey.value,
|
|
5979
5988
|
onSelect: (0, vue.unref)(selectHandle),
|
|
5980
|
-
onSortChange: sortChangeHandler
|
|
5989
|
+
onSortChange: sortChangeHandler,
|
|
5990
|
+
"empty-text": `暂无${__props.config.titlePrefix || ""}数据`
|
|
5981
5991
|
}, null, 8, [
|
|
5982
5992
|
"row-key",
|
|
5983
5993
|
"columns",
|
|
5984
5994
|
"data",
|
|
5985
5995
|
"border",
|
|
5986
5996
|
"max-height",
|
|
5987
|
-
"onSelect"
|
|
5997
|
+
"onSelect",
|
|
5998
|
+
"empty-text"
|
|
5988
5999
|
])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
5989
6000
|
_: 1
|
|
5990
6001
|
}, 8, ["disabled"]),
|
|
@@ -6552,6 +6563,7 @@
|
|
|
6552
6563
|
setup(__props, { emit: __emit }) {
|
|
6553
6564
|
const props = __props;
|
|
6554
6565
|
const emit = __emit;
|
|
6566
|
+
const isMagicAdmin = (0, _tmagic_design.isMagicAdminTheme)();
|
|
6555
6567
|
const value = (0, vue.ref)();
|
|
6556
6568
|
(0, vue.watch)(() => props.model[props.name], (v) => {
|
|
6557
6569
|
value.value = v;
|
|
@@ -6571,7 +6583,7 @@
|
|
|
6571
6583
|
modelValue: value.value,
|
|
6572
6584
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
6573
6585
|
clearable: "",
|
|
6574
|
-
"controls-position": "right",
|
|
6586
|
+
"controls-position": (0, vue.unref)(isMagicAdmin) ? "" : "right",
|
|
6575
6587
|
size: __props.size,
|
|
6576
6588
|
max: __props.config.max,
|
|
6577
6589
|
min: __props.config.min,
|
|
@@ -6582,6 +6594,7 @@
|
|
|
6582
6594
|
onInput: inputHandler
|
|
6583
6595
|
}, null, 8, [
|
|
6584
6596
|
"modelValue",
|
|
6597
|
+
"controls-position",
|
|
6585
6598
|
"size",
|
|
6586
6599
|
"max",
|
|
6587
6600
|
"min",
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.8.0-manmanyu.
|
|
2
|
+
"version": "1.8.0-manmanyu.11",
|
|
3
3
|
"name": "@tmagic/form",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"vue": "^3.5.38",
|
|
54
54
|
"typescript": "^6.0.3",
|
|
55
|
-
"@tmagic/design": "1.8.0-manmanyu.
|
|
56
|
-
"@tmagic/utils": "1.8.0-manmanyu.
|
|
57
|
-
"@tmagic/form-schema": "1.8.0-manmanyu.
|
|
55
|
+
"@tmagic/design": "1.8.0-manmanyu.11",
|
|
56
|
+
"@tmagic/utils": "1.8.0-manmanyu.11",
|
|
57
|
+
"@tmagic/form-schema": "1.8.0-manmanyu.11"
|
|
58
58
|
},
|
|
59
59
|
"peerDependenciesMeta": {
|
|
60
60
|
"typescript": {
|
|
@@ -445,8 +445,10 @@ const formItemProps = computed(() => ({
|
|
|
445
445
|
prop: itemProp.value,
|
|
446
446
|
labelWidth: itemLabelWidth.value,
|
|
447
447
|
labelPosition: props.config.labelPosition,
|
|
448
|
+
|
|
448
449
|
rules: rule.value,
|
|
449
450
|
extra: filterFunction(mForm, props.config.extra, props),
|
|
451
|
+
extraTips: props.config.extraTips,
|
|
450
452
|
}));
|
|
451
453
|
|
|
452
454
|
const itemLabelWidth = computed(() => props.config.labelWidth ?? props.labelWidth);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="m-fields-group-list">
|
|
3
3
|
<div v-if="config.extra" v-html="config.extra" style="color: rgba(0, 0, 0, 0.45)"></div>
|
|
4
4
|
<div v-if="!model[name] || !model[name].length" class="el-table__empty-block">
|
|
5
|
-
<span class="el-table__empty-text t-table__empty"
|
|
5
|
+
<span class="el-table__empty-text t-table__empty">暂无{{ config.titlePrefix || '' }}数据</span>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
<MFieldsGroupListItem
|
|
@@ -7,17 +7,18 @@
|
|
|
7
7
|
</TMagicButton>
|
|
8
8
|
|
|
9
9
|
<span v-html="title"></span>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
<TMagicTooltip :content="`删除 ${title}`">
|
|
11
|
+
<TMagicButton
|
|
12
|
+
v-if="!isCompare"
|
|
13
|
+
v-show="showDelete"
|
|
14
|
+
size="default"
|
|
15
|
+
link
|
|
16
|
+
class="delete-button"
|
|
17
|
+
:icon="Delete"
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
@click="removeHandler"
|
|
20
|
+
></TMagicButton>
|
|
21
|
+
</TMagicTooltip>
|
|
21
22
|
|
|
22
23
|
<TMagicButton
|
|
23
24
|
v-if="copyable && !isCompare"
|
|
@@ -111,7 +112,7 @@
|
|
|
111
112
|
import { computed, inject, ref } from 'vue';
|
|
112
113
|
import { ArrowDown, ArrowRight, Bottom, Delete, DocumentCopy, Position, Top } from '@element-plus/icons-vue';
|
|
113
114
|
|
|
114
|
-
import { TMagicButton, TMagicCard, TMagicIcon, TMagicInputNumber, TMagicPopover } from '@tmagic/design';
|
|
115
|
+
import { TMagicButton, TMagicCard, TMagicIcon, TMagicInputNumber, TMagicPopover, TMagicTooltip } from '@tmagic/design';
|
|
115
116
|
|
|
116
117
|
import type { ContainerChangeEventData, FormState, GroupListConfig } from '../schema';
|
|
117
118
|
import { filterFunction } from '../utils/form';
|
|
@@ -154,7 +155,10 @@ const rowConfig = computed(() => ({
|
|
|
154
155
|
|
|
155
156
|
const title = computed(() => {
|
|
156
157
|
if (props.config.titleKey && props.model[props.config.titleKey]) {
|
|
157
|
-
|
|
158
|
+
const { titlePrefix } = props.config;
|
|
159
|
+
return titlePrefix
|
|
160
|
+
? `${titlePrefix} ${String(props.index + 1)}: ${props.model[props.config.titleKey]}`
|
|
161
|
+
: `${props.model[props.config.titleKey]}`;
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
if (props.config.title) {
|
|
@@ -115,13 +115,13 @@ export const useTableColumns = (
|
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
const defaultFixed: 'left' | 'right' = isMagicAdmin.value ? 'right' : 'left';
|
|
118
|
-
|
|
119
118
|
let actionFixed: 'left' | 'right' | undefined = props.config.fixed === false ? undefined : defaultFixed;
|
|
120
|
-
|
|
121
119
|
if (typeof props.config.fixed === 'string' && ['left', 'right'].includes(props.config.fixed)) {
|
|
122
120
|
actionFixed = props.config.fixed;
|
|
123
121
|
}
|
|
124
122
|
|
|
123
|
+
const actionFlat = props.config.flat === undefined && isMagicAdmin.value ? true : props.config.flat;
|
|
124
|
+
|
|
125
125
|
const actionColumn = {
|
|
126
126
|
props: {
|
|
127
127
|
label: '操作',
|
|
@@ -133,7 +133,7 @@ export const useTableColumns = (
|
|
|
133
133
|
cell: ({ row, $index }: any) =>
|
|
134
134
|
h(ActionsColumn, {
|
|
135
135
|
row,
|
|
136
|
-
flat:
|
|
136
|
+
flat: actionFlat,
|
|
137
137
|
index: $index,
|
|
138
138
|
model: props.model,
|
|
139
139
|
config: props.config,
|
package/src/fields/Number.vue
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
v-if="model"
|
|
4
4
|
v-model="value"
|
|
5
5
|
clearable
|
|
6
|
-
controls-position="right"
|
|
6
|
+
:controls-position="isMagicAdmin ? '' : 'right'"
|
|
7
7
|
:size="size"
|
|
8
8
|
:max="config.max"
|
|
9
9
|
:min="config.min"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<script lang="ts" setup>
|
|
19
19
|
import { inject, ref, watch } from 'vue';
|
|
20
20
|
|
|
21
|
-
import { TMagicInputNumber } from '@tmagic/design';
|
|
21
|
+
import { isMagicAdminTheme, TMagicInputNumber } from '@tmagic/design';
|
|
22
22
|
|
|
23
23
|
import type { FieldProps, FormState, NumberConfig } from '../schema';
|
|
24
24
|
import { useAddField } from '../utils/useAddField';
|
|
@@ -34,6 +34,9 @@ const emit = defineEmits<{
|
|
|
34
34
|
input: [values: number];
|
|
35
35
|
}>();
|
|
36
36
|
|
|
37
|
+
// magic-admin 主题下输入框走"无右侧上下箭头"的极简样式(控件位置置空回到 ElInputNumber 默认两侧布局)
|
|
38
|
+
const isMagicAdmin = isMagicAdminTheme();
|
|
39
|
+
|
|
37
40
|
const value = ref<number>();
|
|
38
41
|
|
|
39
42
|
watch(
|