@blazes/data-visualization 1.0.0-alpha.0 → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/.vite/manifest.json +26 -26
- package/dist/core/config/dashboard-config-schema.d.ts +13 -0
- package/dist/core/config/dashboard-config-schema.d.ts.map +1 -1
- package/dist/core/config/dashboard-config.d.ts +4 -0
- package/dist/core/config/dashboard-config.d.ts.map +1 -1
- package/dist/core/export/index.d.ts +1 -0
- package/dist/core/export/index.d.ts.map +1 -1
- package/dist/core/export/panel-export.d.ts +4 -0
- package/dist/core/export/panel-export.d.ts.map +1 -0
- package/dist/core/index.js +63 -61
- package/dist/core/runtime/dashboard-runtime.d.ts +4 -0
- package/dist/core/runtime/dashboard-runtime.d.ts.map +1 -1
- package/dist/{dashboard-runtime-8a-9P8Ku.js → dashboard-runtime-6VlVQIuQ.js} +27 -27
- package/dist/{dashboard-runtime-8a-9P8Ku.js.map → dashboard-runtime-6VlVQIuQ.js.map} +1 -1
- package/dist/experimental/s2/index.js +12 -12
- package/dist/index.css +1 -1
- package/dist/index.js +63 -61
- package/dist/{csv-Dyrr2yMA.js → panel-export-Di_5Frul.js} +24 -19
- package/dist/panel-export-Di_5Frul.js.map +1 -0
- package/dist/renderers/word-cloud/index.js +1 -1
- package/dist/{runtime-schema-BO2qLlvE.js → runtime-schema-BmeEvFU-.js} +42 -34
- package/dist/runtime-schema-BmeEvFU-.js.map +1 -0
- package/dist/{standard-definitions-DHtaLAf1.js → standard-definitions-hgJ-kOoz.js} +5 -5
- package/dist/{standard-definitions-DHtaLAf1.js.map → standard-definitions-hgJ-kOoz.js.map} +1 -1
- package/dist/vue/components/DashboardPanel.vue.d.ts.map +1 -1
- package/dist/vue/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/vue/index.js +620 -592
- package/dist/vue/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/csv-Dyrr2yMA.js.map +0 -1
- package/dist/runtime-schema-BO2qLlvE.js.map +0 -1
package/dist/vue/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as O, openBlock as
|
|
2
|
-
import { FormatType as
|
|
3
|
-
import { a as
|
|
4
|
-
import { v as
|
|
5
|
-
import { RedoOutlined as
|
|
6
|
-
import { RangePicker as
|
|
7
|
-
import { b as
|
|
8
|
-
const
|
|
1
|
+
import { defineComponent as O, openBlock as u, createElementBlock as b, normalizeClass as K, createElementVNode as R, Fragment as H, renderList as G, normalizeStyle as pe, toDisplayString as L, createVNode as k, unref as c, mergeProps as Ce, withCtx as S, createTextVNode as U, createBlock as z, createCommentVNode as $, ref as j, computed as I, onErrorCaptured as Se, watch as ke, resolveDynamicComponent as fe, pushScopeId as Re, popScopeId as Ie, shallowRef as Pe, onMounted as ve, onBeforeUnmount as me, onBeforeMount as $e, markRaw as De, toRaw as Ae, h as V } from "vue";
|
|
2
|
+
import { FormatType as X, ChartBar as ze, Size as te, ChartLine as Le, ChartPie as Te } from "@blazes/charts";
|
|
3
|
+
import { a as ne, b as W, c as J, S as ae } from "../visual-theme-DH-k3L51.js";
|
|
4
|
+
import { v as F } from "../value-formatter-D5QmLSMG.js";
|
|
5
|
+
import { RedoOutlined as ee, ExclamationCircleOutlined as Ee, BarChartOutlined as Fe, WarningOutlined as Ve, CloudDownloadOutlined as Oe, QuestionCircleOutlined as Be, RiseOutlined as _e, FallOutlined as ge, MinusOutlined as he } from "@ant-design/icons-vue";
|
|
6
|
+
import { RangePicker as Ue, RadioGroup as Ne, RadioButton as je, Select as de, Tooltip as N, Button as Y, Card as Ye, Spin as ce, Dropdown as He, Menu as qe, MenuItem as ue, Progress as Ke, Tag as Ge, Table as We } from "ant-design-vue";
|
|
7
|
+
import { i as Z, b as Ze, s as Qe, a as Xe, P as Je } from "../panel-export-Di_5Frul.js";
|
|
8
|
+
const et = { class: "dv-filter-bar__controls" }, tt = { class: "dv-filter-bar__label" }, nt = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "dv-filter-bar__date-range"
|
|
11
|
-
},
|
|
11
|
+
}, at = /* @__PURE__ */ O({
|
|
12
12
|
__name: "DashboardFilterBar",
|
|
13
13
|
props: {
|
|
14
14
|
config: {},
|
|
@@ -16,209 +16,219 @@ const Xe = { class: "dv-filter-bar__controls" }, Je = { class: "dv-filter-bar__l
|
|
|
16
16
|
loading: { type: Boolean }
|
|
17
17
|
},
|
|
18
18
|
emits: ["change", "refresh"],
|
|
19
|
-
setup(
|
|
20
|
-
const i =
|
|
21
|
-
function
|
|
19
|
+
setup(o, { emit: _ }) {
|
|
20
|
+
const i = o, t = _;
|
|
21
|
+
function g(e) {
|
|
22
22
|
return {
|
|
23
|
-
"--dv-filter-xs": String(
|
|
24
|
-
"--dv-filter-sm": String(
|
|
25
|
-
"--dv-filter-md": String(
|
|
26
|
-
"--dv-filter-lg": String(
|
|
27
|
-
"--dv-filter-xl": String(
|
|
23
|
+
"--dv-filter-xs": String(e.xs),
|
|
24
|
+
"--dv-filter-sm": String(e.sm ?? e.xs),
|
|
25
|
+
"--dv-filter-md": String(e.md ?? e.sm ?? e.xs),
|
|
26
|
+
"--dv-filter-lg": String(e.lg ?? e.md ?? e.sm ?? e.xs),
|
|
27
|
+
"--dv-filter-xl": String(e.xl ?? e.lg ?? e.md ?? e.sm ?? e.xs)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
30
|
+
function M(e) {
|
|
31
|
+
return e;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
33
|
+
function x(e) {
|
|
34
|
+
return e.map((a) => ({ ...a }));
|
|
35
35
|
}
|
|
36
|
-
function s(
|
|
37
|
-
if (typeof
|
|
38
|
-
const a = /* @__PURE__ */ new Date(`${
|
|
36
|
+
function s(e) {
|
|
37
|
+
if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e)) return;
|
|
38
|
+
const a = /* @__PURE__ */ new Date(`${e}T12:00:00Z`);
|
|
39
39
|
return Number.isNaN(a.getTime()) ? void 0 : a;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
41
|
+
function C(e) {
|
|
42
|
+
return e.toISOString().slice(0, 10);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
44
|
+
function P() {
|
|
45
|
+
const e = new Intl.DateTimeFormat("en-CA", {
|
|
46
46
|
timeZone: i.context.timezone,
|
|
47
47
|
year: "numeric",
|
|
48
48
|
month: "2-digit",
|
|
49
49
|
day: "2-digit"
|
|
50
|
-
}).formatToParts(/* @__PURE__ */ new Date()), a = Object.fromEntries(
|
|
51
|
-
return
|
|
50
|
+
}).formatToParts(/* @__PURE__ */ new Date()), a = Object.fromEntries(e.map((f) => [f.type, f.value])), n = /* @__PURE__ */ new Date(`${a.year}-${a.month}-${a.day}T12:00:00Z`);
|
|
51
|
+
return n.setUTCDate(n.getUTCDate() - 1), n;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
return i.context.variables[
|
|
53
|
+
function r(e) {
|
|
54
|
+
return i.context.variables[e];
|
|
55
55
|
}
|
|
56
|
-
function l(
|
|
57
|
-
const a =
|
|
58
|
-
return typeof a != "string" || typeof
|
|
56
|
+
function l(e) {
|
|
57
|
+
const a = r(e.startVariableId), n = r(e.endVariableId);
|
|
58
|
+
return typeof a != "string" || typeof n != "string" || !s(a) || !s(n) ? {} : { value: [a, n] };
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function m(e, a) {
|
|
61
61
|
if (!Array.isArray(a) || a.length !== 2) return;
|
|
62
|
-
const [
|
|
63
|
-
typeof
|
|
64
|
-
[
|
|
65
|
-
[
|
|
62
|
+
const [n, f] = a;
|
|
63
|
+
typeof n != "string" || typeof f != "string" || t("change", {
|
|
64
|
+
[e.startVariableId]: n,
|
|
65
|
+
[e.endVariableId]: f
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function d(
|
|
69
|
-
var
|
|
70
|
-
const a = s(
|
|
71
|
-
if (!a || !
|
|
72
|
-
const
|
|
73
|
-
return (
|
|
68
|
+
function d(e) {
|
|
69
|
+
var h, A;
|
|
70
|
+
const a = s(r(e.startVariableId)), n = s(r(e.endVariableId));
|
|
71
|
+
if (!a || !n || n.getTime() !== P().getTime()) return;
|
|
72
|
+
const f = Math.round((n.getTime() - a.getTime()) / 864e5) + 1;
|
|
73
|
+
return (A = (h = e.presets) == null ? void 0 : h.find((E) => E.days === f)) == null ? void 0 : A.id;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
var
|
|
77
|
-
const
|
|
78
|
-
if (!
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
[
|
|
82
|
-
[
|
|
75
|
+
function w(e, a) {
|
|
76
|
+
var E;
|
|
77
|
+
const n = typeof a.target.value == "string" ? a.target.value : void 0, f = (E = e.presets) == null ? void 0 : E.find((Q) => Q.id === n);
|
|
78
|
+
if (!f) return;
|
|
79
|
+
const h = P(), A = new Date(h);
|
|
80
|
+
A.setUTCDate(A.getUTCDate() - f.days + 1), t("change", {
|
|
81
|
+
[e.startVariableId]: C(A),
|
|
82
|
+
[e.endVariableId]: C(h)
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
85
|
+
function D(e, a) {
|
|
86
|
+
t("change", { [e]: a ?? null });
|
|
87
87
|
}
|
|
88
|
-
return (
|
|
88
|
+
return (e, a) => e.config ? (u(), b("div", {
|
|
89
89
|
key: 0,
|
|
90
|
-
class:
|
|
90
|
+
class: K(["dv-filter-bar", { "dv-filter-bar--flow": e.config.layout === "flow" }])
|
|
91
91
|
}, [
|
|
92
|
-
|
|
93
|
-
(
|
|
94
|
-
var
|
|
95
|
-
return
|
|
96
|
-
key:
|
|
97
|
-
class:
|
|
98
|
-
style:
|
|
92
|
+
R("div", et, [
|
|
93
|
+
(u(!0), b(H, null, G(e.config.controls, (n) => {
|
|
94
|
+
var f;
|
|
95
|
+
return u(), b("div", {
|
|
96
|
+
key: n.id,
|
|
97
|
+
class: K(["dv-filter-bar__control", `dv-filter-bar__control--${n.type}`]),
|
|
98
|
+
style: pe(g(n.layout))
|
|
99
99
|
}, [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
R("label", tt, L(n.label), 1),
|
|
101
|
+
n.type === "date-range" ? (u(), b("div", nt, [
|
|
102
|
+
k(c(Ue), Ce({
|
|
103
103
|
class: "dv-filter-bar__range-picker",
|
|
104
104
|
"allow-clear": !1,
|
|
105
|
-
disabled:
|
|
105
|
+
disabled: n.disabled ?? !1,
|
|
106
106
|
"dropdown-class-name": "dv-filter-bar__date-popup",
|
|
107
|
-
format:
|
|
108
|
-
}, l(
|
|
107
|
+
format: n.format ?? "YYYY-MM-DD"
|
|
108
|
+
}, l(n), {
|
|
109
109
|
"value-format": "YYYY-MM-DD",
|
|
110
|
-
onChange: (
|
|
110
|
+
onChange: (h) => m(n, h)
|
|
111
111
|
}), {
|
|
112
|
-
separator:
|
|
112
|
+
separator: S(() => [
|
|
113
113
|
U("至")
|
|
114
114
|
]),
|
|
115
115
|
_: 2
|
|
116
116
|
}, 1040, ["disabled", "format", "onChange"]),
|
|
117
|
-
(
|
|
117
|
+
(f = n.presets) != null && f.length ? (u(), z(c(Ne), {
|
|
118
118
|
key: 0,
|
|
119
119
|
class: "dv-filter-bar__presets",
|
|
120
|
-
disabled:
|
|
120
|
+
disabled: n.disabled ?? !1,
|
|
121
121
|
size: "small",
|
|
122
|
-
value: d(
|
|
123
|
-
onChange: (
|
|
122
|
+
value: d(n),
|
|
123
|
+
onChange: (h) => w(n, h)
|
|
124
124
|
}, {
|
|
125
|
-
default:
|
|
126
|
-
(
|
|
127
|
-
key:
|
|
128
|
-
value:
|
|
125
|
+
default: S(() => [
|
|
126
|
+
(u(!0), b(H, null, G(n.presets, (h) => (u(), z(c(je), {
|
|
127
|
+
key: h.id,
|
|
128
|
+
value: h.id
|
|
129
129
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
U(L(
|
|
130
|
+
default: S(() => [
|
|
131
|
+
U(L(h.label), 1)
|
|
132
132
|
]),
|
|
133
133
|
_: 2
|
|
134
134
|
}, 1032, ["value"]))), 128))
|
|
135
135
|
]),
|
|
136
136
|
_: 2
|
|
137
|
-
}, 1032, ["disabled", "value", "onChange"])) :
|
|
138
|
-
])) :
|
|
137
|
+
}, 1032, ["disabled", "value", "onChange"])) : $("", !0)
|
|
138
|
+
])) : n.type === "multi-select" ? (u(), z(c(de), {
|
|
139
139
|
key: 1,
|
|
140
|
-
"allow-clear":
|
|
141
|
-
disabled:
|
|
142
|
-
"max-tag-count":
|
|
140
|
+
"allow-clear": n.allowClear ?? !1,
|
|
141
|
+
disabled: n.disabled ?? !1,
|
|
142
|
+
"max-tag-count": n.maxTagCount ?? "responsive",
|
|
143
143
|
mode: "multiple",
|
|
144
144
|
"option-filter-prop": "label",
|
|
145
|
-
options:
|
|
146
|
-
placeholder:
|
|
147
|
-
"show-search":
|
|
148
|
-
value:
|
|
149
|
-
onChange: (
|
|
150
|
-
}, null, 8, ["allow-clear", "disabled", "max-tag-count", "options", "placeholder", "show-search", "value", "onChange"])) : (
|
|
145
|
+
options: x(n.options),
|
|
146
|
+
placeholder: n.placeholder ?? "",
|
|
147
|
+
"show-search": n.showSearch ?? !1,
|
|
148
|
+
value: e.context.variables[n.variableId],
|
|
149
|
+
onChange: (h) => D(n.variableId, h)
|
|
150
|
+
}, null, 8, ["allow-clear", "disabled", "max-tag-count", "options", "placeholder", "show-search", "value", "onChange"])) : (u(), z(c(de), {
|
|
151
151
|
key: 2,
|
|
152
|
-
"allow-clear":
|
|
153
|
-
disabled:
|
|
152
|
+
"allow-clear": n.allowClear ?? !1,
|
|
153
|
+
disabled: n.disabled ?? !1,
|
|
154
154
|
"option-filter-prop": "label",
|
|
155
|
-
options:
|
|
156
|
-
placeholder:
|
|
157
|
-
"show-search":
|
|
158
|
-
value:
|
|
159
|
-
onChange: (
|
|
155
|
+
options: x(n.options),
|
|
156
|
+
placeholder: n.placeholder ?? "",
|
|
157
|
+
"show-search": n.showSearch ?? !1,
|
|
158
|
+
value: e.context.variables[n.variableId],
|
|
159
|
+
onChange: (h) => D(n.variableId, h)
|
|
160
160
|
}, null, 8, ["allow-clear", "disabled", "options", "placeholder", "show-search", "value", "onChange"]))
|
|
161
161
|
], 6);
|
|
162
162
|
}), 128))
|
|
163
163
|
]),
|
|
164
|
-
|
|
164
|
+
e.config.showRefresh !== !1 ? (u(), z(c(N), {
|
|
165
165
|
key: 0,
|
|
166
166
|
title: "刷新全部"
|
|
167
167
|
}, {
|
|
168
|
-
default:
|
|
169
|
-
|
|
168
|
+
default: S(() => [
|
|
169
|
+
k(c(Y), {
|
|
170
170
|
type: "primary",
|
|
171
171
|
class: "dv-filter-bar__refresh",
|
|
172
|
-
loading:
|
|
173
|
-
onClick: a[0] || (a[0] = (
|
|
172
|
+
loading: e.loading ?? !1,
|
|
173
|
+
onClick: a[0] || (a[0] = (n) => e.$emit("refresh"))
|
|
174
174
|
}, {
|
|
175
|
-
icon:
|
|
176
|
-
|
|
175
|
+
icon: S(() => [
|
|
176
|
+
k(c(ee))
|
|
177
177
|
]),
|
|
178
|
-
default:
|
|
178
|
+
default: S(() => [
|
|
179
179
|
U(" 刷新 ")
|
|
180
180
|
]),
|
|
181
181
|
_: 1
|
|
182
182
|
}, 8, ["loading"])
|
|
183
183
|
]),
|
|
184
184
|
_: 1
|
|
185
|
-
})) :
|
|
186
|
-
], 2)) :
|
|
185
|
+
})) : $("", !0)
|
|
186
|
+
], 2)) : $("", !0);
|
|
187
187
|
}
|
|
188
|
-
}), B = (
|
|
189
|
-
const i =
|
|
190
|
-
for (const [
|
|
191
|
-
i[
|
|
188
|
+
}), B = (o, _) => {
|
|
189
|
+
const i = o.__vccOpts || o;
|
|
190
|
+
for (const [t, g] of _)
|
|
191
|
+
i[t] = g;
|
|
192
192
|
return i;
|
|
193
|
-
},
|
|
193
|
+
}, it = /* @__PURE__ */ B(at, [["__scopeId", "data-v-45855b0b"]]), ye = (o) => (Re("data-v-d457add9"), o = o(), Ie(), o), rt = { class: "dv-panel__heading" }, ot = { class: "dv-panel__title-group" }, st = { class: "dv-panel__title" }, lt = {
|
|
194
194
|
key: 0,
|
|
195
195
|
class: "dv-panel__title-note"
|
|
196
|
-
},
|
|
196
|
+
}, dt = { class: "dv-panel__actions" }, ct = {
|
|
197
197
|
key: 0,
|
|
198
198
|
class: "dv-panel__filters"
|
|
199
|
-
},
|
|
199
|
+
}, ut = {
|
|
200
200
|
key: 1,
|
|
201
201
|
class: "dv-panel__state dv-panel__state--failure",
|
|
202
202
|
role: "status"
|
|
203
|
-
},
|
|
203
|
+
}, pt = { class: "dv-panel__failure" }, ft = { class: "dv-panel__failure-copy" }, vt = { class: "dv-panel__failure-heading" }, mt = ["title"], _t = /* @__PURE__ */ ye(() => /* @__PURE__ */ R("span", { class: "dv-panel__retry-label" }, "重新加载", -1)), gt = {
|
|
204
204
|
key: 2,
|
|
205
205
|
class: "dv-panel__state dv-panel__state--loading"
|
|
206
206
|
}, ht = {
|
|
207
207
|
key: 0,
|
|
208
208
|
class: "dv-panel__state dv-panel__state--metric-empty"
|
|
209
209
|
}, yt = {
|
|
210
|
+
key: 1,
|
|
211
|
+
class: "dv-panel__state dv-panel__state--empty",
|
|
212
|
+
role: "status",
|
|
213
|
+
"aria-live": "polite"
|
|
214
|
+
}, bt = {
|
|
215
|
+
class: "dv-panel__empty-icon",
|
|
216
|
+
"aria-hidden": "true"
|
|
217
|
+
}, wt = /* @__PURE__ */ ye(() => /* @__PURE__ */ R("div", { class: "dv-panel__empty-copy" }, [
|
|
218
|
+
/* @__PURE__ */ R("div", { class: "dv-panel__empty-title" }, "暂无数据")
|
|
219
|
+
], -1)), Mt = {
|
|
210
220
|
key: 4,
|
|
211
221
|
class: "dv-panel__renderer"
|
|
212
|
-
},
|
|
222
|
+
}, xt = {
|
|
213
223
|
key: 0,
|
|
214
224
|
class: "dv-panel__refreshing"
|
|
215
|
-
},
|
|
225
|
+
}, Ct = {
|
|
216
226
|
key: 5,
|
|
217
227
|
class: "dv-panel__state dv-panel__idle"
|
|
218
|
-
},
|
|
228
|
+
}, St = {
|
|
219
229
|
key: 6,
|
|
220
230
|
class: "dv-panel__updated"
|
|
221
|
-
},
|
|
231
|
+
}, kt = /* @__PURE__ */ O({
|
|
222
232
|
__name: "DashboardPanel",
|
|
223
233
|
props: {
|
|
224
234
|
panel: {},
|
|
@@ -230,120 +240,123 @@ const Xe = { class: "dv-filter-bar__controls" }, Je = { class: "dv-filter-bar__l
|
|
|
230
240
|
refreshDisabled: { type: Boolean }
|
|
231
241
|
},
|
|
232
242
|
emits: ["refresh", "retry", "exportCsv", "exportPng", "action", "visualizationEvent"],
|
|
233
|
-
setup(
|
|
234
|
-
const
|
|
235
|
-
var
|
|
236
|
-
if (
|
|
237
|
-
return { title: "图表暂时无法展示", detail:
|
|
238
|
-
if (
|
|
239
|
-
return { title: "数据暂时无法加载", detail: (
|
|
240
|
-
}),
|
|
241
|
-
() =>
|
|
242
|
-
),
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
setup(o, { expose: _, emit: i }) {
|
|
244
|
+
const t = o, g = i, M = j(), x = j(), s = I(() => t.panel.rendererId === "metric"), C = I(() => {
|
|
245
|
+
var e;
|
|
246
|
+
if (x.value)
|
|
247
|
+
return { title: "图表暂时无法展示", detail: x.value.message };
|
|
248
|
+
if (t.state.status === "error" || t.state.status === "cancelled")
|
|
249
|
+
return { title: "数据暂时无法加载", detail: (e = t.state.error) == null ? void 0 : e.message };
|
|
250
|
+
}), P = I(
|
|
251
|
+
() => Z(t.panel, t.definition.capabilities, "csv") && !!t.state.dataset
|
|
252
|
+
), r = I(
|
|
253
|
+
() => Z(t.panel, t.definition.capabilities, "png") && !!t.state.viewModel
|
|
254
|
+
), l = I(() => P.value || r.value), m = I(() => {
|
|
255
|
+
const e = t.panel.layout.minHeight ?? (s.value ? 119 : 401), a = s.value ? 40 : 50;
|
|
256
|
+
return { minHeight: `${Math.max(e - a - 2, s.value ? 77 : 190)}px` };
|
|
257
|
+
}), d = I(
|
|
258
|
+
() => t.state.lastSuccessfulAt ? new Intl.DateTimeFormat(t.context.locale, { timeStyle: "medium", timeZone: t.context.timezone }).format(
|
|
259
|
+
new Date(t.state.lastSuccessfulAt)
|
|
248
260
|
) : ""
|
|
249
261
|
);
|
|
250
|
-
function
|
|
251
|
-
var
|
|
252
|
-
|
|
262
|
+
function w() {
|
|
263
|
+
var e, a;
|
|
264
|
+
if (r.value)
|
|
265
|
+
return (a = (e = M.value) == null ? void 0 : e.exportPng) == null ? void 0 : a.call(e);
|
|
253
266
|
}
|
|
254
|
-
function
|
|
255
|
-
|
|
267
|
+
function D(e) {
|
|
268
|
+
e.key === "csv" && P.value && g("exportCsv"), e.key === "png" && r.value && g("exportPng");
|
|
256
269
|
}
|
|
257
|
-
return
|
|
258
|
-
() => [
|
|
270
|
+
return Se((e) => (x.value = e instanceof Error ? e : new Error(String(e)), !1)), ke(
|
|
271
|
+
() => [t.state.generation, t.state.viewModel],
|
|
259
272
|
() => {
|
|
260
|
-
|
|
273
|
+
x.value = void 0;
|
|
261
274
|
}
|
|
262
|
-
),
|
|
263
|
-
class:
|
|
264
|
-
"body-style":
|
|
275
|
+
), _({ exportPng: w }), (e, a) => (u(), z(c(Ye), {
|
|
276
|
+
class: K(["dv-panel", { "dv-panel--metric": s.value }]),
|
|
277
|
+
"body-style": m.value
|
|
265
278
|
}, {
|
|
266
|
-
title:
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
279
|
+
title: S(() => [
|
|
280
|
+
R("div", rt, [
|
|
281
|
+
R("span", ot, [
|
|
282
|
+
R("span", st, L(e.panel.title), 1),
|
|
283
|
+
e.panel.description ? (u(), z(c(N), {
|
|
271
284
|
key: 0,
|
|
272
|
-
title:
|
|
285
|
+
title: e.panel.description
|
|
273
286
|
}, {
|
|
274
|
-
default:
|
|
275
|
-
|
|
287
|
+
default: S(() => [
|
|
288
|
+
k(c(Be))
|
|
276
289
|
]),
|
|
277
290
|
_: 1
|
|
278
|
-
}, 8, ["title"])) :
|
|
291
|
+
}, 8, ["title"])) : $("", !0)
|
|
279
292
|
]),
|
|
280
|
-
|
|
293
|
+
e.panel.titleNote ? (u(), b("span", lt, L(e.panel.titleNote), 1)) : $("", !0)
|
|
281
294
|
])
|
|
282
295
|
]),
|
|
283
|
-
extra:
|
|
284
|
-
var
|
|
296
|
+
extra: S(() => {
|
|
297
|
+
var n;
|
|
285
298
|
return [
|
|
286
|
-
|
|
287
|
-
|
|
299
|
+
R("div", dt, [
|
|
300
|
+
e.state.status === "stale" ? (u(), z(c(N), {
|
|
288
301
|
key: 0,
|
|
289
|
-
title: `刷新失败,当前展示上次成功数据${(
|
|
302
|
+
title: `刷新失败,当前展示上次成功数据${(n = e.state.error) != null && n.message ? `:${e.state.error.message}` : ""}`
|
|
290
303
|
}, {
|
|
291
|
-
default:
|
|
292
|
-
|
|
304
|
+
default: S(() => [
|
|
305
|
+
k(c(Ve), { class: "dv-panel__warning" })
|
|
293
306
|
]),
|
|
294
307
|
_: 1
|
|
295
|
-
}, 8, ["title"])) :
|
|
296
|
-
|
|
297
|
-
title:
|
|
308
|
+
}, 8, ["title"])) : $("", !0),
|
|
309
|
+
k(c(N), {
|
|
310
|
+
title: e.refreshDisabled ? "正在刷新全部" : "刷新"
|
|
298
311
|
}, {
|
|
299
|
-
default:
|
|
300
|
-
|
|
301
|
-
disabled:
|
|
312
|
+
default: S(() => [
|
|
313
|
+
k(c(Y), {
|
|
314
|
+
disabled: e.refreshDisabled ?? !1,
|
|
302
315
|
type: "text",
|
|
303
316
|
size: "small",
|
|
304
|
-
onClick:
|
|
317
|
+
onClick: a[0] || (a[0] = (f) => e.$emit("refresh"))
|
|
305
318
|
}, {
|
|
306
|
-
icon:
|
|
307
|
-
|
|
319
|
+
icon: S(() => [
|
|
320
|
+
k(c(ee))
|
|
308
321
|
]),
|
|
309
322
|
_: 1
|
|
310
323
|
}, 8, ["disabled"])
|
|
311
324
|
]),
|
|
312
325
|
_: 1
|
|
313
326
|
}, 8, ["title"]),
|
|
314
|
-
|
|
327
|
+
l.value ? (u(), z(c(He), {
|
|
315
328
|
key: 1,
|
|
316
329
|
placement: "bottomRight",
|
|
317
330
|
trigger: ["click"]
|
|
318
331
|
}, {
|
|
319
|
-
overlay:
|
|
320
|
-
|
|
321
|
-
default:
|
|
322
|
-
|
|
323
|
-
default:
|
|
332
|
+
overlay: S(() => [
|
|
333
|
+
k(c(qe), { onClick: D }, {
|
|
334
|
+
default: S(() => [
|
|
335
|
+
P.value ? (u(), z(c(ue), { key: "csv" }, {
|
|
336
|
+
default: S(() => [
|
|
324
337
|
U("导出 CSV")
|
|
325
338
|
]),
|
|
326
339
|
_: 1
|
|
327
|
-
})) :
|
|
328
|
-
|
|
329
|
-
default:
|
|
340
|
+
})) : $("", !0),
|
|
341
|
+
r.value ? (u(), z(c(ue), { key: "png" }, {
|
|
342
|
+
default: S(() => [
|
|
330
343
|
U("导出 PNG")
|
|
331
344
|
]),
|
|
332
345
|
_: 1
|
|
333
|
-
})) :
|
|
346
|
+
})) : $("", !0)
|
|
334
347
|
]),
|
|
335
348
|
_: 1
|
|
336
349
|
})
|
|
337
350
|
]),
|
|
338
|
-
default:
|
|
339
|
-
|
|
340
|
-
default:
|
|
341
|
-
|
|
351
|
+
default: S(() => [
|
|
352
|
+
k(c(N), { title: "下载" }, {
|
|
353
|
+
default: S(() => [
|
|
354
|
+
k(c(Y), {
|
|
342
355
|
type: "text",
|
|
343
356
|
size: "small"
|
|
344
357
|
}, {
|
|
345
|
-
icon:
|
|
346
|
-
|
|
358
|
+
icon: S(() => [
|
|
359
|
+
k(c(Oe))
|
|
347
360
|
]),
|
|
348
361
|
_: 1
|
|
349
362
|
})
|
|
@@ -352,47 +365,47 @@ const Xe = { class: "dv-filter-bar__controls" }, Je = { class: "dv-filter-bar__l
|
|
|
352
365
|
})
|
|
353
366
|
]),
|
|
354
367
|
_: 1
|
|
355
|
-
})) :
|
|
356
|
-
(
|
|
357
|
-
key:
|
|
368
|
+
})) : $("", !0),
|
|
369
|
+
(u(!0), b(H, null, G(e.panel.actions ?? [], (f) => (u(), z(c(Y), {
|
|
370
|
+
key: f.id,
|
|
358
371
|
type: "link",
|
|
359
372
|
size: "small",
|
|
360
|
-
onClick: (
|
|
373
|
+
onClick: (h) => e.$emit("action", f.id)
|
|
361
374
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
U(L(
|
|
375
|
+
default: S(() => [
|
|
376
|
+
U(L(f.label ?? f.id), 1)
|
|
364
377
|
]),
|
|
365
378
|
_: 2
|
|
366
379
|
}, 1032, ["onClick"]))), 128))
|
|
367
380
|
])
|
|
368
381
|
];
|
|
369
382
|
}),
|
|
370
|
-
default:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
383
|
+
default: S(() => [
|
|
384
|
+
e.filterSummary ? (u(), b("div", ct, L(e.filterSummary), 1)) : $("", !0),
|
|
385
|
+
C.value ? (u(), b("div", ut, [
|
|
386
|
+
R("div", pt, [
|
|
387
|
+
k(c(Ee), { class: "dv-panel__failure-icon" }),
|
|
388
|
+
R("div", ft, [
|
|
389
|
+
R("div", vt, L(C.value.title), 1),
|
|
390
|
+
C.value.detail ? (u(), b("div", {
|
|
378
391
|
key: 0,
|
|
379
392
|
class: "dv-panel__failure-detail",
|
|
380
|
-
title:
|
|
381
|
-
}, L(
|
|
393
|
+
title: C.value.detail
|
|
394
|
+
}, L(C.value.detail), 9, mt)) : $("", !0)
|
|
382
395
|
]),
|
|
383
|
-
|
|
384
|
-
default:
|
|
385
|
-
|
|
396
|
+
k(c(N), { title: "重试" }, {
|
|
397
|
+
default: S(() => [
|
|
398
|
+
k(c(Y), {
|
|
386
399
|
class: "dv-panel__retry",
|
|
387
400
|
size: "small",
|
|
388
401
|
"aria-label": "重试",
|
|
389
|
-
onClick:
|
|
402
|
+
onClick: a[1] || (a[1] = (n) => e.$emit("retry"))
|
|
390
403
|
}, {
|
|
391
|
-
icon:
|
|
392
|
-
|
|
404
|
+
icon: S(() => [
|
|
405
|
+
k(c(ee))
|
|
393
406
|
]),
|
|
394
|
-
default:
|
|
395
|
-
|
|
407
|
+
default: S(() => [
|
|
408
|
+
_t
|
|
396
409
|
]),
|
|
397
410
|
_: 1
|
|
398
411
|
})
|
|
@@ -400,68 +413,69 @@ const Xe = { class: "dv-filter-bar__controls" }, Je = { class: "dv-filter-bar__l
|
|
|
400
413
|
_: 1
|
|
401
414
|
})
|
|
402
415
|
])
|
|
403
|
-
])) :
|
|
404
|
-
|
|
405
|
-
])) :
|
|
406
|
-
s.value ? (
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
416
|
+
])) : e.state.status === "loading" && !e.state.viewModel ? (u(), b("div", gt, [
|
|
417
|
+
k(c(ce))
|
|
418
|
+
])) : e.state.status === "empty" ? (u(), b(H, { key: 3 }, [
|
|
419
|
+
s.value ? (u(), b("div", ht, "暂无数据")) : (u(), b("div", yt, [
|
|
420
|
+
R("span", bt, [
|
|
421
|
+
k(c(Fe))
|
|
422
|
+
]),
|
|
423
|
+
wt
|
|
424
|
+
]))
|
|
425
|
+
], 64)) : e.state.viewModel ? (u(), b("div", Mt, [
|
|
426
|
+
(u(), z(fe(e.renderer), {
|
|
413
427
|
ref_key: "rendererRef",
|
|
414
|
-
ref:
|
|
415
|
-
context:
|
|
416
|
-
panel:
|
|
417
|
-
"view-model":
|
|
418
|
-
onVisualizationEvent:
|
|
428
|
+
ref: M,
|
|
429
|
+
context: e.context,
|
|
430
|
+
panel: e.panel,
|
|
431
|
+
"view-model": e.state.viewModel,
|
|
432
|
+
onVisualizationEvent: a[2] || (a[2] = (n) => e.$emit("visualizationEvent", n))
|
|
419
433
|
}, null, 40, ["context", "panel", "view-model"])),
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
])) :
|
|
423
|
-
])) : (
|
|
424
|
-
|
|
434
|
+
e.state.isRefreshing ? (u(), b("div", xt, [
|
|
435
|
+
k(c(ce))
|
|
436
|
+
])) : $("", !0)
|
|
437
|
+
])) : (u(), b("div", Ct, "等待加载")),
|
|
438
|
+
e.state.lastSuccessfulAt ? (u(), b("div", St, "更新于 " + L(d.value), 1)) : $("", !0)
|
|
425
439
|
]),
|
|
426
440
|
_: 1
|
|
427
441
|
}, 8, ["class", "body-style"]));
|
|
428
442
|
}
|
|
429
|
-
}),
|
|
430
|
-
function
|
|
431
|
-
const i =
|
|
432
|
-
let
|
|
433
|
-
return
|
|
434
|
-
|
|
435
|
-
i.value =
|
|
436
|
-
}),
|
|
437
|
-
}),
|
|
443
|
+
}), Rt = /* @__PURE__ */ B(kt, [["__scopeId", "data-v-d457add9"]]);
|
|
444
|
+
function It(o, _ = {}) {
|
|
445
|
+
const i = Pe(o.snapshot);
|
|
446
|
+
let t;
|
|
447
|
+
return ve(() => {
|
|
448
|
+
t = o.subscribe((g) => {
|
|
449
|
+
i.value = g;
|
|
450
|
+
}), _.autoLoad !== !1 && o.load();
|
|
451
|
+
}), me(() => t == null ? void 0 : t()), {
|
|
438
452
|
snapshot: i,
|
|
439
|
-
context:
|
|
440
|
-
panelStates:
|
|
441
|
-
isLoading:
|
|
442
|
-
loadPanels: (
|
|
443
|
-
refreshAll: () =>
|
|
444
|
-
refreshPanels: (
|
|
445
|
-
refreshPanel: (
|
|
446
|
-
retryPanel: (
|
|
447
|
-
setVariables: (
|
|
453
|
+
context: I(() => i.value.context),
|
|
454
|
+
panelStates: I(() => i.value.panelStates),
|
|
455
|
+
isLoading: I(() => i.value.isGlobalLoading),
|
|
456
|
+
loadPanels: (g) => o.loadPanels(g),
|
|
457
|
+
refreshAll: () => o.refreshAll(),
|
|
458
|
+
refreshPanels: (g, M) => o.refreshPanels(g, M),
|
|
459
|
+
refreshPanel: (g) => o.refreshPanel(g),
|
|
460
|
+
retryPanel: (g) => o.retryPanel(g),
|
|
461
|
+
setVariables: (g, M) => o.setVariables(g, M)
|
|
448
462
|
};
|
|
449
463
|
}
|
|
450
|
-
function
|
|
451
|
-
const
|
|
452
|
-
|
|
464
|
+
function Pt(o, _, i) {
|
|
465
|
+
const t = URL.createObjectURL(new Blob([o], { type: _ }));
|
|
466
|
+
be(t, i), window.setTimeout(() => URL.revokeObjectURL(t), 0);
|
|
453
467
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
468
|
+
function $t(o, _) {
|
|
469
|
+
be(o, _);
|
|
456
470
|
}
|
|
457
|
-
function
|
|
471
|
+
function be(o, _) {
|
|
458
472
|
const i = document.createElement("a");
|
|
459
|
-
i.href =
|
|
473
|
+
i.href = o, i.download = _, i.hidden = !0, document.body.append(i), i.click(), i.remove();
|
|
460
474
|
}
|
|
461
|
-
const
|
|
475
|
+
const Dt = {
|
|
462
476
|
key: 0,
|
|
463
477
|
class: "dv-dashboard__header"
|
|
464
|
-
},
|
|
478
|
+
}, At = { key: 0 }, zt = { class: "dv-dashboard__grid" }, Lt = ["data-panel-id"], Tt = /* @__PURE__ */ O({
|
|
465
479
|
__name: "DashboardRenderer",
|
|
466
480
|
props: {
|
|
467
481
|
runtime: {},
|
|
@@ -473,153 +487,167 @@ const Rt = {
|
|
|
473
487
|
syncUrl: { type: Boolean, default: !0 },
|
|
474
488
|
showHeader: { type: Boolean, default: !0 }
|
|
475
489
|
},
|
|
476
|
-
setup(
|
|
477
|
-
const i =
|
|
478
|
-
let s,
|
|
479
|
-
|
|
490
|
+
setup(o, { expose: _ }) {
|
|
491
|
+
const i = o, t = /* @__PURE__ */ new Map(), g = j(), M = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Set();
|
|
492
|
+
let s, C = !1, P = !1;
|
|
493
|
+
$e(() => {
|
|
480
494
|
i.syncUrl && typeof window < "u" && i.runtime.restoreContext(window.location.search);
|
|
481
495
|
});
|
|
482
496
|
const {
|
|
483
|
-
context:
|
|
497
|
+
context: r,
|
|
484
498
|
panelStates: l,
|
|
485
|
-
isLoading:
|
|
499
|
+
isLoading: m,
|
|
486
500
|
loadPanels: d,
|
|
487
|
-
refreshAll:
|
|
488
|
-
refreshPanels:
|
|
489
|
-
refreshPanel:
|
|
501
|
+
refreshAll: w,
|
|
502
|
+
refreshPanels: D,
|
|
503
|
+
refreshPanel: e,
|
|
490
504
|
retryPanel: a,
|
|
491
|
-
setVariables:
|
|
492
|
-
} =
|
|
493
|
-
|
|
505
|
+
setVariables: n
|
|
506
|
+
} = It(i.runtime, { autoLoad: i.autoLoad && !i.lazyLoad });
|
|
507
|
+
ve(() => {
|
|
494
508
|
var v;
|
|
495
509
|
if (!(!i.autoLoad || !i.lazyLoad)) {
|
|
496
510
|
if (typeof IntersectionObserver > "u") {
|
|
497
|
-
|
|
511
|
+
w();
|
|
498
512
|
return;
|
|
499
513
|
}
|
|
500
|
-
|
|
514
|
+
C = !0, s = new IntersectionObserver(we, {
|
|
501
515
|
rootMargin: i.lazyLoadRootMargin
|
|
502
|
-
}), (v =
|
|
516
|
+
}), (v = g.value) == null || v.querySelectorAll(".dv-dashboard__cell").forEach((p) => s == null ? void 0 : s.observe(p));
|
|
503
517
|
}
|
|
504
|
-
}),
|
|
505
|
-
s == null || s.disconnect(), s = void 0,
|
|
518
|
+
}), me(() => {
|
|
519
|
+
s == null || s.disconnect(), s = void 0, C = !1, M.clear(), x.clear();
|
|
506
520
|
});
|
|
507
|
-
const
|
|
508
|
-
() => (i.runtime.config.variables ?? []).map((v) => `${v.label}: ${
|
|
521
|
+
const f = I(
|
|
522
|
+
() => (i.runtime.config.variables ?? []).map((v) => `${v.label}: ${h(r.value.variables[v.id])}`).join(" · ")
|
|
509
523
|
);
|
|
510
|
-
function
|
|
524
|
+
function h(v) {
|
|
511
525
|
return Array.isArray(v) ? v.join(", ") : String(v ?? "--");
|
|
512
526
|
}
|
|
513
|
-
function
|
|
514
|
-
const
|
|
527
|
+
function A(v) {
|
|
528
|
+
const p = v.layout.span;
|
|
515
529
|
return {
|
|
516
|
-
"--dv-panel-xs": String(
|
|
517
|
-
"--dv-panel-sm": String(
|
|
518
|
-
"--dv-panel-md": String(
|
|
519
|
-
"--dv-panel-lg": String(
|
|
520
|
-
"--dv-panel-xl": String(
|
|
530
|
+
"--dv-panel-xs": String(p.xs),
|
|
531
|
+
"--dv-panel-sm": String(p.sm ?? p.xs),
|
|
532
|
+
"--dv-panel-md": String(p.md ?? p.sm ?? p.xs),
|
|
533
|
+
"--dv-panel-lg": String(p.lg ?? p.md ?? p.sm ?? p.xs),
|
|
534
|
+
"--dv-panel-xl": String(p.xl ?? p.lg ?? p.md ?? p.sm ?? p.xs)
|
|
521
535
|
};
|
|
522
536
|
}
|
|
523
|
-
function
|
|
524
|
-
var
|
|
525
|
-
const
|
|
526
|
-
return
|
|
537
|
+
function E(v) {
|
|
538
|
+
var y;
|
|
539
|
+
const p = ((y = i.panelComponents) == null ? void 0 : y[v.id]) ?? i.rendererRegistry.require(v.rendererId).component;
|
|
540
|
+
return De(Ae(p));
|
|
527
541
|
}
|
|
528
|
-
function
|
|
529
|
-
|
|
542
|
+
function Q(v, p) {
|
|
543
|
+
p ? t.set(v, p) : t.delete(v);
|
|
530
544
|
}
|
|
531
|
-
function
|
|
532
|
-
v.forEach((
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
}), !(!
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
|
|
545
|
+
function we(v) {
|
|
546
|
+
v.forEach((p) => {
|
|
547
|
+
const y = p.target.dataset.panelId;
|
|
548
|
+
y && (p.isIntersecting ? (M.add(y), x.add(y)) : (M.delete(y), x.delete(y)));
|
|
549
|
+
}), !(!x.size || P) && (P = !0, queueMicrotask(() => {
|
|
550
|
+
P = !1;
|
|
551
|
+
const p = Array.from(x);
|
|
552
|
+
x.clear(), d(p);
|
|
539
553
|
}));
|
|
540
554
|
}
|
|
541
555
|
function oe() {
|
|
542
|
-
return
|
|
556
|
+
return C ? D(M, { deferUnselected: !0 }) : w();
|
|
543
557
|
}
|
|
544
|
-
async function
|
|
545
|
-
const
|
|
558
|
+
async function Me(v) {
|
|
559
|
+
const p = n(v, C ? M : void 0);
|
|
546
560
|
if (i.syncUrl && typeof window < "u") {
|
|
547
|
-
const
|
|
561
|
+
const y = Ze(i.runtime.config, i.runtime.context, window.location.search);
|
|
548
562
|
window.history.replaceState(
|
|
549
563
|
window.history.state,
|
|
550
564
|
"",
|
|
551
|
-
`${window.location.pathname}${
|
|
565
|
+
`${window.location.pathname}${y}${window.location.hash}`
|
|
552
566
|
);
|
|
553
567
|
}
|
|
554
|
-
await
|
|
568
|
+
await p;
|
|
555
569
|
}
|
|
556
|
-
function
|
|
557
|
-
var
|
|
558
|
-
const
|
|
559
|
-
if (!
|
|
560
|
-
|
|
561
|
-
|
|
570
|
+
function se(v) {
|
|
571
|
+
var q;
|
|
572
|
+
const p = i.runtime.config.panels.find((xe) => xe.id === v);
|
|
573
|
+
if (!p || !Z(
|
|
574
|
+
p,
|
|
575
|
+
i.runtime.dataRuntime.registries.rendererDefinitions.require(p.rendererId).capabilities,
|
|
576
|
+
"csv"
|
|
577
|
+
))
|
|
578
|
+
return;
|
|
579
|
+
const y = (q = l.value[v]) == null ? void 0 : q.dataset;
|
|
580
|
+
if (!y) return;
|
|
581
|
+
const T = Qe(y, p, r.value);
|
|
582
|
+
Pt(T, "text/csv;charset=utf-8", Xe(i.runtime.config.id, p.id));
|
|
562
583
|
}
|
|
563
|
-
function
|
|
564
|
-
var
|
|
565
|
-
const
|
|
566
|
-
|
|
584
|
+
function le(v) {
|
|
585
|
+
var T;
|
|
586
|
+
const p = i.runtime.config.panels.find((q) => q.id === v);
|
|
587
|
+
if (!p || !Z(
|
|
588
|
+
p,
|
|
589
|
+
i.runtime.dataRuntime.registries.rendererDefinitions.require(p.rendererId).capabilities,
|
|
590
|
+
"png"
|
|
591
|
+
))
|
|
592
|
+
return;
|
|
593
|
+
const y = (T = t.get(v)) == null ? void 0 : T.exportPng();
|
|
594
|
+
y && $t(y, `${i.runtime.config.id}-${v}.png`);
|
|
567
595
|
}
|
|
568
|
-
return
|
|
596
|
+
return _({ refreshAll: oe, refreshPanel: e, exportCsv: se, exportPng: le }), (v, p) => (u(), b("section", {
|
|
569
597
|
ref_key: "dashboardElement",
|
|
570
|
-
ref:
|
|
598
|
+
ref: g,
|
|
571
599
|
class: "dv-dashboard"
|
|
572
600
|
}, [
|
|
573
|
-
v.showHeader ? (
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
v.runtime.config.description ? (
|
|
601
|
+
v.showHeader ? (u(), b("header", Dt, [
|
|
602
|
+
R("div", null, [
|
|
603
|
+
R("h1", null, L(v.runtime.config.title), 1),
|
|
604
|
+
v.runtime.config.description ? (u(), b("p", At, L(v.runtime.config.description), 1)) : $("", !0)
|
|
577
605
|
])
|
|
578
|
-
])) :
|
|
579
|
-
v.runtime.config.filterBar ? (
|
|
606
|
+
])) : $("", !0),
|
|
607
|
+
v.runtime.config.filterBar ? (u(), z(it, {
|
|
580
608
|
key: 1,
|
|
581
609
|
config: v.runtime.config.filterBar,
|
|
582
|
-
context:
|
|
583
|
-
loading:
|
|
584
|
-
onChange:
|
|
610
|
+
context: c(r),
|
|
611
|
+
loading: c(m),
|
|
612
|
+
onChange: Me,
|
|
585
613
|
onRefresh: oe
|
|
586
|
-
}, null, 8, ["config", "context", "loading"])) :
|
|
587
|
-
|
|
588
|
-
(
|
|
589
|
-
key:
|
|
614
|
+
}, null, 8, ["config", "context", "loading"])) : $("", !0),
|
|
615
|
+
R("div", zt, [
|
|
616
|
+
(u(!0), b(H, null, G(v.runtime.config.panels, (y) => (u(), b("div", {
|
|
617
|
+
key: y.id,
|
|
590
618
|
class: "dv-dashboard__cell",
|
|
591
|
-
"data-panel-id":
|
|
592
|
-
style:
|
|
619
|
+
"data-panel-id": y.id,
|
|
620
|
+
style: pe(A(y))
|
|
593
621
|
}, [
|
|
594
|
-
|
|
622
|
+
k(Rt, {
|
|
595
623
|
ref_for: !0,
|
|
596
|
-
ref: (T) =>
|
|
597
|
-
context:
|
|
598
|
-
definition: v.runtime.dataRuntime.registries.rendererDefinitions.require(
|
|
599
|
-
"filter-summary":
|
|
600
|
-
panel:
|
|
601
|
-
"refresh-disabled":
|
|
602
|
-
renderer:
|
|
603
|
-
state:
|
|
604
|
-
onAction: (T) => v.runtime.executePanelAction(
|
|
605
|
-
onExportCsv: (T) =>
|
|
606
|
-
onExportPng: (T) =>
|
|
607
|
-
onRefresh: (T) =>
|
|
608
|
-
onRetry: (T) =>
|
|
609
|
-
onVisualizationEvent:
|
|
624
|
+
ref: (T) => Q(y.id, T),
|
|
625
|
+
context: c(r),
|
|
626
|
+
definition: v.runtime.dataRuntime.registries.rendererDefinitions.require(y.rendererId),
|
|
627
|
+
"filter-summary": f.value,
|
|
628
|
+
panel: y,
|
|
629
|
+
"refresh-disabled": c(m),
|
|
630
|
+
renderer: E(y),
|
|
631
|
+
state: c(l)[y.id],
|
|
632
|
+
onAction: (T) => v.runtime.executePanelAction(y.id, T),
|
|
633
|
+
onExportCsv: (T) => se(y.id),
|
|
634
|
+
onExportPng: (T) => le(y.id),
|
|
635
|
+
onRefresh: (T) => c(e)(y.id),
|
|
636
|
+
onRetry: (T) => c(a)(y.id),
|
|
637
|
+
onVisualizationEvent: p[0] || (p[0] = (T) => v.runtime.dispatchEvent(T))
|
|
610
638
|
}, null, 8, ["context", "definition", "filter-summary", "panel", "refresh-disabled", "renderer", "state", "onAction", "onExportCsv", "onExportPng", "onRefresh", "onRetry"])
|
|
611
|
-
], 12,
|
|
639
|
+
], 12, Lt))), 128))
|
|
612
640
|
])
|
|
613
641
|
], 512));
|
|
614
642
|
}
|
|
615
|
-
}),
|
|
616
|
-
function
|
|
617
|
-
return
|
|
643
|
+
}), cn = /* @__PURE__ */ B(Tt, [["__scopeId", "data-v-39ec9b07"]]);
|
|
644
|
+
function ie(o) {
|
|
645
|
+
return o.type === "percent" ? X.PERCENT : o.type === "decimal" ? X.DECIMAL : X.COMMAS;
|
|
618
646
|
}
|
|
619
|
-
function
|
|
620
|
-
return typeof
|
|
647
|
+
function re(o) {
|
|
648
|
+
return typeof o == "object" && o !== null ? o : {};
|
|
621
649
|
}
|
|
622
|
-
const
|
|
650
|
+
const Et = { class: "dv-chart-renderer dv-bar-renderer" }, Ft = /* @__PURE__ */ O({
|
|
623
651
|
__name: "BarRenderer",
|
|
624
652
|
props: {
|
|
625
653
|
viewModel: {},
|
|
@@ -627,82 +655,82 @@ const At = { class: "dv-chart-renderer dv-bar-renderer" }, zt = /* @__PURE__ */
|
|
|
627
655
|
context: {}
|
|
628
656
|
},
|
|
629
657
|
emits: ["visualizationEvent"],
|
|
630
|
-
setup(
|
|
631
|
-
const
|
|
632
|
-
function
|
|
633
|
-
const d =
|
|
634
|
-
return
|
|
658
|
+
setup(o, { expose: _, emit: i }) {
|
|
659
|
+
const t = o, g = i, M = j();
|
|
660
|
+
function x(r, l, m = !1) {
|
|
661
|
+
const d = m ? F.formatAxis(r, l.format, t.context) : F.formatTooltip(r, l.format, t.context), w = l.format.type === "currency" || l.format.type === "percent" || l.format.unit;
|
|
662
|
+
return r != null && r !== "" && l.unit && !w ? `${d}${l.unit}` : d;
|
|
635
663
|
}
|
|
636
|
-
const s =
|
|
637
|
-
categories: [...
|
|
638
|
-
colors: [...
|
|
639
|
-
orientation:
|
|
640
|
-
...
|
|
664
|
+
const s = I(() => ({
|
|
665
|
+
categories: [...t.viewModel.categories],
|
|
666
|
+
colors: [...ae],
|
|
667
|
+
orientation: t.viewModel.orientation,
|
|
668
|
+
...t.viewModel.visibleCount !== void 0 ? { visibleCount: t.viewModel.visibleCount } : {},
|
|
641
669
|
grid: {
|
|
642
670
|
top: 18,
|
|
643
|
-
right:
|
|
671
|
+
right: t.viewModel.orientation === "horizontal" && t.viewModel.showLabels ? 78 : 18,
|
|
644
672
|
bottom: 10,
|
|
645
673
|
left: 16,
|
|
646
674
|
containLabel: !0
|
|
647
675
|
},
|
|
648
676
|
categoryAxis: {
|
|
649
|
-
...
|
|
650
|
-
...
|
|
651
|
-
axisLabel: { ...
|
|
677
|
+
...J,
|
|
678
|
+
...t.viewModel.orientation === "horizontal" && t.viewModel.visibleCount !== void 0 ? { inverse: !0 } : {},
|
|
679
|
+
axisLabel: { ...J.axisLabel, interval: 0 }
|
|
652
680
|
},
|
|
653
681
|
valueAxis: {
|
|
654
|
-
...
|
|
682
|
+
...W,
|
|
655
683
|
splitNumber: 4,
|
|
656
684
|
axisLabel: {
|
|
657
|
-
...
|
|
685
|
+
...W.axisLabel,
|
|
658
686
|
hideOverlap: !0,
|
|
659
|
-
...
|
|
687
|
+
...t.viewModel.series[0] ? { formatter: (r) => x(r, t.viewModel.series[0], !0) } : {}
|
|
660
688
|
}
|
|
661
689
|
},
|
|
662
690
|
tooltip: {
|
|
663
|
-
...
|
|
691
|
+
...ne,
|
|
664
692
|
axisPointer: { type: "shadow", shadowStyle: { color: "rgba(91, 114, 238, 0.055)" } }
|
|
665
693
|
},
|
|
666
|
-
...
|
|
667
|
-
series:
|
|
668
|
-
name:
|
|
669
|
-
data: [...
|
|
670
|
-
formatType:
|
|
671
|
-
valueFormatter: (l) =>
|
|
672
|
-
showLabel:
|
|
694
|
+
...t.viewModel.stacked ? { stack: "total" } : {},
|
|
695
|
+
series: t.viewModel.series.map((r) => ({
|
|
696
|
+
name: r.label,
|
|
697
|
+
data: [...r.values],
|
|
698
|
+
formatType: ie(r.format),
|
|
699
|
+
valueFormatter: (l) => x(l, r),
|
|
700
|
+
showLabel: t.viewModel.showLabels,
|
|
673
701
|
itemStyle: {
|
|
674
|
-
borderRadius:
|
|
702
|
+
borderRadius: t.viewModel.orientation === "horizontal" ? [0, 5, 5, 0] : [5, 5, 0, 0]
|
|
675
703
|
}
|
|
676
704
|
}))
|
|
677
705
|
}));
|
|
678
|
-
function
|
|
679
|
-
const l =
|
|
680
|
-
d &&
|
|
706
|
+
function C(r) {
|
|
707
|
+
const l = re(r), m = typeof l.seriesIndex == "number" ? l.seriesIndex : 0, d = t.panel.binding.type === "bar" ? t.panel.binding : void 0;
|
|
708
|
+
d && g("visualizationEvent", {
|
|
681
709
|
type: "dataPointClick",
|
|
682
|
-
panelId:
|
|
710
|
+
panelId: t.panel.id,
|
|
683
711
|
datasetId: d.datasetId,
|
|
684
712
|
fields: Object.freeze({
|
|
685
713
|
[d.categoryField]: l.name,
|
|
686
714
|
...d.seriesField ? { [d.seriesField]: l.seriesName } : {},
|
|
687
|
-
[d.valueFields[d.seriesField ? 0 :
|
|
715
|
+
[d.valueFields[d.seriesField ? 0 : m] ?? d.valueFields[0]]: l.value
|
|
688
716
|
})
|
|
689
717
|
});
|
|
690
718
|
}
|
|
691
|
-
function
|
|
692
|
-
var
|
|
693
|
-
return (
|
|
719
|
+
function P() {
|
|
720
|
+
var r;
|
|
721
|
+
return (r = M.value) == null ? void 0 : r.exportPng();
|
|
694
722
|
}
|
|
695
|
-
return
|
|
696
|
-
|
|
723
|
+
return _({ exportPng: P }), (r, l) => (u(), b("div", Et, [
|
|
724
|
+
k(c(ze), {
|
|
697
725
|
ref_key: "chartRef",
|
|
698
|
-
ref:
|
|
726
|
+
ref: M,
|
|
699
727
|
option: s.value,
|
|
700
|
-
size:
|
|
701
|
-
onDataPointClick:
|
|
728
|
+
size: c(te).SMALL,
|
|
729
|
+
onDataPointClick: C
|
|
702
730
|
}, null, 8, ["option", "size"])
|
|
703
731
|
]));
|
|
704
732
|
}
|
|
705
|
-
}),
|
|
733
|
+
}), Vt = /* @__PURE__ */ B(Ft, [["__scopeId", "data-v-4f111bdf"]]), Ot = { class: "dv-chart-renderer dv-line-renderer" }, Bt = /* @__PURE__ */ O({
|
|
706
734
|
__name: "LineRenderer",
|
|
707
735
|
props: {
|
|
708
736
|
viewModel: {},
|
|
@@ -710,63 +738,63 @@ const At = { class: "dv-chart-renderer dv-bar-renderer" }, zt = /* @__PURE__ */
|
|
|
710
738
|
context: {}
|
|
711
739
|
},
|
|
712
740
|
emits: ["visualizationEvent"],
|
|
713
|
-
setup(
|
|
714
|
-
const
|
|
715
|
-
function
|
|
716
|
-
const d =
|
|
717
|
-
return s(d,
|
|
741
|
+
setup(o, { expose: _, emit: i }) {
|
|
742
|
+
const t = o, g = i, M = j();
|
|
743
|
+
function x(l, m) {
|
|
744
|
+
const d = F.formatAxis(l, m.format, t.context);
|
|
745
|
+
return s(d, m);
|
|
718
746
|
}
|
|
719
|
-
function s(l,
|
|
720
|
-
const d =
|
|
721
|
-
return
|
|
747
|
+
function s(l, m) {
|
|
748
|
+
const d = m.format.type === "currency" || m.format.type === "percent" || m.format.unit;
|
|
749
|
+
return m.unit && !d ? `${l}${m.unit}` : l;
|
|
722
750
|
}
|
|
723
|
-
const
|
|
751
|
+
const C = I(() => {
|
|
724
752
|
const l = Array.from(
|
|
725
|
-
new Map(
|
|
726
|
-
),
|
|
753
|
+
new Map(t.viewModel.series.map((d) => [d.axisKey, d])).values()
|
|
754
|
+
), m = new Map(l.map((d, w) => [d.axisKey, w]));
|
|
727
755
|
return {
|
|
728
|
-
colors: [...
|
|
756
|
+
colors: [...ae],
|
|
729
757
|
grid: { top: 18, right: l.length > 1 ? 24 : 16, bottom: 10, left: 16, containLabel: !0 },
|
|
730
758
|
tooltip: {
|
|
731
|
-
...
|
|
759
|
+
...ne,
|
|
732
760
|
axisPointer: { type: "line", lineStyle: { color: "#b8c1d1", type: "dashed" } }
|
|
733
761
|
},
|
|
734
762
|
xAxis: {
|
|
735
|
-
data:
|
|
736
|
-
...
|
|
737
|
-
...
|
|
738
|
-
valueFormatter: (d) =>
|
|
763
|
+
data: t.viewModel.categories.map(String),
|
|
764
|
+
...J,
|
|
765
|
+
...t.viewModel.categoryFormat ? {
|
|
766
|
+
valueFormatter: (d) => F.formatAxis(d, t.viewModel.categoryFormat, t.context)
|
|
739
767
|
} : {}
|
|
740
768
|
},
|
|
741
|
-
yAxis: l.map((d,
|
|
742
|
-
...
|
|
743
|
-
position:
|
|
744
|
-
show:
|
|
769
|
+
yAxis: l.map((d, w) => ({
|
|
770
|
+
...W,
|
|
771
|
+
position: w === 0 ? "left" : "right",
|
|
772
|
+
show: w < 2,
|
|
745
773
|
axisLabel: {
|
|
746
|
-
...
|
|
747
|
-
formatter: (
|
|
774
|
+
...W.axisLabel,
|
|
775
|
+
formatter: (D) => x(D, d)
|
|
748
776
|
},
|
|
749
777
|
splitLine: {
|
|
750
|
-
show:
|
|
778
|
+
show: w === 0,
|
|
751
779
|
lineStyle: { color: "#edf0f5", type: "dashed" }
|
|
752
780
|
}
|
|
753
781
|
})),
|
|
754
|
-
series:
|
|
782
|
+
series: t.viewModel.series.map((d, w) => ({
|
|
755
783
|
name: d.label,
|
|
756
|
-
data: d.values.map((
|
|
757
|
-
formatType:
|
|
758
|
-
valueFormatter: (
|
|
759
|
-
const
|
|
760
|
-
return
|
|
784
|
+
data: d.values.map((D) => D ?? void 0),
|
|
785
|
+
formatType: ie(d.format),
|
|
786
|
+
valueFormatter: (D) => {
|
|
787
|
+
const e = F.formatTooltip(D, d.format, t.context);
|
|
788
|
+
return D == null || D === "" ? e : s(e, d);
|
|
761
789
|
},
|
|
762
|
-
showLabel:
|
|
763
|
-
smooth:
|
|
764
|
-
yAxisIndex:
|
|
790
|
+
showLabel: t.viewModel.showLabels,
|
|
791
|
+
smooth: t.viewModel.smooth,
|
|
792
|
+
yAxisIndex: m.get(d.axisKey) ?? 0,
|
|
765
793
|
showSymbol: !1,
|
|
766
794
|
symbol: "circle",
|
|
767
795
|
symbolSize: 7,
|
|
768
|
-
lineStyle: { width:
|
|
769
|
-
...
|
|
796
|
+
lineStyle: { width: w === 0 ? 3 : 2.25 },
|
|
797
|
+
...w === 0 ? {
|
|
770
798
|
areaStyle: {
|
|
771
799
|
opacity: 1,
|
|
772
800
|
color: {
|
|
@@ -784,83 +812,83 @@ const At = { class: "dv-chart-renderer dv-bar-renderer" }, zt = /* @__PURE__ */
|
|
|
784
812
|
} : {}
|
|
785
813
|
})),
|
|
786
814
|
markLine: {
|
|
787
|
-
xAxis:
|
|
788
|
-
yAxis:
|
|
815
|
+
xAxis: t.viewModel.annotations.filter((d) => d.type === "category").map((d) => String(d.value)),
|
|
816
|
+
yAxis: t.viewModel.annotations.filter((d) => d.type === "value").map((d) => String(d.value))
|
|
789
817
|
}
|
|
790
818
|
};
|
|
791
819
|
});
|
|
792
|
-
function
|
|
793
|
-
const
|
|
794
|
-
|
|
820
|
+
function P(l) {
|
|
821
|
+
const m = re(l), d = typeof m.seriesIndex == "number" ? m.seriesIndex : 0, w = t.panel.binding.type === "line" ? t.panel.binding : void 0;
|
|
822
|
+
w && g("visualizationEvent", {
|
|
795
823
|
type: "dataPointClick",
|
|
796
|
-
panelId:
|
|
797
|
-
datasetId:
|
|
824
|
+
panelId: t.panel.id,
|
|
825
|
+
datasetId: w.datasetId,
|
|
798
826
|
fields: Object.freeze({
|
|
799
|
-
[
|
|
800
|
-
...
|
|
801
|
-
[
|
|
827
|
+
[w.xField]: m.name,
|
|
828
|
+
...w.seriesField ? { [w.seriesField]: m.seriesName } : {},
|
|
829
|
+
[w.yFields[w.seriesField ? 0 : d] ?? w.yFields[0]]: m.value
|
|
802
830
|
})
|
|
803
831
|
});
|
|
804
832
|
}
|
|
805
|
-
function
|
|
833
|
+
function r() {
|
|
806
834
|
var l;
|
|
807
|
-
return (l =
|
|
835
|
+
return (l = M.value) == null ? void 0 : l.exportPng();
|
|
808
836
|
}
|
|
809
|
-
return
|
|
810
|
-
|
|
837
|
+
return _({ exportPng: r }), (l, m) => (u(), b("div", Ot, [
|
|
838
|
+
k(c(Le), {
|
|
811
839
|
ref_key: "chartRef",
|
|
812
|
-
ref:
|
|
813
|
-
option:
|
|
814
|
-
size:
|
|
815
|
-
onDataPointClick:
|
|
840
|
+
ref: M,
|
|
841
|
+
option: C.value,
|
|
842
|
+
size: c(te).SMALL,
|
|
843
|
+
onDataPointClick: P
|
|
816
844
|
}, null, 8, ["option", "size"])
|
|
817
845
|
]));
|
|
818
846
|
}
|
|
819
|
-
}),
|
|
847
|
+
}), Ut = /* @__PURE__ */ B(Bt, [["__scopeId", "data-v-efc34766"]]), Nt = { class: "dv-metric" }, jt = { class: "dv-metric__value" }, Yt = { class: "dv-metric__number" }, Ht = {
|
|
820
848
|
key: 0,
|
|
821
849
|
class: "dv-metric__unit"
|
|
822
|
-
},
|
|
850
|
+
}, qt = {
|
|
823
851
|
key: 0,
|
|
824
852
|
class: "dv-metric__comparison"
|
|
825
|
-
},
|
|
853
|
+
}, Kt = /* @__PURE__ */ O({
|
|
826
854
|
__name: "MetricRenderer",
|
|
827
855
|
props: {
|
|
828
856
|
viewModel: {},
|
|
829
857
|
panel: {},
|
|
830
858
|
context: {}
|
|
831
859
|
},
|
|
832
|
-
setup(
|
|
833
|
-
const
|
|
834
|
-
() =>
|
|
835
|
-
),
|
|
836
|
-
() =>
|
|
837
|
-
),
|
|
838
|
-
const s =
|
|
839
|
-
return s ?
|
|
840
|
-
}),
|
|
841
|
-
var s,
|
|
842
|
-
return ((s =
|
|
843
|
-
}),
|
|
844
|
-
const s =
|
|
860
|
+
setup(o) {
|
|
861
|
+
const _ = o, i = I(
|
|
862
|
+
() => F.formatDisplay(_.viewModel.value, _.viewModel.format, _.context)
|
|
863
|
+
), t = I(
|
|
864
|
+
() => _.viewModel.format.type === "currency" || _.viewModel.format.type === "percent" ? void 0 : _.viewModel.unit
|
|
865
|
+
), g = I(() => {
|
|
866
|
+
const s = _.viewModel.comparison;
|
|
867
|
+
return s ? F.formatDisplay(s.value, s.format, _.context) : "";
|
|
868
|
+
}), M = I(() => {
|
|
869
|
+
var s, C;
|
|
870
|
+
return ((s = _.viewModel.comparison) == null ? void 0 : s.direction) === "up" ? _e : ((C = _.viewModel.comparison) == null ? void 0 : C.direction) === "down" ? ge : he;
|
|
871
|
+
}), x = I(() => {
|
|
872
|
+
const s = _.viewModel.comparison;
|
|
845
873
|
return !s || s.direction === "flat" ? "neutral" : s.colorMode === "direction" ? s.direction === "up" ? "unfavorable" : "favorable" : s.meaning === "neutral" ? "neutral" : s.meaning === "positive" && s.direction === "up" || s.meaning === "negative" && s.direction === "down" ? "favorable" : "unfavorable";
|
|
846
874
|
});
|
|
847
|
-
return (s,
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
875
|
+
return (s, C) => (u(), b("div", Nt, [
|
|
876
|
+
R("div", jt, [
|
|
877
|
+
R("span", Yt, L(i.value), 1),
|
|
878
|
+
t.value ? (u(), b("span", Ht, L(t.value), 1)) : $("", !0)
|
|
851
879
|
]),
|
|
852
|
-
s.viewModel.comparison ? (
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
class:
|
|
880
|
+
s.viewModel.comparison ? (u(), b("div", qt, [
|
|
881
|
+
R("span", null, L(s.viewModel.comparison.label), 1),
|
|
882
|
+
R("strong", {
|
|
883
|
+
class: K(`dv-metric__comparison--${x.value}`)
|
|
856
884
|
}, [
|
|
857
|
-
(
|
|
858
|
-
U(" " + L(
|
|
885
|
+
(u(), z(fe(M.value))),
|
|
886
|
+
U(" " + L(g.value), 1)
|
|
859
887
|
], 2)
|
|
860
|
-
])) :
|
|
888
|
+
])) : $("", !0)
|
|
861
889
|
]));
|
|
862
890
|
}
|
|
863
|
-
}),
|
|
891
|
+
}), Gt = /* @__PURE__ */ B(Kt, [["__scopeId", "data-v-efa26253"]]), Wt = { class: "dv-chart-renderer dv-pie-renderer" }, Zt = /* @__PURE__ */ O({
|
|
864
892
|
__name: "PieRenderer",
|
|
865
893
|
props: {
|
|
866
894
|
viewModel: {},
|
|
@@ -868,60 +896,60 @@ const At = { class: "dv-chart-renderer dv-bar-renderer" }, zt = /* @__PURE__ */
|
|
|
868
896
|
context: {}
|
|
869
897
|
},
|
|
870
898
|
emits: ["visualizationEvent"],
|
|
871
|
-
setup(
|
|
872
|
-
const
|
|
873
|
-
function
|
|
874
|
-
const l =
|
|
875
|
-
return
|
|
899
|
+
setup(o, { expose: _, emit: i }) {
|
|
900
|
+
const t = o, g = i, M = j();
|
|
901
|
+
function x(r) {
|
|
902
|
+
const l = F.formatTooltip(r, t.viewModel.valueFormat, t.context), m = t.viewModel.valueFormat.type === "currency" || t.viewModel.valueFormat.type === "percent" || t.viewModel.valueFormat.unit;
|
|
903
|
+
return t.viewModel.unit && !m ? `${l}${t.viewModel.unit}` : l;
|
|
876
904
|
}
|
|
877
|
-
const s =
|
|
878
|
-
colors: [...
|
|
879
|
-
donut:
|
|
880
|
-
showLegend:
|
|
905
|
+
const s = I(() => ({
|
|
906
|
+
colors: [...ae],
|
|
907
|
+
donut: t.viewModel.donut,
|
|
908
|
+
showLegend: t.viewModel.showLegend,
|
|
881
909
|
showLabels: !1,
|
|
882
910
|
center: ["50%", "43%"],
|
|
883
|
-
radius:
|
|
911
|
+
radius: t.viewModel.donut ? ["50%", "70%"] : "70%",
|
|
884
912
|
itemStyle: { borderColor: "#fff", borderWidth: 3, borderRadius: 4 },
|
|
885
|
-
tooltip: { ...
|
|
886
|
-
series:
|
|
887
|
-
name:
|
|
888
|
-
data:
|
|
889
|
-
formatType:
|
|
890
|
-
valueFormatter:
|
|
913
|
+
tooltip: { ...ne },
|
|
914
|
+
series: t.viewModel.items.map((r) => ({
|
|
915
|
+
name: r.label,
|
|
916
|
+
data: r.value,
|
|
917
|
+
formatType: ie(t.viewModel.valueFormat),
|
|
918
|
+
valueFormatter: x
|
|
891
919
|
})),
|
|
892
|
-
...
|
|
920
|
+
...t.viewModel.donut ? {
|
|
893
921
|
aggregation: {
|
|
894
|
-
total:
|
|
895
|
-
label:
|
|
896
|
-
valueFormatter:
|
|
897
|
-
...
|
|
922
|
+
total: t.viewModel.items.reduce((r, l) => r + l.value, 0),
|
|
923
|
+
label: t.panel.title.replace(/占比$/, ""),
|
|
924
|
+
valueFormatter: x,
|
|
925
|
+
...t.viewModel.unit ? { unit: t.viewModel.unit } : {}
|
|
898
926
|
}
|
|
899
927
|
} : {}
|
|
900
928
|
}));
|
|
901
|
-
function
|
|
902
|
-
const l =
|
|
903
|
-
|
|
929
|
+
function C(r) {
|
|
930
|
+
const l = re(r), m = t.panel.binding.type === "pie" ? t.panel.binding : void 0;
|
|
931
|
+
m && g("visualizationEvent", {
|
|
904
932
|
type: "dataPointClick",
|
|
905
|
-
panelId:
|
|
906
|
-
datasetId:
|
|
907
|
-
fields: Object.freeze({ [
|
|
933
|
+
panelId: t.panel.id,
|
|
934
|
+
datasetId: m.datasetId,
|
|
935
|
+
fields: Object.freeze({ [m.nameField]: l.name, [m.valueField]: l.value })
|
|
908
936
|
});
|
|
909
937
|
}
|
|
910
|
-
function
|
|
911
|
-
var
|
|
912
|
-
return (
|
|
938
|
+
function P() {
|
|
939
|
+
var r;
|
|
940
|
+
return (r = M.value) == null ? void 0 : r.exportPng();
|
|
913
941
|
}
|
|
914
|
-
return
|
|
915
|
-
|
|
942
|
+
return _({ exportPng: P }), (r, l) => (u(), b("div", Wt, [
|
|
943
|
+
k(c(Te), {
|
|
916
944
|
ref_key: "chartRef",
|
|
917
|
-
ref:
|
|
945
|
+
ref: M,
|
|
918
946
|
option: s.value,
|
|
919
|
-
size:
|
|
920
|
-
onDataPointClick:
|
|
947
|
+
size: c(te).SMALL,
|
|
948
|
+
onDataPointClick: C
|
|
921
949
|
}, null, 8, ["option", "size"])
|
|
922
950
|
]));
|
|
923
951
|
}
|
|
924
|
-
}),
|
|
952
|
+
}), Qt = /* @__PURE__ */ B(Zt, [["__scopeId", "data-v-ccdee116"]]), Xt = { class: "dv-table-scroll" }, Jt = /* @__PURE__ */ O({
|
|
925
953
|
__name: "TableRenderer",
|
|
926
954
|
props: {
|
|
927
955
|
viewModel: {},
|
|
@@ -929,8 +957,8 @@ const At = { class: "dv-chart-renderer dv-bar-renderer" }, zt = /* @__PURE__ */
|
|
|
929
957
|
context: {}
|
|
930
958
|
},
|
|
931
959
|
emits: ["visualizationEvent"],
|
|
932
|
-
setup(
|
|
933
|
-
const i =
|
|
960
|
+
setup(o, { emit: _ }) {
|
|
961
|
+
const i = o, t = _, g = I(
|
|
934
962
|
() => i.viewModel.columns.map((a) => ({
|
|
935
963
|
title: a.label,
|
|
936
964
|
dataIndex: a.field,
|
|
@@ -938,66 +966,66 @@ const At = { class: "dv-chart-renderer dv-bar-renderer" }, zt = /* @__PURE__ */
|
|
|
938
966
|
...a.width ? { width: a.width } : {},
|
|
939
967
|
sorter: a.sortable,
|
|
940
968
|
...a.filterable ? {
|
|
941
|
-
filters: Array.from(new Set(i.viewModel.rows.map((
|
|
942
|
-
onFilter: (
|
|
969
|
+
filters: Array.from(new Set(i.viewModel.rows.map((n) => String(n[a.field] ?? "")))).slice(0, 50).map((n) => ({ text: n || "--", value: n })),
|
|
970
|
+
onFilter: (n, f) => String(f[a.field] ?? "") === String(n)
|
|
943
971
|
} : {},
|
|
944
|
-
customRender: ({ text:
|
|
972
|
+
customRender: ({ text: n }) => x(n, a)
|
|
945
973
|
}))
|
|
946
974
|
);
|
|
947
|
-
function
|
|
948
|
-
return
|
|
975
|
+
function M(a, n) {
|
|
976
|
+
return F.formatDisplay(
|
|
949
977
|
a,
|
|
950
|
-
|
|
951
|
-
type:
|
|
978
|
+
n.format ?? {
|
|
979
|
+
type: n.dataType === "date" ? "date" : n.dataType === "datetime" ? "datetime" : "number"
|
|
952
980
|
},
|
|
953
981
|
i.context
|
|
954
982
|
);
|
|
955
983
|
}
|
|
956
|
-
function
|
|
957
|
-
const
|
|
958
|
-
return
|
|
984
|
+
function x(a, n) {
|
|
985
|
+
const f = M(a, n);
|
|
986
|
+
return n.display ? n.display.type === "progress" ? C(a, f, n.display) : n.display.type === "trend" ? P(a, f, n.display) : r(a, f, n.display) : f;
|
|
959
987
|
}
|
|
960
988
|
function s(a) {
|
|
961
989
|
return typeof a == "number" && Number.isFinite(a) ? a : void 0;
|
|
962
990
|
}
|
|
963
|
-
function
|
|
964
|
-
const
|
|
965
|
-
if (
|
|
966
|
-
const
|
|
991
|
+
function C(a, n, f) {
|
|
992
|
+
const h = s(a);
|
|
993
|
+
if (h === void 0) return n;
|
|
994
|
+
const A = f.max ?? 1, E = Math.min(100, Math.max(0, h / A * 100));
|
|
967
995
|
return V("div", { class: "dv-table__progress-cell" }, [
|
|
968
|
-
V(
|
|
969
|
-
V("span", { class: "dv-table__cell-value" },
|
|
996
|
+
V(Ke, { percent: E, showInfo: !1, size: "small", strokeWidth: 6 }),
|
|
997
|
+
V("span", { class: "dv-table__cell-value" }, n)
|
|
970
998
|
]);
|
|
971
999
|
}
|
|
972
|
-
function
|
|
973
|
-
const
|
|
974
|
-
if (
|
|
975
|
-
const
|
|
976
|
-
return V("span", { class: ["dv-table__trend", `dv-table__trend--${
|
|
1000
|
+
function P(a, n, f) {
|
|
1001
|
+
const h = s(a);
|
|
1002
|
+
if (h === void 0) return n;
|
|
1003
|
+
const A = h > 0 ? f.positiveTone ?? "success" : h < 0 ? f.negativeTone ?? "danger" : f.zeroTone ?? "neutral", E = h > 0 ? _e : h < 0 ? ge : he;
|
|
1004
|
+
return V("span", { class: ["dv-table__trend", `dv-table__trend--${A}`] }, [V(E), V("span", n)]);
|
|
977
1005
|
}
|
|
978
|
-
function
|
|
979
|
-
var
|
|
980
|
-
const
|
|
981
|
-
return l(
|
|
1006
|
+
function r(a, n, f) {
|
|
1007
|
+
var A;
|
|
1008
|
+
const h = ((A = f.toneByValue) == null ? void 0 : A[String(a ?? "")]) ?? f.defaultTone ?? "neutral";
|
|
1009
|
+
return l(n, h);
|
|
982
1010
|
}
|
|
983
|
-
function l(a,
|
|
1011
|
+
function l(a, n, f) {
|
|
984
1012
|
return V(
|
|
985
|
-
|
|
986
|
-
{ class: ["dv-table__tag", `dv-table__tag--${
|
|
1013
|
+
Ge,
|
|
1014
|
+
{ class: ["dv-table__tag", `dv-table__tag--${n}`] },
|
|
987
1015
|
{ default: () => [V("span", a)] }
|
|
988
1016
|
);
|
|
989
1017
|
}
|
|
990
|
-
const
|
|
1018
|
+
const m = /* @__PURE__ */ new WeakMap();
|
|
991
1019
|
let d = 0;
|
|
992
|
-
function
|
|
993
|
-
const
|
|
994
|
-
if (
|
|
995
|
-
const
|
|
996
|
-
return
|
|
1020
|
+
function w(a) {
|
|
1021
|
+
const n = m.get(a);
|
|
1022
|
+
if (n) return n;
|
|
1023
|
+
const f = `row-${++d}`;
|
|
1024
|
+
return m.set(a, f), f;
|
|
997
1025
|
}
|
|
998
|
-
function
|
|
1026
|
+
function D(a) {
|
|
999
1027
|
return {
|
|
1000
|
-
onClick: () =>
|
|
1028
|
+
onClick: () => t("visualizationEvent", {
|
|
1001
1029
|
type: "rowClick",
|
|
1002
1030
|
panelId: i.panel.id,
|
|
1003
1031
|
datasetId: i.panel.binding.datasetId,
|
|
@@ -1005,60 +1033,60 @@ const At = { class: "dv-chart-renderer dv-bar-renderer" }, zt = /* @__PURE__ */
|
|
|
1005
1033
|
})
|
|
1006
1034
|
};
|
|
1007
1035
|
}
|
|
1008
|
-
function
|
|
1036
|
+
function e() {
|
|
1009
1037
|
}
|
|
1010
|
-
return (a,
|
|
1011
|
-
|
|
1038
|
+
return (a, n) => (u(), b("div", Xt, [
|
|
1039
|
+
k(c(We), {
|
|
1012
1040
|
class: "dv-table",
|
|
1013
|
-
columns:
|
|
1041
|
+
columns: g.value,
|
|
1014
1042
|
"data-source": [...a.viewModel.rows],
|
|
1015
1043
|
pagination: a.viewModel.showPagination ? { pageSize: a.viewModel.pageSize, showSizeChanger: !1 } : !1,
|
|
1016
|
-
"row-key":
|
|
1044
|
+
"row-key": w,
|
|
1017
1045
|
scroll: { x: "max-content" },
|
|
1018
1046
|
size: "small",
|
|
1019
|
-
onChange:
|
|
1020
|
-
"custom-row":
|
|
1047
|
+
onChange: e,
|
|
1048
|
+
"custom-row": D
|
|
1021
1049
|
}, null, 8, ["columns", "data-source", "pagination"])
|
|
1022
1050
|
]));
|
|
1023
1051
|
}
|
|
1024
|
-
}),
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1027
|
-
{ id: "metric", component:
|
|
1028
|
-
{ id: "line", component:
|
|
1029
|
-
{ id: "bar", component:
|
|
1030
|
-
{ id: "pie", component:
|
|
1031
|
-
{ id: "table", component:
|
|
1032
|
-
]),
|
|
1052
|
+
}), en = /* @__PURE__ */ B(Jt, [["__scopeId", "data-v-c8a717c4"]]);
|
|
1053
|
+
function un(o) {
|
|
1054
|
+
return o.registerMany([
|
|
1055
|
+
{ id: "metric", component: Gt },
|
|
1056
|
+
{ id: "line", component: Ut },
|
|
1057
|
+
{ id: "bar", component: Vt },
|
|
1058
|
+
{ id: "pie", component: Qt },
|
|
1059
|
+
{ id: "table", component: en }
|
|
1060
|
+
]), o;
|
|
1033
1061
|
}
|
|
1034
|
-
class
|
|
1062
|
+
class tn extends Je {
|
|
1035
1063
|
constructor() {
|
|
1036
1064
|
super("VueVisualizationRenderer");
|
|
1037
1065
|
}
|
|
1038
1066
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return new
|
|
1067
|
+
function pn() {
|
|
1068
|
+
return new tn();
|
|
1041
1069
|
}
|
|
1042
1070
|
export {
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1071
|
+
Vt as BarRenderer,
|
|
1072
|
+
it as DashboardFilterBar,
|
|
1073
|
+
Rt as DashboardPanel,
|
|
1074
|
+
cn as DashboardRenderer,
|
|
1075
|
+
Ut as LineRenderer,
|
|
1076
|
+
Gt as MetricRenderer,
|
|
1077
|
+
Qt as PieRenderer,
|
|
1078
|
+
J as STANDARD_CATEGORY_AXIS,
|
|
1079
|
+
ae as STANDARD_CHART_COLORS,
|
|
1080
|
+
ne as STANDARD_CHART_TOOLTIP,
|
|
1081
|
+
W as STANDARD_VALUE_AXIS,
|
|
1082
|
+
en as TableRenderer,
|
|
1083
|
+
tn as VueRendererRegistry,
|
|
1084
|
+
re as chartEventFields,
|
|
1085
|
+
pn as createVueRendererRegistry,
|
|
1086
|
+
Pt as downloadBlob,
|
|
1087
|
+
$t as downloadDataUrl,
|
|
1088
|
+
un as registerStandardVueRenderers,
|
|
1089
|
+
ie as toChartFormat,
|
|
1090
|
+
It as useDashboardRuntime
|
|
1063
1091
|
};
|
|
1064
1092
|
//# sourceMappingURL=index.js.map
|