ts-glitter 21.1.7 → 21.1.9
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 +14 -1
- package/lowcode/Entry.ts +13 -1
- package/lowcode/backend-manager/bg-line.js +18 -10
- package/lowcode/backend-manager/bg-line.ts +19 -10
- package/lowcode/backend-manager/bg-list-component.js +1 -2
- package/lowcode/backend-manager/bg-list-component.ts +1 -1
- package/lowcode/backend-manager/bg-notify.js +17 -10
- package/lowcode/backend-manager/bg-notify.ts +19 -11
- package/lowcode/backend-manager/bg-product.js +39 -18
- package/lowcode/backend-manager/bg-product.ts +54 -23
- package/lowcode/backend-manager/bg-recommend.js +15 -9
- package/lowcode/backend-manager/bg-recommend.ts +16 -9
- package/lowcode/backend-manager/bg-sns.js +16 -9
- package/lowcode/backend-manager/bg-sns.ts +18 -11
- package/lowcode/backend-manager/bg-widget.js +325 -261
- package/lowcode/backend-manager/bg-widget.ts +117 -45
- package/lowcode/cms-plugin/auto-fcm-history.js +15 -6
- package/lowcode/cms-plugin/auto-fcm-history.ts +18 -11
- package/lowcode/cms-plugin/auto-reply.js +17 -1
- package/lowcode/cms-plugin/auto-reply.ts +16 -1
- package/lowcode/cms-plugin/exhibition-list.js +11 -2
- package/lowcode/cms-plugin/exhibition-list.ts +12 -2
- package/lowcode/cms-plugin/live_capture.js +2 -2
- package/lowcode/cms-plugin/live_capture.ts +2 -2
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/order-excel.js +15 -1
- package/lowcode/cms-plugin/module/order-excel.ts +22 -2
- package/lowcode/cms-plugin/module/table-storage.js +11 -0
- package/lowcode/cms-plugin/module/table-storage.ts +12 -0
- package/lowcode/cms-plugin/permission-setting.js +16 -9
- package/lowcode/cms-plugin/permission-setting.ts +18 -10
- package/lowcode/cms-plugin/pos-pages/payment-page.js +37 -29
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +61 -49
- package/lowcode/cms-plugin/pos-pages/pos-function.js +6 -1
- package/lowcode/cms-plugin/pos-pages/pos-function.ts +8 -1
- package/lowcode/cms-plugin/reconciliation-area.js +12 -3
- package/lowcode/cms-plugin/reconciliation-area.ts +13 -3
- package/lowcode/cms-plugin/shopping-allowance-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +13 -3
- package/lowcode/cms-plugin/shopping-invoice-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +13 -4
- package/lowcode/cms-plugin/shopping-order-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-order-manager.ts +13 -4
- package/lowcode/cms-plugin/shopping-product-setting.js +16 -10
- package/lowcode/cms-plugin/shopping-product-setting.ts +17 -10
- package/lowcode/cms-plugin/shopping-product-stock.js +17 -11
- package/lowcode/cms-plugin/shopping-product-stock.ts +18 -11
- package/lowcode/cms-plugin/shopping-setting-basic.js +129 -38
- package/lowcode/cms-plugin/shopping-setting-basic.ts +134 -38
- package/lowcode/cms-plugin/stock-history.js +15 -7
- package/lowcode/cms-plugin/stock-history.ts +16 -17
- package/lowcode/cms-plugin/stock-stores.js +13 -6
- package/lowcode/cms-plugin/stock-stores.ts +14 -6
- package/lowcode/cms-plugin/stock-vendors.js +13 -6
- package/lowcode/cms-plugin/stock-vendors.ts +14 -6
- package/lowcode/cms-plugin/user-list.js +24 -7
- package/lowcode/cms-plugin/user-list.ts +25 -7
- package/lowcode/css/editor.css +11 -6
- package/lowcode/form-view/e-commerce/product-select.js +13 -11
- package/lowcode/form-view/e-commerce/product-select.ts +14 -12
- package/lowcode/modules/tool.js +9 -0
- package/lowcode/modules/tool.ts +12 -0
- package/lowcode/public-components/checkout/index.js +216 -207
- package/lowcode/public-components/checkout/index.ts +1315 -1309
- package/lowcode/public-components/product/pd-class.js +11 -2
- package/lowcode/public-components/product/pd-class.ts +16 -3
- package/lowcode/public-components/public/ad.js +42 -10
- package/lowcode/public-components/public/ad.ts +28 -1
- package/lowcode/public-models/product.ts +1 -0
- package/lowcode/view-model/saas-view-model.js +394 -379
- package/lowcode/view-model/saas-view-model.ts +1451 -1405
- package/package.json +1 -1
- package/src/api-public/controllers/user.js +4 -4
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +4 -4
- package/src/api-public/models/glitter-finance.js +1 -2
- package/src/api-public/models/glitter-finance.js.map +1 -5
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/fb-api.d.ts +4 -3
- package/src/api-public/services/fb-api.js +72 -27
- package/src/api-public/services/fb-api.js.map +1 -1
- package/src/api-public/services/fb-api.ts +183 -127
- package/src/api-public/services/fb-service.js +4 -4
- package/src/api-public/services/fb-service.js.map +1 -1
- package/src/api-public/services/schedule.d.ts +1 -1
- package/src/api-public/services/schedule.js +18 -14
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +18 -14
- package/src/api-public/services/user.d.ts +6 -5
- package/src/api-public/services/user.js +12 -10
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +14 -10
- package/src/config.d.ts +1 -1
- package/src/modules/AWSLib.js +2 -3
- package/src/modules/AWSLib.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/modules/redis.d.ts +1 -1
- package/src/modules/tool.d.ts +4 -4
- package/src/modules/tool.js +1 -2
- package/src/modules/tool.js.map +1 -1
- package/src/seo-config.js +1 -0
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +1 -0
- package/src/services/backend-service.js +17 -7
- package/src/services/backend-service.js.map +1 -1
- package/src/services/create-instance.js +3 -4
- package/src/services/create-instance.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +1 -5
- package/src/services/tool.js +2 -3
- package/src/services/tool.js.map +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -146,7 +146,7 @@ export class Entry {
|
|
|
146
146
|
}
|
|
147
147
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
|
|
148
148
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
149
|
-
glitter.share.editerVersion = 'V_21.1.
|
|
149
|
+
glitter.share.editerVersion = 'V_21.1.9';
|
|
150
150
|
glitter.share.start = new Date();
|
|
151
151
|
const vm = { appConfig: [] };
|
|
152
152
|
window.saasConfig = {
|
|
@@ -547,6 +547,19 @@ export class Entry {
|
|
|
547
547
|
callback();
|
|
548
548
|
}
|
|
549
549
|
static toNormalRender(glitter, vm, callback) {
|
|
550
|
+
ApiUser.getUserData(GlobalUser.token, 'me').then((r) => __awaiter(this, void 0, void 0, function* () {
|
|
551
|
+
try {
|
|
552
|
+
if (!r.result) {
|
|
553
|
+
GlobalUser.token = '';
|
|
554
|
+
}
|
|
555
|
+
else {
|
|
556
|
+
GlobalUser.userInfo = r.response;
|
|
557
|
+
GlobalUser.updateUserData = JSON.parse(JSON.stringify(r.response));
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
catch (e) {
|
|
561
|
+
}
|
|
562
|
+
}));
|
|
550
563
|
glitter.addStyleLink([`https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css`]);
|
|
551
564
|
glitter.addMtScript([
|
|
552
565
|
{
|
package/lowcode/Entry.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { PayConfig } from './cms-plugin/pos-pages/pay-config.js';
|
|
|
11
11
|
import { ApiCart } from './glitter-base/route/api-cart.js';
|
|
12
12
|
import { ApiUser } from './glitter-base/route/user.js';
|
|
13
13
|
import { ApplicationConfig } from './application-config.js';
|
|
14
|
+
import { TriggerEvent } from './glitterBundle/plugins/trigger-event.js';
|
|
14
15
|
|
|
15
16
|
export class Entry {
|
|
16
17
|
// 建立初始函式
|
|
@@ -149,7 +150,7 @@ export class Entry {
|
|
|
149
150
|
}
|
|
150
151
|
(window as any).renderClock = (window as any).renderClock ?? createClock();
|
|
151
152
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
152
|
-
glitter.share.editerVersion = 'V_21.1.
|
|
153
|
+
glitter.share.editerVersion = 'V_21.1.9';
|
|
153
154
|
glitter.share.start = new Date();
|
|
154
155
|
const vm = { appConfig: [] };
|
|
155
156
|
(window as any).saasConfig = {
|
|
@@ -595,6 +596,17 @@ export class Entry {
|
|
|
595
596
|
|
|
596
597
|
// 跳轉至一般頁面
|
|
597
598
|
public static toNormalRender(glitter: Glitter, vm: any, callback: () => void) {
|
|
599
|
+
ApiUser.getUserData(GlobalUser.token,'me').then(async (r) => {
|
|
600
|
+
try {
|
|
601
|
+
if (!r.result) {
|
|
602
|
+
GlobalUser.token = ''
|
|
603
|
+
} else {
|
|
604
|
+
GlobalUser.userInfo = r.response
|
|
605
|
+
GlobalUser.updateUserData = JSON.parse(JSON.stringify(r.response))
|
|
606
|
+
}
|
|
607
|
+
} catch (e) {
|
|
608
|
+
}
|
|
609
|
+
})
|
|
598
610
|
glitter.addStyleLink([`https://cdn.jsdelivr.net/npm/froala-editor@latest/css/froala_editor.pkgd.min.css`]);
|
|
599
611
|
glitter.addMtScript(
|
|
600
612
|
[
|
|
@@ -20,6 +20,7 @@ import { ShoppingDiscountSetting } from '../cms-plugin/shopping-discount-setting
|
|
|
20
20
|
import { BgListComponent } from './bg-list-component.js';
|
|
21
21
|
import { Tool } from '../modules/tool.js';
|
|
22
22
|
import { ApiLineMessage } from '../glitter-base/route/line.js';
|
|
23
|
+
import { TableStorage } from '../cms-plugin/module/table-storage.js';
|
|
23
24
|
const html = String.raw;
|
|
24
25
|
const inputStyle = 'font-size: 16px; height: 40px; width: 300px;';
|
|
25
26
|
export class BgLine {
|
|
@@ -263,6 +264,7 @@ export class BgLine {
|
|
|
263
264
|
query: '',
|
|
264
265
|
queryType: 'email',
|
|
265
266
|
filter: {},
|
|
267
|
+
listLimit: TableStorage.getLimit(),
|
|
266
268
|
};
|
|
267
269
|
return gvc.bindView(() => {
|
|
268
270
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.emailFilterFrame);
|
|
@@ -288,17 +290,23 @@ export class BgLine {
|
|
|
288
290
|
gvc,
|
|
289
291
|
callback: (value) => {
|
|
290
292
|
vm.queryType = value;
|
|
291
|
-
gvc.notifyDataChange(vm.tableId);
|
|
292
|
-
gvc.notifyDataChange(id);
|
|
293
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
293
294
|
},
|
|
294
295
|
default: vm.queryType || 'email',
|
|
295
296
|
options: FilterOptions.snsSelect,
|
|
296
297
|
}),
|
|
297
298
|
BgWidget.searchFilter(gvc.event(e => {
|
|
298
299
|
vm.query = `${e.value}`.trim();
|
|
299
|
-
gvc.notifyDataChange(vm.tableId);
|
|
300
|
-
gvc.notifyDataChange(id);
|
|
300
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
301
301
|
}), vm.query || '', '搜尋所有訊息內容'),
|
|
302
|
+
BgWidget.countingFilter({
|
|
303
|
+
gvc,
|
|
304
|
+
callback: value => {
|
|
305
|
+
vm.listLimit = value;
|
|
306
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
307
|
+
},
|
|
308
|
+
default: vm.listLimit,
|
|
309
|
+
}),
|
|
302
310
|
BgWidget.funnelFilter({
|
|
303
311
|
gvc,
|
|
304
312
|
callback: () => {
|
|
@@ -318,10 +326,9 @@ export class BgLine {
|
|
|
318
326
|
gvc: gvc,
|
|
319
327
|
getData: vmi => {
|
|
320
328
|
var _a, _b;
|
|
321
|
-
const limit = 20;
|
|
322
329
|
ApiLineMessage.history({
|
|
323
330
|
page: vmi.page - 1,
|
|
324
|
-
limit:
|
|
331
|
+
limit: vm.listLimit,
|
|
325
332
|
search: (_a = vm.query) !== null && _a !== void 0 ? _a : '',
|
|
326
333
|
searchType: (_b = vm.queryType) !== null && _b !== void 0 ? _b : 'email',
|
|
327
334
|
sendTime: undefined,
|
|
@@ -392,7 +399,7 @@ export class BgLine {
|
|
|
392
399
|
});
|
|
393
400
|
}
|
|
394
401
|
vm.dataList = data.response.data;
|
|
395
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
402
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
396
403
|
vmi.originalData = vm.dataList;
|
|
397
404
|
vmi.tableData = getDatalist();
|
|
398
405
|
vmi.loading = false;
|
|
@@ -795,7 +802,7 @@ export class BgLine {
|
|
|
795
802
|
ApiUser.getUserList({
|
|
796
803
|
page: 0,
|
|
797
804
|
limit: 99999,
|
|
798
|
-
only_id: true
|
|
805
|
+
only_id: true,
|
|
799
806
|
}).then(dd => {
|
|
800
807
|
dd.response.data.map((user) => {
|
|
801
808
|
if (user.userData.lineID) {
|
|
@@ -1144,7 +1151,7 @@ export class BgLine {
|
|
|
1144
1151
|
ApiUser.getUserList({
|
|
1145
1152
|
page: 0,
|
|
1146
1153
|
limit: 99999,
|
|
1147
|
-
only_id: true
|
|
1154
|
+
only_id: true,
|
|
1148
1155
|
}).then(dd => {
|
|
1149
1156
|
if (dd.response.data) {
|
|
1150
1157
|
const ids = [];
|
|
@@ -1195,7 +1202,8 @@ export class BgLine {
|
|
|
1195
1202
|
ApiUser.getUserList({
|
|
1196
1203
|
page: 0,
|
|
1197
1204
|
limit: 99999,
|
|
1198
|
-
search: data.query,
|
|
1205
|
+
search: data.query,
|
|
1206
|
+
only_id: true,
|
|
1199
1207
|
}).then(dd => {
|
|
1200
1208
|
if (dd.response.data) {
|
|
1201
1209
|
vm.dataList = dd.response.data
|
|
@@ -12,6 +12,7 @@ import { ShoppingDiscountSetting } from '../cms-plugin/shopping-discount-setting
|
|
|
12
12
|
import { BgListComponent } from './bg-list-component.js';
|
|
13
13
|
import { Tool } from '../modules/tool.js';
|
|
14
14
|
import { ApiLineMessage } from '../glitter-base/route/line.js';
|
|
15
|
+
import { TableStorage } from '../cms-plugin/module/table-storage.js';
|
|
15
16
|
|
|
16
17
|
const html = String.raw;
|
|
17
18
|
|
|
@@ -318,6 +319,7 @@ export class BgLine {
|
|
|
318
319
|
query?: string;
|
|
319
320
|
queryType?: string;
|
|
320
321
|
filter?: any;
|
|
322
|
+
listLimit: number;
|
|
321
323
|
} = {
|
|
322
324
|
id: glitter.getUUID(),
|
|
323
325
|
tableId: glitter.getUUID(),
|
|
@@ -327,6 +329,7 @@ export class BgLine {
|
|
|
327
329
|
query: '',
|
|
328
330
|
queryType: 'email',
|
|
329
331
|
filter: {},
|
|
332
|
+
listLimit: TableStorage.getLimit(),
|
|
330
333
|
};
|
|
331
334
|
return gvc.bindView(() => {
|
|
332
335
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.emailFilterFrame);
|
|
@@ -354,8 +357,7 @@ export class BgLine {
|
|
|
354
357
|
gvc,
|
|
355
358
|
callback: (value: any) => {
|
|
356
359
|
vm.queryType = value;
|
|
357
|
-
gvc.notifyDataChange(vm.tableId);
|
|
358
|
-
gvc.notifyDataChange(id);
|
|
360
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
359
361
|
},
|
|
360
362
|
default: vm.queryType || 'email',
|
|
361
363
|
options: FilterOptions.snsSelect,
|
|
@@ -363,12 +365,19 @@ export class BgLine {
|
|
|
363
365
|
BgWidget.searchFilter(
|
|
364
366
|
gvc.event(e => {
|
|
365
367
|
vm.query = `${e.value}`.trim();
|
|
366
|
-
gvc.notifyDataChange(vm.tableId);
|
|
367
|
-
gvc.notifyDataChange(id);
|
|
368
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
368
369
|
}),
|
|
369
370
|
vm.query || '',
|
|
370
371
|
'搜尋所有訊息內容'
|
|
371
372
|
),
|
|
373
|
+
BgWidget.countingFilter({
|
|
374
|
+
gvc,
|
|
375
|
+
callback: value => {
|
|
376
|
+
vm.listLimit = value;
|
|
377
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
378
|
+
},
|
|
379
|
+
default: vm.listLimit,
|
|
380
|
+
}),
|
|
372
381
|
BgWidget.funnelFilter({
|
|
373
382
|
gvc,
|
|
374
383
|
callback: () => {
|
|
@@ -388,10 +397,9 @@ export class BgLine {
|
|
|
388
397
|
return BgWidget.tableV3({
|
|
389
398
|
gvc: gvc,
|
|
390
399
|
getData: vmi => {
|
|
391
|
-
const limit = 20;
|
|
392
400
|
ApiLineMessage.history({
|
|
393
401
|
page: vmi.page - 1,
|
|
394
|
-
limit:
|
|
402
|
+
limit: vm.listLimit,
|
|
395
403
|
search: vm.query ?? '',
|
|
396
404
|
searchType: vm.queryType ?? 'email',
|
|
397
405
|
sendTime: undefined,
|
|
@@ -466,7 +474,7 @@ export class BgLine {
|
|
|
466
474
|
}
|
|
467
475
|
|
|
468
476
|
vm.dataList = data.response.data;
|
|
469
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
477
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
470
478
|
vmi.originalData = vm.dataList;
|
|
471
479
|
vmi.tableData = getDatalist();
|
|
472
480
|
vmi.loading = false;
|
|
@@ -900,7 +908,7 @@ export class BgLine {
|
|
|
900
908
|
ApiUser.getUserList({
|
|
901
909
|
page: 0,
|
|
902
910
|
limit: 99999,
|
|
903
|
-
only_id:true
|
|
911
|
+
only_id: true,
|
|
904
912
|
}).then(dd => {
|
|
905
913
|
dd.response.data.map((user: any) => {
|
|
906
914
|
if (user.userData.lineID) {
|
|
@@ -1272,7 +1280,7 @@ export class BgLine {
|
|
|
1272
1280
|
ApiUser.getUserList({
|
|
1273
1281
|
page: 0,
|
|
1274
1282
|
limit: 99999,
|
|
1275
|
-
only_id:true
|
|
1283
|
+
only_id: true,
|
|
1276
1284
|
}).then(dd => {
|
|
1277
1285
|
if (dd.response.data) {
|
|
1278
1286
|
const ids: number[] = [];
|
|
@@ -1339,7 +1347,8 @@ export class BgLine {
|
|
|
1339
1347
|
ApiUser.getUserList({
|
|
1340
1348
|
page: 0,
|
|
1341
1349
|
limit: 99999,
|
|
1342
|
-
search: data.query,
|
|
1350
|
+
search: data.query,
|
|
1351
|
+
only_id: true,
|
|
1343
1352
|
}).then(dd => {
|
|
1344
1353
|
if (dd.response.data) {
|
|
1345
1354
|
vm.dataList = dd.response.data
|
|
@@ -379,7 +379,6 @@ export class BgListComponent {
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
static listBarRWD(filterList, filterTags) {
|
|
382
|
-
var _a, _b, _c;
|
|
383
382
|
if (document.body.clientWidth > 768) {
|
|
384
383
|
return html ` <div style="display: flex; align-items: center; gap: 10px;">${filterList.join('')}</div>
|
|
385
384
|
<div>${filterTags}</div>`;
|
|
@@ -388,7 +387,7 @@ export class BgListComponent {
|
|
|
388
387
|
style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between"
|
|
389
388
|
>
|
|
390
389
|
<div>${filterList[0]}</div>
|
|
391
|
-
<div style="display: flex; gap: 4px;">${(
|
|
390
|
+
<div style="display: flex; gap: 4px;">${filterList.slice(2, filterList.length).filter(Boolean).join('')}</div>
|
|
392
391
|
</div>
|
|
393
392
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
394
393
|
<div>${filterTags}</div>`;
|
|
@@ -457,7 +457,7 @@ export class BgListComponent {
|
|
|
457
457
|
style="display: flex; align-items: center; gap: 10px; width: 100%; justify-content: space-between"
|
|
458
458
|
>
|
|
459
459
|
<div>${filterList[0]}</div>
|
|
460
|
-
<div style="display: flex; gap: 4px;">${filterList
|
|
460
|
+
<div style="display: flex; gap: 4px;">${filterList.slice(2, filterList.length).filter(Boolean).join('')}</div>
|
|
461
461
|
</div>
|
|
462
462
|
<div style="display: flex; margin-top: 8px;">${filterList[1]}</div>
|
|
463
463
|
<div>${filterTags}</div>`;
|
|
@@ -20,6 +20,7 @@ import { ShoppingDiscountSetting } from '../cms-plugin/shopping-discount-setting
|
|
|
20
20
|
import { ApiSmtp } from '../glitter-base/route/smtp.js';
|
|
21
21
|
import { BgListComponent } from './bg-list-component.js';
|
|
22
22
|
import { Tool } from '../modules/tool.js';
|
|
23
|
+
import { TableStorage } from '../cms-plugin/module/table-storage.js';
|
|
23
24
|
const html = String.raw;
|
|
24
25
|
const inputStyle = 'font-size: 16px; height:40px; width:300px;';
|
|
25
26
|
export class BgNotify {
|
|
@@ -262,6 +263,7 @@ export class BgNotify {
|
|
|
262
263
|
query: '',
|
|
263
264
|
queryType: 'email',
|
|
264
265
|
filter: {},
|
|
266
|
+
listLimit: TableStorage.getLimit(),
|
|
265
267
|
};
|
|
266
268
|
return gvc.bindView(() => {
|
|
267
269
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.emailFilterFrame);
|
|
@@ -287,17 +289,23 @@ export class BgNotify {
|
|
|
287
289
|
gvc,
|
|
288
290
|
callback: (value) => {
|
|
289
291
|
vm.queryType = value;
|
|
290
|
-
gvc.notifyDataChange(vm.tableId);
|
|
291
|
-
gvc.notifyDataChange(id);
|
|
292
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
292
293
|
},
|
|
293
294
|
default: vm.queryType || 'email',
|
|
294
295
|
options: FilterOptions.emailSelect,
|
|
295
296
|
}),
|
|
296
297
|
BgWidget.searchFilter(gvc.event(e => {
|
|
297
298
|
vm.query = `${e.value}`.trim();
|
|
298
|
-
gvc.notifyDataChange(vm.tableId);
|
|
299
|
-
gvc.notifyDataChange(id);
|
|
299
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
300
300
|
}), vm.query || '', '搜尋所有信件內容'),
|
|
301
|
+
BgWidget.countingFilter({
|
|
302
|
+
gvc,
|
|
303
|
+
callback: value => {
|
|
304
|
+
vm.listLimit = value;
|
|
305
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
306
|
+
},
|
|
307
|
+
default: vm.listLimit,
|
|
308
|
+
}),
|
|
301
309
|
BgWidget.funnelFilter({
|
|
302
310
|
gvc,
|
|
303
311
|
callback: () => {
|
|
@@ -317,10 +325,9 @@ export class BgNotify {
|
|
|
317
325
|
gvc: gvc,
|
|
318
326
|
getData: vmi => {
|
|
319
327
|
var _a, _b;
|
|
320
|
-
const limit = 20;
|
|
321
328
|
ApiSmtp.history({
|
|
322
329
|
page: vmi.page - 1,
|
|
323
|
-
limit:
|
|
330
|
+
limit: vm.listLimit,
|
|
324
331
|
search: (_a = vm.query) !== null && _a !== void 0 ? _a : '',
|
|
325
332
|
searchType: (_b = vm.queryType) !== null && _b !== void 0 ? _b : 'email',
|
|
326
333
|
sendTime: undefined,
|
|
@@ -391,7 +398,7 @@ export class BgNotify {
|
|
|
391
398
|
});
|
|
392
399
|
}
|
|
393
400
|
vm.dataList = data.response.data;
|
|
394
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
401
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
395
402
|
vmi.originalData = vm.dataList;
|
|
396
403
|
vmi.tableData = getDatalist();
|
|
397
404
|
vmi.loading = false;
|
|
@@ -855,7 +862,7 @@ export class BgNotify {
|
|
|
855
862
|
ApiUser.getUserList({
|
|
856
863
|
page: 0,
|
|
857
864
|
limit: 99999,
|
|
858
|
-
only_id: true
|
|
865
|
+
only_id: true,
|
|
859
866
|
}).then(dd => {
|
|
860
867
|
dd.response.data.map((user) => {
|
|
861
868
|
if (user.userData.email && user.userData.email.length > 0) {
|
|
@@ -1189,7 +1196,7 @@ export class BgNotify {
|
|
|
1189
1196
|
ApiUser.getUserList({
|
|
1190
1197
|
page: 0,
|
|
1191
1198
|
limit: 99999,
|
|
1192
|
-
only_id: true
|
|
1199
|
+
only_id: true,
|
|
1193
1200
|
}).then(dd => {
|
|
1194
1201
|
if (dd.response.data) {
|
|
1195
1202
|
const ids = [];
|
|
@@ -1241,7 +1248,7 @@ export class BgNotify {
|
|
|
1241
1248
|
page: 0,
|
|
1242
1249
|
limit: 99999,
|
|
1243
1250
|
only_id: true,
|
|
1244
|
-
search: data.query
|
|
1251
|
+
search: data.query,
|
|
1245
1252
|
}).then(dd => {
|
|
1246
1253
|
if (dd.response.data) {
|
|
1247
1254
|
vm.dataList = dd.response.data
|
|
@@ -12,6 +12,7 @@ import { ShoppingDiscountSetting } from '../cms-plugin/shopping-discount-setting
|
|
|
12
12
|
import { ApiSmtp } from '../glitter-base/route/smtp.js';
|
|
13
13
|
import { BgListComponent } from './bg-list-component.js';
|
|
14
14
|
import { Tool } from '../modules/tool.js';
|
|
15
|
+
import { TableStorage } from '../cms-plugin/module/table-storage.js';
|
|
15
16
|
|
|
16
17
|
const html = String.raw;
|
|
17
18
|
|
|
@@ -312,6 +313,7 @@ export class BgNotify {
|
|
|
312
313
|
query?: string;
|
|
313
314
|
queryType?: string;
|
|
314
315
|
filter?: any;
|
|
316
|
+
listLimit: number;
|
|
315
317
|
} = {
|
|
316
318
|
id: glitter.getUUID(),
|
|
317
319
|
tableId: glitter.getUUID(),
|
|
@@ -321,6 +323,7 @@ export class BgNotify {
|
|
|
321
323
|
query: '',
|
|
322
324
|
queryType: 'email',
|
|
323
325
|
filter: {},
|
|
326
|
+
listLimit: TableStorage.getLimit(),
|
|
324
327
|
};
|
|
325
328
|
return gvc.bindView(() => {
|
|
326
329
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.emailFilterFrame);
|
|
@@ -348,8 +351,7 @@ export class BgNotify {
|
|
|
348
351
|
gvc,
|
|
349
352
|
callback: (value: any) => {
|
|
350
353
|
vm.queryType = value;
|
|
351
|
-
gvc.notifyDataChange(vm.tableId);
|
|
352
|
-
gvc.notifyDataChange(id);
|
|
354
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
353
355
|
},
|
|
354
356
|
default: vm.queryType || 'email',
|
|
355
357
|
options: FilterOptions.emailSelect,
|
|
@@ -357,12 +359,19 @@ export class BgNotify {
|
|
|
357
359
|
BgWidget.searchFilter(
|
|
358
360
|
gvc.event(e => {
|
|
359
361
|
vm.query = `${e.value}`.trim();
|
|
360
|
-
gvc.notifyDataChange(vm.tableId);
|
|
361
|
-
gvc.notifyDataChange(id);
|
|
362
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
362
363
|
}),
|
|
363
364
|
vm.query || '',
|
|
364
365
|
'搜尋所有信件內容'
|
|
365
366
|
),
|
|
367
|
+
BgWidget.countingFilter({
|
|
368
|
+
gvc,
|
|
369
|
+
callback: value => {
|
|
370
|
+
vm.listLimit = value;
|
|
371
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
372
|
+
},
|
|
373
|
+
default: vm.listLimit,
|
|
374
|
+
}),
|
|
366
375
|
BgWidget.funnelFilter({
|
|
367
376
|
gvc,
|
|
368
377
|
callback: () => {
|
|
@@ -382,10 +391,9 @@ export class BgNotify {
|
|
|
382
391
|
return BgWidget.tableV3({
|
|
383
392
|
gvc: gvc,
|
|
384
393
|
getData: vmi => {
|
|
385
|
-
const limit = 20;
|
|
386
394
|
ApiSmtp.history({
|
|
387
395
|
page: vmi.page - 1,
|
|
388
|
-
limit:
|
|
396
|
+
limit: vm.listLimit,
|
|
389
397
|
search: vm.query ?? '',
|
|
390
398
|
searchType: vm.queryType ?? 'email',
|
|
391
399
|
sendTime: undefined,
|
|
@@ -463,7 +471,7 @@ export class BgNotify {
|
|
|
463
471
|
}
|
|
464
472
|
|
|
465
473
|
vm.dataList = data.response.data;
|
|
466
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
474
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
467
475
|
vmi.originalData = vm.dataList;
|
|
468
476
|
vmi.tableData = getDatalist();
|
|
469
477
|
vmi.loading = false;
|
|
@@ -958,7 +966,7 @@ export class BgNotify {
|
|
|
958
966
|
ApiUser.getUserList({
|
|
959
967
|
page: 0,
|
|
960
968
|
limit: 99999,
|
|
961
|
-
only_id:true
|
|
969
|
+
only_id: true,
|
|
962
970
|
}).then(dd => {
|
|
963
971
|
dd.response.data.map((user: any) => {
|
|
964
972
|
if (user.userData.email && user.userData.email.length > 0) {
|
|
@@ -1309,7 +1317,7 @@ export class BgNotify {
|
|
|
1309
1317
|
ApiUser.getUserList({
|
|
1310
1318
|
page: 0,
|
|
1311
1319
|
limit: 99999,
|
|
1312
|
-
only_id:true
|
|
1320
|
+
only_id: true,
|
|
1313
1321
|
}).then(dd => {
|
|
1314
1322
|
if (dd.response.data) {
|
|
1315
1323
|
const ids: number[] = [];
|
|
@@ -1361,8 +1369,8 @@ export class BgNotify {
|
|
|
1361
1369
|
ApiUser.getUserList({
|
|
1362
1370
|
page: 0,
|
|
1363
1371
|
limit: 99999,
|
|
1364
|
-
only_id:true,
|
|
1365
|
-
search: data.query
|
|
1372
|
+
only_id: true,
|
|
1373
|
+
search: data.query,
|
|
1366
1374
|
}).then(dd => {
|
|
1367
1375
|
if (dd.response.data) {
|
|
1368
1376
|
vm.dataList = dd.response.data
|
|
@@ -151,7 +151,6 @@ export class BgProduct {
|
|
|
151
151
|
return {
|
|
152
152
|
bind: id,
|
|
153
153
|
view: () => {
|
|
154
|
-
var _a;
|
|
155
154
|
return html `<input
|
|
156
155
|
class="form-check-input mt-0 ${vm.checkClass} cursor_pointer"
|
|
157
156
|
type="checkbox"
|
|
@@ -184,13 +183,11 @@ export class BgProduct {
|
|
|
184
183
|
style="text-wrap: auto;"
|
|
185
184
|
onclick="${gvc.event(() => call())}"
|
|
186
185
|
>
|
|
187
|
-
${
|
|
188
|
-
? BgWidget.infoInsignia(ProductConfig.getName(opt.content))
|
|
189
|
-
: ''}${opt.value}
|
|
186
|
+
${opt.value}
|
|
190
187
|
</div>
|
|
191
188
|
${opt.sub_title
|
|
192
189
|
? html `
|
|
193
|
-
<div class="fw-500" style="color:grey;font-size:13px;">
|
|
190
|
+
<div class="fw-500" style="color: grey; font-size: 13px;">
|
|
194
191
|
${opt.sub_title}
|
|
195
192
|
</div>
|
|
196
193
|
`
|
|
@@ -199,15 +196,43 @@ export class BgProduct {
|
|
|
199
196
|
</div>
|
|
200
197
|
${(() => {
|
|
201
198
|
var _a, _b;
|
|
199
|
+
const isVisibleProduct = opt.content.visible === 'false' && !obj.show_product_type
|
|
200
|
+
? BgWidget.warningInsignia('隱形商品', { size: 'sm' })
|
|
201
|
+
: '';
|
|
202
|
+
const productCategory = obj.show_product_type
|
|
203
|
+
? BgWidget.infoInsignia(ProductConfig.getName(opt.content), {
|
|
204
|
+
size: 'sm',
|
|
205
|
+
})
|
|
206
|
+
: '';
|
|
202
207
|
const collections = (_b = (_a = opt.content) === null || _a === void 0 ? void 0 : _a.collection) === null || _b === void 0 ? void 0 : _b.filter(Boolean).map((col) => BgWidget.normalInsignia(col, { size: 'sm' })).join('');
|
|
203
|
-
|
|
204
|
-
|
|
208
|
+
const renderString = `${isVisibleProduct}${productCategory}${collections}`;
|
|
209
|
+
return renderString
|
|
210
|
+
? html `<div class="d-flex flex-wrap gap-1 mt-2">${renderString}</div>`
|
|
205
211
|
: '';
|
|
206
212
|
})()}
|
|
207
213
|
</div>
|
|
208
214
|
<div class="text-end">
|
|
209
215
|
<div class="tx_normal_14">
|
|
210
|
-
|
|
216
|
+
${(() => {
|
|
217
|
+
const contentMap = {
|
|
218
|
+
price: () => {
|
|
219
|
+
var _a, _b;
|
|
220
|
+
return html `$${parseInt(`${(_a = opt.content[vm.orderString || 'min_price']) !== null && _a !== void 0 ? _a : opt.content.variants[(_b = opt.variant_index) !== null && _b !== void 0 ? _b : 0].sale_price}`, 10).toLocaleString()}`;
|
|
221
|
+
},
|
|
222
|
+
stock: () => {
|
|
223
|
+
var _a, _b;
|
|
224
|
+
const variant = opt.content.variants[(_a = opt.variant_index) !== null && _a !== void 0 ? _a : 0];
|
|
225
|
+
if (variant.show_understocking === 'false') {
|
|
226
|
+
return '不追蹤庫存';
|
|
227
|
+
}
|
|
228
|
+
const n = Number(opt.content.variants[(_b = opt.variant_index) !== null && _b !== void 0 ? _b : 0].stock);
|
|
229
|
+
return html `庫存 ${(isNaN(n) ? 0 : n).toLocaleString()} 個`;
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
return (obj.right_element_type
|
|
233
|
+
? contentMap[obj.right_element_type]
|
|
234
|
+
: contentMap.price)();
|
|
235
|
+
})()}
|
|
211
236
|
</div>
|
|
212
237
|
${opt.note ? html ` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
213
238
|
</div>
|
|
@@ -215,7 +240,7 @@ export class BgProduct {
|
|
|
215
240
|
},
|
|
216
241
|
divCreate: {
|
|
217
242
|
class: 'd-flex align-items-center',
|
|
218
|
-
style:
|
|
243
|
+
style: `gap: ${document.body.clientWidth > 800 ? 24 : 12}px`,
|
|
219
244
|
},
|
|
220
245
|
};
|
|
221
246
|
}) + BgWidget.horizontalLine({ margin: 0.15 }));
|
|
@@ -269,18 +294,14 @@ export class BgProduct {
|
|
|
269
294
|
data.response.data.map((product) => {
|
|
270
295
|
var _a;
|
|
271
296
|
const image = (_a = product.content.preview_image[0]) !== null && _a !== void 0 ? _a : BgWidget.noImageURL;
|
|
272
|
-
const
|
|
273
|
-
product.content.visible === 'false' ? BgWidget.warningInsignia('隱形商品') : '',
|
|
274
|
-
product.content.title,
|
|
275
|
-
]
|
|
276
|
-
.filter(Boolean)
|
|
277
|
-
.join('');
|
|
297
|
+
const title = product.content.title;
|
|
278
298
|
if (obj.with_variants) {
|
|
279
|
-
product.content.variants.map((variant) => {
|
|
299
|
+
product.content.variants.map((variant, index) => {
|
|
280
300
|
vm.options.push({
|
|
281
301
|
key: `${product.content.id}-${variant.spec.join('-')}`,
|
|
282
302
|
sub_title: variant.spec.join('-') ? `規格:${variant.spec.join('-')}` : '',
|
|
283
|
-
|
|
303
|
+
variant_index: index,
|
|
304
|
+
value: title,
|
|
284
305
|
content: product.content,
|
|
285
306
|
image: image,
|
|
286
307
|
});
|
|
@@ -289,7 +310,7 @@ export class BgProduct {
|
|
|
289
310
|
else {
|
|
290
311
|
vm.options.push({
|
|
291
312
|
key: product.content.id,
|
|
292
|
-
value:
|
|
313
|
+
value: title,
|
|
293
314
|
content: product.content,
|
|
294
315
|
image: image,
|
|
295
316
|
});
|