ts-glitter 13.4.7 → 13.4.8

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.
@@ -19,7 +19,8 @@ import { BgProduct } from './bg-product.js';
19
19
  import { CheckInput } from '../modules/checkInput.js';
20
20
  const html = String.raw;
21
21
  export class BgBlog {
22
- static contentManager(gvc, type = 'list', callback = () => { }, is_page, widget, page_tab) {
22
+ static contentManager(gvc, type = 'list', callback = () => {
23
+ }, is_page, widget, page_tab) {
23
24
  const html = String.raw;
24
25
  const glitter = gvc.glitter;
25
26
  const vm = {
@@ -43,15 +44,16 @@ export class BgBlog {
43
44
  },
44
45
  {
45
46
  key: '發布時間',
46
- value: html `<span class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
47
+ value: html `<span
48
+ class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
47
49
  },
48
50
  {
49
51
  key: '預覽',
50
52
  value: html `
51
53
  <div
52
- class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
53
- style="height:28px;width:28px;border-radius:5px;cursor:pointer;color:#151515;"
54
- onclick="${gvc.event((e, event) => {
54
+ class="d-flex align-items-center justify-content-center hoverBtn me-2 border"
55
+ style="height:28px;width:28px;border-radius:5px;cursor:pointer;color:#151515;"
56
+ onclick="${gvc.event((e, event) => {
55
57
  const href = (() => {
56
58
  return `https://${window.parent.glitter.share.editorViewModel.domain}/${is_page
57
59
  ? (() => {
@@ -77,159 +79,175 @@ export class BgBlog {
77
79
  ];
78
80
  });
79
81
  }
82
+ if (window.parent.glitter.getUrlParameter('page-id')) {
83
+ Article.get({
84
+ page: 0,
85
+ limit: 1,
86
+ id: window.parent.glitter.getUrlParameter('page-id')
87
+ }).then((data) => __awaiter(this, void 0, void 0, function* () {
88
+ vm.data = data.response.data[0];
89
+ vm.type = 'replace';
90
+ }));
91
+ }
80
92
  return gvc.bindView(() => {
81
93
  const id = glitter.getUUID();
82
94
  return {
83
95
  bind: id,
84
96
  dataList: [{ obj: vm, key: 'type' }],
85
97
  view: () => {
86
- if (vm.type === 'list') {
87
- return BgWidget.container(html `
88
- <div class="d-flex w-100 align-items-center mb-3 ${type === 'select' ? `d-none` : ``}">
89
- <div class="d-flex flex-column" style="gap:5px;">
90
- ${BgWidget.title(is_page
91
- ? (() => {
92
- switch (page_tab) {
93
- case 'hidden':
94
- return '隱形賣場';
95
- case 'page':
96
- return '自訂頁面';
97
- case 'shopping':
98
- return '一頁商店';
99
- }
100
- })()
101
- : '網誌文章')}
102
- ${BgWidget.grayNote(is_page
103
- ? (() => {
104
- switch (page_tab) {
105
- case 'hidden':
106
- return '隱形賣場僅能透過連結分享,無法顯示於 Google 搜尋列表';
107
- case 'page':
108
- return '打造自訂頁面,顯示品牌官網的獨特內容';
109
- case 'shopping':
110
- return '放大特定商品重點,打造專屬爆品產品,一頁下單快速購物';
111
- }
112
- })()
113
- : '快速分享商店最新資訊的好功能')}
114
- </div>
115
- <div class="flex-fill"></div>
116
- <div style="display: flex; gap: 12px;">
117
- ${is_page
118
- ? ''
119
- : BgWidget.grayButton('網誌分類', gvc.event(() => {
120
- vm.type = 'collection';
121
- gvc.notifyDataChange(id);
98
+ if (window.parent.glitter.getUrlParameter('page-id') && vm.type !== 'replace') {
99
+ return ``;
100
+ }
101
+ else {
102
+ if (vm.type === 'list') {
103
+ return BgWidget.container(html `
104
+ <div class="d-flex w-100 align-items-center mb-3 ${type === 'select' ? `d-none` : ``}">
105
+ <div class="d-flex flex-column" style="gap:5px;">
106
+ ${BgWidget.title(is_page
107
+ ? (() => {
108
+ switch (page_tab) {
109
+ case 'hidden':
110
+ return '隱形賣場';
111
+ case 'page':
112
+ return '自訂頁面';
113
+ case 'shopping':
114
+ return '一頁商店';
115
+ }
116
+ })()
117
+ : '網誌文章')}
118
+ ${BgWidget.grayNote(is_page
119
+ ? (() => {
120
+ switch (page_tab) {
121
+ case 'hidden':
122
+ return '隱形賣場僅能透過連結分享,無法顯示於 Google 搜尋列表';
123
+ case 'page':
124
+ return '打造自訂頁面,顯示品牌官網的獨特內容';
125
+ case 'shopping':
126
+ return '放大特定商品重點,打造專屬爆品產品,一頁下單快速購物';
127
+ }
128
+ })()
129
+ : '快速分享商店最新資訊的好功能')}
130
+ </div>
131
+ <div class="flex-fill"></div>
132
+ <div style="display: flex; gap: 12px;">
133
+ ${is_page
134
+ ? ''
135
+ : BgWidget.grayButton('網誌分類', gvc.event(() => {
136
+ vm.type = 'collection';
137
+ gvc.notifyDataChange(id);
138
+ }))}
139
+ ${BgWidget.darkButton(`新增${is_page ? `頁面` : `網誌`}`, gvc.event(() => {
140
+ vm.data = { content: {} };
141
+ vm.type = 'add';
122
142
  }))}
123
- ${BgWidget.darkButton(`新增${is_page ? `頁面` : `網誌`}`, gvc.event(() => {
124
- vm.data = { content: {} };
125
- vm.type = 'add';
126
- }))}
143
+ </div>
127
144
  </div>
128
- </div>
129
- ${BgWidget.mainCard([
130
- BgWidget.searchPlace(gvc.event((e) => {
131
- vm.query = e.value;
132
- gvc.notifyDataChange(id);
133
- }), vm.query || '', '搜尋所有文章'),
134
- BgWidget.tableV3({
145
+ ${BgWidget.mainCard([
146
+ BgWidget.searchPlace(gvc.event((e) => {
147
+ vm.query = e.value;
148
+ gvc.notifyDataChange(id);
149
+ }), vm.query || '', '搜尋所有文章'),
150
+ BgWidget.tableV3({
151
+ gvc: gvc,
152
+ getData: (vd) => {
153
+ vmi = vd;
154
+ const limit = 20;
155
+ Article.get({
156
+ page: vmi.page - 1,
157
+ limit: limit,
158
+ search: vm.query || undefined,
159
+ for_index: is_page ? `false` : `true`,
160
+ status: '0,1',
161
+ page_type: page_tab,
162
+ }).then((data) => {
163
+ vm.dataList = data.response.data;
164
+ vmi.pageSize = Math.ceil(data.response.total / limit);
165
+ vmi.originalData = vm.dataList;
166
+ vmi.tableData = getDatalist();
167
+ vmi.loading = false;
168
+ vmi.callback();
169
+ });
170
+ },
171
+ rowClick: (data, index) => {
172
+ if (type === 'select') {
173
+ vm.dataList[index].checked = !vm.dataList[index].checked;
174
+ vmi.data = getDatalist();
175
+ vmi.callback();
176
+ callback(vm.dataList.filter((dd) => {
177
+ return dd.checked;
178
+ }));
179
+ }
180
+ else {
181
+ vm.data = vm.dataList[index];
182
+ vm.type = 'replace';
183
+ }
184
+ },
185
+ filter: [
186
+ {
187
+ name: '批量移除',
188
+ event: (checkedData) => {
189
+ const dialog = new ShareDialog(glitter);
190
+ dialog.checkYesOrNot({
191
+ text: '是否確認刪除所選項目?',
192
+ callback: (response) => {
193
+ if (response) {
194
+ dialog.dataLoading({ visible: true });
195
+ Article.deleteV2({
196
+ id: checkedData
197
+ .map((dd) => {
198
+ return dd.id;
199
+ })
200
+ .join(`,`),
201
+ }).then((res) => {
202
+ dialog.dataLoading({ visible: false });
203
+ if (res.result) {
204
+ vm.dataList = undefined;
205
+ gvc.notifyDataChange(id);
206
+ }
207
+ else {
208
+ dialog.errorMessage({ text: '刪除失敗' });
209
+ }
210
+ });
211
+ }
212
+ },
213
+ });
214
+ },
215
+ },
216
+ ],
217
+ }),
218
+ ].join(''))}
219
+ `, BgWidget.getContainerWidth());
220
+ }
221
+ else if (vm.type == 'replace') {
222
+ window.parent.glitter.setUrlParameter('page-id', vm.data.id);
223
+ return editor({
135
224
  gvc: gvc,
136
- getData: (vd) => {
137
- vmi = vd;
138
- const limit = 20;
139
- Article.get({
140
- page: vmi.page - 1,
141
- limit: limit,
142
- search: vm.query || undefined,
143
- for_index: is_page ? `false` : `true`,
144
- status: '0,1',
145
- page_type: page_tab,
146
- }).then((data) => {
147
- vm.dataList = data.response.data;
148
- vmi.pageSize = Math.ceil(data.response.total / limit);
149
- vmi.originalData = vm.dataList;
150
- vmi.tableData = getDatalist();
151
- vmi.loading = false;
152
- vmi.callback();
153
- });
154
- },
155
- rowClick: (data, index) => {
156
- if (type === 'select') {
157
- vm.dataList[index].checked = !vm.dataList[index].checked;
158
- vmi.data = getDatalist();
159
- vmi.callback();
160
- callback(vm.dataList.filter((dd) => {
161
- return dd.checked;
162
- }));
163
- }
164
- else {
165
- vm.data = vm.dataList[index];
166
- vm.type = 'replace';
167
- }
225
+ vm: vm,
226
+ is_page: is_page,
227
+ widget: widget,
228
+ page_tab: page_tab,
229
+ });
230
+ }
231
+ else if (vm.type == 'collection') {
232
+ return BgWidget.container(setCollection({
233
+ gvc: gvc,
234
+ widget: widget,
235
+ key: 'blog_collection',
236
+ goBack: () => {
237
+ vm.type = 'list';
238
+ gvc.notifyDataChange(id);
168
239
  },
169
- filter: [
170
- {
171
- name: '批量移除',
172
- event: (checkedData) => {
173
- const dialog = new ShareDialog(glitter);
174
- dialog.checkYesOrNot({
175
- text: '是否確認刪除所選項目?',
176
- callback: (response) => {
177
- if (response) {
178
- dialog.dataLoading({ visible: true });
179
- Article.deleteV2({
180
- id: checkedData
181
- .map((dd) => {
182
- return dd.id;
183
- })
184
- .join(`,`),
185
- }).then((res) => {
186
- dialog.dataLoading({ visible: false });
187
- if (res.result) {
188
- vm.dataList = undefined;
189
- gvc.notifyDataChange(id);
190
- }
191
- else {
192
- dialog.errorMessage({ text: '刪除失敗' });
193
- }
194
- });
195
- }
196
- },
197
- });
198
- },
199
- },
200
- ],
201
- }),
202
- ].join(''))}
203
- `, BgWidget.getContainerWidth());
204
- }
205
- else if (vm.type == 'replace') {
206
- return editor({
207
- gvc: gvc,
208
- vm: vm,
209
- is_page: is_page,
210
- widget: widget,
211
- page_tab: page_tab,
212
- });
213
- }
214
- else if (vm.type == 'collection') {
215
- return BgWidget.container(setCollection({
216
- gvc: gvc,
217
- widget: widget,
218
- key: 'blog_collection',
219
- goBack: () => {
220
- vm.type = 'list';
221
- gvc.notifyDataChange(id);
222
- },
223
- }), BgWidget.getContainerWidth());
224
- }
225
- else {
226
- return editor({
227
- gvc: gvc,
228
- vm: vm,
229
- is_page: is_page,
230
- widget: widget,
231
- page_tab: page_tab,
232
- });
240
+ }), BgWidget.getContainerWidth());
241
+ }
242
+ else {
243
+ return editor({
244
+ gvc: gvc,
245
+ vm: vm,
246
+ is_page: is_page,
247
+ widget: widget,
248
+ page_tab: page_tab,
249
+ });
250
+ }
233
251
  }
234
252
  },
235
253
  };
@@ -248,14 +266,16 @@ export class BgBlog {
248
266
  }
249
267
  `);
250
268
  const containerID = gvc.glitter.getUUID();
251
- return html `<div class="d-flex align-items-center">
269
+ return html `
270
+ <div class="d-flex align-items-center">
252
271
  ${BgWidget.goBack(gvc.event(() => {
253
272
  callback(undefined);
254
273
  }))}
255
274
  <div>${[BgWidget.title('選擇模板'), BgWidget.grayNote('請選擇一個符合您需求的模板')].join('')}</div>
256
275
  </div>
257
276
  ${[
258
- html `<div class="my-3"></div>`,
277
+ html `
278
+ <div class="my-3"></div>`,
259
279
  BgWidget.card(gvc.bindView(() => {
260
280
  return {
261
281
  bind: containerID,
@@ -380,26 +400,28 @@ export class BgBlog {
380
400
  if (data.response.result.data.length === 0) {
381
401
  if (!vm.search) {
382
402
  return html `
383
- <div class="d-flex align-items-center justify-content-center flex-column w-100 py-4" style="width:700px;gap:10px;">
384
- <img src="./img/box-open-solid.svg" />
385
- <span class="color39 text-center">尚未自製任何模塊<br />請前往開發者模式自製專屬模塊</span>
386
- </div>
387
- `;
403
+ <div class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
404
+ style="width:700px;gap:10px;">
405
+ <img src="./img/box-open-solid.svg"/>
406
+ <span class="color39 text-center">尚未自製任何模塊<br/>請前往開發者模式自製專屬模塊</span>
407
+ </div>
408
+ `;
388
409
  }
389
410
  else {
390
411
  return html `
391
- <div class="d-flex align-items-center justify-content-center flex-column w-100 py-4" style="width:700px;gap:10px;">
392
- <img src="./img/box-open-solid.svg" />
393
- <span class="color39 text-center">查無相關模塊</span>
394
- </div>
395
- `;
412
+ <div class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
413
+ style="width:700px;gap:10px;">
414
+ <img src="./img/box-open-solid.svg"/>
415
+ <span class="color39 text-center">查無相關模塊</span>
416
+ </div>
417
+ `;
396
418
  }
397
419
  }
398
420
  else {
399
421
  return html `
400
- <div class="w-100" style="overflow-y: auto;">
401
- <div class="row m-0 pt-2 w-100">
402
- ${data.response.result.data
422
+ <div class="w-100" style="overflow-y: auto;">
423
+ <div class="row m-0 pt-2 w-100">
424
+ ${data.response.result.data
403
425
  .sort((a, b) => {
404
426
  if (a.tag === 'empty' || b.tag === 'empty') {
405
427
  return b.tag === 'empty' ? 1 : -1;
@@ -410,30 +432,32 @@ export class BgBlog {
410
432
  })
411
433
  .map((dd, index) => {
412
434
  var _a;
413
- return html `<div class="col-6 col-sm-3 mb-3 rounded-3">
414
- <div class="d-flex flex-column justify-content-center w-100 " style="gap:5px;cursor:pointer;">
415
- <div
416
- class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
417
- style="padding-bottom: ${(800 / 600) * 100}%;"
418
- >
419
- <div
420
- class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
421
- style="overflow: hidden;"
422
- >
423
- <img
424
- class="w-100 "
425
- src="${(_a = dd.template_config.image[0]) !== null && _a !== void 0 ? _a : 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
426
- />
427
- </div>
435
+ return html `
436
+ <div class="col-6 col-sm-3 mb-3 rounded-3">
437
+ <div class="d-flex flex-column justify-content-center w-100 "
438
+ style="gap:5px;cursor:pointer;">
439
+ <div
440
+ class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
441
+ style="padding-bottom: ${(800 / 600) * 100}%;"
442
+ >
443
+ <div
444
+ class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
445
+ style="overflow: hidden;"
446
+ >
447
+ <img
448
+ class="w-100 "
449
+ src="${(_a = dd.template_config.image[0]) !== null && _a !== void 0 ? _a : 'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
450
+ />
451
+ </div>
428
452
 
429
- <div
430
- class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
431
- style="background: rgba(0,0,0,0.5);gap:5px;"
432
- >
433
- <button
434
- class="btn btn-secondary d-flex align-items-center "
435
- style="height: 28px;width: 75px;gap:5px;"
436
- onclick="${gvc.event(() => {
453
+ <div
454
+ class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
455
+ style="background: rgba(0,0,0,0.5);gap:5px;"
456
+ >
457
+ <button
458
+ class="btn btn-secondary d-flex align-items-center "
459
+ style="height: 28px;width: 75px;gap:5px;"
460
+ onclick="${gvc.event(() => {
437
461
  if (dd.tag === 'empty') {
438
462
  const a = [];
439
463
  a.name = '空白頁面';
@@ -455,36 +479,38 @@ export class BgBlog {
455
479
  }
456
480
  }
457
481
  })}"
458
- >
459
- 選擇
460
- </button>
461
- </div>
462
- </div>
463
- <h3 class="fs-6 mb-0 d-flex justify-content-between align-items-center fw-500 mt-1">
464
- ${dd.template_config.name}
465
- <i
466
- class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ``}"
467
- style="cursor:pointer;"
468
- onclick="${gvc.event(() => {
482
+ >
483
+ 選擇
484
+ </button>
485
+ </div>
486
+ </div>
487
+ <h3 class="fs-6 mb-0 d-flex justify-content-between align-items-center fw-500 mt-1">
488
+ ${dd.template_config.name}
489
+ <i
490
+ class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ``}"
491
+ style="cursor:pointer;"
492
+ onclick="${gvc.event(() => {
469
493
  window.parent.glitter.openNewTab(`${gvc.glitter.root_path}pages/${dd.tag}?appName=${dd.appName}`);
470
494
  })}"
471
- ></i>
472
- </h3>
473
- </div>
474
- </div>`;
495
+ ></i>
496
+ </h3>
497
+ </div>
498
+ </div>`;
475
499
  })
476
500
  .join('')}
501
+ </div>
477
502
  </div>
478
- </div>
479
- `;
503
+ `;
480
504
  }
481
505
  })();
482
506
  }
483
507
  else {
484
- return html ` <div class="w-100 p-3 d-flex align-items-center justify-content-center flex-column" style="gap: 10px;">
485
- <div class="spinner-border fs-5"></div>
486
- <div class="fs-6 fw-500">載入中...</div>
487
- </div>`;
508
+ return html `
509
+ <div class="w-100 p-3 d-flex align-items-center justify-content-center flex-column"
510
+ style="gap: 10px;">
511
+ <div class="spinner-border fs-5"></div>
512
+ <div class="fs-6 fw-500">載入中...</div>
513
+ </div>`;
488
514
  }
489
515
  },
490
516
  divCreate: {
@@ -564,9 +590,24 @@ function detail(gvc, cf, vm, cVm, page_tab) {
564
590
  }, 100);
565
591
  return ``;
566
592
  }
593
+ const domainPrefix = `${cf.is_page
594
+ ? (() => {
595
+ switch (page_tab) {
596
+ case 'shopping':
597
+ return 'shop';
598
+ case 'hidden':
599
+ return 'hidden';
600
+ case 'page':
601
+ return 'pages';
602
+ default:
603
+ return '';
604
+ }
605
+ })()
606
+ : 'blogs'}`;
567
607
  return html `
568
608
  <div class="d-flex w-100 align-items-center mb-3 ">
569
609
  ${BgWidget.goBack(gvc.event(() => {
610
+ window.parent.glitter.setUrlParameter('page-id', undefined);
570
611
  vm.type = 'list';
571
612
  }))}
572
613
  ${BgWidget.title(cf.is_page
@@ -589,62 +630,17 @@ function detail(gvc, cf, vm, cVm, page_tab) {
589
630
  }))}
590
631
  <div class="mx-1"></div>
591
632
  ${BgWidget.grayButton('前往設計', gvc.event(() => {
592
- localStorage.setItem('preview_data', JSON.stringify(vm.data.content));
593
- window.parent.glitter.innerDialog((gvc) => {
594
- return gvc.bindView(() => {
595
- const id = gvc.glitter.getUUID();
596
- return {
597
- bind: id,
598
- view: () => {
599
- return html ` <iframe
600
- class="rounded-3"
601
- id="editor_dialog"
602
- src="${(() => {
603
- const url = new URL(window.parent.location.href);
604
- url.searchParams.set('function', 'user-editor');
605
- return url.href;
606
- })()}"
607
- ></iframe>`;
608
- },
609
- divCreate: {
610
- class: `vw-100 vh-100 p-2`,
611
- style: `background: rgba(0,0,0,0.5);`,
612
- },
613
- onCreate: () => {
614
- const interval = setInterval(() => {
615
- const iframe = window.parent.document.querySelector('#editor_dialog');
616
- if (iframe.contentWindow.glitter) {
617
- iframe.contentWindow.glitter.share.editor_vm = {
618
- close: () => {
619
- gvc.closeDialog();
620
- },
621
- callback: (cf) => {
622
- vm.data.content.config = cf.config;
623
- saveData(gvc, cf, vm, cVm, true);
624
- },
625
- page_data: {
626
- config: JSON.parse(JSON.stringify(vm.data.content.config || [])),
627
- page_config: {},
628
- name: vm.data.content.name || '尚未設定頁面標題',
629
- },
630
- title: vm.data.content.name || '尚未設定頁面標題',
631
- };
632
- clearInterval(interval);
633
- }
634
- }, 100);
635
- },
636
- };
637
- });
638
- }, '', {
639
- dismiss: () => { },
640
- });
633
+ window.parent.glitter.setUrlParameter('page-id', vm.data.id);
634
+ window.parent.glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
641
635
  }))}
642
636
  </div>
643
637
  </div>
644
638
  ${BgWidget.container(html `
645
- <div class="d-flex justify-content-center p-0 ${document.body.clientWidth < 768 ? 'flex-column' : ''}" style="gap: 24px">
646
- <div class="d-flex flex-column " style="gap:10px;${document.body.clientWidth > 768 ? 'width: 73.5%;' : ''}">
647
- ${BgWidget.container(gvc.bindView(() => {
639
+ <div class="d-flex justify-content-center p-0 ${document.body.clientWidth < 768 ? 'flex-column' : ''}"
640
+ style="gap: 24px">
641
+ <div class="d-flex flex-column "
642
+ style="gap:10px;${document.body.clientWidth > 768 ? 'width: 73.5%;' : ''}">
643
+ ${BgWidget.container(gvc.bindView(() => {
648
644
  var _a;
649
645
  vm.data.status = (_a = vm.data.status) !== null && _a !== void 0 ? _a : 1;
650
646
  const id = gvc.glitter.getUUID();
@@ -670,13 +666,14 @@ function detail(gvc, cf, vm, cVm, page_tab) {
670
666
  : 'blogs'}/`;
671
667
  return [
672
668
  BgWidget.title('基本設定', 'font-size: 16px;'),
673
- html ` <div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
674
- <div class="tx_normal">網頁啟用</div>
675
- ${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
669
+ html `
670
+ <div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
671
+ <div class="tx_normal">網頁啟用</div>
672
+ ${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
676
673
  vm.data.status = bool ? 1 : 0;
677
674
  gvc.notifyDataChange(id);
678
675
  })}
679
- </div>`,
676
+ </div>`,
680
677
  BgWidget.editeInput({
681
678
  gvc: gvc,
682
679
  title: '網頁名稱',
@@ -686,28 +683,32 @@ function detail(gvc, cf, vm, cVm, page_tab) {
686
683
  vm.data.content.name = text;
687
684
  },
688
685
  }),
689
- html ` <div>
690
- <div class="tx_normal fw-normal mb-2">自訂網址</div>
691
- <div
692
- style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
686
+ html `
687
+ <div>
688
+ <div class="tx_normal fw-normal mb-2">
689
+ 自訂網址
690
+ </div>
691
+ <div
692
+ style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
693
693
  .body.clientWidth > 768
694
694
  ? 'gap: 18px; '
695
695
  : 'flex-direction: column; gap: 0px; '}"
696
- class="w-100"
697
- >
698
- <div class="${document.body.clientWidth > 768 ? `` : `w-100`}" style="padding: 9px 18px;background: #EAEAEA ;${document.body.clientWidth > 768 ? `justify-content: center;` : `justify-content: start;`} align-items: center; gap: 5px; display: flex">
699
- <div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
700
- ${prefixURL}
701
- </div>
702
- </div>
703
- <input
704
- class="flex-fill"
705
- style="width:100%;border:none;background:none;text-align: start; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word; ${document
696
+ class="w-100"
697
+ >
698
+ <div class="${document.body.clientWidth > 768 ? `` : `w-100`}"
699
+ style="padding: 9px 18px;background: #EAEAEA ;${document.body.clientWidth > 768 ? `justify-content: center;` : `justify-content: start;`} align-items: center; gap: 5px; display: flex">
700
+ <div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
701
+ ${prefixURL}
702
+ </div>
703
+ </div>
704
+ <input
705
+ class="flex-fill"
706
+ style="width:100%;border:none;background:none;text-align: start; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word; ${document
706
707
  .body.clientWidth > 768
707
708
  ? ''
708
709
  : 'padding: 9px 18px;'}"
709
- value="${vm.data.content.tag || ''}"
710
- onchange="${gvc.event((e) => {
710
+ value="${vm.data.content.tag || ''}"
711
+ onchange="${gvc.event((e) => {
711
712
  let text = e.value;
712
713
  if (!CheckInput.isEnglishNumberHyphen(text)) {
713
714
  const dialog = new ShareDialog(gvc.glitter);
@@ -719,10 +720,13 @@ function detail(gvc, cf, vm, cVm, page_tab) {
719
720
  gvc.notifyDataChange(id);
720
721
  }
721
722
  })}"
722
- />
723
- </div>
724
- </div>`,
725
- html ` <div class="mt-2 mb-1"><span class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + ((_a = vm.data.content.tag) !== null && _a !== void 0 ? _a : ''))}</div>`,
723
+ />
724
+ </div>
725
+ </div>`,
726
+ html `
727
+ <div class="mt-2 mb-1"><span
728
+ class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + ((_a = vm.data.content.tag) !== null && _a !== void 0 ? _a : ''))}
729
+ </div>`,
726
730
  ...(() => {
727
731
  return [
728
732
  BgWidget.editeInput({
@@ -747,14 +751,19 @@ function detail(gvc, cf, vm, cVm, page_tab) {
747
751
  gvc.notifyDataChange(id);
748
752
  },
749
753
  }),
750
- html ` <div>
751
- <div class="tx_normal">社群分享縮圖</div>
752
- <div class="mt-1 mb-2">${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}</div>
753
- ${BgWidget.imageSelector(gvc, vm.data.content.seo.image || '', (text) => {
754
+ html `
755
+ <div>
756
+ <div class="tx_normal">
757
+ 社群分享縮圖
758
+ </div>
759
+ <div class="mt-1 mb-2">
760
+ ${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}
761
+ </div>
762
+ ${BgWidget.imageSelector(gvc, vm.data.content.seo.image || '', (text) => {
754
763
  vm.data.content.seo.image = text;
755
764
  gvc.notifyDataChange(id);
756
765
  })}
757
- </div>`,
766
+ </div>`,
758
767
  ,
759
768
  ];
760
769
  })(),
@@ -763,7 +772,10 @@ function detail(gvc, cf, vm, cVm, page_tab) {
763
772
  if (`${vm.data.content.for_index}` === 'true') {
764
773
  return [
765
774
  [
766
- html `<div class="tx_normal my-3">網誌內文</div>`,
775
+ html `
776
+ <div class="tx_normal my-3">
777
+ 網誌內文
778
+ </div>`,
767
779
  EditorElem.richText({
768
780
  gvc: gvc,
769
781
  def: (_a = vm.data.content.text) !== null && _a !== void 0 ? _a : '',
@@ -787,7 +799,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
787
799
  },
788
800
  };
789
801
  }), undefined, 'padding: 0 !important; margin: 0 !important; width: 100%;')}
790
- ${(() => {
802
+ ${(() => {
791
803
  vm.data.content.relative = vm.data.content.relative || 'collection';
792
804
  vm.data.content.relative_data = vm.data.content.relative_data || [];
793
805
  vm.data.content.with_discount = vm.data.content.with_discount || 'false';
@@ -800,8 +812,12 @@ function detail(gvc, cf, vm, cVm, page_tab) {
800
812
  return [
801
813
  BgWidget.mainCard([
802
814
  BgWidget.title(html `預設加入購物車
803
- <div class="badge ms-2" style="background:#eaeaea;color:#393939;">以下設定的商品會自動加入購物車</div>`, 'font-size: 16px;'),
804
- html `<div class="my-2"></div>`,
815
+ <div class="badge ms-2"
816
+ style="background:#eaeaea;color:#393939;">
817
+ 以下設定的商品會自動加入購物車
818
+ </div>`, 'font-size: 16px;'),
819
+ html `
820
+ <div class="my-2"></div>`,
805
821
  [
806
822
  html `${(() => {
807
823
  return gvc.bindView(() => {
@@ -817,12 +833,16 @@ function detail(gvc, cf, vm, cVm, page_tab) {
817
833
  return BgWidget.spinner();
818
834
  }
819
835
  return html `
820
- <div class="d-flex flex-column p-2" style="gap: 18px;">
821
- <div class="d-flex align-items-center gray-bottom-line-18 " style="gap: 24px; justify-content: space-between;">
822
- <div class="form-check-label c_updown_label">
823
- <div class="tx_normal">產品列表</div>
824
- </div>
825
- ${BgWidget.grayButton('搜尋商品', gvc.event(() => {
836
+ <div class="d-flex flex-column p-2"
837
+ style="gap: 18px;">
838
+ <div class="d-flex align-items-center gray-bottom-line-18 "
839
+ style="gap: 24px; justify-content: space-between;">
840
+ <div class="form-check-label c_updown_label">
841
+ <div class="tx_normal">
842
+ 產品列表
843
+ </div>
844
+ </div>
845
+ ${BgWidget.grayButton('搜尋商品', gvc.event(() => {
826
846
  BgProduct.variantsSelector({
827
847
  gvc: gvc,
828
848
  filter_variants: vm.data.content.relative_data.map((dd) => {
@@ -840,28 +860,37 @@ function detail(gvc, cf, vm, cVm, page_tab) {
840
860
  }),
841
861
  });
842
862
  }), { textStyle: 'font-weight: 400;' })}
843
- </div>
844
- ${subVM.dataList
863
+ </div>
864
+ ${subVM.dataList
845
865
  .map((opt, index) => {
846
866
  return html `
847
- <div class="d-flex align-items-center form-check-label c_updown_label gap-3">
848
- <span class="tx_normal" style="min-width: 20px;">${index + 1} .</span>
849
- ${BgWidget.validImageBox({ gvc: gvc, image: opt.image, width: 40 })}
850
- <div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
851
- ${opt.value} ${opt.note ? html ` <div class="tx_gray_12">${opt.note}</div> ` : ''}
852
- </div>
853
- <div class="flex-fill"></div>
854
- ${BgWidget.cancel(gvc.event(() => {
867
+ <div class="d-flex align-items-center form-check-label c_updown_label gap-3">
868
+ <span class="tx_normal"
869
+ style="min-width: 20px;">${index + 1} .</span>
870
+ ${BgWidget.validImageBox({
871
+ gvc: gvc,
872
+ image: opt.image,
873
+ width: 40
874
+ })}
875
+ <div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
876
+ ${opt.value}
877
+ ${opt.note ? html `
878
+ <div class="tx_gray_12">
879
+ ${opt.note}
880
+ </div> ` : ''}
881
+ </div>
882
+ <div class="flex-fill"></div>
883
+ ${BgWidget.cancel(gvc.event(() => {
855
884
  vm.data.content.relative_data.splice(index, 1);
856
885
  subVM.dataList.splice(index, 1);
857
886
  gvc.notifyDataChange(subVM.id);
858
887
  }), '移除')}
859
- </div>
860
- `;
888
+ </div>
889
+ `;
861
890
  })
862
891
  .join('') || `<div class="w-100 d-flex align-content-center justify-content-center">尚未加入任何賣場商品</div>`}
863
- </div>
864
- `;
892
+ </div>
893
+ `;
865
894
  },
866
895
  onCreate: () => {
867
896
  if (subVM.loading) {
@@ -915,8 +944,8 @@ function detail(gvc, cf, vm, cVm, page_tab) {
915
944
  };
916
945
  });
917
946
  })()}
918
- </div>
919
- ${BgWidget.container(BgWidget.mainCard(gvc.bindView(() => {
947
+ </div>
948
+ ${BgWidget.container(BgWidget.mainCard(gvc.bindView(() => {
920
949
  var _a;
921
950
  console.log(`vm.data.content.template=>`, vm.data.content.template);
922
951
  const id = gvc.glitter.getUUID();
@@ -977,9 +1006,11 @@ function detail(gvc, cf, vm, cVm, page_tab) {
977
1006
  }
978
1007
  vm.data.content.collection = (_a = vm.data.content.collection) !== null && _a !== void 0 ? _a : [];
979
1008
  return [
980
- html ` <div class="d-flex align-items-center my-3" style="gap: 10px;">
981
- ${EditorElem.h3('預覽圖')}
982
- ${BgWidget.grayButton('添加檔案', gvc.event(() => {
1009
+ html `
1010
+ <div class="d-flex align-items-center my-3"
1011
+ style="gap: 10px;">
1012
+ ${EditorElem.h3('預覽圖')}
1013
+ ${BgWidget.grayButton('添加檔案', gvc.event(() => {
983
1014
  EditorElem.uploadFileFunction({
984
1015
  gvc: gvc,
985
1016
  callback: (text) => {
@@ -989,7 +1020,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
989
1020
  type: `image/*, video/*`,
990
1021
  });
991
1022
  }))}
992
- </div>`,
1023
+ </div>`,
993
1024
  EditorElem.flexMediaManager({
994
1025
  gvc: gvc,
995
1026
  data: vm.data.content.preview_image ? [vm.data.content.preview_image] : [],
@@ -999,8 +1030,8 @@ function detail(gvc, cf, vm, cVm, page_tab) {
999
1030
  return ``;
1000
1031
  }
1001
1032
  return html `
1002
- ${EditorElem.h3('文章分類')}
1003
- ${gvc.bindView(() => {
1033
+ ${EditorElem.h3('文章分類')}
1034
+ ${gvc.bindView(() => {
1004
1035
  const tagID = gvc.glitter.getUUID();
1005
1036
  let listTag = [];
1006
1037
  ApiUser.getPublicConfig('blog_collection', 'manager').then((data) => {
@@ -1024,7 +1055,10 @@ function detail(gvc, cf, vm, cVm, page_tab) {
1024
1055
  view: () => {
1025
1056
  return listTag
1026
1057
  .map((dd) => {
1027
- return html ` <div class="badge bg_orange mt-2 me-2 fs-sm">${dd}</div>`;
1058
+ return html `
1059
+ <div class="badge bg_orange mt-2 me-2 fs-sm">
1060
+ ${dd}
1061
+ </div>`;
1028
1062
  })
1029
1063
  .join('');
1030
1064
  },
@@ -1033,17 +1067,18 @@ function detail(gvc, cf, vm, cVm, page_tab) {
1033
1067
  },
1034
1068
  };
1035
1069
  })}
1036
- <div
1037
- class="cursor_pointer bt_c39 ms-2 p-1 mt-3"
1038
- onclick="${gvc.event(() => {
1070
+ <div
1071
+ class="cursor_pointer bt_c39 ms-2 p-1 mt-3"
1072
+ onclick="${gvc.event(() => {
1039
1073
  cVm.type = 'collection';
1040
1074
  gvc.notifyDataChange(cVm.id);
1041
1075
  })}"
1042
- >
1043
- <i class="fa-solid fa-plus me-2" aria-hidden="true"></i>
1044
- 添加與編輯分類
1045
- </div>
1046
- `;
1076
+ >
1077
+ <i class="fa-solid fa-plus me-2"
1078
+ aria-hidden="true"></i>
1079
+ 添加與編輯分類
1080
+ </div>
1081
+ `;
1047
1082
  })(),
1048
1083
  ].join(`<div class="my-2"></div>`);
1049
1084
  },
@@ -1054,8 +1089,8 @@ function detail(gvc, cf, vm, cVm, page_tab) {
1054
1089
  },
1055
1090
  };
1056
1091
  })), undefined, 'padding: 0 !important; margin: 0 !important; width: 26.5%;')}
1057
- </div>
1058
- `, undefined, 'padding: 0 !important;')}
1092
+ </div>
1093
+ `, undefined, 'padding: 0 !important;')}
1059
1094
  ${BgWidget.mbContainer(240)}
1060
1095
  <div class="update-bar-container">
1061
1096
  ${vm.data.id
@@ -1329,35 +1364,36 @@ function setCollection(cf) {
1329
1364
  return {
1330
1365
  bind: vm.id,
1331
1366
  view: () => {
1332
- return html ` <div class="d-flex align-items-center my-3">
1367
+ return html `
1368
+ <div class="d-flex align-items-center my-3">
1333
1369
  ${BgWidget.goBack(cf.gvc.event(() => {
1334
1370
  cf.goBack();
1335
1371
  }))}${BgWidget.title('分類設定')}
1336
1372
  </div>
1337
1373
  <div
1338
- style="max-width:100%;width: 856px; 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"
1374
+ style="max-width:100%;width: 856px; 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"
1339
1375
  >
1340
1376
  <div style="width: 100%; position: relative">
1341
1377
  <div style="width: 100%; left: 0px; top: 0px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 20px; display: inline-flex">
1342
1378
  <div
1343
- class="w-100 ${getSelectCount({
1379
+ class="w-100 ${getSelectCount({
1344
1380
  items: vm.link,
1345
1381
  }) > 0
1346
1382
  ? ``
1347
1383
  : `d-none`}"
1348
- style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
1384
+ style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
1349
1385
  >
1350
1386
  <div style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
1351
- 已選取${getSelectCount({
1387
+ 已選取${getSelectCount({
1352
1388
  items: vm.link,
1353
1389
  })}項
1354
1390
  </div>
1355
1391
  <div
1356
- style="cursor:pointer;padding: 4px 14px;background: white; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.10); border-radius: 20px; border: 1px #DDDDDD solid; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
1392
+ style="cursor:pointer;padding: 4px 14px;background: white; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.10); border-radius: 20px; border: 1px #DDDDDD solid; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
1357
1393
  >
1358
1394
  <div
1359
- style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
1360
- onclick="${gvc.event(() => {
1395
+ style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
1396
+ onclick="${gvc.event(() => {
1361
1397
  vm.link = deleteSelect(vm.link);
1362
1398
  gvc.notifyDataChange(vm.id);
1363
1399
  })}"
@@ -1366,9 +1402,10 @@ function setCollection(cf) {
1366
1402
  </div>
1367
1403
  </div>
1368
1404
  </div>
1369
- <div class="d-flex align-items-center" style="width: 100%; height: 22px; position: relative;gap:29px;">
1405
+ <div class="d-flex align-items-center"
1406
+ style="width: 100%; height: 22px; position: relative;gap:29px;">
1370
1407
  <div
1371
- class="${allSelect({
1408
+ class="${allSelect({
1372
1409
  items: vm.link,
1373
1410
  selected: !vm.link.find((dd) => {
1374
1411
  return !dd.selected;
@@ -1376,8 +1413,8 @@ function setCollection(cf) {
1376
1413
  })
1377
1414
  ? `fa-solid fa-square-check`
1378
1415
  : `fa-regular fa-square`}"
1379
- style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
1380
- onclick="${cf.gvc.event((e, event) => {
1416
+ style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
1417
+ onclick="${cf.gvc.event((e, event) => {
1381
1418
  event.stopPropagation();
1382
1419
  if (vm.link.find((dd) => {
1383
1420
  return !dd.selected;
@@ -1394,7 +1431,9 @@ function setCollection(cf) {
1394
1431
  gvc.notifyDataChange(vm.id);
1395
1432
  })}"
1396
1433
  ></div>
1397
- <div style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">選單名稱</div>
1434
+ <div style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
1435
+ 選單名稱
1436
+ </div>
1398
1437
  </div>
1399
1438
  <div style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex">
1400
1439
  ${(() => {
@@ -1408,20 +1447,20 @@ function setCollection(cf) {
1408
1447
  .map((dd, index) => {
1409
1448
  dd.items;
1410
1449
  const list = html `
1411
- <div
1412
- class=" w-100 "
1413
- style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
1414
- onclick="${cf.gvc.event(() => {
1450
+ <div
1451
+ class=" w-100 "
1452
+ style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
1453
+ onclick="${cf.gvc.event(() => {
1415
1454
  if (dd.items && dd.items.length > 0) {
1416
1455
  dd.toggle = !dd.toggle;
1417
1456
  gvc.notifyDataChange(vm.id);
1418
1457
  }
1419
1458
  })}"
1420
- >
1421
- <div
1422
- class="${allSelect(dd) ? `fa-solid fa-square-check` : `fa-regular fa-square`}"
1423
- style="color:#393939;width: 16px; height: 16px;"
1424
- onclick="${cf.gvc.event((e, event) => {
1459
+ >
1460
+ <div
1461
+ class="${allSelect(dd) ? `fa-solid fa-square-check` : `fa-regular fa-square`}"
1462
+ style="color:#393939;width: 16px; height: 16px;"
1463
+ onclick="${cf.gvc.event((e, event) => {
1425
1464
  event.stopPropagation();
1426
1465
  dd.selected = !dd.selected;
1427
1466
  if (dd.selected) {
@@ -1432,38 +1471,39 @@ function setCollection(cf) {
1432
1471
  }
1433
1472
  gvc.notifyDataChange(vm.id);
1434
1473
  })}"
1435
- ></div>
1436
- <div class="hoverF2 pe-2" style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
1437
- <i
1438
- class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
1439
- style="cursor: pointer;width:25px;height: 25px;"
1440
- ></i>
1441
- <div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
1442
- <div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
1443
- <div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
1444
- ${dd.title}
1445
- </div>
1446
- ${dd.items && dd.items.length > 0
1474
+ ></div>
1475
+ <div class="hoverF2 pe-2"
1476
+ style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
1477
+ <i
1478
+ class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
1479
+ style="cursor: pointer;width:25px;height: 25px;"
1480
+ ></i>
1481
+ <div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
1482
+ <div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
1483
+ <div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
1484
+ ${dd.title}
1485
+ </div>
1486
+ ${dd.items && dd.items.length > 0
1447
1487
  ? !dd.toggle
1448
1488
  ? `<i class="fa-solid fa-angle-down color39"></i>`
1449
1489
  : `<i class="fa-solid fa-angle-up color39"></i>`
1450
1490
  : ``}
1451
- </div>
1452
- <div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
1453
- <div
1454
- style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
1455
- >
1456
- ${dd.title}
1457
- </div>
1458
- <div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
1459
- ${dd.link}
1491
+ </div>
1492
+ <div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
1493
+ <div
1494
+ style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
1495
+ >
1496
+ ${dd.title}
1497
+ </div>
1498
+ <div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
1499
+ ${dd.link}
1500
+ </div>
1501
+ </div>
1460
1502
  </div>
1461
- </div>
1462
- </div>
1463
- <div class="flex-fill"></div>
1464
- <div
1465
- class="child me-2"
1466
- onclick="${cf.gvc.event((e, event) => {
1503
+ <div class="flex-fill"></div>
1504
+ <div
1505
+ class="child me-2"
1506
+ onclick="${cf.gvc.event((e, event) => {
1467
1507
  event.stopPropagation();
1468
1508
  MenusSetting.collectionEvent({
1469
1509
  link: '',
@@ -1482,12 +1522,13 @@ function setCollection(cf) {
1482
1522
  }
1483
1523
  });
1484
1524
  })}"
1485
- >
1486
- <i class="fa-solid fa-plus" style="color:#393939;"></i>
1487
- </div>
1488
- <div
1489
- class="child"
1490
- onclick="${cf.gvc.event((e, event) => {
1525
+ >
1526
+ <i class="fa-solid fa-plus"
1527
+ style="color:#393939;"></i>
1528
+ </div>
1529
+ <div
1530
+ class="child"
1531
+ onclick="${cf.gvc.event((e, event) => {
1491
1532
  event.stopPropagation();
1492
1533
  const og = JSON.parse(JSON.stringify(dd));
1493
1534
  MenusSetting.collectionEvent(dd, (data) => {
@@ -1503,20 +1544,23 @@ function setCollection(cf) {
1503
1544
  }
1504
1545
  });
1505
1546
  })}"
1506
- >
1507
- <i class="fa-solid fa-pencil" style="color:#393939;"></i>
1547
+ >
1548
+ <i class="fa-solid fa-pencil"
1549
+ style="color:#393939;"></i>
1550
+ </div>
1551
+ </div>
1508
1552
  </div>
1509
- </div>
1510
- </div>
1511
- ${dd.items && dd.items.length > 0
1553
+ ${dd.items && dd.items.length > 0
1512
1554
  ? html `
1513
- <div class=" w-100 ${dd.toggle ? `` : `d-none`}" style="padding-left: 35px;">
1514
- ${renderItems(dd.items)}
1515
- </div>
1516
- `
1555
+ <div class=" w-100 ${dd.toggle ? `` : `d-none`}"
1556
+ style="padding-left: 35px;">
1557
+ ${renderItems(dd.items)}
1558
+ </div>
1559
+ `
1517
1560
  : ``}
1518
- `;
1519
- return html ` <li class="w-100 ">${list}</li>`;
1561
+ `;
1562
+ return html `
1563
+ <li class="w-100 ">${list}</li>`;
1520
1564
  })
1521
1565
  .join('');
1522
1566
  },
@@ -1530,7 +1574,9 @@ function setCollection(cf) {
1530
1574
  {
1531
1575
  src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
1532
1576
  },
1533
- ], () => { }, () => { });
1577
+ ], () => {
1578
+ }, () => {
1579
+ });
1534
1580
  const interval = setInterval(() => {
1535
1581
  if (window.Sortable) {
1536
1582
  try {
@@ -1550,7 +1596,8 @@ function setCollection(cf) {
1550
1596
  group: id,
1551
1597
  animation: 100,
1552
1598
  handle: '.dragItem',
1553
- onChange: function (evt) { },
1599
+ onChange: function (evt) {
1600
+ },
1554
1601
  onEnd: (evt) => {
1555
1602
  swapArr(array, startIndex, evt.newIndex);
1556
1603
  gvc.notifyDataChange(id);
@@ -1560,17 +1607,19 @@ function setCollection(cf) {
1560
1607
  },
1561
1608
  });
1562
1609
  }
1563
- catch (e) { }
1610
+ catch (e) {
1611
+ }
1564
1612
  clearInterval(interval);
1565
1613
  }
1566
1614
  }, 100);
1567
1615
  },
1568
1616
  };
1569
1617
  }) +
1570
- html ` <div
1571
- class=""
1572
- style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
1573
- onclick="${cf.gvc.event(() => {
1618
+ html `
1619
+ <div
1620
+ class=""
1621
+ style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
1622
+ onclick="${cf.gvc.event(() => {
1574
1623
  MenusSetting.collectionEvent({
1575
1624
  link: '',
1576
1625
  title: '',
@@ -1587,14 +1636,17 @@ function setCollection(cf) {
1587
1636
  }
1588
1637
  });
1589
1638
  })}"
1590
- >
1591
- <div
1592
- style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
1593
- >
1594
- <i class="fa-solid fa-plus" style="color: #3366BB;font-size: 16px; "></i>
1595
- <div style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">新增選單</div>
1596
- </div>
1597
- </div>`);
1639
+ >
1640
+ <div
1641
+ style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
1642
+ >
1643
+ <i class="fa-solid fa-plus"
1644
+ style="color: #3366BB;font-size: 16px; "></i>
1645
+ <div style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
1646
+ 新增選單
1647
+ </div>
1648
+ </div>
1649
+ </div>`);
1598
1650
  }
1599
1651
  return renderItems(vm.link);
1600
1652
  })()}
@@ -1602,7 +1654,8 @@ function setCollection(cf) {
1602
1654
  </div>
1603
1655
  </div>
1604
1656
  </div>
1605
- <div class="position-fixed bg-body bottom-0 w-100 d-flex align-items-center justify-content-end p-3 border-top" style="gap:10px;left:0px;">
1657
+ <div class="position-fixed bg-body bottom-0 w-100 d-flex align-items-center justify-content-end p-3 border-top"
1658
+ style="gap:10px;left:0px;">
1606
1659
  ${BgWidget.cancel(gvc.event(() => {
1607
1660
  cf.goBack();
1608
1661
  }))}