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