sun-card-design 1.1.48 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/dist/mobile/sun-card-design-mobile.es18.js +5 -4
- package/dist/mobile/sun-card-design-mobile.es21.js +2 -2
- package/dist/mobile/sun-card-design-mobile.es23.js +2 -2
- package/dist/mobile/sun-card-design-mobile.es25.js +6 -6
- package/dist/mobile/sun-card-design-mobile.es32.js +4 -2
- package/dist/mobile/sun-card-design-mobile.es55.js +226 -0
- package/dist/mobile/sun-card-design-mobile.es56.js +64 -0
- package/dist/mobile/sun-card-design-mobile.es57.js +65 -204
- package/dist/mobile/sun-card-design-mobile.es58.js +81 -47
- package/dist/mobile/sun-card-design-mobile.es59.js +123 -48
- package/dist/mobile/sun-card-design-mobile.es6.js +2 -2
- package/dist/mobile/sun-card-design-mobile.es60.js +116 -52
- package/dist/mobile/sun-card-design-mobile.es61.js +116 -52
- package/dist/pc/sun-card-design-pc.es18.js +5 -4
- package/dist/pc/sun-card-design-pc.es21.js +2 -2
- package/dist/pc/sun-card-design-pc.es23.js +2 -2
- package/dist/pc/sun-card-design-pc.es25.js +6 -6
- package/dist/pc/sun-card-design-pc.es32.js +4 -2
- package/dist/pc/sun-card-design-pc.es55.js +226 -0
- package/dist/pc/sun-card-design-pc.es56.js +45 -207
- package/dist/pc/sun-card-design-pc.es57.js +70 -47
- package/dist/pc/sun-card-design-pc.es58.js +20 -9
- package/dist/pc/sun-card-design-pc.es59.js +116 -52
- package/dist/pc/sun-card-design-pc.es6.js +2 -2
- package/dist/pc/sun-card-design-pc.es60.js +116 -52
- package/dist/public/sun-card-design.css +1 -1
- package/package.json +3 -2
- package/dist/assets/cardDesigner.png +0 -0
- package/dist/assets/img.png +0 -0
- package/dist/assets/pic1.jpg +0 -0
- package/dist/assets/picsl1.jpg +0 -0
- package/dist/assets/song.mp3 +0 -0
- package/dist/assets/tmCard1.jpg +0 -0
- package/dist/assets/tmCard2.jpg +0 -0
- package/dist/assets/tmList1.jpg +0 -0
- package/dist/assets/video.mp4 +0 -0
- package/dist/mobile/sun-card-design-mobile.es51.js +0 -4
- package/dist/mobile/sun-card-design-mobile.es62.js +0 -98
- package/dist/pc/sun-card-design-pc.es51.js +0 -4
- package/dist/pc/sun-card-design-pc.es61.js +0 -98
- /package/dist/mobile/{sun-card-design-mobile.es66.js → sun-card-design-mobile.es65.js} +0 -0
- /package/dist/pc/{sun-card-design-pc.es66.js → sun-card-design-pc.es65.js} +0 -0
|
@@ -1,64 +1,98 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { customIcon } from "./sun-card-design-mobile.es66.js";
|
|
1
|
+
import { resolveComponent, createElementBlock, openBlock, normalizeStyle, createVNode, withCtx, Fragment, renderList, createBlock, createElementVNode } from "vue";
|
|
2
|
+
import FormItem from "./sun-card-design-mobile.es25.js";
|
|
4
3
|
/* empty css */
|
|
5
4
|
import _export_sfc from "./sun-card-design-mobile.es28.js";
|
|
5
|
+
const _hoisted_1 = ["onClick"];
|
|
6
6
|
const _sfc_main = {
|
|
7
|
-
__name: "
|
|
8
|
-
props: ["record"],
|
|
9
|
-
emits: ["clickEvent"],
|
|
7
|
+
__name: "multipleColumn",
|
|
8
|
+
props: ["record", "recordData", "columnsIndex"],
|
|
9
|
+
emits: ["clickEvent", "clickColumnsEvent", "fileUpdateEvent"],
|
|
10
10
|
setup(__props, { emit: __emit }) {
|
|
11
11
|
const props = __props;
|
|
12
12
|
const emit = __emit;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
defineComponent({
|
|
17
|
-
name: `CustomIcon${key}`,
|
|
18
|
-
setup() {
|
|
19
|
-
return () => h("span", { innerHTML: normalized });
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
);
|
|
23
|
-
return acc;
|
|
24
|
-
}, {});
|
|
25
|
-
const iconMap = { ...Icons, ...customIconComponents };
|
|
26
|
-
const iconComponent = computed(() => {
|
|
27
|
-
const name = props?.record?.options?.style?.iconName || "CheckCircleOutlined";
|
|
28
|
-
return iconMap[name] || Icons["CheckCircleOutlined"];
|
|
29
|
-
});
|
|
30
|
-
const iconStyle = computed(() => {
|
|
31
|
-
const color = props?.record?.options?.style?.color || "#000000";
|
|
32
|
-
const justifyContent = props?.record?.options?.style?.justifyContent || "flex-start";
|
|
33
|
-
return {
|
|
34
|
-
color,
|
|
35
|
-
display: "flex",
|
|
36
|
-
justifyContent,
|
|
37
|
-
alignItems: "center",
|
|
38
|
-
width: "100%"
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
function onClick() {
|
|
42
|
-
if (props.record.options.clickEvent) {
|
|
43
|
-
emit("clickEvent", props.record);
|
|
13
|
+
const getIndex = (index) => {
|
|
14
|
+
if (index !== void 0) {
|
|
15
|
+
return index;
|
|
44
16
|
}
|
|
17
|
+
return props.columnsIndex;
|
|
18
|
+
};
|
|
19
|
+
const onClick = (record) => {
|
|
20
|
+
emit("clickEvent", record);
|
|
21
|
+
};
|
|
22
|
+
const onUpdate = (record) => {
|
|
23
|
+
emit("fileUpdateEvent", record);
|
|
24
|
+
};
|
|
25
|
+
const onClickColumns = (record) => {
|
|
26
|
+
if (!record.options.clickEvent) return;
|
|
27
|
+
emit("clickColumnsEvent", record);
|
|
28
|
+
};
|
|
29
|
+
const getBackground = () => {
|
|
30
|
+
if (isGradientColor(props.recordData.config.background)) {
|
|
31
|
+
return "none";
|
|
32
|
+
}
|
|
33
|
+
return props.recordData.config.background;
|
|
34
|
+
};
|
|
35
|
+
function isGradientColor(color) {
|
|
36
|
+
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
45
37
|
}
|
|
46
38
|
return (_ctx, _cache) => {
|
|
39
|
+
const _component_a_col = resolveComponent("a-col");
|
|
40
|
+
const _component_a_row = resolveComponent("a-row");
|
|
47
41
|
return openBlock(), createElementBlock("div", {
|
|
48
|
-
class: "main-
|
|
49
|
-
style: normalizeStyle({
|
|
42
|
+
class: "main-grid",
|
|
43
|
+
style: normalizeStyle({ background: getBackground() })
|
|
50
44
|
}, [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
createVNode(_component_a_row, {
|
|
46
|
+
gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
|
|
47
|
+
}, {
|
|
48
|
+
default: withCtx(() => [
|
|
49
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.record.columns, (item, index) => {
|
|
50
|
+
return openBlock(), createBlock(_component_a_col, {
|
|
51
|
+
key: index.toString(),
|
|
52
|
+
flex: props.record.columns[index]?.flex,
|
|
53
|
+
span: 24,
|
|
54
|
+
style: normalizeStyle({
|
|
55
|
+
flex: props.record.columns[index]?.flex
|
|
56
|
+
})
|
|
57
|
+
}, {
|
|
58
|
+
default: withCtx(() => [
|
|
59
|
+
createElementVNode("div", {
|
|
60
|
+
class: "box",
|
|
61
|
+
style: normalizeStyle({
|
|
62
|
+
background: props.record.options.style?.background,
|
|
63
|
+
border: props.record.options.style?.borderColor === "none" ? "none" : "1px solid " + (props.record.options.style?.borderColor || "transparent"),
|
|
64
|
+
borderRadius: props.record.options.style?.borderRadius + "px",
|
|
65
|
+
padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
|
|
66
|
+
justifyContent: props.record.options.style?.alignItems || "start",
|
|
67
|
+
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
68
|
+
boxShadow: props.record.options.style?.boxShadow || null
|
|
69
|
+
}),
|
|
70
|
+
onClick: ($event) => onClickColumns(item)
|
|
71
|
+
}, [
|
|
72
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (element, index2) => {
|
|
73
|
+
return openBlock(), createBlock(FormItem, {
|
|
74
|
+
record: element,
|
|
75
|
+
key: index2,
|
|
76
|
+
recordData: props.recordData,
|
|
77
|
+
columnsIndex: getIndex(item.index),
|
|
78
|
+
onClickEvent: onClick,
|
|
79
|
+
onFileUpdateEvent: onUpdate,
|
|
80
|
+
onClickColumnsEvent: onClickColumns
|
|
81
|
+
}, null, 8, ["record", "recordData", "columnsIndex"]);
|
|
82
|
+
}), 128))
|
|
83
|
+
], 12, _hoisted_1)
|
|
84
|
+
]),
|
|
85
|
+
_: 2
|
|
86
|
+
}, 1032, ["flex", "style"]);
|
|
87
|
+
}), 128))
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["gutter"])
|
|
57
91
|
], 4);
|
|
58
92
|
};
|
|
59
93
|
}
|
|
60
94
|
};
|
|
61
|
-
const
|
|
95
|
+
const MultipleColumn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-20b79e7a"]]);
|
|
62
96
|
export {
|
|
63
|
-
|
|
97
|
+
MultipleColumn as default
|
|
64
98
|
};
|
|
@@ -1,14 +1,58 @@
|
|
|
1
|
-
import { resolveComponent, createElementBlock, openBlock, normalizeStyle, createVNode, withCtx, Fragment, renderList, createBlock,
|
|
1
|
+
import { ref, computed, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, createElementVNode, createVNode, withCtx, TransitionGroup, Fragment, renderList, createBlock, Transition, createCommentVNode } from "vue";
|
|
2
2
|
import FormItem from "./sun-card-design-mobile.es25.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "./sun-card-design-mobile.es28.js";
|
|
5
|
+
const _hoisted_1 = { class: "expand-list-container" };
|
|
6
|
+
const _hoisted_2 = ["onClick"];
|
|
5
7
|
const _sfc_main = {
|
|
6
|
-
__name: "
|
|
8
|
+
__name: "multipleLine",
|
|
7
9
|
props: ["record", "recordData", "columnsIndex"],
|
|
8
10
|
emits: ["clickEvent", "clickColumnsEvent", "fileUpdateEvent"],
|
|
9
11
|
setup(__props, { emit: __emit }) {
|
|
10
12
|
const props = __props;
|
|
11
13
|
const emit = __emit;
|
|
14
|
+
const currentDisplayCount = ref(0);
|
|
15
|
+
const collapse = computed(() => props.record.options?.style?.collapse ?? false);
|
|
16
|
+
const collapseLine = computed(() => props.record.options?.style?.collapseLine ?? 2);
|
|
17
|
+
const expandType = computed(() => props.record.options?.style?.expandType || "noRepeat");
|
|
18
|
+
const expandLine = computed(() => props.record.options?.style?.expandLine ?? 2);
|
|
19
|
+
const totalColumns = computed(() => props.record.columns?.length || 0);
|
|
20
|
+
watch([collapse, collapseLine, totalColumns], () => {
|
|
21
|
+
if (collapse.value) {
|
|
22
|
+
currentDisplayCount.value = Math.min(collapseLine.value, totalColumns.value);
|
|
23
|
+
} else {
|
|
24
|
+
currentDisplayCount.value = totalColumns.value;
|
|
25
|
+
}
|
|
26
|
+
if (currentDisplayCount.value > totalColumns.value) {
|
|
27
|
+
currentDisplayCount.value = totalColumns.value;
|
|
28
|
+
}
|
|
29
|
+
}, { immediate: true });
|
|
30
|
+
const displayedColumns = computed(() => {
|
|
31
|
+
if (!collapse.value) {
|
|
32
|
+
return props.record.columns || [];
|
|
33
|
+
}
|
|
34
|
+
return (props.record.columns || []).slice(0, currentDisplayCount.value);
|
|
35
|
+
});
|
|
36
|
+
const showExpandMore = computed(() => {
|
|
37
|
+
if (!collapse.value) return false;
|
|
38
|
+
return currentDisplayCount.value < totalColumns.value;
|
|
39
|
+
});
|
|
40
|
+
const handleExpandMore = () => {
|
|
41
|
+
if (expandType.value === "noRepeat") {
|
|
42
|
+
currentDisplayCount.value = totalColumns.value;
|
|
43
|
+
} else if (expandType.value === "repeat") {
|
|
44
|
+
currentDisplayCount.value = Math.min(
|
|
45
|
+
currentDisplayCount.value + expandLine.value,
|
|
46
|
+
totalColumns.value
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const getIndex = (index) => {
|
|
51
|
+
if (index !== void 0) {
|
|
52
|
+
return index;
|
|
53
|
+
}
|
|
54
|
+
return props.columnsIndex;
|
|
55
|
+
};
|
|
12
56
|
const onClick = (record) => {
|
|
13
57
|
emit("clickEvent", record);
|
|
14
58
|
};
|
|
@@ -19,69 +63,100 @@ const _sfc_main = {
|
|
|
19
63
|
if (!record.options.clickEvent) return;
|
|
20
64
|
emit("clickColumnsEvent", record);
|
|
21
65
|
};
|
|
22
|
-
|
|
66
|
+
function isGradientColor(color) {
|
|
67
|
+
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
68
|
+
}
|
|
69
|
+
const getBackground = computed(() => {
|
|
70
|
+
if (!props.recordData?.config?.background) {
|
|
71
|
+
return "transparent";
|
|
72
|
+
}
|
|
23
73
|
if (isGradientColor(props.recordData.config.background)) {
|
|
24
74
|
return "none";
|
|
25
75
|
}
|
|
26
76
|
return props.recordData.config.background;
|
|
27
|
-
};
|
|
28
|
-
function isGradientColor(color) {
|
|
29
|
-
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
30
|
-
}
|
|
77
|
+
});
|
|
31
78
|
return (_ctx, _cache) => {
|
|
32
79
|
const _component_a_col = resolveComponent("a-col");
|
|
33
80
|
const _component_a_row = resolveComponent("a-row");
|
|
34
81
|
return openBlock(), createElementBlock("div", {
|
|
35
|
-
class: "main-
|
|
36
|
-
style: normalizeStyle({ background: getBackground
|
|
82
|
+
class: "main-grid",
|
|
83
|
+
style: normalizeStyle({ background: getBackground.value })
|
|
37
84
|
}, [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
85
|
+
createElementVNode("div", _hoisted_1, [
|
|
86
|
+
createVNode(_component_a_row, {
|
|
87
|
+
gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
|
|
88
|
+
}, {
|
|
89
|
+
default: withCtx(() => [
|
|
90
|
+
createVNode(TransitionGroup, {
|
|
91
|
+
name: "expand-list",
|
|
92
|
+
tag: "div",
|
|
93
|
+
class: "expand-list-group"
|
|
47
94
|
}, {
|
|
48
95
|
default: withCtx(() => [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
96
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayedColumns.value, (item, index) => {
|
|
97
|
+
return openBlock(), createBlock(_component_a_col, {
|
|
98
|
+
key: item.uuid || `col-${index}`,
|
|
99
|
+
flex: item.flex,
|
|
100
|
+
span: 24,
|
|
101
|
+
style: normalizeStyle({
|
|
102
|
+
flex: _ctx.none
|
|
103
|
+
}),
|
|
104
|
+
class: "expand-col-item"
|
|
105
|
+
}, {
|
|
106
|
+
default: withCtx(() => [
|
|
107
|
+
createElementVNode("div", {
|
|
108
|
+
class: "box",
|
|
109
|
+
style: normalizeStyle({
|
|
110
|
+
background: props.record.options.style?.background,
|
|
111
|
+
border: props.record.options.style?.borderColor === "none" ? "none" : "1px solid " + (props.record.options.style?.borderColor || "transparent"),
|
|
112
|
+
borderRadius: props.record.options.style?.borderRadius + "px",
|
|
113
|
+
padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
|
|
114
|
+
justifyContent: props.record.options.style?.alignItems || "start",
|
|
115
|
+
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
116
|
+
boxShadow: props.record.options.style?.boxShadow || null
|
|
117
|
+
}),
|
|
118
|
+
onClick: ($event) => onClickColumns(item)
|
|
119
|
+
}, [
|
|
120
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (element, index2) => {
|
|
121
|
+
return openBlock(), createBlock(FormItem, {
|
|
122
|
+
record: element,
|
|
123
|
+
key: index2,
|
|
124
|
+
recordData: props.recordData,
|
|
125
|
+
columnsIndex: getIndex(item.index),
|
|
126
|
+
onClickEvent: onClick,
|
|
127
|
+
onFileUpdateEvent: onUpdate,
|
|
128
|
+
onClickColumnsEvent: onClickColumns
|
|
129
|
+
}, null, 8, ["record", "recordData", "columnsIndex"]);
|
|
130
|
+
}), 128))
|
|
131
|
+
], 12, _hoisted_2)
|
|
132
|
+
]),
|
|
133
|
+
_: 2
|
|
134
|
+
}, 1032, ["flex", "style"]);
|
|
135
|
+
}), 128))
|
|
73
136
|
]),
|
|
74
|
-
_:
|
|
75
|
-
}
|
|
76
|
-
|
|
137
|
+
_: 1
|
|
138
|
+
})
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
}, 8, ["gutter"])
|
|
142
|
+
]),
|
|
143
|
+
createVNode(Transition, { name: "fade" }, {
|
|
144
|
+
default: withCtx(() => [
|
|
145
|
+
showExpandMore.value ? (openBlock(), createElementBlock("div", {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: "expand-more",
|
|
148
|
+
onClick: handleExpandMore
|
|
149
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
150
|
+
createElementVNode("span", null, "展开更多", -1)
|
|
151
|
+
])])) : createCommentVNode("", true)
|
|
77
152
|
]),
|
|
78
153
|
_: 1
|
|
79
|
-
}
|
|
154
|
+
})
|
|
80
155
|
], 4);
|
|
81
156
|
};
|
|
82
157
|
}
|
|
83
158
|
};
|
|
84
|
-
const
|
|
159
|
+
const MultipleLine = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dad6f574"]]);
|
|
85
160
|
export {
|
|
86
|
-
|
|
161
|
+
MultipleLine as default
|
|
87
162
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref, watch, createElementBlock, openBlock, normalizeStyle, createElementVNode } from "vue";
|
|
2
2
|
import { renderTextByVariables } from "./sun-card-design-mobile.es26.js";
|
|
3
|
-
import IMG from "./sun-card-design-mobile.es32.js";
|
|
3
|
+
import { IMG } from "./sun-card-design-mobile.es32.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import _export_sfc from "./sun-card-design-mobile.es28.js";
|
|
6
6
|
const _sfc_main = {
|
|
@@ -91,7 +91,7 @@ const _sfc_main = {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
const Picture = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
94
|
+
const Picture = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b7f1d53f"]]);
|
|
95
95
|
export {
|
|
96
96
|
Picture as default
|
|
97
97
|
};
|
|
@@ -1,15 +1,52 @@
|
|
|
1
|
-
import { resolveComponent, createElementBlock, openBlock, normalizeStyle, createVNode, withCtx, Fragment, renderList, createBlock,
|
|
1
|
+
import { ref, computed, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, createElementVNode, createVNode, withCtx, TransitionGroup, Fragment, renderList, createBlock, Transition, createCommentVNode } from "vue";
|
|
2
2
|
import FormItem from "./sun-card-design-mobile.es25.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "./sun-card-design-mobile.es28.js";
|
|
5
|
-
const _hoisted_1 =
|
|
5
|
+
const _hoisted_1 = { class: "expand-list-container" };
|
|
6
|
+
const _hoisted_2 = ["onClick"];
|
|
6
7
|
const _sfc_main = {
|
|
7
|
-
__name: "
|
|
8
|
+
__name: "gridList",
|
|
8
9
|
props: ["record", "recordData", "columnsIndex"],
|
|
9
10
|
emits: ["clickEvent", "clickColumnsEvent", "fileUpdateEvent"],
|
|
10
11
|
setup(__props, { emit: __emit }) {
|
|
11
12
|
const props = __props;
|
|
12
13
|
const emit = __emit;
|
|
14
|
+
const currentDisplayRows = ref(0);
|
|
15
|
+
const collapse = computed(() => props.record.options?.style?.collapse ?? false);
|
|
16
|
+
const collapseLine = computed(() => props.record.options?.style?.collapseLine ?? 2);
|
|
17
|
+
const expandType = computed(() => props.record.options?.style?.expandType || "noRepeat");
|
|
18
|
+
const expandLine = computed(() => props.record.options?.style?.expandLine ?? 2);
|
|
19
|
+
const totalColumns = computed(() => props.record.columns?.length || 0);
|
|
20
|
+
const autoNumber = computed(() => props.record.options?.autoNumber || 2);
|
|
21
|
+
const totalRows = computed(() => Math.ceil(totalColumns.value / autoNumber.value));
|
|
22
|
+
watch([collapse, collapseLine, totalRows], () => {
|
|
23
|
+
if (collapse.value) {
|
|
24
|
+
currentDisplayRows.value = Math.min(collapseLine.value, totalRows.value);
|
|
25
|
+
} else {
|
|
26
|
+
currentDisplayRows.value = totalRows.value;
|
|
27
|
+
}
|
|
28
|
+
}, { immediate: true });
|
|
29
|
+
const displayedColumns = computed(() => {
|
|
30
|
+
if (!collapse.value) {
|
|
31
|
+
return props.record.columns || [];
|
|
32
|
+
}
|
|
33
|
+
const displayCount = currentDisplayRows.value * autoNumber.value;
|
|
34
|
+
return (props.record.columns || []).slice(0, displayCount);
|
|
35
|
+
});
|
|
36
|
+
const showExpandMore = computed(() => {
|
|
37
|
+
if (!collapse.value) return false;
|
|
38
|
+
return currentDisplayRows.value < totalRows.value;
|
|
39
|
+
});
|
|
40
|
+
const handleExpandMore = () => {
|
|
41
|
+
if (expandType.value === "noRepeat") {
|
|
42
|
+
currentDisplayRows.value = totalRows.value;
|
|
43
|
+
} else if (expandType.value === "repeat") {
|
|
44
|
+
currentDisplayRows.value = Math.min(
|
|
45
|
+
currentDisplayRows.value + expandLine.value,
|
|
46
|
+
totalRows.value
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
13
50
|
const getIndex = (index) => {
|
|
14
51
|
if (index !== void 0) {
|
|
15
52
|
return index;
|
|
@@ -26,73 +63,100 @@ const _sfc_main = {
|
|
|
26
63
|
if (!record.options.clickEvent) return;
|
|
27
64
|
emit("clickColumnsEvent", record);
|
|
28
65
|
};
|
|
29
|
-
|
|
66
|
+
function isGradientColor(color) {
|
|
67
|
+
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
68
|
+
}
|
|
69
|
+
const getBackground = computed(() => {
|
|
70
|
+
if (!props.recordData?.config?.background) {
|
|
71
|
+
return "transparent";
|
|
72
|
+
}
|
|
30
73
|
if (isGradientColor(props.recordData.config.background)) {
|
|
31
74
|
return "none";
|
|
32
75
|
}
|
|
33
76
|
return props.recordData.config.background;
|
|
34
|
-
};
|
|
35
|
-
function isGradientColor(color) {
|
|
36
|
-
return /^(linear|radial)-gradient\(.*\)$/.test(color);
|
|
37
|
-
}
|
|
77
|
+
});
|
|
38
78
|
return (_ctx, _cache) => {
|
|
39
79
|
const _component_a_col = resolveComponent("a-col");
|
|
40
80
|
const _component_a_row = resolveComponent("a-row");
|
|
41
81
|
return openBlock(), createElementBlock("div", {
|
|
42
82
|
class: "main-grid",
|
|
43
|
-
style: normalizeStyle({ background: getBackground
|
|
83
|
+
style: normalizeStyle({ background: getBackground.value })
|
|
44
84
|
}, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
style: normalizeStyle({
|
|
55
|
-
flex: props.record.columns[index]?.flex
|
|
56
|
-
})
|
|
85
|
+
createElementVNode("div", _hoisted_1, [
|
|
86
|
+
createVNode(_component_a_row, {
|
|
87
|
+
gutter: [props.record.options.style.lrGutter, props.record.options.style.tbGutter]
|
|
88
|
+
}, {
|
|
89
|
+
default: withCtx(() => [
|
|
90
|
+
createVNode(TransitionGroup, {
|
|
91
|
+
name: "expand-list",
|
|
92
|
+
tag: "div",
|
|
93
|
+
class: "expand-list-group"
|
|
57
94
|
}, {
|
|
58
95
|
default: withCtx(() => [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
96
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayedColumns.value, (item, index) => {
|
|
97
|
+
return openBlock(), createBlock(_component_a_col, {
|
|
98
|
+
key: item.uuid || `col-${index}`,
|
|
99
|
+
flex: item.flex,
|
|
100
|
+
span: 24 / props.record.options.autoNumber,
|
|
101
|
+
style: normalizeStyle({
|
|
102
|
+
flex: _ctx.none
|
|
103
|
+
}),
|
|
104
|
+
class: "expand-col-item"
|
|
105
|
+
}, {
|
|
106
|
+
default: withCtx(() => [
|
|
107
|
+
createElementVNode("div", {
|
|
108
|
+
class: "box",
|
|
109
|
+
style: normalizeStyle({
|
|
110
|
+
background: props.record.options.style?.background,
|
|
111
|
+
border: props.record.options.style?.borderColor === "none" ? "none" : "1px solid " + (props.record.options.style?.borderColor || "transparent"),
|
|
112
|
+
borderRadius: props.record.options.style?.borderRadius + "px",
|
|
113
|
+
padding: props.record.options.style?.tbPadding + "px " + props.record.options.style?.lrPadding + "px",
|
|
114
|
+
justifyContent: props.record.options.style?.alignItems || "start",
|
|
115
|
+
minHeight: props.record.options.style?.minHeight + "px" || "48px",
|
|
116
|
+
boxShadow: props.record.options.style?.boxShadow || null
|
|
117
|
+
}),
|
|
118
|
+
onClick: ($event) => onClickColumns(item)
|
|
119
|
+
}, [
|
|
120
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.list, (element, index2) => {
|
|
121
|
+
return openBlock(), createBlock(FormItem, {
|
|
122
|
+
record: element,
|
|
123
|
+
key: index2,
|
|
124
|
+
recordData: props.recordData,
|
|
125
|
+
columnsIndex: getIndex(item.index),
|
|
126
|
+
onClickEvent: onClick,
|
|
127
|
+
onFileUpdateEvent: onUpdate,
|
|
128
|
+
onClickColumnsEvent: onClickColumns
|
|
129
|
+
}, null, 8, ["record", "recordData", "columnsIndex"]);
|
|
130
|
+
}), 128))
|
|
131
|
+
], 12, _hoisted_2)
|
|
132
|
+
]),
|
|
133
|
+
_: 2
|
|
134
|
+
}, 1032, ["flex", "span", "style"]);
|
|
135
|
+
}), 128))
|
|
84
136
|
]),
|
|
85
|
-
_:
|
|
86
|
-
}
|
|
87
|
-
|
|
137
|
+
_: 1
|
|
138
|
+
})
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
}, 8, ["gutter"])
|
|
142
|
+
]),
|
|
143
|
+
createVNode(Transition, { name: "fade" }, {
|
|
144
|
+
default: withCtx(() => [
|
|
145
|
+
showExpandMore.value ? (openBlock(), createElementBlock("div", {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: "expand-more",
|
|
148
|
+
onClick: handleExpandMore
|
|
149
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
150
|
+
createElementVNode("span", null, "展开更多", -1)
|
|
151
|
+
])])) : createCommentVNode("", true)
|
|
88
152
|
]),
|
|
89
153
|
_: 1
|
|
90
|
-
}
|
|
154
|
+
})
|
|
91
155
|
], 4);
|
|
92
156
|
};
|
|
93
157
|
}
|
|
94
158
|
};
|
|
95
|
-
const
|
|
159
|
+
const GridList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-159c873b"]]);
|
|
96
160
|
export {
|
|
97
|
-
|
|
161
|
+
GridList as default
|
|
98
162
|
};
|