ts-glitter 21.3.8 → 21.4.0
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-components/checkout/index.js +4 -2
- package/lowcode/public-components/checkout/index.ts +5 -3
- 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 +25 -25
- 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/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/app.js +7 -17
- package/src/services/app.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
|
@@ -197,7 +197,7 @@ export class ShoppingSettingAdvance {
|
|
|
197
197
|
BgWidget.inlineCheckBox({
|
|
198
198
|
title: '',
|
|
199
199
|
gvc: gvc,
|
|
200
|
-
def: [dd.checked ? dd.key :
|
|
200
|
+
def: [dd.checked ? dd.key : ''],
|
|
201
201
|
array: [
|
|
202
202
|
{
|
|
203
203
|
title: dd.title,
|
|
@@ -425,7 +425,7 @@ export class ShoppingSettingAdvance {
|
|
|
425
425
|
}
|
|
426
426
|
return stringArray.join('');
|
|
427
427
|
})),
|
|
428
|
-
].join(
|
|
428
|
+
].join('')),
|
|
429
429
|
BgWidget.mainCard([
|
|
430
430
|
html `
|
|
431
431
|
<div class="d-flex flex-column guide5-4">
|
|
@@ -449,7 +449,7 @@ export class ShoppingSettingAdvance {
|
|
|
449
449
|
},
|
|
450
450
|
],
|
|
451
451
|
}),
|
|
452
|
-
].join(
|
|
452
|
+
].join('')),
|
|
453
453
|
BgWidget.mainCard((() => {
|
|
454
454
|
const priceVM = {
|
|
455
455
|
id: gvc.glitter.getUUID(),
|
|
@@ -558,7 +558,7 @@ export class ShoppingSettingAdvance {
|
|
|
558
558
|
gvc.notifyDataChange(priceVM.id);
|
|
559
559
|
}
|
|
560
560
|
})}"
|
|
561
|
-
${((_a = postMD.multi_sale_price) === null || _a === void 0 ? void 0 : _a.some(m => m.type === item.type)) ? `checked` :
|
|
561
|
+
${((_a = postMD.multi_sale_price) === null || _a === void 0 ? void 0 : _a.some(m => m.type === item.type)) ? `checked` : ''}
|
|
562
562
|
/>
|
|
563
563
|
</div>
|
|
564
564
|
</div>
|
|
@@ -836,7 +836,7 @@ export class ShoppingSettingAdvance {
|
|
|
836
836
|
},
|
|
837
837
|
};
|
|
838
838
|
}))
|
|
839
|
-
:
|
|
839
|
+
: '',
|
|
840
840
|
BgWidget.mainCard(obj.gvc.bindView(() => {
|
|
841
841
|
const id = gvc.glitter.getUUID();
|
|
842
842
|
return {
|
|
@@ -1011,7 +1011,7 @@ export class ShoppingSettingAdvance {
|
|
|
1011
1011
|
.join(html ` <div class="my-3"></div>`);
|
|
1012
1012
|
},
|
|
1013
1013
|
divCreate: {
|
|
1014
|
-
class:
|
|
1014
|
+
class: 'w-100',
|
|
1015
1015
|
},
|
|
1016
1016
|
};
|
|
1017
1017
|
}));
|
|
@@ -31,8 +31,8 @@ export class ShoppingSettingAdvance {
|
|
|
31
31
|
commodity: '商品',
|
|
32
32
|
course: '課程',
|
|
33
33
|
};
|
|
34
|
-
|
|
35
34
|
const carTitle = categoryTitles[postMD.product_category] || '商品';
|
|
35
|
+
|
|
36
36
|
return BgWidget.container(
|
|
37
37
|
gvc.bindView(() => {
|
|
38
38
|
const id = gvc.glitter.getUUID();
|
|
@@ -224,7 +224,7 @@ export class ShoppingSettingAdvance {
|
|
|
224
224
|
BgWidget.inlineCheckBox({
|
|
225
225
|
title: '',
|
|
226
226
|
gvc: gvc,
|
|
227
|
-
def: [dd.checked ? dd.key :
|
|
227
|
+
def: [dd.checked ? dd.key : ''],
|
|
228
228
|
array: [
|
|
229
229
|
{
|
|
230
230
|
title: dd.title,
|
|
@@ -476,7 +476,7 @@ export class ShoppingSettingAdvance {
|
|
|
476
476
|
}
|
|
477
477
|
return stringArray.join('');
|
|
478
478
|
})),
|
|
479
|
-
].join(
|
|
479
|
+
].join('')
|
|
480
480
|
),
|
|
481
481
|
BgWidget.mainCard(
|
|
482
482
|
[
|
|
@@ -502,7 +502,7 @@ export class ShoppingSettingAdvance {
|
|
|
502
502
|
},
|
|
503
503
|
],
|
|
504
504
|
}),
|
|
505
|
-
].join(
|
|
505
|
+
].join('')
|
|
506
506
|
),
|
|
507
507
|
BgWidget.mainCard(
|
|
508
508
|
(() => {
|
|
@@ -621,7 +621,7 @@ export class ShoppingSettingAdvance {
|
|
|
621
621
|
gvc.notifyDataChange(priceVM.id);
|
|
622
622
|
}
|
|
623
623
|
})}"
|
|
624
|
-
${postMD.multi_sale_price?.some(m => m.type === item.type) ? `checked` :
|
|
624
|
+
${postMD.multi_sale_price?.some(m => m.type === item.type) ? `checked` : ''}
|
|
625
625
|
/>
|
|
626
626
|
</div>
|
|
627
627
|
</div>
|
|
@@ -912,7 +912,7 @@ export class ShoppingSettingAdvance {
|
|
|
912
912
|
};
|
|
913
913
|
})
|
|
914
914
|
)
|
|
915
|
-
:
|
|
915
|
+
: '',
|
|
916
916
|
BgWidget.mainCard(
|
|
917
917
|
obj.gvc.bindView(() => {
|
|
918
918
|
const id = gvc.glitter.getUUID();
|
|
@@ -1103,7 +1103,7 @@ export class ShoppingSettingAdvance {
|
|
|
1103
1103
|
.join(html` <div class="my-3"></div>`);
|
|
1104
1104
|
},
|
|
1105
1105
|
divCreate: {
|
|
1106
|
-
class:
|
|
1106
|
+
class: 'w-100',
|
|
1107
1107
|
},
|
|
1108
1108
|
};
|
|
1109
1109
|
})
|
|
@@ -167,6 +167,32 @@ export class ShoppingSettingBasic {
|
|
|
167
167
|
postMD.specs = Array.from(uniqueTitlesMap, ([title, option]) => ({ title, option }));
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
+
function saveImageLib(urlArray) {
|
|
171
|
+
ApiUser.getPublicConfig('image-manager', 'manager').then((data) => {
|
|
172
|
+
const newImageArray = urlArray.map((item) => {
|
|
173
|
+
return {
|
|
174
|
+
title: item.split('_')[item.split('_').length - 1],
|
|
175
|
+
data: item,
|
|
176
|
+
items: [],
|
|
177
|
+
type: 'file',
|
|
178
|
+
tag: [],
|
|
179
|
+
id: gvc.glitter.getUUID(),
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
if (data.result) {
|
|
183
|
+
const img_lib = data.response.value;
|
|
184
|
+
img_lib.push(...newImageArray);
|
|
185
|
+
dialog.dataLoading({ visible: true });
|
|
186
|
+
ApiUser.setPublicConfig({
|
|
187
|
+
key: 'image-manager',
|
|
188
|
+
value: img_lib,
|
|
189
|
+
user_id: 'manager',
|
|
190
|
+
}).then(data => {
|
|
191
|
+
dialog.dataLoading({ visible: false });
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
170
196
|
ShoppingSettingBasic.updateVariants(gvc, postMD, shipment_config, variantsViewID, obj);
|
|
171
197
|
const cat_title = (() => {
|
|
172
198
|
switch (postMD.product_category) {
|
|
@@ -784,6 +810,7 @@ export class ShoppingSettingBasic {
|
|
|
784
810
|
const addImage = (urlArray) => {
|
|
785
811
|
if (urlArray.length > 0) {
|
|
786
812
|
language_data.preview_image.push(...urlArray);
|
|
813
|
+
saveImageLib(urlArray);
|
|
787
814
|
obj.gvc.notifyDataChange('image_view');
|
|
788
815
|
}
|
|
789
816
|
else {
|
|
@@ -835,6 +862,23 @@ export class ShoppingSettingBasic {
|
|
|
835
862
|
EditorElem.flexMediaManagerV2({
|
|
836
863
|
gvc: obj.gvc,
|
|
837
864
|
data: language_data.preview_image,
|
|
865
|
+
event: {
|
|
866
|
+
delete: (index) => {
|
|
867
|
+
console.log('language_data -- ', language_data);
|
|
868
|
+
postMD.variants.forEach((variant) => {
|
|
869
|
+
var _a, _b;
|
|
870
|
+
if (variant.preview_image === language_data.preview_image[index]) {
|
|
871
|
+
variant.preview_image = (_a = language_data.preview_image[0]) !== null && _a !== void 0 ? _a : BgWidget.noImageURL;
|
|
872
|
+
}
|
|
873
|
+
if (variant[`preview_image_${vm.language}`] === language_data.preview_image[index]) {
|
|
874
|
+
variant[`preview_image_${vm.language}`] =
|
|
875
|
+
(_b = language_data.preview_image[0]) !== null && _b !== void 0 ? _b : BgWidget.noImageURL;
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
console.log('language_data -- ', postMD.variants);
|
|
879
|
+
ShoppingSettingBasic.updateVariants(gvc, postMD, shipment_config, variantsViewID, obj);
|
|
880
|
+
},
|
|
881
|
+
},
|
|
838
882
|
}));
|
|
839
883
|
},
|
|
840
884
|
divCreate: {
|
|
@@ -123,6 +123,7 @@ export class ShoppingSettingBasic {
|
|
|
123
123
|
preview_image: '',
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
+
|
|
126
127
|
postMD.variants.map((dd: any) => {
|
|
127
128
|
dd.checked = undefined;
|
|
128
129
|
return dd;
|
|
@@ -195,6 +196,51 @@ export class ShoppingSettingBasic {
|
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
|
|
199
|
+
function saveImageLib(urlArray: string[]) {
|
|
200
|
+
ApiUser.getPublicConfig('image-manager', 'manager').then((data: any) => {
|
|
201
|
+
const newImageArray = urlArray.map((item: string) => {
|
|
202
|
+
return {
|
|
203
|
+
title: item.split('_')[item.split('_').length - 1],
|
|
204
|
+
data: item,
|
|
205
|
+
items: [],
|
|
206
|
+
type: 'file',
|
|
207
|
+
tag: [],
|
|
208
|
+
id: gvc.glitter.getUUID(),
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
if (data.result) {
|
|
212
|
+
const img_lib = data.response.value;
|
|
213
|
+
img_lib.push(...newImageArray);
|
|
214
|
+
dialog.dataLoading({ visible: true });
|
|
215
|
+
ApiUser.setPublicConfig({
|
|
216
|
+
key: 'image-manager',
|
|
217
|
+
value: img_lib,
|
|
218
|
+
user_id: 'manager',
|
|
219
|
+
}).then(data => {
|
|
220
|
+
dialog.dataLoading({ visible: false });
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// if (data.response.value) {
|
|
224
|
+
// vm.link = data.response.value;
|
|
225
|
+
//
|
|
226
|
+
// function loop(array: FileItem[]) {
|
|
227
|
+
// array.map(dd => {
|
|
228
|
+
// if (dd.type === 'folder') {
|
|
229
|
+
// loop(dd.items ?? []);
|
|
230
|
+
// }
|
|
231
|
+
// });
|
|
232
|
+
// }
|
|
233
|
+
//
|
|
234
|
+
// loop(vm.link);
|
|
235
|
+
// vm.loading = false;
|
|
236
|
+
// callback();
|
|
237
|
+
// } else {
|
|
238
|
+
// vm.loading = false;
|
|
239
|
+
// callback();
|
|
240
|
+
// }
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
198
244
|
ShoppingSettingBasic.updateVariants(gvc, postMD, shipment_config, variantsViewID, obj);
|
|
199
245
|
|
|
200
246
|
const cat_title = (() => {
|
|
@@ -907,6 +953,7 @@ export class ShoppingSettingBasic {
|
|
|
907
953
|
const addImage = (urlArray: string[]) => {
|
|
908
954
|
if (urlArray.length > 0) {
|
|
909
955
|
language_data.preview_image.push(...urlArray);
|
|
956
|
+
saveImageLib(urlArray);
|
|
910
957
|
obj.gvc.notifyDataChange('image_view');
|
|
911
958
|
} else {
|
|
912
959
|
dialog.errorMessage({ text: '請選擇至少一張圖片' });
|
|
@@ -964,6 +1011,22 @@ export class ShoppingSettingBasic {
|
|
|
964
1011
|
EditorElem.flexMediaManagerV2({
|
|
965
1012
|
gvc: obj.gvc,
|
|
966
1013
|
data: language_data.preview_image,
|
|
1014
|
+
event: {
|
|
1015
|
+
delete: (index: number) => {
|
|
1016
|
+
console.log('language_data -- ', language_data);
|
|
1017
|
+
postMD.variants.forEach((variant: any) => {
|
|
1018
|
+
if (variant.preview_image === language_data.preview_image[index]) {
|
|
1019
|
+
variant.preview_image = language_data.preview_image[0] ?? BgWidget.noImageURL;
|
|
1020
|
+
}
|
|
1021
|
+
if (variant[`preview_image_${vm.language}`] === language_data.preview_image[index]) {
|
|
1022
|
+
variant[`preview_image_${vm.language}`] =
|
|
1023
|
+
language_data.preview_image[0] ?? BgWidget.noImageURL;
|
|
1024
|
+
}
|
|
1025
|
+
});
|
|
1026
|
+
console.log('language_data -- ', postMD.variants);
|
|
1027
|
+
ShoppingSettingBasic.updateVariants(gvc, postMD, shipment_config, variantsViewID, obj);
|
|
1028
|
+
},
|
|
1029
|
+
},
|
|
967
1030
|
})
|
|
968
1031
|
);
|
|
969
1032
|
},
|
|
@@ -1348,7 +1411,6 @@ export class ShoppingSettingBasic {
|
|
|
1348
1411
|
},
|
|
1349
1412
|
save: () => {
|
|
1350
1413
|
postMD.specs.push(temp);
|
|
1351
|
-
|
|
1352
1414
|
createPage.page = 'add';
|
|
1353
1415
|
checkSpecSingle();
|
|
1354
1416
|
ShoppingSettingBasic.updateVariants(gvc, postMD, shipment_config, variantsViewID, obj);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
11
|
+
import { ApiUser } from '../glitter-base/route/user.js';
|
|
12
|
+
import { Tool } from '../modules/tool.js';
|
|
13
|
+
const html = String.raw;
|
|
14
|
+
export class ShoppingSettingStockLog {
|
|
15
|
+
static main(obj) {
|
|
16
|
+
const gvc = obj.gvc;
|
|
17
|
+
const postMD = obj.postMD;
|
|
18
|
+
const vm2 = obj.vm2;
|
|
19
|
+
const vm = {
|
|
20
|
+
id: gvc.glitter.getUUID(),
|
|
21
|
+
loading: true,
|
|
22
|
+
memberList: new Map(),
|
|
23
|
+
};
|
|
24
|
+
return BgWidget.container(gvc.bindView({
|
|
25
|
+
bind: vm.id,
|
|
26
|
+
view: () => {
|
|
27
|
+
if (vm.loading) {
|
|
28
|
+
return BgWidget.spinner();
|
|
29
|
+
}
|
|
30
|
+
postMD.records.map(log => {
|
|
31
|
+
console.log(log);
|
|
32
|
+
console.log(Tool.formatDateTime(log.changed_at, true));
|
|
33
|
+
if (vm.memberList.has(`${log.changed_by}`)) {
|
|
34
|
+
console.log(vm.memberList.get(`${log.changed_by}`));
|
|
35
|
+
}
|
|
36
|
+
console.log('-----');
|
|
37
|
+
});
|
|
38
|
+
return [BgWidget.mainCard('')].join('');
|
|
39
|
+
},
|
|
40
|
+
divCreate: {
|
|
41
|
+
class: 'w-100',
|
|
42
|
+
},
|
|
43
|
+
onCreate: () => __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
if (vm.loading) {
|
|
45
|
+
const memberResp = yield ApiUser.getPermission({ page: 0, limit: 100 });
|
|
46
|
+
if (memberResp.result && Array.isArray(memberResp.response.data)) {
|
|
47
|
+
vm.memberList = new Map(memberResp.response.data.map((member) => {
|
|
48
|
+
return [member.user, member];
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
vm.loading = false;
|
|
52
|
+
gvc.notifyDataChange(vm.id);
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { GVC } from '../glitterBundle/GVController.js';
|
|
2
|
+
import { BgWidget } from '../backend-manager/bg-widget.js';
|
|
3
|
+
import { ApiUser } from '../glitter-base/route/user.js';
|
|
4
|
+
import { LanguageLocation } from '../glitter-base/global/language.js';
|
|
5
|
+
import { Tool } from '../modules/tool.js';
|
|
6
|
+
import { Product } from '../public-models/product.js';
|
|
7
|
+
|
|
8
|
+
const html = String.raw;
|
|
9
|
+
|
|
10
|
+
interface ManagementMemberConfig {
|
|
11
|
+
pin: string;
|
|
12
|
+
auth: string[];
|
|
13
|
+
name: string;
|
|
14
|
+
phone: string;
|
|
15
|
+
title: string;
|
|
16
|
+
member_id: string;
|
|
17
|
+
is_manager: boolean;
|
|
18
|
+
support_shop: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ManagementMember {
|
|
22
|
+
id: number;
|
|
23
|
+
user: string;
|
|
24
|
+
appName: string;
|
|
25
|
+
config: ManagementMemberConfig;
|
|
26
|
+
email: string;
|
|
27
|
+
invited: number;
|
|
28
|
+
status: number;
|
|
29
|
+
online_time: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface ViewModel {
|
|
33
|
+
id: string;
|
|
34
|
+
loading: boolean;
|
|
35
|
+
memberList: Map<string, ManagementMember>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class ShoppingSettingStockLog {
|
|
39
|
+
public static main(obj: {
|
|
40
|
+
gvc: GVC;
|
|
41
|
+
vm: any;
|
|
42
|
+
vm2: {
|
|
43
|
+
id: string;
|
|
44
|
+
language: LanguageLocation;
|
|
45
|
+
content_detail: any;
|
|
46
|
+
};
|
|
47
|
+
reload: () => void;
|
|
48
|
+
language_data: any;
|
|
49
|
+
postMD: Product;
|
|
50
|
+
shipment_config: any;
|
|
51
|
+
}) {
|
|
52
|
+
const gvc = obj.gvc;
|
|
53
|
+
const postMD = obj.postMD;
|
|
54
|
+
const vm2 = obj.vm2;
|
|
55
|
+
|
|
56
|
+
const vm: ViewModel = {
|
|
57
|
+
id: gvc.glitter.getUUID(),
|
|
58
|
+
loading: true,
|
|
59
|
+
memberList: new Map(),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return BgWidget.container(
|
|
63
|
+
gvc.bindView({
|
|
64
|
+
bind: vm.id,
|
|
65
|
+
view: () => {
|
|
66
|
+
if (vm.loading) {
|
|
67
|
+
return BgWidget.spinner();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
postMD.records.map(log => {
|
|
71
|
+
console.log(log);
|
|
72
|
+
console.log(Tool.formatDateTime(log.changed_at, true));
|
|
73
|
+
if (vm.memberList.has(`${log.changed_by}`)) {
|
|
74
|
+
console.log(vm.memberList.get(`${log.changed_by}`));
|
|
75
|
+
}
|
|
76
|
+
console.log('-----');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return [BgWidget.mainCard('')].join('');
|
|
80
|
+
},
|
|
81
|
+
divCreate: {
|
|
82
|
+
class: 'w-100',
|
|
83
|
+
},
|
|
84
|
+
onCreate: async () => {
|
|
85
|
+
if (vm.loading) {
|
|
86
|
+
const memberResp = await ApiUser.getPermission({ page: 0, limit: 100 });
|
|
87
|
+
if (memberResp.result && Array.isArray(memberResp.response.data)) {
|
|
88
|
+
vm.memberList = new Map(
|
|
89
|
+
memberResp.response.data.map((member: ManagementMember) => {
|
|
90
|
+
return [member.user, member];
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
vm.loading = false;
|
|
95
|
+
gvc.notifyDataChange(vm.id);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
})
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -84,16 +84,20 @@ export class UserList {
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
key: '上次登入時間',
|
|
87
|
-
value: `<
|
|
87
|
+
value: html `<div class="fs-7" style="min-width: 160px">
|
|
88
|
+
${glitter.ut.dateFormat(new Date(dd.online_time), 'yyyy-MM-dd hh:mm')}
|
|
89
|
+
</div>`,
|
|
88
90
|
},
|
|
89
91
|
{
|
|
90
92
|
key: '最後出貨時間',
|
|
91
|
-
value: `<
|
|
93
|
+
value: html `<div class="fs-7" style="min-width: 160px">
|
|
94
|
+
${dd.last_has_shipment_number_date ? Tool.formatDateTime(dd.last_has_shipment_number_date) : '-'}
|
|
95
|
+
</div>`,
|
|
92
96
|
},
|
|
93
97
|
{
|
|
94
98
|
key: '社群綁定',
|
|
95
99
|
value: (() => {
|
|
96
|
-
return html `<div class="d-flex align-items-center px-2" style="gap:5px;">
|
|
100
|
+
return html `<div class="d-flex align-items-center px-2" style="gap: 5px;">
|
|
97
101
|
${[
|
|
98
102
|
{
|
|
99
103
|
type: 'fb',
|
|
@@ -386,7 +390,7 @@ export class UserList {
|
|
|
386
390
|
vmi.tableData = getUserlist();
|
|
387
391
|
vmi.allResult = () => __awaiter(this, void 0, void 0, function* () {
|
|
388
392
|
dialog.dataLoading({ visible: true });
|
|
389
|
-
return ApiUser.getUserListOrders(Object.assign(Object.assign({}, vm.apiJSON), { all_result: true })).then(data => {
|
|
393
|
+
return ApiUser.getUserListOrders(Object.assign(Object.assign({}, vm.apiJSON), { all_result: true, only_id: true })).then(data => {
|
|
390
394
|
dialog.dataLoading({ visible: false });
|
|
391
395
|
return data.response.allUsers;
|
|
392
396
|
});
|
|
@@ -1171,7 +1175,6 @@ export class UserList {
|
|
|
1171
1175
|
].join(BgWidget.mbContainer(18));
|
|
1172
1176
|
}
|
|
1173
1177
|
},
|
|
1174
|
-
divCreate: {},
|
|
1175
1178
|
onCreate: () => {
|
|
1176
1179
|
if (vmt.loading) {
|
|
1177
1180
|
ApiUser.getPublicConfig('user_general_tags', 'manager').then((dd) => {
|
|
@@ -1369,7 +1372,6 @@ export class UserList {
|
|
|
1369
1372
|
`;
|
|
1370
1373
|
}
|
|
1371
1374
|
},
|
|
1372
|
-
divCreate: {},
|
|
1373
1375
|
onCreate: () => {
|
|
1374
1376
|
if (loading) {
|
|
1375
1377
|
ApiUser.getPublicConfig('member_level_config', 'manager').then((dd) => {
|
|
@@ -1691,7 +1693,7 @@ export class UserList {
|
|
|
1691
1693
|
</div>
|
|
1692
1694
|
</div>`,
|
|
1693
1695
|
vm.plan > 0
|
|
1694
|
-
? html ` <div
|
|
1696
|
+
? html ` <div>
|
|
1695
1697
|
<div class="tx_700 mb-3">社群綁定</div>
|
|
1696
1698
|
${[
|
|
1697
1699
|
{
|
|
@@ -1787,7 +1789,6 @@ export class UserList {
|
|
|
1787
1789
|
].join(html ` <div style="margin-top: 24px;"></div>`));
|
|
1788
1790
|
}
|
|
1789
1791
|
},
|
|
1790
|
-
onCreate: () => { },
|
|
1791
1792
|
};
|
|
1792
1793
|
});
|
|
1793
1794
|
}
|
|
@@ -1965,7 +1966,6 @@ export class UserList {
|
|
|
1965
1966
|
</div>
|
|
1966
1967
|
`);
|
|
1967
1968
|
},
|
|
1968
|
-
divCreate: {},
|
|
1969
1969
|
});
|
|
1970
1970
|
}
|
|
1971
1971
|
static userManager(gvc, type = 'list', callback = () => { }) {
|
|
@@ -2039,6 +2039,7 @@ export class UserList {
|
|
|
2039
2039
|
page: vmi.page - 1,
|
|
2040
2040
|
limit: limit,
|
|
2041
2041
|
search: vm.query || undefined,
|
|
2042
|
+
only_id: true,
|
|
2042
2043
|
}).then(data => {
|
|
2043
2044
|
vm.dataList = data.response.data;
|
|
2044
2045
|
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
@@ -123,16 +123,20 @@ export class UserList {
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
key: '上次登入時間',
|
|
126
|
-
value: `<
|
|
126
|
+
value: html`<div class="fs-7" style="min-width: 160px">
|
|
127
|
+
${glitter.ut.dateFormat(new Date(dd.online_time), 'yyyy-MM-dd hh:mm')}
|
|
128
|
+
</div>`,
|
|
127
129
|
},
|
|
128
130
|
{
|
|
129
131
|
key: '最後出貨時間',
|
|
130
|
-
value: `<
|
|
132
|
+
value: html`<div class="fs-7" style="min-width: 160px">
|
|
133
|
+
${dd.last_has_shipment_number_date ? Tool.formatDateTime(dd.last_has_shipment_number_date) : '-'}
|
|
134
|
+
</div>`,
|
|
131
135
|
},
|
|
132
136
|
{
|
|
133
137
|
key: '社群綁定',
|
|
134
138
|
value: (() => {
|
|
135
|
-
return html`<div class="d-flex align-items-center px-2" style="gap:5px;">
|
|
139
|
+
return html`<div class="d-flex align-items-center px-2" style="gap: 5px;">
|
|
136
140
|
${[
|
|
137
141
|
{
|
|
138
142
|
type: 'fb',
|
|
@@ -469,6 +473,7 @@ export class UserList {
|
|
|
469
473
|
return ApiUser.getUserListOrders({
|
|
470
474
|
...vm.apiJSON,
|
|
471
475
|
all_result: true,
|
|
476
|
+
only_id: true,
|
|
472
477
|
}).then(data => {
|
|
473
478
|
dialog.dataLoading({ visible: false });
|
|
474
479
|
return data.response.allUsers;
|
|
@@ -1341,7 +1346,6 @@ export class UserList {
|
|
|
1341
1346
|
].join(BgWidget.mbContainer(18));
|
|
1342
1347
|
}
|
|
1343
1348
|
},
|
|
1344
|
-
divCreate: {},
|
|
1345
1349
|
onCreate: () => {
|
|
1346
1350
|
if (vmt.loading) {
|
|
1347
1351
|
ApiUser.getPublicConfig('user_general_tags', 'manager').then(
|
|
@@ -1568,7 +1572,6 @@ export class UserList {
|
|
|
1568
1572
|
`;
|
|
1569
1573
|
}
|
|
1570
1574
|
},
|
|
1571
|
-
divCreate: {},
|
|
1572
1575
|
onCreate: () => {
|
|
1573
1576
|
if (loading) {
|
|
1574
1577
|
ApiUser.getPublicConfig('member_level_config', 'manager').then(
|
|
@@ -1628,6 +1631,7 @@ export class UserList {
|
|
|
1628
1631
|
<div style="font-size: 16px; font-weight: 400; color: #393939;">${content}</div>
|
|
1629
1632
|
`;
|
|
1630
1633
|
}
|
|
1634
|
+
|
|
1631
1635
|
const firstShipment = (
|
|
1632
1636
|
await ApiShop.getOrder({
|
|
1633
1637
|
page: 0,
|
|
@@ -1943,7 +1947,7 @@ export class UserList {
|
|
|
1943
1947
|
</div>
|
|
1944
1948
|
</div>`,
|
|
1945
1949
|
vm.plan > 0
|
|
1946
|
-
? html` <div
|
|
1950
|
+
? html` <div>
|
|
1947
1951
|
<div class="tx_700 mb-3">社群綁定</div>
|
|
1948
1952
|
${[
|
|
1949
1953
|
{
|
|
@@ -2047,7 +2051,6 @@ export class UserList {
|
|
|
2047
2051
|
);
|
|
2048
2052
|
}
|
|
2049
2053
|
},
|
|
2050
|
-
onCreate: () => {},
|
|
2051
2054
|
};
|
|
2052
2055
|
});
|
|
2053
2056
|
}
|
|
@@ -2253,7 +2256,6 @@ export class UserList {
|
|
|
2253
2256
|
</div>
|
|
2254
2257
|
`);
|
|
2255
2258
|
},
|
|
2256
|
-
divCreate: {},
|
|
2257
2259
|
});
|
|
2258
2260
|
}
|
|
2259
2261
|
|
|
@@ -2342,6 +2344,7 @@ export class UserList {
|
|
|
2342
2344
|
page: vmi.page - 1,
|
|
2343
2345
|
limit: limit,
|
|
2344
2346
|
search: vm.query || undefined,
|
|
2347
|
+
only_id: true,
|
|
2345
2348
|
}).then(data => {
|
|
2346
2349
|
vm.dataList = data.response.data;
|
|
2347
2350
|
vmi.pageSize = Math.ceil(data.response.total / limit);
|