ts-glitter 13.8.669 → 13.8.672

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 CHANGED
@@ -64,7 +64,7 @@ export class Entry {
64
64
  }
65
65
  window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
66
66
  console.log(`Entry-time:`, window.renderClock.stop());
67
- glitter.share.editerVersion = 'V_13.8.669';
67
+ glitter.share.editerVersion = 'V_13.8.672';
68
68
  glitter.share.start = new Date();
69
69
  const vm = {
70
70
  appConfig: [],
@@ -171,6 +171,50 @@ export class Entry {
171
171
  Entry.checkIframe(glitter);
172
172
  });
173
173
  }
174
+ else if (glitter.getUrlParameter('page') === 'backend_manager') {
175
+ if (!GlobalUser.token) {
176
+ glitter.setUrlParameter('page', 'login');
177
+ location.reload();
178
+ }
179
+ else {
180
+ try {
181
+ const appList = (yield ApiPageConfig.getAppList(undefined, GlobalUser.token)).response.result;
182
+ localStorage.setItem('select_item', '0');
183
+ if (appList.length === 0) {
184
+ glitter.getModule(new URL('./view-model/saas-view-model.js', location.href).href, (SaasViewModel) => {
185
+ glitter.innerDialog((gvc) => {
186
+ return gvc.bindView(() => {
187
+ const id = gvc.glitter.getUUID();
188
+ return {
189
+ bind: id,
190
+ view: () => {
191
+ return SaasViewModel.createShop(gvc, true);
192
+ }
193
+ };
194
+ });
195
+ }, 'change_app');
196
+ });
197
+ }
198
+ else {
199
+ let appName = appList[0].appName;
200
+ if (appList.find((dd) => {
201
+ return dd.appName === localStorage.getItem('select_app_name');
202
+ })) {
203
+ appName = localStorage.getItem('select_app_name');
204
+ }
205
+ glitter.setUrlParameter('page', 'index');
206
+ glitter.setUrlParameter('type', 'editor');
207
+ glitter.setUrlParameter('appName', appName);
208
+ glitter.setUrlParameter('function', 'backend-manger');
209
+ location.reload();
210
+ }
211
+ }
212
+ catch (e) {
213
+ glitter.setUrlParameter('page', 'login');
214
+ location.reload();
215
+ }
216
+ }
217
+ }
174
218
  else {
175
219
  Entry.toNormalRender(glitter, vm, () => {
176
220
  Entry.checkIframe(glitter);
package/lowcode/Entry.ts CHANGED
@@ -6,6 +6,8 @@ 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
+ import {TriggerEvent} from "./glitterBundle/plugins/trigger-event.js";
10
+ import {ApiUser} from "./glitter-base/route/user.js";
9
11
 
10
12
  export class Entry {
11
13
  public static onCreate(glitter: Glitter) {
@@ -64,7 +66,7 @@ export class Entry {
64
66
  }
65
67
  (window as any).renderClock = (window as any).renderClock ?? clockF();
66
68
  console.log(`Entry-time:`, (window as any).renderClock.stop());
67
- glitter.share.editerVersion = 'V_13.8.669';
69
+ glitter.share.editerVersion = 'V_13.8.672';
68
70
  glitter.share.start = new Date();
69
71
  const vm: {
70
72
  appConfig: any;
@@ -180,7 +182,51 @@ export class Entry {
180
182
  Entry.toHtmlEditor(glitter, vm, () => {
181
183
  Entry.checkIframe(glitter);
182
184
  });
183
- } else {
185
+ } else if(glitter.getUrlParameter('page')==='backend_manager'){
186
+ if (!GlobalUser.token) {
187
+ glitter.setUrlParameter('page', 'login');
188
+ location.reload()
189
+ }else{
190
+ try {
191
+ const appList = (await ApiPageConfig.getAppList(
192
+ undefined,
193
+ GlobalUser.token
194
+ )).response.result;
195
+ localStorage.setItem('select_item', '0')
196
+ if(appList.length===0){
197
+ glitter.getModule(new URL('./view-model/saas-view-model.js', location.href).href, (SaasViewModel) => {
198
+ glitter.innerDialog((gvc) => {
199
+ return gvc.bindView(() => {
200
+ const id = gvc.glitter.getUUID();
201
+ return {
202
+ bind: id,
203
+ view: () => {
204
+ return SaasViewModel.createShop(gvc, true)
205
+ }
206
+ }
207
+ })
208
+
209
+ }, 'change_app')
210
+ })
211
+ }else{
212
+ let appName = appList[0].appName;
213
+ if (appList.find((dd:any) => {
214
+ return dd.appName === localStorage.getItem('select_app_name')
215
+ })) {
216
+ appName = localStorage.getItem('select_app_name')
217
+ }
218
+ glitter.setUrlParameter('page', 'index')
219
+ glitter.setUrlParameter('type', 'editor')
220
+ glitter.setUrlParameter('appName', appName)
221
+ glitter.setUrlParameter('function', 'backend-manger')
222
+ location.reload()
223
+ }
224
+ }catch (e) {
225
+ glitter.setUrlParameter('page', 'login');
226
+ location.reload()
227
+ }
228
+ }
229
+ }else {
184
230
  // 一般頁面
185
231
  Entry.toNormalRender(glitter, vm, () => {
186
232
  Entry.checkIframe(glitter);
@@ -314,18 +314,18 @@ height: 51px;
314
314
  return html `
315
315
  <div
316
316
  class="d-flex nav-top"
317
- style="z-index:20;min-height: ${(() => {
317
+ style="z-index:20;padding-top:${glitter.share.top_inset}px;width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
318
+ >
319
+ <div
320
+ class="POS-logo d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ``} mx-2 w-100"
321
+ style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 32px;padding-left: 24px;`}height: ${(() => {
318
322
  if (document.body.offsetWidth > 800) {
319
323
  return `86px`;
320
324
  }
321
325
  else {
322
326
  return `66px`;
323
327
  }
324
- })()};padding-top:${glitter.share.top_inset}px;width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
325
- >
326
- <div
327
- class="POS-logo h-100 d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ``} mx-2 w-100"
328
- style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 32px;padding-left: 24px;`}"
328
+ })()};"
329
329
  >
330
330
  ${document.body.offsetWidth < 800 && vm.type === 'menu'
331
331
  ? ` `
@@ -355,17 +355,17 @@ height: 51px;
355
355
  return html`
356
356
  <div
357
357
  class="d-flex nav-top"
358
- style="z-index:20;min-height: ${(() => {
359
- if (document.body.offsetWidth > 800) {
360
- return `86px`
361
- } else {
362
- return `66px`
363
- }
364
- })()};padding-top:${glitter.share.top_inset}px;width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
358
+ style="z-index:20;padding-top:${glitter.share.top_inset}px;width: 100%;background: #FFF;box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.10);position: fixed;left: 0;top: 0;"
365
359
  >
366
360
  <div
367
- class="POS-logo h-100 d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ``} mx-2 w-100"
368
- style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 32px;padding-left: 24px;`}"
361
+ class="POS-logo d-flex align-items-center ${document.body.offsetWidth < 800 ? `justify-content-center` : ``} mx-2 w-100"
362
+ style="${document.body.offsetWidth < 800 ? `gap: 0px;` : `gap: 32px;padding-left: 24px;`}height: ${(() => {
363
+ if (document.body.offsetWidth > 800) {
364
+ return `86px`
365
+ } else {
366
+ return `66px`
367
+ }
368
+ })()};"
369
369
  >
370
370
  ${document.body.offsetWidth < 800 && vm.type === 'menu'
371
371
  ? ` `
@@ -2383,6 +2383,11 @@ HtmlGenerate.renameWidgetID = (dd) => {
2383
2383
  HtmlGenerate.setHome = (obj) => {
2384
2384
  var _a, _b;
2385
2385
  const glitter = Glitter.glitter;
2386
+ if (obj.tag === 'backend_manager') {
2387
+ glitter.setUrlParameter('page', 'backend_manager');
2388
+ location.reload();
2389
+ return;
2390
+ }
2386
2391
  glitter.setHome('glitterBundle/plugins/html-render.js', obj.tag, {
2387
2392
  app_config: obj.app_config,
2388
2393
  page_config: (_a = obj.page_config) !== null && _a !== void 0 ? _a : {},
@@ -2394,6 +2399,11 @@ HtmlGenerate.setHome = (obj) => {
2394
2399
  HtmlGenerate.changePage = (obj) => {
2395
2400
  var _a, _b;
2396
2401
  const glitter = Glitter.glitter;
2402
+ if (obj.tag === 'backend_manager') {
2403
+ glitter.setUrlParameter('page', 'backend_manager');
2404
+ location.reload();
2405
+ return;
2406
+ }
2397
2407
  console.log(`changePage-time:`, window.renderClock.stop());
2398
2408
  glitter.changePage('glitterBundle/plugins/html-render.js', obj.tag, obj.goBack, {
2399
2409
  app_config: obj.app_config,
@@ -573,6 +573,12 @@ export class HtmlGenerate {
573
573
 
574
574
  public static setHome = (obj: { page_config?: any; app_config?: any; config: any; editMode?: any; data: any; tag: string; option?: any }) => {
575
575
  const glitter = Glitter.glitter;
576
+ //複寫back_manager的頁面,避免堆棧問題
577
+ if(obj.tag==='backend_manager'){
578
+ glitter.setUrlParameter('page','backend_manager')
579
+ location.reload()
580
+ return
581
+ }
576
582
 
577
583
  glitter.setHome(
578
584
  'glitterBundle/plugins/html-render.js',
@@ -589,6 +595,13 @@ export class HtmlGenerate {
589
595
  };
590
596
  public static changePage = (obj: { page_config?: any; config: any; editMode?: any; data: any; tag: string; goBack: boolean; option?: any; app_config?: any }) => {
591
597
  const glitter = Glitter.glitter;
598
+ //複寫back_manager的頁面,避免堆棧問題
599
+ if(obj.tag==='backend_manager'){
600
+ glitter.setUrlParameter('page','backend_manager')
601
+ location.reload()
602
+ return
603
+ }
604
+
592
605
  console.log(`changePage-time:`, (window as any).renderClock.stop());
593
606
  glitter.changePage(
594
607
  'glitterBundle/plugins/html-render.js',
@@ -6,7 +6,6 @@ import {GVC} from "../../glitterBundle/GVController.js";
6
6
  const html = String.raw
7
7
  class ChangePage {
8
8
  public static changePage(link: string, type: 'home' | 'page', subData: any) {
9
-
10
9
  $('.new_page_loading').removeClass('d-none')
11
10
  const glitter=(window as any).glitter;
12
11
  return new Promise(async (resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "13.8.669",
3
+ "version": "13.8.672",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -32,6 +32,7 @@
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",
35
36
  "compression": "^1.7.4",
36
37
  "cookie-parser": "^1.4.6",
37
38
  "cors": "^2.8.5",