st-comp 0.0.244 → 0.0.246

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