cabloy 5.1.48 → 5.1.50
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/CHANGELOG.md +32 -0
- package/package.json +1 -1
- package/zova/env/.env.cabloyBasicWeb +2 -0
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +7 -7
- package/zova/src/suite/a-demo/modules/demo-basic/src/page/toolTwo/controller.tsx +0 -2
- package/zova/src/suite/a-home/modules/home-base/src/config/locale/en-us.ts +1 -0
- package/zova/src/suite/a-home/modules/home-base/src/config/locale/zh-cn.ts +1 -0
- package/zova/src/suite/a-home/modules/home-base/src/page/errorNotFound/controller.tsx +8 -2
- package/zova/src/suite/a-home/modules/home-indexweb/src/.metadata/index.ts +9 -3
- package/zova/src/suite/a-home/modules/home-indexweb/src/.metadata/page/home.ts +7 -0
- package/zova/src/suite/a-home/modules/home-indexweb/src/page/home/controller.tsx +5 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/model/menu.ts +6 -2
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/controller.tsx +1 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.locale.tsx +2 -5
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.tabs.tsx +1 -13
- package/zova/src/suite/a-home/modules/home-layoutweb/src/model/menu.ts +6 -2
- package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/bean/sys.router.ts +33 -12
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/monkeySys.ts +24 -7
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/types/router.ts +2 -1
- package/zova/src/suite-vendor/a-zova/modules/a-router/src/types/utils.ts +3 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/src/model/tabs.ts +4 -0
- package/zova/src/suite-vendor/a-zova/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.1.50
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Update tab-related behavior and rendering.
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- Reset tabs when the layout refreshes.
|
|
12
|
+
- Improve active tab route matching.
|
|
13
|
+
- Handle alias routes correctly for active tabs.
|
|
14
|
+
- Improve navigation for localized home routes.
|
|
15
|
+
|
|
16
|
+
### Improvements
|
|
17
|
+
|
|
18
|
+
- Refine tab rendering logic.
|
|
19
|
+
|
|
20
|
+
## 5.1.49
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
- Add typed locale parameters for the home page.
|
|
25
|
+
- Support route parameters in router navigation.
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
- Resolve localized menu page paths.
|
|
30
|
+
|
|
31
|
+
### Improvements
|
|
32
|
+
|
|
33
|
+
- Update `render.tabs.tsx`.
|
|
34
|
+
|
|
3
35
|
## 5.1.48
|
|
4
36
|
|
|
5
37
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.93",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "A vue3 framework with ioc",
|
|
6
6
|
"keywords": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"zova-core": "^5.1.48",
|
|
49
|
-
"zova-suite-a-zova": "^5.1.
|
|
49
|
+
"zova-suite-a-zova": "^5.1.92"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"clean-package": "^2.2.0",
|
package/zova/pnpm-lock.yaml
CHANGED
|
@@ -131,7 +131,7 @@ importers:
|
|
|
131
131
|
specifier: workspace:^
|
|
132
132
|
version: link:packages-zova/zova
|
|
133
133
|
zova-jsx:
|
|
134
|
-
specifier: ^1.1.
|
|
134
|
+
specifier: ^1.1.54
|
|
135
135
|
version: link:packages-utils/zova-jsx
|
|
136
136
|
zova-module-a-api:
|
|
137
137
|
specifier: workspace:^
|
|
@@ -667,7 +667,7 @@ importers:
|
|
|
667
667
|
specifier: ^3.5.32
|
|
668
668
|
version: 3.5.34(typescript@5.9.3)
|
|
669
669
|
zova-core:
|
|
670
|
-
specifier: ^5.1.
|
|
670
|
+
specifier: ^5.1.48
|
|
671
671
|
version: link:../../packages-zova/zova-core
|
|
672
672
|
devDependencies:
|
|
673
673
|
clean-package:
|
|
@@ -808,10 +808,10 @@ importers:
|
|
|
808
808
|
packages-zova/zova:
|
|
809
809
|
dependencies:
|
|
810
810
|
zova-core:
|
|
811
|
-
specifier: ^5.1.
|
|
811
|
+
specifier: ^5.1.48
|
|
812
812
|
version: link:../zova-core
|
|
813
813
|
zova-suite-a-zova:
|
|
814
|
-
specifier: ^5.1.
|
|
814
|
+
specifier: ^5.1.90
|
|
815
815
|
version: link:../../src/suite-vendor/a-zova
|
|
816
816
|
devDependencies:
|
|
817
817
|
clean-package:
|
|
@@ -939,7 +939,7 @@ importers:
|
|
|
939
939
|
specifier: ^5.1.18
|
|
940
940
|
version: link:modules/a-app
|
|
941
941
|
zova-module-a-bean:
|
|
942
|
-
specifier: ^5.1.
|
|
942
|
+
specifier: ^5.1.25
|
|
943
943
|
version: link:modules/a-bean
|
|
944
944
|
zova-module-a-behavior:
|
|
945
945
|
specifier: ^5.1.19
|
|
@@ -1005,7 +1005,7 @@ importers:
|
|
|
1005
1005
|
specifier: ^5.1.23
|
|
1006
1006
|
version: link:modules/a-zod
|
|
1007
1007
|
zova-module-a-zova:
|
|
1008
|
-
specifier: ^5.1.
|
|
1008
|
+
specifier: ^5.1.60
|
|
1009
1009
|
version: link:modules/a-zova
|
|
1010
1010
|
|
|
1011
1011
|
src/suite-vendor/a-zova/modules/a-api:
|
|
@@ -1344,7 +1344,7 @@ importers:
|
|
|
1344
1344
|
specifier: ^3.7.2
|
|
1345
1345
|
version: 3.7.2
|
|
1346
1346
|
zova-jsx:
|
|
1347
|
-
specifier: ^1.1.
|
|
1347
|
+
specifier: ^1.1.54
|
|
1348
1348
|
version: link:../../../../../packages-utils/zova-jsx
|
|
1349
1349
|
devDependencies:
|
|
1350
1350
|
'@cabloy/cli':
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RouterLink } from '@cabloy/vue-router';
|
|
2
1
|
import { z } from 'zod';
|
|
3
2
|
import { BeanControllerPageBase, Use } from 'zova';
|
|
4
3
|
import { Controller } from 'zova-module-a-bean';
|
|
@@ -27,7 +26,6 @@ export class ControllerPageToolTwo extends BeanControllerPageBase {
|
|
|
27
26
|
<div>{`id: ${pageData?.id}`}</div>
|
|
28
27
|
<div>{`name: ${pageData?.name}`}</div>
|
|
29
28
|
<div>{`married: ${pageData?.married}`}</div>
|
|
30
|
-
<RouterLink to={this.sys.env.ROUTER_PAGE_HOME}>Go Home</RouterLink>
|
|
31
29
|
</div>
|
|
32
30
|
);
|
|
33
31
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RouterLink } from '@cabloy/vue-router';
|
|
2
1
|
import { classes } from 'typestyle';
|
|
3
2
|
import { BeanControllerPageBase } from 'zova';
|
|
4
3
|
import { Controller } from 'zova-module-a-bean';
|
|
@@ -26,7 +25,14 @@ export class ControllerPageErrorNotFound extends BeanControllerPageBase {
|
|
|
26
25
|
<div>
|
|
27
26
|
<div class={this.cTitle}>404</div>
|
|
28
27
|
<div class={this.cDescription}>Oops. Nothing here...</div>
|
|
29
|
-
<
|
|
28
|
+
<button
|
|
29
|
+
class="btn btn-primary"
|
|
30
|
+
onClick={() => {
|
|
31
|
+
this.app.$gotoHome();
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
{this.scope.locale.GoHome()}
|
|
35
|
+
</button>
|
|
30
36
|
</div>
|
|
31
37
|
</div>
|
|
32
38
|
);
|
|
@@ -26,12 +26,13 @@ declare module 'zova' {
|
|
|
26
26
|
/** controller: end */
|
|
27
27
|
/** pages: begin */
|
|
28
28
|
export * from './page/home.js';
|
|
29
|
+
import { NSControllerPageHome } from './page/home.js';
|
|
29
30
|
export * from '../routes.js';
|
|
30
31
|
import { TypePagePathSchema } from 'zova-module-a-router';
|
|
31
32
|
import 'zova';
|
|
32
33
|
declare module 'zova-module-a-router' {
|
|
33
34
|
export interface IPagePathRecord {
|
|
34
|
-
'/home/indexweb/home/:locale?': TypePagePathSchema<
|
|
35
|
+
'/home/indexweb/home/:locale?': TypePagePathSchema<NSControllerPageHome.ParamsInput,undefined>;
|
|
35
36
|
}
|
|
36
37
|
export interface IPageNameRecord {
|
|
37
38
|
'home-indexweb:home': undefined;
|
|
@@ -41,10 +42,15 @@ export const pagePathSchemas = {
|
|
|
41
42
|
|
|
42
43
|
};
|
|
43
44
|
export const pageNameSchemas = {
|
|
44
|
-
|
|
45
|
+
'home-indexweb:home': {
|
|
46
|
+
params: NSControllerPageHome.paramsSchema,
|
|
47
|
+
|
|
48
|
+
},
|
|
45
49
|
};
|
|
46
50
|
declare module 'zova-module-home-indexweb' {
|
|
47
|
-
|
|
51
|
+
export interface ControllerPageHome {
|
|
52
|
+
$params: NSControllerPageHome.ParamsOutput;
|
|
53
|
+
}
|
|
48
54
|
}
|
|
49
55
|
/** pages: end */
|
|
50
56
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { createZovaComponentPage } from 'zova';
|
|
2
3
|
|
|
3
4
|
import { ControllerPageHome } from '../../page/home/controller.jsx';
|
|
5
|
+
import { ControllerPageHomeSchemaParams } from '../../page/home/controller.jsx';
|
|
6
|
+
export namespace NSControllerPageHome {
|
|
7
|
+
export const paramsSchema = ControllerPageHomeSchemaParams;
|
|
8
|
+
export type ParamsInput = z.input<typeof ControllerPageHomeSchemaParams>;
|
|
9
|
+
export type ParamsOutput = z.output<typeof ControllerPageHomeSchemaParams>;
|
|
10
|
+
}
|
|
4
11
|
|
|
5
12
|
export const ZPageHome = createZovaComponentPage(ControllerPageHome, undefined, undefined);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { BeanControllerPageBase } from 'zova';
|
|
2
3
|
import { Controller } from 'zova-module-a-bean';
|
|
3
4
|
|
|
5
|
+
export const ControllerPageHomeSchemaParams = z.object({
|
|
6
|
+
locale: z.string().optional(),
|
|
7
|
+
});
|
|
8
|
+
|
|
4
9
|
@Controller()
|
|
5
10
|
export class ControllerPageHome extends BeanControllerPageBase {
|
|
6
11
|
public message: string;
|
|
@@ -49,8 +49,12 @@ export class ModelMenu extends BeanModelBase {
|
|
|
49
49
|
});
|
|
50
50
|
const menus = data.menus
|
|
51
51
|
?.map(item => {
|
|
52
|
-
if (item.
|
|
53
|
-
|
|
52
|
+
if (item.external || !item.link) return item;
|
|
53
|
+
if (this.$router.isRouterName(item.link)) {
|
|
54
|
+
const link = this.$router.resolveName(item.link as never, item.meta as never);
|
|
55
|
+
return { ...item, link };
|
|
56
|
+
} else if (item.meta?.params || item.meta?.query) {
|
|
57
|
+
const link = this.$router.getPagePath(item.link as never, item.meta as never);
|
|
54
58
|
return { ...item, link };
|
|
55
59
|
}
|
|
56
60
|
return item;
|
package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.locale.tsx
CHANGED
|
@@ -22,13 +22,10 @@ export class RenderLocale extends BeanRenderBase {
|
|
|
22
22
|
<a
|
|
23
23
|
onClick={event => {
|
|
24
24
|
if (metaLocale) {
|
|
25
|
-
|
|
26
|
-
params:
|
|
27
|
-
locale: key === this.sys.config.locale.default ? '' : key,
|
|
28
|
-
}),
|
|
25
|
+
this.app.$gotoPage(currentRoute.matched[0].path, {
|
|
26
|
+
params: { ...currentRoute.params, locale: key },
|
|
29
27
|
query: currentRoute.query,
|
|
30
28
|
});
|
|
31
|
-
this.$router.push(fullPath);
|
|
32
29
|
} else {
|
|
33
30
|
this.$$serviceLocale.setLocale(key as any);
|
|
34
31
|
}
|
package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.tabs.tsx
CHANGED
|
@@ -16,7 +16,6 @@ export class RenderTabs extends BeanRenderBase {
|
|
|
16
16
|
public renderTabs(): VNode | undefined {
|
|
17
17
|
const $$modelTabs = this.$$modelTabs;
|
|
18
18
|
if (!$$modelTabs) return;
|
|
19
|
-
|
|
20
19
|
const domTabs = $$modelTabs.tabs.map(tab => {
|
|
21
20
|
return this._renderMenuItem(tab.info as TypeMenuItem, true, tab.tabKey);
|
|
22
21
|
});
|
|
@@ -144,18 +143,7 @@ export class RenderTabs extends BeanRenderBase {
|
|
|
144
143
|
|
|
145
144
|
private _isMenuLeafCurrent(item: TypeMenuLeaf): boolean {
|
|
146
145
|
if (item.external || !item.link) return false;
|
|
147
|
-
|
|
148
|
-
if (!currentRoute) return false;
|
|
149
|
-
const fullPath = this.$router.isRouterName(item.link)
|
|
150
|
-
? this.$router.resolveName(
|
|
151
|
-
item.link as never,
|
|
152
|
-
{
|
|
153
|
-
params: item.meta?.params,
|
|
154
|
-
query: item.meta?.query,
|
|
155
|
-
} as never,
|
|
156
|
-
)
|
|
157
|
-
: this.$router.resolvePath(item.link as never, item.meta?.query as never);
|
|
158
|
-
return currentRoute.fullPath === fullPath;
|
|
146
|
+
return this.$router.checkActiveOfFullPath(item.link);
|
|
159
147
|
}
|
|
160
148
|
|
|
161
149
|
private _getMenuItemKey(item: TypeMenuItem): string {
|
|
@@ -49,8 +49,12 @@ export class ModelMenu extends BeanModelBase {
|
|
|
49
49
|
});
|
|
50
50
|
const menus = data.menus
|
|
51
51
|
?.map(item => {
|
|
52
|
-
if (item.
|
|
53
|
-
|
|
52
|
+
if (item.external || !item.link) return item;
|
|
53
|
+
if (this.$router.isRouterName(item.link)) {
|
|
54
|
+
const link = this.$router.resolveName(item.link as never, item.meta as never);
|
|
55
|
+
return { ...item, link };
|
|
56
|
+
} else if (item.meta?.params || item.meta?.query) {
|
|
57
|
+
const link = this.$router.getPagePath(item.link as never, item.meta as never);
|
|
54
58
|
return { ...item, link };
|
|
55
59
|
}
|
|
56
60
|
return item;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
RouteLocationMatched,
|
|
3
3
|
RouteLocationNormalizedLoaded,
|
|
4
|
+
RouteLocationNormalizedLoadedGeneric,
|
|
4
5
|
RouteLocationResolvedGeneric,
|
|
5
6
|
Router,
|
|
6
7
|
RouterOptions,
|
|
@@ -18,7 +19,7 @@ import {
|
|
|
18
19
|
import { BeanBase, cast, deepExtend } from 'zova';
|
|
19
20
|
import { Sys } from 'zova-module-a-bean';
|
|
20
21
|
|
|
21
|
-
import { getRealRouteName, getRouteMatched, isRouterName } from '../lib/utils.js';
|
|
22
|
+
import { getCurrentRoute, getRealRouteName, getRouteMatched, isRouterName } from '../lib/utils.js';
|
|
22
23
|
import {
|
|
23
24
|
IModuleRoute,
|
|
24
25
|
IModuleRouteComponent,
|
|
@@ -96,10 +97,15 @@ export class SysRouter extends BeanBase {
|
|
|
96
97
|
options?: IPagePathRecord[K],
|
|
97
98
|
absolute?: boolean,
|
|
98
99
|
) {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
const query = options?.query;
|
|
101
|
+
let params = options?.params;
|
|
102
|
+
const paramsLocale = cast(params)?.locale;
|
|
103
|
+
if (paramsLocale !== undefined) {
|
|
104
|
+
const localeCurrent = paramsLocale === true ? this.app.meta.locale.current : paramsLocale;
|
|
105
|
+
const locale = localeCurrent === this.sys.config.locale.default ? undefined : localeCurrent;
|
|
106
|
+
params = Object.assign({}, params, { locale });
|
|
107
|
+
}
|
|
108
|
+
const pagePath = combineParamsAndQuery(path, { params, query });
|
|
103
109
|
return absolute ? this.sys.util.getAbsoluteUrlFromPagePath(pagePath) : pagePath;
|
|
104
110
|
}
|
|
105
111
|
|
|
@@ -138,6 +144,28 @@ export class SysRouter extends BeanBase {
|
|
|
138
144
|
return this.sys.meta.module.exists(moduleName);
|
|
139
145
|
}
|
|
140
146
|
|
|
147
|
+
public checkActiveOfFullPath(
|
|
148
|
+
fullPath: string,
|
|
149
|
+
currentRoute?: RouteLocationNormalizedLoadedGeneric,
|
|
150
|
+
): boolean {
|
|
151
|
+
if (!currentRoute) {
|
|
152
|
+
currentRoute = getCurrentRoute(this.ctx)?.value;
|
|
153
|
+
}
|
|
154
|
+
if (!currentRoute) return false;
|
|
155
|
+
if (currentRoute.fullPath === fullPath) return true;
|
|
156
|
+
if (!currentRoute.matched || currentRoute.matched.length === 0) return false;
|
|
157
|
+
return currentRoute.matched.some(routeAlias => {
|
|
158
|
+
const fullPathAlias = this.getPagePath(
|
|
159
|
+
routeAlias.path as never,
|
|
160
|
+
{
|
|
161
|
+
params: currentRoute.params,
|
|
162
|
+
query: currentRoute.query,
|
|
163
|
+
} as never,
|
|
164
|
+
);
|
|
165
|
+
return fullPathAlias === fullPath;
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
141
169
|
public async ensureRoute(pagePath: string) {
|
|
142
170
|
// try to resolve, support alias route
|
|
143
171
|
let route = this._vueRouterSys.resolve(pagePath);
|
|
@@ -208,13 +236,6 @@ export class SysRouter extends BeanBase {
|
|
|
208
236
|
});
|
|
209
237
|
}
|
|
210
238
|
|
|
211
|
-
resolvePath<K extends keyof IPagePathRecord>(path: K, query?: IPagePathRecord[K]): string {
|
|
212
|
-
return this._resolveNameOrPath(query, query => {
|
|
213
|
-
const route = this.router.resolve({ path, query });
|
|
214
|
-
return route.fullPath;
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
|
|
218
239
|
private _resolveNameOrPath(query, fn) {
|
|
219
240
|
const query1 = {};
|
|
220
241
|
const query2: any = [];
|
|
@@ -2,7 +2,6 @@ import type { IModule } from '@cabloy/module-info';
|
|
|
2
2
|
import type { IMonkeyModuleSys, IMonkeySysApplicationInitialize, ZovaApplication } from 'zova';
|
|
3
3
|
import type { ErrorSSR } from 'zova-module-a-ssr';
|
|
4
4
|
|
|
5
|
-
import { combineQueries } from '@cabloy/utils';
|
|
6
5
|
import { BeanSimple, cast, isHttpUrl } from 'zova';
|
|
7
6
|
|
|
8
7
|
import type { SysRouter } from './bean/sys.router.js';
|
|
@@ -58,12 +57,18 @@ export class MonkeySys
|
|
|
58
57
|
if (options?.returnTo) {
|
|
59
58
|
const returnTo =
|
|
60
59
|
typeof options?.returnTo === 'string' ? options?.returnTo : app.$getCurrentPagePath();
|
|
61
|
-
if (returnTo !== app
|
|
60
|
+
if (returnTo !== app.$getPagePathHome()) {
|
|
62
61
|
query[app.sys.env.ROUTER_KEY_RETURNTO] = returnTo;
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
//
|
|
66
|
-
pagePath =
|
|
64
|
+
// combineParamsAndQuery
|
|
65
|
+
pagePath = app.meta.$router.getPagePath(
|
|
66
|
+
pagePath as never,
|
|
67
|
+
{
|
|
68
|
+
params: options?.params,
|
|
69
|
+
query,
|
|
70
|
+
} as never,
|
|
71
|
+
);
|
|
67
72
|
// redirect
|
|
68
73
|
if (process.env.SERVER || options?.forceRedirect) {
|
|
69
74
|
return app.$redirect(pagePath);
|
|
@@ -75,8 +80,9 @@ export class MonkeySys
|
|
|
75
80
|
return app.meta.$router[options?.replace ? 'replace' : 'push'](pagePath);
|
|
76
81
|
}
|
|
77
82
|
};
|
|
78
|
-
app.$gotoHome = () => {
|
|
79
|
-
|
|
83
|
+
app.$gotoHome = (options?: IGotoPageOptions) => {
|
|
84
|
+
const pagePath = app.$getPagePathHome(options);
|
|
85
|
+
return app.$gotoPage(pagePath, { ...options, params: undefined });
|
|
80
86
|
};
|
|
81
87
|
app.$gotoLogin = (returnTo?: string, cause?: string) => {
|
|
82
88
|
if (!returnTo && cast(app.meta.$router.currentRoute)?.path === app.sys.env.ROUTER_PAGE_LOGIN)
|
|
@@ -97,7 +103,7 @@ export class MonkeySys
|
|
|
97
103
|
const pagePath =
|
|
98
104
|
returnTo ||
|
|
99
105
|
cast(app.meta.$router.currentRoute)?.query?.[app.sys.env.ROUTER_KEY_RETURNTO] ||
|
|
100
|
-
app
|
|
106
|
+
app.$getPagePathHome();
|
|
101
107
|
return pagePath;
|
|
102
108
|
};
|
|
103
109
|
app.$getCurrentPagePath = (): string | undefined => {
|
|
@@ -109,5 +115,16 @@ export class MonkeySys
|
|
|
109
115
|
}
|
|
110
116
|
return cast(app.meta.$router.currentRoute)?.fullPath;
|
|
111
117
|
};
|
|
118
|
+
app.$getPagePathHome = (options?: IGotoPageOptions): string => {
|
|
119
|
+
let params = options?.params;
|
|
120
|
+
if (params?.locale === undefined) {
|
|
121
|
+
params = Object.assign({}, params, { locale: true });
|
|
122
|
+
}
|
|
123
|
+
// not handle options?.query
|
|
124
|
+
return app.meta.$router.getPagePath(
|
|
125
|
+
app.sys.env.ROUTER_PAGE_HOME as never,
|
|
126
|
+
{ params } as never,
|
|
127
|
+
);
|
|
128
|
+
};
|
|
112
129
|
}
|
|
113
130
|
}
|
|
@@ -50,11 +50,12 @@ declare module 'zova' {
|
|
|
50
50
|
export interface ZovaApplication {
|
|
51
51
|
$redirect(pagePath: string, status?: 301 | 302): never;
|
|
52
52
|
$gotoPage(pagePath: string, options?: IGotoPageOptions): TypeGotoPageResult;
|
|
53
|
-
$gotoHome(): TypeGotoPageResult;
|
|
53
|
+
$gotoHome(options?: IGotoPageOptions): TypeGotoPageResult;
|
|
54
54
|
$gotoLogin(returnTo?: string, cause?: string): TypeGotoPageResult;
|
|
55
55
|
$gotoReturnTo(returnTo?: string): TypeGotoPageResult;
|
|
56
56
|
$getReturnTo(returnTo?: string): string;
|
|
57
57
|
$getCurrentPagePath(): string | undefined;
|
|
58
|
+
$getPagePathHome(options?: IGotoPageOptions): string;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
export interface AppMeta {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { IParamsAndQuery } from '@cabloy/utils';
|
|
2
|
+
|
|
1
3
|
export const SymbolRouterHistory = Symbol('SymbolRouterHistory');
|
|
2
4
|
|
|
3
|
-
export interface IGotoPageOptions {
|
|
4
|
-
query?: object;
|
|
5
|
+
export interface IGotoPageOptions extends IParamsAndQuery {
|
|
5
6
|
returnTo?: string | boolean;
|
|
6
7
|
forceRedirect?: boolean;
|
|
7
8
|
replace?: boolean;
|
|
@@ -183,6 +183,10 @@ export class ModelTabs extends BeanModelBase {
|
|
|
183
183
|
return true;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
resetAllTabInfos() {
|
|
187
|
+
this.tabs = this._getInitialTabs() as RouteTab[];
|
|
188
|
+
}
|
|
189
|
+
|
|
186
190
|
updateAllTabInfos(tabInitials?: RouteTabInitial[]) {
|
|
187
191
|
for (const tab of this.tabs) {
|
|
188
192
|
const tabInitial = tabInitials?.find(item => item.tabKey === tab.tabKey);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.92",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"zova-module-a-meta": "^5.1.15",
|
|
24
24
|
"zova-module-a-model": "^5.1.23",
|
|
25
25
|
"zova-module-a-openapi": "^5.1.30",
|
|
26
|
-
"zova-module-a-router": "^5.1.
|
|
26
|
+
"zova-module-a-router": "^5.1.23",
|
|
27
27
|
"zova-module-a-routerstack": "^5.1.20",
|
|
28
|
-
"zova-module-a-routertabs": "^5.1.
|
|
28
|
+
"zova-module-a-routertabs": "^5.1.25",
|
|
29
29
|
"zova-module-a-ssr": "^5.1.18",
|
|
30
30
|
"zova-module-a-ssrhmr": "^5.1.16",
|
|
31
31
|
"zova-module-a-ssrserver": "^5.1.15",
|