ts-glitter 22.5.6 → 22.5.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.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-product.js +13 -13
- package/lowcode/backend-manager/bg-product.ts +13 -13
- package/lowcode/backend-manager/bg-shopping.js +8 -13
- package/lowcode/backend-manager/bg-shopping.ts +8 -15
- package/lowcode/backend-manager/bg-widget.js +62 -49
- package/lowcode/backend-manager/bg-widget.ts +129 -93
- package/lowcode/cms-plugin/POS-setting.js +30 -9
- package/lowcode/cms-plugin/POS-setting.ts +49 -16
- package/lowcode/cms-plugin/cms-router.js +27 -21
- package/lowcode/cms-plugin/cms-router.ts +116 -101
- package/lowcode/cms-plugin/filter-options.js +25 -17
- package/lowcode/cms-plugin/filter-options.ts +27 -17
- package/lowcode/cms-plugin/module/product-excel.js +2 -0
- package/lowcode/cms-plugin/module/product-excel.ts +2 -0
- package/lowcode/cms-plugin/module/product-setting.js +13 -12
- package/lowcode/cms-plugin/module/product-setting.ts +26 -23
- package/lowcode/cms-plugin/order/order-module.js +91 -68
- package/lowcode/cms-plugin/order/order-module.ts +105 -73
- package/lowcode/cms-plugin/pos-checkout-setting.js +46 -39
- package/lowcode/cms-plugin/pos-checkout-setting.ts +237 -227
- package/lowcode/cms-plugin/pos-config-setting.js +25 -23
- package/lowcode/cms-plugin/pos-config-setting.ts +35 -32
- package/lowcode/cms-plugin/pos-pages/payment-function.js +253 -139
- package/lowcode/cms-plugin/pos-pages/payment-function.ts +405 -279
- package/lowcode/cms-plugin/pos-pages/payment-page.js +348 -267
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +378 -296
- package/lowcode/cms-plugin/pos-pages/pos-function.js +76 -19
- package/lowcode/cms-plugin/pos-pages/pos-function.ts +84 -19
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -2
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -2
- package/lowcode/cms-plugin/shopping-finance-setting.js +1590 -1701
- package/lowcode/cms-plugin/shopping-finance-setting.ts +1967 -2011
- package/lowcode/cms-plugin/shopping-order-manager.js +74 -62
- package/lowcode/cms-plugin/shopping-order-manager.ts +119 -85
- package/lowcode/cms-plugin/shopping-product-text.js +874 -531
- package/lowcode/cms-plugin/shopping-product-text.ts +1656 -1305
- package/lowcode/cms-plugin/shopping-setting-basic.js +152 -124
- package/lowcode/cms-plugin/shopping-setting-basic.ts +315 -247
- package/lowcode/css/editor.css +3 -2
- package/lowcode/glitter-base/global/language.js +5 -3
- package/lowcode/glitter-base/global/language.ts +8 -6
- package/lowcode/glitter-base/global/payment-config.js +6 -0
- package/lowcode/glitter-base/global/payment-config.ts +6 -3
- package/lowcode/public-components/product/pd-class.js +1 -3
- package/lowcode/public-components/product/pd-class.ts +1 -3
- package/lowcode/public-components/user-manager/um-order.js +2 -1
- package/lowcode/public-components/user-manager/um-order.ts +2 -1
- package/package.json +1 -1
- package/src/api-public/controllers/index.js +14 -1
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/index.ts +16 -1
- package/src/api-public/controllers/shop.js +14 -7
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +14 -8
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/ezpay/tool.d.ts +0 -1
- package/src/api-public/services/financial-serviceV2.js +7 -17
- package/src/api-public/services/financial-serviceV2.js.map +1 -1
- package/src/api-public/services/shopee.js.map +1 -1
- package/src/api-public/services/updated-table-checked.js +20 -0
- package/src/api-public/services/updated-table-checked.js.map +1 -1
- package/src/api-public/services/updated-table-checked.ts +21 -0
- package/src/app-project/serverless/src/modules/database.d.ts +1 -1
- package/src/app-project/serverless/src/modules/redis.d.ts +1 -1
- package/src/helper/glitter-util.d.ts +0 -1
- package/src/index.js +3 -3
- package/src/index.js.map +13 -1
- package/src/modules/database.js +5 -1
- package/src/modules/database.js.map +1 -1
- package/src/modules/database.ts +5 -1
- package/src/modules/tool.d.ts +2 -0
- package/src/modules/tool.js +7 -0
- package/src/modules/tool.js.map +1 -1
- package/src/modules/tool.ts +7 -0
- package/src/seo-config.js +3 -3
- package/src/seo-config.js.map +9 -1
- package/src/services/private_config.js +11 -0
- package/src/services/private_config.js.map +1 -1
- package/src/services/private_config.ts +11 -0
- package/src/services/saas-table-check.js +12 -0
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/saas-table-check.ts +12 -0
- package/src/services/ses.js +3 -4
- package/src/services/ses.js.map +1 -1
|
@@ -5,6 +5,7 @@ import { Tool } from '../modules/tool.js';
|
|
|
5
5
|
import { ApiUser } from '../glitter-base/route/user.js';
|
|
6
6
|
import { CheckInput } from '../modules/checkInput.js';
|
|
7
7
|
const html = String.raw;
|
|
8
|
+
const css = String.raw;
|
|
8
9
|
export class ProductText {
|
|
9
10
|
static main(gvc) {
|
|
10
11
|
const glitter = gvc.glitter;
|
|
@@ -17,6 +18,7 @@ export class ProductText {
|
|
|
17
18
|
data: {
|
|
18
19
|
content: '',
|
|
19
20
|
tags: [],
|
|
21
|
+
text_size: '10',
|
|
20
22
|
},
|
|
21
23
|
status: false,
|
|
22
24
|
updated_time: '',
|
|
@@ -88,33 +90,33 @@ export class ProductText {
|
|
|
88
90
|
function getHtml() {
|
|
89
91
|
return BgWidget.mainCard([
|
|
90
92
|
html ` <div class="d-flex align-items-center gap-2 ms-1 mb-3">
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
<div class="tx_700">商品促銷標籤</div>
|
|
94
|
+
${BgWidget.questionButton(gvc.event(() => {
|
|
93
95
|
BgWidget.quesDialog({
|
|
94
96
|
gvc,
|
|
95
97
|
innerHTML: () => {
|
|
96
98
|
return html `
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
<div
|
|
100
|
+
style="width:100%;border-radius: 10px;background: #393939;display: flex;padding: 10px;flex-direction: column;justify-content: center;align-items: flex-start;gap: 16px;"
|
|
101
|
+
>
|
|
102
|
+
<div class="tx_normal text-wrap text-white">
|
|
103
|
+
顯示於商品卡片上方,用於突出推廣特定商品,例如「熱賣中」、「特價」等,以便消費者快速識別商品狀態,提升購物吸引力。
|
|
104
|
+
</div>
|
|
105
|
+
<div class="w-100" style="width: 182.681px;height: 225.135px;flex-shrink: 0;">
|
|
106
|
+
<img
|
|
107
|
+
style="width: 182.681px;height: 225.135px;flex-shrink: 0;"
|
|
108
|
+
src="https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/size1440_s*px$_s4s0sbs5s5sbs6se_messageImage_1730260643019.jpg"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
`;
|
|
111
113
|
},
|
|
112
114
|
});
|
|
113
115
|
}))}
|
|
114
|
-
|
|
116
|
+
</div>`,
|
|
115
117
|
BgWidget.tableV3({
|
|
116
118
|
gvc: gvc,
|
|
117
|
-
getData:
|
|
119
|
+
getData: vmi => {
|
|
118
120
|
ApiUser.getPublicConfig('promo-label', 'manager').then((data) => {
|
|
119
121
|
vm.labelList = (() => {
|
|
120
122
|
return !data.response.value.length ? [] : data.response.value;
|
|
@@ -132,10 +134,10 @@ export class ProductText {
|
|
|
132
134
|
filter: [
|
|
133
135
|
{
|
|
134
136
|
name: '批量刪除',
|
|
135
|
-
event:
|
|
137
|
+
event: checkedData => {
|
|
136
138
|
dialog.checkYesOrNot({
|
|
137
|
-
text: '
|
|
138
|
-
callback:
|
|
139
|
+
text: '確認要刪除已勾選的促銷標籤?',
|
|
140
|
+
callback: bool => {
|
|
139
141
|
if (bool) {
|
|
140
142
|
vm.labelList = vm.labelList.filter((item) => {
|
|
141
143
|
return checkedData.findIndex((d) => d.id === item.id) === -1;
|
|
@@ -144,7 +146,7 @@ export class ProductText {
|
|
|
144
146
|
key: 'promo-label',
|
|
145
147
|
user_id: 'manager',
|
|
146
148
|
value: vm.labelList,
|
|
147
|
-
}).then(
|
|
149
|
+
}).then(result => {
|
|
148
150
|
if (!result.response.result) {
|
|
149
151
|
dialog.errorMessage({ text: '設定失敗' });
|
|
150
152
|
}
|
|
@@ -159,45 +161,47 @@ export class ProductText {
|
|
|
159
161
|
hiddenPageSplit: true,
|
|
160
162
|
}),
|
|
161
163
|
html ` <div
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
class="w-100 d-flex justify-content-center align-items-center gap-2 cursor_pointer"
|
|
165
|
+
style="color: #3366BB"
|
|
166
|
+
onclick="${gvc.event(() => {
|
|
165
167
|
vm.data = getExample();
|
|
166
168
|
vm.type = 'label_edit';
|
|
167
169
|
})}"
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
>
|
|
171
|
+
<div style="font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
172
|
+
新增一個標籤
|
|
173
|
+
</div>
|
|
174
|
+
<i class="fa-solid fa-plus"></i>
|
|
175
|
+
</div>`,
|
|
172
176
|
].join(''));
|
|
173
177
|
}
|
|
174
178
|
return BgWidget.container([
|
|
175
179
|
BgWidget.mainCard([
|
|
176
180
|
html ` <div class="d-flex align-items-center gap-2 ms-1 mb-3">
|
|
177
|
-
|
|
178
|
-
|
|
181
|
+
<div class="tx_700">商品文本</div>
|
|
182
|
+
${BgWidget.questionButton(gvc.event(() => {
|
|
179
183
|
BgWidget.quesDialog({
|
|
180
184
|
gvc,
|
|
181
185
|
innerHTML: () => {
|
|
182
186
|
return html `
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
187
|
+
<div
|
|
188
|
+
style="display: flex;padding: 20px;flex-direction: column;justify-content: center;align-items: flex-start;gap: 16px;border-radius: 10px;background: #393939;"
|
|
189
|
+
>
|
|
190
|
+
<div class="tx_normal text-wrap text-white">
|
|
191
|
+
可在商品頁面展示多個自訂文本分頁,如商品規格、退換貨政策等,並能自由選擇每個文本的顯示內容是否統一,提升管理靈活性。
|
|
192
|
+
</div>
|
|
193
|
+
<div class="w-100 border border-1">
|
|
194
|
+
<img src="https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/s348251.png" />
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
`;
|
|
194
198
|
},
|
|
195
199
|
});
|
|
196
200
|
}))}
|
|
197
|
-
|
|
201
|
+
</div>`,
|
|
198
202
|
BgWidget.tableV3({
|
|
199
203
|
gvc: gvc,
|
|
200
|
-
getData:
|
|
204
|
+
getData: vmi => {
|
|
201
205
|
ApiUser.getPublicConfig('text-manager', 'manager').then((data) => {
|
|
202
206
|
vm.dataList = (() => {
|
|
203
207
|
return !data.response.value.length ? [] : data.response.value;
|
|
@@ -215,10 +219,10 @@ export class ProductText {
|
|
|
215
219
|
filter: [
|
|
216
220
|
{
|
|
217
221
|
name: '批量刪除',
|
|
218
|
-
event:
|
|
222
|
+
event: checkedData => {
|
|
219
223
|
dialog.checkYesOrNot({
|
|
220
224
|
text: '確認要刪除已勾選的文本?',
|
|
221
|
-
callback:
|
|
225
|
+
callback: bool => {
|
|
222
226
|
if (bool) {
|
|
223
227
|
vm.dataList = vm.dataList.filter((item) => {
|
|
224
228
|
return checkedData.findIndex((d) => d.id === item.id) === -1;
|
|
@@ -227,7 +231,7 @@ export class ProductText {
|
|
|
227
231
|
key: 'text-manager',
|
|
228
232
|
user_id: 'manager',
|
|
229
233
|
value: vm.dataList,
|
|
230
|
-
}).then(
|
|
234
|
+
}).then(result => {
|
|
231
235
|
if (!result.response.result) {
|
|
232
236
|
dialog.errorMessage({ text: '設定失敗' });
|
|
233
237
|
}
|
|
@@ -242,16 +246,18 @@ export class ProductText {
|
|
|
242
246
|
hiddenPageSplit: true,
|
|
243
247
|
}),
|
|
244
248
|
html ` <div
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
249
|
+
class="w-100 d-flex justify-content-center align-items-center gap-2 cursor_pointer"
|
|
250
|
+
style="color: #3366BB"
|
|
251
|
+
onclick="${gvc.event(() => {
|
|
248
252
|
vm.data = getExample();
|
|
249
253
|
vm.type = 'text_edit';
|
|
250
254
|
})}"
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
>
|
|
256
|
+
<div style="font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
257
|
+
新增一個文本
|
|
258
|
+
</div>
|
|
259
|
+
<i class="fa-solid fa-plus"></i>
|
|
260
|
+
</div>`,
|
|
255
261
|
].join('')),
|
|
256
262
|
html ` <div style="margin-top: 15px;"></div>`,
|
|
257
263
|
getHtml(),
|
|
@@ -287,60 +293,62 @@ export class ProductText {
|
|
|
287
293
|
BgWidget.dialog({
|
|
288
294
|
gvc,
|
|
289
295
|
title: '編輯標籤',
|
|
290
|
-
innerHTML:
|
|
291
|
-
return html
|
|
292
|
-
|
|
293
|
-
html
|
|
296
|
+
innerHTML: gvc => {
|
|
297
|
+
return html ` <div>
|
|
298
|
+
${[
|
|
299
|
+
html ` <div class="tx_normal">標籤名稱</div>`,
|
|
294
300
|
BgWidget.editeInput({
|
|
295
301
|
gvc,
|
|
296
302
|
title: '',
|
|
297
303
|
default: item.title,
|
|
298
304
|
placeHolder: '',
|
|
299
|
-
callback:
|
|
305
|
+
callback: text => {
|
|
300
306
|
item.title = text;
|
|
301
307
|
},
|
|
302
308
|
}),
|
|
303
|
-
html
|
|
309
|
+
html ` <div class="tx_normal mt-2">字體大小</div>`,
|
|
304
310
|
BgWidget.editeInput({
|
|
305
311
|
gvc,
|
|
306
312
|
title: '',
|
|
307
313
|
default: item.font_size,
|
|
308
314
|
type: 'number',
|
|
309
315
|
placeHolder: '',
|
|
310
|
-
callback:
|
|
316
|
+
callback: text => {
|
|
311
317
|
item.font_size = text;
|
|
312
318
|
},
|
|
313
319
|
}),
|
|
314
|
-
html
|
|
320
|
+
html ` <div class="tx_normal mt-2">字體顏色</div>`,
|
|
315
321
|
EditorElem.colorSelect({
|
|
316
322
|
gvc: gvc,
|
|
317
323
|
title: '',
|
|
318
|
-
callback:
|
|
324
|
+
callback: text => {
|
|
319
325
|
item.font_color = text;
|
|
320
326
|
gvc.recreateView();
|
|
321
327
|
},
|
|
322
328
|
def: item.font_color,
|
|
323
329
|
}),
|
|
324
|
-
html
|
|
330
|
+
html ` <div class="tx_normal mt-2">背景顏色</div>`,
|
|
325
331
|
EditorElem.colorSelect({
|
|
326
332
|
gvc: gvc,
|
|
327
333
|
title: '',
|
|
328
|
-
callback:
|
|
334
|
+
callback: text => {
|
|
329
335
|
item.font_bgr = text;
|
|
330
336
|
gvc.recreateView();
|
|
331
337
|
},
|
|
332
338
|
def: item.font_bgr,
|
|
333
339
|
}),
|
|
334
340
|
].join('')}
|
|
335
|
-
|
|
341
|
+
</div>`;
|
|
336
342
|
},
|
|
337
343
|
save: {
|
|
338
344
|
event: () => {
|
|
339
|
-
return new Promise(
|
|
340
|
-
const sameTitleItem = vm.data.data.tags.findIndex(
|
|
345
|
+
return new Promise(resolve => {
|
|
346
|
+
const sameTitleItem = vm.data.data.tags.findIndex(tag => tag.title === item.title);
|
|
341
347
|
if (sameTitleItem !== index && sameTitleItem !== -1) {
|
|
342
348
|
dialog.errorMessage({
|
|
343
|
-
text: html
|
|
349
|
+
text: html ` <div class="text-center">
|
|
350
|
+
標籤名稱「${item.title}」已存在<br />請更換一個標籤名稱
|
|
351
|
+
</div>`,
|
|
344
352
|
});
|
|
345
353
|
resolve(false);
|
|
346
354
|
}
|
|
@@ -352,13 +360,13 @@ export class ProductText {
|
|
|
352
360
|
},
|
|
353
361
|
},
|
|
354
362
|
cancel: {
|
|
355
|
-
event: () => new Promise(
|
|
363
|
+
event: () => new Promise(resolve => {
|
|
356
364
|
item.title = originText;
|
|
357
365
|
gvc.notifyDataChange(ids.tag);
|
|
358
366
|
resolve(true);
|
|
359
367
|
}),
|
|
360
368
|
},
|
|
361
|
-
xmark: () => new Promise(
|
|
369
|
+
xmark: () => new Promise(resolve => {
|
|
362
370
|
item.title = originText;
|
|
363
371
|
gvc.notifyDataChange(ids.tag);
|
|
364
372
|
resolve(true);
|
|
@@ -368,49 +376,48 @@ export class ProductText {
|
|
|
368
376
|
if (vm.type === 'text_edit') {
|
|
369
377
|
return BgWidget.container([
|
|
370
378
|
html ` <div class="title-container">
|
|
371
|
-
|
|
379
|
+
${BgWidget.goBack(gvc.event(() => {
|
|
372
380
|
vm.type = 'list';
|
|
373
381
|
}))}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
382
|
+
${BgWidget.title(vm.data.title || '新增文本')}
|
|
383
|
+
<div class="flex-fill"></div>
|
|
384
|
+
</div>`,
|
|
377
385
|
BgWidget.container([
|
|
378
386
|
BgWidget.mainCard(BgWidget.editeInput({
|
|
379
387
|
gvc: gvc,
|
|
380
388
|
title: '文本標題',
|
|
381
389
|
default: vm.data.title,
|
|
382
390
|
placeHolder: '請輸入文本標題',
|
|
383
|
-
callback:
|
|
391
|
+
callback: text => {
|
|
384
392
|
vm.data.title = text;
|
|
385
393
|
},
|
|
386
394
|
})),
|
|
387
395
|
BgWidget.container1x2({
|
|
388
|
-
html: BgWidget.mainCard(html
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
+
html: BgWidget.mainCard(html ` <div>
|
|
397
|
+
<div class="title-container px-0">
|
|
398
|
+
<div class="tx_normal fw-normal">文本說明</div>
|
|
399
|
+
<div class="flex-fill"></div>
|
|
400
|
+
${BgWidget.aiChatButton({ gvc, select: 'writer' })}
|
|
401
|
+
</div>
|
|
402
|
+
<div style="margin: 8px 0">
|
|
403
|
+
${gvc.bindView((() => {
|
|
396
404
|
return {
|
|
397
405
|
bind: ids.content,
|
|
398
406
|
view: () => {
|
|
399
407
|
return BgWidget.richTextEditor({
|
|
400
408
|
gvc: gvc,
|
|
401
409
|
content: generateRichtext(vm.data.data.content) || '',
|
|
402
|
-
callback:
|
|
410
|
+
callback: content => {
|
|
403
411
|
vm.data.data.content = originRichtext(content);
|
|
404
412
|
},
|
|
405
|
-
title: '顯示文本編輯'
|
|
413
|
+
title: '顯示文本編輯',
|
|
406
414
|
});
|
|
407
415
|
},
|
|
408
|
-
onCreate: () => {
|
|
409
|
-
},
|
|
416
|
+
onCreate: () => { },
|
|
410
417
|
};
|
|
411
418
|
})())}
|
|
412
|
-
|
|
413
|
-
|
|
419
|
+
</div>
|
|
420
|
+
</div>`),
|
|
414
421
|
ratio: 70,
|
|
415
422
|
}, {
|
|
416
423
|
html: gvc.bindView((() => {
|
|
@@ -419,18 +426,20 @@ export class ProductText {
|
|
|
419
426
|
view: () => {
|
|
420
427
|
var _a;
|
|
421
428
|
vm.data.data.tags = (_a = vm.data.data.tags) !== null && _a !== void 0 ? _a : [];
|
|
422
|
-
return BgWidget.mainCard(html
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
return html ` <div
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
429
|
+
return BgWidget.mainCard(html ` <div>
|
|
430
|
+
<div class="title-container px-0">
|
|
431
|
+
<div class="tx_normal fw-normal">標籤</div>
|
|
432
|
+
</div>
|
|
433
|
+
<div style="margin: 12px 0">
|
|
434
|
+
${gvc.map(vm.data.data.tags.map((item, index) => {
|
|
435
|
+
return html ` <div
|
|
436
|
+
style="display: flex; align-items: center; justify-content: space-between; margin-top: 8px;"
|
|
437
|
+
>
|
|
438
|
+
${item.title}
|
|
439
|
+
<div class="d-flex gap-3">
|
|
440
|
+
<i
|
|
441
|
+
class="fa-regular fa-copy cursor_pointer"
|
|
442
|
+
onclick="${gvc.event(() => {
|
|
434
443
|
navigator.clipboard.writeText(targetText(item.title));
|
|
435
444
|
BgWidget.jumpAlert({
|
|
436
445
|
gvc,
|
|
@@ -439,22 +448,22 @@ export class ProductText {
|
|
|
439
448
|
align: 'center',
|
|
440
449
|
});
|
|
441
450
|
})}"
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
451
|
+
></i>
|
|
452
|
+
<i
|
|
453
|
+
class="fa-solid fa-pencil cursor_pointer"
|
|
454
|
+
onclick="${gvc.event(() => {
|
|
446
455
|
editDocumentTag(index);
|
|
447
456
|
})}"
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
457
|
+
></i>
|
|
458
|
+
<i
|
|
459
|
+
class="fa-regular fa-trash cursor_pointer"
|
|
460
|
+
onclick="${gvc.event(() => {
|
|
452
461
|
if (vm.data.data.content.includes(`@{{${item.key}}}`)) {
|
|
453
462
|
dialog.warningMessage({
|
|
454
|
-
callback:
|
|
463
|
+
callback: bool => {
|
|
455
464
|
if (bool) {
|
|
456
465
|
const regex = new RegExp(`@{{${item.key}}}`, 'g');
|
|
457
|
-
vm.data.data.tags = vm.data.data.tags.filter(
|
|
466
|
+
vm.data.data.tags = vm.data.data.tags.filter(tag => tag.key !== item.key);
|
|
458
467
|
vm.data.data.content = vm.data.data.content.replace(regex, '');
|
|
459
468
|
gvc.notifyDataChange([ids.tag, ids.content]);
|
|
460
469
|
}
|
|
@@ -463,16 +472,16 @@ export class ProductText {
|
|
|
463
472
|
});
|
|
464
473
|
}
|
|
465
474
|
else {
|
|
466
|
-
vm.data.data.tags = vm.data.data.tags.filter(
|
|
475
|
+
vm.data.data.tags = vm.data.data.tags.filter(tag => tag.key !== item.key);
|
|
467
476
|
gvc.notifyDataChange([ids.tag, ids.content]);
|
|
468
477
|
}
|
|
469
478
|
})}"
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
479
|
+
></i>
|
|
480
|
+
</div>
|
|
481
|
+
</div>`;
|
|
473
482
|
}))}
|
|
474
|
-
|
|
475
|
-
|
|
483
|
+
</div>
|
|
484
|
+
${BgWidget.plusButton({
|
|
476
485
|
title: '新增一個標籤',
|
|
477
486
|
event: gvc.event(() => {
|
|
478
487
|
const limit = 30;
|
|
@@ -485,12 +494,12 @@ export class ProductText {
|
|
|
485
494
|
}
|
|
486
495
|
function getNextLabel() {
|
|
487
496
|
const existingLabels = vm.data.data.tags.slice();
|
|
488
|
-
const labels = existingLabels.map(
|
|
497
|
+
const labels = existingLabels.map(label => label.title);
|
|
489
498
|
const numbers = Array.from({ length: limit }, (_, i) => {
|
|
490
499
|
return (i + 1).toString().padStart(2, '0');
|
|
491
500
|
});
|
|
492
501
|
for (const n of numbers) {
|
|
493
|
-
const label = labels.find(
|
|
502
|
+
const label = labels.find(label => label === `${defaultLabel}${n}`);
|
|
494
503
|
if (!label)
|
|
495
504
|
return `${defaultLabel}${n}`;
|
|
496
505
|
}
|
|
@@ -507,7 +516,7 @@ export class ProductText {
|
|
|
507
516
|
editDocumentTag(vm.data.data.tags.length - 1);
|
|
508
517
|
}),
|
|
509
518
|
})}
|
|
510
|
-
|
|
519
|
+
</div>`);
|
|
511
520
|
},
|
|
512
521
|
};
|
|
513
522
|
})()),
|
|
@@ -516,19 +525,19 @@ export class ProductText {
|
|
|
516
525
|
].join(BgWidget.mbContainer(12))),
|
|
517
526
|
BgWidget.mbContainer(240),
|
|
518
527
|
html ` <div class="update-bar-container">
|
|
519
|
-
|
|
528
|
+
${vm.data.id.length === 0
|
|
520
529
|
? ''
|
|
521
530
|
: BgWidget.danger(gvc.event(() => {
|
|
522
531
|
dialog.checkYesOrNot({
|
|
523
532
|
text: '確認要刪除此文本?',
|
|
524
|
-
callback:
|
|
533
|
+
callback: bool => {
|
|
525
534
|
if (bool) {
|
|
526
535
|
vm.dataList = vm.dataList.filter((item) => vm.data.id !== item.id);
|
|
527
536
|
ApiUser.setPublicConfig({
|
|
528
537
|
key: 'text-manager',
|
|
529
538
|
user_id: 'manager',
|
|
530
539
|
value: vm.dataList,
|
|
531
|
-
}).then(
|
|
540
|
+
}).then(result => {
|
|
532
541
|
if (!result.response.result) {
|
|
533
542
|
dialog.errorMessage({ text: '設定失敗' });
|
|
534
543
|
}
|
|
@@ -538,10 +547,10 @@ export class ProductText {
|
|
|
538
547
|
},
|
|
539
548
|
});
|
|
540
549
|
}))}
|
|
541
|
-
|
|
550
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
542
551
|
vm.type = 'list';
|
|
543
552
|
}))}
|
|
544
|
-
|
|
553
|
+
${BgWidget.save(gvc.event(() => {
|
|
545
554
|
try {
|
|
546
555
|
if (CheckInput.isEmpty(vm.data.title)) {
|
|
547
556
|
dialog.errorMessage({ text: '請輸入文本標題' });
|
|
@@ -568,7 +577,7 @@ export class ProductText {
|
|
|
568
577
|
key: 'text-manager',
|
|
569
578
|
user_id: 'manager',
|
|
570
579
|
value: vm.dataList,
|
|
571
|
-
}).then(
|
|
580
|
+
}).then(result => {
|
|
572
581
|
dialog.dataLoading({ visible: false });
|
|
573
582
|
if (result.response.result) {
|
|
574
583
|
dialog.successMessage({ text: '設定成功' });
|
|
@@ -587,7 +596,7 @@ export class ProductText {
|
|
|
587
596
|
``;
|
|
588
597
|
}
|
|
589
598
|
}))}
|
|
590
|
-
|
|
599
|
+
</div>`,
|
|
591
600
|
].join(''));
|
|
592
601
|
}
|
|
593
602
|
if (vm.type === 'label_edit') {
|
|
@@ -601,27 +610,31 @@ export class ProductText {
|
|
|
601
610
|
vm.data.data['label_color'] = (_a = vm.data.data['label_color']) !== null && _a !== void 0 ? _a : '#393939';
|
|
602
611
|
vm.data.data['text_color'] = (_b = vm.data.data['text_color']) !== null && _b !== void 0 ? _b : '#FFFFFF';
|
|
603
612
|
return html `
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
613
|
+
<div style="font-size: 16px;font-style: normal;font-weight: 400;color:#393939;">${title}</div>
|
|
614
|
+
<div
|
|
615
|
+
class="d-flex "
|
|
616
|
+
style="padding: 12px 10px;gap: 10px;cursor: pointer;border-radius: 7px;border: 1px solid #DDD;"
|
|
617
|
+
onclick="${gvc.event(() => {
|
|
609
618
|
document.querySelector(`.${inputClass}`).click();
|
|
610
619
|
})}"
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
620
|
+
>
|
|
621
|
+
<input
|
|
622
|
+
class="d-none ${inputClass}"
|
|
623
|
+
value="${vm.data.data[key]}"
|
|
624
|
+
type="color"
|
|
625
|
+
onchange="${gvc.event(e => {
|
|
617
626
|
vm.data.data[key] = e.value;
|
|
618
627
|
gvc.notifyDataChange([id, 'drawPreview']);
|
|
619
628
|
})}"
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
629
|
+
/>
|
|
630
|
+
<div
|
|
631
|
+
style="width: 24px;height: 24px;flex-shrink: 0;border-radius: 3px;background: ${(_c = vm.data.data[key]) !== null && _c !== void 0 ? _c : '#393939'};border: 1px solid #393939;"
|
|
632
|
+
></div>
|
|
633
|
+
<div style="color: #393939;font-size: 16px; font-weight: 400; ">
|
|
634
|
+
${(_d = vm.data.data[key]) !== null && _d !== void 0 ? _d : '#393939'}
|
|
635
|
+
</div>
|
|
636
|
+
</div>
|
|
637
|
+
`;
|
|
625
638
|
},
|
|
626
639
|
divCreate: {
|
|
627
640
|
class: 'd-flex flex-column',
|
|
@@ -640,104 +653,113 @@ export class ProductText {
|
|
|
640
653
|
{
|
|
641
654
|
title: '矩形',
|
|
642
655
|
shape: html `
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
656
|
+
<svg width="64" height="30" viewBox="0 0 64 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
657
|
+
<rect y="0.666016" width="64" height="29.3333" rx="1.33333" fill="#D2D2D2" />
|
|
658
|
+
</svg>
|
|
659
|
+
`,
|
|
647
660
|
},
|
|
648
661
|
{
|
|
649
662
|
title: '橢圓',
|
|
650
663
|
shape: html `
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
664
|
+
<svg width="64" height="30" viewBox="0 0 64 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
665
|
+
<rect y="0.666016" width="64" height="29.3333" rx="14.6667" fill="#D2D2D2" />
|
|
666
|
+
</svg>
|
|
667
|
+
`,
|
|
655
668
|
},
|
|
656
669
|
{
|
|
657
670
|
title: '標籤',
|
|
658
671
|
shape: html `
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
672
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
673
|
+
<path
|
|
674
|
+
fill-rule="evenodd"
|
|
675
|
+
clip-rule="evenodd"
|
|
676
|
+
d="M14.0064 19C13.6114 19 13.2366 19.1752 12.9833 19.4784L0.310174 34.6451C-0.103392 35.14 -0.103391 35.86 0.310175 36.3549L12.9833 51.5216C13.2366 51.8248 13.6114 52 14.0064 52H70.2625C70.9988 52 71.5958 51.403 71.5958 50.6667V20.3333C71.5958 19.597 70.9988 19 70.2625 19H14.0064ZM12.3281 39C14.2611 39 15.8281 37.433 15.8281 35.5C15.8281 33.567 14.2611 32 12.3281 32C10.3951 32 8.82812 33.567 8.82812 35.5C8.82812 37.433 10.3951 39 12.3281 39Z"
|
|
677
|
+
fill="#D9D9D9"
|
|
678
|
+
/>
|
|
679
|
+
</svg>
|
|
680
|
+
`,
|
|
668
681
|
},
|
|
669
682
|
{
|
|
670
683
|
title: '彩帶(橫)',
|
|
671
684
|
shape: html `
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
685
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
686
|
+
<path
|
|
687
|
+
d="M0 21C0 20.1716 0.671573 19.5 1.5 19.5H68.4945C69.8141 19.5 70.4907 21.0812 69.5795 22.0357L57.2386 34.9643C56.6853 35.5439 56.6853 36.4561 57.2386 37.0357L69.5795 49.9643C70.4907 50.9188 69.8141 52.5 68.4945 52.5H1.5C0.671571 52.5 0 51.8284 0 51V21Z"
|
|
688
|
+
fill="#D9D9D9"
|
|
689
|
+
/>
|
|
690
|
+
</svg>
|
|
691
|
+
`,
|
|
679
692
|
},
|
|
680
693
|
{
|
|
681
694
|
title: '彩帶(直)',
|
|
682
695
|
shape: html `
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
696
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
697
|
+
<path
|
|
698
|
+
d="M50.5 -6.55671e-08C51.3284 -2.93554e-08 52 0.671573 52 1.5L52 68.4945C52 69.8141 50.4188 70.4907 49.4643 69.5795L36.5357 57.2386C35.9561 56.6853 35.0439 56.6853 34.4643 57.2386L21.5357 69.5795C20.5812 70.4907 19 69.8141 19 68.4945L19 1.5C19 0.67157 19.6716 -1.41312e-06 20.5 -1.37691e-06L50.5 -6.55671e-08Z"
|
|
699
|
+
fill="#D9D9D9"
|
|
700
|
+
/>
|
|
701
|
+
</svg>
|
|
702
|
+
`,
|
|
690
703
|
},
|
|
691
704
|
{
|
|
692
705
|
title: '圓形',
|
|
693
706
|
shape: html `
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
707
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
708
|
+
<circle cx="37.333" cy="36" r="28" fill="#D9D9D9" />
|
|
709
|
+
</svg>
|
|
710
|
+
`,
|
|
698
711
|
},
|
|
699
712
|
{
|
|
700
713
|
title: '梯形',
|
|
701
714
|
shape: html `
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
715
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
716
|
+
<path d="M33.6632 4H68L4 68V33.6632L33.6632 4Z" fill="#D9D9D9" />
|
|
717
|
+
</svg>
|
|
718
|
+
`,
|
|
706
719
|
},
|
|
707
720
|
];
|
|
708
721
|
vm.data.data.shape = (_a = vm.data.data.shape) !== null && _a !== void 0 ? _a : '矩形';
|
|
709
722
|
return html `
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
723
|
+
<div style="font-size: 16px;font-weight: 400;">${title}</div>
|
|
724
|
+
<div style="font-size: 14px;font-weight: 400;color: #8D8D8D;">梯形與圓形字數建議不要超過 3 個</div>
|
|
725
|
+
${gvc.bindView({
|
|
713
726
|
bind: 'shape',
|
|
714
727
|
view: () => {
|
|
715
728
|
return shapeArray
|
|
716
|
-
.map(
|
|
729
|
+
.map(data => {
|
|
717
730
|
return html `
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
731
|
+
<div style="display: flex;flex-direction: column;align-items: center;gap: 8px;">
|
|
732
|
+
<div
|
|
733
|
+
class="d-flex align-items-center justify-content-center"
|
|
734
|
+
style="width: 80px;height: 80px;"
|
|
735
|
+
>
|
|
736
|
+
${data.shape}
|
|
737
|
+
</div>
|
|
738
|
+
<div
|
|
739
|
+
class="d-flex align-items-center justify-content-center"
|
|
740
|
+
style="font-size: 16px;font-style: normal;font-weight: 400;gap: 6px;cursor:pointer;"
|
|
741
|
+
onclick="${gvc.event(() => {
|
|
724
742
|
vm.data.data.shape = data.title;
|
|
725
743
|
gvc.notifyDataChange(['shape', 'drawPreview']);
|
|
726
744
|
})}"
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
? html
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
745
|
+
>
|
|
746
|
+
${vm.data.data.shape == data.title
|
|
747
|
+
? html ` <div
|
|
748
|
+
style="width: 16px;height: 16px;border-radius: 20px;border:4px solid #393939;"
|
|
749
|
+
></div>`
|
|
750
|
+
: html ` <div
|
|
751
|
+
style="width: 16px;height: 16px;border-radius: 20px;border: 1px solid #DDD;background: #FFF;"
|
|
752
|
+
></div>`}
|
|
753
|
+
${data.title}
|
|
754
|
+
</div>
|
|
755
|
+
</div>
|
|
756
|
+
`;
|
|
735
757
|
})
|
|
736
758
|
.join('');
|
|
737
759
|
},
|
|
738
760
|
divCreate: { class: 'w-100 d-flex flex-wrap', style: `gap:42px;` },
|
|
739
761
|
})}
|
|
740
|
-
|
|
762
|
+
`;
|
|
741
763
|
},
|
|
742
764
|
divCreate: {
|
|
743
765
|
class: 'd-flex flex-column',
|
|
@@ -759,438 +781,759 @@ export class ProductText {
|
|
|
759
781
|
{
|
|
760
782
|
title: '矩形',
|
|
761
783
|
shape: html `
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
784
|
+
<div
|
|
785
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
786
|
+
? 'padding-top:'
|
|
787
|
+
: 'padding-bottom:'}10px; ${labelPosition == '左上' || labelPosition == '左下'
|
|
765
788
|
? 'padding-left:'
|
|
766
789
|
: 'padding-right:'}10px;"
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
790
|
+
>
|
|
791
|
+
<div style="min-width: 49px;background: ${color};position: relative;padding:5px 9px;">
|
|
792
|
+
<div
|
|
793
|
+
class="d-flex align-items-center"
|
|
794
|
+
style="color: ${vm.data.data.text_color};font-size: ${vm.data.data
|
|
795
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;"
|
|
796
|
+
>
|
|
797
|
+
${text}
|
|
798
|
+
</div>
|
|
799
|
+
</div>
|
|
800
|
+
</div>
|
|
801
|
+
`,
|
|
773
802
|
},
|
|
774
803
|
{
|
|
775
804
|
title: '橢圓',
|
|
776
805
|
shape: html `
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
806
|
+
<div
|
|
807
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
808
|
+
? 'padding-top:'
|
|
809
|
+
: 'padding-bottom:'}10px; ${labelPosition == '左上' || labelPosition == '左下'
|
|
780
810
|
? 'padding-left:'
|
|
781
811
|
: 'padding-right:'}10px;"
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
812
|
+
>
|
|
813
|
+
<div style="min-width: 59px;background: ${color};border-radius: 32px;padding:5px 14px;">
|
|
814
|
+
<div
|
|
815
|
+
class="d-flex align-items-center"
|
|
816
|
+
style="color: ${vm.data.data.text_color};font-size: ${vm.data.data
|
|
817
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;"
|
|
818
|
+
>
|
|
819
|
+
${text}
|
|
820
|
+
</div>
|
|
821
|
+
</div>
|
|
822
|
+
</div>
|
|
823
|
+
`,
|
|
788
824
|
},
|
|
789
825
|
{
|
|
790
826
|
title: '標籤',
|
|
791
827
|
shape: html `
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
828
|
+
<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
829
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
830
|
+
d="M13.9543 22C13.5891 22 13.2398 22.1499 12.9881 22.4146L0.468637 35.5812C-0.0207961 36.096 -0.0207953 36.904 0.468638 37.4188L12.9881 50.5854C13.2398 50.8501 13.5891 51 13.9543 51H70.2617C70.9981 51 71.595 50.403 71.595 49.6667V23.3333C71.595 22.597 70.9981 22 70.2617 22H13.9543ZM12.3271 40C14.2601 40 15.8271 38.433 15.8271 36.5C15.8271 34.567 14.2601 33 12.3271 33C10.3942 33 8.82715 34.567 8.82715 36.5C8.82715 38.433 10.3942 40 12.3271 40Z"
|
|
831
|
+
fill="${color}"
|
|
832
|
+
//>
|
|
833
|
+
<text x="50%" y="50%" font-family="Noto Sans', sans-serif " text-anchor="middle"
|
|
834
|
+
font-size="${vm.data.data.text_size}" fill="${vm.data.data.text_color}"
|
|
835
|
+
dominant-baseline="central">${text}
|
|
836
|
+
</text>
|
|
837
|
+
</svg>
|
|
838
|
+
|
|
839
|
+
`,
|
|
840
|
+
shape2: html `
|
|
841
|
+
<div
|
|
842
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
843
|
+
? 'padding-top:'
|
|
844
|
+
: 'padding-bottom:'}9.57px; ${labelPosition == '左上' || labelPosition == '左下'
|
|
795
845
|
? 'padding-left:'
|
|
796
846
|
: 'padding-right:'}9.11px; position: relative;"
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
847
|
+
>
|
|
848
|
+
<div
|
|
849
|
+
class="d-flex align-items-center"
|
|
850
|
+
style="position: absolute;right: ${labelPosition == '左上' || labelPosition == '左下'
|
|
851
|
+
? '9'
|
|
852
|
+
: '19'}px;top: ${labelPosition == '左上' || labelPosition == '右上'
|
|
801
853
|
? '17.5'
|
|
802
|
-
: '7.5'}px;font-size:
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
854
|
+
: '7.5'}px;font-size: ${vm.data.data
|
|
855
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data.text_color}"
|
|
856
|
+
>
|
|
857
|
+
${text}
|
|
858
|
+
</div>
|
|
859
|
+
<svg
|
|
860
|
+
width="72"
|
|
861
|
+
height="32"
|
|
862
|
+
viewBox="0 0 69 24"
|
|
863
|
+
fill="none"
|
|
864
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
865
|
+
preserveAspectRatio="none"
|
|
866
|
+
>
|
|
867
|
+
<path
|
|
868
|
+
fill-rule="evenodd"
|
|
869
|
+
clip-rule="evenodd"
|
|
870
|
+
d="M14.4492 0C14.0593 0 13.6889 0.170677 13.4356 0.467093L4.31972 11.1338C3.89342 11.6326 3.89343 12.3674 4.31972 12.8662L13.4356 23.5329C13.6889 23.8293 14.0593 24 14.4492 24H66.2461C66.9825 24 67.5794 23.403 67.5794 22.6667V1.33333C67.5794 0.596954 66.9825 0 66.2461 0H14.4492ZM16.1178 15C17.7938 15 19.1523 13.6569 19.1523 12C19.1523 10.3431 17.7938 9 16.1178 9C14.4419 9 13.0833 10.3431 13.0833 12C13.0833 13.6569 14.4419 15 16.1178 15Z"
|
|
871
|
+
fill="${color}"
|
|
872
|
+
/>
|
|
873
|
+
</svg>
|
|
874
|
+
</div>
|
|
875
|
+
`,
|
|
816
876
|
},
|
|
817
877
|
{
|
|
818
878
|
title: '彩帶(橫)',
|
|
819
879
|
shape: html `
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
880
|
+
<div style="padding-left:9.11px;">
|
|
881
|
+
<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
882
|
+
<path
|
|
883
|
+
d="M0 23.5C0 22.6716 0.671573 22 1.5 22H68.156C69.5225 22 70.1773 23.678 69.172 24.6035L57.4487 35.3965C56.8033 35.9906 56.8033 37.0094 57.4487 37.6035L69.172 48.3965C70.1773 49.322 69.5225 51 68.156 51H1.5C0.671571 51 0 50.3284 0 49.5V23.5Z"
|
|
884
|
+
fill="${vm.data.data.label_color}"
|
|
885
|
+
//>
|
|
886
|
+
<text x="30%" y="50%" font-family="Noto Sans', sans-serif " text-anchor="middle"
|
|
887
|
+
font-size="${vm.data.data.text_size}" fill="${vm.data.data.text_color}"
|
|
888
|
+
dominant-baseline="central">${text}
|
|
889
|
+
</text>
|
|
890
|
+
</svg>
|
|
891
|
+
</div>
|
|
892
|
+
`,
|
|
893
|
+
shape1: html `
|
|
894
|
+
<div
|
|
895
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
896
|
+
? 'padding-top:'
|
|
897
|
+
: 'padding-bottom:'}9.57px; ${labelPosition == '左上' || labelPosition == '左下'
|
|
823
898
|
? 'padding-left:'
|
|
824
899
|
: 'padding-right:'}9.11px;position: relative;"
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
900
|
+
>
|
|
901
|
+
<div
|
|
902
|
+
class="d-flex align-items-center"
|
|
903
|
+
style="position: absolute;left: ${labelPosition == '左上' || labelPosition == '左下'
|
|
904
|
+
? '21'
|
|
905
|
+
: '11'}px;top: ${labelPosition == '左上' || labelPosition == '右上'
|
|
829
906
|
? '13.5'
|
|
830
|
-
: '3.5'}px;font-size:
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
907
|
+
: '3.5'}px;font-size: ${vm.data.data
|
|
908
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data.text_color}"
|
|
909
|
+
>
|
|
910
|
+
${text}
|
|
911
|
+
</div>
|
|
912
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="71" height="32" viewBox="0 0 71 32" fill="none">
|
|
913
|
+
<g filter="url(#filter0_d_14130_223497)">
|
|
914
|
+
<path
|
|
915
|
+
d="M4.54297 1.5C4.54297 0.671573 5.21454 0 6.04297 0H65.3404C66.6122 0 67.3069 1.48329 66.4927 2.46028L59.3432 11.0397C58.8796 11.596 58.8796 12.404 59.3432 12.9603L66.4927 21.5397C67.3069 22.5167 66.6122 24 65.3404 24H6.04297C5.21454 24 4.54297 23.3284 4.54297 22.5V1.5Z"
|
|
916
|
+
fill="${color}"
|
|
917
|
+
/>
|
|
918
|
+
</g>
|
|
919
|
+
</svg>
|
|
920
|
+
</div>
|
|
921
|
+
`,
|
|
844
922
|
},
|
|
845
923
|
{
|
|
846
924
|
title: '彩帶(直)',
|
|
847
925
|
shape: html `
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
926
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
927
|
+
<path
|
|
928
|
+
d="M48.5 -6.55671e-08C49.3284 -2.93554e-08 50 0.671573 50 1.5L50 68.156C50 69.5225 48.3219 70.1773 47.3964 69.172L36.6035 57.4487C36.0094 56.8033 34.9906 56.8033 34.3964 57.4487L23.6035 69.172C22.678 70.1773 21 69.5225 21 68.156L21 1.5C21 0.67157 21.6716 -1.23827e-06 22.5 -1.20206e-06L48.5 -6.55671e-08Z"
|
|
929
|
+
fill="${vm.data.data.label_color}"
|
|
930
|
+
/>
|
|
931
|
+
<text
|
|
932
|
+
x="50%"
|
|
933
|
+
y="30%"
|
|
934
|
+
font-family="Noto Sans', sans-serif "
|
|
935
|
+
text-anchor="middle"
|
|
936
|
+
font-size="${vm.data.data.text_size}"
|
|
937
|
+
fill="${vm.data.data.text_color}"
|
|
938
|
+
dominant-baseline="central"
|
|
939
|
+
style="writing-mode: vertical-rl;"
|
|
940
|
+
>
|
|
941
|
+
${text}
|
|
942
|
+
</text>
|
|
943
|
+
</svg>
|
|
944
|
+
`,
|
|
945
|
+
shape1: html `
|
|
946
|
+
<div
|
|
947
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
948
|
+
? 'padding-top:'
|
|
949
|
+
: 'padding-bottom:'} 9.57px;${labelPosition == '左上' || labelPosition == '左下'
|
|
851
950
|
? 'padding-left:'
|
|
852
951
|
: 'padding-right:'} 9.11px;position: relative;"
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
labelPosition == '右上'
|
|
952
|
+
>
|
|
953
|
+
<div
|
|
954
|
+
style="position: absolute;left: ${labelPosition == '左上' || labelPosition == '左下'
|
|
857
955
|
? '17.5'
|
|
858
|
-
: '7.5'}px;
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
956
|
+
: '7.5'}px;top: ${labelPosition == '左上' || labelPosition == '右上'
|
|
957
|
+
? '17.5'
|
|
958
|
+
: '7.5'}px;font-size: ${vm.data.data
|
|
959
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
960
|
+
.text_color};writing-mode: vertical-lr;"
|
|
961
|
+
>
|
|
962
|
+
${text}
|
|
963
|
+
</div>
|
|
964
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="33" height="71" viewBox="0 0 33 71" fill="none">
|
|
965
|
+
<g filter="url(#filter0_d_14130_223503)">
|
|
966
|
+
<path
|
|
967
|
+
d="M27.043 -0.00195319C27.8714 -0.00195315 28.543 0.66962 28.543 1.49805L28.543 60.7955C28.543 62.0672 27.0597 62.762 26.0827 61.9478L17.5032 54.7983C16.947 54.3347 16.139 54.3347 15.5827 54.7983L7.00324 61.9478C6.02625 62.762 4.54297 62.0672 4.54297 60.7955L4.54297 1.49805C4.54297 0.669619 5.21454 -0.00195414 6.04297 -0.00195411L27.043 -0.00195319Z"
|
|
968
|
+
fill="${color}"
|
|
969
|
+
/>
|
|
970
|
+
</g>
|
|
971
|
+
<defs>
|
|
972
|
+
<filter
|
|
973
|
+
id="filter0_d_14130_223503"
|
|
974
|
+
x="0.542969"
|
|
975
|
+
y="-0.00195312"
|
|
976
|
+
width="32"
|
|
977
|
+
height="70.3008"
|
|
978
|
+
filterUnits="userSpaceOnUse"
|
|
979
|
+
color-interpolation-filters="sRGB"
|
|
980
|
+
>
|
|
981
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
982
|
+
<feColorMatrix
|
|
983
|
+
in="SourceAlpha"
|
|
984
|
+
type="matrix"
|
|
985
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
986
|
+
result="hardAlpha"
|
|
987
|
+
/>
|
|
988
|
+
<feOffset dy="4" />
|
|
989
|
+
<feGaussianBlur stdDeviation="2" />
|
|
990
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
991
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
|
|
992
|
+
<feBlend
|
|
993
|
+
mode="normal"
|
|
994
|
+
in2="BackgroundImageFix"
|
|
995
|
+
result="effect1_dropShadow_14130_223503"
|
|
996
|
+
/>
|
|
997
|
+
<feBlend
|
|
998
|
+
mode="normal"
|
|
999
|
+
in="SourceGraphic"
|
|
1000
|
+
in2="effect1_dropShadow_14130_223503"
|
|
1001
|
+
result="shape"
|
|
1002
|
+
/>
|
|
1003
|
+
</filter>
|
|
1004
|
+
</defs>
|
|
1005
|
+
</svg>
|
|
1006
|
+
</div>
|
|
1007
|
+
`,
|
|
892
1008
|
},
|
|
893
1009
|
{
|
|
894
1010
|
title: '圓形',
|
|
895
1011
|
shape: html `
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
1012
|
+
<div
|
|
1013
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
1014
|
+
? 'padding-top:'
|
|
1015
|
+
: 'padding-bottom:'} 9.57px;${labelPosition == '左上' || labelPosition == '左下'
|
|
899
1016
|
? 'padding-left:'
|
|
900
1017
|
: 'padding-right:'} 9.11px;"
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
.text_color};font-size:
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
1018
|
+
>
|
|
1019
|
+
<div
|
|
1020
|
+
class=" align-items-center justify-content-center"
|
|
1021
|
+
style="display: inline-flex; width: 46px;height: 46px;flex-shrink: 0;background-color: ${color};border-radius: 50%;color: ${vm
|
|
1022
|
+
.data.data.text_color};font-size: ${vm.data.data
|
|
1023
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;"
|
|
1024
|
+
>
|
|
1025
|
+
${text}
|
|
1026
|
+
</div>
|
|
1027
|
+
</div>
|
|
1028
|
+
`,
|
|
911
1029
|
},
|
|
912
1030
|
{
|
|
913
1031
|
title: '梯形',
|
|
914
1032
|
shape: (() => {
|
|
1033
|
+
console.log(vm.data.data.position);
|
|
1034
|
+
gvc.addStyle(css `
|
|
1035
|
+
.corner {
|
|
1036
|
+
width: 58px;
|
|
1037
|
+
height: 58px;
|
|
1038
|
+
background-color: ${vm.data.data.label_color};
|
|
1039
|
+
color: ${vm.data.data.text_color};
|
|
1040
|
+
box-sizing: border-box;
|
|
1041
|
+
display: flex;
|
|
1042
|
+
justify-content: center;
|
|
1043
|
+
align-items: center;
|
|
1044
|
+
text-align: center;
|
|
1045
|
+
font-size: ${vm.data.data.text_size}px;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
.corner-左上 {
|
|
1049
|
+
top: 0;
|
|
1050
|
+
left: 0;
|
|
1051
|
+
clip-path: polygon(50% 0, 100% 0, 0 100%, 0 50%);
|
|
1052
|
+
}
|
|
1053
|
+
.corner-左上 p{
|
|
1054
|
+
transform: rotate(-45deg) translate(-50%, -50%);
|
|
1055
|
+
position: absolute;
|
|
1056
|
+
left: 41%;
|
|
1057
|
+
top: 18%;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
.corner-左下 {
|
|
1061
|
+
top: 0;
|
|
1062
|
+
left: 0;
|
|
1063
|
+
clip-path: polygon(0 0, 100% 100%, 50% 100%, 0 50%);
|
|
1064
|
+
}
|
|
1065
|
+
.corner-左下 p{
|
|
1066
|
+
transform: rotate(45deg) translate(-50%, -50%);
|
|
1067
|
+
position: absolute;
|
|
1068
|
+
left: 22%;
|
|
1069
|
+
bottom: 0;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
.corner-右上 {
|
|
1073
|
+
top: 0;
|
|
1074
|
+
left: 0;
|
|
1075
|
+
clip-path: polygon(0 0, 100% 100%, 100% 50%, 50% 0);
|
|
1076
|
+
}
|
|
1077
|
+
.corner-右上 p{
|
|
1078
|
+
transform: rotate(45deg) translate(-50%, -50%);
|
|
1079
|
+
position: absolute;
|
|
1080
|
+
left: 46%;
|
|
1081
|
+
bottom: 23%;
|
|
1082
|
+
}
|
|
1083
|
+
.corner-右下 {
|
|
1084
|
+
top: 0;
|
|
1085
|
+
left: 0;
|
|
1086
|
+
clip-path: polygon(0 100%, 50% 100%, 100% 50%, 100% 0);
|
|
1087
|
+
}
|
|
1088
|
+
.corner-右下 p{
|
|
1089
|
+
transform: rotate(-45deg);
|
|
1090
|
+
position: absolute;
|
|
1091
|
+
left: 40%;
|
|
1092
|
+
bottom: 23%;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
`);
|
|
1096
|
+
return html `<div class="corner corner-${vm.data.data.position} position-relative">
|
|
1097
|
+
<p class="m-0">${text}</p>
|
|
1098
|
+
</div>`;
|
|
1099
|
+
})(),
|
|
1100
|
+
shape2: html `
|
|
1101
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" fill="none">
|
|
1102
|
+
<path d="M29.6632 0H64L0 64V29.6632L29.6632 0Z" fill="${vm.data.data.label_color}" />
|
|
1103
|
+
<text
|
|
1104
|
+
x="50%"
|
|
1105
|
+
y="30%"
|
|
1106
|
+
font-family="Noto Sans', sans-serif "
|
|
1107
|
+
text-anchor="middle"
|
|
1108
|
+
font-size="${vm.data.data.text_size}"
|
|
1109
|
+
fill="${vm.data.data.text_color}"
|
|
1110
|
+
dominant-baseline="central"
|
|
1111
|
+
style="writing-mode: vertical-rl;"
|
|
1112
|
+
>
|
|
1113
|
+
${text}
|
|
1114
|
+
</text>
|
|
1115
|
+
</svg>
|
|
1116
|
+
`,
|
|
1117
|
+
shape1: (() => {
|
|
915
1118
|
switch (labelPosition) {
|
|
916
1119
|
case '左上': {
|
|
917
1120
|
return html `
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1121
|
+
<div style="display: inline-block;position: relative;">
|
|
1122
|
+
<div
|
|
1123
|
+
style="position: absolute;left: 5px;top: 13.5px;font-size: ${vm.data.data
|
|
1124
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
921
1125
|
.text_color};transform: rotate(-44.938deg);"
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
1126
|
+
>
|
|
1127
|
+
${text}
|
|
1128
|
+
</div>
|
|
1129
|
+
<svg
|
|
1130
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1131
|
+
width="62"
|
|
1132
|
+
height="66"
|
|
1133
|
+
viewBox="0 0 62 66"
|
|
1134
|
+
fill="none"
|
|
1135
|
+
>
|
|
1136
|
+
<g filter="url(#filter0_d_14130_126851)">
|
|
1137
|
+
<path d="M26.8833 0H58.001L0.000976562 58V26.8823L26.8833 0Z" fill="${color}" />
|
|
1138
|
+
</g>
|
|
1139
|
+
<defs>
|
|
1140
|
+
<filter
|
|
1141
|
+
id="filter0_d_14130_126851"
|
|
1142
|
+
x="-3.99902"
|
|
1143
|
+
y="0"
|
|
1144
|
+
width="66"
|
|
1145
|
+
height="66"
|
|
1146
|
+
filterUnits="userSpaceOnUse"
|
|
1147
|
+
color-interpolation-filters="sRGB"
|
|
1148
|
+
>
|
|
1149
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1150
|
+
<feColorMatrix
|
|
1151
|
+
in="SourceAlpha"
|
|
1152
|
+
type="matrix"
|
|
1153
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1154
|
+
result="hardAlpha"
|
|
1155
|
+
/>
|
|
1156
|
+
<feOffset dy="4" />
|
|
1157
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1158
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1159
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
|
|
1160
|
+
<feBlend
|
|
1161
|
+
mode="normal"
|
|
1162
|
+
in2="BackgroundImageFix"
|
|
1163
|
+
result="effect1_dropShadow_14130_126851"
|
|
1164
|
+
/>
|
|
1165
|
+
<feBlend
|
|
1166
|
+
mode="normal"
|
|
1167
|
+
in="SourceGraphic"
|
|
1168
|
+
in2="effect1_dropShadow_14130_126851"
|
|
1169
|
+
result="shape"
|
|
1170
|
+
/>
|
|
1171
|
+
</filter>
|
|
1172
|
+
</defs>
|
|
1173
|
+
</svg>
|
|
1174
|
+
</div>
|
|
1175
|
+
`;
|
|
952
1176
|
}
|
|
953
1177
|
case '左下': {
|
|
954
1178
|
return html `
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1179
|
+
<div style="display: inline-block;position: relative;min-height:79px;">
|
|
1180
|
+
<div
|
|
1181
|
+
style="position: absolute;left: 12px;bottom: 23px;font-size: ${vm.data.data
|
|
1182
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
958
1183
|
.text_color};transform: rotate(45deg);"
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1184
|
+
>
|
|
1185
|
+
${text}
|
|
1186
|
+
</div>
|
|
1187
|
+
<svg
|
|
1188
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1189
|
+
width="79"
|
|
1190
|
+
height="79"
|
|
1191
|
+
viewBox="0 0 58 58"
|
|
1192
|
+
fill="none"
|
|
1193
|
+
>
|
|
1194
|
+
<g filter="url(#filter0_d_14378_119252)">
|
|
1195
|
+
<path d="M26.8823 58H58L0 0V31.1177L26.8823 58Z" fill="${color}" />
|
|
1196
|
+
</g>
|
|
1197
|
+
<defs>
|
|
1198
|
+
<filter
|
|
1199
|
+
id="filter0_d_14378_119252"
|
|
1200
|
+
x="-4"
|
|
1201
|
+
y="0"
|
|
1202
|
+
width="66"
|
|
1203
|
+
height="66"
|
|
1204
|
+
filterUnits="userSpaceOnUse"
|
|
1205
|
+
color-interpolation-filters="sRGB"
|
|
1206
|
+
>
|
|
1207
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1208
|
+
<feColorMatrix
|
|
1209
|
+
in="SourceAlpha"
|
|
1210
|
+
type="matrix"
|
|
1211
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1212
|
+
result="hardAlpha"
|
|
1213
|
+
/>
|
|
1214
|
+
<feOffset dy="4" />
|
|
1215
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1216
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1217
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
|
|
1218
|
+
<feBlend
|
|
1219
|
+
mode="normal"
|
|
1220
|
+
in2="BackgroundImageFix"
|
|
1221
|
+
result="effect1_dropShadow_14378_119252"
|
|
1222
|
+
/>
|
|
1223
|
+
<feBlend
|
|
1224
|
+
mode="normal"
|
|
1225
|
+
in="SourceGraphic"
|
|
1226
|
+
in2="effect1_dropShadow_14378_119252"
|
|
1227
|
+
result="shape"
|
|
1228
|
+
/>
|
|
1229
|
+
</filter>
|
|
1230
|
+
</defs>
|
|
1231
|
+
</svg>
|
|
1232
|
+
</div>
|
|
1233
|
+
`;
|
|
989
1234
|
}
|
|
990
1235
|
case '右上': {
|
|
991
1236
|
return html `
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1237
|
+
<div style="display: inline-block;position: relative;min-height:79px;">
|
|
1238
|
+
<div
|
|
1239
|
+
style="position: absolute;right: 5px;top: 13.5px;font-size: ${vm.data.data
|
|
1240
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
995
1241
|
.text_color};transform: rotate(45deg);"
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1242
|
+
>
|
|
1243
|
+
${text}
|
|
1244
|
+
</div>
|
|
1245
|
+
<svg
|
|
1246
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1247
|
+
width="63"
|
|
1248
|
+
height="66"
|
|
1249
|
+
viewBox="0 0 63 66"
|
|
1250
|
+
fill="none"
|
|
1251
|
+
>
|
|
1252
|
+
<g filter="url(#filter0_d_14378_119247)">
|
|
1253
|
+
<path d="M35.1177 0H4L62 58V26.8823L35.1177 0Z" fill="${color}" />
|
|
1254
|
+
</g>
|
|
1255
|
+
<defs>
|
|
1256
|
+
<filter
|
|
1257
|
+
id="filter0_d_14378_119247"
|
|
1258
|
+
x="0"
|
|
1259
|
+
y="0"
|
|
1260
|
+
width="66"
|
|
1261
|
+
height="66"
|
|
1262
|
+
filterUnits="userSpaceOnUse"
|
|
1263
|
+
color-interpolation-filters="sRGB"
|
|
1264
|
+
>
|
|
1265
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1266
|
+
<feColorMatrix
|
|
1267
|
+
in="SourceAlpha"
|
|
1268
|
+
type="matrix"
|
|
1269
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1270
|
+
result="hardAlpha"
|
|
1271
|
+
/>
|
|
1272
|
+
<feOffset dy="4" />
|
|
1273
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1274
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1275
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
|
|
1276
|
+
<feBlend
|
|
1277
|
+
mode="normal"
|
|
1278
|
+
in2="BackgroundImageFix"
|
|
1279
|
+
result="effect1_dropShadow_14378_119247"
|
|
1280
|
+
/>
|
|
1281
|
+
<feBlend
|
|
1282
|
+
mode="normal"
|
|
1283
|
+
in="SourceGraphic"
|
|
1284
|
+
in2="effect1_dropShadow_14378_119247"
|
|
1285
|
+
result="shape"
|
|
1286
|
+
/>
|
|
1287
|
+
</filter>
|
|
1288
|
+
</defs>
|
|
1289
|
+
</svg>
|
|
1290
|
+
</div>
|
|
1291
|
+
`;
|
|
1026
1292
|
}
|
|
1027
1293
|
default: {
|
|
1028
1294
|
return html `
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1295
|
+
<div style="display: inline-block;position: relative;min-height:79px;">
|
|
1296
|
+
<div
|
|
1297
|
+
style="position: absolute;right: 13px;bottom: 16px;font-size: ${vm.data.data
|
|
1298
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
1032
1299
|
.text_color};transform: rotate(-45deg);"
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1300
|
+
>
|
|
1301
|
+
${text}
|
|
1302
|
+
</div>
|
|
1303
|
+
<svg
|
|
1304
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1305
|
+
width="79"
|
|
1306
|
+
height="79"
|
|
1307
|
+
viewBox="0 0 58 58"
|
|
1308
|
+
fill="none"
|
|
1309
|
+
>
|
|
1310
|
+
<g filter="url(#filter0_d_14378_119257)">
|
|
1311
|
+
<path d="M35.1177 58H4L62 0V31.1177L35.1177 58Z" fill="${color}" />
|
|
1312
|
+
</g>
|
|
1313
|
+
<defs>
|
|
1314
|
+
<filter
|
|
1315
|
+
id="filter0_d_14378_119257"
|
|
1316
|
+
x="0"
|
|
1317
|
+
y="0"
|
|
1318
|
+
width="66"
|
|
1319
|
+
height="66"
|
|
1320
|
+
filterUnits="userSpaceOnUse"
|
|
1321
|
+
color-interpolation-filters="sRGB"
|
|
1322
|
+
>
|
|
1323
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1324
|
+
<feColorMatrix
|
|
1325
|
+
in="SourceAlpha"
|
|
1326
|
+
type="matrix"
|
|
1327
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1328
|
+
result="hardAlpha"
|
|
1329
|
+
/>
|
|
1330
|
+
<feOffset dy="4" />
|
|
1331
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1332
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1333
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
|
|
1334
|
+
<feBlend
|
|
1335
|
+
mode="normal"
|
|
1336
|
+
in2="BackgroundImageFix"
|
|
1337
|
+
result="effect1_dropShadow_14378_119257"
|
|
1338
|
+
/>
|
|
1339
|
+
<feBlend
|
|
1340
|
+
mode="normal"
|
|
1341
|
+
in="SourceGraphic"
|
|
1342
|
+
in2="effect1_dropShadow_14378_119257"
|
|
1343
|
+
result="shape"
|
|
1344
|
+
/>
|
|
1345
|
+
</filter>
|
|
1346
|
+
</defs>
|
|
1347
|
+
</svg>
|
|
1348
|
+
</div>
|
|
1349
|
+
`;
|
|
1063
1350
|
}
|
|
1064
1351
|
}
|
|
1065
1352
|
})(),
|
|
1066
1353
|
},
|
|
1067
1354
|
];
|
|
1068
|
-
const labelHTML = (_d = shapeArray.find(
|
|
1355
|
+
const labelHTML = (_d = shapeArray.find(shape => {
|
|
1069
1356
|
return shape.title == vm.data.data.shape;
|
|
1070
1357
|
})) === null || _d === void 0 ? void 0 : _d.shape;
|
|
1071
1358
|
vm.data.data.content = labelHTML !== null && labelHTML !== void 0 ? labelHTML : '';
|
|
1072
1359
|
return html `
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1360
|
+
<div
|
|
1361
|
+
class="w-100 w-lg-50"
|
|
1362
|
+
style="display: flex;height: 270px;justify-content: center;align-items: center;align-self: stretch;border-radius: 10px;border: 1px solid #DDD;"
|
|
1363
|
+
>
|
|
1364
|
+
<div class="d-flex flex-wrap" style="height: 178px;width: 178px;">
|
|
1365
|
+
${position
|
|
1079
1366
|
.map((data, index) => {
|
|
1080
1367
|
if (vm.data.data.position == data) {
|
|
1081
1368
|
return html `
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1369
|
+
<div
|
|
1370
|
+
class="d-flex align-items-center justify-content-center"
|
|
1371
|
+
style="width: 89px;height: 89px;border: 1px solid rgba(205, 205, 205, 0.87);background: #393939;color: #FFF;font-size: 16px;font-weight: 400;"
|
|
1372
|
+
>
|
|
1373
|
+
${data}
|
|
1374
|
+
</div>
|
|
1375
|
+
`;
|
|
1089
1376
|
}
|
|
1090
1377
|
return html `
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
onclick="${gvc.event(() => {
|
|
1378
|
+
<div
|
|
1379
|
+
style="width: 89px;height: 89px;border: 1px solid rgba(205, 205, 205, 0.87);background: #EAEAEA;"
|
|
1380
|
+
onclick="${gvc.event(() => {
|
|
1095
1381
|
vm.data.data.position = data;
|
|
1096
1382
|
gvc.notifyDataChange('drawPreview');
|
|
1097
1383
|
})}"
|
|
1098
|
-
|
|
1099
|
-
|
|
1384
|
+
></div>
|
|
1385
|
+
`;
|
|
1100
1386
|
})
|
|
1101
1387
|
.join('')}
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
'左上' || vm.data.data.position == '右上'
|
|
1388
|
+
</div>
|
|
1389
|
+
</div>
|
|
1390
|
+
<div
|
|
1391
|
+
class="w-100 w-lg-50"
|
|
1392
|
+
style="display: flex;padding: 14px 114px 13.713px 113px;justify-content: center;align-items: center;align-self: stretch;border-radius: 10px;border: 1px solid #DDD;"
|
|
1393
|
+
>
|
|
1394
|
+
<div
|
|
1395
|
+
style="padding: 11.67px;border-radius: 2px;border: 1px solid #DDD;background: #FFF;display: flex;flex-direction: column;justify-content: center;align-items: flex-start;gap: 8px;"
|
|
1396
|
+
>
|
|
1397
|
+
<div
|
|
1398
|
+
class="d-flex flex-column align-items-center position-relative"
|
|
1399
|
+
style="width:178px;height: 178px;padding-top: 10px;border-radius: 2px;background-image: url('https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/size1440_s*px$_sdsfs9sbs5ses7sb_Frame127.png')"
|
|
1400
|
+
>
|
|
1401
|
+
<div
|
|
1402
|
+
style="position:absolute;${vm.data.data.position == '左上' || vm.data.data.position == '左下'
|
|
1403
|
+
? 'left'
|
|
1404
|
+
: 'right'}: 0;${vm.data.data.position == '左上' || vm.data.data.position == '右上'
|
|
1119
1405
|
? 'top'
|
|
1120
1406
|
: 'bottom'}: 0;z-index:2;"
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1407
|
+
>
|
|
1408
|
+
${labelHTML}
|
|
1409
|
+
</div>
|
|
1410
|
+
<div
|
|
1411
|
+
style="position: absolute;top: 9.75px;right: 9.94px;;display: flex;width: 25.285px;height: 25.285px;padding: 7.779px 7.778px 7.781px 7.782px;justify-content: center;align-items: center;flex-shrink: 0;border-radius: 58.351px;background: #FFF;box-shadow: 3.89px 1.945px 9.725px 0px rgba(0, 0, 0, 0.15);"
|
|
1412
|
+
>
|
|
1413
|
+
<svg
|
|
1414
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1415
|
+
width="11"
|
|
1416
|
+
height="11"
|
|
1417
|
+
viewBox="0 0 11 11"
|
|
1418
|
+
fill="none"
|
|
1419
|
+
>
|
|
1420
|
+
<g clip-path="url(#clip0_14130_223540)">
|
|
1421
|
+
<path
|
|
1422
|
+
d="M5.07214 9.6716L5.02465 9.62791L1.69683 6.53753C1.11371 5.99618 0.783203 5.23641 0.783203 4.44054V4.37786C0.783203 3.04066 1.73292 1.8934 3.04733 1.64267C3.79571 1.49831 4.56119 1.67116 5.17091 2.10043C5.34186 2.222 5.50141 2.36256 5.64577 2.52401C5.72554 2.43284 5.81102 2.34926 5.90219 2.27138C5.97247 2.2106 6.04465 2.15362 6.12063 2.10043C6.73035 1.67116 7.49582 1.49831 8.2442 1.64077C9.55861 1.8915 10.5083 3.04066 10.5083 4.37786V4.44054C10.5083 5.23641 10.1778 5.99618 9.5947 6.53753L6.26688 9.62791L6.2194 9.6716C6.06364 9.81596 5.8585 9.89763 5.64577 9.89763C5.43303 9.89763 5.22789 9.81786 5.07214 9.6716ZM5.32476 3.53261C5.31716 3.52691 5.31147 3.51932 5.30577 3.51172L4.96767 3.13183L4.96577 3.12993C4.527 2.63798 3.86409 2.41384 3.21828 2.53731C2.33315 2.70636 1.69493 3.47753 1.69493 4.37786V4.44054C1.69493 4.98188 1.92097 5.50043 2.31795 5.86892L5.64577 8.95931L8.97359 5.86892C9.37057 5.50043 9.5966 4.98188 9.5966 4.44054V4.37786C9.5966 3.47943 8.95839 2.70636 8.07515 2.53731C7.42934 2.41384 6.76454 2.63988 6.32767 3.12993C6.32767 3.12993 6.32767 3.12993 6.32577 3.13183C6.32387 3.13373 6.32577 3.13183 6.32387 3.13373L5.98577 3.51362C5.98007 3.52122 5.97247 3.52691 5.96677 3.53451C5.8813 3.61999 5.76543 3.66747 5.64577 3.66747C5.5261 3.66747 5.41024 3.61999 5.32476 3.53451V3.53261Z"
|
|
1423
|
+
fill="#393939"
|
|
1424
|
+
/>
|
|
1425
|
+
</g>
|
|
1426
|
+
<defs>
|
|
1427
|
+
<clipPath id="clip0_14130_223540">
|
|
1428
|
+
<rect
|
|
1429
|
+
width="9.72513"
|
|
1430
|
+
height="9.72513"
|
|
1431
|
+
fill="white"
|
|
1432
|
+
transform="translate(0.782227 0.779297)"
|
|
1433
|
+
/>
|
|
1434
|
+
</clipPath>
|
|
1435
|
+
</defs>
|
|
1436
|
+
</svg>
|
|
1437
|
+
</div>
|
|
1438
|
+
</div>
|
|
1439
|
+
<div
|
|
1440
|
+
style="display: flex;flex-direction: column;gap: 5.835px;color:#393939;font-size: 9.725px;font-weight: 400;letter-spacing: 0.389px;"
|
|
1441
|
+
>
|
|
1442
|
+
<div>商品名稱</div>
|
|
1443
|
+
<div>NT.$ 99</div>
|
|
1444
|
+
</div>
|
|
1445
|
+
</div>
|
|
1446
|
+
</div>
|
|
1447
|
+
`;
|
|
1448
|
+
},
|
|
1449
|
+
divCreate: {
|
|
1450
|
+
style: `display: flex;align-items: flex-start;gap: 18px;align-self: stretch;`,
|
|
1451
|
+
class: `flex-column flex-lg-row`,
|
|
1452
|
+
},
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
function drawInput(type, title, key) {
|
|
1456
|
+
const id = gvc.glitter.getUUID();
|
|
1457
|
+
const inputClass = gvc.glitter.getUUID();
|
|
1458
|
+
return gvc.bindView({
|
|
1459
|
+
bind: id,
|
|
1460
|
+
view: () => {
|
|
1461
|
+
var _a;
|
|
1462
|
+
vm.data.data['text_size'] = (_a = vm.data.data['text_size']) !== null && _a !== void 0 ? _a : '10';
|
|
1463
|
+
return html `
|
|
1464
|
+
<div style="font-size: 16px;font-style: normal;font-weight: 400;color:#393939;">${title}</div>
|
|
1465
|
+
<div
|
|
1466
|
+
class="d-flex "
|
|
1467
|
+
style="padding: 12px 10px;gap: 10px;border-radius: 7px;border: 1px solid #DDD;"
|
|
1468
|
+
onclick="${gvc.event(() => {
|
|
1469
|
+
document.querySelector(`.${inputClass}`).click();
|
|
1470
|
+
})}"
|
|
1471
|
+
>
|
|
1472
|
+
<input
|
|
1473
|
+
class="${inputClass} border-0"
|
|
1474
|
+
value="${vm.data.data[key]}"
|
|
1475
|
+
type="number"
|
|
1476
|
+
onchange="${gvc.event(e => {
|
|
1477
|
+
vm.data.data[key] = e.value;
|
|
1478
|
+
gvc.notifyDataChange([id, 'drawPreview']);
|
|
1479
|
+
})}"
|
|
1480
|
+
/>
|
|
1481
|
+
</div>
|
|
1482
|
+
`;
|
|
1483
|
+
},
|
|
1484
|
+
divCreate: {
|
|
1485
|
+
class: 'd-flex flex-column',
|
|
1486
|
+
style: 'gap:8px;',
|
|
1149
1487
|
},
|
|
1150
|
-
divCreate: { style: `display: flex;align-items: flex-start;gap: 18px;align-self: stretch;`, class: `flex-column flex-lg-row` },
|
|
1151
1488
|
});
|
|
1152
1489
|
}
|
|
1153
1490
|
return BgWidget.container([
|
|
1154
1491
|
html ` <div class="title-container">
|
|
1155
|
-
|
|
1492
|
+
${BgWidget.goBack(gvc.event(() => {
|
|
1156
1493
|
vm.type = 'list';
|
|
1157
1494
|
}))}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1495
|
+
${BgWidget.title(vm.data.title || '新增商品促銷標籤')}
|
|
1496
|
+
<div class="flex-fill"></div>
|
|
1497
|
+
</div>`,
|
|
1161
1498
|
BgWidget.container([
|
|
1162
1499
|
BgWidget.mainCard(BgWidget.editeInput({
|
|
1163
1500
|
gvc: gvc,
|
|
1164
1501
|
title: '標籤文字',
|
|
1165
1502
|
default: (_a = vm.data.title) !== null && _a !== void 0 ? _a : '',
|
|
1166
1503
|
placeHolder: '請輸入標籤文字',
|
|
1167
|
-
callback:
|
|
1504
|
+
callback: text => {
|
|
1168
1505
|
vm.data.title = text;
|
|
1169
1506
|
gvc.notifyDataChange('drawPreview');
|
|
1170
1507
|
},
|
|
1171
1508
|
})),
|
|
1172
1509
|
BgWidget.mainCard(html `
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1510
|
+
<div class="d-flex flex-column" style="gap: 18px;">
|
|
1511
|
+
${BgWidget.title('標籤樣式')} ${drawColorInput('標籤顏色', 'label_color')}
|
|
1512
|
+
${drawColorInput('文字顏色', 'text_color')} ${drawInput('number', '文字大小', 'text_size')}
|
|
1513
|
+
${drawShapeInput('標籤形狀')}
|
|
1514
|
+
</div>
|
|
1515
|
+
`),
|
|
1516
|
+
BgWidget.mainCard(html `
|
|
1517
|
+
<div class="d-flex flex-column" style="gap: 18px;">
|
|
1518
|
+
${BgWidget.title('標籤位置')} ${drawPreview()}
|
|
1519
|
+
</div>
|
|
1520
|
+
`),
|
|
1178
1521
|
].join(BgWidget.mbContainer(12))),
|
|
1179
1522
|
BgWidget.mbContainer(240),
|
|
1180
1523
|
html ` <div class="update-bar-container">
|
|
1181
|
-
|
|
1524
|
+
${vm.data.id.length === 0
|
|
1182
1525
|
? ''
|
|
1183
1526
|
: BgWidget.danger(gvc.event(() => {
|
|
1184
1527
|
dialog.checkYesOrNot({
|
|
1185
1528
|
text: '確認要刪除此標籤?',
|
|
1186
|
-
callback:
|
|
1529
|
+
callback: bool => {
|
|
1187
1530
|
if (bool) {
|
|
1188
1531
|
vm.labelList = vm.labelList.filter((item) => vm.data.id !== item.id);
|
|
1189
1532
|
ApiUser.setPublicConfig({
|
|
1190
1533
|
key: 'promo-label',
|
|
1191
1534
|
user_id: 'manager',
|
|
1192
1535
|
value: vm.labelList,
|
|
1193
|
-
}).then(
|
|
1536
|
+
}).then(result => {
|
|
1194
1537
|
if (!result.response.result) {
|
|
1195
1538
|
dialog.errorMessage({ text: '設定失敗' });
|
|
1196
1539
|
}
|
|
@@ -1200,10 +1543,10 @@ export class ProductText {
|
|
|
1200
1543
|
},
|
|
1201
1544
|
});
|
|
1202
1545
|
}))}
|
|
1203
|
-
|
|
1546
|
+
${BgWidget.cancel(gvc.event(() => {
|
|
1204
1547
|
vm.type = 'list';
|
|
1205
1548
|
}))}
|
|
1206
|
-
|
|
1549
|
+
${BgWidget.save(gvc.event(() => {
|
|
1207
1550
|
vm.data.updated_time = glitter.ut.dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss');
|
|
1208
1551
|
if (vm.data.id.length === 0) {
|
|
1209
1552
|
vm.data.id = Tool.randomString(10);
|
|
@@ -1217,7 +1560,7 @@ export class ProductText {
|
|
|
1217
1560
|
key: 'promo-label',
|
|
1218
1561
|
user_id: 'manager',
|
|
1219
1562
|
value: vm.labelList,
|
|
1220
|
-
}).then(
|
|
1563
|
+
}).then(result => {
|
|
1221
1564
|
dialog.dataLoading({ visible: false });
|
|
1222
1565
|
if (result.response.result) {
|
|
1223
1566
|
dialog.successMessage({ text: '設定成功' });
|
|
@@ -1230,7 +1573,7 @@ export class ProductText {
|
|
|
1230
1573
|
}
|
|
1231
1574
|
});
|
|
1232
1575
|
}))}
|
|
1233
|
-
|
|
1576
|
+
</div>`,
|
|
1234
1577
|
].join(''));
|
|
1235
1578
|
}
|
|
1236
1579
|
return BgWidget.container(BgWidget.mainCard(html ` <div>tag_edit</div>`));
|