提交 c3d6bd2d 编写于 作者: zhf's avatar zhf

feat: 更新图表插件

上级 b3ae2477
var P = Object.defineProperty;
var T = (l, d, e) => d in l ? P(l, d, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[d] = e;
var x = (l, d, e) => (T(l, typeof d != "symbol" ? d + "" : d, e), e);
import { defineComponent as I, getCurrentInstance as N, h as v } from "vue";
import { useControlController as z, useNamespace as D } from "@ibiz-template/vue-util";
import { ChartModel as M } from "@ibiz-template/model";
import { Neuron as j, ControlNerve as $, ControlController as R } from "@ibiz-template/controller";
import { createUUID as V } from "qx-util";
import { init as q } from "echarts";
import { mergeDeepRight as w } from "ramda";
import { ControlService as U } from "@ibiz-template/service";
class B extends j {
}
class X extends $ {
createNeuron() {
return new B(this.bindAbility());
}
bindAbility() {
return {
...super.bindAbility(),
load: this.controller.load.bind(this.controller)
};
}
}
function y(l) {
const d = {};
return l && Object.keys(l).forEach((e) => {
const s = e.indexOf(".");
if (s === -1)
return;
const r = e.slice(s + 1);
r && l[e] !== void 0 && (d[r] = JSON.parse(l[e]));
}), d;
}
function Y(l) {
var e;
const d = {};
if (l) {
d.show = l.showTitle, d.text = l.title, d.subtext = l.subTitle;
const s = (e = l.titlePos) == null ? void 0 : e.toLowerCase();
s === "left" || s === "right" ? d.left = s : (s === "bottom" || s === "top") && (d.left = "center", d.top = s);
}
return d;
}
function _(l) {
var e;
const d = {};
if (l) {
d.show = l.showLegend;
const s = (e = l.legendPos) == null ? void 0 : e.toLowerCase();
s === "left" || s === "right" ? (d.left = s, d.top = "middle", d.orient = "vertical") : s === "bottom" && (d.top = s);
}
return d;
}
function F(l) {
return {
axisLabel: {
formatter: (e) => l === 1 ? e.length > 4 ? `${e.slice(0, 4).split("").join(`
`)}
...` : e.split("").join(`
`) : l === 2 && e.length > 4 ? `${e.slice(0, 4)}...` : e,
rotate: l === 2 ? 45 : 0
}
};
}
function H(l) {
const d = [];
return l && l.length && l.forEach((e) => {
const { caption: s, minValue: r, maxValue: o, eChartsType: t, position: n } = e, a = {
name: s,
min: r,
max: o
};
Object.assign(a, {
type: t,
position: n,
...w(
F(e.dataShowMode),
y(e.userParams)
)
}), d.push(a);
}), d;
}
function J(l) {
const d = [];
return l && l.length && l.forEach((e) => {
const { caption: s, minValue: r, maxValue: o, eChartsType: t, position: n } = e, a = {
name: s,
min: r,
max: o
};
Object.assign(a, {
type: t,
position: n,
...w(
F(e.dataShowMode),
y(e.userParams)
)
}), d.push(a);
}), d;
}
class K extends U {
constructor(e) {
super(e);
/**
* 序列列表
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:38
* @type {IPSDEChartSeries[]}
*/
x(this, "seriesList", []);
const s = e.source.getPSDEChartSerieses();
if (!s || !s.length)
throw new Error("图表序列集合不能为空");
this.seriesList = s;
}
/**
* 获取数据
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:11
* @param {IContext} context
* @param {IParams} [params={}]
* @return {*} {Promise<IHttpResponse>}
*/
async fetch(e, s = {}) {
return await this.exec(this.model.fetchAction, e, s);
}
/**
* 获取所有代码表映射
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:21
* @param {IContext} context
* @param {IParams} params
* @return {*}
*/
async getAllCodeListMap(e, s) {
const r = [];
return await Promise.all(
this.seriesList.map(async (o, t) => {
var c, i, h, f;
const n = {}, a = (i = (c = o.getCatalogPSCodeList) == null ? void 0 : c.call(o)) == null ? void 0 : i.codeName, C = (f = (h = o.getSeriesPSCodeList) == null ? void 0 : h.call(o)) == null ? void 0 : f.codeName;
if (a) {
const p = await ibiz.codeListService.get(
a,
e,
s
);
if (p) {
const g = /* @__PURE__ */ new Map();
p.forEach((u) => {
g.set(u.value, u.text);
}), n.catalog = g;
}
}
if (C) {
const p = await ibiz.codeListService.get(
C,
e,
s
);
if (p) {
const g = /* @__PURE__ */ new Map();
p.forEach((u) => {
g.set(u.value, u.text);
}), n.series = g;
}
}
r[t] = n;
})
), r;
}
/**
* 生成数据集配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:37
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @return {*}
*/
generateDatasetOption(e, s, r) {
var c;
const o = {}, t = [];
o.source = t;
const n = e.catalogField.toLowerCase(), a = e.valueField.toLowerCase(), C = (c = e.seriesField) == null ? void 0 : c.toLowerCase();
if (C) {
const i = /* @__PURE__ */ new Set();
s.forEach((h) => {
i.add(h[C]);
}), t.push([n, ...i]);
} else
t.push([n, a]);
t.push(
...s.map((i) => t[0].map((h, f) => f === 0 ? (r && r.catalog ? r.catalog.get(i[h]) : i[h]) || "未定义" : C ? h === i[C] && i[a] || 0 : i[a] || 0))
), r && r.series && (t[0] = t[0].map((i, h) => {
var f;
return h === 0 ? i : ((f = r.series) == null ? void 0 : f.get(i)) || i;
}));
for (let i = 1; i < t.length; i++)
for (let h = i + 1; h < t.length; h++)
t[h][0] === t[i][0] && (t[h].forEach((f, p) => {
p !== 0 && (t[i][p] += f);
}), t.splice(h, 1), h -= 1);
return o;
}
/**
* 生成图表配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:49
* @param {IData[]} data
* @param {IContext} context
* @param {IParams} params
* @return {*}
*/
async generateChartOption(e, s, r) {
const o = {};
o.dataset = [], o.series = [];
const t = await this.getAllCodeListMap(s, r);
return this.seriesList.forEach((n, a) => {
if (n.eChartsType === "radar") {
const { series: c, radar: i } = this.generateRadarSeriesOption(
n,
e,
t[a]
);
Array.isArray(o.series) && o.series.push(...c), o.radar = i;
return;
}
const C = this.generateDatasetOption(n, e, t[a]);
if (Array.isArray(o.dataset) && o.dataset.push(C), n.eChartsType === "bar") {
const c = this.generateBarSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(o.series) && o.series.push(...c);
} else if (n.eChartsType === "line") {
const c = this.generateLineSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(o.series) && o.series.push(...c);
} else if (n.eChartsType === "pie") {
const c = this.generatePieSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(o.series) && o.series.push(...c);
} else if (n.eChartsType === "funnel") {
const c = this.generateFunnelSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(o.series) && o.series.push(...c);
} else if (n.eChartsType === "scatter") {
const c = this.generateScatterSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(o.series) && o.series.push(...c);
} else
throw new Error(`${n.eChartsType}类型的图表暂未实现`);
}), o;
}
/**
* 生成柱状图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:13
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateBarSeriesOption(e, s, r, o) {
var p, g, u, m, S, O, A;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), c = (p = e.seriesField) == null ? void 0 : p.toLowerCase(), i = +((m = (u = (g = e.M) == null ? void 0 : g.getPSChartSeriesEncode) == null ? void 0 : u.getPSChartXAxis) == null ? void 0 : m.id) || 0, h = +((A = (O = (S = e.M) == null ? void 0 : S.getPSChartSeriesEncode) == null ? void 0 : O.getPSChartYAxis) == null ? void 0 : A.id) || 0, f = {};
if (c) {
const E = /* @__PURE__ */ new Set();
s.forEach((L) => {
const b = L[c];
E.add(r && r.series && r.series.get(b) || b);
}), t.push(
...[...E].map((L) => ({
type: n,
xAxisIndex: i,
yAxisIndex: h,
name: L,
datasetIndex: o,
encode: {
x: a,
y: L
},
...w(
f,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
xAxisIndex: i,
yAxisIndex: h,
name: e.caption || e.id,
datasetIndex: o,
encode: {
x: a,
y: C
},
...w(
f,
y(e.userParams)
)
});
return t;
}
/**
* 生成折线图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:32
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateLineSeriesOption(e, s, r, o) {
var h;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), c = (h = e.seriesField) == null ? void 0 : h.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (c) {
const f = /* @__PURE__ */ new Set();
s.forEach((p) => {
const g = p[c];
f.add(r && r.series && r.series.get(g) || g);
}), t.push(
...[...f].map((p) => ({
type: n,
name: p,
datasetIndex: o,
encode: {
x: a,
y: p
},
stack: e.M.stack ? e.id : void 0,
step: e.M.step ? "middle" : !1,
...w(
i,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
name: e.caption || e.id,
datasetIndex: o,
encode: {
x: a,
y: C
},
...w(
i,
y(e.userParams)
)
});
return t;
}
/**
* 生成饼图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:44
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generatePieSeriesOption(e, s, r, o) {
var h;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), c = (h = e.seriesField) == null ? void 0 : h.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
formatter: "{b}: {d}%({@age})",
position: "outside",
show: !0
}
};
if (c) {
const f = /* @__PURE__ */ new Set();
s.forEach((p) => {
const g = p[c];
f.add(r && r.series && r.series.get(g) || g);
}), t.push(
...[...f].map((p) => ({
type: n,
name: p,
datasetIndex: o,
encode: {
itemName: a,
value: p
},
...w(
i,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
name: e.caption || e.id,
datasetIndex: o,
encode: {
itemName: a,
value: C
},
...w(
i,
y(e.userParams)
)
});
return t;
}
/**
* 生成漏斗图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:03
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateFunnelSeriesOption(e, s, r, o) {
var h;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), c = (h = e.seriesField) == null ? void 0 : h.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
formatter: "{b}: {d}%({@age})",
position: "outside",
show: !0
}
};
if (c) {
const f = /* @__PURE__ */ new Set();
s.forEach((p) => {
const g = p[c];
f.add(r && r.series && r.series.get(g) || g);
}), t.push(
...[...f].map((p) => ({
type: n,
name: p,
datasetIndex: o,
encode: {
itemName: a,
value: p
},
...w(
i,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
name: e.caption || e.id,
datasetIndex: o,
encode: {
itemName: a,
value: C
},
...w(
i,
y(e.userParams)
)
});
return t;
}
/**
* 生成散点图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:25
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateScatterSeriesOption(e, s, r, o) {
var h;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), c = (h = e.seriesField) == null ? void 0 : h.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (c) {
const f = /* @__PURE__ */ new Set();
s.forEach((p) => {
const g = p[c];
f.add(r && r.series && r.series.get(g) || g);
}), t.push(
...[...f].map((p) => ({
type: n,
name: p,
datasetIndex: o,
encode: {
x: a,
y: p
},
...w(
i,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
name: e.caption || e.id,
datasetIndex: o,
encode: {
x: a,
y: C
},
...w(
i,
y(e.userParams)
)
});
return t;
}
/**
* 生成雷达图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:47
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @return {*}
*/
generateRadarSeriesOption(e, s, r) {
var g;
const o = [], t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), c = (g = e.seriesField) == null ? void 0 : g.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (c) {
const u = /* @__PURE__ */ new Set();
s.forEach((m) => {
u.add(m[c]);
}), t.push([a, ...u]);
} else
t.push([a, C]);
t.push(
...s.map((u) => t[0].map((m, S) => S === 0 ? (r && r.catalog ? r.catalog.get(u[m]) : u[m]) || "未定义" : c ? m === u[c] ? u[C] : 0 : u[C]))
), r && r.series && (t[0] = t[0].map((u, m) => {
var S;
return m === 0 ? u : ((S = r.series) == null ? void 0 : S.get(u)) || u;
}));
for (let u = 1; u < t.length; u++)
for (let m = u + 1; m < t.length; m++)
t[m][0] === t[u][0] && (t[m].forEach((S, O) => {
O !== 0 && (t[u][O] += S);
}), t.splice(m, 1), m -= 1);
const h = t[0].slice(1).map((u, m) => t.slice(1).map((S) => S[m + 1]));
o.push({
type: n,
name: e.caption || e.id,
data: h,
...w(i, y(e.userParams))
});
let f = -1 / 0;
h.forEach((u) => {
u.forEach((m) => {
+m > f && (f = +m);
});
});
const p = t.slice(1).map((u) => ({
name: u[0],
max: f
}));
return {
series: o,
radar: {
indicator: p
}
};
}
}
class W extends R {
constructor() {
super(...arguments);
/**
* 图表实例
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:45
* @type {(EChartsType | null)}
*/
x(this, "chart", null);
/**
* 图表id
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:22
* @type {string}
*/
x(this, "chartId", `chart_${V()}`);
/**
* 图表静态配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:32
* @type {EChartsOption}
*/
x(this, "chartStaticOption", {});
}
/**
* 创建图表神经系统
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:24
* @protected
* @return {*} {ChartNerve}
*/
createNerve() {
return new X(this);
}
/**
* 初始化配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:41
* @protected
* @return {*} {Promise<void>}
*/
async onInit() {
await super.onInit(), this.service = new K(this.model), await this.service.init(this.context), this.initChartStaticOption(), this.resizeChart = this.resizeChart.bind(this), window.addEventListener("resize", this.resizeChart);
}
/**
* 重新渲染图表
*
* @author zhanghengfeng
* @date 2023-04-03 18:04:35
*/
resizeChart() {
var e;
(e = this.chart) == null || e.resize();
}
/**
* 初始化图表静态配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:52
*/
initChartStaticOption() {
const e = {}, s = this.model.source.getPSDEChartTitle();
e.title = s ? Y(s) : {}, e.tooltip = {
show: !0
};
const r = this.model.source.getPSDEChartSerieses();
r && r.length && r[0].eChartsType === "bar" && (e.grid = {
top: 41,
bottom: 5,
left: 13,
right: 13,
containLabel: !0
}, e.tooltip = {
show: !0,
padding: 0,
backgroundColor: "rgba(255, 255, 255, 0)",
borderWidth: 0,
className: "chart-tooltip",
borderRadius: 6,
extraCssText: "box-shadow: none;",
formatter: (a) => {
const { seriesName: C, dimensionNames: c, value: i } = a, h = document.createElement("div");
return h.classList.add("chart-tooltip-container"), Array.isArray(c) && Array.isArray(i) && c.length >= 2 && c.length === i.length ? (h.innerHTML = `
<div class='chart-tooltip-title'>${i[0]}</div>
${c.slice(1).map((f, p) => `
<div class='chart-tooltip-item'>
<div class='chart-tooltip-item-name'>${c.length === 2 ? C : f}</div>
<div class='chart-tooltip-item-number'>${i[p + 1]}</div>
</div>
`).join("")}
`, h) : C;
}
});
const o = this.model.source.getPSDEChartLegend();
e.legend = o ? _(o) : {};
const t = this.model.source.getPSChartXAxises();
e.xAxis = t ? H(t) : [];
const n = this.model.source.getPSChartYAxises();
e.yAxis = n ? J(n) : [], Object.assign(
this.chartStaticOption,
w(e, y(this.model.source.userParams))
);
}
/**
* 加载数据
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:13
* @param {IParams} params
*/
async load() {
await this.startLoading();
try {
const { data: e } = await this.service.fetch(this.context, this.params);
if (Array.isArray(e) && e.length) {
if (!this.chart) {
const r = document.querySelector(`#${this.chartId}`);
if (!r)
throw new Error("未找到ECharts绘制容器元素");
this.chart = q(r);
}
const s = await this.service.generateChartOption(
e,
this.context,
this.params
);
this.chart.setOption({
...this.chartStaticOption,
...s
});
}
} finally {
await this.endLoading();
}
}
destroy() {
var e;
super.destroy(), (e = this.chart) == null || e.dispose(), window.removeEventListener("resize", this.resizeChart);
}
}
function G(l, d, e, s = {}) {
return z(l, () => new W(d, e, s));
}
const ae = I({
name: "ChartControl",
props: {
modelData: {
type: M,
required: !0
},
context: {
type: Object,
required: !0
},
params: {
type: Object,
default: () => ({})
}
},
setup(l) {
const {
proxy: d
} = N(), e = D("chart"), s = G(d, l.modelData, l.context, l.params);
return s.initChartStaticOption(), {
c: s,
ns: e
};
},
render() {
if (this.c.complete)
return v("control-layout", {
attrs: {
modelData: this.c.model
}
}, [v("div", {
class: this.ns.b()
}, [v("div", {
attrs: {
id: this.c.chartId
},
class: this.ns.b("content")
})])]);
}
});
export {
ae as default
};
var F = Object.defineProperty;
var T = (l, d, e) => d in l ? F(l, d, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[d] = e;
var O = (l, d, e) => (T(l, typeof d != "symbol" ? d + "" : d, e), e);
import { defineComponent as I, getCurrentInstance as N, h as b } from "vue";
import { useControlController as z, useNamespace as D } from "@ibiz-template/vue-util";
import { ChartModel as M } from "@ibiz-template/model";
import { Neuron as j, ControlNerve as $, ControlController as q } from "@ibiz-template/controller";
import { createUUID as R } from "qx-util";
import { init as V } from "echarts";
import { mergeDeepRight as w } from "ramda";
import { ControlService as U } from "@ibiz-template/service";
class B extends j {
}
class X extends $ {
createNeuron() {
return new B(this.bindAbility());
}
bindAbility() {
return {
...super.bindAbility(),
load: this.controller.load.bind(this.controller)
};
}
}
function y(l) {
const d = {};
return l && Object.keys(l).forEach((e) => {
const s = e.indexOf(".");
if (s === -1)
return;
const o = e.slice(s + 1);
o && l[e] !== void 0 && (d[o] = JSON.parse(l[e]));
}), d;
}
function Y(l) {
var e;
const d = {};
if (l) {
d.show = l.showTitle, d.text = l.title, d.subtext = l.subTitle;
const s = (e = l.titlePos) == null ? void 0 : e.toLowerCase();
s === "left" || s === "right" ? d.left = s : (s === "bottom" || s === "top") && (d.left = "center", d.top = s);
}
return d;
}
function _(l) {
var e;
const d = {};
if (l) {
d.show = l.showLegend;
const s = (e = l.legendPos) == null ? void 0 : e.toLowerCase();
s === "left" || s === "right" ? (d.left = s, d.top = "middle", d.orient = "vertical") : s === "bottom" && (d.top = s);
}
return d;
}
function P(l) {
return {
axisLabel: {
formatter: (e) => l === 1 ? e.length > 4 ? `${e.slice(0, 4).split("").join(`
`)}
...` : e.split("").join(`
`) : l === 2 && e.length > 4 ? `${e.slice(0, 4)}...` : e,
rotate: l === 2 ? 45 : 0
}
};
}
function H(l) {
const d = [];
return l && l.length && l.forEach((e) => {
const { caption: s, minValue: o, maxValue: r, eChartsType: t, position: n } = e, a = {
name: s,
min: o,
max: r
};
Object.assign(a, {
type: t,
position: n,
...w(
P(e.dataShowMode),
y(e.userParams)
)
}), d.push(a);
}), d;
}
function J(l) {
const d = [];
return l && l.length && l.forEach((e) => {
const { caption: s, minValue: o, maxValue: r, eChartsType: t, position: n } = e, a = {
name: s,
min: o,
max: r
};
Object.assign(a, {
type: t,
position: n,
...w(
P(e.dataShowMode),
y(e.userParams)
)
}), d.push(a);
}), d;
}
class K extends U {
constructor(e) {
super(e);
/**
* 序列列表
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:38
* @type {IPSDEChartSeries[]}
*/
O(this, "seriesList", []);
const s = e.source.getPSDEChartSerieses();
if (!s || !s.length)
throw new Error("图表序列集合不能为空");
this.seriesList = s;
}
/**
* 获取数据
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:11
* @param {IContext} context
* @param {IParams} [params={}]
* @return {*} {Promise<IHttpResponse>}
*/
async fetch(e, s = {}) {
return await this.exec(this.model.fetchAction, e, s);
}
/**
* 获取所有代码表映射
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:21
* @param {IContext} context
* @param {IParams} params
* @return {*}
*/
async getAllCodeListMap(e, s) {
const o = [];
return await Promise.all(
this.seriesList.map(async (r, t) => {
var c, i, h, f;
const n = {}, a = (i = (c = r.getCatalogPSCodeList) == null ? void 0 : c.call(r)) == null ? void 0 : i.codeName, m = (f = (h = r.getSeriesPSCodeList) == null ? void 0 : h.call(r)) == null ? void 0 : f.codeName;
if (a) {
const u = await ibiz.codeListService.get(
a,
e,
s
);
if (u) {
const g = /* @__PURE__ */ new Map();
u.forEach((p) => {
g.set(p.value, p.text);
}), n.catalog = g;
}
}
if (m) {
const u = await ibiz.codeListService.get(
m,
e,
s
);
if (u) {
const g = /* @__PURE__ */ new Map();
u.forEach((p) => {
g.set(p.value, p.text);
}), n.series = g;
}
}
o[t] = n;
})
), o;
}
/**
* 生成数据集配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:37
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @return {*}
*/
generateDatasetOption(e, s, o) {
var c;
const r = {}, t = [];
r.source = t;
const n = e.catalogField.toLowerCase(), a = e.valueField.toLowerCase(), m = (c = e.seriesField) == null ? void 0 : c.toLowerCase();
if (m) {
const i = /* @__PURE__ */ new Set();
s.forEach((h) => {
i.add(h[m]);
}), t.push([n, ...i]);
} else
t.push([n, a]);
t.push(
...s.map((i) => t[0].map((h, f) => f === 0 ? (o && o.catalog ? o.catalog.get(i[h]) : i[h]) || "未定义" : m ? h === i[m] && i[a] || 0 : i[a] || 0))
), o && o.series && (t[0] = t[0].map((i, h) => {
var f;
return h === 0 ? i : ((f = o.series) == null ? void 0 : f.get(i)) || i;
}));
for (let i = 1; i < t.length; i++)
for (let h = i + 1; h < t.length; h++)
t[h][0] === t[i][0] && (t[h].forEach((f, u) => {
u !== 0 && (t[i][u] += f);
}), t.splice(h, 1), h -= 1);
return r;
}
/**
* 生成图表配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:49
* @param {IData[]} data
* @param {IContext} context
* @param {IParams} params
* @return {*}
*/
async generateChartOption(e, s, o) {
const r = {};
r.dataset = [], r.series = [];
const t = await this.getAllCodeListMap(s, o);
return this.seriesList.forEach((n, a) => {
if (n.eChartsType === "radar") {
const { series: c, radar: i } = this.generateRadarSeriesOption(
n,
e,
t[a]
);
Array.isArray(r.series) && r.series.push(...c), r.radar = i;
return;
}
const m = this.generateDatasetOption(n, e, t[a]);
if (Array.isArray(r.dataset) && r.dataset.push(m), n.eChartsType === "bar") {
const c = this.generateBarSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(r.series) && r.series.push(...c);
} else if (n.eChartsType === "line") {
const c = this.generateLineSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(r.series) && r.series.push(...c);
} else if (n.eChartsType === "pie") {
const c = this.generatePieSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(r.series) && r.series.push(...c);
} else if (n.eChartsType === "funnel") {
const c = this.generateFunnelSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(r.series) && r.series.push(...c);
} else if (n.eChartsType === "scatter") {
const c = this.generateScatterSeriesOption(
n,
e,
t[a],
a
);
Array.isArray(r.series) && r.series.push(...c);
} else
throw new Error(`${n.eChartsType}类型的图表暂未实现`);
}), r;
}
/**
* 生成柱状图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:13
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateBarSeriesOption(e, s, o, r) {
var u, g, p, C, S, x, A;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), m = e.valueField.toLowerCase(), c = (u = e.seriesField) == null ? void 0 : u.toLowerCase(), i = +((C = (p = (g = e.M) == null ? void 0 : g.getPSChartSeriesEncode) == null ? void 0 : p.getPSChartXAxis) == null ? void 0 : C.id) || 0, h = +((A = (x = (S = e.M) == null ? void 0 : S.getPSChartSeriesEncode) == null ? void 0 : x.getPSChartYAxis) == null ? void 0 : A.id) || 0, f = {};
if (c) {
const E = /* @__PURE__ */ new Set();
s.forEach((L) => {
const v = L[c];
E.add(o && o.series && o.series.get(v) || v);
}), t.push(
...[...E].map((L) => ({
type: n,
xAxisIndex: i,
yAxisIndex: h,
name: L,
datasetIndex: r,
encode: {
x: a,
y: L
},
...w(
f,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
xAxisIndex: i,
yAxisIndex: h,
name: e.caption || e.id,
datasetIndex: r,
encode: {
x: a,
y: m
},
...w(
f,
y(e.userParams)
)
});
return t;
}
/**
* 生成折线图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:32
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateLineSeriesOption(e, s, o, r) {
var h;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), m = e.valueField.toLowerCase(), c = (h = e.seriesField) == null ? void 0 : h.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (c) {
const f = /* @__PURE__ */ new Set();
s.forEach((u) => {
const g = u[c];
f.add(o && o.series && o.series.get(g) || g);
}), t.push(
...[...f].map((u) => ({
type: n,
name: u,
datasetIndex: r,
encode: {
x: a,
y: u
},
stack: e.M.stack ? e.id : void 0,
step: e.M.step ? "middle" : !1,
...w(
i,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
name: e.caption || e.id,
datasetIndex: r,
encode: {
x: a,
y: m
},
...w(
i,
y(e.userParams)
)
});
return t;
}
/**
* 生成饼图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:44
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generatePieSeriesOption(e, s, o, r) {
var h;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), m = e.valueField.toLowerCase(), c = (h = e.seriesField) == null ? void 0 : h.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
formatter: "{b}: {d}%({@age})",
position: "outside",
show: !0
}
};
if (c) {
const f = /* @__PURE__ */ new Set();
s.forEach((u) => {
const g = u[c];
f.add(o && o.series && o.series.get(g) || g);
}), t.push(
...[...f].map((u) => ({
type: n,
name: u,
datasetIndex: r,
encode: {
itemName: a,
value: u
},
...w(
i,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
name: e.caption || e.id,
datasetIndex: r,
encode: {
itemName: a,
value: m
},
...w(
i,
y(e.userParams)
)
});
return t;
}
/**
* 生成漏斗图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:03
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateFunnelSeriesOption(e, s, o, r) {
var h;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), m = e.valueField.toLowerCase(), c = (h = e.seriesField) == null ? void 0 : h.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
formatter: "{b}: {d}%({@age})",
position: "outside",
show: !0
}
};
if (c) {
const f = /* @__PURE__ */ new Set();
s.forEach((u) => {
const g = u[c];
f.add(o && o.series && o.series.get(g) || g);
}), t.push(
...[...f].map((u) => ({
type: n,
name: u,
datasetIndex: r,
encode: {
itemName: a,
value: u
},
...w(
i,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
name: e.caption || e.id,
datasetIndex: r,
encode: {
itemName: a,
value: m
},
...w(
i,
y(e.userParams)
)
});
return t;
}
/**
* 生成散点图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:25
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateScatterSeriesOption(e, s, o, r) {
var h;
const t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), m = e.valueField.toLowerCase(), c = (h = e.seriesField) == null ? void 0 : h.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (c) {
const f = /* @__PURE__ */ new Set();
s.forEach((u) => {
const g = u[c];
f.add(o && o.series && o.series.get(g) || g);
}), t.push(
...[...f].map((u) => ({
type: n,
name: u,
datasetIndex: r,
encode: {
x: a,
y: u
},
...w(
i,
y(e.userParams)
)
}))
);
} else
t.push({
type: n,
name: e.caption || e.id,
datasetIndex: r,
encode: {
x: a,
y: m
},
...w(
i,
y(e.userParams)
)
});
return t;
}
/**
* 生成雷达图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:47
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @return {*}
*/
generateRadarSeriesOption(e, s, o) {
var g;
const r = [], t = [], n = e.eChartsType, a = e.catalogField.toLowerCase(), m = e.valueField.toLowerCase(), c = (g = e.seriesField) == null ? void 0 : g.toLowerCase(), i = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (c) {
const p = /* @__PURE__ */ new Set();
s.forEach((C) => {
p.add(C[c]);
}), t.push([a, ...p]);
} else
t.push([a, m]);
t.push(
...s.map((p) => t[0].map((C, S) => S === 0 ? (o && o.catalog ? o.catalog.get(p[C]) : p[C]) || "未定义" : c ? C === p[c] ? p[m] : 0 : p[m]))
), o && o.series && (t[0] = t[0].map((p, C) => {
var S;
return C === 0 ? p : ((S = o.series) == null ? void 0 : S.get(p)) || p;
}));
for (let p = 1; p < t.length; p++)
for (let C = p + 1; C < t.length; C++)
t[C][0] === t[p][0] && (t[C].forEach((S, x) => {
x !== 0 && (t[p][x] += S);
}), t.splice(C, 1), C -= 1);
const h = t[0].slice(1).map((p, C) => t.slice(1).map((S) => S[C + 1]));
r.push({
type: n,
name: e.caption || e.id,
data: h,
...w(i, y(e.userParams))
});
let f = -1 / 0;
h.forEach((p) => {
p.forEach((C) => {
+C > f && (f = +C);
});
});
const u = t.slice(1).map((p) => ({
name: p[0],
max: f
}));
return {
series: r,
radar: {
indicator: u
}
};
}
}
class W extends q {
constructor() {
super(...arguments);
/**
* 图表实例
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:45
* @type {(EChartsType | null)}
*/
O(this, "chart", null);
/**
* 图表id
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:22
* @type {string}
*/
O(this, "chartId", `chart_${R()}`);
/**
* 图表静态配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:32
* @type {EChartsOption}
*/
O(this, "chartStaticOption", {});
/**
* 数据集合
*
* @author zhanghengfeng
* @date 2023-04-07 16:04:34
* @type {IData[]}
*/
O(this, "items", []);
/**
* 请求参数
*
* @author zhanghengfeng
* @date 2023-04-07 16:04:28
*/
O(this, "queryParams", {
page: 0,
size: 1e3,
query: ""
});
}
/**
* 创建图表神经系统
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:24
* @protected
* @return {*} {ChartNerve}
*/
createNerve() {
return new X(this);
}
/**
* 初始化配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:41
* @protected
* @return {*} {Promise<void>}
*/
async onInit() {
await super.onInit(), this.service = new K(this.model), await this.service.init(this.context), this.initChartStaticOption(), this.resizeChart = this.resizeChart.bind(this), window.addEventListener("resize", this.resizeChart);
}
/**
* 重新渲染图表
*
* @author zhanghengfeng
* @date 2023-04-03 18:04:35
*/
resizeChart() {
var e;
(e = this.chart) == null || e.resize();
}
/**
* 初始化图表静态配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:52
*/
initChartStaticOption() {
const e = {}, s = this.model.source.getPSDEChartTitle();
e.title = s ? Y(s) : {}, e.tooltip = {
show: !0
};
const o = this.model.source.getPSDEChartSerieses();
o && o.length && o[0].eChartsType === "bar" && (e.grid = {
top: 41,
bottom: 5,
left: 13,
right: 13,
containLabel: !0
}, e.tooltip = {
show: !0,
padding: 0,
backgroundColor: "rgba(255, 255, 255, 0)",
borderWidth: 0,
className: "chart-tooltip",
borderRadius: 6,
extraCssText: "box-shadow: none;",
formatter: (a) => {
const { seriesName: m, dimensionNames: c, value: i } = a, h = document.createElement("div");
return h.classList.add("chart-tooltip-container"), Array.isArray(c) && Array.isArray(i) && c.length >= 2 && c.length === i.length ? (h.innerHTML = `
<div class='chart-tooltip-title'>${i[0]}</div>
${c.slice(1).map((f, u) => `
<div class='chart-tooltip-item'>
<div class='chart-tooltip-item-name'>${c.length === 2 ? m : f}</div>
<div class='chart-tooltip-item-number'>${i[u + 1]}</div>
</div>
`).join("")}
`, h) : m;
}
});
const r = this.model.source.getPSDEChartLegend();
e.legend = r ? _(r) : {};
const t = this.model.source.getPSChartXAxises();
e.xAxis = t ? H(t) : [];
const n = this.model.source.getPSChartYAxises();
e.yAxis = n ? J(n) : [], Object.assign(
this.chartStaticOption,
w(e, y(this.model.source.userParams))
);
}
/**
* 加载数据
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:13
* @param {IParams} params
*/
async load() {
var e;
await this.startLoading();
try {
const { data: s } = await this.service.fetch(this.context, {
...this.params,
...this.queryParams
});
if (Array.isArray(s) && s.length) {
if (this.items = s, !this.chart) {
const r = document.querySelector(`#${this.chartId}`);
if (!r)
throw new Error("未找到ECharts绘制容器元素");
this.chart = V(r);
}
const o = await this.service.generateChartOption(
s,
this.context,
this.params
);
this.chart.setOption({
...this.chartStaticOption,
...o
});
} else
this.items = [], (e = this.chart) == null || e.clear();
} finally {
await this.endLoading();
}
}
destroy() {
var e;
super.destroy(), (e = this.chart) == null || e.dispose(), window.removeEventListener("resize", this.resizeChart);
}
}
function G(l, d, e, s = {}) {
return z(l, () => new W(d, e, s));
}
const ae = I({
name: "ChartControl",
props: {
modelData: {
type: M,
required: !0
},
context: {
type: Object,
required: !0
},
params: {
type: Object,
default: () => ({})
}
},
setup(l) {
const {
proxy: d
} = N(), e = D("chart"), s = G(d, l.modelData, l.context, l.params);
return s.initChartStaticOption(), {
c: s,
ns: e
};
},
render() {
if (this.c.complete)
return b("control-layout", {
attrs: {
modelData: this.c.model
}
}, [b("div", {
class: this.ns.b()
}, [b("div", {
attrs: {
id: this.c.chartId
},
class: this.ns.b("content")
}), this.c.items.length ? null : b("div", {
class: this.ns.b("empty-content")
}, ["暂无数据"])])]);
}
});
export {
ae as default
};
import { ChartPortletModel as s } from "@ibiz-template/model";
import { useNamespace as l } from "@ibiz-template/vue-util";
import { defineComponent as m, h as o } from "vue";
import { C as c } from "./index-42d80035.js";
import "@ibiz-template/runtime";
import "@ibiz-template/controller";
const f = m({
name: "ChartPortlet",
props: {
modelData: {
type: s,
required: !0
},
controller: {
type: c,
required: !0
}
},
setup() {
return {
ns: l("chart-portlet")
};
},
render() {
const t = this.controller;
let r = null;
const {
chart: e
} = t.model;
t.chartProvider && (r = o(t.chartProvider.component, {
props: {
modelData: e,
context: t.context,
params: t.params
},
on: {
neuronInit: (a) => {
t.setChartNeuron(a);
}
}
}));
const n = [this.ns.b(), this.ns.m(this.modelData.modelClass)];
return o("portlet-layout", {
attrs: {
controller: this.controller
},
class: n
}, [r]);
}
});
export {
f as default
};
System.register(["@ibiz-template/model","@ibiz-template/vue-util","vue","./index.legacy2.js","@ibiz-template/runtime","@ibiz-template/controller"],(function(t,e){"use strict";var r,n,o,l,a;return{setters:[function(t){r=t.ChartPortletModel},function(t){n=t.useNamespace},function(t){o=t.defineComponent,l=t.h},function(t){a=t.C},null,null],execute:function(){t("default",o({name:"ChartPortlet",props:{modelData:{type:r,required:!0},controller:{type:a,required:!0}},setup:function(){return{ns:n("chart-portlet")}},render:function(){var t=this.controller,e=null,r=t.model.chart;t.chartProvider&&(e=l(t.chartProvider.component,{props:{modelData:r,context:t.context,params:t.params},on:{neuronInit:function(e){t.setChartNeuron(e)}}}));var n=[this.ns.b(),this.ns.m(this.modelData.modelClass)];return l("portlet-layout",{attrs:{controller:this.controller},class:n},[e])}}))}}}));
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 l } from "@ibiz-template/vue-util";
import { Neuron as h, ViewNerve as u, ViewController as d } from "@ibiz-template/controller";
class p extends h {
}
class m extends u {
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 d {
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();
}
}
function f(r, e) {
return l(
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
};
var i = Object.defineProperty; import "@ibiz-template/model";
var n = (r, t, e) => t in r ? i(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e; import { i as p } from "./index-42d80035.js";
var o = (r, t, e) => (n(r, typeof t != "symbol" ? t + "" : t, e), e); import "@ibiz-template/runtime";
import { ControlType as s, ViewType as a } from "@ibiz-template/model"; import "@ibiz-template/controller";
import { PluginStaticResource as l } from "@ibiz-template/runtime";
const m = new l(import.meta.url);
class c {
constructor() {
o(this, "component", "ChartControl");
}
}
class p {
constructor() {
o(this, "component", "ChartView");
}
}
const d = {
mateUrl: import.meta.url,
install(r) {
m.loadStyle(["/style.css"]), r.component(
"ChartControl",
() => import("./chart-control-82e4972f.js")
), ibiz.register.control.register(s.CHART, new c()), r.component(
"ChartView",
() => import("./chart-view-2e05f0a8.js")
), ibiz.register.view.register(
a.DE_CHART_VIEW,
new p()
);
}
};
export { export {
d as default p as default
}; };
var n = Object.defineProperty;
var s = (t, e, r) => e in t ? n(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
var o = (t, e, r) => (s(t, typeof e != "symbol" ? e + "" : e, r), r);
import { ControlType as c, ViewType as l } from "@ibiz-template/model";
import { PluginStaticResource as h } from "@ibiz-template/runtime";
import { PortletPartController as m } from "@ibiz-template/controller";
const C = new h(import.meta.url);
class p {
constructor() {
o(this, "component", "ChartControl");
}
}
class d {
constructor() {
o(this, "component", "ChartView");
}
}
class w extends m {
constructor() {
super(...arguments);
/**
* 图表神经元
*
* @author zhanghengfeng
* @date 2023-10-30 19:10:58
* @type {ChartNeuron}
*/
o(this, "chart");
/**
* 图表适配器
*
* @author zhanghengfeng
* @date 2023-10-30 19:10:22
* @type {IControlProvider}
*/
o(this, "chartProvider");
}
async onInit() {
await super.onInit();
const { chart: r } = this.model;
r && (this.chartProvider = await ibiz.register.control.get(r));
}
/**
* 设置图表神经元
*
* @author zhanghengfeng
* @date 2023-10-30 19:10:45
* @param {ChartNeuron} neuron
*/
setChartNeuron(r) {
this.chart = r, this.chart.evt.on("mounted", () => {
var i;
(i = this.chart) == null || i.call.load();
}), this.chart.evt.on("destroyed", () => {
this.chart = void 0;
});
}
}
class P {
constructor() {
o(this, "component", "ChartPortlet");
}
async createController(e, r, i) {
const a = new w(
e,
r,
i
);
return await a.init(), a;
}
}
const T = {
mateUrl: import.meta.url,
install(t) {
C.loadStyle(["/style.css"]), t.component(
"ChartControl",
() => import("./chart-control-82e4972f.js")
), ibiz.register.control.register(c.CHART, new p()), t.component(
"ChartView",
() => import("./chart-view-2e05f0a8.js")
), ibiz.register.view.register(
l.DE_CHART_VIEW,
new d()
), t.component(
"ChartPortlet",
() => import("./chart-portlet-54877294.js")
), ibiz.register.portletPart.register("CHART", new P());
}
};
export {
w as C,
T as i
};
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}System.register(["@ibiz-template/model","@ibiz-template/runtime"],(function(t,e){"use strict";var i,u,c;return{setters:[function(t){i=t.ControlType,u=t.ViewType},function(t){c=t.PluginStaticResource}],execute:function(){var l=new c(e.meta.url),a=r((function t(){n(this,t),o(this,"component","ChartControl")})),f=r((function t(){n(this,t),o(this,"component","ChartView")}));t("default",{mateUrl:e.meta.url,install:function(t){l.loadStyle(["/style.css"]),t.component("ChartControl",(function(){return e.import("./chart-control.legacy.js")})),ibiz.register.control.register(i.CHART,new a),t.component("ChartView",(function(){return e.import("./chart-view.legacy.js")})),ibiz.register.view.register(u.DE_CHART_VIEW,new f)}})}}}))}(); System.register(["@ibiz-template/model","./index.legacy2.js","@ibiz-template/runtime","@ibiz-template/controller"],(function(e,t){"use strict";return{setters:[null,function(t){e("default",t.i)},null,null],execute:function(){}}}));
!function(){function t(r){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(r)}function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return e};var e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},c="function"==typeof Symbol?Symbol:{},a=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{f({},"")}catch(k){f=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof y?r:y,c=Object.create(o.prototype),a=new _(n||[]);return i(c,"_invoke",{value:j(t,e,a)}),c}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(k){return{type:"throw",arg:k}}}e.wrap=s;var p={};function y(){}function v(){}function d(){}var m={};f(m,a,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(S([])));b&&b!==n&&o.call(b,a)&&(m=b);var w=d.prototype=y.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(r){f(t,r,(function(t){return this._invoke(r,t)}))}))}function O(r,e){function n(i,c,a,u){var l=h(r[i],r,c);if("throw"!==l.type){var f=l.arg,s=f.value;return s&&"object"==t(s)&&o.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(l.arg)}var c;i(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return c=c?c.then(o,o):o()}})}function j(t,r,e){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return C()}for(e.method=o,e.arg=i;;){var c=e.delegate;if(c){var a=P(c,e);if(a){if(a===p)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=h(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}function P(t,r){var e=r.method,n=t.iterator[e];if(void 0===n)return r.delegate=null,"throw"===e&&t.iterator.return&&(r.method="return",r.arg=void 0,P(t,r),"throw"===r.method)||"return"!==e&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+e+"' method")),p;var o=h(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function E(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function L(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function S(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function r(){for(;++e<t.length;)if(o.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r};return n.next=n}}return{next:C}}function C(){return{value:void 0,done:!0}}return v.prototype=d,i(w,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:v,configurable:!0}),v.displayName=f(d,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===v||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,f(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},x(O.prototype),f(O.prototype,u,(function(){return this})),e.AsyncIterator=O,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var c=new O(s(t,r,n,o),i);return e.isGeneratorFunction(r)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},x(w),f(w,l,"Generator"),f(w,a,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=S,_.prototype={constructor:_,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function e(e,n){return c.type="throw",c.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],c=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=r,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(c)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),p},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),L(e),p}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;L(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:S(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),p}},e}function e(t,r,e,n,o,i,c){try{var a=t[i](c),u=a.value}catch(l){return void e(l)}a.done?r(u):Promise.resolve(u).then(n,o)}function n(t){return function(){var r=this,n=arguments;return new Promise((function(o,i){var c=t.apply(r,n);function a(t){e(c,o,i,a,u,"next",t)}function u(t){e(c,o,i,a,u,"throw",t)}a(void 0)}))}}function o(){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,r,e){var n=function(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=u(t)););return t}(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?t:e):o.value}},o.apply(this,arguments)}function i(t,r){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},i(t,r)}function c(r){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=u(r);if(e){var i=u(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return function(r,e){if(e&&("object"===t(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return a(r)}(this,n)}}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}function l(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,p(n.key),n)}}function f(t,r,e){return r&&l(t.prototype,r),e&&l(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function h(t,r,e){return(r=p(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function p(r){var e=function(r,e){if("object"!==t(r)||null===r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var o=n.call(r,e||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(r)}(r,"string");return"symbol"===t(e)?e:String(e)}System.register(["@ibiz-template/model","@ibiz-template/runtime","@ibiz-template/controller"],(function(t,e){"use strict";var l,p,y,v;return{setters:[function(t){l=t.ControlType,p=t.ViewType},function(t){y=t.PluginStaticResource},function(t){v=t.PortletPartController}],execute:function(){var d=new y(e.meta.url),m=f((function t(){s(this,t),h(this,"component","ChartControl")})),g=f((function t(){s(this,t),h(this,"component","ChartView")})),b=function(t){!function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&i(t,r)}(p,t);var e,l=c(p);function p(){var t;s(this,p);for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];return h(a(t=l.call.apply(l,[this].concat(e))),"chart",void 0),h(a(t),"chartProvider",void 0),t}return f(p,[{key:"onInit",value:(e=n(r().mark((function t(){var e;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o(u(p.prototype),"onInit",this).call(this);case 2:if(!(e=this.model.chart)){t.next=7;break}return t.next=6,ibiz.register.control.get(e);case 6:this.chartProvider=t.sent;case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"setChartNeuron",value:function(t){var r=this;this.chart=t,this.chart.evt.on("mounted",(function(){var t;null===(t=r.chart)||void 0===t||t.call.load()})),this.chart.evt.on("destroyed",(function(){r.chart=void 0}))}}]),p}(v);t("C",b);var w=function(){function t(){s(this,t),h(this,"component","ChartPortlet")}var e;return f(t,[{key:"createController",value:(e=n(r().mark((function t(e,n,o){var i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=new b(e,n,o),t.next=3,i.init();case 3:return t.abrupt("return",i);case 4:case"end":return t.stop()}}),t)}))),function(t,r,n){return e.apply(this,arguments)})}]),t}();t("i",{mateUrl:e.meta.url,install:function(t){d.loadStyle(["/style.css"]),t.component("ChartControl",(function(){return e.import("./chart-control.legacy.js")})),ibiz.register.control.register(l.CHART,new m),t.component("ChartView",(function(){return e.import("./chart-view.legacy.js")})),ibiz.register.view.register(p.DE_CHART_VIEW,new g),t.component("ChartPortlet",(function(){return e.import("./chart-portlet.legacy.js")})),ibiz.register.portletPart.register("CHART",new w)}})}}}))}();
import { PropType } from 'vue';
import { ChartModel } from '@ibiz-template/model';
declare const _default: import("vue").DefineComponent<{
modelData: {
type: typeof ChartModel;
required: true;
};
context: {
type: PropType<IContext>;
required: true;
};
params: {
type: PropType<IParams>;
default: () => {};
};
}, {
c: import("../../controller/chart-controller").ChartController;
ns: import("@ibiz-template/core").Namespace;
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
modelData: {
type: typeof ChartModel;
required: true;
};
context: {
type: PropType<IContext>;
required: true;
};
params: {
type: PropType<IParams>;
default: () => {};
};
}>>, {
params: IParams;
}>;
export default _default;
import { IModal } from '@ibiz-template/runtime';
import { PropType } from 'vue';
declare const _default: import("vue").DefineComponent<{
context: PropType<IContext>;
params: {
type: PropType<IParams>;
default: () => {};
};
modelPath: {
type: StringConstructor;
required: true;
};
modal: {
type: PropType<IModal>;
};
}, {
c: import("../../controller/chart-view-controller").ChartViewController;
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{
context: PropType<IContext>;
params: {
type: PropType<IParams>;
default: () => {};
};
modelPath: {
type: StringConstructor;
required: true;
};
modal: {
type: PropType<IModal>;
};
}>>, {
params: IParams;
}>;
export default _default;
import { ControlController } from '@ibiz-template/controller';
import { EChartsOption, EChartsType } from 'echarts';
import { ChartModel } from '@ibiz-template/model';
import { ChartNerve } from './nerve/chart-nerve';
import { ChartService } from '../service/chart-service';
export declare class ChartController extends ControlController<ChartModel> {
/**
* 图表神经系统
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:02
* @type {ChartNerve}
*/
nerve: ChartNerve;
/**
* 图表服务
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:13
* @type {ChartService}
*/
service: ChartService;
/**
* 图表实例
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:45
* @type {(EChartsType | null)}
*/
chart: EChartsType | null;
/**
* 图表id
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:22
* @type {string}
*/
chartId: string;
/**
* 图表静态配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:32
* @type {EChartsOption}
*/
chartStaticOption: EChartsOption;
/**
* 数据集合
*
* @author zhanghengfeng
* @date 2023-04-07 16:04:34
* @type {IData[]}
*/
items: IData[];
/**
* 请求参数
*
* @author zhanghengfeng
* @date 2023-04-07 16:04:28
*/
queryParams: {
page: number;
size: number;
query: string;
};
/**
* 图表部件宽度
*
* @author zhanghengfeng
* @date 2023-04-11 15:04:23
* @type {string}
*/
width: string;
/**
* 图表部件高度
*
* @author zhanghengfeng
* @date 2023-04-11 15:04:37
* @type {string}
*/
height: string;
/**
* 创建图表神经系统
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:24
* @protected
* @return {*} {ChartNerve}
*/
protected createNerve(): ChartNerve;
/**
* 初始化配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:41
* @protected
* @return {*} {Promise<void>}
*/
protected onInit(): Promise<void>;
/**
* 重新渲染图表
*
* @author zhanghengfeng
* @date 2023-04-03 18:04:35
*/
resizeChart(): void;
/**
* 初始化图表静态配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:52
*/
initChartStaticOption(): void;
/**
* 加载数据
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:13
* @param {IParams} params
*/
load(): Promise<void>;
destroy(): void;
}
import { ViewController } from '@ibiz-template/controller';
import { ChartViewModel } from '@ibiz-template/model';
import { ChartViewNerve } from './nerve/chart-view-nerve';
/**
* 图表视图控制器
*
* @author zhanghengfeng
* @date 2023-04-03 17:04:29
* @export
* @class ChartViewController
* @extends {ViewController<ChartViewModel>}
*/
export declare class ChartViewController extends ViewController<ChartViewModel> {
nerve: ChartViewNerve;
protected createNerve(): ChartViewNerve;
protected onInit(): Promise<void>;
/**
* 视图加载方法
*
* @return {*} {Promise<IData[]>}
* @memberof ChartViewController
*/
load(): Promise<void>;
/**
* 刷新视图
*
* @author zhanghengfeng
* @date 2023-04-07 17:04:41
* @return {*} {Promise<void>}
*/
refresh(): Promise<void>;
}
import { IControlAbility } from '@ibiz-template/controller';
/**
* 图表能力
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:31
* @export
* @interface IChartAbility
* @extends {IControlAbility}
*/
export interface IChartAbility extends IControlAbility {
load(): Promise<void>;
}
import { IControlEvent } from '@ibiz-template/controller';
/**
* 图表事件
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:46
* @export
* @interface IChartEvent
* @extends {IControlEvent}
*/
export interface IChartEvent extends IControlEvent {
}
import { IViewAbility } from '@ibiz-template/controller';
/**
* 图表视图能力
*
* @author zhanghengfeng
* @date 2023-04-03 17:04:09
* @export
* @interface IChartViewAbility
* @extends {IViewAbility}
*/
export interface IChartViewAbility extends IViewAbility {
}
import { IViewEvent } from '@ibiz-template/controller';
/**
* 图表视图事件
*
* @author zhanghengfeng
* @date 2023-04-03 17:04:26
* @export
* @interface IChartViewEvent
* @extends {IViewEvent}
*/
export interface IChartViewEvent extends IViewEvent {
}
import { ControlNerve } from '@ibiz-template/controller';
import { ChartController } from '../chart-controller';
import { ChartNeuron } from '../neuron/chart-neuron';
/**
* 图表神经系统
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:03
* @export
* @class ChartNerve
* @extends {ControlNerve<ChartNeuron, ChartController>}
*/
export declare class ChartNerve extends ControlNerve<ChartNeuron, ChartController> {
protected createNeuron(): ChartNeuron;
protected bindAbility(): {
load: () => Promise<void>;
};
}
import { Neuron, ViewNerve } from '@ibiz-template/controller';
import { ChartViewController } from '../chart-view-controller';
import { ChartViewNeuron } from '../neuron/chart-view-neuron';
import { ChartNeuron } from '../neuron/chart-neuron';
/**
* 图表视图神经系统
*
* @author zhanghengfeng
* @date 2023-04-03 17:04:29
* @export
* @class ChartViewNerve
* @extends {ViewNerve<ChartViewNeuron, ChartViewController>}
*/
export declare class ChartViewNerve extends ViewNerve<ChartViewNeuron, ChartViewController> {
chart: ChartNeuron;
protected createNeuron(): ChartViewNeuron;
inclusive(name: string): boolean;
connect(name: string, neuron: Neuron): void;
destroy(): void;
}
import { Neuron } from '@ibiz-template/controller';
import { IChartAbility } from '../interface/i-chart-ability';
import { IChartEvent } from '../interface/i-chart-event';
/**
* 图表神经元
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:17
* @export
* @class ChartNeuron
* @extends {Neuron<IChartEvent, IChartAbility>}
*/
export declare class ChartNeuron extends Neuron<IChartEvent, IChartAbility> {
}
import { Neuron } from '@ibiz-template/controller';
import { IChartViewEvent } from '../interface/i-chart-view-event';
import { IChartViewAbility } from '../interface/i-chart-view-ability';
/**
* 图表视图神经元
*
* @author zhanghengfeng
* @date 2023-04-03 17:04:06
* @export
* @class ChartViewNeuron
* @extends {Neuron<IChartViewEvent, IChartViewAbility>}
*/
export declare class ChartViewNeuron extends Neuron<IChartViewEvent, IChartViewAbility> {
}
import { IPSChartAxis, IPSDEChartLegend, IPSDEChartTitle } from '@ibiz-template/model';
import { EChartsOption, LegendComponentOption, TitleComponentOption, XAXisComponentOption, YAXisComponentOption } from 'echarts';
/**
* 解析自定义配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:52
* @export
* @param {IModel} userParams
* @return {*}
*/
export declare function parseUserParams(userParams: IModel): EChartsOption;
/**
* 生成标题配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:06
* @export
* @param {IPSDEChartTitle} chartTitle
* @return {*}
*/
export declare function generateTitleOption(chartTitle: IPSDEChartTitle): TitleComponentOption;
/**
* 生成图例配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:21
* @export
* @param {IPSDEChartLegend} chartLegend
* @return {*}
*/
export declare function generateLegendOption(chartLegend: IPSDEChartLegend): LegendComponentOption;
/**
* 生成坐标轴label配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:37
* @export
* @param {number} dataShowMode
* @return {*}
*/
export declare function generateAxisLabelOption(dataShowMode: number): {
axisLabel: {
formatter: (value: string) => string;
rotate: number;
};
};
/**
* 生成x轴配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:57
* @export
* @param {IPSChartAxis[]} chartXAxisList
* @return {*}
*/
export declare function generateXAxisOption(chartXAxisList: IPSChartAxis[]): XAXisComponentOption[];
/**
* 生成y轴配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:16
* @export
* @param {IPSChartAxis[]} chartYAxisList
* @return {*}
*/
export declare function generateYAxisOption(chartYAxisList: IPSChartAxis[]): YAXisComponentOption[];
import { PluginStaticResource } from '@ibiz-template/runtime';
declare const resource: PluginStaticResource;
export { resource };
import { VueConstructor } from 'vue';
declare const _default: {
mateUrl: string;
install(vue: VueConstructor): void;
};
export default _default;
/**
* 代码表映射
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:42
* @export
* @interface CodeListMap
*/
export interface CodeListMap {
catalog?: Map<string | number, string>;
series?: Map<string | number, string>;
}
/**
* tooltip格式化函数参数
*
* @author zhanghengfeng
* @date 2023-04-19 09:04:04
* @export
* @interface TooltipFormatterParam
*/
export interface TooltipFormatterParam {
seriesName: string;
dimensionNames: string[];
value: string[];
}
import { IControlProvider } from '@ibiz-template/controller';
/**
* 图表适配器
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:11
* @export
* @class ChartProvider
* @implements {IControlProvider}
*/
export declare class ChartProvider implements IControlProvider {
component: string;
}
import { IViewProvider } from '@ibiz-template/controller';
/**
* 图表视图适配器
*
* @author zhanghengfeng
* @date 2023-04-03 17:04:29
* @export
* @class ChartViewProvider
* @implements {IViewProvider}
*/
export declare class ChartViewProvider implements IViewProvider {
component: string;
}
import { ControlService } from '@ibiz-template/service';
import { IHttpResponse } from '@ibiz-template/core';
import { ChartModel, IPSDEChartSeries } from '@ibiz-template/model';
import { DatasetComponentOption, EChartsOption, SeriesOption } from 'echarts';
import { CodeListMap } from '../interface/code-list-map';
/**
* 图表服务
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:23
* @export
* @class ChartService
* @extends {ControlService<ChartModel>}
*/
export declare class ChartService extends ControlService<ChartModel> {
/**
* 序列列表
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:38
* @type {IPSDEChartSeries[]}
*/
seriesList: IPSDEChartSeries[];
constructor(model: ChartModel);
/**
* 获取数据
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:11
* @param {IContext} context
* @param {IParams} [params={}]
* @return {*} {Promise<IHttpResponse>}
*/
fetch(context: IContext, params?: IParams): Promise<IHttpResponse>;
/**
* 获取所有代码表映射
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:21
* @param {IContext} context
* @param {IParams} params
* @return {*}
*/
getAllCodeListMap(context: IContext, params: IParams): Promise<CodeListMap[]>;
/**
* 生成数据集配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:37
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @return {*}
*/
generateDatasetOption(series: IPSDEChartSeries, data: IData[], map: CodeListMap): DatasetComponentOption;
/**
* 生成图表配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:49
* @param {IData[]} data
* @param {IContext} context
* @param {IParams} params
* @return {*}
*/
generateChartOption(data: IData[], context: IContext, params: IParams): Promise<EChartsOption>;
/**
* 生成柱状图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:13
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateBarSeriesOption(series: IPSDEChartSeries, data: IData[], map: CodeListMap, index: number): SeriesOption[];
/**
* 生成折线图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:32
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateLineSeriesOption(series: IPSDEChartSeries, data: IData[], map: CodeListMap, index: number): SeriesOption[];
/**
* 生成饼图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:44
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generatePieSeriesOption(series: IPSDEChartSeries, data: IData[], map: CodeListMap, index: number): SeriesOption[];
/**
* 生成漏斗图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:03
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateFunnelSeriesOption(series: IPSDEChartSeries, data: IData[], map: CodeListMap, index: number): SeriesOption[];
/**
* 生成散点图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:25
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @param {number} index
* @return {*}
*/
generateScatterSeriesOption(series: IPSDEChartSeries, data: IData[], map: CodeListMap, index: number): SeriesOption[];
/**
* 生成雷达图序列配置
*
* @author zhanghengfeng
* @date 2023-04-03 16:04:47
* @param {IPSDEChartSeries} series
* @param {IData[]} data
* @param {CodeListMap} map
* @return {*}
*/
generateRadarSeriesOption(series: IPSDEChartSeries, data: IData[], map: CodeListMap): {
series: SeriesOption[];
radar: {
indicator: {
name: string;
max: number;
}[];
};
};
}
import { ChartModel } from '@ibiz-template/model';
import { ChartController } from '../controller/chart-controller';
export declare function useChartController(vue: Vue, model: ChartModel, context: IContext, params?: IParams): ChartController;
import { ChartViewController } from '../controller/chart-view-controller';
export declare function useChartViewController(vue: Vue, path: string): ChartViewController;
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册