ts-glitter 21.1.8 → 21.1.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 +14 -1
- package/lowcode/Entry.ts +13 -1
- package/lowcode/backend-manager/bg-line.js +18 -10
- package/lowcode/backend-manager/bg-line.ts +19 -10
- package/lowcode/backend-manager/bg-list-component.js +1 -2
- package/lowcode/backend-manager/bg-list-component.ts +1 -1
- package/lowcode/backend-manager/bg-notify.js +17 -10
- package/lowcode/backend-manager/bg-notify.ts +19 -11
- package/lowcode/backend-manager/bg-recommend.js +15 -9
- package/lowcode/backend-manager/bg-recommend.ts +16 -9
- package/lowcode/backend-manager/bg-sns.js +16 -9
- package/lowcode/backend-manager/bg-sns.ts +18 -11
- package/lowcode/backend-manager/bg-widget.js +325 -261
- package/lowcode/backend-manager/bg-widget.ts +117 -45
- package/lowcode/cms-plugin/auto-fcm-history.js +15 -6
- package/lowcode/cms-plugin/auto-fcm-history.ts +18 -11
- package/lowcode/cms-plugin/auto-reply.js +17 -1
- package/lowcode/cms-plugin/auto-reply.ts +16 -1
- package/lowcode/cms-plugin/exhibition-list.js +11 -2
- package/lowcode/cms-plugin/exhibition-list.ts +12 -2
- package/lowcode/cms-plugin/live_capture.js +2 -2
- package/lowcode/cms-plugin/live_capture.ts +2 -2
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/order-excel.js +15 -1
- package/lowcode/cms-plugin/module/order-excel.ts +22 -2
- package/lowcode/cms-plugin/module/table-storage.js +11 -0
- package/lowcode/cms-plugin/module/table-storage.ts +12 -0
- package/lowcode/cms-plugin/permission-setting.js +16 -9
- package/lowcode/cms-plugin/permission-setting.ts +18 -10
- package/lowcode/cms-plugin/reconciliation-area.js +12 -3
- package/lowcode/cms-plugin/reconciliation-area.ts +13 -3
- package/lowcode/cms-plugin/shopping-allowance-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +13 -3
- package/lowcode/cms-plugin/shopping-invoice-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +13 -4
- package/lowcode/cms-plugin/shopping-order-manager.js +12 -3
- package/lowcode/cms-plugin/shopping-order-manager.ts +13 -4
- package/lowcode/cms-plugin/shopping-product-setting.js +16 -10
- package/lowcode/cms-plugin/shopping-product-setting.ts +17 -10
- package/lowcode/cms-plugin/shopping-product-stock.js +17 -11
- package/lowcode/cms-plugin/shopping-product-stock.ts +18 -11
- package/lowcode/cms-plugin/shopping-setting-basic.js +129 -38
- package/lowcode/cms-plugin/shopping-setting-basic.ts +134 -38
- package/lowcode/cms-plugin/stock-history.js +14 -7
- package/lowcode/cms-plugin/stock-history.ts +15 -7
- package/lowcode/cms-plugin/stock-stores.js +13 -6
- package/lowcode/cms-plugin/stock-stores.ts +14 -6
- package/lowcode/cms-plugin/stock-vendors.js +13 -6
- package/lowcode/cms-plugin/stock-vendors.ts +14 -6
- package/lowcode/cms-plugin/user-list.js +24 -7
- package/lowcode/cms-plugin/user-list.ts +25 -7
- package/lowcode/css/editor.css +9 -4
- package/lowcode/public-components/product/pd-class.js +11 -2
- package/lowcode/public-components/product/pd-class.ts +16 -3
- package/lowcode/public-components/public/ad.js +42 -10
- package/lowcode/public-components/public/ad.ts +28 -1
- package/lowcode/public-models/product.ts +1 -0
- package/lowcode/view-model/saas-view-model.js +394 -379
- package/lowcode/view-model/saas-view-model.ts +1451 -1405
- package/package.json +1 -1
- package/src/api-public/controllers/user.js +4 -4
- package/src/api-public/controllers/user.js.map +1 -1
- package/src/api-public/controllers/user.ts +4 -4
- package/src/api-public/services/checkout-event.js +7 -17
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/fb-api.d.ts +4 -3
- package/src/api-public/services/fb-api.js +72 -27
- package/src/api-public/services/fb-api.js.map +1 -1
- package/src/api-public/services/fb-api.ts +183 -127
- package/src/api-public/services/user.d.ts +6 -5
- package/src/api-public/services/user.js +19 -27
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +14 -10
- package/src/seo-config.js +1 -0
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +1 -0
- package/src/services/app.js +7 -17
- package/src/services/app.js.map +1 -1
|
@@ -26,6 +26,7 @@ import { ListHeaderOption } from './list-header-option.js';
|
|
|
26
26
|
import { ShoppingInvoiceManager } from './shopping-invoice-manager.js';
|
|
27
27
|
import { LineItem } from './module/data.js';
|
|
28
28
|
import { OrderModule } from './order/order-module.js';
|
|
29
|
+
import { TableStorage } from './module/table-storage.js';
|
|
29
30
|
|
|
30
31
|
const html = String.raw;
|
|
31
32
|
const css = String.raw;
|
|
@@ -124,6 +125,7 @@ export class ShoppingOrderManager {
|
|
|
124
125
|
apiJSON: {},
|
|
125
126
|
checkedData: [],
|
|
126
127
|
headerConfig: [],
|
|
128
|
+
listLimit: TableStorage.getLimit(),
|
|
127
129
|
};
|
|
128
130
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.orderFilterFrame);
|
|
129
131
|
vm.filter = ListComp.getFilterObject();
|
|
@@ -203,7 +205,7 @@ export class ShoppingOrderManager {
|
|
|
203
205
|
});
|
|
204
206
|
}
|
|
205
207
|
|
|
206
|
-
static tableOrder(gvc: GVC, vm:
|
|
208
|
+
static tableOrder(gvc: GVC, vm: ViewModel, query: OrderQuery, ListComp: BgListComponent) {
|
|
207
209
|
const glitter = gvc.glitter;
|
|
208
210
|
const dialog = new ShareDialog(glitter);
|
|
209
211
|
|
|
@@ -304,6 +306,14 @@ export class ShoppingOrderManager {
|
|
|
304
306
|
vm.query || '',
|
|
305
307
|
'搜尋訂單'
|
|
306
308
|
),
|
|
309
|
+
BgWidget.countingFilter({
|
|
310
|
+
gvc,
|
|
311
|
+
callback: value => {
|
|
312
|
+
vm.listLimit = value;
|
|
313
|
+
gvc.notifyDataChange(vm.id);
|
|
314
|
+
},
|
|
315
|
+
default: vm.listLimit,
|
|
316
|
+
}),
|
|
307
317
|
BgWidget.funnelFilter({
|
|
308
318
|
gvc,
|
|
309
319
|
callback: () => {
|
|
@@ -364,10 +374,9 @@ export class ShoppingOrderManager {
|
|
|
364
374
|
defPage: ShoppingOrderManager.vm.page,
|
|
365
375
|
getData: vmi => {
|
|
366
376
|
ShoppingOrderManager.vm.page = vmi.page;
|
|
367
|
-
const limit = 20;
|
|
368
377
|
vm.apiJSON = {
|
|
369
378
|
page: vmi.page - 1,
|
|
370
|
-
limit:
|
|
379
|
+
limit: vm.listLimit,
|
|
371
380
|
search: vm.query || undefined,
|
|
372
381
|
searchType: vm.queryType || 'cart_token',
|
|
373
382
|
orderString: vm.orderString,
|
|
@@ -530,7 +539,7 @@ export class ShoppingOrderManager {
|
|
|
530
539
|
}
|
|
531
540
|
|
|
532
541
|
vm.dataList = data.response.data;
|
|
533
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
542
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
534
543
|
vmi.originalData = vm.dataList;
|
|
535
544
|
vmi.tableData = await getDatalist();
|
|
536
545
|
vmi.loading = false;
|
|
@@ -26,6 +26,7 @@ import { ShoppingSettingBasic } from './shopping-setting-basic.js';
|
|
|
26
26
|
import { ShoppingSettingAdvance } from './shopping-setting-advance.js';
|
|
27
27
|
import { ProductInitial } from '../public-models/product.js';
|
|
28
28
|
import { IminModule } from './pos-pages/imin-module.js';
|
|
29
|
+
import { TableStorage } from './module/table-storage.js';
|
|
29
30
|
const html = String.raw;
|
|
30
31
|
export class ShoppingProductSetting {
|
|
31
32
|
static main(gvc, type = 'product') {
|
|
@@ -45,6 +46,7 @@ export class ShoppingProductSetting {
|
|
|
45
46
|
ai_initial: {},
|
|
46
47
|
apiJSON: {},
|
|
47
48
|
checkedData: [],
|
|
49
|
+
listLimit: TableStorage.getLimit(),
|
|
48
50
|
};
|
|
49
51
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.productFilterFrame);
|
|
50
52
|
vm.filter = ListComp.getFilterObject();
|
|
@@ -164,8 +166,7 @@ export class ShoppingProductSetting {
|
|
|
164
166
|
gvc,
|
|
165
167
|
callback: (value) => {
|
|
166
168
|
vm.queryType = value;
|
|
167
|
-
gvc.notifyDataChange(vm.tableId);
|
|
168
|
-
gvc.notifyDataChange(id);
|
|
169
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
169
170
|
},
|
|
170
171
|
default: vm.queryType || 'title',
|
|
171
172
|
options: FilterOptions.productSelect,
|
|
@@ -173,9 +174,16 @@ export class ShoppingProductSetting {
|
|
|
173
174
|
}),
|
|
174
175
|
BgWidget.searchFilter(gvc.event(e => {
|
|
175
176
|
vm.query = `${e.value}`.trim();
|
|
176
|
-
gvc.notifyDataChange(vm.tableId);
|
|
177
|
-
gvc.notifyDataChange(id);
|
|
177
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
178
178
|
}), vm.query || '', '搜尋'),
|
|
179
|
+
BgWidget.countingFilter({
|
|
180
|
+
gvc,
|
|
181
|
+
callback: value => {
|
|
182
|
+
vm.listLimit = value;
|
|
183
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
184
|
+
},
|
|
185
|
+
default: vm.listLimit,
|
|
186
|
+
}),
|
|
179
187
|
BgWidget.funnelFilter({
|
|
180
188
|
gvc,
|
|
181
189
|
callback: () => ListComp.showRightMenu(productFunnel),
|
|
@@ -184,8 +192,7 @@ export class ShoppingProductSetting {
|
|
|
184
192
|
gvc,
|
|
185
193
|
callback: (value) => {
|
|
186
194
|
vm.orderString = value;
|
|
187
|
-
gvc.notifyDataChange(vm.tableId);
|
|
188
|
-
gvc.notifyDataChange(id);
|
|
195
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
189
196
|
},
|
|
190
197
|
default: vm.orderString || 'default',
|
|
191
198
|
options: FilterOptions.productListOrderBy,
|
|
@@ -199,14 +206,13 @@ export class ShoppingProductSetting {
|
|
|
199
206
|
gvc.bindView({
|
|
200
207
|
bind: vm.tableId,
|
|
201
208
|
view: () => {
|
|
202
|
-
const limit = 20;
|
|
203
209
|
return BgWidget.tableV3({
|
|
204
210
|
gvc: gvc,
|
|
205
211
|
getData: vmi => {
|
|
206
212
|
function loop() {
|
|
207
213
|
vm.apiJSON = {
|
|
208
214
|
page: vmi.page - 1,
|
|
209
|
-
limit:
|
|
215
|
+
limit: vm.listLimit,
|
|
210
216
|
search: vm.query || undefined,
|
|
211
217
|
searchType: vm.queryType || undefined,
|
|
212
218
|
orderBy: vm.orderString || undefined,
|
|
@@ -344,7 +350,7 @@ export class ShoppingProductSetting {
|
|
|
344
350
|
});
|
|
345
351
|
}
|
|
346
352
|
vm.dataList = data.response.data;
|
|
347
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
353
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
348
354
|
vmi.originalData = vm.dataList;
|
|
349
355
|
vmi.tableData = getDatalist();
|
|
350
356
|
vmi.loading = false;
|
|
@@ -678,7 +684,7 @@ export class ShoppingProductSetting {
|
|
|
678
684
|
<div style="font-weight: 700;">定價</div>
|
|
679
685
|
<div class="d-flex w-100" style="gap:18px;">
|
|
680
686
|
<div class="d-flex w-50 flex-column guide5-5" style="gap: 8px;">
|
|
681
|
-
<div
|
|
687
|
+
<div>售價</div>
|
|
682
688
|
<input
|
|
683
689
|
style="width: 100%;border-radius: 10px;border: 1px solid #DDD;height: 40px;padding: 0px 18px;"
|
|
684
690
|
placeholder="請輸入售價"
|
|
@@ -17,6 +17,7 @@ import { ShoppingSettingBasic } from './shopping-setting-basic.js';
|
|
|
17
17
|
import { ShoppingSettingAdvance } from './shopping-setting-advance.js';
|
|
18
18
|
import { ActiveSchedule, Product, ProductInitial } from '../public-models/product.js';
|
|
19
19
|
import { IminModule } from './pos-pages/imin-module.js';
|
|
20
|
+
import { TableStorage } from './module/table-storage.js';
|
|
20
21
|
|
|
21
22
|
const html = String.raw;
|
|
22
23
|
|
|
@@ -49,6 +50,7 @@ export class ShoppingProductSetting {
|
|
|
49
50
|
ai_initial: any;
|
|
50
51
|
apiJSON: any;
|
|
51
52
|
checkedData: any[];
|
|
53
|
+
listLimit: number;
|
|
52
54
|
} = {
|
|
53
55
|
id: glitter.getUUID(),
|
|
54
56
|
tableId: glitter.getUUID(),
|
|
@@ -63,6 +65,7 @@ export class ShoppingProductSetting {
|
|
|
63
65
|
ai_initial: {},
|
|
64
66
|
apiJSON: {},
|
|
65
67
|
checkedData: [],
|
|
68
|
+
listLimit: TableStorage.getLimit(),
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.productFilterFrame);
|
|
@@ -216,8 +219,7 @@ export class ShoppingProductSetting {
|
|
|
216
219
|
gvc,
|
|
217
220
|
callback: (value: any) => {
|
|
218
221
|
vm.queryType = value;
|
|
219
|
-
gvc.notifyDataChange(vm.tableId);
|
|
220
|
-
gvc.notifyDataChange(id);
|
|
222
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
221
223
|
},
|
|
222
224
|
default: vm.queryType || 'title',
|
|
223
225
|
options: FilterOptions.productSelect,
|
|
@@ -226,12 +228,19 @@ export class ShoppingProductSetting {
|
|
|
226
228
|
BgWidget.searchFilter(
|
|
227
229
|
gvc.event(e => {
|
|
228
230
|
vm.query = `${e.value}`.trim();
|
|
229
|
-
gvc.notifyDataChange(vm.tableId);
|
|
230
|
-
gvc.notifyDataChange(id);
|
|
231
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
231
232
|
}),
|
|
232
233
|
vm.query || '',
|
|
233
234
|
'搜尋'
|
|
234
235
|
),
|
|
236
|
+
BgWidget.countingFilter({
|
|
237
|
+
gvc,
|
|
238
|
+
callback: value => {
|
|
239
|
+
vm.listLimit = value;
|
|
240
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
241
|
+
},
|
|
242
|
+
default: vm.listLimit,
|
|
243
|
+
}),
|
|
235
244
|
BgWidget.funnelFilter({
|
|
236
245
|
gvc,
|
|
237
246
|
callback: () => ListComp.showRightMenu(productFunnel),
|
|
@@ -240,8 +249,7 @@ export class ShoppingProductSetting {
|
|
|
240
249
|
gvc,
|
|
241
250
|
callback: (value: any) => {
|
|
242
251
|
vm.orderString = value;
|
|
243
|
-
gvc.notifyDataChange(vm.tableId);
|
|
244
|
-
gvc.notifyDataChange(id);
|
|
252
|
+
gvc.notifyDataChange([vm.tableId, id]);
|
|
245
253
|
},
|
|
246
254
|
default: vm.orderString || 'default',
|
|
247
255
|
options: FilterOptions.productListOrderBy,
|
|
@@ -256,14 +264,13 @@ export class ShoppingProductSetting {
|
|
|
256
264
|
gvc.bindView({
|
|
257
265
|
bind: vm.tableId,
|
|
258
266
|
view: () => {
|
|
259
|
-
const limit = 20;
|
|
260
267
|
return BgWidget.tableV3({
|
|
261
268
|
gvc: gvc,
|
|
262
269
|
getData: vmi => {
|
|
263
270
|
function loop() {
|
|
264
271
|
vm.apiJSON = {
|
|
265
272
|
page: vmi.page - 1,
|
|
266
|
-
limit:
|
|
273
|
+
limit: vm.listLimit,
|
|
267
274
|
search: vm.query || undefined,
|
|
268
275
|
searchType: vm.queryType || undefined,
|
|
269
276
|
orderBy: vm.orderString || undefined,
|
|
@@ -404,7 +411,7 @@ export class ShoppingProductSetting {
|
|
|
404
411
|
}
|
|
405
412
|
|
|
406
413
|
vm.dataList = data.response.data;
|
|
407
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
414
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
408
415
|
vmi.originalData = vm.dataList;
|
|
409
416
|
vmi.tableData = getDatalist();
|
|
410
417
|
vmi.loading = false;
|
|
@@ -786,7 +793,7 @@ export class ShoppingProductSetting {
|
|
|
786
793
|
<div style="font-weight: 700;">定價</div>
|
|
787
794
|
<div class="d-flex w-100" style="gap:18px;">
|
|
788
795
|
<div class="d-flex w-50 flex-column guide5-5" style="gap: 8px;">
|
|
789
|
-
<div
|
|
796
|
+
<div>售價</div>
|
|
790
797
|
<input
|
|
791
798
|
style="width: 100%;border-radius: 10px;border: 1px solid #DDD;height: 40px;padding: 0px 18px;"
|
|
792
799
|
placeholder="請輸入售價"
|
|
@@ -7,6 +7,7 @@ import { FilterOptions } from './filter-options.js';
|
|
|
7
7
|
import { BgProduct } from '../backend-manager/bg-product.js';
|
|
8
8
|
import { ShoppingProductSetting } from './shopping-product-setting.js';
|
|
9
9
|
import { Tool } from '../modules/tool.js';
|
|
10
|
+
import { TableStorage } from './module/table-storage.js';
|
|
10
11
|
const html = String.raw;
|
|
11
12
|
export class StockList {
|
|
12
13
|
static main(gvc, option = {
|
|
@@ -33,6 +34,7 @@ export class StockList {
|
|
|
33
34
|
stockOriginArray: [],
|
|
34
35
|
replaceData: {},
|
|
35
36
|
stockStores: [],
|
|
37
|
+
listLimit: TableStorage.getLimit(),
|
|
36
38
|
};
|
|
37
39
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.stockFilterFrame);
|
|
38
40
|
vm.filter = ListComp.getFilterObject();
|
|
@@ -232,17 +234,23 @@ export class StockList {
|
|
|
232
234
|
gvc,
|
|
233
235
|
callback: (value) => {
|
|
234
236
|
vm.queryType = value;
|
|
235
|
-
gvc.notifyDataChange(vm.tableId);
|
|
236
|
-
gvc.notifyDataChange(vmlist.id);
|
|
237
|
+
gvc.notifyDataChange([vm.tableId, vmlist.id]);
|
|
237
238
|
},
|
|
238
239
|
default: vm.queryType || 'name',
|
|
239
240
|
options: FilterOptions.stockSelect,
|
|
240
241
|
}),
|
|
241
242
|
BgWidget.searchFilter(gvc.event(e => {
|
|
242
243
|
vm.query = `${e.value}`.trim();
|
|
243
|
-
gvc.notifyDataChange(vm.tableId);
|
|
244
|
-
gvc.notifyDataChange(vmlist.id);
|
|
244
|
+
gvc.notifyDataChange([vm.tableId, vmlist.id]);
|
|
245
245
|
}), vm.query || '', '搜尋商品'),
|
|
246
|
+
BgWidget.countingFilter({
|
|
247
|
+
gvc,
|
|
248
|
+
callback: value => {
|
|
249
|
+
vm.listLimit = value;
|
|
250
|
+
gvc.notifyDataChange([vm.tableId, vmlist.id]);
|
|
251
|
+
},
|
|
252
|
+
default: vm.listLimit,
|
|
253
|
+
}),
|
|
246
254
|
BgWidget.funnelFilter({
|
|
247
255
|
gvc,
|
|
248
256
|
callback: () => ListComp.showRightMenu(FilterOptions.stockFunnel),
|
|
@@ -251,8 +259,7 @@ export class StockList {
|
|
|
251
259
|
gvc,
|
|
252
260
|
callback: (value) => {
|
|
253
261
|
vm.orderString = value;
|
|
254
|
-
gvc.notifyDataChange(vm.tableId);
|
|
255
|
-
gvc.notifyDataChange(vmlist.id);
|
|
262
|
+
gvc.notifyDataChange([vm.tableId, vmlist.id]);
|
|
256
263
|
},
|
|
257
264
|
default: vm.orderString || 'default',
|
|
258
265
|
options: FilterOptions.stockOrderBy,
|
|
@@ -279,9 +286,8 @@ export class StockList {
|
|
|
279
286
|
gvc: gvc,
|
|
280
287
|
getData: vd => {
|
|
281
288
|
vmi = vd;
|
|
282
|
-
const limit = 15;
|
|
283
289
|
Promise.all([
|
|
284
|
-
new Promise(
|
|
290
|
+
new Promise(resolve => {
|
|
285
291
|
ApiUser.getPublicConfig('store_manager', 'manager').then((dd) => {
|
|
286
292
|
if (dd.result && dd.response.value && dd.response.value.list) {
|
|
287
293
|
resolve(dd.response.value.list);
|
|
@@ -291,10 +297,10 @@ export class StockList {
|
|
|
291
297
|
}
|
|
292
298
|
});
|
|
293
299
|
}),
|
|
294
|
-
new Promise(
|
|
300
|
+
new Promise(resolve => {
|
|
295
301
|
ApiShop.getVariants({
|
|
296
302
|
page: vmi.page - 1,
|
|
297
|
-
limit:
|
|
303
|
+
limit: vm.listLimit,
|
|
298
304
|
search: vm.query || undefined,
|
|
299
305
|
searchType: vm.queryType || 'title',
|
|
300
306
|
orderBy: vm.orderString || undefined,
|
|
@@ -319,7 +325,7 @@ export class StockList {
|
|
|
319
325
|
return !option.filter_variants.includes([dd.product_id].concat(dd.variant_content.spec).join('-'));
|
|
320
326
|
});
|
|
321
327
|
vm.dataList = data.response.data;
|
|
322
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
328
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
323
329
|
vmi.originalData = vm.dataList;
|
|
324
330
|
vmi.tableData = getDatalist();
|
|
325
331
|
vm.stockOriginArray = JSON.parse(JSON.stringify(vm.stockArray));
|
|
@@ -8,6 +8,7 @@ import { FilterOptions } from './filter-options.js';
|
|
|
8
8
|
import { BgProduct, OptionsItem } from '../backend-manager/bg-product.js';
|
|
9
9
|
import { ShoppingProductSetting } from './shopping-product-setting.js';
|
|
10
10
|
import { Tool } from '../modules/tool.js';
|
|
11
|
+
import { TableStorage } from './module/table-storage.js';
|
|
11
12
|
|
|
12
13
|
const html = String.raw;
|
|
13
14
|
|
|
@@ -40,6 +41,7 @@ type VM = {
|
|
|
40
41
|
stockOriginArray: StockListObj;
|
|
41
42
|
replaceData?: any;
|
|
42
43
|
stockStores: StockStore[];
|
|
44
|
+
listLimit: number;
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
type ProductType = 'product' | 'addProduct' | 'giveaway' | 'hidden' | 'all';
|
|
@@ -79,6 +81,7 @@ export class StockList {
|
|
|
79
81
|
stockOriginArray: [],
|
|
80
82
|
replaceData: {},
|
|
81
83
|
stockStores: [],
|
|
84
|
+
listLimit: TableStorage.getLimit(),
|
|
82
85
|
};
|
|
83
86
|
|
|
84
87
|
const ListComp = new BgListComponent(gvc, vm, FilterOptions.stockFilterFrame);
|
|
@@ -302,8 +305,7 @@ export class StockList {
|
|
|
302
305
|
gvc,
|
|
303
306
|
callback: (value: any) => {
|
|
304
307
|
vm.queryType = value;
|
|
305
|
-
gvc.notifyDataChange(vm.tableId);
|
|
306
|
-
gvc.notifyDataChange(vmlist.id);
|
|
308
|
+
gvc.notifyDataChange([vm.tableId, vmlist.id]);
|
|
307
309
|
},
|
|
308
310
|
default: vm.queryType || 'name',
|
|
309
311
|
options: FilterOptions.stockSelect,
|
|
@@ -311,12 +313,19 @@ export class StockList {
|
|
|
311
313
|
BgWidget.searchFilter(
|
|
312
314
|
gvc.event(e => {
|
|
313
315
|
vm.query = `${e.value}`.trim();
|
|
314
|
-
gvc.notifyDataChange(vm.tableId);
|
|
315
|
-
gvc.notifyDataChange(vmlist.id);
|
|
316
|
+
gvc.notifyDataChange([vm.tableId, vmlist.id]);
|
|
316
317
|
}),
|
|
317
318
|
vm.query || '',
|
|
318
319
|
'搜尋商品'
|
|
319
320
|
),
|
|
321
|
+
BgWidget.countingFilter({
|
|
322
|
+
gvc,
|
|
323
|
+
callback: value => {
|
|
324
|
+
vm.listLimit = value;
|
|
325
|
+
gvc.notifyDataChange([vm.tableId, vmlist.id]);
|
|
326
|
+
},
|
|
327
|
+
default: vm.listLimit,
|
|
328
|
+
}),
|
|
320
329
|
BgWidget.funnelFilter({
|
|
321
330
|
gvc,
|
|
322
331
|
callback: () => ListComp.showRightMenu(FilterOptions.stockFunnel),
|
|
@@ -325,8 +334,7 @@ export class StockList {
|
|
|
325
334
|
gvc,
|
|
326
335
|
callback: (value: any) => {
|
|
327
336
|
vm.orderString = value;
|
|
328
|
-
gvc.notifyDataChange(vm.tableId);
|
|
329
|
-
gvc.notifyDataChange(vmlist.id);
|
|
337
|
+
gvc.notifyDataChange([vm.tableId, vmlist.id]);
|
|
330
338
|
},
|
|
331
339
|
default: vm.orderString || 'default',
|
|
332
340
|
options: FilterOptions.stockOrderBy,
|
|
@@ -354,10 +362,9 @@ export class StockList {
|
|
|
354
362
|
gvc: gvc,
|
|
355
363
|
getData: vd => {
|
|
356
364
|
vmi = vd;
|
|
357
|
-
const limit = 15;
|
|
358
365
|
|
|
359
366
|
Promise.all([
|
|
360
|
-
new Promise(
|
|
367
|
+
new Promise(resolve => {
|
|
361
368
|
ApiUser.getPublicConfig('store_manager', 'manager').then((dd: any) => {
|
|
362
369
|
if (dd.result && dd.response.value && dd.response.value.list) {
|
|
363
370
|
resolve(dd.response.value.list);
|
|
@@ -366,10 +373,10 @@ export class StockList {
|
|
|
366
373
|
}
|
|
367
374
|
});
|
|
368
375
|
}),
|
|
369
|
-
new Promise(
|
|
376
|
+
new Promise(resolve => {
|
|
370
377
|
ApiShop.getVariants({
|
|
371
378
|
page: vmi.page - 1,
|
|
372
|
-
limit:
|
|
379
|
+
limit: vm.listLimit,
|
|
373
380
|
search: vm.query || undefined,
|
|
374
381
|
searchType: vm.queryType || 'title',
|
|
375
382
|
orderBy: vm.orderString || undefined,
|
|
@@ -398,7 +405,7 @@ export class StockList {
|
|
|
398
405
|
});
|
|
399
406
|
|
|
400
407
|
vm.dataList = data.response.data;
|
|
401
|
-
vmi.pageSize = Math.ceil(data.response.total /
|
|
408
|
+
vmi.pageSize = Math.ceil(data.response.total / vm.listLimit);
|
|
402
409
|
vmi.originalData = vm.dataList;
|
|
403
410
|
vmi.tableData = getDatalist();
|
|
404
411
|
vm.stockOriginArray = JSON.parse(JSON.stringify(vm.stockArray));
|