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