@ibiz-template/vue3-util 0.7.34 → 0.7.38-alpha.12
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.d.ts +1 -1
- package/es/common/code-list/code-list.d.ts +10 -1
- package/es/common/code-list/code-list.d.ts.map +1 -1
- package/es/common/code-list/code-list.mjs +23 -5
- package/es/common/control-loading-placeholder/control-loading-placeholder.d.ts +1 -1
- package/es/common/control-shell/control-shell.d.ts +1 -1
- package/es/common/icon/icon.d.ts +1 -1
- package/es/common/router-view/router-view.d.ts +3 -4
- package/es/common/router-view/router-view.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.d.ts +11 -8
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +61 -32
- package/es/control/panel/panel/index.d.ts +1 -1
- package/es/control/panel/panel/panel.d.ts +1 -1
- package/es/control/panel/view-layout-panel/index.d.ts +1 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +2 -2
- 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 +12 -4
- package/es/index.mjs +4 -0
- package/es/locale/en/index.mjs +1 -1
- package/es/panel-component/grid-container/grid-container.d.ts +1 -1
- package/es/panel-component/grid-container/index.d.ts +1 -1
- package/es/panel-component/index.d.ts +1 -0
- package/es/panel-component/index.d.ts.map +1 -1
- package/es/panel-component/index.mjs +3 -0
- package/es/panel-component/multi-data-container/index.d.ts +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts +9 -0
- package/es/panel-component/multi-data-container/multi-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/multi-data-container/multi-data-container.controller.mjs +32 -7
- package/es/panel-component/multi-data-container/multi-data-container.d.ts +2 -2
- package/es/panel-component/multi-data-container/multi-data-container.d.ts.map +1 -1
- package/es/panel-component/multi-data-container-raw/index.d.ts +37 -0
- package/es/panel-component/multi-data-container-raw/index.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/index.mjs +21 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts +118 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.controller.mjs +351 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.css +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts +36 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.mjs +82 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.provider.d.ts +16 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.provider.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.provider.mjs +15 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.d.ts +20 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.d.ts.map +1 -0
- package/es/panel-component/multi-data-container-raw/multi-data-container-raw.state.mjs +17 -0
- package/es/panel-component/nav-pos/index.d.ts +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.controller.mjs +5 -0
- package/es/panel-component/nav-pos/nav-pos.d.ts +1 -1
- package/es/panel-component/nav-pos/nav-pos.d.ts.map +1 -1
- package/es/panel-component/nav-pos/nav-pos.mjs +1 -1
- package/es/panel-component/panel-container/index.d.ts +1 -1
- package/es/panel-component/panel-container/panel-container.d.ts +1 -1
- package/es/panel-component/panel-container-group/index.d.ts +1 -1
- package/es/panel-component/panel-container-group/panel-container-group.d.ts +1 -1
- package/es/panel-component/panel-container-image/index.d.ts +1 -1
- package/es/panel-component/panel-container-image/panel-container-image.d.ts +1 -1
- package/es/panel-component/panel-container-tabs/index.d.ts +1 -1
- package/es/panel-component/panel-container-tabs/panel-container-tabs.d.ts +1 -1
- package/es/panel-component/panel-ctrl-pos/index.d.ts +1 -1
- package/es/panel-component/panel-ctrl-pos/panel-ctrl-pos.d.ts +1 -1
- package/es/panel-component/panel-field/index.d.ts +1 -1
- package/es/panel-component/panel-field/panel-field.d.ts +1 -1
- package/es/panel-component/panel-item-render/index.d.ts +1 -1
- package/es/panel-component/panel-item-render/panel-item-render.d.ts +1 -1
- package/es/panel-component/panel-rawitem/index.d.ts +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.d.ts +1 -1
- package/es/panel-component/panel-rawitem/panel-rawitem.mjs +2 -2
- package/es/panel-component/panel-tab-page/index.d.ts +1 -1
- package/es/panel-component/panel-tab-page/panel-tab-page.d.ts +1 -1
- package/es/panel-component/scroll-container/index.d.ts +1 -1
- package/es/panel-component/scroll-container/scroll-container/scroll-container.d.ts +1 -1
- package/es/panel-component/scroll-container/scroll-container-item/scroll-container-item.d.ts +1 -1
- package/es/panel-component/single-data-container/index.d.ts +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts +9 -0
- package/es/panel-component/single-data-container/single-data-container.controller.d.ts.map +1 -1
- package/es/panel-component/single-data-container/single-data-container.controller.mjs +31 -6
- package/es/panel-component/single-data-container/single-data-container.d.ts +2 -2
- package/es/panel-component/single-data-container/single-data-container.d.ts.map +1 -1
- package/es/panel-component/teleport-placeholder/index.d.ts +1 -1
- package/es/panel-component/teleport-placeholder/teleport-placeholder.d.ts +1 -1
- package/es/use/click-outside/click-outside.d.ts.map +1 -1
- package/es/util/install.d.ts.map +1 -1
- package/es/util/store/ui-store/ui-store.d.ts.map +1 -1
- package/es/util/store/ui-store/ui-store.mjs +8 -1
- package/es/view/app-redirect-view/app-redirect-view.d.ts +1 -1
- package/es/view/app-redirect-view/app-redirect-view.d.ts.map +1 -1
- package/es/view/common/index.d.ts +3 -3
- package/es/view/common/view.d.ts +3 -3
- package/es/view/common/view.d.ts.map +1 -1
- package/es/view/common/view.mjs +7 -6
- package/es/view/de-redirect-view/de-redirect-view.d.ts +1 -1
- package/es/view/de-redirect-view/index.d.ts +1 -1
- package/es/view/html-view/html-view.css +1 -0
- package/es/view/html-view/html-view.d.ts +48 -0
- package/es/view/html-view/html-view.d.ts.map +1 -0
- package/es/view/html-view/html-view.mjs +94 -0
- package/es/view/html-view/html-view.provider.d.ts +14 -0
- package/es/view/html-view/html-view.provider.d.ts.map +1 -0
- package/es/view/html-view/html-view.provider.mjs +8 -0
- package/es/view/html-view/index.d.ts +44 -0
- package/es/view/html-view/index.d.ts.map +1 -0
- package/es/view/html-view/index.mjs +13 -0
- package/es/view/index.d.ts +1 -0
- package/es/view/index.d.ts.map +1 -1
- package/es/view/index.mjs +1 -0
- package/es/view/portal-view/index.d.ts +1 -1
- package/es/view/portal-view/portal-view.d.ts +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts +1 -1
- package/es/view/todo-redirect/todo-redirect.d.ts.map +1 -1
- package/lib/common/code-list/code-list.cjs +21 -3
- package/lib/common/view-shell/view-shell.cjs +59 -30
- package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +11 -3
- package/lib/index.cjs +45 -37
- package/lib/locale/en/index.cjs +1 -1
- package/lib/panel-component/index.cjs +22 -16
- package/lib/panel-component/multi-data-container/multi-data-container.controller.cjs +31 -6
- package/lib/panel-component/multi-data-container-raw/index.cjs +28 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.cjs +84 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.controller.cjs +353 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.css +1 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.provider.cjs +17 -0
- package/lib/panel-component/multi-data-container-raw/multi-data-container-raw.state.cjs +19 -0
- package/lib/panel-component/nav-pos/nav-pos.cjs +1 -1
- package/lib/panel-component/nav-pos/nav-pos.controller.cjs +5 -0
- package/lib/panel-component/panel-rawitem/panel-rawitem.cjs +2 -2
- package/lib/panel-component/single-data-container/single-data-container.controller.cjs +30 -5
- package/lib/util/store/ui-store/ui-store.cjs +8 -1
- package/lib/view/common/view.cjs +7 -6
- package/lib/view/html-view/html-view.cjs +96 -0
- package/lib/view/html-view/html-view.css +1 -0
- package/lib/view/html-view/html-view.provider.cjs +10 -0
- package/lib/view/html-view/index.cjs +15 -0
- package/lib/view/index.cjs +2 -0
- package/package.json +5 -5
package/es/view/common/view.mjs
CHANGED
|
@@ -81,18 +81,19 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
81
81
|
});
|
|
82
82
|
return result;
|
|
83
83
|
};
|
|
84
|
-
const getCtrlProps = (ctrl) => {
|
|
84
|
+
const getCtrlProps = (ctrl, slotProps = {}) => {
|
|
85
85
|
const slotKey = ctrl.name || ctrl.id;
|
|
86
86
|
return {
|
|
87
87
|
context: c.context,
|
|
88
88
|
params: c.params,
|
|
89
89
|
modelData: ctrl,
|
|
90
|
-
...c.slotProps[slotKey] || {}
|
|
90
|
+
...c.slotProps[slotKey] || {},
|
|
91
|
+
...slotProps
|
|
91
92
|
};
|
|
92
93
|
};
|
|
93
|
-
const renderControl = (ctrl) => {
|
|
94
|
+
const renderControl = (ctrl, slotProps = {}) => {
|
|
94
95
|
const slotKey = ctrl.name || ctrl.id;
|
|
95
|
-
const ctrlProps = getCtrlProps(ctrl);
|
|
96
|
+
const ctrlProps = getCtrlProps(ctrl, slotProps);
|
|
96
97
|
if (slots[slotKey]) {
|
|
97
98
|
return renderSlot(slots, slotKey, ctrlProps);
|
|
98
99
|
}
|
|
@@ -133,8 +134,8 @@ const View = /* @__PURE__ */ defineComponent({
|
|
|
133
134
|
if ((_a = this.controls) == null ? void 0 : _a.length) {
|
|
134
135
|
this.controls.forEach((ctrl) => {
|
|
135
136
|
const slotKey = ctrl.name || ctrl.id;
|
|
136
|
-
slots[slotKey] = () => {
|
|
137
|
-
return this.renderControl(ctrl);
|
|
137
|
+
slots[slotKey] = (slotProps) => {
|
|
138
|
+
return this.renderControl(ctrl, slotProps);
|
|
138
139
|
};
|
|
139
140
|
});
|
|
140
141
|
}
|
|
@@ -19,7 +19,7 @@ export declare const DeRedirectView: import("vue").DefineComponent<{
|
|
|
19
19
|
toViewId: import("vue").Ref<string | undefined>;
|
|
20
20
|
toViewContext: import("vue").Ref<IContext | undefined>;
|
|
21
21
|
toViewParams: import("vue").Ref<IParams | undefined>;
|
|
22
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
22
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
23
|
context: {
|
|
24
24
|
type: PropType<IContext>;
|
|
25
25
|
required: true;
|
|
@@ -16,7 +16,7 @@ export declare const IBizDeRedirectView: import("../../util").TypeWithInstall<im
|
|
|
16
16
|
toViewId: import("vue").Ref<string | undefined>;
|
|
17
17
|
toViewContext: import("vue").Ref<IContext | undefined>;
|
|
18
18
|
toViewParams: import("vue").Ref<IParams | undefined>;
|
|
19
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
19
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
20
|
context: {
|
|
21
21
|
type: import("vue").PropType<IContext>;
|
|
22
22
|
required: true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-view-dehtmlview>iframe{width:100%;height:100%;border:0}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IModal, ViewController } from '@ibiz-template/runtime';
|
|
2
|
+
import { IAppPortalView } from '@ibiz/model-core';
|
|
3
|
+
import { PropType } from 'vue';
|
|
4
|
+
import './html-view.scss';
|
|
5
|
+
export declare const HtmlView: import("vue").DefineComponent<{
|
|
6
|
+
context: PropType<IContext>;
|
|
7
|
+
params: {
|
|
8
|
+
type: PropType<IParams>;
|
|
9
|
+
default: () => {};
|
|
10
|
+
};
|
|
11
|
+
modelData: {
|
|
12
|
+
type: PropType<IAppPortalView>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
modal: {
|
|
16
|
+
type: PropType<IModal>;
|
|
17
|
+
};
|
|
18
|
+
state: {
|
|
19
|
+
type: PropType<IData>;
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
c: ViewController<import("@ibiz/model-core").IAppView, import("@ibiz-template/runtime").IViewState, import("@ibiz-template/runtime").IViewEvent>;
|
|
23
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
24
|
+
controls: import("@ibiz/model-core").IControl[] | undefined;
|
|
25
|
+
viewClassNames: (string | undefined)[];
|
|
26
|
+
url: import("vue").ComputedRef<any>;
|
|
27
|
+
isLoading: import("vue").Ref<boolean>;
|
|
28
|
+
onLoad: () => void;
|
|
29
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
+
context: PropType<IContext>;
|
|
31
|
+
params: {
|
|
32
|
+
type: PropType<IParams>;
|
|
33
|
+
default: () => {};
|
|
34
|
+
};
|
|
35
|
+
modelData: {
|
|
36
|
+
type: PropType<IAppPortalView>;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
modal: {
|
|
40
|
+
type: PropType<IModal>;
|
|
41
|
+
};
|
|
42
|
+
state: {
|
|
43
|
+
type: PropType<IData>;
|
|
44
|
+
};
|
|
45
|
+
}>>, {
|
|
46
|
+
params: IParams;
|
|
47
|
+
}, {}>;
|
|
48
|
+
//# sourceMappingURL=html-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-view.d.ts","sourceRoot":"","sources":["../../../src/view/html-view/html-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEL,QAAQ,EAMT,MAAM,KAAK,CAAC;AAEb,OAAO,kBAAkB,CAAC;AAE1B,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAmEnB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, onBeforeMount, withDirectives, createVNode, resolveDirective, h, resolveComponent } from 'vue';
|
|
2
|
+
import { ViewController, getErrorViewProvider } from '@ibiz-template/runtime';
|
|
3
|
+
import '../../use/index.mjs';
|
|
4
|
+
import './html-view.css';
|
|
5
|
+
import { useNamespace } from '../../use/namespace/namespace.mjs';
|
|
6
|
+
import { useViewController } from '../../use/view/use-view-controller/use-view-controller.mjs';
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
const HtmlView = /* @__PURE__ */ defineComponent({
|
|
10
|
+
name: "IBizHtmlView",
|
|
11
|
+
props: {
|
|
12
|
+
context: Object,
|
|
13
|
+
params: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: () => ({})
|
|
16
|
+
},
|
|
17
|
+
modelData: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
modal: {
|
|
22
|
+
type: Object
|
|
23
|
+
},
|
|
24
|
+
state: {
|
|
25
|
+
type: Object
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
setup() {
|
|
29
|
+
var _a;
|
|
30
|
+
const ns = useNamespace("view");
|
|
31
|
+
const c = useViewController((...args) => new ViewController(...args));
|
|
32
|
+
const controls = ((_a = c.model.viewLayoutPanel) == null ? void 0 : _a.controls) || c.model.controls;
|
|
33
|
+
const {
|
|
34
|
+
viewType,
|
|
35
|
+
sysCss,
|
|
36
|
+
codeName
|
|
37
|
+
} = c.model;
|
|
38
|
+
const typeClass = viewType.toLowerCase();
|
|
39
|
+
const sysCssName = sysCss == null ? void 0 : sysCss.cssName;
|
|
40
|
+
const viewClassNames = [ns.b(), ns.b(typeClass), ns.m(codeName), sysCssName];
|
|
41
|
+
const isLoading = ref(false);
|
|
42
|
+
const url = computed(() => {
|
|
43
|
+
if (c.model) {
|
|
44
|
+
const {
|
|
45
|
+
htmlUrl
|
|
46
|
+
} = c.model;
|
|
47
|
+
if (htmlUrl) {
|
|
48
|
+
return htmlUrl;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return "";
|
|
52
|
+
});
|
|
53
|
+
onBeforeMount(() => {
|
|
54
|
+
if (url.value) {
|
|
55
|
+
isLoading.value = true;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const onLoad = () => {
|
|
59
|
+
isLoading.value = false;
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
c,
|
|
63
|
+
ns,
|
|
64
|
+
controls,
|
|
65
|
+
viewClassNames,
|
|
66
|
+
url,
|
|
67
|
+
isLoading,
|
|
68
|
+
onLoad
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
render() {
|
|
72
|
+
if (this.url) {
|
|
73
|
+
return withDirectives(createVNode("div", {
|
|
74
|
+
"class": this.viewClassNames
|
|
75
|
+
}, [createVNode("iframe", {
|
|
76
|
+
"src": this.url,
|
|
77
|
+
"onLoad": () => this.onLoad()
|
|
78
|
+
}, null)]), [[resolveDirective("loading"), this.isLoading]]);
|
|
79
|
+
}
|
|
80
|
+
let Content = null;
|
|
81
|
+
const provider = getErrorViewProvider("404");
|
|
82
|
+
if (provider) {
|
|
83
|
+
if (typeof provider.component === "string") {
|
|
84
|
+
Content = h(resolveComponent(provider.component));
|
|
85
|
+
}
|
|
86
|
+
Content = h(provider.component);
|
|
87
|
+
}
|
|
88
|
+
return createVNode("div", {
|
|
89
|
+
"class": this.viewClassNames
|
|
90
|
+
}, [Content]);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export { HtmlView };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IViewProvider } from '@ibiz-template/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* 实体html视图适配器
|
|
4
|
+
*
|
|
5
|
+
* @author fzh
|
|
6
|
+
* @date 2024-08-21 18:00:57
|
|
7
|
+
* @export
|
|
8
|
+
* @class HtmlViewProvider
|
|
9
|
+
* @implements {IViewProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class HtmlViewProvider implements IViewProvider {
|
|
12
|
+
component: string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=html-view.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-view.provider.d.ts","sourceRoot":"","sources":["../../../src/view/html-view/html-view.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,YAAW,aAAa;IACpD,SAAS,EAAE,MAAM,CAAkB;CACpC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const IBizHtmlView: import("../../util").TypeWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
context: import("vue").PropType<IContext>;
|
|
3
|
+
params: {
|
|
4
|
+
type: import("vue").PropType<IParams>;
|
|
5
|
+
default: () => {};
|
|
6
|
+
};
|
|
7
|
+
modelData: {
|
|
8
|
+
type: import("vue").PropType<import("@ibiz/model-core").IAppPortalView>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
modal: {
|
|
12
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IModal>;
|
|
13
|
+
};
|
|
14
|
+
state: {
|
|
15
|
+
type: import("vue").PropType<IData>;
|
|
16
|
+
};
|
|
17
|
+
}, {
|
|
18
|
+
c: import("@ibiz-template/runtime").ViewController<import("@ibiz/model-core").IAppView, import("@ibiz-template/runtime").IViewState, import("@ibiz-template/runtime").IViewEvent>;
|
|
19
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
20
|
+
controls: import("@ibiz/model-core").IControl[] | undefined;
|
|
21
|
+
viewClassNames: (string | undefined)[];
|
|
22
|
+
url: import("vue").ComputedRef<any>;
|
|
23
|
+
isLoading: import("vue").Ref<boolean>;
|
|
24
|
+
onLoad: () => void;
|
|
25
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
|
+
context: import("vue").PropType<IContext>;
|
|
27
|
+
params: {
|
|
28
|
+
type: import("vue").PropType<IParams>;
|
|
29
|
+
default: () => {};
|
|
30
|
+
};
|
|
31
|
+
modelData: {
|
|
32
|
+
type: import("vue").PropType<import("@ibiz/model-core").IAppPortalView>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
modal: {
|
|
36
|
+
type: import("vue").PropType<import("@ibiz-template/runtime").IModal>;
|
|
37
|
+
};
|
|
38
|
+
state: {
|
|
39
|
+
type: import("vue").PropType<IData>;
|
|
40
|
+
};
|
|
41
|
+
}>>, {
|
|
42
|
+
params: IParams;
|
|
43
|
+
}, {}>>;
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/html-view/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAGvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { registerViewProvider, ViewType } from '@ibiz-template/runtime';
|
|
2
|
+
import '../../util/index.mjs';
|
|
3
|
+
import { HtmlViewProvider } from './html-view.provider.mjs';
|
|
4
|
+
import { HtmlView } from './html-view.mjs';
|
|
5
|
+
import { withInstall } from '../../util/install.mjs';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const IBizHtmlView = withInstall(HtmlView, function(v) {
|
|
9
|
+
v.component(HtmlView.name, HtmlView);
|
|
10
|
+
registerViewProvider(ViewType.DE_HTML_VIEW, () => new HtmlViewProvider());
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export { IBizHtmlView };
|
package/es/view/index.d.ts
CHANGED
package/es/view/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/view/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC"}
|
package/es/view/index.mjs
CHANGED
|
@@ -3,5 +3,6 @@ export { IBizView } from './common/index.mjs';
|
|
|
3
3
|
export { TodoRedirect } from './todo-redirect/todo-redirect.mjs';
|
|
4
4
|
export { IBizPortalView } from './portal-view/index.mjs';
|
|
5
5
|
export { IBizDeRedirectView } from './de-redirect-view/index.mjs';
|
|
6
|
+
export { IBizHtmlView } from './html-view/index.mjs';
|
|
6
7
|
|
|
7
8
|
"use strict";
|
|
@@ -19,7 +19,7 @@ export declare const IBizPortalView: import("../../util").TypeWithInstall<import
|
|
|
19
19
|
ns: import("@ibiz-template/core").Namespace;
|
|
20
20
|
controls: import("@ibiz/model-core").IControl[] | undefined;
|
|
21
21
|
viewClassNames: (string | undefined)[];
|
|
22
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
22
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
23
|
context: import("vue").PropType<IContext>;
|
|
24
24
|
params: {
|
|
25
25
|
type: import("vue").PropType<IParams>;
|
|
@@ -22,7 +22,7 @@ export declare const PortalView: import("vue").DefineComponent<{
|
|
|
22
22
|
ns: import("@ibiz-template/core").Namespace;
|
|
23
23
|
controls: import("@ibiz/model-core").IControl[] | undefined;
|
|
24
24
|
viewClassNames: (string | undefined)[];
|
|
25
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
25
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
26
26
|
context: PropType<IContext>;
|
|
27
27
|
params: {
|
|
28
28
|
type: PropType<IParams>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const TodoRedirect: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
1
|
+
export declare const TodoRedirect: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
2
|
//# sourceMappingURL=todo-redirect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todo-redirect.d.ts","sourceRoot":"","sources":["../../../src/view/todo-redirect/todo-redirect.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"todo-redirect.d.ts","sourceRoot":"","sources":["../../../src/view/todo-redirect/todo-redirect.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,4NA8CvB,CAAC"}
|
|
@@ -31,6 +31,10 @@ const IBizCodeList = /* @__PURE__ */ vue.defineComponent({
|
|
|
31
31
|
},
|
|
32
32
|
unitName: {
|
|
33
33
|
type: String
|
|
34
|
+
},
|
|
35
|
+
showMode: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "DEFAULT"
|
|
34
38
|
}
|
|
35
39
|
},
|
|
36
40
|
emits: {
|
|
@@ -44,6 +48,13 @@ const IBizCodeList = /* @__PURE__ */ vue.defineComponent({
|
|
|
44
48
|
const items = vue.ref([]);
|
|
45
49
|
const textSeparator = ((_a = props.codeList) == null ? void 0 : _a.textSeparator) || "\u3001";
|
|
46
50
|
const valueSeparator = ((_b = props.codeList) == null ? void 0 : _b.valueSeparator) || ",";
|
|
51
|
+
const currentMode = vue.computed(() => {
|
|
52
|
+
if (props.codeList && props.codeList.orMode) {
|
|
53
|
+
return props.codeList.orMode;
|
|
54
|
+
}
|
|
55
|
+
return "STR";
|
|
56
|
+
});
|
|
57
|
+
const calcOrMode = runtime.useCalcOrMode(currentMode.value);
|
|
47
58
|
vue.watch(items, (newVal) => {
|
|
48
59
|
let infoText = "";
|
|
49
60
|
if (newVal.length > 0) {
|
|
@@ -78,7 +89,14 @@ const IBizCodeList = /* @__PURE__ */ vue.defineComponent({
|
|
|
78
89
|
if (ramda.isNil(value) || value === "") {
|
|
79
90
|
items.value = [];
|
|
80
91
|
} else {
|
|
81
|
-
|
|
92
|
+
let values = [];
|
|
93
|
+
const {
|
|
94
|
+
getSelectArray
|
|
95
|
+
} = calcOrMode;
|
|
96
|
+
const arr = getSelectArray(value, props.codeList, codeListItems, valueSeparator, props.codeList.codeItemValueNumber);
|
|
97
|
+
if (arr) {
|
|
98
|
+
values = arr;
|
|
99
|
+
}
|
|
82
100
|
items.value = values.map((val) => {
|
|
83
101
|
const findItem = findCodeListItem(codeListItems, val);
|
|
84
102
|
let codeValue = val;
|
|
@@ -124,9 +142,9 @@ const IBizCodeList = /* @__PURE__ */ vue.defineComponent({
|
|
|
124
142
|
"style": item.color ? this.ns.cssVarBlock({
|
|
125
143
|
"item-color": "".concat(item.color)
|
|
126
144
|
}) : null
|
|
127
|
-
}, [item.sysImage && vue.createVNode(vue.resolveComponent("iBizIcon"), {
|
|
145
|
+
}, [this.showMode !== "TEXT" && item.sysImage && vue.createVNode(vue.resolveComponent("iBizIcon"), {
|
|
128
146
|
"icon": item.sysImage
|
|
129
|
-
}, null), item.text])];
|
|
147
|
+
}, null), this.showMode !== "ICON" && item.text])];
|
|
130
148
|
})]);
|
|
131
149
|
}
|
|
132
150
|
});
|
|
@@ -34,12 +34,21 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
34
34
|
const provider = vue.ref();
|
|
35
35
|
const viewModelData = vue.ref();
|
|
36
36
|
const hasAuthority = vue.ref(true);
|
|
37
|
-
const
|
|
37
|
+
const context = vue.ref(props.context);
|
|
38
|
+
const params = vue.ref(props.params || {});
|
|
39
|
+
vue.watch(() => ({
|
|
40
|
+
context: props.context,
|
|
41
|
+
params: props.params
|
|
42
|
+
}), (newVal) => {
|
|
43
|
+
context.value = newVal.context;
|
|
44
|
+
params.value = newVal.params ? newVal.params : {};
|
|
45
|
+
});
|
|
46
|
+
const checkViewAuthority = async (viewModel2) => {
|
|
38
47
|
let checkResult = true;
|
|
39
48
|
const {
|
|
40
49
|
accUserMode,
|
|
41
50
|
accessKey
|
|
42
|
-
} =
|
|
51
|
+
} = viewModel2;
|
|
43
52
|
const authInfo = ibiz.auth.getAuthInfo();
|
|
44
53
|
if (accUserMode !== void 0) {
|
|
45
54
|
switch (accUserMode) {
|
|
@@ -55,7 +64,7 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
55
64
|
break;
|
|
56
65
|
case 4:
|
|
57
66
|
if (accessKey) {
|
|
58
|
-
const app = await ibiz.hub.getApp(
|
|
67
|
+
const app = await ibiz.hub.getApp(context.value.srfappid);
|
|
59
68
|
const permitted = app.authority.calcByResCode(accessKey);
|
|
60
69
|
if (!permitted) {
|
|
61
70
|
checkResult = false;
|
|
@@ -68,13 +77,16 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
68
77
|
}
|
|
69
78
|
return checkResult;
|
|
70
79
|
};
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
let viewModel;
|
|
81
|
+
const initViewModel = async () => {
|
|
73
82
|
if (props.modelData) {
|
|
74
83
|
viewModel = props.modelData;
|
|
75
84
|
} else {
|
|
76
85
|
viewModel = await ibiz.hub.getAppView(props.viewId);
|
|
77
86
|
}
|
|
87
|
+
};
|
|
88
|
+
const init = async () => {
|
|
89
|
+
await initViewModel();
|
|
78
90
|
if (!viewModel) {
|
|
79
91
|
throw new core.RuntimeError(ibiz.i18n.t("vue3Util.common.noFoundViewModel"));
|
|
80
92
|
}
|
|
@@ -89,30 +101,26 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
89
101
|
codeName: viewModel.codeName
|
|
90
102
|
}));
|
|
91
103
|
}
|
|
92
|
-
const
|
|
93
|
-
const loadModelParams = await runtime.calcDynaSysParams(appDataEntityId, props.context, {
|
|
104
|
+
const loadModelParams = await runtime.calcDynaSysParams(appDataEntityId, context.value, {
|
|
94
105
|
viewParams: params,
|
|
95
106
|
appId: viewModel.appId
|
|
96
107
|
});
|
|
97
|
-
if (params.srfdatatype) {
|
|
98
|
-
loadModelParams.srfdatatype = params.srfdatatype;
|
|
108
|
+
if (params.value.srfdatatype) {
|
|
109
|
+
loadModelParams.srfdatatype = params.value.srfdatatype;
|
|
99
110
|
}
|
|
100
|
-
if (params.srfwftag) {
|
|
101
|
-
loadModelParams.srfwftag = params.srfwftag;
|
|
111
|
+
if (params.value.srfwftag) {
|
|
112
|
+
loadModelParams.srfwftag = params.value.srfwftag;
|
|
102
113
|
} else if (appDataEntityId && viewModel.enableWF) {
|
|
103
|
-
const context = {
|
|
104
|
-
...props.context
|
|
105
|
-
};
|
|
106
114
|
if (loadModelParams.srfkey) {
|
|
107
|
-
const noSrfSessionId = ramda.isNil(
|
|
115
|
+
const noSrfSessionId = ramda.isNil(context.value.srfsessionid) || ramda.isEmpty(context.value.srfsessionid);
|
|
108
116
|
const id = qxUtil.createUUID();
|
|
109
117
|
if (noSrfSessionId) {
|
|
110
118
|
const domain = ibiz.uiDomainManager.create(id);
|
|
111
|
-
context.srfsessionid = domain.id;
|
|
119
|
+
context.value.srfsessionid = domain.id;
|
|
112
120
|
}
|
|
113
121
|
const app = ibiz.hub.getApp(viewModel.appId);
|
|
114
|
-
const service = await app.deService.getService(
|
|
115
|
-
const res = await service.get(context,
|
|
122
|
+
const service = await app.deService.getService(context.value, appDataEntityId);
|
|
123
|
+
const res = await service.get(context.value, params.value || {});
|
|
116
124
|
if (res.ok && res.data) {
|
|
117
125
|
const {
|
|
118
126
|
srfwftag,
|
|
@@ -123,12 +131,11 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
123
131
|
loadModelParams.srfwftag = srfwftag;
|
|
124
132
|
}
|
|
125
133
|
if (["DEWFDYNAEDITVIEW3", "DEWFDYNAEDITVIEW"].includes(viewModel.viewType)) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
viewParams.processDefinitionKey = processdefinitionkey;
|
|
134
|
+
if (ramda.isNil(params.value.processDefinitionKey)) {
|
|
135
|
+
params.value.processDefinitionKey = processdefinitionkey;
|
|
129
136
|
}
|
|
130
|
-
if (ramda.isNil(
|
|
131
|
-
|
|
137
|
+
if (ramda.isNil(params.value.taskDefinitionKey)) {
|
|
138
|
+
params.value.taskDefinitionKey = taskdefinitionkey;
|
|
132
139
|
}
|
|
133
140
|
}
|
|
134
141
|
}
|
|
@@ -151,23 +158,45 @@ const IBizViewShell = /* @__PURE__ */ vue.defineComponent({
|
|
|
151
158
|
}
|
|
152
159
|
};
|
|
153
160
|
init();
|
|
161
|
+
const redrawView = async (event) => {
|
|
162
|
+
isComplete.value = false;
|
|
163
|
+
const {
|
|
164
|
+
redrawData
|
|
165
|
+
} = event;
|
|
166
|
+
const {
|
|
167
|
+
isReloadModel
|
|
168
|
+
} = redrawData;
|
|
169
|
+
Object.assign(context.value, redrawData.context);
|
|
170
|
+
Object.assign(params.value, redrawData.params);
|
|
171
|
+
if (isReloadModel) {
|
|
172
|
+
await init();
|
|
173
|
+
} else {
|
|
174
|
+
setTimeout(() => {
|
|
175
|
+
isComplete.value = true;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
};
|
|
154
179
|
return {
|
|
155
180
|
ns,
|
|
156
|
-
isComplete,
|
|
157
181
|
errMsg,
|
|
158
|
-
|
|
182
|
+
provider,
|
|
183
|
+
isComplete,
|
|
159
184
|
hasAuthority,
|
|
160
|
-
|
|
185
|
+
viewModelData,
|
|
186
|
+
redrawView,
|
|
187
|
+
curContext: context,
|
|
188
|
+
curParams: params
|
|
161
189
|
};
|
|
162
190
|
},
|
|
163
191
|
render() {
|
|
164
192
|
if (this.isComplete && this.provider && this.hasAuthority) {
|
|
165
193
|
return vue.h(vue.resolveComponent(this.provider.component), {
|
|
166
|
-
context: this
|
|
167
|
-
params: this
|
|
168
|
-
modelData: this.viewModelData,
|
|
194
|
+
context: this.curContext,
|
|
195
|
+
params: this.curParams,
|
|
196
|
+
modelData: ramda.clone(this.viewModelData),
|
|
169
197
|
...this.$attrs,
|
|
170
|
-
provider: this.provider
|
|
198
|
+
provider: this.provider,
|
|
199
|
+
onRedrawView: this.redrawView
|
|
171
200
|
}, this.$slots);
|
|
172
201
|
}
|
|
173
202
|
if (!this.hasAuthority) {
|
|
@@ -93,9 +93,17 @@ const ViewLayoutPanelControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
93
93
|
const component = vue.resolveComponent(provider.component);
|
|
94
94
|
let children;
|
|
95
95
|
if (panelItem.itemType === "CTRLPOS" && slots[panelItem.id]) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
const panelItemC2 = panelItems[panelItem.id];
|
|
97
|
+
if (panelItemC2.parent && runtime.isSimpleDataContainer(panelItemC2.parent.model)) {
|
|
98
|
+
children = () => {
|
|
99
|
+
return slots[panelItem.id]({
|
|
100
|
+
isSimple: true,
|
|
101
|
+
data: panelItemC2.data
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
} else {
|
|
105
|
+
children = () => slots[panelItem.id]();
|
|
106
|
+
}
|
|
99
107
|
} else if (panelItem.itemType === "TABPANEL" && ((_a = panelItem.panelTabPages) == null ? void 0 : _a.length)) {
|
|
100
108
|
children = () => {
|
|
101
109
|
return panelItem.panelTabPages.map((child) => {
|