st-comp 0.0.231 → 0.0.232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/KlineBasic.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import "./base-a5af3db3.js";
2
- import { E as Ie } from "./el-dialog-41ab8417.js";
2
+ import { E as $e } from "./el-dialog-41ab8417.js";
3
3
  import "./el-overlay-09ad71cd.js";
4
4
  import "./el-input-2f75c4ba.js";
5
5
  import { E as Be } from "./el-input-number-5193fe6d.js";
6
6
  import { E as Oe } from "./el-button-c95adb85.js";
7
- import { E as $e } from "./el-empty-33cb66f1.js";
7
+ import { E as Ne } from "./el-empty-33cb66f1.js";
8
8
  import { E as Pe, a as We } from "./el-menu-item-7e881203.js";
9
9
  import "./el-tooltip-4ed993c7.js";
10
10
  import "./el-popper-b4f97157.js";
11
- import { defineComponent as ye, ref as S, watch as G, nextTick as ge, openBlock as A, createElementBlock as E, Fragment as ee, renderList as ce, normalizeStyle as de, toDisplayString as te, computed as ne, createVNode as B, onMounted as De, onUnmounted as ke, createElementVNode as U, withCtx as K, createBlock as Me, createCommentVNode as J, renderSlot as Ye, createTextVNode as se, pushScopeId as Ne, popScopeId as qe } from "vue";
12
- import * as ve from "echarts";
11
+ import { defineComponent as ve, ref as T, watch as J, nextTick as ge, openBlock as F, createElementBlock as E, Fragment as ee, renderList as ce, normalizeStyle as de, toDisplayString as te, computed as ne, createVNode as $, onMounted as De, onUnmounted as ke, createElementVNode as U, withCtx as K, createBlock as Me, createCommentVNode as Q, renderSlot as Ye, createTextVNode as se, pushScopeId as qe, popScopeId as Ce } from "vue";
12
+ import * as ye from "echarts";
13
13
  import { d } from "./dayjs.min-8313b006.js";
14
- import { y as Ce, v as ze, U as Ke, K as Ue, V as oe, x as be, D as He } from "./index-7ed0999e.js";
14
+ import { y as ze, v as Ke, U as Ue, K as He, V as oe, x as be, D as je } from "./index-7ed0999e.js";
15
15
  import { E as ue } from "./el-message-e544a8f5.js";
16
- import { _ as X } from "./_plugin-vue_export-helper-dad06003.js";
16
+ import { _ as G } from "./_plugin-vue_export-helper-dad06003.js";
17
17
  import "./el-tag-66cab138.js";
18
- import { E as je, a as Ze } from "./el-select-95627997.js";
18
+ import { E as Ze, a as Xe } from "./el-select-95627997.js";
19
19
  import "./el-scrollbar-323542e7.js";
20
20
  import "./index-a871c3eb.js";
21
21
  import "./use-form-common-props-815d48a6.js";
@@ -34,21 +34,21 @@ import "./index-844bdd85.js";
34
34
  import "./index-57672682.js";
35
35
  import "./castArray-7741a212.js";
36
36
  import "./debounce-8d53f4dd.js";
37
- let Z = null;
38
- const Xe = (n) => {
39
- const w = Ce(n, {
40
- handleReq: (T) => {
41
- ze() && (T.headers.token = Ke());
37
+ let X = null;
38
+ const Ge = (n) => {
39
+ const D = ze(n, {
40
+ handleReq: (Y) => {
41
+ Ke() && (Y.headers.token = Ue());
42
42
  },
43
- handleRes: (T) => {
44
- const { data: i } = T;
45
- if (i.code === 401)
46
- return location.origin.includes("localhost") ? location.href = `${location.origin}/#/404` : Ue(), !0;
43
+ handleRes: (Y) => {
44
+ const { data: l } = Y;
45
+ if (l.code === 401)
46
+ return location.origin.includes("localhost") ? location.href = `${location.origin}/#/404` : He(), !0;
47
47
  }
48
48
  });
49
- w.get, Z = w.post;
50
- }, Ge = (n) => Z("/middleLayer/kline/getKlineBasic", { ...n, userId: oe("id") }), Je = (n) => Z("/middleLayer/kline/getKline", n), Qe = async (n) => Z("/alarm/deliversign/addAlarmPrice", { ...n, userId: oe("id") }), et = async (n) => Z("/alarm/deliversign/findAlarmPriceByUserId", { ...n, userId: oe("id") }), Se = async (n) => Z("/alarm/deliversign/updateAlarmPrice", { ...n, userId: oe("id") }), tt = async (n) => Z("/alarm/deliversign/deleteAlarmPrice", { ...n, userId: oe("id") }), { round: Q } = be, nt = (n, w, T, i, u) => {
51
- const { data: e, time: D } = n, { gridTop: c, gridRight: g, gridLeft: f, maxShowCounts: v, showSubChart: a } = w;
49
+ D.get, X = D.post;
50
+ }, Je = (n) => X("/middleLayer/kline/getKlineBasic", { ...n, userId: oe("id") }), Qe = (n) => X("/middleLayer/kline/getKline", n), et = async (n) => X("/alarm/deliversign/addAlarmPrice", { ...n, userId: oe("id") }), tt = async (n) => X("/alarm/deliversign/findAlarmPriceByUserId", { ...n, userId: oe("id") }), Se = async (n) => X("/alarm/deliversign/updateAlarmPrice", { ...n, userId: oe("id") }), nt = async (n) => X("/alarm/deliversign/deleteAlarmPrice", { ...n, userId: oe("id") }), { round: Z } = be, ot = (n, D, Y, l, s) => {
51
+ const { data: e, time: k } = n, { gridTop: c, gridRight: g, gridLeft: f, maxShowCounts: y, showSubChart: a } = D;
52
52
  return {
53
53
  animation: !1,
54
54
  grid: {
@@ -60,9 +60,9 @@ const Xe = (n) => {
60
60
  dataZoom: [
61
61
  {
62
62
  type: "inside",
63
- startValue: T,
64
- endValue: i,
65
- maxValueSpan: v
63
+ startValue: Y,
64
+ endValue: l,
65
+ maxValueSpan: y
66
66
  }
67
67
  ],
68
68
  tooltip: {
@@ -75,7 +75,7 @@ const Xe = (n) => {
75
75
  rich: {},
76
76
  formatter: (o) => {
77
77
  const { axisDimension: b, value: x } = o;
78
- return b === "x" ? a ? "" : ["6", "7", "8"].includes(u) ? d(x).format("YYYY-MM-DD") : x : String(Q(x));
78
+ return b === "x" ? a ? "" : ["6", "7", "8"].includes(s) ? d(x).format("YYYY-MM-DD") : x : String(Z(x));
79
79
  }
80
80
  }
81
81
  },
@@ -84,12 +84,12 @@ const Xe = (n) => {
84
84
  xAxis: {
85
85
  show: !a,
86
86
  type: "category",
87
- data: D,
87
+ data: k,
88
88
  splitLine: {
89
89
  show: !1
90
90
  },
91
91
  axisLabel: {
92
- formatter: (o) => ["6", "7", "8"].includes(u) ? d(o).format("YYYY-MM-DD") : o
92
+ formatter: (o) => ["6", "7", "8"].includes(s) ? d(o).format("YYYY-MM-DD") : o
93
93
  }
94
94
  },
95
95
  yAxis: {
@@ -104,8 +104,8 @@ const Xe = (n) => {
104
104
  color: "#333"
105
105
  }
106
106
  },
107
- min: (o) => Q(o.min),
108
- max: (o) => Q(o.max)
107
+ min: (o) => Z(o.min),
108
+ max: (o) => Z(o.max)
109
109
  },
110
110
  series: [
111
111
  {
@@ -149,13 +149,13 @@ const Xe = (n) => {
149
149
  }
150
150
  }
151
151
  };
152
- }, ot = (n, w, T, i, u) => {
153
- const { variety: e, featureId: D, featureType: c } = T, { gridTop: g, gridLeft: f, gridRight: v } = i;
154
- return w.reduce((a, o) => {
152
+ }, at = (n, D, Y, l, s) => {
153
+ const { variety: e, featureId: k, featureType: c } = Y, { gridTop: g, gridLeft: f, gridRight: y } = l;
154
+ return D.reduce((a, o) => {
155
155
  const { warnPrice: b } = o, x = n == null ? void 0 : n.convertToPixel({ yAxisIndex: 0 }, b);
156
156
  if (x <= g || x >= (n == null ? void 0 : n.getHeight()))
157
157
  return a;
158
- let V = 0;
158
+ let A = 0;
159
159
  return [
160
160
  ...a,
161
161
  {
@@ -172,7 +172,7 @@ const Xe = (n) => {
172
172
  // 开始X坐标
173
173
  y1: x,
174
174
  // 开始Y坐标
175
- x2: (n == null ? void 0 : n.getWidth()) - v,
175
+ x2: (n == null ? void 0 : n.getWidth()) - y,
176
176
  // 结束X坐标
177
177
  y2: x
178
178
  // 结束Y坐标
@@ -187,7 +187,7 @@ const Xe = (n) => {
187
187
  {
188
188
  type: "text",
189
189
  info: o,
190
- x: (n == null ? void 0 : n.getWidth()) - v,
190
+ x: (n == null ? void 0 : n.getWidth()) - y,
191
191
  y: x - 5,
192
192
  style: {
193
193
  fill: "#FFF",
@@ -200,37 +200,65 @@ const Xe = (n) => {
200
200
  }
201
201
  ],
202
202
  // 事件:开始拖拽
203
- ondragstart: (M) => {
204
- V = M.offsetY;
203
+ ondragstart: (S) => {
204
+ A = S.offsetY;
205
205
  },
206
- ondrag: (M) => {
207
- var P;
208
- if (M.target && M.target.childAt(1)) {
209
- const L = n.convertFromPixel({ yAxisIndex: 0 }, x + (M.offsetY - V));
210
- (P = M.target.childAt(1)) == null || P.animate("style", !1).when(1, { text: Q(L, 3) }).start();
206
+ ondrag: (S) => {
207
+ var N;
208
+ if (S.target && S.target.childAt(1)) {
209
+ const L = n.convertFromPixel({ yAxisIndex: 0 }, x + (S.offsetY - A));
210
+ (N = S.target.childAt(1)) == null || N.animate("style", !1).when(1, { text: Z(L, 3) }).start();
211
211
  }
212
212
  },
213
213
  // 事件:结束拖拽
214
- ondragend: async (M) => {
215
- const L = M.offsetY - V;
214
+ ondragend: async (S) => {
215
+ const L = S.offsetY - A;
216
216
  if (L !== 0) {
217
217
  const I = n == null ? void 0 : n.convertFromPixel({ yAxisIndex: 0 }, L + x), p = {
218
218
  id: o.id,
219
- warnPrice: Q(I, 3),
220
- featureId: D,
219
+ warnPrice: Z(I, 3),
220
+ featureId: k,
221
221
  //品种id
222
222
  featureCode: e,
223
223
  //品种代码
224
224
  featureType: c
225
225
  //品种类型
226
226
  };
227
- await Se(p), ue.success("画线预警修改成功"), u && u();
227
+ await Se(p), ue.success("画线预警修改成功"), s && s();
228
228
  }
229
229
  }
230
230
  }
231
231
  ];
232
232
  }, []);
233
- }, at = /* @__PURE__ */ ye({
233
+ };
234
+ function Te(n) {
235
+ function D(l) {
236
+ if (typeof l == "number")
237
+ return Number.isFinite(l) ? l : null;
238
+ if (typeof l == "string") {
239
+ const s = l.trim();
240
+ if (s === "")
241
+ return null;
242
+ const e = Number(s);
243
+ return Number.isFinite(e) ? e : null;
244
+ }
245
+ return null;
246
+ }
247
+ const Y = D(n);
248
+ if (Y === null)
249
+ return "-";
250
+ try {
251
+ if (Y >= 1 || Y <= -1)
252
+ return Z(Y);
253
+ {
254
+ const l = Y.toPrecision(3);
255
+ return Z(l, l.split(".")[1].length - 1);
256
+ }
257
+ } catch {
258
+ return "-";
259
+ }
260
+ }
261
+ const rt = /* @__PURE__ */ ve({
234
262
  __name: "index",
235
263
  props: {
236
264
  // 提示数据
@@ -240,29 +268,29 @@ const Xe = (n) => {
240
268
  }
241
269
  },
242
270
  setup(n) {
243
- const w = n, T = S(null), i = S([]);
244
- return G(() => w.data, () => {
245
- i.value.length === 0 && ge(() => {
246
- Array.from(T.value.children).forEach((u, e) => {
247
- var D, c, g, f, v, a, o, b;
248
- ((c = (D = w.data) == null ? void 0 : D[e]) == null ? void 0 : c.label) === "涨跌" ? i.value[e] = "85px" : ((f = (g = w.data) == null ? void 0 : g[e]) == null ? void 0 : f.label) === "至今涨幅" ? i.value[e] = "115px" : ((a = (v = w.data) == null ? void 0 : v[e]) == null ? void 0 : a.label) === "额" ? i.value[e] = "85px" : ["开", "高", "低", "收"].includes((b = (o = w.data) == null ? void 0 : o[e]) == null ? void 0 : b.label) ? i.value[e] = `${u.offsetWidth + 20}px` : i.value[e] = `${u.offsetWidth + 36}px`;
271
+ const D = n, Y = T(null), l = T([]);
272
+ return J(() => D.data, () => {
273
+ l.value.length === 0 && ge(() => {
274
+ Array.from(Y.value.children).forEach((s, e) => {
275
+ var k, c, g, f, y, a, o, b;
276
+ ((c = (k = D.data) == null ? void 0 : k[e]) == null ? void 0 : c.label) === "涨跌" ? l.value[e] = "85px" : ((f = (g = D.data) == null ? void 0 : g[e]) == null ? void 0 : f.label) === "至今涨幅" ? l.value[e] = "115px" : ((a = (y = D.data) == null ? void 0 : y[e]) == null ? void 0 : a.label) === "额" ? l.value[e] = "85px" : ["开", "高", "低", "收"].includes((b = (o = D.data) == null ? void 0 : o[e]) == null ? void 0 : b.label) ? l.value[e] = `${s.offsetWidth + 20}px` : l.value[e] = `${s.offsetWidth + 36}px`;
249
277
  });
250
278
  });
251
- }), (u, e) => (A(), E("div", {
279
+ }), (s, e) => (F(), E("div", {
252
280
  class: "kline-tips",
253
281
  ref_key: "tipsRef",
254
- ref: T
282
+ ref: Y
255
283
  }, [
256
- (A(!0), E(ee, null, ce(n.data, (D, c) => (A(), E("div", {
284
+ (F(!0), E(ee, null, ce(n.data, (k, c) => (F(), E("div", {
257
285
  key: c,
258
286
  class: "kline-tips-item",
259
- style: de({ color: D.color, width: i.value[c] ? i.value[c] : null })
260
- }, te(D.label) + " " + te(D.value), 5))), 128))
287
+ style: de({ color: k.color, width: l.value[c] ? l.value[c] : null })
288
+ }, te(k.label) + " " + te(k.value), 5))), 128))
261
289
  ], 512));
262
290
  }
263
291
  });
264
- const we = /* @__PURE__ */ X(at, [["__scopeId", "data-v-1ccf76bf"]]);
265
- const lt = { class: "kline-tips" }, rt = {
292
+ const we = /* @__PURE__ */ G(rt, [["__scopeId", "data-v-1ccf76bf"]]);
293
+ const lt = { class: "kline-tips" }, it = {
266
294
  __name: "index",
267
295
  props: {
268
296
  // 提示数据
@@ -280,42 +308,42 @@ const lt = { class: "kline-tips" }, rt = {
280
308
  }
281
309
  },
282
310
  setup(n) {
283
- const { round: w, formatValue: T } = be, i = n, u = S(null);
284
- G(() => i.activeIndex, () => {
285
- u.value === null && (u.value = i.data.data[i.activeIndex][1]);
286
- }), G(() => i.data, () => {
287
- u.value === null && (u.value = i.data.data[i.activeIndex][1]);
288
- }), G(() => i.variety, () => {
289
- u.value = null;
311
+ const { round: D, formatValue: Y } = be, l = n, s = T(null);
312
+ J(() => l.activeIndex, () => {
313
+ s.value === null && (s.value = l.data.data[l.activeIndex][1]);
314
+ }), J(() => l.data, () => {
315
+ s.value === null && (s.value = l.data.data[l.activeIndex][1]);
316
+ }), J(() => l.variety, () => {
317
+ s.value = null;
290
318
  });
291
319
  const e = ne(() => {
292
- const { data: c, activeIndex: g } = i;
320
+ const { data: c, activeIndex: g } = l;
293
321
  if (c.data && c.data[g]) {
294
- const f = c.data[g], v = [
322
+ const f = c.data[g], y = [
295
323
  { label: "开", value: f[0] },
296
324
  { label: "高", value: f[3] },
297
325
  { label: "低", value: f[2] },
298
326
  { label: "收", value: f[1] }
299
327
  ];
300
- f[4] !== null && v.push({ label: "额", value: T(f[4]) });
328
+ f[4] !== null && y.push({ label: "额", value: Y(f[4]) });
301
329
  let a;
302
- f[6] > 0 ? a = "red" : f[6] < 0 && (a = "green"), v.push({ label: "涨跌", value: `${w(f[6])}%`, color: a });
303
- const o = (u.value / f[1] - 1) * 100;
330
+ f[6] > 0 ? a = "red" : f[6] < 0 && (a = "green"), y.push({ label: "涨跌", value: `${D(f[6])}%`, color: a });
331
+ const o = (s.value / f[1] - 1) * 100;
304
332
  let b;
305
- return o > 0 ? b = "red" : o < 0 && (b = "green"), v.push({ label: "至今涨幅", value: `${w(o)}%`, color: b }), v;
333
+ return o > 0 ? b = "red" : o < 0 && (b = "green"), y.push({ label: "至今涨幅", value: `${D(o)}%`, color: b }), y;
306
334
  }
307
335
  return [];
308
- }), D = ne(() => {
336
+ }), k = ne(() => {
309
337
  var f;
310
- const { data: c, activeIndex: g } = i;
311
- return ((f = c == null ? void 0 : c.mainIndicator) == null ? void 0 : f.map((v) => ({ label: v.key, value: w(v.data[g]), color: v.color }))) || [];
338
+ const { data: c, activeIndex: g } = l;
339
+ return ((f = c == null ? void 0 : c.mainIndicator) == null ? void 0 : f.map((y) => ({ label: y.key, value: Te(y.data[g]), color: y.color }))) || [];
312
340
  });
313
- return (c, g) => (A(), E("div", lt, [
314
- B(we, { data: e.value }, null, 8, ["data"]),
315
- B(we, { data: D.value }, null, 8, ["data"])
341
+ return (c, g) => (F(), E("div", lt, [
342
+ $(we, { data: e.value }, null, 8, ["data"]),
343
+ $(we, { data: k.value }, null, 8, ["data"])
316
344
  ]));
317
345
  }
318
- }, it = /* @__PURE__ */ X(rt, [["__scopeId", "data-v-d24c4fcf"]]), st = { class: "kline-averageTips" }, ut = /* @__PURE__ */ ye({
346
+ }, st = /* @__PURE__ */ G(it, [["__scopeId", "data-v-5be4d504"]]), ut = { class: "kline-averageTips" }, ct = /* @__PURE__ */ ve({
319
347
  __name: "index",
320
348
  props: {
321
349
  // 提示数据
@@ -325,20 +353,20 @@ const lt = { class: "kline-tips" }, rt = {
325
353
  }
326
354
  },
327
355
  setup(n) {
328
- return (w, T) => (A(), E("div", st, [
329
- (A(!0), E(ee, null, ce(n.data, (i, u) => (A(), E("div", {
330
- key: u,
356
+ return (D, Y) => (F(), E("div", ut, [
357
+ (F(!0), E(ee, null, ce(n.data, (l, s) => (F(), E("div", {
358
+ key: s,
331
359
  class: "kline-averageTips-item",
332
- style: de({ color: i.color })
333
- }, te(i.label) + " " + te(i.value), 5))), 128))
360
+ style: de({ color: l.color })
361
+ }, te(l.label) + " " + te(l.value), 5))), 128))
334
362
  ]));
335
363
  }
336
364
  });
337
- const ct = /* @__PURE__ */ X(ut, [["__scopeId", "data-v-2ce54548"]]);
338
- const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
365
+ const dt = /* @__PURE__ */ G(ct, [["__scopeId", "data-v-2ce54548"]]);
366
+ const ft = { class: "klineSub" }, pt = { class: "klineSub-tips" }, mt = {
339
367
  key: 0,
340
368
  class: "klineSub-tips-select"
341
- }, mt = {
369
+ }, yt = {
342
370
  __name: "index",
343
371
  props: {
344
372
  cycle: {
@@ -354,37 +382,37 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
354
382
  // 副图指标列表
355
383
  },
356
384
  emits: ["update:modelValue"],
357
- setup(n, { expose: w, emit: T }) {
358
- const { round: i } = be;
359
- let u, e;
360
- const D = T, c = n, g = S(), f = ne({
385
+ setup(n, { expose: D, emit: Y }) {
386
+ const { round: l } = be;
387
+ let s, e;
388
+ const k = Y, c = n, g = T(), f = ne({
361
389
  get() {
362
390
  return c.modelValue;
363
391
  },
364
392
  set(o) {
365
- D("update:modelValue", o);
393
+ k("update:modelValue", o);
366
394
  }
367
- }), v = ne(() => {
395
+ }), y = ne(() => {
368
396
  var x;
369
397
  const { data: o, activeIndex: b } = c;
370
- return ((x = o == null ? void 0 : o.subIndicator) == null ? void 0 : x.map((V) => ({ label: V.key, color: V.color, value: V.data[b] || "-" }))) || [];
398
+ return ((x = o == null ? void 0 : o.subIndicator) == null ? void 0 : x.map((A) => ({ label: A.key, color: A.color, value: `${A.data[b]}-${Te(A.data[b])}` }))) || [];
371
399
  });
372
400
  De(() => {
373
- u = ve.init(g.value);
401
+ s = ye.init(g.value);
374
402
  let o = !0;
375
403
  e = new ResizeObserver(() => {
376
404
  if (o) {
377
405
  o = null;
378
406
  return;
379
407
  }
380
- u.resize();
408
+ s.resize();
381
409
  }), e.observe(g.value);
382
410
  }), ke(() => {
383
- u.dispose(), e.disconnect(), e = null;
411
+ s.dispose(), e.disconnect(), e = null;
384
412
  });
385
413
  const a = (o, b) => {
386
- const x = o[b], V = b === 0 ? o[b] : o[b - 1];
387
- return x[0] === x[1] ? x[0] >= V[1] ? {
414
+ const x = o[b], A = b === 0 ? o[b] : o[b - 1];
415
+ return x[0] === x[1] ? x[0] >= A[1] ? {
388
416
  color: "transparent",
389
417
  borderColor: "#FF0000"
390
418
  } : {
@@ -396,14 +424,14 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
396
424
  color: "#00FFFF"
397
425
  };
398
426
  };
399
- return w({
427
+ return D({
400
428
  connect: (o) => {
401
- ve.connect([o, u]);
429
+ ye.connect([o, s]);
402
430
  },
403
431
  // 联动
404
432
  draw: (o, b) => {
405
433
  ge(() => {
406
- const { startValue: x, endValue: V, maxValueSpan: M } = o, { leftYAxisRange: P, rightYAxisRange: L } = c.data.subIndicator[0], I = c.data.subIndicator.map((p) => {
434
+ const { startValue: x, endValue: A, maxValueSpan: S } = o, { leftYAxisRange: N, rightYAxisRange: L } = c.data.subIndicator[0], I = c.data.subIndicator.map((p) => {
407
435
  if (p.series === "bar")
408
436
  return {
409
437
  name: "subMain",
@@ -412,16 +440,16 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
412
440
  type: "bar",
413
441
  silent: !0,
414
442
  symbol: "none",
415
- data: p.data.map((N, C) => p.seriesColor === "kline" ? {
416
- value: N,
443
+ data: p.data.map((W, C) => p.seriesColor === "kline" ? {
444
+ value: W,
417
445
  itemStyle: a(c.data.data, C)
418
446
  } : p.seriesColor === "value" ? {
419
- value: N,
447
+ value: W,
420
448
  itemStyle: {
421
- color: N >= 0 ? "#FF0000" : "#00FFFF"
449
+ color: W >= 0 ? "#FF0000" : "#00FFFF"
422
450
  }
423
451
  } : {
424
- value: N,
452
+ value: W,
425
453
  itemStyle: {
426
454
  color: p.seriesColor
427
455
  }
@@ -444,7 +472,7 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
444
472
  }
445
473
  };
446
474
  });
447
- u.setOption(
475
+ s.setOption(
448
476
  {
449
477
  animation: !1,
450
478
  grid: {
@@ -457,8 +485,8 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
457
485
  {
458
486
  type: "inside",
459
487
  startValue: x,
460
- endValue: V,
461
- maxValueSpan: M
488
+ endValue: A,
489
+ maxValueSpan: S
462
490
  }
463
491
  ],
464
492
  tooltip: {
@@ -470,11 +498,11 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
470
498
  label: {
471
499
  rich: {},
472
500
  formatter: (p) => {
473
- const { axisDimension: N, value: C } = p;
474
- if (N === "x")
501
+ const { axisDimension: W, value: C } = p;
502
+ if (W === "x")
475
503
  return ["6", "7", "8"].includes(c.cycle) ? d(C).format("YYYY-MM-DD") : C;
476
504
  if (p.axisIndex === 1)
477
- return String(i(C));
505
+ return String(l(C));
478
506
  }
479
507
  }
480
508
  },
@@ -499,8 +527,8 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
499
527
  },
500
528
  {
501
529
  position: "left",
502
- min: P === "cover" ? (p) => p.min : null,
503
- max: P === "cover" ? (p) => p.max : null,
530
+ min: N === "cover" ? (p) => p.min : null,
531
+ max: N === "cover" ? (p) => p.max : null,
504
532
  splitNumber: 1,
505
533
  axisLine: {
506
534
  show: !0
@@ -537,28 +565,28 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
537
565
  }
538
566
  // 重置
539
567
  }), (o, b) => {
540
- const x = je, V = Ze;
541
- return A(), E("div", dt, [
542
- U("div", ft, [
543
- v.value.length ? (A(), E("div", pt, [
544
- B(V, {
568
+ const x = Ze, A = Xe;
569
+ return F(), E("div", ft, [
570
+ U("div", pt, [
571
+ y.value.length ? (F(), E("div", mt, [
572
+ $(A, {
545
573
  modelValue: f.value,
546
- "onUpdate:modelValue": b[0] || (b[0] = (M) => f.value = M),
574
+ "onUpdate:modelValue": b[0] || (b[0] = (S) => f.value = S),
547
575
  size: "small",
548
576
  "popper-class": "element-dark",
549
577
  class: "element-dark subIndicator"
550
578
  }, {
551
579
  default: K(() => [
552
- (A(!0), E(ee, null, ce(n.subIndicatorList, (M) => (A(), Me(x, {
553
- key: M.value,
554
- label: M.label,
555
- value: M.value
580
+ (F(!0), E(ee, null, ce(n.subIndicatorList, (S) => (F(), Me(x, {
581
+ key: S.value,
582
+ label: S.label,
583
+ value: S.value
556
584
  }, null, 8, ["label", "value"]))), 128))
557
585
  ]),
558
586
  _: 1
559
587
  }, 8, ["modelValue"])
560
- ])) : J("", !0),
561
- B(ct, { data: v.value }, null, 8, ["data"])
588
+ ])) : Q("", !0),
589
+ $(dt, { data: y.value }, null, 8, ["data"])
562
590
  ]),
563
591
  U("div", {
564
592
  class: "klineSub-chart",
@@ -568,62 +596,62 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
568
596
  ]);
569
597
  };
570
598
  }
571
- }, vt = /* @__PURE__ */ X(mt, [["__scopeId", "data-v-7ec4c8cf"]]), yt = /* @__PURE__ */ ye({
599
+ }, vt = /* @__PURE__ */ G(yt, [["__scopeId", "data-v-9af636f9"]]), gt = /* @__PURE__ */ ve({
572
600
  __name: "index",
573
601
  emits: ["closeContextMenuCallBack"],
574
- setup(n, { emit: w }) {
575
- const T = w, i = S(), u = S(), e = S({
602
+ setup(n, { emit: D }) {
603
+ const Y = D, l = T(), s = T(), e = T({
576
604
  display: "none",
577
605
  top: "0px",
578
606
  left: "0px"
579
- }), D = () => {
580
- e.value.display = "none", T("closeContextMenuCallBack"), document.removeEventListener("click", D);
607
+ }), k = () => {
608
+ e.value.display = "none", Y("closeContextMenuCallBack"), document.removeEventListener("click", k);
581
609
  }, c = (g) => {
582
610
  if (g.preventDefault(), e.value.display === "block") {
583
- const { offsetX: f, offsetY: v } = g, { offsetWidth: a, offsetHeight: o } = u.value;
584
- if (f <= a && v <= o)
611
+ const { offsetX: f, offsetY: y } = g, { offsetWidth: a, offsetHeight: o } = s.value;
612
+ if (f <= a && y <= o)
585
613
  return;
586
614
  }
587
- i.value.click(), e.value = {
615
+ l.value.click(), e.value = {
588
616
  display: "block",
589
617
  top: `${g.offsetY}px`,
590
618
  left: `${g.offsetX}px`
591
619
  }, ge(() => {
592
- const f = i.value.getBoundingClientRect(), v = u.value.getBoundingClientRect();
593
- v.left + v.width >= f.right && (e.value.left = `${g.offsetX - v.width}px`), v.top + v.height >= f.bottom && (console.log("高度超出"), e.value.top = `${g.offsetY - v.height}px`);
594
- }), document.addEventListener("click", D);
620
+ const f = l.value.getBoundingClientRect(), y = s.value.getBoundingClientRect();
621
+ y.left + y.width >= f.right && (e.value.left = `${g.offsetX - y.width}px`), y.top + y.height >= f.bottom && (console.log("高度超出"), e.value.top = `${g.offsetY - y.height}px`);
622
+ }), document.addEventListener("click", k);
595
623
  };
596
- return (g, f) => (A(), E("div", {
624
+ return (g, f) => (F(), E("div", {
597
625
  ref_key: "contextmenuRef",
598
- ref: i,
626
+ ref: l,
599
627
  class: "contextmenu",
600
628
  onContextmenu: c,
601
- onMouseleave: D
629
+ onMouseleave: k
602
630
  }, [
603
631
  Ye(g.$slots, "default", {}, void 0, !0),
604
- e.value.display !== "none" ? (A(), E("div", {
632
+ e.value.display !== "none" ? (F(), E("div", {
605
633
  key: 0,
606
634
  ref_key: "contextmenuContentRef",
607
- ref: u,
635
+ ref: s,
608
636
  class: "contextmenu-popover",
609
637
  style: de(e.value)
610
638
  }, [
611
639
  Ye(g.$slots, "popover", {}, void 0, !0)
612
- ], 4)) : J("", !0)
640
+ ], 4)) : Q("", !0)
613
641
  ], 544));
614
642
  }
615
643
  });
616
- const gt = /* @__PURE__ */ X(yt, [["__scopeId", "data-v-811db6b4"]]);
617
- const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klineBasic-tips" }, xt = {
644
+ const bt = /* @__PURE__ */ G(gt, [["__scopeId", "data-v-811db6b4"]]);
645
+ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klineBasic-tips" }, ht = {
618
646
  key: 0,
619
647
  class: "klineBasic-sub"
620
- }, ht = {
648
+ }, _t = {
621
649
  key: 1,
622
650
  class: "klineBasic-empty"
623
- }, _t = {
651
+ }, Yt = {
624
652
  key: 2,
625
653
  class: "klineBasic-error"
626
- }, Yt = /* @__PURE__ */ Te(() => /* @__PURE__ */ U("div", { class: "klineBasic-error-content" }, "加载失败,请刷新重试", -1)), wt = { style: { "text-align": "center" } }, Dt = /* @__PURE__ */ Te(() => /* @__PURE__ */ U("span", { style: { "margin-right": "10px" } }, "预警价格:", -1)), kt = { class: "dialog-footer" }, Mt = {
654
+ }, wt = /* @__PURE__ */ Le(() => /* @__PURE__ */ U("div", { class: "klineBasic-error-content" }, "加载失败,请刷新重试", -1)), Dt = { style: { "text-align": "center" } }, kt = /* @__PURE__ */ Le(() => /* @__PURE__ */ U("span", { style: { "margin-right": "10px" } }, "预警价格:", -1)), Mt = { class: "dialog-footer" }, St = {
627
655
  __name: "index",
628
656
  props: {
629
657
  variety: {
@@ -691,10 +719,10 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
691
719
  // 时段框选
692
720
  },
693
721
  emits: ["change", "getFactorData"],
694
- setup(n, { expose: w, emit: T }) {
695
- const i = [{ label: "画线预警", key: "drawWarningLine" }];
696
- let u = null, e = null, D, c, g = !1, f = !1;
697
- const v = T, a = n, o = S(!1), b = S(!1), x = S(!1), V = S(null), M = S(null), P = S("VOL"), L = S(0), I = S({}), p = S([]), N = S({}), C = S(!1), ae = S(""), fe = S([...i]), H = ne(() => ({
722
+ setup(n, { expose: D, emit: Y }) {
723
+ const l = [{ label: "画线预警", key: "drawWarningLine" }];
724
+ let s = null, e = null, k, c, g = !1, f = !1;
725
+ const y = Y, a = n, o = T(!1), b = T(!1), x = T(!1), A = T(null), S = T(null), N = T("VOL"), L = T(0), I = T({}), p = T([]), W = T({}), C = T(!1), ae = T(""), fe = T([...l]), H = ne(() => ({
698
726
  defaultShowCounts: 500,
699
727
  // 默认展示条数
700
728
  addCounts: 2e3,
@@ -717,238 +745,238 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
717
745
  // 是否获取因子数据
718
746
  ...a.config
719
747
  }));
720
- G(
748
+ J(
721
749
  () => {
722
- var r, t;
723
- return [a.variety, a.cycle, a.mainIndicator, P.value, (r = a.indicatorStore) == null ? void 0 : r.filterIndicator, (t = a.indicatorStore) == null ? void 0 : t.customIndicator];
750
+ var i, t;
751
+ return [a.variety, a.cycle, a.mainIndicator, N.value, (i = a.indicatorStore) == null ? void 0 : i.filterIndicator, (t = a.indicatorStore) == null ? void 0 : t.customIndicator];
724
752
  },
725
753
  () => {
726
754
  pe();
727
755
  },
728
756
  { deep: !0 }
729
757
  ), De(() => {
730
- Xe(a.env), pe(), window.addEventListener("keydown", xe);
758
+ Ge(a.env), pe(), window.addEventListener("keydown", xe);
731
759
  }), ke(() => {
732
- e == null || e.off("datazoom"), e == null || e.off("highlight"), e == null || e.off("globalout"), e == null || e.dispose(), u == null || u.dispose(), window.removeEventListener("keydown", xe);
760
+ e == null || e.off("datazoom"), e == null || e.off("highlight"), e == null || e.off("globalout"), e == null || e.dispose(), s == null || s.dispose(), window.removeEventListener("keydown", xe);
733
761
  });
734
- const Le = () => {
735
- e || (e = ve.init(V.value), Ae(), H.value.showSubChart && M.value.connect(e), u = He(V.value), u.listen(() => {
762
+ const Fe = () => {
763
+ e || (e = ye.init(A.value), Ae(), H.value.showSubChart && S.value.connect(e), s = je(A.value), s.listen(() => {
736
764
  requestAnimationFrame(() => {
737
765
  e.resize();
738
766
  });
739
767
  }));
740
- }, xe = ({ code: r, ctrlKey: t }) => {
768
+ }, xe = ({ code: i, ctrlKey: t }) => {
741
769
  if (!(t || o.value))
742
770
  return;
743
- const { xAxis: h, dataZoom: m } = e.getOption(), { data: y } = (h == null ? void 0 : h[0]) ?? { data: [] };
744
- let { startValue: l, endValue: s } = (m == null ? void 0 : m[0]) ?? {};
745
- if (y != null && y.length) {
746
- switch (r) {
771
+ const { xAxis: h, dataZoom: m } = e.getOption(), { data: v } = (h == null ? void 0 : h[0]) ?? { data: [] };
772
+ let { startValue: r, endValue: u } = (m == null ? void 0 : m[0]) ?? {};
773
+ if (v != null && v.length) {
774
+ switch (i) {
747
775
  case "ArrowUp": {
748
- if (s - l < 5)
776
+ if (u - r < 5)
749
777
  return;
750
- const k = Math.floor((s - l) / 2) + 1;
751
- l = l + k, s - l < 5 && (l = s - 4);
778
+ const M = Math.floor((u - r) / 2) + 1;
779
+ r = r + M, u - r < 5 && (r = u - 4);
752
780
  break;
753
781
  }
754
782
  case "ArrowDown": {
755
- const k = Math.min(500, s - l);
756
- l = l - k - 1;
783
+ const M = Math.min(500, u - r);
784
+ r = r - M - 1;
757
785
  break;
758
786
  }
759
787
  case "ArrowLeft": {
760
- l > 0 && (l -= 1, s -= 1), L.value > 0 && (L.value -= 1);
788
+ r > 0 && (r -= 1, u -= 1), L.value > 0 && (L.value -= 1);
761
789
  break;
762
790
  }
763
791
  case "ArrowRight": {
764
- s < y.length - 1 && (l += 1, s += 1), o.value && L.value < y.length - 1 && (L.value += 1);
792
+ u < v.length - 1 && (r += 1, u += 1), o.value && L.value < v.length - 1 && (L.value += 1);
765
793
  break;
766
794
  }
767
795
  }
768
796
  e.dispatchAction({
769
797
  type: "dataZoom",
770
- startValue: l,
771
- endValue: s
798
+ startValue: r,
799
+ endValue: u
772
800
  }), e.dispatchAction({
773
801
  type: "updateAxisPointer",
774
802
  seriesIndex: 0,
775
803
  dataIndex: o.value ? L.value : null
776
804
  }), e.dispatchAction({
777
805
  type: "highlight",
778
- dataIndex: o.value ? L.value : s
806
+ dataIndex: o.value ? L.value : u
779
807
  });
780
808
  }
781
809
  }, Ae = () => {
782
810
  e == null || e.on("datazoom", (t) => {
783
811
  clearTimeout(c), c = setTimeout(() => {
784
- var m, y, l, s;
812
+ var m, v, r, u;
785
813
  const { loadCheckCounts: h } = H.value;
786
- if ((y = (m = e == null ? void 0 : e.getOption()) == null ? void 0 : m.dataZoom) != null && y[0]) {
787
- const { startValue: k } = (s = (l = e == null ? void 0 : e.getOption()) == null ? void 0 : l.dataZoom) == null ? void 0 : s[0];
788
- k < h && g === !1 && f === !1 && (g = !0, Fe("history")), le();
814
+ if ((v = (m = e == null ? void 0 : e.getOption()) == null ? void 0 : m.dataZoom) != null && v[0]) {
815
+ const { startValue: M } = (u = (r = e == null ? void 0 : e.getOption()) == null ? void 0 : r.dataZoom) == null ? void 0 : u[0];
816
+ M < h && g === !1 && f === !1 && (g = !0, Re("history")), re();
789
817
  }
790
818
  clearTimeout(c);
791
819
  }, 100);
792
820
  }), e == null || e.on("highlight", (t) => {
793
- var m, y;
821
+ var m, v;
794
822
  let h = t.dataIndex || -1;
795
- t.batch && (h = typeof ((m = t == null ? void 0 : t.batch[0]) == null ? void 0 : m.dataIndex) == "number" ? (y = t == null ? void 0 : t.batch[0]) == null ? void 0 : y.dataIndex : -1), clearTimeout(D), D = setTimeout(() => {
796
- L.value = h, clearTimeout(D);
823
+ t.batch && (h = typeof ((m = t == null ? void 0 : t.batch[0]) == null ? void 0 : m.dataIndex) == "number" ? (v = t == null ? void 0 : t.batch[0]) == null ? void 0 : v.dataIndex : -1), clearTimeout(k), k = setTimeout(() => {
824
+ L.value = h, clearTimeout(k);
797
825
  }, 20);
798
826
  }), e == null || e.on("globalout", () => {
799
827
  const t = setTimeout(() => {
800
- var m, y, l;
828
+ var m, v, r;
801
829
  clearTimeout(t);
802
- const h = (l = (y = (m = e == null ? void 0 : e.getOption()) == null ? void 0 : m.dataZoom) == null ? void 0 : y[0]) == null ? void 0 : l.endValue;
830
+ const h = (r = (v = (m = e == null ? void 0 : e.getOption()) == null ? void 0 : m.dataZoom) == null ? void 0 : v[0]) == null ? void 0 : r.endValue;
803
831
  L.value = h;
804
832
  }, 30);
805
833
  });
806
- let r = null;
834
+ let i = null;
807
835
  e == null || e.on("contextmenu", (t) => {
808
- r = setTimeout(() => {
809
- t.componentType === "graphic" && (N.value = t.info, fe.value = [
836
+ i = setTimeout(() => {
837
+ t.componentType === "graphic" && (W.value = t.info, fe.value = [
810
838
  { label: "删除画线", key: "deleteWarningLine" },
811
839
  { label: "修改画线", key: "changeWarningLine" }
812
- ]), clearTimeout(r), r = null;
840
+ ]), clearTimeout(i), i = null;
813
841
  });
814
842
  });
815
843
  }, pe = async () => {
816
- var r, t, h, m, y, l;
844
+ var i, t, h, m, v, r;
817
845
  try {
818
846
  if (!a.variety || !a.cycle)
819
847
  return;
820
- const { variety: s, featureId: k, cycle: F, indicatorStore: Y, mainIndicator: q, right: z, startTime: j, endTime: R } = a, { defaultShowCounts: O, addCounts: _, showWarningLine: me, getFactorData: ie } = H.value, $ = {
821
- variety: s,
822
- featureId: k,
823
- cycle: F,
824
- mainIndicatorList: Y.getIndicatorParams(q),
825
- subIndicator: P.value,
848
+ const { variety: u, featureId: M, cycle: R, indicatorStore: w, mainIndicator: q, right: z, startTime: j, endTime: V } = a, { defaultShowCounts: B, addCounts: _, showWarningLine: me, getFactorData: ie } = H.value, O = {
849
+ variety: u,
850
+ featureId: M,
851
+ cycle: R,
852
+ mainIndicatorList: w.getIndicatorParams(q),
853
+ subIndicator: N.value,
826
854
  right: z,
827
855
  showWarningLine: me,
828
856
  getFactorData: ie
829
857
  };
830
- j && R ? ($.startTime = j, $.endTime = R) : j ? ($.startTime = j, $.limit = O + _) : R ? ($.endTime = R, $.limit = O + _) : ($.endTime = d().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), $.limit = O + _);
831
- const W = await Ge($);
832
- if ((h = (t = (r = W == null ? void 0 : W.body) == null ? void 0 : r.kline) == null ? void 0 : t.time) != null && h.length)
858
+ j && V ? (O.startTime = j, O.endTime = V) : j ? (O.startTime = j, O.limit = B + _) : V ? (O.endTime = V, O.limit = B + _) : (O.endTime = d().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), O.limit = B + _);
859
+ const P = await Je(O);
860
+ if ((h = (t = (i = P == null ? void 0 : P.body) == null ? void 0 : i.kline) == null ? void 0 : t.time) != null && h.length)
833
861
  b.value = !1, x.value = !1;
834
862
  else {
835
863
  b.value = !0, x.value = !1;
836
864
  return;
837
865
  }
838
- I.value = (m = W == null ? void 0 : W.body) == null ? void 0 : m.kline, p.value = ((y = W == null ? void 0 : W.body) == null ? void 0 : y.warningLine) || [], he(), le(), ie && v("getFactorData", (l = W == null ? void 0 : W.body) == null ? void 0 : l.factor);
839
- } catch (s) {
840
- throw x.value = !0, b.value = !1, new Error(s);
866
+ I.value = (m = P == null ? void 0 : P.body) == null ? void 0 : m.kline, p.value = ((v = P == null ? void 0 : P.body) == null ? void 0 : v.warningLine) || [], he(), re(), ie && y("getFactorData", (r = P == null ? void 0 : P.body) == null ? void 0 : r.factor);
867
+ } catch (u) {
868
+ throw x.value = !0, b.value = !1, new Error(u);
841
869
  }
842
- }, Fe = async (r) => {
843
- const { variety: t, cycle: h, indicatorStore: m, mainIndicator: y, right: l } = a, { addCounts: s } = H.value, { time: k } = I.value;
844
- if (r === "history") {
845
- const F = await Je({
870
+ }, Re = async (i) => {
871
+ const { variety: t, cycle: h, indicatorStore: m, mainIndicator: v, right: r } = a, { addCounts: u } = H.value, { time: M } = I.value;
872
+ if (i === "history") {
873
+ const R = await Qe({
846
874
  variety: t,
847
875
  cycle: h,
848
- endTime: k[0],
849
- limit: s,
850
- mainIndicatorList: m.getIndicatorParams(y),
851
- subIndicator: P.value,
852
- right: l
876
+ endTime: M[0],
877
+ limit: u,
878
+ mainIndicatorList: m.getIndicatorParams(v),
879
+ subIndicator: N.value,
880
+ right: r
853
881
  });
854
882
  I.value = {
855
- time: [...F.body.time, ...I.value.time.slice(1)],
856
- data: [...F.body.data, ...I.value.data.slice(1)],
857
- mainIndicator: I.value.mainIndicator.map((Y, q) => {
883
+ time: [...R.body.time, ...I.value.time.slice(1)],
884
+ data: [...R.body.data, ...I.value.data.slice(1)],
885
+ mainIndicator: I.value.mainIndicator.map((w, q) => {
858
886
  var z;
859
887
  return {
860
- ...Y,
861
- data: [...((z = F.body.mainIndicator[q]) == null ? void 0 : z.data) ?? [], ...Y.data.slice(1)]
888
+ ...w,
889
+ data: [...((z = R.body.mainIndicator[q]) == null ? void 0 : z.data) ?? [], ...w.data.slice(1)]
862
890
  };
863
891
  }),
864
- subIndicator: I.value.subIndicator.map((Y, q) => {
892
+ subIndicator: I.value.subIndicator.map((w, q) => {
865
893
  var z;
866
894
  return {
867
- ...Y,
868
- data: [...((z = F.body.subIndicator[q]) == null ? void 0 : z.data) ?? [], ...Y.data.slice(1)]
895
+ ...w,
896
+ data: [...((z = R.body.subIndicator[q]) == null ? void 0 : z.data) ?? [], ...w.data.slice(1)]
869
897
  };
870
898
  })
871
- }, he(!0), F.body.data.length < s && (f = !0), g = !1;
899
+ }, he(!0), R.body.data.length < u && (f = !0), g = !1;
872
900
  }
873
- }, he = (r = !1) => {
901
+ }, he = (i = !1) => {
874
902
  var q, z, j;
875
- Le();
876
- const { time: t } = I.value, { gridRight: h, gridLeft: m, defaultShowCounts: y, maxShowCounts: l, showSubChart: s } = H.value;
877
- let k = t.length - 1 - y, F = t.length - 1;
878
- if (r) {
879
- const R = e.getOption(), O = (z = (q = R == null ? void 0 : R.xAxis) == null ? void 0 : q[0]) == null ? void 0 : z.data, _ = (j = R == null ? void 0 : R.dataZoom) == null ? void 0 : j[0], me = O[_ == null ? void 0 : _.startValue], ie = O[_ == null ? void 0 : _.endValue];
880
- k = t.findIndex(($) => $ === me), F = t.findIndex(($) => $ === ie);
903
+ Fe();
904
+ const { time: t } = I.value, { gridRight: h, gridLeft: m, defaultShowCounts: v, maxShowCounts: r, showSubChart: u } = H.value;
905
+ let M = t.length - 1 - v, R = t.length - 1;
906
+ if (i) {
907
+ const V = e.getOption(), B = (z = (q = V == null ? void 0 : V.xAxis) == null ? void 0 : q[0]) == null ? void 0 : z.data, _ = (j = V == null ? void 0 : V.dataZoom) == null ? void 0 : j[0], me = B[_ == null ? void 0 : _.startValue], ie = B[_ == null ? void 0 : _.endValue];
908
+ M = t.findIndex((O) => O === me), R = t.findIndex((O) => O === ie);
881
909
  }
882
- const Y = nt(I.value, H.value, k, F, a.cycle);
883
- if (e.setOption(Y, !0), L.value = F, a.brushRange) {
884
- let R = null, O = null;
910
+ const w = ot(I.value, H.value, M, R, a.cycle);
911
+ if (e.setOption(w, !0), L.value = R, a.brushRange) {
912
+ let V = null, B = null;
885
913
  switch (a.cycle) {
886
914
  case "6": {
887
- R = t.find((_) => new Date(_).getTime() >= new Date(a.brushRange[0]).getTime() || d(_).format("YYYY-MM-DD") === d(a.brushRange[0]).format("YYYY-MM-DD")), O = t.findLast((_) => new Date(_).getTime() <= new Date(a.brushRange[1]).getTime() || d(_).format("YYYY-MM-DD") === d(a.brushRange[1]).format("YYYY-MM-DD"));
915
+ V = t.find((_) => new Date(_).getTime() >= new Date(a.brushRange[0]).getTime() || d(_).format("YYYY-MM-DD") === d(a.brushRange[0]).format("YYYY-MM-DD")), B = t.findLast((_) => new Date(_).getTime() <= new Date(a.brushRange[1]).getTime() || d(_).format("YYYY-MM-DD") === d(a.brushRange[1]).format("YYYY-MM-DD"));
888
916
  break;
889
917
  }
890
918
  case "7": {
891
- R = t.find((_) => d(_).day(5).format("YYYY-MM-DD") === d(a.brushRange[0]).day(5).format("YYYY-MM-DD")), O = t.findLast((_) => d(_).day(5).format("YYYY-MM-DD") === d(a.brushRange[1]).day(5).format("YYYY-MM-DD"));
919
+ V = t.find((_) => d(_).day(5).format("YYYY-MM-DD") === d(a.brushRange[0]).day(5).format("YYYY-MM-DD")), B = t.findLast((_) => d(_).day(5).format("YYYY-MM-DD") === d(a.brushRange[1]).day(5).format("YYYY-MM-DD"));
892
920
  break;
893
921
  }
894
922
  case "8": {
895
- R = t.find((_) => d(_).endOf("month").format("YYYY-MM-DD") === d(a.brushRange[0]).endOf("month").format("YYYY-MM-DD")), O = t.findLast((_) => d(_).endOf("month").format("YYYY-MM-DD") === d(a.brushRange[1]).endOf("month").format("YYYY-MM-DD"));
923
+ V = t.find((_) => d(_).endOf("month").format("YYYY-MM-DD") === d(a.brushRange[0]).endOf("month").format("YYYY-MM-DD")), B = t.findLast((_) => d(_).endOf("month").format("YYYY-MM-DD") === d(a.brushRange[1]).endOf("month").format("YYYY-MM-DD"));
896
924
  break;
897
925
  }
898
926
  default:
899
- R = t.find((_) => new Date(_).getTime() >= new Date(a.brushRange[0]).getTime()), O = t.findLast((_) => new Date(_).getTime() <= new Date(a.brushRange[1]).getTime());
927
+ V = t.find((_) => new Date(_).getTime() >= new Date(a.brushRange[0]).getTime()), B = t.findLast((_) => new Date(_).getTime() <= new Date(a.brushRange[1]).getTime());
900
928
  }
901
- console.log(R, O), e.dispatchAction({
929
+ console.log(V, B), e.dispatchAction({
902
930
  type: "brush",
903
931
  areas: [
904
932
  {
905
933
  brushType: "lineX",
906
- coordRange: [R, O],
934
+ coordRange: [V, B],
907
935
  xAxisIndex: 0
908
936
  }
909
937
  ]
910
938
  });
911
939
  }
912
- s && M.value.draw({ startValue: k, endValue: F, maxValueSpan: l }, { gridLeft: m, gridRight: h }), _e();
913
- }, le = () => {
940
+ u && S.value.draw({ startValue: M, endValue: R, maxValueSpan: r }, { gridLeft: m, gridRight: h }), _e();
941
+ }, re = () => {
914
942
  if (!e)
915
943
  return;
916
- const r = e == null ? void 0 : e.getOption();
917
- r && (e == null || e.setOption(
944
+ const i = e == null ? void 0 : e.getOption();
945
+ i && (e == null || e.setOption(
918
946
  {
919
- ...r,
947
+ ...i,
920
948
  graphic: [
921
- ...ot(e, p.value, a, H.value, () => {
922
- re();
949
+ ...at(e, p.value, a, H.value, () => {
950
+ le();
923
951
  })
924
952
  ]
925
953
  },
926
954
  !0
927
955
  ), _e());
928
956
  }, _e = () => {
929
- const { time: r } = I.value;
930
- if (a.brushRange && (r != null && r.length)) {
931
- let t = d(a.brushRange[0]).format("YYYY-MM-DD 00:00:00"), h = d(a.brushRange[1]).format("YYYY-MM-DD 23:59:59"), m = null, y = null;
957
+ const { time: i } = I.value;
958
+ if (a.brushRange && (i != null && i.length)) {
959
+ let t = d(a.brushRange[0]).format("YYYY-MM-DD 00:00:00"), h = d(a.brushRange[1]).format("YYYY-MM-DD 23:59:59"), m = null, v = null;
932
960
  switch (a.cycle) {
933
961
  case "6": {
934
- m = r.find((l) => d(l).format("YYYY-MM-DD") === d(t).format("YYYY-MM-DD")), y = m;
962
+ m = i.find((r) => d(r).format("YYYY-MM-DD") === d(t).format("YYYY-MM-DD")), v = m;
935
963
  break;
936
964
  }
937
965
  case "7": {
938
- m = r.find((l) => d(l).day(5).format("YYYY-MM-DD") === d(t).day(5).format("YYYY-MM-DD")), y = r.findLast((l) => d(l).day(5).format("YYYY-MM-DD") === d(h).day(5).format("YYYY-MM-DD"));
966
+ m = i.find((r) => d(r).day(5).format("YYYY-MM-DD") === d(t).day(5).format("YYYY-MM-DD")), v = i.findLast((r) => d(r).day(5).format("YYYY-MM-DD") === d(h).day(5).format("YYYY-MM-DD"));
939
967
  break;
940
968
  }
941
969
  case "8": {
942
- m = r.find((l) => d(l).endOf("month").format("YYYY-MM-DD") === d(t).endOf("month").format("YYYY-MM-DD")), y = r.findLast((l) => d(l).endOf("month").format("YYYY-MM-DD") === d(h).endOf("month").format("YYYY-MM-DD"));
970
+ m = i.find((r) => d(r).endOf("month").format("YYYY-MM-DD") === d(t).endOf("month").format("YYYY-MM-DD")), v = i.findLast((r) => d(r).endOf("month").format("YYYY-MM-DD") === d(h).endOf("month").format("YYYY-MM-DD"));
943
971
  break;
944
972
  }
945
973
  default:
946
- m = r.find((l) => {
947
- const s = d(l).format("YYYY-MM-DD") === d(t).format("YYYY-MM-DD"), k = new Date(l).getTime() >= new Date(t).getTime();
948
- return s && k;
949
- }), y = r.findLast((l) => {
950
- const s = d(l).format("YYYY-MM-DD") === d(h).format("YYYY-MM-DD"), k = new Date(l).getTime() <= new Date(h).getTime();
951
- return s && k;
974
+ m = i.find((r) => {
975
+ const u = d(r).format("YYYY-MM-DD") === d(t).format("YYYY-MM-DD"), M = new Date(r).getTime() >= new Date(t).getTime();
976
+ return u && M;
977
+ }), v = i.findLast((r) => {
978
+ const u = d(r).format("YYYY-MM-DD") === d(h).format("YYYY-MM-DD"), M = new Date(r).getTime() <= new Date(h).getTime();
979
+ return u && M;
952
980
  });
953
981
  }
954
982
  e.dispatchAction({
@@ -956,28 +984,28 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
956
984
  areas: [
957
985
  {
958
986
  brushType: "lineX",
959
- coordRange: [m, y],
987
+ coordRange: [m, v],
960
988
  xAxisIndex: 0
961
989
  }
962
990
  ]
963
991
  });
964
992
  }
965
- }, re = async () => {
966
- const r = await et({ featureId: a.featureId });
967
- p.value = (r == null ? void 0 : r.body) || [], le(), v("change", "warningLine", p.value);
968
- }, Re = async (r) => {
969
- const { variety: t, varietyName: h, featureId: m, featureType: y } = a;
970
- if (r.key === "drawWarningLine") {
971
- const l = e == null ? void 0 : e.getOption(), s = l.tooltip[0];
993
+ }, le = async () => {
994
+ const i = await tt({ featureId: a.featureId });
995
+ p.value = (i == null ? void 0 : i.body) || [], re(), y("change", "warningLine", p.value);
996
+ }, Ve = async (i) => {
997
+ const { variety: t, varietyName: h, featureId: m, featureType: v } = a;
998
+ if (i.key === "drawWarningLine") {
999
+ const r = e == null ? void 0 : e.getOption(), u = r.tooltip[0];
972
1000
  e == null || e.setOption({
973
- ...l,
1001
+ ...r,
974
1002
  // 指示器样式
975
1003
  tooltip: {
976
- ...s,
1004
+ ...u,
977
1005
  // 坐标轴指示器
978
1006
  axisPointer: {
979
1007
  // 保留原有部分配置
980
- ...s.axisPointer,
1008
+ ...u.axisPointer,
981
1009
  // X轴指示线的宽度
982
1010
  lineStyle: {
983
1011
  width: 0
@@ -989,25 +1017,25 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
989
1017
  // 文本标签
990
1018
  label: {
991
1019
  // 保留原有部分配置
992
- ...s.axisPointer.label,
1020
+ ...u.axisPointer.label,
993
1021
  // 颜色改为透明
994
1022
  backgroundColor: "transparent",
995
1023
  // 仅显示Y轴值
996
- formatter: (F) => ""
1024
+ formatter: (R) => ""
997
1025
  }
998
1026
  }
999
1027
  }
1000
1028
  });
1001
- const k = async (F) => {
1002
- e == null || e.getZr().off("mousedown", k);
1003
- const Y = e == null ? void 0 : e.convertFromPixel({ yAxisIndex: 0 }, F.offsetY), q = Math.round(Y * 1e3) / 1e3;
1029
+ const M = async (R) => {
1030
+ e == null || e.getZr().off("mousedown", M);
1031
+ const w = e == null ? void 0 : e.convertFromPixel({ yAxisIndex: 0 }, R.offsetY), q = Math.round(w * 1e3) / 1e3;
1004
1032
  e == null || e.setOption({
1005
- ...l,
1033
+ ...r,
1006
1034
  // 指示器样式
1007
1035
  tooltip: {
1008
- ...s,
1036
+ ...u,
1009
1037
  axisPointer: {
1010
- ...s.axisPointer,
1038
+ ...u.axisPointer,
1011
1039
  lineStyle: {
1012
1040
  width: 1
1013
1041
  },
@@ -1015,31 +1043,31 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
1015
1043
  width: 1
1016
1044
  },
1017
1045
  label: {
1018
- ...s.axisPointer.label,
1046
+ ...u.axisPointer.label,
1019
1047
  backgroundColor: null
1020
1048
  }
1021
1049
  }
1022
1050
  }
1023
- }), await Qe({
1051
+ }), await et({
1024
1052
  featureCode: t,
1025
1053
  //品种代码
1026
1054
  featureName: h,
1027
1055
  //品种名称
1028
1056
  featureId: m,
1029
1057
  //品种id
1030
- featureType: y,
1058
+ featureType: v,
1031
1059
  //品种类型
1032
1060
  warnPrice: q
1033
- }), ue.success("画线预警成功!"), re();
1061
+ }), ue.success("画线预警成功!"), le();
1034
1062
  };
1035
- e == null || e.getZr().on("mousedown", k);
1063
+ e == null || e.getZr().on("mousedown", M);
1036
1064
  } else
1037
- r.key === "deleteWarningLine" ? (await tt({ id: N.value.id }), ue.success("画线预警删除成功"), re()) : r.key === "changeWarningLine" && (C.value = !0, ae.value = N.value.warnPrice);
1038
- }, Ve = async () => {
1039
- const { variety: r, varietyName: t, featureId: h, featureType: m } = a;
1065
+ i.key === "deleteWarningLine" ? (await nt({ id: W.value.id }), ue.success("画线预警删除成功"), le()) : i.key === "changeWarningLine" && (C.value = !0, ae.value = W.value.warnPrice);
1066
+ }, Ee = async () => {
1067
+ const { variety: i, varietyName: t, featureId: h, featureType: m } = a;
1040
1068
  await Se({
1041
- id: N.value.id,
1042
- featureCode: r,
1069
+ id: W.value.id,
1070
+ featureCode: i,
1043
1071
  //品种代码
1044
1072
  featureName: t,
1045
1073
  //品种名称
@@ -1048,25 +1076,25 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
1048
1076
  featureType: m,
1049
1077
  //品种类型
1050
1078
  warnPrice: ae.value
1051
- }), ue.success("画线预警修改成功"), re();
1052
- }, Ee = () => {
1053
- fe.value = [...i];
1079
+ }), ue.success("画线预警修改成功"), le();
1080
+ }, Ie = () => {
1081
+ fe.value = [...l];
1054
1082
  };
1055
- return w({
1056
- draw: (r, t) => {
1057
- r === "warningLine" && (p.value = t, le());
1083
+ return D({
1084
+ draw: (i, t) => {
1085
+ i === "warningLine" && (p.value = t, re());
1058
1086
  }
1059
- }), (r, t) => {
1060
- var F;
1061
- const h = Pe, m = We, y = $e, l = Oe, s = Be, k = Ie;
1062
- return A(), E(ee, null, [
1087
+ }), (i, t) => {
1088
+ var R;
1089
+ const h = Pe, m = We, v = Ne, r = Oe, u = Be, M = $e;
1090
+ return F(), E(ee, null, [
1063
1091
  U("div", {
1064
1092
  class: "klineBasic",
1065
- onMousemove: t[1] || (t[1] = (Y) => o.value = !0),
1066
- onMouseout: t[2] || (t[2] = (Y) => o.value = !1)
1093
+ onMousemove: t[1] || (t[1] = (w) => o.value = !0),
1094
+ onMouseout: t[2] || (t[2] = (w) => o.value = !1)
1067
1095
  }, [
1068
- U("div", bt, [
1069
- B(it, {
1096
+ U("div", xt, [
1097
+ $(st, {
1070
1098
  variety: n.variety,
1071
1099
  data: I.value,
1072
1100
  activeIndex: L.value
@@ -1076,23 +1104,23 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
1076
1104
  class: "klineBasic-main",
1077
1105
  style: de({ height: H.value.showSubChart ? "70%" : "100%" })
1078
1106
  }, [
1079
- B(gt, { onCloseContextMenuCallBack: Ee }, {
1107
+ $(bt, { onCloseContextMenuCallBack: Ie }, {
1080
1108
  popover: K(() => [
1081
- B(m, { style: {
1109
+ $(m, { style: {
1082
1110
  borderRadius: "4px",
1083
1111
  overflow: "hidden",
1084
1112
  background: "#fff",
1085
1113
  borderRight: 0
1086
1114
  } }, {
1087
1115
  default: K(() => [
1088
- (A(!0), E(ee, null, ce(fe.value, (Y) => (A(), Me(h, {
1116
+ (F(!0), E(ee, null, ce(fe.value, (w) => (F(), Me(h, {
1089
1117
  style: { height: "36px" },
1090
- key: Y.key,
1091
- index: Y.key,
1092
- onClick: (q) => Re(Y)
1118
+ key: w.key,
1119
+ index: w.key,
1120
+ onClick: (q) => Ve(w)
1093
1121
  }, {
1094
1122
  default: K(() => [
1095
- se(te(Y.label), 1)
1123
+ se(te(w.label), 1)
1096
1124
  ]),
1097
1125
  _: 2
1098
1126
  }, 1032, ["index", "onClick"]))), 128))
@@ -1103,63 +1131,63 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
1103
1131
  default: K(() => [
1104
1132
  U("div", {
1105
1133
  ref_key: "klineBasicMainRef",
1106
- ref: V,
1134
+ ref: A,
1107
1135
  style: { height: "100%" }
1108
1136
  }, null, 512)
1109
1137
  ]),
1110
1138
  _: 1
1111
1139
  })
1112
1140
  ], 4),
1113
- H.value.showSubChart ? (A(), E("div", xt, [
1114
- B(vt, {
1141
+ H.value.showSubChart ? (F(), E("div", ht, [
1142
+ $(vt, {
1115
1143
  ref_key: "klineSubRef",
1116
- ref: M,
1117
- modelValue: P.value,
1118
- "onUpdate:modelValue": t[0] || (t[0] = (Y) => P.value = Y),
1144
+ ref: S,
1145
+ modelValue: N.value,
1146
+ "onUpdate:modelValue": t[0] || (t[0] = (w) => N.value = w),
1119
1147
  data: I.value,
1120
1148
  cycle: n.cycle,
1121
1149
  activeIndex: L.value,
1122
- subIndicatorList: (F = n.indicatorStore) == null ? void 0 : F.subIndicatorList
1150
+ subIndicatorList: (R = n.indicatorStore) == null ? void 0 : R.subIndicatorList
1123
1151
  }, null, 8, ["modelValue", "data", "cycle", "activeIndex", "subIndicatorList"])
1124
- ])) : J("", !0),
1125
- b.value ? (A(), E("div", ht, [
1126
- B(y, {
1152
+ ])) : Q("", !0),
1153
+ b.value ? (F(), E("div", _t, [
1154
+ $(v, {
1127
1155
  class: "klineBasic-empty-content",
1128
1156
  description: "暂无数据"
1129
1157
  })
1130
- ])) : J("", !0),
1131
- x.value ? (A(), E("div", _t, [
1132
- Yt,
1133
- U("div", wt, [
1134
- B(l, { onClick: pe }, {
1158
+ ])) : Q("", !0),
1159
+ x.value ? (F(), E("div", Yt, [
1160
+ wt,
1161
+ U("div", Dt, [
1162
+ $(r, { onClick: pe }, {
1135
1163
  default: K(() => [
1136
1164
  se("刷新")
1137
1165
  ]),
1138
1166
  _: 1
1139
1167
  })
1140
1168
  ])
1141
- ])) : J("", !0)
1169
+ ])) : Q("", !0)
1142
1170
  ], 32),
1143
- B(k, {
1171
+ $(M, {
1144
1172
  modelValue: C.value,
1145
- "onUpdate:modelValue": t[5] || (t[5] = (Y) => C.value = Y),
1173
+ "onUpdate:modelValue": t[5] || (t[5] = (w) => C.value = w),
1146
1174
  title: "画线预警-修改价格",
1147
1175
  width: "30%",
1148
1176
  "align-center": ""
1149
1177
  }, {
1150
1178
  footer: K(() => [
1151
- U("span", kt, [
1152
- B(l, {
1153
- onClick: t[4] || (t[4] = (Y) => C.value = !1)
1179
+ U("span", Mt, [
1180
+ $(r, {
1181
+ onClick: t[4] || (t[4] = (w) => C.value = !1)
1154
1182
  }, {
1155
1183
  default: K(() => [
1156
1184
  se("取消")
1157
1185
  ]),
1158
1186
  _: 1
1159
1187
  }),
1160
- B(l, {
1188
+ $(r, {
1161
1189
  type: "primary",
1162
- onClick: Ve
1190
+ onClick: Ee
1163
1191
  }, {
1164
1192
  default: K(() => [
1165
1193
  se("确定")
@@ -1169,10 +1197,10 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
1169
1197
  ])
1170
1198
  ]),
1171
1199
  default: K(() => [
1172
- Dt,
1173
- B(s, {
1200
+ kt,
1201
+ $(u, {
1174
1202
  modelValue: ae.value,
1175
- "onUpdate:modelValue": t[3] || (t[3] = (Y) => ae.value = Y),
1203
+ "onUpdate:modelValue": t[3] || (t[3] = (w) => ae.value = w),
1176
1204
  placeholder: "输入预警价格"
1177
1205
  }, null, 8, ["modelValue"])
1178
1206
  ]),
@@ -1181,11 +1209,11 @@ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klin
1181
1209
  ], 64);
1182
1210
  };
1183
1211
  }
1184
- }, St = /* @__PURE__ */ X(Mt, [["__scopeId", "data-v-e675b051"]]), cn = {
1212
+ }, Tt = /* @__PURE__ */ G(St, [["__scopeId", "data-v-e675b051"]]), dn = {
1185
1213
  install(n) {
1186
- n.component("st-klineBasic", St);
1214
+ n.component("st-klineBasic", Tt);
1187
1215
  }
1188
1216
  };
1189
1217
  export {
1190
- cn as default
1218
+ dn as default
1191
1219
  };