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.
Files changed (111) 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-product.js +39 -18
  10. package/lowcode/backend-manager/bg-product.ts +54 -23
  11. package/lowcode/backend-manager/bg-recommend.js +15 -9
  12. package/lowcode/backend-manager/bg-recommend.ts +16 -9
  13. package/lowcode/backend-manager/bg-sns.js +16 -9
  14. package/lowcode/backend-manager/bg-sns.ts +18 -11
  15. package/lowcode/backend-manager/bg-widget.js +325 -261
  16. package/lowcode/backend-manager/bg-widget.ts +117 -45
  17. package/lowcode/cms-plugin/auto-fcm-history.js +15 -6
  18. package/lowcode/cms-plugin/auto-fcm-history.ts +18 -11
  19. package/lowcode/cms-plugin/auto-reply.js +17 -1
  20. package/lowcode/cms-plugin/auto-reply.ts +16 -1
  21. package/lowcode/cms-plugin/exhibition-list.js +11 -2
  22. package/lowcode/cms-plugin/exhibition-list.ts +12 -2
  23. package/lowcode/cms-plugin/live_capture.js +2 -2
  24. package/lowcode/cms-plugin/live_capture.ts +2 -2
  25. package/lowcode/cms-plugin/model/order.d.ts +1 -0
  26. package/lowcode/cms-plugin/module/order-excel.js +15 -1
  27. package/lowcode/cms-plugin/module/order-excel.ts +22 -2
  28. package/lowcode/cms-plugin/module/table-storage.js +11 -0
  29. package/lowcode/cms-plugin/module/table-storage.ts +12 -0
  30. package/lowcode/cms-plugin/permission-setting.js +16 -9
  31. package/lowcode/cms-plugin/permission-setting.ts +18 -10
  32. package/lowcode/cms-plugin/pos-pages/payment-page.js +37 -29
  33. package/lowcode/cms-plugin/pos-pages/payment-page.ts +61 -49
  34. package/lowcode/cms-plugin/pos-pages/pos-function.js +6 -1
  35. package/lowcode/cms-plugin/pos-pages/pos-function.ts +8 -1
  36. package/lowcode/cms-plugin/reconciliation-area.js +12 -3
  37. package/lowcode/cms-plugin/reconciliation-area.ts +13 -3
  38. package/lowcode/cms-plugin/shopping-allowance-manager.js +12 -3
  39. package/lowcode/cms-plugin/shopping-allowance-manager.ts +13 -3
  40. package/lowcode/cms-plugin/shopping-invoice-manager.js +12 -3
  41. package/lowcode/cms-plugin/shopping-invoice-manager.ts +13 -4
  42. package/lowcode/cms-plugin/shopping-order-manager.js +12 -3
  43. package/lowcode/cms-plugin/shopping-order-manager.ts +13 -4
  44. package/lowcode/cms-plugin/shopping-product-setting.js +16 -10
  45. package/lowcode/cms-plugin/shopping-product-setting.ts +17 -10
  46. package/lowcode/cms-plugin/shopping-product-stock.js +17 -11
  47. package/lowcode/cms-plugin/shopping-product-stock.ts +18 -11
  48. package/lowcode/cms-plugin/shopping-setting-basic.js +129 -38
  49. package/lowcode/cms-plugin/shopping-setting-basic.ts +134 -38
  50. package/lowcode/cms-plugin/stock-history.js +15 -7
  51. package/lowcode/cms-plugin/stock-history.ts +16 -17
  52. package/lowcode/cms-plugin/stock-stores.js +13 -6
  53. package/lowcode/cms-plugin/stock-stores.ts +14 -6
  54. package/lowcode/cms-plugin/stock-vendors.js +13 -6
  55. package/lowcode/cms-plugin/stock-vendors.ts +14 -6
  56. package/lowcode/cms-plugin/user-list.js +24 -7
  57. package/lowcode/cms-plugin/user-list.ts +25 -7
  58. package/lowcode/css/editor.css +11 -6
  59. package/lowcode/form-view/e-commerce/product-select.js +13 -11
  60. package/lowcode/form-view/e-commerce/product-select.ts +14 -12
  61. package/lowcode/modules/tool.js +9 -0
  62. package/lowcode/modules/tool.ts +12 -0
  63. package/lowcode/public-components/checkout/index.js +216 -207
  64. package/lowcode/public-components/checkout/index.ts +1315 -1309
  65. package/lowcode/public-components/product/pd-class.js +11 -2
  66. package/lowcode/public-components/product/pd-class.ts +16 -3
  67. package/lowcode/public-components/public/ad.js +42 -10
  68. package/lowcode/public-components/public/ad.ts +28 -1
  69. package/lowcode/public-models/product.ts +1 -0
  70. package/lowcode/view-model/saas-view-model.js +394 -379
  71. package/lowcode/view-model/saas-view-model.ts +1451 -1405
  72. package/package.json +1 -1
  73. package/src/api-public/controllers/user.js +4 -4
  74. package/src/api-public/controllers/user.js.map +1 -1
  75. package/src/api-public/controllers/user.ts +4 -4
  76. package/src/api-public/models/glitter-finance.js +1 -2
  77. package/src/api-public/models/glitter-finance.js.map +1 -5
  78. package/src/api-public/services/data-analyze.d.ts +1 -1
  79. package/src/api-public/services/fb-api.d.ts +4 -3
  80. package/src/api-public/services/fb-api.js +72 -27
  81. package/src/api-public/services/fb-api.js.map +1 -1
  82. package/src/api-public/services/fb-api.ts +183 -127
  83. package/src/api-public/services/fb-service.js +4 -4
  84. package/src/api-public/services/fb-service.js.map +1 -1
  85. package/src/api-public/services/schedule.d.ts +1 -1
  86. package/src/api-public/services/schedule.js +18 -14
  87. package/src/api-public/services/schedule.js.map +1 -1
  88. package/src/api-public/services/schedule.ts +18 -14
  89. package/src/api-public/services/user.d.ts +6 -5
  90. package/src/api-public/services/user.js +12 -10
  91. package/src/api-public/services/user.js.map +1 -1
  92. package/src/api-public/services/user.ts +14 -10
  93. package/src/config.d.ts +1 -1
  94. package/src/modules/AWSLib.js +2 -3
  95. package/src/modules/AWSLib.js.map +1 -1
  96. package/src/modules/database.d.ts +1 -1
  97. package/src/modules/redis.d.ts +1 -1
  98. package/src/modules/tool.d.ts +4 -4
  99. package/src/modules/tool.js +1 -2
  100. package/src/modules/tool.js.map +1 -1
  101. package/src/seo-config.js +1 -0
  102. package/src/seo-config.js.map +1 -1
  103. package/src/seo-config.ts +1 -0
  104. package/src/services/backend-service.js +17 -7
  105. package/src/services/backend-service.js.map +1 -1
  106. package/src/services/create-instance.js +3 -4
  107. package/src/services/create-instance.js.map +1 -1
  108. package/src/services/saas-table-check.js +2 -2
  109. package/src/services/saas-table-check.js.map +1 -5
  110. package/src/services/tool.js +2 -3
  111. package/src/services/tool.js.map +1 -1
@@ -16,6 +16,7 @@ export type OptionsItem = {
16
16
  note?: string;
17
17
  sub_title?: string;
18
18
  content?: any;
19
+ variant_index?: number;
19
20
  };
20
21
 
21
22
  type CollectionItem = {
@@ -77,6 +78,7 @@ export class BgProduct {
77
78
  filter_visible?: string;
78
79
  with_variants?: boolean;
79
80
  show_product_type?: boolean;
81
+ right_element_type?: 'price' | 'stock';
80
82
  }) {
81
83
  const glitter = (window.parent as any).glitter;
82
84
  return (window.parent as any).glitter.innerDialog((gvc: GVC) => {
@@ -225,13 +227,11 @@ export class BgProduct {
225
227
  style="text-wrap: auto;"
226
228
  onclick="${gvc.event(() => call())}"
227
229
  >
228
- ${obj.show_product_type
229
- ? BgWidget.infoInsignia(ProductConfig.getName(opt.content))
230
- : ''}${opt.value}
230
+ ${opt.value}
231
231
  </div>
232
232
  ${opt.sub_title
233
233
  ? html`
234
- <div class="fw-500" style="color:grey;font-size:13px;">
234
+ <div class="fw-500" style="color: grey; font-size: 13px;">
235
235
  ${opt.sub_title}
236
236
  </div>
237
237
  `
@@ -239,24 +239,59 @@ export class BgProduct {
239
239
  </div>
240
240
  </div>
241
241
  ${(() => {
242
+ const isVisibleProduct =
243
+ opt.content.visible === 'false' && !obj.show_product_type
244
+ ? BgWidget.warningInsignia('隱形商品', { size: 'sm' })
245
+ : '';
246
+
247
+ const productCategory = obj.show_product_type
248
+ ? BgWidget.infoInsignia(ProductConfig.getName(opt.content), {
249
+ size: 'sm',
250
+ })
251
+ : '';
252
+
242
253
  const collections = opt.content?.collection
243
254
  ?.filter(Boolean)
244
255
  .map((col: string) => BgWidget.normalInsignia(col, { size: 'sm' }))
245
256
  .join('');
246
- return collections
247
- ? html`<div class="d-flex flex-wrap gap-1 mt-2">${collections}</div>`
257
+
258
+ const renderString = `${isVisibleProduct}${productCategory}${collections}`;
259
+
260
+ return renderString
261
+ ? html`<div class="d-flex flex-wrap gap-1 mt-2">${renderString}</div>`
248
262
  : '';
249
263
  })()}
250
264
  </div>
251
265
  <div class="text-end">
252
266
  <div class="tx_normal_14">
253
- $${parseInt(
254
- `${
255
- opt.content[vm.orderString || 'min_price'] ??
256
- opt.content.variants[0].sale_price
257
- }`,
258
- 10
259
- ).toLocaleString()}
267
+ ${(() => {
268
+ const contentMap: Record<string, () => string> = {
269
+ price: () => {
270
+ return html`$${parseInt(
271
+ `${
272
+ opt.content[vm.orderString || 'min_price'] ??
273
+ opt.content.variants[opt.variant_index ?? 0].sale_price
274
+ }`,
275
+ 10
276
+ ).toLocaleString()}`;
277
+ },
278
+ stock: () => {
279
+ const variant = opt.content.variants[opt.variant_index ?? 0];
280
+ if (variant.show_understocking === 'false') {
281
+ return '不追蹤庫存';
282
+ }
283
+
284
+ const n = Number(opt.content.variants[opt.variant_index ?? 0].stock);
285
+ return html`庫存 ${(isNaN(n) ? 0 : n).toLocaleString()} 個`;
286
+ },
287
+ };
288
+
289
+ return (
290
+ obj.right_element_type
291
+ ? contentMap[obj.right_element_type]
292
+ : contentMap.price
293
+ )();
294
+ })()}
260
295
  </div>
261
296
  ${opt.note ? html` <div class="tx_gray_12">${opt.note}</div> ` : ''}
262
297
  </div>
@@ -264,7 +299,7 @@ export class BgProduct {
264
299
  },
265
300
  divCreate: {
266
301
  class: 'd-flex align-items-center',
267
- style: 'gap: 24px',
302
+ style: `gap: ${document.body.clientWidth > 800 ? 24 : 12}px`,
268
303
  },
269
304
  };
270
305
  }) + BgWidget.horizontalLine({ margin: 0.15 })
@@ -332,19 +367,15 @@ export class BgProduct {
332
367
  content: { id: number; title: string; preview_image: string[]; variants: any; visible: string };
333
368
  }) => {
334
369
  const image = product.content.preview_image[0] ?? BgWidget.noImageURL;
335
- const value = [
336
- product.content.visible === 'false' ? BgWidget.warningInsignia('隱形商品') : '',
337
- product.content.title,
338
- ]
339
- .filter(Boolean)
340
- .join('');
370
+ const title = product.content.title;
341
371
 
342
372
  if (obj.with_variants) {
343
- product.content.variants.map((variant: any) => {
373
+ product.content.variants.map((variant: any, index: number) => {
344
374
  vm.options.push({
345
375
  key: `${product.content.id}-${variant.spec.join('-')}`,
346
376
  sub_title: variant.spec.join('-') ? `規格:${variant.spec.join('-')}` : '',
347
- value: value,
377
+ variant_index: index,
378
+ value: title,
348
379
  content: product.content,
349
380
  image: image,
350
381
  });
@@ -352,7 +383,7 @@ export class BgProduct {
352
383
  } else {
353
384
  vm.options.push({
354
385
  key: product.content.id,
355
- value: value,
386
+ value: title,
356
387
  content: product.content,
357
388
  image: image,
358
389
  });
@@ -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;
@@ -21,6 +21,7 @@ import { BgListComponent } from './bg-list-component.js';
21
21
  import { Tool } from '../modules/tool.js';
22
22
  import { ApiWallet } from '../glitter-base/route/wallet.js';
23
23
  import { ApiSns } from '../glitter-base/route/sms.js';
24
+ import { TableStorage } from '../cms-plugin/module/table-storage.js';
24
25
  const html = String.raw;
25
26
  const inputStyle = 'font-size: 16px; height:40px; width:300px;';
26
27
  export class BgSNS {
@@ -265,6 +266,7 @@ export class BgSNS {
265
266
  query: '',
266
267
  queryType: 'email',
267
268
  filter: {},
269
+ listLimit: TableStorage.getLimit(),
268
270
  };
269
271
  return gvc.bindView(() => {
270
272
  const ListComp = new BgListComponent(gvc, vm, FilterOptions.emailFilterFrame);
@@ -290,17 +292,23 @@ export class BgSNS {
290
292
  gvc,
291
293
  callback: (value) => {
292
294
  vm.queryType = value;
293
- gvc.notifyDataChange(vm.tableId);
294
- gvc.notifyDataChange(id);
295
+ gvc.notifyDataChange([vm.tableId, id]);
295
296
  },
296
297
  default: vm.queryType || 'email',
297
298
  options: FilterOptions.snsSelect,
298
299
  }),
299
300
  BgWidget.searchFilter(gvc.event(e => {
300
301
  vm.query = `${e.value}`.trim();
301
- gvc.notifyDataChange(vm.tableId);
302
- gvc.notifyDataChange(id);
302
+ gvc.notifyDataChange([vm.tableId, id]);
303
303
  }), vm.query || '', '搜尋所有信件內容'),
304
+ BgWidget.countingFilter({
305
+ gvc,
306
+ callback: value => {
307
+ vm.listLimit = value;
308
+ gvc.notifyDataChange([vm.tableId, id]);
309
+ },
310
+ default: vm.listLimit,
311
+ }),
304
312
  BgWidget.funnelFilter({
305
313
  gvc,
306
314
  callback: () => {
@@ -320,10 +328,9 @@ export class BgSNS {
320
328
  gvc: gvc,
321
329
  getData: vmi => {
322
330
  var _a, _b;
323
- const limit = 20;
324
331
  ApiSns.history({
325
332
  page: vmi.page - 1,
326
- limit: limit,
333
+ limit: vm.listLimit,
327
334
  search: (_a = vm.query) !== null && _a !== void 0 ? _a : '',
328
335
  searchType: (_b = vm.queryType) !== null && _b !== void 0 ? _b : 'email',
329
336
  sendTime: undefined,
@@ -409,7 +416,7 @@ export class BgSNS {
409
416
  });
410
417
  }
411
418
  vm.dataList = data.response.data;
412
- vmi.pageSize = Math.ceil(data.response.total / limit);
419
+ vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
413
420
  vmi.originalData = vm.dataList;
414
421
  vmi.tableData = getDatalist();
415
422
  vmi.loading = false;
@@ -843,7 +850,7 @@ export class BgSNS {
843
850
  ApiUser.getUserList({
844
851
  page: 0,
845
852
  limit: 99999,
846
- only_id: true
853
+ only_id: true,
847
854
  }).then(dd => {
848
855
  dd.response.data.map((user) => {
849
856
  if (user.userData.email && user.userData.email.length > 0 && user.userData.phone) {
@@ -1195,7 +1202,7 @@ export class BgSNS {
1195
1202
  ApiUser.getUserList({
1196
1203
  page: 0,
1197
1204
  limit: 99999,
1198
- only_id: true
1205
+ only_id: true,
1199
1206
  }).then(dd => {
1200
1207
  if (dd.response.data) {
1201
1208
  const ids = [];
@@ -9,11 +9,11 @@ import { FormWidget } from '../official_view_component/official/form.js';
9
9
  import { Chat } from '../glitter-base/route/chat.js';
10
10
  import { FilterOptions } from '../cms-plugin/filter-options.js';
11
11
  import { ShoppingDiscountSetting } from '../cms-plugin/shopping-discount-setting.js';
12
- import { ApiSmtp } from '../glitter-base/route/smtp.js';
13
12
  import { BgListComponent } from './bg-list-component.js';
14
13
  import { Tool } from '../modules/tool.js';
15
14
  import { ApiWallet } from '../glitter-base/route/wallet.js';
16
15
  import { ApiSns } from '../glitter-base/route/sms.js';
16
+ import { TableStorage } from '../cms-plugin/module/table-storage.js';
17
17
 
18
18
  const html = String.raw;
19
19
 
@@ -320,6 +320,7 @@ export class BgSNS {
320
320
  query?: string;
321
321
  queryType?: string;
322
322
  filter?: any;
323
+ listLimit: number;
323
324
  } = {
324
325
  id: glitter.getUUID(),
325
326
  tableId: glitter.getUUID(),
@@ -329,6 +330,7 @@ export class BgSNS {
329
330
  query: '',
330
331
  queryType: 'email',
331
332
  filter: {},
333
+ listLimit: TableStorage.getLimit(),
332
334
  };
333
335
  return gvc.bindView(() => {
334
336
  const ListComp = new BgListComponent(gvc, vm, FilterOptions.emailFilterFrame);
@@ -356,8 +358,7 @@ export class BgSNS {
356
358
  gvc,
357
359
  callback: (value: any) => {
358
360
  vm.queryType = value;
359
- gvc.notifyDataChange(vm.tableId);
360
- gvc.notifyDataChange(id);
361
+ gvc.notifyDataChange([vm.tableId, id]);
361
362
  },
362
363
  default: vm.queryType || 'email',
363
364
  options: FilterOptions.snsSelect,
@@ -365,12 +366,19 @@ export class BgSNS {
365
366
  BgWidget.searchFilter(
366
367
  gvc.event(e => {
367
368
  vm.query = `${e.value}`.trim();
368
- gvc.notifyDataChange(vm.tableId);
369
- gvc.notifyDataChange(id);
369
+ gvc.notifyDataChange([vm.tableId, id]);
370
370
  }),
371
371
  vm.query || '',
372
372
  '搜尋所有信件內容'
373
373
  ),
374
+ BgWidget.countingFilter({
375
+ gvc,
376
+ callback: value => {
377
+ vm.listLimit = value;
378
+ gvc.notifyDataChange([vm.tableId, id]);
379
+ },
380
+ default: vm.listLimit,
381
+ }),
374
382
  BgWidget.funnelFilter({
375
383
  gvc,
376
384
  callback: () => {
@@ -390,10 +398,9 @@ export class BgSNS {
390
398
  return BgWidget.tableV3({
391
399
  gvc: gvc,
392
400
  getData: vmi => {
393
- const limit = 20;
394
401
  ApiSns.history({
395
402
  page: vmi.page - 1,
396
- limit: limit,
403
+ limit: vm.listLimit,
397
404
  search: vm.query ?? '',
398
405
  searchType: vm.queryType ?? 'email',
399
406
  sendTime: undefined,
@@ -483,7 +490,7 @@ export class BgSNS {
483
490
  }
484
491
 
485
492
  vm.dataList = data.response.data;
486
- vmi.pageSize = Math.ceil(data.response.total / limit);
493
+ vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
487
494
  vmi.originalData = vm.dataList;
488
495
  vmi.tableData = getDatalist();
489
496
  vmi.loading = false;
@@ -946,7 +953,7 @@ export class BgSNS {
946
953
  ApiUser.getUserList({
947
954
  page: 0,
948
955
  limit: 99999,
949
- only_id:true
956
+ only_id: true,
950
957
  }).then(dd => {
951
958
  dd.response.data.map((user: any) => {
952
959
  if (user.userData.email && user.userData.email.length > 0 && user.userData.phone) {
@@ -1321,7 +1328,7 @@ export class BgSNS {
1321
1328
  ApiUser.getUserList({
1322
1329
  page: 0,
1323
1330
  limit: 99999,
1324
- only_id:true
1331
+ only_id: true,
1325
1332
  }).then(dd => {
1326
1333
  if (dd.response.data) {
1327
1334
  const ids: number[] = [];
@@ -1387,7 +1394,7 @@ export class BgSNS {
1387
1394
  ApiUser.getUserList({
1388
1395
  page: 0,
1389
1396
  limit: 99999,
1390
- only_id:true,
1397
+ only_id: true,
1391
1398
  search: data.query,
1392
1399
  }).then(dd => {
1393
1400
  if (dd.response.data) {