ts-glitter 13.4.7 → 13.4.8
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/backend-manager/bg-blog.js +466 -413
- package/lowcode/backend-manager/bg-blog.ts +1298 -1244
- package/lowcode/form-view/editor/array-items.js +1 -1
- package/lowcode/form-view/editor/array-items.ts +1 -1
- package/lowcode/form-view/editor/color-selector.ts +1 -1
- package/lowcode/glitterBundle/Glitter.js +9 -2
- package/lowcode/glitterBundle/Glitter.ts +9 -2
- package/lowcode/jspage/editor.js +15 -9
- package/lowcode/jspage/editor.ts +16 -10
- package/lowcode/jspage/main.js +52 -24
- package/lowcode/jspage/main.ts +91 -50
- package/lowcode/official_view_component/official/form.js +110 -78
- package/lowcode/official_view_component/official/form.ts +238 -192
- package/package.json +1 -1
- package/src/api-public/controllers/article.js +3 -0
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/article.ts +3 -0
|
@@ -19,7 +19,8 @@ import { BgProduct } from './bg-product.js';
|
|
|
19
19
|
import { CheckInput } from '../modules/checkInput.js';
|
|
20
20
|
const html = String.raw;
|
|
21
21
|
export class BgBlog {
|
|
22
|
-
static contentManager(gvc, type = 'list', callback = () => {
|
|
22
|
+
static contentManager(gvc, type = 'list', callback = () => {
|
|
23
|
+
}, is_page, widget, page_tab) {
|
|
23
24
|
const html = String.raw;
|
|
24
25
|
const glitter = gvc.glitter;
|
|
25
26
|
const vm = {
|
|
@@ -43,15 +44,16 @@ export class BgBlog {
|
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
key: '發布時間',
|
|
46
|
-
value: html `<span
|
|
47
|
+
value: html `<span
|
|
48
|
+
class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
|
|
47
49
|
},
|
|
48
50
|
{
|
|
49
51
|
key: '預覽',
|
|
50
52
|
value: html `
|
|
51
53
|
<div
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
|
|
55
|
+
style="height:28px;width:28px;border-radius:5px;cursor:pointer;color:#151515;"
|
|
56
|
+
onclick="${gvc.event((e, event) => {
|
|
55
57
|
const href = (() => {
|
|
56
58
|
return `https://${window.parent.glitter.share.editorViewModel.domain}/${is_page
|
|
57
59
|
? (() => {
|
|
@@ -77,159 +79,175 @@ export class BgBlog {
|
|
|
77
79
|
];
|
|
78
80
|
});
|
|
79
81
|
}
|
|
82
|
+
if (window.parent.glitter.getUrlParameter('page-id')) {
|
|
83
|
+
Article.get({
|
|
84
|
+
page: 0,
|
|
85
|
+
limit: 1,
|
|
86
|
+
id: window.parent.glitter.getUrlParameter('page-id')
|
|
87
|
+
}).then((data) => __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
vm.data = data.response.data[0];
|
|
89
|
+
vm.type = 'replace';
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
80
92
|
return gvc.bindView(() => {
|
|
81
93
|
const id = glitter.getUUID();
|
|
82
94
|
return {
|
|
83
95
|
bind: id,
|
|
84
96
|
dataList: [{ obj: vm, key: 'type' }],
|
|
85
97
|
view: () => {
|
|
86
|
-
if (vm.type
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
98
|
+
if (window.parent.glitter.getUrlParameter('page-id') && vm.type !== 'replace') {
|
|
99
|
+
return ``;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
if (vm.type === 'list') {
|
|
103
|
+
return BgWidget.container(html `
|
|
104
|
+
<div class="d-flex w-100 align-items-center mb-3 ${type === 'select' ? `d-none` : ``}">
|
|
105
|
+
<div class="d-flex flex-column" style="gap:5px;">
|
|
106
|
+
${BgWidget.title(is_page
|
|
107
|
+
? (() => {
|
|
108
|
+
switch (page_tab) {
|
|
109
|
+
case 'hidden':
|
|
110
|
+
return '隱形賣場';
|
|
111
|
+
case 'page':
|
|
112
|
+
return '自訂頁面';
|
|
113
|
+
case 'shopping':
|
|
114
|
+
return '一頁商店';
|
|
115
|
+
}
|
|
116
|
+
})()
|
|
117
|
+
: '網誌文章')}
|
|
118
|
+
${BgWidget.grayNote(is_page
|
|
119
|
+
? (() => {
|
|
120
|
+
switch (page_tab) {
|
|
121
|
+
case 'hidden':
|
|
122
|
+
return '隱形賣場僅能透過連結分享,無法顯示於 Google 搜尋列表';
|
|
123
|
+
case 'page':
|
|
124
|
+
return '打造自訂頁面,顯示品牌官網的獨特內容';
|
|
125
|
+
case 'shopping':
|
|
126
|
+
return '放大特定商品重點,打造專屬爆品產品,一頁下單快速購物';
|
|
127
|
+
}
|
|
128
|
+
})()
|
|
129
|
+
: '快速分享商店最新資訊的好功能')}
|
|
130
|
+
</div>
|
|
131
|
+
<div class="flex-fill"></div>
|
|
132
|
+
<div style="display: flex; gap: 12px;">
|
|
133
|
+
${is_page
|
|
134
|
+
? ''
|
|
135
|
+
: BgWidget.grayButton('網誌分類', gvc.event(() => {
|
|
136
|
+
vm.type = 'collection';
|
|
137
|
+
gvc.notifyDataChange(id);
|
|
138
|
+
}))}
|
|
139
|
+
${BgWidget.darkButton(`新增${is_page ? `頁面` : `網誌`}`, gvc.event(() => {
|
|
140
|
+
vm.data = { content: {} };
|
|
141
|
+
vm.type = 'add';
|
|
122
142
|
}))}
|
|
123
|
-
|
|
124
|
-
vm.data = { content: {} };
|
|
125
|
-
vm.type = 'add';
|
|
126
|
-
}))}
|
|
143
|
+
</div>
|
|
127
144
|
</div>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
145
|
+
${BgWidget.mainCard([
|
|
146
|
+
BgWidget.searchPlace(gvc.event((e) => {
|
|
147
|
+
vm.query = e.value;
|
|
148
|
+
gvc.notifyDataChange(id);
|
|
149
|
+
}), vm.query || '', '搜尋所有文章'),
|
|
150
|
+
BgWidget.tableV3({
|
|
151
|
+
gvc: gvc,
|
|
152
|
+
getData: (vd) => {
|
|
153
|
+
vmi = vd;
|
|
154
|
+
const limit = 20;
|
|
155
|
+
Article.get({
|
|
156
|
+
page: vmi.page - 1,
|
|
157
|
+
limit: limit,
|
|
158
|
+
search: vm.query || undefined,
|
|
159
|
+
for_index: is_page ? `false` : `true`,
|
|
160
|
+
status: '0,1',
|
|
161
|
+
page_type: page_tab,
|
|
162
|
+
}).then((data) => {
|
|
163
|
+
vm.dataList = data.response.data;
|
|
164
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
165
|
+
vmi.originalData = vm.dataList;
|
|
166
|
+
vmi.tableData = getDatalist();
|
|
167
|
+
vmi.loading = false;
|
|
168
|
+
vmi.callback();
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
rowClick: (data, index) => {
|
|
172
|
+
if (type === 'select') {
|
|
173
|
+
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
174
|
+
vmi.data = getDatalist();
|
|
175
|
+
vmi.callback();
|
|
176
|
+
callback(vm.dataList.filter((dd) => {
|
|
177
|
+
return dd.checked;
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
vm.data = vm.dataList[index];
|
|
182
|
+
vm.type = 'replace';
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
filter: [
|
|
186
|
+
{
|
|
187
|
+
name: '批量移除',
|
|
188
|
+
event: (checkedData) => {
|
|
189
|
+
const dialog = new ShareDialog(glitter);
|
|
190
|
+
dialog.checkYesOrNot({
|
|
191
|
+
text: '是否確認刪除所選項目?',
|
|
192
|
+
callback: (response) => {
|
|
193
|
+
if (response) {
|
|
194
|
+
dialog.dataLoading({ visible: true });
|
|
195
|
+
Article.deleteV2({
|
|
196
|
+
id: checkedData
|
|
197
|
+
.map((dd) => {
|
|
198
|
+
return dd.id;
|
|
199
|
+
})
|
|
200
|
+
.join(`,`),
|
|
201
|
+
}).then((res) => {
|
|
202
|
+
dialog.dataLoading({ visible: false });
|
|
203
|
+
if (res.result) {
|
|
204
|
+
vm.dataList = undefined;
|
|
205
|
+
gvc.notifyDataChange(id);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
}),
|
|
218
|
+
].join(''))}
|
|
219
|
+
`, BgWidget.getContainerWidth());
|
|
220
|
+
}
|
|
221
|
+
else if (vm.type == 'replace') {
|
|
222
|
+
window.parent.glitter.setUrlParameter('page-id', vm.data.id);
|
|
223
|
+
return editor({
|
|
135
224
|
gvc: gvc,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
vmi.tableData = getDatalist();
|
|
151
|
-
vmi.loading = false;
|
|
152
|
-
vmi.callback();
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
rowClick: (data, index) => {
|
|
156
|
-
if (type === 'select') {
|
|
157
|
-
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
158
|
-
vmi.data = getDatalist();
|
|
159
|
-
vmi.callback();
|
|
160
|
-
callback(vm.dataList.filter((dd) => {
|
|
161
|
-
return dd.checked;
|
|
162
|
-
}));
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
vm.data = vm.dataList[index];
|
|
166
|
-
vm.type = 'replace';
|
|
167
|
-
}
|
|
225
|
+
vm: vm,
|
|
226
|
+
is_page: is_page,
|
|
227
|
+
widget: widget,
|
|
228
|
+
page_tab: page_tab,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
else if (vm.type == 'collection') {
|
|
232
|
+
return BgWidget.container(setCollection({
|
|
233
|
+
gvc: gvc,
|
|
234
|
+
widget: widget,
|
|
235
|
+
key: 'blog_collection',
|
|
236
|
+
goBack: () => {
|
|
237
|
+
vm.type = 'list';
|
|
238
|
+
gvc.notifyDataChange(id);
|
|
168
239
|
},
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
id: checkedData
|
|
181
|
-
.map((dd) => {
|
|
182
|
-
return dd.id;
|
|
183
|
-
})
|
|
184
|
-
.join(`,`),
|
|
185
|
-
}).then((res) => {
|
|
186
|
-
dialog.dataLoading({ visible: false });
|
|
187
|
-
if (res.result) {
|
|
188
|
-
vm.dataList = undefined;
|
|
189
|
-
gvc.notifyDataChange(id);
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
dialog.errorMessage({ text: '刪除失敗' });
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
});
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
],
|
|
201
|
-
}),
|
|
202
|
-
].join(''))}
|
|
203
|
-
`, BgWidget.getContainerWidth());
|
|
204
|
-
}
|
|
205
|
-
else if (vm.type == 'replace') {
|
|
206
|
-
return editor({
|
|
207
|
-
gvc: gvc,
|
|
208
|
-
vm: vm,
|
|
209
|
-
is_page: is_page,
|
|
210
|
-
widget: widget,
|
|
211
|
-
page_tab: page_tab,
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
else if (vm.type == 'collection') {
|
|
215
|
-
return BgWidget.container(setCollection({
|
|
216
|
-
gvc: gvc,
|
|
217
|
-
widget: widget,
|
|
218
|
-
key: 'blog_collection',
|
|
219
|
-
goBack: () => {
|
|
220
|
-
vm.type = 'list';
|
|
221
|
-
gvc.notifyDataChange(id);
|
|
222
|
-
},
|
|
223
|
-
}), BgWidget.getContainerWidth());
|
|
224
|
-
}
|
|
225
|
-
else {
|
|
226
|
-
return editor({
|
|
227
|
-
gvc: gvc,
|
|
228
|
-
vm: vm,
|
|
229
|
-
is_page: is_page,
|
|
230
|
-
widget: widget,
|
|
231
|
-
page_tab: page_tab,
|
|
232
|
-
});
|
|
240
|
+
}), BgWidget.getContainerWidth());
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
return editor({
|
|
244
|
+
gvc: gvc,
|
|
245
|
+
vm: vm,
|
|
246
|
+
is_page: is_page,
|
|
247
|
+
widget: widget,
|
|
248
|
+
page_tab: page_tab,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
233
251
|
}
|
|
234
252
|
},
|
|
235
253
|
};
|
|
@@ -248,14 +266,16 @@ export class BgBlog {
|
|
|
248
266
|
}
|
|
249
267
|
`);
|
|
250
268
|
const containerID = gvc.glitter.getUUID();
|
|
251
|
-
return html
|
|
269
|
+
return html `
|
|
270
|
+
<div class="d-flex align-items-center">
|
|
252
271
|
${BgWidget.goBack(gvc.event(() => {
|
|
253
272
|
callback(undefined);
|
|
254
273
|
}))}
|
|
255
274
|
<div>${[BgWidget.title('選擇模板'), BgWidget.grayNote('請選擇一個符合您需求的模板')].join('')}</div>
|
|
256
275
|
</div>
|
|
257
276
|
${[
|
|
258
|
-
html
|
|
277
|
+
html `
|
|
278
|
+
<div class="my-3"></div>`,
|
|
259
279
|
BgWidget.card(gvc.bindView(() => {
|
|
260
280
|
return {
|
|
261
281
|
bind: containerID,
|
|
@@ -380,26 +400,28 @@ export class BgBlog {
|
|
|
380
400
|
if (data.response.result.data.length === 0) {
|
|
381
401
|
if (!vm.search) {
|
|
382
402
|
return html `
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
403
|
+
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
404
|
+
style="width:700px;gap:10px;">
|
|
405
|
+
<img src="./img/box-open-solid.svg"/>
|
|
406
|
+
<span class="color39 text-center">尚未自製任何模塊<br/>請前往開發者模式自製專屬模塊</span>
|
|
407
|
+
</div>
|
|
408
|
+
`;
|
|
388
409
|
}
|
|
389
410
|
else {
|
|
390
411
|
return html `
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
412
|
+
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
413
|
+
style="width:700px;gap:10px;">
|
|
414
|
+
<img src="./img/box-open-solid.svg"/>
|
|
415
|
+
<span class="color39 text-center">查無相關模塊</span>
|
|
416
|
+
</div>
|
|
417
|
+
`;
|
|
396
418
|
}
|
|
397
419
|
}
|
|
398
420
|
else {
|
|
399
421
|
return html `
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
422
|
+
<div class="w-100" style="overflow-y: auto;">
|
|
423
|
+
<div class="row m-0 pt-2 w-100">
|
|
424
|
+
${data.response.result.data
|
|
403
425
|
.sort((a, b) => {
|
|
404
426
|
if (a.tag === 'empty' || b.tag === 'empty') {
|
|
405
427
|
return b.tag === 'empty' ? 1 : -1;
|
|
@@ -410,30 +432,32 @@ export class BgBlog {
|
|
|
410
432
|
})
|
|
411
433
|
.map((dd, index) => {
|
|
412
434
|
var _a;
|
|
413
|
-
return html
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
435
|
+
return html `
|
|
436
|
+
<div class="col-6 col-sm-3 mb-3 rounded-3">
|
|
437
|
+
<div class="d-flex flex-column justify-content-center w-100 "
|
|
438
|
+
style="gap:5px;cursor:pointer;">
|
|
439
|
+
<div
|
|
440
|
+
class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
|
|
441
|
+
style="padding-bottom: ${(800 / 600) * 100}%;"
|
|
442
|
+
>
|
|
443
|
+
<div
|
|
444
|
+
class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
|
|
445
|
+
style="overflow: hidden;"
|
|
446
|
+
>
|
|
447
|
+
<img
|
|
448
|
+
class="w-100 "
|
|
449
|
+
src="${(_a = dd.template_config.image[0]) !== null && _a !== void 0 ? _a : 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
450
|
+
/>
|
|
451
|
+
</div>
|
|
428
452
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
453
|
+
<div
|
|
454
|
+
class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
455
|
+
style="background: rgba(0,0,0,0.5);gap:5px;"
|
|
456
|
+
>
|
|
457
|
+
<button
|
|
458
|
+
class="btn btn-secondary d-flex align-items-center "
|
|
459
|
+
style="height: 28px;width: 75px;gap:5px;"
|
|
460
|
+
onclick="${gvc.event(() => {
|
|
437
461
|
if (dd.tag === 'empty') {
|
|
438
462
|
const a = [];
|
|
439
463
|
a.name = '空白頁面';
|
|
@@ -455,36 +479,38 @@ export class BgBlog {
|
|
|
455
479
|
}
|
|
456
480
|
}
|
|
457
481
|
})}"
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
482
|
+
>
|
|
483
|
+
選擇
|
|
484
|
+
</button>
|
|
485
|
+
</div>
|
|
486
|
+
</div>
|
|
487
|
+
<h3 class="fs-6 mb-0 d-flex justify-content-between align-items-center fw-500 mt-1">
|
|
488
|
+
${dd.template_config.name}
|
|
489
|
+
<i
|
|
490
|
+
class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ``}"
|
|
491
|
+
style="cursor:pointer;"
|
|
492
|
+
onclick="${gvc.event(() => {
|
|
469
493
|
window.parent.glitter.openNewTab(`${gvc.glitter.root_path}pages/${dd.tag}?appName=${dd.appName}`);
|
|
470
494
|
})}"
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
495
|
+
></i>
|
|
496
|
+
</h3>
|
|
497
|
+
</div>
|
|
498
|
+
</div>`;
|
|
475
499
|
})
|
|
476
500
|
.join('')}
|
|
501
|
+
</div>
|
|
477
502
|
</div>
|
|
478
|
-
|
|
479
|
-
`;
|
|
503
|
+
`;
|
|
480
504
|
}
|
|
481
505
|
})();
|
|
482
506
|
}
|
|
483
507
|
else {
|
|
484
|
-
return html `
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
508
|
+
return html `
|
|
509
|
+
<div class="w-100 p-3 d-flex align-items-center justify-content-center flex-column"
|
|
510
|
+
style="gap: 10px;">
|
|
511
|
+
<div class="spinner-border fs-5"></div>
|
|
512
|
+
<div class="fs-6 fw-500">載入中...</div>
|
|
513
|
+
</div>`;
|
|
488
514
|
}
|
|
489
515
|
},
|
|
490
516
|
divCreate: {
|
|
@@ -564,9 +590,24 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
564
590
|
}, 100);
|
|
565
591
|
return ``;
|
|
566
592
|
}
|
|
593
|
+
const domainPrefix = `${cf.is_page
|
|
594
|
+
? (() => {
|
|
595
|
+
switch (page_tab) {
|
|
596
|
+
case 'shopping':
|
|
597
|
+
return 'shop';
|
|
598
|
+
case 'hidden':
|
|
599
|
+
return 'hidden';
|
|
600
|
+
case 'page':
|
|
601
|
+
return 'pages';
|
|
602
|
+
default:
|
|
603
|
+
return '';
|
|
604
|
+
}
|
|
605
|
+
})()
|
|
606
|
+
: 'blogs'}`;
|
|
567
607
|
return html `
|
|
568
608
|
<div class="d-flex w-100 align-items-center mb-3 ">
|
|
569
609
|
${BgWidget.goBack(gvc.event(() => {
|
|
610
|
+
window.parent.glitter.setUrlParameter('page-id', undefined);
|
|
570
611
|
vm.type = 'list';
|
|
571
612
|
}))}
|
|
572
613
|
${BgWidget.title(cf.is_page
|
|
@@ -589,62 +630,17 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
589
630
|
}))}
|
|
590
631
|
<div class="mx-1"></div>
|
|
591
632
|
${BgWidget.grayButton('前往設計', gvc.event(() => {
|
|
592
|
-
|
|
593
|
-
window.parent.glitter.
|
|
594
|
-
return gvc.bindView(() => {
|
|
595
|
-
const id = gvc.glitter.getUUID();
|
|
596
|
-
return {
|
|
597
|
-
bind: id,
|
|
598
|
-
view: () => {
|
|
599
|
-
return html ` <iframe
|
|
600
|
-
class="rounded-3"
|
|
601
|
-
id="editor_dialog"
|
|
602
|
-
src="${(() => {
|
|
603
|
-
const url = new URL(window.parent.location.href);
|
|
604
|
-
url.searchParams.set('function', 'user-editor');
|
|
605
|
-
return url.href;
|
|
606
|
-
})()}"
|
|
607
|
-
></iframe>`;
|
|
608
|
-
},
|
|
609
|
-
divCreate: {
|
|
610
|
-
class: `vw-100 vh-100 p-2`,
|
|
611
|
-
style: `background: rgba(0,0,0,0.5);`,
|
|
612
|
-
},
|
|
613
|
-
onCreate: () => {
|
|
614
|
-
const interval = setInterval(() => {
|
|
615
|
-
const iframe = window.parent.document.querySelector('#editor_dialog');
|
|
616
|
-
if (iframe.contentWindow.glitter) {
|
|
617
|
-
iframe.contentWindow.glitter.share.editor_vm = {
|
|
618
|
-
close: () => {
|
|
619
|
-
gvc.closeDialog();
|
|
620
|
-
},
|
|
621
|
-
callback: (cf) => {
|
|
622
|
-
vm.data.content.config = cf.config;
|
|
623
|
-
saveData(gvc, cf, vm, cVm, true);
|
|
624
|
-
},
|
|
625
|
-
page_data: {
|
|
626
|
-
config: JSON.parse(JSON.stringify(vm.data.content.config || [])),
|
|
627
|
-
page_config: {},
|
|
628
|
-
name: vm.data.content.name || '尚未設定頁面標題',
|
|
629
|
-
},
|
|
630
|
-
title: vm.data.content.name || '尚未設定頁面標題',
|
|
631
|
-
};
|
|
632
|
-
clearInterval(interval);
|
|
633
|
-
}
|
|
634
|
-
}, 100);
|
|
635
|
-
},
|
|
636
|
-
};
|
|
637
|
-
});
|
|
638
|
-
}, '', {
|
|
639
|
-
dismiss: () => { },
|
|
640
|
-
});
|
|
633
|
+
window.parent.glitter.setUrlParameter('page-id', vm.data.id);
|
|
634
|
+
window.parent.glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
|
|
641
635
|
}))}
|
|
642
636
|
</div>
|
|
643
637
|
</div>
|
|
644
638
|
${BgWidget.container(html `
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
639
|
+
<div class="d-flex justify-content-center p-0 ${document.body.clientWidth < 768 ? 'flex-column' : ''}"
|
|
640
|
+
style="gap: 24px">
|
|
641
|
+
<div class="d-flex flex-column "
|
|
642
|
+
style="gap:10px;${document.body.clientWidth > 768 ? 'width: 73.5%;' : ''}">
|
|
643
|
+
${BgWidget.container(gvc.bindView(() => {
|
|
648
644
|
var _a;
|
|
649
645
|
vm.data.status = (_a = vm.data.status) !== null && _a !== void 0 ? _a : 1;
|
|
650
646
|
const id = gvc.glitter.getUUID();
|
|
@@ -670,13 +666,14 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
670
666
|
: 'blogs'}/`;
|
|
671
667
|
return [
|
|
672
668
|
BgWidget.title('基本設定', 'font-size: 16px;'),
|
|
673
|
-
html `
|
|
674
|
-
|
|
675
|
-
|
|
669
|
+
html `
|
|
670
|
+
<div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
|
|
671
|
+
<div class="tx_normal">網頁啟用</div>
|
|
672
|
+
${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
|
|
676
673
|
vm.data.status = bool ? 1 : 0;
|
|
677
674
|
gvc.notifyDataChange(id);
|
|
678
675
|
})}
|
|
679
|
-
|
|
676
|
+
</div>`,
|
|
680
677
|
BgWidget.editeInput({
|
|
681
678
|
gvc: gvc,
|
|
682
679
|
title: '網頁名稱',
|
|
@@ -686,28 +683,32 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
686
683
|
vm.data.content.name = text;
|
|
687
684
|
},
|
|
688
685
|
}),
|
|
689
|
-
html `
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
686
|
+
html `
|
|
687
|
+
<div>
|
|
688
|
+
<div class="tx_normal fw-normal mb-2">
|
|
689
|
+
自訂網址
|
|
690
|
+
</div>
|
|
691
|
+
<div
|
|
692
|
+
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
693
693
|
.body.clientWidth > 768
|
|
694
694
|
? 'gap: 18px; '
|
|
695
695
|
: 'flex-direction: column; gap: 0px; '}"
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
696
|
+
class="w-100"
|
|
697
|
+
>
|
|
698
|
+
<div class="${document.body.clientWidth > 768 ? `` : `w-100`}"
|
|
699
|
+
style="padding: 9px 18px;background: #EAEAEA ;${document.body.clientWidth > 768 ? `justify-content: center;` : `justify-content: start;`} align-items: center; gap: 5px; display: flex">
|
|
700
|
+
<div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
701
|
+
${prefixURL}
|
|
702
|
+
</div>
|
|
703
|
+
</div>
|
|
704
|
+
<input
|
|
705
|
+
class="flex-fill"
|
|
706
|
+
style="width:100%;border:none;background:none;text-align: start; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word; ${document
|
|
706
707
|
.body.clientWidth > 768
|
|
707
708
|
? ''
|
|
708
709
|
: 'padding: 9px 18px;'}"
|
|
709
|
-
|
|
710
|
-
|
|
710
|
+
value="${vm.data.content.tag || ''}"
|
|
711
|
+
onchange="${gvc.event((e) => {
|
|
711
712
|
let text = e.value;
|
|
712
713
|
if (!CheckInput.isEnglishNumberHyphen(text)) {
|
|
713
714
|
const dialog = new ShareDialog(gvc.glitter);
|
|
@@ -719,10 +720,13 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
719
720
|
gvc.notifyDataChange(id);
|
|
720
721
|
}
|
|
721
722
|
})}"
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
html `
|
|
723
|
+
/>
|
|
724
|
+
</div>
|
|
725
|
+
</div>`,
|
|
726
|
+
html `
|
|
727
|
+
<div class="mt-2 mb-1"><span
|
|
728
|
+
class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + ((_a = vm.data.content.tag) !== null && _a !== void 0 ? _a : ''))}
|
|
729
|
+
</div>`,
|
|
726
730
|
...(() => {
|
|
727
731
|
return [
|
|
728
732
|
BgWidget.editeInput({
|
|
@@ -747,14 +751,19 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
747
751
|
gvc.notifyDataChange(id);
|
|
748
752
|
},
|
|
749
753
|
}),
|
|
750
|
-
html `
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
+
html `
|
|
755
|
+
<div>
|
|
756
|
+
<div class="tx_normal">
|
|
757
|
+
社群分享縮圖
|
|
758
|
+
</div>
|
|
759
|
+
<div class="mt-1 mb-2">
|
|
760
|
+
${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}
|
|
761
|
+
</div>
|
|
762
|
+
${BgWidget.imageSelector(gvc, vm.data.content.seo.image || '', (text) => {
|
|
754
763
|
vm.data.content.seo.image = text;
|
|
755
764
|
gvc.notifyDataChange(id);
|
|
756
765
|
})}
|
|
757
|
-
|
|
766
|
+
</div>`,
|
|
758
767
|
,
|
|
759
768
|
];
|
|
760
769
|
})(),
|
|
@@ -763,7 +772,10 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
763
772
|
if (`${vm.data.content.for_index}` === 'true') {
|
|
764
773
|
return [
|
|
765
774
|
[
|
|
766
|
-
html
|
|
775
|
+
html `
|
|
776
|
+
<div class="tx_normal my-3">
|
|
777
|
+
網誌內文
|
|
778
|
+
</div>`,
|
|
767
779
|
EditorElem.richText({
|
|
768
780
|
gvc: gvc,
|
|
769
781
|
def: (_a = vm.data.content.text) !== null && _a !== void 0 ? _a : '',
|
|
@@ -787,7 +799,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
787
799
|
},
|
|
788
800
|
};
|
|
789
801
|
}), undefined, 'padding: 0 !important; margin: 0 !important; width: 100%;')}
|
|
790
|
-
|
|
802
|
+
${(() => {
|
|
791
803
|
vm.data.content.relative = vm.data.content.relative || 'collection';
|
|
792
804
|
vm.data.content.relative_data = vm.data.content.relative_data || [];
|
|
793
805
|
vm.data.content.with_discount = vm.data.content.with_discount || 'false';
|
|
@@ -800,8 +812,12 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
800
812
|
return [
|
|
801
813
|
BgWidget.mainCard([
|
|
802
814
|
BgWidget.title(html `預設加入購物車
|
|
803
|
-
|
|
804
|
-
|
|
815
|
+
<div class="badge ms-2"
|
|
816
|
+
style="background:#eaeaea;color:#393939;">
|
|
817
|
+
以下設定的商品會自動加入購物車
|
|
818
|
+
</div>`, 'font-size: 16px;'),
|
|
819
|
+
html `
|
|
820
|
+
<div class="my-2"></div>`,
|
|
805
821
|
[
|
|
806
822
|
html `${(() => {
|
|
807
823
|
return gvc.bindView(() => {
|
|
@@ -817,12 +833,16 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
817
833
|
return BgWidget.spinner();
|
|
818
834
|
}
|
|
819
835
|
return html `
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
836
|
+
<div class="d-flex flex-column p-2"
|
|
837
|
+
style="gap: 18px;">
|
|
838
|
+
<div class="d-flex align-items-center gray-bottom-line-18 "
|
|
839
|
+
style="gap: 24px; justify-content: space-between;">
|
|
840
|
+
<div class="form-check-label c_updown_label">
|
|
841
|
+
<div class="tx_normal">
|
|
842
|
+
產品列表
|
|
843
|
+
</div>
|
|
844
|
+
</div>
|
|
845
|
+
${BgWidget.grayButton('搜尋商品', gvc.event(() => {
|
|
826
846
|
BgProduct.variantsSelector({
|
|
827
847
|
gvc: gvc,
|
|
828
848
|
filter_variants: vm.data.content.relative_data.map((dd) => {
|
|
@@ -840,28 +860,37 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
840
860
|
}),
|
|
841
861
|
});
|
|
842
862
|
}), { textStyle: 'font-weight: 400;' })}
|
|
843
|
-
|
|
844
|
-
|
|
863
|
+
</div>
|
|
864
|
+
${subVM.dataList
|
|
845
865
|
.map((opt, index) => {
|
|
846
866
|
return html `
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
867
|
+
<div class="d-flex align-items-center form-check-label c_updown_label gap-3">
|
|
868
|
+
<span class="tx_normal"
|
|
869
|
+
style="min-width: 20px;">${index + 1} .</span>
|
|
870
|
+
${BgWidget.validImageBox({
|
|
871
|
+
gvc: gvc,
|
|
872
|
+
image: opt.image,
|
|
873
|
+
width: 40
|
|
874
|
+
})}
|
|
875
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
|
|
876
|
+
${opt.value}
|
|
877
|
+
${opt.note ? html `
|
|
878
|
+
<div class="tx_gray_12">
|
|
879
|
+
${opt.note}
|
|
880
|
+
</div> ` : ''}
|
|
881
|
+
</div>
|
|
882
|
+
<div class="flex-fill"></div>
|
|
883
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
855
884
|
vm.data.content.relative_data.splice(index, 1);
|
|
856
885
|
subVM.dataList.splice(index, 1);
|
|
857
886
|
gvc.notifyDataChange(subVM.id);
|
|
858
887
|
}), '移除')}
|
|
859
|
-
|
|
860
|
-
|
|
888
|
+
</div>
|
|
889
|
+
`;
|
|
861
890
|
})
|
|
862
891
|
.join('') || `<div class="w-100 d-flex align-content-center justify-content-center">尚未加入任何賣場商品</div>`}
|
|
863
|
-
|
|
864
|
-
|
|
892
|
+
</div>
|
|
893
|
+
`;
|
|
865
894
|
},
|
|
866
895
|
onCreate: () => {
|
|
867
896
|
if (subVM.loading) {
|
|
@@ -915,8 +944,8 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
915
944
|
};
|
|
916
945
|
});
|
|
917
946
|
})()}
|
|
918
|
-
|
|
919
|
-
|
|
947
|
+
</div>
|
|
948
|
+
${BgWidget.container(BgWidget.mainCard(gvc.bindView(() => {
|
|
920
949
|
var _a;
|
|
921
950
|
console.log(`vm.data.content.template=>`, vm.data.content.template);
|
|
922
951
|
const id = gvc.glitter.getUUID();
|
|
@@ -977,9 +1006,11 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
977
1006
|
}
|
|
978
1007
|
vm.data.content.collection = (_a = vm.data.content.collection) !== null && _a !== void 0 ? _a : [];
|
|
979
1008
|
return [
|
|
980
|
-
html `
|
|
981
|
-
|
|
982
|
-
|
|
1009
|
+
html `
|
|
1010
|
+
<div class="d-flex align-items-center my-3"
|
|
1011
|
+
style="gap: 10px;">
|
|
1012
|
+
${EditorElem.h3('預覽圖')}
|
|
1013
|
+
${BgWidget.grayButton('添加檔案', gvc.event(() => {
|
|
983
1014
|
EditorElem.uploadFileFunction({
|
|
984
1015
|
gvc: gvc,
|
|
985
1016
|
callback: (text) => {
|
|
@@ -989,7 +1020,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
989
1020
|
type: `image/*, video/*`,
|
|
990
1021
|
});
|
|
991
1022
|
}))}
|
|
992
|
-
|
|
1023
|
+
</div>`,
|
|
993
1024
|
EditorElem.flexMediaManager({
|
|
994
1025
|
gvc: gvc,
|
|
995
1026
|
data: vm.data.content.preview_image ? [vm.data.content.preview_image] : [],
|
|
@@ -999,8 +1030,8 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
999
1030
|
return ``;
|
|
1000
1031
|
}
|
|
1001
1032
|
return html `
|
|
1002
|
-
|
|
1003
|
-
|
|
1033
|
+
${EditorElem.h3('文章分類')}
|
|
1034
|
+
${gvc.bindView(() => {
|
|
1004
1035
|
const tagID = gvc.glitter.getUUID();
|
|
1005
1036
|
let listTag = [];
|
|
1006
1037
|
ApiUser.getPublicConfig('blog_collection', 'manager').then((data) => {
|
|
@@ -1024,7 +1055,10 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1024
1055
|
view: () => {
|
|
1025
1056
|
return listTag
|
|
1026
1057
|
.map((dd) => {
|
|
1027
|
-
return html `
|
|
1058
|
+
return html `
|
|
1059
|
+
<div class="badge bg_orange mt-2 me-2 fs-sm">
|
|
1060
|
+
${dd}
|
|
1061
|
+
</div>`;
|
|
1028
1062
|
})
|
|
1029
1063
|
.join('');
|
|
1030
1064
|
},
|
|
@@ -1033,17 +1067,18 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1033
1067
|
},
|
|
1034
1068
|
};
|
|
1035
1069
|
})}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1070
|
+
<div
|
|
1071
|
+
class="cursor_pointer bt_c39 ms-2 p-1 mt-3"
|
|
1072
|
+
onclick="${gvc.event(() => {
|
|
1039
1073
|
cVm.type = 'collection';
|
|
1040
1074
|
gvc.notifyDataChange(cVm.id);
|
|
1041
1075
|
})}"
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1076
|
+
>
|
|
1077
|
+
<i class="fa-solid fa-plus me-2"
|
|
1078
|
+
aria-hidden="true"></i>
|
|
1079
|
+
添加與編輯分類
|
|
1080
|
+
</div>
|
|
1081
|
+
`;
|
|
1047
1082
|
})(),
|
|
1048
1083
|
].join(`<div class="my-2"></div>`);
|
|
1049
1084
|
},
|
|
@@ -1054,8 +1089,8 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1054
1089
|
},
|
|
1055
1090
|
};
|
|
1056
1091
|
})), undefined, 'padding: 0 !important; margin: 0 !important; width: 26.5%;')}
|
|
1057
|
-
|
|
1058
|
-
|
|
1092
|
+
</div>
|
|
1093
|
+
`, undefined, 'padding: 0 !important;')}
|
|
1059
1094
|
${BgWidget.mbContainer(240)}
|
|
1060
1095
|
<div class="update-bar-container">
|
|
1061
1096
|
${vm.data.id
|
|
@@ -1329,35 +1364,36 @@ function setCollection(cf) {
|
|
|
1329
1364
|
return {
|
|
1330
1365
|
bind: vm.id,
|
|
1331
1366
|
view: () => {
|
|
1332
|
-
return html `
|
|
1367
|
+
return html `
|
|
1368
|
+
<div class="d-flex align-items-center my-3">
|
|
1333
1369
|
${BgWidget.goBack(cf.gvc.event(() => {
|
|
1334
1370
|
cf.goBack();
|
|
1335
1371
|
}))}${BgWidget.title('分類設定')}
|
|
1336
1372
|
</div>
|
|
1337
1373
|
<div
|
|
1338
|
-
|
|
1374
|
+
style="max-width:100%;width: 856px; padding: 20px; background: white; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.08); border-radius: 10px; overflow: hidden; justify-content: center; align-items: center; display: inline-flex"
|
|
1339
1375
|
>
|
|
1340
1376
|
<div style="width: 100%; position: relative">
|
|
1341
1377
|
<div style="width: 100%; left: 0px; top: 0px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 20px; display: inline-flex">
|
|
1342
1378
|
<div
|
|
1343
|
-
|
|
1379
|
+
class="w-100 ${getSelectCount({
|
|
1344
1380
|
items: vm.link,
|
|
1345
1381
|
}) > 0
|
|
1346
1382
|
? ``
|
|
1347
1383
|
: `d-none`}"
|
|
1348
|
-
|
|
1384
|
+
style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
|
|
1349
1385
|
>
|
|
1350
1386
|
<div style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
|
|
1351
|
-
|
|
1387
|
+
已選取${getSelectCount({
|
|
1352
1388
|
items: vm.link,
|
|
1353
1389
|
})}項
|
|
1354
1390
|
</div>
|
|
1355
1391
|
<div
|
|
1356
|
-
|
|
1392
|
+
style="cursor:pointer;padding: 4px 14px;background: white; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.10); border-radius: 20px; border: 1px #DDDDDD solid; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
1357
1393
|
>
|
|
1358
1394
|
<div
|
|
1359
|
-
|
|
1360
|
-
|
|
1395
|
+
style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
1396
|
+
onclick="${gvc.event(() => {
|
|
1361
1397
|
vm.link = deleteSelect(vm.link);
|
|
1362
1398
|
gvc.notifyDataChange(vm.id);
|
|
1363
1399
|
})}"
|
|
@@ -1366,9 +1402,10 @@ function setCollection(cf) {
|
|
|
1366
1402
|
</div>
|
|
1367
1403
|
</div>
|
|
1368
1404
|
</div>
|
|
1369
|
-
<div class="d-flex align-items-center"
|
|
1405
|
+
<div class="d-flex align-items-center"
|
|
1406
|
+
style="width: 100%; height: 22px; position: relative;gap:29px;">
|
|
1370
1407
|
<div
|
|
1371
|
-
|
|
1408
|
+
class="${allSelect({
|
|
1372
1409
|
items: vm.link,
|
|
1373
1410
|
selected: !vm.link.find((dd) => {
|
|
1374
1411
|
return !dd.selected;
|
|
@@ -1376,8 +1413,8 @@ function setCollection(cf) {
|
|
|
1376
1413
|
})
|
|
1377
1414
|
? `fa-solid fa-square-check`
|
|
1378
1415
|
: `fa-regular fa-square`}"
|
|
1379
|
-
|
|
1380
|
-
|
|
1416
|
+
style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
|
|
1417
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1381
1418
|
event.stopPropagation();
|
|
1382
1419
|
if (vm.link.find((dd) => {
|
|
1383
1420
|
return !dd.selected;
|
|
@@ -1394,7 +1431,9 @@ function setCollection(cf) {
|
|
|
1394
1431
|
gvc.notifyDataChange(vm.id);
|
|
1395
1432
|
})}"
|
|
1396
1433
|
></div>
|
|
1397
|
-
<div style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word"
|
|
1434
|
+
<div style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
|
|
1435
|
+
選單名稱
|
|
1436
|
+
</div>
|
|
1398
1437
|
</div>
|
|
1399
1438
|
<div style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex">
|
|
1400
1439
|
${(() => {
|
|
@@ -1408,20 +1447,20 @@ function setCollection(cf) {
|
|
|
1408
1447
|
.map((dd, index) => {
|
|
1409
1448
|
dd.items;
|
|
1410
1449
|
const list = html `
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1450
|
+
<div
|
|
1451
|
+
class=" w-100 "
|
|
1452
|
+
style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
|
|
1453
|
+
onclick="${cf.gvc.event(() => {
|
|
1415
1454
|
if (dd.items && dd.items.length > 0) {
|
|
1416
1455
|
dd.toggle = !dd.toggle;
|
|
1417
1456
|
gvc.notifyDataChange(vm.id);
|
|
1418
1457
|
}
|
|
1419
1458
|
})}"
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1459
|
+
>
|
|
1460
|
+
<div
|
|
1461
|
+
class="${allSelect(dd) ? `fa-solid fa-square-check` : `fa-regular fa-square`}"
|
|
1462
|
+
style="color:#393939;width: 16px; height: 16px;"
|
|
1463
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1425
1464
|
event.stopPropagation();
|
|
1426
1465
|
dd.selected = !dd.selected;
|
|
1427
1466
|
if (dd.selected) {
|
|
@@ -1432,38 +1471,39 @@ function setCollection(cf) {
|
|
|
1432
1471
|
}
|
|
1433
1472
|
gvc.notifyDataChange(vm.id);
|
|
1434
1473
|
})}"
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1474
|
+
></div>
|
|
1475
|
+
<div class="hoverF2 pe-2"
|
|
1476
|
+
style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
|
|
1477
|
+
<i
|
|
1478
|
+
class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
|
|
1479
|
+
style="cursor: pointer;width:25px;height: 25px;"
|
|
1480
|
+
></i>
|
|
1481
|
+
<div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
|
|
1482
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1483
|
+
<div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1484
|
+
${dd.title}
|
|
1485
|
+
</div>
|
|
1486
|
+
${dd.items && dd.items.length > 0
|
|
1447
1487
|
? !dd.toggle
|
|
1448
1488
|
? `<i class="fa-solid fa-angle-down color39"></i>`
|
|
1449
1489
|
: `<i class="fa-solid fa-angle-up color39"></i>`
|
|
1450
1490
|
: ``}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1491
|
+
</div>
|
|
1492
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1493
|
+
<div
|
|
1494
|
+
style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
|
|
1495
|
+
>
|
|
1496
|
+
${dd.title}
|
|
1497
|
+
</div>
|
|
1498
|
+
<div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1499
|
+
${dd.link}
|
|
1500
|
+
</div>
|
|
1501
|
+
</div>
|
|
1460
1502
|
</div>
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
class="child me-2"
|
|
1466
|
-
onclick="${cf.gvc.event((e, event) => {
|
|
1503
|
+
<div class="flex-fill"></div>
|
|
1504
|
+
<div
|
|
1505
|
+
class="child me-2"
|
|
1506
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1467
1507
|
event.stopPropagation();
|
|
1468
1508
|
MenusSetting.collectionEvent({
|
|
1469
1509
|
link: '',
|
|
@@ -1482,12 +1522,13 @@ function setCollection(cf) {
|
|
|
1482
1522
|
}
|
|
1483
1523
|
});
|
|
1484
1524
|
})}"
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1525
|
+
>
|
|
1526
|
+
<i class="fa-solid fa-plus"
|
|
1527
|
+
style="color:#393939;"></i>
|
|
1528
|
+
</div>
|
|
1529
|
+
<div
|
|
1530
|
+
class="child"
|
|
1531
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1491
1532
|
event.stopPropagation();
|
|
1492
1533
|
const og = JSON.parse(JSON.stringify(dd));
|
|
1493
1534
|
MenusSetting.collectionEvent(dd, (data) => {
|
|
@@ -1503,20 +1544,23 @@ function setCollection(cf) {
|
|
|
1503
1544
|
}
|
|
1504
1545
|
});
|
|
1505
1546
|
})}"
|
|
1506
|
-
|
|
1507
|
-
|
|
1547
|
+
>
|
|
1548
|
+
<i class="fa-solid fa-pencil"
|
|
1549
|
+
style="color:#393939;"></i>
|
|
1550
|
+
</div>
|
|
1551
|
+
</div>
|
|
1508
1552
|
</div>
|
|
1509
|
-
|
|
1510
|
-
</div>
|
|
1511
|
-
${dd.items && dd.items.length > 0
|
|
1553
|
+
${dd.items && dd.items.length > 0
|
|
1512
1554
|
? html `
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1555
|
+
<div class=" w-100 ${dd.toggle ? `` : `d-none`}"
|
|
1556
|
+
style="padding-left: 35px;">
|
|
1557
|
+
${renderItems(dd.items)}
|
|
1558
|
+
</div>
|
|
1559
|
+
`
|
|
1517
1560
|
: ``}
|
|
1518
|
-
|
|
1519
|
-
return html `
|
|
1561
|
+
`;
|
|
1562
|
+
return html `
|
|
1563
|
+
<li class="w-100 ">${list}</li>`;
|
|
1520
1564
|
})
|
|
1521
1565
|
.join('');
|
|
1522
1566
|
},
|
|
@@ -1530,7 +1574,9 @@ function setCollection(cf) {
|
|
|
1530
1574
|
{
|
|
1531
1575
|
src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
|
|
1532
1576
|
},
|
|
1533
|
-
], () => {
|
|
1577
|
+
], () => {
|
|
1578
|
+
}, () => {
|
|
1579
|
+
});
|
|
1534
1580
|
const interval = setInterval(() => {
|
|
1535
1581
|
if (window.Sortable) {
|
|
1536
1582
|
try {
|
|
@@ -1550,7 +1596,8 @@ function setCollection(cf) {
|
|
|
1550
1596
|
group: id,
|
|
1551
1597
|
animation: 100,
|
|
1552
1598
|
handle: '.dragItem',
|
|
1553
|
-
onChange: function (evt) {
|
|
1599
|
+
onChange: function (evt) {
|
|
1600
|
+
},
|
|
1554
1601
|
onEnd: (evt) => {
|
|
1555
1602
|
swapArr(array, startIndex, evt.newIndex);
|
|
1556
1603
|
gvc.notifyDataChange(id);
|
|
@@ -1560,17 +1607,19 @@ function setCollection(cf) {
|
|
|
1560
1607
|
},
|
|
1561
1608
|
});
|
|
1562
1609
|
}
|
|
1563
|
-
catch (e) {
|
|
1610
|
+
catch (e) {
|
|
1611
|
+
}
|
|
1564
1612
|
clearInterval(interval);
|
|
1565
1613
|
}
|
|
1566
1614
|
}, 100);
|
|
1567
1615
|
},
|
|
1568
1616
|
};
|
|
1569
1617
|
}) +
|
|
1570
|
-
html `
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1618
|
+
html `
|
|
1619
|
+
<div
|
|
1620
|
+
class=""
|
|
1621
|
+
style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
1622
|
+
onclick="${cf.gvc.event(() => {
|
|
1574
1623
|
MenusSetting.collectionEvent({
|
|
1575
1624
|
link: '',
|
|
1576
1625
|
title: '',
|
|
@@ -1587,14 +1636,17 @@ function setCollection(cf) {
|
|
|
1587
1636
|
}
|
|
1588
1637
|
});
|
|
1589
1638
|
})}"
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1639
|
+
>
|
|
1640
|
+
<div
|
|
1641
|
+
style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
|
|
1642
|
+
>
|
|
1643
|
+
<i class="fa-solid fa-plus"
|
|
1644
|
+
style="color: #3366BB;font-size: 16px; "></i>
|
|
1645
|
+
<div style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1646
|
+
新增選單
|
|
1647
|
+
</div>
|
|
1648
|
+
</div>
|
|
1649
|
+
</div>`);
|
|
1598
1650
|
}
|
|
1599
1651
|
return renderItems(vm.link);
|
|
1600
1652
|
})()}
|
|
@@ -1602,7 +1654,8 @@ function setCollection(cf) {
|
|
|
1602
1654
|
</div>
|
|
1603
1655
|
</div>
|
|
1604
1656
|
</div>
|
|
1605
|
-
<div class="position-fixed bg-body bottom-0 w-100 d-flex align-items-center justify-content-end p-3 border-top"
|
|
1657
|
+
<div class="position-fixed bg-body bottom-0 w-100 d-flex align-items-center justify-content-end p-3 border-top"
|
|
1658
|
+
style="gap:10px;left:0px;">
|
|
1606
1659
|
${BgWidget.cancel(gvc.event(() => {
|
|
1607
1660
|
cf.goBack();
|
|
1608
1661
|
}))}
|