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

feat: 更新图表插件

上级 f015558e
var F = Object.defineProperty;
var I = (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) => (I(l, typeof d != "symbol" ? d + "" : d, e), e);
import { defineComponent as T, getCurrentInstance as N, h as A } from "vue";
import { useControlController as z, useNamespace as M } from "@ibiz-template/vue-util";
import { ChartModel as D } 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 y } from "ramda";
import { ControlService as B } from "@ibiz-template/service";
class U extends j {
}
class X extends $ {
createNeuron() {
return new U(this.bindAbility());
}
bindAbility() {
return {
...super.bindAbility(),
load: this.controller.load.bind(this.controller)
};
}
}
function x(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 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 J(l) {
const d = [];
return l && l.length && l.forEach((e) => {
const { caption: s, minValue: r, maxValue: o, eChartsType: t, position: i } = e, n = {
name: s,
min: r,
max: o
};
Object.assign(n, {
type: t,
position: i,
...y(
P(e.dataShowMode),
x(e.userParams)
)
}), d.push(n);
}), d;
}
function K(l) {
const d = [];
return l && l.length && l.forEach((e) => {
const { caption: s, minValue: r, maxValue: o, eChartsType: t, position: i } = e, n = {
name: s,
min: r,
max: o
};
Object.assign(n, {
type: t,
position: i,
...y(
P(e.dataShowMode),
x(e.userParams)
)
}), d.push(n);
}), d;
}
class W extends B {
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 r = [];
return await Promise.all(
this.seriesList.map(async (o, t) => {
var a, c, p, g;
const i = {}, n = (c = (a = o.getCatalogPSCodeList) == null ? void 0 : a.call(o)) == null ? void 0 : c.codeName, C = (g = (p = o.getSeriesPSCodeList) == null ? void 0 : p.call(o)) == null ? void 0 : g.codeName;
if (n) {
const u = await ibiz.codeListService.get(
n,
e,
s
);
if (u) {
const f = /* @__PURE__ */ new Map();
u.forEach((h) => {
f.set(h.value, h.text);
}), i.catalog = f;
}
}
if (C) {
const u = await ibiz.codeListService.get(
C,
e,
s
);
if (u) {
const f = /* @__PURE__ */ new Map();
u.forEach((h) => {
f.set(h.value, h.text);
}), i.series = f;
}
}
r[t] = i;
})
), 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 a;
const o = {}, t = [];
o.source = t;
const i = e.catalogField.toLowerCase(), n = e.valueField.toLowerCase(), C = (a = e.seriesField) == null ? void 0 : a.toLowerCase();
if (C) {
const c = /* @__PURE__ */ new Set();
s.forEach((p) => {
c.add(p[C]);
}), t.push([i, ...c]);
} else
t.push([i, n]);
t.push(
...s.map((c) => t[0].map((p, g) => g === 0 ? (r && r.catalog ? r.catalog.get(c[p]) : c[p]) || "未定义" : C ? p === c[C] && c[n] || 0 : c[n] || 0))
), r && r.series && (t[0] = t[0].map((c, p) => {
var g;
return p === 0 ? c : ((g = r.series) == null ? void 0 : g.get(c)) || c;
}));
for (let c = 1; c < t.length; c++)
for (let p = c + 1; p < t.length; p++)
t[p][0] === t[c][0] && (t[p].forEach((g, u) => {
u !== 0 && (t[c][u] += g);
}), t.splice(p, 1), p -= 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((i, n) => {
if (i.eChartsType === "radar") {
const { series: a, radar: c } = this.generateRadarSeriesOption(
i,
e,
t[n]
);
Array.isArray(o.series) && o.series.push(...a), o.radar = c;
return;
}
const C = this.generateDatasetOption(i, e, t[n]);
if (Array.isArray(o.dataset) && o.dataset.push(C), i.eChartsType === "bar") {
const a = this.generateBarSeriesOption(
i,
e,
t[n],
n
);
Array.isArray(o.series) && o.series.push(...a);
} else if (i.eChartsType === "line") {
const a = this.generateLineSeriesOption(
i,
e,
t[n],
n
);
Array.isArray(o.series) && o.series.push(...a);
} else if (i.eChartsType === "pie") {
const a = this.generatePieSeriesOption(
i,
e,
t[n],
n
);
Array.isArray(o.series) && o.series.push(...a);
} else if (i.eChartsType === "funnel") {
const a = this.generateFunnelSeriesOption(
i,
e,
t[n],
n
);
Array.isArray(o.series) && o.series.push(...a);
} else if (i.eChartsType === "scatter") {
const a = this.generateScatterSeriesOption(
i,
e,
t[n],
n
);
Array.isArray(o.series) && o.series.push(...a);
} else
throw new Error(`${i.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 u, f, h, m, w, S, b;
const t = [], i = e.eChartsType, n = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), a = (u = e.seriesField) == null ? void 0 : u.toLowerCase(), c = +((m = (h = (f = e.M) == null ? void 0 : f.getPSChartSeriesEncode) == null ? void 0 : h.getPSChartXAxis) == null ? void 0 : m.id) || 0, p = +((b = (S = (w = e.M) == null ? void 0 : w.getPSChartSeriesEncode) == null ? void 0 : S.getPSChartYAxis) == null ? void 0 : b.id) || 0, g = {};
if (a) {
const E = /* @__PURE__ */ new Set();
s.forEach((L) => {
const v = L[a];
E.add(r && r.series && r.series.get(v) || v);
}), t.push(
...[...E].map((L) => ({
type: i,
xAxisIndex: c,
yAxisIndex: p,
name: L,
datasetIndex: o,
encode: {
x: n,
y: L
},
...y(
g,
x(e.userParams)
)
}))
);
} else
t.push({
type: i,
xAxisIndex: c,
yAxisIndex: p,
name: e.caption || e.id,
datasetIndex: o,
encode: {
x: n,
y: C
},
...y(
g,
x(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 u, f, h, m, w, S, b;
const t = [], i = e.eChartsType, n = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), a = (u = e.seriesField) == null ? void 0 : u.toLowerCase(), c = +((m = (h = (f = e.M) == null ? void 0 : f.getPSChartSeriesEncode) == null ? void 0 : h.getPSChartXAxis) == null ? void 0 : m.id) || 0, p = +((b = (S = (w = e.M) == null ? void 0 : w.getPSChartSeriesEncode) == null ? void 0 : S.getPSChartYAxis) == null ? void 0 : b.id) || 0, g = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (a) {
const E = /* @__PURE__ */ new Set();
s.forEach((L) => {
const v = L[a];
E.add(r && r.series && r.series.get(v) || v);
}), t.push(
...[...E].map((L) => ({
type: i,
xAxisIndex: c,
yAxisIndex: p,
name: L,
datasetIndex: o,
encode: {
x: n,
y: L
},
stack: e.M.stack ? e.id : void 0,
step: e.M.step ? "middle" : !1,
...y(
g,
x(e.userParams)
)
}))
);
} else
t.push({
type: i,
xAxisIndex: c,
yAxisIndex: p,
name: e.caption || e.id,
datasetIndex: o,
encode: {
x: n,
y: C
},
...y(
g,
x(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 p;
const t = [], i = e.eChartsType, n = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), a = (p = e.seriesField) == null ? void 0 : p.toLowerCase(), c = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
formatter: "{b}: {d}%({@age})",
position: "outside",
show: !0
}
};
if (a) {
const g = /* @__PURE__ */ new Set();
s.forEach((u) => {
const f = u[a];
g.add(r && r.series && r.series.get(f) || f);
}), t.push(
...[...g].map((u) => ({
type: i,
name: u,
datasetIndex: o,
encode: {
itemName: n,
value: u
},
...y(
c,
x(e.userParams)
)
}))
);
} else
t.push({
type: i,
name: e.caption || e.id,
datasetIndex: o,
encode: {
itemName: n,
value: C
},
...y(
c,
x(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 p;
const t = [], i = e.eChartsType, n = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), a = (p = e.seriesField) == null ? void 0 : p.toLowerCase(), c = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
formatter: "{b}: {d}%({@age})",
position: "outside",
show: !0
}
};
if (a) {
const g = /* @__PURE__ */ new Set();
s.forEach((u) => {
const f = u[a];
g.add(r && r.series && r.series.get(f) || f);
}), t.push(
...[...g].map((u) => ({
type: i,
name: u,
datasetIndex: o,
encode: {
itemName: n,
value: u
},
...y(
c,
x(e.userParams)
)
}))
);
} else
t.push({
type: i,
name: e.caption || e.id,
datasetIndex: o,
encode: {
itemName: n,
value: C
},
...y(
c,
x(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 p;
const t = [], i = e.eChartsType, n = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), a = (p = e.seriesField) == null ? void 0 : p.toLowerCase(), c = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (a) {
const g = /* @__PURE__ */ new Set();
s.forEach((u) => {
const f = u[a];
g.add(r && r.series && r.series.get(f) || f);
}), t.push(
...[...g].map((u) => ({
type: i,
name: u,
datasetIndex: o,
encode: {
x: n,
y: u
},
...y(
c,
x(e.userParams)
)
}))
);
} else
t.push({
type: i,
name: e.caption || e.id,
datasetIndex: o,
encode: {
x: n,
y: C
},
...y(
c,
x(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 f;
const o = [], t = [], i = e.eChartsType, n = e.catalogField.toLowerCase(), C = e.valueField.toLowerCase(), a = (f = e.seriesField) == null ? void 0 : f.toLowerCase(), c = {
emphasis: {
label: {
fontSize: 20,
show: !0
}
},
label: {
position: "top",
show: !0
}
};
if (a) {
const h = /* @__PURE__ */ new Set();
s.forEach((m) => {
h.add(m[a]);
}), t.push([n, ...h]);
} else
t.push([n, C]);
t.push(
...s.map((h) => t[0].map((m, w) => w === 0 ? (r && r.catalog ? r.catalog.get(h[m]) : h[m]) || "未定义" : a ? m === h[a] ? h[C] : 0 : h[C]))
), r && r.series && (t[0] = t[0].map((h, m) => {
var w;
return m === 0 ? h : ((w = r.series) == null ? void 0 : w.get(h)) || h;
}));
for (let h = 1; h < t.length; h++)
for (let m = h + 1; m < t.length; m++)
t[m][0] === t[h][0] && (t[m].forEach((w, S) => {
S !== 0 && (t[h][S] += w);
}), t.splice(m, 1), m -= 1);
const p = t[0].slice(1).map((h, m) => t.slice(1).map((w) => w[m + 1]));
o.push({
type: i,
name: e.caption || e.id,
data: p,
...y(c, x(e.userParams))
});
let g = -1 / 0;
p.forEach((h) => {
h.forEach((m) => {
+m > g && (g = +m);
});
});
const u = t.slice(1).map((h) => ({
name: h[0],
max: g
}));
return {
series: o,
radar: {
indicator: u
}
};
}
}
class G 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-11 15:04:23
* @type {string}
*/
O(this, "width", "100%");
/**
* 图表部件高度
*
* @author zhanghengfeng
* @date 2023-04-11 15:04:37
* @type {string}
*/
O(this, "height", "100%");
}
/**
* 创建图表神经系统
*
* @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 W(this.model), await this.service.init(this.context), this.initChartStaticOption(), this.resizeChart = this.resizeChart.bind(this), window.addEventListener("resize", this.resizeChart);
const { width: e, height: s } = this.model.source;
e && (this.width = `${e}px`), s && (this.height = `${s}px`);
}
/**
* 重新渲染图表
*
* @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.tooltip = {
show: !0,
padding: 0,
backgroundColor: "rgba(255, 255, 255, 0)",
borderWidth: 0,
className: "chart-tooltip",
borderRadius: 6,
extraCssText: "box-shadow: none;",
trigger: "axis",
axisPointer: {
type: "shadow"
},
appendToBody: !0,
formatter: (n) => {
const C = n, a = document.createElement("div");
if (a.classList.add("chart-tooltip-container"), Array.isArray(n)) {
const c = [], p = /* @__PURE__ */ new Map();
C.forEach((u) => {
const f = u.seriesName, h = u.dimensionNames;
h.slice(1).forEach((m, w) => {
const S = h.length === 2 ? f : m, b = u.value[w + 1];
p.has(S) || (c.push({
x: S,
y: b
}), p.set(S, b));
});
});
const g = document.createElement("div");
return g.classList.add("chart-tooltip-title"), g.textContent = C[0].value[0], a.appendChild(g), c.forEach((u) => {
const f = document.createElement("div");
f.classList.add("chart-tooltip-item");
const h = document.createElement("div");
h.classList.add("chart-tooltip-item-name"), h.textContent = u.x, f.appendChild(h);
const m = document.createElement("div");
m.classList.add("chart-tooltip-item-number"), m.textContent = u.y, f.appendChild(m), a.appendChild(f);
}), a;
}
return a;
}
});
const o = this.model.source.getPSDEChartLegend();
e.legend = o ? _(o) : {};
const t = this.model.source.getPSChartXAxises();
e.xAxis = t ? J(t) : [];
const i = this.model.source.getPSChartYAxises();
e.yAxis = i ? K(i) : [], Object.assign(
this.chartStaticOption,
y(e, x(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 o = document.querySelector(`#${this.chartId}`);
if (!o)
throw new Error("未找到ECharts绘制容器元素");
this.chart = V(o);
}
const r = await this.service.generateChartOption(
s,
this.context,
this.params
);
this.chart.setOption({
...this.chartStaticOption,
...r
});
} 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 H(l, d, e, s = {}) {
return z(l, () => new G(d, e, s));
}
const ie = T({
name: "ChartControl",
props: {
modelData: {
type: D,
required: !0
},
context: {
type: Object,
required: !0
},
params: {
type: Object,
default: () => ({})
}
},
setup(l) {
const {
proxy: d
} = N(), e = M("chart");
return {
c: H(d, l.modelData, l.context, l.params),
ns: e
};
},
render() {
if (this.c.complete)
return A("control-layout", {
attrs: {
modelData: this.c.model
}
}, [A("div", {
class: this.ns.b(),
style: {
width: this.c.width,
height: this.c.height
}
}, [A("div", {
attrs: {
id: this.c.chartId
},
class: this.ns.b("content")
}), this.c.items.length ? null : A("div", {
class: this.ns.b("empty-content")
}, ["暂无数据"])])]);
}
});
export {
ie 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-25c28368.js";
import { C as c } from "./index-7562e272.js";
import "@ibiz-template/runtime";
import "@ibiz-template/controller";
const f = m({
......
......@@ -29,7 +29,7 @@ const V = S({
if (s == null)
return "";
try {
return ibiz.util.text.format(`${s}`, "#,##0");
return ibiz.util.text.format(`${s}`, "#,##0.##");
} catch (a) {
return ibiz.log.error(`${s} 值格式化错误`), `${s}`;
}
......
!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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(C){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new O(n||[]);return o(a,"_invoke",{value:A(t,r,c)}),a}function v(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(C){return{type:"throw",arg:C}}}r.wrap=f;var h={};function d(){}function p(){}function m(){}var y={};s(y,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(P([])));b&&b!==n&&i.call(b,c)&&(y=b);var w=m.prototype=d.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(o,a,c,u){var l=v(e[o],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var a;o(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,i){n(t,e,r,i)}))}return a=a?a.then(i,i):i()}})}function A(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return T()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=v(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=v(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function P(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:T}}function T(){return{value:void 0,done:!0}}return p.prototype=m,o(w,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new L(f(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),s(w,l,"Generator"),s(w,c,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=P,O.prototype={constructor:O,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(S),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=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 e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){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&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},r}function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e,r,n,i,o,a){try{var c=t[o](a),u=c.value}catch(l){return void r(l)}c.done?e(u):Promise.resolve(u).then(n,i)}function o(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,r||"default");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}System.register(["vue","@ibiz-template/vue-util","@ibiz-template/model","ramda","./use-chart-controller.legacy.js","@ibiz-template/controller","qx-util","echarts","@ibiz-template/service"],(function(t,n){"use strict";var a,c,u,l,s,f,v,h,d;return{setters:[function(t){a=t.defineComponent,c=t.ref,u=t.h,l=t.getCurrentInstance,s=t.default},function(t){f=t.useNamespace},function(t){v=t.ChartModel},function(t){h=t.mergeDeepRight},function(t){d=t.u},null,null,null,null],execute:function(){var n=a({name:"ChartTooltip",props:{params:{type:[Object,Array],required:!0},c:{type:Object,required:!0},codeListMap:{type:Array,required:!0}},setup:function(t){var e,r=f("chart-tooltip"),n=c([]),i=c(""),o=c(),a=(null===(e=t.c.model.source.getPSControlParam())||void 0===e?void 0:e.ctrlParams)||{},u=a.LABEL,l=a.TEXT,s=a.LEFT,v=a.CENTER,h=a.RIGHT,d=a.PERCENTAGE,p=a.RATE,m=JSON.parse(a.LIST||"[]"),y=function(t){if(null==t)return"";try{return ibiz.util.text.format("".concat(t),"#,##0")}catch(e){return ibiz.log.error("".concat(t," 值格式化错误")),"".concat(t)}};return function(){var e=t.params;if(Array.isArray(e))n.value=e.map((function(e){if(!o.value&&Array.isArray(t.c.items)&&t.c.items.length){var r,n,a=e.seriesIndex||0,c=t.c.service.seriesList[a],u=null==c||null===(r=c.catalogField)||void 0===r?void 0:r.toLowerCase(),l=e.name||"",s=null===(n=t.codeListMap[a])||void 0===n?void 0:n.catalog;u&&l&&(o.value=t.c.items.find((function(t){return s&&s.get(t[u])?s.get(t[u])===l:t[u]===l})))}i.value=e.name||"";var f=Array.isArray(e.value)?e.value[1]:e.value;return{text:e.seriesName,value:y(f),color:e.color}})),Array.isArray(m)&&m.length&&(n.value=m.map((function(t){var e,r,n=null===(e=o.value)||void 0===e?void 0:e[t.value];return{color:t.color,text:t.text,value:y(n),rate:null===(r=o.value)||void 0===r?void 0:r[t.rate]}})));else if(e){var r,a,c,u,f,g=e;if(Array.isArray(t.c.items)&&t.c.items.length){var b,w,x,L=g.seriesIndex||0,A=t.c.service.seriesList[L],E=null==A||null===(b=A.catalogField)||void 0===b?void 0:b.toLowerCase(),j=null==A||null===(w=A.valueField)||void 0===w?void 0:w.toLowerCase();if("radar"===g.seriesType)return n.value=t.c.items.map((function(t){return{text:t[E],value:y(t[j]),color:g.color,left:s,center:t[v],right:h}})),void(o.value={});var S=g.name||"",O=null===(x=t.codeListMap[L])||void 0===x?void 0:x.catalog;E&&S&&(o.value=t.c.items.find((function(t){return O&&O.get(t[E])?O.get(t[E])===S:t[E]===S})))}var P=Array.isArray(g.value)?null===(r=g.value)||void 0===r?void 0:r[1]:g.value;n.value=[{text:(null===(a=o.value)||void 0===a?void 0:a[l])||e.name,value:y(P),color:g.color,left:s,center:null===(c=o.value)||void 0===c?void 0:c[v],right:h,percentage:null===(u=o.value)||void 0===u?void 0:u[d],rate:null===(f=o.value)||void 0===f?void 0:f[p]}]}}(),{ns:r,title:i,items:n,curData:o,label:u}},render:function(){var t=this;if(this.curData)return u("div",{class:this.ns.b()},[this.label&&this.curData[this.label]&&u("div",{class:this.ns.b("header")},[this.curData[this.label]]),!(this.label&&this.curData[this.label])&&this.title&&u("div",{class:this.ns.b("header")},[this.title]),u("div",{class:this.ns.b("content")},[u("div",{class:this.ns.b("item-icon")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.color&&u("div",{class:t.ns.be("item","icon"),style:{background:e.color}})])}))]),u("div",{class:this.ns.b("item-text")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.text&&u("div",{class:t.ns.be("item","text")},[e.text])])}))]),u("div",{class:this.ns.b("item-value")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[null!=e.value&&u("div",{class:t.ns.be("item","value")},[e.value])])}))]),u("div",{class:this.ns.b("item-center")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.left&&u("div",{class:t.ns.be("item","left")},[e.left]),null!=e.center&&u("div",{class:t.ns.be("item","center")},[e.center]),e.right&&u("div",{class:t.ns.be("item","right")},[e.right])])}))]),u("div",{class:this.ns.b("item-percentage")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.percentage&&u("div",{class:t.ns.be("item","percentage")},[e.percentage])])}))]),u("div",{class:this.ns.b("item-rate")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.rate&&u("div",{class:t.ns.be("item","rate")},[u("rate-span",{attrs:{value:e.rate}})])])}))])])])}});t("default",a({name:"GwxnChartControl",props:{modelData:{type:v,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(t){var a,c=l().proxy,u=f("chart"),v=d(c,t.modelData,t.context,t.params),p=(null===(a=v.model.source.getPSControlParam())||void 0===a?void 0:a.ctrlParams)||{},m=p.TYPE,y=p.TOTAL,g=!0;v.registerLoadHook((function(t){return Array.isArray(t)&&y&&0===t.length&&(t.push(o({},y,100)),g=!1),t}));var b=function(){var t,o=(t=e().mark((function t(i){var o,a,c,u,l,f,d,b,w,x,L,A,E,j,S;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o=i.tooltip)){t.next=6;break}return t.next=4,v.service.getAllCodeListMap(v.context,v.params);case 4:a=t.sent,o.formatter=function(t){var e=document.createElement("div"),r=new s({el:e,render:function(e){return e(n,{props:{params:t,ctrlParams:p,c:v,codeListMap:a}})}});return r.$el};case 6:if("line"===m&&(c=i.xAxis,Array.isArray(c)&&c.length&&c.forEach((function(t){t.max=function(t){return t.max+1}}))),u=i.series,Array.isArray(u)){t.next=10;break}return t.abrupt("return",i);case 10:return"custom"===m&&(-1!==(l=u.findIndex((function(t){return"pie"===t.type})))&&(b=!0,w=v.service.seriesList,(x=null===(f=w[l])||void 0===f||null===(d=f.valueField)||void 0===d?void 0:d.toLowerCase())&&v.items.every((function(t){return!t[x]}))&&(u.splice(l,1),b=!1),b&&(u[l]=h(u[l],{emphasis:{label:{formatter:function(t){var e,r=null===(e=t.value[0])||void 0===e?void 0:e.replace("~","-"),n=t.value[1];return"{value|".concat(n,"}\n{key|").concat(r,"}")}}}}))),-1!==(L=u.findIndex((function(t){return"gauge"===t.type})))&&(u[L]=h(u[L],{axisLabel:{formatter:function(t){return 24===t||t%2==1?"":"".concat(t)}}}))),"radar"===m&&(A=i.radar,E=u.find((function(t){return"radar"===t.type})),A&&!Array.isArray(A)&&Array.isArray(A.indicator)&&E&&Array.isArray(E.data)&&E.data.length&&(A.indicator=[].concat(r(A.indicator.slice(0,1)),r(A.indicator.slice(1).reverse())),E.data[0]=[].concat(r(E.data[0].slice(0,1)),r(E.data[0].slice(1).reverse())))),y&&(j=i.graphic,Array.isArray(j)&&j.length&&g&&(S=v.items.reduce((function(t,e){return t+e[y]}),0),j[0]=h(j[0],{style:{text:S}})),g||i.tooltip&&Object.assign(i.tooltip,{show:!1})),t.abrupt("return",i);case 14:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t){return o.apply(this,arguments)}}();return v.registerHook(b),{c:v,ns:u}},render:function(){if(this.c.complete)return u("control-layout",{attrs:{modelData:this.c.model}},[u("div",{class:this.ns.b(),style:{width:this.c.width,height:this.c.height}},[u("div",{attrs:{id:this.c.chartId},class:this.ns.b("content")}),this.c.items.length?null:u("div",{class:this.ns.b("empty-content")},["暂无数据"])])])}}))}}}))}();
!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(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var r={},n=Object.prototype,i=n.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(C){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),c=new O(n||[]);return o(a,"_invoke",{value:A(t,r,c)}),a}function v(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(C){return{type:"throw",arg:C}}}r.wrap=f;var h={};function d(){}function p(){}function m(){}var y={};s(y,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(P([])));b&&b!==n&&i.call(b,c)&&(y=b);var w=m.prototype=d.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(e,r){function n(o,a,c,u){var l=v(e[o],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&i.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var a;o(this,"_invoke",{value:function(t,e){function i(){return new r((function(r,i){n(t,e,r,i)}))}return a=a?a.then(i,i):i()}})}function A(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return T()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=v(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=v(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function P(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:T}}function T(){return{value:void 0,done:!0}}return p.prototype=m,o(w,"constructor",{value:m,configurable:!0}),o(m,"constructor",{value:p,configurable:!0}),p.displayName=s(m,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,s(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){return this})),r.AsyncIterator=L,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new L(f(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),s(w,l,"Generator"),s(w,c,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=P,O.prototype={constructor:O,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(S),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=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 e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=i.call(o,"catchLoc"),u=i.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(t,e){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&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},r}function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function i(t,e,r,n,i,o,a){try{var c=t[o](a),u=c.value}catch(l){return void r(l)}c.done?e(u):Promise.resolve(u).then(n,i)}function o(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,r||"default");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}System.register(["vue","@ibiz-template/vue-util","@ibiz-template/model","ramda","./use-chart-controller.legacy.js","@ibiz-template/controller","qx-util","echarts","@ibiz-template/service"],(function(t,n){"use strict";var a,c,u,l,s,f,v,h,d;return{setters:[function(t){a=t.defineComponent,c=t.ref,u=t.h,l=t.getCurrentInstance,s=t.default},function(t){f=t.useNamespace},function(t){v=t.ChartModel},function(t){h=t.mergeDeepRight},function(t){d=t.u},null,null,null,null],execute:function(){var n=a({name:"ChartTooltip",props:{params:{type:[Object,Array],required:!0},c:{type:Object,required:!0},codeListMap:{type:Array,required:!0}},setup:function(t){var e,r=f("chart-tooltip"),n=c([]),i=c(""),o=c(),a=(null===(e=t.c.model.source.getPSControlParam())||void 0===e?void 0:e.ctrlParams)||{},u=a.LABEL,l=a.TEXT,s=a.LEFT,v=a.CENTER,h=a.RIGHT,d=a.PERCENTAGE,p=a.RATE,m=JSON.parse(a.LIST||"[]"),y=function(t){if(null==t)return"";try{return ibiz.util.text.format("".concat(t),"#,##0.##")}catch(e){return ibiz.log.error("".concat(t," 值格式化错误")),"".concat(t)}};return function(){var e=t.params;if(Array.isArray(e))n.value=e.map((function(e){if(!o.value&&Array.isArray(t.c.items)&&t.c.items.length){var r,n,a=e.seriesIndex||0,c=t.c.service.seriesList[a],u=null==c||null===(r=c.catalogField)||void 0===r?void 0:r.toLowerCase(),l=e.name||"",s=null===(n=t.codeListMap[a])||void 0===n?void 0:n.catalog;u&&l&&(o.value=t.c.items.find((function(t){return s&&s.get(t[u])?s.get(t[u])===l:t[u]===l})))}i.value=e.name||"";var f=Array.isArray(e.value)?e.value[1]:e.value;return{text:e.seriesName,value:y(f),color:e.color}})),Array.isArray(m)&&m.length&&(n.value=m.map((function(t){var e,r,n=null===(e=o.value)||void 0===e?void 0:e[t.value];return{color:t.color,text:t.text,value:y(n),rate:null===(r=o.value)||void 0===r?void 0:r[t.rate]}})));else if(e){var r,a,c,u,f,g=e;if(Array.isArray(t.c.items)&&t.c.items.length){var b,w,x,L=g.seriesIndex||0,A=t.c.service.seriesList[L],E=null==A||null===(b=A.catalogField)||void 0===b?void 0:b.toLowerCase(),j=null==A||null===(w=A.valueField)||void 0===w?void 0:w.toLowerCase();if("radar"===g.seriesType)return n.value=t.c.items.map((function(t){return{text:t[E],value:y(t[j]),color:g.color,left:s,center:t[v],right:h}})),void(o.value={});var S=g.name||"",O=null===(x=t.codeListMap[L])||void 0===x?void 0:x.catalog;E&&S&&(o.value=t.c.items.find((function(t){return O&&O.get(t[E])?O.get(t[E])===S:t[E]===S})))}var P=Array.isArray(g.value)?null===(r=g.value)||void 0===r?void 0:r[1]:g.value;n.value=[{text:(null===(a=o.value)||void 0===a?void 0:a[l])||e.name,value:y(P),color:g.color,left:s,center:null===(c=o.value)||void 0===c?void 0:c[v],right:h,percentage:null===(u=o.value)||void 0===u?void 0:u[d],rate:null===(f=o.value)||void 0===f?void 0:f[p]}]}}(),{ns:r,title:i,items:n,curData:o,label:u}},render:function(){var t=this;if(this.curData)return u("div",{class:this.ns.b()},[this.label&&this.curData[this.label]&&u("div",{class:this.ns.b("header")},[this.curData[this.label]]),!(this.label&&this.curData[this.label])&&this.title&&u("div",{class:this.ns.b("header")},[this.title]),u("div",{class:this.ns.b("content")},[u("div",{class:this.ns.b("item-icon")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.color&&u("div",{class:t.ns.be("item","icon"),style:{background:e.color}})])}))]),u("div",{class:this.ns.b("item-text")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.text&&u("div",{class:t.ns.be("item","text")},[e.text])])}))]),u("div",{class:this.ns.b("item-value")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[null!=e.value&&u("div",{class:t.ns.be("item","value")},[e.value])])}))]),u("div",{class:this.ns.b("item-center")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.left&&u("div",{class:t.ns.be("item","left")},[e.left]),null!=e.center&&u("div",{class:t.ns.be("item","center")},[e.center]),e.right&&u("div",{class:t.ns.be("item","right")},[e.right])])}))]),u("div",{class:this.ns.b("item-percentage")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.percentage&&u("div",{class:t.ns.be("item","percentage")},[e.percentage])])}))]),u("div",{class:this.ns.b("item-rate")},[this.items.map((function(e){return u("div",{class:t.ns.b("item")},[e.rate&&u("div",{class:t.ns.be("item","rate")},[u("rate-span",{attrs:{value:e.rate}})])])}))])])])}});t("default",a({name:"GwxnChartControl",props:{modelData:{type:v,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}}},setup:function(t){var a,c=l().proxy,u=f("chart"),v=d(c,t.modelData,t.context,t.params),p=(null===(a=v.model.source.getPSControlParam())||void 0===a?void 0:a.ctrlParams)||{},m=p.TYPE,y=p.TOTAL,g=!0;v.registerLoadHook((function(t){return Array.isArray(t)&&y&&0===t.length&&(t.push(o({},y,100)),g=!1),t}));var b=function(){var t,o=(t=e().mark((function t(i){var o,a,c,u,l,f,d,b,w,x,L,A,E,j,S;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(o=i.tooltip)){t.next=6;break}return t.next=4,v.service.getAllCodeListMap(v.context,v.params);case 4:a=t.sent,o.formatter=function(t){var e=document.createElement("div"),r=new s({el:e,render:function(e){return e(n,{props:{params:t,ctrlParams:p,c:v,codeListMap:a}})}});return r.$el};case 6:if("line"===m&&(c=i.xAxis,Array.isArray(c)&&c.length&&c.forEach((function(t){t.max=function(t){return t.max+1}}))),u=i.series,Array.isArray(u)){t.next=10;break}return t.abrupt("return",i);case 10:return"custom"===m&&(-1!==(l=u.findIndex((function(t){return"pie"===t.type})))&&(b=!0,w=v.service.seriesList,(x=null===(f=w[l])||void 0===f||null===(d=f.valueField)||void 0===d?void 0:d.toLowerCase())&&v.items.every((function(t){return!t[x]}))&&(u.splice(l,1),b=!1),b&&(u[l]=h(u[l],{emphasis:{label:{formatter:function(t){var e,r=null===(e=t.value[0])||void 0===e?void 0:e.replace("~","-"),n=t.value[1];return"{value|".concat(n,"}\n{key|").concat(r,"}")}}}}))),-1!==(L=u.findIndex((function(t){return"gauge"===t.type})))&&(u[L]=h(u[L],{axisLabel:{formatter:function(t){return 24===t||t%2==1?"":"".concat(t)}}}))),"radar"===m&&(A=i.radar,E=u.find((function(t){return"radar"===t.type})),A&&!Array.isArray(A)&&Array.isArray(A.indicator)&&E&&Array.isArray(E.data)&&E.data.length&&(A.indicator=[].concat(r(A.indicator.slice(0,1)),r(A.indicator.slice(1).reverse())),E.data[0]=[].concat(r(E.data[0].slice(0,1)),r(E.data[0].slice(1).reverse())))),y&&(j=i.graphic,Array.isArray(j)&&j.length&&g&&(S=v.items.reduce((function(t,e){return t+e[y]}),0),j[0]=h(j[0],{style:{text:S}})),g||i.tooltip&&Object.assign(i.tooltip,{show:!1})),t.abrupt("return",i);case 14:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t){return o.apply(this,arguments)}}();return v.registerHook(b),{c:v,ns:u}},render:function(){if(this.c.complete)return u("control-layout",{attrs:{modelData:this.c.model}},[u("div",{class:this.ns.b(),style:{width:this.c.width,height:this.c.height}},[u("div",{attrs:{id:this.c.chartId},class:this.ns.b("content")}),this.c.items.length?null:u("div",{class:this.ns.b("empty-content")},["暂无数据"])])])}}))}}}))}();
import "@ibiz-template/model";
import { i as p } from "./index-25c28368.js";
import { i as p } from "./index-7562e272.js";
import "@ibiz-template/runtime";
import "@ibiz-template/controller";
export {
......
......@@ -88,10 +88,10 @@ const T = {
new w()
), t.component(
"ChartPortlet",
() => import("./chart-portlet-5b6b8afb.js")
() => import("./chart-portlet-533d5bd9.js")
), ibiz.register.portletPart.register("CHART", new P()), t.component(
"GwxnChartControl",
() => import("./gwxn-chart-control-fa848c26.js")
() => import("./gwxn-chart-control-f043106c.js")
), ibiz.register.control.register("CUSTOM_GwxnChart", new g());
}
};
......
@charset "UTF-8";.ibiz-chart .ibiz-chart-empty-content{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}.chart-tooltip .chart-tooltip-container{width:141px;padding:10px 12px 6px 8px;background:rgba(255,255,255,.45);border-radius:6px;backdrop-filter:blur(3px)}.chart-tooltip .chart-tooltip-container .chart-tooltip-title{font-size:14px;font-weight:700;line-height:19px;color:#666}.chart-tooltip .chart-tooltip-container .chart-tooltip-item{display:flex;align-items:center;justify-content:space-between;margin-top:8px}.chart-tooltip .chart-tooltip-container .chart-tooltip-item .chart-tooltip-item-name,.chart-tooltip .chart-tooltip-container .chart-tooltip-item .chart-tooltip-item-number{font-size:12px;line-height:16px;color:#666}.ibiz-chart{position:relative;width:100%;height:100%;overflow:auto}.ibiz-chart .ibiz-chart-content{width:100%;height:100%}.ibiz-chart .ibiz-chart-empty-content,.ibiz-chart .ibiz-chart-center{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}.ibiz-chart-tooltip{font-family:MicrosoftYaHei,sans-serif;font-size:12px;color:#000}.ibiz-chart-tooltip-header{margin-bottom:4px}.ibiz-chart-tooltip-content{display:flex}.ibiz-chart-tooltip-item{display:flex;align-items:center;height:21px;margin-bottom:4px}.ibiz-chart-tooltip-item:last-child{margin-bottom:0}.ibiz-chart-tooltip-item__icon{flex:0 0 auto;width:6px;height:6px;margin-right:8px;border-radius:50%}.ibiz-chart-tooltip-item__text{margin-right:16px}.ibiz-chart-tooltip-item__value{width:100%;color:#337dff;text-align:right}.ibiz-chart-tooltip-item__center{color:#337dff}.ibiz-chart-tooltip-item__percentage{margin-left:10px;color:#337dff}.ibiz-chart-tooltip-item__rate{margin-left:17px}.ibiz-chart-tooltip-item-value{margin-left:auto}.ibiz-chart-tooltip-item-center{margin-left:4px}.ibiz-chart-tooltip-item-percentage+.ibiz-chart-tooltip-item-rate .ibiz-chart-tooltip-item__rate{margin-left:10px}
@charset "UTF-8";.ibiz-chart .ibiz-chart-empty-content{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}.chart-tooltip .chart-tooltip-container{width:141px;padding:10px 12px 6px 8px;background:rgba(255,255,255,.45);border-radius:6px;backdrop-filter:blur(3px)}.chart-tooltip .chart-tooltip-container .chart-tooltip-title{font-size:14px;font-weight:700;line-height:19px;color:#666}.chart-tooltip .chart-tooltip-container .chart-tooltip-item{display:flex;align-items:center;justify-content:space-between;margin-top:8px}.chart-tooltip .chart-tooltip-container .chart-tooltip-item .chart-tooltip-item-name,.chart-tooltip .chart-tooltip-container .chart-tooltip-item .chart-tooltip-item-number{font-size:12px;line-height:16px;color:#666}.ibiz-chart{position:relative;width:100%;height:100%;overflow:auto}.ibiz-chart .ibiz-chart-content{width:100%;height:100%}.ibiz-chart .ibiz-chart-empty-content,.ibiz-chart .ibiz-chart-center{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}.ibiz-chart-tooltip{font-family:MicrosoftYaHei,sans-serif;font-size:12px;color:#000}.ibiz-chart-tooltip-header{margin-bottom:4px}.ibiz-chart-tooltip-content{display:flex}.ibiz-chart-tooltip-item{display:flex;align-items:center;height:21px;margin-bottom:4px}.ibiz-chart-tooltip-item:last-child{margin-bottom:0}.ibiz-chart-tooltip-item__icon{flex:0 0 auto;width:6px;height:6px;margin-right:8px;border-radius:50%}.ibiz-chart-tooltip-item__text{margin-right:16px}.ibiz-chart-tooltip-item__value{width:100%;color:#337dff;text-align:right}.ibiz-chart-tooltip-item__center{color:#337dff}.ibiz-chart-tooltip-item__percentage{margin-left:10px;color:#337dff}.ibiz-chart-tooltip-item__rate{margin-left:17px}.ibiz-chart-tooltip-item-center{margin-left:4px}.ibiz-chart-tooltip-item-percentage+.ibiz-chart-tooltip-item-rate .ibiz-chart-tooltip-item__rate{margin-left:10px}
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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册