@ibiz-template/vue3-util 0.5.7-alpha.1 → 0.5.7-alpha.10
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/es/common/badge/badge.mjs +1 -1
- package/es/common/code-list/code-list.d.ts +2 -2
- package/es/common/code-list/code-list.mjs +1 -1
- package/es/common/control-base/control-base.mjs +1 -1
- package/es/common/control-loading-placeholder/control-loading-placeholder.mjs +1 -1
- package/es/common/control-shell/control-shell.mjs +1 -1
- package/es/common/icon/icon.mjs +1 -1
- package/es/common/router-view/router-view.mjs +1 -1
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +10 -26
- package/es/control/panel/panel/index.mjs +1 -1
- package/es/control/panel/panel/panel.d.ts.map +1 -1
- package/es/control/panel/panel/panel.mjs +7 -2
- package/es/control/panel/view-layout-panel/index.mjs +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts.map +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.mjs +7 -2
- package/es/panel-component/grid-container/grid-container.d.ts +2 -0
- package/es/panel-component/grid-container/grid-container.d.ts.map +1 -1
- package/es/panel-component/grid-container/grid-container.mjs +1 -1
- package/es/panel-component/grid-container/index.d.ts +2 -0
- package/es/panel-component/grid-container/index.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.mjs +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.mjs +1 -1
- package/es/panel-component/nav-pos/nav-pos.mjs +1 -1
- package/es/panel-component/panel-container/panel-container.mjs +1 -1
- package/es/panel-component/panel-container-group/panel-container-group.mjs +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.mjs +1 -1
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.mjs +1 -1
- package/es/panel-component/panel-field/panel-field.mjs +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.mjs +1 -1
- package/es/panel-component/panel-rawitem/index.d.ts +1 -0
- package/es/panel-component/panel-rawitem/index.d.ts.map +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts +1 -0
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts.map +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.mjs +11 -2
- package/es/panel-component/panel-tab-page/panel-tab-page.mjs +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.mjs +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.mjs +1 -1
- package/es/panel-component/single-data-container/single-data-container.mjs +1 -1
- package/es/props/editor/autocomplete.d.ts +2 -2
- package/es/props/editor/check-box-list.d.ts +2 -2
- package/es/props/editor/check-box.d.ts +2 -2
- package/es/props/editor/data-picker.d.ts +2 -2
- package/es/props/editor/date-picker.d.ts +2 -2
- package/es/props/editor/date-range.d.ts +2 -2
- package/es/props/editor/dropdown-list.d.ts +2 -2
- package/es/props/editor/list-box.d.ts +2 -2
- package/es/props/editor/number-range.d.ts +2 -2
- package/es/props/editor/radio-button-list.d.ts +2 -2
- package/es/props/editor/rate.d.ts +2 -2
- package/es/props/editor/raw.d.ts +2 -2
- package/es/props/editor/slider.d.ts +2 -2
- package/es/props/editor/span.d.ts +2 -2
- package/es/props/editor/stepper.d.ts +2 -2
- package/es/props/editor/switch.d.ts +2 -2
- package/es/props/editor/text-box.d.ts +2 -2
- package/es/util/route/route.d.ts +4 -3
- package/es/util/route/route.d.ts.map +1 -1
- package/es/util/route/route.mjs +19 -5
- package/es/util/store/app-store/app-store.d.ts +3 -82
- package/es/util/store/app-store/app-store.d.ts.map +1 -1
- package/es/util/store/app-store/app-store.mjs +1 -8
- package/es/view/app-redirect-view/app-redirect-view.mjs +1 -1
- package/es/view/common/index.d.ts +0 -1
- package/es/view/common/index.d.ts.map +1 -1
- package/es/view/common/view.d.ts +0 -1
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +1 -17
- package/es/view/de-redirect-view/de-redirect-view.mjs +1 -1
- package/es/view/de-redirect-view/index.mjs +1 -1
- package/es/view/portal-view/index.mjs +1 -1
- package/es/view/portal-view/portal-view.mjs +1 -1
- package/es/view/todo-redirect/todo-redirect.mjs +1 -1
- package/package.json +6 -6
- package/src/common/view-shell/view-shell.tsx +11 -35
- package/src/control/panel/panel/panel.tsx +6 -0
- package/src/control/panel/view-layout-panel/view-layout-panel.tsx +6 -0
- package/src/panel-component/panel-rawitem/panel-rawitem.tsx +11 -1
- package/src/util/route/route.ts +30 -5
- package/src/util/store/app-store/app-store.ts +3 -14
- package/src/view/common/view.tsx +0 -24
- package/es/util/store/async-action/async-action.d.ts +0 -56
- package/es/util/store/async-action/async-action.d.ts.map +0 -1
- package/es/util/store/async-action/async-action.mjs +0 -80
- package/src/util/store/async-action/async-action.ts +0 -122
package/es/util/route/route.mjs
CHANGED
|
@@ -3,14 +3,19 @@ import { RuntimeError } from '@ibiz-template/core';
|
|
|
3
3
|
import qs from 'qs';
|
|
4
4
|
import { useRoute } from 'vue-router';
|
|
5
5
|
import { watch } from 'vue';
|
|
6
|
-
import { ViewType, getMatchResPath, calcDeCodeNameById
|
|
6
|
+
import { RouteConst, ViewType, getMatchResPath, calcDeCodeNameById } from '@ibiz-template/runtime';
|
|
7
7
|
|
|
8
8
|
"use strict";
|
|
9
|
-
function route2routePath(route) {
|
|
9
|
+
function route2routePath(route, isRouteModal = false) {
|
|
10
10
|
const depth = route.matched.length;
|
|
11
|
+
let path = route.path;
|
|
12
|
+
if (isRouteModal) {
|
|
13
|
+
path = path.replace(new RegExp("/".concat(RouteConst.ROUTE_MODAL_TAG), "g"), "");
|
|
14
|
+
}
|
|
15
|
+
const items = path.split("/");
|
|
11
16
|
const pathNodes = [];
|
|
12
17
|
for (let index = 1; index <= depth; index++) {
|
|
13
|
-
const viewName =
|
|
18
|
+
const viewName = items[index * 2];
|
|
14
19
|
const paramsStr = route.params["params".concat(index)];
|
|
15
20
|
let params;
|
|
16
21
|
let context;
|
|
@@ -190,6 +195,12 @@ async function generateRoutePath(appView, route, context, params) {
|
|
|
190
195
|
}
|
|
191
196
|
async function generateRoutePathByModal(appView, route, context, params) {
|
|
192
197
|
const routePath = route2routePath(route);
|
|
198
|
+
const findIndex = routePath.pathNodes.findIndex(
|
|
199
|
+
(item) => item.viewName === RouteConst.ROUTE_MODAL_TAG
|
|
200
|
+
);
|
|
201
|
+
if (findIndex !== -1) {
|
|
202
|
+
routePath.pathNodes = routePath.pathNodes.slice(0, findIndex);
|
|
203
|
+
}
|
|
193
204
|
if (context.currentSrfNav) {
|
|
194
205
|
const currentNode = routePath.pathNodes[routePath.pathNodes.length - 1];
|
|
195
206
|
currentNode.params = currentNode.params || {};
|
|
@@ -203,13 +214,16 @@ async function generateRoutePathByModal(appView, route, context, params) {
|
|
|
203
214
|
});
|
|
204
215
|
return { path: routePath2string(routePath) };
|
|
205
216
|
}
|
|
206
|
-
async function parseRouteViewData(route, depth) {
|
|
217
|
+
async function parseRouteViewData(route, depth, isRouteModal = false) {
|
|
207
218
|
var _a;
|
|
208
|
-
const routePath = route2routePath(route);
|
|
219
|
+
const routePath = route2routePath(route, isRouteModal);
|
|
209
220
|
let viewCodeName = routePath.pathNodes[depth - 1].viewName;
|
|
210
221
|
if (!viewCodeName) {
|
|
211
222
|
throw new RuntimeError("\u7B2C".concat(depth, "\u7EA7\u8DEF\u7531\u4E0D\u5B58\u5728\u89C6\u56FE\u6807\u8BC6"));
|
|
212
223
|
}
|
|
224
|
+
if (viewCodeName === RouteConst.ROUTE_MODAL_TAG) {
|
|
225
|
+
viewCodeName = routePath.pathNodes[depth].viewName;
|
|
226
|
+
}
|
|
213
227
|
if (viewCodeName === "index") {
|
|
214
228
|
viewCodeName = ibiz.hub.defaultAppIndexViewName;
|
|
215
229
|
}
|
|
@@ -1,89 +1,10 @@
|
|
|
1
|
-
import { IPortalAsyncAction } from '@ibiz-template/core';
|
|
2
|
-
import { Ref } from 'vue';
|
|
3
1
|
export interface IAppStore {
|
|
4
|
-
allAsyncActions: Ref<IPortalAsyncAction[]>;
|
|
5
|
-
recentAsyncActions: IPortalAsyncAction[];
|
|
6
2
|
}
|
|
7
3
|
export declare const useAppStore: import("pinia").StoreDefinition<"appStore", import("pinia")._UnwrapAll<Pick<{
|
|
8
|
-
appStore:
|
|
9
|
-
allAsyncActions: IPortalAsyncAction[];
|
|
10
|
-
recentAsyncActions: {
|
|
11
|
-
asyncacitonid: string;
|
|
12
|
-
asyncacitonname: string;
|
|
13
|
-
fulltopictag: string;
|
|
14
|
-
srfdcid: string;
|
|
15
|
-
dcsystemid: string;
|
|
16
|
-
actiontype: string;
|
|
17
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
18
|
-
actionresult?: unknown;
|
|
19
|
-
stepinfo?: string | undefined;
|
|
20
|
-
completionrate?: number | undefined;
|
|
21
|
-
asyncresultdownloadurl?: string | undefined;
|
|
22
|
-
actionparam?: unknown;
|
|
23
|
-
actionparam2?: unknown;
|
|
24
|
-
actionparam3?: unknown;
|
|
25
|
-
actionparam4?: unknown;
|
|
26
|
-
begintime: string;
|
|
27
|
-
endtime: string;
|
|
28
|
-
createman: string;
|
|
29
|
-
createdate: string;
|
|
30
|
-
updateman: string;
|
|
31
|
-
updatedate: string;
|
|
32
|
-
}[];
|
|
33
|
-
};
|
|
4
|
+
appStore: IAppStore;
|
|
34
5
|
}, "appStore">>, Pick<{
|
|
35
|
-
appStore:
|
|
36
|
-
allAsyncActions: IPortalAsyncAction[];
|
|
37
|
-
recentAsyncActions: {
|
|
38
|
-
asyncacitonid: string;
|
|
39
|
-
asyncacitonname: string;
|
|
40
|
-
fulltopictag: string;
|
|
41
|
-
srfdcid: string;
|
|
42
|
-
dcsystemid: string;
|
|
43
|
-
actiontype: string;
|
|
44
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
45
|
-
actionresult?: unknown;
|
|
46
|
-
stepinfo?: string | undefined;
|
|
47
|
-
completionrate?: number | undefined;
|
|
48
|
-
asyncresultdownloadurl?: string | undefined;
|
|
49
|
-
actionparam?: unknown;
|
|
50
|
-
actionparam2?: unknown;
|
|
51
|
-
actionparam3?: unknown;
|
|
52
|
-
actionparam4?: unknown;
|
|
53
|
-
begintime: string;
|
|
54
|
-
endtime: string;
|
|
55
|
-
createman: string;
|
|
56
|
-
createdate: string;
|
|
57
|
-
updateman: string;
|
|
58
|
-
updatedate: string;
|
|
59
|
-
}[];
|
|
60
|
-
};
|
|
6
|
+
appStore: IAppStore;
|
|
61
7
|
}, never>, Pick<{
|
|
62
|
-
appStore:
|
|
63
|
-
allAsyncActions: IPortalAsyncAction[];
|
|
64
|
-
recentAsyncActions: {
|
|
65
|
-
asyncacitonid: string;
|
|
66
|
-
asyncacitonname: string;
|
|
67
|
-
fulltopictag: string;
|
|
68
|
-
srfdcid: string;
|
|
69
|
-
dcsystemid: string;
|
|
70
|
-
actiontype: string;
|
|
71
|
-
actionstate: 10 | 20 | 30 | 40;
|
|
72
|
-
actionresult?: unknown;
|
|
73
|
-
stepinfo?: string | undefined;
|
|
74
|
-
completionrate?: number | undefined;
|
|
75
|
-
asyncresultdownloadurl?: string | undefined;
|
|
76
|
-
actionparam?: unknown;
|
|
77
|
-
actionparam2?: unknown;
|
|
78
|
-
actionparam3?: unknown;
|
|
79
|
-
actionparam4?: unknown;
|
|
80
|
-
begintime: string;
|
|
81
|
-
endtime: string;
|
|
82
|
-
createman: string;
|
|
83
|
-
createdate: string;
|
|
84
|
-
updateman: string;
|
|
85
|
-
updatedate: string;
|
|
86
|
-
}[];
|
|
87
|
-
};
|
|
8
|
+
appStore: IAppStore;
|
|
88
9
|
}, never>>;
|
|
89
10
|
//# sourceMappingURL=app-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-store.d.ts","sourceRoot":"","sources":["../../../../src/util/store/app-store/app-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-store.d.ts","sourceRoot":"","sources":["../../../../src/util/store/app-store/app-store.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;CAAG;AAE7B,eAAO,MAAM,WAAW;;;;;;UAItB,CAAC"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { defineStore } from 'pinia';
|
|
2
2
|
import { reactive } from 'vue';
|
|
3
|
-
import { useAsyncAction } from '../async-action/async-action.mjs';
|
|
4
3
|
|
|
5
4
|
"use strict";
|
|
6
5
|
const useAppStore = defineStore("appStore", () => {
|
|
7
|
-
const
|
|
8
|
-
const appStore = reactive({
|
|
9
|
-
allAsyncActions,
|
|
10
|
-
get recentAsyncActions() {
|
|
11
|
-
return recentAsyncActions.value;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
6
|
+
const appStore = reactive({});
|
|
14
7
|
return { appStore };
|
|
15
8
|
});
|
|
16
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onUnmounted, onMounted,
|
|
1
|
+
import { defineComponent, onUnmounted, onMounted, createVNode, createTextVNode } from 'vue';
|
|
2
2
|
import { IBizContext } from '@ibiz-template/core';
|
|
3
3
|
import { toLocalOpenWFRedirectView } from '@ibiz-template/runtime';
|
|
4
4
|
|
|
@@ -21,7 +21,6 @@ export declare const IBizView: import("../../util").TypeWithInstall<import("vue"
|
|
|
21
21
|
c: import("@ibiz-template/runtime").ViewController<import("@ibiz/model-core").IAppView, import("@ibiz-template/runtime").IViewState, import("@ibiz-template/runtime").IViewEvent>;
|
|
22
22
|
controls: import("@ibiz/model-core").IControl[];
|
|
23
23
|
viewClassNames: import("vue").ComputedRef<(string | undefined)[]>;
|
|
24
|
-
container: import("vue").Ref<HTMLElement | null>;
|
|
25
24
|
onLayoutPanelCreated: (controller: import("@ibiz-template/runtime").IViewLayoutPanelController) => void;
|
|
26
25
|
renderViewMessage: (position: "TOP" | "BOTTOM" | "BODY") => JSX.Element | null;
|
|
27
26
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/common/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/common/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAGnB,CAAC"}
|
package/es/view/common/view.d.ts
CHANGED
|
@@ -25,7 +25,6 @@ export declare const View: import("vue").DefineComponent<{
|
|
|
25
25
|
c: ViewController<IAppView, import("@ibiz-template/runtime").IViewState, import("@ibiz-template/runtime").IViewEvent>;
|
|
26
26
|
controls: import("@ibiz/model-core").IControl[];
|
|
27
27
|
viewClassNames: import("vue").ComputedRef<(string | undefined)[]>;
|
|
28
|
-
container: import("vue").Ref<HTMLElement | null>;
|
|
29
28
|
onLayoutPanelCreated: (controller: IViewLayoutPanelController) => void;
|
|
30
29
|
renderViewMessage: (position: 'TOP' | 'BOTTOM' | 'BODY') => JSX.Element | null;
|
|
31
30
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/common/view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACf,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/view/common/view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAGL,QAAQ,EAIT,MAAM,KAAK,CAAC;AACb,OAAO,aAAa,CAAC;AAGrB,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;uCA4BC,0BAA0B,KACrC,IAAI;kCAI8B,KAAK,GAAG,QAAQ,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;MAmGhE,CAAC"}
|
package/es/view/common/view.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent, computed, createVNode, resolveComponent, h, createTextVNode, withDirectives, resolveDirective } from 'vue';
|
|
2
2
|
import { ViewController, getControlsByView } from '@ibiz-template/runtime';
|
|
3
|
-
import { createUUID } from 'qx-util';
|
|
4
3
|
import './view.css';
|
|
5
4
|
import '../../use/index.mjs';
|
|
6
5
|
import { useNamespace } from '../../use/namespace/namespace.mjs';
|
|
@@ -44,19 +43,6 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
44
43
|
const onLayoutPanelCreated = (controller) => {
|
|
45
44
|
c.setLayoutPanel(controller);
|
|
46
45
|
};
|
|
47
|
-
const container = ref(null);
|
|
48
|
-
const key = createUUID();
|
|
49
|
-
const devtool = window.devtool;
|
|
50
|
-
onMounted(() => {
|
|
51
|
-
if (devtool) {
|
|
52
|
-
devtool.registerView(key, c, container);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
onUnmounted(() => {
|
|
56
|
-
if (devtool) {
|
|
57
|
-
devtool.unRegisterView(key);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
46
|
const renderViewMessage = (position) => {
|
|
61
47
|
if (c.state.isCreated) {
|
|
62
48
|
const viewMessages = c.state.viewMessages[position];
|
|
@@ -73,7 +59,6 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
73
59
|
c,
|
|
74
60
|
controls,
|
|
75
61
|
viewClassNames,
|
|
76
|
-
container,
|
|
77
62
|
onLayoutPanelCreated,
|
|
78
63
|
renderViewMessage
|
|
79
64
|
};
|
|
@@ -133,7 +118,6 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
133
118
|
}
|
|
134
119
|
}
|
|
135
120
|
return withDirectives(createVNode("div", {
|
|
136
|
-
"ref": "container",
|
|
137
121
|
"class": this.viewClassNames,
|
|
138
122
|
"id": this.c.id
|
|
139
123
|
}, [this.renderViewMessage("TOP"), layoutPanel, this.renderViewMessage("BOTTOM")]), [[resolveDirective("loading"), this.c.state.isLoading]]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, toRaw, resolveComponent,
|
|
1
|
+
import { defineComponent, ref, toRaw, h, resolveComponent, withDirectives, createVNode, resolveDirective } from 'vue';
|
|
2
2
|
import { RuntimeError } from '@ibiz-template/core';
|
|
3
3
|
import { ViewController, getDERedirectToView } from '@ibiz-template/runtime';
|
|
4
4
|
import '../../use/index.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { registerViewProvider, ViewType } from '@ibiz-template/runtime';
|
|
2
2
|
import '../../util/index.mjs';
|
|
3
3
|
import { DeRedirectView } from './de-redirect-view.mjs';
|
|
4
4
|
import { DeRedirectViewProvider } from './de-redirect-view.provider.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { registerViewProvider, ViewType } from '@ibiz-template/runtime';
|
|
2
2
|
import '../../util/index.mjs';
|
|
3
3
|
import { PortalViewProvider } from './portal-view.provider.mjs';
|
|
4
4
|
import { PortalView } from './portal-view.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveComponent, h, createVNode
|
|
1
|
+
import { defineComponent, resolveComponent, h, createVNode } from 'vue';
|
|
2
2
|
import { ViewController } from '@ibiz-template/runtime';
|
|
3
3
|
import '../../use/index.mjs';
|
|
4
4
|
import { useNamespace } from '../../use/namespace/namespace.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-util",
|
|
3
|
-
"version": "0.5.7-alpha.
|
|
3
|
+
"version": "0.5.7-alpha.10",
|
|
4
4
|
"description": "vue3 工具包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@ibiz-template/cli": "^0.3.10",
|
|
35
|
-
"@ibiz-template/core": "^0.5.7-alpha.
|
|
36
|
-
"@ibiz-template/runtime": "^0.5.7-alpha.
|
|
35
|
+
"@ibiz-template/core": "^0.5.7-alpha.10",
|
|
36
|
+
"@ibiz-template/runtime": "^0.5.7-alpha.10",
|
|
37
37
|
"@ibiz-template/theme": "^0.5.7-alpha.0",
|
|
38
|
-
"@ibiz/model-core": "^0.1.
|
|
38
|
+
"@ibiz/model-core": "^0.1.9",
|
|
39
39
|
"@types/path-browserify": "^1.0.2",
|
|
40
40
|
"@types/qs": "^6.9.11",
|
|
41
41
|
"@types/systemjs": "^6.13.5",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@ibiz-template/core": "^0.5.0-beta.0",
|
|
54
54
|
"@ibiz-template/runtime": "^0.5.0-beta.0",
|
|
55
|
-
"@ibiz/model-core": "^0.1.
|
|
55
|
+
"@ibiz/model-core": "^0.1.9",
|
|
56
56
|
"dayjs": "^1.11.10",
|
|
57
57
|
"path-browserify": "^1.0.1",
|
|
58
58
|
"pinia": "^2.1.7",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"vue": "^3.3.4",
|
|
63
63
|
"vue-router": "^4.2.4"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "9ccf60215bd9d4c64c9102032c492a85ddbc591e"
|
|
66
66
|
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import {
|
|
4
4
|
getViewProvider,
|
|
5
5
|
IViewProvider,
|
|
6
|
-
|
|
6
|
+
calcDynaSysParams,
|
|
7
7
|
} from '@ibiz-template/runtime';
|
|
8
8
|
import { defineComponent, h, PropType, ref, resolveComponent } from 'vue';
|
|
9
|
-
import {
|
|
9
|
+
import { IAppView } from '@ibiz/model-core';
|
|
10
10
|
import { RuntimeError } from '@ibiz-template/core';
|
|
11
11
|
import { createUUID } from 'qx-util';
|
|
12
12
|
import { isEmpty, isNil } from 'ramda';
|
|
@@ -42,13 +42,7 @@ export const IBizViewShell = defineComponent({
|
|
|
42
42
|
if (viewModel.dynaSysMode === 1) {
|
|
43
43
|
//* 计算实体资源路径上下文参数
|
|
44
44
|
const appDataEntityId = viewModel.appDataEntityId;
|
|
45
|
-
|
|
46
|
-
if (appDataEntityId) {
|
|
47
|
-
appDe = await ibiz.hub.getAppDataEntity(
|
|
48
|
-
appDataEntityId,
|
|
49
|
-
viewModel.appId,
|
|
50
|
-
);
|
|
51
|
-
} else {
|
|
45
|
+
if (!appDataEntityId) {
|
|
52
46
|
throw new RuntimeError(
|
|
53
47
|
`${viewModel.codeName}无实体,暂不支持加载动态模型`,
|
|
54
48
|
);
|
|
@@ -57,38 +51,20 @@ export const IBizViewShell = defineComponent({
|
|
|
57
51
|
const params = props.params || {};
|
|
58
52
|
|
|
59
53
|
/** 加载动态模型的请求参数 */
|
|
60
|
-
const loadModelParams: IParams =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// 主键
|
|
66
|
-
const srfkey = props.context[appDe.codeName!.toLowerCase()];
|
|
67
|
-
if (srfkey) {
|
|
68
|
-
loadModelParams.srfkey = srfkey;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
54
|
+
const loadModelParams: IParams = await calcDynaSysParams(
|
|
55
|
+
appDataEntityId,
|
|
56
|
+
props.context,
|
|
57
|
+
{ viewParams: params, appId: viewModel.appId },
|
|
58
|
+
);
|
|
71
59
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
loadModelParams.srfparentkey = params.srfparentkey;
|
|
75
|
-
loadModelParams.srfparentdeanme = params.srfparentdeanme;
|
|
76
|
-
} else {
|
|
77
|
-
// 上层资源路径主实体名称和主键
|
|
78
|
-
const match = getMatchResPath(props.context, appDe);
|
|
79
|
-
if (match && match.keys.length > 1) {
|
|
80
|
-
const parentDeKey = match.keys[match.keys.length - 2];
|
|
81
|
-
loadModelParams.srfparentkey =
|
|
82
|
-
params.srfparentkey || props.context[parentDeKey];
|
|
83
|
-
loadModelParams.srfparentdeanme =
|
|
84
|
-
params.srfparentdeanme || parentDeKey;
|
|
85
|
-
}
|
|
60
|
+
if (params.srfdatatype) {
|
|
61
|
+
loadModelParams.srfdatatype = params.srfdatatype;
|
|
86
62
|
}
|
|
87
63
|
|
|
88
64
|
// 如果视图参数中存在 srfwftag 则直接使用视图参数
|
|
89
65
|
if (params.srfwftag) {
|
|
90
66
|
loadModelParams.srfwftag = params.srfwftag;
|
|
91
|
-
} else if (
|
|
67
|
+
} else if (appDataEntityId && viewModel.enableWF) {
|
|
92
68
|
// 处理数据请求的上下文
|
|
93
69
|
const context: IContext = { ...props.context };
|
|
94
70
|
// 存在主键则加载数据计算对应的参数
|
|
@@ -74,12 +74,18 @@ function renderPanelItem(
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
// 直接样式
|
|
78
|
+
let tempStyle = '';
|
|
79
|
+
if (panelItem.cssStyle) {
|
|
80
|
+
tempStyle = panelItem.cssStyle;
|
|
81
|
+
}
|
|
77
82
|
return h(
|
|
78
83
|
component,
|
|
79
84
|
{
|
|
80
85
|
modelData: panelItem,
|
|
81
86
|
controller: panelItems[panelItem.id!],
|
|
82
87
|
key: panelItem.id,
|
|
88
|
+
style: tempStyle,
|
|
83
89
|
},
|
|
84
90
|
children,
|
|
85
91
|
);
|
|
@@ -128,12 +128,18 @@ export const ViewLayoutPanelControl = defineComponent({
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
// 直接样式
|
|
132
|
+
let tempStyle = '';
|
|
133
|
+
if (panelItem.cssStyle) {
|
|
134
|
+
tempStyle = panelItem.cssStyle;
|
|
135
|
+
}
|
|
131
136
|
return h(
|
|
132
137
|
component,
|
|
133
138
|
{
|
|
134
139
|
modelData: panelItem,
|
|
135
140
|
controller: panelItems[panelItem.id!],
|
|
136
141
|
key: panelItem.id,
|
|
142
|
+
style: tempStyle,
|
|
137
143
|
},
|
|
138
144
|
children,
|
|
139
145
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IPanelRawItem } from '@ibiz/model-core';
|
|
2
|
-
import { computed, defineComponent, PropType } from 'vue';
|
|
2
|
+
import { computed, defineComponent, PropType, ref } from 'vue';
|
|
3
3
|
import { useNamespace } from '../../use';
|
|
4
4
|
import { PanelRawItemController } from './panel-rawitem.controller';
|
|
5
5
|
import './panel-rawitem.scss';
|
|
@@ -19,6 +19,14 @@ export const PanelRawItem = defineComponent({
|
|
|
19
19
|
setup(props) {
|
|
20
20
|
const ns = useNamespace('panel-rawitem');
|
|
21
21
|
|
|
22
|
+
const tempStyle = ref('');
|
|
23
|
+
|
|
24
|
+
const { rawItem } = props.modelData;
|
|
25
|
+
|
|
26
|
+
if (rawItem && rawItem.cssStyle) {
|
|
27
|
+
tempStyle.value = rawItem.cssStyle;
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
// 类名控制
|
|
23
31
|
const classArr = computed(() => {
|
|
24
32
|
const { id } = props.modelData;
|
|
@@ -30,6 +38,7 @@ export const PanelRawItem = defineComponent({
|
|
|
30
38
|
return {
|
|
31
39
|
ns,
|
|
32
40
|
classArr,
|
|
41
|
+
tempStyle,
|
|
33
42
|
};
|
|
34
43
|
},
|
|
35
44
|
render() {
|
|
@@ -40,6 +49,7 @@ export const PanelRawItem = defineComponent({
|
|
|
40
49
|
return (
|
|
41
50
|
<div
|
|
42
51
|
class={this.classArr}
|
|
52
|
+
style={this.tempStyle}
|
|
43
53
|
onClick={() => {
|
|
44
54
|
this.controller.onClick();
|
|
45
55
|
}}
|
package/src/util/route/route.ts
CHANGED
|
@@ -19,16 +19,26 @@ import { IRoutePath, IRoutePathNode, IRouteViewData } from '../../interface';
|
|
|
19
19
|
* @date 2022-08-18 11:08:08
|
|
20
20
|
* @export
|
|
21
21
|
* @param {string} pathStr 以/开头的路径,即router的path
|
|
22
|
+
* @param {boolean} [isRouteModal=false]
|
|
22
23
|
* @returns {*} {IRoutePath}
|
|
23
24
|
*/
|
|
24
|
-
export function route2routePath(
|
|
25
|
+
export function route2routePath(
|
|
26
|
+
route: Route,
|
|
27
|
+
isRouteModal: boolean = false,
|
|
28
|
+
): IRoutePath {
|
|
25
29
|
// 一共匹配了几级路由
|
|
26
30
|
const depth = route.matched.length;
|
|
27
31
|
|
|
32
|
+
let path = route.path;
|
|
33
|
+
if (isRouteModal) {
|
|
34
|
+
path = path.replace(new RegExp(`/${RouteConst.ROUTE_MODAL_TAG}`, 'g'), '');
|
|
35
|
+
}
|
|
36
|
+
const items = path.split('/');
|
|
37
|
+
|
|
28
38
|
// 解析路径节点
|
|
29
39
|
const pathNodes: IRoutePathNode[] = [];
|
|
30
40
|
for (let index = 1; index <= depth; index++) {
|
|
31
|
-
const viewName =
|
|
41
|
+
const viewName = items[index * 2];
|
|
32
42
|
const paramsStr = route.params[`params${index}`] as string;
|
|
33
43
|
|
|
34
44
|
/** 路由参数,默认是视图参数 */
|
|
@@ -341,6 +351,15 @@ export async function generateRoutePathByModal(
|
|
|
341
351
|
): Promise<{ path: string }> {
|
|
342
352
|
const routePath = route2routePath(route);
|
|
343
353
|
|
|
354
|
+
// 特殊处理 RouteConst.ROUTE_MODAL_TAG,因为只能有一级避免多次或重复点击,导致路由计算错误。再次点击时把之前的modal路由删除
|
|
355
|
+
const findIndex = routePath.pathNodes.findIndex(
|
|
356
|
+
item => item.viewName === RouteConst.ROUTE_MODAL_TAG,
|
|
357
|
+
);
|
|
358
|
+
|
|
359
|
+
if (findIndex !== -1) {
|
|
360
|
+
routePath.pathNodes = routePath.pathNodes.slice(0, findIndex);
|
|
361
|
+
}
|
|
362
|
+
|
|
344
363
|
// 导航视图的导航参数,加在目标层级之前的一个层级的视图参数里
|
|
345
364
|
if (context.currentSrfNav) {
|
|
346
365
|
const currentNode = routePath.pathNodes[routePath.pathNodes.length - 1];
|
|
@@ -352,7 +371,9 @@ export async function generateRoutePathByModal(
|
|
|
352
371
|
|
|
353
372
|
// 计算目标视图path路径
|
|
354
373
|
routePath.pathNodes.push({
|
|
355
|
-
viewName: `${
|
|
374
|
+
viewName: `${
|
|
375
|
+
RouteConst.ROUTE_MODAL_TAG
|
|
376
|
+
}/${appView.codeName!.toLowerCase()}`,
|
|
356
377
|
context: getOwnRouteContext(context),
|
|
357
378
|
params,
|
|
358
379
|
});
|
|
@@ -366,23 +387,27 @@ export async function generateRoutePathByModal(
|
|
|
366
387
|
* @author lxm
|
|
367
388
|
* @date 2022-08-17 22:08:51
|
|
368
389
|
* @export
|
|
369
|
-
* @param {IApplication} appModel 视图模型
|
|
370
390
|
* @param {Route} route 路由对象
|
|
371
391
|
* @param {number} depth 层级
|
|
392
|
+
* @param {boolean} [isRouteModal=false]
|
|
372
393
|
* @returns {*} {IRouteViewData}
|
|
373
394
|
*/
|
|
374
395
|
export async function parseRouteViewData(
|
|
375
396
|
route: Route,
|
|
376
397
|
depth: number,
|
|
398
|
+
isRouteModal: boolean = false,
|
|
377
399
|
): Promise<IRouteViewData> {
|
|
378
400
|
// 解析路由的视图参数
|
|
379
|
-
const routePath = route2routePath(route);
|
|
401
|
+
const routePath = route2routePath(route, isRouteModal);
|
|
380
402
|
|
|
381
403
|
// 获取对应层级的视图名称参数
|
|
382
404
|
let viewCodeName = routePath.pathNodes[depth - 1].viewName;
|
|
383
405
|
if (!viewCodeName) {
|
|
384
406
|
throw new RuntimeError(`第${depth}级路由不存在视图标识`);
|
|
385
407
|
}
|
|
408
|
+
if (viewCodeName === RouteConst.ROUTE_MODAL_TAG) {
|
|
409
|
+
viewCodeName = routePath.pathNodes[depth].viewName;
|
|
410
|
+
}
|
|
386
411
|
if (viewCodeName === 'index') {
|
|
387
412
|
viewCodeName = ibiz.hub.defaultAppIndexViewName;
|
|
388
413
|
}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import { IPortalAsyncAction } from '@ibiz-template/core';
|
|
2
1
|
import { defineStore } from 'pinia';
|
|
3
|
-
import { reactive
|
|
4
|
-
import { useAsyncAction } from '../async-action/async-action';
|
|
2
|
+
import { reactive } from 'vue';
|
|
5
3
|
|
|
6
|
-
export interface IAppStore {
|
|
7
|
-
allAsyncActions: Ref<IPortalAsyncAction[]>;
|
|
8
|
-
recentAsyncActions: IPortalAsyncAction[];
|
|
9
|
-
}
|
|
4
|
+
export interface IAppStore {}
|
|
10
5
|
|
|
11
6
|
export const useAppStore = defineStore('appStore', () => {
|
|
12
|
-
const
|
|
13
|
-
const appStore = reactive<IAppStore>({
|
|
14
|
-
allAsyncActions,
|
|
15
|
-
get recentAsyncActions() {
|
|
16
|
-
return recentAsyncActions.value;
|
|
17
|
-
},
|
|
18
|
-
});
|
|
7
|
+
const appStore = reactive<IAppStore>({});
|
|
19
8
|
|
|
20
9
|
return { appStore };
|
|
21
10
|
});
|
package/src/view/common/view.tsx
CHANGED
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
IViewProvider,
|
|
6
6
|
ViewController,
|
|
7
7
|
} from '@ibiz-template/runtime';
|
|
8
|
-
import { createUUID } from 'qx-util';
|
|
9
8
|
import { IAppView } from '@ibiz/model-core';
|
|
10
9
|
import {
|
|
11
10
|
defineComponent,
|
|
@@ -13,10 +12,7 @@ import {
|
|
|
13
12
|
PropType,
|
|
14
13
|
resolveComponent,
|
|
15
14
|
VNode,
|
|
16
|
-
ref,
|
|
17
15
|
computed,
|
|
18
|
-
onMounted,
|
|
19
|
-
onUnmounted,
|
|
20
16
|
} from 'vue';
|
|
21
17
|
import './view.scss';
|
|
22
18
|
import { useNamespace, useViewController } from '../../use';
|
|
@@ -54,24 +50,6 @@ export const View = defineComponent({
|
|
|
54
50
|
c.setLayoutPanel(controller as IViewLayoutPanelController);
|
|
55
51
|
};
|
|
56
52
|
|
|
57
|
-
const container = ref<HTMLElement | null>(null);
|
|
58
|
-
// todo devtool抽全局
|
|
59
|
-
const key = createUUID();
|
|
60
|
-
|
|
61
|
-
// 临时实现从window上取
|
|
62
|
-
const devtool = (window as IData).devtool;
|
|
63
|
-
onMounted(() => {
|
|
64
|
-
if (devtool) {
|
|
65
|
-
devtool.registerView(key, c, container);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
onUnmounted(() => {
|
|
70
|
-
if (devtool) {
|
|
71
|
-
devtool.unRegisterView(key);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
53
|
const renderViewMessage = (position: 'TOP' | 'BOTTOM' | 'BODY') => {
|
|
76
54
|
if (c.state.isCreated) {
|
|
77
55
|
const viewMessages = c.state.viewMessages[position];
|
|
@@ -91,7 +69,6 @@ export const View = defineComponent({
|
|
|
91
69
|
c,
|
|
92
70
|
controls,
|
|
93
71
|
viewClassNames,
|
|
94
|
-
container,
|
|
95
72
|
onLayoutPanelCreated,
|
|
96
73
|
renderViewMessage,
|
|
97
74
|
};
|
|
@@ -162,7 +139,6 @@ export const View = defineComponent({
|
|
|
162
139
|
|
|
163
140
|
return (
|
|
164
141
|
<div
|
|
165
|
-
ref='container'
|
|
166
142
|
class={this.viewClassNames}
|
|
167
143
|
id={this.c.id}
|
|
168
144
|
v-loading={this.c.state.isLoading}
|