@ibiz-template/vue3-util 0.2.12 → 0.2.13
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/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/es/index.mjs +0 -12
- package/es/panel-component/grid-container/index.d.ts +1 -2
- package/es/panel-component/grid-container/index.d.ts.map +1 -1
- package/es/panel-component/grid-container/index.mjs +1 -1
- package/es/panel-component/index.mjs +0 -10
- package/es/panel-component/multi-data-container/index.d.ts +1 -2
- package/es/panel-component/multi-data-container/index.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/index.mjs +1 -1
- package/es/panel-component/nav-pos/index.d.ts +1 -2
- package/es/panel-component/nav-pos/index.d.ts.map +1 -1
- package/es/panel-component/nav-pos/index.mjs +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.d.ts +1 -0
- package/es/panel-component/nav-pos/nav-pos.controller.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.mjs +24 -2
- package/es/panel-component/panel-container/index.d.ts +1 -2
- package/es/panel-component/panel-container/index.d.ts.map +1 -1
- package/es/panel-component/panel-container/index.mjs +1 -1
- package/es/panel-component/panel-ctrl-pos/index.d.ts +1 -2
- package/es/panel-component/panel-ctrl-pos/index.d.ts.map +1 -1
- package/es/panel-component/panel-ctrl-pos/index.mjs +1 -1
- package/es/panel-component/panel-field/index.d.ts +0 -1
- package/es/panel-component/panel-field/index.d.ts.map +1 -1
- package/es/panel-component/panel-field/index.mjs +1 -1
- package/es/panel-component/panel-rawitem/index.d.ts +0 -1
- package/es/panel-component/panel-rawitem/index.d.ts.map +1 -1
- package/es/panel-component/panel-rawitem/index.mjs +1 -1
- package/es/panel-component/scroll-container/index.mjs +1 -1
- package/es/panel-component/scroll-container/scroll-container/index.d.ts +0 -1
- package/es/panel-component/scroll-container/scroll-container/index.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container/index.mjs +0 -1
- package/es/panel-component/scroll-container/scroll-container-item/index.d.ts +0 -1
- package/es/panel-component/scroll-container/scroll-container-item/index.d.ts.map +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/index.mjs +0 -1
- package/es/panel-component/single-data-container/index.d.ts +1 -2
- package/es/panel-component/single-data-container/index.d.ts.map +1 -1
- package/es/panel-component/single-data-container/index.mjs +1 -1
- package/es/util/route/route.mjs +1 -1
- package/es/view/common/index.d.ts +0 -2
- package/es/view/common/index.d.ts.map +1 -1
- package/es/view/common/index.mjs +1 -1
- package/es/view/index.mjs +0 -2
- package/es/view/portal-view/index.d.ts +0 -2
- package/es/view/portal-view/index.d.ts.map +1 -1
- package/es/view/portal-view/index.mjs +1 -1
- package/lib/index.cjs +0 -24
- package/package.json +5 -6
- package/src/panel-component/grid-container/index.ts +1 -1
- package/src/panel-component/multi-data-container/index.ts +1 -5
- package/src/panel-component/nav-pos/index.ts +1 -1
- package/src/panel-component/nav-pos/nav-pos.controller.ts +27 -5
- package/src/panel-component/panel-container/index.ts +1 -5
- package/src/panel-component/panel-ctrl-pos/index.ts +1 -1
- package/src/panel-component/panel-field/index.ts +0 -1
- package/src/panel-component/panel-rawitem/index.ts +0 -1
- package/src/panel-component/scroll-container/scroll-container/index.ts +0 -1
- package/src/panel-component/scroll-container/scroll-container-item/index.ts +0 -1
- package/src/panel-component/single-data-container/index.ts +1 -5
- package/src/util/route/route.ts +2 -2
- package/src/view/common/index.ts +0 -2
- package/src/view/portal-view/index.ts +0 -2
|
@@ -6,11 +6,7 @@ import { MultiDataContainerProvider } from './multi-data-container.provider';
|
|
|
6
6
|
import { MultiDataContainerState } from './multi-data-container.state';
|
|
7
7
|
import { MultiDataContainerController } from './multi-data-container.controller';
|
|
8
8
|
|
|
9
|
-
export {
|
|
10
|
-
MultiDataContainerProvider,
|
|
11
|
-
MultiDataContainerState,
|
|
12
|
-
MultiDataContainerController,
|
|
13
|
-
};
|
|
9
|
+
export { MultiDataContainerState, MultiDataContainerController };
|
|
14
10
|
|
|
15
11
|
export const IBizMultiDataContainer = withInstall(
|
|
16
12
|
MultiDataContainer,
|
|
@@ -6,7 +6,7 @@ import { NavPosProvider } from './nav-pos.provider';
|
|
|
6
6
|
import { NavPosState } from './nav-pos.state';
|
|
7
7
|
import { NavPosController } from './nav-pos.controller';
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { NavPosState, NavPosController };
|
|
10
10
|
|
|
11
11
|
export const IBizNavPos = withInstall(NavPos, function (v: App) {
|
|
12
12
|
v.component(NavPos.name, NavPos);
|
|
@@ -14,6 +14,10 @@ import { RouteLocationNormalizedLoaded, Router } from 'vue-router';
|
|
|
14
14
|
import { notNilEmpty } from 'qx-util';
|
|
15
15
|
import { mergeLeft } from 'ramda';
|
|
16
16
|
import { NavPosState } from './nav-pos.state';
|
|
17
|
+
import { getNestedRoutePath } from '../../util';
|
|
18
|
+
|
|
19
|
+
const excludeKeys = ['is404', 'isRoutePushed'] as const;
|
|
20
|
+
|
|
17
21
|
/**
|
|
18
22
|
* 导航占位控制器
|
|
19
23
|
*
|
|
@@ -208,9 +212,16 @@ export class NavPosController
|
|
|
208
212
|
* @memberof NavPosController
|
|
209
213
|
*/
|
|
210
214
|
setNavViewMsgs(navViewMsg: INavViewMsg): void {
|
|
211
|
-
//
|
|
215
|
+
// isRoutePushed没传的时候给false
|
|
216
|
+
navViewMsg.isRoutePushed = navViewMsg.isRoutePushed === true;
|
|
212
217
|
if (this.state.navViewMsgs[navViewMsg.key]) {
|
|
213
218
|
mergeLeft(this.state.navViewMsgs[navViewMsg.key], navViewMsg);
|
|
219
|
+
// 部分属性这次没传就是undefined
|
|
220
|
+
excludeKeys.forEach(key => {
|
|
221
|
+
if (Object.prototype.hasOwnProperty.call(navViewMsg, key)) {
|
|
222
|
+
this.state.navViewMsgs[navViewMsg.key][key] = undefined;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
214
225
|
} else {
|
|
215
226
|
// 不存在的走新建流程
|
|
216
227
|
this.state.navViewMsgs[navViewMsg.key] = navViewMsg;
|
|
@@ -252,6 +263,11 @@ export class NavPosController
|
|
|
252
263
|
ibiz.log.debug(this.constructor.name, 'onViewCreated', event);
|
|
253
264
|
}
|
|
254
265
|
|
|
266
|
+
toBlankRoute(): void {
|
|
267
|
+
const blankRoute = getNestedRoutePath(this.route, this.routeDepth!);
|
|
268
|
+
this.router.push(blankRoute);
|
|
269
|
+
}
|
|
270
|
+
|
|
255
271
|
/**
|
|
256
272
|
* 打开视图
|
|
257
273
|
*
|
|
@@ -262,6 +278,10 @@ export class NavPosController
|
|
|
262
278
|
// 当key为空时,直接切换currentKey,绘制null
|
|
263
279
|
if (!openViewMsg.key) {
|
|
264
280
|
this.state.currentKey = openViewMsg.key;
|
|
281
|
+
if (this.routeDepth && this.state.routeOpen) {
|
|
282
|
+
this.toBlankRoute();
|
|
283
|
+
}
|
|
284
|
+
|
|
265
285
|
return;
|
|
266
286
|
}
|
|
267
287
|
|
|
@@ -280,8 +300,7 @@ export class NavPosController
|
|
|
280
300
|
*/
|
|
281
301
|
openViewByPath(openViewMsg: INavViewMsg): void {
|
|
282
302
|
this.setNavViewMsgs(openViewMsg);
|
|
283
|
-
const isRoutePushed =
|
|
284
|
-
this.state.navViewMsgs[this.curNavViewMsg.key].isRoutePushed === true;
|
|
303
|
+
const isRoutePushed = openViewMsg.isRoutePushed === true;
|
|
285
304
|
// * 外部跳转过了的场景不需要这边跳转路由了,直接处理后续内容。
|
|
286
305
|
if (isRoutePushed) {
|
|
287
306
|
this.state.currentKey = openViewMsg.key;
|
|
@@ -291,8 +310,11 @@ export class NavPosController
|
|
|
291
310
|
}
|
|
292
311
|
|
|
293
312
|
// * 路由跳转
|
|
294
|
-
|
|
295
|
-
|
|
313
|
+
if (openViewMsg.is404) {
|
|
314
|
+
const selfPath = getNestedRoutePath(this.route, this.routeDepth!, false);
|
|
315
|
+
this.router.push(`${selfPath}/404`);
|
|
316
|
+
} else if (
|
|
317
|
+
// 如果启用缓存并且有之前存过的fullPath则push回fullPath。
|
|
296
318
|
this.state.navViewMsgs[openViewMsg.key].fullPath &&
|
|
297
319
|
this.getExpItemIsCache(openViewMsg)
|
|
298
320
|
) {
|
|
@@ -6,11 +6,7 @@ import { PanelContainerProvider } from './panel-container.provider';
|
|
|
6
6
|
import { PanelContainerState } from './panel-container.state';
|
|
7
7
|
import { PanelContainerController } from './panel-container.controller';
|
|
8
8
|
|
|
9
|
-
export {
|
|
10
|
-
PanelContainerProvider,
|
|
11
|
-
PanelContainerState,
|
|
12
|
-
PanelContainerController,
|
|
13
|
-
};
|
|
9
|
+
export { PanelContainerState, PanelContainerController };
|
|
14
10
|
|
|
15
11
|
export const IBizPanelContainer = withInstall(
|
|
16
12
|
PanelContainer,
|
|
@@ -5,7 +5,7 @@ import { PanelCtrlPos } from './panel-ctrl-pos';
|
|
|
5
5
|
import { PanelCtrlPosProvider } from './panel-ctrl-pos.provider';
|
|
6
6
|
import { PanelCtrlPosController } from './panel-ctrl-pos.controller';
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { PanelCtrlPosController };
|
|
9
9
|
export const IBizPanelCtrlPos = withInstall(PanelCtrlPos, function (v: App) {
|
|
10
10
|
v.component(PanelCtrlPos.name, PanelCtrlPos);
|
|
11
11
|
registerPanelItemProvider('CTRLPOS', () => new PanelCtrlPosProvider());
|
|
@@ -4,7 +4,6 @@ import { withInstall } from '../../util';
|
|
|
4
4
|
import { PanelField } from './panel-field';
|
|
5
5
|
import { PanelFieldProvider } from './panel-field.provider';
|
|
6
6
|
|
|
7
|
-
export * from './panel-field.provider';
|
|
8
7
|
export * from './panel-field.controller';
|
|
9
8
|
|
|
10
9
|
export const IBizPanelField = withInstall(PanelField, function (v: App) {
|
|
@@ -4,7 +4,6 @@ import { withInstall } from '../../util';
|
|
|
4
4
|
import { PanelRawItem } from './panel-rawitem';
|
|
5
5
|
import { PanelRawItemProvider } from './panel-rawitem.provider';
|
|
6
6
|
|
|
7
|
-
export * from './panel-rawitem.provider';
|
|
8
7
|
export * from './panel-rawitem.controller';
|
|
9
8
|
|
|
10
9
|
export const IBizPanelRawItem = withInstall(PanelRawItem, function (v: App) {
|
|
@@ -6,11 +6,7 @@ import { SingleDataContainerProvider } from './single-data-container.provider';
|
|
|
6
6
|
import { SingleDataContainerState } from './single-data-container.state';
|
|
7
7
|
import { SingleDataContainerController } from './single-data-container.controller';
|
|
8
8
|
|
|
9
|
-
export {
|
|
10
|
-
SingleDataContainerProvider,
|
|
11
|
-
SingleDataContainerState,
|
|
12
|
-
SingleDataContainerController,
|
|
13
|
-
};
|
|
9
|
+
export { SingleDataContainerState, SingleDataContainerController };
|
|
14
10
|
|
|
15
11
|
export const IBizSingleDataContainer = withInstall(
|
|
16
12
|
SingleDataContainer,
|
package/src/util/route/route.ts
CHANGED
|
@@ -397,8 +397,8 @@ export function getNestedRoutePath(
|
|
|
397
397
|
return '';
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
//
|
|
401
|
-
if (route.name) {
|
|
400
|
+
// 只有当前层级的路由的代名称的路由如login,404等直接返回path
|
|
401
|
+
if (route.matched.length === depth && route.name) {
|
|
402
402
|
return route.path;
|
|
403
403
|
}
|
|
404
404
|
const routePath = route2routePath(route);
|
package/src/view/common/index.ts
CHANGED
|
@@ -4,8 +4,6 @@ import { withInstall } from '../../util';
|
|
|
4
4
|
import { ViewProvider } from './view.provider';
|
|
5
5
|
import { View } from './view';
|
|
6
6
|
|
|
7
|
-
export { ViewProvider };
|
|
8
|
-
|
|
9
7
|
export const IBizView = withInstall(View, function (v: App) {
|
|
10
8
|
v.component(View.name, View);
|
|
11
9
|
registerViewProvider('DEFAULT', () => new ViewProvider());
|
|
@@ -4,8 +4,6 @@ import { withInstall } from '../../util';
|
|
|
4
4
|
import { PortalViewProvider } from './portal-view.provider';
|
|
5
5
|
import { PortalView } from './portal-view';
|
|
6
6
|
|
|
7
|
-
export { PortalViewProvider };
|
|
8
|
-
|
|
9
7
|
export const IBizPortalView = withInstall(PortalView, function (v: App) {
|
|
10
8
|
v.component(PortalView.name, PortalView);
|
|
11
9
|
registerViewProvider(
|