polarvo-layout 1.0.66 → 1.0.68
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/package.json
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
<script>
|
|
16
16
|
let cachedDefaultElements = null;
|
|
17
|
-
let cachedCustomElements = null;
|
|
18
17
|
</script>
|
|
19
18
|
|
|
20
19
|
<script setup>
|
|
@@ -50,7 +49,7 @@ const sectionMode = computed(() => activeMode.value);
|
|
|
50
49
|
|
|
51
50
|
const allElements = ref({
|
|
52
51
|
default: [],
|
|
53
|
-
custom:
|
|
52
|
+
custom: [],
|
|
54
53
|
});
|
|
55
54
|
|
|
56
55
|
const currentElements = computed(() => {
|
|
@@ -79,6 +78,19 @@ function getPropsDefaults(props) {
|
|
|
79
78
|
);
|
|
80
79
|
}
|
|
81
80
|
|
|
81
|
+
function formatElDate(createdAt) {
|
|
82
|
+
if (!createdAt) return null;
|
|
83
|
+
|
|
84
|
+
const d = new Date(createdAt);
|
|
85
|
+
const yy = String(d.getFullYear()).slice(-2);
|
|
86
|
+
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
|
87
|
+
const dd = String(d.getDate()).padStart(2, '0');
|
|
88
|
+
const hh = String(d.getHours()).padStart(2, '0');
|
|
89
|
+
const min = String(d.getMinutes()).padStart(2, '0');
|
|
90
|
+
|
|
91
|
+
return `${yy}${mm}${dd}_${hh}:${min}`;
|
|
92
|
+
}
|
|
93
|
+
|
|
82
94
|
// 기본 요소 목록에서 제외할 컴포넌트
|
|
83
95
|
const EXCLUDED_ELEMENTS = [
|
|
84
96
|
'button',
|
|
@@ -115,13 +127,11 @@ function buildDefaultElements() {
|
|
|
115
127
|
}
|
|
116
128
|
|
|
117
129
|
function buildCustomElements() {
|
|
118
|
-
if (cachedCustomElements) return cachedCustomElements;
|
|
119
|
-
|
|
120
130
|
const imgurl = imageModules['/src/assets/el_img/customDefault.png']?.default ?? '';
|
|
121
131
|
|
|
122
|
-
|
|
132
|
+
return props.customElements.map((el) => {
|
|
123
133
|
const { elName, type, mode, position, size, section, isLocked, createdAt, ...propDefaults } = el;
|
|
124
|
-
const elDate = createdAt
|
|
134
|
+
const elDate = formatElDate(createdAt);
|
|
125
135
|
|
|
126
136
|
return {
|
|
127
137
|
label: elDate ? `${type}_${elDate}` : type,
|
|
@@ -130,13 +140,13 @@ function buildCustomElements() {
|
|
|
130
140
|
imgurl,
|
|
131
141
|
};
|
|
132
142
|
});
|
|
133
|
-
|
|
134
|
-
return cachedCustomElements;
|
|
135
143
|
}
|
|
136
144
|
|
|
137
145
|
function getElements() {
|
|
138
146
|
allElements.value.default = buildDefaultElements();
|
|
139
147
|
allElements.value.custom = buildCustomElements();
|
|
148
|
+
|
|
149
|
+
console.log("allElements.value.default", allElements.value);
|
|
140
150
|
}
|
|
141
151
|
|
|
142
152
|
onBeforeMount(() => {
|