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