ts-glitter 20.6.9 → 20.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lowcode/Entry.js CHANGED
@@ -144,7 +144,7 @@ export class Entry {
144
144
  }
145
145
  window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
146
146
  console.log(`Entry-time:`, window.renderClock.stop());
147
- glitter.share.editerVersion = 'V_20.6.9';
147
+ glitter.share.editerVersion = 'V_20.7.1';
148
148
  glitter.share.start = new Date();
149
149
  const vm = { appConfig: [] };
150
150
  window.saasConfig = {
package/lowcode/Entry.ts CHANGED
@@ -146,7 +146,7 @@ export class Entry {
146
146
  }
147
147
  (window as any).renderClock = (window as any).renderClock ?? createClock();
148
148
  console.log(`Entry-time:`, (window as any).renderClock.stop());
149
- glitter.share.editerVersion = 'V_20.6.9';
149
+ glitter.share.editerVersion = 'V_20.7.1';
150
150
  glitter.share.start = new Date();
151
151
  const vm = { appConfig: [] };
152
152
  (window as any).saasConfig = {
@@ -238,7 +238,8 @@ export class StockHistory {
238
238
  },
239
239
  {
240
240
  key: '總金額',
241
- value: `<span class="fs-7">$ ${dd.content.product_list.reduce((sum, item) => {
241
+ value: `<span class="fs-7">$ ${dd.content.product_list
242
+ .reduce((sum, item) => {
242
243
  var _a, _b;
243
244
  if (dd.type === 'restocking') {
244
245
  return sum + item.cost * ((_a = item.transfer_count) !== null && _a !== void 0 ? _a : 0);
@@ -246,7 +247,8 @@ export class StockHistory {
246
247
  else {
247
248
  return sum + item.cost * ((_b = item.recent_count) !== null && _b !== void 0 ? _b : 0);
248
249
  }
249
- }, 0).toLocaleString()}</span>`,
250
+ }, 0)
251
+ .toLocaleString()}</span>`,
250
252
  },
251
253
  {
252
254
  key: '供應商',
@@ -1039,7 +1041,7 @@ export class StockHistory {
1039
1041
  filter: [],
1040
1042
  hiddenPageSplit: true,
1041
1043
  }),
1042
- html `<div
1044
+ html ` <div
1043
1045
  class="w-100 d-flex align-items-center justify-content-center cursor_pointer"
1044
1046
  style="color: #36B; font-size: 16px; font-weight: 400;"
1045
1047
  onclick="${gvc.event(() => {
@@ -1119,7 +1121,7 @@ export class StockHistory {
1119
1121
  filter: [],
1120
1122
  hiddenPageSplit: true,
1121
1123
  }),
1122
- html `<div
1124
+ html ` <div
1123
1125
  class="w-100 d-flex align-items-center justify-content-center cursor_pointer"
1124
1126
  style="color: #36B; font-size: 16px; font-weight: 400;"
1125
1127
  onclick="${gvc.event(() => {
@@ -1621,13 +1623,13 @@ export class StockHistory {
1621
1623
  }
1622
1624
  const priceHTML = (obj) => {
1623
1625
  var _a, _b;
1624
- return html `<div class="d-flex w-100 mb-2">
1626
+ return html ` <div class="d-flex w-100 mb-2">
1625
1627
  <div class="flex-fill"></div>
1626
1628
  <div class="d-flex justify-content-between" style="width: 250px;">
1627
1629
  <div class="${(_a = obj.className) !== null && _a !== void 0 ? _a : ''}">${obj.name}</div>
1628
1630
  ${obj.incompletion
1629
- ? html `<div style="color: #8D8D8D">商品尚未核對完成</div>`
1630
- : html `<div class="${(_b = obj.className) !== null && _b !== void 0 ? _b : ''}">$ ${obj.price.toLocaleString()}</div>`}
1631
+ ? html ` <div style="color: #8D8D8D">商品尚未核對完成</div>`
1632
+ : html ` <div class="${(_b = obj.className) !== null && _b !== void 0 ? _b : ''}">$ ${obj.price.toLocaleString()}</div>`}
1631
1633
  </div>
1632
1634
  </div>`;
1633
1635
  };
@@ -1661,7 +1663,7 @@ export class StockHistory {
1661
1663
  return a.time > b.time ? -1 : 1;
1662
1664
  })
1663
1665
  .map(log => {
1664
- return html `<div class="d-flex justify-content-between align-items-center mt-2">
1666
+ return html ` <div class="d-flex justify-content-between align-items-center mt-2">
1665
1667
  <div class="d-flex align-items-center">
1666
1668
  <div class="me-3">${log.time}</div>
1667
1669
  <div class="me-1">${log.text}</div>
@@ -1740,11 +1742,12 @@ export class StockHistory {
1740
1742
  switch (vm.type) {
1741
1743
  case 'restocking':
1742
1744
  return [
1743
- html `<div class="row">
1744
- <div class="col-12 col-md-6">
1745
- <div class="tx_normal">供應商</div>
1746
- ${BgWidget.mbContainer(8)}
1747
- ${gvc.bindView((() => {
1745
+ html `
1746
+ <div class="row">
1747
+ <div class="col-12 col-md-6">
1748
+ <div class="tx_normal">供應商</div>
1749
+ ${BgWidget.mbContainer(8)}
1750
+ ${gvc.bindView((() => {
1748
1751
  const id = glitter.getUUID();
1749
1752
  let dataList = [];
1750
1753
  let loading = true;
@@ -1780,13 +1783,13 @@ export class StockHistory {
1780
1783
  gvc.notifyDataChange(id);
1781
1784
  },
1782
1785
  clickElement: {
1783
- html: html `<div>新增供應商</div>
1784
- <div>
1785
- <i
1786
- class="fa-solid fa-plus ps-2"
1787
- style="font-size: 16px; height: 14px; width: 14px;"
1788
- ></i>
1789
- </div>`,
1786
+ html: html ` <div>新增供應商</div>
1787
+ <div>
1788
+ <i
1789
+ class="fa-solid fa-plus ps-2"
1790
+ style="font-size: 16px; height: 14px; width: 14px;"
1791
+ ></i>
1792
+ </div>`,
1790
1793
  event: gvc2 => {
1791
1794
  const newVendorData = StockVendors.emptyData();
1792
1795
  BgWidget.settingDialog({
@@ -1828,11 +1831,11 @@ export class StockHistory {
1828
1831
  },
1829
1832
  };
1830
1833
  })())}
1831
- </div>
1832
- <div class="col-12 col-md-6">
1833
- <div class="tx_normal">庫存點</div>
1834
- ${BgWidget.mbContainer(8)}
1835
- ${gvc.bindView((() => {
1834
+ </div>
1835
+ <div class="col-12 col-md-6">
1836
+ <div class="tx_normal">庫存點</div>
1837
+ ${BgWidget.mbContainer(8)}
1838
+ ${gvc.bindView((() => {
1836
1839
  const id = glitter.getUUID();
1837
1840
  let dataList = [];
1838
1841
  let loading = true;
@@ -1868,13 +1871,13 @@ export class StockHistory {
1868
1871
  gvc.notifyDataChange(id);
1869
1872
  },
1870
1873
  clickElement: {
1871
- html: html `<div>新增庫存點</div>
1872
- <div>
1873
- <i
1874
- class="fa-solid fa-plus ps-2"
1875
- style="font-size: 16px; height: 14px; width: 14px;"
1876
- ></i>
1877
- </div>`,
1874
+ html: html ` <div>新增庫存點</div>
1875
+ <div>
1876
+ <i
1877
+ class="fa-solid fa-plus ps-2"
1878
+ style="font-size: 16px; height: 14px; width: 14px;"
1879
+ ></i>
1880
+ </div>`,
1878
1881
  event: gvc2 => {
1879
1882
  const newStoreData = StockStores.emptyData();
1880
1883
  BgWidget.settingDialog({
@@ -1916,16 +1919,18 @@ export class StockHistory {
1916
1919
  },
1917
1920
  };
1918
1921
  })())}
1922
+ </div>
1919
1923
  </div>
1920
- </div> `,
1924
+ `,
1921
1925
  ];
1922
1926
  case 'transfer':
1923
1927
  return [
1924
- html `<div class="row">
1925
- <div class="col-12 col-md-6">
1926
- <div class="tx_normal">調出庫存點</div>
1927
- ${BgWidget.mbContainer(8)}
1928
- ${gvc.bindView((() => {
1928
+ html `
1929
+ <div class="row">
1930
+ <div class="col-12 col-md-6">
1931
+ <div class="tx_normal">調出庫存點</div>
1932
+ ${BgWidget.mbContainer(8)}
1933
+ ${gvc.bindView((() => {
1929
1934
  const id = glitter.getUUID();
1930
1935
  let dataList = [];
1931
1936
  let loading = true;
@@ -1977,11 +1982,11 @@ export class StockHistory {
1977
1982
  },
1978
1983
  };
1979
1984
  })())}
1980
- </div>
1981
- <div class="col-12 col-md-6">
1982
- <div class="tx_normal">調入庫存點</div>
1983
- ${BgWidget.mbContainer(8)}
1984
- ${gvc.bindView((() => {
1985
+ </div>
1986
+ <div class="col-12 col-md-6">
1987
+ <div class="tx_normal">調入庫存點</div>
1988
+ ${BgWidget.mbContainer(8)}
1989
+ ${gvc.bindView((() => {
1985
1990
  const id = glitter.getUUID();
1986
1991
  let dataList = [];
1987
1992
  let loading = true;
@@ -2033,16 +2038,18 @@ export class StockHistory {
2033
2038
  },
2034
2039
  };
2035
2040
  })())}
2041
+ </div>
2036
2042
  </div>
2037
- </div> `,
2043
+ `,
2038
2044
  ];
2039
2045
  case 'checking':
2040
2046
  return [
2041
- html `<div class="row">
2042
- <div class="col-12 col-md-6">
2043
- <div class="tx_normal">盤點庫存點</div>
2044
- ${BgWidget.mbContainer(8)}
2045
- ${gvc.bindView((() => {
2047
+ html `
2048
+ <div class="row">
2049
+ <div class="col-12 col-md-6">
2050
+ <div class="tx_normal">盤點庫存點</div>
2051
+ ${BgWidget.mbContainer(8)}
2052
+ ${gvc.bindView((() => {
2046
2053
  const id = glitter.getUUID();
2047
2054
  let dataList = [];
2048
2055
  let loading = true;
@@ -2096,8 +2103,9 @@ export class StockHistory {
2096
2103
  },
2097
2104
  };
2098
2105
  })())}
2106
+ </div>
2099
2107
  </div>
2100
- </div> `,
2108
+ `,
2101
2109
  ];
2102
2110
  }
2103
2111
  }
@@ -2406,9 +2414,9 @@ export class StockHistory {
2406
2414
  }
2407
2415
  static vendorForm(gvc, data) {
2408
2416
  var _a, _b, _c, _d, _e;
2409
- return html `<div class="row">
2417
+ return html ` <div class="row">
2410
2418
  ${[
2411
- html `<div class="tx_normal">供應商名稱</div>
2419
+ html ` <div class="tx_normal">供應商名稱</div>
2412
2420
  ${BgWidget.mbContainer(4)}
2413
2421
  ${BgWidget.editeInput({
2414
2422
  gvc: gvc,
@@ -2419,7 +2427,7 @@ export class StockHistory {
2419
2427
  data.name = text;
2420
2428
  },
2421
2429
  })}`,
2422
- html `<div class="tx_normal">供應商地址</div>
2430
+ html ` <div class="tx_normal">供應商地址</div>
2423
2431
  ${BgWidget.mbContainer(4)}
2424
2432
  ${BgWidget.editeInput({
2425
2433
  gvc: gvc,
@@ -2430,7 +2438,7 @@ export class StockHistory {
2430
2438
  data.address = text;
2431
2439
  },
2432
2440
  })}`,
2433
- html `<div class="tx_normal">聯絡人姓名</div>
2441
+ html ` <div class="tx_normal">聯絡人姓名</div>
2434
2442
  ${BgWidget.mbContainer(4)}
2435
2443
  ${BgWidget.editeInput({
2436
2444
  gvc: gvc,
@@ -2441,7 +2449,7 @@ export class StockHistory {
2441
2449
  data.manager_name = text;
2442
2450
  },
2443
2451
  })}`,
2444
- html `<div class="tx_normal">電話</div>
2452
+ html ` <div class="tx_normal">電話</div>
2445
2453
  ${BgWidget.mbContainer(4)}
2446
2454
  ${BgWidget.editeInput({
2447
2455
  gvc: gvc,
@@ -2471,9 +2479,9 @@ export class StockHistory {
2471
2479
  }
2472
2480
  static storeForm(gvc, data) {
2473
2481
  var _a, _b, _c, _d, _e;
2474
- return html `<div class="row">
2482
+ return html ` <div class="row">
2475
2483
  ${[
2476
- html `<div class="tx_normal">庫存點名稱</div>
2484
+ html ` <div class="tx_normal">庫存點名稱</div>
2477
2485
  ${BgWidget.mbContainer(4)}
2478
2486
  ${BgWidget.editeInput({
2479
2487
  gvc: gvc,
@@ -2484,7 +2492,7 @@ export class StockHistory {
2484
2492
  data.name = text;
2485
2493
  },
2486
2494
  })}`,
2487
- html `<div class="tx_normal">庫存點地址</div>
2495
+ html ` <div class="tx_normal">庫存點地址</div>
2488
2496
  ${BgWidget.mbContainer(4)}
2489
2497
  ${BgWidget.editeInput({
2490
2498
  gvc: gvc,
@@ -2495,7 +2503,7 @@ export class StockHistory {
2495
2503
  data.address = text;
2496
2504
  },
2497
2505
  })}`,
2498
- html `<div class="tx_normal">聯絡人姓名</div>
2506
+ html ` <div class="tx_normal">聯絡人姓名</div>
2499
2507
  ${BgWidget.mbContainer(4)}
2500
2508
  ${BgWidget.editeInput({
2501
2509
  gvc: gvc,
@@ -2506,7 +2514,7 @@ export class StockHistory {
2506
2514
  data.manager_name = text;
2507
2515
  },
2508
2516
  })}`,
2509
- html `<div class="tx_normal">電話</div>
2517
+ html ` <div class="tx_normal">電話</div>
2510
2518
  ${BgWidget.mbContainer(4)}
2511
2519
  ${BgWidget.editeInput({
2512
2520
  gvc: gvc,
@@ -2637,7 +2645,7 @@ export class StockHistory {
2637
2645
  return arr
2638
2646
  .map(item => {
2639
2647
  var _a;
2640
- return html `<div style="${document.body.clientWidth > 768 ? `width: ${(_a = item.width) !== null && _a !== void 0 ? _a : 20}%;` : ''}">
2648
+ return html ` <div style="${document.body.clientWidth > 768 ? `width: ${(_a = item.width) !== null && _a !== void 0 ? _a : 20}%;` : ''}">
2641
2649
  <div class="tx_700" style="margin-bottom: 8px;">${item.title}</div>
2642
2650
  <div class="tx_normal">${item.value}</div>
2643
2651
  </div>`;
@@ -3143,10 +3151,14 @@ export class StockHistory {
3143
3151
  const spec = item.variant_content.spec;
3144
3152
  const sku = item.variant_content.sku;
3145
3153
  const barcode = item.variant_content.barcode;
3146
- product_list.push(Object.assign(Object.assign({ variant_id: item.id, cost: 0, note: '', transfer_count: 0, check_count: 0 }, (origin !== null && origin !== void 0 ? origin : {})), { title: title, spec: spec && spec.length > 0 ? spec.join('/') : '單一規格', sku: sku !== null && sku !== void 0 ? sku : '', barcode: barcode !== null && barcode !== void 0 ? barcode : '' }));
3154
+ product_list.push(Object.assign(Object.assign({ variant_id: item.id, cost: 0, note: '', transfer_count: 0, product_id: item.product_content.id, check_count: 0 }, (origin !== null && origin !== void 0 ? origin : {})), { title: title, spec: spec && spec.length > 0 ? spec.join('/') : '單一規格', sku: sku !== null && sku !== void 0 ? sku : '', barcode: barcode !== null && barcode !== void 0 ? barcode : '' }));
3147
3155
  });
3148
3156
  }
3149
- callback(product_list);
3157
+ callback(origins.filter((d1) => {
3158
+ return !product_list.find((dd) => {
3159
+ return d1.variant_id === dd.variant_id;
3160
+ });
3161
+ }).concat(product_list));
3150
3162
  });
3151
3163
  }
3152
3164
  static getVariantInfo(dataList, callback) {