hydro-graph 1.0.43 → 1.0.44
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/dist/hydro-graph.css +1 -1
- package/dist/hydro-graph.es.js +745 -809
- package/dist/hydro-graph.umd.js +27 -27
- package/package.json +1 -1
package/dist/hydro-graph.es.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import * as
|
|
3
|
-
import { LineChart as
|
|
4
|
-
import { TooltipComponent as
|
|
5
|
-
import { LabelLayout as
|
|
6
|
-
import { CanvasRenderer as
|
|
1
|
+
import { ref as fe, watch as Ce, nextTick as Te, onMounted as dn, resolveComponent as oe, resolveDirective as cn, withDirectives as me, openBlock as V, createElementBlock as ee, createTextVNode as ze, toDisplayString as ue, vShow as Le, createBlock as Z, createCommentVNode as _, Fragment as Se, renderList as Ne, normalizeStyle as W, withCtx as q, createElementVNode as te, createVNode as he, unref as Be, normalizeClass as fn, defineComponent as un, computed as Ye } from "vue";
|
|
2
|
+
import * as Re from "echarts/core";
|
|
3
|
+
import { LineChart as hn, BarChart as pn } from "echarts/charts";
|
|
4
|
+
import { TooltipComponent as An, GridComponent as yn, LegendComponent as xn, DataZoomComponent as gn } from "echarts/components";
|
|
5
|
+
import { LabelLayout as mn } from "echarts/features";
|
|
6
|
+
import { CanvasRenderer as vn } from "echarts/renderers";
|
|
7
7
|
import S from "dayjs";
|
|
8
|
-
import
|
|
9
|
-
import { ElMessage as
|
|
10
|
-
import { ArrowDown as
|
|
11
|
-
function
|
|
12
|
-
let
|
|
13
|
-
return window.performance && typeof window.performance.now == "function" && (
|
|
8
|
+
import Ue from "html2canvas";
|
|
9
|
+
import { ElMessage as bn, ElCheckbox as En, ElIcon as Mn, ElDropdown as wn, ElDropdownMenu as Sn, ElDropdownItem as In } from "element-plus";
|
|
10
|
+
import { ArrowDown as He } from "@element-plus/icons-vue";
|
|
11
|
+
function On() {
|
|
12
|
+
let l = (/* @__PURE__ */ new Date()).getTime();
|
|
13
|
+
return window.performance && typeof window.performance.now == "function" && (l += performance.now()), "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
|
|
14
14
|
/[xy]/g,
|
|
15
|
-
function(
|
|
16
|
-
const
|
|
17
|
-
return
|
|
15
|
+
function(Y) {
|
|
16
|
+
const h = (l + Math.random() * 16) % 16 | 0;
|
|
17
|
+
return l = Math.floor(l / 16), (Y == "x" ? h : h & 3 | 8).toString(16);
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const Ve = [
|
|
22
22
|
"#E3A8F7",
|
|
23
23
|
"#5C2D91",
|
|
24
24
|
"#8AE2C2",
|
|
@@ -72,20 +72,20 @@ const Ye = [
|
|
|
72
72
|
"#00B4DB",
|
|
73
73
|
"#0083B0"
|
|
74
74
|
];
|
|
75
|
-
function
|
|
76
|
-
let
|
|
77
|
-
return
|
|
75
|
+
function ve(l) {
|
|
76
|
+
let g = /^(\d{4})-(\d{2})-(\d{2}) ([01]\d|2[0-3]):[0-5]\d$/, Y = /^(\d{2})-(\d{2}) ([01]\d|2[0-3]):[0-5]\d$/, h = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
77
|
+
return g.test(l) || Y.test(l) || h.test(l);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
let
|
|
81
|
-
return
|
|
79
|
+
function C(l, g, Y) {
|
|
80
|
+
let h = "";
|
|
81
|
+
return g - l <= 1 ? h = 0.1 : g - l <= 5 ? h = 0.5 : g - l <= 10 ? h = 1 : g - l <= 25 ? h = 2.5 : g - l <= 50 ? h = 5 : g - l <= 100 ? h = 10 : g - l <= 250 ? h = 25 : g - l <= 500 ? h = 50 : g - l <= 1e3 ? h = 100 : g - l <= 2500 ? h = 250 : g - l <= 5e3 ? h = 500 : g - l <= 1e4 ? h = 1e3 : g - l <= 2e4 ? h = 2e3 : g - l <= 3e4 ? h = 3e3 : g - l <= 4e4 ? h = 4e3 : g - l <= 5e4 ? h = 5e3 : g - l <= 6e4 ? h = 6e3 : g - l <= 7e4 ? h = 7e3 : g - l <= 8e4 ? h = 8e3 : g - l <= 9e4 ? h = 9e3 : g - l <= 1e5 ? h = 1e4 : g - l <= 11e4 ? h = 11e3 : g - l <= 12e4 ? h = 12e3 : g - l <= 13e4 ? h = 13e3 : g - l <= 14e4 ? h = 14e3 : g - l <= 15e4 ? h = 15e3 : g - l <= 16e4 ? h = 16e3 : g - l <= 17e4 ? h = 17e3 : g - l <= 18e4 ? h = 18e3 : g - l <= 19e4 ? h = 19e3 : g - l <= 2e5 && (h = 2e4), Y == 1 && (h = h * 2), h;
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
if (isNaN(
|
|
83
|
+
function le(l) {
|
|
84
|
+
if (isNaN(l))
|
|
85
85
|
return "";
|
|
86
|
-
var
|
|
87
|
-
if (
|
|
88
|
-
for (var
|
|
86
|
+
var g = parseFloat(l);
|
|
87
|
+
if (g > 1) {
|
|
88
|
+
for (var Y = 0, h = [
|
|
89
89
|
1,
|
|
90
90
|
10,
|
|
91
91
|
100,
|
|
@@ -96,54 +96,54 @@ function ne(o) {
|
|
|
96
96
|
1e7,
|
|
97
97
|
1e8,
|
|
98
98
|
1e9
|
|
99
|
-
],
|
|
100
|
-
|
|
101
|
-
if (
|
|
102
|
-
return
|
|
103
|
-
var M = Math.round(
|
|
104
|
-
return M = M *
|
|
99
|
+
], n = 0; n < h.length; n++)
|
|
100
|
+
g >= h[n] && g < h[n + 1] && (Y = h[n]);
|
|
101
|
+
if (Y == 0)
|
|
102
|
+
return g.toString();
|
|
103
|
+
var M = Math.round(g / Y * 100) / 100;
|
|
104
|
+
return M = M * Y, M >= 100 ? M.toFixed(0) : M >= 10 ? M.toFixed(1) : M.toFixed(2);
|
|
105
105
|
} else {
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
108
|
-
if (
|
|
109
|
-
return "-" +
|
|
106
|
+
if (g >= 0)
|
|
107
|
+
return g.toFixed(3);
|
|
108
|
+
if (g < 0)
|
|
109
|
+
return "-" + le(Math.abs(g));
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
const
|
|
114
|
-
let
|
|
115
|
-
for (;
|
|
116
|
-
const M =
|
|
117
|
-
M %
|
|
112
|
+
function Qe(l, g, Y) {
|
|
113
|
+
const h = [];
|
|
114
|
+
let n = new Date(l);
|
|
115
|
+
for (; n <= g; ) {
|
|
116
|
+
const M = n.getMinutes();
|
|
117
|
+
M % Y === 0 && h.push(S(new Date(n)).format("YYYY-MM-DD HH:mm")), n.setMinutes(M + 1);
|
|
118
118
|
}
|
|
119
|
-
return
|
|
119
|
+
return h;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
let
|
|
124
|
-
for (let
|
|
125
|
-
|
|
126
|
-
let M = S(
|
|
127
|
-
|
|
121
|
+
function Fn(l, g) {
|
|
122
|
+
l = l.sort((n, M) => Date.parse(n) - Date.parse(M));
|
|
123
|
+
let Y, h = [];
|
|
124
|
+
for (let n = 0; n < l.length; n++) {
|
|
125
|
+
n == 0 && (Y = l[n]);
|
|
126
|
+
let M = S(l[n]).add(g, "minute").format("YYYY-MM-DD HH:mm");
|
|
127
|
+
l.includes(M) || (h.push({ startTm: Y, endTm: l[n] }), n + 1 < l.length && (Y = l[n + 1]));
|
|
128
128
|
}
|
|
129
|
-
return
|
|
129
|
+
return h;
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const kn = (l) => new Promise((g) => {
|
|
132
132
|
setTimeout(() => {
|
|
133
|
-
|
|
133
|
+
g({ statusCode: 200, data: l.rzw * 1e3 });
|
|
134
134
|
}, 100);
|
|
135
|
-
}),
|
|
136
|
-
const
|
|
137
|
-
for (const [
|
|
138
|
-
|
|
139
|
-
return
|
|
140
|
-
},
|
|
135
|
+
}), Dn = "data:image/png;base64,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", Cn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAAaVBMVEUAAAAQFBgQExcQEhYLFRcQExcQExYPExcQEhcOFBUQEhcQExcPEhcPExcQEhcQExYQERcPExYPEhcQExYQEhcTExMUFBQQExcQExcQExcQFBcPEhcPExcPFBYSEhgcHBwRExcOExgQExdmmIFTAAAAInRSTlMAQL+AFuzVxbEj3KOWdF9OR7qnnmgZDPrkyY5WQzIqCXs2T8mN8gAAAeVJREFUeNrt3dlqwzAQRmFFdpx9X7omaf/3f8iSrSW0FqFy0Micc+2bDxsGI9A4IiIiIqJHNJuMFz5hxWzQiGOs9PU30Yzdk0y0jnSUstI+DtKTlXpRjkJ2KmIgK9mp344vS+rGQLo65V3KOjoXM01kCdIBAgQIECChgAABEg4IECDhgAABEg4IkLZBNrPipul7lpB1pV+95AcpF/qrIjfIVmoHxLcEstajIV6XHgsZqaZ5ZpCqxrF0eUFKnfO3rQqXGaT2CSBAgAABAgQIECBAgAABAgQIEFsQr38HBAgQIECAOF+bLvm6bEFaM9mBAAECBAgQIECAAAECBAgQIECAADlBruUO+Q4IECA/AQECJBwQIEDCAQECJBwQIEDCAQECJBwQIEDCAQECJBwQIEDCGYQ8XyCdpOncJgKykJ2Gd7wz0xuTri1jIFPZaRoDcUtZaeyiIK4rIx0iIe5VFqoGLhbi5r3ky8Wqj2aubd12JkXC5uX9IzPzgFgLiLWANN1h1w7IvlLvrQWQgY695Q/p69gwf8hQp/KHCAiQU0CAAAkHBAiQcAYhgyskbQ0s+36WnV7i/gTsNGKz/7GhrDRyUb3LSlt3V9bP1rqfLrZypPS9uiaaTVY+Yf3JvHRERERERA/oC7GKf5yH1bdrAAAAAElFTkSuQmCC", Tn = "data:image/png;base64,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", Ge = (l, g) => {
|
|
136
|
+
const Y = l.__vccOpts || l;
|
|
137
|
+
for (const [h, n] of g)
|
|
138
|
+
Y[h] = n;
|
|
139
|
+
return Y;
|
|
140
|
+
}, zn = { class: "title" }, Ln = { class: "subTitle" }, Nn = { style: { width: "20px", display: "flex", "justify-content": "center" } }, Bn = { class: "mychart" }, Yn = ["id"], Rn = {
|
|
141
141
|
__name: "HydroGraph",
|
|
142
142
|
props: {
|
|
143
143
|
id: {
|
|
144
144
|
type: String,
|
|
145
145
|
default() {
|
|
146
|
-
return
|
|
146
|
+
return On();
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
chartOption: {
|
|
@@ -177,74 +177,74 @@ const On = (o) => new Promise((m) => {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
|
-
setup(
|
|
181
|
-
|
|
182
|
-
un,
|
|
183
|
-
hn,
|
|
184
|
-
pn,
|
|
180
|
+
setup(l, { expose: g, emit: Y }) {
|
|
181
|
+
Re.use([
|
|
185
182
|
An,
|
|
186
|
-
|
|
187
|
-
fn,
|
|
183
|
+
yn,
|
|
188
184
|
xn,
|
|
189
|
-
|
|
185
|
+
gn,
|
|
186
|
+
hn,
|
|
187
|
+
pn,
|
|
188
|
+
mn,
|
|
189
|
+
vn
|
|
190
190
|
]);
|
|
191
|
-
const
|
|
192
|
-
|
|
191
|
+
const h = fe(), n = l;
|
|
192
|
+
n.chartOption.series || (n.chartOption.series = []);
|
|
193
193
|
let M = {};
|
|
194
|
-
const
|
|
195
|
-
let
|
|
196
|
-
|
|
197
|
-
() =>
|
|
194
|
+
const Pe = Y;
|
|
195
|
+
let re = {};
|
|
196
|
+
Ce(
|
|
197
|
+
() => n.chartOption,
|
|
198
198
|
() => {
|
|
199
|
-
|
|
200
|
-
let
|
|
201
|
-
document.getElementById(
|
|
202
|
-
...
|
|
203
|
-
moveOnMouseMove:
|
|
199
|
+
Te(() => {
|
|
200
|
+
let s = setInterval(() => {
|
|
201
|
+
document.getElementById(n.id) && document.getElementById(n.id).offsetHeight > 100 && document.getElementById(n.id).offsetWidth > 100 && (k && k.getOption() && !n.chartOption.restoreZoom && (re = {
|
|
202
|
+
...k.getOption().dataZoom[0],
|
|
203
|
+
moveOnMouseMove: n.chartOption.series.some(
|
|
204
204
|
(f) => f.openBarDrag && (f.type == "line" || f.type == "markLine")
|
|
205
205
|
) ? "ctrl" : !0
|
|
206
|
-
}),
|
|
206
|
+
}), Ee(), clearInterval(s));
|
|
207
207
|
}, 100);
|
|
208
208
|
});
|
|
209
209
|
},
|
|
210
210
|
{ deep: !0, immediate: !0 }
|
|
211
211
|
);
|
|
212
|
-
let
|
|
213
|
-
|
|
214
|
-
() =>
|
|
212
|
+
let ie = {};
|
|
213
|
+
Ce(
|
|
214
|
+
() => n.legendList,
|
|
215
215
|
() => {
|
|
216
|
-
|
|
217
|
-
let
|
|
218
|
-
let
|
|
219
|
-
return
|
|
220
|
-
...
|
|
221
|
-
...
|
|
216
|
+
k && (ie = k.getOption().legend[0].selected);
|
|
217
|
+
let s = n.legendList.map((i) => {
|
|
218
|
+
let p = Oe.find((r) => r.code == i.name);
|
|
219
|
+
return p ? {
|
|
220
|
+
...i,
|
|
221
|
+
...p
|
|
222
222
|
} : {
|
|
223
|
-
...
|
|
223
|
+
...i
|
|
224
224
|
};
|
|
225
|
-
}), f = JSON.parse(JSON.stringify(
|
|
226
|
-
M = {},
|
|
227
|
-
const
|
|
228
|
-
M[
|
|
229
|
-
M[
|
|
230
|
-
let
|
|
231
|
-
return
|
|
232
|
-
...
|
|
233
|
-
isSelected:
|
|
225
|
+
}), f = JSON.parse(JSON.stringify(P.value));
|
|
226
|
+
M = {}, P.value = s.map((i) => {
|
|
227
|
+
const p = f.find((O) => O.name == i.name);
|
|
228
|
+
M[i.name] = i, i.children && (i.children = i.children.map((O) => {
|
|
229
|
+
M[O.name] = O;
|
|
230
|
+
let x = "";
|
|
231
|
+
return n.chartOption.isDefaultElement === !1 ? x = ie[O.name] != null ? ie[O.name] : O.isSelected : p && p.children && p.children.find((N) => N.name == O.name) ? x = p.children.find((N) => N.name == O.name).isSelected : x = O.isSelected, {
|
|
232
|
+
...O,
|
|
233
|
+
isSelected: x,
|
|
234
234
|
id: Math.random()
|
|
235
235
|
};
|
|
236
236
|
}));
|
|
237
|
-
let
|
|
238
|
-
return
|
|
239
|
-
...
|
|
240
|
-
isSelected:
|
|
237
|
+
let r = "";
|
|
238
|
+
return n.chartOption.isDefaultElement === !1 ? r = ie[i.name] != null ? ie[i.name] : i.isSelected : i.compel ? r = i.isSelected : p ? r = p.isSelected : r = i.isSelected, {
|
|
239
|
+
...i,
|
|
240
|
+
isSelected: r,
|
|
241
241
|
id: Math.random()
|
|
242
242
|
};
|
|
243
243
|
});
|
|
244
244
|
},
|
|
245
245
|
{ deep: !0 }
|
|
246
246
|
);
|
|
247
|
-
const
|
|
247
|
+
const Ie = [
|
|
248
248
|
{ name: "实况雨量", type: "bar", color: "#0000ff", unit: "mm" },
|
|
249
249
|
{ name: "实测水位", type: "line", color: "#304755", unit: "m" },
|
|
250
250
|
{ name: "库容", type: "line", color: "#197e2b", unit: "万m³" },
|
|
@@ -260,133 +260,133 @@ const On = (o) => new Promise((m) => {
|
|
|
260
260
|
{ name: "累计降雨", type: "line", color: "red", unit: "mm" },
|
|
261
261
|
{ name: "可纳雨量", type: "bar", color: "#0000ff", unit: "mm" },
|
|
262
262
|
{ name: "作业预报时间", type: "markLine", color: "#ff0000" }
|
|
263
|
-
],
|
|
263
|
+
], Oe = [
|
|
264
264
|
{ name: "实况雨量", code: "P", color: "#0000ff", icon: "histogram" },
|
|
265
265
|
{ name: "实测水位", code: "RZ", color: "#304755", icon: "straightLine", iconWidth: "30", iconHeight: "30" },
|
|
266
266
|
{ name: "库容", code: "W", color: "#197e2b", icon: "straightLine", iconWidth: "30", iconHeight: "30" }
|
|
267
|
-
],
|
|
268
|
-
|
|
269
|
-
let
|
|
270
|
-
return
|
|
271
|
-
...
|
|
272
|
-
...
|
|
267
|
+
], Je = ["校核洪水位", "设计洪水位", "正常高水位", "坝顶高程", "死水位", "主汛期"], P = fe(
|
|
268
|
+
n.legendList.map((s, f) => {
|
|
269
|
+
let i = Oe.find((p) => p.code == s.name);
|
|
270
|
+
return s.color || (s.color = Ve[f]), i ? {
|
|
271
|
+
...s,
|
|
272
|
+
...i
|
|
273
273
|
} : {
|
|
274
|
-
...
|
|
274
|
+
...s
|
|
275
275
|
};
|
|
276
276
|
})
|
|
277
277
|
);
|
|
278
|
-
|
|
279
|
-
M[
|
|
278
|
+
P.value.forEach((s) => {
|
|
279
|
+
M[s.name] = s, s.children && s.children.forEach((f) => {
|
|
280
280
|
M[f.name] = f;
|
|
281
281
|
});
|
|
282
282
|
});
|
|
283
|
-
const
|
|
284
|
-
let
|
|
285
|
-
const
|
|
286
|
-
var
|
|
283
|
+
const se = fe(!0);
|
|
284
|
+
let Fe = null;
|
|
285
|
+
const We = (s) => {
|
|
286
|
+
var i;
|
|
287
287
|
let f = [];
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
se.value = s, P.value.forEach((p) => {
|
|
289
|
+
p.isSelected = s, f.push(p.name), p.children && p.children.forEach((r) => {
|
|
290
|
+
r.isSelected = s, f.push(r.name);
|
|
291
291
|
});
|
|
292
|
-
}), f.forEach((
|
|
293
|
-
|
|
294
|
-
}),
|
|
295
|
-
},
|
|
296
|
-
var
|
|
297
|
-
let
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}) :
|
|
302
|
-
|
|
292
|
+
}), f.forEach((p) => {
|
|
293
|
+
X[p] = s, xe(p, s);
|
|
294
|
+
}), re = { ...(i = k.getOption()) == null ? void 0 : i.dataZoom[0] }, Ee();
|
|
295
|
+
}, pe = (s, f) => {
|
|
296
|
+
var p;
|
|
297
|
+
let i = [];
|
|
298
|
+
P.value.forEach((r) => {
|
|
299
|
+
r.name == f ? (r.isSelected = s, r.children ? r.children.forEach((O) => {
|
|
300
|
+
O.isSelected = s, i.push(O.name);
|
|
301
|
+
}) : i.push(r.name)) : r.children && r.children.forEach((O) => {
|
|
302
|
+
O.name == f && (O.isSelected = s, i.push(O.name), r.children.filter((x) => x.isSelected).length == r.children.length ? r.isSelected = !0 : r.isSelected = !1);
|
|
303
303
|
});
|
|
304
|
-
}),
|
|
305
|
-
Array.isArray(
|
|
306
|
-
}),
|
|
304
|
+
}), i.forEach((r) => {
|
|
305
|
+
Array.isArray(r) ? (X[r[0]] = s, X[r[1]] = s, xe(r[0], s), xe(r[1], s)) : (X[r] = s, xe(r, s));
|
|
306
|
+
}), Fe = P.value.some((r) => r.isSelected == !1), Fe ? se.value = !1 : se.value = !0, re = { ...(p = k.getOption()) == null ? void 0 : p.dataZoom[0] }, Ee();
|
|
307
307
|
};
|
|
308
|
-
|
|
309
|
-
window.addEventListener("keydown",
|
|
308
|
+
dn(() => {
|
|
309
|
+
window.addEventListener("keydown", Xe);
|
|
310
310
|
});
|
|
311
|
-
let
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
314
|
-
let f = JSON.parse(JSON.stringify(
|
|
315
|
-
f.series.forEach((
|
|
316
|
-
|
|
317
|
-
}),
|
|
311
|
+
let be = {};
|
|
312
|
+
const Xe = (s) => {
|
|
313
|
+
if (s.key === "i") {
|
|
314
|
+
let f = JSON.parse(JSON.stringify(k.getOption()));
|
|
315
|
+
f.series.forEach((i) => {
|
|
316
|
+
i.markPoint && i.markPoint.data.length != 0 ? i.markPoint.data = [] : i.markPoint && i.markPoint.data == 0 && (i.markPoint = be[i.name]);
|
|
317
|
+
}), k.setOption(f);
|
|
318
318
|
}
|
|
319
319
|
};
|
|
320
|
-
let
|
|
321
|
-
const
|
|
322
|
-
let
|
|
323
|
-
let
|
|
324
|
-
return e.code ?
|
|
325
|
-
...
|
|
320
|
+
let X = {}, k, Ae;
|
|
321
|
+
const K = fe({}), Ee = async () => {
|
|
322
|
+
let s = n.chartOption.series.map((e) => {
|
|
323
|
+
let t = "";
|
|
324
|
+
return e.code ? t = Ie.find((o) => o.code == e.code) : t = Ie.find((o) => o.name == e.name), t ? {
|
|
325
|
+
...t,
|
|
326
326
|
...e
|
|
327
327
|
} : {
|
|
328
328
|
...e
|
|
329
329
|
};
|
|
330
330
|
});
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
331
|
+
P.value.forEach((e) => {
|
|
332
|
+
X[e.name] = e.isSelected, e.children && e.children.forEach((t) => {
|
|
333
|
+
X[t.name] = t.isSelected;
|
|
334
334
|
});
|
|
335
|
-
}),
|
|
336
|
-
let f =
|
|
337
|
-
const
|
|
335
|
+
}), Ae = document.getElementById(n.id), k || (k = Re.init(Ae));
|
|
336
|
+
let f = s.filter((e) => Array.isArray(e.data));
|
|
337
|
+
const i = f.every(
|
|
338
338
|
(e) => Array.isArray(e.data) && e.data.length === 0
|
|
339
|
-
),
|
|
339
|
+
), p = Qe(
|
|
340
340
|
new Date(S().subtract(5, "day").format("YYYY-MM-DD 08:00")),
|
|
341
341
|
new Date(S().format("YYYY-MM-DD HH:00")),
|
|
342
342
|
60
|
|
343
343
|
).map((e) => [e, ""]);
|
|
344
|
-
let
|
|
344
|
+
let r = [];
|
|
345
345
|
f.forEach((e) => {
|
|
346
|
-
|
|
347
|
-
}),
|
|
348
|
-
let
|
|
349
|
-
|
|
350
|
-
e.name == "开始" && e.sectionStartTime && (
|
|
346
|
+
r = r.concat(e.data);
|
|
347
|
+
}), r = [...new Set(r.map((e) => e[0]))], r.sort((e, t) => Date.parse(e) - Date.parse(t)), r.some((e) => ve(e)) && (r = r.filter((e) => ve(e)));
|
|
348
|
+
let O = r[0];
|
|
349
|
+
n.chartOption.series.forEach((e) => {
|
|
350
|
+
e.name == "开始" && e.sectionStartTime && (O = e.sectionStartTime);
|
|
351
351
|
});
|
|
352
|
-
let
|
|
353
|
-
let
|
|
354
|
-
e.show == !1 ||
|
|
355
|
-
let
|
|
352
|
+
let x = JSON.parse(JSON.stringify(n.chartOption.grid)), N = n.chartOption.xAxis.map((e, t) => {
|
|
353
|
+
let o = "";
|
|
354
|
+
e.show == !1 || x.length > 1 && t == 0 ? o = !1 : o = !0;
|
|
355
|
+
let A = {
|
|
356
356
|
type: e.type,
|
|
357
357
|
logBase: e.logBase || 10,
|
|
358
358
|
gridIndex: e.gridIndex,
|
|
359
|
-
name:
|
|
360
|
-
nameLocation:
|
|
359
|
+
name: o && e.type == "time" ? "时间" : e.name,
|
|
360
|
+
nameLocation: o && e.type == "time" ? "end" : "middle",
|
|
361
361
|
// x轴name处于x轴的什么位置
|
|
362
362
|
nameTextStyle: {
|
|
363
363
|
//x轴上方单位的颜色
|
|
364
364
|
color: "#333",
|
|
365
|
-
verticalAlign:
|
|
365
|
+
verticalAlign: o && e.type == "time" ? "top" : ""
|
|
366
366
|
},
|
|
367
367
|
position: e.position,
|
|
368
368
|
offset: e.offset ? e.offset : 0,
|
|
369
369
|
inverse: e.inverse ? e.inverse : !1,
|
|
370
|
-
nameGap:
|
|
370
|
+
nameGap: o && e.type == "time" ? 45 : e.nameGap ? e.nameGap : e.name ? 25 : 0,
|
|
371
371
|
// x轴name与横纵坐标轴线的间距
|
|
372
372
|
axisLabel: {
|
|
373
|
-
show:
|
|
373
|
+
show: o,
|
|
374
374
|
rotate: e.rotate,
|
|
375
|
-
formatter: function(
|
|
376
|
-
return e.type == "time" ?
|
|
375
|
+
formatter: function(v) {
|
|
376
|
+
return e.type == "time" ? Ke(S(S(v).format("YYYY-MM-DD HH:mm"))) ? n.chartOption.xTimeType ? `{a|${n.chartOption.xTimeType}}` : "{a|{yyyy}-{MM}-{dd} {HH}:{mm}}" : n.chartOption.xTimeType ? n.chartOption.xTimeType : "{MM}-{dd} {HH}:{mm}" : e.name ? e.name.includes("m³/s") ? le(v) : e.name.includes("万m³") ? v.toFixed(2) : e.name.includes("mm") ? v.toFixed(1) : e.name.includes("m") ? v.toFixed(2) : (v || v == 0) && e.toFixed ? Number(v).toFixed(e.toFixed) : v : v;
|
|
377
377
|
},
|
|
378
378
|
rich: {
|
|
379
379
|
a: {
|
|
380
380
|
fontWeight: "bold"
|
|
381
381
|
}
|
|
382
382
|
},
|
|
383
|
-
color:
|
|
383
|
+
color: n.chartOption.yAxisColor ? n.chartOption.yAxisColor : "#333",
|
|
384
384
|
hideOverlap: !0
|
|
385
385
|
},
|
|
386
386
|
axisLine: {
|
|
387
387
|
show: !0,
|
|
388
388
|
lineStyle: {
|
|
389
|
-
color:
|
|
389
|
+
color: n.chartOption.yAxisColor ? n.chartOption.yAxisColor : "#8a949c"
|
|
390
390
|
}
|
|
391
391
|
},
|
|
392
392
|
splitLine: {
|
|
@@ -396,28 +396,28 @@ const On = (o) => new Promise((m) => {
|
|
|
396
396
|
}
|
|
397
397
|
},
|
|
398
398
|
axisTick: {
|
|
399
|
-
show: e.show == !1 ? !1 : !(
|
|
399
|
+
show: e.show == !1 ? !1 : !(x.length > 1 && t == 0),
|
|
400
400
|
// 不显示坐标轴上的文字
|
|
401
|
-
alignWithLabel:
|
|
401
|
+
alignWithLabel: n.chartOption.alignWithLabel != null ? n.chartOption.alignWithLabel : !0
|
|
402
402
|
},
|
|
403
403
|
boundaryGap: e.boundaryGap ? e.boundaryGap : ["1%", "1%"]
|
|
404
404
|
};
|
|
405
|
-
if (e.data && (
|
|
406
|
-
let
|
|
407
|
-
e.name.includes("m³/s") ? (
|
|
408
|
-
let
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}),
|
|
412
|
-
(
|
|
413
|
-
).map((
|
|
405
|
+
if (e.data && (A.data = e.data), e.type == "value" || e.type == "log") {
|
|
406
|
+
let v = 0, E = 100, u = 10;
|
|
407
|
+
e.name.includes("m³/s") ? (E = 1e3, u = 100) : e.name.includes("万m³") && (E = 1e4, u = 1e3);
|
|
408
|
+
let a = n.chartOption.series.filter((c) => c.yAxisIndex == t), b = [], y = [], d = 0, w = 100;
|
|
409
|
+
a.forEach((c) => {
|
|
410
|
+
c.data instanceof Array && (b = b.concat(c.data));
|
|
411
|
+
}), b[0] instanceof Array && (y = b.filter(
|
|
412
|
+
(c) => c[0] != "" && c[0] != null && c[0] != null && !isNaN(c[0])
|
|
413
|
+
).map((c) => Number(c[0]))), y.length > 0 && (d = Math.min(...y), w = Math.max(...y), a.some((c) => c.type == "bar") || e.name.includes("雨") ? (v = 0, (d !== 0 || w !== 0) && (E = Math.ceil(w / C(0, w)) * C(0, w), u = C(0, w))) : e.min || e.min == 0 ? (v = e.min, (d !== 0 || w !== 0) && (E = Math.ceil(w / C(e.min, w)) * C(e.min, w), u = C(e.min, w))) : (d !== 0 || w !== 0) && (v = Math.floor(d / C(d, w)) * C(d, w), E = Math.ceil(w / C(d, w)) * C(d, w), u = C(d, w))), A.min = e.min != "" && e.min != null ? e.min : v, A.max = e.max != "" && e.max != null ? e.max : E, A.interval = e.interval && e.max && (e.min || e.min == 0) ? e.interval : u, e.interval && e.max && (e.min || e.min == 0) && e.interval, A.minorTick = {
|
|
414
414
|
show: !!e.isMinorSplitLineShow
|
|
415
415
|
};
|
|
416
416
|
}
|
|
417
|
-
return
|
|
418
|
-
}),
|
|
419
|
-
let
|
|
420
|
-
if (e.name.includes("m³/s") ? (
|
|
417
|
+
return A;
|
|
418
|
+
}), Q = n.chartOption.yAxis.map((e, t) => {
|
|
419
|
+
let o = 0, A = 100, v = 10;
|
|
420
|
+
if (e.name.includes("m³/s") ? (A = 1e3, v = 100) : e.name.includes("万m³") && (A = 1e4, v = 1e3), e.name == "可纳雨量(mm)")
|
|
421
421
|
return {
|
|
422
422
|
gridIndex: e.index,
|
|
423
423
|
name: e.name,
|
|
@@ -437,7 +437,7 @@ const On = (o) => new Promise((m) => {
|
|
|
437
437
|
interval: e.interval,
|
|
438
438
|
axisLabel: {
|
|
439
439
|
// 内容格式器
|
|
440
|
-
formatter: (
|
|
440
|
+
formatter: (E) => E.toFixed(1),
|
|
441
441
|
color: "#333"
|
|
442
442
|
},
|
|
443
443
|
axisLine: {
|
|
@@ -458,39 +458,39 @@ const On = (o) => new Promise((m) => {
|
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
460
|
{
|
|
461
|
-
let
|
|
462
|
-
if (
|
|
463
|
-
|
|
464
|
-
if (
|
|
465
|
-
const
|
|
466
|
-
if (
|
|
467
|
-
const
|
|
468
|
-
|
|
461
|
+
let E = n.chartOption.series.filter((c) => c.yAxisIndex == t && (X[c.name] || !Object.keys(X).includes(c.name))), u = [], a = [], b = [], y = 0, d = 100, w = null;
|
|
462
|
+
if (E.forEach((c) => {
|
|
463
|
+
c.data instanceof Array ? ((c.data2 ? c.data2 : c.data).forEach((D) => {
|
|
464
|
+
if (D instanceof Array && D.length >= 2) {
|
|
465
|
+
const T = D[1];
|
|
466
|
+
if (T != "" && T != null && T != null && !isNaN(T)) {
|
|
467
|
+
const F = Number(T);
|
|
468
|
+
w === null && (w = F);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
}), u =
|
|
472
|
-
}), u[0] instanceof Array ?
|
|
473
|
-
(
|
|
474
|
-
).map((
|
|
475
|
-
(
|
|
476
|
-
).map((
|
|
477
|
-
(
|
|
478
|
-
).map((
|
|
479
|
-
if (
|
|
480
|
-
|
|
471
|
+
}), u = c.data2 ? u.concat(c.data2) : u.concat(c.data)) : c.data.name == "yAxis" && c.data.value && b.push(Number(c.data.value));
|
|
472
|
+
}), u[0] instanceof Array ? a = u.filter(
|
|
473
|
+
(c) => c[1] != "" && c[1] != null && c[1] != null && !isNaN(c[1])
|
|
474
|
+
).map((c) => Number(c[1])) : u[0] instanceof Object && u[0].value ? a = u.map((I) => I.value).filter(
|
|
475
|
+
(I) => I != "" && I != null && I != null && !isNaN(I)
|
|
476
|
+
).map((I) => Number(I)) : a = u.filter(
|
|
477
|
+
(c) => c != "" && c != null && c != null && !isNaN(c)
|
|
478
|
+
).map((c) => Number(c)), a.length > 0 || b.length > 0) {
|
|
479
|
+
if (y = Math.min(...a, ...b), d = Math.max(...a, ...b), E.some((c) => c.type == "bar") || e.name.includes("雨"))
|
|
480
|
+
o = 0, n.chartOption.xAxis.length > 1 && e.inverse ? (y !== 0 || d !== 0) && (A = Math.ceil(d / C(0, d, 1)) * C(0, d, 1) + C(0, d, 1) * (e.upIntervalNumber != null ? e.upIntervalNumber : 1), v = C(0, d, 1)) : (y !== 0 || d !== 0) && (A = Math.ceil(d / C(0, d)) * C(0, d) + C(0, d) * (e.upIntervalNumber != null ? e.upIntervalNumber : 1), v = C(0, d));
|
|
481
481
|
else if (e.min || e.min == 0)
|
|
482
|
-
|
|
483
|
-
else if (
|
|
484
|
-
if (
|
|
485
|
-
|
|
486
|
-
const
|
|
487
|
-
|
|
482
|
+
o = e.min, (y !== 0 || d !== 0) && (A = Math.ceil(d / C(e.min, d)) * C(e.min, d) + C(e.min, d) * (e.upIntervalNumber != null ? e.upIntervalNumber : 1), v = C(e.min, d));
|
|
483
|
+
else if (y !== 0 || d !== 0)
|
|
484
|
+
if (n.chartOption.xAxis.some((I) => I.type === "value") && w !== null) {
|
|
485
|
+
o = w;
|
|
486
|
+
const I = C(o, d);
|
|
487
|
+
A = Math.ceil((d - o) / I) * I + o + I * (e.upIntervalNumber != null ? e.upIntervalNumber : 1), v = I;
|
|
488
488
|
} else
|
|
489
|
-
|
|
489
|
+
o = Math.floor(y / C(y, d)) * C(y, d) - C(y, d) * (e.downIntervalNumber != null ? e.downIntervalNumber : 1), A = Math.ceil(d / C(y, d)) * C(y, d) + C(y, d) * (e.upIntervalNumber != null ? e.upIntervalNumber : 1), v = C(y, d);
|
|
490
490
|
}
|
|
491
491
|
if (e.rangeType == 1) {
|
|
492
|
-
let
|
|
493
|
-
Math.abs(
|
|
492
|
+
let c = "", I = "";
|
|
493
|
+
Math.abs(d) > Math.abs(y) ? I = Math.abs(d) : I = Math.abs(y), c = Math.ceil(I / C(0, I)) * C(0, I), A = c, o = 0 - c, v = C(0, Math.abs(c));
|
|
494
494
|
}
|
|
495
495
|
return {
|
|
496
496
|
gridIndex: e.index,
|
|
@@ -499,7 +499,7 @@ const On = (o) => new Promise((m) => {
|
|
|
499
499
|
// y轴name处于y轴的什么位置
|
|
500
500
|
nameTextStyle: {
|
|
501
501
|
//y轴上方单位的颜色
|
|
502
|
-
color:
|
|
502
|
+
color: n.chartOption.yAxisColor ? n.chartOption.yAxisColor : "#333"
|
|
503
503
|
},
|
|
504
504
|
nameGap: e.nameGap,
|
|
505
505
|
// y轴name与横纵坐标轴线的间距
|
|
@@ -508,18 +508,18 @@ const On = (o) => new Promise((m) => {
|
|
|
508
508
|
position: e.position,
|
|
509
509
|
offset: e.offset ? e.offset : 0,
|
|
510
510
|
inverse: e.inverse ? e.inverse : !1,
|
|
511
|
-
min: e.min != "" && e.min != null ? e.min :
|
|
512
|
-
max: e.max != "" && e.max != null ? e.max :
|
|
513
|
-
interval: e.interval && e.max && (e.min || e.min == 0) ? e.interval :
|
|
511
|
+
min: e.min != "" && e.min != null ? e.min : o,
|
|
512
|
+
max: e.max != "" && e.max != null ? e.max : A,
|
|
513
|
+
interval: e.interval && e.max && (e.min || e.min == 0) ? e.interval : v,
|
|
514
514
|
axisLabel: {
|
|
515
515
|
// 内容格式器
|
|
516
|
-
formatter: (
|
|
517
|
-
color:
|
|
516
|
+
formatter: (c) => e.name.includes("m³/s") ? le(c) : e.name.includes("万m³") ? c.toFixed(2) : e.name.includes("mm") ? c.toFixed(1) : e.name.includes("m") ? c.toFixed(2) : c,
|
|
517
|
+
color: n.chartOption.yAxisColor ? n.chartOption.yAxisColor : "#333"
|
|
518
518
|
},
|
|
519
519
|
axisLine: {
|
|
520
520
|
show: !0,
|
|
521
521
|
lineStyle: {
|
|
522
|
-
color:
|
|
522
|
+
color: n.chartOption.yAxisColor ? n.chartOption.yAxisColor : "#8a949c"
|
|
523
523
|
}
|
|
524
524
|
},
|
|
525
525
|
axisTick: {
|
|
@@ -527,7 +527,7 @@ const On = (o) => new Promise((m) => {
|
|
|
527
527
|
// 是否显示坐标轴刻度
|
|
528
528
|
},
|
|
529
529
|
splitLine: {
|
|
530
|
-
show: !(
|
|
530
|
+
show: !(x.length > 1 && e.index == 1 && e.position == "right" || x.length == 1 && e.index == 0 && e.position == "right" || e.splitLineHide),
|
|
531
531
|
lineStyle: {
|
|
532
532
|
color: "#e0e6f1"
|
|
533
533
|
}
|
|
@@ -536,7 +536,7 @@ const On = (o) => new Promise((m) => {
|
|
|
536
536
|
show: !0
|
|
537
537
|
},
|
|
538
538
|
minorSplitLine: {
|
|
539
|
-
show:
|
|
539
|
+
show: x.length > 1 && e.index == 1 && e.position == "right" || x.length == 1 && e.index == 0 && e.position == "right" || e.splitLineHide ? !1 : !e.minorSplitLineHide,
|
|
540
540
|
lineStyle: {
|
|
541
541
|
color: "#f4f7fd"
|
|
542
542
|
}
|
|
@@ -547,17 +547,17 @@ const On = (o) => new Promise((m) => {
|
|
|
547
547
|
}
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
|
-
}),
|
|
551
|
-
var
|
|
552
|
-
let
|
|
550
|
+
}), m = s.some((e) => e.openBarDrag), U = s.map((e, t) => {
|
|
551
|
+
var A, v, E;
|
|
552
|
+
let o = {};
|
|
553
553
|
if (e.type == "bar")
|
|
554
|
-
e.name == "可纳雨量" ?
|
|
554
|
+
e.name == "可纳雨量" ? o = {
|
|
555
555
|
name: e.name,
|
|
556
556
|
type: e.type,
|
|
557
557
|
xAxisIndex: e.xAxisIndex,
|
|
558
558
|
yAxisIndex: e.yAxisIndex,
|
|
559
559
|
barWidth: e.barWidth,
|
|
560
|
-
data:
|
|
560
|
+
data: i ? p : e.data,
|
|
561
561
|
label: {
|
|
562
562
|
show: !0,
|
|
563
563
|
// 显示标签
|
|
@@ -584,7 +584,7 @@ const On = (o) => new Promise((m) => {
|
|
|
584
584
|
},
|
|
585
585
|
zlevel: 9,
|
|
586
586
|
z: 9
|
|
587
|
-
} :
|
|
587
|
+
} : o = {
|
|
588
588
|
name: e.name,
|
|
589
589
|
type: e.type,
|
|
590
590
|
xAxisIndex: e.xAxisIndex,
|
|
@@ -611,34 +611,34 @@ const On = (o) => new Promise((m) => {
|
|
|
611
611
|
},
|
|
612
612
|
itemStyle: e.itemStyle ? e.itemStyle : {
|
|
613
613
|
color: function(u) {
|
|
614
|
-
let
|
|
615
|
-
return e.color2 && u.value[1] < 0 ? e.color2 :
|
|
614
|
+
let a = M[e.name] ? M[e.name].color : e.color ? e.color : Ve[t];
|
|
615
|
+
return e.color2 && u.value[1] < 0 ? e.color2 : a;
|
|
616
616
|
},
|
|
617
617
|
decal: {
|
|
618
618
|
symbol: e.pattern ? e.pattern : "none"
|
|
619
619
|
}
|
|
620
620
|
},
|
|
621
|
-
barCategoryGap: e.barCategoryGap ? e.barCategoryGap :
|
|
621
|
+
barCategoryGap: e.barCategoryGap ? e.barCategoryGap : Q[e.yAxisIndex].inverse ? "0%" : "20%",
|
|
622
622
|
barGap: e.barGap ? e.barGap : "0%",
|
|
623
|
-
data:
|
|
623
|
+
data: i ? p : e.data,
|
|
624
624
|
zlevel: 9,
|
|
625
625
|
z: 9
|
|
626
|
-
}, e.barWidth && (
|
|
626
|
+
}, e.barWidth && (o.barWidth = e.barWidth, e.barGap ? o.barGap = e.barGap : o.barGap = "20%"), e.barMaxWidth && (o.barMaxWidth = e.barMaxWidth, e.barGap ? o.barGap = e.barGap : o.barGap = "20%");
|
|
627
627
|
else if (e.type == "line") {
|
|
628
628
|
let u = "rgba(0, 0, 0, 0)";
|
|
629
|
-
|
|
630
|
-
let
|
|
631
|
-
if (e.showSymbol || ((
|
|
629
|
+
n.chartOption.isFace && (n.chartOption.faceNames ? n.chartOption.faceNames.includes(e.name) && (M[e.name] ? u = M[e.name].color : u = e.color) : M[e.name] ? u = M[e.name].color : u = e.color);
|
|
630
|
+
let a = "", b = !1;
|
|
631
|
+
if (e.showSymbol || ((A = M[e.name]) == null ? void 0 : A.icon) == "dottedLine" ? e.symbolSize ? a = e.symbolSize : a = 5 : n.chartOption.isTooltipItem ? (a = 10, b = !0) : a = 0, o = {
|
|
632
632
|
name: e.name,
|
|
633
633
|
type: e.type,
|
|
634
634
|
xAxisIndex: e.xAxisIndex,
|
|
635
635
|
yAxisIndex: e.yAxisIndex,
|
|
636
636
|
itemStyle: {
|
|
637
637
|
color: M[e.name] ? M[e.name].color : e.color,
|
|
638
|
-
opacity: e.showSymbol || ((
|
|
638
|
+
opacity: e.showSymbol || ((v = M[e.name]) == null ? void 0 : v.icon) == "dottedLine" ? 1 : 0
|
|
639
639
|
},
|
|
640
640
|
lineStyle: e.lineStyle ? e.lineStyle : {
|
|
641
|
-
type: ((
|
|
641
|
+
type: ((E = M[e.name]) == null ? void 0 : E.icon) == "dotted" ? "dotted" : "solid"
|
|
642
642
|
},
|
|
643
643
|
areaStyle: {
|
|
644
644
|
color: u,
|
|
@@ -648,17 +648,17 @@ const On = (o) => new Promise((m) => {
|
|
|
648
648
|
showSymbol: !0,
|
|
649
649
|
symbol: e.symbol ? e.symbol : "circle",
|
|
650
650
|
connectNulls: !0,
|
|
651
|
-
symbolSize:
|
|
652
|
-
data:
|
|
653
|
-
silent:
|
|
654
|
-
triggerLineEvent:
|
|
651
|
+
symbolSize: a,
|
|
652
|
+
data: i ? p : e.data,
|
|
653
|
+
silent: m ? e.openBarDrag !== !0 : !1,
|
|
654
|
+
triggerLineEvent: b,
|
|
655
655
|
zlevel: 9,
|
|
656
656
|
z: 9
|
|
657
657
|
}, e.isMaxMinShow && e.data.length > 0) {
|
|
658
|
-
let
|
|
659
|
-
|
|
660
|
-
S(
|
|
661
|
-
}),
|
|
658
|
+
let y = e.data.filter((D) => !D[2]).filter((D) => D[1]), d = y.reduce((D, T) => parseFloat(T[1]) > parseFloat(D[1]) ? T : D, y[0]), w = d ? d[0] : "", c = d ? d[1] : "", I;
|
|
659
|
+
r.forEach((D, T) => {
|
|
660
|
+
S(D).isValid() && D == w && (D.markPointOffset || (T >= r.length / 5 * 4 ? I = [-200, 0] : T >= r.length / 5 * 3 ? I = [-150, 0] : T >= r.length / 5 * 2 ? I = [-100, 0] : T >= r.length / 5 * 1 ? I = [-50, 0] : T >= 0 && (I = [0, 0])));
|
|
661
|
+
}), o.markPoint = {
|
|
662
662
|
symbol: "pin",
|
|
663
663
|
symbolSize: 20,
|
|
664
664
|
label: {
|
|
@@ -676,17 +676,17 @@ const On = (o) => new Promise((m) => {
|
|
|
676
676
|
padding: [4, 4, 4, 4],
|
|
677
677
|
lineHeight: 30,
|
|
678
678
|
color: e.markPointColor ? e.markPointColor : "#fff",
|
|
679
|
-
formatter: (
|
|
680
|
-
let
|
|
681
|
-
if (
|
|
682
|
-
let
|
|
683
|
-
|
|
679
|
+
formatter: (D) => {
|
|
680
|
+
let T = "";
|
|
681
|
+
if (D.data && D.data.coord && D.data.coord[0]) {
|
|
682
|
+
let ae = e.tmType ? e.tmType : "YYYY-MM-DD HH:mm";
|
|
683
|
+
T = S(D.data.coord[0]).format(ae);
|
|
684
684
|
}
|
|
685
|
-
let
|
|
686
|
-
if (
|
|
687
|
-
return
|
|
688
|
-
${e.tmText}: {a1|${
|
|
689
|
-
${
|
|
685
|
+
let F = "", H = "";
|
|
686
|
+
if (D.name == "Max")
|
|
687
|
+
return F = e.maxText ? e.maxText : "最大值", e.unit.includes("m³") ? H = D.value ? le(D.value) : "--" : e.unit.includes("mm") ? H = D.value ? Number(D.value).toFixed(1) : "--" : e.unit.includes("m") ? H = D.value ? Number(D.value).toFixed(2) : "--" : H = D.value, e.tmText ? `${F}: {a0|${H}} ${e.unit}
|
|
688
|
+
${e.tmText}: {a1|${T}}` : `${e.tmText2 ? e.tmText2 : "相应时间"}: {a1|${T}}
|
|
689
|
+
${F}: {a0|${H}} ${e.unit}`;
|
|
690
690
|
},
|
|
691
691
|
rich: {
|
|
692
692
|
a0: {
|
|
@@ -703,22 +703,22 @@ ${z}: {a0|${V}} ${e.unit}`;
|
|
|
703
703
|
{
|
|
704
704
|
name: "Max",
|
|
705
705
|
label: {
|
|
706
|
-
offset: e.markPointOffset ? e.markPointOffset :
|
|
706
|
+
offset: e.markPointOffset ? e.markPointOffset : I || [-120, 0]
|
|
707
707
|
},
|
|
708
|
-
xAxis:
|
|
709
|
-
yAxis:
|
|
710
|
-
value:
|
|
708
|
+
xAxis: w,
|
|
709
|
+
yAxis: c,
|
|
710
|
+
value: c
|
|
711
711
|
}
|
|
712
712
|
]
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
715
|
} else if (e.type == "markLine") {
|
|
716
|
-
let u = {},
|
|
717
|
-
e.labelType == 2 ? (e.name == "开始" ?
|
|
716
|
+
let u = {}, a = [];
|
|
717
|
+
e.labelType == 2 ? (e.name == "开始" ? a = [0, 0, -80, 180] : e.name == "结束" && (a = [0, 180, -120, 0]), u = {
|
|
718
718
|
show: !e.labelHide,
|
|
719
719
|
position: "end",
|
|
720
720
|
fontWeight: "bold",
|
|
721
|
-
padding:
|
|
721
|
+
padding: a,
|
|
722
722
|
fontFamily: "Times New Roman",
|
|
723
723
|
lineHeight: 20,
|
|
724
724
|
fontSize: 15
|
|
@@ -728,7 +728,7 @@ ${z}: {a0|${V}} ${e.unit}`;
|
|
|
728
728
|
fontFamily: "Times New Roman",
|
|
729
729
|
lineHeight: 20,
|
|
730
730
|
fontSize: 15
|
|
731
|
-
},
|
|
731
|
+
}, o = {
|
|
732
732
|
name: e.name,
|
|
733
733
|
type: "line",
|
|
734
734
|
xAxisIndex: e.xAxisIndex,
|
|
@@ -750,16 +750,16 @@ ${z}: {a0|${V}} ${e.unit}`;
|
|
|
750
750
|
fontFamily: "Times New Roman, serif",
|
|
751
751
|
distance: -2,
|
|
752
752
|
position: e.position ? e.position : "insideStartTop",
|
|
753
|
-
formatter: function(
|
|
753
|
+
formatter: function(b) {
|
|
754
754
|
if (e.labelType == 2) {
|
|
755
|
-
let
|
|
756
|
-
return e.name == "开始" ?
|
|
757
|
-
|
|
758
|
-
${
|
|
759
|
-
}),
|
|
755
|
+
let y = "";
|
|
756
|
+
return e.name == "开始" ? y = `${e.name}: ${b.value}` : e.name == "结束" && (y = `${e.name}: ${ln(b.value)}`), e.labelArr && e.labelArr.forEach((d) => {
|
|
757
|
+
y += `{a1|
|
|
758
|
+
${d.name}: ${d.value} ${d.unit}}`;
|
|
759
|
+
}), y;
|
|
760
760
|
} else {
|
|
761
|
-
let
|
|
762
|
-
return (
|
|
761
|
+
let y = "";
|
|
762
|
+
return (Je.includes(e.name) || e.name.includes("梅汛期") || e.name.includes("台汛期")) && (y = "{a0|▽}"), e.data.name == "xAxis" ? e.name : ` ${y}${e.name}: ${e.data.value} ${e.unit} `;
|
|
763
763
|
}
|
|
764
764
|
},
|
|
765
765
|
rich: {
|
|
@@ -782,7 +782,7 @@ ${i.name}: ${i.value} ${i.unit}}`;
|
|
|
782
782
|
]
|
|
783
783
|
}
|
|
784
784
|
};
|
|
785
|
-
} else e.type == "scatter" ?
|
|
785
|
+
} else e.type == "scatter" ? o = {
|
|
786
786
|
name: e.name,
|
|
787
787
|
type: e.type,
|
|
788
788
|
xAxisIndex: e.xAxisIndex,
|
|
@@ -791,10 +791,10 @@ ${i.name}: ${i.value} ${i.unit}}`;
|
|
|
791
791
|
itemStyle: {
|
|
792
792
|
color: M[e.name] ? M[e.name].color : e.color
|
|
793
793
|
},
|
|
794
|
-
data:
|
|
794
|
+
data: i ? p : e.data,
|
|
795
795
|
zlevel: 9,
|
|
796
796
|
z: 9
|
|
797
|
-
} : e.type == "boxplot" && (
|
|
797
|
+
} : e.type == "boxplot" && (o = {
|
|
798
798
|
name: e.name,
|
|
799
799
|
type: e.type,
|
|
800
800
|
xAxisIndex: e.xAxisIndex,
|
|
@@ -812,16 +812,16 @@ ${i.name}: ${i.value} ${i.unit}}`;
|
|
|
812
812
|
borderWidth: 2
|
|
813
813
|
}
|
|
814
814
|
},
|
|
815
|
-
data:
|
|
815
|
+
data: i ? p : e.data,
|
|
816
816
|
zlevel: 9,
|
|
817
817
|
z: 9
|
|
818
818
|
});
|
|
819
|
-
return e.markArea && (e.markArea.data ?
|
|
819
|
+
return e.markArea && (e.markArea.data ? o.markArea = {
|
|
820
820
|
silent: e.markArea.silent ? e.markArea.silent : !1,
|
|
821
821
|
label: e.markArea.label ? e.markArea.label : {},
|
|
822
822
|
itemStyle: e.markArea.itemStyle ? e.markArea.itemStyle : {},
|
|
823
823
|
data: e.markArea.data
|
|
824
|
-
} :
|
|
824
|
+
} : o.markArea = {
|
|
825
825
|
silent: !0,
|
|
826
826
|
itemStyle: {
|
|
827
827
|
opacity: e.markArea.opacity ? e.markArea.opacity : 0.3,
|
|
@@ -839,55 +839,55 @@ ${i.name}: ${i.value} ${i.unit}}`;
|
|
|
839
839
|
}
|
|
840
840
|
]
|
|
841
841
|
]
|
|
842
|
-
}),
|
|
843
|
-
}),
|
|
844
|
-
if (
|
|
845
|
-
let e =
|
|
846
|
-
for (let
|
|
847
|
-
|
|
848
|
-
let
|
|
849
|
-
for (let
|
|
842
|
+
}), o;
|
|
843
|
+
}), L = Q.map((e) => e.name), de = {}, ne = {};
|
|
844
|
+
if (L.includes("水位(m)") && L.includes("库容(万m³)") && n.chartOption.stationCode) {
|
|
845
|
+
let e = Q.find((a) => a.name == "水位(m)"), t = [];
|
|
846
|
+
for (let a = e.min; a <= e.max; a += e.interval)
|
|
847
|
+
t.push(a);
|
|
848
|
+
let o = [];
|
|
849
|
+
for (let a = 0; a < t.length; a++)
|
|
850
850
|
if (e.max == 100)
|
|
851
|
-
|
|
852
|
-
else if (
|
|
853
|
-
|
|
851
|
+
o.push(a * 1e3);
|
|
852
|
+
else if (t[a] == 0)
|
|
853
|
+
o.push(0);
|
|
854
854
|
else {
|
|
855
|
-
let
|
|
856
|
-
|
|
855
|
+
let b = await tn(t[a], a);
|
|
856
|
+
o.push(b);
|
|
857
857
|
}
|
|
858
|
-
|
|
859
|
-
|
|
858
|
+
Q.forEach((a) => {
|
|
859
|
+
a.name == "水位(m)" ? a.offset = 80 : a.name == "库容(万m³)" && (a.offset = 80, a.nameGap = -70, a.splitLine.show = !1, a.minorSplitLine.show = !1, a.axisLabel.inside = !0, a.axisTick.inside = !0, x.length > 1 ? a.gridIndex == 0 ? (x[a.gridIndex].left = 150, x[a.gridIndex].right = 20, x[1].left = 150, x[1].right = 20) : a.gridIndex == 1 && (x[0].left = 150, x[0].right = 70, x[a.gridIndex].left = 150, x[a.gridIndex].right = 70) : x.length == 1 && (x[a.gridIndex].left = 150, x[a.gridIndex].right = 20), a.position = "left", a.max = e.max, a.min = e.min, a.interval = e.interval, a.axisLabel.formatter = (b, y) => o[y] || o[y] == 0 ? Number(o[y]).toFixed(2) : "");
|
|
860
860
|
});
|
|
861
|
-
let
|
|
862
|
-
(
|
|
863
|
-
), u =
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
}),
|
|
867
|
-
|
|
868
|
-
}),
|
|
869
|
-
|
|
861
|
+
let A = U.find((a) => a.name == "库容"), v = U.find((a) => a.name == "5分钟库容"), E = U.find(
|
|
862
|
+
(a) => a.name == "实测水位" || a.name == "水位"
|
|
863
|
+
), u = U.find((a) => a.name == "5分钟水位");
|
|
864
|
+
A && A.data && A.data.forEach((a) => {
|
|
865
|
+
de[a[0]] = a[1];
|
|
866
|
+
}), v && v.data && v.data.forEach((a) => {
|
|
867
|
+
ne[a[0]] = a[1];
|
|
868
|
+
}), U.forEach((a) => {
|
|
869
|
+
a.name == "库容" ? a.data = E.data : a.name == "5分钟库容" && (a.data = u.data);
|
|
870
870
|
});
|
|
871
871
|
}
|
|
872
|
-
let
|
|
873
|
-
if (
|
|
874
|
-
let
|
|
875
|
-
if (
|
|
872
|
+
let ce = [...r];
|
|
873
|
+
if (r.some((e) => ve(e)) && (ce = ce.filter((e) => {
|
|
874
|
+
let t = S(e);
|
|
875
|
+
if (ve(e) && t.minute() === 0 && t.second() === 0)
|
|
876
876
|
return e;
|
|
877
|
-
})),
|
|
877
|
+
})), x.length == 1 ? U.push({
|
|
878
878
|
name: "a",
|
|
879
879
|
xAxisIndex: 0,
|
|
880
880
|
yAxisIndex: 0,
|
|
881
|
-
data:
|
|
881
|
+
data: n.chartOption.series.length == 0 ? p : ce.map((e) => [e, void 0]),
|
|
882
882
|
type: "line",
|
|
883
883
|
z: 9,
|
|
884
884
|
zlevel: 9
|
|
885
|
-
}) :
|
|
885
|
+
}) : U.push(
|
|
886
886
|
{
|
|
887
887
|
name: "a",
|
|
888
888
|
xAxisIndex: 0,
|
|
889
889
|
yAxisIndex: 0,
|
|
890
|
-
data:
|
|
890
|
+
data: n.chartOption.series.length == 0 ? p : ce.map((e) => [e, void 0]),
|
|
891
891
|
type: "line",
|
|
892
892
|
z: 9,
|
|
893
893
|
zlevel: 9
|
|
@@ -895,26 +895,26 @@ ${i.name}: ${i.value} ${i.unit}}`;
|
|
|
895
895
|
{
|
|
896
896
|
name: "b",
|
|
897
897
|
xAxisIndex: 1,
|
|
898
|
-
yAxisIndex:
|
|
899
|
-
data:
|
|
898
|
+
yAxisIndex: Q.findIndex((e) => e.gridIndex == 1),
|
|
899
|
+
data: n.chartOption.series.length == 0 ? p : ce.map((e) => [e, void 0]),
|
|
900
900
|
type: "line",
|
|
901
901
|
z: 9,
|
|
902
902
|
zlevel: 9
|
|
903
903
|
}
|
|
904
|
-
),
|
|
905
|
-
e.top = e.newTop ? e.newTop : 10, e.bottom = e.newBottom ? e.newBottom :
|
|
906
|
-
}) :
|
|
907
|
-
|
|
908
|
-
}) :
|
|
909
|
-
|
|
910
|
-
}),
|
|
904
|
+
), x.length == 1 ? x.forEach((e, t) => {
|
|
905
|
+
e.top = e.newTop ? e.newTop : 10, e.bottom = e.newBottom ? e.newBottom : n.chartOption.xAxis[t].name ? 40 : 20;
|
|
906
|
+
}) : x.length == 2 ? x.forEach((e, t) => {
|
|
907
|
+
t == 0 ? (e.top = 10, e.height = n.chartOption.isTwoXAxis ? "48%" : "26%") : t == 1 && (e.top = n.chartOption.isTwoXAxis ? "52%" : "30%", e.bottom = n.chartOption.xAxis[t].name ? 40 : 20);
|
|
908
|
+
}) : x.length == 3 && x.forEach((e, t) => {
|
|
909
|
+
t == 0 ? (e.top = 10, e.height = "26%") : (t == 1 || t == 2) && (e.top = "30%", e.bottom = 40);
|
|
910
|
+
}), K.value = {
|
|
911
911
|
animation: !0,
|
|
912
912
|
// 将 animation 设置为 false 关闭动画效果
|
|
913
913
|
tooltip: {
|
|
914
|
-
show: !(
|
|
914
|
+
show: !(n.chartOption.isTooltipItem || n.chartOption.tooltipShow == !1),
|
|
915
915
|
hideDelay: 0,
|
|
916
916
|
triggerOn: "mousemove",
|
|
917
|
-
trigger:
|
|
917
|
+
trigger: n.chartOption.tooltipType == "1" ? "item" : "axis",
|
|
918
918
|
axisPointer: {
|
|
919
919
|
animation: !1,
|
|
920
920
|
animationDuration: 1e3,
|
|
@@ -923,417 +923,353 @@ ${i.name}: ${i.value} ${i.unit}}`;
|
|
|
923
923
|
// 数据更新动画的时长
|
|
924
924
|
},
|
|
925
925
|
formatter: function(e) {
|
|
926
|
-
if (
|
|
926
|
+
if (n.chartOption.tooltipType == "1") {
|
|
927
927
|
if (e.componentSubType == "boxplot") {
|
|
928
|
-
let
|
|
929
|
-
return
|
|
928
|
+
let t = f[0] ? f[0].unit : "", o = e.name + "<br/>";
|
|
929
|
+
return o += `<div style='padding-right:8px'>
|
|
930
930
|
<div style='display:flex;flex-direction: column;'>
|
|
931
931
|
<div>${e.marker} ${e.seriesName}</div>
|
|
932
932
|
<div style='display:flex;align-items: center;margin-left: 18px'>
|
|
933
933
|
<div style='margin-right:5px;'>最大:${e.value[4] ? e.value[4] : "--"}</div>
|
|
934
|
-
<div style='width:30px'>${
|
|
934
|
+
<div style='width:30px'>${t}</div>
|
|
935
935
|
</div>
|
|
936
936
|
<div style='display:flex;align-items: center;margin-left: 18px'>
|
|
937
937
|
<div style='margin-right:5px;'>平均:${e.value[3] ? e.value[3] : "--"}</div>
|
|
938
|
-
<div style='width:30px'>${
|
|
938
|
+
<div style='width:30px'>${t}</div>
|
|
939
939
|
</div>
|
|
940
940
|
<div style='display:flex;align-items: center;margin-left: 18px'>
|
|
941
941
|
<div style='margin-right:5px;'>最小:${e.value[2] ? e.value[2] : "--"}</div>
|
|
942
|
-
<div style='width:30px'>${
|
|
942
|
+
<div style='width:30px'>${t}</div>
|
|
943
943
|
</div>
|
|
944
944
|
</div>
|
|
945
|
-
</div>`,
|
|
945
|
+
</div>`, o;
|
|
946
946
|
}
|
|
947
|
-
} else if (
|
|
948
|
-
let
|
|
949
|
-
return f.forEach((
|
|
950
|
-
let
|
|
951
|
-
if (
|
|
952
|
-
let
|
|
953
|
-
|
|
947
|
+
} else if (n.chartOption.tooltipType == "2" || n.chartOption.tooltipType == "4") {
|
|
948
|
+
let t = "";
|
|
949
|
+
return f.forEach((o) => {
|
|
950
|
+
let A = e.find((v) => v.seriesName == o.name);
|
|
951
|
+
if (A) {
|
|
952
|
+
let v = A.axisId, E = /[\u4e00-\u9fa5]+|\([^)]+\)/g, u = v.match(E), a = u[0], b = u[1] ? u[1].replace(/[\(\)]/g, "") : u[0], y = n.chartOption.yAxis[0].name.match(E), d = y[0], w = y[1] ? y[1].replace(/[\(\)]/g, "") : y[0];
|
|
953
|
+
n.chartOption.tooltipType == "4" && (t += `<div style='font-weight: bold;color: ${o.color};'>${A.seriesName}</div>`), t += `<div style='padding-right:8px'>
|
|
954
954
|
<div style='display:flex;align-items: center;justify-content: space-between'>
|
|
955
|
-
<div style='margin-right:8px;'>${
|
|
955
|
+
<div style='margin-right:8px;'>${d}</div>
|
|
956
956
|
<div style='display:flex;align-items: center;'>
|
|
957
|
-
<div style='margin-right:5px;'>${
|
|
958
|
-
<div style='width:30px'>${
|
|
957
|
+
<div style='margin-right:5px;'>${A.value[1] || A.value[1] === 0 ? A.value[1] : "--"}</div>
|
|
958
|
+
<div style='width:30px'>${w || ""}</div>
|
|
959
959
|
</div>
|
|
960
960
|
</div>
|
|
961
961
|
<div style='display:flex;align-items: center;justify-content: space-between'>
|
|
962
|
-
<div style='margin-right:8px;'>${
|
|
962
|
+
<div style='margin-right:8px;'>${a}</div>
|
|
963
963
|
<div style='display:flex;align-items: center;'>
|
|
964
|
-
<div style='margin-right:5px;'>${
|
|
965
|
-
<div style='width:30px'>${
|
|
964
|
+
<div style='margin-right:5px;'>${A.value[0] || A.value[0] === 0 ? A.value[0] : "--"}</div>
|
|
965
|
+
<div style='width:30px'>${b || ""}</div>
|
|
966
966
|
</div>
|
|
967
967
|
</div>
|
|
968
968
|
</div>`;
|
|
969
969
|
}
|
|
970
|
-
}),
|
|
971
|
-
} else if (
|
|
972
|
-
let
|
|
970
|
+
}), t;
|
|
971
|
+
} else if (n.chartOption.tooltipType == "3") {
|
|
972
|
+
let t = [];
|
|
973
973
|
e.forEach((u) => {
|
|
974
|
-
|
|
974
|
+
t.push(u.seriesName.replace(/\d+/g, ""));
|
|
975
975
|
});
|
|
976
|
-
let
|
|
977
|
-
return f.forEach((u,
|
|
978
|
-
let
|
|
979
|
-
if (u.name.includes(
|
|
980
|
-
let
|
|
981
|
-
|
|
982
|
-
${
|
|
976
|
+
let o = "预报潮位", A = e[0].value[0] + "<br/>", v = 0, E = "";
|
|
977
|
+
return f.forEach((u, a) => {
|
|
978
|
+
let b = e.find((d) => d.seriesName == u.name), y = "";
|
|
979
|
+
if (u.name.includes(o) ? (y = n.chartOption.plan[v], v++, f.find((d) => d.name == "预报潮位1") && (E = `<div>${y}</div>`)) : E = "", b) {
|
|
980
|
+
let d = "";
|
|
981
|
+
b.value[1] && (d = `<div style='padding-right:8px'>
|
|
982
|
+
${E}
|
|
983
983
|
<div style='display:flex;align-items: center;justify-content: space-between'>
|
|
984
|
-
<div style='margin-right:8px;'>${
|
|
984
|
+
<div style='margin-right:8px;'>${b.marker} ${b.seriesName.replace(/\d+/g, "")}</div>
|
|
985
985
|
<div style='display:flex;align-items: center;'>
|
|
986
|
-
<div style='margin-right:5px;'>${
|
|
986
|
+
<div style='margin-right:5px;'>${b.value[1] ? b.value[1] : "--"}</div>
|
|
987
987
|
<div style='width:30px'>${u.unit ? u.unit : ""}</div>
|
|
988
988
|
</div>
|
|
989
989
|
</div>
|
|
990
|
-
</div>`),
|
|
990
|
+
</div>`), A += d;
|
|
991
991
|
}
|
|
992
|
-
}),
|
|
992
|
+
}), A;
|
|
993
993
|
} else {
|
|
994
|
-
let
|
|
995
|
-
return
|
|
996
|
-
|
|
997
|
-
) + "<br/>" :
|
|
998
|
-
|
|
999
|
-
) + "<br/>" : Array.isArray(e[0].value) ?
|
|
1000
|
-
var
|
|
1001
|
-
let
|
|
1002
|
-
if (
|
|
1003
|
-
let
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
994
|
+
let t = "";
|
|
995
|
+
return n.chartOption.tooltipNameTimeType ? Array.isArray(e[0].value) ? t = S(e[0].value[0]).format(
|
|
996
|
+
n.chartOption.tooltipNameTimeType
|
|
997
|
+
) + "<br/>" : t = S(e[0].name).format(
|
|
998
|
+
n.chartOption.tooltipNameTimeType
|
|
999
|
+
) + "<br/>" : Array.isArray(e[0].value) ? t = String(e[0].value[0]).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">") + "<br/>" : t = e[0].name + "<br/>", f.forEach((o) => {
|
|
1000
|
+
var v;
|
|
1001
|
+
let A = e.find((E) => E.seriesName == o.name);
|
|
1002
|
+
if (A && !(Array.isArray(A.value) && A.value[2] === !0)) {
|
|
1003
|
+
let E = "";
|
|
1004
|
+
o.key ? E = o.key : P.value.forEach((b) => {
|
|
1005
|
+
b.name == A.seriesName ? E = b.key ? b.key : o.name : b.children && b.children.forEach((y) => {
|
|
1006
|
+
y.name == A.seriesName && (E = y.key);
|
|
1007
1007
|
});
|
|
1008
1008
|
});
|
|
1009
|
-
let u = "",
|
|
1010
|
-
if (
|
|
1011
|
-
let
|
|
1012
|
-
|
|
1009
|
+
let u = "", a = "";
|
|
1010
|
+
if (A.marker == '<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:transparent;"></span>' ? a = `<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${(v = M[o.name]) == null ? void 0 : v.color};"></span>` : a = A.marker, A.value) {
|
|
1011
|
+
let b = "";
|
|
1012
|
+
o.data2 ? b = o.data2.find((d) => d[0] == A.value[0])[1] : Array.isArray(A.value) ? b = A.value[1] : b = A.value, JSON.stringify(de) != "{}" && A.seriesName == "库容" ? b = de[e[0].value[0]] : JSON.stringify(ne) != "{}" && A.seriesName == "5分钟库容" && (b = ne[e[0].value[0]]), u = `<div style='padding-right:8px'>
|
|
1013
1013
|
<div style='display:flex;align-items: center;justify-content: space-between'>
|
|
1014
|
-
<div style='margin-right:8px;'>${
|
|
1014
|
+
<div style='margin-right:8px;'>${a} ${E || A.seriesName}</div>
|
|
1015
1015
|
<div style='display:flex;align-items: center;'>
|
|
1016
|
-
<div style='margin-right:5px;'>${
|
|
1017
|
-
<div style='width:30px'>${
|
|
1016
|
+
<div style='margin-right:5px;'>${b || b === 0 ? b : "--"}</div>
|
|
1017
|
+
<div style='width:30px'>${o.unit ? o.unit : ""}</div>
|
|
1018
1018
|
</div>
|
|
1019
1019
|
</div>
|
|
1020
1020
|
</div>`;
|
|
1021
1021
|
}
|
|
1022
|
-
|
|
1022
|
+
t += u;
|
|
1023
1023
|
}
|
|
1024
|
-
}),
|
|
1024
|
+
}), t;
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
1027
|
},
|
|
1028
1028
|
legend: {
|
|
1029
1029
|
show: !1,
|
|
1030
|
-
selected:
|
|
1030
|
+
selected: X
|
|
1031
1031
|
},
|
|
1032
|
-
grid:
|
|
1032
|
+
grid: x,
|
|
1033
1033
|
axisPointer: {
|
|
1034
1034
|
link: {
|
|
1035
1035
|
xAxisIndex: "all"
|
|
1036
1036
|
}
|
|
1037
1037
|
},
|
|
1038
|
-
xAxis:
|
|
1039
|
-
yAxis:
|
|
1038
|
+
xAxis: N,
|
|
1039
|
+
yAxis: Q,
|
|
1040
1040
|
dataZoom: [
|
|
1041
1041
|
{
|
|
1042
1042
|
type: "inside",
|
|
1043
1043
|
//内置滑动,随鼠标滚轮展示
|
|
1044
1044
|
xAxisIndex: [0, 1],
|
|
1045
|
-
zoomLock: !!
|
|
1046
|
-
start:
|
|
1047
|
-
end:
|
|
1048
|
-
moveOnMouseMove:
|
|
1045
|
+
zoomLock: !!n.chartOption.zoomLock,
|
|
1046
|
+
start: n.chartOption.viewDataRange ? n.chartOption.viewDataRange[0] : 0,
|
|
1047
|
+
end: n.chartOption.viewDataRange ? n.chartOption.viewDataRange[1] : 100,
|
|
1048
|
+
moveOnMouseMove: n.chartOption.series.some(
|
|
1049
1049
|
(e) => e.openBarDrag && (e.type == "line" || e.type == "markLine")
|
|
1050
1050
|
) ? "ctrl" : !0
|
|
1051
1051
|
}
|
|
1052
1052
|
],
|
|
1053
|
-
series:
|
|
1054
|
-
},
|
|
1055
|
-
let
|
|
1056
|
-
return e.step ?
|
|
1057
|
-
let u = new Date(
|
|
1058
|
-
|
|
1053
|
+
series: U
|
|
1054
|
+
}, n.chartOption.visualMap && (K.value.visualMap = n.chartOption.visualMap.map((e) => {
|
|
1055
|
+
let t = U[e.seriesIndex], o = [], A = [];
|
|
1056
|
+
return e.step ? A = Fn(e.pieces, e.step) : A = e.pieces, A.forEach((v, E) => {
|
|
1057
|
+
let u = new Date(v.startTm).getTime(), a = new Date(v.endTm).getTime();
|
|
1058
|
+
E == 0 ? o.push(
|
|
1059
1059
|
{
|
|
1060
1060
|
lt: u,
|
|
1061
|
-
color:
|
|
1061
|
+
color: t.itemStyle.color
|
|
1062
1062
|
},
|
|
1063
1063
|
{
|
|
1064
1064
|
gte: u,
|
|
1065
|
-
lte:
|
|
1065
|
+
lte: a,
|
|
1066
1066
|
color: e.color ? e.color : "red"
|
|
1067
1067
|
}
|
|
1068
|
-
) :
|
|
1068
|
+
) : o.push(
|
|
1069
1069
|
{
|
|
1070
|
-
gt:
|
|
1070
|
+
gt: o[o.length - 1].lte,
|
|
1071
1071
|
lt: u,
|
|
1072
|
-
color:
|
|
1072
|
+
color: t.itemStyle.color
|
|
1073
1073
|
},
|
|
1074
1074
|
{
|
|
1075
1075
|
gte: u,
|
|
1076
|
-
lte:
|
|
1076
|
+
lte: a,
|
|
1077
1077
|
color: e.color ? e.color : "red"
|
|
1078
1078
|
}
|
|
1079
1079
|
);
|
|
1080
|
-
}),
|
|
1081
|
-
gt:
|
|
1082
|
-
color:
|
|
1080
|
+
}), o.push({
|
|
1081
|
+
gt: o[o.length - 1].lte,
|
|
1082
|
+
color: t.itemStyle.color
|
|
1083
1083
|
}), {
|
|
1084
1084
|
show: !1,
|
|
1085
1085
|
dimension: e.dimension ? e.dimension : 0,
|
|
1086
1086
|
seriesIndex: e.seriesIndex,
|
|
1087
|
-
pieces:
|
|
1087
|
+
pieces: o
|
|
1088
1088
|
};
|
|
1089
|
-
})), JSON.stringify(
|
|
1090
|
-
e.markPoint && (
|
|
1091
|
-
}),
|
|
1089
|
+
})), JSON.stringify(re) != "{}" && (K.value.dataZoom[0] = re), console.log(K.value), k.setOption(K.value, !0), k.getOption().series.map((e) => {
|
|
1090
|
+
e.markPoint && (be[e.name] = e.markPoint);
|
|
1091
|
+
}), n.chartOption.isTooltipItem) {
|
|
1092
1092
|
let e = document.createElement("div");
|
|
1093
|
-
e.className = "line-name-tooltip-style",
|
|
1094
|
-
|
|
1095
|
-
}),
|
|
1093
|
+
e.className = "line-name-tooltip-style", Ae.appendChild(e), k.on("mouseover", function(t) {
|
|
1094
|
+
t.componentType === "series" && t.seriesType === "line" ? (e.innerText = `${t.seriesName}`, e.style.left = `${t.event.offsetX}px`, e.style.top = `${t.event.offsetY}px`, e.style.opacity = "1") : e && (e.style.opacity = "0");
|
|
1095
|
+
}), k.on("mouseout", function(t) {
|
|
1096
1096
|
e && (e.style.opacity = "0");
|
|
1097
1097
|
});
|
|
1098
1098
|
} else {
|
|
1099
|
-
const e =
|
|
1100
|
-
e.length > 0 && e.forEach((
|
|
1101
|
-
|
|
1099
|
+
const e = Ae.querySelectorAll(".line-name-tooltip-style");
|
|
1100
|
+
e.length > 0 && e.forEach((t) => {
|
|
1101
|
+
t.remove();
|
|
1102
1102
|
});
|
|
1103
1103
|
}
|
|
1104
|
-
|
|
1105
|
-
var
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
)
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
name: `${p[0]}
|
|
1122
|
-
${e.seriesName}: ${p[1]} ${n.unit}`,
|
|
1123
|
-
label: {
|
|
1124
|
-
offset: g || [-120, 0]
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
], j.value.series[b].markPoint = {
|
|
1128
|
-
symbol: "pin",
|
|
1129
|
-
symbolSize: 20,
|
|
1130
|
-
label: {
|
|
1131
|
-
show: !0,
|
|
1132
|
-
position: "top",
|
|
1133
|
-
align: "left",
|
|
1134
|
-
fontSize: 16,
|
|
1135
|
-
backgroundColor: n.backgroundColor ? n.backgroundColor : M[n.name] ? M[n.name].color : n.color,
|
|
1136
|
-
borderRadius: 6,
|
|
1137
|
-
shadowColor: "#666666",
|
|
1138
|
-
shadowBlur: 5,
|
|
1139
|
-
shadowOffsetX: 3,
|
|
1140
|
-
shadowOffsetY: 3,
|
|
1141
|
-
fontWeight: "bold",
|
|
1142
|
-
padding: [4, 4, 4, 4],
|
|
1143
|
-
lineHeight: 30,
|
|
1144
|
-
color: n.markPointColor ? n.markPointColor : "#fff",
|
|
1145
|
-
formatter: (r) => {
|
|
1146
|
-
let i = "", O = n.tmType ? n.tmType : "YYYY-MM-DD HH:mm";
|
|
1147
|
-
r.data && r.data.coord && r.data.coord[0] && (i = S(r.data.coord[0]).format(O));
|
|
1148
|
-
let h = "", v = "";
|
|
1149
|
-
if (r.name == "Max" || r.name == "Min") {
|
|
1150
|
-
if (r.name == "Max")
|
|
1151
|
-
return h = n.maxText ? n.maxText : "最大值", n.unit.includes("m³") ? v = r.value ? ne(r.value) : "--" : n.unit.includes("mm") ? v = r.value ? Number(r.value).toFixed(1) : "--" : n.unit.includes("m") ? v = r.value ? Number(r.value).toFixed(2) : "--" : v = r.value, n.tmText ? `${h}: {a0|${v}} ${n.unit}
|
|
1152
|
-
${n.tmText}: {a1|${i}}` : `${n.tmText2 ? n.tmText2 : "相应时间"}: {a1|${i}}
|
|
1153
|
-
${h}: {a0|${v}} ${n.unit}`;
|
|
1154
|
-
} else
|
|
1155
|
-
return `相应时间: {a1|${S(r.data.coord[0]).format(
|
|
1156
|
-
O
|
|
1157
|
-
)}}
|
|
1158
|
-
${n.name}: {a0|${r.data.coord[1]}} ${n.unit}`;
|
|
1159
|
-
},
|
|
1160
|
-
rich: {
|
|
1161
|
-
a0: {
|
|
1162
|
-
fontSize: 25,
|
|
1163
|
-
fontFamily: "Times New Roman"
|
|
1164
|
-
},
|
|
1165
|
-
a1: {
|
|
1166
|
-
fontSize: 20,
|
|
1167
|
-
fontFamily: "Times New Roman"
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
},
|
|
1171
|
-
data: t
|
|
1172
|
-
}, j.value.dataZoom[0] = { ...(d = I.getOption()) == null ? void 0 : d.dataZoom[0] }, I.setOption(j.value, !0), I.getOption().series.map((r) => {
|
|
1173
|
-
r.markPoint && (me[r.name] = r.markPoint);
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
}), I.on("mousedown", function(e) {
|
|
1178
|
-
I.setOption({
|
|
1179
|
-
tooltip: {
|
|
1180
|
-
show: !1
|
|
1104
|
+
k.off("click"), k.on("click", (e) => {
|
|
1105
|
+
var I, D, T;
|
|
1106
|
+
const t = f.find((F) => F.name == e.seriesName);
|
|
1107
|
+
if (!t || e.seriesType !== "line") return;
|
|
1108
|
+
const { data: o, seriesIndex: A } = e, E = ((I = k.getOption().series[A].markPoint) == null ? void 0 : I.data) || [], u = r.findIndex(
|
|
1109
|
+
(F) => S(F).isValid() && F == o[0]
|
|
1110
|
+
), a = u >= 0 ? [-Math.floor(u / (r.length / 5)) * 50, 0] : [-120, 0], y = new Set(
|
|
1111
|
+
E.filter((F) => F.name !== "Max" && F.name !== "Min").map((F) => F.coord[0])
|
|
1112
|
+
).has(e.value[0]) ? E.filter(
|
|
1113
|
+
(F) => F.name === "Max" || F.name === "Min" || F.coord[0] !== e.value[0]
|
|
1114
|
+
) : [
|
|
1115
|
+
...E,
|
|
1116
|
+
{
|
|
1117
|
+
coord: o,
|
|
1118
|
+
name: `${o[0]}
|
|
1119
|
+
${e.seriesName}: ${o[1]} ${t.unit}`,
|
|
1120
|
+
label: { offset: a }
|
|
1181
1121
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
});
|
|
1210
|
-
} else
|
|
1211
|
-
i.forEach((B) => {
|
|
1212
|
-
n.name == "开始" ? B.name == "开始" && (B.markLine.data[0].xAxis = z, B.markArea.data[0][0].xAxis = z) : n.name == "结束" && (B.name == "开始" ? B.markArea.data[0][1].xAxis = z : B.name == "结束" && (B.markLine.data[0].xAxis = z));
|
|
1213
|
-
});
|
|
1214
|
-
I.setOption({
|
|
1215
|
-
series: i
|
|
1216
|
-
}, {
|
|
1217
|
-
notMerge: !1,
|
|
1218
|
-
lazyUpdate: !0
|
|
1219
|
-
}), O = z;
|
|
1220
|
-
}
|
|
1221
|
-
} else {
|
|
1222
|
-
let [C, z] = I.convertFromPixel({ seriesIndex: d }, [
|
|
1223
|
-
w.offsetX,
|
|
1224
|
-
w.offsetY
|
|
1225
|
-
]);
|
|
1226
|
-
if (S(C).format("YYYY-MM-DD HH:00") !== O || !h || Math.abs(z - h) >= 0.5) {
|
|
1227
|
-
const V = S(C).format("YYYY-MM-DD HH:00");
|
|
1228
|
-
g[V] = z;
|
|
1229
|
-
let P = Object.keys(g).sort(), Ae = new Set(P);
|
|
1230
|
-
i[d].data.forEach((Y) => {
|
|
1231
|
-
Ae.has(Y[0]) && (Y[1] = g[Y[0]]);
|
|
1232
|
-
});
|
|
1233
|
-
let B = He(
|
|
1234
|
-
new Date(P[0]),
|
|
1235
|
-
new Date(P[P.length - 1]),
|
|
1236
|
-
p
|
|
1237
|
-
), xe = Object.entries(g).sort(
|
|
1238
|
-
(Y, K) => S(Y[0]).valueOf() - S(K[0]).valueOf()
|
|
1239
|
-
), an = new Set(P), Oe = [];
|
|
1240
|
-
B.forEach((Y) => {
|
|
1241
|
-
an.has(Y) || Oe.push(en(xe, Y));
|
|
1242
|
-
}), xe = xe.concat(Oe).sort(
|
|
1243
|
-
(Y, K) => S(Y[0]).valueOf() - S(K[0]).valueOf()
|
|
1244
|
-
);
|
|
1245
|
-
let ie = {};
|
|
1246
|
-
xe.forEach((Y) => {
|
|
1247
|
-
ie[Y[0]] = Y[1];
|
|
1248
|
-
});
|
|
1249
|
-
let tn = Object.keys(ie), ln = new Set(tn);
|
|
1250
|
-
i[d].data.forEach((Y) => {
|
|
1251
|
-
if (ln.has(Y[0])) {
|
|
1252
|
-
let K = "";
|
|
1253
|
-
r.name.includes("m³") ? K = ne(ie[Y[0]]) : r.name.includes("mm") ? K = ie[Y[0]].toFixed(1) : r.name.includes("m") && (K = ie[Y[0]].toFixed(2)), Y[1] = K;
|
|
1254
|
-
}
|
|
1255
|
-
}), I.setOption({
|
|
1256
|
-
series: i
|
|
1257
|
-
}, {
|
|
1258
|
-
notMerge: !1,
|
|
1259
|
-
lazyUpdate: !0
|
|
1260
|
-
}), O = V, h = z;
|
|
1122
|
+
], d = (F, H) => F ? H.includes("m³") ? le(F) : H.includes("mm") ? Number(F).toFixed(1) : H.includes("m") ? Number(F).toFixed(2) : F : "--", w = t.tmType || "YYYY-MM-DD HH:mm", c = t.backgroundColor || ((D = M[t.name]) == null ? void 0 : D.color) || t.color;
|
|
1123
|
+
K.value.series[A].markPoint = {
|
|
1124
|
+
symbol: "pin",
|
|
1125
|
+
symbolSize: 20,
|
|
1126
|
+
label: {
|
|
1127
|
+
show: !0,
|
|
1128
|
+
position: "top",
|
|
1129
|
+
align: "left",
|
|
1130
|
+
fontSize: 16,
|
|
1131
|
+
backgroundColor: c,
|
|
1132
|
+
borderRadius: 6,
|
|
1133
|
+
shadowColor: "#666666",
|
|
1134
|
+
shadowBlur: 5,
|
|
1135
|
+
shadowOffsetX: 3,
|
|
1136
|
+
shadowOffsetY: 3,
|
|
1137
|
+
fontWeight: "bold",
|
|
1138
|
+
padding: [4, 4, 4, 4],
|
|
1139
|
+
lineHeight: 30,
|
|
1140
|
+
color: t.markPointColor || "#fff",
|
|
1141
|
+
formatter: (F) => {
|
|
1142
|
+
var J, B;
|
|
1143
|
+
const H = (B = (J = F.data) == null ? void 0 : J.coord) == null ? void 0 : B[0], ae = H ? S(H).format(w) : "";
|
|
1144
|
+
if (F.name === "Max") {
|
|
1145
|
+
const R = t.maxText || "最大值", z = d(F.value, t.unit), $ = t.tmText || t.tmText2 || "相应时间";
|
|
1146
|
+
return t.tmText ? `${R}: {a0|${z}} ${t.unit}
|
|
1147
|
+
${$}: {a1|${ae}}` : `${$}: {a1|${ae}}
|
|
1148
|
+
${R}: {a0|${z}} ${t.unit}`;
|
|
1261
1149
|
}
|
|
1150
|
+
if (F.name !== "Min")
|
|
1151
|
+
return `相应时间: {a1|${S(H).format(w)}}
|
|
1152
|
+
${t.name}: {a0|${F.data.coord[1]}} ${t.unit}`;
|
|
1153
|
+
},
|
|
1154
|
+
rich: {
|
|
1155
|
+
a0: { fontSize: 25, fontFamily: "Times New Roman" },
|
|
1156
|
+
a1: { fontSize: 20, fontFamily: "Times New Roman" }
|
|
1262
1157
|
}
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1158
|
+
},
|
|
1159
|
+
data: y
|
|
1160
|
+
}, K.value.dataZoom[0] = { ...(T = k.getOption()) == null ? void 0 : T.dataZoom[0] }, k.setOption(K.value, !0), k.getOption().series.forEach((F) => {
|
|
1161
|
+
F.markPoint && (be[F.name] = F.markPoint);
|
|
1162
|
+
});
|
|
1163
|
+
}), k.on("mousedown", function(e) {
|
|
1164
|
+
k.setOption({ tooltip: { show: !1 } }), k.dispatchAction({ type: "hideTip" });
|
|
1165
|
+
const { seriesIndex: t } = e, o = n.chartOption.series[t];
|
|
1166
|
+
if (!(o != null && o.openBarDrag)) return;
|
|
1167
|
+
const A = o.stepTM || 60, v = e.componentType === "markLine" && o.data.name === "xAxis", E = o.name === "开始", u = n.chartOption.yAxis[o.yAxisIndex], a = {};
|
|
1168
|
+
let b = {}, y, d, w;
|
|
1169
|
+
const c = K.value.series.map((B, R) => v ? B.name === "开始" || B.name === "结束" ? JSON.parse(JSON.stringify(B)) : {} : R === t ? { data: JSON.parse(JSON.stringify(B.data)) } : {});
|
|
1170
|
+
let I = 0;
|
|
1171
|
+
if (n.chartOption.fixedTimePeriod) {
|
|
1172
|
+
const B = n.chartOption.series.find((z) => z.name === "开始").data.value, R = n.chartOption.series.find((z) => z.name === "结束").data.value;
|
|
1173
|
+
I = S(R).diff(S(B), "hour");
|
|
1174
|
+
}
|
|
1175
|
+
const D = S(r[r.length - 1]), T = O ? S(O) : null, F = (B) => {
|
|
1176
|
+
const R = u.name;
|
|
1177
|
+
return R.includes("m³") ? le(B) : R.includes("mm") ? B.toFixed(1) : R.includes("m") ? B.toFixed(2) : B;
|
|
1178
|
+
}, H = (B, R) => {
|
|
1179
|
+
c.forEach((z) => {
|
|
1180
|
+
z.name === "开始" ? (z.markLine.data[0].xAxis = B, z.markArea.data[0][0].xAxis = B, R != null && (z.markArea.data[0][1].xAxis = R)) : z.name === "结束" && (z.markLine.data[0].xAxis = R ?? z.markLine.data[0].xAxis);
|
|
1181
|
+
});
|
|
1182
|
+
}, ae = () => {
|
|
1183
|
+
k.setOption({ series: c }, { notMerge: !1, lazyUpdate: !0 });
|
|
1184
|
+
}, J = k.getZr();
|
|
1185
|
+
J.off("mousemove"), J.off("mouseup"), J.on("mousemove", function(B) {
|
|
1186
|
+
if (v) {
|
|
1187
|
+
const R = k.convertFromPixel({ xAxisIndex: o.xAxisIndex }, B.offsetX), z = S(R).format("YYYY-MM-DD HH:00");
|
|
1188
|
+
if (z === y) return;
|
|
1189
|
+
const $ = S(z);
|
|
1190
|
+
if ($.isAfter(D) || T && $.isBefore(T)) return;
|
|
1191
|
+
if (n.chartOption.fixedTimePeriod) {
|
|
1192
|
+
const G = E ? I : -I;
|
|
1193
|
+
if (w = S(z).add(G, "hours").format("YYYY-MM-DD HH:00"), E && S(w).isAfter(D) || !E && T && S(w).isBefore(T)) return;
|
|
1194
|
+
H(
|
|
1195
|
+
E ? z : w,
|
|
1196
|
+
E ? w : z
|
|
1197
|
+
);
|
|
1277
1198
|
} else
|
|
1278
|
-
|
|
1279
|
-
name
|
|
1280
|
-
data: i[d].data
|
|
1281
|
-
};
|
|
1282
|
-
t.name && Ve("getNewSeriesData", t), I.getZr().on("mousemove", function(w) {
|
|
1283
|
-
let C = w.offsetX, z = w.offsetY;
|
|
1284
|
-
I.dispatchAction({
|
|
1285
|
-
type: "showTip",
|
|
1286
|
-
x: C,
|
|
1287
|
-
y: z
|
|
1199
|
+
E ? H(z, null) : c.forEach((G) => {
|
|
1200
|
+
G.name === "开始" && (G.markArea.data[0][1].xAxis = z), G.name === "结束" && (G.markLine.data[0].xAxis = z);
|
|
1288
1201
|
});
|
|
1202
|
+
ae(), y = z;
|
|
1203
|
+
} else {
|
|
1204
|
+
const [R, z] = k.convertFromPixel({ seriesIndex: t }, [B.offsetX, B.offsetY]), $ = S(R).format("YYYY-MM-DD HH:00");
|
|
1205
|
+
if ($ === y && d && Math.abs(z - d) < 0.5) return;
|
|
1206
|
+
a[$] = z;
|
|
1207
|
+
const G = Object.keys(a).sort(), ke = new Set(G);
|
|
1208
|
+
c[t].data.forEach((j) => {
|
|
1209
|
+
ke.has(j[0]) && (j[1] = a[j[0]]);
|
|
1289
1210
|
});
|
|
1211
|
+
const rn = Qe(new Date(G[0]), new Date(G[G.length - 1]), A);
|
|
1212
|
+
let ge = Object.entries(a).sort((j, we) => S(j[0]).valueOf() - S(we[0]).valueOf());
|
|
1213
|
+
const sn = rn.filter((j) => !ke.has(j)).map((j) => on(ge, j));
|
|
1214
|
+
ge = ge.concat(sn).sort((j, we) => S(j[0]).valueOf() - S(we[0]).valueOf());
|
|
1215
|
+
const De = new Map(ge);
|
|
1216
|
+
c[t].data.forEach((j) => {
|
|
1217
|
+
De.has(j[0]) && (j[1] = F(De.get(j[0])));
|
|
1218
|
+
}), ae(), y = $, d = z;
|
|
1219
|
+
}
|
|
1220
|
+
}), J.on("mouseup", function() {
|
|
1221
|
+
J.off("mousemove"), J.off("mouseup"), v ? y && (w ? (E && S(w).isAfter(D) ? w = S(y).add(I, "hours").format("YYYY-MM-DD HH:00") : !E && T && S(w).isBefore(T) && (w = S(y).add(-I, "hours").format("YYYY-MM-DD HH:00")), b = {
|
|
1222
|
+
name: "开始/结束",
|
|
1223
|
+
value: E ? `${y}/${w}` : `${w}/${y}`
|
|
1224
|
+
}) : b = { name: o.name, value: y }) : b = { name: e.seriesName, data: c[t].data }, b.name && Pe("getNewSeriesData", b), J.on("mousemove", ({ offsetX: B, offsetY: R }) => {
|
|
1225
|
+
k.dispatchAction({ type: "showTip", x: B, y: R });
|
|
1290
1226
|
});
|
|
1291
|
-
}
|
|
1227
|
+
});
|
|
1292
1228
|
}), window.onresize = function() {
|
|
1293
|
-
|
|
1229
|
+
k.resize();
|
|
1294
1230
|
};
|
|
1295
|
-
},
|
|
1296
|
-
|
|
1297
|
-
|
|
1231
|
+
}, ye = () => {
|
|
1232
|
+
Te(() => {
|
|
1233
|
+
k && k.resize();
|
|
1298
1234
|
});
|
|
1299
|
-
},
|
|
1300
|
-
|
|
1235
|
+
}, xe = (s, f) => {
|
|
1236
|
+
k.dispatchAction({
|
|
1301
1237
|
type: f ? "legendSelect" : "legendUnSelect",
|
|
1302
1238
|
// 图例名称
|
|
1303
|
-
name:
|
|
1239
|
+
name: s
|
|
1304
1240
|
});
|
|
1305
1241
|
};
|
|
1306
|
-
function
|
|
1307
|
-
return
|
|
1242
|
+
function Ke(s) {
|
|
1243
|
+
return s.month() === 0 && s.date() === 1 && s.hour() === 0 && s.minute() === 0;
|
|
1308
1244
|
}
|
|
1309
|
-
function
|
|
1310
|
-
|
|
1245
|
+
function $e(s) {
|
|
1246
|
+
s.preventDefault();
|
|
1311
1247
|
let f = document.querySelector("body .chartMenu");
|
|
1312
1248
|
f && f.remove();
|
|
1313
|
-
let
|
|
1314
|
-
|
|
1315
|
-
let
|
|
1316
|
-
|
|
1317
|
-
let
|
|
1318
|
-
|
|
1319
|
-
let
|
|
1320
|
-
|
|
1321
|
-
|
|
1249
|
+
let i = s.pageX, p = s.pageY, r = document.createElement("ul");
|
|
1250
|
+
r.style.position = "absolute", r.style.left = i + "px", r.style.top = p + "px", r.className = "chartMenu";
|
|
1251
|
+
let O = document.createElement("li");
|
|
1252
|
+
O.style.cursor = "pointer", O.innerHTML = `<div><img src='${Dn}'><span>还原缩放</span></div>`, r.appendChild(O);
|
|
1253
|
+
let x = document.createElement("li");
|
|
1254
|
+
x.style.cursor = "pointer", x.innerHTML = `<div><img src='${Cn}'><span>复制图片</span></div>`, r.appendChild(x);
|
|
1255
|
+
let N = document.createElement("li");
|
|
1256
|
+
N.style.cursor = "pointer", N.innerHTML = `<div><img src='${Tn}'><span>导出图片</span></div>`, r.appendChild(N), O.addEventListener("click", () => {
|
|
1257
|
+
k.dispatchAction({
|
|
1322
1258
|
type: "dataZoom",
|
|
1323
1259
|
dataZoomIndex: 0,
|
|
1324
1260
|
start: 0,
|
|
1325
1261
|
end: 100
|
|
1326
1262
|
});
|
|
1327
|
-
}),
|
|
1328
|
-
|
|
1263
|
+
}), x.addEventListener("click", () => {
|
|
1264
|
+
Ue(h.value, {
|
|
1329
1265
|
// dpi: 300, // 精度,处理模糊问题
|
|
1330
1266
|
useCORS: !0,
|
|
1331
1267
|
// 允许跨域
|
|
1332
1268
|
scale: 2,
|
|
1333
1269
|
// 当前显示设备的物理像素分辨率与CSS像素分辨率之比
|
|
1334
|
-
width:
|
|
1270
|
+
width: h.value.offsetWidth,
|
|
1335
1271
|
//图片宽度可自行设置
|
|
1336
|
-
height:
|
|
1272
|
+
height: h.value.offsetHeight + 50,
|
|
1337
1273
|
//图片高度可自行设置
|
|
1338
1274
|
backgroundColor: "#fff",
|
|
1339
1275
|
//图片背景色
|
|
@@ -1342,66 +1278,66 @@ ${n.name}: {a0|${r.data.coord[1]}} ${n.unit}`;
|
|
|
1342
1278
|
removeContainer: !0
|
|
1343
1279
|
// 清除临时创建的克隆dom元素
|
|
1344
1280
|
// eslint-disable-next-line space-before-function-paren
|
|
1345
|
-
}).then((
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1281
|
+
}).then((Q) => {
|
|
1282
|
+
const m = Q.toDataURL("image/png"), U = Ze(m, "图片");
|
|
1283
|
+
qe(U), bn.success("复制成功");
|
|
1348
1284
|
});
|
|
1349
|
-
}),
|
|
1350
|
-
|
|
1351
|
-
}), document.body.appendChild(
|
|
1352
|
-
|
|
1285
|
+
}), N.addEventListener("click", () => {
|
|
1286
|
+
nn();
|
|
1287
|
+
}), document.body.appendChild(r), document.addEventListener("click", () => {
|
|
1288
|
+
r.parentNode && document.body.removeChild(r);
|
|
1353
1289
|
});
|
|
1354
1290
|
}
|
|
1355
|
-
const
|
|
1356
|
-
const
|
|
1357
|
-
let
|
|
1358
|
-
const
|
|
1359
|
-
for (;
|
|
1360
|
-
|
|
1361
|
-
return new File([
|
|
1362
|
-
type:
|
|
1291
|
+
const Ze = (s, f = "file") => {
|
|
1292
|
+
const i = s.split(","), p = i[0].match(/:(.*?);/)[1], r = p.split("/")[1], O = window.atob(i[1]);
|
|
1293
|
+
let x = O.length;
|
|
1294
|
+
const N = new Uint8Array(x);
|
|
1295
|
+
for (; x--; )
|
|
1296
|
+
N[x] = O.charCodeAt(x);
|
|
1297
|
+
return new File([N], `${f}.${r}`, {
|
|
1298
|
+
type: p
|
|
1363
1299
|
});
|
|
1364
|
-
},
|
|
1300
|
+
}, qe = (s) => {
|
|
1365
1301
|
const f = new FileReader();
|
|
1366
|
-
f.onload = (
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
let
|
|
1370
|
-
|
|
1302
|
+
f.onload = (i) => {
|
|
1303
|
+
const p = i.target.result.toString(), r = new Image();
|
|
1304
|
+
r.src = p, r.onload = () => {
|
|
1305
|
+
let O = _e(r), x = en(
|
|
1306
|
+
O.replace("data:image/png;base64,", ""),
|
|
1371
1307
|
"image/png",
|
|
1372
1308
|
512
|
|
1373
1309
|
);
|
|
1374
1310
|
navigator.clipboard.write([
|
|
1375
1311
|
new ClipboardItem({
|
|
1376
|
-
"image/png":
|
|
1312
|
+
"image/png": x
|
|
1377
1313
|
})
|
|
1378
1314
|
]);
|
|
1379
1315
|
};
|
|
1380
|
-
}, f.readAsDataURL(
|
|
1381
|
-
},
|
|
1316
|
+
}, f.readAsDataURL(s);
|
|
1317
|
+
}, _e = (s) => {
|
|
1382
1318
|
let f = document.createElement("canvas");
|
|
1383
|
-
return f.width =
|
|
1384
|
-
},
|
|
1385
|
-
f = f || "",
|
|
1386
|
-
let
|
|
1387
|
-
for (let
|
|
1388
|
-
let
|
|
1389
|
-
for (let
|
|
1390
|
-
U
|
|
1391
|
-
let
|
|
1392
|
-
|
|
1319
|
+
return f.width = s.width, f.height = s.height, f.getContext("2d").drawImage(s, 0, 0, s.width, s.height), f.toDataURL("image/png");
|
|
1320
|
+
}, en = (s, f, i) => {
|
|
1321
|
+
f = f || "", i = i || 512;
|
|
1322
|
+
let p = window.atob(s), r = [];
|
|
1323
|
+
for (let x = 0; x < p.length; x += i) {
|
|
1324
|
+
let N = p.slice(x, x + i), Q = new Array(N.length);
|
|
1325
|
+
for (let U = 0; U < N.length; U++)
|
|
1326
|
+
Q[U] = N.charCodeAt(U);
|
|
1327
|
+
let m = new Uint8Array(Q);
|
|
1328
|
+
r.push(m);
|
|
1393
1329
|
}
|
|
1394
|
-
return new Blob(
|
|
1395
|
-
},
|
|
1396
|
-
|
|
1330
|
+
return new Blob(r, { type: f });
|
|
1331
|
+
}, nn = () => {
|
|
1332
|
+
Ue(h.value, {
|
|
1397
1333
|
// dpi: 300, // 精度,处理模糊问题
|
|
1398
1334
|
useCORS: !0,
|
|
1399
1335
|
// 允许跨域
|
|
1400
1336
|
scale: 1,
|
|
1401
1337
|
// 当前显示设备的物理像素分辨率与CSS像素分辨率之比
|
|
1402
|
-
width:
|
|
1338
|
+
width: h.value.offsetWidth,
|
|
1403
1339
|
//图片宽度可自行设置
|
|
1404
|
-
height:
|
|
1340
|
+
height: h.value.offsetHeight + 50,
|
|
1405
1341
|
//图片高度可自行设置
|
|
1406
1342
|
backgroundColor: "#fff",
|
|
1407
1343
|
//图片背景色
|
|
@@ -1410,152 +1346,152 @@ ${n.name}: {a0|${r.data.coord[1]}} ${n.unit}`;
|
|
|
1410
1346
|
removeContainer: !0
|
|
1411
1347
|
// 清除临时创建的克隆dom元素
|
|
1412
1348
|
// eslint-disable-next-line space-before-function-paren
|
|
1413
|
-
}).then((
|
|
1414
|
-
const f =
|
|
1415
|
-
|
|
1349
|
+
}).then((s) => {
|
|
1350
|
+
const f = s.toDataURL("image/png"), i = document.createElement("a");
|
|
1351
|
+
i.href = f, i.download = n.chartOption.title, i.click();
|
|
1416
1352
|
});
|
|
1417
|
-
},
|
|
1418
|
-
function
|
|
1419
|
-
return
|
|
1353
|
+
}, Me = fe();
|
|
1354
|
+
function an() {
|
|
1355
|
+
return Me.value ? Me.value.offsetHeight : 0;
|
|
1420
1356
|
}
|
|
1421
|
-
function
|
|
1422
|
-
return new Promise((
|
|
1423
|
-
|
|
1424
|
-
STCD:
|
|
1425
|
-
rzw:
|
|
1426
|
-
}).then((
|
|
1427
|
-
|
|
1357
|
+
function tn(s, f) {
|
|
1358
|
+
return new Promise((i) => {
|
|
1359
|
+
kn({
|
|
1360
|
+
STCD: n.chartOption.stationCode,
|
|
1361
|
+
rzw: s
|
|
1362
|
+
}).then((p) => {
|
|
1363
|
+
p.statusCode == 200 && p.data ? i(p.data) : i(f * 1e3);
|
|
1428
1364
|
});
|
|
1429
1365
|
});
|
|
1430
1366
|
}
|
|
1431
|
-
function
|
|
1432
|
-
if (
|
|
1433
|
-
let
|
|
1434
|
-
(
|
|
1435
|
-
),
|
|
1436
|
-
(
|
|
1367
|
+
function on(s, f) {
|
|
1368
|
+
if (s.length > 0) {
|
|
1369
|
+
let i = s.filter(
|
|
1370
|
+
(r) => S(r[0]).isBefore(S(f))
|
|
1371
|
+
), p = s.filter(
|
|
1372
|
+
(r) => S(r[0]).isAfter(S(f))
|
|
1437
1373
|
);
|
|
1438
|
-
if (
|
|
1439
|
-
return [f,
|
|
1440
|
-
if (
|
|
1441
|
-
return [f,
|
|
1374
|
+
if (i.length == 0)
|
|
1375
|
+
return [f, p[0][1]];
|
|
1376
|
+
if (p.length == 0)
|
|
1377
|
+
return [f, i[i.length - 1][1]];
|
|
1442
1378
|
{
|
|
1443
|
-
let
|
|
1444
|
-
S(
|
|
1379
|
+
let r = S(f).diff(
|
|
1380
|
+
S(i[i.length - 1][0]),
|
|
1445
1381
|
"seconds"
|
|
1446
|
-
),
|
|
1447
|
-
S(
|
|
1382
|
+
), O = p[0][1] - i[i.length - 1][1], x = S(p[0][0]).diff(
|
|
1383
|
+
S(i[i.length - 1][0]),
|
|
1448
1384
|
"seconds"
|
|
1449
|
-
),
|
|
1450
|
-
return [f, Number(
|
|
1385
|
+
), N = r * O / x + i[i.length - 1][1];
|
|
1386
|
+
return [f, Number(N)];
|
|
1451
1387
|
}
|
|
1452
1388
|
}
|
|
1453
1389
|
}
|
|
1454
|
-
function
|
|
1455
|
-
var
|
|
1456
|
-
let f = (
|
|
1457
|
-
const
|
|
1458
|
-
return
|
|
1390
|
+
function ln(s) {
|
|
1391
|
+
var x;
|
|
1392
|
+
let f = (x = n.chartOption.series.find((N) => N.name == "开始")) == null ? void 0 : x.data.value;
|
|
1393
|
+
const i = S(f), p = S(s), r = i.year() === p.year();
|
|
1394
|
+
return r && i.month() === p.month() ? p.format("DD HH:mm") : r ? p.format("MM-DD HH:mm") : p.format("YYYY-MM-DD HH:mm");
|
|
1459
1395
|
}
|
|
1460
|
-
return
|
|
1461
|
-
getLegendBoxHeight:
|
|
1462
|
-
onChange:
|
|
1463
|
-
}), (
|
|
1464
|
-
const
|
|
1465
|
-
return
|
|
1396
|
+
return g({
|
|
1397
|
+
getLegendBoxHeight: an,
|
|
1398
|
+
onChange: pe
|
|
1399
|
+
}), (s, f) => {
|
|
1400
|
+
const i = oe("el-checkbox"), p = oe("svg-icon"), r = oe("el-icon"), O = oe("el-dropdown-item"), x = oe("el-dropdown-menu"), N = oe("el-dropdown"), Q = cn("resize");
|
|
1401
|
+
return me((V(), ee("div", {
|
|
1466
1402
|
class: "box",
|
|
1467
1403
|
ref_key: "chartBox",
|
|
1468
|
-
ref:
|
|
1469
|
-
onContextmenu: f[1] || (f[1] = (
|
|
1404
|
+
ref: h,
|
|
1405
|
+
onContextmenu: f[1] || (f[1] = (m) => $e(m))
|
|
1470
1406
|
}, [
|
|
1471
|
-
|
|
1472
|
-
|
|
1407
|
+
me((V(), ee("div", zn, [
|
|
1408
|
+
ze(ue(l.chartOption.title), 1)
|
|
1473
1409
|
])), [
|
|
1474
|
-
[
|
|
1475
|
-
[
|
|
1410
|
+
[Le, l.chartOption.title],
|
|
1411
|
+
[Q, ye]
|
|
1476
1412
|
]),
|
|
1477
|
-
|
|
1478
|
-
|
|
1413
|
+
me((V(), ee("div", Ln, [
|
|
1414
|
+
ze(ue(l.chartOption.subTitle), 1)
|
|
1479
1415
|
])), [
|
|
1480
|
-
[
|
|
1481
|
-
[
|
|
1416
|
+
[Le, l.chartOption.subTitle],
|
|
1417
|
+
[Q, ye]
|
|
1482
1418
|
]),
|
|
1483
|
-
|
|
1419
|
+
me((V(), ee("div", {
|
|
1484
1420
|
class: "legend-box",
|
|
1485
1421
|
ref_key: "myLegend",
|
|
1486
|
-
ref:
|
|
1422
|
+
ref: Me
|
|
1487
1423
|
}, [
|
|
1488
|
-
|
|
1424
|
+
P.value.length > 1 ? (V(), Z(i, {
|
|
1489
1425
|
key: 0,
|
|
1490
|
-
modelValue:
|
|
1491
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
1426
|
+
modelValue: se.value,
|
|
1427
|
+
"onUpdate:modelValue": f[0] || (f[0] = (m) => se.value = m),
|
|
1492
1428
|
label: "全选",
|
|
1493
|
-
onChange:
|
|
1429
|
+
onChange: We,
|
|
1494
1430
|
style: { "--fill-color": "#409EFF" }
|
|
1495
|
-
}, null, 8, ["modelValue"])) :
|
|
1496
|
-
(
|
|
1497
|
-
|
|
1431
|
+
}, null, 8, ["modelValue"])) : _("", !0),
|
|
1432
|
+
(V(!0), ee(Se, null, Ne(P.value, (m, U) => (V(), ee(Se, { key: U }, [
|
|
1433
|
+
m.children ? _("", !0) : (V(), Z(i, {
|
|
1498
1434
|
key: 0,
|
|
1499
|
-
modelValue:
|
|
1500
|
-
"onUpdate:modelValue": (
|
|
1501
|
-
onChange: (
|
|
1502
|
-
style:
|
|
1435
|
+
modelValue: m.isSelected,
|
|
1436
|
+
"onUpdate:modelValue": (L) => m.isSelected = L,
|
|
1437
|
+
onChange: (L) => pe(L, m.name),
|
|
1438
|
+
style: W({ "--fill-color": m.color ? m.color : "#409EFF" })
|
|
1503
1439
|
}, {
|
|
1504
|
-
default:
|
|
1505
|
-
|
|
1440
|
+
default: q(() => [
|
|
1441
|
+
m.icon ? (V(), Z(p, {
|
|
1506
1442
|
key: 0,
|
|
1507
|
-
"icon-class":
|
|
1508
|
-
style:
|
|
1509
|
-
width:
|
|
1510
|
-
height:
|
|
1443
|
+
"icon-class": m.icon,
|
|
1444
|
+
style: W({
|
|
1445
|
+
width: m.iconWidth ? m.iconWidth + "px" : "20px",
|
|
1446
|
+
height: m.iconHeight ? m.iconHeight + "px" : "20px"
|
|
1511
1447
|
}),
|
|
1512
|
-
color:
|
|
1513
|
-
}, null, 8, ["icon-class", "style", "color"])) :
|
|
1514
|
-
|
|
1515
|
-
style:
|
|
1516
|
-
},
|
|
1517
|
-
|
|
1448
|
+
color: m.color
|
|
1449
|
+
}, null, 8, ["icon-class", "style", "color"])) : _("", !0),
|
|
1450
|
+
te("span", {
|
|
1451
|
+
style: W({ color: m.color, marginLeft: "3px" })
|
|
1452
|
+
}, ue(m.key ? m.key : m.name), 5),
|
|
1453
|
+
m.children && m.children.length > 0 ? (V(), Z(r, {
|
|
1518
1454
|
key: 1,
|
|
1519
1455
|
class: "el-icon--right"
|
|
1520
1456
|
}, {
|
|
1521
|
-
default:
|
|
1522
|
-
|
|
1457
|
+
default: q(() => [
|
|
1458
|
+
he(Be(He))
|
|
1523
1459
|
]),
|
|
1524
1460
|
_: 1
|
|
1525
|
-
})) :
|
|
1461
|
+
})) : _("", !0)
|
|
1526
1462
|
]),
|
|
1527
1463
|
_: 2
|
|
1528
1464
|
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange", "style"])),
|
|
1529
|
-
|
|
1465
|
+
m.children && m.children.length > 0 ? (V(), Z(N, {
|
|
1530
1466
|
key: 1,
|
|
1531
1467
|
"hide-on-click": !1
|
|
1532
1468
|
}, {
|
|
1533
|
-
dropdown:
|
|
1534
|
-
|
|
1535
|
-
default:
|
|
1536
|
-
(
|
|
1537
|
-
default:
|
|
1538
|
-
|
|
1539
|
-
modelValue:
|
|
1540
|
-
"onUpdate:modelValue": (
|
|
1541
|
-
onChange: (
|
|
1542
|
-
style:
|
|
1469
|
+
dropdown: q(() => [
|
|
1470
|
+
he(x, null, {
|
|
1471
|
+
default: q(() => [
|
|
1472
|
+
(V(!0), ee(Se, null, Ne(m.children, (L, de) => (V(), Z(O, { key: de }, {
|
|
1473
|
+
default: q(() => [
|
|
1474
|
+
he(i, {
|
|
1475
|
+
modelValue: L.isSelected,
|
|
1476
|
+
"onUpdate:modelValue": (ne) => L.isSelected = ne,
|
|
1477
|
+
onChange: (ne) => pe(ne, L.name),
|
|
1478
|
+
style: W({ "--fill-color": L.color ? L.color : "#409EFF" })
|
|
1543
1479
|
}, {
|
|
1544
|
-
default:
|
|
1545
|
-
|
|
1546
|
-
|
|
1480
|
+
default: q(() => [
|
|
1481
|
+
te("div", Nn, [
|
|
1482
|
+
L.icon ? (V(), Z(p, {
|
|
1547
1483
|
key: 0,
|
|
1548
|
-
"icon-class":
|
|
1549
|
-
style:
|
|
1550
|
-
width:
|
|
1551
|
-
height:
|
|
1484
|
+
"icon-class": L.icon,
|
|
1485
|
+
style: W({
|
|
1486
|
+
width: L.iconWidth ? L.iconWidth + "px" : "20px",
|
|
1487
|
+
height: L.iconHeight ? L.iconHeight + "px" : "20px"
|
|
1552
1488
|
}),
|
|
1553
|
-
color:
|
|
1554
|
-
}, null, 8, ["icon-class", "style", "color"])) :
|
|
1489
|
+
color: L.color
|
|
1490
|
+
}, null, 8, ["icon-class", "style", "color"])) : _("", !0)
|
|
1555
1491
|
]),
|
|
1556
|
-
|
|
1557
|
-
style:
|
|
1558
|
-
},
|
|
1492
|
+
te("span", {
|
|
1493
|
+
style: W({ color: L.color, marginLeft: "3px" })
|
|
1494
|
+
}, ue(L.key ? L.key : L.name), 5)
|
|
1559
1495
|
]),
|
|
1560
1496
|
_: 2
|
|
1561
1497
|
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange", "style"])
|
|
@@ -1566,57 +1502,57 @@ ${n.name}: {a0|${r.data.coord[1]}} ${n.unit}`;
|
|
|
1566
1502
|
_: 2
|
|
1567
1503
|
}, 1024)
|
|
1568
1504
|
]),
|
|
1569
|
-
default:
|
|
1570
|
-
|
|
1571
|
-
modelValue:
|
|
1572
|
-
"onUpdate:modelValue": (
|
|
1573
|
-
onChange: (
|
|
1574
|
-
style:
|
|
1505
|
+
default: q(() => [
|
|
1506
|
+
he(i, {
|
|
1507
|
+
modelValue: m.isSelected,
|
|
1508
|
+
"onUpdate:modelValue": (L) => m.isSelected = L,
|
|
1509
|
+
onChange: (L) => pe(L, m.name),
|
|
1510
|
+
style: W({ "--fill-color": m.color ? m.color : "#409EFF" })
|
|
1575
1511
|
}, {
|
|
1576
|
-
default:
|
|
1577
|
-
|
|
1512
|
+
default: q(() => [
|
|
1513
|
+
m.icon ? (V(), Z(p, {
|
|
1578
1514
|
key: 0,
|
|
1579
|
-
"icon-class":
|
|
1580
|
-
style:
|
|
1581
|
-
width:
|
|
1582
|
-
height:
|
|
1515
|
+
"icon-class": m.icon,
|
|
1516
|
+
style: W({
|
|
1517
|
+
width: m.iconWidth ? m.iconWidth + "px" : "20px",
|
|
1518
|
+
height: m.iconHeight ? m.iconHeight + "px" : "20px"
|
|
1583
1519
|
}),
|
|
1584
|
-
color:
|
|
1585
|
-
}, null, 8, ["icon-class", "style", "color"])) :
|
|
1586
|
-
|
|
1587
|
-
style:
|
|
1588
|
-
},
|
|
1589
|
-
|
|
1520
|
+
color: m.color
|
|
1521
|
+
}, null, 8, ["icon-class", "style", "color"])) : _("", !0),
|
|
1522
|
+
te("span", {
|
|
1523
|
+
style: W({ color: m.color, marginLeft: "3px" })
|
|
1524
|
+
}, ue(m.key ? m.key : m.name), 5),
|
|
1525
|
+
m.children && m.children.length > 0 ? (V(), Z(r, {
|
|
1590
1526
|
key: 1,
|
|
1591
1527
|
class: "el-icon--right"
|
|
1592
1528
|
}, {
|
|
1593
|
-
default:
|
|
1594
|
-
|
|
1529
|
+
default: q(() => [
|
|
1530
|
+
he(Be(He))
|
|
1595
1531
|
]),
|
|
1596
1532
|
_: 1
|
|
1597
|
-
})) :
|
|
1533
|
+
})) : _("", !0)
|
|
1598
1534
|
]),
|
|
1599
1535
|
_: 2
|
|
1600
1536
|
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange", "style"])
|
|
1601
1537
|
]),
|
|
1602
1538
|
_: 2
|
|
1603
|
-
}, 1024)) :
|
|
1539
|
+
}, 1024)) : _("", !0)
|
|
1604
1540
|
], 64))), 128))
|
|
1605
1541
|
])), [
|
|
1606
|
-
[
|
|
1542
|
+
[Q, ye]
|
|
1607
1543
|
]),
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
id:
|
|
1611
|
-
style:
|
|
1612
|
-
}, null, 12,
|
|
1544
|
+
te("div", Bn, [
|
|
1545
|
+
te("div", {
|
|
1546
|
+
id: l.id,
|
|
1547
|
+
style: W({ width: l.width, height: l.height })
|
|
1548
|
+
}, null, 12, Yn)
|
|
1613
1549
|
])
|
|
1614
1550
|
], 32)), [
|
|
1615
|
-
[
|
|
1551
|
+
[Q, ye]
|
|
1616
1552
|
]);
|
|
1617
1553
|
};
|
|
1618
1554
|
}
|
|
1619
|
-
},
|
|
1555
|
+
}, je = /* @__PURE__ */ Ge(Rn, [["__scopeId", "data-v-adf77597"]]), Un = un({
|
|
1620
1556
|
props: {
|
|
1621
1557
|
iconClass: {
|
|
1622
1558
|
type: String,
|
|
@@ -1631,30 +1567,30 @@ ${n.name}: {a0|${r.data.coord[1]}} ${n.unit}`;
|
|
|
1631
1567
|
default: ""
|
|
1632
1568
|
}
|
|
1633
1569
|
},
|
|
1634
|
-
setup(
|
|
1570
|
+
setup(l) {
|
|
1635
1571
|
return {
|
|
1636
1572
|
// 开发环境使用 icon-[name] 格式
|
|
1637
|
-
iconName:
|
|
1638
|
-
svgClass:
|
|
1573
|
+
iconName: Ye(() => `#icon-${l.iconClass}`),
|
|
1574
|
+
svgClass: Ye(() => l.className ? `svg-icon ${l.className}` : "svg-icon")
|
|
1639
1575
|
};
|
|
1640
1576
|
}
|
|
1641
|
-
}),
|
|
1642
|
-
function
|
|
1643
|
-
return
|
|
1644
|
-
class:
|
|
1577
|
+
}), Hn = ["xlink:href", "fill"];
|
|
1578
|
+
function Vn(l, g, Y, h, n, M) {
|
|
1579
|
+
return V(), ee("svg", {
|
|
1580
|
+
class: fn(l.svgClass),
|
|
1645
1581
|
"aria-hidden": "true"
|
|
1646
1582
|
}, [
|
|
1647
|
-
|
|
1648
|
-
"xlink:href":
|
|
1649
|
-
fill:
|
|
1650
|
-
}, null, 8,
|
|
1583
|
+
te("use", {
|
|
1584
|
+
"xlink:href": l.iconName,
|
|
1585
|
+
fill: l.color
|
|
1586
|
+
}, null, 8, Hn)
|
|
1651
1587
|
], 2);
|
|
1652
1588
|
}
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1655
|
-
|
|
1589
|
+
const Qn = /* @__PURE__ */ Ge(Un, [["render", Vn]]);
|
|
1590
|
+
je.install = (l) => {
|
|
1591
|
+
l.component("ElCheckbox", En), l.component("ElIcon", Mn), l.component("ElDropdown", wn), l.component("ElDropdownMenu", Sn), l.component("ElDropdownItem", In), l.component("SvgIcon", Qn), l.component("HydroGraph", je);
|
|
1656
1592
|
};
|
|
1657
1593
|
export {
|
|
1658
|
-
|
|
1659
|
-
|
|
1594
|
+
je as HydroGraph,
|
|
1595
|
+
je as default
|
|
1660
1596
|
};
|