ts-glitter 21.3.8 → 21.3.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.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-line.js +12 -1
- package/lowcode/backend-manager/bg-line.ts +16 -1
- package/lowcode/backend-manager/bg-notify.js +13 -2
- package/lowcode/backend-manager/bg-notify.ts +17 -2
- package/lowcode/backend-manager/bg-product.js +81 -30
- package/lowcode/backend-manager/bg-product.ts +95 -34
- package/lowcode/backend-manager/bg-recommend.js +109 -141
- package/lowcode/backend-manager/bg-recommend.ts +122 -144
- package/lowcode/backend-manager/bg-sns.js +14 -4
- package/lowcode/backend-manager/bg-sns.ts +18 -4
- package/lowcode/backend-manager/bg-widget.js +176 -12
- package/lowcode/backend-manager/bg-widget.ts +198 -13
- package/lowcode/cms-plugin/auto-fcm-advertise.js +13 -2
- package/lowcode/cms-plugin/auto-fcm-advertise.ts +16 -2
- package/lowcode/cms-plugin/auto-fcm-history.js +13 -2
- package/lowcode/cms-plugin/auto-fcm-history.ts +16 -2
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/order-excel.js +18 -2
- package/lowcode/cms-plugin/module/order-excel.ts +20 -9
- package/lowcode/cms-plugin/module/product-setting.js +2 -1
- package/lowcode/cms-plugin/module/product-setting.ts +2 -1
- package/lowcode/cms-plugin/module/user-excel.js +1 -1
- package/lowcode/cms-plugin/module/user-excel.ts +2 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.js +3 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +11 -5
- package/lowcode/cms-plugin/pos-pages/products-page.ts +0 -1
- package/lowcode/cms-plugin/shopping-allowance-manager.js +3 -2
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +3 -2
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -0
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -0
- package/lowcode/cms-plugin/shopping-invoice-manager.js +7 -4
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +12 -11
- package/lowcode/cms-plugin/shopping-order-manager.js +21 -4
- package/lowcode/cms-plugin/shopping-order-manager.ts +30 -11
- package/lowcode/cms-plugin/shopping-product-setting.js +45 -41
- package/lowcode/cms-plugin/shopping-product-setting.ts +55 -48
- package/lowcode/cms-plugin/shopping-rebate.js +52 -46
- package/lowcode/cms-plugin/shopping-rebate.ts +402 -396
- package/lowcode/cms-plugin/shopping-setting-advance.js +6 -6
- package/lowcode/cms-plugin/shopping-setting-advance.ts +7 -7
- package/lowcode/cms-plugin/shopping-setting-basic.js +44 -0
- package/lowcode/cms-plugin/shopping-setting-basic.ts +63 -1
- package/lowcode/cms-plugin/shopping-setting-stock-log.js +57 -0
- package/lowcode/cms-plugin/shopping-setting-stock-log.ts +101 -0
- package/lowcode/cms-plugin/user-list.js +10 -9
- package/lowcode/cms-plugin/user-list.ts +11 -8
- package/lowcode/css/editor.css +1 -1
- package/lowcode/form-view/editor/image-selector.js +83 -82
- package/lowcode/form-view/editor/image-selector.ts +115 -107
- package/lowcode/glitter-base/route/user.js +27 -34
- package/lowcode/glitter-base/route/user.ts +31 -40
- package/lowcode/glitterBundle/dialog/ShareDialog.js +1 -0
- package/lowcode/glitterBundle/dialog/ShareDialog.ts +2 -0
- package/lowcode/glitterBundle/dialog/dialog.js +2 -2
- package/lowcode/glitterBundle/dialog/dialog.ts +2 -2
- package/lowcode/glitterBundle/plugins/editor-elem.js +5 -11
- package/lowcode/glitterBundle/plugins/editor-elem.ts +11 -11
- package/lowcode/modules/image-library.js +836 -486
- package/lowcode/modules/image-library.ts +1760 -1418
- package/lowcode/modules/tool.js +10 -9
- package/lowcode/modules/tool.ts +11 -10
- package/lowcode/public-models/product.ts +13 -0
- package/nxv0ptv53w.json +1 -0
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +2 -2
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +5 -2
- package/src/api-public/controllers/stock.js +1 -1
- package/src/api-public/controllers/stock.js.map +1 -1
- package/src/api-public/controllers/stock.ts +93 -81
- package/src/api-public/models/glitter-finance.js +2 -1
- package/src/api-public/models/glitter-finance.js.map +1 -1
- package/src/api-public/services/checkout-event.js +1 -0
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +2 -2
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/diff-record.d.ts +25 -0
- package/src/api-public/services/diff-record.js +158 -0
- package/src/api-public/services/diff-record.js.map +1 -0
- package/src/api-public/services/diff-record.ts +217 -0
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- package/src/api-public/services/financial-serviceV2.js +7 -17
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/public-table-check.js +25 -7
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/public-table-check.ts +53 -31
- package/src/api-public/services/shopping.d.ts +2 -12
- package/src/api-public/services/shopping.js +16 -7
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +33 -7
- package/src/api-public/services/stock.d.ts +1 -1
- package/src/api-public/services/stock.js +19 -17
- package/src/api-public/services/stock.js.map +1 -1
- package/src/api-public/services/stock.ts +711 -696
- package/src/api-public/services/user.d.ts +1 -1
- package/src/api-public/services/user.js +18 -8
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +34 -27
- package/src/app-project/serverless/src/index.js +7 -17
- package/src/app-project/serverless/src/index.js.map +1 -1
- package/src/app-project/serverless/src/modules/CryptoJS.js +7 -17
- package/src/app-project/serverless/src/modules/CryptoJS.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/app-project/serverless/src/modules/ssh.js +7 -17
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/firebase/message.js +2 -1
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +2 -1
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +1 -0
- package/src/index.js +17 -7
- package/src/index.js.map +5 -1
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/CryptoJS.js +7 -17
- package/src/modules/CryptoJS.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/modules/ssh.js +7 -17
- package/src/modules/ssh.js.map +1 -1
- package/src/modules/tool.d.ts +5 -0
- package/src/modules/tool.js +19 -0
- package/src/modules/tool.js.map +1 -1
- package/src/modules/tool.ts +27 -0
- package/src/run.js +2 -1
- package/src/run.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +2 -1
- package/src/services/ses.js.map +1 -1
|
@@ -338,18 +338,20 @@ export class ApiUser {
|
|
|
338
338
|
search_type?: string;
|
|
339
339
|
only_id?: boolean;
|
|
340
340
|
}) {
|
|
341
|
+
const url =
|
|
342
|
+
getBaseUrl() +
|
|
343
|
+
`/api-public/v1/user?${(() => {
|
|
344
|
+
let par = [`type=list`, `limit=${json.limit}`, `page=${json.page}`];
|
|
345
|
+
json.search && par.push(`search=${json.search}`);
|
|
346
|
+
json.search_type && par.push(`searchType=${json.search_type}`);
|
|
347
|
+
json.only_id && par.push(`only_id=${json.only_id}`);
|
|
348
|
+
json.id && par.push(`id=${json.id}`);
|
|
349
|
+
|
|
350
|
+
return par.join('&');
|
|
351
|
+
})()}`;
|
|
352
|
+
|
|
341
353
|
return BaseApi.create({
|
|
342
|
-
url:
|
|
343
|
-
getBaseUrl() +
|
|
344
|
-
`/api-public/v1/user?${(() => {
|
|
345
|
-
let par = [`type=list`, `limit=${json.limit}`, `page=${json.page}`];
|
|
346
|
-
json.search && par.push(`search=${json.search}`);
|
|
347
|
-
json.search_type && par.push(`searchType=${json.search_type}`);
|
|
348
|
-
json.only_id && par.push(`only_id=${json.only_id}`);
|
|
349
|
-
json.id && par.push(`id=${json.id}`);
|
|
350
|
-
|
|
351
|
-
return par.join('&');
|
|
352
|
-
})()}`,
|
|
354
|
+
url: url,
|
|
353
355
|
type: 'GET',
|
|
354
356
|
headers: {
|
|
355
357
|
'g-app': getConfig().config.appName,
|
|
@@ -426,6 +428,7 @@ export class ApiUser {
|
|
|
426
428
|
filter_type?: string;
|
|
427
429
|
with_level?: boolean;
|
|
428
430
|
all_result?: boolean;
|
|
431
|
+
only_id?: boolean;
|
|
429
432
|
}) {
|
|
430
433
|
const filterString = this.formatFilterString(json.filter);
|
|
431
434
|
const groupString = this.userListGroupString(json.group);
|
|
@@ -440,6 +443,7 @@ export class ApiUser {
|
|
|
440
443
|
order_string: json.orderString ?? '',
|
|
441
444
|
filter_type: json.filter_type ?? '',
|
|
442
445
|
all_result: json.all_result ? `${json.all_result}` : '',
|
|
446
|
+
only_id: json.only_id ? `${json.only_id}` : '',
|
|
443
447
|
}).toString();
|
|
444
448
|
|
|
445
449
|
const extraQuery = [...filterString, ...groupString].join('&');
|
|
@@ -462,37 +466,10 @@ export class ApiUser {
|
|
|
462
466
|
};
|
|
463
467
|
}
|
|
464
468
|
|
|
465
|
-
const array = data.response.data;
|
|
466
|
-
const allUsers = data.response.allUsers;
|
|
467
|
-
|
|
468
|
-
if (array.length > 0) {
|
|
469
|
-
await Promise.allSettled(
|
|
470
|
-
array.map(async (item: any) => {
|
|
471
|
-
const firstShipment = (
|
|
472
|
-
await ApiShop.getOrder({
|
|
473
|
-
page: 0,
|
|
474
|
-
limit: 1,
|
|
475
|
-
data_from: 'manager',
|
|
476
|
-
email: item.account || '-1',
|
|
477
|
-
phone: item.account || '-1',
|
|
478
|
-
valid: true,
|
|
479
|
-
is_shipment: true,
|
|
480
|
-
})
|
|
481
|
-
).response.data[0];
|
|
482
|
-
if (!item.tag_name) {
|
|
483
|
-
item.tag_name = '一般會員'; // 失敗時提供預設值
|
|
484
|
-
}
|
|
485
|
-
if (firstShipment) {
|
|
486
|
-
item.firstShipment = firstShipment;
|
|
487
|
-
}
|
|
488
|
-
})
|
|
489
|
-
);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
469
|
return {
|
|
493
470
|
response: {
|
|
494
|
-
data:
|
|
495
|
-
allUsers,
|
|
471
|
+
data: data.response.data,
|
|
472
|
+
allUsers: data.response.allUsers,
|
|
496
473
|
total: data.response.total,
|
|
497
474
|
extra: data.response.extra,
|
|
498
475
|
},
|
|
@@ -831,6 +808,20 @@ export class ApiUser {
|
|
|
831
808
|
});
|
|
832
809
|
}
|
|
833
810
|
|
|
811
|
+
public static async getUserPermission() {
|
|
812
|
+
return await this.getPermission({ page: 0, limit: 1000 }).then(data => {
|
|
813
|
+
if (!data.result) {
|
|
814
|
+
return undefined;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
const find_user = data.response.data.find((data: any) => {
|
|
818
|
+
return `${data.user}` === `${GlobalUser.parseJWT(GlobalUser.saas_token).payload.userID}`;
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
return find_user;
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
|
|
834
825
|
public static setPermission(json: {
|
|
835
826
|
email: string;
|
|
836
827
|
config: {
|
|
@@ -23,6 +23,7 @@ interface ConfirmDialogOptions {
|
|
|
23
23
|
icon?: string;
|
|
24
24
|
yesString?: string;
|
|
25
25
|
notString?: string;
|
|
26
|
+
width?: string;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
|
|
@@ -97,6 +98,7 @@ export class ShareDialog {
|
|
|
97
98
|
this.glitter.openDiaLog('glitterBundle/dialog/dialog.js', type, {
|
|
98
99
|
type,
|
|
99
100
|
title: obj.text,
|
|
101
|
+
width: obj.width,
|
|
100
102
|
icon: obj.icon,
|
|
101
103
|
yesString: obj.yesString,
|
|
102
104
|
notString: obj.notString,
|
|
@@ -89,7 +89,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
89
89
|
`);
|
|
90
90
|
return {
|
|
91
91
|
onCreateView: () => {
|
|
92
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
92
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
93
93
|
try {
|
|
94
94
|
switch (gBundle.type) {
|
|
95
95
|
case 'dataLoading':
|
|
@@ -170,7 +170,7 @@ init(import.meta.url, (gvc, glitter, gBundle) => {
|
|
|
170
170
|
title: (_q = gBundle.notString) !== null && _q !== void 0 ? _q : Language.text('cancel'),
|
|
171
171
|
event: () => { var _a; return (_a = gBundle.callback) === null || _a === void 0 ? void 0 : _a.call(gBundle, false); },
|
|
172
172
|
},
|
|
173
|
-
width: 600
|
|
173
|
+
width: (_r = gBundle.width) !== null && _r !== void 0 ? _r : 600
|
|
174
174
|
});
|
|
175
175
|
default:
|
|
176
176
|
return '';
|
|
@@ -165,7 +165,7 @@ init(import.meta.url, (gvc, glitter, gBundle: Bundle) => {
|
|
|
165
165
|
case 'checkYesOrNot':
|
|
166
166
|
case 'warningMessage':
|
|
167
167
|
return createDialogBox({
|
|
168
|
-
icon:
|
|
168
|
+
icon: icons.question,
|
|
169
169
|
content: gBundle.title ?? '',
|
|
170
170
|
confirm: {
|
|
171
171
|
title: gBundle.yesString ?? Language.text('okay'),
|
|
@@ -204,7 +204,7 @@ init(import.meta.url, (gvc, glitter, gBundle: Bundle) => {
|
|
|
204
204
|
title: gBundle.notString ?? Language.text('cancel'),
|
|
205
205
|
event: () => gBundle.callback?.(false),
|
|
206
206
|
},
|
|
207
|
-
width:600
|
|
207
|
+
width:gBundle.width??600
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
default:
|
|
@@ -398,6 +398,10 @@ export class EditorElem {
|
|
|
398
398
|
<i
|
|
399
399
|
class="fa-regular fa-trash"
|
|
400
400
|
onclick="${obj.gvc.event(() => {
|
|
401
|
+
var _a;
|
|
402
|
+
if ((_a = obj.event) === null || _a === void 0 ? void 0 : _a.delete) {
|
|
403
|
+
obj.event.delete(index);
|
|
404
|
+
}
|
|
401
405
|
data.splice(index, 1);
|
|
402
406
|
obj.gvc.notifyDataChange(id);
|
|
403
407
|
})}"
|
|
@@ -680,17 +684,7 @@ export class EditorElem {
|
|
|
680
684
|
return html ` <iframe class="rounded-3" style="border: none;width:${cf.width}px;height:${cf.height}px;"></iframe>`;
|
|
681
685
|
}
|
|
682
686
|
static codeEditor(obj) {
|
|
683
|
-
var _a;
|
|
684
687
|
const codeID = obj.gvc.glitter.getUUID();
|
|
685
|
-
console.log(`codeEditor`, {
|
|
686
|
-
type: 'getData',
|
|
687
|
-
value: `${obj.structStart ? obj.structStart : `(()=>{`} ${(_a = obj.initial) !== null && _a !== void 0 ? _a : ''}
|
|
688
|
-
${obj.structEnd ? obj.structEnd : '})()'}`,
|
|
689
|
-
language: 'javascript',
|
|
690
|
-
refactor: true,
|
|
691
|
-
structStart: obj.structStart,
|
|
692
|
-
structEnd: obj.structEnd,
|
|
693
|
-
});
|
|
694
688
|
function getComponent(gvc, height) {
|
|
695
689
|
return gvc.bindView(() => {
|
|
696
690
|
const id = obj.gvc.glitter.getUUID();
|
|
@@ -2431,7 +2425,7 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
|
|
|
2431
2425
|
.join(html ` <div style="margin-top: 12px;"></div>`);
|
|
2432
2426
|
},
|
|
2433
2427
|
divCreate: {
|
|
2434
|
-
class: `${obj.oneLine ? 'd-flex gap-2' : ''} ps-1`,
|
|
2428
|
+
class: `${obj.oneLine ? 'd-flex flex-wrap gap-2' : ''} ps-1`,
|
|
2435
2429
|
},
|
|
2436
2430
|
};
|
|
2437
2431
|
})}
|
|
@@ -308,7 +308,13 @@ export class EditorElem {
|
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
-
public static flexMediaManagerV2(obj: {
|
|
311
|
+
public static flexMediaManagerV2(obj: {
|
|
312
|
+
gvc: GVC;
|
|
313
|
+
data: string[];
|
|
314
|
+
event?: {
|
|
315
|
+
delete?: (index: number) => void;
|
|
316
|
+
};
|
|
317
|
+
}) {
|
|
312
318
|
const data = obj.data;
|
|
313
319
|
obj.gvc.addStyle(`
|
|
314
320
|
.p-hover-image:hover {
|
|
@@ -427,6 +433,9 @@ export class EditorElem {
|
|
|
427
433
|
<i
|
|
428
434
|
class="fa-regular fa-trash"
|
|
429
435
|
onclick="${obj.gvc.event(() => {
|
|
436
|
+
if (obj.event?.delete) {
|
|
437
|
+
obj.event.delete(index);
|
|
438
|
+
}
|
|
430
439
|
data.splice(index, 1);
|
|
431
440
|
obj.gvc.notifyDataChange(id);
|
|
432
441
|
})}"
|
|
@@ -775,15 +784,6 @@ export class EditorElem {
|
|
|
775
784
|
structEnd?: string;
|
|
776
785
|
}) {
|
|
777
786
|
const codeID = obj.gvc.glitter.getUUID();
|
|
778
|
-
console.log(`codeEditor`, {
|
|
779
|
-
type: 'getData',
|
|
780
|
-
value: `${obj.structStart ? obj.structStart : `(()=>{`} ${obj.initial ?? ''}
|
|
781
|
-
${obj.structEnd ? obj.structEnd : '})()'}`,
|
|
782
|
-
language: 'javascript',
|
|
783
|
-
refactor: true,
|
|
784
|
-
structStart: obj.structStart,
|
|
785
|
-
structEnd: obj.structEnd,
|
|
786
|
-
});
|
|
787
787
|
|
|
788
788
|
function getComponent(gvc: GVC, height: number) {
|
|
789
789
|
return gvc.bindView(() => {
|
|
@@ -2806,7 +2806,7 @@ ${obj.structEnd ? obj.structEnd : '})()'}`,
|
|
|
2806
2806
|
.join(html` <div style="margin-top: 12px;"></div>`);
|
|
2807
2807
|
},
|
|
2808
2808
|
divCreate: {
|
|
2809
|
-
class: `${obj.oneLine ? 'd-flex gap-2' : ''} ps-1`,
|
|
2809
|
+
class: `${obj.oneLine ? 'd-flex flex-wrap gap-2' : ''} ps-1`,
|
|
2810
2810
|
},
|
|
2811
2811
|
};
|
|
2812
2812
|
})}
|