st-comp 0.0.227 → 0.0.228

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
@@ -8,8 +8,8 @@ import { E as Oe } 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 ve, ref as S, watch as ye, nextTick as ge, openBlock as A, createElementBlock as E, Fragment as Q, renderList as ue, normalizeStyle as ce, toDisplayString as ee, computed as te, createVNode as B, onMounted as De, onUnmounted as ke, createElementVNode as U, withCtx as K, createBlock as Me, createCommentVNode as G, renderSlot as Ye, createTextVNode as ie, pushScopeId as Ne, popScopeId as qe } from "vue";
12
- import * as me from "echarts";
11
+ import { defineComponent as ye, ref as S, watch as ue, nextTick as ge, openBlock as A, createElementBlock as E, Fragment as Q, renderList as ce, normalizeStyle as de, toDisplayString as ee, computed as te, createVNode as B, onMounted as De, onUnmounted as ke, createElementVNode as U, withCtx as K, createBlock as Me, createCommentVNode as G, renderSlot as Ye, createTextVNode as ie, pushScopeId as Ne, popScopeId as qe } from "vue";
12
+ import * as ve from "echarts";
13
13
  import { d as c } from "./dayjs.min-8313b006.js";
14
14
  import { y as Ce, v as ze, U as Ke, K as Ue, V as ne, x as be, D as He } from "./index-7ed0999e.js";
15
15
  import { E as se } from "./el-message-e544a8f5.js";
@@ -41,27 +41,27 @@ const Xe = (n) => {
41
41
  ze() && (T.headers.token = Ke());
42
42
  },
43
43
  handleRes: (T) => {
44
- const { data: u } = T;
45
- if (u.code === 401)
44
+ const { data: s } = T;
45
+ if (s.code === 401)
46
46
  return location.origin.includes("localhost") ? location.href = `${location.origin}/#/404` : Ue(), !0;
47
47
  }
48
48
  });
49
49
  w.get, Z = w.post;
50
- }, Ge = (n) => Z("/middleLayer/kline/getKlineBasic", { ...n, userId: ne("id") }), Je = (n) => Z("/middleLayer/kline/getKline", n), Qe = async (n) => Z("/alarm/deliversign/addAlarmPrice", { ...n, userId: ne("id") }), et = async (n) => Z("/alarm/deliversign/findAlarmPriceByUserId", { ...n, userId: ne("id") }), Se = async (n) => Z("/alarm/deliversign/updateAlarmPrice", { ...n, userId: ne("id") }), tt = async (n) => Z("/alarm/deliversign/deleteAlarmPrice", { ...n, userId: ne("id") }), { round: J } = be, nt = (n, w, T, u, m) => {
51
- const { data: e, time: D } = n, { gridTop: s, gridRight: g, gridLeft: d, maxShowCounts: v, showSubChart: a } = w;
50
+ }, Ge = (n) => Z("/middleLayer/kline/getKlineBasic", { ...n, userId: ne("id") }), Je = (n) => Z("/middleLayer/kline/getKline", n), Qe = async (n) => Z("/alarm/deliversign/addAlarmPrice", { ...n, userId: ne("id") }), et = async (n) => Z("/alarm/deliversign/findAlarmPriceByUserId", { ...n, userId: ne("id") }), Se = async (n) => Z("/alarm/deliversign/updateAlarmPrice", { ...n, userId: ne("id") }), tt = async (n) => Z("/alarm/deliversign/deleteAlarmPrice", { ...n, userId: ne("id") }), { round: J } = be, nt = (n, w, T, s, d) => {
51
+ const { data: e, time: D } = n, { gridTop: u, gridRight: g, gridLeft: f, maxShowCounts: v, showSubChart: a } = w;
52
52
  return {
53
53
  animation: !1,
54
54
  grid: {
55
- top: `${s}px`,
55
+ top: `${u}px`,
56
56
  right: `${g}px`,
57
57
  bottom: a ? "6px" : "24px",
58
- left: `${d}px`
58
+ left: `${f}px`
59
59
  },
60
60
  dataZoom: [
61
61
  {
62
62
  type: "inside",
63
63
  startValue: T,
64
- endValue: u,
64
+ endValue: s,
65
65
  maxValueSpan: v
66
66
  }
67
67
  ],
@@ -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(m) ? c(x).format("YYYY-MM-DD") : x : String(J(x));
78
+ return b === "x" ? a ? "" : ["6", "7", "8"].includes(d) ? c(x).format("YYYY-MM-DD") : x : String(J(x));
79
79
  }
80
80
  }
81
81
  },
@@ -89,7 +89,7 @@ const Xe = (n) => {
89
89
  show: !1
90
90
  },
91
91
  axisLabel: {
92
- formatter: (o) => ["6", "7", "8"].includes(m) ? c(o).format("YYYY-MM-DD") : o
92
+ formatter: (o) => ["6", "7", "8"].includes(d) ? c(o).format("YYYY-MM-DD") : o
93
93
  }
94
94
  },
95
95
  yAxis: {
@@ -149,8 +149,8 @@ const Xe = (n) => {
149
149
  }
150
150
  }
151
151
  };
152
- }, ot = (n, w, T, u, m) => {
153
- const { variety: e, featureId: D, featureType: s } = T, { gridTop: g, gridLeft: d, gridRight: v } = u;
152
+ }, ot = (n, w, T, s, d) => {
153
+ const { variety: e, featureId: D, featureType: u } = T, { gridTop: g, gridLeft: f, gridRight: v } = s;
154
154
  return w.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()))
@@ -168,7 +168,7 @@ const Xe = (n) => {
168
168
  type: "line",
169
169
  info: o,
170
170
  shape: {
171
- x1: d,
171
+ x1: f,
172
172
  // 开始X坐标
173
173
  y1: x,
174
174
  // 开始Y坐标
@@ -214,23 +214,23 @@ const Xe = (n) => {
214
214
  ondragend: async (M) => {
215
215
  const L = M.offsetY - V;
216
216
  if (L !== 0) {
217
- const I = n == null ? void 0 : n.convertFromPixel({ yAxisIndex: 0 }, L + x), f = {
217
+ const I = n == null ? void 0 : n.convertFromPixel({ yAxisIndex: 0 }, L + x), p = {
218
218
  id: o.id,
219
219
  warnPrice: J(I, 3),
220
220
  featureId: D,
221
221
  //品种id
222
222
  featureCode: e,
223
223
  //品种代码
224
- featureType: s
224
+ featureType: u
225
225
  //品种类型
226
226
  };
227
- await Se(f), se.success("画线预警修改成功"), m && m();
227
+ await Se(p), se.success("画线预警修改成功"), d && d();
228
228
  }
229
229
  }
230
230
  }
231
231
  ];
232
232
  }, []);
233
- }, at = /* @__PURE__ */ ve({
233
+ }, at = /* @__PURE__ */ ye({
234
234
  __name: "index",
235
235
  props: {
236
236
  // 提示数据
@@ -240,28 +240,28 @@ const Xe = (n) => {
240
240
  }
241
241
  },
242
242
  setup(n) {
243
- const w = n, T = S(null), u = S([]);
244
- return ye(() => w.data, () => {
245
- u.value.length === 0 && ge(() => {
246
- Array.from(T.value.children).forEach((m, e) => {
247
- var D, s, g, d, v, a, o, b;
248
- ((s = (D = w.data) == null ? void 0 : D[e]) == null ? void 0 : s.label) === "涨跌" ? u.value[e] = "85px" : ((d = (g = w.data) == null ? void 0 : g[e]) == null ? void 0 : d.label) === "至今涨幅" ? u.value[e] = "115px" : ((a = (v = w.data) == null ? void 0 : v[e]) == null ? void 0 : a.label) === "额" ? u.value[e] = "75px" : ["开", "高", "低", "收"].includes((b = (o = w.data) == null ? void 0 : o[e]) == null ? void 0 : b.label) ? u.value[e] = `${m.offsetWidth + 20}px` : u.value[e] = `${m.offsetWidth + 30}px`;
243
+ const w = n, T = S(null), s = S([]);
244
+ return ue(() => w.data, () => {
245
+ s.value.length === 0 && ge(() => {
246
+ Array.from(T.value.children).forEach((d, e) => {
247
+ var D, u, g, f, v, a, o, b;
248
+ ((u = (D = w.data) == null ? void 0 : D[e]) == null ? void 0 : u.label) === "涨跌" ? s.value[e] = "85px" : ((f = (g = w.data) == null ? void 0 : g[e]) == null ? void 0 : f.label) === "至今涨幅" ? s.value[e] = "115px" : ((a = (v = w.data) == null ? void 0 : v[e]) == null ? void 0 : a.label) === "额" ? s.value[e] = "75px" : ["开", "高", "低", "收"].includes((b = (o = w.data) == null ? void 0 : o[e]) == null ? void 0 : b.label) ? s.value[e] = `${d.offsetWidth + 20}px` : s.value[e] = `${d.offsetWidth + 36}px`;
249
249
  });
250
250
  });
251
- }), (m, e) => (A(), E("div", {
251
+ }), (d, e) => (A(), E("div", {
252
252
  class: "kline-tips",
253
253
  ref_key: "tipsRef",
254
254
  ref: T
255
255
  }, [
256
- (A(!0), E(Q, null, ue(n.data, (D, s) => (A(), E("div", {
257
- key: s,
256
+ (A(!0), E(Q, null, ce(n.data, (D, u) => (A(), E("div", {
257
+ key: u,
258
258
  class: "kline-tips-item",
259
- style: ce({ color: D.color, width: u.value[s] ? u.value[s] : null })
259
+ style: de({ color: D.color, width: s.value[u] ? s.value[u] : null })
260
260
  }, ee(D.label) + " " + ee(D.value), 5))), 128))
261
261
  ], 512));
262
262
  }
263
263
  });
264
- const we = /* @__PURE__ */ X(at, [["__scopeId", "data-v-5f7d4137"]]);
264
+ const we = /* @__PURE__ */ X(at, [["__scopeId", "data-v-c6a71281"]]);
265
265
  const lt = { class: "kline-tips" }, rt = {
266
266
  __name: "index",
267
267
  props: {
@@ -273,41 +273,47 @@ const lt = { class: "kline-tips" }, rt = {
273
273
  activeIndex: {
274
274
  type: [Number, String],
275
275
  require: !0
276
+ },
277
+ variety: {
278
+ type: [String, Number],
279
+ default: () => null
276
280
  }
277
281
  },
278
282
  setup(n) {
279
- const { round: w, formatValue: T } = be, u = n, m = S(null);
280
- ye(() => u.activeIndex, () => {
281
- m.value === null && (m.value = u.data.data[u.activeIndex][1]);
283
+ const { round: w, formatValue: T } = be, s = n, d = S(null);
284
+ ue(() => s.activeIndex, () => {
285
+ d.value === null && (d.value = s.data.data[s.activeIndex][1]);
286
+ }), ue(() => s.variety, () => {
287
+ d.value;
282
288
  });
283
289
  const e = te(() => {
284
- const { data: s, activeIndex: g } = u;
285
- if (s.data && s.data[g]) {
286
- const d = s.data[g], v = [
287
- { label: "开", value: d[0] },
288
- { label: "高", value: d[3] },
289
- { label: "低", value: d[2] },
290
- { label: "收", value: d[1] }
290
+ const { data: u, activeIndex: g } = s;
291
+ if (u.data && u.data[g]) {
292
+ const f = u.data[g], v = [
293
+ { label: "开", value: f[0] },
294
+ { label: "高", value: f[3] },
295
+ { label: "低", value: f[2] },
296
+ { label: "收", value: f[1] }
291
297
  ];
292
- d[4] !== null && v.push({ label: "额", value: T(d[4]) });
298
+ f[4] !== null && v.push({ label: "额", value: T(f[4]) });
293
299
  let a;
294
- d[6] > 0 ? a = "red" : d[6] < 0 && (a = "green"), v.push({ label: "涨跌", value: `${w(d[6])}%`, color: a });
295
- const o = (m.value / d[1] - 1) * 100;
300
+ f[6] > 0 ? a = "red" : f[6] < 0 && (a = "green"), v.push({ label: "涨跌", value: `${w(f[6])}%`, color: a });
301
+ const o = (d.value / f[1] - 1) * 100;
296
302
  let b;
297
303
  return o > 0 ? b = "red" : o < 0 && (b = "green"), v.push({ label: "至今涨幅", value: `${w(o)}%`, color: b }), v;
298
304
  }
299
305
  return [];
300
306
  }), D = te(() => {
301
- var d;
302
- const { data: s, activeIndex: g } = u;
303
- return ((d = s == null ? void 0 : s.mainIndicator) == null ? void 0 : d.map((v) => ({ label: v.key, value: w(v.data[g]), color: v.color }))) || [];
307
+ var f;
308
+ const { data: u, activeIndex: g } = s;
309
+ return ((f = u == null ? void 0 : u.mainIndicator) == null ? void 0 : f.map((v) => ({ label: v.key, value: w(v.data[g]), color: v.color }))) || [];
304
310
  });
305
- return (s, g) => (A(), E("div", lt, [
311
+ return (u, g) => (A(), E("div", lt, [
306
312
  B(we, { data: e.value }, null, 8, ["data"]),
307
313
  B(we, { data: D.value }, null, 8, ["data"])
308
314
  ]));
309
315
  }
310
- }, it = /* @__PURE__ */ X(rt, [["__scopeId", "data-v-85e9befe"]]), st = { class: "kline-averageTips" }, ut = /* @__PURE__ */ ve({
316
+ }, it = /* @__PURE__ */ X(rt, [["__scopeId", "data-v-946e09fc"]]), st = { class: "kline-averageTips" }, ut = /* @__PURE__ */ ye({
311
317
  __name: "index",
312
318
  props: {
313
319
  // 提示数据
@@ -318,11 +324,11 @@ const lt = { class: "kline-tips" }, rt = {
318
324
  },
319
325
  setup(n) {
320
326
  return (w, T) => (A(), E("div", st, [
321
- (A(!0), E(Q, null, ue(n.data, (u, m) => (A(), E("div", {
322
- key: m,
327
+ (A(!0), E(Q, null, ce(n.data, (s, d) => (A(), E("div", {
328
+ key: d,
323
329
  class: "kline-averageTips-item",
324
- style: ce({ color: u.color, width: `calc(100% / ${n.data.length} - 10px)` })
325
- }, ee(u.label) + " " + ee(u.value), 5))), 128))
330
+ style: de({ color: s.color, width: `calc(100% / ${n.data.length} - 10px)` })
331
+ }, ee(s.label) + " " + ee(s.value), 5))), 128))
326
332
  ]));
327
333
  }
328
334
  });
@@ -347,32 +353,32 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
347
353
  },
348
354
  emits: ["update:modelValue"],
349
355
  setup(n, { expose: w, emit: T }) {
350
- const { round: u } = be;
351
- let m, e;
352
- const D = T, s = n, g = S(), d = te({
356
+ const { round: s } = be;
357
+ let d, e;
358
+ const D = T, u = n, g = S(), f = te({
353
359
  get() {
354
- return s.modelValue;
360
+ return u.modelValue;
355
361
  },
356
362
  set(o) {
357
363
  D("update:modelValue", o);
358
364
  }
359
365
  }), v = te(() => {
360
366
  var x;
361
- const { data: o, activeIndex: b } = s;
367
+ const { data: o, activeIndex: b } = u;
362
368
  return ((x = o == null ? void 0 : o.subIndicator) == null ? void 0 : x.map((V) => ({ label: V.key, color: V.color, value: V.data[b] || "-" }))) || [];
363
369
  });
364
370
  De(() => {
365
- m = me.init(g.value);
371
+ d = ve.init(g.value);
366
372
  let o = !0;
367
373
  e = new ResizeObserver(() => {
368
374
  if (o) {
369
375
  o = null;
370
376
  return;
371
377
  }
372
- m.resize();
378
+ d.resize();
373
379
  }), e.observe(g.value);
374
380
  }), ke(() => {
375
- m.dispose(), e.disconnect(), e = null;
381
+ d.dispose(), e.disconnect(), e = null;
376
382
  });
377
383
  const a = (o, b) => {
378
384
  const x = o[b], V = b === 0 ? o[b] : o[b - 1];
@@ -390,13 +396,13 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
390
396
  };
391
397
  return w({
392
398
  connect: (o) => {
393
- me.connect([o, m]);
399
+ ve.connect([o, d]);
394
400
  },
395
401
  // 联动
396
402
  draw: (o, b) => {
397
403
  ge(() => {
398
- const { startValue: x, endValue: V, maxValueSpan: M } = o, { leftYAxisRange: P, rightYAxisRange: L } = s.data.subIndicator[0], I = s.data.subIndicator.map((f) => {
399
- if (f.series === "bar")
404
+ const { startValue: x, endValue: V, maxValueSpan: M } = o, { leftYAxisRange: P, rightYAxisRange: L } = u.data.subIndicator[0], I = u.data.subIndicator.map((p) => {
405
+ if (p.series === "bar")
400
406
  return {
401
407
  name: "subMain",
402
408
  xAxisIndex: 0,
@@ -404,10 +410,10 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
404
410
  type: "bar",
405
411
  silent: !0,
406
412
  symbol: "none",
407
- data: f.data.map((N, C) => f.seriesColor === "kline" ? {
413
+ data: p.data.map((N, C) => p.seriesColor === "kline" ? {
408
414
  value: N,
409
- itemStyle: a(s.data.data, C)
410
- } : f.seriesColor === "value" ? {
415
+ itemStyle: a(u.data.data, C)
416
+ } : p.seriesColor === "value" ? {
411
417
  value: N,
412
418
  itemStyle: {
413
419
  color: N >= 0 ? "#FF0000" : "#00FFFF"
@@ -415,28 +421,28 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
415
421
  } : {
416
422
  value: N,
417
423
  itemStyle: {
418
- color: f.seriesColor
424
+ color: p.seriesColor
419
425
  }
420
426
  })
421
427
  };
422
- if (f.series === "line")
428
+ if (p.series === "line")
423
429
  return {
424
430
  xAxisIndex: 0,
425
- yAxisIndex: f.yAxis === "right" ? 2 : 1,
426
- name: f.key,
431
+ yAxisIndex: p.yAxis === "right" ? 2 : 1,
432
+ name: p.key,
427
433
  type: "line",
428
434
  silent: !0,
429
435
  symbol: "none",
430
- data: f.data,
436
+ data: p.data,
431
437
  lineStyle: {
432
438
  width: 1
433
439
  },
434
440
  itemStyle: {
435
- color: f.color
441
+ color: p.color
436
442
  }
437
443
  };
438
444
  });
439
- m.setOption(
445
+ d.setOption(
440
446
  {
441
447
  animation: !1,
442
448
  grid: {
@@ -461,12 +467,12 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
461
467
  type: "cross",
462
468
  label: {
463
469
  rich: {},
464
- formatter: (f) => {
465
- const { axisDimension: N, value: C } = f;
470
+ formatter: (p) => {
471
+ const { axisDimension: N, value: C } = p;
466
472
  if (N === "x")
467
- return ["6", "7", "8"].includes(s.cycle) ? c(C).format("YYYY-MM-DD") : C;
468
- if (f.axisIndex === 1)
469
- return String(u(C));
473
+ return ["6", "7", "8"].includes(u.cycle) ? c(C).format("YYYY-MM-DD") : C;
474
+ if (p.axisIndex === 1)
475
+ return String(s(C));
470
476
  }
471
477
  }
472
478
  },
@@ -474,7 +480,7 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
474
480
  },
475
481
  xAxis: {
476
482
  type: "category",
477
- data: s.data.time,
483
+ data: u.data.time,
478
484
  axisLine: {
479
485
  show: !0
480
486
  },
@@ -482,7 +488,7 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
482
488
  show: !1
483
489
  },
484
490
  axisLabel: {
485
- formatter: (f) => ["6", "7", "8"].includes(s.cycle) ? c(f).format("YYYY-MM-DD") : f
491
+ formatter: (p) => ["6", "7", "8"].includes(u.cycle) ? c(p).format("YYYY-MM-DD") : p
486
492
  }
487
493
  },
488
494
  yAxis: [
@@ -491,8 +497,8 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
491
497
  },
492
498
  {
493
499
  position: "left",
494
- min: P === "cover" ? (f) => f.min : null,
495
- max: P === "cover" ? (f) => f.max : null,
500
+ min: P === "cover" ? (p) => p.min : null,
501
+ max: P === "cover" ? (p) => p.max : null,
496
502
  splitNumber: 1,
497
503
  axisLine: {
498
504
  show: !0
@@ -507,8 +513,8 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
507
513
  },
508
514
  {
509
515
  position: "right",
510
- min: L === "cover" ? (f) => f.min : null,
511
- max: L === "cover" ? (f) => f.max : null,
516
+ min: L === "cover" ? (p) => p.min : null,
517
+ max: L === "cover" ? (p) => p.max : null,
512
518
  splitNumber: 1,
513
519
  axisLine: {
514
520
  show: !1
@@ -534,14 +540,14 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
534
540
  U("div", ft, [
535
541
  v.value.length ? (A(), E("div", pt, [
536
542
  B(V, {
537
- modelValue: d.value,
538
- "onUpdate:modelValue": b[0] || (b[0] = (M) => d.value = M),
543
+ modelValue: f.value,
544
+ "onUpdate:modelValue": b[0] || (b[0] = (M) => f.value = M),
539
545
  size: "small",
540
546
  "popper-class": "element-dark",
541
547
  class: "element-dark subIndicator"
542
548
  }, {
543
549
  default: K(() => [
544
- (A(!0), E(Q, null, ue(n.subIndicatorList, (M) => (A(), Me(x, {
550
+ (A(!0), E(Q, null, ce(n.subIndicatorList, (M) => (A(), Me(x, {
545
551
  key: M.value,
546
552
  label: M.label,
547
553
  value: M.value
@@ -560,45 +566,45 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
560
566
  ]);
561
567
  };
562
568
  }
563
- }, vt = /* @__PURE__ */ X(mt, [["__scopeId", "data-v-7ec4c8cf"]]), yt = /* @__PURE__ */ ve({
569
+ }, vt = /* @__PURE__ */ X(mt, [["__scopeId", "data-v-7ec4c8cf"]]), yt = /* @__PURE__ */ ye({
564
570
  __name: "index",
565
571
  emits: ["closeContextMenuCallBack"],
566
572
  setup(n, { emit: w }) {
567
- const T = w, u = S(), m = S(), e = S({
573
+ const T = w, s = S(), d = S(), e = S({
568
574
  display: "none",
569
575
  top: "0px",
570
576
  left: "0px"
571
577
  }), D = () => {
572
578
  e.value.display = "none", T("closeContextMenuCallBack"), document.removeEventListener("click", D);
573
- }, s = (g) => {
579
+ }, u = (g) => {
574
580
  if (g.preventDefault(), e.value.display === "block") {
575
- const { offsetX: d, offsetY: v } = g, { offsetWidth: a, offsetHeight: o } = m.value;
576
- if (d <= a && v <= o)
581
+ const { offsetX: f, offsetY: v } = g, { offsetWidth: a, offsetHeight: o } = d.value;
582
+ if (f <= a && v <= o)
577
583
  return;
578
584
  }
579
- u.value.click(), e.value = {
585
+ s.value.click(), e.value = {
580
586
  display: "block",
581
587
  top: `${g.offsetY}px`,
582
588
  left: `${g.offsetX}px`
583
589
  }, ge(() => {
584
- const d = u.value.getBoundingClientRect(), v = m.value.getBoundingClientRect();
585
- v.left + v.width >= d.right && (e.value.left = `${g.offsetX - v.width}px`), v.top + v.height >= d.bottom && (console.log("高度超出"), e.value.top = `${g.offsetY - v.height}px`);
590
+ const f = s.value.getBoundingClientRect(), v = d.value.getBoundingClientRect();
591
+ 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`);
586
592
  }), document.addEventListener("click", D);
587
593
  };
588
- return (g, d) => (A(), E("div", {
594
+ return (g, f) => (A(), E("div", {
589
595
  ref_key: "contextmenuRef",
590
- ref: u,
596
+ ref: s,
591
597
  class: "contextmenu",
592
- onContextmenu: s,
598
+ onContextmenu: u,
593
599
  onMouseleave: D
594
600
  }, [
595
601
  Ye(g.$slots, "default", {}, void 0, !0),
596
602
  e.value.display !== "none" ? (A(), E("div", {
597
603
  key: 0,
598
604
  ref_key: "contextmenuContentRef",
599
- ref: m,
605
+ ref: d,
600
606
  class: "contextmenu-popover",
601
- style: ce(e.value)
607
+ style: de(e.value)
602
608
  }, [
603
609
  Ye(g.$slots, "popover", {}, void 0, !0)
604
610
  ], 4)) : G("", !0)
@@ -606,7 +612,7 @@ const dt = { class: "klineSub" }, ft = { class: "klineSub-tips" }, pt = {
606
612
  }
607
613
  });
608
614
  const gt = /* @__PURE__ */ X(yt, [["__scopeId", "data-v-811db6b4"]]);
609
- const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klineBasic-tips" }, xt = {
615
+ const Te = (n) => (Ne("data-v-e675b051"), n = n(), qe(), n), bt = { class: "klineBasic-tips" }, xt = {
610
616
  key: 0,
611
617
  class: "klineBasic-sub"
612
618
  }, ht = {
@@ -684,9 +690,9 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
684
690
  },
685
691
  emits: ["change", "getFactorData"],
686
692
  setup(n, { expose: w, emit: T }) {
687
- const u = [{ label: "画线预警", key: "drawWarningLine" }];
688
- let m = null, e = null, D, s, g = !1, d = !1;
689
- 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({}), f = S([]), N = S({}), C = S(!1), oe = S(""), de = S([...u]), H = te(() => ({
693
+ const s = [{ label: "画线预警", key: "drawWarningLine" }];
694
+ let d = null, e = null, D, u, g = !1, f = !1;
695
+ 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), oe = S(""), fe = S([...s]), H = te(() => ({
690
696
  defaultShowCounts: 500,
691
697
  // 默认展示条数
692
698
  addCounts: 2e3,
@@ -709,22 +715,22 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
709
715
  // 是否获取因子数据
710
716
  ...a.config
711
717
  }));
712
- ye(
718
+ ue(
713
719
  () => {
714
720
  var r, t;
715
721
  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];
716
722
  },
717
723
  () => {
718
- fe();
724
+ pe();
719
725
  },
720
726
  { deep: !0 }
721
727
  ), De(() => {
722
- Xe(a.env), fe(), window.addEventListener("keydown", xe);
728
+ Xe(a.env), pe(), window.addEventListener("keydown", xe);
723
729
  }), ke(() => {
724
- e == null || e.off("datazoom"), e == null || e.off("highlight"), e == null || e.off("globalout"), e == null || e.dispose(), m == null || m.dispose(), window.removeEventListener("keydown", xe);
730
+ e == null || e.off("datazoom"), e == null || e.off("highlight"), e == null || e.off("globalout"), e == null || e.dispose(), d == null || d.dispose(), window.removeEventListener("keydown", xe);
725
731
  });
726
732
  const Le = () => {
727
- e || (e = me.init(V.value), Ae(), H.value.showSubChart && M.value.connect(e), m = He(V.value), m.listen(() => {
733
+ e || (e = ve.init(V.value), Ae(), H.value.showSubChart && M.value.connect(e), d = He(V.value), d.listen(() => {
728
734
  requestAnimationFrame(() => {
729
735
  e.resize();
730
736
  });
@@ -732,8 +738,8 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
732
738
  }, xe = ({ code: r, ctrlKey: t }) => {
733
739
  if (!(t || o.value))
734
740
  return;
735
- const { xAxis: h, dataZoom: p } = e.getOption(), { data: y } = (h == null ? void 0 : h[0]) ?? { data: [] };
736
- let { startValue: l, endValue: i } = (p == null ? void 0 : p[0]) ?? {};
741
+ const { xAxis: h, dataZoom: m } = e.getOption(), { data: y } = (h == null ? void 0 : h[0]) ?? { data: [] };
742
+ let { startValue: l, endValue: i } = (m == null ? void 0 : m[0]) ?? {};
737
743
  if (y != null && y.length) {
738
744
  switch (r) {
739
745
  case "ArrowUp": {
@@ -772,51 +778,51 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
772
778
  }
773
779
  }, Ae = () => {
774
780
  e == null || e.on("datazoom", (t) => {
775
- clearTimeout(s), s = setTimeout(() => {
776
- var p, y, l, i;
781
+ clearTimeout(u), u = setTimeout(() => {
782
+ var m, y, l, i;
777
783
  const { loadCheckCounts: h } = H.value;
778
- if ((y = (p = e == null ? void 0 : e.getOption()) == null ? void 0 : p.dataZoom) != null && y[0]) {
784
+ if ((y = (m = e == null ? void 0 : e.getOption()) == null ? void 0 : m.dataZoom) != null && y[0]) {
779
785
  const { startValue: k } = (i = (l = e == null ? void 0 : e.getOption()) == null ? void 0 : l.dataZoom) == null ? void 0 : i[0];
780
- k < h && g === !1 && d === !1 && (g = !0, Fe("history")), ae();
786
+ k < h && g === !1 && f === !1 && (g = !0, Fe("history")), ae();
781
787
  }
782
- clearTimeout(s);
788
+ clearTimeout(u);
783
789
  }, 100);
784
790
  }), e == null || e.on("highlight", (t) => {
785
- var p, y;
791
+ var m, y;
786
792
  let h = t.dataIndex || -1;
787
- t.batch && (h = typeof ((p = t == null ? void 0 : t.batch[0]) == null ? void 0 : p.dataIndex) == "number" ? (y = t == null ? void 0 : t.batch[0]) == null ? void 0 : y.dataIndex : -1), clearTimeout(D), D = setTimeout(() => {
793
+ 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(() => {
788
794
  L.value = h, clearTimeout(D);
789
795
  }, 20);
790
796
  }), e == null || e.on("globalout", () => {
791
797
  const t = setTimeout(() => {
792
- var p, y, l;
798
+ var m, y, l;
793
799
  clearTimeout(t);
794
- const h = (l = (y = (p = e == null ? void 0 : e.getOption()) == null ? void 0 : p.dataZoom) == null ? void 0 : y[0]) == null ? void 0 : l.endValue;
800
+ 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;
795
801
  L.value = h;
796
802
  }, 30);
797
803
  });
798
804
  let r = null;
799
805
  e == null || e.on("contextmenu", (t) => {
800
806
  r = setTimeout(() => {
801
- t.componentType === "graphic" && (N.value = t.info, de.value = [
807
+ t.componentType === "graphic" && (N.value = t.info, fe.value = [
802
808
  { label: "删除画线", key: "deleteWarningLine" },
803
809
  { label: "修改画线", key: "changeWarningLine" }
804
810
  ]), clearTimeout(r), r = null;
805
811
  });
806
812
  });
807
- }, fe = async () => {
808
- var r, t, h, p, y, l;
813
+ }, pe = async () => {
814
+ var r, t, h, m, y, l;
809
815
  try {
810
816
  if (!a.variety || !a.cycle)
811
817
  return;
812
- const { variety: i, featureId: k, cycle: F, indicatorStore: Y, mainIndicator: q, right: z, startTime: j, endTime: R } = a, { defaultShowCounts: $, addCounts: _, showWarningLine: pe, getFactorData: re } = H.value, O = {
818
+ const { variety: i, featureId: k, cycle: F, indicatorStore: Y, mainIndicator: q, right: z, startTime: j, endTime: R } = a, { defaultShowCounts: $, addCounts: _, showWarningLine: me, getFactorData: re } = H.value, O = {
813
819
  variety: i,
814
820
  featureId: k,
815
821
  cycle: F,
816
822
  mainIndicatorList: Y.getIndicatorParams(q),
817
823
  subIndicator: P.value,
818
824
  right: z,
819
- showWarningLine: pe,
825
+ showWarningLine: me,
820
826
  getFactorData: re
821
827
  };
822
828
  j && R ? (O.startTime = j, O.endTime = R) : j ? (O.startTime = j, O.limit = $ + _) : R ? (O.endTime = R, O.limit = $ + _) : (O.endTime = c().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), O.limit = $ + _);
@@ -827,19 +833,19 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
827
833
  b.value = !0, x.value = !1;
828
834
  return;
829
835
  }
830
- I.value = (p = W == null ? void 0 : W.body) == null ? void 0 : p.kline, f.value = ((y = W == null ? void 0 : W.body) == null ? void 0 : y.warningLine) || [], he(), ae(), re && v("getFactorData", (l = W == null ? void 0 : W.body) == null ? void 0 : l.factor);
836
+ 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(), ae(), re && v("getFactorData", (l = W == null ? void 0 : W.body) == null ? void 0 : l.factor);
831
837
  } catch (i) {
832
838
  throw x.value = !0, b.value = !1, new Error(i);
833
839
  }
834
840
  }, Fe = async (r) => {
835
- const { variety: t, cycle: h, indicatorStore: p, mainIndicator: y, right: l } = a, { addCounts: i } = H.value, { time: k } = I.value;
841
+ const { variety: t, cycle: h, indicatorStore: m, mainIndicator: y, right: l } = a, { addCounts: i } = H.value, { time: k } = I.value;
836
842
  if (r === "history") {
837
843
  const F = await Je({
838
844
  variety: t,
839
845
  cycle: h,
840
846
  endTime: k[0],
841
847
  limit: i,
842
- mainIndicatorList: p.getIndicatorParams(y),
848
+ mainIndicatorList: m.getIndicatorParams(y),
843
849
  subIndicator: P.value,
844
850
  right: l
845
851
  });
@@ -860,16 +866,16 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
860
866
  data: [...((z = F.body.subIndicator[q]) == null ? void 0 : z.data) ?? [], ...Y.data.slice(1)]
861
867
  };
862
868
  })
863
- }, he(!0), F.body.data.length < i && (d = !0), g = !1;
869
+ }, he(!0), F.body.data.length < i && (f = !0), g = !1;
864
870
  }
865
871
  }, he = (r = !1) => {
866
872
  var q, z, j;
867
873
  Le();
868
- const { time: t } = I.value, { gridRight: h, gridLeft: p, defaultShowCounts: y, maxShowCounts: l, showSubChart: i } = H.value;
874
+ const { time: t } = I.value, { gridRight: h, gridLeft: m, defaultShowCounts: y, maxShowCounts: l, showSubChart: i } = H.value;
869
875
  let k = t.length - 1 - y, F = t.length - 1;
870
876
  if (r) {
871
- const R = e.getOption(), $ = (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], pe = $[_ == null ? void 0 : _.startValue], re = $[_ == null ? void 0 : _.endValue];
872
- k = t.findIndex((O) => O === pe), F = t.findIndex((O) => O === re);
877
+ const R = e.getOption(), $ = (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 = $[_ == null ? void 0 : _.startValue], re = $[_ == null ? void 0 : _.endValue];
878
+ k = t.findIndex((O) => O === me), F = t.findIndex((O) => O === re);
873
879
  }
874
880
  const Y = nt(I.value, H.value, k, F, a.cycle);
875
881
  if (e.setOption(Y, !0), L.value = F, a.brushRange) {
@@ -901,7 +907,7 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
901
907
  ]
902
908
  });
903
909
  }
904
- i && M.value.draw({ startValue: k, endValue: F, maxValueSpan: l }, { gridLeft: p, gridRight: h }), _e();
910
+ i && M.value.draw({ startValue: k, endValue: F, maxValueSpan: l }, { gridLeft: m, gridRight: h }), _e();
905
911
  }, ae = () => {
906
912
  if (!e)
907
913
  return;
@@ -910,7 +916,7 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
910
916
  {
911
917
  ...r,
912
918
  graphic: [
913
- ...ot(e, f.value, a, H.value, () => {
919
+ ...ot(e, p.value, a, H.value, () => {
914
920
  le();
915
921
  })
916
922
  ]
@@ -920,22 +926,22 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
920
926
  }, _e = () => {
921
927
  const { time: r } = I.value;
922
928
  if (a.brushRange && (r != null && r.length)) {
923
- let t = c(a.brushRange[0]).format("YYYY-MM-DD 00:00:00"), h = c(a.brushRange[1]).format("YYYY-MM-DD 23:59:59"), p = null, y = null;
929
+ let t = c(a.brushRange[0]).format("YYYY-MM-DD 00:00:00"), h = c(a.brushRange[1]).format("YYYY-MM-DD 23:59:59"), m = null, y = null;
924
930
  switch (a.cycle) {
925
931
  case "6": {
926
- p = r.find((l) => c(l).format("YYYY-MM-DD") === c(t).format("YYYY-MM-DD")), y = p;
932
+ m = r.find((l) => c(l).format("YYYY-MM-DD") === c(t).format("YYYY-MM-DD")), y = m;
927
933
  break;
928
934
  }
929
935
  case "7": {
930
- p = r.find((l) => c(l).day(5).format("YYYY-MM-DD") === c(t).day(5).format("YYYY-MM-DD")), y = r.findLast((l) => c(l).day(5).format("YYYY-MM-DD") === c(h).day(5).format("YYYY-MM-DD"));
936
+ m = r.find((l) => c(l).day(5).format("YYYY-MM-DD") === c(t).day(5).format("YYYY-MM-DD")), y = r.findLast((l) => c(l).day(5).format("YYYY-MM-DD") === c(h).day(5).format("YYYY-MM-DD"));
931
937
  break;
932
938
  }
933
939
  case "8": {
934
- p = r.find((l) => c(l).endOf("month").format("YYYY-MM-DD") === c(t).endOf("month").format("YYYY-MM-DD")), y = r.findLast((l) => c(l).endOf("month").format("YYYY-MM-DD") === c(h).endOf("month").format("YYYY-MM-DD"));
940
+ m = r.find((l) => c(l).endOf("month").format("YYYY-MM-DD") === c(t).endOf("month").format("YYYY-MM-DD")), y = r.findLast((l) => c(l).endOf("month").format("YYYY-MM-DD") === c(h).endOf("month").format("YYYY-MM-DD"));
935
941
  break;
936
942
  }
937
943
  default:
938
- p = r.find((l) => {
944
+ m = r.find((l) => {
939
945
  const i = c(l).format("YYYY-MM-DD") === c(t).format("YYYY-MM-DD"), k = new Date(l).getTime() >= new Date(t).getTime();
940
946
  return i && k;
941
947
  }), y = r.findLast((l) => {
@@ -948,7 +954,7 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
948
954
  areas: [
949
955
  {
950
956
  brushType: "lineX",
951
- coordRange: [p, y],
957
+ coordRange: [m, y],
952
958
  xAxisIndex: 0
953
959
  }
954
960
  ]
@@ -956,9 +962,9 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
956
962
  }
957
963
  }, le = async () => {
958
964
  const r = await et({ featureId: a.featureId });
959
- f.value = (r == null ? void 0 : r.body) || [], ae(), v("change", "warningLine", f.value);
965
+ p.value = (r == null ? void 0 : r.body) || [], ae(), v("change", "warningLine", p.value);
960
966
  }, Re = async (r) => {
961
- const { variety: t, varietyName: h, featureId: p, featureType: y } = a;
967
+ const { variety: t, varietyName: h, featureId: m, featureType: y } = a;
962
968
  if (r.key === "drawWarningLine") {
963
969
  const l = e == null ? void 0 : e.getOption(), i = l.tooltip[0];
964
970
  e == null || e.setOption({
@@ -1017,7 +1023,7 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
1017
1023
  //品种代码
1018
1024
  featureName: h,
1019
1025
  //品种名称
1020
- featureId: p,
1026
+ featureId: m,
1021
1027
  //品种id
1022
1028
  featureType: y,
1023
1029
  //品种类型
@@ -1028,7 +1034,7 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
1028
1034
  } else
1029
1035
  r.key === "deleteWarningLine" ? (await tt({ id: N.value.id }), se.success("画线预警删除成功"), le()) : r.key === "changeWarningLine" && (C.value = !0, oe.value = N.value.warnPrice);
1030
1036
  }, Ve = async () => {
1031
- const { variety: r, varietyName: t, featureId: h, featureType: p } = a;
1037
+ const { variety: r, varietyName: t, featureId: h, featureType: m } = a;
1032
1038
  await Se({
1033
1039
  id: N.value.id,
1034
1040
  featureCode: r,
@@ -1037,20 +1043,20 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
1037
1043
  //品种名称
1038
1044
  featureId: h,
1039
1045
  //品种id
1040
- featureType: p,
1046
+ featureType: m,
1041
1047
  //品种类型
1042
1048
  warnPrice: oe.value
1043
1049
  }), se.success("画线预警修改成功"), le();
1044
1050
  }, Ee = () => {
1045
- de.value = [...u];
1051
+ fe.value = [...s];
1046
1052
  };
1047
1053
  return w({
1048
1054
  draw: (r, t) => {
1049
- r === "warningLine" && (f.value = t, ae());
1055
+ r === "warningLine" && (p.value = t, ae());
1050
1056
  }
1051
1057
  }), (r, t) => {
1052
1058
  var F;
1053
- const h = Pe, p = We, y = Oe, l = $e, i = Be, k = Ie;
1059
+ const h = Pe, m = We, y = Oe, l = $e, i = Be, k = Ie;
1054
1060
  return A(), E(Q, null, [
1055
1061
  U("div", {
1056
1062
  class: "klineBasic",
@@ -1059,24 +1065,25 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
1059
1065
  }, [
1060
1066
  U("div", bt, [
1061
1067
  B(it, {
1068
+ variety: n.variety,
1062
1069
  data: I.value,
1063
1070
  activeIndex: L.value
1064
- }, null, 8, ["data", "activeIndex"])
1071
+ }, null, 8, ["variety", "data", "activeIndex"])
1065
1072
  ]),
1066
1073
  U("div", {
1067
1074
  class: "klineBasic-main",
1068
- style: ce({ height: H.value.showSubChart ? "70%" : "100%" })
1075
+ style: de({ height: H.value.showSubChart ? "70%" : "100%" })
1069
1076
  }, [
1070
1077
  B(gt, { onCloseContextMenuCallBack: Ee }, {
1071
1078
  popover: K(() => [
1072
- B(p, { style: {
1079
+ B(m, { style: {
1073
1080
  borderRadius: "4px",
1074
1081
  overflow: "hidden",
1075
1082
  background: "#fff",
1076
1083
  borderRight: 0
1077
1084
  } }, {
1078
1085
  default: K(() => [
1079
- (A(!0), E(Q, null, ue(de.value, (Y) => (A(), Me(h, {
1086
+ (A(!0), E(Q, null, ce(fe.value, (Y) => (A(), Me(h, {
1080
1087
  style: { height: "36px" },
1081
1088
  key: Y.key,
1082
1089
  index: Y.key,
@@ -1122,7 +1129,7 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
1122
1129
  x.value ? (A(), E("div", _t, [
1123
1130
  Yt,
1124
1131
  U("div", wt, [
1125
- B(l, { onClick: fe }, {
1132
+ B(l, { onClick: pe }, {
1126
1133
  default: K(() => [
1127
1134
  ie("刷新")
1128
1135
  ]),
@@ -1172,7 +1179,7 @@ const Te = (n) => (Ne("data-v-eff0fd1a"), n = n(), qe(), n), bt = { class: "klin
1172
1179
  ], 64);
1173
1180
  };
1174
1181
  }
1175
- }, St = /* @__PURE__ */ X(Mt, [["__scopeId", "data-v-eff0fd1a"]]), cn = {
1182
+ }, St = /* @__PURE__ */ X(Mt, [["__scopeId", "data-v-e675b051"]]), cn = {
1176
1183
  install(n) {
1177
1184
  n.component("st-klineBasic", St);
1178
1185
  }