ts-glitter 13.3.4 → 13.3.7
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 +2 -7
- package/lowcode/backend-manager/bg-blog.ts +8 -13
- package/lowcode/backend-manager/bg-customer-message.js +4 -2
- package/lowcode/backend-manager/bg-customer-message.ts +4 -2
- package/lowcode/backend-manager/bg-graph-api.js +6 -11
- package/lowcode/backend-manager/bg-graph-api.ts +14 -20
- package/lowcode/backend-manager/bg-line.js +526 -1002
- package/lowcode/backend-manager/bg-line.ts +1815 -2354
- package/lowcode/backend-manager/bg-notify.js +392 -746
- package/lowcode/backend-manager/bg-notify.ts +436 -835
- package/lowcode/backend-manager/bg-project.js +176 -293
- package/lowcode/backend-manager/bg-project.ts +214 -344
- package/lowcode/backend-manager/bg-recommend.js +39 -148
- package/lowcode/backend-manager/bg-recommend.ts +43 -162
- package/lowcode/backend-manager/bg-sns.js +489 -814
- package/lowcode/backend-manager/bg-sns.ts +1876 -2238
- package/lowcode/backend-manager/bg-widget.js +301 -171
- package/lowcode/backend-manager/bg-widget.ts +324 -193
- package/lowcode/cms-plugin/ai-points.js +84 -67
- package/lowcode/cms-plugin/ai-points.ts +280 -247
- package/lowcode/cms-plugin/auto-reply.js +6 -7
- package/lowcode/cms-plugin/auto-reply.ts +6 -7
- package/lowcode/cms-plugin/data-analyze.js +5 -6
- package/lowcode/cms-plugin/data-analyze.ts +5 -6
- package/lowcode/cms-plugin/form-setting.js +122 -220
- package/lowcode/cms-plugin/form-setting.ts +124 -240
- package/lowcode/cms-plugin/line-auto-reply.js +17 -18
- package/lowcode/cms-plugin/line-auto-reply.ts +29 -36
- package/lowcode/cms-plugin/member-group-list.js +5 -2
- package/lowcode/cms-plugin/member-group-list.ts +5 -2
- package/lowcode/cms-plugin/member-type-list.js +36 -84
- package/lowcode/cms-plugin/member-type-list.ts +39 -92
- package/lowcode/cms-plugin/menus-setting.js +8 -73
- package/lowcode/cms-plugin/menus-setting.ts +8 -78
- package/lowcode/cms-plugin/permission-setting.js +73 -106
- package/lowcode/cms-plugin/permission-setting.ts +236 -278
- package/lowcode/cms-plugin/shopping-collections.js +95 -137
- package/lowcode/cms-plugin/shopping-collections.ts +103 -147
- package/lowcode/cms-plugin/shopping-discount-setting.js +310 -416
- package/lowcode/cms-plugin/shopping-discount-setting.ts +1269 -1386
- package/lowcode/cms-plugin/shopping-finance-setting.js +1 -0
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1 -0
- package/lowcode/cms-plugin/shopping-order-manager.js +742 -973
- package/lowcode/cms-plugin/shopping-order-manager.ts +1928 -2164
- package/lowcode/cms-plugin/shopping-order-return.js +147 -267
- package/lowcode/cms-plugin/shopping-order-return.ts +154 -292
- package/lowcode/cms-plugin/shopping-product-setting.js +6 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +8 -4
- package/lowcode/cms-plugin/shopping-product-stock.js +12 -92
- package/lowcode/cms-plugin/shopping-product-stock.ts +14 -94
- package/lowcode/cms-plugin/shopping-product-text.js +0 -3
- package/lowcode/cms-plugin/shopping-product-text.ts +0 -3
- package/lowcode/cms-plugin/shopping-rebate.js +95 -151
- package/lowcode/cms-plugin/shopping-rebate.ts +101 -159
- package/lowcode/cms-plugin/sms-points.js +83 -67
- package/lowcode/cms-plugin/sms-points.ts +281 -241
- package/lowcode/cms-plugin/sns-auto-reply.js +18 -18
- package/lowcode/cms-plugin/sns-auto-reply.ts +34 -40
- package/lowcode/cms-plugin/user-list.js +71 -90
- package/lowcode/cms-plugin/user-list.ts +76 -95
- package/lowcode/cms-plugin/web-config-setting.js +61 -111
- package/lowcode/cms-plugin/web-config-setting.ts +65 -124
- package/lowcode/css/editor.css +5 -2
- package/lowcode/glitter-base/route/shopping.js +1 -1
- package/lowcode/glitter-base/route/shopping.ts +19 -19
- package/lowcode/jspage/editor.js +1 -1
- package/lowcode/jspage/editor.ts +1 -1
- package/lowcode/jspage/main.js +3 -0
- package/lowcode/jspage/main.ts +3 -0
- package/package.json +1 -2
- package/src/api-public/controllers/ai-chat.js.map +5 -1
- package/src/api-public/controllers/article.js.map +1 -1
- package/src/api-public/controllers/chat.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/controllers/rebate.js.map +1 -1
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/chat.js +3 -3
- package/src/api-public/services/chat.js.map +1 -1
- package/src/api-public/services/chat.ts +3 -4
- package/src/api-public/services/fb-message.js.map +5 -1
- package/src/api-public/services/filter-protect-data.js.map +1 -1
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/notify.js.map +1 -1
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/share-permission.js.map +1 -1
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/user.js +67 -66
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +212 -182
- package/src/helper/glitter-util.js.map +1 -1
- package/src/modules/firebase.d.ts +1 -0
- package/src/modules/firebase.js +1 -1
- package/src/modules/firebase.js.map +1 -1
|
@@ -276,145 +276,100 @@ export class ShoppingCollections {
|
|
|
276
276
|
vm.type = 'add';
|
|
277
277
|
}))}
|
|
278
278
|
</div>
|
|
279
|
-
${BgWidget.container(BgWidget.mainCard(
|
|
280
|
-
gvc
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
key: EditorElem.checkBoxOnly({
|
|
300
|
-
gvc: gvc,
|
|
301
|
-
def: !collections.find((dd) => !dd.checked),
|
|
302
|
-
callback: (result) => {
|
|
303
|
-
collections.map((dd) => {
|
|
304
|
-
dd.checked = result;
|
|
305
|
-
});
|
|
306
|
-
vmi.data = getDatalist();
|
|
307
|
-
vmi.callback();
|
|
308
|
-
gvc.notifyDataChange(vm.filterID);
|
|
309
|
-
},
|
|
310
|
-
}),
|
|
311
|
-
value: EditorElem.checkBoxOnly({
|
|
312
|
-
gvc: gvc,
|
|
313
|
-
def: dd.checked,
|
|
314
|
-
callback: (result) => {
|
|
315
|
-
dd.checked = result;
|
|
316
|
-
vmi.data = getDatalist();
|
|
317
|
-
vmi.callback();
|
|
318
|
-
gvc.notifyDataChange(vm.filterID);
|
|
319
|
-
},
|
|
320
|
-
style: 'height: 25px;',
|
|
321
|
-
}),
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
key: '標題',
|
|
325
|
-
value: html `<span class="fs-7"
|
|
326
|
-
>${(() => {
|
|
327
|
-
if (dd.parentTitles && dd.parentTitles.length > 0) {
|
|
328
|
-
return html `<i class="fa-solid fa-arrow-turn-down-right me-2"></i>${dd.parentTitles.join(' / ')} /
|
|
329
|
-
${dd.title}`;
|
|
330
|
-
}
|
|
331
|
-
return dd.title;
|
|
332
|
-
})()}</span
|
|
333
|
-
>`,
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
key: '商品數量',
|
|
337
|
-
value: html `<span class="fs-7">${dd.product_id ? dd.product_id.length : 0}</span>`,
|
|
338
|
-
},
|
|
339
|
-
];
|
|
279
|
+
${BgWidget.container(BgWidget.mainCard([
|
|
280
|
+
BgWidget.searchPlace(gvc.event((e) => {
|
|
281
|
+
vm.query = e.value;
|
|
282
|
+
gvc.notifyDataChange(vm.id);
|
|
283
|
+
}), vm.query || '', '搜尋類別'),
|
|
284
|
+
BgWidget.tableV3({
|
|
285
|
+
gvc: gvc,
|
|
286
|
+
getData: (vmi) => {
|
|
287
|
+
ApiShop.getProduct({
|
|
288
|
+
page: 0,
|
|
289
|
+
limit: 999999,
|
|
290
|
+
}).then((d) => {
|
|
291
|
+
if (d.result) {
|
|
292
|
+
const products = d.response.data;
|
|
293
|
+
ApiShop.getCollection().then((data) => {
|
|
294
|
+
if (data.result && data.response.value.length > 0) {
|
|
295
|
+
vm.allParents = ['(無)'].concat(data.response.value.map((item) => item.title));
|
|
296
|
+
const collections = updateCollections({
|
|
297
|
+
products,
|
|
298
|
+
collections: data.response.value,
|
|
340
299
|
});
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
});
|
|
352
|
-
}
|
|
353
|
-
});
|
|
354
|
-
},
|
|
355
|
-
rowClick: (data, index) => {
|
|
356
|
-
vm.data = vm.dataList[index];
|
|
357
|
-
vm.type = 'replace';
|
|
358
|
-
},
|
|
359
|
-
filter: [
|
|
360
|
-
BgWidget.searchPlace(gvc.event((e) => {
|
|
361
|
-
vm.query = e.value;
|
|
362
|
-
gvc.notifyDataChange(vm.id);
|
|
363
|
-
}), vm.query || '', '搜尋類別'),
|
|
364
|
-
gvc.bindView(() => {
|
|
365
|
-
return {
|
|
366
|
-
bind: vm.filterID,
|
|
367
|
-
view: () => {
|
|
368
|
-
if (!vm.dataList || !vm.dataList.find((dd) => dd.checked)) {
|
|
369
|
-
return '';
|
|
370
|
-
}
|
|
371
|
-
const selCount = vm.dataList.filter((dd) => dd.checked).length;
|
|
372
|
-
return BgWidget.selNavbar({
|
|
373
|
-
count: selCount,
|
|
374
|
-
buttonList: [
|
|
375
|
-
BgWidget.selEventButton('批量移除', gvc.event(() => {
|
|
376
|
-
dialog.checkYesOrNot({
|
|
377
|
-
text: '確定要刪除商品類別嗎?<br/>(若此類別包含子類別,也將一併刪除)',
|
|
378
|
-
callback: (response) => {
|
|
379
|
-
if (response) {
|
|
380
|
-
dialog.dataLoading({ visible: true });
|
|
381
|
-
ApiShop.deleteCollections({
|
|
382
|
-
data: { data: vm.dataList.filter((dd) => dd.checked) },
|
|
383
|
-
token: window.parent.config.token,
|
|
384
|
-
}).then((res) => {
|
|
385
|
-
dialog.dataLoading({ visible: false });
|
|
386
|
-
if (res.result) {
|
|
387
|
-
vm.query = '';
|
|
388
|
-
vm.dataList = undefined;
|
|
389
|
-
gvc.notifyDataChange(vm.id);
|
|
300
|
+
function getDatalist() {
|
|
301
|
+
return collections.map((dd) => {
|
|
302
|
+
return [
|
|
303
|
+
{
|
|
304
|
+
key: '標題',
|
|
305
|
+
value: html `<span class="fs-7"
|
|
306
|
+
>${(() => {
|
|
307
|
+
if (dd.parentTitles && dd.parentTitles.length > 0) {
|
|
308
|
+
return html `<i class="fa-solid fa-arrow-turn-down-right me-2"></i>${dd.parentTitles.join(' / ')} /
|
|
309
|
+
${dd.title}`;
|
|
390
310
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
311
|
+
return dd.title;
|
|
312
|
+
})()}</span
|
|
313
|
+
>`,
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
key: '商品數量',
|
|
317
|
+
value: html `<span class="fs-7">${dd.product_id ? dd.product_id.length : 0}</span>`,
|
|
318
|
+
},
|
|
319
|
+
];
|
|
397
320
|
});
|
|
398
|
-
}
|
|
399
|
-
|
|
321
|
+
}
|
|
322
|
+
vm.dataList = collections;
|
|
323
|
+
vmi.tableData = getDatalist();
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
vm.dataList = [];
|
|
327
|
+
vmi.tableData = [];
|
|
328
|
+
}
|
|
329
|
+
vmi.pageSize = 1;
|
|
330
|
+
vmi.originalData = vm.dataList;
|
|
331
|
+
vmi.loading = false;
|
|
332
|
+
vmi.callback();
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
},
|
|
337
|
+
rowClick: (data, index) => {
|
|
338
|
+
vm.data = vm.dataList[index];
|
|
339
|
+
vm.type = 'replace';
|
|
340
|
+
},
|
|
341
|
+
filter: [
|
|
342
|
+
{
|
|
343
|
+
name: '批量移除',
|
|
344
|
+
event: () => {
|
|
345
|
+
dialog.checkYesOrNot({
|
|
346
|
+
text: '確定要刪除商品類別嗎?<br/>(若此類別包含子類別,也將一併刪除)',
|
|
347
|
+
callback: (response) => {
|
|
348
|
+
if (response) {
|
|
349
|
+
dialog.dataLoading({ visible: true });
|
|
350
|
+
ApiShop.deleteCollections({
|
|
351
|
+
data: { data: vm.dataList.filter((dd) => dd.checked) },
|
|
352
|
+
token: window.parent.config.token,
|
|
353
|
+
}).then((res) => {
|
|
354
|
+
dialog.dataLoading({ visible: false });
|
|
355
|
+
if (res.result) {
|
|
356
|
+
vm.query = '';
|
|
357
|
+
vm.dataList = undefined;
|
|
358
|
+
gvc.notifyDataChange(vm.id);
|
|
359
|
+
}
|
|
360
|
+
else {
|
|
361
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
},
|
|
400
366
|
});
|
|
401
367
|
},
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
})
|
|
408
|
-
? `d-none`
|
|
409
|
-
: ``}`,
|
|
410
|
-
style: ``,
|
|
411
|
-
};
|
|
412
|
-
},
|
|
413
|
-
};
|
|
414
|
-
}),
|
|
415
|
-
].join(''),
|
|
416
|
-
hiddenPageSplit: true,
|
|
417
|
-
})))}
|
|
368
|
+
},
|
|
369
|
+
],
|
|
370
|
+
hiddenPageSplit: true,
|
|
371
|
+
}),
|
|
372
|
+
].join('')))}
|
|
418
373
|
${BgWidget.mbContainer(120)}
|
|
419
374
|
`, BgWidget.getContainerWidth());
|
|
420
375
|
}
|
|
@@ -483,7 +438,10 @@ export class ShoppingCollections {
|
|
|
483
438
|
: 'flex-direction: column; gap: 0px; '}"
|
|
484
439
|
class="w-100"
|
|
485
440
|
>
|
|
486
|
-
<div
|
|
441
|
+
<div
|
|
442
|
+
class="${document.body.clientWidth < 800 ? `w-100` : ``} justify-content-start justify-content-lg-center"
|
|
443
|
+
style="padding: 9px 18px;background: #EAEAEA; justify-content: center; align-items: center; gap: 5px; display: flex"
|
|
444
|
+
>
|
|
487
445
|
<div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
488
446
|
${prefixURL}
|
|
489
447
|
</div>
|
|
@@ -520,8 +478,8 @@ export class ShoppingCollections {
|
|
|
520
478
|
},
|
|
521
479
|
divCreate: {
|
|
522
480
|
class: `${gvc.glitter.ut.frSize({
|
|
523
|
-
sm:
|
|
524
|
-
}, `p-0`)}
|
|
481
|
+
sm: ``,
|
|
482
|
+
}, `p-0`)}`,
|
|
525
483
|
},
|
|
526
484
|
};
|
|
527
485
|
}),
|
|
@@ -343,153 +343,103 @@ export class ShoppingCollections {
|
|
|
343
343
|
</div>
|
|
344
344
|
${BgWidget.container(
|
|
345
345
|
BgWidget.mainCard(
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
callback: (result) => {
|
|
371
|
-
collections.map((dd: any) => {
|
|
372
|
-
dd.checked = result;
|
|
373
|
-
});
|
|
374
|
-
vmi.data = getDatalist();
|
|
375
|
-
vmi.callback();
|
|
376
|
-
gvc.notifyDataChange(vm.filterID);
|
|
377
|
-
},
|
|
378
|
-
}),
|
|
379
|
-
value: EditorElem.checkBoxOnly({
|
|
380
|
-
gvc: gvc,
|
|
381
|
-
def: dd.checked,
|
|
382
|
-
callback: (result) => {
|
|
383
|
-
dd.checked = result;
|
|
384
|
-
vmi.data = getDatalist();
|
|
385
|
-
vmi.callback();
|
|
386
|
-
gvc.notifyDataChange(vm.filterID);
|
|
387
|
-
},
|
|
388
|
-
style: 'height: 25px;',
|
|
389
|
-
}),
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
key: '標題',
|
|
393
|
-
value: html`<span class="fs-7"
|
|
394
|
-
>${(() => {
|
|
395
|
-
if (dd.parentTitles && dd.parentTitles.length > 0) {
|
|
396
|
-
return html`<i class="fa-solid fa-arrow-turn-down-right me-2"></i>${dd.parentTitles.join(' / ')} /
|
|
397
|
-
${dd.title}`;
|
|
398
|
-
}
|
|
399
|
-
return dd.title;
|
|
400
|
-
})()}</span
|
|
401
|
-
>`,
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
key: '商品數量',
|
|
405
|
-
value: html`<span class="fs-7">${dd.product_id ? dd.product_id.length : 0}</span>`,
|
|
406
|
-
},
|
|
407
|
-
];
|
|
346
|
+
[
|
|
347
|
+
BgWidget.searchPlace(
|
|
348
|
+
gvc.event((e) => {
|
|
349
|
+
vm.query = e.value;
|
|
350
|
+
gvc.notifyDataChange(vm.id);
|
|
351
|
+
}),
|
|
352
|
+
vm.query || '',
|
|
353
|
+
'搜尋類別'
|
|
354
|
+
),
|
|
355
|
+
BgWidget.tableV3({
|
|
356
|
+
gvc: gvc,
|
|
357
|
+
getData: (vmi) => {
|
|
358
|
+
ApiShop.getProduct({
|
|
359
|
+
page: 0,
|
|
360
|
+
limit: 999999,
|
|
361
|
+
}).then((d) => {
|
|
362
|
+
if (d.result) {
|
|
363
|
+
const products: Product[] = d.response.data;
|
|
364
|
+
ApiShop.getCollection().then((data) => {
|
|
365
|
+
if (data.result && data.response.value.length > 0) {
|
|
366
|
+
vm.allParents = ['(無)'].concat(data.response.value.map((item: { title: string }) => item.title));
|
|
367
|
+
const collections = updateCollections({
|
|
368
|
+
products,
|
|
369
|
+
collections: data.response.value,
|
|
408
370
|
});
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
});
|
|
421
|
-
},
|
|
422
|
-
rowClick: (data, index) => {
|
|
423
|
-
vm.data = vm.dataList[index];
|
|
424
|
-
vm.type = 'replace';
|
|
425
|
-
},
|
|
426
|
-
filter: [
|
|
427
|
-
BgWidget.searchPlace(
|
|
428
|
-
gvc.event((e) => {
|
|
429
|
-
vm.query = e.value;
|
|
430
|
-
gvc.notifyDataChange(vm.id);
|
|
431
|
-
}),
|
|
432
|
-
vm.query || '',
|
|
433
|
-
'搜尋類別'
|
|
434
|
-
),
|
|
435
|
-
gvc.bindView(() => {
|
|
436
|
-
return {
|
|
437
|
-
bind: vm.filterID,
|
|
438
|
-
view: () => {
|
|
439
|
-
if (!vm.dataList || !vm.dataList.find((dd: any) => dd.checked)) {
|
|
440
|
-
return '';
|
|
441
|
-
}
|
|
442
|
-
const selCount = vm.dataList.filter((dd: any) => dd.checked).length;
|
|
443
|
-
return BgWidget.selNavbar({
|
|
444
|
-
count: selCount,
|
|
445
|
-
buttonList: [
|
|
446
|
-
BgWidget.selEventButton(
|
|
447
|
-
'批量移除',
|
|
448
|
-
gvc.event(() => {
|
|
449
|
-
dialog.checkYesOrNot({
|
|
450
|
-
text: '確定要刪除商品類別嗎?<br/>(若此類別包含子類別,也將一併刪除)',
|
|
451
|
-
callback: (response) => {
|
|
452
|
-
if (response) {
|
|
453
|
-
dialog.dataLoading({ visible: true });
|
|
454
|
-
ApiShop.deleteCollections({
|
|
455
|
-
data: { data: vm.dataList.filter((dd: any) => dd.checked) },
|
|
456
|
-
token: (window.parent as any).config.token,
|
|
457
|
-
}).then((res) => {
|
|
458
|
-
dialog.dataLoading({ visible: false });
|
|
459
|
-
if (res.result) {
|
|
460
|
-
vm.query = '';
|
|
461
|
-
vm.dataList = undefined;
|
|
462
|
-
gvc.notifyDataChange(vm.id);
|
|
463
|
-
} else {
|
|
464
|
-
dialog.errorMessage({ text: '刪除失敗' });
|
|
371
|
+
|
|
372
|
+
function getDatalist() {
|
|
373
|
+
return collections.map((dd) => {
|
|
374
|
+
return [
|
|
375
|
+
{
|
|
376
|
+
key: '標題',
|
|
377
|
+
value: html`<span class="fs-7"
|
|
378
|
+
>${(() => {
|
|
379
|
+
if (dd.parentTitles && dd.parentTitles.length > 0) {
|
|
380
|
+
return html`<i class="fa-solid fa-arrow-turn-down-right me-2"></i>${dd.parentTitles.join(' / ')} /
|
|
381
|
+
${dd.title}`;
|
|
465
382
|
}
|
|
466
|
-
|
|
467
|
-
|
|
383
|
+
return dd.title;
|
|
384
|
+
})()}</span
|
|
385
|
+
>`,
|
|
468
386
|
},
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
387
|
+
{
|
|
388
|
+
key: '商品數量',
|
|
389
|
+
value: html`<span class="fs-7">${dd.product_id ? dd.product_id.length : 0}</span>`,
|
|
390
|
+
},
|
|
391
|
+
];
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
vm.dataList = collections;
|
|
395
|
+
vmi.tableData = getDatalist();
|
|
396
|
+
} else {
|
|
397
|
+
vm.dataList = [];
|
|
398
|
+
vmi.tableData = [];
|
|
399
|
+
}
|
|
400
|
+
vmi.pageSize = 1;
|
|
401
|
+
vmi.originalData = vm.dataList;
|
|
402
|
+
vmi.loading = false;
|
|
403
|
+
vmi.callback();
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
},
|
|
408
|
+
rowClick: (data, index) => {
|
|
409
|
+
vm.data = vm.dataList[index];
|
|
410
|
+
vm.type = 'replace';
|
|
411
|
+
},
|
|
412
|
+
filter: [
|
|
413
|
+
{
|
|
414
|
+
name: '批量移除',
|
|
415
|
+
event: () => {
|
|
416
|
+
dialog.checkYesOrNot({
|
|
417
|
+
text: '確定要刪除商品類別嗎?<br/>(若此類別包含子類別,也將一併刪除)',
|
|
418
|
+
callback: (response) => {
|
|
419
|
+
if (response) {
|
|
420
|
+
dialog.dataLoading({ visible: true });
|
|
421
|
+
ApiShop.deleteCollections({
|
|
422
|
+
data: { data: vm.dataList.filter((dd: any) => dd.checked) },
|
|
423
|
+
token: (window.parent as any).config.token,
|
|
424
|
+
}).then((res) => {
|
|
425
|
+
dialog.dataLoading({ visible: false });
|
|
426
|
+
if (res.result) {
|
|
427
|
+
vm.query = '';
|
|
428
|
+
vm.dataList = undefined;
|
|
429
|
+
gvc.notifyDataChange(vm.id);
|
|
430
|
+
} else {
|
|
431
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
},
|
|
473
436
|
});
|
|
474
437
|
},
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
return dd.checked;
|
|
481
|
-
})
|
|
482
|
-
? `d-none`
|
|
483
|
-
: ``
|
|
484
|
-
}`,
|
|
485
|
-
style: ``,
|
|
486
|
-
};
|
|
487
|
-
},
|
|
488
|
-
};
|
|
489
|
-
}),
|
|
490
|
-
].join(''),
|
|
491
|
-
hiddenPageSplit: true,
|
|
492
|
-
})
|
|
438
|
+
},
|
|
439
|
+
],
|
|
440
|
+
hiddenPageSplit: true,
|
|
441
|
+
}),
|
|
442
|
+
].join('')
|
|
493
443
|
)
|
|
494
444
|
)}
|
|
495
445
|
${BgWidget.mbContainer(120)}
|
|
@@ -567,13 +517,16 @@ export class ShoppingCollections {
|
|
|
567
517
|
: 'flex-direction: column; gap: 0px; '}"
|
|
568
518
|
class="w-100"
|
|
569
519
|
>
|
|
570
|
-
<div
|
|
520
|
+
<div
|
|
521
|
+
class="${document.body.clientWidth < 800 ? `w-100` : ``} justify-content-start justify-content-lg-center"
|
|
522
|
+
style="padding: 9px 18px;background: #EAEAEA; justify-content: center; align-items: center; gap: 5px; display: flex"
|
|
523
|
+
>
|
|
571
524
|
<div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
572
525
|
${prefixURL}
|
|
573
526
|
</div>
|
|
574
527
|
</div>
|
|
575
528
|
<input
|
|
576
|
-
class="flex-fill ${document.body.clientWidth<800 ? `w-100
|
|
529
|
+
class="flex-fill ${document.body.clientWidth < 800 ? `w-100` : ``}"
|
|
577
530
|
style="border:none;background:none;text-align: start; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word; ${document
|
|
578
531
|
.body.clientWidth > 768
|
|
579
532
|
? ''
|
|
@@ -605,9 +558,12 @@ export class ShoppingCollections {
|
|
|
605
558
|
);
|
|
606
559
|
},
|
|
607
560
|
divCreate: {
|
|
608
|
-
class
|
|
609
|
-
|
|
610
|
-
|
|
561
|
+
class: `${gvc.glitter.ut.frSize(
|
|
562
|
+
{
|
|
563
|
+
sm: ``,
|
|
564
|
+
},
|
|
565
|
+
`p-0`
|
|
566
|
+
)}`,
|
|
611
567
|
},
|
|
612
568
|
};
|
|
613
569
|
}),
|