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