ts-glitter 21.7.1 → 21.7.3
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 +2 -2
- package/lowcode/Entry.ts +2 -2
- package/lowcode/api/pageConfig.js +15 -1
- package/lowcode/api/pageConfig.ts +15 -13
- package/lowcode/cms-plugin/line-auto-reply.js +1 -0
- package/lowcode/cms-plugin/line-auto-reply.ts +1 -0
- package/lowcode/cms-plugin/menus-setting.js +4 -4
- package/lowcode/cms-plugin/menus-setting.ts +4 -4
- package/lowcode/cms-plugin/shopping-market-shopee.js +2 -20
- package/lowcode/cms-plugin/shopping-market-shopee.ts +3 -19
- package/lowcode/cms-plugin/shopping-order-manager.ts +1 -0
- package/lowcode/editor-components/global-widget/bridge.js +95 -3
- package/lowcode/editor-components/global-widget/bridge.ts +124 -115
- package/lowcode/glitter-base/route/shopee.js +0 -2
- package/lowcode/glitter-base/route/shopee.ts +0 -2
- package/lowcode/glitterBundle/html-component/global-widget.js +37 -11
- package/lowcode/glitterBundle/html-component/global-widget.ts +75 -14
- package/lowcode/jspage/main.js +152 -68
- package/lowcode/jspage/main.ts +155 -80
- package/lowcode/modules/image-library.js +70 -86
- package/lowcode/modules/image-library.ts +98 -119
- package/lowcode/official_view_component/official/component.js +17 -15
- package/lowcode/official_view_component/official/component.ts +20 -15
- package/lowcode/official_view_component/official/form.js +186 -159
- package/lowcode/official_view_component/official/form.ts +1150 -1068
- package/lowcode/public-components/blogs/blogs-01.js +20 -4
- package/lowcode/public-components/blogs/blogs-01.ts +25 -4
- package/lowcode/public-components/checkout/index.js +6 -7
- package/lowcode/public-components/checkout/index.ts +9 -7
- package/lowcode/public-components/footer/footer-01.js +1 -1
- package/lowcode/public-components/footer/footer-01.ts +2 -1
- package/lowcode/public-components/footer/footer-02.js +1 -1
- package/lowcode/public-components/footer/footer-02.ts +1 -1
- package/lowcode/public-components/footer/footer-03.js +1 -1
- package/lowcode/public-components/footer/footer-03.ts +1 -1
- package/lowcode/public-components/modules/cart-module.js +3 -12
- package/lowcode/public-components/modules/cart-module.ts +4 -11
- package/package.json +1 -1
- package/src/api-public/controllers/shopee.js +10 -0
- package/src/api-public/controllers/shopee.js.map +1 -1
- package/src/api-public/controllers/shopee.ts +12 -12
- package/src/api-public/services/auto-send-email.js +16 -0
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/auto-send-email.ts +16 -0
- package/src/api-public/services/checkout-event.js +6 -0
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +9 -1
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/line-message.js +1 -0
- package/src/api-public/services/line-message.js.map +1 -1
- package/src/api-public/services/line-message.ts +2 -0
- package/src/api-public/services/shopee.d.ts +4 -3
- package/src/api-public/services/shopee.js +28 -24
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/shopee.ts +30 -24
- package/src/api-public/services/shopping.js +20 -12
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +34 -19
- package/src/index.js +3 -3
- package/src/modules/database.d.ts +1 -1
- package/src/public-config-initial/auto-fcm.js +4 -0
- package/src/public-config-initial/auto-fcm.js.map +1 -1
- package/src/public-config-initial/auto-fcm.ts +7 -1
- package/src/seo-config.js +0 -1
- package/src/seo-config.js.map +1 -1
- package/src/seo-config.ts +0 -1
- package/src/services/template.js +10 -0
- package/src/services/template.js.map +1 -1
- package/src/services/template.ts +9 -0
|
@@ -16,13 +16,7 @@ export type FileItem = {
|
|
|
16
16
|
id: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
type KeyType =
|
|
20
|
-
| 'file'
|
|
21
|
-
| 'folder'
|
|
22
|
-
| 'folderView'
|
|
23
|
-
| 'folderEdit'
|
|
24
|
-
| 'folderADD'
|
|
25
|
-
| 'folderViewToEdit';
|
|
19
|
+
type KeyType = 'file' | 'folder' | 'folderView' | 'folderEdit' | 'folderADD' | 'folderViewToEdit';
|
|
26
20
|
|
|
27
21
|
const html = String.raw;
|
|
28
22
|
const css = String.raw;
|
|
@@ -50,13 +44,13 @@ export class imageLibrary {
|
|
|
50
44
|
const gvc = cf.gvc;
|
|
51
45
|
const vm: {
|
|
52
46
|
id: string;
|
|
53
|
-
footer_id: string
|
|
47
|
+
footer_id: string;
|
|
54
48
|
link: FileItem[];
|
|
55
49
|
loading: boolean;
|
|
56
50
|
selected: boolean;
|
|
57
51
|
query: string;
|
|
58
52
|
orderString: string;
|
|
59
|
-
type: KeyType
|
|
53
|
+
type: KeyType;
|
|
60
54
|
tag?: string;
|
|
61
55
|
newFolder: FileItem;
|
|
62
56
|
} = {
|
|
@@ -80,12 +74,9 @@ export class imageLibrary {
|
|
|
80
74
|
};
|
|
81
75
|
const ids = {
|
|
82
76
|
classPrefix: 'image-library-dialog',
|
|
77
|
+
selectBarID: gvc.glitter.getUUID(),
|
|
83
78
|
};
|
|
84
79
|
|
|
85
|
-
gvc.addStyle(css`
|
|
86
|
-
.${ids.classPrefix} {
|
|
87
|
-
}
|
|
88
|
-
`);
|
|
89
80
|
|
|
90
81
|
if (cf.key == 'folderEdit') {
|
|
91
82
|
vm.tag = cf.tag;
|
|
@@ -119,7 +110,7 @@ export class imageLibrary {
|
|
|
119
110
|
if (dd.selected) {
|
|
120
111
|
count++;
|
|
121
112
|
}
|
|
122
|
-
return dd.
|
|
113
|
+
return dd.filter((d: any) => {
|
|
123
114
|
return d.selected;
|
|
124
115
|
}).length;
|
|
125
116
|
}
|
|
@@ -256,23 +247,7 @@ export class imageLibrary {
|
|
|
256
247
|
const imageUrl = originImageURL ?? noImageURL;
|
|
257
248
|
|
|
258
249
|
function itemClick() {
|
|
259
|
-
if (vm.type == '
|
|
260
|
-
//編輯資料夾內容
|
|
261
|
-
vm.type = 'folder';
|
|
262
|
-
that.selectImageLibrary(
|
|
263
|
-
gvc,
|
|
264
|
-
selectData => {
|
|
265
|
-
vm.link = selectData;
|
|
266
|
-
gvc.notifyDataChange(vm.id);
|
|
267
|
-
},
|
|
268
|
-
`<div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">${vm.tag}</div>`,
|
|
269
|
-
{
|
|
270
|
-
key: 'folderEdit',
|
|
271
|
-
mul: true,
|
|
272
|
-
tag: fileItem.title,
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
} else if (vm.type == 'folderView') {
|
|
250
|
+
if (vm.type == 'folderView') {
|
|
276
251
|
function updateLinkList(replaceId: string, newItem?: FileItem) {
|
|
277
252
|
const replaceItemIndex = vm.link.findIndex(i => i.id === replaceId);
|
|
278
253
|
console.log(replaceItemIndex);
|
|
@@ -327,7 +302,7 @@ export class imageLibrary {
|
|
|
327
302
|
array = [];
|
|
328
303
|
vm.type = 'folderView';
|
|
329
304
|
vm.tag = fileItem.title;
|
|
330
|
-
|
|
305
|
+
|
|
331
306
|
gvc.notifyDataChange(vm.id);
|
|
332
307
|
return;
|
|
333
308
|
}
|
|
@@ -524,10 +499,11 @@ export class imageLibrary {
|
|
|
524
499
|
bind: vm.id,
|
|
525
500
|
view: async () => {
|
|
526
501
|
const dialog = new ShareDialog(cf.gvc.glitter);
|
|
527
|
-
gvc.notifyDataChange(vm.footer_id)
|
|
502
|
+
gvc.notifyDataChange(vm.footer_id);
|
|
503
|
+
|
|
528
504
|
function drawBreadcrumb() {
|
|
529
505
|
return html`
|
|
530
|
-
<div class="d-flex" style="margin:
|
|
506
|
+
<div class="d-flex" style="margin-bottom:12px;">
|
|
531
507
|
<div class="breadcrumb-item">
|
|
532
508
|
<div
|
|
533
509
|
class="cursor_pointer"
|
|
@@ -583,6 +559,8 @@ export class imageLibrary {
|
|
|
583
559
|
? '700'
|
|
584
560
|
: '500'};cursor: pointer;"
|
|
585
561
|
onclick="${gvc.event(e => {
|
|
562
|
+
if (vm.type == data.key) return;
|
|
563
|
+
else vm.link.forEach(item => (item.selected = false));
|
|
586
564
|
vm.type = data.key as KeyType;
|
|
587
565
|
vm.query = '';
|
|
588
566
|
gvc.notifyDataChange(vm.id);
|
|
@@ -594,27 +572,45 @@ export class imageLibrary {
|
|
|
594
572
|
})
|
|
595
573
|
.join('');
|
|
596
574
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
575
|
+
|
|
576
|
+
function drawSelectBar(selectCount: number) {
|
|
577
|
+
return gvc.bindView({
|
|
578
|
+
bind: ids.selectBarID,
|
|
579
|
+
view: () => {
|
|
580
|
+
return html`
|
|
581
|
+
<div
|
|
582
|
+
class="${selectCount ? `` : `d-none`} ${gClass('select-bar-text')}"
|
|
583
|
+
>
|
|
584
|
+
已選取${selectCount}項
|
|
585
|
+
</div>
|
|
586
|
+
<div class="ms-auto ${gClass('search-raw')}">上傳時間舊>新</div>
|
|
587
|
+
`;
|
|
604
588
|
},
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
tag: vm.tag,
|
|
610
|
-
}
|
|
611
|
-
);
|
|
589
|
+
divCreate: {
|
|
590
|
+
class: `w-100 ${gClass('select-bar')} `,
|
|
591
|
+
},
|
|
592
|
+
});
|
|
612
593
|
}
|
|
594
|
+
|
|
595
|
+
// if (vm.type == 'folderViewToEdit') {
|
|
596
|
+
// vm.type = 'folderView';
|
|
597
|
+
// await that.selectImageLibrary(
|
|
598
|
+
// gvc,
|
|
599
|
+
// selectData => {
|
|
600
|
+
// vm.link = selectData;
|
|
601
|
+
// gvc.notifyDataChange(vm.id);
|
|
602
|
+
// },
|
|
603
|
+
// `<div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">${vm.tag}</div>`,
|
|
604
|
+
// {
|
|
605
|
+
// key: 'folderEdit',
|
|
606
|
+
// mul: true,
|
|
607
|
+
// tag: vm.tag,
|
|
608
|
+
// }
|
|
609
|
+
// );
|
|
610
|
+
// }
|
|
613
611
|
// 空白資料夾新增的頁面
|
|
614
612
|
if (vm.type == 'folderADD') {
|
|
615
613
|
function pushFolder(folder: FileItem, imageArray: FileItem[]) {
|
|
616
|
-
console.log('folder -- ', folder);
|
|
617
|
-
console.log('imageArray -- ', imageArray);
|
|
618
614
|
imageArray.forEach(image => {
|
|
619
615
|
image.selected = false;
|
|
620
616
|
});
|
|
@@ -693,6 +689,9 @@ export class imageLibrary {
|
|
|
693
689
|
if (vm.type == 'folderView') {
|
|
694
690
|
changeWindowsName(vm.tag ?? 'folder');
|
|
695
691
|
changeCancelBTNName('返回');
|
|
692
|
+
const group = vm.link.filter(item2 => {
|
|
693
|
+
return item2.tag && item2.tag.includes(vm.tag ?? '');
|
|
694
|
+
});
|
|
696
695
|
return html`
|
|
697
696
|
${drawBreadcrumb()}
|
|
698
697
|
<div class="d-flex w-100" style="gap:14px;margin-top: 12px;">
|
|
@@ -714,13 +713,11 @@ export class imageLibrary {
|
|
|
714
713
|
options: FilterOptions.imageLibraryOrderBy,
|
|
715
714
|
})}
|
|
716
715
|
</div>
|
|
716
|
+
${drawSelectBar(getSelectCount(group))}
|
|
717
717
|
${gvc.bindView({
|
|
718
718
|
bind: `folderItemGroup`,
|
|
719
719
|
view: () => {
|
|
720
720
|
if (vm.tag) {
|
|
721
|
-
let group = vm.link.filter(item2 => {
|
|
722
|
-
return item2.tag && item2.tag.includes(vm.tag ?? '');
|
|
723
|
-
});
|
|
724
721
|
return renderItems(group);
|
|
725
722
|
}
|
|
726
723
|
return ``;
|
|
@@ -732,7 +729,7 @@ export class imageLibrary {
|
|
|
732
729
|
//資料夾的內容編輯
|
|
733
730
|
if (vm.type == 'folderEdit') {
|
|
734
731
|
return html`
|
|
735
|
-
<div class="d-flex flex-column ${gClass('album-title')}"
|
|
732
|
+
<div class="d-flex flex-column ${gClass('album-title')}">
|
|
736
733
|
相簿名稱
|
|
737
734
|
<input
|
|
738
735
|
class="w-100"
|
|
@@ -764,30 +761,8 @@ export class imageLibrary {
|
|
|
764
761
|
})}
|
|
765
762
|
</div>
|
|
766
763
|
<div class="d-flex w-100 justify-content-end" style="gap:12px;margin-top: 18px;">
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
>
|
|
770
|
-
已選取${getSelectCount({
|
|
771
|
-
items: vm.link,
|
|
772
|
-
})}項
|
|
773
|
-
</div>
|
|
774
|
-
${BgWidget.grayButton(
|
|
775
|
-
'刪除',
|
|
776
|
-
gvc.event(() => {
|
|
777
|
-
let selectedData = vm.link.filter(item => (item as any).selected);
|
|
778
|
-
selectedData.forEach(item => {
|
|
779
|
-
(item as any).selected = false;
|
|
780
|
-
item.tag = item.tag.filter(tag => {
|
|
781
|
-
return tag !== vm.tag;
|
|
782
|
-
});
|
|
783
|
-
});
|
|
784
|
-
|
|
785
|
-
let folder = vm.link.find(dd => {
|
|
786
|
-
return dd.title == vm.tag && dd.type == 'folder';
|
|
787
|
-
});
|
|
788
|
-
gvc.notifyDataChange(vm.id);
|
|
789
|
-
})
|
|
790
|
-
)}
|
|
764
|
+
${drawSelectBar(getSelectCount(vm.link))}
|
|
765
|
+
|
|
791
766
|
${BgWidget.grayButton(
|
|
792
767
|
'新增圖片',
|
|
793
768
|
gvc.event(() => {
|
|
@@ -880,7 +855,7 @@ export class imageLibrary {
|
|
|
880
855
|
})
|
|
881
856
|
)}
|
|
882
857
|
</div>
|
|
883
|
-
<div
|
|
858
|
+
<div>
|
|
884
859
|
${gvc.bindView({
|
|
885
860
|
bind: `folderItemGroup`,
|
|
886
861
|
view: () => {
|
|
@@ -907,10 +882,9 @@ export class imageLibrary {
|
|
|
907
882
|
flex-direction: column;
|
|
908
883
|
height: auto; /* 設定一個固定的高度 (或用 auto 讓內容決定) */
|
|
909
884
|
flex-shrink: 0;
|
|
910
|
-
padding: 15px;
|
|
911
885
|
box-sizing: border-box; /* padding 不影響宣告的高度 */
|
|
912
886
|
width: 100%;
|
|
913
|
-
gap:
|
|
887
|
+
gap: 12px;
|
|
914
888
|
position: sticky;
|
|
915
889
|
background: #fff;
|
|
916
890
|
left: 0;
|
|
@@ -922,9 +896,7 @@ export class imageLibrary {
|
|
|
922
896
|
flex-grow: 1; /* 重要:讓此區塊佔滿所有剩餘的垂直空間 */
|
|
923
897
|
overflow-y: auto; /* 關鍵:當內容垂直溢出時,只在此區塊顯示垂直滾動條 */
|
|
924
898
|
width: 100%;
|
|
925
|
-
padding: 15px;
|
|
926
899
|
box-sizing: border-box;
|
|
927
|
-
gap: 20px;
|
|
928
900
|
}
|
|
929
901
|
|
|
930
902
|
.${ids.classPrefix}-content {
|
|
@@ -934,14 +906,20 @@ export class imageLibrary {
|
|
|
934
906
|
}
|
|
935
907
|
|
|
936
908
|
.${ids.classPrefix}-select-bar {
|
|
937
|
-
height: 40px;
|
|
938
|
-
padding: 12px 18px;
|
|
939
|
-
background: #f7f7f7;
|
|
940
909
|
border-radius: 10px;
|
|
941
910
|
justify-content: flex-end;
|
|
942
911
|
align-items: center;
|
|
943
912
|
gap: 8px;
|
|
944
913
|
display: ${cf.mul ? `inline-flex` : `none`};
|
|
914
|
+
margin-top: 18px;
|
|
915
|
+
margin-bottom: 8px;
|
|
916
|
+
}
|
|
917
|
+
.${ids.classPrefix}-select-bar-text{
|
|
918
|
+
flex: 1 1 0;
|
|
919
|
+
color: #393939;
|
|
920
|
+
font-size: 14px;
|
|
921
|
+
font-weight: 700;
|
|
922
|
+
word-wrap: break-word
|
|
945
923
|
}
|
|
946
924
|
|
|
947
925
|
.${ids.classPrefix}-new-album-title-bar {
|
|
@@ -949,7 +927,6 @@ export class imageLibrary {
|
|
|
949
927
|
font-style: normal;
|
|
950
928
|
font-weight: 400;
|
|
951
929
|
gap: 8px;
|
|
952
|
-
padding-top: 12px;
|
|
953
930
|
}
|
|
954
931
|
|
|
955
932
|
.${ids.classPrefix}-new-album-title-bar input {
|
|
@@ -985,7 +962,6 @@ export class imageLibrary {
|
|
|
985
962
|
font-style: normal;
|
|
986
963
|
font-weight: 400;
|
|
987
964
|
gap: 8px;
|
|
988
|
-
padding-top: 12px;
|
|
989
965
|
}
|
|
990
966
|
|
|
991
967
|
.${ids.classPrefix}-album-title input {
|
|
@@ -994,6 +970,13 @@ export class imageLibrary {
|
|
|
994
970
|
border-radius: 10px;
|
|
995
971
|
border: 1px solid #ddd;
|
|
996
972
|
}
|
|
973
|
+
|
|
974
|
+
.${ids.classPrefix}-search-raw {
|
|
975
|
+
color: #393939;
|
|
976
|
+
text-align: right;
|
|
977
|
+
font-size: 14px;
|
|
978
|
+
font-weight: 400;
|
|
979
|
+
}
|
|
997
980
|
`);
|
|
998
981
|
return html`
|
|
999
982
|
<div
|
|
@@ -1022,21 +1005,7 @@ export class imageLibrary {
|
|
|
1022
1005
|
</div>
|
|
1023
1006
|
</div>
|
|
1024
1007
|
<div class="scrollable-bottom-section d-flex flex-column">
|
|
1025
|
-
|
|
1026
|
-
class="w-100 ${gClass('select-bar')} ${getSelectCount({
|
|
1027
|
-
items: vm.link,
|
|
1028
|
-
}) > 0 && vm.type == 'file'
|
|
1029
|
-
? ``
|
|
1030
|
-
: `d-none`}"
|
|
1031
|
-
>
|
|
1032
|
-
<div
|
|
1033
|
-
style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word"
|
|
1034
|
-
>
|
|
1035
|
-
已選取${getSelectCount({
|
|
1036
|
-
items: vm.link,
|
|
1037
|
-
})}項
|
|
1038
|
-
</div>
|
|
1039
|
-
</div>
|
|
1008
|
+
${drawSelectBar(getSelectCount(vm.link))}
|
|
1040
1009
|
<div
|
|
1041
1010
|
style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex"
|
|
1042
1011
|
>
|
|
@@ -1159,7 +1128,7 @@ export class imageLibrary {
|
|
|
1159
1128
|
},
|
|
1160
1129
|
divCreate: {
|
|
1161
1130
|
class: `w-100 h-100`,
|
|
1162
|
-
style:
|
|
1131
|
+
style: `padding: 8px;`,
|
|
1163
1132
|
},
|
|
1164
1133
|
};
|
|
1165
1134
|
});
|
|
@@ -1177,10 +1146,9 @@ export class imageLibrary {
|
|
|
1177
1146
|
// | 'folderEdit'
|
|
1178
1147
|
// | 'folderADD'
|
|
1179
1148
|
// | 'folderViewToEdit';
|
|
1180
|
-
const footerType = vm.type
|
|
1149
|
+
const footerType = vm.type;
|
|
1181
1150
|
const dialog = new ShareDialog(cf.gvc.glitter);
|
|
1182
1151
|
|
|
1183
|
-
|
|
1184
1152
|
function clearNoNeedData(items: FileItem[]) {
|
|
1185
1153
|
items.map(dd => {
|
|
1186
1154
|
if ((dd as any).selected) {
|
|
@@ -1255,6 +1223,7 @@ export class imageLibrary {
|
|
|
1255
1223
|
},
|
|
1256
1224
|
];
|
|
1257
1225
|
}
|
|
1226
|
+
|
|
1258
1227
|
function getDefaultButtons(gvc: GVC, save: Function, dialog: ShareDialog): BtnDef[] {
|
|
1259
1228
|
const finishLabel = cf.key === 'album' ? '建立' : '完成';
|
|
1260
1229
|
const cancelLabel = cf.key === 'album' ? '返回' : '取消';
|
|
@@ -1269,7 +1238,11 @@ export class imageLibrary {
|
|
|
1269
1238
|
closeFolderView();
|
|
1270
1239
|
vm.type = 'folder';
|
|
1271
1240
|
gvc.notifyDataChange(vm.id);
|
|
1272
|
-
} else {
|
|
1241
|
+
} else if (vm.type === 'folderEdit') {
|
|
1242
|
+
closeFolderView();
|
|
1243
|
+
vm.type = 'folderView';
|
|
1244
|
+
gvc.notifyDataChange(vm.id);
|
|
1245
|
+
}else {
|
|
1273
1246
|
gvc.closeDialog();
|
|
1274
1247
|
}
|
|
1275
1248
|
},
|
|
@@ -1278,7 +1251,8 @@ export class imageLibrary {
|
|
|
1278
1251
|
type: 'edit',
|
|
1279
1252
|
label: '編輯',
|
|
1280
1253
|
onClick: () => {
|
|
1281
|
-
vm.type = '
|
|
1254
|
+
vm.type = 'folderEdit';
|
|
1255
|
+
cf.key = "album";
|
|
1282
1256
|
gvc.notifyDataChange(vm.id);
|
|
1283
1257
|
},
|
|
1284
1258
|
},
|
|
@@ -1338,15 +1312,19 @@ export class imageLibrary {
|
|
|
1338
1312
|
},
|
|
1339
1313
|
];
|
|
1340
1314
|
}
|
|
1315
|
+
|
|
1341
1316
|
const defs = vm.type === 'folderEdit' ? getFolderEditButtons(gvc, save) : getDefaultButtons(gvc, save, dialog);
|
|
1342
1317
|
return gvc.bindView({
|
|
1343
|
-
bind:vm.footer_id,
|
|
1344
|
-
view:()=>{
|
|
1345
|
-
|
|
1318
|
+
bind: vm.footer_id,
|
|
1319
|
+
view: () => {
|
|
1346
1320
|
return defs
|
|
1347
1321
|
.map(d => {
|
|
1348
1322
|
const widget =
|
|
1349
|
-
|
|
1323
|
+
d.type === 'cancel' || d.type === 'edit'
|
|
1324
|
+
? BgWidget.cancel
|
|
1325
|
+
: d.type === 'danger'
|
|
1326
|
+
? BgWidget.danger
|
|
1327
|
+
: BgWidget.save;
|
|
1350
1328
|
if (d.type == 'edit') {
|
|
1351
1329
|
if (vm.type == 'folderView') {
|
|
1352
1330
|
return widget(gvc.event(d.onClick), d.label);
|
|
@@ -1357,12 +1335,12 @@ export class imageLibrary {
|
|
|
1357
1335
|
}
|
|
1358
1336
|
})
|
|
1359
1337
|
.join('');
|
|
1360
|
-
},
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1338
|
+
},
|
|
1339
|
+
divCreate: {
|
|
1340
|
+
class: 'w-100 d-flex align-items-center justify-content-end',
|
|
1341
|
+
style: 'gap:14px',
|
|
1342
|
+
},
|
|
1343
|
+
});
|
|
1366
1344
|
},
|
|
1367
1345
|
closeCallback: () => {
|
|
1368
1346
|
if (cf.cancelEvent) {
|
|
@@ -1692,9 +1670,10 @@ export class imageLibrary {
|
|
|
1692
1670
|
const dialog = new ShareDialog(gvc.glitter);
|
|
1693
1671
|
|
|
1694
1672
|
function deleteImage() {
|
|
1673
|
+
const text = (item.type == 'folder')?`此操作不可復原。確定要刪除相簿${item.title}嗎?`:'刪除此圖片後,所有使用它的頁面與商品將無法顯示。<br>是否確定?' ;
|
|
1695
1674
|
dialog.checkYesOrNotWithCustomWidth({
|
|
1696
1675
|
width: '432',
|
|
1697
|
-
text:
|
|
1676
|
+
text: text,
|
|
1698
1677
|
icon: '<i class="fa-solid fa-info"></i>',
|
|
1699
1678
|
callback: response => {
|
|
1700
1679
|
if (response) {
|
|
@@ -901,7 +901,6 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
901
901
|
return {
|
|
902
902
|
bind: vm.id,
|
|
903
903
|
view: () => __awaiter(this, void 0, void 0, function* () {
|
|
904
|
-
var _a;
|
|
905
904
|
let refer_form = getReferForm(widget, type);
|
|
906
905
|
function refresh(widget, device) {
|
|
907
906
|
if (widget.data.refer_app) {
|
|
@@ -973,11 +972,22 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
973
972
|
subData.editor_updated_callback(oWidget);
|
|
974
973
|
}
|
|
975
974
|
glitter.share.refer_form = refer_form;
|
|
976
|
-
glitter.share.refer_form_ = (_a = glitter.share.refer_form_) !== null && _a !== void 0 ? _a : {};
|
|
977
|
-
glitter.share.refer_form_[oWidget.data.tag] = refer_form;
|
|
978
975
|
glitter.share.refresh_global = (() => {
|
|
979
976
|
refresh(widget, type);
|
|
980
977
|
});
|
|
978
|
+
function defineGettable(key) {
|
|
979
|
+
Object.defineProperty(refer_form, key, {
|
|
980
|
+
get: function () {
|
|
981
|
+
return oWidget.data.refer_form_data[key];
|
|
982
|
+
},
|
|
983
|
+
set(v) {
|
|
984
|
+
if (v !== undefined) {
|
|
985
|
+
oWidget.data.refer_form_data[key] = v;
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
configurable: true,
|
|
989
|
+
});
|
|
990
|
+
}
|
|
981
991
|
function getItemsVisibility(dd) {
|
|
982
992
|
const descriptor = Object.getOwnPropertyDescriptor(refer_form, dd.key);
|
|
983
993
|
const custom = !oWidget[`${type}_editable`] ||
|
|
@@ -990,17 +1000,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
990
1000
|
delete refer_form[dd.key];
|
|
991
1001
|
}
|
|
992
1002
|
if (!custom) {
|
|
993
|
-
|
|
994
|
-
get: function () {
|
|
995
|
-
return oWidget.data.refer_form_data[dd.key];
|
|
996
|
-
},
|
|
997
|
-
set(v) {
|
|
998
|
-
if (v !== undefined) {
|
|
999
|
-
oWidget.data.refer_form_data[dd.key] = v;
|
|
1000
|
-
}
|
|
1001
|
-
},
|
|
1002
|
-
configurable: true,
|
|
1003
|
-
});
|
|
1003
|
+
defineGettable(dd.key);
|
|
1004
1004
|
}
|
|
1005
1005
|
return !glitter.share.only_show_cuatomize || custom;
|
|
1006
1006
|
}
|
|
@@ -1096,6 +1096,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
1096
1096
|
})();
|
|
1097
1097
|
return true;
|
|
1098
1098
|
});
|
|
1099
|
+
defineGettable('menu_refer');
|
|
1099
1100
|
try {
|
|
1100
1101
|
let global_setting_view = [
|
|
1101
1102
|
`<div class="mx-3 guide-user-editor-6 "
|
|
@@ -1202,6 +1203,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter, editM
|
|
|
1202
1203
|
},
|
|
1203
1204
|
formData: refer_form,
|
|
1204
1205
|
widget: pageData.config,
|
|
1206
|
+
oWidget: oWidget
|
|
1205
1207
|
}),
|
|
1206
1208
|
].join('');
|
|
1207
1209
|
}
|
|
@@ -1311,7 +1313,7 @@ font-weight: 700;"
|
|
|
1311
1313
|
refresh(widget, type);
|
|
1312
1314
|
},
|
|
1313
1315
|
formData: refer_form,
|
|
1314
|
-
widget: pageData.config
|
|
1316
|
+
widget: pageData.config
|
|
1315
1317
|
})}</div>`);
|
|
1316
1318
|
break;
|
|
1317
1319
|
case 'fonts':
|
|
@@ -1078,11 +1078,24 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
1078
1078
|
subData.editor_updated_callback(oWidget);
|
|
1079
1079
|
}
|
|
1080
1080
|
glitter.share.refer_form=refer_form
|
|
1081
|
-
glitter.share.refer_form_=glitter.share.refer_form_ ?? {}
|
|
1082
|
-
glitter.share.refer_form_[oWidget.data.tag]=refer_form
|
|
1083
1081
|
glitter.share.refresh_global=(()=>{
|
|
1084
1082
|
refresh(widget,type)
|
|
1085
1083
|
})
|
|
1084
|
+
//定義Form的Getter 和 Setter
|
|
1085
|
+
function defineGettable(key:string){
|
|
1086
|
+
Object.defineProperty(refer_form, key, {
|
|
1087
|
+
get: function () {
|
|
1088
|
+
return oWidget.data.refer_form_data[key];
|
|
1089
|
+
},
|
|
1090
|
+
|
|
1091
|
+
set(v) {
|
|
1092
|
+
if (v !== undefined) {
|
|
1093
|
+
oWidget.data.refer_form_data[key] = v;
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
configurable: true,
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1086
1099
|
//設定顯示編輯與否
|
|
1087
1100
|
function getItemsVisibility(dd: any) {
|
|
1088
1101
|
const descriptor = Object.getOwnPropertyDescriptor(
|
|
@@ -1104,18 +1117,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
1104
1117
|
}
|
|
1105
1118
|
//判斷為勾選自訂義則參照主表單
|
|
1106
1119
|
if (!custom) {
|
|
1107
|
-
|
|
1108
|
-
get: function () {
|
|
1109
|
-
return oWidget.data.refer_form_data[dd.key];
|
|
1110
|
-
},
|
|
1111
|
-
|
|
1112
|
-
set(v) {
|
|
1113
|
-
if (v !== undefined) {
|
|
1114
|
-
oWidget.data.refer_form_data[dd.key] = v;
|
|
1115
|
-
}
|
|
1116
|
-
},
|
|
1117
|
-
configurable: true,
|
|
1118
|
-
});
|
|
1120
|
+
defineGettable(dd.key)
|
|
1119
1121
|
}
|
|
1120
1122
|
return !glitter.share.only_show_cuatomize || custom;
|
|
1121
1123
|
}
|
|
@@ -1216,6 +1218,8 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
1216
1218
|
})();
|
|
1217
1219
|
return true;
|
|
1218
1220
|
});
|
|
1221
|
+
|
|
1222
|
+
defineGettable('menu_refer')
|
|
1219
1223
|
try {
|
|
1220
1224
|
let global_setting_view = [
|
|
1221
1225
|
`<div class="mx-3 guide-user-editor-6 "
|
|
@@ -1377,6 +1381,7 @@ export const component = Plugin.createComponent(import.meta.url, (glitter: Glitt
|
|
|
1377
1381
|
},
|
|
1378
1382
|
formData: refer_form,
|
|
1379
1383
|
widget: pageData.config,
|
|
1384
|
+
oWidget:oWidget
|
|
1380
1385
|
})
|
|
1381
1386
|
,
|
|
1382
1387
|
].join('');
|
|
@@ -1508,7 +1513,7 @@ font-weight: 700;"
|
|
|
1508
1513
|
refresh(widget, type);
|
|
1509
1514
|
},
|
|
1510
1515
|
formData: refer_form,
|
|
1511
|
-
widget: pageData.config
|
|
1516
|
+
widget: pageData.config
|
|
1512
1517
|
}
|
|
1513
1518
|
)}</div>`
|
|
1514
1519
|
);
|