st-comp 0.0.262 → 0.0.263

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