ts-glitter 13.8.673 → 13.8.676
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 +9 -3
- package/lowcode/Entry.ts +24 -18
- package/lowcode/cms-plugin/POS-setting.js +1 -2
- package/lowcode/cms-plugin/POS-setting.ts +3 -4
- package/lowcode/config.js +3 -1
- package/lowcode/config.ts +3 -1
- package/lowcode/view-model/saas-view-model.js +2 -3
- package/lowcode/view-model/saas-view-model.ts +2 -3
- package/package.json +1 -2
package/lowcode/Entry.js
CHANGED
|
@@ -17,6 +17,11 @@ import { ShareDialog } from './glitterBundle/dialog/ShareDialog.js';
|
|
|
17
17
|
export class Entry {
|
|
18
18
|
static onCreate(glitter) {
|
|
19
19
|
var _a;
|
|
20
|
+
glitter.share.reload = (page, app_name) => {
|
|
21
|
+
window.appName = app_name || window.appName;
|
|
22
|
+
window.glitter_page = page;
|
|
23
|
+
Entry.onCreate(glitter);
|
|
24
|
+
};
|
|
20
25
|
glitter.share.top_inset = 0;
|
|
21
26
|
glitter.share.bottom_inset = 0;
|
|
22
27
|
glitter.share.reload_code_hash = function () {
|
|
@@ -60,11 +65,10 @@ export class Entry {
|
|
|
60
65
|
`);
|
|
61
66
|
if (glitter.getUrlParameter('appName')) {
|
|
62
67
|
window.appName = glitter.getUrlParameter('appName');
|
|
63
|
-
config.appName = glitter.getUrlParameter('appName');
|
|
64
68
|
}
|
|
65
69
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
66
70
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
67
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
71
|
+
glitter.share.editerVersion = 'V_13.8.676';
|
|
68
72
|
glitter.share.start = new Date();
|
|
69
73
|
const vm = {
|
|
70
74
|
appConfig: [],
|
|
@@ -595,7 +599,9 @@ export class Entry {
|
|
|
595
599
|
});
|
|
596
600
|
}
|
|
597
601
|
if (glitter.getUrlParameter('type') === 'editor' || glitter.getUrlParameter('page') === 'pos') {
|
|
598
|
-
|
|
602
|
+
setTimeout(() => {
|
|
603
|
+
loopVersion();
|
|
604
|
+
}, 1000 * 300);
|
|
599
605
|
}
|
|
600
606
|
let countI = dd.response.data.initialList.length;
|
|
601
607
|
const vm = {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -6,11 +6,15 @@ import {BaseApi} from './glitterBundle/api/base.js';
|
|
|
6
6
|
import {GlobalUser} from './glitter-base/global/global-user.js';
|
|
7
7
|
import {EditorConfig} from './editor-config.js';
|
|
8
8
|
import {ShareDialog} from './glitterBundle/dialog/ShareDialog.js';
|
|
9
|
-
|
|
10
|
-
import {ApiUser} from "./glitter-base/route/user.js";
|
|
9
|
+
|
|
11
10
|
|
|
12
11
|
export class Entry {
|
|
13
12
|
public static onCreate(glitter: Glitter) {
|
|
13
|
+
glitter.share.reload = (page: string, app_name: string) => {
|
|
14
|
+
(window as any).appName = app_name || (window as any).appName;
|
|
15
|
+
(window as any).glitter_page = page;
|
|
16
|
+
Entry.onCreate(glitter)
|
|
17
|
+
}
|
|
14
18
|
glitter.share.top_inset = 0;
|
|
15
19
|
glitter.share.bottom_inset = 0;
|
|
16
20
|
glitter.share.reload_code_hash = function () {
|
|
@@ -62,11 +66,10 @@ export class Entry {
|
|
|
62
66
|
`);
|
|
63
67
|
if (glitter.getUrlParameter('appName')) {
|
|
64
68
|
(window as any).appName = glitter.getUrlParameter('appName');
|
|
65
|
-
config.appName = glitter.getUrlParameter('appName');
|
|
66
69
|
}
|
|
67
70
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
68
71
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
69
|
-
glitter.share.editerVersion = 'V_13.8.
|
|
72
|
+
glitter.share.editerVersion = 'V_13.8.676';
|
|
70
73
|
glitter.share.start = new Date();
|
|
71
74
|
const vm: {
|
|
72
75
|
appConfig: any;
|
|
@@ -182,18 +185,18 @@ export class Entry {
|
|
|
182
185
|
Entry.toHtmlEditor(glitter, vm, () => {
|
|
183
186
|
Entry.checkIframe(glitter);
|
|
184
187
|
});
|
|
185
|
-
} else if(glitter.getUrlParameter('page')==='backend_manager'){
|
|
188
|
+
} else if (glitter.getUrlParameter('page') === 'backend_manager') {
|
|
186
189
|
if (!GlobalUser.token) {
|
|
187
190
|
glitter.setUrlParameter('page', 'login');
|
|
188
191
|
location.reload()
|
|
189
|
-
}else{
|
|
192
|
+
} else {
|
|
190
193
|
try {
|
|
191
194
|
const appList = (await ApiPageConfig.getAppList(
|
|
192
195
|
undefined,
|
|
193
196
|
GlobalUser.token
|
|
194
197
|
)).response.result;
|
|
195
198
|
localStorage.setItem('select_item', '0')
|
|
196
|
-
if(appList.length===0){
|
|
199
|
+
if (appList.length === 0) {
|
|
197
200
|
glitter.getModule(new URL('./view-model/saas-view-model.js', location.href).href, (SaasViewModel) => {
|
|
198
201
|
glitter.innerDialog((gvc) => {
|
|
199
202
|
return gvc.bindView(() => {
|
|
@@ -208,9 +211,9 @@ export class Entry {
|
|
|
208
211
|
|
|
209
212
|
}, 'change_app')
|
|
210
213
|
})
|
|
211
|
-
}else{
|
|
214
|
+
} else {
|
|
212
215
|
let appName = appList[0].appName;
|
|
213
|
-
if (appList.find((dd:any) => {
|
|
216
|
+
if (appList.find((dd: any) => {
|
|
214
217
|
return dd.appName === localStorage.getItem('select_app_name')
|
|
215
218
|
})) {
|
|
216
219
|
appName = localStorage.getItem('select_app_name')
|
|
@@ -221,12 +224,12 @@ export class Entry {
|
|
|
221
224
|
glitter.setUrlParameter('function', 'backend-manger')
|
|
222
225
|
location.reload()
|
|
223
226
|
}
|
|
224
|
-
}catch (e) {
|
|
227
|
+
} catch (e) {
|
|
225
228
|
glitter.setUrlParameter('page', 'login');
|
|
226
229
|
location.reload()
|
|
227
230
|
}
|
|
228
231
|
}
|
|
229
|
-
}else {
|
|
232
|
+
} else {
|
|
230
233
|
// 一般頁面
|
|
231
234
|
Entry.toNormalRender(glitter, vm, () => {
|
|
232
235
|
Entry.checkIframe(glitter);
|
|
@@ -262,7 +265,7 @@ export class Entry {
|
|
|
262
265
|
|
|
263
266
|
// 跳轉至頁面編輯器
|
|
264
267
|
public static toBackendEditor(glitter: Glitter, callback: () => void) {
|
|
265
|
-
if ((localStorage.getItem('on-pos') === 'true') && glitter.getUrlParameter('page')!=='pos') {
|
|
268
|
+
if ((localStorage.getItem('on-pos') === 'true') && glitter.getUrlParameter('page') !== 'pos') {
|
|
266
269
|
localStorage.removeItem('on-pos')
|
|
267
270
|
location.href = glitter.root_path + 'pos?app-id=t_1725992531001';
|
|
268
271
|
}
|
|
@@ -542,7 +545,7 @@ export class Entry {
|
|
|
542
545
|
'getTopInset',
|
|
543
546
|
{},
|
|
544
547
|
(response: any) => {
|
|
545
|
-
glitter.share.top_inset=(response.data);
|
|
548
|
+
glitter.share.top_inset = (response.data);
|
|
546
549
|
},
|
|
547
550
|
{
|
|
548
551
|
webFunction: () => {
|
|
@@ -555,7 +558,7 @@ export class Entry {
|
|
|
555
558
|
'getBottomInset',
|
|
556
559
|
{},
|
|
557
560
|
(response: any) => {
|
|
558
|
-
glitter.share.bottom_inset=(response.data);
|
|
561
|
+
glitter.share.bottom_inset = (response.data);
|
|
559
562
|
},
|
|
560
563
|
{
|
|
561
564
|
webFunction: () => {
|
|
@@ -653,14 +656,14 @@ export class Entry {
|
|
|
653
656
|
callback: (response) => {
|
|
654
657
|
if (response) {
|
|
655
658
|
location.reload()
|
|
656
|
-
}else{
|
|
659
|
+
} else {
|
|
657
660
|
setTimeout(() => {
|
|
658
661
|
loopVersion()
|
|
659
662
|
}, 1000 * 300)
|
|
660
663
|
}
|
|
661
664
|
}
|
|
662
665
|
})
|
|
663
|
-
}else{
|
|
666
|
+
} else {
|
|
664
667
|
setTimeout(() => {
|
|
665
668
|
loopVersion()
|
|
666
669
|
}, 1000 * 300)
|
|
@@ -668,8 +671,11 @@ export class Entry {
|
|
|
668
671
|
|
|
669
672
|
})
|
|
670
673
|
}
|
|
671
|
-
|
|
672
|
-
|
|
674
|
+
|
|
675
|
+
if (glitter.getUrlParameter('type') === 'editor' || glitter.getUrlParameter('page') === 'pos') {
|
|
676
|
+
setTimeout(() => {
|
|
677
|
+
loopVersion()
|
|
678
|
+
}, 1000 * 300)
|
|
673
679
|
}
|
|
674
680
|
|
|
675
681
|
let countI = dd.response.data.initialList.length;
|
|
@@ -222,7 +222,6 @@ height: 51px;
|
|
|
222
222
|
`);
|
|
223
223
|
POSSetting.initialStyle(gvc);
|
|
224
224
|
gvc.glitter.share.NormalPageEditor = NormalPageEditor;
|
|
225
|
-
getConfig().config.appName = gvc.glitter.getUrlParameter('app-id');
|
|
226
225
|
window.glitterBase = 'shopnex';
|
|
227
226
|
window.appName = gvc.glitter.getUrlParameter('app-id');
|
|
228
227
|
window.saasConfig.config.token = GlobalUser.saas_token;
|
|
@@ -561,7 +560,7 @@ cursor: pointer;
|
|
|
561
560
|
dialog.dataLoading({ visible: true });
|
|
562
561
|
localStorage.removeItem('on-pos');
|
|
563
562
|
(window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
|
|
564
|
-
|
|
563
|
+
glitter.share.reload('cms', 'shopnex');
|
|
565
564
|
})}">返回全通路後臺</a>
|
|
566
565
|
` : ``}
|
|
567
566
|
</div>
|
|
@@ -257,7 +257,6 @@ height: 51px;
|
|
|
257
257
|
POSSetting.initialStyle(gvc);
|
|
258
258
|
//提供給編輯器使用
|
|
259
259
|
gvc.glitter.share.NormalPageEditor = NormalPageEditor;
|
|
260
|
-
getConfig().config.appName = gvc.glitter.getUrlParameter('app-id');
|
|
261
260
|
(window as any).glitterBase = 'shopnex';
|
|
262
261
|
(window as any).appName = gvc.glitter.getUrlParameter('app-id');
|
|
263
262
|
(window as any).saasConfig.config.token = GlobalUser.saas_token;
|
|
@@ -603,11 +602,11 @@ cursor: pointer;
|
|
|
603
602
|
})().join('<div class="dropdown-divider"></div>')}
|
|
604
603
|
${(POSSetting.config.who === 'manager') ? `<div class="dropdown-divider"></div>
|
|
605
604
|
<a class="dropdown-item cursor_pointer d-flex flex-column" onclick="${gvc.event(() => {
|
|
606
|
-
const dialog = new ShareDialog(gvc.glitter)
|
|
607
|
-
dialog.dataLoading({visible: true})
|
|
605
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
606
|
+
dialog.dataLoading({visible: true});
|
|
608
607
|
localStorage.removeItem('on-pos');
|
|
609
608
|
(window.parent).history.replaceState({}, document.title, `${glitter.root_path}cms?appName=${glitter.getUrlParameter('app-id')}&type=editor&function=backend-manger&tab=home_page`);
|
|
610
|
-
|
|
609
|
+
glitter.share.reload('cms','shopnex');
|
|
611
610
|
})}">返回全通路後臺</a>
|
|
612
611
|
` : ``}
|
|
613
612
|
</div>
|
package/lowcode/config.js
CHANGED
package/lowcode/config.ts
CHANGED
|
@@ -168,13 +168,12 @@ export class SaasViewModel {
|
|
|
168
168
|
<a
|
|
169
169
|
class="dropdown-item cursor_pointer"
|
|
170
170
|
onclick="${gvc.event(() => {
|
|
171
|
-
gvc.glitter.setUrlParameter();
|
|
172
171
|
dialog.checkYesOrNot({
|
|
173
172
|
callback: (bool) => {
|
|
174
173
|
if (bool) {
|
|
175
174
|
GlobalUser.saas_token = '';
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
window.history.replaceState({}, document.title, gvc.glitter.root_path + 'login');
|
|
176
|
+
gvc.glitter.share.reload('login', 'shopnex');
|
|
178
177
|
}
|
|
179
178
|
},
|
|
180
179
|
text: '確定要登出嗎?',
|
|
@@ -162,13 +162,12 @@ export class SaasViewModel {
|
|
|
162
162
|
<a
|
|
163
163
|
class="dropdown-item cursor_pointer"
|
|
164
164
|
onclick="${gvc.event(() => {
|
|
165
|
-
gvc.glitter.setUrlParameter()
|
|
166
165
|
dialog.checkYesOrNot({
|
|
167
166
|
callback: (bool) => {
|
|
168
167
|
if (bool) {
|
|
169
168
|
GlobalUser.saas_token = '';
|
|
170
|
-
gvc.glitter.
|
|
171
|
-
|
|
169
|
+
window.history.replaceState({},document.title,gvc.glitter.root_path+'login')
|
|
170
|
+
gvc.glitter.share.reload('login','shopnex')
|
|
172
171
|
}
|
|
173
172
|
},
|
|
174
173
|
text: '確定要登出嗎?',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-glitter",
|
|
3
|
-
"version": "13.8.
|
|
3
|
+
"version": "13.8.676",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"axios": "^1.6.2",
|
|
33
33
|
"bcrypt": "^5.1.0",
|
|
34
34
|
"body-parser": "^1.20.2",
|
|
35
|
-
"ts-glitter": "13.8.672",
|
|
36
35
|
"compression": "^1.7.4",
|
|
37
36
|
"cookie-parser": "^1.4.6",
|
|
38
37
|
"cors": "^2.8.5",
|