st-comp 0.0.245 → 0.0.247

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