ts-glitter 16.1.0 → 16.1.2

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 (43) hide show
  1. package/lowcode/Entry.js +1 -1
  2. package/lowcode/Entry.ts +1 -1
  3. package/lowcode/backend-manager/bg-widget.ts +1 -1
  4. package/lowcode/cms-plugin/POS-setting.js +124 -48
  5. package/lowcode/cms-plugin/POS-setting.ts +129 -53
  6. package/lowcode/cms-plugin/data-analyze-module.js +506 -62
  7. package/lowcode/cms-plugin/data-analyze-module.ts +646 -160
  8. package/lowcode/cms-plugin/data-analyze-orders.js +90 -0
  9. package/lowcode/cms-plugin/data-analyze-orders.ts +113 -0
  10. package/lowcode/cms-plugin/data-analyze-products.js +168 -0
  11. package/lowcode/cms-plugin/data-analyze-products.ts +195 -0
  12. package/lowcode/cms-plugin/permission-setting.js +133 -66
  13. package/lowcode/cms-plugin/permission-setting.ts +481 -411
  14. package/lowcode/cms-plugin/pos-pages/payment-page.js +2 -1
  15. package/lowcode/cms-plugin/pos-pages/payment-page.ts +2 -1
  16. package/lowcode/cms-plugin/pos-pages/pos-function.js +119 -0
  17. package/lowcode/cms-plugin/pos-pages/pos-function.ts +122 -0
  18. package/lowcode/cms-plugin/pos-pages/products-page.js +2 -2
  19. package/lowcode/cms-plugin/pos-pages/products-page.ts +3 -2
  20. package/lowcode/cms-plugin/shopping-information.ts +1 -1
  21. package/lowcode/cms-plugin/shopping-order-manager.js +29 -2
  22. package/lowcode/cms-plugin/shopping-order-manager.ts +37 -11
  23. package/lowcode/cms-plugin/stock-stores.js +95 -64
  24. package/lowcode/cms-plugin/stock-stores.ts +387 -355
  25. package/lowcode/glitter-base/route/shopping.js +2 -2
  26. package/lowcode/glitter-base/route/shopping.ts +2 -2
  27. package/lowcode/glitter-base/route/user.ts +1 -0
  28. package/lowcode/glitterBundle/dialog/ShareDialog.ts +2 -2
  29. package/lowcode/glitterBundle/dialog/dialog.js +4 -1
  30. package/lowcode/glitterBundle/dialog/dialog.ts +4 -1
  31. package/lowcode/img/user-group-crown-regular.svg +1 -0
  32. package/lowcode/jspage/function-page/setting_editor.js +27 -1
  33. package/lowcode/jspage/function-page/setting_editor.ts +36 -1
  34. package/lowcode/public-components/product/product-list.js +10 -2
  35. package/lowcode/public-components/product/product-list.ts +10 -3
  36. package/package.json +1 -1
  37. package/src/api-public/controllers/shop.js +1 -1
  38. package/src/api-public/controllers/shop.js.map +1 -1
  39. package/src/api-public/controllers/shop.ts +1 -1
  40. package/src/api-public/services/shopping.d.ts +9 -2
  41. package/src/api-public/services/shopping.js +23 -8
  42. package/src/api-public/services/shopping.js.map +1 -1
  43. package/src/api-public/services/shopping.ts +25 -9
package/lowcode/Entry.js CHANGED
@@ -79,7 +79,7 @@ export class Entry {
79
79
  }
80
80
  window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
81
81
  console.log(`Entry-time:`, window.renderClock.stop());
82
- glitter.share.editerVersion = 'V_16.1.0';
82
+ glitter.share.editerVersion = 'V_16.1.2';
83
83
  glitter.share.start = new Date();
84
84
  const vm = {
85
85
  appConfig: [],
package/lowcode/Entry.ts CHANGED
@@ -78,7 +78,7 @@ export class Entry {
78
78
  }
79
79
  (window as any).renderClock = (window as any).renderClock ?? clockF();
80
80
  console.log(`Entry-time:`, (window as any).renderClock.stop());
81
- glitter.share.editerVersion = 'V_16.1.0';
81
+ glitter.share.editerVersion = 'V_16.1.2';
82
82
  glitter.share.start = new Date();
83
83
  const vm: {
84
84
  appConfig: any;
@@ -2353,7 +2353,7 @@ ${obj.default ?? ''}</textarea
2353
2353
  gvc: any;
2354
2354
  def: string | string[];
2355
2355
  array: string[] | { title: string; value: string; innerHtml?: string }[];
2356
- callback: (text: string) => void;
2356
+ callback: (text: string | string[]) => void;
2357
2357
  type?: 'single' | 'multiple';
2358
2358
  }) {
2359
2359
  obj.type = obj.type ?? 'single';
@@ -23,6 +23,7 @@ import { ApiShop } from "../glitter-base/route/shopping.js";
23
23
  import { Swal } from "../modules/sweetAlert.js";
24
24
  import { ConnectionMode } from "./pos-pages/connection-mode.js";
25
25
  import { PosFunction } from "./pos-pages/pos-function.js";
26
+ import { UserList } from "./user-list.js";
26
27
  function getConfig() {
27
28
  const saasConfig = window.parent.saasConfig;
28
29
  return saasConfig;
@@ -251,14 +252,18 @@ height: 51px;
251
252
  return {
252
253
  bind: id,
253
254
  view: () => __awaiter(this, void 0, void 0, function* () {
254
- let [initial, res, member_auth] = yield Promise.all([POSSetting.initial(gvc), ApiUser.checkAdminAuth({
255
+ let [initial, res, member_auth, store_list] = yield Promise.all([POSSetting.initial(gvc), ApiUser.checkAdminAuth({
255
256
  app: gvc.glitter.getUrlParameter('app-id'),
256
257
  token: GlobalUser.saas_token,
257
258
  }), ApiUser.getPermission({
258
259
  page: 0,
259
260
  limit: 100
260
- })]);
261
- member_auth = member_auth.response.data;
261
+ }), ApiUser.getPublicConfig('store_manager', 'manager')]);
262
+ member_auth = member_auth.response.data.filter((dd) => {
263
+ return dd.invited && dd.status;
264
+ });
265
+ store_list = store_list.response.value.list;
266
+ glitter.share.store_list = store_list;
262
267
  glitter.share.member_auth_list = member_auth;
263
268
  glitter.share.editorViewModel.app_config_original;
264
269
  try {
@@ -270,10 +275,38 @@ height: 51px;
270
275
  }
271
276
  catch (e) {
272
277
  }
273
- if (res.response.result && (member_auth.find((dd) => {
278
+ const member_auth_ = member_auth.find((dd) => {
274
279
  return `${dd.user}` === `${POSSetting.config.who}`;
275
- }) || POSSetting.config.who === 'manager')) {
276
- return POSSetting.posView(gvc);
280
+ });
281
+ member_auth_.config.support_shop = member_auth_.config.support_shop.filter((dd) => {
282
+ return store_list.find((d1) => {
283
+ return dd === d1.id;
284
+ });
285
+ });
286
+ if (res.response.result && (member_auth_ || POSSetting.config.who === 'manager')) {
287
+ if (!member_auth_.config.support_shop || member_auth_.config.support_shop.length === 0) {
288
+ const dialog = new ShareDialog(gvc.glitter);
289
+ dialog.errorMessage({
290
+ text: `尚未設定任何門市,請前往『 門市設定 』與『 員工設定 』中設定相關參數`,
291
+ callback: () => {
292
+ const dialog = new ShareDialog(gvc.glitter);
293
+ dialog.dataLoading({ visible: true });
294
+ localStorage.removeItem('on-pos');
295
+ (window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
296
+ glitter.share.reload('cms', 'shopnex');
297
+ }
298
+ });
299
+ return ``;
300
+ }
301
+ else {
302
+ glitter.share.member_auth_list = member_auth.filter((dd) => {
303
+ return dd.config.support_shop && dd.config.support_shop.length > 0;
304
+ });
305
+ if (!member_auth_.config.support_shop.includes(POSSetting.config.where_store)) {
306
+ POSSetting.config.where_store = member_auth_.config.support_shop[0];
307
+ }
308
+ return POSSetting.posView(gvc);
309
+ }
277
310
  }
278
311
  else {
279
312
  return POSSetting.loginManager(gvc, 'first', () => {
@@ -471,7 +504,7 @@ height: 51px;
471
504
  >
472
505
  ${document.body.offsetWidth < 800 && vm.type === 'menu'
473
506
  ? ` `
474
- : `<div class="ms-2 d-flex align-items-center" style="gap:10px;"><svg width="157" height="28" viewBox="0 0 157 28" fill="none"
507
+ : `<div class=" d-flex align-items-center h-100 border-end pe-4" style="gap:10px;"><svg width="157" height="28" viewBox="0 0 157 28" fill="none"
475
508
  xmlns="http://www.w3.org/2000/svg">
476
509
  <path d="M1.812 17.972C2.28067 18.342 3.08233 18.8477 4.217 19.489C5.37633 20.1303 6.474 20.451 7.51 20.451C8.57067 20.451 9.101 20.044 9.101 19.23C9.101 18.86 8.953 18.5393 8.657 18.268C8.361 17.972 7.81833 17.639 7.029 17.269C6.23967 16.899 5.64767 16.6153 5.253 16.418C4.85833 16.196 4.328 15.8507 3.662 15.382C3.02067 14.8887 2.52733 14.383 2.182 13.865C1.19533 12.459 0.702 10.6707 0.702 8.5C0.702 6.32933 1.50367 4.504 3.107 3.024C4.735 1.51933 6.85633 0.766998 9.471 0.766998C11.247 0.766998 12.8873 0.964332 14.392 1.359C15.8967 1.729 16.6737 2.22233 16.723 2.839C16.723 2.913 16.723 2.987 16.723 3.061C16.723 3.92433 16.4517 5.022 15.909 6.354C15.3663 7.66133 14.984 8.389 14.762 8.537C13.1833 7.723 11.765 7.316 10.507 7.316C9.27367 7.316 8.657 7.76 8.657 8.648C8.657 9.19067 9.11333 9.67167 10.026 10.091C10.2233 10.1897 10.507 10.3253 10.877 10.498C11.247 10.6707 11.6663 10.8803 12.135 11.127C12.6283 11.349 13.1463 11.645 13.689 12.015C14.2563 12.3603 14.8607 12.829 15.502 13.421C16.8093 14.6543 17.463 16.2823 17.463 18.305C17.463 20.9443 16.7353 23.1027 15.28 24.78C13.8247 26.4573 11.58 27.3207 8.546 27.37C7.066 27.37 5.72167 27.2467 4.513 27C3.329 26.7533 2.293 26.2723 1.405 25.557C0.517 24.8417 0.073 23.9783 0.073 22.967C0.073 21.9557 0.258 20.9567 0.628 19.97C0.998 18.9587 1.39267 18.2927 1.812 17.972ZM40.6343 26.371C40.6343 26.7903 39.3886 27 36.8973 27C34.4059 27 33.1603 26.7903 33.1603 26.371V17.861H27.9803V26.371C27.9803 26.7903 26.7346 27 24.2433 27C21.7519 27 20.5063 26.7903 20.5063 26.371V1.84C20.5063 1.322 21.7519 1.063 24.2433 1.063C26.7346 1.063 27.9803 1.322 27.9803 1.84V10.535H33.1603V1.914C33.1603 1.56867 33.7769 1.322 35.0103 1.174C35.6516 1.12467 36.2806 1.1 36.8973 1.1L38.7843 1.174C40.0176 1.322 40.6343 1.56867 40.6343 1.914V26.371ZM55.3068 27.37C51.8534 27.37 49.0291 26.2353 46.8338 23.966C44.6631 21.6967 43.5778 18.3913 43.5778 14.05C43.5778 9.684 44.6754 6.37867 46.8708 4.134C49.0908 1.88933 51.9398 0.766998 55.4178 0.766998C58.9204 0.766998 61.7448 1.877 63.8908 4.097C66.0368 6.29233 67.1098 9.63467 67.1098 14.124C67.1098 18.5887 66.0121 21.9187 63.8168 24.114C61.6214 26.2847 58.7848 27.37 55.3068 27.37ZM55.3438 7.871C54.1598 7.871 53.1608 8.41367 52.3468 9.499C51.5574 10.5843 51.1628 12.1137 51.1628 14.087C51.1628 16.0357 51.5451 17.5403 52.3098 18.601C53.0744 19.637 54.0734 20.155 55.3068 20.155C56.5648 20.155 57.5761 19.6247 58.3408 18.564C59.1301 17.5033 59.5248 15.9863 59.5248 14.013C59.5248 12.0397 59.1178 10.5227 58.3038 9.462C57.5144 8.40133 56.5278 7.871 55.3438 7.871ZM73.2995 27.074C71.0548 27.074 69.9325 26.8273 69.9325 26.334V2.358C69.9325 1.51933 70.3148 1.1 71.0795 1.1H77.5915C81.2421 1.1 83.8691 1.85233 85.4725 3.357C87.1005 4.86167 87.9145 7.04467 87.9145 9.906C87.9145 12.274 87.1498 14.4447 85.6205 16.418C84.8558 17.4047 83.7335 18.194 82.2535 18.786C80.7735 19.378 79.0468 19.674 77.0735 19.674V26.297C77.0735 26.593 76.6048 26.8027 75.6675 26.926C74.7548 27.0247 73.9655 27.074 73.2995 27.074ZM77.0735 7.538V13.384H77.5545C78.4178 13.384 79.1455 13.1127 79.7375 12.57C80.3295 12.0273 80.6255 11.2627 80.6255 10.276C80.6255 9.28933 80.4158 8.58633 79.9965 8.167C79.6018 7.74767 78.8865 7.538 77.8505 7.538H77.0735ZM111.458 26.186C111.458 26.704 110.299 26.963 107.98 26.963C105.661 26.963 104.403 26.778 104.206 26.408L98.027 14.864V26.371C98.027 26.815 96.88 27.037 94.586 27.037C92.3167 27.037 91.182 26.815 91.182 26.371V1.618C91.182 1.248 92.1564 1.063 94.105 1.063C94.8697 1.063 95.7577 1.137 96.769 1.285C97.805 1.40833 98.434 1.655 98.656 2.025L104.576 13.421V1.803C104.576 1.33433 105.723 1.1 108.017 1.1C110.311 1.1 111.458 1.33433 111.458 1.803V26.186ZM127.199 11.386C127.668 11.386 127.902 12.2493 127.902 13.976C127.902 14.494 127.841 15.1107 127.717 15.826C127.619 16.5167 127.421 16.862 127.125 16.862H122.426V20.562H129.234C129.654 20.562 129.937 21.1047 130.085 22.19C130.159 22.6587 130.196 23.1643 130.196 23.707C130.196 24.225 130.122 24.9033 129.974 25.742C129.826 26.5807 129.58 27 129.234 27H116.58C115.643 27 115.174 26.6177 115.174 25.853V2.062C115.174 1.42067 115.458 1.1 116.025 1.1H129.271C129.789 1.1 130.048 2.19767 130.048 4.393C130.048 6.56367 129.789 7.649 129.271 7.649H122.426V11.386H127.199ZM147.148 2.099C147.444 1.359 148.986 0.989 151.773 0.989C152.489 0.989 153.364 1.05067 154.4 1.174C155.461 1.27267 155.991 1.37133 155.991 1.47L149.701 14.272L156.213 26.519C156.287 26.6423 155.757 26.7657 154.622 26.889C153.488 26.9877 152.526 27.037 151.736 27.037C148.604 27.037 146.889 26.6177 146.593 25.779L143.818 18.712L141.302 26.001C141.056 26.6917 139.477 27.037 136.566 27.037C135.851 27.037 134.963 26.9877 133.902 26.889C132.842 26.7903 132.361 26.6547 132.459 26.482L138.231 13.68L132.237 1.47C132.163 1.34666 132.669 1.23566 133.754 1.137C134.864 1.01366 135.802 0.951998 136.566 0.951998C139.674 0.951998 141.376 1.396 141.672 2.284L144.225 8.5L147.148 2.099Z"
477
510
  fill="url(#paint0_linear_3001_1051)"></path>
@@ -525,7 +558,9 @@ cursor: pointer;
525
558
  };
526
559
  })}
527
560
  <div class="searchBar ms-sm-2 me-2 ${vm.type !== 'menu' ? `d-none` : ``} ${document.body.offsetWidth < 800 ? `flex-fill` : ``}"
528
- style="position: relative;max-width:calc(100% - 60px);">
561
+ style="position: relative;max-width:calc(100% - 60px);
562
+ ${document.body.clientWidth < 800 ? `` : `position: absolute;left: 50%;top:50%;transform:translate(-50%,-50%);`}
563
+ ">
529
564
  <input
530
565
  class="border-0 "
531
566
  placeholder="搜尋商品名稱或貨號"
@@ -571,14 +606,9 @@ cursor: pointer;
571
606
  return {
572
607
  bind: id,
573
608
  view: () => {
574
- return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
609
+ return new Promise((resolve, reject) => {
575
610
  var _a;
576
- const member_auth = (yield ApiUser.getPermission({
577
- page: 0,
578
- limit: 100
579
- })).response.data.filter((dd) => {
580
- return dd.invited && dd.status;
581
- });
611
+ const member_auth = glitter.share.member_auth_list;
582
612
  const select_member = (_a = member_auth.find((dd) => {
583
613
  return `${dd.user}` === `${POSSetting.config.who}`;
584
614
  })) !== null && _a !== void 0 ? _a : { config: { title: '管理員', name: 'manager' } };
@@ -590,39 +620,65 @@ cursor: pointer;
590
620
  <div class=" btn btn-outline-secondary border-0 p-1 position-relative"
591
621
  data-bs-toggle="dropdown" aria-haspopup="true"
592
622
  aria-expanded="false">
593
- <div class="d-flex align-items-center px-2"
594
- style="gap:5px;">
595
- <i class="fa-solid fa-repeat fs-5"></i>
623
+ <div class="d-flex align-items-center px-sm-2"
624
+ style="gap:10px;">
596
625
  <div class="ps-2 text-start">
597
- <div class="fs-xs lh-1 opacity-60 fw-500">
598
- ${select_member.config.title}
599
- </div>
600
- <div class="fs-sm fw-500">
626
+
627
+ <div class="" style="color: #393939;
628
+ font-size: 18px;
629
+ font-style: normal;
630
+ font-weight: 400;
631
+ line-height: normal;">
601
632
  ${select_member.config.name}
602
633
  </div>
634
+ <div class="fs-xs lh-1 opacity-60 fw-500 d-flex align-items-center fw-500 mt-1" style="color: #8D8D8D;
635
+ font-size: 14px;
636
+ font-style: normal;
637
+ gap:5px;
638
+ font-weight: 400;
639
+ line-height: normal;">
640
+ ${select_member.config.title} <div>/</div> <div class="text-info fw-bold">${glitter.share.store_list.find((dd) => {
641
+ return dd.id === POSSetting.config.where_store;
642
+ }).name}</div>
643
+ </div>
644
+
603
645
  </div>
604
-
646
+ <i class="fa-regular fa-angle-down fs-6"></i>
605
647
  </div>
606
648
  </div>
607
649
  <div class="dropdown-menu position-absolute"
608
650
  style="top:50px; right: 0;">
609
651
  ${[
610
652
  ...(() => {
611
- const view = member_auth.filter((dd) => {
653
+ const mem_ = member_auth.filter((dd) => {
612
654
  return `${dd.user}` !== `${POSSetting.config.who}`;
613
- }).map((dd) => {
614
- const memberDD = dd;
615
- return html `<a
616
- class="dropdown-item cursor_pointer d-flex flex-column"
617
- onclick="${gvc.event(() => {
618
- PosFunction.switchUser(gvc, dd.user);
619
- })}">
620
- ${dd.config.title} / ${dd.config.name} /
621
- ${dd.config.member_id}
622
- </a>
623
- `;
624
655
  });
625
- return view;
656
+ if (mem_.length > 0) {
657
+ return [`<a
658
+ class="dropdown-item cursor_pointer d-flex align-items-center" style="gap:5px;"
659
+ onclick="${gvc.event(() => {
660
+ PosFunction.selectUserSwitch(gvc);
661
+ })}">
662
+ <i class="fa-regular fa-swap-arrows me-1"></i>切換當值員工
663
+ </a>`];
664
+ }
665
+ else {
666
+ return [];
667
+ }
668
+ })(),
669
+ ...(() => {
670
+ if (glitter.share.select_member.config.support_shop.length > 1) {
671
+ return [`<a
672
+ class="dropdown-item cursor_pointer d-flex align-items-center" style="gap:5px;"
673
+ onclick="${gvc.event(() => {
674
+ PosFunction.selectStoreSwitch(gvc);
675
+ })}">
676
+ <i class="fa-solid fa-store me-1"></i>切換門市
677
+ </a>`];
678
+ }
679
+ else {
680
+ return [];
681
+ }
626
682
  })(),
627
683
  ...[
628
684
  ...((PayConfig.deviceType === 'pos') ? [
@@ -662,21 +718,20 @@ cursor: pointer;
662
718
  })}"><i
663
719
  class="fa-solid fa-plug d-flex align-items-center justify-content-center"
664
720
  style="width:20px;"></i>連線至『 ${dd} 』</a>`;
665
- }))
721
+ })),
722
+ ` <a class="dropdown-item cursor_pointer d-flex align-items-center"
723
+ style="gap:5px;" onclick="${gvc.event(() => {
724
+ const dialog = new ShareDialog(gvc.glitter);
725
+ dialog.dataLoading({ visible: true });
726
+ localStorage.removeItem('on-pos');
727
+ (window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
728
+ glitter.share.reload('cms', 'shopnex');
729
+ })}"><i class="fa-solid fa-angle-left d-flex align-items-center justify-content-center"
730
+ style="width:20px;"></i>返回後台管理</a>`
666
731
  ].join('<div class="dropdown-divider"></div>')}
667
- <div class="dropdown-divider"></div>
668
- <a class="dropdown-item cursor_pointer d-flex align-items-center"
669
- style="gap:10px;" onclick="${gvc.event(() => {
670
- const dialog = new ShareDialog(gvc.glitter);
671
- dialog.dataLoading({ visible: true });
672
- localStorage.removeItem('on-pos');
673
- (window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
674
- glitter.share.reload('cms', 'shopnex');
675
- })}"><i class="fa-solid fa-angle-left d-flex align-items-center justify-content-center"
676
- style="width:20px;"></i>返回全通路後臺</a>
677
732
  </div>
678
733
  </div>`);
679
- }));
734
+ });
680
735
  },
681
736
  divCreate: {
682
737
  class: `h-100`
@@ -702,6 +757,9 @@ cursor: pointer;
702
757
  else if (vm.type === 'order') {
703
758
  return `<div class="vw-100 px-lg-3" style="overflow-y: scroll;">${ShoppingOrderManager.main(gvc, { isPOS: true })}</div>`;
704
759
  }
760
+ else if (vm.type === 'member') {
761
+ return `<div class="vw-100 px-lg-3" style="overflow-y: scroll;">${UserList.main(gvc)}</div>`;
762
+ }
705
763
  else if (vm.type === 'setting') {
706
764
  return PosSetting.main({ gvc: gvc, vm: vm });
707
765
  }
@@ -821,6 +879,18 @@ cursor: pointer;
821
879
  title: `訂單`,
822
880
  type: `order`,
823
881
  },
882
+ {
883
+ selectIcon: html `
884
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" width="29" height="29" fill="#393939">
885
+ <path d="M144 144c0 44.2 35.8 80 80 80s80-35.8 80-80l0-16-160 0 0 16zm-.1-124.9l.1 .1c10.2 7.5 23.8 8.3 34.9 2L209.1 4c4.6-2.6 9.7-4 14.9-4s10.4 1.4 14.9 4l30.2 17.2c11 6.3 24.7 5.5 34.9-2l.1-.1c.3-.2 .6-.4 .8-.6l3-2.4L323.6 3.5c2.8-2.3 6.4-3.5 10-3.5L336 0c8.8 0 16 7.2 16 16l0 23 0 3.2c0 0 0 .1 0 .1L352 144c0 70.7-57.3 128-128 128s-128-57.3-128-128L96 42.3c0 0 0-.1 0-.1L96 39l0-23c0-8.8 7.2-16 16-16l2.4 0c3.6 0 7.2 1.2 10 3.5L140 16l3 2.4c.3 .2 .6 .4 .8 .6zM48.3 464l351.5 0c-4.1-62.5-56.2-112-119.7-112l-112 0c-63.6 0-115.6 49.5-119.7 112zM0 472c0-92.8 75.2-168 168-168l112 0c92.8 0 168 75.2 168 168l0 8c0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32l0-8zM432 256c-27.7 0-53-10.1-72.6-26.7c.5-.8 1-1.5 1.4-2.3c12.1-19.9 20-42.6 22.4-67c.5-5.3 .8-10.6 .8-16l0-101.2C398.5 35.9 414.8 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112zM609.3 512l-137.8 0c5.4-9.4 8.6-20.3 8.6-32l0-8c0-60.7-27.1-115.2-69.8-151.8c2.4-.1 4.7-.2 7.1-.2l61.4 0C567.8 320 640 392.2 640 481.3c0 17-13.8 30.7-30.7 30.7z"/>
886
+ </svg>`,
887
+ unselectIcon: html `
888
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" width="29" height="29" fill="#8D8D8D">
889
+ <path d="M144 144c0 44.2 35.8 80 80 80s80-35.8 80-80l0-16-160 0 0 16zm-.1-124.9l.1 .1c10.2 7.5 23.8 8.3 34.9 2L209.1 4c4.6-2.6 9.7-4 14.9-4s10.4 1.4 14.9 4l30.2 17.2c11 6.3 24.7 5.5 34.9-2l.1-.1c.3-.2 .6-.4 .8-.6l3-2.4L323.6 3.5c2.8-2.3 6.4-3.5 10-3.5L336 0c8.8 0 16 7.2 16 16l0 23 0 3.2c0 0 0 .1 0 .1L352 144c0 70.7-57.3 128-128 128s-128-57.3-128-128L96 42.3c0 0 0-.1 0-.1L96 39l0-23c0-8.8 7.2-16 16-16l2.4 0c3.6 0 7.2 1.2 10 3.5L140 16l3 2.4c.3 .2 .6 .4 .8 .6zM48.3 464l351.5 0c-4.1-62.5-56.2-112-119.7-112l-112 0c-63.6 0-115.6 49.5-119.7 112zM0 472c0-92.8 75.2-168 168-168l112 0c92.8 0 168 75.2 168 168l0 8c0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32l0-8zM432 256c-27.7 0-53-10.1-72.6-26.7c.5-.8 1-1.5 1.4-2.3c12.1-19.9 20-42.6 22.4-67c.5-5.3 .8-10.6 .8-16l0-101.2C398.5 35.9 414.8 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112zM609.3 512l-137.8 0c5.4-9.4 8.6-20.3 8.6-32l0-8c0-60.7-27.1-115.2-69.8-151.8c2.4-.1 4.7-.2 7.1-.2l61.4 0C567.8 320 640 392.2 640 481.3c0 17-13.8 30.7-30.7 30.7z"/>
890
+ </svg>`,
891
+ title: `會員`,
892
+ type: `member`,
893
+ }
824
894
  ];
825
895
  return page
826
896
  .map((data) => {
@@ -983,6 +1053,12 @@ POSSetting.config = {
983
1053
  },
984
1054
  set pickup_number(value) {
985
1055
  localStorage.setItem('orderGetNumber', `${value}`);
1056
+ },
1057
+ get where_store() {
1058
+ return localStorage.getItem('where_store') || '';
1059
+ },
1060
+ set where_store(value) {
1061
+ localStorage.setItem('where_store', `${value}`);
986
1062
  }
987
1063
  };
988
1064
  window.glitter.setModule(import.meta.url, POSSetting);
@@ -15,6 +15,8 @@ import {ApiShop} from "../glitter-base/route/shopping.js";
15
15
  import {Swal} from "../modules/sweetAlert.js";
16
16
  import {ConnectionMode} from "./pos-pages/connection-mode.js";
17
17
  import {PosFunction} from "./pos-pages/pos-function.js";
18
+ import {ShoppingProductSetting} from "./shopping-product-setting.js";
19
+ import {UserList} from "./user-list.js";
18
20
 
19
21
  function getConfig() {
20
22
  const saasConfig: { config: any; api: any } = (window.parent as any).saasConfig;
@@ -27,7 +29,8 @@ export class POSSetting {
27
29
  public static config: {
28
30
  who: string,
29
31
  recreate: () => void,
30
- pickup_number: number
32
+ pickup_number: number,
33
+ where_store:string
31
34
  } = {
32
35
  get who() {
33
36
  return localStorage.getItem('pos_use_member') || ''
@@ -47,6 +50,13 @@ export class POSSetting {
47
50
  },
48
51
  set pickup_number(value) {
49
52
  localStorage.setItem('orderGetNumber', `${value}`)
53
+ },
54
+
55
+ get where_store() {
56
+ return localStorage.getItem('where_store') || ''
57
+ },
58
+ set where_store(value) {
59
+ localStorage.setItem('where_store', `${value}`)
50
60
  }
51
61
  }
52
62
 
@@ -297,15 +307,19 @@ height: 51px;
297
307
  return {
298
308
  bind: id,
299
309
  view: async () => {
300
- let [initial,res,member_auth]:any=await Promise.all([POSSetting.initial(gvc),ApiUser.checkAdminAuth({
310
+ let [initial, res, member_auth,store_list]: any = await Promise.all([POSSetting.initial(gvc), ApiUser.checkAdminAuth({
301
311
  app: gvc.glitter.getUrlParameter('app-id'),
302
312
  token: GlobalUser.saas_token,
303
- }),ApiUser.getPermission({
313
+ }), ApiUser.getPermission({
304
314
  page: 0,
305
315
  limit: 100
306
- })]);
307
- member_auth=member_auth.response.data;
308
- glitter.share.member_auth_list=member_auth
316
+ }),ApiUser.getPublicConfig('store_manager', 'manager')]);
317
+ member_auth = member_auth.response.data.filter((dd: any) => {
318
+ return dd.invited && dd.status
319
+ });
320
+ store_list=store_list.response.value.list;
321
+ glitter.share.store_list=store_list;
322
+ glitter.share.member_auth_list = member_auth
309
323
  glitter.share.editorViewModel.app_config_original
310
324
  try {
311
325
  const login_user = GlobalUser.parseJWT(GlobalUser.saas_token).payload.userID
@@ -316,12 +330,39 @@ height: 51px;
316
330
  } catch (e) {
317
331
 
318
332
  }
333
+ const member_auth_ = member_auth.find((dd: any) => {
334
+ return `${dd.user}` === `${POSSetting.config.who}`
335
+ })
336
+ member_auth_.config.support_shop=member_auth_.config.support_shop.filter((dd:string)=>{
337
+ return store_list.find((d1:any)=>{
338
+ return dd===d1.id
339
+ })
340
+ })
319
341
  if (res.response.result && (
320
- member_auth.find((dd: any) => {
321
- return `${dd.user}` === `${POSSetting.config.who}`
322
- }) || POSSetting.config.who === 'manager'
342
+ member_auth_ || POSSetting.config.who === 'manager'
323
343
  )) {
324
- return POSSetting.posView(gvc);
344
+ if (!member_auth_.config.support_shop || member_auth_.config.support_shop.length === 0) {
345
+ const dialog = new ShareDialog(gvc.glitter)
346
+ dialog.errorMessage({
347
+ text: `尚未設定任何門市,請前往『 門市設定 』與『 員工設定 』中設定相關參數`,
348
+ callback: () => {
349
+ const dialog = new ShareDialog(gvc.glitter);
350
+ dialog.dataLoading({visible: true});
351
+ localStorage.removeItem('on-pos');
352
+ (window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
353
+ glitter.share.reload('cms', 'shopnex');
354
+ }
355
+ })
356
+ return ``;
357
+ } else {
358
+ glitter.share.member_auth_list = member_auth.filter((dd:any)=>{
359
+ return dd.config.support_shop && dd.config.support_shop.length > 0;
360
+ });
361
+ if(!member_auth_.config.support_shop.includes(POSSetting.config.where_store)){
362
+ POSSetting.config.where_store=member_auth_.config.support_shop[0]
363
+ }
364
+ return POSSetting.posView(gvc);
365
+ }
325
366
  } else {
326
367
  return POSSetting.loginManager(gvc, 'first', () => {
327
368
  });
@@ -526,7 +567,7 @@ height: 51px;
526
567
  >
527
568
  ${document.body.offsetWidth < 800 && vm.type === 'menu'
528
569
  ? ` `
529
- : `<div class="ms-2 d-flex align-items-center" style="gap:10px;"><svg width="157" height="28" viewBox="0 0 157 28" fill="none"
570
+ : `<div class=" d-flex align-items-center h-100 border-end pe-4" style="gap:10px;"><svg width="157" height="28" viewBox="0 0 157 28" fill="none"
530
571
  xmlns="http://www.w3.org/2000/svg">
531
572
  <path d="M1.812 17.972C2.28067 18.342 3.08233 18.8477 4.217 19.489C5.37633 20.1303 6.474 20.451 7.51 20.451C8.57067 20.451 9.101 20.044 9.101 19.23C9.101 18.86 8.953 18.5393 8.657 18.268C8.361 17.972 7.81833 17.639 7.029 17.269C6.23967 16.899 5.64767 16.6153 5.253 16.418C4.85833 16.196 4.328 15.8507 3.662 15.382C3.02067 14.8887 2.52733 14.383 2.182 13.865C1.19533 12.459 0.702 10.6707 0.702 8.5C0.702 6.32933 1.50367 4.504 3.107 3.024C4.735 1.51933 6.85633 0.766998 9.471 0.766998C11.247 0.766998 12.8873 0.964332 14.392 1.359C15.8967 1.729 16.6737 2.22233 16.723 2.839C16.723 2.913 16.723 2.987 16.723 3.061C16.723 3.92433 16.4517 5.022 15.909 6.354C15.3663 7.66133 14.984 8.389 14.762 8.537C13.1833 7.723 11.765 7.316 10.507 7.316C9.27367 7.316 8.657 7.76 8.657 8.648C8.657 9.19067 9.11333 9.67167 10.026 10.091C10.2233 10.1897 10.507 10.3253 10.877 10.498C11.247 10.6707 11.6663 10.8803 12.135 11.127C12.6283 11.349 13.1463 11.645 13.689 12.015C14.2563 12.3603 14.8607 12.829 15.502 13.421C16.8093 14.6543 17.463 16.2823 17.463 18.305C17.463 20.9443 16.7353 23.1027 15.28 24.78C13.8247 26.4573 11.58 27.3207 8.546 27.37C7.066 27.37 5.72167 27.2467 4.513 27C3.329 26.7533 2.293 26.2723 1.405 25.557C0.517 24.8417 0.073 23.9783 0.073 22.967C0.073 21.9557 0.258 20.9567 0.628 19.97C0.998 18.9587 1.39267 18.2927 1.812 17.972ZM40.6343 26.371C40.6343 26.7903 39.3886 27 36.8973 27C34.4059 27 33.1603 26.7903 33.1603 26.371V17.861H27.9803V26.371C27.9803 26.7903 26.7346 27 24.2433 27C21.7519 27 20.5063 26.7903 20.5063 26.371V1.84C20.5063 1.322 21.7519 1.063 24.2433 1.063C26.7346 1.063 27.9803 1.322 27.9803 1.84V10.535H33.1603V1.914C33.1603 1.56867 33.7769 1.322 35.0103 1.174C35.6516 1.12467 36.2806 1.1 36.8973 1.1L38.7843 1.174C40.0176 1.322 40.6343 1.56867 40.6343 1.914V26.371ZM55.3068 27.37C51.8534 27.37 49.0291 26.2353 46.8338 23.966C44.6631 21.6967 43.5778 18.3913 43.5778 14.05C43.5778 9.684 44.6754 6.37867 46.8708 4.134C49.0908 1.88933 51.9398 0.766998 55.4178 0.766998C58.9204 0.766998 61.7448 1.877 63.8908 4.097C66.0368 6.29233 67.1098 9.63467 67.1098 14.124C67.1098 18.5887 66.0121 21.9187 63.8168 24.114C61.6214 26.2847 58.7848 27.37 55.3068 27.37ZM55.3438 7.871C54.1598 7.871 53.1608 8.41367 52.3468 9.499C51.5574 10.5843 51.1628 12.1137 51.1628 14.087C51.1628 16.0357 51.5451 17.5403 52.3098 18.601C53.0744 19.637 54.0734 20.155 55.3068 20.155C56.5648 20.155 57.5761 19.6247 58.3408 18.564C59.1301 17.5033 59.5248 15.9863 59.5248 14.013C59.5248 12.0397 59.1178 10.5227 58.3038 9.462C57.5144 8.40133 56.5278 7.871 55.3438 7.871ZM73.2995 27.074C71.0548 27.074 69.9325 26.8273 69.9325 26.334V2.358C69.9325 1.51933 70.3148 1.1 71.0795 1.1H77.5915C81.2421 1.1 83.8691 1.85233 85.4725 3.357C87.1005 4.86167 87.9145 7.04467 87.9145 9.906C87.9145 12.274 87.1498 14.4447 85.6205 16.418C84.8558 17.4047 83.7335 18.194 82.2535 18.786C80.7735 19.378 79.0468 19.674 77.0735 19.674V26.297C77.0735 26.593 76.6048 26.8027 75.6675 26.926C74.7548 27.0247 73.9655 27.074 73.2995 27.074ZM77.0735 7.538V13.384H77.5545C78.4178 13.384 79.1455 13.1127 79.7375 12.57C80.3295 12.0273 80.6255 11.2627 80.6255 10.276C80.6255 9.28933 80.4158 8.58633 79.9965 8.167C79.6018 7.74767 78.8865 7.538 77.8505 7.538H77.0735ZM111.458 26.186C111.458 26.704 110.299 26.963 107.98 26.963C105.661 26.963 104.403 26.778 104.206 26.408L98.027 14.864V26.371C98.027 26.815 96.88 27.037 94.586 27.037C92.3167 27.037 91.182 26.815 91.182 26.371V1.618C91.182 1.248 92.1564 1.063 94.105 1.063C94.8697 1.063 95.7577 1.137 96.769 1.285C97.805 1.40833 98.434 1.655 98.656 2.025L104.576 13.421V1.803C104.576 1.33433 105.723 1.1 108.017 1.1C110.311 1.1 111.458 1.33433 111.458 1.803V26.186ZM127.199 11.386C127.668 11.386 127.902 12.2493 127.902 13.976C127.902 14.494 127.841 15.1107 127.717 15.826C127.619 16.5167 127.421 16.862 127.125 16.862H122.426V20.562H129.234C129.654 20.562 129.937 21.1047 130.085 22.19C130.159 22.6587 130.196 23.1643 130.196 23.707C130.196 24.225 130.122 24.9033 129.974 25.742C129.826 26.5807 129.58 27 129.234 27H116.58C115.643 27 115.174 26.6177 115.174 25.853V2.062C115.174 1.42067 115.458 1.1 116.025 1.1H129.271C129.789 1.1 130.048 2.19767 130.048 4.393C130.048 6.56367 129.789 7.649 129.271 7.649H122.426V11.386H127.199ZM147.148 2.099C147.444 1.359 148.986 0.989 151.773 0.989C152.489 0.989 153.364 1.05067 154.4 1.174C155.461 1.27267 155.991 1.37133 155.991 1.47L149.701 14.272L156.213 26.519C156.287 26.6423 155.757 26.7657 154.622 26.889C153.488 26.9877 152.526 27.037 151.736 27.037C148.604 27.037 146.889 26.6177 146.593 25.779L143.818 18.712L141.302 26.001C141.056 26.6917 139.477 27.037 136.566 27.037C135.851 27.037 134.963 26.9877 133.902 26.889C132.842 26.7903 132.361 26.6547 132.459 26.482L138.231 13.68L132.237 1.47C132.163 1.34666 132.669 1.23566 133.754 1.137C134.864 1.01366 135.802 0.951998 136.566 0.951998C139.674 0.951998 141.376 1.396 141.672 2.284L144.225 8.5L147.148 2.099Z"
532
573
  fill="url(#paint0_linear_3001_1051)"></path>
@@ -580,7 +621,9 @@ cursor: pointer;
580
621
  };
581
622
  })}
582
623
  <div class="searchBar ms-sm-2 me-2 ${vm.type !== 'menu' ? `d-none` : ``} ${document.body.offsetWidth < 800 ? `flex-fill` : ``}"
583
- style="position: relative;max-width:calc(100% - 60px);">
624
+ style="position: relative;max-width:calc(100% - 60px);
625
+ ${document.body.clientWidth<800 ? ``:`position: absolute;left: 50%;top:50%;transform:translate(-50%,-50%);`}
626
+ ">
584
627
  <input
585
628
  class="border-0 "
586
629
  placeholder="搜尋商品名稱或貨號"
@@ -629,16 +672,11 @@ cursor: pointer;
629
672
  return {
630
673
  bind: id,
631
674
  view: () => {
632
- return new Promise(async (resolve, reject) => {
675
+ return new Promise( (resolve, reject) => {
633
676
  // POSSetting.login(gvc);
634
- const member_auth = (await ApiUser.getPermission({
635
- page: 0,
636
- limit: 100
637
- })).response.data.filter((dd:any)=>{
638
- return dd.invited && dd.status
639
- });
677
+ const member_auth =glitter.share.member_auth_list;
640
678
  const select_member = member_auth.find((dd: any) => {
641
- return `${dd.user}` === `${POSSetting.config.who}`
679
+ return `${dd.user}` === `${POSSetting.config.who}`
642
680
  }) ?? {config: {title: '管理員', name: 'manager'}};
643
681
  glitter.share.select_member = select_member
644
682
  glitter.share.staff_title = select_member.config.name === 'manager' ? `BOSS` : POSSetting.config.who;
@@ -649,39 +687,64 @@ cursor: pointer;
649
687
  <div class=" btn btn-outline-secondary border-0 p-1 position-relative"
650
688
  data-bs-toggle="dropdown" aria-haspopup="true"
651
689
  aria-expanded="false">
652
- <div class="d-flex align-items-center px-2"
653
- style="gap:5px;">
654
- <i class="fa-solid fa-repeat fs-5"></i>
690
+ <div class="d-flex align-items-center px-sm-2"
691
+ style="gap:10px;">
655
692
  <div class="ps-2 text-start">
656
- <div class="fs-xs lh-1 opacity-60 fw-500">
657
- ${select_member.config.title}
658
- </div>
659
- <div class="fs-sm fw-500">
693
+
694
+ <div class="" style="color: #393939;
695
+ font-size: 18px;
696
+ font-style: normal;
697
+ font-weight: 400;
698
+ line-height: normal;">
660
699
  ${select_member.config.name}
661
700
  </div>
701
+ <div class="fs-xs lh-1 opacity-60 fw-500 d-flex align-items-center fw-500 mt-1" style="color: #8D8D8D;
702
+ font-size: 14px;
703
+ font-style: normal;
704
+ gap:5px;
705
+ font-weight: 400;
706
+ line-height: normal;">
707
+ ${select_member.config.title} <div>/</div> <div class="text-info fw-bold">${glitter.share.store_list.find((dd:any)=>{
708
+ return dd.id===POSSetting.config.where_store
709
+ }).name}</div>
710
+ </div>
711
+
662
712
  </div>
663
-
713
+ <i class="fa-regular fa-angle-down fs-6"></i>
664
714
  </div>
665
715
  </div>
666
716
  <div class="dropdown-menu position-absolute"
667
717
  style="top:50px; right: 0;">
668
718
  ${[
669
719
  ...(() => {
670
- const view = member_auth.filter((dd: any) => {
671
- return `${dd.user}` !== `${POSSetting.config.who}`
672
- }).map((dd: any) => {
673
- const memberDD = dd;
674
- return html`<a
675
- class="dropdown-item cursor_pointer d-flex flex-column"
676
- onclick="${gvc.event(() => {
677
- PosFunction.switchUser(gvc, dd.user)
678
- })}">
679
- ${dd.config.title} / ${dd.config.name} /
680
- ${dd.config.member_id}
681
- </a>
682
- `
720
+ const mem_=member_auth.filter((dd: any) => {
721
+ return `${dd.user}` !== `${POSSetting.config.who}`
683
722
  })
684
- return view
723
+ if(mem_.length>0){
724
+ return [`<a
725
+ class="dropdown-item cursor_pointer d-flex align-items-center" style="gap:5px;"
726
+ onclick="${gvc.event(() => {
727
+ PosFunction.selectUserSwitch(gvc)
728
+ })}">
729
+ <i class="fa-regular fa-swap-arrows me-1"></i>切換當值員工
730
+ </a>`]
731
+ }else{
732
+ return []
733
+ }
734
+ })(),
735
+ ...(() => {
736
+
737
+ if(glitter.share.select_member.config.support_shop.length>1){
738
+ return [`<a
739
+ class="dropdown-item cursor_pointer d-flex align-items-center" style="gap:5px;"
740
+ onclick="${gvc.event(() => {
741
+ PosFunction.selectStoreSwitch(gvc)
742
+ })}">
743
+ <i class="fa-solid fa-store me-1"></i>切換門市
744
+ </a>`]
745
+ }else{
746
+ return []
747
+ }
685
748
  })(),
686
749
  ...[
687
750
  ...((PayConfig.deviceType === 'pos') ? [
@@ -722,18 +785,17 @@ cursor: pointer;
722
785
  })}"><i
723
786
  class="fa-solid fa-plug d-flex align-items-center justify-content-center"
724
787
  style="width:20px;"></i>連線至『 ${dd} 』</a>`
725
- }))
788
+ })),
789
+ ` <a class="dropdown-item cursor_pointer d-flex align-items-center"
790
+ style="gap:5px;" onclick="${gvc.event(() => {
791
+ const dialog = new ShareDialog(gvc.glitter);
792
+ dialog.dataLoading({visible: true});
793
+ localStorage.removeItem('on-pos');
794
+ (window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
795
+ glitter.share.reload('cms', 'shopnex');
796
+ })}"><i class="fa-solid fa-angle-left d-flex align-items-center justify-content-center"
797
+ style="width:20px;"></i>返回後台管理</a>`
726
798
  ].join('<div class="dropdown-divider"></div>')}
727
- <div class="dropdown-divider"></div>
728
- <a class="dropdown-item cursor_pointer d-flex align-items-center"
729
- style="gap:10px;" onclick="${gvc.event(() => {
730
- const dialog = new ShareDialog(gvc.glitter);
731
- dialog.dataLoading({visible: true});
732
- localStorage.removeItem('on-pos');
733
- (window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
734
- glitter.share.reload('cms', 'shopnex');
735
- })}"><i class="fa-solid fa-angle-left d-flex align-items-center justify-content-center"
736
- style="width:20px;"></i>返回全通路後臺</a>
737
799
  </div>
738
800
  </div>`)
739
801
  })
@@ -761,6 +823,8 @@ cursor: pointer;
761
823
  });
762
824
  } else if (vm.type === 'order') {
763
825
  return `<div class="vw-100 px-lg-3" style="overflow-y: scroll;">${ShoppingOrderManager.main(gvc, {isPOS: true})}</div>`;
826
+ }else if (vm.type === 'member') {
827
+ return `<div class="vw-100 px-lg-3" style="overflow-y: scroll;">${UserList.main(gvc)}</div>`;
764
828
  } else if (vm.type === 'setting') {
765
829
  return PosSetting.main({gvc: gvc, vm: vm})
766
830
  } else if (vm.type === 'home') {
@@ -908,6 +972,18 @@ cursor: pointer;
908
972
  title: `訂單`,
909
973
  type: `order`,
910
974
  },
975
+ {
976
+ selectIcon: html`
977
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" width="29" height="29" fill="#393939">
978
+ <path d="M144 144c0 44.2 35.8 80 80 80s80-35.8 80-80l0-16-160 0 0 16zm-.1-124.9l.1 .1c10.2 7.5 23.8 8.3 34.9 2L209.1 4c4.6-2.6 9.7-4 14.9-4s10.4 1.4 14.9 4l30.2 17.2c11 6.3 24.7 5.5 34.9-2l.1-.1c.3-.2 .6-.4 .8-.6l3-2.4L323.6 3.5c2.8-2.3 6.4-3.5 10-3.5L336 0c8.8 0 16 7.2 16 16l0 23 0 3.2c0 0 0 .1 0 .1L352 144c0 70.7-57.3 128-128 128s-128-57.3-128-128L96 42.3c0 0 0-.1 0-.1L96 39l0-23c0-8.8 7.2-16 16-16l2.4 0c3.6 0 7.2 1.2 10 3.5L140 16l3 2.4c.3 .2 .6 .4 .8 .6zM48.3 464l351.5 0c-4.1-62.5-56.2-112-119.7-112l-112 0c-63.6 0-115.6 49.5-119.7 112zM0 472c0-92.8 75.2-168 168-168l112 0c92.8 0 168 75.2 168 168l0 8c0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32l0-8zM432 256c-27.7 0-53-10.1-72.6-26.7c.5-.8 1-1.5 1.4-2.3c12.1-19.9 20-42.6 22.4-67c.5-5.3 .8-10.6 .8-16l0-101.2C398.5 35.9 414.8 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112zM609.3 512l-137.8 0c5.4-9.4 8.6-20.3 8.6-32l0-8c0-60.7-27.1-115.2-69.8-151.8c2.4-.1 4.7-.2 7.1-.2l61.4 0C567.8 320 640 392.2 640 481.3c0 17-13.8 30.7-30.7 30.7z"/>
979
+ </svg>`,
980
+ unselectIcon: html`
981
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" width="29" height="29" fill="#8D8D8D">
982
+ <path d="M144 144c0 44.2 35.8 80 80 80s80-35.8 80-80l0-16-160 0 0 16zm-.1-124.9l.1 .1c10.2 7.5 23.8 8.3 34.9 2L209.1 4c4.6-2.6 9.7-4 14.9-4s10.4 1.4 14.9 4l30.2 17.2c11 6.3 24.7 5.5 34.9-2l.1-.1c.3-.2 .6-.4 .8-.6l3-2.4L323.6 3.5c2.8-2.3 6.4-3.5 10-3.5L336 0c8.8 0 16 7.2 16 16l0 23 0 3.2c0 0 0 .1 0 .1L352 144c0 70.7-57.3 128-128 128s-128-57.3-128-128L96 42.3c0 0 0-.1 0-.1L96 39l0-23c0-8.8 7.2-16 16-16l2.4 0c3.6 0 7.2 1.2 10 3.5L140 16l3 2.4c.3 .2 .6 .4 .8 .6zM48.3 464l351.5 0c-4.1-62.5-56.2-112-119.7-112l-112 0c-63.6 0-115.6 49.5-119.7 112zM0 472c0-92.8 75.2-168 168-168l112 0c92.8 0 168 75.2 168 168l0 8c0 17.7-14.3 32-32 32L32 512c-17.7 0-32-14.3-32-32l0-8zM432 256c-27.7 0-53-10.1-72.6-26.7c.5-.8 1-1.5 1.4-2.3c12.1-19.9 20-42.6 22.4-67c.5-5.3 .8-10.6 .8-16l0-101.2C398.5 35.9 414.8 32 432 32c61.9 0 112 50.1 112 112s-50.1 112-112 112zM609.3 512l-137.8 0c5.4-9.4 8.6-20.3 8.6-32l0-8c0-60.7-27.1-115.2-69.8-151.8c2.4-.1 4.7-.2 7.1-.2l61.4 0C567.8 320 640 392.2 640 481.3c0 17-13.8 30.7-30.7 30.7z"/>
983
+ </svg>`,
984
+ title: `會員`,
985
+ type: `member`,
986
+ }
911
987
  // ...(() => {
912
988
  // if (POSSetting.config.who === 'manager') {
913
989
  // return [{