1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { IModal } from '@ibiz-template/runtime';
import { useAppPortalViewController } from '@ibiz-template/vue-util';
import { defineComponent, getCurrentInstance, PropType } from 'vue';
export const AppPortalView = defineComponent({
name: 'AppPortalView',
props: {
context: Object as PropType<IContext>,
params: { type: Object as PropType<IParams> },
modelPath: { type: String, required: true },
modal: { type: Object as PropType<IModal> },
noLoadDefault: { type: Boolean, required: false },
},
setup(props) {
const { proxy } = getCurrentInstance()!;
const c = useAppPortalViewController(proxy, props.modelPath);
return { c };
},
render(h) {
let dashboardComponent = null;
if (this.c.complete) {
const { dashboard } = this.c.model;
if (this.c.providers[dashboard.name]) {
dashboardComponent = h(this.c.providers[dashboard.name].component, {
props: {
modelData: dashboard,
context: this.c.context,
params: this.c.params,
},
on: {
neuronInit: this.c.nerve.onNeuronInit(dashboard.name),
},
});
}
}
return <view-base controller={this.c}>{dashboardComponent}</view-base>;
},
});