ts-glitter 16.4.2 → 16.4.4

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 (54) hide show
  1. package/lowcode/Entry.js +3 -3
  2. package/lowcode/Entry.ts +3 -3
  3. package/lowcode/cms-plugin/module/order-setting.js +20 -2
  4. package/lowcode/cms-plugin/module/order-setting.ts +19 -2
  5. package/lowcode/cms-plugin/module/product-excel.js +32 -27
  6. package/lowcode/cms-plugin/module/product-excel.ts +40 -32
  7. package/lowcode/cms-plugin/module/product-setting.js +21 -5
  8. package/lowcode/cms-plugin/module/product-setting.ts +21 -5
  9. package/lowcode/cms-plugin/shopping-product-setting.ts +0 -1
  10. package/lowcode/cms-plugin/stock-history.js +1467 -540
  11. package/lowcode/cms-plugin/stock-history.ts +1530 -556
  12. package/lowcode/css/editor.css +8 -2
  13. package/lowcode/glitter-base/route/stock.js +1 -0
  14. package/lowcode/glitter-base/route/stock.ts +11 -2
  15. package/lowcode/glitterBundle/GlitterInitial.js +7 -0
  16. package/lowcode/glitterBundle/GlitterInitial.ts +7 -0
  17. package/lowcode/jspage/function-page/setting_editor.ts +8 -0
  18. package/package.json +1 -1
  19. package/src/api-public/controllers/index.js +5 -0
  20. package/src/api-public/controllers/index.js.map +1 -1
  21. package/src/api-public/controllers/index.ts +5 -0
  22. package/src/api-public/controllers/shopee.d.ts +3 -0
  23. package/src/api-public/controllers/shopee.js +8 -0
  24. package/src/api-public/controllers/shopee.js.map +1 -0
  25. package/src/api-public/controllers/shopee.ts +45 -0
  26. package/src/api-public/controllers/stock.js +1 -0
  27. package/src/api-public/controllers/stock.js.map +1 -1
  28. package/src/api-public/controllers/stock.ts +1 -0
  29. package/src/api-public/services/ai-pointes.js.map +1 -1
  30. package/src/api-public/services/fake-data-model/fake-order.js.map +1 -1
  31. package/src/api-public/services/fake-data-model/fake-product.js.map +1 -1
  32. package/src/api-public/services/shopee.d.ts +7 -0
  33. package/src/api-public/services/shopee.js +19 -0
  34. package/src/api-public/services/shopee.js.map +1 -0
  35. package/src/api-public/services/shopee.ts +37 -0
  36. package/src/api-public/services/shopping.js +16 -2
  37. package/src/api-public/services/shopping.js.map +1 -1
  38. package/src/api-public/services/shopping.ts +23 -2
  39. package/src/api-public/services/sms-pointes.js.map +1 -1
  40. package/src/api-public/services/stock.d.ts +10 -1
  41. package/src/api-public/services/stock.js +136 -7
  42. package/src/api-public/services/stock.js.map +1 -1
  43. package/src/api-public/services/stock.ts +174 -17
  44. package/src/api-public/services/wallet.js.map +1 -1
  45. package/src/config.d.ts +2 -0
  46. package/src/config.js +2 -0
  47. package/src/config.js.map +1 -1
  48. package/src/config.ts +2 -0
  49. package/src/modules/tool.d.ts +1 -0
  50. package/src/modules/tool.js +12 -1
  51. package/src/modules/tool.js.map +1 -1
  52. package/src/modules/tool.ts +13 -114
  53. package/src/services/saas-table-check.js +2 -2
  54. package/src/services/saas-table-check.js.map +1 -1
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.4.2';
82
+ glitter.share.editerVersion = 'V_16.4.4';
83
83
  glitter.share.start = new Date();
84
84
  const vm = {
85
85
  appConfig: [],
@@ -274,8 +274,8 @@ export class Entry {
274
274
  }
275
275
 
276
276
  ::-webkit-scrollbar {
277
- width: 0px !important; /* 滚动条宽度 */
278
- height: 0px !important;
277
+ width: 0 ; /* 滚动条宽度 */
278
+ height: 0;
279
279
  }
280
280
  `);
281
281
  glitter.share.EditorMode = true;
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.4.2';
81
+ glitter.share.editerVersion = 'V_16.4.4';
82
82
  glitter.share.start = new Date();
83
83
  const vm: {
84
84
  appConfig: any;
@@ -283,8 +283,8 @@ export class Entry {
283
283
  }
284
284
 
285
285
  ::-webkit-scrollbar {
286
- width: 0px !important; /* 滚动条宽度 */
287
- height: 0px !important;
286
+ width: 0 ; /* 滚动条宽度 */
287
+ height: 0;
288
288
  }
289
289
  `);
290
290
  glitter.share.EditorMode = true;
@@ -61,6 +61,24 @@ export class OrderSetting {
61
61
  }
62
62
  });
63
63
  }
64
+ gvc.addStyle(html `
65
+ .scrollbar-appear::-webkit-scrollbar {
66
+ width: 10px;
67
+ height: 10px;
68
+ }
69
+
70
+ .scrollbar-appear::-webkit-scrollbar-thumb {
71
+ background: #666;
72
+ border-radius: 20px;
73
+ }
74
+
75
+ .scrollbar-appear::-webkit-scrollbar-track {
76
+ border-radius: 20px;
77
+ background: #D8D8D8;
78
+ }
79
+ .scrollbar-appear{
80
+ }
81
+ `);
64
82
  return html `
65
83
  <div class="d-flex flex-column position-relative"
66
84
  style="width: 80%;height:70%;background:white;border-radius: 10px;">
@@ -72,7 +90,7 @@ export class OrderSetting {
72
90
  分倉出貨
73
91
  </div>
74
92
  </div>
75
- <div class="overflow-scroll" style="padding:20px;margin-right:30px;">
93
+ <div class="overflow-scroll scrollbar-appear flex-fill" style="padding:20px;">
76
94
  <div class="d-flex "
77
95
  style="margin-bottom:16px;gap:44px;position: relative;">
78
96
  <div class="d-flex flex-shrink-0 align-items-center "
@@ -198,7 +216,7 @@ export class OrderSetting {
198
216
  })()}
199
217
  </div>
200
218
  <div class="w-100 justify-content-end d-flex bg-white"
201
- style="margin-top:100px;position: absolute;left: 0;bottom: 0;gap:14px;padding-right:24px;padding-bottom:20px;padding-top: 10px;border-radius: 0px 0px 10px 10px;">
219
+ style="gap:14px;padding-right:24px;padding-bottom:20px;padding-top: 10px;border-radius: 0px 0px 10px 10px;">
202
220
  ${BgWidget.cancel(gvc.event(() => {
203
221
  postMD = origData;
204
222
  topGVC.glitter.closeDiaLog();
@@ -84,7 +84,24 @@ export class OrderSetting {
84
84
  })
85
85
 
86
86
  }
87
+ gvc.addStyle(html`
88
+ .scrollbar-appear::-webkit-scrollbar {
89
+ width: 10px;
90
+ height: 10px;
91
+ }
92
+
93
+ .scrollbar-appear::-webkit-scrollbar-thumb {
94
+ background: #666;
95
+ border-radius: 20px;
96
+ }
87
97
 
98
+ .scrollbar-appear::-webkit-scrollbar-track {
99
+ border-radius: 20px;
100
+ background: #D8D8D8;
101
+ }
102
+ .scrollbar-appear{
103
+ }
104
+ `)
88
105
  return html`
89
106
  <div class="d-flex flex-column position-relative"
90
107
  style="width: 80%;height:70%;background:white;border-radius: 10px;">
@@ -96,7 +113,7 @@ export class OrderSetting {
96
113
  分倉出貨
97
114
  </div>
98
115
  </div>
99
- <div class="overflow-scroll" style="padding:20px;margin-right:30px;">
116
+ <div class="overflow-scroll scrollbar-appear flex-fill" style="padding:20px;">
100
117
  <div class="d-flex "
101
118
  style="margin-bottom:16px;gap:44px;position: relative;">
102
119
  <div class="d-flex flex-shrink-0 align-items-center "
@@ -232,7 +249,7 @@ export class OrderSetting {
232
249
  })()}
233
250
  </div>
234
251
  <div class="w-100 justify-content-end d-flex bg-white"
235
- style="margin-top:100px;position: absolute;left: 0;bottom: 0;gap:14px;padding-right:24px;padding-bottom:20px;padding-top: 10px;border-radius: 0px 0px 10px 10px;">
252
+ style="gap:14px;padding-right:24px;padding-bottom:20px;padding-top: 10px;border-radius: 0px 0px 10px 10px;">
236
253
  ${BgWidget.cancel(
237
254
  gvc.event(() => {
238
255
  postMD = origData;
@@ -189,8 +189,10 @@ export class ProductExcel {
189
189
  data[index] = dd.filter((d1, index) => { return index > 0; });
190
190
  });
191
191
  }
192
+ id_list = id_list.filter((item) => { return !['商品ID', ''].includes(item); });
192
193
  let error = false;
193
194
  let addCollection = [];
195
+ let appendCollection = [];
194
196
  let postMD = [];
195
197
  let productData = {};
196
198
  const getVariantData = () => {
@@ -224,30 +226,6 @@ export class ProductExcel {
224
226
  dialog.infoMessage({ text });
225
227
  }
226
228
  }
227
- const domainList = data
228
- .filter((item, index) => {
229
- return item[0] && (!(id_list)[index]);
230
- })
231
- .map((item) => {
232
- if (CheckInput.isEmpty(item[5])) {
233
- item[5] = item[0];
234
- }
235
- return `${item[5]}`;
236
- });
237
- const filteredArr = domainList.filter((item) => {
238
- return item && item.length > 0 && item.trim().length > 0;
239
- });
240
- const hasDuplicates = new Set(filteredArr).size !== filteredArr.length;
241
- if (hasDuplicates) {
242
- errorCallback('「商品連結」的值不可重複<br/>如果「商品連結」為空,預設值為該商品的「商品名稱」<br/>則該「商品名稱」不可與其它「商品連結」重複', {
243
- warningMessageView: true,
244
- });
245
- }
246
- const productDomainSet = new Set(allProductDomain);
247
- const duplicateDomain = domainList.find((domain) => domain.length > 0 && productDomainSet.has(domain));
248
- if (duplicateDomain) {
249
- errorCallback(`商品連結「${duplicateDomain}」已有產品使用,請更換該欄位的值`);
250
- }
251
229
  data.forEach((row, index) => {
252
230
  var _a;
253
231
  const variantData = getVariantData();
@@ -257,7 +235,6 @@ export class ProductExcel {
257
235
  postMD.push(productData);
258
236
  }
259
237
  addCollection = [];
260
- productData.id = id_list[index];
261
238
  productData = {
262
239
  title: '',
263
240
  productType: {
@@ -281,6 +258,8 @@ export class ProductExcel {
281
258
  },
282
259
  template: '',
283
260
  };
261
+ console.log(`id_list=>`, id_list);
262
+ productData.id = id_list[postMD.length - 1];
284
263
  productData.title = this.checkString(row[0]);
285
264
  productData.status = row[1] == '啟用' ? 'active' : 'draft';
286
265
  productData.collection = (_a = row[2].split(',')) !== null && _a !== void 0 ? _a : [];
@@ -306,6 +285,9 @@ export class ProductExcel {
306
285
  addCollection.push(collection);
307
286
  });
308
287
  productData.collection = addCollection;
288
+ appendCollection = appendCollection.concat(addCollection).filter((dd) => {
289
+ return dd;
290
+ });
309
291
  switch (row[3]) {
310
292
  case '贈品':
311
293
  productData.productType.giveaway = true;
@@ -370,10 +352,33 @@ export class ProductExcel {
370
352
  }
371
353
  });
372
354
  postMD.push(productData);
373
- productData.reverse;
355
+ const domainList = postMD
356
+ .filter((item, index) => {
357
+ return (!(id_list)[index]);
358
+ })
359
+ .map((item) => {
360
+ return item.domain;
361
+ });
362
+ const filteredArr = domainList.filter((item) => {
363
+ return item && item.length > 0 && item.trim().length > 0;
364
+ });
365
+ const hasDuplicates = new Set(filteredArr).size !== filteredArr.length;
366
+ if (hasDuplicates) {
367
+ errorCallback('「商品連結」的值不可重複<br/>如果「商品連結」為空,預設值為該商品的「商品名稱」<br/>則該「商品名稱」不可與其它「商品連結」重複', {
368
+ warningMessageView: true,
369
+ });
370
+ return;
371
+ }
372
+ console.log(`domainList=>`, domainList);
373
+ const productDomainSet = new Set(allProductDomain);
374
+ const duplicateDomain = domainList.find((domain) => domain.length > 0 && productDomainSet.has(domain));
375
+ if (duplicateDomain) {
376
+ errorCallback(`商品連結「${duplicateDomain}」已有產品使用,請更換該欄位的值`);
377
+ return;
378
+ }
374
379
  let passData = {
375
380
  data: postMD,
376
- collection: addCollection,
381
+ collection: appendCollection,
377
382
  };
378
383
  dialog.dataLoading({ visible: false });
379
384
  if (!error) {
@@ -266,8 +266,10 @@ export class ProductExcel {
266
266
  data[index]=dd.filter((d1:any,index:number)=>{return index>0})
267
267
  })
268
268
  }
269
+ id_list=id_list.filter((item:string)=>{return !['商品ID',''].includes(item)})
269
270
  let error = false;
270
271
  let addCollection: any = [];
272
+ let appendCollection:any=[];
271
273
  let postMD: {
272
274
  title: string;
273
275
  productType: {
@@ -326,35 +328,6 @@ export class ProductExcel {
326
328
  }
327
329
  }
328
330
 
329
- // 商品連結若為空,則預設值為商品名稱
330
- const domainList = data
331
- .filter((item: string[],index:number) => {
332
- return item[0] && (!(id_list)[index]);
333
- })
334
- .map((item: string[]) => {
335
- if (CheckInput.isEmpty(item[5])) {
336
- item[5] = item[0];
337
- }
338
- return `${item[5]}`;
339
- });
340
- // 判斷excel中是否有重複的domain
341
- const filteredArr = domainList.filter((item: string) => {
342
- return item && item.length > 0 && item.trim().length > 0;
343
- });
344
- // 過濾掉空白字串
345
- const hasDuplicates = new Set(filteredArr).size !== filteredArr.length;
346
- if (hasDuplicates) {
347
- errorCallback('「商品連結」的值不可重複<br/>如果「商品連結」為空,預設值為該商品的「商品名稱」<br/>則該「商品名稱」不可與其它「商品連結」重複', {
348
- warningMessageView: true,
349
- });
350
- }
351
-
352
- // 判斷已建立產品中是否有重複存在的domain
353
- const productDomainSet = new Set(allProductDomain);
354
- const duplicateDomain = domainList.find((domain: string) => domain.length > 0 && productDomainSet.has(domain));
355
- if (duplicateDomain) {
356
- errorCallback(`商品連結「${duplicateDomain}」已有產品使用,請更換該欄位的值`);
357
- }
358
331
 
359
332
  data.forEach((row: any, index: number) => {
360
333
  const variantData = getVariantData();
@@ -364,7 +337,6 @@ export class ProductExcel {
364
337
  postMD.push(productData);
365
338
  }
366
339
  addCollection = [];
367
- productData.id=id_list[index];
368
340
  productData = {
369
341
  title: '',
370
342
  productType: {
@@ -388,6 +360,8 @@ export class ProductExcel {
388
360
  },
389
361
  template: '',
390
362
  };
363
+ console.log(`id_list=>`,id_list)
364
+ productData.id=id_list[postMD.length-1];
391
365
  productData.title = this.checkString(row[0]);
392
366
  productData.status = row[1] == '啟用' ? 'active' : 'draft';
393
367
  productData.collection = row[2].split(',') ?? [];
@@ -427,6 +401,9 @@ export class ProductExcel {
427
401
  addCollection.push(collection);
428
402
  });
429
403
  productData.collection = addCollection;
404
+ appendCollection=appendCollection.concat(addCollection).filter((dd)=>{
405
+ return dd
406
+ })
430
407
  switch (row[3]) {
431
408
  case '贈品':
432
409
  productData.productType.giveaway = true;
@@ -494,10 +471,41 @@ export class ProductExcel {
494
471
  }
495
472
  });
496
473
  postMD.push(productData);
497
- productData.reverse;
474
+ // console.log(`one-push`)
475
+ //商品連結若為空,則預設值為商品名稱
476
+
477
+ const domainList = postMD
478
+ .filter((item: any,index:number) => {
479
+ return (!(id_list)[index]);
480
+ })
481
+ .map((item:any) => {
482
+
483
+ return item.domain
484
+ });
485
+ // 判斷excel中是否有重複的domain
486
+ const filteredArr = domainList.filter((item: string) => {
487
+ return item && item.length > 0 && item.trim().length > 0;
488
+ });
489
+ // 過濾掉空白字串
490
+ const hasDuplicates = new Set(filteredArr).size !== filteredArr.length;
491
+ if (hasDuplicates) {
492
+ errorCallback('「商品連結」的值不可重複<br/>如果「商品連結」為空,預設值為該商品的「商品名稱」<br/>則該「商品名稱」不可與其它「商品連結」重複', {
493
+ warningMessageView: true,
494
+ });
495
+ return
496
+ }
497
+ console.log(`domainList=>`,domainList)
498
+ //判斷已建立產品中是否有重複存在的domain
499
+ const productDomainSet = new Set(allProductDomain);
500
+ const duplicateDomain = domainList.find((domain: string) => domain.length > 0 && productDomainSet.has(domain));
501
+ if (duplicateDomain) {
502
+ errorCallback(`商品連結「${duplicateDomain}」已有產品使用,請更換該欄位的值`);
503
+ return
504
+ }
505
+
498
506
  let passData = {
499
507
  data: postMD,
500
- collection: addCollection,
508
+ collection: appendCollection,
501
509
  };
502
510
  dialog.dataLoading({ visible: false });
503
511
  if (!error) {
@@ -44,8 +44,24 @@ export class ProductSetting {
44
44
  dialog.dataLoading({
45
45
  visible: false,
46
46
  });
47
+ gvc.addStyle(html `
48
+ .scrollbar-appear::-webkit-scrollbar {
49
+ width: 10px;
50
+ height: 10px;
51
+ }
52
+ .scrollbar-appear::-webkit-scrollbar-thumb {
53
+ background: #666;
54
+ border-radius: 20px;
55
+ }
56
+ .scrollbar-appear::-webkit-scrollbar-track {
57
+ border-radius: 20px;
58
+ background: #D8D8D8;
59
+ }
60
+ .scrollbar-appear{
61
+ }
62
+ `);
47
63
  return html `
48
- <div class="d-flex flex-column px-5"
64
+ <div class="d-flex flex-column"
49
65
  style="width: 100vw;height:100vh;position: absolute;left: 0;top:0;background-color: white;z-index:1;">
50
66
  <div class="d-flex align-items-center"
51
67
  style="height: 60px;width: 100vw;border-bottom: solid 1px #DDD;font-size: 16px;font-style: normal;font-weight: 700;color: #393939;">
@@ -72,7 +88,7 @@ export class ProductSetting {
72
88
  個規格
73
89
  </div>
74
90
  </div>
75
- <div class="overflow-scroll" style="padding:24px 32px;">
91
+ <div class="overflow-scroll scrollbar-appear flex-fill" style="padding:24px 32px;">
76
92
  <div class="d-flex " style="margin-bottom:24px;gap:24px;">
77
93
  ${(() => {
78
94
  let titleArray = [
@@ -208,7 +224,7 @@ export class ProductSetting {
208
224
  ${Tool.truncateString(postMD.title, 6)}</span>
209
225
  </div>
210
226
  <div class="flex-shrink-0"
211
- style="width:${elementLength}px;font-size: 16px;font-weight: 400;gap:14px;display: flex;align-items: center;"
227
+ style="width:${elementLength}px;font-size: 16px;font-weight: 400;gap:14px;display: flex;align-items: center;margin-right: 12px;"
212
228
  >
213
229
  ${Tool.truncateString(data.spec.join(' / '), 12)}
214
230
  </div>
@@ -390,8 +406,8 @@ export class ProductSetting {
390
406
  };
391
407
  })}
392
408
  </div>
393
- <div class="w-100 justify-content-end d-flex update-bar-container"
394
- style="margin-top:100px;">
409
+ <div class="w-100 justify-content-end d-flex "
410
+ style="padding:14px 16px;gap:14px;">
395
411
  ${BgWidget.cancel(gvc.event(() => {
396
412
  postMD = origData;
397
413
  topGVC.glitter.closeDiaLog();
@@ -59,8 +59,24 @@ export class ProductSetting {
59
59
  dialog.dataLoading({
60
60
  visible: false,
61
61
  })
62
+ gvc.addStyle(html`
63
+ .scrollbar-appear::-webkit-scrollbar {
64
+ width: 10px;
65
+ height: 10px;
66
+ }
67
+ .scrollbar-appear::-webkit-scrollbar-thumb {
68
+ background: #666;
69
+ border-radius: 20px;
70
+ }
71
+ .scrollbar-appear::-webkit-scrollbar-track {
72
+ border-radius: 20px;
73
+ background: #D8D8D8;
74
+ }
75
+ .scrollbar-appear{
76
+ }
77
+ `)
62
78
  return html`
63
- <div class="d-flex flex-column px-5"
79
+ <div class="d-flex flex-column"
64
80
  style="width: 100vw;height:100vh;position: absolute;left: 0;top:0;background-color: white;z-index:1;">
65
81
  <div class="d-flex align-items-center"
66
82
  style="height: 60px;width: 100vw;border-bottom: solid 1px #DDD;font-size: 16px;font-style: normal;font-weight: 700;color: #393939;">
@@ -87,7 +103,7 @@ export class ProductSetting {
87
103
  個規格
88
104
  </div>
89
105
  </div>
90
- <div class="overflow-scroll" style="padding:24px 32px;">
106
+ <div class="overflow-scroll scrollbar-appear flex-fill" style="padding:24px 32px;">
91
107
  <div class="d-flex " style="margin-bottom:24px;gap:24px;">
92
108
  ${(() => {
93
109
  type TitleItem = {
@@ -246,7 +262,7 @@ export class ProductSetting {
246
262
  )}</span>
247
263
  </div>
248
264
  <div class="flex-shrink-0"
249
- style="width:${elementLength}px;font-size: 16px;font-weight: 400;gap:14px;display: flex;align-items: center;"
265
+ style="width:${elementLength}px;font-size: 16px;font-weight: 400;gap:14px;display: flex;align-items: center;margin-right: 12px;"
250
266
  >
251
267
  ${Tool.truncateString(
252
268
  data.spec.join(' / '),
@@ -438,8 +454,8 @@ export class ProductSetting {
438
454
  };
439
455
  })}
440
456
  </div>
441
- <div class="w-100 justify-content-end d-flex update-bar-container"
442
- style="margin-top:100px;">
457
+ <div class="w-100 justify-content-end d-flex "
458
+ style="padding:14px 16px;gap:14px;">
443
459
  ${BgWidget.cancel(
444
460
  gvc.event(() => {
445
461
  postMD = origData;
@@ -3830,7 +3830,6 @@ export class ShoppingProductSetting {
3830
3830
  style="margin-right: 18px;">
3831
3831
  <div style="border-radius: 7px;border: 1px solid #DDD;background: #FFF;box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.10);padding: 3px 13px;cursor: pointer;"
3832
3832
  onclick="${gvc.event(() => {
3833
-
3834
3833
  ProductSetting.showBatchEditDialog({
3835
3834
  gvc: gvc,
3836
3835
  postMD: postMD,