ts-glitter 13.8.7993 → 13.8.7994
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/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/editor/add-component.js +12 -0
- package/lowcode/editor/add-component.ts +13 -0
- package/lowcode/editor/basic-component.js +220 -25
- package/lowcode/editor/basic-component.ts +222 -59
- package/package.json +1 -1
- package/src/api-public/services/filter-protect-data.js +2 -0
- package/src/api-public/services/filter-protect-data.js.map +1 -1
- package/src/api-public/services/filter-protect-data.ts +2 -0
package/lowcode/Entry.js
CHANGED
|
@@ -70,7 +70,7 @@ export class Entry {
|
|
|
70
70
|
}
|
|
71
71
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
72
72
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
73
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
73
|
+
glitter.share.editerVersion = 'V_13.8.7994';
|
|
74
74
|
glitter.share.start = new Date();
|
|
75
75
|
const vm = {
|
|
76
76
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -71,7 +71,7 @@ export class Entry {
|
|
|
71
71
|
}
|
|
72
72
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
73
73
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
74
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
74
|
+
glitter.share.editerVersion = 'V_13.8.7994';
|
|
75
75
|
glitter.share.start = new Date();
|
|
76
76
|
const vm: {
|
|
77
77
|
appConfig: any;
|
|
@@ -705,6 +705,18 @@ ${BgWidget.save(gvc.event(() => {
|
|
|
705
705
|
</div>`;
|
|
706
706
|
}
|
|
707
707
|
else {
|
|
708
|
+
if (type === 'module') {
|
|
709
|
+
return `<div class="w-100 row m-0 mt-3" style=" max-height:${(() => {
|
|
710
|
+
return Storage.select_function === 'user-editor' ? `calc(100vh - 200px)` : `calc(100vh - 160px)`;
|
|
711
|
+
})()};overflow-y: auto;">
|
|
712
|
+
${BasicComponent.getComponentList(gvc, [
|
|
713
|
+
{
|
|
714
|
+
title: '其餘設計模塊',
|
|
715
|
+
value: 'layout',
|
|
716
|
+
}
|
|
717
|
+
], '基本元件,設計元件')}
|
|
718
|
+
</div>`;
|
|
719
|
+
}
|
|
708
720
|
return gvc.bindView(() => {
|
|
709
721
|
let data = undefined;
|
|
710
722
|
const id = gvc.glitter.getUUID();
|
|
@@ -380,6 +380,7 @@ export class AddComponent {
|
|
|
380
380
|
query_tag: [],
|
|
381
381
|
search: '',
|
|
382
382
|
};
|
|
383
|
+
|
|
383
384
|
return (
|
|
384
385
|
gvc.bindView(() => {
|
|
385
386
|
const searchContainer = gvc.glitter.getUUID();
|
|
@@ -738,6 +739,18 @@ ${BgWidget.save(gvc.event(() => {
|
|
|
738
739
|
].join('<div class="my-2"></div>')}
|
|
739
740
|
</div>`
|
|
740
741
|
} else {
|
|
742
|
+
if(type==='module'){
|
|
743
|
+
return `<div class="w-100 row m-0 mt-3" style=" max-height:${(() => {
|
|
744
|
+
return Storage.select_function === 'user-editor' ? `calc(100vh - 200px)` : `calc(100vh - 160px)`;
|
|
745
|
+
})()};overflow-y: auto;">
|
|
746
|
+
${BasicComponent.getComponentList(gvc,[
|
|
747
|
+
{
|
|
748
|
+
title: '其餘設計模塊',
|
|
749
|
+
value: 'layout',
|
|
750
|
+
}
|
|
751
|
+
],'基本元件,設計元件')}
|
|
752
|
+
</div>`
|
|
753
|
+
}
|
|
741
754
|
return gvc.bindView(() => {
|
|
742
755
|
let data: any = undefined;
|
|
743
756
|
const id = gvc.glitter.getUUID();
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { AddComponent } from "./add-component.js";
|
|
2
|
+
import { ApiPageConfig } from "../api/pageConfig.js";
|
|
2
3
|
const html = String.raw;
|
|
3
4
|
export class BasicComponent {
|
|
4
5
|
static main(gvc) {
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
<div class="
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
return [
|
|
7
|
+
html `
|
|
8
|
+
<div class="row m-0 pt-3 w-100 border-top pb-5"
|
|
9
|
+
style="max-height: calc(100vh - 125px);overflow-y: auto;">
|
|
10
|
+
<div class="fw-500 fs-6 col-12 mt-0 pt-0 pb-3" style="color:dimgray;">
|
|
11
|
+
<div class="alert bg-secondary w-100 fs-6 mb-3 p-3" style="color: dimgray;white-space: normal;">
|
|
12
|
+
統合了所有電商網站常使用到的基本元件,透過基礎設計元件,即可達成基本設計需求。
|
|
13
|
+
</div>
|
|
14
|
+
內容
|
|
10
15
|
</div>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
${BasicComponent.componentList.map((dd) => {
|
|
14
|
-
return `<div class="col-6 mb-3 ${dd.title == "文字組合" ? 'simpleAddGuide' : ''}">
|
|
16
|
+
${BasicComponent.componentList.map((dd) => {
|
|
17
|
+
return `<div class="col-6 mb-3 ${dd.title == "文字組合" ? 'simpleAddGuide' : ''}">
|
|
15
18
|
<div class="d-flex flex-column justify-content-center w-100"
|
|
16
19
|
style="gap:5px;cursor:pointer;">
|
|
17
20
|
<div class="card w-100 position-relative rounded hoverHidden rounded-3"
|
|
@@ -26,12 +29,12 @@ export class BasicComponent {
|
|
|
26
29
|
style="background: rgba(0,0,0,0.5);gap:5px;">
|
|
27
30
|
<button class="btn btn-primary-c d-flex align-items-center"
|
|
28
31
|
style="height: 28px;width: 75px;gap:5px;" onclick="${gvc.event(() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
dd.config.label = dd.title;
|
|
33
|
+
gvc.glitter.share.loading_dialog.dataLoading({ text: '模組添加中...', visible: true });
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
AddComponent.addWidget(gvc, JSON.parse(JSON.stringify(dd.config)));
|
|
36
|
+
}, 100);
|
|
37
|
+
})}">
|
|
35
38
|
<i class="fa-regular fa-circle-plus " aria-hidden="true" ></i>新增
|
|
36
39
|
</button>
|
|
37
40
|
</div>
|
|
@@ -45,10 +48,10 @@ export class BasicComponent {
|
|
|
45
48
|
|
|
46
49
|
</div>
|
|
47
50
|
</div>`;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
}).join('')}
|
|
52
|
+
<div class="fw-bold fs-6 col-12 mt-0 pt-3 pb-3 border-top" style="color:dimgray;">商品顯示方式</div>
|
|
53
|
+
${BasicComponent.productList.map((dd) => {
|
|
54
|
+
return `<div class="col-6 mb-3 ">
|
|
52
55
|
<div class="d-flex flex-column justify-content-center w-100"
|
|
53
56
|
style="gap:5px;cursor:pointer;">
|
|
54
57
|
<div class="card w-100 position-relative rounded hoverHidden rounded-3"
|
|
@@ -63,9 +66,9 @@ export class BasicComponent {
|
|
|
63
66
|
style="background: rgba(0,0,0,0.5);gap:5px;">
|
|
64
67
|
<button class="btn btn-primary-c d-flex align-items-center"
|
|
65
68
|
style="height: 28px;width: 75px;gap:5px;" onclick="${gvc.event(() => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
dd.config.label = dd.title;
|
|
70
|
+
AddComponent.addWidget(gvc, dd.config);
|
|
71
|
+
})}">
|
|
69
72
|
<i class="fa-regular fa-circle-plus " aria-hidden="true" ></i>新增
|
|
70
73
|
</button>
|
|
71
74
|
</div>
|
|
@@ -79,9 +82,201 @@ export class BasicComponent {
|
|
|
79
82
|
|
|
80
83
|
</div>
|
|
81
84
|
</div>`;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
}).join('')}
|
|
86
|
+
<div class="fw-bold fs-6 col-12 mt-0 pt-3 pb-3 border-top" style="color:dimgray;">基本元件</div>
|
|
87
|
+
${BasicComponent.getComponentList(gvc, [
|
|
88
|
+
{
|
|
89
|
+
title: '基礎設計元件',
|
|
90
|
+
value: 'basic',
|
|
91
|
+
}
|
|
92
|
+
])}
|
|
93
|
+
<div class="fw-bold fs-6 col-12 mt-0 pt-3 pb-3 border-top" style="color:dimgray;">包裝容器</div>
|
|
94
|
+
${BasicComponent.getComponentList(gvc, [
|
|
95
|
+
{
|
|
96
|
+
title: '包裝容器元件',
|
|
97
|
+
value: 'container',
|
|
98
|
+
}
|
|
99
|
+
])}
|
|
100
|
+
</div>`
|
|
101
|
+
].join('');
|
|
102
|
+
}
|
|
103
|
+
static getComponentList(gvc, list, tag = '基本元件') {
|
|
104
|
+
return gvc.bindView(() => {
|
|
105
|
+
let data = undefined;
|
|
106
|
+
const id = gvc.glitter.getUUID();
|
|
107
|
+
return {
|
|
108
|
+
bind: id,
|
|
109
|
+
view: () => {
|
|
110
|
+
return html `
|
|
111
|
+
<div class="w-100 p-3 d-flex align-items-center justify-content-center flex-column"
|
|
112
|
+
style="gap: 10px;">
|
|
113
|
+
<div class="spinner-border fs-5"></div>
|
|
114
|
+
<div class="fs-6 fw-500">載入中...</div>
|
|
115
|
+
</div>`;
|
|
116
|
+
},
|
|
117
|
+
divCreate: {
|
|
118
|
+
style: '', class: `col-12`
|
|
119
|
+
},
|
|
120
|
+
onCreate: () => {
|
|
121
|
+
ApiPageConfig.getPageTemplate({
|
|
122
|
+
template_from: 'all',
|
|
123
|
+
page: '0',
|
|
124
|
+
limit: '3000',
|
|
125
|
+
type: 'module',
|
|
126
|
+
tag: tag,
|
|
127
|
+
search: '',
|
|
128
|
+
}).then((res) => {
|
|
129
|
+
data = res;
|
|
130
|
+
if (document.querySelector(`[gvc-id='${gvc.id(id)}']`)) {
|
|
131
|
+
document.querySelector(`[gvc-id='${gvc.id(id)}']`).outerHTML = (() => {
|
|
132
|
+
return list.map((d1) => {
|
|
133
|
+
return data.response.result.data
|
|
134
|
+
.concat((() => {
|
|
135
|
+
if (d1.value === 'container') {
|
|
136
|
+
return [
|
|
137
|
+
{
|
|
138
|
+
template_config: {
|
|
139
|
+
image: [
|
|
140
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/Screenshot 2024-08-12 at 2.11.09 PM.jpg',
|
|
141
|
+
],
|
|
142
|
+
tag: [],
|
|
143
|
+
name: '網格容器',
|
|
144
|
+
},
|
|
145
|
+
type: '容器',
|
|
146
|
+
name: '網格容器',
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
template_config: {
|
|
150
|
+
image: [
|
|
151
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_Screenshot2024-08-16at5.04.35 PM.jpg',
|
|
152
|
+
],
|
|
153
|
+
tag: [],
|
|
154
|
+
name: '垂直排版',
|
|
155
|
+
},
|
|
156
|
+
type: '容器',
|
|
157
|
+
name: '垂直排版',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
template_config: {
|
|
161
|
+
image: [
|
|
162
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sbs8sfs9s0s2ses5_Screenshot2024-08-20at6.19.57 PM.jpg',
|
|
163
|
+
],
|
|
164
|
+
tag: [],
|
|
165
|
+
name: '比例佈局',
|
|
166
|
+
},
|
|
167
|
+
type: '容器',
|
|
168
|
+
name: '比例佈局',
|
|
169
|
+
},
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
})())
|
|
176
|
+
.filter((dd) => {
|
|
177
|
+
var _a, _b, _c, _d, _e, _f;
|
|
178
|
+
if (d1.value === 'basic') {
|
|
179
|
+
return (((_a = dd.template_config.tag) !== null && _a !== void 0 ? _a : []).find((dd) => {
|
|
180
|
+
return dd === '基本元件';
|
|
181
|
+
})) && ((_b = dd.template_config.tag) !== null && _b !== void 0 ? _b : []).find((dd) => {
|
|
182
|
+
return dd === '設計元件';
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
else if (d1.value === 'layout') {
|
|
186
|
+
return !((_c = dd.template_config.tag) !== null && _c !== void 0 ? _c : []).find((dd) => {
|
|
187
|
+
return dd === '基本元件' || dd === '商品元件';
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
else if (d1.value === 'product_show') {
|
|
191
|
+
return ((_d = dd.template_config.tag) !== null && _d !== void 0 ? _d : []).find((dd) => {
|
|
192
|
+
return dd === '商品元件';
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
else if (d1.value === 'container') {
|
|
196
|
+
return dd.type === '容器';
|
|
197
|
+
}
|
|
198
|
+
else if (d1.value === 'layout') {
|
|
199
|
+
return (!(((_e = dd.template_config.tag) !== null && _e !== void 0 ? _e : []).find((dd) => {
|
|
200
|
+
return dd === '基本元件';
|
|
201
|
+
}))) && ((_f = dd.template_config.tag) !== null && _f !== void 0 ? _f : []).find((dd) => {
|
|
202
|
+
return dd === '設計元件';
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}).map((dd) => {
|
|
206
|
+
console.log(dd);
|
|
207
|
+
return `<div class="col-6 mb-3 ">
|
|
208
|
+
<div class="d-flex flex-column justify-content-center w-100"
|
|
209
|
+
style="gap:5px;cursor:pointer;">
|
|
210
|
+
<div class="card w-100 position-relative rounded hoverHidden rounded-3"
|
|
211
|
+
style="padding-bottom: 58%;overflow: hidden;">
|
|
212
|
+
<div class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center"
|
|
213
|
+
style="overflow: hidden;">
|
|
214
|
+
<img class="w-100 "
|
|
215
|
+
src="${dd.template_config.image[0] || 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}">
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<div class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
219
|
+
style="background: rgba(0,0,0,0.5);gap:5px;">
|
|
220
|
+
<button class="btn btn-primary-c d-flex align-items-center"
|
|
221
|
+
style="height: 28px;width: 75px;gap:5px;" onclick="${gvc.event(() => {
|
|
222
|
+
(window.glitterInitialHelper).getPageData({
|
|
223
|
+
tag: dd.tag,
|
|
224
|
+
appName: dd.appName
|
|
225
|
+
}, (d3) => {
|
|
226
|
+
gvc.glitter.share.addComponent({
|
|
227
|
+
id: gvc.glitter.getUUID(),
|
|
228
|
+
js: './official_view_component/official.js',
|
|
229
|
+
css: {
|
|
230
|
+
class: {},
|
|
231
|
+
style: {},
|
|
232
|
+
},
|
|
233
|
+
data: {
|
|
234
|
+
refer_app: dd.appName,
|
|
235
|
+
tag: dd.tag,
|
|
236
|
+
list: [],
|
|
237
|
+
carryData: {},
|
|
238
|
+
refer_form_data: d3.response.result[0].page_config.formData
|
|
239
|
+
},
|
|
240
|
+
type: 'component',
|
|
241
|
+
class: 'w-100',
|
|
242
|
+
index: 0,
|
|
243
|
+
label: dd.template_config.name,
|
|
244
|
+
style: '',
|
|
245
|
+
bundle: {},
|
|
246
|
+
global: [],
|
|
247
|
+
toggle: false,
|
|
248
|
+
stylist: [],
|
|
249
|
+
dataType: 'static',
|
|
250
|
+
style_from: 'code',
|
|
251
|
+
classDataType: 'static',
|
|
252
|
+
preloadEvenet: {},
|
|
253
|
+
share: {},
|
|
254
|
+
});
|
|
255
|
+
gvc.glitter.closeDiaLog();
|
|
256
|
+
});
|
|
257
|
+
})}">
|
|
258
|
+
<i class="fa-regular fa-circle-plus " aria-hidden="true" ></i>新增
|
|
259
|
+
</button>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
<h3 class="fs-6 mb-0">
|
|
263
|
+
${dd.template_config.name}</h3>
|
|
264
|
+
<div class="d-flex flex-wrap">
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
</div>
|
|
270
|
+
</div>`;
|
|
271
|
+
}).join('');
|
|
272
|
+
})
|
|
273
|
+
.join('');
|
|
274
|
+
})();
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
});
|
|
85
280
|
}
|
|
86
281
|
}
|
|
87
282
|
BasicComponent.componentList = [
|
|
@@ -3,6 +3,7 @@ import {AddComponent} from "./add-component.js";
|
|
|
3
3
|
import {ApiPageConfig} from "../api/pageConfig.js";
|
|
4
4
|
import {Storage} from "../glitterBundle/helper/storage.js";
|
|
5
5
|
import {BgWidget} from "../backend-manager/bg-widget.js";
|
|
6
|
+
import {EditorConfig} from "../editor-config.js";
|
|
6
7
|
|
|
7
8
|
const html = String.raw
|
|
8
9
|
|
|
@@ -9954,16 +9955,18 @@ export class BasicComponent {
|
|
|
9954
9955
|
]
|
|
9955
9956
|
|
|
9956
9957
|
public static main(gvc: GVC) {
|
|
9957
|
-
return
|
|
9958
|
-
|
|
9959
|
-
<div class="
|
|
9960
|
-
|
|
9961
|
-
|
|
9958
|
+
return [
|
|
9959
|
+
html`
|
|
9960
|
+
<div class="row m-0 pt-3 w-100 border-top pb-5"
|
|
9961
|
+
style="max-height: calc(100vh - 125px);overflow-y: auto;">
|
|
9962
|
+
<div class="fw-500 fs-6 col-12 mt-0 pt-0 pb-3" style="color:dimgray;">
|
|
9963
|
+
<div class="alert bg-secondary w-100 fs-6 mb-3 p-3" style="color: dimgray;white-space: normal;">
|
|
9964
|
+
統合了所有電商網站常使用到的基本元件,透過基礎設計元件,即可達成基本設計需求。
|
|
9965
|
+
</div>
|
|
9966
|
+
內容
|
|
9962
9967
|
</div>
|
|
9963
|
-
|
|
9964
|
-
|
|
9965
|
-
${BasicComponent.componentList.map((dd) => {
|
|
9966
|
-
return `<div class="col-6 mb-3 ${dd.title == "文字組合" ? 'simpleAddGuide' : ''}">
|
|
9968
|
+
${BasicComponent.componentList.map((dd) => {
|
|
9969
|
+
return `<div class="col-6 mb-3 ${dd.title == "文字組合" ? 'simpleAddGuide' : ''}">
|
|
9967
9970
|
<div class="d-flex flex-column justify-content-center w-100"
|
|
9968
9971
|
style="gap:5px;cursor:pointer;">
|
|
9969
9972
|
<div class="card w-100 position-relative rounded hoverHidden rounded-3"
|
|
@@ -9978,12 +9981,12 @@ export class BasicComponent {
|
|
|
9978
9981
|
style="background: rgba(0,0,0,0.5);gap:5px;">
|
|
9979
9982
|
<button class="btn btn-primary-c d-flex align-items-center"
|
|
9980
9983
|
style="height: 28px;width: 75px;gap:5px;" onclick="${gvc.event(() => {
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
9986
|
-
|
|
9984
|
+
dd.config.label = dd.title;
|
|
9985
|
+
gvc.glitter.share.loading_dialog.dataLoading({text: '模組添加中...', visible: true})
|
|
9986
|
+
setTimeout(() => {
|
|
9987
|
+
AddComponent.addWidget(gvc, JSON.parse(JSON.stringify(dd.config)));
|
|
9988
|
+
}, 100)
|
|
9989
|
+
})}">
|
|
9987
9990
|
<i class="fa-regular fa-circle-plus " aria-hidden="true" ></i>新增
|
|
9988
9991
|
</button>
|
|
9989
9992
|
</div>
|
|
@@ -9997,10 +10000,10 @@ export class BasicComponent {
|
|
|
9997
10000
|
|
|
9998
10001
|
</div>
|
|
9999
10002
|
</div>`
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10003
|
+
}).join('')}
|
|
10004
|
+
<div class="fw-bold fs-6 col-12 mt-0 pt-3 pb-3 border-top" style="color:dimgray;">商品顯示方式</div>
|
|
10005
|
+
${BasicComponent.productList.map((dd) => {
|
|
10006
|
+
return `<div class="col-6 mb-3 ">
|
|
10004
10007
|
<div class="d-flex flex-column justify-content-center w-100"
|
|
10005
10008
|
style="gap:5px;cursor:pointer;">
|
|
10006
10009
|
<div class="card w-100 position-relative rounded hoverHidden rounded-3"
|
|
@@ -10015,9 +10018,9 @@ export class BasicComponent {
|
|
|
10015
10018
|
style="background: rgba(0,0,0,0.5);gap:5px;">
|
|
10016
10019
|
<button class="btn btn-primary-c d-flex align-items-center"
|
|
10017
10020
|
style="height: 28px;width: 75px;gap:5px;" onclick="${gvc.event(() => {
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
+
dd.config.label = dd.title;
|
|
10022
|
+
AddComponent.addWidget(gvc, dd.config);
|
|
10023
|
+
})}">
|
|
10021
10024
|
<i class="fa-regular fa-circle-plus " aria-hidden="true" ></i>新增
|
|
10022
10025
|
</button>
|
|
10023
10026
|
</div>
|
|
@@ -10031,43 +10034,203 @@ export class BasicComponent {
|
|
|
10031
10034
|
|
|
10032
10035
|
</div>
|
|
10033
10036
|
</div>`
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10037
|
+
}).join('')}
|
|
10038
|
+
<div class="fw-bold fs-6 col-12 mt-0 pt-3 pb-3 border-top" style="color:dimgray;">基本元件</div>
|
|
10039
|
+
${
|
|
10040
|
+
BasicComponent.getComponentList(gvc, [
|
|
10041
|
+
{
|
|
10042
|
+
title: '基礎設計元件',
|
|
10043
|
+
value: 'basic',
|
|
10044
|
+
}
|
|
10045
|
+
])
|
|
10046
|
+
}
|
|
10047
|
+
<div class="fw-bold fs-6 col-12 mt-0 pt-3 pb-3 border-top" style="color:dimgray;">包裝容器</div>
|
|
10048
|
+
${
|
|
10049
|
+
BasicComponent.getComponentList(gvc, [
|
|
10050
|
+
{
|
|
10051
|
+
title: '包裝容器元件',
|
|
10052
|
+
value: 'container',
|
|
10053
|
+
}
|
|
10054
|
+
])
|
|
10055
|
+
}
|
|
10056
|
+
</div>`
|
|
10057
|
+
].join('')
|
|
10058
|
+
|
|
10059
|
+
}
|
|
10060
|
+
|
|
10061
|
+
public static getComponentList(gvc: GVC, list: { title: string, value: string }[ ],tag:string='基本元件') {
|
|
10062
|
+
return gvc.bindView(() => {
|
|
10063
|
+
let data: any = undefined;
|
|
10064
|
+
const id = gvc.glitter.getUUID();
|
|
10065
|
+
return {
|
|
10066
|
+
bind: id,
|
|
10067
|
+
view: () => {
|
|
10068
|
+
return html`
|
|
10069
|
+
<div class="w-100 p-3 d-flex align-items-center justify-content-center flex-column"
|
|
10070
|
+
style="gap: 10px;">
|
|
10071
|
+
<div class="spinner-border fs-5"></div>
|
|
10072
|
+
<div class="fs-6 fw-500">載入中...</div>
|
|
10073
|
+
</div>`;
|
|
10074
|
+
},
|
|
10075
|
+
divCreate: {
|
|
10076
|
+
style: '', class: `col-12`
|
|
10077
|
+
},
|
|
10078
|
+
onCreate: () => {
|
|
10079
|
+
ApiPageConfig.getPageTemplate({
|
|
10080
|
+
template_from: 'all',
|
|
10081
|
+
page: '0',
|
|
10082
|
+
limit: '3000',
|
|
10083
|
+
type: 'module',
|
|
10084
|
+
tag: tag,
|
|
10085
|
+
search: '',
|
|
10086
|
+
}).then((res) => {
|
|
10087
|
+
data = res;
|
|
10088
|
+
if (document.querySelector(`[gvc-id='${gvc.id(id)}']`)) {
|
|
10089
|
+
(document.querySelector(`[gvc-id='${gvc.id(id)}']`) as any).outerHTML = (() => {
|
|
10090
|
+
return list.map((d1) => {
|
|
10091
|
+
return data.response.result.data
|
|
10092
|
+
.concat(
|
|
10093
|
+
(() => {
|
|
10094
|
+
if (d1.value === 'container') {
|
|
10095
|
+
return [
|
|
10096
|
+
{
|
|
10097
|
+
template_config: {
|
|
10098
|
+
image: [
|
|
10099
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/Screenshot 2024-08-12 at 2.11.09 PM.jpg',
|
|
10100
|
+
],
|
|
10101
|
+
tag: [],
|
|
10102
|
+
name: '網格容器',
|
|
10103
|
+
},
|
|
10104
|
+
type: '容器',
|
|
10105
|
+
name: '網格容器',
|
|
10106
|
+
},
|
|
10107
|
+
{
|
|
10108
|
+
template_config: {
|
|
10109
|
+
image: [
|
|
10110
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_Screenshot2024-08-16at5.04.35 PM.jpg',
|
|
10111
|
+
],
|
|
10112
|
+
tag: [],
|
|
10113
|
+
name: '垂直排版',
|
|
10114
|
+
},
|
|
10115
|
+
type: '容器',
|
|
10116
|
+
name: '垂直排版',
|
|
10117
|
+
},
|
|
10118
|
+
{
|
|
10119
|
+
template_config: {
|
|
10120
|
+
image: [
|
|
10121
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/234285319/size1440_s*px$_sbs8sfs9s0s2ses5_Screenshot2024-08-20at6.19.57 PM.jpg',
|
|
10122
|
+
],
|
|
10123
|
+
tag: [],
|
|
10124
|
+
name: '比例佈局',
|
|
10125
|
+
},
|
|
10126
|
+
type: '容器',
|
|
10127
|
+
name: '比例佈局',
|
|
10128
|
+
},
|
|
10129
|
+
];
|
|
10130
|
+
} else {
|
|
10131
|
+
return [];
|
|
10132
|
+
}
|
|
10133
|
+
})()
|
|
10134
|
+
)
|
|
10135
|
+
.filter((dd: any) => {
|
|
10136
|
+
if (d1.value === 'basic') {
|
|
10137
|
+
return ((dd.template_config.tag ?? []).find((dd: any) => {
|
|
10138
|
+
return dd === '基本元件';
|
|
10139
|
+
})) && (dd.template_config.tag ?? []).find((dd: any) => {
|
|
10140
|
+
return dd === '設計元件';
|
|
10141
|
+
});
|
|
10142
|
+
} else if (d1.value === 'layout') {
|
|
10143
|
+
return !(dd.template_config.tag ?? []).find((dd: any) => {
|
|
10144
|
+
return dd === '基本元件' || dd === '商品元件';
|
|
10145
|
+
});
|
|
10146
|
+
} else if (d1.value === 'product_show') {
|
|
10147
|
+
return (dd.template_config.tag ?? []).find((dd: any) => {
|
|
10148
|
+
return dd === '商品元件';
|
|
10149
|
+
});
|
|
10150
|
+
} else if (d1.value === 'container') {
|
|
10151
|
+
return dd.type === '容器';
|
|
10152
|
+
} else if (d1.value === 'layout') {
|
|
10153
|
+
return (!((dd.template_config.tag ?? []).find((dd: any) => {
|
|
10154
|
+
return dd === '基本元件';
|
|
10155
|
+
}))) && (dd.template_config.tag ?? []).find((dd: any) => {
|
|
10156
|
+
return dd === '設計元件';
|
|
10157
|
+
})
|
|
10158
|
+
}
|
|
10159
|
+
}).map((dd: any) => {
|
|
10160
|
+
console.log(dd)
|
|
10161
|
+
return `<div class="col-6 mb-3 ">
|
|
10162
|
+
<div class="d-flex flex-column justify-content-center w-100"
|
|
10163
|
+
style="gap:5px;cursor:pointer;">
|
|
10164
|
+
<div class="card w-100 position-relative rounded hoverHidden rounded-3"
|
|
10165
|
+
style="padding-bottom: 58%;overflow: hidden;">
|
|
10166
|
+
<div class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center"
|
|
10167
|
+
style="overflow: hidden;">
|
|
10168
|
+
<img class="w-100 "
|
|
10169
|
+
src="${dd.template_config.image[0] || 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}">
|
|
10170
|
+
</div>
|
|
10071
10171
|
|
|
10172
|
+
<div class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
10173
|
+
style="background: rgba(0,0,0,0.5);gap:5px;">
|
|
10174
|
+
<button class="btn btn-primary-c d-flex align-items-center"
|
|
10175
|
+
style="height: 28px;width: 75px;gap:5px;" onclick="${gvc.event(() => {
|
|
10176
|
+
((window as any).glitterInitialHelper).getPageData({
|
|
10177
|
+
tag: dd.tag,
|
|
10178
|
+
appName: dd.appName
|
|
10179
|
+
}, (d3: any) => {
|
|
10180
|
+
|
|
10181
|
+
gvc.glitter.share.addComponent({
|
|
10182
|
+
id: gvc.glitter.getUUID(),
|
|
10183
|
+
js: './official_view_component/official.js',
|
|
10184
|
+
css: {
|
|
10185
|
+
class: {},
|
|
10186
|
+
style: {},
|
|
10187
|
+
},
|
|
10188
|
+
data: {
|
|
10189
|
+
refer_app: dd.appName,
|
|
10190
|
+
tag: dd.tag,
|
|
10191
|
+
list: [],
|
|
10192
|
+
carryData: {},
|
|
10193
|
+
refer_form_data: d3.response.result[0].page_config.formData
|
|
10194
|
+
},
|
|
10195
|
+
type: 'component',
|
|
10196
|
+
class: 'w-100',
|
|
10197
|
+
index: 0,
|
|
10198
|
+
label: dd.template_config.name,
|
|
10199
|
+
style: '',
|
|
10200
|
+
bundle: {},
|
|
10201
|
+
global: [],
|
|
10202
|
+
toggle: false,
|
|
10203
|
+
stylist: [],
|
|
10204
|
+
dataType: 'static',
|
|
10205
|
+
style_from: 'code',
|
|
10206
|
+
classDataType: 'static',
|
|
10207
|
+
preloadEvenet: {},
|
|
10208
|
+
share: {},
|
|
10209
|
+
});
|
|
10210
|
+
gvc.glitter.closeDiaLog();
|
|
10211
|
+
})
|
|
10212
|
+
})}">
|
|
10213
|
+
<i class="fa-regular fa-circle-plus " aria-hidden="true" ></i>新增
|
|
10214
|
+
</button>
|
|
10215
|
+
</div>
|
|
10216
|
+
</div>
|
|
10217
|
+
<h3 class="fs-6 mb-0">
|
|
10218
|
+
${dd.template_config.name}</h3>
|
|
10219
|
+
<div class="d-flex flex-wrap">
|
|
10220
|
+
|
|
10221
|
+
|
|
10222
|
+
</div>
|
|
10223
|
+
|
|
10224
|
+
</div>
|
|
10225
|
+
</div>`
|
|
10226
|
+
}).join('');
|
|
10227
|
+
})
|
|
10228
|
+
.join('')
|
|
10229
|
+
})()
|
|
10230
|
+
}
|
|
10231
|
+
});
|
|
10232
|
+
}
|
|
10233
|
+
};
|
|
10234
|
+
})
|
|
10072
10235
|
}
|
|
10073
10236
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-protect-data.js","sourceRoot":"","sources":["filter-protect-data.ts"],"names":[],"mappings":";;;AAAA,MAAa,iBAAiB;IACnB,MAAM,CAAC,MAAM,CAAC,GAAU,EAAC,IAAQ;QACpC,IAAG,IAAI,EAAC,CAAC;YACL,QAAQ,GAAG,EAAE,CAAC;gBACV,KAAK,oBAAoB;oBACrB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,IAAI,CAAC,eAAe,CAAC,GAAC,SAAS,CAAA;oBAC/B,MAAK;gBACT,KAAK,kBAAkB;oBACnB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,MAAK;gBACT,KAAK,sBAAsB;oBACvB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,MAAK;gBACT,KAAK,qBAAqB;oBACtB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,IAAI,CAAC,SAAS,CAAC,GAAC,SAAS,CAAA;oBACzB,IAAI,CAAC,WAAW,CAAC,GAAC,SAAS,CAAA;oBAC3B,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,MAAK;YACb,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAA;IACf,CAAC;CACJ;
|
|
1
|
+
{"version":3,"file":"filter-protect-data.js","sourceRoot":"","sources":["filter-protect-data.ts"],"names":[],"mappings":";;;AAAA,MAAa,iBAAiB;IACnB,MAAM,CAAC,MAAM,CAAC,GAAU,EAAC,IAAQ;QACpC,IAAG,IAAI,EAAC,CAAC;YACL,QAAQ,GAAG,EAAE,CAAC;gBACV,KAAK,oBAAoB;oBACrB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,IAAI,CAAC,eAAe,CAAC,GAAC,SAAS,CAAA;oBAC/B,MAAK;gBACT,KAAK,kBAAkB;oBACnB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,IAAI,CAAC,YAAY,CAAC,GAAC,SAAS,CAAA;oBAC5B,IAAI,CAAC,SAAS,CAAC,GAAC,SAAS,CAAA;oBACzB,MAAK;gBACT,KAAK,sBAAsB;oBACvB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,MAAK;gBACT,KAAK,qBAAqB;oBACtB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,IAAI,CAAC,SAAS,CAAC,GAAC,SAAS,CAAA;oBACzB,IAAI,CAAC,WAAW,CAAC,GAAC,SAAS,CAAA;oBAC3B,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,IAAI,CAAC,QAAQ,CAAC,GAAC,SAAS,CAAA;oBACxB,MAAK;YACb,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAA;IACf,CAAC;CACJ;AA3BD,8CA2BC"}
|