ts-glitter 22.5.7 → 22.5.9
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-advance.js +1 -1
- package/lowcode/cms-plugin/shopping-setting-advance.ts +2 -1
- 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 -3
- package/src/api-public/controllers/index.js.map +1 -1
- package/src/api-public/controllers/index.ts +16 -3
- 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/schedule.js +1 -1
- package/src/api-public/services/schedule.js.map +1 -1
- package/src/api-public/services/schedule.ts +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/api-public/services/user.js +22 -12
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +31 -22
- 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/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
|
@@ -7,1354 +7,1705 @@ import { ApiUser } from '../glitter-base/route/user.js';
|
|
|
7
7
|
import { CheckInput } from '../modules/checkInput.js';
|
|
8
8
|
|
|
9
9
|
const html = String.raw;
|
|
10
|
-
|
|
10
|
+
const css = String.raw;
|
|
11
11
|
type Tag = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
key: string;
|
|
13
|
+
title: string;
|
|
14
|
+
font_size: string;
|
|
15
|
+
font_color: string;
|
|
16
|
+
font_bgr: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
type Example = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
id: string;
|
|
21
|
+
type: 'file' | 'folder';
|
|
22
|
+
title: string;
|
|
23
|
+
data: {
|
|
24
|
+
content: string;
|
|
25
|
+
label_text?: string;
|
|
26
|
+
text_color?: string;
|
|
27
|
+
label_color?: string;
|
|
28
|
+
shape?: string;
|
|
29
|
+
position?: string;
|
|
30
|
+
text_size: string;
|
|
31
|
+
tags: Tag[];
|
|
32
|
+
};
|
|
33
|
+
status: boolean;
|
|
34
|
+
updated_time: string;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
interface ViewModel {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
id: string;
|
|
39
|
+
type: 'list' | 'text_edit' | 'tag_edit' | 'label_edit';
|
|
40
|
+
dataList: any;
|
|
41
|
+
labelList: any;
|
|
42
|
+
data: Example;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
export class ProductText {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
public static main(gvc: GVC) {
|
|
47
|
+
const glitter = gvc.glitter;
|
|
48
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
49
|
+
|
|
50
|
+
function getExample(): Example {
|
|
51
|
+
return {
|
|
52
|
+
id: '',
|
|
53
|
+
type: 'file',
|
|
54
|
+
title: '',
|
|
55
|
+
data: {
|
|
56
|
+
content: '',
|
|
57
|
+
tags: [],
|
|
58
|
+
text_size: '10',
|
|
59
|
+
},
|
|
60
|
+
status: false,
|
|
61
|
+
updated_time: '',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
48
64
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
const vm: ViewModel = {
|
|
66
|
+
id: glitter.getUUID(),
|
|
67
|
+
type: 'list',
|
|
68
|
+
dataList: [],
|
|
69
|
+
labelList: [],
|
|
70
|
+
data: getExample(),
|
|
71
|
+
};
|
|
72
|
+
const ids = {
|
|
73
|
+
content: glitter.getUUID(),
|
|
74
|
+
tag: glitter.getUUID(),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return gvc.bindView({
|
|
78
|
+
bind: vm.id,
|
|
79
|
+
dataList: [{ obj: vm, key: 'type' }],
|
|
80
|
+
view: () => {
|
|
81
|
+
if (vm.type === 'list') {
|
|
82
|
+
function getTextList(list: any) {
|
|
83
|
+
return list.map((item: any) => {
|
|
84
|
+
const ids = [gvc.glitter.getUUID(), gvc.glitter.getUUID()];
|
|
85
|
+
return [
|
|
86
|
+
{
|
|
87
|
+
key: '標籤名稱',
|
|
88
|
+
value: item.title,
|
|
57
89
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
90
|
+
{
|
|
91
|
+
key: '最後更新時間',
|
|
92
|
+
value: gvc.bindView({
|
|
93
|
+
bind: ids[0],
|
|
94
|
+
view: () => {
|
|
95
|
+
if (!item.updated_time) {
|
|
96
|
+
return '尚無更新紀錄';
|
|
97
|
+
}
|
|
98
|
+
return glitter.ut.dateFormat(new Date(item.updated_time), 'yyyy-MM-dd hh:mm:ss');
|
|
99
|
+
},
|
|
100
|
+
}),
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
});
|
|
104
|
+
}
|
|
62
105
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
106
|
+
function getLabelList(list: any) {
|
|
107
|
+
return list.map((item: any) => {
|
|
108
|
+
const ids = [gvc.glitter.getUUID(), gvc.glitter.getUUID()];
|
|
109
|
+
return [
|
|
110
|
+
{
|
|
111
|
+
key: '標籤名稱',
|
|
112
|
+
value: item.title,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
key: '標籤樣式',
|
|
116
|
+
value: item.data.shape,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: '標籤位置',
|
|
120
|
+
value: item.data.position,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
key: '標籤顏色',
|
|
124
|
+
value: html` <div style="background: ${item.data.label_color};width: 26px;height: 26px;"></div> `,
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
});
|
|
128
|
+
}
|
|
74
129
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
130
|
+
function getHtml() {
|
|
131
|
+
return BgWidget.mainCard(
|
|
132
|
+
[
|
|
133
|
+
html` <div class="d-flex align-items-center gap-2 ms-1 mb-3">
|
|
134
|
+
<div class="tx_700">商品促銷標籤</div>
|
|
135
|
+
${BgWidget.questionButton(
|
|
136
|
+
gvc.event(() => {
|
|
137
|
+
BgWidget.quesDialog({
|
|
138
|
+
gvc,
|
|
139
|
+
innerHTML: () => {
|
|
140
|
+
return html`
|
|
141
|
+
<div
|
|
142
|
+
style="width:100%;border-radius: 10px;background: #393939;display: flex;padding: 10px;flex-direction: column;justify-content: center;align-items: flex-start;gap: 16px;"
|
|
143
|
+
>
|
|
144
|
+
<div class="tx_normal text-wrap text-white">
|
|
145
|
+
顯示於商品卡片上方,用於突出推廣特定商品,例如「熱賣中」、「特價」等,以便消費者快速識別商品狀態,提升購物吸引力。
|
|
146
|
+
</div>
|
|
147
|
+
<div class="w-100" style="width: 182.681px;height: 225.135px;flex-shrink: 0;">
|
|
148
|
+
<img
|
|
149
|
+
style="width: 182.681px;height: 225.135px;flex-shrink: 0;"
|
|
150
|
+
src="https://d3jnmi1tfjgtti.cloudfront.net/file/122538856/size1440_s*px$_s4s0sbs5s5sbs6se_messageImage_1730260643019.jpg"
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
`;
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
})
|
|
158
|
+
)}
|
|
159
|
+
</div>`,
|
|
160
|
+
BgWidget.tableV3({
|
|
161
|
+
gvc: gvc,
|
|
162
|
+
getData: vmi => {
|
|
163
|
+
ApiUser.getPublicConfig('promo-label', 'manager').then((data: any) => {
|
|
164
|
+
vm.labelList = (() => {
|
|
165
|
+
return !data.response.value.length ? [] : data.response.value;
|
|
166
|
+
})();
|
|
167
|
+
vmi.originalData = vm.labelList;
|
|
168
|
+
vmi.tableData = getLabelList(vm.labelList);
|
|
169
|
+
vmi.loading = false;
|
|
170
|
+
vmi.callback();
|
|
171
|
+
});
|
|
172
|
+
},
|
|
173
|
+
rowClick: (data, index) => {
|
|
174
|
+
vm.data = vm.labelList[index];
|
|
175
|
+
vm.type = 'label_edit';
|
|
176
|
+
},
|
|
177
|
+
filter: [
|
|
178
|
+
{
|
|
179
|
+
name: '批量刪除',
|
|
180
|
+
event: checkedData => {
|
|
181
|
+
dialog.checkYesOrNot({
|
|
182
|
+
text: '確認要刪除已勾選的促銷標籤?',
|
|
183
|
+
callback: bool => {
|
|
184
|
+
if (bool) {
|
|
185
|
+
vm.labelList = vm.labelList.filter((item: any) => {
|
|
186
|
+
return checkedData.findIndex((d: any) => d.id === item.id) === -1;
|
|
187
|
+
});
|
|
188
|
+
ApiUser.setPublicConfig({
|
|
189
|
+
key: 'promo-label',
|
|
190
|
+
user_id: 'manager',
|
|
191
|
+
value: vm.labelList,
|
|
192
|
+
}).then(result => {
|
|
193
|
+
if (!result.response.result) {
|
|
194
|
+
dialog.errorMessage({ text: '設定失敗' });
|
|
195
|
+
}
|
|
196
|
+
gvc.notifyDataChange(vm.id);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
},
|
|
101
200
|
});
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
hiddenPageSplit: true,
|
|
205
|
+
}),
|
|
206
|
+
html` <div
|
|
207
|
+
class="w-100 d-flex justify-content-center align-items-center gap-2 cursor_pointer"
|
|
208
|
+
style="color: #3366BB"
|
|
209
|
+
onclick="${gvc.event(() => {
|
|
210
|
+
vm.data = getExample();
|
|
211
|
+
vm.type = 'label_edit';
|
|
212
|
+
})}"
|
|
213
|
+
>
|
|
214
|
+
<div style="font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
215
|
+
新增一個標籤
|
|
216
|
+
</div>
|
|
217
|
+
<i class="fa-solid fa-plus"></i>
|
|
218
|
+
</div>`,
|
|
219
|
+
].join('')
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return BgWidget.container(
|
|
224
|
+
[
|
|
225
|
+
BgWidget.mainCard(
|
|
226
|
+
[
|
|
227
|
+
html` <div class="d-flex align-items-center gap-2 ms-1 mb-3">
|
|
228
|
+
<div class="tx_700">商品文本</div>
|
|
229
|
+
${BgWidget.questionButton(
|
|
230
|
+
gvc.event(() => {
|
|
231
|
+
BgWidget.quesDialog({
|
|
232
|
+
gvc,
|
|
233
|
+
innerHTML: () => {
|
|
234
|
+
return html`
|
|
235
|
+
<div
|
|
236
|
+
style="display: flex;padding: 20px;flex-direction: column;justify-content: center;align-items: flex-start;gap: 16px;border-radius: 10px;background: #393939;"
|
|
237
|
+
>
|
|
238
|
+
<div class="tx_normal text-wrap text-white">
|
|
239
|
+
可在商品頁面展示多個自訂文本分頁,如商品規格、退換貨政策等,並能自由選擇每個文本的顯示內容是否統一,提升管理靈活性。
|
|
240
|
+
</div>
|
|
241
|
+
<div class="w-100 border border-1">
|
|
242
|
+
<img src="https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/s348251.png" />
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
`;
|
|
246
|
+
},
|
|
124
247
|
});
|
|
125
|
-
|
|
248
|
+
})
|
|
249
|
+
)}
|
|
250
|
+
</div>`,
|
|
251
|
+
BgWidget.tableV3({
|
|
252
|
+
gvc: gvc,
|
|
253
|
+
getData: vmi => {
|
|
254
|
+
ApiUser.getPublicConfig('text-manager', 'manager').then((data: any) => {
|
|
255
|
+
vm.dataList = (() => {
|
|
256
|
+
return !data.response.value.length ? [] : data.response.value;
|
|
257
|
+
})();
|
|
126
258
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
key: 'promo-label',
|
|
187
|
-
user_id: 'manager',
|
|
188
|
-
value: vm.labelList,
|
|
189
|
-
}).then((result) => {
|
|
190
|
-
if (!result.response.result) {
|
|
191
|
-
dialog.errorMessage({ text: '設定失敗' });
|
|
192
|
-
}
|
|
193
|
-
gvc.notifyDataChange(vm.id);
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
});
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
],
|
|
201
|
-
hiddenPageSplit: true,
|
|
202
|
-
}),
|
|
203
|
-
html` <div
|
|
204
|
-
class="w-100 d-flex justify-content-center align-items-center gap-2 cursor_pointer"
|
|
205
|
-
style="color: #3366BB"
|
|
206
|
-
onclick="${gvc.event(() => {
|
|
207
|
-
vm.data = getExample();
|
|
208
|
-
vm.type = 'label_edit';
|
|
209
|
-
})}"
|
|
210
|
-
>
|
|
211
|
-
<div style="font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">新增一個標籤</div>
|
|
212
|
-
<i class="fa-solid fa-plus"></i>
|
|
213
|
-
</div>`,
|
|
214
|
-
].join('')
|
|
215
|
-
);
|
|
216
|
-
}
|
|
259
|
+
vmi.originalData = vm.dataList;
|
|
260
|
+
vmi.tableData = getTextList(vm.dataList);
|
|
261
|
+
vmi.loading = false;
|
|
262
|
+
vmi.callback();
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
rowClick: (data, index) => {
|
|
266
|
+
vm.data = vm.dataList[index];
|
|
267
|
+
vm.type = 'text_edit';
|
|
268
|
+
},
|
|
269
|
+
filter: [
|
|
270
|
+
{
|
|
271
|
+
name: '批量刪除',
|
|
272
|
+
event: checkedData => {
|
|
273
|
+
dialog.checkYesOrNot({
|
|
274
|
+
text: '確認要刪除已勾選的文本?',
|
|
275
|
+
callback: bool => {
|
|
276
|
+
if (bool) {
|
|
277
|
+
vm.dataList = vm.dataList.filter((item: any) => {
|
|
278
|
+
return checkedData.findIndex((d: any) => d.id === item.id) === -1;
|
|
279
|
+
});
|
|
280
|
+
ApiUser.setPublicConfig({
|
|
281
|
+
key: 'text-manager',
|
|
282
|
+
user_id: 'manager',
|
|
283
|
+
value: vm.dataList,
|
|
284
|
+
}).then(result => {
|
|
285
|
+
if (!result.response.result) {
|
|
286
|
+
dialog.errorMessage({ text: '設定失敗' });
|
|
287
|
+
}
|
|
288
|
+
gvc.notifyDataChange(vm.id);
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
hiddenPageSplit: true,
|
|
297
|
+
}),
|
|
298
|
+
html` <div
|
|
299
|
+
class="w-100 d-flex justify-content-center align-items-center gap-2 cursor_pointer"
|
|
300
|
+
style="color: #3366BB"
|
|
301
|
+
onclick="${gvc.event(() => {
|
|
302
|
+
vm.data = getExample();
|
|
303
|
+
vm.type = 'text_edit';
|
|
304
|
+
})}"
|
|
305
|
+
>
|
|
306
|
+
<div style="font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">
|
|
307
|
+
新增一個文本
|
|
308
|
+
</div>
|
|
309
|
+
<i class="fa-solid fa-plus"></i>
|
|
310
|
+
</div>`,
|
|
311
|
+
].join('')
|
|
312
|
+
),
|
|
313
|
+
html` <div style="margin-top: 15px;"></div>`,
|
|
314
|
+
getHtml(),
|
|
315
|
+
].join('')
|
|
316
|
+
);
|
|
317
|
+
}
|
|
217
318
|
|
|
218
|
-
|
|
219
|
-
[
|
|
220
|
-
BgWidget.mainCard(
|
|
221
|
-
[
|
|
222
|
-
html` <div class="d-flex align-items-center gap-2 ms-1 mb-3">
|
|
223
|
-
<div class="tx_700">商品文本</div>
|
|
224
|
-
${BgWidget.questionButton(
|
|
225
|
-
gvc.event(() => {
|
|
226
|
-
BgWidget.quesDialog({
|
|
227
|
-
gvc,
|
|
228
|
-
innerHTML: () => {
|
|
229
|
-
return html`
|
|
230
|
-
<div
|
|
231
|
-
style="display: flex;padding: 20px;flex-direction: column;justify-content: center;align-items: flex-start;gap: 16px;border-radius: 10px;background: #393939;"
|
|
232
|
-
>
|
|
233
|
-
<div class="tx_normal text-wrap text-white">
|
|
234
|
-
可在商品頁面展示多個自訂文本分頁,如商品規格、退換貨政策等,並能自由選擇每個文本的顯示內容是否統一,提升管理靈活性。
|
|
235
|
-
</div>
|
|
236
|
-
<div class="w-100 border border-1">
|
|
237
|
-
<img src="https://d3jnmi1tfjgtti.cloudfront.net/file/252530754/s348251.png" />
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
`;
|
|
241
|
-
},
|
|
242
|
-
});
|
|
243
|
-
})
|
|
244
|
-
)}
|
|
245
|
-
</div>`,
|
|
246
|
-
BgWidget.tableV3({
|
|
247
|
-
gvc: gvc,
|
|
248
|
-
getData: (vmi) => {
|
|
249
|
-
ApiUser.getPublicConfig('text-manager', 'manager').then((data: any) => {
|
|
250
|
-
vm.dataList = (() => {
|
|
251
|
-
return !data.response.value.length ? [] : data.response.value;
|
|
252
|
-
})();
|
|
319
|
+
const targetText = (text: string) => `#${text}#`;
|
|
253
320
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
vmi.loading = false;
|
|
257
|
-
vmi.callback();
|
|
258
|
-
});
|
|
259
|
-
},
|
|
260
|
-
rowClick: (data, index) => {
|
|
261
|
-
vm.data = vm.dataList[index];
|
|
262
|
-
vm.type = 'text_edit';
|
|
263
|
-
},
|
|
264
|
-
filter: [
|
|
265
|
-
{
|
|
266
|
-
name: '批量刪除',
|
|
267
|
-
event: (checkedData) => {
|
|
268
|
-
dialog.checkYesOrNot({
|
|
269
|
-
text: '確認要刪除已勾選的文本?',
|
|
270
|
-
callback: (bool) => {
|
|
271
|
-
if (bool) {
|
|
272
|
-
vm.dataList = vm.dataList.filter((item: any) => {
|
|
273
|
-
return checkedData.findIndex((d: any) => d.id === item.id) === -1;
|
|
274
|
-
});
|
|
275
|
-
ApiUser.setPublicConfig({
|
|
276
|
-
key: 'text-manager',
|
|
277
|
-
user_id: 'manager',
|
|
278
|
-
value: vm.dataList,
|
|
279
|
-
}).then((result) => {
|
|
280
|
-
if (!result.response.result) {
|
|
281
|
-
dialog.errorMessage({ text: '設定失敗' });
|
|
282
|
-
}
|
|
283
|
-
gvc.notifyDataChange(vm.id);
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
},
|
|
287
|
-
});
|
|
288
|
-
},
|
|
289
|
-
},
|
|
290
|
-
],
|
|
291
|
-
hiddenPageSplit: true,
|
|
292
|
-
}),
|
|
293
|
-
html` <div
|
|
294
|
-
class="w-100 d-flex justify-content-center align-items-center gap-2 cursor_pointer"
|
|
295
|
-
style="color: #3366BB"
|
|
296
|
-
onclick="${gvc.event(() => {
|
|
297
|
-
vm.data = getExample();
|
|
298
|
-
vm.type = 'text_edit';
|
|
299
|
-
})}"
|
|
300
|
-
>
|
|
301
|
-
<div style="font-size: 16px; font-family: Noto Sans; font-weight: 400; word-wrap: break-word">新增一個文本</div>
|
|
302
|
-
<i class="fa-solid fa-plus"></i>
|
|
303
|
-
</div>`,
|
|
304
|
-
].join('')
|
|
305
|
-
),
|
|
306
|
-
html` <div style="margin-top: 15px;"></div>`,
|
|
307
|
-
getHtml(),
|
|
308
|
-
].join('')
|
|
309
|
-
);
|
|
310
|
-
}
|
|
321
|
+
function originRichtext(text: string) {
|
|
322
|
+
let gText = `${text}`;
|
|
311
323
|
|
|
312
|
-
|
|
324
|
+
if (vm.data.data.tags && vm.data.data.tags.length > 0) {
|
|
325
|
+
const tempElement = document.createElement('div');
|
|
326
|
+
tempElement.innerHTML = gText;
|
|
313
327
|
|
|
314
|
-
|
|
315
|
-
|
|
328
|
+
for (const item of vm.data.data.tags) {
|
|
329
|
+
// const imgElements = tempElement.querySelectorAll(`img[alt="${item.key}"]`) as any;
|
|
330
|
+
// if (imgElements.length > 0) {
|
|
331
|
+
// imgElements.forEach((imgElement: any) => {
|
|
332
|
+
// const newText = document.createTextNode(`@{{${item.key}}}`);
|
|
333
|
+
// imgElement.parentNode.replaceChild(newText, imgElement);
|
|
334
|
+
// });
|
|
335
|
+
// gText = tempElement.innerHTML;
|
|
336
|
+
// }
|
|
337
|
+
const regex = new RegExp(targetText(item.title), 'g');
|
|
338
|
+
gText = gText.replace(regex, `@{{${item.key}}}`);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
316
341
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
tempElement.innerHTML = gText;
|
|
342
|
+
return gText;
|
|
343
|
+
}
|
|
320
344
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
// if (imgElements.length > 0) {
|
|
324
|
-
// imgElements.forEach((imgElement: any) => {
|
|
325
|
-
// const newText = document.createTextNode(`@{{${item.key}}}`);
|
|
326
|
-
// imgElement.parentNode.replaceChild(newText, imgElement);
|
|
327
|
-
// });
|
|
328
|
-
// gText = tempElement.innerHTML;
|
|
329
|
-
// }
|
|
330
|
-
const regex = new RegExp(targetText(item.title), 'g');
|
|
331
|
-
gText = gText.replace(regex, `@{{${item.key}}}`);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
345
|
+
function generateRichtext(text: string) {
|
|
346
|
+
let gText = `${text}`;
|
|
334
347
|
|
|
335
|
-
|
|
336
|
-
|
|
348
|
+
if (vm.data.data.tags && vm.data.data.tags.length > 0) {
|
|
349
|
+
for (const item of vm.data.data.tags) {
|
|
350
|
+
// const textImage = html`<img
|
|
351
|
+
// alt="${item.key}"
|
|
352
|
+
// class="rounded-2"
|
|
353
|
+
// src="https://assets.imgix.net/~text?bg=4d86db&txtclr=f2f2f2&w=${Tool.twenLength(item.title) *
|
|
354
|
+
// 20}&h=40&txtsize=12&txt=${item.title}&txtfont=Helvetica&txtalign=middle,center"
|
|
355
|
+
// />`;
|
|
356
|
+
const textImage = targetText(item.title);
|
|
357
|
+
const regex = new RegExp(`@{{${item.key}}}`, 'g');
|
|
358
|
+
gText = gText.replace(regex, textImage);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
337
361
|
|
|
338
|
-
|
|
339
|
-
|
|
362
|
+
return gText;
|
|
363
|
+
}
|
|
340
364
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
365
|
+
function editDocumentTag(index: number) {
|
|
366
|
+
const item = vm.data.data.tags[index];
|
|
367
|
+
const originText = `${item.title}`;
|
|
368
|
+
BgWidget.dialog({
|
|
369
|
+
gvc,
|
|
370
|
+
title: '編輯標籤',
|
|
371
|
+
innerHTML: gvc => {
|
|
372
|
+
return html` <div>
|
|
373
|
+
${[
|
|
374
|
+
html` <div class="tx_normal">標籤名稱</div>`,
|
|
375
|
+
BgWidget.editeInput({
|
|
376
|
+
gvc,
|
|
377
|
+
title: '',
|
|
378
|
+
default: item.title,
|
|
379
|
+
placeHolder: '',
|
|
380
|
+
callback: text => {
|
|
381
|
+
item.title = text;
|
|
382
|
+
},
|
|
383
|
+
}),
|
|
384
|
+
html` <div class="tx_normal mt-2">字體大小</div>`,
|
|
385
|
+
BgWidget.editeInput({
|
|
386
|
+
gvc,
|
|
387
|
+
title: '',
|
|
388
|
+
default: item.font_size,
|
|
389
|
+
type: 'number',
|
|
390
|
+
placeHolder: '',
|
|
391
|
+
callback: text => {
|
|
392
|
+
item.font_size = text;
|
|
393
|
+
},
|
|
394
|
+
}),
|
|
395
|
+
html` <div class="tx_normal mt-2">字體顏色</div>`,
|
|
396
|
+
EditorElem.colorSelect({
|
|
397
|
+
gvc: gvc,
|
|
398
|
+
title: '',
|
|
399
|
+
callback: text => {
|
|
400
|
+
item.font_color = text;
|
|
401
|
+
gvc.recreateView();
|
|
402
|
+
},
|
|
403
|
+
def: item.font_color,
|
|
404
|
+
}),
|
|
405
|
+
html` <div class="tx_normal mt-2">背景顏色</div>`,
|
|
406
|
+
EditorElem.colorSelect({
|
|
407
|
+
gvc: gvc,
|
|
408
|
+
title: '',
|
|
409
|
+
callback: text => {
|
|
410
|
+
item.font_bgr = text;
|
|
411
|
+
gvc.recreateView();
|
|
412
|
+
},
|
|
413
|
+
def: item.font_bgr,
|
|
414
|
+
}),
|
|
415
|
+
].join('')}
|
|
416
|
+
</div>`;
|
|
417
|
+
},
|
|
418
|
+
save: {
|
|
419
|
+
event: () => {
|
|
420
|
+
return new Promise<boolean>(resolve => {
|
|
421
|
+
const sameTitleItem = vm.data.data.tags.findIndex(tag => tag.title === item.title);
|
|
422
|
+
if (sameTitleItem !== index && sameTitleItem !== -1) {
|
|
423
|
+
dialog.errorMessage({
|
|
424
|
+
text: html` <div class="text-center">
|
|
425
|
+
標籤名稱「${item.title}」已存在<br />請更換一個標籤名稱
|
|
426
|
+
</div>`,
|
|
427
|
+
});
|
|
428
|
+
resolve(false);
|
|
429
|
+
} else {
|
|
430
|
+
gvc.notifyDataChange([ids.tag, ids.content]);
|
|
431
|
+
resolve(true);
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
cancel: {
|
|
437
|
+
event: () =>
|
|
438
|
+
new Promise<boolean>(resolve => {
|
|
439
|
+
item.title = originText;
|
|
440
|
+
gvc.notifyDataChange(ids.tag);
|
|
441
|
+
resolve(true);
|
|
442
|
+
}),
|
|
443
|
+
},
|
|
444
|
+
xmark: () =>
|
|
445
|
+
new Promise<boolean>(resolve => {
|
|
446
|
+
item.title = originText;
|
|
447
|
+
gvc.notifyDataChange(ids.tag);
|
|
448
|
+
resolve(true);
|
|
449
|
+
}),
|
|
450
|
+
});
|
|
451
|
+
}
|
|
354
452
|
|
|
355
|
-
|
|
356
|
-
|
|
453
|
+
if (vm.type === 'text_edit') {
|
|
454
|
+
return BgWidget.container(
|
|
455
|
+
[
|
|
456
|
+
html` <div class="title-container">
|
|
457
|
+
${BgWidget.goBack(
|
|
458
|
+
gvc.event(() => {
|
|
459
|
+
vm.type = 'list';
|
|
460
|
+
})
|
|
461
|
+
)}
|
|
462
|
+
${BgWidget.title(vm.data.title || '新增文本')}
|
|
463
|
+
<div class="flex-fill"></div>
|
|
464
|
+
</div>`,
|
|
465
|
+
BgWidget.container(
|
|
466
|
+
[
|
|
467
|
+
BgWidget.mainCard(
|
|
468
|
+
BgWidget.editeInput({
|
|
469
|
+
gvc: gvc,
|
|
470
|
+
title: '文本標題',
|
|
471
|
+
default: vm.data.title,
|
|
472
|
+
placeHolder: '請輸入文本標題',
|
|
473
|
+
callback: text => {
|
|
474
|
+
vm.data.title = text;
|
|
475
|
+
},
|
|
476
|
+
})
|
|
477
|
+
),
|
|
357
478
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
479
|
+
BgWidget.container1x2(
|
|
480
|
+
{
|
|
481
|
+
html: BgWidget.mainCard(
|
|
482
|
+
html` <div>
|
|
483
|
+
<div class="title-container px-0">
|
|
484
|
+
<div class="tx_normal fw-normal">文本說明</div>
|
|
485
|
+
<div class="flex-fill"></div>
|
|
486
|
+
${BgWidget.aiChatButton({ gvc, select: 'writer' })}
|
|
487
|
+
</div>
|
|
488
|
+
<div style="margin: 8px 0">
|
|
489
|
+
${gvc.bindView(
|
|
490
|
+
(() => {
|
|
491
|
+
return {
|
|
492
|
+
bind: ids.content,
|
|
493
|
+
view: () => {
|
|
494
|
+
return BgWidget.richTextEditor({
|
|
495
|
+
gvc: gvc,
|
|
496
|
+
content: generateRichtext(vm.data.data.content) || '',
|
|
497
|
+
callback: content => {
|
|
498
|
+
vm.data.data.content = originRichtext(content);
|
|
499
|
+
},
|
|
500
|
+
title: '顯示文本編輯',
|
|
501
|
+
});
|
|
502
|
+
},
|
|
503
|
+
onCreate: () => {},
|
|
504
|
+
};
|
|
505
|
+
})()
|
|
506
|
+
)}
|
|
507
|
+
</div>
|
|
508
|
+
</div>`
|
|
509
|
+
),
|
|
510
|
+
ratio: 70,
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
html: gvc.bindView(
|
|
514
|
+
(() => {
|
|
515
|
+
return {
|
|
516
|
+
bind: ids.tag,
|
|
517
|
+
view: () => {
|
|
518
|
+
vm.data.data.tags = vm.data.data.tags ?? [];
|
|
519
|
+
return BgWidget.mainCard(
|
|
520
|
+
html` <div>
|
|
521
|
+
<div class="title-container px-0">
|
|
522
|
+
<div class="tx_normal fw-normal">標籤</div>
|
|
523
|
+
</div>
|
|
524
|
+
<div style="margin: 12px 0">
|
|
525
|
+
${gvc.map(
|
|
526
|
+
vm.data.data.tags.map((item, index) => {
|
|
527
|
+
return html` <div
|
|
528
|
+
style="display: flex; align-items: center; justify-content: space-between; margin-top: 8px;"
|
|
529
|
+
>
|
|
530
|
+
${item.title}
|
|
531
|
+
<div class="d-flex gap-3">
|
|
532
|
+
<i
|
|
533
|
+
class="fa-regular fa-copy cursor_pointer"
|
|
534
|
+
onclick="${gvc.event(() => {
|
|
535
|
+
navigator.clipboard.writeText(targetText(item.title));
|
|
536
|
+
BgWidget.jumpAlert({
|
|
537
|
+
gvc,
|
|
538
|
+
text: '複製成功',
|
|
539
|
+
justify: 'top',
|
|
540
|
+
align: 'center',
|
|
541
|
+
});
|
|
542
|
+
})}"
|
|
543
|
+
></i>
|
|
544
|
+
<i
|
|
545
|
+
class="fa-solid fa-pencil cursor_pointer"
|
|
546
|
+
onclick="${gvc.event(() => {
|
|
547
|
+
editDocumentTag(index);
|
|
548
|
+
})}"
|
|
549
|
+
></i>
|
|
550
|
+
<i
|
|
551
|
+
class="fa-regular fa-trash cursor_pointer"
|
|
552
|
+
onclick="${gvc.event(() => {
|
|
553
|
+
if (vm.data.data.content.includes(`@{{${item.key}}}`)) {
|
|
554
|
+
dialog.warningMessage({
|
|
555
|
+
callback: bool => {
|
|
556
|
+
if (bool) {
|
|
557
|
+
const regex = new RegExp(`@{{${item.key}}}`, 'g');
|
|
558
|
+
vm.data.data.tags = vm.data.data.tags.filter(
|
|
559
|
+
tag => tag.key !== item.key
|
|
560
|
+
);
|
|
561
|
+
vm.data.data.content = vm.data.data.content.replace(regex, '');
|
|
562
|
+
gvc.notifyDataChange([ids.tag, ids.content]);
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
text: `此操作將會移除文本內所有「${item.title}」的標籤<br/>確定要執行嗎?`,
|
|
566
|
+
});
|
|
567
|
+
} else {
|
|
568
|
+
vm.data.data.tags = vm.data.data.tags.filter(
|
|
569
|
+
tag => tag.key !== item.key
|
|
570
|
+
);
|
|
571
|
+
gvc.notifyDataChange([ids.tag, ids.content]);
|
|
572
|
+
}
|
|
573
|
+
})}"
|
|
574
|
+
></i>
|
|
575
|
+
</div>
|
|
576
|
+
</div>`;
|
|
577
|
+
})
|
|
578
|
+
)}
|
|
579
|
+
</div>
|
|
580
|
+
${BgWidget.plusButton({
|
|
581
|
+
title: '新增一個標籤',
|
|
582
|
+
event: gvc.event(() => {
|
|
583
|
+
const limit = 30;
|
|
584
|
+
const defaultLabel = '新標籤';
|
|
585
|
+
|
|
586
|
+
if (vm.data.data.tags.length + 1 > limit) {
|
|
416
587
|
dialog.errorMessage({
|
|
417
|
-
|
|
588
|
+
text: `標籤上限為${limit}個`,
|
|
418
589
|
});
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
function getNextLabel() {
|
|
594
|
+
const existingLabels = vm.data.data.tags.slice();
|
|
595
|
+
const labels = existingLabels.map(label => label.title);
|
|
596
|
+
const numbers = Array.from({ length: limit }, (_, i) => {
|
|
597
|
+
return (i + 1).toString().padStart(2, '0');
|
|
598
|
+
});
|
|
599
|
+
for (const n of numbers) {
|
|
600
|
+
const label = labels.find(label => label === `${defaultLabel}${n}`);
|
|
601
|
+
if (!label) return `${defaultLabel}${n}`;
|
|
602
|
+
}
|
|
603
|
+
return `${defaultLabel}${vm.data.data.tags.length + 1}`;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
vm.data.data.tags.push({
|
|
607
|
+
key: Tool.randomString(16),
|
|
608
|
+
title: getNextLabel(),
|
|
609
|
+
font_size: '16',
|
|
610
|
+
font_color: '#393939',
|
|
611
|
+
font_bgr: '#FFFFFF',
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
gvc.notifyDataChange(ids.tag);
|
|
615
|
+
editDocumentTag(vm.data.data.tags.length - 1);
|
|
616
|
+
}),
|
|
617
|
+
})}
|
|
618
|
+
</div>`
|
|
619
|
+
);
|
|
425
620
|
},
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
621
|
+
};
|
|
622
|
+
})()
|
|
623
|
+
),
|
|
624
|
+
ratio: 30,
|
|
625
|
+
}
|
|
626
|
+
),
|
|
627
|
+
].join(BgWidget.mbContainer(12))
|
|
628
|
+
),
|
|
629
|
+
BgWidget.mbContainer(240),
|
|
630
|
+
html` <div class="update-bar-container">
|
|
631
|
+
${vm.data.id.length === 0
|
|
632
|
+
? ''
|
|
633
|
+
: BgWidget.danger(
|
|
634
|
+
gvc.event(() => {
|
|
635
|
+
dialog.checkYesOrNot({
|
|
636
|
+
text: '確認要刪除此文本?',
|
|
637
|
+
callback: bool => {
|
|
638
|
+
if (bool) {
|
|
639
|
+
vm.dataList = vm.dataList.filter((item: any) => vm.data.id !== item.id);
|
|
640
|
+
ApiUser.setPublicConfig({
|
|
641
|
+
key: 'text-manager',
|
|
642
|
+
user_id: 'manager',
|
|
643
|
+
value: vm.dataList,
|
|
644
|
+
}).then(result => {
|
|
645
|
+
if (!result.response.result) {
|
|
646
|
+
dialog.errorMessage({ text: '設定失敗' });
|
|
647
|
+
}
|
|
648
|
+
vm.type = 'list';
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
});
|
|
653
|
+
})
|
|
654
|
+
)}
|
|
655
|
+
${BgWidget.cancel(
|
|
656
|
+
gvc.event(() => {
|
|
657
|
+
vm.type = 'list';
|
|
658
|
+
})
|
|
659
|
+
)}
|
|
660
|
+
${BgWidget.save(
|
|
661
|
+
gvc.event(() => {
|
|
662
|
+
try {
|
|
663
|
+
if (CheckInput.isEmpty(vm.data.title)) {
|
|
664
|
+
dialog.errorMessage({ text: '請輸入文本標題' });
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
443
667
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
)}
|
|
453
|
-
${BgWidget.title(vm.data.title || '新增文本')}
|
|
454
|
-
<div class="flex-fill"></div>
|
|
455
|
-
</div>`,
|
|
456
|
-
BgWidget.container(
|
|
457
|
-
[
|
|
458
|
-
BgWidget.mainCard(
|
|
459
|
-
BgWidget.editeInput({
|
|
460
|
-
gvc: gvc,
|
|
461
|
-
title: '文本標題',
|
|
462
|
-
default: vm.data.title,
|
|
463
|
-
placeHolder: '請輸入文本標題',
|
|
464
|
-
callback: (text) => {
|
|
465
|
-
vm.data.title = text;
|
|
466
|
-
},
|
|
467
|
-
})
|
|
468
|
-
),
|
|
668
|
+
if (vm.data.data.tags) {
|
|
669
|
+
for (const tag of vm.data.data.tags) {
|
|
670
|
+
if (!vm.data.data.content.includes(`@{{${tag.key}}}`)) {
|
|
671
|
+
dialog.errorMessage({ text: `標籤名「${tag.title}」尚未使用<br />請加入至文本或刪除標籤` });
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
469
676
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
${BgWidget.aiChatButton({ gvc, select: 'writer' })}
|
|
478
|
-
</div>
|
|
479
|
-
<div style="margin: 8px 0">
|
|
480
|
-
${gvc.bindView(
|
|
481
|
-
(() => {
|
|
482
|
-
return {
|
|
483
|
-
bind: ids.content,
|
|
484
|
-
view: () => {
|
|
485
|
-
return BgWidget.richTextEditor({
|
|
486
|
-
gvc: gvc,
|
|
487
|
-
content: generateRichtext(vm.data.data.content) || '',
|
|
488
|
-
callback: (content) => {
|
|
489
|
-
vm.data.data.content = originRichtext(content);
|
|
490
|
-
},
|
|
491
|
-
title: '顯示文本編輯'
|
|
492
|
-
})
|
|
493
|
-
},
|
|
494
|
-
onCreate: () => {
|
|
495
|
-
|
|
496
|
-
},
|
|
497
|
-
};
|
|
498
|
-
})()
|
|
499
|
-
)}
|
|
500
|
-
</div>
|
|
501
|
-
</div>`
|
|
502
|
-
),
|
|
503
|
-
ratio: 70,
|
|
504
|
-
},
|
|
505
|
-
{
|
|
506
|
-
html: gvc.bindView(
|
|
507
|
-
(() => {
|
|
508
|
-
return {
|
|
509
|
-
bind: ids.tag,
|
|
510
|
-
view: () => {
|
|
511
|
-
vm.data.data.tags = vm.data.data.tags ?? [];
|
|
512
|
-
return BgWidget.mainCard(
|
|
513
|
-
html`<div>
|
|
514
|
-
<div class="title-container px-0">
|
|
515
|
-
<div class="tx_normal fw-normal">標籤</div>
|
|
516
|
-
</div>
|
|
517
|
-
<div style="margin: 12px 0">
|
|
518
|
-
${gvc.map(
|
|
519
|
-
vm.data.data.tags.map((item, index) => {
|
|
520
|
-
return html` <div style="display: flex; align-items: center; justify-content: space-between; margin-top: 8px;">
|
|
521
|
-
${item.title}
|
|
522
|
-
<div class="d-flex gap-3">
|
|
523
|
-
<i
|
|
524
|
-
class="fa-regular fa-copy cursor_pointer"
|
|
525
|
-
onclick="${gvc.event(() => {
|
|
526
|
-
navigator.clipboard.writeText(targetText(item.title));
|
|
527
|
-
BgWidget.jumpAlert({
|
|
528
|
-
gvc,
|
|
529
|
-
text: '複製成功',
|
|
530
|
-
justify: 'top',
|
|
531
|
-
align: 'center',
|
|
532
|
-
});
|
|
533
|
-
})}"
|
|
534
|
-
></i>
|
|
535
|
-
<i
|
|
536
|
-
class="fa-solid fa-pencil cursor_pointer"
|
|
537
|
-
onclick="${gvc.event(() => {
|
|
538
|
-
editDocumentTag(index);
|
|
539
|
-
})}"
|
|
540
|
-
></i>
|
|
541
|
-
<i
|
|
542
|
-
class="fa-regular fa-trash cursor_pointer"
|
|
543
|
-
onclick="${gvc.event(() => {
|
|
544
|
-
if (vm.data.data.content.includes(`@{{${item.key}}}`)) {
|
|
545
|
-
dialog.warningMessage({
|
|
546
|
-
callback: (bool) => {
|
|
547
|
-
if (bool) {
|
|
548
|
-
const regex = new RegExp(`@{{${item.key}}}`, 'g');
|
|
549
|
-
vm.data.data.tags = vm.data.data.tags.filter((tag) => tag.key !== item.key);
|
|
550
|
-
vm.data.data.content = vm.data.data.content.replace(regex, '');
|
|
551
|
-
gvc.notifyDataChange([ids.tag, ids.content]);
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
text: `此操作將會移除文本內所有「${item.title}」的標籤<br/>確定要執行嗎?`,
|
|
555
|
-
});
|
|
556
|
-
} else {
|
|
557
|
-
vm.data.data.tags = vm.data.data.tags.filter((tag) => tag.key !== item.key);
|
|
558
|
-
gvc.notifyDataChange([ids.tag, ids.content]);
|
|
559
|
-
}
|
|
560
|
-
})}"
|
|
561
|
-
></i>
|
|
562
|
-
</div>
|
|
563
|
-
</div>`;
|
|
564
|
-
})
|
|
565
|
-
)}
|
|
566
|
-
</div>
|
|
567
|
-
${BgWidget.plusButton({
|
|
568
|
-
title: '新增一個標籤',
|
|
569
|
-
event: gvc.event(() => {
|
|
570
|
-
const limit = 30;
|
|
571
|
-
const defaultLabel = '新標籤';
|
|
677
|
+
vm.data.updated_time = glitter.ut.dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss');
|
|
678
|
+
if (vm.data.id.length === 0) {
|
|
679
|
+
vm.data.id = Tool.randomString(10);
|
|
680
|
+
vm.dataList.push(vm.data);
|
|
681
|
+
} else {
|
|
682
|
+
vm.dataList[vm.dataList.findIndex((item: { id: string }) => item.id === vm.data.id)] = vm.data;
|
|
683
|
+
}
|
|
572
684
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
685
|
+
dialog.dataLoading({ text: '設定中...', visible: true });
|
|
686
|
+
ApiUser.setPublicConfig({
|
|
687
|
+
key: 'text-manager',
|
|
688
|
+
user_id: 'manager',
|
|
689
|
+
value: vm.dataList,
|
|
690
|
+
}).then(result => {
|
|
691
|
+
dialog.dataLoading({ visible: false });
|
|
692
|
+
if (result.response.result) {
|
|
693
|
+
dialog.successMessage({ text: '設定成功' });
|
|
694
|
+
setTimeout(() => {
|
|
695
|
+
vm.type = 'list';
|
|
696
|
+
}, 200);
|
|
697
|
+
} else {
|
|
698
|
+
dialog.errorMessage({ text: '設定失敗' });
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
} catch (e) {
|
|
702
|
+
console.log(`error`, e);
|
|
703
|
+
return;
|
|
704
|
+
``;
|
|
705
|
+
}
|
|
706
|
+
})
|
|
707
|
+
)}
|
|
708
|
+
</div>`,
|
|
709
|
+
].join('')
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
if (vm.type === 'label_edit') {
|
|
713
|
+
function drawColorInput(title: string, key: 'label_color' | 'text_color') {
|
|
714
|
+
const id = gvc.glitter.getUUID();
|
|
715
|
+
const inputClass = gvc.glitter.getUUID();
|
|
716
|
+
return gvc.bindView({
|
|
717
|
+
bind: id,
|
|
718
|
+
view: () => {
|
|
719
|
+
vm.data.data['label_color'] = vm.data.data['label_color'] ?? '#393939';
|
|
720
|
+
vm.data.data['text_color'] = vm.data.data['text_color'] ?? '#FFFFFF';
|
|
721
|
+
return html`
|
|
722
|
+
<div style="font-size: 16px;font-style: normal;font-weight: 400;color:#393939;">${title}</div>
|
|
723
|
+
<div
|
|
724
|
+
class="d-flex "
|
|
725
|
+
style="padding: 12px 10px;gap: 10px;cursor: pointer;border-radius: 7px;border: 1px solid #DDD;"
|
|
726
|
+
onclick="${gvc.event(() => {
|
|
727
|
+
(document.querySelector(`.${inputClass}`) as HTMLElement)!.click();
|
|
728
|
+
})}"
|
|
729
|
+
>
|
|
730
|
+
<input
|
|
731
|
+
class="d-none ${inputClass}"
|
|
732
|
+
value="${vm.data.data[key]}"
|
|
733
|
+
type="color"
|
|
734
|
+
onchange="${gvc.event(e => {
|
|
735
|
+
vm.data.data[key] = e.value;
|
|
736
|
+
gvc.notifyDataChange([id, 'drawPreview']);
|
|
737
|
+
})}"
|
|
738
|
+
/>
|
|
739
|
+
<div
|
|
740
|
+
style="width: 24px;height: 24px;flex-shrink: 0;border-radius: 3px;background: ${vm.data.data[
|
|
741
|
+
key
|
|
742
|
+
] ?? '#393939'};border: 1px solid #393939;"
|
|
743
|
+
></div>
|
|
744
|
+
<div style="color: #393939;font-size: 16px; font-weight: 400; ">
|
|
745
|
+
${vm.data.data[key] ?? '#393939'}
|
|
746
|
+
</div>
|
|
747
|
+
</div>
|
|
748
|
+
`;
|
|
749
|
+
},
|
|
750
|
+
divCreate: {
|
|
751
|
+
class: 'd-flex flex-column',
|
|
752
|
+
style: 'gap:8px;',
|
|
753
|
+
},
|
|
754
|
+
});
|
|
755
|
+
}
|
|
579
756
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
757
|
+
function drawShapeInput(title: string) {
|
|
758
|
+
const id = gvc.glitter.getUUID();
|
|
759
|
+
const inputClass = gvc.glitter.getUUID();
|
|
760
|
+
return gvc.bindView({
|
|
761
|
+
bind: id,
|
|
762
|
+
view: () => {
|
|
763
|
+
let shapeArray = [
|
|
764
|
+
{
|
|
765
|
+
title: '矩形',
|
|
766
|
+
shape: html`
|
|
767
|
+
<svg width="64" height="30" viewBox="0 0 64 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
768
|
+
<rect y="0.666016" width="64" height="29.3333" rx="1.33333" fill="#D2D2D2" />
|
|
769
|
+
</svg>
|
|
770
|
+
`,
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
title: '橢圓',
|
|
774
|
+
shape: html`
|
|
775
|
+
<svg width="64" height="30" viewBox="0 0 64 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
776
|
+
<rect y="0.666016" width="64" height="29.3333" rx="14.6667" fill="#D2D2D2" />
|
|
777
|
+
</svg>
|
|
778
|
+
`,
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
title: '標籤',
|
|
782
|
+
shape: html`
|
|
783
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
784
|
+
<path
|
|
785
|
+
fill-rule="evenodd"
|
|
786
|
+
clip-rule="evenodd"
|
|
787
|
+
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"
|
|
788
|
+
fill="#D9D9D9"
|
|
789
|
+
/>
|
|
790
|
+
</svg>
|
|
791
|
+
`,
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
title: '彩帶(橫)',
|
|
795
|
+
shape: html`
|
|
796
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
797
|
+
<path
|
|
798
|
+
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"
|
|
799
|
+
fill="#D9D9D9"
|
|
800
|
+
/>
|
|
801
|
+
</svg>
|
|
802
|
+
`,
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
title: '彩帶(直)',
|
|
806
|
+
shape: html`
|
|
807
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
808
|
+
<path
|
|
809
|
+
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"
|
|
810
|
+
fill="#D9D9D9"
|
|
811
|
+
/>
|
|
812
|
+
</svg>
|
|
813
|
+
`,
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
title: '圓形',
|
|
817
|
+
shape: html`
|
|
818
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
819
|
+
<circle cx="37.333" cy="36" r="28" fill="#D9D9D9" />
|
|
820
|
+
</svg>
|
|
821
|
+
`,
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
title: '梯形',
|
|
825
|
+
shape: html`
|
|
826
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
827
|
+
<path d="M33.6632 4H68L4 68V33.6632L33.6632 4Z" fill="#D9D9D9" />
|
|
828
|
+
</svg>
|
|
829
|
+
`,
|
|
830
|
+
},
|
|
831
|
+
];
|
|
832
|
+
vm.data.data.shape = vm.data.data.shape ?? '矩形';
|
|
592
833
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
834
|
+
return html`
|
|
835
|
+
<div style="font-size: 16px;font-weight: 400;">${title}</div>
|
|
836
|
+
<div style="font-size: 14px;font-weight: 400;color: #8D8D8D;">梯形與圓形字數建議不要超過 3 個</div>
|
|
837
|
+
${gvc.bindView({
|
|
838
|
+
bind: 'shape',
|
|
839
|
+
view: () => {
|
|
840
|
+
return shapeArray
|
|
841
|
+
.map(data => {
|
|
842
|
+
return html`
|
|
843
|
+
<div style="display: flex;flex-direction: column;align-items: center;gap: 8px;">
|
|
844
|
+
<div
|
|
845
|
+
class="d-flex align-items-center justify-content-center"
|
|
846
|
+
style="width: 80px;height: 80px;"
|
|
847
|
+
>
|
|
848
|
+
${data.shape}
|
|
849
|
+
</div>
|
|
850
|
+
<div
|
|
851
|
+
class="d-flex align-items-center justify-content-center"
|
|
852
|
+
style="font-size: 16px;font-style: normal;font-weight: 400;gap: 6px;cursor:pointer;"
|
|
853
|
+
onclick="${gvc.event(() => {
|
|
854
|
+
vm.data.data.shape = data.title;
|
|
855
|
+
gvc.notifyDataChange(['shape', 'drawPreview']);
|
|
856
|
+
})}"
|
|
857
|
+
>
|
|
858
|
+
${vm.data.data.shape == data.title
|
|
859
|
+
? html` <div
|
|
860
|
+
style="width: 16px;height: 16px;border-radius: 20px;border:4px solid #393939;"
|
|
861
|
+
></div>`
|
|
862
|
+
: html` <div
|
|
863
|
+
style="width: 16px;height: 16px;border-radius: 20px;border: 1px solid #DDD;background: #FFF;"
|
|
864
|
+
></div>`}
|
|
865
|
+
${data.title}
|
|
866
|
+
</div>
|
|
867
|
+
</div>
|
|
868
|
+
`;
|
|
869
|
+
})
|
|
870
|
+
.join('');
|
|
871
|
+
},
|
|
872
|
+
divCreate: { class: 'w-100 d-flex flex-wrap', style: `gap:42px;` },
|
|
873
|
+
})}
|
|
874
|
+
`;
|
|
875
|
+
},
|
|
876
|
+
divCreate: {
|
|
877
|
+
class: 'd-flex flex-column',
|
|
878
|
+
style: 'gap:4px;',
|
|
879
|
+
},
|
|
880
|
+
});
|
|
881
|
+
}
|
|
600
882
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
),
|
|
611
|
-
ratio: 30,
|
|
612
|
-
}
|
|
613
|
-
),
|
|
614
|
-
].join(BgWidget.mbContainer(12))
|
|
615
|
-
),
|
|
616
|
-
BgWidget.mbContainer(240),
|
|
617
|
-
html` <div class="update-bar-container">
|
|
618
|
-
${vm.data.id.length === 0
|
|
619
|
-
? ''
|
|
620
|
-
: BgWidget.danger(
|
|
621
|
-
gvc.event(() => {
|
|
622
|
-
dialog.checkYesOrNot({
|
|
623
|
-
text: '確認要刪除此文本?',
|
|
624
|
-
callback: (bool) => {
|
|
625
|
-
if (bool) {
|
|
626
|
-
vm.dataList = vm.dataList.filter((item: any) => vm.data.id !== item.id);
|
|
627
|
-
ApiUser.setPublicConfig({
|
|
628
|
-
key: 'text-manager',
|
|
629
|
-
user_id: 'manager',
|
|
630
|
-
value: vm.dataList,
|
|
631
|
-
}).then((result) => {
|
|
632
|
-
if (!result.response.result) {
|
|
633
|
-
dialog.errorMessage({ text: '設定失敗' });
|
|
634
|
-
}
|
|
635
|
-
vm.type = 'list';
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
},
|
|
639
|
-
});
|
|
640
|
-
})
|
|
641
|
-
)}
|
|
642
|
-
${BgWidget.cancel(
|
|
643
|
-
gvc.event(() => {
|
|
644
|
-
vm.type = 'list';
|
|
645
|
-
})
|
|
646
|
-
)}
|
|
647
|
-
${BgWidget.save(
|
|
648
|
-
gvc.event(() => {
|
|
649
|
-
try {
|
|
650
|
-
if (CheckInput.isEmpty(vm.data.title)) {
|
|
651
|
-
dialog.errorMessage({ text: '請輸入文本標題' });
|
|
652
|
-
return;
|
|
653
|
-
}
|
|
883
|
+
function drawPreview() {
|
|
884
|
+
return gvc.bindView({
|
|
885
|
+
bind: `drawPreview`,
|
|
886
|
+
view: () => {
|
|
887
|
+
const position = ['左上', '右上', '左下', '右下'];
|
|
888
|
+
const color = vm.data.data.label_color ?? '#393939';
|
|
889
|
+
const text = vm.data.title ?? '熱賣中';
|
|
890
|
+
vm.data.data.position = vm.data.data.position ?? '左上';
|
|
891
|
+
const labelPosition = vm.data.data.position;
|
|
654
892
|
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
893
|
+
let shapeArray = [
|
|
894
|
+
{
|
|
895
|
+
title: '矩形',
|
|
896
|
+
shape: html`
|
|
897
|
+
<div
|
|
898
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
899
|
+
? 'padding-top:'
|
|
900
|
+
: 'padding-bottom:'}10px; ${labelPosition == '左上' || labelPosition == '左下'
|
|
901
|
+
? 'padding-left:'
|
|
902
|
+
: 'padding-right:'}10px;"
|
|
903
|
+
>
|
|
904
|
+
<div style="min-width: 49px;background: ${color};position: relative;padding:5px 9px;">
|
|
905
|
+
<div
|
|
906
|
+
class="d-flex align-items-center"
|
|
907
|
+
style="color: ${vm.data.data.text_color};font-size: ${vm.data.data
|
|
908
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;"
|
|
909
|
+
>
|
|
910
|
+
${text}
|
|
911
|
+
</div>
|
|
912
|
+
</div>
|
|
913
|
+
</div>
|
|
914
|
+
`,
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
title: '橢圓',
|
|
918
|
+
shape: html`
|
|
919
|
+
<div
|
|
920
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
921
|
+
? 'padding-top:'
|
|
922
|
+
: 'padding-bottom:'}10px; ${labelPosition == '左上' || labelPosition == '左下'
|
|
923
|
+
? 'padding-left:'
|
|
924
|
+
: 'padding-right:'}10px;"
|
|
925
|
+
>
|
|
926
|
+
<div style="min-width: 59px;background: ${color};border-radius: 32px;padding:5px 14px;">
|
|
927
|
+
<div
|
|
928
|
+
class="d-flex align-items-center"
|
|
929
|
+
style="color: ${vm.data.data.text_color};font-size: ${vm.data.data
|
|
930
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;"
|
|
931
|
+
>
|
|
932
|
+
${text}
|
|
933
|
+
</div>
|
|
934
|
+
</div>
|
|
935
|
+
</div>
|
|
936
|
+
`,
|
|
937
|
+
},
|
|
938
|
+
{
|
|
939
|
+
title: '標籤',
|
|
940
|
+
shape: html`
|
|
941
|
+
<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
942
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
943
|
+
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"
|
|
944
|
+
fill="${color}"
|
|
945
|
+
//>
|
|
946
|
+
<text x="50%" y="50%" font-family="Noto Sans', sans-serif " text-anchor="middle"
|
|
947
|
+
font-size="${vm.data.data.text_size}" fill="${vm.data.data.text_color}"
|
|
948
|
+
dominant-baseline="central">${text}
|
|
949
|
+
</text>
|
|
950
|
+
</svg>
|
|
663
951
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
952
|
+
`,
|
|
953
|
+
shape2: html`
|
|
954
|
+
<div
|
|
955
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
956
|
+
? 'padding-top:'
|
|
957
|
+
: 'padding-bottom:'}9.57px; ${labelPosition == '左上' || labelPosition == '左下'
|
|
958
|
+
? 'padding-left:'
|
|
959
|
+
: 'padding-right:'}9.11px; position: relative;"
|
|
960
|
+
>
|
|
961
|
+
<div
|
|
962
|
+
class="d-flex align-items-center"
|
|
963
|
+
style="position: absolute;right: ${labelPosition == '左上' || labelPosition == '左下'
|
|
964
|
+
? '9'
|
|
965
|
+
: '19'}px;top: ${labelPosition == '左上' || labelPosition == '右上'
|
|
966
|
+
? '17.5'
|
|
967
|
+
: '7.5'}px;font-size: ${vm.data.data
|
|
968
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data.text_color}"
|
|
969
|
+
>
|
|
970
|
+
${text}
|
|
971
|
+
</div>
|
|
972
|
+
<svg
|
|
973
|
+
width="72"
|
|
974
|
+
height="32"
|
|
975
|
+
viewBox="0 0 69 24"
|
|
976
|
+
fill="none"
|
|
977
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
978
|
+
preserveAspectRatio="none"
|
|
979
|
+
>
|
|
980
|
+
<path
|
|
981
|
+
fill-rule="evenodd"
|
|
982
|
+
clip-rule="evenodd"
|
|
983
|
+
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"
|
|
984
|
+
fill="${color}"
|
|
985
|
+
/>
|
|
986
|
+
</svg>
|
|
987
|
+
</div>
|
|
988
|
+
`,
|
|
989
|
+
},
|
|
990
|
+
{
|
|
991
|
+
title: '彩帶(橫)',
|
|
992
|
+
shape: html`
|
|
993
|
+
<div style="padding-left:9.11px;">
|
|
994
|
+
<svg width="72" height="72" viewBox="0 0 72 72" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
995
|
+
<path
|
|
996
|
+
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"
|
|
997
|
+
fill="${vm.data.data.label_color}"
|
|
998
|
+
//>
|
|
999
|
+
<text x="30%" y="50%" font-family="Noto Sans', sans-serif " text-anchor="middle"
|
|
1000
|
+
font-size="${vm.data.data.text_size}" fill="${vm.data.data.text_color}"
|
|
1001
|
+
dominant-baseline="central">${text}
|
|
1002
|
+
</text>
|
|
1003
|
+
</svg>
|
|
1004
|
+
</div>
|
|
1005
|
+
`,
|
|
1006
|
+
shape1: html`
|
|
1007
|
+
<div
|
|
1008
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
1009
|
+
? 'padding-top:'
|
|
1010
|
+
: 'padding-bottom:'}9.57px; ${labelPosition == '左上' || labelPosition == '左下'
|
|
1011
|
+
? 'padding-left:'
|
|
1012
|
+
: 'padding-right:'}9.11px;position: relative;"
|
|
1013
|
+
>
|
|
1014
|
+
<div
|
|
1015
|
+
class="d-flex align-items-center"
|
|
1016
|
+
style="position: absolute;left: ${labelPosition == '左上' || labelPosition == '左下'
|
|
1017
|
+
? '21'
|
|
1018
|
+
: '11'}px;top: ${labelPosition == '左上' || labelPosition == '右上'
|
|
1019
|
+
? '13.5'
|
|
1020
|
+
: '3.5'}px;font-size: ${vm.data.data
|
|
1021
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data.text_color}"
|
|
1022
|
+
>
|
|
1023
|
+
${text}
|
|
1024
|
+
</div>
|
|
1025
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="71" height="32" viewBox="0 0 71 32" fill="none">
|
|
1026
|
+
<g filter="url(#filter0_d_14130_223497)">
|
|
1027
|
+
<path
|
|
1028
|
+
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"
|
|
1029
|
+
fill="${color}"
|
|
1030
|
+
/>
|
|
1031
|
+
</g>
|
|
1032
|
+
</svg>
|
|
1033
|
+
</div>
|
|
1034
|
+
`,
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
title: '彩帶(直)',
|
|
1038
|
+
shape: html`
|
|
1039
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
1040
|
+
<path
|
|
1041
|
+
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"
|
|
1042
|
+
fill="${vm.data.data.label_color}"
|
|
1043
|
+
/>
|
|
1044
|
+
<text
|
|
1045
|
+
x="50%"
|
|
1046
|
+
y="30%"
|
|
1047
|
+
font-family="Noto Sans', sans-serif "
|
|
1048
|
+
text-anchor="middle"
|
|
1049
|
+
font-size="${vm.data.data.text_size}"
|
|
1050
|
+
fill="${vm.data.data.text_color}"
|
|
1051
|
+
dominant-baseline="central"
|
|
1052
|
+
style="writing-mode: vertical-rl;"
|
|
1053
|
+
>
|
|
1054
|
+
${text}
|
|
1055
|
+
</text>
|
|
1056
|
+
</svg>
|
|
1057
|
+
`,
|
|
1058
|
+
shape1: html`
|
|
1059
|
+
<div
|
|
1060
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
1061
|
+
? 'padding-top:'
|
|
1062
|
+
: 'padding-bottom:'} 9.57px;${labelPosition == '左上' || labelPosition == '左下'
|
|
1063
|
+
? 'padding-left:'
|
|
1064
|
+
: 'padding-right:'} 9.11px;position: relative;"
|
|
1065
|
+
>
|
|
1066
|
+
<div
|
|
1067
|
+
style="position: absolute;left: ${labelPosition == '左上' || labelPosition == '左下'
|
|
1068
|
+
? '17.5'
|
|
1069
|
+
: '7.5'}px;top: ${labelPosition == '左上' || labelPosition == '右上'
|
|
1070
|
+
? '17.5'
|
|
1071
|
+
: '7.5'}px;font-size: ${vm.data.data
|
|
1072
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
1073
|
+
.text_color};writing-mode: vertical-lr;"
|
|
1074
|
+
>
|
|
1075
|
+
${text}
|
|
1076
|
+
</div>
|
|
1077
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="33" height="71" viewBox="0 0 33 71" fill="none">
|
|
1078
|
+
<g filter="url(#filter0_d_14130_223503)">
|
|
1079
|
+
<path
|
|
1080
|
+
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"
|
|
1081
|
+
fill="${color}"
|
|
1082
|
+
/>
|
|
1083
|
+
</g>
|
|
1084
|
+
<defs>
|
|
1085
|
+
<filter
|
|
1086
|
+
id="filter0_d_14130_223503"
|
|
1087
|
+
x="0.542969"
|
|
1088
|
+
y="-0.00195312"
|
|
1089
|
+
width="32"
|
|
1090
|
+
height="70.3008"
|
|
1091
|
+
filterUnits="userSpaceOnUse"
|
|
1092
|
+
color-interpolation-filters="sRGB"
|
|
1093
|
+
>
|
|
1094
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1095
|
+
<feColorMatrix
|
|
1096
|
+
in="SourceAlpha"
|
|
1097
|
+
type="matrix"
|
|
1098
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1099
|
+
result="hardAlpha"
|
|
1100
|
+
/>
|
|
1101
|
+
<feOffset dy="4" />
|
|
1102
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1103
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1104
|
+
<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" />
|
|
1105
|
+
<feBlend
|
|
1106
|
+
mode="normal"
|
|
1107
|
+
in2="BackgroundImageFix"
|
|
1108
|
+
result="effect1_dropShadow_14130_223503"
|
|
1109
|
+
/>
|
|
1110
|
+
<feBlend
|
|
1111
|
+
mode="normal"
|
|
1112
|
+
in="SourceGraphic"
|
|
1113
|
+
in2="effect1_dropShadow_14130_223503"
|
|
1114
|
+
result="shape"
|
|
1115
|
+
/>
|
|
1116
|
+
</filter>
|
|
1117
|
+
</defs>
|
|
1118
|
+
</svg>
|
|
1119
|
+
</div>
|
|
1120
|
+
`,
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
title: '圓形',
|
|
1124
|
+
shape: html`
|
|
1125
|
+
<div
|
|
1126
|
+
style="${labelPosition == '左上' || labelPosition == '右上'
|
|
1127
|
+
? 'padding-top:'
|
|
1128
|
+
: 'padding-bottom:'} 9.57px;${labelPosition == '左上' || labelPosition == '左下'
|
|
1129
|
+
? 'padding-left:'
|
|
1130
|
+
: 'padding-right:'} 9.11px;"
|
|
1131
|
+
>
|
|
1132
|
+
<div
|
|
1133
|
+
class=" align-items-center justify-content-center"
|
|
1134
|
+
style="display: inline-flex; width: 46px;height: 46px;flex-shrink: 0;background-color: ${color};border-radius: 50%;color: ${vm
|
|
1135
|
+
.data.data.text_color};font-size: ${vm.data.data
|
|
1136
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;"
|
|
1137
|
+
>
|
|
1138
|
+
${text}
|
|
1139
|
+
</div>
|
|
1140
|
+
</div>
|
|
1141
|
+
`,
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
title: '梯形',
|
|
1145
|
+
shape: (() => {
|
|
1146
|
+
console.log(vm.data.data.position);
|
|
1147
|
+
gvc.addStyle(css`
|
|
1148
|
+
.corner {
|
|
1149
|
+
width: 58px;
|
|
1150
|
+
height: 58px;
|
|
1151
|
+
background-color: ${vm.data.data.label_color};
|
|
1152
|
+
color: ${vm.data.data.text_color};
|
|
1153
|
+
box-sizing: border-box;
|
|
1154
|
+
display: flex;
|
|
1155
|
+
justify-content: center;
|
|
1156
|
+
align-items: center;
|
|
1157
|
+
text-align: center;
|
|
1158
|
+
font-size: ${vm.data.data.text_size}px;
|
|
1159
|
+
}
|
|
671
1160
|
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}, 200);
|
|
684
|
-
} else {
|
|
685
|
-
dialog.errorMessage({ text: '設定失敗' });
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
}catch (e) {
|
|
689
|
-
console.log(`error`,e)
|
|
690
|
-
return; ``
|
|
691
|
-
}
|
|
692
|
-
})
|
|
693
|
-
)}
|
|
694
|
-
</div>`,
|
|
695
|
-
].join('')
|
|
696
|
-
);
|
|
697
|
-
}
|
|
698
|
-
if (vm.type === 'label_edit') {
|
|
699
|
-
function drawColorInput(title: string, key: 'label_color' | 'text_color') {
|
|
700
|
-
const id = gvc.glitter.getUUID();
|
|
701
|
-
const inputClass = gvc.glitter.getUUID();
|
|
702
|
-
return gvc.bindView({
|
|
703
|
-
bind: id,
|
|
704
|
-
view: () => {
|
|
705
|
-
vm.data.data['label_color'] = vm.data.data['label_color'] ?? '#393939';
|
|
706
|
-
vm.data.data['text_color'] = vm.data.data['text_color'] ?? '#FFFFFF';
|
|
707
|
-
return html`
|
|
708
|
-
<div style="font-size: 16px;font-style: normal;font-weight: 400;color:#393939;">${title}</div>
|
|
709
|
-
<div
|
|
710
|
-
class="d-flex "
|
|
711
|
-
style="padding: 12px 10px;gap: 10px;cursor: pointer;border-radius: 7px;border: 1px solid #DDD;"
|
|
712
|
-
onclick="${gvc.event(() => {
|
|
713
|
-
(document.querySelector(`.${inputClass}`) as HTMLElement)!.click();
|
|
714
|
-
})}"
|
|
715
|
-
>
|
|
716
|
-
<input
|
|
717
|
-
class="d-none ${inputClass}"
|
|
718
|
-
value="${vm.data.data[key]}"
|
|
719
|
-
type="color"
|
|
720
|
-
onchange="${gvc.event((e) => {
|
|
721
|
-
vm.data.data[key] = e.value;
|
|
722
|
-
gvc.notifyDataChange([id, 'drawPreview']);
|
|
723
|
-
})}"
|
|
724
|
-
/>
|
|
725
|
-
<div style="width: 24px;height: 24px;flex-shrink: 0;border-radius: 3px;background: ${vm.data.data[key] ?? '#393939'};border: 1px solid #393939;"></div>
|
|
726
|
-
<div style="color: #393939;font-size: 16px; font-weight: 400; ">${vm.data.data[key] ?? '#393939'}</div>
|
|
727
|
-
</div>
|
|
728
|
-
`;
|
|
729
|
-
},
|
|
730
|
-
divCreate: {
|
|
731
|
-
class: 'd-flex flex-column',
|
|
732
|
-
style: 'gap:8px;',
|
|
733
|
-
},
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
function drawShapeInput(title: string) {
|
|
737
|
-
const id = gvc.glitter.getUUID();
|
|
738
|
-
const inputClass = gvc.glitter.getUUID();
|
|
739
|
-
return gvc.bindView({
|
|
740
|
-
bind: id,
|
|
741
|
-
view: () => {
|
|
742
|
-
let shapeArray = [
|
|
743
|
-
{
|
|
744
|
-
title: '矩形',
|
|
745
|
-
shape: html`
|
|
746
|
-
<svg width="64" height="30" viewBox="0 0 64 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
747
|
-
<rect y="0.666016" width="64" height="29.3333" rx="1.33333" fill="#D2D2D2" />
|
|
748
|
-
</svg>
|
|
749
|
-
`,
|
|
750
|
-
},
|
|
751
|
-
{
|
|
752
|
-
title: '橢圓',
|
|
753
|
-
shape: html`
|
|
754
|
-
<svg width="64" height="30" viewBox="0 0 64 30" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
755
|
-
<rect y="0.666016" width="64" height="29.3333" rx="14.6667" fill="#D2D2D2" />
|
|
756
|
-
</svg>
|
|
757
|
-
`,
|
|
758
|
-
},
|
|
759
|
-
{
|
|
760
|
-
title: '標籤',
|
|
761
|
-
shape: html`
|
|
762
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
763
|
-
<path
|
|
764
|
-
fill-rule="evenodd"
|
|
765
|
-
clip-rule="evenodd"
|
|
766
|
-
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"
|
|
767
|
-
fill="#D9D9D9"
|
|
768
|
-
/>
|
|
769
|
-
</svg>
|
|
770
|
-
`,
|
|
771
|
-
},
|
|
772
|
-
{
|
|
773
|
-
title: '彩帶(橫)',
|
|
774
|
-
shape: html`
|
|
775
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
776
|
-
<path
|
|
777
|
-
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"
|
|
778
|
-
fill="#D9D9D9"
|
|
779
|
-
/>
|
|
780
|
-
</svg>
|
|
781
|
-
`,
|
|
782
|
-
},
|
|
783
|
-
{
|
|
784
|
-
title: '彩帶(直)',
|
|
785
|
-
shape: html`
|
|
786
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
787
|
-
<path
|
|
788
|
-
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"
|
|
789
|
-
fill="#D9D9D9"
|
|
790
|
-
/>
|
|
791
|
-
</svg>
|
|
792
|
-
`,
|
|
793
|
-
},
|
|
794
|
-
{
|
|
795
|
-
title: '圓形',
|
|
796
|
-
shape: html`
|
|
797
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
798
|
-
<circle cx="37.333" cy="36" r="28" fill="#D9D9D9" />
|
|
799
|
-
</svg>
|
|
800
|
-
`,
|
|
801
|
-
},
|
|
802
|
-
{
|
|
803
|
-
title: '梯形',
|
|
804
|
-
shape: html`
|
|
805
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 72 72" fill="none">
|
|
806
|
-
<path d="M33.6632 4H68L4 68V33.6632L33.6632 4Z" fill="#D9D9D9" />
|
|
807
|
-
</svg>
|
|
808
|
-
`,
|
|
809
|
-
},
|
|
810
|
-
];
|
|
811
|
-
vm.data.data.shape = vm.data.data.shape ?? '矩形';
|
|
1161
|
+
.corner-左上 {
|
|
1162
|
+
top: 0;
|
|
1163
|
+
left: 0;
|
|
1164
|
+
clip-path: polygon(50% 0, 100% 0, 0 100%, 0 50%);
|
|
1165
|
+
}
|
|
1166
|
+
.corner-左上 p{
|
|
1167
|
+
transform: rotate(-45deg) translate(-50%, -50%);
|
|
1168
|
+
position: absolute;
|
|
1169
|
+
left: 41%;
|
|
1170
|
+
top: 18%;
|
|
1171
|
+
}
|
|
812
1172
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
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
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
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
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
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
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
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
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
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
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1173
|
+
.corner-左下 {
|
|
1174
|
+
top: 0;
|
|
1175
|
+
left: 0;
|
|
1176
|
+
clip-path: polygon(0 0, 100% 100%, 50% 100%, 0 50%);
|
|
1177
|
+
}
|
|
1178
|
+
.corner-左下 p{
|
|
1179
|
+
transform: rotate(45deg) translate(-50%, -50%);
|
|
1180
|
+
position: absolute;
|
|
1181
|
+
left: 22%;
|
|
1182
|
+
bottom: 0;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.corner-右上 {
|
|
1186
|
+
top: 0;
|
|
1187
|
+
left: 0;
|
|
1188
|
+
clip-path: polygon(0 0, 100% 100%, 100% 50%, 50% 0);
|
|
1189
|
+
}
|
|
1190
|
+
.corner-右上 p{
|
|
1191
|
+
transform: rotate(45deg) translate(-50%, -50%);
|
|
1192
|
+
position: absolute;
|
|
1193
|
+
left: 46%;
|
|
1194
|
+
bottom: 23%;
|
|
1195
|
+
}
|
|
1196
|
+
.corner-右下 {
|
|
1197
|
+
top: 0;
|
|
1198
|
+
left: 0;
|
|
1199
|
+
clip-path: polygon(0 100%, 50% 100%, 100% 50%, 100% 0);
|
|
1200
|
+
}
|
|
1201
|
+
.corner-右下 p{
|
|
1202
|
+
transform: rotate(-45deg);
|
|
1203
|
+
position: absolute;
|
|
1204
|
+
left: 40%;
|
|
1205
|
+
bottom: 23%;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
`);
|
|
1209
|
+
return html`<div class="corner corner-${vm.data.data.position} position-relative">
|
|
1210
|
+
<p class="m-0">${text}</p>
|
|
1211
|
+
</div>`;
|
|
1212
|
+
})(),
|
|
1213
|
+
shape2: html`
|
|
1214
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" fill="none">
|
|
1215
|
+
<path d="M29.6632 0H64L0 64V29.6632L29.6632 0Z" fill="${vm.data.data.label_color}" />
|
|
1216
|
+
<text
|
|
1217
|
+
x="50%"
|
|
1218
|
+
y="30%"
|
|
1219
|
+
font-family="Noto Sans', sans-serif "
|
|
1220
|
+
text-anchor="middle"
|
|
1221
|
+
font-size="${vm.data.data.text_size}"
|
|
1222
|
+
fill="${vm.data.data.text_color}"
|
|
1223
|
+
dominant-baseline="central"
|
|
1224
|
+
style="writing-mode: vertical-rl;"
|
|
1225
|
+
>
|
|
1226
|
+
${text}
|
|
1227
|
+
</text>
|
|
1228
|
+
</svg>
|
|
1229
|
+
`,
|
|
1230
|
+
shape1: (() => {
|
|
1231
|
+
switch (labelPosition) {
|
|
1232
|
+
case '左上': {
|
|
1233
|
+
return html`
|
|
1234
|
+
<div style="display: inline-block;position: relative;">
|
|
1235
|
+
<div
|
|
1236
|
+
style="position: absolute;left: 5px;top: 13.5px;font-size: ${vm.data.data
|
|
1237
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
1238
|
+
.text_color};transform: rotate(-44.938deg);"
|
|
1239
|
+
>
|
|
1240
|
+
${text}
|
|
1241
|
+
</div>
|
|
1242
|
+
<svg
|
|
1243
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1244
|
+
width="62"
|
|
1245
|
+
height="66"
|
|
1246
|
+
viewBox="0 0 62 66"
|
|
1247
|
+
fill="none"
|
|
1248
|
+
>
|
|
1249
|
+
<g filter="url(#filter0_d_14130_126851)">
|
|
1250
|
+
<path d="M26.8833 0H58.001L0.000976562 58V26.8823L26.8833 0Z" fill="${color}" />
|
|
1251
|
+
</g>
|
|
1252
|
+
<defs>
|
|
1253
|
+
<filter
|
|
1254
|
+
id="filter0_d_14130_126851"
|
|
1255
|
+
x="-3.99902"
|
|
1256
|
+
y="0"
|
|
1257
|
+
width="66"
|
|
1258
|
+
height="66"
|
|
1259
|
+
filterUnits="userSpaceOnUse"
|
|
1260
|
+
color-interpolation-filters="sRGB"
|
|
1261
|
+
>
|
|
1262
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1263
|
+
<feColorMatrix
|
|
1264
|
+
in="SourceAlpha"
|
|
1265
|
+
type="matrix"
|
|
1266
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1267
|
+
result="hardAlpha"
|
|
1268
|
+
/>
|
|
1269
|
+
<feOffset dy="4" />
|
|
1270
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1271
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1272
|
+
<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" />
|
|
1273
|
+
<feBlend
|
|
1274
|
+
mode="normal"
|
|
1275
|
+
in2="BackgroundImageFix"
|
|
1276
|
+
result="effect1_dropShadow_14130_126851"
|
|
1277
|
+
/>
|
|
1278
|
+
<feBlend
|
|
1279
|
+
mode="normal"
|
|
1280
|
+
in="SourceGraphic"
|
|
1281
|
+
in2="effect1_dropShadow_14130_126851"
|
|
1282
|
+
result="shape"
|
|
1283
|
+
/>
|
|
1284
|
+
</filter>
|
|
1285
|
+
</defs>
|
|
1286
|
+
</svg>
|
|
1287
|
+
</div>
|
|
1288
|
+
`;
|
|
1289
|
+
}
|
|
1290
|
+
case '左下': {
|
|
1291
|
+
return html`
|
|
1292
|
+
<div style="display: inline-block;position: relative;min-height:79px;">
|
|
1293
|
+
<div
|
|
1294
|
+
style="position: absolute;left: 12px;bottom: 23px;font-size: ${vm.data.data
|
|
1295
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
1296
|
+
.text_color};transform: rotate(45deg);"
|
|
1297
|
+
>
|
|
1298
|
+
${text}
|
|
1299
|
+
</div>
|
|
1300
|
+
<svg
|
|
1301
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1302
|
+
width="79"
|
|
1303
|
+
height="79"
|
|
1304
|
+
viewBox="0 0 58 58"
|
|
1305
|
+
fill="none"
|
|
1306
|
+
>
|
|
1307
|
+
<g filter="url(#filter0_d_14378_119252)">
|
|
1308
|
+
<path d="M26.8823 58H58L0 0V31.1177L26.8823 58Z" fill="${color}" />
|
|
1309
|
+
</g>
|
|
1310
|
+
<defs>
|
|
1311
|
+
<filter
|
|
1312
|
+
id="filter0_d_14378_119252"
|
|
1313
|
+
x="-4"
|
|
1314
|
+
y="0"
|
|
1315
|
+
width="66"
|
|
1316
|
+
height="66"
|
|
1317
|
+
filterUnits="userSpaceOnUse"
|
|
1318
|
+
color-interpolation-filters="sRGB"
|
|
1319
|
+
>
|
|
1320
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1321
|
+
<feColorMatrix
|
|
1322
|
+
in="SourceAlpha"
|
|
1323
|
+
type="matrix"
|
|
1324
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1325
|
+
result="hardAlpha"
|
|
1326
|
+
/>
|
|
1327
|
+
<feOffset dy="4" />
|
|
1328
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1329
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1330
|
+
<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" />
|
|
1331
|
+
<feBlend
|
|
1332
|
+
mode="normal"
|
|
1333
|
+
in2="BackgroundImageFix"
|
|
1334
|
+
result="effect1_dropShadow_14378_119252"
|
|
1335
|
+
/>
|
|
1336
|
+
<feBlend
|
|
1337
|
+
mode="normal"
|
|
1338
|
+
in="SourceGraphic"
|
|
1339
|
+
in2="effect1_dropShadow_14378_119252"
|
|
1340
|
+
result="shape"
|
|
1341
|
+
/>
|
|
1342
|
+
</filter>
|
|
1343
|
+
</defs>
|
|
1344
|
+
</svg>
|
|
1345
|
+
</div>
|
|
1346
|
+
`;
|
|
1347
|
+
}
|
|
1348
|
+
case '右上': {
|
|
1349
|
+
return html`
|
|
1350
|
+
<div style="display: inline-block;position: relative;min-height:79px;">
|
|
1351
|
+
<div
|
|
1352
|
+
style="position: absolute;right: 5px;top: 13.5px;font-size: ${vm.data.data
|
|
1353
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
1354
|
+
.text_color};transform: rotate(45deg);"
|
|
1355
|
+
>
|
|
1356
|
+
${text}
|
|
1357
|
+
</div>
|
|
1358
|
+
<svg
|
|
1359
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1360
|
+
width="63"
|
|
1361
|
+
height="66"
|
|
1362
|
+
viewBox="0 0 63 66"
|
|
1363
|
+
fill="none"
|
|
1364
|
+
>
|
|
1365
|
+
<g filter="url(#filter0_d_14378_119247)">
|
|
1366
|
+
<path d="M35.1177 0H4L62 58V26.8823L35.1177 0Z" fill="${color}" />
|
|
1367
|
+
</g>
|
|
1368
|
+
<defs>
|
|
1369
|
+
<filter
|
|
1370
|
+
id="filter0_d_14378_119247"
|
|
1371
|
+
x="0"
|
|
1372
|
+
y="0"
|
|
1373
|
+
width="66"
|
|
1374
|
+
height="66"
|
|
1375
|
+
filterUnits="userSpaceOnUse"
|
|
1376
|
+
color-interpolation-filters="sRGB"
|
|
1377
|
+
>
|
|
1378
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1379
|
+
<feColorMatrix
|
|
1380
|
+
in="SourceAlpha"
|
|
1381
|
+
type="matrix"
|
|
1382
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1383
|
+
result="hardAlpha"
|
|
1384
|
+
/>
|
|
1385
|
+
<feOffset dy="4" />
|
|
1386
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1387
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1388
|
+
<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" />
|
|
1389
|
+
<feBlend
|
|
1390
|
+
mode="normal"
|
|
1391
|
+
in2="BackgroundImageFix"
|
|
1392
|
+
result="effect1_dropShadow_14378_119247"
|
|
1393
|
+
/>
|
|
1394
|
+
<feBlend
|
|
1395
|
+
mode="normal"
|
|
1396
|
+
in="SourceGraphic"
|
|
1397
|
+
in2="effect1_dropShadow_14378_119247"
|
|
1398
|
+
result="shape"
|
|
1399
|
+
/>
|
|
1400
|
+
</filter>
|
|
1401
|
+
</defs>
|
|
1402
|
+
</svg>
|
|
1403
|
+
</div>
|
|
1404
|
+
`;
|
|
1405
|
+
}
|
|
1406
|
+
default: {
|
|
1407
|
+
return html`
|
|
1408
|
+
<div style="display: inline-block;position: relative;min-height:79px;">
|
|
1409
|
+
<div
|
|
1410
|
+
style="position: absolute;right: 13px;bottom: 16px;font-size: ${vm.data.data
|
|
1411
|
+
.text_size}px;font-weight: 400;letter-spacing: 0.4px;color: ${vm.data.data
|
|
1412
|
+
.text_color};transform: rotate(-45deg);"
|
|
1413
|
+
>
|
|
1414
|
+
${text}
|
|
1415
|
+
</div>
|
|
1416
|
+
<svg
|
|
1417
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1418
|
+
width="79"
|
|
1419
|
+
height="79"
|
|
1420
|
+
viewBox="0 0 58 58"
|
|
1421
|
+
fill="none"
|
|
1422
|
+
>
|
|
1423
|
+
<g filter="url(#filter0_d_14378_119257)">
|
|
1424
|
+
<path d="M35.1177 58H4L62 0V31.1177L35.1177 58Z" fill="${color}" />
|
|
1425
|
+
</g>
|
|
1426
|
+
<defs>
|
|
1427
|
+
<filter
|
|
1428
|
+
id="filter0_d_14378_119257"
|
|
1429
|
+
x="0"
|
|
1430
|
+
y="0"
|
|
1431
|
+
width="66"
|
|
1432
|
+
height="66"
|
|
1433
|
+
filterUnits="userSpaceOnUse"
|
|
1434
|
+
color-interpolation-filters="sRGB"
|
|
1435
|
+
>
|
|
1436
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
|
1437
|
+
<feColorMatrix
|
|
1438
|
+
in="SourceAlpha"
|
|
1439
|
+
type="matrix"
|
|
1440
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
1441
|
+
result="hardAlpha"
|
|
1442
|
+
/>
|
|
1443
|
+
<feOffset dy="4" />
|
|
1444
|
+
<feGaussianBlur stdDeviation="2" />
|
|
1445
|
+
<feComposite in2="hardAlpha" operator="out" />
|
|
1446
|
+
<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" />
|
|
1447
|
+
<feBlend
|
|
1448
|
+
mode="normal"
|
|
1449
|
+
in2="BackgroundImageFix"
|
|
1450
|
+
result="effect1_dropShadow_14378_119257"
|
|
1451
|
+
/>
|
|
1452
|
+
<feBlend
|
|
1453
|
+
mode="normal"
|
|
1454
|
+
in="SourceGraphic"
|
|
1455
|
+
in2="effect1_dropShadow_14378_119257"
|
|
1456
|
+
result="shape"
|
|
1457
|
+
/>
|
|
1458
|
+
</filter>
|
|
1459
|
+
</defs>
|
|
1460
|
+
</svg>
|
|
1461
|
+
</div>
|
|
1462
|
+
`;
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
})(),
|
|
1466
|
+
},
|
|
1467
|
+
];
|
|
1468
|
+
const labelHTML = shapeArray.find(shape => {
|
|
1469
|
+
return shape.title == vm.data.data.shape;
|
|
1470
|
+
})?.shape;
|
|
1471
|
+
vm.data.data.content = labelHTML ?? '';
|
|
1472
|
+
return html`
|
|
1473
|
+
<div
|
|
1474
|
+
class="w-100 w-lg-50"
|
|
1475
|
+
style="display: flex;height: 270px;justify-content: center;align-items: center;align-self: stretch;border-radius: 10px;border: 1px solid #DDD;"
|
|
1476
|
+
>
|
|
1477
|
+
<div class="d-flex flex-wrap" style="height: 178px;width: 178px;">
|
|
1478
|
+
${position
|
|
1479
|
+
.map((data, index) => {
|
|
1480
|
+
if (vm.data.data.position == data) {
|
|
1481
|
+
return html`
|
|
1482
|
+
<div
|
|
1483
|
+
class="d-flex align-items-center justify-content-center"
|
|
1484
|
+
style="width: 89px;height: 89px;border: 1px solid rgba(205, 205, 205, 0.87);background: #393939;color: #FFF;font-size: 16px;font-weight: 400;"
|
|
1485
|
+
>
|
|
1486
|
+
${data}
|
|
1487
|
+
</div>
|
|
1488
|
+
`;
|
|
1489
|
+
}
|
|
1490
|
+
return html`
|
|
1491
|
+
<div
|
|
1492
|
+
style="width: 89px;height: 89px;border: 1px solid rgba(205, 205, 205, 0.87);background: #EAEAEA;"
|
|
1493
|
+
onclick="${gvc.event(() => {
|
|
1494
|
+
vm.data.data.position = data;
|
|
1495
|
+
gvc.notifyDataChange('drawPreview');
|
|
1496
|
+
})}"
|
|
1497
|
+
></div>
|
|
1498
|
+
`;
|
|
1499
|
+
})
|
|
1500
|
+
.join('')}
|
|
1501
|
+
</div>
|
|
1502
|
+
</div>
|
|
1503
|
+
<div
|
|
1504
|
+
class="w-100 w-lg-50"
|
|
1505
|
+
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;"
|
|
1506
|
+
>
|
|
1507
|
+
<div
|
|
1508
|
+
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;"
|
|
1509
|
+
>
|
|
1510
|
+
<div
|
|
1511
|
+
class="d-flex flex-column align-items-center position-relative"
|
|
1512
|
+
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')"
|
|
1513
|
+
>
|
|
1514
|
+
<div
|
|
1515
|
+
style="position:absolute;${vm.data.data.position == '左上' || vm.data.data.position == '左下'
|
|
1516
|
+
? 'left'
|
|
1517
|
+
: 'right'}: 0;${vm.data.data.position == '左上' || vm.data.data.position == '右上'
|
|
1518
|
+
? 'top'
|
|
1519
|
+
: 'bottom'}: 0;z-index:2;"
|
|
1520
|
+
>
|
|
1521
|
+
${labelHTML}
|
|
1522
|
+
</div>
|
|
1523
|
+
<div
|
|
1524
|
+
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);"
|
|
1525
|
+
>
|
|
1526
|
+
<svg
|
|
1527
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1528
|
+
width="11"
|
|
1529
|
+
height="11"
|
|
1530
|
+
viewBox="0 0 11 11"
|
|
1531
|
+
fill="none"
|
|
1532
|
+
>
|
|
1533
|
+
<g clip-path="url(#clip0_14130_223540)">
|
|
1534
|
+
<path
|
|
1535
|
+
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"
|
|
1536
|
+
fill="#393939"
|
|
1537
|
+
/>
|
|
1538
|
+
</g>
|
|
1539
|
+
<defs>
|
|
1540
|
+
<clipPath id="clip0_14130_223540">
|
|
1541
|
+
<rect
|
|
1542
|
+
width="9.72513"
|
|
1543
|
+
height="9.72513"
|
|
1544
|
+
fill="white"
|
|
1545
|
+
transform="translate(0.782227 0.779297)"
|
|
1546
|
+
/>
|
|
1547
|
+
</clipPath>
|
|
1548
|
+
</defs>
|
|
1549
|
+
</svg>
|
|
1550
|
+
</div>
|
|
1551
|
+
</div>
|
|
1552
|
+
<div
|
|
1553
|
+
style="display: flex;flex-direction: column;gap: 5.835px;color:#393939;font-size: 9.725px;font-weight: 400;letter-spacing: 0.389px;"
|
|
1554
|
+
>
|
|
1555
|
+
<div>商品名稱</div>
|
|
1556
|
+
<div>NT.$ 99</div>
|
|
1557
|
+
</div>
|
|
1558
|
+
</div>
|
|
1559
|
+
</div>
|
|
1560
|
+
`;
|
|
1561
|
+
},
|
|
1562
|
+
divCreate: {
|
|
1563
|
+
style: `display: flex;align-items: flex-start;gap: 18px;align-self: stretch;`,
|
|
1564
|
+
class: `flex-column flex-lg-row`,
|
|
1565
|
+
},
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
function drawInput(type: string, title: string, key: 'text_size') {
|
|
1570
|
+
const id = gvc.glitter.getUUID();
|
|
1571
|
+
const inputClass = gvc.glitter.getUUID();
|
|
1572
|
+
return gvc.bindView({
|
|
1573
|
+
bind: id,
|
|
1574
|
+
view: () => {
|
|
1575
|
+
vm.data.data['text_size'] = vm.data.data['text_size'] ?? '10';
|
|
1576
|
+
return html`
|
|
1577
|
+
<div style="font-size: 16px;font-style: normal;font-weight: 400;color:#393939;">${title}</div>
|
|
1578
|
+
<div
|
|
1579
|
+
class="d-flex "
|
|
1580
|
+
style="padding: 12px 10px;gap: 10px;border-radius: 7px;border: 1px solid #DDD;"
|
|
1581
|
+
onclick="${gvc.event(() => {
|
|
1582
|
+
(document.querySelector(`.${inputClass}`) as HTMLElement)!.click();
|
|
1583
|
+
})}"
|
|
1584
|
+
>
|
|
1585
|
+
<input
|
|
1586
|
+
class="${inputClass} border-0"
|
|
1587
|
+
value="${vm.data.data[key]}"
|
|
1588
|
+
type="number"
|
|
1589
|
+
onchange="${gvc.event(e => {
|
|
1590
|
+
vm.data.data[key] = e.value;
|
|
1591
|
+
gvc.notifyDataChange([id, 'drawPreview']);
|
|
1592
|
+
})}"
|
|
1593
|
+
/>
|
|
1594
|
+
</div>
|
|
1595
|
+
`;
|
|
1596
|
+
},
|
|
1597
|
+
divCreate: {
|
|
1598
|
+
class: 'd-flex flex-column',
|
|
1599
|
+
style: 'gap:8px;',
|
|
1600
|
+
},
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
return BgWidget.container(
|
|
1605
|
+
[
|
|
1606
|
+
html` <div class="title-container">
|
|
1607
|
+
${BgWidget.goBack(
|
|
1608
|
+
gvc.event(() => {
|
|
1609
|
+
vm.type = 'list';
|
|
1610
|
+
})
|
|
1611
|
+
)}
|
|
1612
|
+
${BgWidget.title(vm.data.title || '新增商品促銷標籤')}
|
|
1613
|
+
<div class="flex-fill"></div>
|
|
1614
|
+
</div>`,
|
|
1615
|
+
BgWidget.container(
|
|
1616
|
+
[
|
|
1617
|
+
BgWidget.mainCard(
|
|
1618
|
+
BgWidget.editeInput({
|
|
1619
|
+
gvc: gvc,
|
|
1620
|
+
title: '標籤文字',
|
|
1621
|
+
default: vm.data.title ?? '',
|
|
1622
|
+
placeHolder: '請輸入標籤文字',
|
|
1623
|
+
callback: text => {
|
|
1624
|
+
vm.data.title = text;
|
|
1625
|
+
gvc.notifyDataChange('drawPreview');
|
|
1626
|
+
},
|
|
1627
|
+
})
|
|
1628
|
+
),
|
|
1629
|
+
BgWidget.mainCard(html`
|
|
1630
|
+
<div class="d-flex flex-column" style="gap: 18px;">
|
|
1631
|
+
${BgWidget.title('標籤樣式')} ${drawColorInput('標籤顏色', 'label_color')}
|
|
1632
|
+
${drawColorInput('文字顏色', 'text_color')} ${drawInput('number', '文字大小', 'text_size')}
|
|
1633
|
+
${drawShapeInput('標籤形狀')}
|
|
1634
|
+
</div>
|
|
1635
|
+
`),
|
|
1636
|
+
BgWidget.mainCard(html`
|
|
1637
|
+
<div class="d-flex flex-column" style="gap: 18px;">
|
|
1638
|
+
${BgWidget.title('標籤位置')} ${drawPreview()}
|
|
1639
|
+
</div>
|
|
1640
|
+
`),
|
|
1641
|
+
].join(BgWidget.mbContainer(12))
|
|
1642
|
+
),
|
|
1643
|
+
BgWidget.mbContainer(240),
|
|
1644
|
+
html` <div class="update-bar-container">
|
|
1645
|
+
${vm.data.id.length === 0
|
|
1646
|
+
? ''
|
|
1647
|
+
: BgWidget.danger(
|
|
1648
|
+
gvc.event(() => {
|
|
1649
|
+
dialog.checkYesOrNot({
|
|
1650
|
+
text: '確認要刪除此標籤?',
|
|
1651
|
+
callback: bool => {
|
|
1652
|
+
if (bool) {
|
|
1653
|
+
vm.labelList = vm.labelList.filter((item: any) => vm.data.id !== item.id);
|
|
1654
|
+
ApiUser.setPublicConfig({
|
|
1655
|
+
key: 'promo-label',
|
|
1656
|
+
user_id: 'manager',
|
|
1657
|
+
value: vm.labelList,
|
|
1658
|
+
}).then(result => {
|
|
1659
|
+
if (!result.response.result) {
|
|
1660
|
+
dialog.errorMessage({ text: '設定失敗' });
|
|
1661
|
+
}
|
|
1662
|
+
vm.type = 'list';
|
|
1663
|
+
});
|
|
1664
|
+
}
|
|
1665
|
+
},
|
|
1254
1666
|
});
|
|
1667
|
+
})
|
|
1668
|
+
)}
|
|
1669
|
+
${BgWidget.cancel(
|
|
1670
|
+
gvc.event(() => {
|
|
1671
|
+
vm.type = 'list';
|
|
1672
|
+
})
|
|
1673
|
+
)}
|
|
1674
|
+
${BgWidget.save(
|
|
1675
|
+
gvc.event(() => {
|
|
1676
|
+
vm.data.updated_time = glitter.ut.dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss');
|
|
1677
|
+
if (vm.data.id.length === 0) {
|
|
1678
|
+
vm.data.id = Tool.randomString(10);
|
|
1679
|
+
vm.labelList.push(vm.data);
|
|
1680
|
+
} else {
|
|
1681
|
+
vm.labelList[vm.labelList.findIndex((item: { id: string }) => item.id === vm.data.id)] = vm.data;
|
|
1255
1682
|
}
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
BgWidget.mainCard(
|
|
1283
|
-
html`
|
|
1284
|
-
<div class="d-flex flex-column" style="gap: 18px;">
|
|
1285
|
-
${BgWidget.title('標籤樣式')} ${drawColorInput('標籤顏色', 'label_color')} ${drawColorInput('文字顏色', 'text_color')} ${drawShapeInput('標籤形狀')}
|
|
1286
|
-
</div>
|
|
1287
|
-
`
|
|
1288
|
-
),
|
|
1289
|
-
BgWidget.mainCard(html` <div class="d-flex flex-column" style="gap: 18px;">${BgWidget.title('標籤位置')} ${drawPreview()}</div> `),
|
|
1290
|
-
].join(BgWidget.mbContainer(12))
|
|
1291
|
-
),
|
|
1292
|
-
BgWidget.mbContainer(240),
|
|
1293
|
-
html` <div class="update-bar-container">
|
|
1294
|
-
${vm.data.id.length === 0
|
|
1295
|
-
? ''
|
|
1296
|
-
: BgWidget.danger(
|
|
1297
|
-
gvc.event(() => {
|
|
1298
|
-
dialog.checkYesOrNot({
|
|
1299
|
-
text: '確認要刪除此標籤?',
|
|
1300
|
-
callback: (bool) => {
|
|
1301
|
-
if (bool) {
|
|
1302
|
-
vm.labelList = vm.labelList.filter((item: any) => vm.data.id !== item.id);
|
|
1303
|
-
ApiUser.setPublicConfig({
|
|
1304
|
-
key: 'promo-label',
|
|
1305
|
-
user_id: 'manager',
|
|
1306
|
-
value: vm.labelList,
|
|
1307
|
-
}).then((result) => {
|
|
1308
|
-
if (!result.response.result) {
|
|
1309
|
-
dialog.errorMessage({ text: '設定失敗' });
|
|
1310
|
-
}
|
|
1311
|
-
vm.type = 'list';
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
},
|
|
1315
|
-
});
|
|
1316
|
-
})
|
|
1317
|
-
)}
|
|
1318
|
-
${BgWidget.cancel(
|
|
1319
|
-
gvc.event(() => {
|
|
1320
|
-
vm.type = 'list';
|
|
1321
|
-
})
|
|
1322
|
-
)}
|
|
1323
|
-
${BgWidget.save(
|
|
1324
|
-
gvc.event(() => {
|
|
1325
|
-
vm.data.updated_time = glitter.ut.dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss');
|
|
1326
|
-
if (vm.data.id.length === 0) {
|
|
1327
|
-
vm.data.id = Tool.randomString(10);
|
|
1328
|
-
vm.labelList.push(vm.data);
|
|
1329
|
-
} else {
|
|
1330
|
-
vm.labelList[vm.labelList.findIndex((item: { id: string }) => item.id === vm.data.id)] = vm.data;
|
|
1331
|
-
}
|
|
1332
|
-
dialog.dataLoading({ text: '設定中...', visible: true });
|
|
1333
|
-
ApiUser.setPublicConfig({
|
|
1334
|
-
key: 'promo-label',
|
|
1335
|
-
user_id: 'manager',
|
|
1336
|
-
value: vm.labelList,
|
|
1337
|
-
}).then((result) => {
|
|
1338
|
-
dialog.dataLoading({ visible: false });
|
|
1339
|
-
if (result.response.result) {
|
|
1340
|
-
dialog.successMessage({ text: '設定成功' });
|
|
1341
|
-
setTimeout(() => {
|
|
1342
|
-
vm.type = 'list';
|
|
1343
|
-
}, 200);
|
|
1344
|
-
} else {
|
|
1345
|
-
dialog.errorMessage({ text: '設定失敗' });
|
|
1346
|
-
}
|
|
1347
|
-
});
|
|
1348
|
-
})
|
|
1349
|
-
)}
|
|
1350
|
-
</div>`,
|
|
1351
|
-
].join('')
|
|
1352
|
-
);
|
|
1353
|
-
}
|
|
1354
|
-
return BgWidget.container(BgWidget.mainCard(html` <div>tag_edit</div>`));
|
|
1355
|
-
},
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1683
|
+
dialog.dataLoading({ text: '設定中...', visible: true });
|
|
1684
|
+
ApiUser.setPublicConfig({
|
|
1685
|
+
key: 'promo-label',
|
|
1686
|
+
user_id: 'manager',
|
|
1687
|
+
value: vm.labelList,
|
|
1688
|
+
}).then(result => {
|
|
1689
|
+
dialog.dataLoading({ visible: false });
|
|
1690
|
+
if (result.response.result) {
|
|
1691
|
+
dialog.successMessage({ text: '設定成功' });
|
|
1692
|
+
setTimeout(() => {
|
|
1693
|
+
vm.type = 'list';
|
|
1694
|
+
}, 200);
|
|
1695
|
+
} else {
|
|
1696
|
+
dialog.errorMessage({ text: '設定失敗' });
|
|
1697
|
+
}
|
|
1698
|
+
});
|
|
1699
|
+
})
|
|
1700
|
+
)}
|
|
1701
|
+
</div>`,
|
|
1702
|
+
].join('')
|
|
1703
|
+
);
|
|
1704
|
+
}
|
|
1705
|
+
return BgWidget.container(BgWidget.mainCard(html` <div>tag_edit</div>`));
|
|
1706
|
+
},
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1358
1709
|
}
|
|
1359
1710
|
|
|
1360
1711
|
(window as any).glitter.setModule(import.meta.url, ProductText);
|