ts-glitter 13.4.8 → 13.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/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -2
- package/lowcode/backend-manager/bg-blog.js +691 -761
- package/lowcode/backend-manager/bg-blog.ts +956 -1041
- package/lowcode/backend-manager/bg-graph-api.js +3 -3
- package/lowcode/backend-manager/bg-graph-api.ts +3 -5
- package/lowcode/backend-manager/bg-guide.js +69 -24
- package/lowcode/backend-manager/bg-guide.ts +82 -27
- package/lowcode/backend-manager/bg-line.js +18 -18
- package/lowcode/backend-manager/bg-line.ts +18 -35
- package/lowcode/backend-manager/bg-notify.js +18 -18
- package/lowcode/backend-manager/bg-notify.ts +18 -34
- package/lowcode/backend-manager/bg-project.js +11 -11
- package/lowcode/backend-manager/bg-project.ts +11 -20
- package/lowcode/backend-manager/bg-recommend.js +656 -652
- package/lowcode/backend-manager/bg-recommend.ts +31 -40
- package/lowcode/backend-manager/bg-seo.js +25 -20
- package/lowcode/backend-manager/bg-seo.ts +121 -105
- package/lowcode/backend-manager/bg-shopping.js +14 -14
- package/lowcode/backend-manager/bg-shopping.ts +14 -25
- package/lowcode/backend-manager/bg-sns.js +18 -18
- package/lowcode/backend-manager/bg-sns.ts +18 -34
- package/lowcode/backend-manager/bg-wallet.js +5 -5
- package/lowcode/backend-manager/bg-wallet.ts +5 -7
- package/lowcode/backend-manager/bg-widget.js +25 -14
- package/lowcode/backend-manager/bg-widget.ts +43 -17
- package/lowcode/cms-plugin/ai-points-list.js +54 -57
- package/lowcode/cms-plugin/ai-points-list.ts +55 -63
- package/lowcode/cms-plugin/ai-points.js +2 -2
- package/lowcode/cms-plugin/ai-points.ts +2 -4
- package/lowcode/cms-plugin/app-release.js +45 -46
- package/lowcode/cms-plugin/app-release.ts +221 -209
- package/lowcode/cms-plugin/auto-reply.js +3 -3
- package/lowcode/cms-plugin/auto-reply.ts +3 -5
- package/lowcode/cms-plugin/form-setting.js +6 -6
- package/lowcode/cms-plugin/form-setting.ts +6 -10
- package/lowcode/cms-plugin/line-auto-reply.js +3 -3
- package/lowcode/cms-plugin/line-auto-reply.ts +3 -5
- package/lowcode/cms-plugin/member-group-list.js +2 -2
- package/lowcode/cms-plugin/member-group-list.ts +2 -3
- package/lowcode/cms-plugin/member-setting.js +75 -88
- package/lowcode/cms-plugin/member-setting.ts +143 -157
- package/lowcode/cms-plugin/member-type-list.js +243 -240
- package/lowcode/cms-plugin/member-type-list.ts +14 -19
- package/lowcode/cms-plugin/menus-setting.js +2 -2
- package/lowcode/cms-plugin/menus-setting.ts +2 -4
- package/lowcode/cms-plugin/permission-setting.js +17 -18
- package/lowcode/cms-plugin/permission-setting.ts +145 -147
- package/lowcode/cms-plugin/pos-checkout-setting.js +7 -10
- package/lowcode/cms-plugin/pos-checkout-setting.ts +174 -179
- package/lowcode/cms-plugin/shopping-collections.js +224 -218
- package/lowcode/cms-plugin/shopping-collections.ts +152 -153
- package/lowcode/cms-plugin/shopping-discount-setting.js +855 -852
- package/lowcode/cms-plugin/shopping-discount-setting.ts +14 -18
- package/lowcode/cms-plugin/shopping-finance-setting.js +259 -265
- package/lowcode/cms-plugin/shopping-finance-setting.ts +273 -284
- package/lowcode/cms-plugin/shopping-order-manager.js +520 -497
- package/lowcode/cms-plugin/shopping-order-manager.ts +347 -325
- package/lowcode/cms-plugin/shopping-order-return.js +10 -9
- package/lowcode/cms-plugin/shopping-order-return.ts +23 -27
- package/lowcode/cms-plugin/shopping-product-setting.js +1079 -1055
- package/lowcode/cms-plugin/shopping-product-setting.ts +348 -337
- package/lowcode/cms-plugin/shopping-product-stock.js +2 -2
- package/lowcode/cms-plugin/shopping-product-stock.ts +2 -3
- package/lowcode/cms-plugin/shopping-product-text.js +32 -36
- package/lowcode/cms-plugin/shopping-product-text.ts +78 -81
- package/lowcode/cms-plugin/shopping-rebate-setting.js +321 -316
- package/lowcode/cms-plugin/shopping-rebate-setting.ts +15 -17
- package/lowcode/cms-plugin/shopping-rebate.js +102 -59
- package/lowcode/cms-plugin/shopping-rebate.ts +110 -71
- package/lowcode/cms-plugin/shopping-shipment-setting.js +382 -426
- package/lowcode/cms-plugin/shopping-shipment-setting.ts +489 -531
- package/lowcode/cms-plugin/sms-points.js +2 -2
- package/lowcode/cms-plugin/sms-points.ts +2 -4
- package/lowcode/cms-plugin/sns-auto-reply.js +3 -3
- package/lowcode/cms-plugin/sns-auto-reply.ts +3 -5
- package/lowcode/cms-plugin/third-party-apple.js +22 -28
- package/lowcode/cms-plugin/third-party-apple.ts +189 -191
- package/lowcode/cms-plugin/third-party-facebook.js +31 -32
- package/lowcode/cms-plugin/third-party-facebook.ts +240 -234
- package/lowcode/cms-plugin/third-party-google.js +33 -29
- package/lowcode/cms-plugin/third-party-google.ts +216 -202
- package/lowcode/cms-plugin/third-party-line.js +19 -22
- package/lowcode/cms-plugin/third-party-line.ts +166 -162
- package/lowcode/cms-plugin/user-list.js +449 -441
- package/lowcode/cms-plugin/user-list.ts +63 -65
- package/lowcode/cms-plugin/user-login-setting.js +2 -2
- package/lowcode/cms-plugin/user-login-setting.ts +2 -5
- package/lowcode/cms-plugin/wallet-list.js +5 -5
- package/lowcode/cms-plugin/wallet-list.ts +5 -7
- package/lowcode/cms-plugin/web-config-setting.js +5 -5
- package/lowcode/cms-plugin/web-config-setting.ts +5 -8
- package/lowcode/cms-plugin/widget-manager.js +1 -1
- package/lowcode/cms-plugin/widget-manager.ts +1 -2
- package/lowcode/css/editor.css +12 -1
- package/lowcode/glitter-base/route/shopping.js +17 -0
- package/lowcode/glitter-base/route/shopping.ts +17 -0
- package/lowcode/glitter-base/route/user.js +2 -2
- package/lowcode/glitter-base/route/user.ts +26 -27
- package/lowcode/glitterBundle/Glitter.js +1 -1
- package/lowcode/glitterBundle/Glitter.ts +1 -1
- package/lowcode/jspage/editor.js +1 -1
- package/lowcode/jspage/editor.ts +1 -1
- package/lowcode/jspage/function-page/server-editor/router/api-manager.js +4 -4
- package/lowcode/jspage/function-page/server-editor/router/api-manager.ts +4 -6
- package/lowcode/jspage/function-page/server-editor/router/database.js +8 -8
- package/lowcode/jspage/function-page/server-editor/router/database.ts +53 -48
- package/lowcode/jspage/function-page/server-editor/router/domain-manager.js +2 -2
- package/lowcode/jspage/function-page/server-editor/router/domain-manager.ts +2 -3
- package/lowcode/jspage/function-page/server-editor/router/server-status.js +50 -38
- package/lowcode/jspage/function-page/server-editor/router/server-status.ts +93 -76
- package/lowcode/jspage/main.js +9 -5
- package/lowcode/jspage/main.ts +9 -7
- package/lowcode/view-model/saas-view-model.js +454 -285
- package/lowcode/view-model/saas-view-model.ts +917 -722
- package/package.json +1 -1
- package/src/api-public/controllers/ai-points.js.map +1 -1
- package/src/api-public/controllers/chat.js.map +1 -1
- package/src/api-public/controllers/delivery.js.map +1 -1
- package/src/api-public/controllers/fb-message.js.map +1 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/invoice.js.map +1 -1
- package/src/api-public/controllers/line-message.js.map +1 -1
- package/src/api-public/controllers/oauth.js.map +1 -1
- package/src/api-public/controllers/rebate.js.map +1 -1
- package/src/api-public/controllers/recommend.js.map +1 -1
- package/src/api-public/controllers/sms-points.js.map +1 -1
- package/src/api-public/controllers/wallet.js.map +1 -1
- package/src/api-public/services/EcInvoice.js.map +1 -1
- package/src/api-public/services/ai-pointes.js.map +1 -1
- package/src/api-public/services/article.js.map +1 -1
- package/src/api-public/services/auto-send-email.js.map +1 -1
- package/src/api-public/services/delivery.js.map +1 -1
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/ezpay/tool.js.map +1 -1
- package/src/api-public/services/fake-data-model/fake-product.js.map +1 -1
- package/src/api-public/services/fb-message.js.map +1 -5
- package/src/api-public/services/filter-protect-data.js.map +1 -1
- package/src/api-public/services/financial-service.js.map +1 -1
- package/src/api-public/services/graph-api.js.map +1 -1
- package/src/api-public/services/invoice.js.map +1 -1
- package/src/api-public/services/monitor.d.ts +0 -1
- package/src/api-public/services/monitor.js.map +1 -1
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/rebate.js.map +1 -1
- package/src/api-public/services/recommend.js.map +1 -1
- package/src/api-public/services/share-permission.js.map +1 -1
- package/src/api-public/services/shopping.d.ts +1 -1
- package/src/api-public/services/shopping.js +44 -36
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +184 -183
- package/src/api-public/services/sms-pointes.js.map +1 -1
- package/src/api-public/services/sms.js.map +1 -1
- package/src/api-public/services/wallet.js.map +1 -1
- package/src/api-public/services/workers.d.ts +1 -1
- package/src/api-public/utils/ut-database.js.map +1 -1
- package/src/app-project/serverless/src/controllers/index.js.map +1 -1
- package/src/app-project/serverless/src/controllers/sample.js.map +1 -1
- package/src/app-project/serverless/src/modules/database.d.ts +1 -2
- package/src/app-project/serverless/src/modules/database.js.map +1 -1
- package/src/app-project/serverless/src/modules/exception.js.map +1 -1
- package/src/app-project/serverless/src/modules/hooks.js.map +1 -1
- package/src/app-project/serverless/src/modules/logger.js.map +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.js.map +1 -1
- package/src/app-project/serverless/src/modules/response.js.map +1 -1
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/config.js.map +1 -5
- package/src/controllers/ai.js.map +1 -1
- package/src/controllers/global-event.js.map +1 -1
- package/src/controllers/page.js.map +1 -1
- package/src/controllers/private_config.js.map +1 -1
- package/src/export/export-test.js.map +1 -1
- package/src/firebase/message.js +1 -2
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +1 -2
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/helper/glitter-util.js.map +1 -1
- package/src/lambda/interface.d.ts +1 -1
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/exception.js.map +1 -1
- package/src/modules/hooks.js.map +1 -1
- package/src/modules/response.js.map +1 -1
- package/src/modules/ssh.js.map +1 -1
- package/src/services/ses.js +1 -2
- package/src/services/ses.js.map +1 -1
- package/src/services/system-schedule.js.map +1 -1
- package/g1b90plcfb.csv +0 -1289
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {GVC} from '../glitterBundle/GVController.js';
|
|
2
|
-
import {EditorElem} from '../glitterBundle/plugins/editor-elem.js';
|
|
3
|
-
import {BgWidget} from './bg-widget.js';
|
|
4
|
-
import {ApiUser} from '../glitter-base/route/user.js';
|
|
5
|
-
import {ShareDialog} from '../glitterBundle/dialog/ShareDialog.js';
|
|
6
|
-
import {ApiPageConfig} from '../api/pageConfig.js';
|
|
7
|
-
import {Article} from '../glitter-base/route/article.js';
|
|
8
|
-
import {MenusSetting} from '../cms-plugin/menus-setting.js';
|
|
9
|
-
import {BaseApi} from '../glitterBundle/api/base.js';
|
|
10
|
-
import {BgProduct, OptionsItem} from './bg-product.js';
|
|
11
|
-
import {CheckInput} from '../modules/checkInput.js';
|
|
12
|
-
import {config} from "../config.js";
|
|
1
|
+
import { GVC } from '../glitterBundle/GVController.js';
|
|
2
|
+
import { EditorElem } from '../glitterBundle/plugins/editor-elem.js';
|
|
3
|
+
import { BgWidget } from './bg-widget.js';
|
|
4
|
+
import { ApiUser } from '../glitter-base/route/user.js';
|
|
5
|
+
import { ShareDialog } from '../glitterBundle/dialog/ShareDialog.js';
|
|
6
|
+
import { ApiPageConfig } from '../api/pageConfig.js';
|
|
7
|
+
import { Article } from '../glitter-base/route/article.js';
|
|
8
|
+
import { MenusSetting } from '../cms-plugin/menus-setting.js';
|
|
9
|
+
import { BaseApi } from '../glitterBundle/api/base.js';
|
|
10
|
+
import { BgProduct, OptionsItem } from './bg-product.js';
|
|
11
|
+
import { CheckInput } from '../modules/checkInput.js';
|
|
13
12
|
|
|
14
13
|
interface MenuItem {
|
|
15
14
|
link: string;
|
|
@@ -23,8 +22,7 @@ export class BgBlog {
|
|
|
23
22
|
public static contentManager(
|
|
24
23
|
gvc: GVC,
|
|
25
24
|
type: 'select' | 'list' | 'collection' = 'list',
|
|
26
|
-
callback: (list: any[]) => void = () => {
|
|
27
|
-
},
|
|
25
|
+
callback: (list: any[]) => void = () => {},
|
|
28
26
|
is_page: boolean,
|
|
29
27
|
widget: any,
|
|
30
28
|
page_tab: 'page' | 'hidden' | 'shopping'
|
|
@@ -57,8 +55,7 @@ export class BgBlog {
|
|
|
57
55
|
},
|
|
58
56
|
{
|
|
59
57
|
key: '發布時間',
|
|
60
|
-
value: html`<span
|
|
61
|
-
class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
|
|
58
|
+
value: html`<span class="fs-7">${glitter.ut.dateFormat(new Date(dd.created_time), 'yyyy-MM-dd')}</span>`,
|
|
62
59
|
},
|
|
63
60
|
{
|
|
64
61
|
key: '預覽',
|
|
@@ -94,7 +91,6 @@ export class BgBlog {
|
|
|
94
91
|
];
|
|
95
92
|
});
|
|
96
93
|
}
|
|
97
|
-
|
|
98
94
|
if ((window.parent as any).glitter.getUrlParameter('page-id')) {
|
|
99
95
|
Article.get({
|
|
100
96
|
page: 0,
|
|
@@ -109,179 +105,178 @@ export class BgBlog {
|
|
|
109
105
|
const id = glitter.getUUID();
|
|
110
106
|
return {
|
|
111
107
|
bind: id,
|
|
112
|
-
dataList: [{obj: vm, key: 'type'}],
|
|
108
|
+
dataList: [{ obj: vm, key: 'type' }],
|
|
113
109
|
view: () => {
|
|
114
110
|
if ((window.parent as any).glitter.getUrlParameter('page-id') && vm.type!=='replace') {
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</div>
|
|
151
|
-
<div class="flex-fill"></div>
|
|
152
|
-
<div style="display: flex; gap: 12px;">
|
|
153
|
-
${is_page
|
|
154
|
-
? ''
|
|
155
|
-
: BgWidget.grayButton(
|
|
156
|
-
'網誌分類',
|
|
157
|
-
gvc.event(() => {
|
|
158
|
-
vm.type = 'collection';
|
|
159
|
-
gvc.notifyDataChange(id);
|
|
160
|
-
})
|
|
161
|
-
)}
|
|
162
|
-
${BgWidget.darkButton(
|
|
163
|
-
`新增${is_page ? `頁面` : `網誌`}`,
|
|
164
|
-
gvc.event(() => {
|
|
165
|
-
vm.data = {content: {}};
|
|
166
|
-
vm.type = 'add';
|
|
167
|
-
})
|
|
168
|
-
)}
|
|
169
|
-
</div>
|
|
111
|
+
return ``
|
|
112
|
+
}
|
|
113
|
+
if (vm.type === 'list') {
|
|
114
|
+
return BgWidget.container(
|
|
115
|
+
html`
|
|
116
|
+
<div class="title-container gap-4 ${type === 'select' ? `d-none` : ``}">
|
|
117
|
+
<div class="d-flex flex-column" style="gap:5px;">
|
|
118
|
+
${BgWidget.title(
|
|
119
|
+
is_page
|
|
120
|
+
? (() => {
|
|
121
|
+
switch (page_tab) {
|
|
122
|
+
case 'hidden':
|
|
123
|
+
return '隱形賣場';
|
|
124
|
+
case 'page':
|
|
125
|
+
return '自訂頁面';
|
|
126
|
+
case 'shopping':
|
|
127
|
+
return '一頁商店';
|
|
128
|
+
}
|
|
129
|
+
})()
|
|
130
|
+
: '網誌文章'
|
|
131
|
+
)}
|
|
132
|
+
${BgWidget.grayNote(
|
|
133
|
+
is_page
|
|
134
|
+
? (() => {
|
|
135
|
+
switch (page_tab) {
|
|
136
|
+
case 'hidden':
|
|
137
|
+
return '隱形賣場僅能透過連結分享,無法顯示於 Google 搜尋列表';
|
|
138
|
+
case 'page':
|
|
139
|
+
return '打造自訂頁面,顯示品牌官網的獨特內容';
|
|
140
|
+
case 'shopping':
|
|
141
|
+
return '放大特定商品重點,打造專屬爆品產品,一頁下單快速購物';
|
|
142
|
+
}
|
|
143
|
+
})()
|
|
144
|
+
: '快速分享商店最新資訊的好功能'
|
|
145
|
+
)}
|
|
170
146
|
</div>
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
147
|
+
<div class="flex-fill"></div>
|
|
148
|
+
<div style="display: flex; gap: 12px;">
|
|
149
|
+
${is_page
|
|
150
|
+
? ''
|
|
151
|
+
: BgWidget.grayButton(
|
|
152
|
+
'網誌分類',
|
|
153
|
+
gvc.event(() => {
|
|
154
|
+
vm.type = 'collection';
|
|
155
|
+
gvc.notifyDataChange(id);
|
|
156
|
+
})
|
|
157
|
+
)}
|
|
158
|
+
${BgWidget.darkButton(
|
|
159
|
+
`新增${is_page ? `頁面` : `網誌`}`,
|
|
160
|
+
gvc.event(() => {
|
|
161
|
+
vm.data = { content: {} };
|
|
162
|
+
vm.type = 'add';
|
|
163
|
+
})
|
|
164
|
+
)}
|
|
165
|
+
</div>
|
|
166
|
+
</div>
|
|
167
|
+
${BgWidget.container(
|
|
168
|
+
BgWidget.mainCard(
|
|
169
|
+
[
|
|
170
|
+
BgWidget.searchPlace(
|
|
171
|
+
gvc.event((e) => {
|
|
172
|
+
vm.query = e.value;
|
|
173
|
+
gvc.notifyDataChange(id);
|
|
174
|
+
}),
|
|
175
|
+
vm.query || '',
|
|
176
|
+
'搜尋所有文章'
|
|
177
|
+
),
|
|
178
|
+
BgWidget.tableV3({
|
|
179
|
+
gvc: gvc,
|
|
180
|
+
getData: (vd) => {
|
|
181
|
+
vmi = vd;
|
|
182
|
+
const limit = 20;
|
|
183
|
+
Article.get({
|
|
184
|
+
page: vmi.page - 1,
|
|
185
|
+
limit: limit,
|
|
186
|
+
search: vm.query || undefined,
|
|
187
|
+
for_index: is_page ? `false` : `true`,
|
|
188
|
+
status: '0,1',
|
|
189
|
+
page_type: page_tab,
|
|
190
|
+
}).then((data) => {
|
|
191
|
+
vm.dataList = data.response.data;
|
|
192
|
+
vmi.pageSize = Math.ceil(data.response.total / limit);
|
|
193
|
+
vmi.originalData = vm.dataList;
|
|
194
|
+
vmi.tableData = getDatalist();
|
|
195
|
+
vmi.loading = false;
|
|
196
|
+
vmi.callback();
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
rowClick: (data, index) => {
|
|
200
|
+
if (type === 'select') {
|
|
201
|
+
vm.dataList[index].checked = !vm.dataList[index].checked;
|
|
202
|
+
vmi.data = getDatalist();
|
|
203
|
+
vmi.callback();
|
|
204
|
+
callback(
|
|
205
|
+
vm.dataList.filter((dd: any) => {
|
|
206
|
+
return dd.checked;
|
|
207
|
+
})
|
|
208
|
+
);
|
|
209
|
+
} else {
|
|
210
|
+
vm.data = vm.dataList[index];
|
|
211
|
+
vm.type = 'replace';
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
filter: [
|
|
215
|
+
{
|
|
216
|
+
name: '批量移除',
|
|
217
|
+
event: (checkedData) => {
|
|
218
|
+
const dialog = new ShareDialog(glitter);
|
|
219
|
+
dialog.checkYesOrNot({
|
|
220
|
+
text: '是否確認刪除所選項目?',
|
|
221
|
+
callback: (response) => {
|
|
222
|
+
if (response) {
|
|
223
|
+
dialog.dataLoading({ visible: true });
|
|
224
|
+
Article.deleteV2({
|
|
225
|
+
id: checkedData
|
|
226
|
+
.map((dd: any) => {
|
|
227
|
+
return dd.id;
|
|
228
|
+
})
|
|
229
|
+
.join(`,`),
|
|
230
|
+
}).then((res) => {
|
|
231
|
+
dialog.dataLoading({ visible: false });
|
|
232
|
+
if (res.result) {
|
|
233
|
+
vm.dataList = undefined;
|
|
234
|
+
gvc.notifyDataChange(id);
|
|
235
|
+
} else {
|
|
236
|
+
dialog.errorMessage({ text: '刪除失敗' });
|
|
242
237
|
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
245
240
|
},
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
]
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
)
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
key: 'blog_collection',
|
|
269
|
-
goBack: () => {
|
|
270
|
-
vm.type = 'list';
|
|
271
|
-
gvc.notifyDataChange(id);
|
|
272
|
-
},
|
|
273
|
-
}),
|
|
274
|
-
BgWidget.getContainerWidth()
|
|
275
|
-
);
|
|
276
|
-
} else {
|
|
277
|
-
return editor({
|
|
241
|
+
});
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
}),
|
|
246
|
+
].join('')
|
|
247
|
+
)
|
|
248
|
+
)}
|
|
249
|
+
`
|
|
250
|
+
);
|
|
251
|
+
} else if (vm.type == 'replace') {
|
|
252
|
+
(window.parent as any).glitter.setUrlParameter('page-id', vm.data.id)
|
|
253
|
+
return editor({
|
|
254
|
+
gvc: gvc,
|
|
255
|
+
vm: vm,
|
|
256
|
+
is_page: is_page,
|
|
257
|
+
widget: widget,
|
|
258
|
+
page_tab: page_tab,
|
|
259
|
+
});
|
|
260
|
+
} else if (vm.type == 'collection') {
|
|
261
|
+
return BgWidget.container(
|
|
262
|
+
setCollection({
|
|
278
263
|
gvc: gvc,
|
|
279
|
-
vm: vm,
|
|
280
|
-
is_page: is_page,
|
|
281
264
|
widget: widget,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
265
|
+
key: 'blog_collection',
|
|
266
|
+
goBack: () => {
|
|
267
|
+
vm.type = 'list';
|
|
268
|
+
gvc.notifyDataChange(id);
|
|
269
|
+
},
|
|
270
|
+
})
|
|
271
|
+
);
|
|
272
|
+
} else {
|
|
273
|
+
return editor({
|
|
274
|
+
gvc: gvc,
|
|
275
|
+
vm: vm,
|
|
276
|
+
is_page: is_page,
|
|
277
|
+
widget: widget,
|
|
278
|
+
page_tab: page_tab,
|
|
279
|
+
});
|
|
285
280
|
}
|
|
286
281
|
},
|
|
287
282
|
};
|
|
@@ -302,7 +297,7 @@ export class BgBlog {
|
|
|
302
297
|
`);
|
|
303
298
|
const containerID = gvc.glitter.getUUID();
|
|
304
299
|
return html`
|
|
305
|
-
<div class="
|
|
300
|
+
<div class="title-container">
|
|
306
301
|
${BgWidget.goBack(
|
|
307
302
|
gvc.event(() => {
|
|
308
303
|
callback(undefined);
|
|
@@ -311,8 +306,7 @@ export class BgBlog {
|
|
|
311
306
|
<div>${[BgWidget.title('選擇模板'), BgWidget.grayNote('請選擇一個符合您需求的模板')].join('')}</div>
|
|
312
307
|
</div>
|
|
313
308
|
${[
|
|
314
|
-
html
|
|
315
|
-
<div class="my-3"></div>`,
|
|
309
|
+
html`<div class="my-3"></div>`,
|
|
316
310
|
BgWidget.card(
|
|
317
311
|
gvc.bindView(() => {
|
|
318
312
|
return {
|
|
@@ -441,17 +435,15 @@ export class BgBlog {
|
|
|
441
435
|
if (data.response.result.data.length === 0) {
|
|
442
436
|
if (!vm.search) {
|
|
443
437
|
return html`
|
|
444
|
-
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
445
|
-
|
|
446
|
-
<
|
|
447
|
-
<span class="color39 text-center">尚未自製任何模塊<br/>請前往開發者模式自製專屬模塊</span>
|
|
438
|
+
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4" style="width:700px;gap:10px;">
|
|
439
|
+
<img src="./img/box-open-solid.svg" />
|
|
440
|
+
<span class="color39 text-center">尚未自製任何模塊<br />請前往開發者模式自製專屬模塊</span>
|
|
448
441
|
</div>
|
|
449
442
|
`;
|
|
450
443
|
} else {
|
|
451
444
|
return html`
|
|
452
|
-
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4"
|
|
453
|
-
|
|
454
|
-
<img src="./img/box-open-solid.svg"/>
|
|
445
|
+
<div class="d-flex align-items-center justify-content-center flex-column w-100 py-4" style="width:700px;gap:10px;">
|
|
446
|
+
<img src="./img/box-open-solid.svg" />
|
|
455
447
|
<span class="color39 text-center">查無相關模塊</span>
|
|
456
448
|
</div>
|
|
457
449
|
`;
|
|
@@ -469,73 +461,71 @@ export class BgBlog {
|
|
|
469
461
|
}
|
|
470
462
|
})
|
|
471
463
|
.map((dd: any, index: number) => {
|
|
472
|
-
return html
|
|
473
|
-
<div class="
|
|
474
|
-
<div
|
|
475
|
-
|
|
464
|
+
return html`<div class="col-6 col-sm-3 mb-3 rounded-3">
|
|
465
|
+
<div class="d-flex flex-column justify-content-center w-100 " style="gap:5px;cursor:pointer;">
|
|
466
|
+
<div
|
|
467
|
+
class="card w-100 position-relative rounded hoverHidden bgf6 rounded-3"
|
|
468
|
+
style="padding-bottom: ${(800 / 600) * 100}%;"
|
|
469
|
+
>
|
|
476
470
|
<div
|
|
477
|
-
class="
|
|
478
|
-
style="
|
|
471
|
+
class="position-absolute w-100 h-100 d-flex align-items-center justify-content-center rounded-3"
|
|
472
|
+
style="overflow: hidden;"
|
|
479
473
|
>
|
|
480
|
-
<
|
|
481
|
-
class="
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
src="${dd.template_config.image[0] ??
|
|
487
|
-
'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
488
|
-
/>
|
|
489
|
-
</div>
|
|
474
|
+
<img
|
|
475
|
+
class="w-100 "
|
|
476
|
+
src="${dd.template_config.image[0] ??
|
|
477
|
+
'https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/1713445383494-未命名(1080x1080像素).jpg'}"
|
|
478
|
+
/>
|
|
479
|
+
</div>
|
|
490
480
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
481
|
+
<div
|
|
482
|
+
class="position-absolute w-100 h-100 align-items-center justify-content-center rounded fs-6 flex-column"
|
|
483
|
+
style="background: rgba(0,0,0,0.5);gap:5px;"
|
|
484
|
+
>
|
|
485
|
+
<button
|
|
486
|
+
class="btn btn-secondary d-flex align-items-center "
|
|
487
|
+
style="height: 28px;width: 75px;gap:5px;"
|
|
488
|
+
onclick="${gvc.event(() => {
|
|
489
|
+
if (dd.tag === 'empty') {
|
|
490
|
+
const a: any = [];
|
|
491
|
+
(a as any).name = '空白頁面';
|
|
492
|
+
callback(a);
|
|
493
|
+
} else {
|
|
494
|
+
if (dd._config) {
|
|
495
|
+
dd._config.name = dd.template_config.name;
|
|
496
|
+
callback(dd._config);
|
|
503
497
|
} else {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
}).then((res) => {
|
|
514
|
-
res.response.result[0].config.name = dd.template_config.name;
|
|
515
|
-
callback(res.response.result[0].config);
|
|
516
|
-
});
|
|
517
|
-
}
|
|
498
|
+
BaseApi.create({
|
|
499
|
+
url: `${(window as any).glitterBackend}/api/v1/template?appName=${dd.appName}&tag=${
|
|
500
|
+
dd.tag
|
|
501
|
+
}`,
|
|
502
|
+
type: 'get',
|
|
503
|
+
}).then((res) => {
|
|
504
|
+
res.response.result[0].config.name = dd.template_config.name;
|
|
505
|
+
callback(res.response.result[0].config);
|
|
506
|
+
});
|
|
518
507
|
}
|
|
519
|
-
}
|
|
520
|
-
>
|
|
521
|
-
選擇
|
|
522
|
-
</button>
|
|
523
|
-
</div>
|
|
524
|
-
</div>
|
|
525
|
-
<h3 class="fs-6 mb-0 d-flex justify-content-between align-items-center fw-500 mt-1">
|
|
526
|
-
${dd.template_config.name}
|
|
527
|
-
<i
|
|
528
|
-
class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ``}"
|
|
529
|
-
style="cursor:pointer;"
|
|
530
|
-
onclick="${gvc.event(() => {
|
|
531
|
-
(window.parent as any).glitter.openNewTab(
|
|
532
|
-
`${gvc.glitter.root_path}pages/${dd.tag}?appName=${dd.appName}`
|
|
533
|
-
);
|
|
508
|
+
}
|
|
534
509
|
})}"
|
|
535
|
-
|
|
536
|
-
|
|
510
|
+
>
|
|
511
|
+
選擇
|
|
512
|
+
</button>
|
|
513
|
+
</div>
|
|
537
514
|
</div>
|
|
538
|
-
|
|
515
|
+
<h3 class="fs-6 mb-0 d-flex justify-content-between align-items-center fw-500 mt-1">
|
|
516
|
+
${dd.template_config.name}
|
|
517
|
+
<i
|
|
518
|
+
class="fa-solid fa-eye ${dd.tag === 'empty' ? `d-none` : ``}"
|
|
519
|
+
style="cursor:pointer;"
|
|
520
|
+
onclick="${gvc.event(() => {
|
|
521
|
+
(window.parent as any).glitter.openNewTab(
|
|
522
|
+
`${gvc.glitter.root_path}pages/${dd.tag}?appName=${dd.appName}`
|
|
523
|
+
);
|
|
524
|
+
})}"
|
|
525
|
+
></i>
|
|
526
|
+
</h3>
|
|
527
|
+
</div>
|
|
528
|
+
</div>`;
|
|
539
529
|
})
|
|
540
530
|
.join('')}
|
|
541
531
|
</div>
|
|
@@ -544,12 +534,10 @@ export class BgBlog {
|
|
|
544
534
|
}
|
|
545
535
|
})();
|
|
546
536
|
} else {
|
|
547
|
-
return html`
|
|
548
|
-
<div class="
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
<div class="fs-6 fw-500">載入中...</div>
|
|
552
|
-
</div>`;
|
|
537
|
+
return html` <div class="w-100 p-3 d-flex align-items-center justify-content-center flex-column" style="gap: 10px;">
|
|
538
|
+
<div class="spinner-border fs-5"></div>
|
|
539
|
+
<div class="fs-6 fw-500">載入中...</div>
|
|
540
|
+
</div>`;
|
|
553
541
|
}
|
|
554
542
|
},
|
|
555
543
|
divCreate: {
|
|
@@ -562,7 +550,8 @@ export class BgBlog {
|
|
|
562
550
|
};
|
|
563
551
|
})
|
|
564
552
|
),
|
|
565
|
-
].join('')}
|
|
553
|
+
].join('')}
|
|
554
|
+
`;
|
|
566
555
|
}
|
|
567
556
|
}
|
|
568
557
|
|
|
@@ -584,7 +573,6 @@ function editor(cf: { gvc: GVC; vm: any; is_page: boolean; widget: any; page_tab
|
|
|
584
573
|
id: gvc.glitter.getUUID(),
|
|
585
574
|
type: 'detail',
|
|
586
575
|
};
|
|
587
|
-
|
|
588
576
|
return BgWidget.container(
|
|
589
577
|
gvc.bindView(() => {
|
|
590
578
|
return {
|
|
@@ -612,23 +600,19 @@ function editor(cf: { gvc: GVC; vm: any; is_page: boolean; widget: any; page_tab
|
|
|
612
600
|
},
|
|
613
601
|
def: vm.data.content.collection || [],
|
|
614
602
|
},
|
|
615
|
-
})
|
|
616
|
-
BgWidget.getContainerWidth()
|
|
603
|
+
})
|
|
617
604
|
);
|
|
618
605
|
case 'detail':
|
|
619
606
|
return detail(gvc, cf, vm, cVm, cf.page_tab);
|
|
620
607
|
case 'template':
|
|
621
|
-
|
|
622
608
|
return template_select(gvc, cf, vm, cVm, cf.page_tab);
|
|
623
609
|
default:
|
|
624
610
|
return ``;
|
|
625
611
|
}
|
|
626
|
-
|
|
627
612
|
},
|
|
628
613
|
divCreate: {},
|
|
629
614
|
};
|
|
630
|
-
})
|
|
631
|
-
BgWidget.getContainerWidth()
|
|
615
|
+
})
|
|
632
616
|
);
|
|
633
617
|
}
|
|
634
618
|
|
|
@@ -660,7 +644,7 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
660
644
|
: 'blogs'
|
|
661
645
|
}`
|
|
662
646
|
return html`
|
|
663
|
-
<div class="
|
|
647
|
+
<div class="title-container">
|
|
664
648
|
${BgWidget.goBack(
|
|
665
649
|
gvc.event(() => {
|
|
666
650
|
(window.parent as any).glitter.setUrlParameter('page-id', undefined)
|
|
@@ -700,501 +684,450 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
700
684
|
)}
|
|
701
685
|
</div>
|
|
702
686
|
</div>
|
|
703
|
-
${BgWidget.
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
case 'page':
|
|
728
|
-
return 'pages';
|
|
729
|
-
default:
|
|
730
|
-
return '';
|
|
731
|
-
}
|
|
732
|
-
})()
|
|
733
|
-
: 'blogs'
|
|
734
|
-
}/`;
|
|
735
|
-
return [
|
|
736
|
-
BgWidget.title('基本設定', 'font-size: 16px;'),
|
|
737
|
-
html`
|
|
738
|
-
<div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
|
|
739
|
-
<div class="tx_normal">網頁啟用</div>
|
|
740
|
-
${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
|
|
741
|
-
vm.data.status = bool ? 1 : 0;
|
|
742
|
-
gvc.notifyDataChange(id);
|
|
743
|
-
})}
|
|
744
|
-
</div>`,
|
|
745
|
-
BgWidget.editeInput({
|
|
746
|
-
gvc: gvc,
|
|
747
|
-
title: '網頁名稱',
|
|
748
|
-
default: vm.data.content.name || '',
|
|
749
|
-
placeHolder: '請輸入網頁名稱',
|
|
750
|
-
callback: (text) => {
|
|
751
|
-
vm.data.content.name = text;
|
|
752
|
-
},
|
|
753
|
-
}),
|
|
754
|
-
html`
|
|
755
|
-
<div>
|
|
756
|
-
<div class="tx_normal fw-normal mb-2">
|
|
757
|
-
自訂網址
|
|
758
|
-
</div>
|
|
759
|
-
<div
|
|
760
|
-
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
761
|
-
.body.clientWidth > 768
|
|
762
|
-
? 'gap: 18px; '
|
|
763
|
-
: 'flex-direction: column; gap: 0px; '}"
|
|
764
|
-
class="w-100"
|
|
765
|
-
>
|
|
766
|
-
<div class="${document.body.clientWidth > 768 ? `` : `w-100`}"
|
|
767
|
-
style="padding: 9px 18px;background: #EAEAEA ;${document.body.clientWidth > 768 ? `justify-content: center;` : `justify-content: start;`} align-items: center; gap: 5px; display: flex">
|
|
768
|
-
<div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
769
|
-
${prefixURL}
|
|
770
|
-
</div>
|
|
771
|
-
</div>
|
|
772
|
-
<input
|
|
773
|
-
class="flex-fill"
|
|
774
|
-
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
|
|
775
|
-
.body.clientWidth > 768
|
|
776
|
-
? ''
|
|
777
|
-
: 'padding: 9px 18px;'}"
|
|
778
|
-
value="${vm.data.content.tag || ''}"
|
|
779
|
-
onchange="${gvc.event((e) => {
|
|
780
|
-
let text = e.value;
|
|
781
|
-
if (!CheckInput.isEnglishNumberHyphen(text)) {
|
|
782
|
-
const dialog = new ShareDialog(gvc.glitter);
|
|
783
|
-
dialog.infoMessage({text: '僅能輸入英文或數字與連接號'});
|
|
784
|
-
gvc.notifyDataChange(id);
|
|
785
|
-
} else {
|
|
786
|
-
vm.data.content.tag = text;
|
|
787
|
-
gvc.notifyDataChange(id);
|
|
788
|
-
}
|
|
789
|
-
})}"
|
|
790
|
-
/>
|
|
791
|
-
</div>
|
|
792
|
-
</div>`,
|
|
793
|
-
html`
|
|
794
|
-
<div class="mt-2 mb-1"><span
|
|
795
|
-
class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + (vm.data.content.tag ?? ''))}
|
|
796
|
-
</div>`,
|
|
797
|
-
...(() => {
|
|
798
|
-
return [
|
|
799
|
-
BgWidget.editeInput({
|
|
800
|
-
gvc: gvc,
|
|
801
|
-
title: 'SEO標題',
|
|
802
|
-
default: vm.data.content.seo.title,
|
|
803
|
-
placeHolder: `請輸入SEO標題`,
|
|
804
|
-
callback: (text) => {
|
|
805
|
-
vm.data.content.title = text;
|
|
806
|
-
vm.data.content.seo.title = text;
|
|
807
|
-
gvc.notifyDataChange(id);
|
|
808
|
-
},
|
|
809
|
-
}),
|
|
810
|
-
BgWidget.textArea({
|
|
811
|
-
gvc: gvc,
|
|
812
|
-
title: 'SEO描述',
|
|
813
|
-
default: vm.data.content.seo.content,
|
|
814
|
-
placeHolder: `請輸入中繼描述`,
|
|
815
|
-
callback: (text) => {
|
|
816
|
-
vm.data.content.description = text;
|
|
817
|
-
vm.data.content.seo.content = text;
|
|
818
|
-
gvc.notifyDataChange(id);
|
|
819
|
-
},
|
|
820
|
-
}),
|
|
821
|
-
html`
|
|
822
|
-
<div>
|
|
823
|
-
<div class="tx_normal">
|
|
824
|
-
社群分享縮圖
|
|
825
|
-
</div>
|
|
826
|
-
<div class="mt-1 mb-2">
|
|
827
|
-
${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}
|
|
828
|
-
</div>
|
|
829
|
-
${BgWidget.imageSelector(gvc, vm.data.content.seo.image || '', (text) => {
|
|
830
|
-
vm.data.content.seo.image = text;
|
|
831
|
-
gvc.notifyDataChange(id);
|
|
832
|
-
})}
|
|
833
|
-
</div>`,
|
|
834
|
-
,
|
|
835
|
-
];
|
|
836
|
-
})(),
|
|
837
|
-
...(() => {
|
|
838
|
-
if (`${vm.data.content.for_index}` === 'true') {
|
|
839
|
-
return [
|
|
840
|
-
[
|
|
841
|
-
html`
|
|
842
|
-
<div class="tx_normal my-3">
|
|
843
|
-
網誌內文
|
|
844
|
-
</div>`,
|
|
845
|
-
EditorElem.richText({
|
|
846
|
-
gvc: gvc,
|
|
847
|
-
def: vm.data.content.text ?? '',
|
|
848
|
-
callback: (text) => {
|
|
849
|
-
vm.data.content.text = text;
|
|
850
|
-
},
|
|
851
|
-
}),
|
|
852
|
-
].join(BgWidget.mbContainer(12)),
|
|
853
|
-
];
|
|
854
|
-
} else {
|
|
855
|
-
return [];
|
|
687
|
+
${BgWidget.container1x2(
|
|
688
|
+
{
|
|
689
|
+
html: [
|
|
690
|
+
gvc.bindView(() => {
|
|
691
|
+
vm.data.status = vm.data.status ?? 1;
|
|
692
|
+
const id = gvc.glitter.getUUID();
|
|
693
|
+
return {
|
|
694
|
+
bind: id,
|
|
695
|
+
view: () => {
|
|
696
|
+
return [
|
|
697
|
+
BgWidget.mainCard(
|
|
698
|
+
(() => {
|
|
699
|
+
const prefixURL = `https://${(window.parent as any).glitter.share.editorViewModel.domain}/${
|
|
700
|
+
cf.is_page
|
|
701
|
+
? (() => {
|
|
702
|
+
switch (page_tab) {
|
|
703
|
+
case 'shopping':
|
|
704
|
+
return 'shop';
|
|
705
|
+
case 'hidden':
|
|
706
|
+
return 'hidden';
|
|
707
|
+
case 'page':
|
|
708
|
+
return 'pages';
|
|
709
|
+
default:
|
|
710
|
+
return '';
|
|
856
711
|
}
|
|
857
|
-
})()
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
),
|
|
861
|
-
].join('');
|
|
862
|
-
},
|
|
863
|
-
divCreate: {
|
|
864
|
-
style: 'padding: 0;',
|
|
865
|
-
},
|
|
866
|
-
};
|
|
867
|
-
}),
|
|
868
|
-
undefined,
|
|
869
|
-
'padding: 0 !important; margin: 0 !important; width: 100%;'
|
|
870
|
-
)}
|
|
871
|
-
${(() => {
|
|
872
|
-
vm.data.content.relative = vm.data.content.relative || 'collection';
|
|
873
|
-
vm.data.content.relative_data = vm.data.content.relative_data || [];
|
|
874
|
-
vm.data.content.with_discount = vm.data.content.with_discount || 'false';
|
|
875
|
-
|
|
876
|
-
return gvc.bindView(() => {
|
|
877
|
-
const id = gvc.glitter.getUUID();
|
|
878
|
-
return {
|
|
879
|
-
bind: id,
|
|
880
|
-
view: () => {
|
|
881
|
-
// 顯示套用的賣場商品列表
|
|
882
|
-
if (vm.data.content.page_type === 'hidden' || vm.data.content.page_type === 'shopping') {
|
|
883
|
-
return [
|
|
884
|
-
BgWidget.mainCard(
|
|
885
|
-
[
|
|
886
|
-
BgWidget.title(
|
|
887
|
-
html`預設加入購物車
|
|
888
|
-
<div class="badge ms-2"
|
|
889
|
-
style="background:#eaeaea;color:#393939;">
|
|
890
|
-
以下設定的商品會自動加入購物車
|
|
891
|
-
</div>`,
|
|
892
|
-
'font-size: 16px;'
|
|
893
|
-
),
|
|
894
|
-
html`
|
|
895
|
-
<div class="my-2"></div>`,
|
|
896
|
-
[
|
|
897
|
-
html`${(() => {
|
|
898
|
-
return gvc.bindView(() => {
|
|
899
|
-
const subVM = {
|
|
900
|
-
id: gvc.glitter.getUUID(),
|
|
901
|
-
loading: true,
|
|
902
|
-
dataList: [] as OptionsItem[],
|
|
903
|
-
};
|
|
904
|
-
return {
|
|
905
|
-
bind: subVM.id,
|
|
906
|
-
view: () => {
|
|
907
|
-
if (subVM.loading) {
|
|
908
|
-
return BgWidget.spinner();
|
|
909
|
-
}
|
|
910
|
-
return html`
|
|
911
|
-
<div class="d-flex flex-column p-2"
|
|
912
|
-
style="gap: 18px;">
|
|
913
|
-
<div class="d-flex align-items-center gray-bottom-line-18 "
|
|
914
|
-
style="gap: 24px; justify-content: space-between;">
|
|
915
|
-
<div class="form-check-label c_updown_label">
|
|
916
|
-
<div class="tx_normal">
|
|
917
|
-
產品列表
|
|
918
|
-
</div>
|
|
919
|
-
</div>
|
|
920
|
-
${BgWidget.grayButton(
|
|
921
|
-
'搜尋商品',
|
|
922
|
-
gvc.event(() => {
|
|
923
|
-
BgProduct.variantsSelector({
|
|
924
|
-
gvc: gvc,
|
|
925
|
-
filter_variants: vm.data.content.relative_data.map((dd: any) => {
|
|
926
|
-
return [dd.product_id].concat(dd.variant.spec).join('-');
|
|
927
|
-
}),
|
|
928
|
-
callback: async (value) => {
|
|
929
|
-
vm.data.content.relative_data = value.map((dd: any) => {
|
|
930
|
-
return {
|
|
931
|
-
variant: dd.variant_content,
|
|
932
|
-
product_id: dd.product_id,
|
|
933
|
-
};
|
|
934
|
-
});
|
|
935
|
-
subVM.loading = true;
|
|
936
|
-
gvc.notifyDataChange(subVM.id);
|
|
937
|
-
},
|
|
938
|
-
});
|
|
939
|
-
}),
|
|
940
|
-
{textStyle: 'font-weight: 400;'}
|
|
941
|
-
)}
|
|
942
|
-
</div>
|
|
943
|
-
${subVM.dataList
|
|
944
|
-
.map((opt: OptionsItem, index) => {
|
|
945
|
-
return html`
|
|
946
|
-
<div class="d-flex align-items-center form-check-label c_updown_label gap-3">
|
|
947
|
-
<span class="tx_normal"
|
|
948
|
-
style="min-width: 20px;">${index + 1} .</span>
|
|
949
|
-
${BgWidget.validImageBox({
|
|
950
|
-
gvc: gvc,
|
|
951
|
-
image: opt.image,
|
|
952
|
-
width: 40
|
|
953
|
-
})}
|
|
954
|
-
<div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
|
|
955
|
-
${opt.value}
|
|
956
|
-
${opt.note ? html`
|
|
957
|
-
<div class="tx_gray_12">
|
|
958
|
-
${opt.note}
|
|
959
|
-
</div> ` : ''}
|
|
960
|
-
</div>
|
|
961
|
-
<div class="flex-fill"></div>
|
|
962
|
-
${BgWidget.cancel(
|
|
963
|
-
gvc.event(() => {
|
|
964
|
-
vm.data.content.relative_data.splice(index, 1);
|
|
965
|
-
subVM.dataList.splice(index, 1);
|
|
966
|
-
gvc.notifyDataChange(subVM.id);
|
|
967
|
-
}),
|
|
968
|
-
'移除'
|
|
969
|
-
)}
|
|
970
|
-
</div>
|
|
971
|
-
`;
|
|
972
|
-
})
|
|
973
|
-
.join('') || `<div class="w-100 d-flex align-content-center justify-content-center">尚未加入任何賣場商品</div>`}
|
|
974
|
-
</div>
|
|
975
|
-
`;
|
|
976
|
-
},
|
|
977
|
-
onCreate: () => {
|
|
978
|
-
if (subVM.loading) {
|
|
979
|
-
if (vm.data.content.relative_data.length === 0) {
|
|
980
|
-
setTimeout(() => {
|
|
981
|
-
subVM.dataList = [];
|
|
982
|
-
subVM.loading = false;
|
|
983
|
-
gvc.notifyDataChange(subVM.id);
|
|
984
|
-
}, 300);
|
|
985
|
-
} else {
|
|
986
|
-
new Promise<OptionsItem[]>(async (resolve) => {
|
|
987
|
-
const products_data = await BgProduct.getProductOpts(
|
|
988
|
-
vm.data.content.relative_data.map((dd: any) => {
|
|
989
|
-
return dd.product_id;
|
|
990
|
-
})
|
|
991
|
-
);
|
|
992
|
-
vm.data.content.relative_data = vm.data.content.relative_data.filter((dd: any) => {
|
|
993
|
-
return products_data.find((d1) => {
|
|
994
|
-
return `${dd.product_id}` === `${d1.key}`;
|
|
995
|
-
});
|
|
996
|
-
});
|
|
997
|
-
subVM.dataList = vm.data.content.relative_data.map((dd: any) => {
|
|
998
|
-
const product: any = JSON.parse(
|
|
999
|
-
JSON.stringify(
|
|
1000
|
-
products_data.find((d1) => {
|
|
1001
|
-
return `${dd.product_id}` === `${d1.key}`;
|
|
1002
|
-
})
|
|
1003
|
-
)
|
|
1004
|
-
);
|
|
1005
|
-
product.note = dd.variant.spec.join(' / ');
|
|
1006
|
-
return product;
|
|
1007
|
-
});
|
|
1008
|
-
resolve(subVM.dataList);
|
|
1009
|
-
}).then((data) => {
|
|
1010
|
-
subVM.dataList = data;
|
|
1011
|
-
subVM.loading = false;
|
|
1012
|
-
gvc.notifyDataChange(subVM.id);
|
|
1013
|
-
});
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
},
|
|
1017
|
-
};
|
|
1018
|
-
});
|
|
1019
|
-
})()}`,
|
|
1020
|
-
].join(''),
|
|
1021
|
-
].join('')
|
|
1022
|
-
),
|
|
1023
|
-
].join('');
|
|
1024
|
-
} else {
|
|
1025
|
-
return [].join('');
|
|
1026
|
-
}
|
|
1027
|
-
},
|
|
1028
|
-
divCreate: {
|
|
1029
|
-
class: `w-100 mt-2`,
|
|
1030
|
-
},
|
|
1031
|
-
};
|
|
1032
|
-
});
|
|
1033
|
-
})()}
|
|
1034
|
-
</div>
|
|
1035
|
-
${BgWidget.container(
|
|
1036
|
-
BgWidget.mainCard(
|
|
1037
|
-
gvc.bindView(() => {
|
|
1038
|
-
console.log(`vm.data.content.template=>`, vm.data.content.template);
|
|
1039
|
-
const id = gvc.glitter.getUUID();
|
|
1040
|
-
vm.data.status = vm.data.status ?? '1';
|
|
1041
|
-
return {
|
|
1042
|
-
bind: id,
|
|
1043
|
-
view: () => {
|
|
712
|
+
})()
|
|
713
|
+
: 'blogs'
|
|
714
|
+
}/`;
|
|
1044
715
|
return [
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
716
|
+
BgWidget.title('基本設定', 'font-size: 16px;'),
|
|
717
|
+
html` <div style="display: flex; align-items: center; gap: 4px; margin: 18px 0;">
|
|
718
|
+
<div class="tx_normal">網頁啟用</div>
|
|
719
|
+
${BgWidget.switchButton(gvc, vm.data.status, (bool) => {
|
|
720
|
+
vm.data.status = bool ? 1 : 0;
|
|
721
|
+
gvc.notifyDataChange(id);
|
|
722
|
+
})}
|
|
723
|
+
</div>`,
|
|
724
|
+
BgWidget.editeInput({
|
|
725
|
+
gvc: gvc,
|
|
726
|
+
title: '網頁名稱',
|
|
727
|
+
default: vm.data.content.name || '',
|
|
728
|
+
placeHolder: '請輸入網頁名稱',
|
|
729
|
+
callback: (text) => {
|
|
730
|
+
vm.data.content.name = text;
|
|
731
|
+
},
|
|
732
|
+
}),
|
|
733
|
+
html` <div>
|
|
734
|
+
<div class="tx_normal fw-normal mb-2">自訂網址</div>
|
|
735
|
+
<div
|
|
736
|
+
style="justify-content: flex-start; align-items: center; display: inline-flex;border:1px solid #EAEAEA;border-radius: 10px;overflow: hidden; ${document
|
|
737
|
+
.body.clientWidth > 768
|
|
738
|
+
? 'gap: 18px; '
|
|
739
|
+
: 'flex-direction: column; gap: 0px; '}"
|
|
740
|
+
class="w-100"
|
|
741
|
+
>
|
|
742
|
+
<div style="width:100%;padding: 9px 18px;background: #EAEAEA; justify-content: flex-start; align-items: center; gap: 5px; display: flex">
|
|
743
|
+
<div style="text-align: right; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
744
|
+
${prefixURL}
|
|
745
|
+
</div>
|
|
746
|
+
</div>
|
|
747
|
+
<input
|
|
748
|
+
class="flex-fill"
|
|
749
|
+
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
|
|
750
|
+
.body.clientWidth > 768
|
|
751
|
+
? ''
|
|
752
|
+
: 'padding: 9px 18px;'}"
|
|
753
|
+
value="${vm.data.content.tag || ''}"
|
|
754
|
+
onchange="${gvc.event((e) => {
|
|
755
|
+
let text = e.value;
|
|
756
|
+
if (!CheckInput.isEnglishNumberHyphen(text)) {
|
|
757
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
758
|
+
dialog.infoMessage({ text: '僅能輸入英文或數字與連接號' });
|
|
759
|
+
gvc.notifyDataChange(id);
|
|
760
|
+
} else {
|
|
761
|
+
vm.data.content.tag = text;
|
|
762
|
+
gvc.notifyDataChange(id);
|
|
763
|
+
}
|
|
764
|
+
})}"
|
|
765
|
+
/>
|
|
766
|
+
</div>
|
|
767
|
+
</div>`,
|
|
768
|
+
html` <div class="mt-2 mb-1"><span class="tx_normal me-2">網址預覽</span>${BgWidget.greenNote(prefixURL + (vm.data.content.tag ?? ''))}</div>`,
|
|
769
|
+
...(() => {
|
|
770
|
+
return [
|
|
771
|
+
BgWidget.editeInput({
|
|
1049
772
|
gvc: gvc,
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
{
|
|
1057
|
-
title: '隱藏',
|
|
1058
|
-
value: '0',
|
|
1059
|
-
},
|
|
1060
|
-
],
|
|
1061
|
-
callback: (text: string) => {
|
|
1062
|
-
vm.data.status = text;
|
|
773
|
+
title: 'SEO標題',
|
|
774
|
+
default: vm.data.content.seo.title,
|
|
775
|
+
placeHolder: `請輸入SEO標題`,
|
|
776
|
+
callback: (text) => {
|
|
777
|
+
vm.data.content.title = text;
|
|
778
|
+
vm.data.content.seo.title = text;
|
|
1063
779
|
gvc.notifyDataChange(id);
|
|
1064
780
|
},
|
|
1065
781
|
}),
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
const filter_result = dd.group !== 'glitter-article' && dd.page_type === 'article' && dd.page_config.template_type === 'blog';
|
|
1075
|
-
if (filter_result && !vm.data.content.template) {
|
|
1076
|
-
vm.data.content.template = dd.tag;
|
|
782
|
+
BgWidget.textArea({
|
|
783
|
+
gvc: gvc,
|
|
784
|
+
title: 'SEO描述',
|
|
785
|
+
default: vm.data.content.seo.content,
|
|
786
|
+
placeHolder: `請輸入中繼描述`,
|
|
787
|
+
callback: (text) => {
|
|
788
|
+
vm.data.content.description = text;
|
|
789
|
+
vm.data.content.seo.content = text;
|
|
1077
790
|
gvc.notifyDataChange(id);
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
gvc
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
}),
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
791
|
+
},
|
|
792
|
+
}),
|
|
793
|
+
html` <div>
|
|
794
|
+
<div class="tx_normal">社群分享縮圖</div>
|
|
795
|
+
<div class="mt-1 mb-2">${BgWidget.grayNote('建議尺寸為 200px * 200px 以上')}</div>
|
|
796
|
+
${BgWidget.imageSelector(gvc, vm.data.content.seo.image || '', (text) => {
|
|
797
|
+
vm.data.content.seo.image = text;
|
|
798
|
+
gvc.notifyDataChange(id);
|
|
799
|
+
})}
|
|
800
|
+
</div>`,
|
|
801
|
+
,
|
|
802
|
+
];
|
|
803
|
+
})(),
|
|
804
|
+
...(() => {
|
|
805
|
+
if (`${vm.data.content.for_index}` === 'true') {
|
|
806
|
+
return [
|
|
807
|
+
[
|
|
808
|
+
html`<div class="tx_normal my-3">網誌內文</div>`,
|
|
809
|
+
EditorElem.richText({
|
|
810
|
+
gvc: gvc,
|
|
811
|
+
def: vm.data.content.text ?? '',
|
|
812
|
+
callback: (text) => {
|
|
813
|
+
vm.data.content.text = text;
|
|
814
|
+
},
|
|
815
|
+
}),
|
|
816
|
+
].join(BgWidget.mbContainer(12)),
|
|
817
|
+
];
|
|
818
|
+
} else {
|
|
819
|
+
return [];
|
|
820
|
+
}
|
|
821
|
+
})(),
|
|
822
|
+
].join(BgWidget.mbContainer(12));
|
|
823
|
+
})()
|
|
824
|
+
),
|
|
825
|
+
].join('');
|
|
826
|
+
},
|
|
827
|
+
divCreate: {
|
|
828
|
+
style: 'padding: 0;',
|
|
829
|
+
},
|
|
830
|
+
};
|
|
831
|
+
}),
|
|
832
|
+
(() => {
|
|
833
|
+
vm.data.content.relative = vm.data.content.relative || 'collection';
|
|
834
|
+
vm.data.content.relative_data = vm.data.content.relative_data || [];
|
|
835
|
+
vm.data.content.with_discount = vm.data.content.with_discount || 'false';
|
|
836
|
+
|
|
837
|
+
return gvc.bindView(() => {
|
|
838
|
+
const id = gvc.glitter.getUUID();
|
|
839
|
+
return {
|
|
840
|
+
bind: id,
|
|
841
|
+
view: () => {
|
|
842
|
+
// 顯示套用的賣場商品列表
|
|
843
|
+
if (vm.data.content.page_type === 'hidden' || vm.data.content.page_type === 'shopping') {
|
|
844
|
+
return [
|
|
845
|
+
BgWidget.mbContainer(24),
|
|
846
|
+
BgWidget.mainCard(
|
|
847
|
+
[
|
|
848
|
+
BgWidget.title(
|
|
849
|
+
html`預設加入購物車
|
|
850
|
+
<div class="badge ms-2" style="background:#eaeaea;color:#393939;">以下設定的商品會自動加入購物車</div>`,
|
|
851
|
+
'font-size: 16px;'
|
|
852
|
+
),
|
|
853
|
+
html`<div class="my-2"></div>`,
|
|
854
|
+
[
|
|
855
|
+
html`${(() => {
|
|
856
|
+
return gvc.bindView(() => {
|
|
857
|
+
const subVM = {
|
|
858
|
+
id: gvc.glitter.getUUID(),
|
|
859
|
+
loading: true,
|
|
860
|
+
dataList: [] as OptionsItem[],
|
|
861
|
+
};
|
|
862
|
+
return {
|
|
863
|
+
bind: subVM.id,
|
|
864
|
+
view: () => {
|
|
865
|
+
if (subVM.loading) {
|
|
866
|
+
return BgWidget.spinner();
|
|
867
|
+
}
|
|
868
|
+
return html`
|
|
869
|
+
<div class="d-flex flex-column p-2" style="gap: 18px;">
|
|
870
|
+
<div class="d-flex align-items-center gray-bottom-line-18 " style="gap: 24px; justify-content: space-between;">
|
|
871
|
+
<div class="form-check-label c_updown_label">
|
|
872
|
+
<div class="tx_normal">產品列表</div>
|
|
873
|
+
</div>
|
|
874
|
+
${BgWidget.grayButton(
|
|
875
|
+
'搜尋商品',
|
|
1107
876
|
gvc.event(() => {
|
|
1108
|
-
|
|
877
|
+
BgProduct.variantsSelector({
|
|
1109
878
|
gvc: gvc,
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
879
|
+
filter_variants: vm.data.content.relative_data.map((dd: any) => {
|
|
880
|
+
return [dd.product_id].concat(dd.variant.spec).join('-');
|
|
881
|
+
}),
|
|
882
|
+
callback: async (value) => {
|
|
883
|
+
vm.data.content.relative_data = value.map((dd: any) => {
|
|
884
|
+
return {
|
|
885
|
+
variant: dd.variant_content,
|
|
886
|
+
product_id: dd.product_id,
|
|
887
|
+
};
|
|
888
|
+
});
|
|
889
|
+
subVM.loading = true;
|
|
890
|
+
gvc.notifyDataChange(subVM.id);
|
|
1113
891
|
},
|
|
1114
|
-
type: `image/*, video/*`,
|
|
1115
892
|
});
|
|
1116
|
-
})
|
|
893
|
+
}),
|
|
894
|
+
{ textStyle: 'font-weight: 400;' }
|
|
1117
895
|
)}
|
|
1118
|
-
|
|
1119
|
-
|
|
896
|
+
</div>
|
|
897
|
+
${subVM.dataList
|
|
898
|
+
.map((opt: OptionsItem, index) => {
|
|
899
|
+
return html`
|
|
900
|
+
<div class="d-flex align-items-center form-check-label c_updown_label gap-3">
|
|
901
|
+
<span class="tx_normal" style="min-width: 20px;">${index + 1} .</span>
|
|
902
|
+
${BgWidget.validImageBox({ gvc: gvc, image: opt.image, width: 40 })}
|
|
903
|
+
<div class="tx_normal ${opt.note ? 'mb-1' : ''} d-flex flex-column">
|
|
904
|
+
${opt.value} ${opt.note ? html` <div class="tx_gray_12">${opt.note}</div> ` : ''}
|
|
905
|
+
</div>
|
|
906
|
+
<div class="flex-fill"></div>
|
|
907
|
+
${BgWidget.cancel(
|
|
908
|
+
gvc.event(() => {
|
|
909
|
+
vm.data.content.relative_data.splice(index, 1);
|
|
910
|
+
subVM.dataList.splice(index, 1);
|
|
911
|
+
gvc.notifyDataChange(subVM.id);
|
|
912
|
+
}),
|
|
913
|
+
'移除'
|
|
914
|
+
)}
|
|
915
|
+
</div>
|
|
916
|
+
`;
|
|
917
|
+
})
|
|
918
|
+
.join('') || `<div class="w-100 d-flex align-content-center justify-content-center">尚未加入任何賣場商品</div>`}
|
|
919
|
+
</div>
|
|
920
|
+
`;
|
|
921
|
+
},
|
|
922
|
+
onCreate: () => {
|
|
923
|
+
if (subVM.loading) {
|
|
924
|
+
if (vm.data.content.relative_data.length === 0) {
|
|
925
|
+
setTimeout(() => {
|
|
926
|
+
subVM.dataList = [];
|
|
927
|
+
subVM.loading = false;
|
|
928
|
+
gvc.notifyDataChange(subVM.id);
|
|
929
|
+
}, 300);
|
|
930
|
+
} else {
|
|
931
|
+
new Promise<OptionsItem[]>(async (resolve) => {
|
|
932
|
+
const products_data = await BgProduct.getProductOpts(
|
|
933
|
+
vm.data.content.relative_data.map((dd: any) => {
|
|
934
|
+
return dd.product_id;
|
|
935
|
+
})
|
|
936
|
+
);
|
|
937
|
+
vm.data.content.relative_data = vm.data.content.relative_data.filter((dd: any) => {
|
|
938
|
+
return products_data.find((d1) => {
|
|
939
|
+
return `${dd.product_id}` === `${d1.key}`;
|
|
940
|
+
});
|
|
941
|
+
});
|
|
942
|
+
subVM.dataList = vm.data.content.relative_data.map((dd: any) => {
|
|
943
|
+
const product: any = JSON.parse(
|
|
944
|
+
JSON.stringify(
|
|
945
|
+
products_data.find((d1) => {
|
|
946
|
+
return `${dd.product_id}` === `${d1.key}`;
|
|
947
|
+
})
|
|
948
|
+
)
|
|
949
|
+
);
|
|
950
|
+
product.note = dd.variant.spec.join(' / ');
|
|
951
|
+
return product;
|
|
952
|
+
});
|
|
953
|
+
resolve(subVM.dataList);
|
|
954
|
+
}).then((data) => {
|
|
955
|
+
subVM.dataList = data;
|
|
956
|
+
subVM.loading = false;
|
|
957
|
+
gvc.notifyDataChange(subVM.id);
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
};
|
|
963
|
+
});
|
|
964
|
+
})()}`,
|
|
965
|
+
].join(''),
|
|
966
|
+
].join('')
|
|
967
|
+
),
|
|
968
|
+
].join('');
|
|
969
|
+
} else {
|
|
970
|
+
return [].join('');
|
|
971
|
+
}
|
|
972
|
+
},
|
|
973
|
+
};
|
|
974
|
+
});
|
|
975
|
+
})(),
|
|
976
|
+
].join(''),
|
|
977
|
+
ratio: 75,
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
html: BgWidget.summaryCard(
|
|
981
|
+
gvc.bindView(() => {
|
|
982
|
+
console.log(`vm.data.content.template=>`, vm.data.content.template);
|
|
983
|
+
const id = gvc.glitter.getUUID();
|
|
984
|
+
vm.data.status = vm.data.status ?? '1';
|
|
985
|
+
return {
|
|
986
|
+
bind: id,
|
|
987
|
+
view: () => {
|
|
988
|
+
return [
|
|
989
|
+
cf.is_page
|
|
990
|
+
? ``
|
|
991
|
+
: EditorElem.select({
|
|
992
|
+
title: '啟用狀態',
|
|
993
|
+
gvc: gvc,
|
|
994
|
+
def: `${vm.data.status}`,
|
|
995
|
+
array: [
|
|
996
|
+
{
|
|
997
|
+
title: '啟用',
|
|
998
|
+
value: '1',
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
title: '隱藏',
|
|
1002
|
+
value: '0',
|
|
1003
|
+
},
|
|
1004
|
+
],
|
|
1005
|
+
callback: (text: string) => {
|
|
1006
|
+
vm.data.status = text;
|
|
1007
|
+
gvc.notifyDataChange(id);
|
|
1008
|
+
},
|
|
1009
|
+
}),
|
|
1010
|
+
EditorElem.pageSelect(
|
|
1011
|
+
gvc,
|
|
1012
|
+
'選擇佈景主題',
|
|
1013
|
+
vm.data.content.template ?? '',
|
|
1014
|
+
(data) => {
|
|
1015
|
+
vm.data.content.template = data;
|
|
1016
|
+
},
|
|
1017
|
+
(dd) => {
|
|
1018
|
+
const filter_result = dd.group !== 'glitter-article' && dd.page_type === 'article' && dd.page_config.template_type === 'blog';
|
|
1019
|
+
if (filter_result && !vm.data.content.template) {
|
|
1020
|
+
vm.data.content.template = dd.tag;
|
|
1021
|
+
gvc.notifyDataChange(id);
|
|
1022
|
+
}
|
|
1023
|
+
return filter_result;
|
|
1024
|
+
}
|
|
1025
|
+
),
|
|
1026
|
+
EditorElem.editeInput({
|
|
1027
|
+
gvc: gvc,
|
|
1028
|
+
title: '作者名稱',
|
|
1029
|
+
default: vm.data.content.author,
|
|
1030
|
+
placeHolder: '請輸入作者名稱',
|
|
1031
|
+
callback: (text) => {
|
|
1032
|
+
vm.data.content.author = text;
|
|
1033
|
+
},
|
|
1034
|
+
}),
|
|
1035
|
+
gvc.bindView(() => {
|
|
1036
|
+
const id = gvc.glitter.getUUID();
|
|
1037
|
+
return {
|
|
1038
|
+
bind: id,
|
|
1039
|
+
view: () => {
|
|
1040
|
+
if (cf.is_page) {
|
|
1041
|
+
return ``;
|
|
1042
|
+
}
|
|
1043
|
+
vm.data.content.collection = vm.data.content.collection ?? [];
|
|
1044
|
+
return [
|
|
1045
|
+
html` <div class="d-flex align-items-center my-3" style="gap: 10px;">
|
|
1046
|
+
${EditorElem.h3('預覽圖')}
|
|
1047
|
+
${BgWidget.grayButton(
|
|
1048
|
+
'添加檔案',
|
|
1049
|
+
gvc.event(() => {
|
|
1050
|
+
EditorElem.uploadFileFunction({
|
|
1120
1051
|
gvc: gvc,
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1052
|
+
callback: (text) => {
|
|
1053
|
+
vm.data.content.preview_image = text;
|
|
1054
|
+
gvc.notifyDataChange(id);
|
|
1055
|
+
},
|
|
1056
|
+
type: `image/*, video/*`,
|
|
1057
|
+
});
|
|
1058
|
+
})
|
|
1059
|
+
)}
|
|
1060
|
+
</div>`,
|
|
1061
|
+
EditorElem.flexMediaManager({
|
|
1062
|
+
gvc: gvc,
|
|
1063
|
+
data: vm.data.content.preview_image ? [vm.data.content.preview_image] : [],
|
|
1064
|
+
}),
|
|
1065
|
+
(() => {
|
|
1066
|
+
if (cf.is_page) {
|
|
1067
|
+
return ``;
|
|
1068
|
+
}
|
|
1069
|
+
return html`
|
|
1070
|
+
${EditorElem.h3('文章分類')}
|
|
1071
|
+
${gvc.bindView(() => {
|
|
1072
|
+
const tagID = gvc.glitter.getUUID();
|
|
1073
|
+
let listTag: string[] = [];
|
|
1074
|
+
ApiUser.getPublicConfig('blog_collection', 'manager').then((data: any) => {
|
|
1075
|
+
if (data.response.value) {
|
|
1076
|
+
vm.link = data.response.value;
|
|
1135
1077
|
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1078
|
+
function setCheck(link: MenuItem[]) {
|
|
1079
|
+
link.map((dd) => {
|
|
1080
|
+
const it = vm.data.content.collection.find((d1: string) => {
|
|
1081
|
+
return d1 === dd.link;
|
|
1082
|
+
});
|
|
1083
|
+
it && listTag.push(dd.title);
|
|
1084
|
+
setCheck(dd.items);
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1145
1087
|
|
|
1146
|
-
|
|
1088
|
+
setCheck(vm.link);
|
|
1147
1089
|
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
})
|
|
1190
|
-
),
|
|
1191
|
-
undefined,
|
|
1192
|
-
'padding: 0 !important; margin: 0 !important; width: 26.5%;'
|
|
1193
|
-
)}
|
|
1194
|
-
</div>
|
|
1195
|
-
`,
|
|
1196
|
-
undefined,
|
|
1197
|
-
'padding: 0 !important;'
|
|
1090
|
+
gvc.notifyDataChange(tagID);
|
|
1091
|
+
}
|
|
1092
|
+
});
|
|
1093
|
+
return {
|
|
1094
|
+
bind: tagID,
|
|
1095
|
+
view: () => {
|
|
1096
|
+
return listTag
|
|
1097
|
+
.map((dd: any) => {
|
|
1098
|
+
return html` <div class="badge bg_orange mt-2 me-2 fs-sm">${dd}</div>`;
|
|
1099
|
+
})
|
|
1100
|
+
.join('');
|
|
1101
|
+
},
|
|
1102
|
+
divCreate: {
|
|
1103
|
+
class: `d-flex flex-wrap`,
|
|
1104
|
+
},
|
|
1105
|
+
};
|
|
1106
|
+
})}
|
|
1107
|
+
<div
|
|
1108
|
+
class="cursor_pointer bt_c39 ms-2 p-1 mt-3"
|
|
1109
|
+
onclick="${gvc.event(() => {
|
|
1110
|
+
cVm.type = 'collection';
|
|
1111
|
+
gvc.notifyDataChange(cVm.id);
|
|
1112
|
+
})}"
|
|
1113
|
+
>
|
|
1114
|
+
<i class="fa-solid fa-plus me-2" aria-hidden="true"></i>
|
|
1115
|
+
添加與編輯分類
|
|
1116
|
+
</div>
|
|
1117
|
+
`;
|
|
1118
|
+
})(),
|
|
1119
|
+
].join(`<div class="my-2"></div>`);
|
|
1120
|
+
},
|
|
1121
|
+
divCreate: {},
|
|
1122
|
+
};
|
|
1123
|
+
}),
|
|
1124
|
+
].join('');
|
|
1125
|
+
},
|
|
1126
|
+
};
|
|
1127
|
+
})
|
|
1128
|
+
),
|
|
1129
|
+
ratio: 25,
|
|
1130
|
+
}
|
|
1198
1131
|
)}
|
|
1199
1132
|
${BgWidget.mbContainer(240)}
|
|
1200
1133
|
<div class="update-bar-container">
|
|
@@ -1488,13 +1421,13 @@ function setCollection(cf: {
|
|
|
1488
1421
|
check(it, items);
|
|
1489
1422
|
const dialog = new ShareDialog(gvc.glitter);
|
|
1490
1423
|
if (!it.link || !it.title) {
|
|
1491
|
-
dialog.infoMessage({text: '請確實填寫欄位內容'});
|
|
1424
|
+
dialog.infoMessage({ text: '請確實填寫欄位內容' });
|
|
1492
1425
|
return false;
|
|
1493
1426
|
} else if (exists_count) {
|
|
1494
|
-
dialog.infoMessage({text: '此標籤已被使用'});
|
|
1427
|
+
dialog.infoMessage({ text: '此標籤已被使用' });
|
|
1495
1428
|
return false;
|
|
1496
1429
|
} else if (title_exists_count) {
|
|
1497
|
-
dialog.infoMessage({text: '此標題已被使用'});
|
|
1430
|
+
dialog.infoMessage({ text: '此標題已被使用' });
|
|
1498
1431
|
return false;
|
|
1499
1432
|
} else {
|
|
1500
1433
|
return true;
|
|
@@ -1506,327 +1439,309 @@ function setCollection(cf: {
|
|
|
1506
1439
|
return {
|
|
1507
1440
|
bind: vm.id,
|
|
1508
1441
|
view: () => {
|
|
1509
|
-
return html`
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
cf.
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
>
|
|
1520
|
-
<div style="width: 100%;
|
|
1521
|
-
<div
|
|
1442
|
+
return html` <div class="title-container">
|
|
1443
|
+
${BgWidget.goBack(
|
|
1444
|
+
cf.gvc.event(() => {
|
|
1445
|
+
cf.goBack();
|
|
1446
|
+
})
|
|
1447
|
+
)}${BgWidget.title('分類設定')}
|
|
1448
|
+
</div>
|
|
1449
|
+
<div
|
|
1450
|
+
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"
|
|
1451
|
+
>
|
|
1452
|
+
<div style="width: 100%; position: relative">
|
|
1453
|
+
<div style="width: 100%; left: 0px; top: 0px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 20px; display: inline-flex">
|
|
1454
|
+
<div
|
|
1455
|
+
class="w-100 ${getSelectCount({
|
|
1456
|
+
items: vm.link,
|
|
1457
|
+
}) > 0
|
|
1458
|
+
? ``
|
|
1459
|
+
: `d-none`}"
|
|
1460
|
+
style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
|
|
1461
|
+
>
|
|
1462
|
+
<div style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
|
|
1463
|
+
已選取${getSelectCount({
|
|
1464
|
+
items: vm.link,
|
|
1465
|
+
})}項
|
|
1466
|
+
</div>
|
|
1522
1467
|
<div
|
|
1523
|
-
|
|
1524
|
-
items: vm.link,
|
|
1525
|
-
}) > 0
|
|
1526
|
-
? ``
|
|
1527
|
-
: `d-none`}"
|
|
1528
|
-
style="height: 40px; padding: 12px 18px;background: #F7F7F7; border-radius: 10px; justify-content: flex-end; align-items: center; gap: 8px; display: inline-flex"
|
|
1468
|
+
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"
|
|
1529
1469
|
>
|
|
1530
|
-
<div style="flex: 1 1 0; color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">
|
|
1531
|
-
已選取${getSelectCount({
|
|
1532
|
-
items: vm.link,
|
|
1533
|
-
})}項
|
|
1534
|
-
</div>
|
|
1535
|
-
<div
|
|
1536
|
-
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"
|
|
1537
|
-
>
|
|
1538
|
-
<div
|
|
1539
|
-
style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
1540
|
-
onclick="${gvc.event(() => {
|
|
1541
|
-
vm.link = deleteSelect(vm.link);
|
|
1542
|
-
gvc.notifyDataChange(vm.id);
|
|
1543
|
-
})}"
|
|
1544
|
-
>
|
|
1545
|
-
刪除
|
|
1546
|
-
</div>
|
|
1547
|
-
</div>
|
|
1548
|
-
</div>
|
|
1549
|
-
<div class="d-flex align-items-center"
|
|
1550
|
-
style="width: 100%; height: 22px; position: relative;gap:29px;">
|
|
1551
1470
|
<div
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
return !(dd as any).selected;
|
|
1556
|
-
}),
|
|
1557
|
-
})
|
|
1558
|
-
? `fa-solid fa-square-check`
|
|
1559
|
-
: `fa-regular fa-square`}"
|
|
1560
|
-
style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
|
|
1561
|
-
onclick="${cf.gvc.event((e, event) => {
|
|
1562
|
-
event.stopPropagation();
|
|
1563
|
-
|
|
1564
|
-
if (
|
|
1565
|
-
vm.link.find((dd) => {
|
|
1566
|
-
return !(dd as any).selected;
|
|
1567
|
-
})
|
|
1568
|
-
) {
|
|
1569
|
-
selectAll({
|
|
1570
|
-
items: vm.link,
|
|
1571
|
-
} as any);
|
|
1572
|
-
} else {
|
|
1573
|
-
clearAll({
|
|
1574
|
-
items: vm.link,
|
|
1575
|
-
} as any);
|
|
1576
|
-
}
|
|
1471
|
+
style="color: #393939; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word"
|
|
1472
|
+
onclick="${gvc.event(() => {
|
|
1473
|
+
vm.link = deleteSelect(vm.link);
|
|
1577
1474
|
gvc.notifyDataChange(vm.id);
|
|
1578
1475
|
})}"
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
選單名稱
|
|
1476
|
+
>
|
|
1477
|
+
刪除
|
|
1582
1478
|
</div>
|
|
1583
1479
|
</div>
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1480
|
+
</div>
|
|
1481
|
+
<div class="d-flex align-items-center" style="width: 100%; height: 22px; position: relative;gap:29px;">
|
|
1482
|
+
<div
|
|
1483
|
+
class="${allSelect({
|
|
1484
|
+
items: vm.link,
|
|
1485
|
+
selected: !vm.link.find((dd) => {
|
|
1486
|
+
return !(dd as any).selected;
|
|
1487
|
+
}),
|
|
1488
|
+
})
|
|
1489
|
+
? `fa-solid fa-square-check`
|
|
1490
|
+
: `fa-regular fa-square`}"
|
|
1491
|
+
style="color:#393939;width: 16px; height: 16px;cursor: pointer;"
|
|
1492
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1493
|
+
event.stopPropagation();
|
|
1494
|
+
|
|
1495
|
+
if (
|
|
1496
|
+
vm.link.find((dd) => {
|
|
1497
|
+
return !(dd as any).selected;
|
|
1498
|
+
})
|
|
1499
|
+
) {
|
|
1500
|
+
selectAll({
|
|
1501
|
+
items: vm.link,
|
|
1502
|
+
} as any);
|
|
1503
|
+
} else {
|
|
1504
|
+
clearAll({
|
|
1505
|
+
items: vm.link,
|
|
1506
|
+
} as any);
|
|
1507
|
+
}
|
|
1508
|
+
gvc.notifyDataChange(vm.id);
|
|
1509
|
+
})}"
|
|
1510
|
+
></div>
|
|
1511
|
+
<div style="left: 61px; top: 0px; color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 700; word-wrap: break-word">選單名稱</div>
|
|
1512
|
+
</div>
|
|
1513
|
+
<div style="align-self: stretch; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 18px; display: flex">
|
|
1514
|
+
${(() => {
|
|
1515
|
+
function renderItems(array: MenuItem[]): string {
|
|
1516
|
+
const id = gvc.glitter.getUUID();
|
|
1517
|
+
return (
|
|
1518
|
+
gvc.bindView(() => {
|
|
1519
|
+
return {
|
|
1520
|
+
bind: id,
|
|
1521
|
+
view: () => {
|
|
1522
|
+
return array
|
|
1523
|
+
.map((dd, index) => {
|
|
1524
|
+
dd.items;
|
|
1525
|
+
const list = html`
|
|
1526
|
+
<div
|
|
1527
|
+
class=" w-100 "
|
|
1528
|
+
style="width: 100%; justify-content: flex-start; align-items: center; gap: 5px; display: inline-flex;cursor: pointer;"
|
|
1529
|
+
onclick="${cf.gvc.event(() => {
|
|
1530
|
+
if (dd.items && dd.items.length > 0) {
|
|
1531
|
+
(dd as any).toggle = !(dd as any).toggle;
|
|
1532
|
+
gvc.notifyDataChange(vm.id);
|
|
1533
|
+
}
|
|
1534
|
+
})}"
|
|
1535
|
+
>
|
|
1597
1536
|
<div
|
|
1598
|
-
class="
|
|
1599
|
-
style="width:
|
|
1600
|
-
onclick="${cf.gvc.event(() => {
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1537
|
+
class="${allSelect(dd) ? `fa-solid fa-square-check` : `fa-regular fa-square`}"
|
|
1538
|
+
style="color:#393939;width: 16px; height: 16px;"
|
|
1539
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1540
|
+
event.stopPropagation();
|
|
1541
|
+
(dd as any).selected = !(dd as any).selected;
|
|
1542
|
+
if ((dd as any).selected) {
|
|
1543
|
+
selectAll(dd);
|
|
1544
|
+
} else {
|
|
1545
|
+
clearAll(dd);
|
|
1604
1546
|
}
|
|
1547
|
+
gvc.notifyDataChange(vm.id);
|
|
1605
1548
|
})}"
|
|
1606
|
-
>
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
}
|
|
1616
|
-
clearAll(dd);
|
|
1617
|
-
}
|
|
1618
|
-
gvc.notifyDataChange(vm.id);
|
|
1619
|
-
})}"
|
|
1620
|
-
></div>
|
|
1621
|
-
<div class="hoverF2 pe-2"
|
|
1622
|
-
style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
|
|
1623
|
-
<i
|
|
1624
|
-
class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
|
|
1625
|
-
style="cursor: pointer;width:25px;height: 25px;"
|
|
1626
|
-
></i>
|
|
1627
|
-
<div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
|
|
1628
|
-
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1629
|
-
<div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1630
|
-
${dd.title}
|
|
1631
|
-
</div>
|
|
1632
|
-
${dd.items && dd.items.length > 0
|
|
1633
|
-
? !(dd as any).toggle
|
|
1634
|
-
? `<i class="fa-solid fa-angle-down color39"></i>`
|
|
1635
|
-
: `<i class="fa-solid fa-angle-up color39"></i>`
|
|
1636
|
-
: ``}
|
|
1549
|
+
></div>
|
|
1550
|
+
<div class="hoverF2 pe-2" style="width: 100%; justify-content: flex-start; align-items: center; gap: 8px; display: flex">
|
|
1551
|
+
<i
|
|
1552
|
+
class="ms-2 fa-solid fa-grip-dots-vertical color39 dragItem hoverBtn d-flex align-items-center justify-content-center"
|
|
1553
|
+
style="cursor: pointer;width:25px;height: 25px;"
|
|
1554
|
+
></i>
|
|
1555
|
+
<div style="flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px; display: inline-flex">
|
|
1556
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1557
|
+
<div style="color: #393939; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1558
|
+
${dd.title}
|
|
1637
1559
|
</div>
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1560
|
+
${dd.items && dd.items.length > 0
|
|
1561
|
+
? !(dd as any).toggle
|
|
1562
|
+
? `<i class="fa-solid fa-angle-down color39"></i>`
|
|
1563
|
+
: `<i class="fa-solid fa-angle-up color39"></i>`
|
|
1564
|
+
: ``}
|
|
1565
|
+
</div>
|
|
1566
|
+
<div style="justify-content: flex-start; align-items: center; gap: 8px; display: inline-flex">
|
|
1567
|
+
<div
|
|
1568
|
+
style="color: #3366BB; font-size: 14px; font-family: Noto Sans; font-weight: 400; line-height: 14px; word-wrap: break-word"
|
|
1569
|
+
>
|
|
1570
|
+
${dd.title}
|
|
1571
|
+
</div>
|
|
1572
|
+
<div style="color: #159240; font-size: 14px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1573
|
+
${dd.link}
|
|
1647
1574
|
</div>
|
|
1648
1575
|
</div>
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1576
|
+
</div>
|
|
1577
|
+
<div class="flex-fill"></div>
|
|
1578
|
+
<div
|
|
1579
|
+
class="child me-2"
|
|
1580
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1581
|
+
event.stopPropagation();
|
|
1582
|
+
MenusSetting.collectionEvent(
|
|
1583
|
+
{
|
|
1584
|
+
link: '',
|
|
1585
|
+
title: '',
|
|
1586
|
+
items: [],
|
|
1587
|
+
},
|
|
1588
|
+
(data) => {
|
|
1589
|
+
dd.items = dd.items || [];
|
|
1590
|
+
dd.items.push(data);
|
|
1591
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1592
|
+
gvc.notifyDataChange(vm.id);
|
|
1593
|
+
return true;
|
|
1594
|
+
} else {
|
|
1595
|
+
dd.items.splice(dd.items.length - 1, 1);
|
|
1596
|
+
return false;
|
|
1670
1597
|
}
|
|
1671
|
-
);
|
|
1672
|
-
})}"
|
|
1673
|
-
>
|
|
1674
|
-
<i class="fa-solid fa-plus"
|
|
1675
|
-
style="color:#393939;"></i>
|
|
1676
|
-
</div>
|
|
1677
|
-
<div
|
|
1678
|
-
class="child"
|
|
1679
|
-
onclick="${cf.gvc.event((e, event) => {
|
|
1680
|
-
event.stopPropagation();
|
|
1681
|
-
const og = JSON.parse(JSON.stringify(dd));
|
|
1682
|
-
|
|
1683
|
-
MenusSetting.collectionEvent(dd, (data) => {
|
|
1684
|
-
if (checkLinkExists(data, vm.link)) {
|
|
1685
|
-
array[index] = data;
|
|
1686
|
-
gvc.notifyDataChange(vm.id);
|
|
1687
|
-
return true;
|
|
1688
|
-
} else {
|
|
1689
|
-
data.link = og.link;
|
|
1690
|
-
data.title = og.title;
|
|
1691
|
-
return false;
|
|
1692
1598
|
}
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1599
|
+
);
|
|
1600
|
+
})}"
|
|
1601
|
+
>
|
|
1602
|
+
<i class="fa-solid fa-plus" style="color:#393939;"></i>
|
|
1603
|
+
</div>
|
|
1604
|
+
<div
|
|
1605
|
+
class="child"
|
|
1606
|
+
onclick="${cf.gvc.event((e, event) => {
|
|
1607
|
+
event.stopPropagation();
|
|
1608
|
+
const og = JSON.parse(JSON.stringify(dd));
|
|
1609
|
+
|
|
1610
|
+
MenusSetting.collectionEvent(dd, (data) => {
|
|
1611
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1612
|
+
array[index] = data;
|
|
1613
|
+
gvc.notifyDataChange(vm.id);
|
|
1614
|
+
return true;
|
|
1615
|
+
} else {
|
|
1616
|
+
data.link = og.link;
|
|
1617
|
+
data.title = og.title;
|
|
1618
|
+
return false;
|
|
1619
|
+
}
|
|
1620
|
+
});
|
|
1621
|
+
})}"
|
|
1622
|
+
>
|
|
1623
|
+
<i class="fa-solid fa-pencil" style="color:#393939;"></i>
|
|
1699
1624
|
</div>
|
|
1700
1625
|
</div>
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
|
|
1725
|
-
},
|
|
1726
|
-
],
|
|
1727
|
-
() => {
|
|
1626
|
+
</div>
|
|
1627
|
+
${dd.items && dd.items.length > 0
|
|
1628
|
+
? html`
|
|
1629
|
+
<div class=" w-100 ${(dd as any).toggle ? `` : `d-none`}" style="padding-left: 35px;">
|
|
1630
|
+
${renderItems(dd.items as MenuItem[]) as any}
|
|
1631
|
+
</div>
|
|
1632
|
+
`
|
|
1633
|
+
: ``}
|
|
1634
|
+
`;
|
|
1635
|
+
return html` <li class="w-100 ">${list}</li>`;
|
|
1636
|
+
})
|
|
1637
|
+
.join('');
|
|
1638
|
+
},
|
|
1639
|
+
divCreate: {
|
|
1640
|
+
elem: 'ul',
|
|
1641
|
+
class: `w-100 my-2`,
|
|
1642
|
+
style: `display:flex;flex-direction: column;gap:18px;`,
|
|
1643
|
+
},
|
|
1644
|
+
onCreate: () => {
|
|
1645
|
+
gvc.glitter.addMtScript(
|
|
1646
|
+
[
|
|
1647
|
+
{
|
|
1648
|
+
src: `https://raw.githack.com/SortableJS/Sortable/master/Sortable.js`,
|
|
1728
1649
|
},
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1650
|
+
],
|
|
1651
|
+
() => {},
|
|
1652
|
+
() => {}
|
|
1653
|
+
);
|
|
1654
|
+
const interval = setInterval(() => {
|
|
1655
|
+
//@ts-ignore
|
|
1656
|
+
if (window.Sortable) {
|
|
1657
|
+
try {
|
|
1658
|
+
gvc.addStyle(`
|
|
1737
1659
|
ul {
|
|
1738
1660
|
list-style: none;
|
|
1739
1661
|
padding: 0;
|
|
1740
1662
|
}
|
|
1741
1663
|
`);
|
|
1742
1664
|
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1665
|
+
function swapArr(arr: any, index1: number, index2: number) {
|
|
1666
|
+
const data = arr[index1];
|
|
1667
|
+
arr.splice(index1, 1);
|
|
1668
|
+
arr.splice(index2, 0, data);
|
|
1669
|
+
}
|
|
1748
1670
|
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1671
|
+
let startIndex = 0;
|
|
1672
|
+
//@ts-ignore
|
|
1673
|
+
Sortable.create(gvc.getBindViewElem(id).get(0), {
|
|
1674
|
+
group: id,
|
|
1675
|
+
animation: 100,
|
|
1676
|
+
handle: '.dragItem',
|
|
1677
|
+
onChange: function (evt: any) {},
|
|
1678
|
+
onEnd: (evt: any) => {
|
|
1679
|
+
swapArr(array, startIndex, evt.newIndex);
|
|
1680
|
+
gvc.notifyDataChange(id);
|
|
1681
|
+
},
|
|
1682
|
+
onStart: function (evt: any) {
|
|
1683
|
+
startIndex = evt.oldIndex;
|
|
1684
|
+
},
|
|
1685
|
+
});
|
|
1686
|
+
} catch (e) {}
|
|
1687
|
+
clearInterval(interval);
|
|
1688
|
+
}
|
|
1689
|
+
}, 100);
|
|
1690
|
+
},
|
|
1691
|
+
};
|
|
1692
|
+
}) +
|
|
1693
|
+
html` <div
|
|
1694
|
+
class=""
|
|
1695
|
+
style="cursor:pointer;align-self: stretch; height: 50px; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 10px; display: flex"
|
|
1696
|
+
onclick="${cf.gvc.event(() => {
|
|
1697
|
+
MenusSetting.collectionEvent(
|
|
1698
|
+
{
|
|
1699
|
+
link: '',
|
|
1700
|
+
title: '',
|
|
1701
|
+
items: [],
|
|
1702
|
+
},
|
|
1703
|
+
(data) => {
|
|
1704
|
+
array.push(data);
|
|
1705
|
+
if (checkLinkExists(data, vm.link)) {
|
|
1706
|
+
gvc.notifyDataChange(vm.id);
|
|
1707
|
+
return true;
|
|
1708
|
+
} else {
|
|
1709
|
+
array.splice(array.length - 1, 1);
|
|
1710
|
+
return false;
|
|
1766
1711
|
}
|
|
1767
|
-
clearInterval(interval);
|
|
1768
1712
|
}
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
title: '',
|
|
1782
|
-
items: [],
|
|
1783
|
-
},
|
|
1784
|
-
(data) => {
|
|
1785
|
-
array.push(data);
|
|
1786
|
-
if (checkLinkExists(data, vm.link)) {
|
|
1787
|
-
gvc.notifyDataChange(vm.id);
|
|
1788
|
-
return true;
|
|
1789
|
-
} else {
|
|
1790
|
-
array.splice(array.length - 1, 1);
|
|
1791
|
-
return false;
|
|
1792
|
-
}
|
|
1793
|
-
}
|
|
1794
|
-
);
|
|
1795
|
-
})}"
|
|
1796
|
-
>
|
|
1797
|
-
<div
|
|
1798
|
-
style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
|
|
1799
|
-
>
|
|
1800
|
-
<i class="fa-solid fa-plus"
|
|
1801
|
-
style="color: #3366BB;font-size: 16px; "></i>
|
|
1802
|
-
<div style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
1803
|
-
新增選單
|
|
1804
|
-
</div>
|
|
1805
|
-
</div>
|
|
1806
|
-
</div>`
|
|
1807
|
-
);
|
|
1808
|
-
}
|
|
1713
|
+
);
|
|
1714
|
+
})}"
|
|
1715
|
+
>
|
|
1716
|
+
<div
|
|
1717
|
+
style="align-self: stretch; height: 54px; border-radius: 10px; border: 1px #DDDDDD solid; justify-content: center; align-items: center; gap: 6px; display: inline-flex"
|
|
1718
|
+
>
|
|
1719
|
+
<i class="fa-solid fa-plus" style="color: #3366BB;font-size: 16px; "></i>
|
|
1720
|
+
<div style="color: #3366BB; font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">新增選單</div>
|
|
1721
|
+
</div>
|
|
1722
|
+
</div>`
|
|
1723
|
+
);
|
|
1724
|
+
}
|
|
1809
1725
|
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
</div>
|
|
1726
|
+
return renderItems(vm.link);
|
|
1727
|
+
})()}
|
|
1813
1728
|
</div>
|
|
1814
1729
|
</div>
|
|
1815
1730
|
</div>
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1731
|
+
</div>
|
|
1732
|
+
<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;">
|
|
1733
|
+
${BgWidget.cancel(
|
|
1734
|
+
gvc.event(() => {
|
|
1735
|
+
cf.goBack();
|
|
1736
|
+
})
|
|
1737
|
+
)}
|
|
1738
|
+
${BgWidget.save(
|
|
1739
|
+
gvc.event(() => {
|
|
1740
|
+
save();
|
|
1741
|
+
}),
|
|
1742
|
+
'確認'
|
|
1743
|
+
)}
|
|
1744
|
+
</div>`;
|
|
1830
1745
|
},
|
|
1831
1746
|
divCreate: {
|
|
1832
1747
|
style: `padding-bottom:60px;`,
|
|
@@ -1858,4 +1773,4 @@ function template_select(gvc: GVC, cf: any, vm: any, cVm: any, page_type: any) {
|
|
|
1858
1773
|
);
|
|
1859
1774
|
}
|
|
1860
1775
|
|
|
1861
|
-
(window as any).glitter.setModule(import.meta.url, BgBlog);
|
|
1776
|
+
(window as any).glitter.setModule(import.meta.url, BgBlog);
|