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.
- package/es/ConfigProvider.cjs +1 -1
- package/es/ConfigProvider.js +1 -1
- package/es/CustomFunction.cjs +2 -2
- package/es/CustomFunction.js +262 -263
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +1 -1
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +1 -1
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +574 -606
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +1 -1
- package/es/KlinePlus.cjs +1 -1
- package/es/KlinePlus.js +1 -1
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +3 -3
- package/es/Pie.cjs +1 -1
- package/es/Pie.js +1 -1
- package/es/User.cjs +1 -1
- package/es/User.js +1 -1
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +2 -2
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +1 -1
- package/es/VarietySearch.cjs +20 -20
- package/es/VarietySearch.js +2995 -3000
- package/es/{VarietySelect-031bf077.cjs → VarietySelect-2fd501da.cjs} +1 -1
- package/es/{VarietySelect-ae0c48b2.js → VarietySelect-5a9dd50b.js} +1 -1
- package/es/{index-1f939868.cjs → index-2375023e.cjs} +2 -2
- package/es/{index-edabe380.js → index-7ed0999e.js} +5487 -5574
- package/es/{index-2c456130.cjs → index-8901a38c.cjs} +40 -40
- package/es/{index-4b01552e.js → index-ac98a4d8.js} +3 -3
- package/es/{python-7ce6f0b1.js → python-a914569a.js} +3 -3
- package/es/{python-c8abd4f5.cjs → python-c67c8901.cjs} +1 -1
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +223 -223
- package/lib/{index-200db55b.js → index-2a325d42.js} +34655 -34779
- package/lib/{python-9540022d.js → python-eb65d93b.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/CustomFunction/index.vue +2 -4
- package/packages/KlineBasic/index.vue +518 -497
- package/packages/VarietySearch/components/CompositeOrder/index.vue +2 -4
- package/packages/VarietySearch/components/FactorScreen/index.vue +5 -7
- package/packages/VarietySearch/index.vue +4 -6
- package/src/pages/KlineBasic/api.js +7 -4
- package/src/pages/KlineBasic/index.vue +346 -56
- 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
|
|
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
|
|
6
|
-
import { E as
|
|
7
|
-
import { E as
|
|
8
|
-
import { E as
|
|
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
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { y as
|
|
15
|
-
import { E as
|
|
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
|
|
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
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
handleReq: (
|
|
41
|
-
|
|
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: (
|
|
44
|
-
const { data: l } =
|
|
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` :
|
|
46
|
+
return location.origin.includes("localhost") ? location.href = `${location.origin}/#/404` : Qe(), !0;
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
const { data: e, time:
|
|
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: `${
|
|
56
|
-
right: `${
|
|
57
|
-
bottom:
|
|
58
|
-
left: `${
|
|
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:
|
|
63
|
+
startValue: h,
|
|
64
64
|
endValue: l,
|
|
65
|
-
maxValueSpan:
|
|
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: (
|
|
77
|
-
const { axisDimension:
|
|
78
|
-
return
|
|
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: !
|
|
85
|
+
show: !Y,
|
|
86
86
|
type: "category",
|
|
87
|
-
data:
|
|
87
|
+
data: b,
|
|
88
88
|
splitLine: {
|
|
89
89
|
show: !1
|
|
90
90
|
},
|
|
91
91
|
axisLabel: {
|
|
92
|
-
formatter: (
|
|
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: (
|
|
108
|
-
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((
|
|
123
|
-
name:
|
|
122
|
+
...n.mainIndicator.map((a) => ({
|
|
123
|
+
name: a.key,
|
|
124
124
|
type: "line",
|
|
125
125
|
silent: !0,
|
|
126
126
|
symbol: "none",
|
|
127
|
-
data:
|
|
127
|
+
data: a.data,
|
|
128
128
|
lineStyle: {
|
|
129
|
-
width:
|
|
129
|
+
width: a.width || 1
|
|
130
130
|
},
|
|
131
131
|
itemStyle: {
|
|
132
|
-
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
|
-
},
|
|
153
|
-
const { variety: e, featureId:
|
|
154
|
-
return
|
|
155
|
-
const { warnPrice:
|
|
156
|
-
if (
|
|
157
|
-
return
|
|
158
|
-
let
|
|
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
|
-
...
|
|
160
|
+
...Y,
|
|
161
161
|
{
|
|
162
162
|
type: "group",
|
|
163
163
|
name: "warningLine",
|
|
164
|
-
info:
|
|
164
|
+
info: a,
|
|
165
165
|
draggable: "vertical",
|
|
166
166
|
children: [
|
|
167
167
|
{
|
|
168
168
|
type: "line",
|
|
169
|
-
info:
|
|
169
|
+
info: a,
|
|
170
170
|
shape: {
|
|
171
|
-
x1:
|
|
171
|
+
x1: p,
|
|
172
172
|
// 开始X坐标
|
|
173
|
-
y1:
|
|
173
|
+
y1: i,
|
|
174
174
|
// 开始Y坐标
|
|
175
|
-
x2: (n == null ? void 0 : n.getWidth()) -
|
|
175
|
+
x2: (n == null ? void 0 : n.getWidth()) - v,
|
|
176
176
|
// 结束X坐标
|
|
177
|
-
y2:
|
|
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:
|
|
190
|
-
x: (n == null ? void 0 : n.getWidth()) -
|
|
191
|
-
y:
|
|
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:
|
|
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: (
|
|
204
|
-
|
|
203
|
+
ondragstart: (D) => {
|
|
204
|
+
M = D.offsetY;
|
|
205
205
|
},
|
|
206
|
-
ondrag: (
|
|
207
|
-
var
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
(
|
|
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 (
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
217
|
-
const
|
|
218
|
-
id:
|
|
219
|
-
warnPrice:
|
|
220
|
-
featureId:
|
|
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:
|
|
224
|
+
featureType: s
|
|
225
225
|
//品种类型
|
|
226
226
|
};
|
|
227
|
-
await
|
|
227
|
+
await Te(g), pe.success("画线预警修改成功"), f && f();
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
];
|
|
232
232
|
}, []);
|
|
233
233
|
};
|
|
234
|
-
function
|
|
235
|
-
function
|
|
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
|
|
240
|
-
if (
|
|
239
|
+
const f = l.trim();
|
|
240
|
+
if (f === "")
|
|
241
241
|
return null;
|
|
242
|
-
const e = Number(
|
|
242
|
+
const e = Number(f);
|
|
243
243
|
return Number.isFinite(e) ? e : null;
|
|
244
244
|
}
|
|
245
245
|
return null;
|
|
246
246
|
}
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
247
|
+
const h = w(n);
|
|
248
|
+
if (h === null)
|
|
249
249
|
return "-";
|
|
250
250
|
try {
|
|
251
|
-
if (
|
|
252
|
-
return
|
|
251
|
+
if (h >= 1 || h <= -1)
|
|
252
|
+
return H(h);
|
|
253
253
|
{
|
|
254
|
-
const l =
|
|
255
|
-
return
|
|
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
|
|
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
|
|
272
|
-
return
|
|
273
|
-
l.value.length === 0 &&
|
|
274
|
-
Array.from(
|
|
275
|
-
var
|
|
276
|
-
((
|
|
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
|
-
}), (
|
|
279
|
+
}), (f, e) => (A(), R("div", {
|
|
280
280
|
class: "kline-tips",
|
|
281
281
|
ref_key: "tipsRef",
|
|
282
|
-
ref:
|
|
282
|
+
ref: h
|
|
283
283
|
}, [
|
|
284
|
-
(
|
|
285
|
-
key:
|
|
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:
|
|
288
|
-
},
|
|
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
|
|
293
|
-
const
|
|
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:
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}),
|
|
315
|
-
|
|
316
|
-
}),
|
|
317
|
-
|
|
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 =
|
|
320
|
-
const { data:
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
{ label: "开", value:
|
|
324
|
-
{ label: "高", value:
|
|
325
|
-
{ label: "低", value:
|
|
326
|
-
{ label: "收", value:
|
|
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
|
-
|
|
329
|
-
let
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
let
|
|
333
|
-
return
|
|
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
|
-
}),
|
|
337
|
-
var
|
|
338
|
-
const { data:
|
|
339
|
-
return ((
|
|
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 (
|
|
342
|
-
B(
|
|
343
|
-
B(
|
|
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
|
-
},
|
|
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 (
|
|
357
|
-
(
|
|
358
|
-
key:
|
|
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:
|
|
361
|
-
},
|
|
360
|
+
style: ve({ color: l.color })
|
|
361
|
+
}, le(l.label) + " " + le(l.value), 5))), 128))
|
|
362
362
|
]));
|
|
363
363
|
}
|
|
364
364
|
});
|
|
365
|
-
const
|
|
366
|
-
const
|
|
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
|
-
},
|
|
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:
|
|
386
|
-
const { round: l } =
|
|
387
|
-
let
|
|
388
|
-
const
|
|
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
|
|
390
|
+
return s.modelValue;
|
|
391
391
|
},
|
|
392
|
-
set(
|
|
393
|
-
|
|
392
|
+
set(a) {
|
|
393
|
+
b("update:modelValue", a);
|
|
394
394
|
}
|
|
395
|
-
}),
|
|
396
|
-
var
|
|
397
|
-
const { data:
|
|
398
|
-
return ((
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
let
|
|
400
|
+
Me(() => {
|
|
401
|
+
f = be.init(x.value);
|
|
402
|
+
let a = !0;
|
|
403
403
|
e = new ResizeObserver(() => {
|
|
404
|
-
if (
|
|
405
|
-
|
|
404
|
+
if (a) {
|
|
405
|
+
a = null;
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
|
|
409
|
-
}), e.observe(
|
|
410
|
-
}),
|
|
411
|
-
|
|
408
|
+
f.resize();
|
|
409
|
+
}), e.observe(x.value);
|
|
410
|
+
}), Le(() => {
|
|
411
|
+
f.dispose(), e.disconnect(), e = null;
|
|
412
412
|
});
|
|
413
|
-
const
|
|
414
|
-
const
|
|
415
|
-
return
|
|
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
|
-
} :
|
|
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
|
|
428
|
-
connect: (
|
|
429
|
-
|
|
427
|
+
return w({
|
|
428
|
+
connect: (a) => {
|
|
429
|
+
be.connect([a, f]);
|
|
430
430
|
},
|
|
431
431
|
// 联动
|
|
432
|
-
draw: (
|
|
433
|
-
|
|
434
|
-
const { startValue:
|
|
435
|
-
if (
|
|
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:
|
|
444
|
-
value:
|
|
445
|
-
itemStyle:
|
|
446
|
-
} :
|
|
447
|
-
value:
|
|
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:
|
|
449
|
+
color: V >= 0 ? "#FF0000" : "#00FFFF"
|
|
450
450
|
}
|
|
451
451
|
} : {
|
|
452
|
-
value:
|
|
452
|
+
value: V,
|
|
453
453
|
itemStyle: {
|
|
454
|
-
color:
|
|
454
|
+
color: g.seriesColor
|
|
455
455
|
}
|
|
456
456
|
})
|
|
457
457
|
};
|
|
458
|
-
if (
|
|
458
|
+
if (g.series === "line")
|
|
459
459
|
return {
|
|
460
460
|
xAxisIndex: 0,
|
|
461
|
-
yAxisIndex:
|
|
462
|
-
name:
|
|
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:
|
|
466
|
+
data: g.data,
|
|
467
467
|
lineStyle: {
|
|
468
468
|
width: 1
|
|
469
469
|
},
|
|
470
470
|
itemStyle: {
|
|
471
|
-
color:
|
|
471
|
+
color: g.color
|
|
472
472
|
}
|
|
473
473
|
};
|
|
474
474
|
});
|
|
475
|
-
|
|
475
|
+
f.setOption(
|
|
476
476
|
{
|
|
477
477
|
animation: !1,
|
|
478
478
|
grid: {
|
|
479
|
-
left: `${
|
|
479
|
+
left: `${_.gridLeft}px`,
|
|
480
480
|
top: "10px",
|
|
481
|
-
right: `${
|
|
481
|
+
right: `${_.gridRight}px`,
|
|
482
482
|
bottom: "20px"
|
|
483
483
|
},
|
|
484
484
|
dataZoom: [
|
|
485
485
|
{
|
|
486
486
|
type: "inside",
|
|
487
|
-
startValue:
|
|
488
|
-
endValue:
|
|
489
|
-
maxValueSpan:
|
|
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: (
|
|
501
|
-
const { axisDimension:
|
|
502
|
-
if (
|
|
503
|
-
return ["6", "7", "8"].includes(
|
|
504
|
-
if (
|
|
505
|
-
return String(l(
|
|
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:
|
|
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: (
|
|
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:
|
|
531
|
-
max:
|
|
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:
|
|
547
|
-
max:
|
|
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:
|
|
560
|
+
series: z
|
|
561
561
|
},
|
|
562
562
|
!0
|
|
563
563
|
);
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
566
|
// 重置
|
|
567
|
-
}), (
|
|
568
|
-
const
|
|
569
|
-
return
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
B(
|
|
573
|
-
modelValue:
|
|
574
|
-
"onUpdate:modelValue":
|
|
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:
|
|
580
|
-
(
|
|
581
|
-
key:
|
|
582
|
-
label:
|
|
583
|
-
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
|
-
])) :
|
|
589
|
-
B(
|
|
588
|
+
])) : ne("", !0),
|
|
589
|
+
B(yt, { data: v.value }, null, 8, ["data"])
|
|
590
590
|
]),
|
|
591
|
-
|
|
591
|
+
q("div", {
|
|
592
592
|
class: "klineSub-chart",
|
|
593
593
|
ref_key: "subChartRef",
|
|
594
|
-
ref:
|
|
594
|
+
ref: x
|
|
595
595
|
}, null, 512)
|
|
596
596
|
]);
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
|
-
},
|
|
599
|
+
}, wt = /* @__PURE__ */ G(ht, [["__scopeId", "data-v-a6bfe8fe"]]), kt = /* @__PURE__ */ _e({
|
|
600
600
|
__name: "index",
|
|
601
601
|
emits: ["closeContextMenuCallBack"],
|
|
602
|
-
setup(n, { emit:
|
|
603
|
-
const
|
|
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
|
-
}),
|
|
608
|
-
e.value.display = "none",
|
|
609
|
-
},
|
|
610
|
-
if (
|
|
611
|
-
const { offsetX:
|
|
612
|
-
if (
|
|
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: `${
|
|
618
|
-
left: `${
|
|
619
|
-
},
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
}), document.addEventListener("click",
|
|
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 (
|
|
624
|
+
return (x, p) => (A(), R("div", {
|
|
625
625
|
ref_key: "contextmenuRef",
|
|
626
626
|
ref: l,
|
|
627
627
|
class: "contextmenu",
|
|
628
|
-
onContextmenu:
|
|
629
|
-
onMouseleave:
|
|
628
|
+
onContextmenu: s,
|
|
629
|
+
onMouseleave: b
|
|
630
630
|
}, [
|
|
631
|
-
|
|
632
|
-
e.value.display !== "none" ? (
|
|
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:
|
|
635
|
+
ref: f,
|
|
636
636
|
class: "contextmenu-popover",
|
|
637
|
-
style:
|
|
637
|
+
style: ve(e.value)
|
|
638
638
|
}, [
|
|
639
|
-
|
|
640
|
-
], 4)) :
|
|
639
|
+
De(x.$slots, "popover", {}, void 0, !0)
|
|
640
|
+
], 4)) : ne("", !0)
|
|
641
641
|
], 544));
|
|
642
642
|
}
|
|
643
643
|
});
|
|
644
|
-
const
|
|
645
|
-
const
|
|
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
|
-
},
|
|
648
|
+
}, Mt = {
|
|
649
649
|
key: 1,
|
|
650
650
|
class: "klineBasic-empty"
|
|
651
|
-
},
|
|
651
|
+
}, Lt = {
|
|
652
652
|
key: 2,
|
|
653
653
|
class: "klineBasic-error"
|
|
654
|
-
},
|
|
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:
|
|
711
|
+
setup(n, { expose: w, emit: h }) {
|
|
723
712
|
const l = [{ label: "画线预警", key: "drawWarningLine" }];
|
|
724
|
-
let
|
|
725
|
-
const
|
|
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
|
-
|
|
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
|
-
},
|
|
769
|
-
|
|
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 {
|
|
772
|
-
let
|
|
773
|
-
if (
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
|
|
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
|
-
|
|
783
|
-
|
|
784
|
-
|
|
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 "
|
|
788
|
-
|
|
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 "
|
|
792
|
-
|
|
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: "
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
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
|
-
},
|
|
844
|
-
var
|
|
837
|
+
}, xe = async () => {
|
|
838
|
+
var r, t, y, c, d, o;
|
|
845
839
|
try {
|
|
846
|
-
if (!
|
|
840
|
+
if (!i.variety || !i.cycle)
|
|
847
841
|
return;
|
|
848
|
-
const { variety: u, featureId:
|
|
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:
|
|
851
|
-
cycle:
|
|
852
|
-
mainIndicatorList:
|
|
853
|
-
subIndicator:
|
|
854
|
-
right:
|
|
855
|
-
showWarningLine:
|
|
856
|
-
getFactorData:
|
|
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
|
-
|
|
859
|
-
const
|
|
860
|
-
if ((
|
|
861
|
-
|
|
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
|
-
|
|
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
|
|
868
|
+
throw ye(), $.value = !0, D.value = !1, new Error(u);
|
|
869
869
|
}
|
|
870
|
-
},
|
|
871
|
-
const { variety: t, cycle:
|
|
872
|
-
if (
|
|
873
|
-
const
|
|
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:
|
|
876
|
-
endTime:
|
|
875
|
+
cycle: y,
|
|
876
|
+
endTime: k[0],
|
|
877
877
|
limit: u,
|
|
878
|
-
mainIndicatorList:
|
|
879
|
-
subIndicator:
|
|
880
|
-
right:
|
|
878
|
+
mainIndicatorList: c.getIndicatorParams(d),
|
|
879
|
+
subIndicator: g.value,
|
|
880
|
+
right: o
|
|
881
881
|
});
|
|
882
|
-
|
|
883
|
-
time: [...
|
|
884
|
-
data: [...
|
|
885
|
-
mainIndicator:
|
|
886
|
-
var
|
|
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
|
-
...
|
|
889
|
-
data: [...((
|
|
888
|
+
...m,
|
|
889
|
+
data: [...((P = L.body.mainIndicator[E]) == null ? void 0 : P.data) ?? [], ...m.data.slice(1)]
|
|
890
890
|
};
|
|
891
891
|
}),
|
|
892
|
-
subIndicator:
|
|
893
|
-
var
|
|
892
|
+
subIndicator: T.value.subIndicator.map((m, E) => {
|
|
893
|
+
var P;
|
|
894
894
|
return {
|
|
895
|
-
...
|
|
896
|
-
data: [...((
|
|
895
|
+
...m,
|
|
896
|
+
data: [...((P = L.body.subIndicator[E]) == null ? void 0 : P.data) ?? [], ...m.data.slice(1)]
|
|
897
897
|
};
|
|
898
898
|
})
|
|
899
|
-
},
|
|
899
|
+
}, console.log("触发了加载更多数据"), await oe(), we(!0), L.body.data.length < u && (a = !0, console.log("历史数据已经全部加载完毕")), Y = !1;
|
|
900
900
|
}
|
|
901
|
-
},
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
const {
|
|
905
|
-
let
|
|
906
|
-
if (
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
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
|
-
|
|
927
|
-
|
|
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 "
|
|
966
|
-
|
|
920
|
+
case "ArrowLeft": {
|
|
921
|
+
o > 0 && (o -= 1, u -= 1), V.value > 0 && (V.value -= 1);
|
|
967
922
|
break;
|
|
968
923
|
}
|
|
969
|
-
case "
|
|
970
|
-
|
|
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
|
-
|
|
983
|
-
type: "
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
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
|
-
},
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
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
|
-
...
|
|
1002
|
-
// 指示器样式
|
|
982
|
+
...o,
|
|
1003
983
|
tooltip: {
|
|
1004
984
|
...u,
|
|
1005
|
-
// 坐标轴指示器
|
|
1006
985
|
axisPointer: {
|
|
1007
|
-
// 保留原有部分配置
|
|
1008
986
|
...u.axisPointer,
|
|
1009
|
-
|
|
1010
|
-
|
|
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
|
-
|
|
1024
|
-
formatter: (A) => ""
|
|
992
|
+
formatter: () => ""
|
|
1025
993
|
}
|
|
1026
994
|
}
|
|
1027
995
|
}
|
|
1028
996
|
});
|
|
1029
|
-
const
|
|
1030
|
-
e == null || e.getZr().off("mousedown",
|
|
1031
|
-
const
|
|
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
|
-
...
|
|
1034
|
-
// 指示器样式
|
|
1001
|
+
...o,
|
|
1035
1002
|
tooltip: {
|
|
1036
1003
|
...u,
|
|
1037
1004
|
axisPointer: {
|
|
1038
1005
|
...u.axisPointer,
|
|
1039
|
-
lineStyle: {
|
|
1040
|
-
|
|
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
|
|
1014
|
+
}), await it({
|
|
1052
1015
|
featureCode: t,
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
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",
|
|
1022
|
+
e == null || e.getZr().on("mousedown", k);
|
|
1064
1023
|
} else
|
|
1065
|
-
|
|
1066
|
-
},
|
|
1067
|
-
const { variety:
|
|
1068
|
-
await
|
|
1069
|
-
id:
|
|
1070
|
-
featureCode:
|
|
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
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
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
|
|
1084
|
-
|
|
1085
|
-
|
|
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
|
-
}), (
|
|
1088
|
-
var
|
|
1089
|
-
const
|
|
1090
|
-
return
|
|
1091
|
-
|
|
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] = (
|
|
1094
|
-
onMouseout: t[2] || (t[2] = (
|
|
1061
|
+
onMousemove: t[1] || (t[1] = (m) => M.value = !0),
|
|
1062
|
+
onMouseout: t[2] || (t[2] = (m) => M.value = !1)
|
|
1095
1063
|
}, [
|
|
1096
|
-
|
|
1097
|
-
B(
|
|
1064
|
+
q("div", Dt, [
|
|
1065
|
+
B(mt, {
|
|
1098
1066
|
variety: n.variety,
|
|
1099
|
-
data:
|
|
1100
|
-
activeIndex:
|
|
1067
|
+
data: T.value,
|
|
1068
|
+
activeIndex: V.value
|
|
1101
1069
|
}, null, 8, ["variety", "data", "activeIndex"])
|
|
1102
1070
|
]),
|
|
1103
|
-
|
|
1071
|
+
q("div", {
|
|
1104
1072
|
class: "klineBasic-main",
|
|
1105
|
-
style:
|
|
1073
|
+
style: ve({ height: O.value.showSubChart ? "70%" : "100%" })
|
|
1106
1074
|
}, [
|
|
1107
|
-
B(
|
|
1108
|
-
popover:
|
|
1109
|
-
B(
|
|
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:
|
|
1116
|
-
(
|
|
1083
|
+
default: W(() => [
|
|
1084
|
+
(A(!0), R(ae, null, me(ge.value, (m) => (A(), Fe(y, {
|
|
1117
1085
|
style: { height: "36px" },
|
|
1118
|
-
key:
|
|
1119
|
-
index:
|
|
1120
|
-
onClick: (
|
|
1086
|
+
key: m.key,
|
|
1087
|
+
index: m.key,
|
|
1088
|
+
onClick: (E) => Oe(m)
|
|
1121
1089
|
}, {
|
|
1122
|
-
default:
|
|
1123
|
-
|
|
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:
|
|
1132
|
-
|
|
1099
|
+
default: W(() => [
|
|
1100
|
+
q("div", {
|
|
1133
1101
|
ref_key: "klineBasicMainRef",
|
|
1134
|
-
ref:
|
|
1102
|
+
ref: N,
|
|
1135
1103
|
style: { height: "100%" }
|
|
1136
1104
|
}, null, 512)
|
|
1137
1105
|
]),
|
|
1138
1106
|
_: 1
|
|
1139
1107
|
})
|
|
1140
1108
|
], 4),
|
|
1141
|
-
|
|
1142
|
-
B(
|
|
1109
|
+
O.value.showSubChart ? (A(), R("div", St, [
|
|
1110
|
+
B(wt, {
|
|
1143
1111
|
ref_key: "klineSubRef",
|
|
1144
|
-
ref:
|
|
1145
|
-
modelValue:
|
|
1146
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1147
|
-
data:
|
|
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:
|
|
1150
|
-
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
|
-
])) :
|
|
1153
|
-
|
|
1154
|
-
B(
|
|
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
|
-
])) :
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
B(
|
|
1163
|
-
default:
|
|
1164
|
-
|
|
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
|
-
])) :
|
|
1137
|
+
])) : ne("", !0)
|
|
1170
1138
|
], 32),
|
|
1171
|
-
B(
|
|
1172
|
-
modelValue:
|
|
1173
|
-
"onUpdate:modelValue": t[5] || (t[5] = (
|
|
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:
|
|
1179
|
-
|
|
1180
|
-
B(
|
|
1181
|
-
onClick: t[4] || (t[4] = (
|
|
1146
|
+
footer: W(() => [
|
|
1147
|
+
q("span", Vt, [
|
|
1148
|
+
B(o, {
|
|
1149
|
+
onClick: t[4] || (t[4] = (m) => ue.value = !1)
|
|
1182
1150
|
}, {
|
|
1183
|
-
default:
|
|
1184
|
-
|
|
1151
|
+
default: W(() => [
|
|
1152
|
+
fe("取消")
|
|
1185
1153
|
]),
|
|
1186
1154
|
_: 1
|
|
1187
1155
|
}),
|
|
1188
|
-
B(
|
|
1156
|
+
B(o, {
|
|
1189
1157
|
type: "primary",
|
|
1190
|
-
onClick:
|
|
1158
|
+
onClick: Pe
|
|
1191
1159
|
}, {
|
|
1192
|
-
default:
|
|
1193
|
-
|
|
1160
|
+
default: W(() => [
|
|
1161
|
+
fe("确定")
|
|
1194
1162
|
]),
|
|
1195
1163
|
_: 1
|
|
1196
1164
|
})
|
|
1197
1165
|
])
|
|
1198
1166
|
]),
|
|
1199
|
-
default:
|
|
1200
|
-
|
|
1167
|
+
default: W(() => [
|
|
1168
|
+
At,
|
|
1201
1169
|
B(u, {
|
|
1202
|
-
modelValue:
|
|
1203
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
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
|
-
},
|
|
1180
|
+
}, Rt = /* @__PURE__ */ G(Et, [["__scopeId", "data-v-8efc10f3"]]), yn = {
|
|
1213
1181
|
install(n) {
|
|
1214
|
-
n.component("st-klineBasic",
|
|
1182
|
+
n.component("st-klineBasic", Rt);
|
|
1215
1183
|
}
|
|
1216
1184
|
};
|
|
1217
1185
|
export {
|
|
1218
|
-
|
|
1186
|
+
yn as default
|
|
1219
1187
|
};
|