ts-glitter 21.1.8 → 21.2.0

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.
Files changed (78) hide show
  1. package/lowcode/Entry.js +14 -1
  2. package/lowcode/Entry.ts +13 -1
  3. package/lowcode/backend-manager/bg-line.js +18 -10
  4. package/lowcode/backend-manager/bg-line.ts +19 -10
  5. package/lowcode/backend-manager/bg-list-component.js +1 -2
  6. package/lowcode/backend-manager/bg-list-component.ts +1 -1
  7. package/lowcode/backend-manager/bg-notify.js +17 -10
  8. package/lowcode/backend-manager/bg-notify.ts +19 -11
  9. package/lowcode/backend-manager/bg-recommend.js +15 -9
  10. package/lowcode/backend-manager/bg-recommend.ts +16 -9
  11. package/lowcode/backend-manager/bg-sns.js +16 -9
  12. package/lowcode/backend-manager/bg-sns.ts +18 -11
  13. package/lowcode/backend-manager/bg-widget.js +325 -261
  14. package/lowcode/backend-manager/bg-widget.ts +117 -45
  15. package/lowcode/cms-plugin/auto-fcm-history.js +15 -6
  16. package/lowcode/cms-plugin/auto-fcm-history.ts +18 -11
  17. package/lowcode/cms-plugin/auto-reply.js +17 -1
  18. package/lowcode/cms-plugin/auto-reply.ts +16 -1
  19. package/lowcode/cms-plugin/exhibition-list.js +11 -2
  20. package/lowcode/cms-plugin/exhibition-list.ts +12 -2
  21. package/lowcode/cms-plugin/live_capture.js +2 -2
  22. package/lowcode/cms-plugin/live_capture.ts +2 -2
  23. package/lowcode/cms-plugin/model/order.d.ts +1 -0
  24. package/lowcode/cms-plugin/module/order-excel.js +15 -1
  25. package/lowcode/cms-plugin/module/order-excel.ts +22 -2
  26. package/lowcode/cms-plugin/module/table-storage.js +11 -0
  27. package/lowcode/cms-plugin/module/table-storage.ts +12 -0
  28. package/lowcode/cms-plugin/permission-setting.js +16 -9
  29. package/lowcode/cms-plugin/permission-setting.ts +18 -10
  30. package/lowcode/cms-plugin/reconciliation-area.js +12 -3
  31. package/lowcode/cms-plugin/reconciliation-area.ts +13 -3
  32. package/lowcode/cms-plugin/shopping-allowance-manager.js +12 -3
  33. package/lowcode/cms-plugin/shopping-allowance-manager.ts +13 -3
  34. package/lowcode/cms-plugin/shopping-invoice-manager.js +12 -3
  35. package/lowcode/cms-plugin/shopping-invoice-manager.ts +13 -4
  36. package/lowcode/cms-plugin/shopping-order-manager.js +12 -3
  37. package/lowcode/cms-plugin/shopping-order-manager.ts +13 -4
  38. package/lowcode/cms-plugin/shopping-product-setting.js +16 -10
  39. package/lowcode/cms-plugin/shopping-product-setting.ts +17 -10
  40. package/lowcode/cms-plugin/shopping-product-stock.js +17 -11
  41. package/lowcode/cms-plugin/shopping-product-stock.ts +18 -11
  42. package/lowcode/cms-plugin/shopping-setting-basic.js +129 -38
  43. package/lowcode/cms-plugin/shopping-setting-basic.ts +134 -38
  44. package/lowcode/cms-plugin/stock-history.js +14 -7
  45. package/lowcode/cms-plugin/stock-history.ts +15 -7
  46. package/lowcode/cms-plugin/stock-stores.js +13 -6
  47. package/lowcode/cms-plugin/stock-stores.ts +14 -6
  48. package/lowcode/cms-plugin/stock-vendors.js +13 -6
  49. package/lowcode/cms-plugin/stock-vendors.ts +14 -6
  50. package/lowcode/cms-plugin/user-list.js +24 -7
  51. package/lowcode/cms-plugin/user-list.ts +25 -7
  52. package/lowcode/css/editor.css +9 -4
  53. package/lowcode/public-components/product/pd-class.js +11 -2
  54. package/lowcode/public-components/product/pd-class.ts +16 -3
  55. package/lowcode/public-components/public/ad.js +42 -10
  56. package/lowcode/public-components/public/ad.ts +28 -1
  57. package/lowcode/public-models/product.ts +1 -0
  58. package/lowcode/view-model/saas-view-model.js +394 -379
  59. package/lowcode/view-model/saas-view-model.ts +1451 -1405
  60. package/package.json +1 -1
  61. package/src/api-public/controllers/user.js +4 -4
  62. package/src/api-public/controllers/user.js.map +1 -1
  63. package/src/api-public/controllers/user.ts +4 -4
  64. package/src/api-public/services/checkout-event.js +7 -17
  65. package/src/api-public/services/checkout-event.js.map +1 -1
  66. package/src/api-public/services/fb-api.d.ts +4 -3
  67. package/src/api-public/services/fb-api.js +71 -27
  68. package/src/api-public/services/fb-api.js.map +1 -1
  69. package/src/api-public/services/fb-api.ts +182 -127
  70. package/src/api-public/services/user.d.ts +6 -5
  71. package/src/api-public/services/user.js +19 -27
  72. package/src/api-public/services/user.js.map +1 -1
  73. package/src/api-public/services/user.ts +14 -10
  74. package/src/seo-config.js +1 -0
  75. package/src/seo-config.js.map +1 -1
  76. package/src/seo-config.ts +1 -0
  77. package/src/services/app.js +7 -17
  78. package/src/services/app.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.8';
149
+ glitter.share.editerVersion = 'V_21.2.0';
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.8';
153
+ glitter.share.editerVersion = 'V_21.2.0';
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: 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 / limit);
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, only_id: true,
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: 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 / limit);
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, only_id:true,
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;">${(_a = filterList[2]) !== null && _a !== void 0 ? _a : ''} ${(_b = filterList[3]) !== null && _b !== void 0 ? _b : ''} ${(_c = filterList[4]) !== null && _c !== void 0 ? _c : ''}</div>
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[2] ?? ''} ${filterList[3] ?? ''} ${filterList[4] ?? ''}</div>
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: 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 / limit);
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: 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 / limit);
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
@@ -18,6 +18,7 @@ import { Tool } from '../modules/tool.js';
18
18
  import { BgProduct } from './bg-product.js';
19
19
  import { CheckInput } from '../modules/checkInput.js';
20
20
  import { ShoppingOrderManager } from '../cms-plugin/shopping-order-manager.js';
21
+ import { TableStorage } from '../cms-plugin/module/table-storage.js';
21
22
  export class BgRecommend {
22
23
  static linkList(gvc, widget) {
23
24
  const html = String.raw;
@@ -284,6 +285,7 @@ export class BgRecommend {
284
285
  group: { type: 'level', title: '', tag: '' },
285
286
  filter: {},
286
287
  orderString: 'default',
288
+ listLimit: TableStorage.getLimit(),
287
289
  };
288
290
  const ListComp = new BgListComponent(gvc, vm, FilterOptions.recommendUserFilterFrame);
289
291
  vm.filter = ListComp.getFilterObject();
@@ -343,23 +345,28 @@ export class BgRecommend {
343
345
  gvc,
344
346
  callback: (value) => {
345
347
  vm.queryType = value;
346
- gvc.notifyDataChange(vm.tableId);
347
- gvc.notifyDataChange(fvm.id);
348
+ gvc.notifyDataChange([vm.tableId, fvm.id]);
348
349
  },
349
350
  default: vm.queryType || 'name',
350
351
  options: FilterOptions.recommendUserSelect,
351
352
  }),
352
353
  BgWidget.searchFilter(gvc.event(e => {
353
354
  vm.query = `${e.value}`.trim();
354
- gvc.notifyDataChange(vm.tableId);
355
- gvc.notifyDataChange(fvm.id);
355
+ gvc.notifyDataChange([vm.tableId, fvm.id]);
356
356
  }), vm.query || '', '搜尋推薦人'),
357
+ BgWidget.countingFilter({
358
+ gvc,
359
+ callback: value => {
360
+ vm.listLimit = value;
361
+ gvc.notifyDataChange([vm.tableId, fvm.id]);
362
+ },
363
+ default: vm.listLimit,
364
+ }),
357
365
  BgWidget.updownFilter({
358
366
  gvc,
359
367
  callback: (value) => {
360
368
  vm.orderString = value;
361
- gvc.notifyDataChange(vm.tableId);
362
- gvc.notifyDataChange(fvm.id);
369
+ gvc.notifyDataChange([vm.tableId, fvm.id]);
363
370
  },
364
371
  default: vm.orderString || 'default',
365
372
  options: FilterOptions.recommendUserOrderBy,
@@ -387,10 +394,9 @@ export class BgRecommend {
387
394
  gvc: gvc,
388
395
  getData: (vd) => __awaiter(this, void 0, void 0, function* () {
389
396
  vmi = vd;
390
- const limit = 15;
391
397
  ApiRecommend.getUsers({
392
398
  data: {},
393
- limit: limit,
399
+ limit: vm.listLimit,
394
400
  page: vmi.page - 1,
395
401
  token: window.parent.config.token,
396
402
  search: vm.query,
@@ -398,7 +404,7 @@ export class BgRecommend {
398
404
  orderBy: vm.orderString,
399
405
  }).then(data => {
400
406
  vm.dataList = data.response.data;
401
- vmi.pageSize = Math.ceil(data.response.total / limit);
407
+ vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
402
408
  vmi.originalData = vm.dataList;
403
409
  vmi.tableData = getDatalist();
404
410
  vmi.loading = false;
@@ -10,6 +10,7 @@ import { Tool } from '../modules/tool.js';
10
10
  import { BgProduct } from './bg-product.js';
11
11
  import { CheckInput } from '../modules/checkInput.js';
12
12
  import { ShoppingOrderManager } from '../cms-plugin/shopping-order-manager.js';
13
+ import { TableStorage } from '../cms-plugin/module/table-storage.js';
13
14
 
14
15
  export type OptionsItem = {
15
16
  key: number | string;
@@ -354,6 +355,7 @@ export class BgRecommend {
354
355
  group: { type: string; title: string; tag: string };
355
356
  filter: any;
356
357
  orderString: string;
358
+ listLimit: number;
357
359
  } = {
358
360
  id: glitter.getUUID(),
359
361
  tableId: glitter.getUUID(),
@@ -366,6 +368,7 @@ export class BgRecommend {
366
368
  group: { type: 'level', title: '', tag: '' },
367
369
  filter: {},
368
370
  orderString: 'default',
371
+ listLimit: TableStorage.getLimit(),
369
372
  };
370
373
 
371
374
  const ListComp = new BgListComponent(gvc, vm, FilterOptions.recommendUserFilterFrame);
@@ -433,8 +436,7 @@ export class BgRecommend {
433
436
  gvc,
434
437
  callback: (value: any) => {
435
438
  vm.queryType = value;
436
- gvc.notifyDataChange(vm.tableId);
437
- gvc.notifyDataChange(fvm.id);
439
+ gvc.notifyDataChange([vm.tableId, fvm.id]);
438
440
  },
439
441
  default: vm.queryType || 'name',
440
442
  options: FilterOptions.recommendUserSelect,
@@ -442,18 +444,24 @@ export class BgRecommend {
442
444
  BgWidget.searchFilter(
443
445
  gvc.event(e => {
444
446
  vm.query = `${e.value}`.trim();
445
- gvc.notifyDataChange(vm.tableId);
446
- gvc.notifyDataChange(fvm.id);
447
+ gvc.notifyDataChange([vm.tableId, fvm.id]);
447
448
  }),
448
449
  vm.query || '',
449
450
  '搜尋推薦人'
450
451
  ),
452
+ BgWidget.countingFilter({
453
+ gvc,
454
+ callback: value => {
455
+ vm.listLimit = value;
456
+ gvc.notifyDataChange([vm.tableId, fvm.id]);
457
+ },
458
+ default: vm.listLimit,
459
+ }),
451
460
  BgWidget.updownFilter({
452
461
  gvc,
453
462
  callback: (value: any) => {
454
463
  vm.orderString = value;
455
- gvc.notifyDataChange(vm.tableId);
456
- gvc.notifyDataChange(fvm.id);
464
+ gvc.notifyDataChange([vm.tableId, fvm.id]);
457
465
  },
458
466
  default: vm.orderString || 'default',
459
467
  options: FilterOptions.recommendUserOrderBy,
@@ -482,10 +490,9 @@ export class BgRecommend {
482
490
  gvc: gvc,
483
491
  getData: async vd => {
484
492
  vmi = vd;
485
- const limit = 15;
486
493
  ApiRecommend.getUsers({
487
494
  data: {},
488
- limit: limit,
495
+ limit: vm.listLimit,
489
496
  page: vmi.page - 1,
490
497
  token: (window.parent as any).config.token,
491
498
  search: vm.query,
@@ -493,7 +500,7 @@ export class BgRecommend {
493
500
  orderBy: vm.orderString,
494
501
  }).then(data => {
495
502
  vm.dataList = data.response.data;
496
- vmi.pageSize = Math.ceil(data.response.total / limit);
503
+ vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
497
504
  vmi.originalData = vm.dataList;
498
505
  vmi.tableData = getDatalist();
499
506
  vmi.loading = false;