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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
var s = Object.defineProperty;
var i = (r, e, t) => e in r ? s(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
var o = (r, e, t) => (i(r, typeof e != "symbol" ? e + "" : e, t), t);
import { defineComponent as c, getCurrentInstance as a } from "vue";
import { useViewController as h } from "@ibiz-template/vue-util";
import { Neuron as l, ViewNerve as d, ViewController as u } from "@ibiz-template/controller";
class p extends l {
}
class m extends d {
constructor() {
super(...arguments);
o(this, "chart");
}
createNeuron() {
return new p(this.bindAbility());
}
inclusive(t) {
return t === "chart" || super.inclusive(t);
}
connect(t, n) {
super.connect(t, n), t === "chart" && (this.chart = n, this.chart.evt.on("destroyed", () => {
this.chart = void 0;
}));
}
destroy() {
super.destroy(), this.chart = void 0;
}
}
class v extends u {
createNerve() {
return new m(this);
}
async onInit() {
await super.onInit();
const { chart: e } = this.model;
e && (this.providers[e.name] = await ibiz.register.control.get(e)), this.nerve.self.evt.on("mounted", () => {
this.model.source.loadDefault && this.load();
});
}
/**
* 视图加载方法
*
* @return {*} {Promise<IData[]>}
* @memberof ChartViewController
*/
async load() {
const { chart: e } = this.nerve;
return e.call.load();
}
/**
* 刷新视图
*
* @author zhanghengfeng
* @date 2023-04-07 17:04:41
* @return {*} {Promise<void>}
*/
async refresh() {
this.load();
}
}
function f(r, e) {
return h(
r,
(t, n) => new v(e, t, n)
);
}
const V = c({
props: {
context: Object,
params: {
type: Object,
default: () => ({})
},
modelPath: {
type: String,
required: !0
},
modal: {
type: Object
}
},
setup(r) {
const {
proxy: e
} = a();
return {
c: f(e, r.modelPath)
};
},
render(r) {
let e = null;
if (this.c.complete) {
const {
chart: t
} = this.c.model;
this.c.providers[t.name] && (e = r(this.c.providers[t.name].component, {
props: {
modelData: t,
context: this.c.context,
params: this.c.params
},
on: {
neuronInit: this.c.nerve.onNeuronInit(t.name)
}
}));
}
return r("view-base", {
attrs: {
controller: this.c
}
}, [e]);
}
});
export {
V as default
};