ts-glitter 22.4.7 → 22.5.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/lib/glitterBundle/Glitter.css +74 -62
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +49 -32
- package/lowcode/backend-manager/bg-product.ts +57 -39
- package/lowcode/backend-manager/bg-widget.js +17 -0
- package/lowcode/backend-manager/bg-widget.ts +18 -0
- package/lowcode/cms-plugin/information/information-module.js +5 -5
- package/lowcode/cms-plugin/information/information-module.ts +9 -5
- package/lowcode/cms-plugin/menus-setting.js +69 -55
- package/lowcode/cms-plugin/menus-setting.ts +77 -61
- package/lowcode/cms-plugin/module/form-module.js +109 -89
- package/lowcode/cms-plugin/module/form-module.ts +680 -650
- package/lowcode/cms-plugin/module/product-excel.js +1 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/pos-pages/payment-page.js +28 -10
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +29 -10
- package/lowcode/cms-plugin/shopping-allowance-manager.js +0 -1
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +0 -1
- package/lowcode/cms-plugin/shopping-collections.js +367 -193
- package/lowcode/cms-plugin/shopping-collections.ts +664 -243
- package/lowcode/cms-plugin/shopping-information.js +392 -38
- package/lowcode/cms-plugin/shopping-information.ts +479 -87
- package/lowcode/cms-plugin/shopping-product-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-product-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-setting-advance.js +906 -766
- package/lowcode/cms-plugin/shopping-setting-advance.ts +977 -841
- package/lowcode/cms-plugin/shopping-setting-basic.js +1547 -1285
- package/lowcode/cms-plugin/shopping-setting-basic.ts +1742 -1466
- package/lowcode/cms-plugin/stock-stores.js +1 -0
- package/lowcode/cms-plugin/stock-stores.ts +1 -0
- package/lowcode/cms-plugin/user-list.js +47 -12
- package/lowcode/cms-plugin/user-list.ts +52 -14
- package/lowcode/css/editor.css +6 -0
- package/lowcode/glitterBundle/Glitter.css +74 -62
- package/lowcode/jslib/nestable/index.html +317 -0
- package/lowcode/jslib/nestable/jquery.nestable.js +484 -0
- package/lowcode/official_view_component/form-widget/input-custom.js +98 -6
- package/lowcode/official_view_component/form-widget/input-custom.ts +121 -16
- package/lowcode/public-components/headers/header-class.js +63 -0
- package/lowcode/public-components/headers/header-class.ts +65 -0
- package/lowcode/public-components/headers/sy-02.js +386 -400
- package/lowcode/public-components/headers/sy-02.ts +482 -492
- package/lowcode/public-components/headers/sy-03.js +42 -43
- package/lowcode/public-components/headers/sy-03.ts +46 -43
- package/lowcode/public-components/headers/sy-04.js +43 -41
- package/lowcode/public-components/headers/sy-04.ts +48 -41
- package/lowcode/public-components/headers/sy-05.js +30 -27
- package/lowcode/public-components/headers/sy-05.ts +33 -27
- package/lowcode/public-components/product/product-list.js +160 -148
- package/lowcode/public-components/product/product-list.ts +186 -165
- package/lowcode/public-models/product.ts +26 -1
- package/lowcode/src/glitterBundle/Glitter.css +74 -62
- package/package.json +1 -1
- package/rxmnt81tnk.json +1 -0
- package/src/api-public/controllers/shop.js +10 -4
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -9
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- package/src/api-public/services/mail.js +1 -1
- package/src/api-public/services/mail.js.map +1 -1
- package/src/api-public/services/mail.ts +1 -1
- package/src/api-public/services/schedule.d.ts +0 -1
- package/src/api-public/services/schedule.js +12 -35
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +15 -39
- package/src/api-public/services/shopee.js +7 -17
- package/src/api-public/services/shopping.d.ts +27 -6
- package/src/api-public/services/shopping.js +364 -85
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +510 -101
- package/src/api-public/services/updated-table-checked.js +58 -1
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +62 -1
- package/src/api-public/services/user-update.js +14 -0
- package/src/api-public/services/user-update.js.map +1 -1
- package/src/api-public/services/user-update.ts +15 -0
- package/src/api-public/services/user.js +1 -1
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +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/helper/glitter-util.d.ts +1 -0
- package/src/index.js +7 -5
- package/src/index.js.map +1 -1
- package/src/index.ts +45 -38
- package/src/modules/firebase.js +1 -0
- package/src/modules/firebase.js.map +1 -1
- package/src/modules/firebase.ts +1 -0
- package/src/seo-config.d.ts +1 -1
- package/src/seo-config.js +1 -2
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +1 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +4 -3
- package/src/services/ses.js.map +1 -1
- package/src/services/system-schedule.js.map +1 -1
- package/src/services/system-schedule.ts +1 -0
|
@@ -23,7 +23,7 @@ export class MenusSetting {
|
|
|
23
23
|
dataList: undefined,
|
|
24
24
|
query: '',
|
|
25
25
|
tab: def || 'menu',
|
|
26
|
-
select: { title: '', tag: '' },
|
|
26
|
+
select: { title: '', tag: '', inner_title: '' },
|
|
27
27
|
};
|
|
28
28
|
function getDatalist() {
|
|
29
29
|
return vm.dataList.map((dd) => {
|
|
@@ -124,7 +124,41 @@ export class MenusSetting {
|
|
|
124
124
|
</div>
|
|
125
125
|
`,
|
|
126
126
|
},
|
|
127
|
-
...menu_all.list
|
|
127
|
+
...menu_all.list
|
|
128
|
+
.filter((d1) => d1.tab === tag)
|
|
129
|
+
.map((dd, index) => {
|
|
130
|
+
return {
|
|
131
|
+
tag: tag,
|
|
132
|
+
inner_title: dd.title,
|
|
133
|
+
title: html ` <div class="w-100 d-flex align-items-center">
|
|
134
|
+
${dd.title}
|
|
135
|
+
<div class="flex-fill"></div>
|
|
136
|
+
<div class="c_filter_view" style="cursor:pointer;width: 30px;height: 30px;" onclick="${gvc.event((e, event) => {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
event.stopPropagation();
|
|
139
|
+
dialog.checkYesOrNot({
|
|
140
|
+
text: '是否確認刪除?',
|
|
141
|
+
callback: (response) => __awaiter(this, void 0, void 0, function* () {
|
|
142
|
+
if (response) {
|
|
143
|
+
dialog.dataLoading({ visible: true });
|
|
144
|
+
let menu_all = (yield ApiUser.getPublicConfig(tag, 'manager')).response.value;
|
|
145
|
+
menu_all.list = menu_all.list.filter((d1) => d1.tag != tag);
|
|
146
|
+
yield ApiUser.setPublicConfig({
|
|
147
|
+
key: tag,
|
|
148
|
+
value: menu_all,
|
|
149
|
+
user_id: 'manager',
|
|
150
|
+
});
|
|
151
|
+
dialog.dataLoading({ visible: false });
|
|
152
|
+
gvc.recreateView();
|
|
153
|
+
}
|
|
154
|
+
}),
|
|
155
|
+
});
|
|
156
|
+
})}">
|
|
157
|
+
<i class="fa-regular fa-trash"></i>
|
|
158
|
+
</div>
|
|
159
|
+
</div>`,
|
|
160
|
+
};
|
|
161
|
+
}),
|
|
128
162
|
];
|
|
129
163
|
vmi.pageSize = 1;
|
|
130
164
|
vmi.originalData = vm.dataList;
|
|
@@ -154,7 +188,7 @@ export class MenusSetting {
|
|
|
154
188
|
gvc: gvc,
|
|
155
189
|
widget: widget,
|
|
156
190
|
key: vm.select.tag,
|
|
157
|
-
title: vm.select.title,
|
|
191
|
+
title: vm.select.inner_title || vm.select.title,
|
|
158
192
|
goBack: () => {
|
|
159
193
|
vm.type = 'list';
|
|
160
194
|
gvc.notifyDataChange(id);
|
|
@@ -271,7 +305,7 @@ export class MenusSetting {
|
|
|
271
305
|
var _a, _b;
|
|
272
306
|
vm.link[vm.language] = (_a = vm.link[vm.language]) !== null && _a !== void 0 ? _a : [];
|
|
273
307
|
const link = vm.link[vm.language];
|
|
274
|
-
return html
|
|
308
|
+
return html ` <div class="title-container" style="width: 100%; max-width: 100%;">
|
|
275
309
|
${BgWidget.goBack(cf.gvc.event(() => {
|
|
276
310
|
cf.goBack();
|
|
277
311
|
}))}${BgWidget.title((_b = cf.title) !== null && _b !== void 0 ? _b : '選單設定')}
|
|
@@ -313,7 +347,7 @@ export class MenusSetting {
|
|
|
313
347
|
},
|
|
314
348
|
})}
|
|
315
349
|
</div>
|
|
316
|
-
${BgWidget.container(html
|
|
350
|
+
${BgWidget.container(html ` <div
|
|
317
351
|
style="max-width:100%;width: 100%; padding: 20px; background: white; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.08); border-radius: 10px; overflow: hidden; justify-content: center; align-items: center; display: inline-flex"
|
|
318
352
|
>
|
|
319
353
|
<div style="width: 100%; position: relative">
|
|
@@ -376,7 +410,7 @@ export class MenusSetting {
|
|
|
376
410
|
style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex"
|
|
377
411
|
>
|
|
378
412
|
${(() => {
|
|
379
|
-
function renderItems(array) {
|
|
413
|
+
function renderItems(array, depth) {
|
|
380
414
|
const id = gvc.glitter.getUUID();
|
|
381
415
|
return (gvc.bindView(() => {
|
|
382
416
|
return {
|
|
@@ -453,24 +487,26 @@ export class MenusSetting {
|
|
|
453
487
|
</div>
|
|
454
488
|
</div>
|
|
455
489
|
<div class="flex-fill"></div>
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
490
|
+
${depth < 2
|
|
491
|
+
? html ` <div
|
|
492
|
+
class="child me-2"
|
|
493
|
+
onclick="${cf.gvc.event((_, event) => {
|
|
494
|
+
event.stopPropagation();
|
|
495
|
+
MenusSetting.editEvent({
|
|
496
|
+
link: '',
|
|
497
|
+
title: '',
|
|
498
|
+
visible_type: 'all',
|
|
499
|
+
items: [],
|
|
500
|
+
}, data => {
|
|
501
|
+
dd.items = dd.items || [];
|
|
502
|
+
dd.items.push(data);
|
|
503
|
+
gvc.notifyDataChange(vm.id);
|
|
504
|
+
});
|
|
505
|
+
})}"
|
|
506
|
+
>
|
|
507
|
+
<i class="fa-solid fa-plus" style="color:#393939;"></i>
|
|
508
|
+
</div>`
|
|
509
|
+
: ''}
|
|
474
510
|
<div
|
|
475
511
|
class="child"
|
|
476
512
|
onclick="${cf.gvc.event((_, event) => {
|
|
@@ -491,12 +527,12 @@ export class MenusSetting {
|
|
|
491
527
|
class=" w-100 ${dd.toggle ? '' : 'd-none'}"
|
|
492
528
|
style="padding-left: 35px;"
|
|
493
529
|
>
|
|
494
|
-
${renderItems(dd.items)}
|
|
530
|
+
${renderItems(dd.items, depth + 1)}
|
|
495
531
|
</div>
|
|
496
532
|
`
|
|
497
533
|
: ''}
|
|
498
534
|
`;
|
|
499
|
-
return html
|
|
535
|
+
return html ` <li class="w-100 ">${list}</li>`;
|
|
500
536
|
})
|
|
501
537
|
.join('');
|
|
502
538
|
},
|
|
@@ -573,35 +609,13 @@ export class MenusSetting {
|
|
|
573
609
|
</div>
|
|
574
610
|
</div>`);
|
|
575
611
|
}
|
|
576
|
-
return renderItems(link);
|
|
612
|
+
return renderItems(link, 0);
|
|
577
613
|
})()}
|
|
578
614
|
</div>
|
|
579
615
|
</div>
|
|
580
616
|
</div>
|
|
581
617
|
</div>`)}
|
|
582
618
|
<div class="update-bar-container">
|
|
583
|
-
${['menu-setting', 'footer-setting', 'text-manager'].includes(cf.key)
|
|
584
|
-
? ''
|
|
585
|
-
: BgWidget.danger(gvc.event(() => __awaiter(this, void 0, void 0, function* () {
|
|
586
|
-
dialog.checkYesOrNot({
|
|
587
|
-
text: '是否確認刪除?',
|
|
588
|
-
callback: (response) => __awaiter(this, void 0, void 0, function* () {
|
|
589
|
-
if (response) {
|
|
590
|
-
dialog.dataLoading({ visible: true });
|
|
591
|
-
let menu_all = (yield ApiUser.getPublicConfig('menu-setting-list', 'manager')).response
|
|
592
|
-
.value;
|
|
593
|
-
menu_all.list = menu_all.list.filter((d1) => d1.tag != cf.key);
|
|
594
|
-
yield ApiUser.setPublicConfig({
|
|
595
|
-
key: 'menu-setting-list',
|
|
596
|
-
value: menu_all,
|
|
597
|
-
user_id: 'manager',
|
|
598
|
-
});
|
|
599
|
-
dialog.dataLoading({ visible: false });
|
|
600
|
-
cf.goBack();
|
|
601
|
-
}
|
|
602
|
-
}),
|
|
603
|
-
});
|
|
604
|
-
})))}
|
|
605
619
|
${BgWidget.cancel(gvc.event(() => {
|
|
606
620
|
cf.goBack();
|
|
607
621
|
}))}
|
|
@@ -742,7 +756,7 @@ export class MenusSetting {
|
|
|
742
756
|
? data.visible_type === 'user'
|
|
743
757
|
? vm.visibleDataList
|
|
744
758
|
.map(item => {
|
|
745
|
-
return html
|
|
759
|
+
return html ` <div class="d-flex gap-1">
|
|
746
760
|
<div>${item.userData.name}</div>
|
|
747
761
|
${BgWidget.grayNote(item.account)}
|
|
748
762
|
</div>`;
|
|
@@ -750,7 +764,7 @@ export class MenusSetting {
|
|
|
750
764
|
.join('')
|
|
751
765
|
: vm.visibleDataList
|
|
752
766
|
.map(item => {
|
|
753
|
-
return html
|
|
767
|
+
return html ` <div class="d-flex gap-1">
|
|
754
768
|
<div>${item.title.replace('會員等級 - ', '')}</div>
|
|
755
769
|
</div>`;
|
|
756
770
|
})
|
|
@@ -760,7 +774,7 @@ export class MenusSetting {
|
|
|
760
774
|
`;
|
|
761
775
|
}
|
|
762
776
|
return BgWidget.mainCard([
|
|
763
|
-
html
|
|
777
|
+
html ` <div
|
|
764
778
|
class="d-flex align-items-center cursor_pointer"
|
|
765
779
|
onclick="${gvc.event(() => {
|
|
766
780
|
vm.show = false;
|
|
@@ -801,7 +815,7 @@ export class MenusSetting {
|
|
|
801
815
|
});
|
|
802
816
|
};
|
|
803
817
|
const backToDefault = () => {
|
|
804
|
-
return html
|
|
818
|
+
return html ` <div
|
|
805
819
|
class="position-absolute bottom-0 left-0 w-100 d-flex align-items-center justify-content-end p-3 border-top pe-4"
|
|
806
820
|
style="gap: 10px; background-color: #fff"
|
|
807
821
|
>
|
|
@@ -836,7 +850,7 @@ export class MenusSetting {
|
|
|
836
850
|
setVisibleDataArray(),
|
|
837
851
|
backToDefault(),
|
|
838
852
|
]
|
|
839
|
-
.map(h => html
|
|
853
|
+
.map(h => html ` <div class="w-100">${h}</div>`)
|
|
840
854
|
.join('');
|
|
841
855
|
rightMenu.closeEvent = () => {
|
|
842
856
|
if (data.title.length > 0 || data.link.length > 0) {
|
|
@@ -848,7 +862,7 @@ export class MenusSetting {
|
|
|
848
862
|
title: '新增選單',
|
|
849
863
|
view: gvc.bindView({
|
|
850
864
|
bind: ids.main,
|
|
851
|
-
view: () => html
|
|
865
|
+
view: () => html ` <div class="d-flex flex-column p-3">${view}</div>`,
|
|
852
866
|
}),
|
|
853
867
|
right: true,
|
|
854
868
|
});
|
|
@@ -26,7 +26,7 @@ export class MenusSetting {
|
|
|
26
26
|
index: number;
|
|
27
27
|
dataList: any;
|
|
28
28
|
query?: string;
|
|
29
|
-
select: { title: string; tag: string };
|
|
29
|
+
select: { inner_title:string,title: string; tag: string };
|
|
30
30
|
tab: 'menu' | 'footer';
|
|
31
31
|
} = {
|
|
32
32
|
type: 'list',
|
|
@@ -34,7 +34,7 @@ export class MenusSetting {
|
|
|
34
34
|
dataList: undefined,
|
|
35
35
|
query: '',
|
|
36
36
|
tab: def || 'menu',
|
|
37
|
-
select: { title: '', tag: '' },
|
|
37
|
+
select: { title: '', tag: '',inner_title:'' },
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
function getDatalist() {
|
|
@@ -64,6 +64,7 @@ export class MenusSetting {
|
|
|
64
64
|
`新增${vm.tab === 'menu' ? `頁首選單` : `頁腳選單`}`,
|
|
65
65
|
gvc.event(async () => {
|
|
66
66
|
let title = '';
|
|
67
|
+
|
|
67
68
|
async function next() {
|
|
68
69
|
dialog.dataLoading({ visible: true });
|
|
69
70
|
const tab = vm.tab === 'menu' ? `頁首選單` : `頁腳選單`;
|
|
@@ -84,6 +85,7 @@ export class MenusSetting {
|
|
|
84
85
|
dialog.dataLoading({ visible: false });
|
|
85
86
|
gvc.notifyDataChange(id);
|
|
86
87
|
}
|
|
88
|
+
|
|
87
89
|
BgWidget.settingDialog({
|
|
88
90
|
gvc: gvc,
|
|
89
91
|
title: '選單名稱',
|
|
@@ -148,7 +150,41 @@ export class MenusSetting {
|
|
|
148
150
|
</div>
|
|
149
151
|
`,
|
|
150
152
|
},
|
|
151
|
-
...menu_all.list
|
|
153
|
+
...menu_all.list
|
|
154
|
+
.filter((d1: any) => d1.tab === tag)
|
|
155
|
+
.map((dd: any, index: number) => {
|
|
156
|
+
return {
|
|
157
|
+
tag: tag,
|
|
158
|
+
inner_title: dd.title,
|
|
159
|
+
title: html` <div class="w-100 d-flex align-items-center">
|
|
160
|
+
${dd.title}
|
|
161
|
+
<div class="flex-fill"></div>
|
|
162
|
+
<div class="c_filter_view" style="cursor:pointer;width: 30px;height: 30px;" onclick="${gvc.event((e,event)=>{
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
event.stopPropagation();
|
|
165
|
+
dialog.checkYesOrNot({
|
|
166
|
+
text: '是否確認刪除?',
|
|
167
|
+
callback: async response => {
|
|
168
|
+
if (response) {
|
|
169
|
+
dialog.dataLoading({ visible: true });
|
|
170
|
+
let menu_all = (await ApiUser.getPublicConfig(tag, 'manager')).response.value;
|
|
171
|
+
menu_all.list = menu_all.list.filter((d1: any) => d1.tag != tag);
|
|
172
|
+
await ApiUser.setPublicConfig({
|
|
173
|
+
key: tag,
|
|
174
|
+
value: menu_all,
|
|
175
|
+
user_id: 'manager',
|
|
176
|
+
});
|
|
177
|
+
dialog.dataLoading({ visible: false });
|
|
178
|
+
gvc.recreateView();
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
})}">
|
|
183
|
+
<i class="fa-regular fa-trash"></i>
|
|
184
|
+
</div>
|
|
185
|
+
</div>`,
|
|
186
|
+
};
|
|
187
|
+
}),
|
|
152
188
|
];
|
|
153
189
|
|
|
154
190
|
vmi.pageSize = 1;
|
|
@@ -182,7 +218,7 @@ export class MenusSetting {
|
|
|
182
218
|
gvc: gvc,
|
|
183
219
|
widget: widget,
|
|
184
220
|
key: vm.select.tag as any,
|
|
185
|
-
title: vm.select.title,
|
|
221
|
+
title: vm.select.inner_title || vm.select.title,
|
|
186
222
|
goBack: () => {
|
|
187
223
|
vm.type = 'list';
|
|
188
224
|
gvc.notifyDataChange(id);
|
|
@@ -321,7 +357,7 @@ export class MenusSetting {
|
|
|
321
357
|
vm.link[vm.language] = vm.link[vm.language] ?? [];
|
|
322
358
|
const link = vm.link[vm.language];
|
|
323
359
|
|
|
324
|
-
return html
|
|
360
|
+
return html` <div class="title-container" style="width: 100%; max-width: 100%;">
|
|
325
361
|
${BgWidget.goBack(
|
|
326
362
|
cf.gvc.event(() => {
|
|
327
363
|
cf.goBack();
|
|
@@ -372,7 +408,7 @@ export class MenusSetting {
|
|
|
372
408
|
})}
|
|
373
409
|
</div>
|
|
374
410
|
${BgWidget.container(
|
|
375
|
-
html
|
|
411
|
+
html` <div
|
|
376
412
|
style="max-width:100%;width: 100%; padding: 20px; background: white; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.08); border-radius: 10px; overflow: hidden; justify-content: center; align-items: center; display: inline-flex"
|
|
377
413
|
>
|
|
378
414
|
<div style="width: 100%; position: relative">
|
|
@@ -435,7 +471,7 @@ export class MenusSetting {
|
|
|
435
471
|
style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex"
|
|
436
472
|
>
|
|
437
473
|
${(() => {
|
|
438
|
-
function renderItems(array: MenuItem[]): string {
|
|
474
|
+
function renderItems(array: MenuItem[], depth: number): string {
|
|
439
475
|
const id = gvc.glitter.getUUID();
|
|
440
476
|
return (
|
|
441
477
|
gvc.bindView(() => {
|
|
@@ -512,27 +548,29 @@ export class MenusSetting {
|
|
|
512
548
|
</div>
|
|
513
549
|
</div>
|
|
514
550
|
<div class="flex-fill"></div>
|
|
515
|
-
<
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
551
|
+
${depth < 2
|
|
552
|
+
? html` <div
|
|
553
|
+
class="child me-2"
|
|
554
|
+
onclick="${cf.gvc.event((_, event) => {
|
|
555
|
+
event.stopPropagation();
|
|
556
|
+
MenusSetting.editEvent(
|
|
557
|
+
{
|
|
558
|
+
link: '',
|
|
559
|
+
title: '',
|
|
560
|
+
visible_type: 'all',
|
|
561
|
+
items: [],
|
|
562
|
+
},
|
|
563
|
+
data => {
|
|
564
|
+
dd.items = dd.items || [];
|
|
565
|
+
dd.items.push(data);
|
|
566
|
+
gvc.notifyDataChange(vm.id);
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
})}"
|
|
570
|
+
>
|
|
571
|
+
<i class="fa-solid fa-plus" style="color:#393939;"></i>
|
|
572
|
+
</div>`
|
|
573
|
+
: ''}
|
|
536
574
|
<div
|
|
537
575
|
class="child"
|
|
538
576
|
onclick="${cf.gvc.event((_, event) => {
|
|
@@ -553,12 +591,12 @@ export class MenusSetting {
|
|
|
553
591
|
class=" w-100 ${(dd as any).toggle ? '' : 'd-none'}"
|
|
554
592
|
style="padding-left: 35px;"
|
|
555
593
|
>
|
|
556
|
-
${renderItems(dd.items as MenuItem[]) as any}
|
|
594
|
+
${renderItems(dd.items as MenuItem[], depth + 1) as any}
|
|
557
595
|
</div>
|
|
558
596
|
`
|
|
559
597
|
: ''}
|
|
560
598
|
`;
|
|
561
|
-
return html
|
|
599
|
+
return html` <li class="w-100 ">${list}</li>`;
|
|
562
600
|
})
|
|
563
601
|
.join('');
|
|
564
602
|
},
|
|
@@ -587,11 +625,13 @@ export class MenusSetting {
|
|
|
587
625
|
padding: 0;
|
|
588
626
|
}
|
|
589
627
|
`);
|
|
628
|
+
|
|
590
629
|
function swapArr(arr: any, index1: number, index2: number) {
|
|
591
630
|
const data = arr[index1];
|
|
592
631
|
arr.splice(index1, 1);
|
|
593
632
|
arr.splice(index2, 0, data);
|
|
594
633
|
}
|
|
634
|
+
|
|
595
635
|
let startIndex = 0;
|
|
596
636
|
//@ts-ignore
|
|
597
637
|
Sortable.create(gvc.getBindViewElem(id).get(0), {
|
|
@@ -645,7 +685,7 @@ export class MenusSetting {
|
|
|
645
685
|
);
|
|
646
686
|
}
|
|
647
687
|
|
|
648
|
-
return renderItems(link);
|
|
688
|
+
return renderItems(link, 0);
|
|
649
689
|
})()}
|
|
650
690
|
</div>
|
|
651
691
|
</div>
|
|
@@ -653,30 +693,6 @@ export class MenusSetting {
|
|
|
653
693
|
</div>`
|
|
654
694
|
)}
|
|
655
695
|
<div class="update-bar-container">
|
|
656
|
-
${['menu-setting', 'footer-setting', 'text-manager'].includes(cf.key)
|
|
657
|
-
? ''
|
|
658
|
-
: BgWidget.danger(
|
|
659
|
-
gvc.event(async () => {
|
|
660
|
-
dialog.checkYesOrNot({
|
|
661
|
-
text: '是否確認刪除?',
|
|
662
|
-
callback: async response => {
|
|
663
|
-
if (response) {
|
|
664
|
-
dialog.dataLoading({ visible: true });
|
|
665
|
-
let menu_all = (await ApiUser.getPublicConfig('menu-setting-list', 'manager')).response
|
|
666
|
-
.value;
|
|
667
|
-
menu_all.list = menu_all.list.filter((d1: any) => d1.tag != cf.key);
|
|
668
|
-
await ApiUser.setPublicConfig({
|
|
669
|
-
key: 'menu-setting-list',
|
|
670
|
-
value: menu_all,
|
|
671
|
-
user_id: 'manager',
|
|
672
|
-
});
|
|
673
|
-
dialog.dataLoading({ visible: false });
|
|
674
|
-
cf.goBack();
|
|
675
|
-
}
|
|
676
|
-
},
|
|
677
|
-
});
|
|
678
|
-
})
|
|
679
|
-
)}
|
|
680
696
|
${BgWidget.cancel(
|
|
681
697
|
gvc.event(() => {
|
|
682
698
|
cf.goBack();
|
|
@@ -835,7 +851,7 @@ export class MenusSetting {
|
|
|
835
851
|
? data.visible_type === 'user'
|
|
836
852
|
? vm.visibleDataList
|
|
837
853
|
.map(item => {
|
|
838
|
-
return html
|
|
854
|
+
return html` <div class="d-flex gap-1">
|
|
839
855
|
<div>${item.userData.name}</div>
|
|
840
856
|
${BgWidget.grayNote(item.account)}
|
|
841
857
|
</div>`;
|
|
@@ -843,7 +859,7 @@ export class MenusSetting {
|
|
|
843
859
|
.join('')
|
|
844
860
|
: vm.visibleDataList
|
|
845
861
|
.map(item => {
|
|
846
|
-
return html
|
|
862
|
+
return html` <div class="d-flex gap-1">
|
|
847
863
|
<div>${item.title.replace('會員等級 - ', '')}</div>
|
|
848
864
|
</div>`;
|
|
849
865
|
})
|
|
@@ -855,7 +871,7 @@ export class MenusSetting {
|
|
|
855
871
|
|
|
856
872
|
return BgWidget.mainCard(
|
|
857
873
|
[
|
|
858
|
-
html
|
|
874
|
+
html` <div
|
|
859
875
|
class="d-flex align-items-center cursor_pointer"
|
|
860
876
|
onclick="${gvc.event(() => {
|
|
861
877
|
vm.show = false;
|
|
@@ -907,7 +923,7 @@ export class MenusSetting {
|
|
|
907
923
|
};
|
|
908
924
|
|
|
909
925
|
const backToDefault = () => {
|
|
910
|
-
return html
|
|
926
|
+
return html` <div
|
|
911
927
|
class="position-absolute bottom-0 left-0 w-100 d-flex align-items-center justify-content-end p-3 border-top pe-4"
|
|
912
928
|
style="gap: 10px; background-color: #fff"
|
|
913
929
|
>
|
|
@@ -946,7 +962,7 @@ export class MenusSetting {
|
|
|
946
962
|
setVisibleDataArray(),
|
|
947
963
|
backToDefault(),
|
|
948
964
|
]
|
|
949
|
-
.map(h => html
|
|
965
|
+
.map(h => html` <div class="w-100">${h}</div>`)
|
|
950
966
|
.join('');
|
|
951
967
|
|
|
952
968
|
rightMenu.closeEvent = () => {
|
|
@@ -960,7 +976,7 @@ export class MenusSetting {
|
|
|
960
976
|
title: '新增選單',
|
|
961
977
|
view: gvc.bindView({
|
|
962
978
|
bind: ids.main,
|
|
963
|
-
view: () => html
|
|
979
|
+
view: () => html` <div class="d-flex flex-column p-3">${view}</div>`,
|
|
964
980
|
}),
|
|
965
981
|
right: true,
|
|
966
982
|
});
|