ts-glitter 21.3.8 → 21.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-line.js +12 -1
- package/lowcode/backend-manager/bg-line.ts +16 -1
- package/lowcode/backend-manager/bg-notify.js +13 -2
- package/lowcode/backend-manager/bg-notify.ts +17 -2
- package/lowcode/backend-manager/bg-product.js +81 -30
- package/lowcode/backend-manager/bg-product.ts +95 -34
- package/lowcode/backend-manager/bg-recommend.js +109 -141
- package/lowcode/backend-manager/bg-recommend.ts +122 -144
- package/lowcode/backend-manager/bg-sns.js +14 -4
- package/lowcode/backend-manager/bg-sns.ts +18 -4
- package/lowcode/backend-manager/bg-widget.js +176 -12
- package/lowcode/backend-manager/bg-widget.ts +198 -13
- package/lowcode/cms-plugin/auto-fcm-advertise.js +13 -2
- package/lowcode/cms-plugin/auto-fcm-advertise.ts +16 -2
- package/lowcode/cms-plugin/auto-fcm-history.js +13 -2
- package/lowcode/cms-plugin/auto-fcm-history.ts +16 -2
- package/lowcode/cms-plugin/model/order.d.ts +1 -0
- package/lowcode/cms-plugin/module/order-excel.js +18 -2
- package/lowcode/cms-plugin/module/order-excel.ts +20 -9
- package/lowcode/cms-plugin/module/product-setting.js +2 -1
- package/lowcode/cms-plugin/module/product-setting.ts +2 -1
- package/lowcode/cms-plugin/module/user-excel.js +1 -1
- package/lowcode/cms-plugin/module/user-excel.ts +2 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.js +3 -2
- package/lowcode/cms-plugin/pos-pages/payment-page.ts +11 -5
- package/lowcode/cms-plugin/pos-pages/products-page.ts +0 -1
- package/lowcode/cms-plugin/shopping-allowance-manager.js +3 -2
- package/lowcode/cms-plugin/shopping-allowance-manager.ts +3 -2
- package/lowcode/cms-plugin/shopping-discount-setting.js +2 -0
- package/lowcode/cms-plugin/shopping-discount-setting.ts +2 -0
- package/lowcode/cms-plugin/shopping-invoice-manager.js +7 -4
- package/lowcode/cms-plugin/shopping-invoice-manager.ts +12 -11
- package/lowcode/cms-plugin/shopping-order-manager.js +21 -4
- package/lowcode/cms-plugin/shopping-order-manager.ts +30 -11
- package/lowcode/cms-plugin/shopping-product-setting.js +45 -41
- package/lowcode/cms-plugin/shopping-product-setting.ts +55 -48
- package/lowcode/cms-plugin/shopping-rebate.js +52 -46
- package/lowcode/cms-plugin/shopping-rebate.ts +402 -396
- package/lowcode/cms-plugin/shopping-setting-advance.js +6 -6
- package/lowcode/cms-plugin/shopping-setting-advance.ts +7 -7
- package/lowcode/cms-plugin/shopping-setting-basic.js +44 -0
- package/lowcode/cms-plugin/shopping-setting-basic.ts +63 -1
- package/lowcode/cms-plugin/shopping-setting-stock-log.js +57 -0
- package/lowcode/cms-plugin/shopping-setting-stock-log.ts +101 -0
- package/lowcode/cms-plugin/user-list.js +10 -9
- package/lowcode/cms-plugin/user-list.ts +11 -8
- package/lowcode/css/editor.css +1 -1
- package/lowcode/form-view/editor/image-selector.js +83 -82
- package/lowcode/form-view/editor/image-selector.ts +115 -107
- package/lowcode/glitter-base/route/user.js +27 -34
- package/lowcode/glitter-base/route/user.ts +31 -40
- package/lowcode/glitterBundle/dialog/ShareDialog.js +1 -0
- package/lowcode/glitterBundle/dialog/ShareDialog.ts +2 -0
- package/lowcode/glitterBundle/dialog/dialog.js +2 -2
- package/lowcode/glitterBundle/dialog/dialog.ts +2 -2
- package/lowcode/glitterBundle/plugins/editor-elem.js +5 -11
- package/lowcode/glitterBundle/plugins/editor-elem.ts +11 -11
- package/lowcode/modules/image-library.js +836 -486
- package/lowcode/modules/image-library.ts +1760 -1418
- package/lowcode/modules/tool.js +10 -9
- package/lowcode/modules/tool.ts +11 -10
- package/lowcode/public-components/checkout/index.js +4 -2
- package/lowcode/public-components/checkout/index.ts +5 -3
- package/lowcode/public-models/product.ts +13 -0
- package/nxv0ptv53w.json +1 -0
- package/package.json +1 -1
- package/src/api-public/controllers/shop.js +2 -2
- package/src/api-public/controllers/shop.js.map +1 -1
- package/src/api-public/controllers/shop.ts +5 -2
- package/src/api-public/controllers/stock.js +1 -1
- package/src/api-public/controllers/stock.js.map +1 -1
- package/src/api-public/controllers/stock.ts +93 -81
- package/src/api-public/models/glitter-finance.js +2 -1
- package/src/api-public/models/glitter-finance.js.map +1 -1
- package/src/api-public/services/checkout-event.js +1 -0
- package/src/api-public/services/checkout-event.js.map +1 -1
- package/src/api-public/services/checkout-event.ts +2 -2
- package/src/api-public/services/data-analyze.d.ts +1 -1
- package/src/api-public/services/diff-record.d.ts +25 -0
- package/src/api-public/services/diff-record.js +158 -0
- package/src/api-public/services/diff-record.js.map +1 -0
- package/src/api-public/services/diff-record.ts +217 -0
- package/src/api-public/services/ezpay/tool.d.ts +1 -0
- 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/public-table-check.js +25 -7
- package/src/api-public/services/public-table-check.js.map +1 -1
- package/src/api-public/services/public-table-check.ts +53 -31
- package/src/api-public/services/shopping.d.ts +2 -12
- package/src/api-public/services/shopping.js +16 -7
- package/src/api-public/services/shopping.js.map +1 -1
- package/src/api-public/services/shopping.ts +33 -7
- package/src/api-public/services/stock.d.ts +1 -1
- package/src/api-public/services/stock.js +19 -17
- package/src/api-public/services/stock.js.map +1 -1
- package/src/api-public/services/stock.ts +711 -696
- package/src/api-public/services/user.d.ts +1 -1
- package/src/api-public/services/user.js +25 -25
- package/src/api-public/services/user.js.map +1 -1
- package/src/api-public/services/user.ts +34 -27
- package/src/app-project/serverless/src/index.js +7 -17
- package/src/app-project/serverless/src/index.js.map +1 -1
- package/src/app-project/serverless/src/modules/CryptoJS.js +7 -17
- package/src/app-project/serverless/src/modules/CryptoJS.js.map +1 -1
- 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/app-project/serverless/src/modules/ssh.js +7 -17
- package/src/app-project/serverless/src/modules/ssh.js.map +1 -1
- package/src/firebase/message.js +2 -1
- package/src/firebase/message.js.map +1 -1
- package/src/helper/app_creater.js +2 -1
- package/src/helper/app_creater.js.map +1 -1
- package/src/helper/glitter-util.d.ts +1 -0
- package/src/lambda/interface.js +2 -2
- package/src/lambda/interface.js.map +1 -1
- package/src/modules/CryptoJS.js +7 -17
- package/src/modules/CryptoJS.js.map +1 -1
- package/src/modules/database.d.ts +1 -1
- package/src/modules/ssh.js +7 -17
- package/src/modules/ssh.js.map +1 -1
- package/src/modules/tool.d.ts +5 -0
- package/src/modules/tool.js +19 -0
- package/src/modules/tool.js.map +1 -1
- package/src/modules/tool.ts +27 -0
- package/src/run.js +2 -1
- package/src/run.js.map +1 -1
- package/src/services/app.js +7 -17
- package/src/services/app.js.map +1 -1
- package/src/services/saas-table-check.js +2 -2
- package/src/services/saas-table-check.js.map +1 -1
- package/src/services/ses.js +2 -1
- package/src/services/ses.js.map +1 -1
|
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { ApiUser } from
|
|
11
|
-
import { imageLibrary } from
|
|
12
|
-
import { BgWidget } from
|
|
10
|
+
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
11
|
+
import { imageLibrary } from '../../modules/image-library.js';
|
|
12
|
+
import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
13
13
|
export class ImageSelector {
|
|
14
14
|
static main(cf) {
|
|
15
15
|
const widget = cf.widget;
|
|
@@ -25,117 +25,118 @@ export class ImageSelector {
|
|
|
25
25
|
}
|
|
26
26
|
const src = widget.bundle.form_data[widget.bundle.form_key];
|
|
27
27
|
function selectImage() {
|
|
28
|
-
imageLibrary.selectImageLibrary(gvc,
|
|
28
|
+
imageLibrary.selectImageLibrary(gvc, urlArray => {
|
|
29
29
|
widget.bundle.form_data[widget.bundle.form_key] = urlArray[0].data;
|
|
30
30
|
widget.bundle.refresh && widget.bundle.refresh();
|
|
31
31
|
gvc.notifyDataChange(id);
|
|
32
|
-
}, html `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
</div>`, { mul: false });
|
|
32
|
+
}, html ` <div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">
|
|
33
|
+
圖片庫
|
|
34
|
+
</div>`, { mul: false });
|
|
36
35
|
}
|
|
37
|
-
return html `
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
onclick="${gvc.event(() => {
|
|
36
|
+
return html ` <div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;">
|
|
37
|
+
${widget.bundle.form_title}
|
|
38
|
+
<button
|
|
39
|
+
class="btn-size-sm btn-gray "
|
|
40
|
+
style=""
|
|
41
|
+
type="button"
|
|
42
|
+
onclick="${gvc.event(() => {
|
|
45
43
|
selectImage();
|
|
46
44
|
})}"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
>
|
|
46
|
+
<span class="tx_700" style="">替換</span>
|
|
47
|
+
</button>
|
|
48
|
+
</div>
|
|
49
|
+
<div
|
|
50
|
+
class="d-flex align-items-center justify-content-center rounded-3 shadow mt-2"
|
|
51
|
+
style="width:145px;height:145px;cursor:pointer;background-color: lightgrey;
|
|
52
|
+
background-image: url('${src ||
|
|
53
|
+
BgWidget.noImageURL}');background-size: cover;background-repeat: no-repeat;background-position: center;
|
|
56
54
|
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
|
|
58
|
+
style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
|
|
59
|
+
>
|
|
60
|
+
${src && src !== BgWidget.noImageURL
|
|
61
|
+
? ` <button
|
|
63
62
|
class="btn-size-sm btn-gray position-absolute"
|
|
64
63
|
style="top:5px;right:5px;"
|
|
65
64
|
type="button"
|
|
66
65
|
onclick="${gvc.event(() => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
window.glitter.getModule(gvc.glitter.root_path + `backend-manager/bg-widget.js`, (BgWidget) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const tag = gvc.glitter.generateCheckSum(src, 9);
|
|
68
|
+
let alt = (yield ApiUser.getPublicConfig(`alt_` + tag, 'manager'))
|
|
69
|
+
.response.value || { alt: '' };
|
|
70
|
+
function set_alt() {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
ApiUser.setPublicConfig({
|
|
73
|
+
key: `alt_` + tag,
|
|
74
|
+
value: alt,
|
|
75
|
+
user_id: 'manager',
|
|
76
|
+
});
|
|
76
77
|
});
|
|
78
|
+
}
|
|
79
|
+
BgWidget.settingDialog({
|
|
80
|
+
gvc: gvc,
|
|
81
|
+
title: '設定圖片描述',
|
|
82
|
+
innerHTML: (gvc) => {
|
|
83
|
+
return `<div>${BgWidget.textArea({
|
|
84
|
+
gvc: gvc,
|
|
85
|
+
title: `ALT描述`,
|
|
86
|
+
default: alt.alt,
|
|
87
|
+
placeHolder: `請輸入ALT描述`,
|
|
88
|
+
callback: (text) => {
|
|
89
|
+
alt.alt = text;
|
|
90
|
+
},
|
|
91
|
+
})}</div>`;
|
|
92
|
+
},
|
|
93
|
+
footer_html: (gvc) => {
|
|
94
|
+
let array = [
|
|
95
|
+
BgWidget.cancel(gvc.event(() => {
|
|
96
|
+
gvc.closeDialog();
|
|
97
|
+
})),
|
|
98
|
+
BgWidget.save(gvc.event(() => {
|
|
99
|
+
set_alt();
|
|
100
|
+
gvc.closeDialog();
|
|
101
|
+
})),
|
|
102
|
+
];
|
|
103
|
+
return array.join('');
|
|
104
|
+
},
|
|
77
105
|
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
gvc: gvc,
|
|
81
|
-
title: '設定圖片描述',
|
|
82
|
-
innerHTML: (gvc) => {
|
|
83
|
-
return `<div>${BgWidget.textArea({
|
|
84
|
-
gvc: gvc,
|
|
85
|
-
title: `ALT描述`,
|
|
86
|
-
default: alt.alt,
|
|
87
|
-
placeHolder: `請輸入ALT描述`,
|
|
88
|
-
callback: (text) => {
|
|
89
|
-
alt.alt = text;
|
|
90
|
-
},
|
|
91
|
-
})}</div>`;
|
|
92
|
-
},
|
|
93
|
-
footer_html: (gvc) => {
|
|
94
|
-
let array = [
|
|
95
|
-
BgWidget.cancel(gvc.event(() => {
|
|
96
|
-
gvc.closeDialog();
|
|
97
|
-
})),
|
|
98
|
-
BgWidget.save(gvc.event(() => {
|
|
99
|
-
set_alt();
|
|
100
|
-
gvc.closeDialog();
|
|
101
|
-
})),
|
|
102
|
-
];
|
|
103
|
-
return array.join('');
|
|
104
|
-
},
|
|
105
|
-
});
|
|
106
|
-
}));
|
|
107
|
-
})}"
|
|
106
|
+
}));
|
|
107
|
+
})}"
|
|
108
108
|
>
|
|
109
109
|
<span class="tx_700" style="">ALT</span>
|
|
110
110
|
</button>
|
|
111
111
|
<i
|
|
112
112
|
class="fa-regular fa-eye"
|
|
113
113
|
onclick="${gvc.event(() => {
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
window.parent.glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', src);
|
|
115
|
+
})}"
|
|
116
116
|
></i>
|
|
117
117
|
<i
|
|
118
118
|
class="fa-regular fa-trash"
|
|
119
119
|
onclick="${gvc.event(() => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
></i>`
|
|
120
|
+
widget.bundle.form_data[widget.bundle.form_key] = BgWidget.noImageURL;
|
|
121
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
122
|
+
gvc.notifyDataChange(id);
|
|
123
|
+
})}"
|
|
124
|
+
></i>`
|
|
125
|
+
: `
|
|
125
126
|
<button
|
|
126
127
|
class="btn-size-sm btn-gray "
|
|
127
128
|
style=""
|
|
128
129
|
type="button"
|
|
129
130
|
onclick="${gvc.event(() => {
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
selectImage();
|
|
132
|
+
})}"
|
|
132
133
|
>
|
|
133
134
|
<span class="tx_700" style="">選擇圖片</span>
|
|
134
135
|
</button>
|
|
135
136
|
`}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
137
|
+
</div>
|
|
138
|
+
</div>`;
|
|
139
|
+
},
|
|
139
140
|
};
|
|
140
141
|
});
|
|
141
142
|
}
|
|
@@ -1,150 +1,158 @@
|
|
|
1
|
-
import {GVC} from
|
|
2
|
-
import {ApiUser} from
|
|
3
|
-
import {imageLibrary} from
|
|
4
|
-
import {ShareDialog} from
|
|
5
|
-
import {BgWidget} from
|
|
1
|
+
import { GVC } from '../../glitterBundle/GVController.js';
|
|
2
|
+
import { ApiUser } from '../../glitter-base/route/user.js';
|
|
3
|
+
import { imageLibrary } from '../../modules/image-library.js';
|
|
4
|
+
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
5
|
+
import { BgWidget } from '../../backend-manager/bg-widget.js';
|
|
6
6
|
|
|
7
7
|
export class ImageSelector {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
public static main(cf: { gvc: GVC; formData: any; widget: any }) {
|
|
9
|
+
const widget = cf.widget;
|
|
10
|
+
const gvc = cf.gvc;
|
|
11
|
+
const id = gvc.glitter.getUUID();
|
|
12
|
+
const html = String.raw;
|
|
13
|
+
return gvc.bindView(() => {
|
|
14
|
+
return {
|
|
15
|
+
bind: id,
|
|
16
|
+
view: () => {
|
|
17
|
+
if (typeof widget.bundle.form_data[widget.bundle.form_key] === 'object') {
|
|
18
|
+
widget.bundle.form_data[widget.bundle.form_key] = widget.bundle.form_data[widget.bundle.form_key].value;
|
|
19
|
+
}
|
|
20
|
+
const src = widget.bundle.form_data[widget.bundle.form_key];
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
22
|
+
function selectImage() {
|
|
23
|
+
imageLibrary.selectImageLibrary(
|
|
24
|
+
gvc,
|
|
25
|
+
urlArray => {
|
|
26
|
+
widget.bundle.form_data[widget.bundle.form_key] = urlArray[0].data;
|
|
27
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
28
|
+
gvc.notifyDataChange(id);
|
|
29
|
+
},
|
|
30
|
+
html` <div class="d-flex flex-column" style="border-radius: 10px 10px 0px 0px;background: #F2F2F2;">
|
|
31
|
+
圖片庫
|
|
32
|
+
</div>`,
|
|
33
|
+
{ mul: false }
|
|
34
|
+
);
|
|
35
|
+
}
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
background-image: url('${src || BgWidget.noImageURL}');background-size: cover;background-repeat: no-repeat;background-position: center;
|
|
37
|
+
return html` <div class="fw-normal mt-2 fs-6 d-flex align-items-center" style="gap:8px;">
|
|
38
|
+
${widget.bundle.form_title}
|
|
39
|
+
<button
|
|
40
|
+
class="btn-size-sm btn-gray "
|
|
41
|
+
style=""
|
|
42
|
+
type="button"
|
|
43
|
+
onclick="${gvc.event(() => {
|
|
44
|
+
selectImage();
|
|
45
|
+
})}"
|
|
46
|
+
>
|
|
47
|
+
<span class="tx_700" style="">替換</span>
|
|
48
|
+
</button>
|
|
49
|
+
</div>
|
|
50
|
+
<div
|
|
51
|
+
class="d-flex align-items-center justify-content-center rounded-3 shadow mt-2"
|
|
52
|
+
style="width:145px;height:145px;cursor:pointer;background-color: lightgrey;
|
|
53
|
+
background-image: url('${src ||
|
|
54
|
+
BgWidget.noImageURL}');background-size: cover;background-repeat: no-repeat;background-position: center;
|
|
57
55
|
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
>
|
|
57
|
+
<div
|
|
58
|
+
class="w-100 h-100 d-flex align-items-center justify-content-center rounded-3 p-hover-image position-relative"
|
|
59
|
+
style="opacity:0;background: rgba(0,0,0,0.5);gap:20px;color:white;font-size:22px;"
|
|
60
|
+
>
|
|
61
|
+
${src && src !== BgWidget.noImageURL
|
|
62
|
+
? ` <button
|
|
64
63
|
class="btn-size-sm btn-gray position-absolute"
|
|
65
64
|
style="top:5px;right:5px;"
|
|
66
65
|
type="button"
|
|
67
66
|
onclick="${gvc.event(() => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
(window as any).glitter.getModule(
|
|
68
|
+
gvc.glitter.root_path + `backend-manager/bg-widget.js`,
|
|
69
|
+
async (BgWidget: any) => {
|
|
70
|
+
const tag = gvc.glitter.generateCheckSum(src, 9);
|
|
71
|
+
let alt = (await ApiUser.getPublicConfig(`alt_` + tag, 'manager'))
|
|
72
|
+
.response.value || { alt: '' };
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
async function set_alt() {
|
|
75
|
+
ApiUser.setPublicConfig({
|
|
76
|
+
key: `alt_` + tag,
|
|
77
|
+
value: alt,
|
|
78
|
+
user_id: 'manager',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
79
81
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
BgWidget.settingDialog({
|
|
83
|
+
gvc: gvc,
|
|
84
|
+
title: '設定圖片描述',
|
|
85
|
+
innerHTML: (gvc: GVC) => {
|
|
86
|
+
return `<div>${BgWidget.textArea({
|
|
85
87
|
gvc: gvc,
|
|
86
88
|
title: `ALT描述`,
|
|
87
89
|
default: alt.alt,
|
|
88
90
|
placeHolder: `請輸入ALT描述`,
|
|
89
91
|
callback: (text: string) => {
|
|
90
|
-
|
|
92
|
+
alt.alt = text;
|
|
91
93
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
})}</div>`;
|
|
95
|
+
},
|
|
96
|
+
footer_html: (gvc: GVC) => {
|
|
97
|
+
let array = [
|
|
96
98
|
BgWidget.cancel(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
gvc.event(() => {
|
|
100
|
+
gvc.closeDialog();
|
|
101
|
+
})
|
|
100
102
|
),
|
|
101
103
|
BgWidget.save(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
gvc.event(() => {
|
|
105
|
+
set_alt();
|
|
106
|
+
gvc.closeDialog();
|
|
107
|
+
})
|
|
106
108
|
),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
];
|
|
110
|
+
return array.join('');
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
})}"
|
|
113
116
|
>
|
|
114
117
|
<span class="tx_700" style="">ALT</span>
|
|
115
118
|
</button>
|
|
116
119
|
<i
|
|
117
120
|
class="fa-regular fa-eye"
|
|
118
121
|
onclick="${gvc.event(() => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
(window.parent as any).glitter.openDiaLog(
|
|
123
|
+
new URL('../../dialog/image-preview.js', import.meta.url).href,
|
|
124
|
+
'preview',
|
|
125
|
+
src
|
|
126
|
+
);
|
|
127
|
+
// gvc.glitter.openDiaLog(new URL('../../dialog/image-preview.js', import.meta.url).href, 'preview', dd);
|
|
128
|
+
})}"
|
|
122
129
|
></i>
|
|
123
130
|
<i
|
|
124
131
|
class="fa-regular fa-trash"
|
|
125
132
|
onclick="${gvc.event(() => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
></i>`
|
|
133
|
+
widget.bundle.form_data[widget.bundle.form_key] = BgWidget.noImageURL;
|
|
134
|
+
widget.bundle.refresh && widget.bundle.refresh();
|
|
135
|
+
gvc.notifyDataChange(id);
|
|
136
|
+
})}"
|
|
137
|
+
></i>`
|
|
138
|
+
: `
|
|
131
139
|
<button
|
|
132
140
|
class="btn-size-sm btn-gray "
|
|
133
141
|
style=""
|
|
134
142
|
type="button"
|
|
135
143
|
onclick="${gvc.event(() => {
|
|
136
|
-
|
|
137
|
-
|
|
144
|
+
selectImage();
|
|
145
|
+
})}"
|
|
138
146
|
>
|
|
139
147
|
<span class="tx_700" style="">選擇圖片</span>
|
|
140
148
|
</button>
|
|
141
149
|
`}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
</div>
|
|
151
|
+
</div>`;
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
}
|
|
148
156
|
}
|
|
149
157
|
|
|
150
158
|
(window as any).glitter.setModule(import.meta.url, ImageSelector);
|
|
@@ -9,7 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { BaseApi } from '../../glitterBundle/api/base.js';
|
|
11
11
|
import { GlobalUser } from '../global/global-user.js';
|
|
12
|
-
import { ApiShop } from './shopping.js';
|
|
13
12
|
import { ShareDialog } from '../../glitterBundle/dialog/ShareDialog.js';
|
|
14
13
|
export class ApiUser {
|
|
15
14
|
static register(json) {
|
|
@@ -312,16 +311,17 @@ export class ApiUser {
|
|
|
312
311
|
});
|
|
313
312
|
}
|
|
314
313
|
static getUserList(json) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
314
|
+
const url = getBaseUrl() +
|
|
315
|
+
`/api-public/v1/user?${(() => {
|
|
316
|
+
let par = [`type=list`, `limit=${json.limit}`, `page=${json.page}`];
|
|
317
|
+
json.search && par.push(`search=${json.search}`);
|
|
318
|
+
json.search_type && par.push(`searchType=${json.search_type}`);
|
|
319
|
+
json.only_id && par.push(`only_id=${json.only_id}`);
|
|
320
|
+
json.id && par.push(`id=${json.id}`);
|
|
321
|
+
return par.join('&');
|
|
322
|
+
})()}`;
|
|
323
|
+
return BaseApi.create({
|
|
324
|
+
url: url,
|
|
325
325
|
type: 'GET',
|
|
326
326
|
headers: {
|
|
327
327
|
'g-app': getConfig().config.appName,
|
|
@@ -387,6 +387,7 @@ export class ApiUser {
|
|
|
387
387
|
order_string: (_d = json.orderString) !== null && _d !== void 0 ? _d : '',
|
|
388
388
|
filter_type: (_e = json.filter_type) !== null && _e !== void 0 ? _e : '',
|
|
389
389
|
all_result: json.all_result ? `${json.all_result}` : '',
|
|
390
|
+
only_id: json.only_id ? `${json.only_id}` : '',
|
|
390
391
|
}).toString();
|
|
391
392
|
const extraQuery = [...filterString, ...groupString].join('&');
|
|
392
393
|
const finalQuery = extraQuery ? `${baseQuery}&${extraQuery}` : baseQuery;
|
|
@@ -405,31 +406,10 @@ export class ApiUser {
|
|
|
405
406
|
response: { data: [], total: 0 },
|
|
406
407
|
};
|
|
407
408
|
}
|
|
408
|
-
const array = data.response.data;
|
|
409
|
-
const allUsers = data.response.allUsers;
|
|
410
|
-
if (array.length > 0) {
|
|
411
|
-
yield Promise.allSettled(array.map((item) => __awaiter(this, void 0, void 0, function* () {
|
|
412
|
-
const firstShipment = (yield ApiShop.getOrder({
|
|
413
|
-
page: 0,
|
|
414
|
-
limit: 1,
|
|
415
|
-
data_from: 'manager',
|
|
416
|
-
email: item.account || '-1',
|
|
417
|
-
phone: item.account || '-1',
|
|
418
|
-
valid: true,
|
|
419
|
-
is_shipment: true,
|
|
420
|
-
})).response.data[0];
|
|
421
|
-
if (!item.tag_name) {
|
|
422
|
-
item.tag_name = '一般會員';
|
|
423
|
-
}
|
|
424
|
-
if (firstShipment) {
|
|
425
|
-
item.firstShipment = firstShipment;
|
|
426
|
-
}
|
|
427
|
-
})));
|
|
428
|
-
}
|
|
429
409
|
return {
|
|
430
410
|
response: {
|
|
431
|
-
data:
|
|
432
|
-
allUsers,
|
|
411
|
+
data: data.response.data,
|
|
412
|
+
allUsers: data.response.allUsers,
|
|
433
413
|
total: data.response.total,
|
|
434
414
|
extra: data.response.extra,
|
|
435
415
|
},
|
|
@@ -727,6 +707,19 @@ export class ApiUser {
|
|
|
727
707
|
},
|
|
728
708
|
});
|
|
729
709
|
}
|
|
710
|
+
static getUserPermission() {
|
|
711
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
712
|
+
return yield this.getPermission({ page: 0, limit: 1000 }).then(data => {
|
|
713
|
+
if (!data.result) {
|
|
714
|
+
return undefined;
|
|
715
|
+
}
|
|
716
|
+
const find_user = data.response.data.find((data) => {
|
|
717
|
+
return `${data.user}` === `${GlobalUser.parseJWT(GlobalUser.saas_token).payload.userID}`;
|
|
718
|
+
});
|
|
719
|
+
return find_user;
|
|
720
|
+
});
|
|
721
|
+
});
|
|
722
|
+
}
|
|
730
723
|
static setPermission(json) {
|
|
731
724
|
return BaseApi.create({
|
|
732
725
|
url: getBaseUrl() + `/api-public/v1/user/permission`,
|