st-comp 0.0.246 → 0.0.248
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/ChartLayout.js +4 -4
- package/es/CustomFunction.js +42 -42
- package/es/FactorWarning.js +33 -33
- package/es/Kline.js +17 -17
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +520 -512
- package/es/KlineConfig.js +61 -61
- package/es/KlineNew.js +16 -16
- package/es/KlinePlus.cjs +4 -4
- package/es/KlinePlus.js +589 -575
- package/es/LinearLegend.cjs +1 -1
- package/es/LinearLegend.js +1 -63
- package/es/MonacoEditor.js +24 -24
- package/es/Pagination.js +73 -73
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.js +38 -38
- package/es/User.js +44 -44
- package/es/VarSelectDialog.js +25 -25
- package/es/VarietyAutoComplete.js +10 -10
- package/es/VarietySearch.js +38 -38
- package/es/{VarietySelect-5a9dd50b.js → VarietySelect-b9fe3000.js} +4 -4
- package/es/VarietyTextCopy.cjs +3 -3
- package/es/VarietyTextCopy.js +15 -15
- package/es/VirtualTable.js +14 -14
- package/es/{_initCloneObject-c34c65bc.js → _initCloneObject-382335b2.js} +7 -7
- package/es/{base-a5af3db3.js → base-ff0e366f.js} +40 -40
- package/es/{castArray-7741a212.js → castArray-15070be9.js} +1 -1
- package/es/{config-provider-06a63185.js → config-provider-2e85eee8.js} +6 -6
- package/es/{debounce-8d53f4dd.js → debounce-e9e47f9a.js} +1 -1
- package/es/{dropdown-302f71e7.js → dropdown-2b35a683.js} +13 -13
- package/es/{el-autocomplete-ed75a659.js → el-autocomplete-18be2c5a.js} +16 -16
- package/es/{el-button-d09ff85f.js → el-button-f08c0639.js} +39 -39
- package/es/{el-checkbox-64648e02.js → el-checkbox-058dba2d.js} +31 -31
- package/es/{el-dialog-6a80e3d8.js → el-dialog-d328e0d8.js} +15 -15
- package/es/{el-divider-4e059794.js → el-divider-4fe55ebe.js} +1 -1
- package/es/{el-empty-33cb66f1.js → el-empty-ceecb81c.js} +5 -5
- package/es/{el-form-item-4eca95be.js → el-form-item-cb328886.js} +36 -36
- package/es/{el-input-cae60510.js → el-input-0f6ead19.js} +50 -50
- package/es/{el-input-number-c2499410.js → el-input-number-66e68609.js} +36 -36
- package/es/{el-loading-c738468d.js → el-loading-412370c7.js} +5 -5
- package/es/{el-menu-item-f904f685.js → el-menu-item-0ee8ad18.js} +22 -22
- package/es/{el-message-box-05d8cf39.js → el-message-box-6db52b29.js} +11 -11
- package/es/{el-message-0df23ae7.js → el-message-e6c755df.js} +23 -23
- package/es/{el-overlay-cc9bc792.js → el-overlay-981f8d49.js} +56 -56
- package/es/{el-popconfirm-a6f66a0e.js → el-popconfirm-005013fa.js} +20 -20
- package/es/{el-popper-a38874f4.js → el-popper-fdc7c793.js} +109 -109
- package/es/{el-segmented-51b1c797.js → el-segmented-050d0090.js} +8 -8
- package/es/{el-select-1b149fab.js → el-select-23a1f302.js} +64 -64
- package/es/{el-table-column-3e30ebae.js → el-table-column-d0c374cf.js} +15 -15
- package/es/{el-tag-0a25efdf.js → el-tag-f13f463b.js} +15 -15
- package/es/{el-text-73d899ff.js → el-text-27cef2be.js} +2 -2
- package/es/{index-42e59bf5.js → index-09bd2621.js} +43 -43
- package/es/{index-94e43e0d.js → index-15b9603e.js} +3 -3
- package/es/{index-960806da.js → index-269b8a8c.js} +36 -36
- package/es/{index-54d289d1.js → index-4a3f30c5.js} +12 -12
- package/es/{index-6e967429.js → index-80a7ad32.js} +17 -17
- package/es/{index-d77a7336.js → index-93a8960e.js} +1 -1
- package/es/{index-4194c942.js → index-b937ea22.js} +2 -2
- package/es/{index-ac98a4d8.js → index-c266c23a.js} +10 -10
- package/es/{index-6806997d.js → index-e0901394.js} +34 -34
- package/es/{index-87b4bf61.js → index-ec7ad93f.js} +31 -31
- package/es/{python-a914569a.js → python-823b276b.js} +24 -24
- package/es/raf-8e05a7f4.js +6 -0
- package/es/{scroll-679bd6bf.js → scroll-41b4f625.js} +5 -5
- package/es/style.css +1 -1
- package/es/{use-form-common-props-47e50c10.js → use-form-common-props-631cacae.js} +65 -65
- package/es/{use-global-config-f52caea0.js → use-global-config-5d001623.js} +14 -14
- package/es/{validator-94c04152.js → validator-4160d9e7.js} +1 -1
- package/es/{vnode-5ddb7ed1.js → vnode-06571d5b.js} +1 -1
- package/es/{zh-cn-4921961d.js → zh-cn-5df98ac2.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +162 -162
- package/lib/{index-2a325d42.js → index-f00d1e1f.js} +13173 -13151
- package/lib/{python-eb65d93b.js → python-0f34e2e6.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 +39 -41
- package/packages/KlinePlus/index.vue +88 -62
- package/src/App.vue +15 -4
- package/src/pages/KlineBasic/index.vue +7 -7
- package/src/pages/KlineNew/components/KlineAction/mockApi/index.js +1 -1
- package/src/pages/KlineNew/components/KlineBasic/utils.js +1 -1
- package/src/pages/KlineNew/components/KlineSlide/utils.js +1 -1
- package/src/pages/KlinePlus/KlineDialog/MultiCycle.vue +312 -0
- package/src/pages/KlinePlus/KlineDialog/api.js +108 -0
- package/src/pages/KlinePlus/KlineDialog/index.vue +582 -0
- package/src/pages/KlinePlus/KlineDialog/indicator.js +109 -0
- package/src/pages/KlinePlus/KlineDialog/tools.js +86 -0
- package/src/pages/KlinePlus/index.vue +23 -209
- package/es/raf-80ef0c0a.js +0 -6
package/es/ChartLayout.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./base-
|
|
2
|
-
import { E as d } from "./el-empty-
|
|
1
|
+
import "./base-ff0e366f.js";
|
|
2
|
+
import { E as d } from "./el-empty-ceecb81c.js";
|
|
3
3
|
import { openBlock as e, createElementBlock as a, normalizeStyle as n, Fragment as o, renderList as u, renderSlot as m, createBlock as s } from "vue";
|
|
4
4
|
import { _ as y } from "./_plugin-vue_export-helper-dad06003.js";
|
|
5
|
-
import "./index-
|
|
6
|
-
import "./index-
|
|
5
|
+
import "./index-269b8a8c.js";
|
|
6
|
+
import "./index-93a8960e.js";
|
|
7
7
|
const f = {
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
package/es/CustomFunction.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import "./base-
|
|
2
|
-
import { E as te } from "./el-button-
|
|
3
|
-
import "./el-tag-
|
|
4
|
-
import { E as _e, a as ve } from "./el-select-
|
|
1
|
+
import "./base-ff0e366f.js";
|
|
2
|
+
import { E as te } from "./el-button-f08c0639.js";
|
|
3
|
+
import "./el-tag-f13f463b.js";
|
|
4
|
+
import { E as _e, a as ve } from "./el-select-23a1f302.js";
|
|
5
5
|
import "./el-scrollbar-323542e7.js";
|
|
6
|
-
import "./el-popper-
|
|
7
|
-
import { E as oe } from "./el-popconfirm-
|
|
6
|
+
import "./el-popper-fdc7c793.js";
|
|
7
|
+
import { E as oe } from "./el-popconfirm-005013fa.js";
|
|
8
8
|
import "./el-popover-4ed993c7.js";
|
|
9
|
-
import { inject as ne, ref as v, reactive as P, computed as ge, watch as he, nextTick as X, resolveComponent as Y, openBlock as D, createBlock as G, withCtx as s, createElementVNode as a, normalizeClass as
|
|
10
|
-
import {
|
|
11
|
-
import { E as Ve } from "./el-dialog-
|
|
12
|
-
import "./el-overlay-
|
|
13
|
-
import { E as we } from "./el-divider-
|
|
14
|
-
import { E as Ne } from "./el-empty-
|
|
15
|
-
import { E as ee } from "./el-input-
|
|
9
|
+
import { inject as ne, ref as v, reactive as P, computed as ge, watch as he, nextTick as X, resolveComponent as Y, openBlock as D, createBlock as G, withCtx as s, createElementVNode as a, normalizeClass as j, createVNode as t, unref as b, createTextVNode as S, createElementBlock as L, Fragment as le, renderList as se, toDisplayString as U, withModifiers as T, pushScopeId as ye, popScopeId as Ee, h as M, onMounted as xe, normalizeStyle as be } from "vue";
|
|
10
|
+
import { a as Z, f as ae, g as ie, h as Ce, E as ce, j as ke } from "./index-ec7ad93f.js";
|
|
11
|
+
import { E as Ve } from "./el-dialog-d328e0d8.js";
|
|
12
|
+
import "./el-overlay-981f8d49.js";
|
|
13
|
+
import { E as we } from "./el-divider-4fe55ebe.js";
|
|
14
|
+
import { E as Ne } from "./el-empty-ceecb81c.js";
|
|
15
|
+
import { E as ee } from "./el-input-0f6ead19.js";
|
|
16
16
|
import { G as $e } from "./index-7ed0999e.js";
|
|
17
|
-
import { E as $ } from "./el-message-
|
|
18
|
-
import { E as Se } from "./el-message-box-
|
|
19
|
-
import {
|
|
17
|
+
import { E as $ } from "./el-message-e6c755df.js";
|
|
18
|
+
import { E as Se } from "./el-message-box-6db52b29.js";
|
|
19
|
+
import { a as De, E as Fe } from "./el-form-item-cb328886.js";
|
|
20
20
|
import { _ as ue } from "./_plugin-vue_export-helper-dad06003.js";
|
|
21
|
-
import { E as ze } from "./index-
|
|
21
|
+
import { E as ze } from "./index-e0901394.js";
|
|
22
22
|
import "./index-2e331d74.js";
|
|
23
|
-
import "./use-global-config-
|
|
24
|
-
import "./use-form-common-props-
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-
|
|
27
|
-
import "./index-
|
|
23
|
+
import "./use-global-config-5d001623.js";
|
|
24
|
+
import "./use-form-common-props-631cacae.js";
|
|
25
|
+
import "./index-269b8a8c.js";
|
|
26
|
+
import "./index-93a8960e.js";
|
|
27
|
+
import "./index-09bd2621.js";
|
|
28
28
|
import "./index-657047bb.js";
|
|
29
|
-
import "./index-
|
|
30
|
-
import "./castArray-
|
|
31
|
-
import "./index-
|
|
32
|
-
import "./scroll-
|
|
33
|
-
import "./debounce-
|
|
34
|
-
import "./vnode-
|
|
29
|
+
import "./index-15b9603e.js";
|
|
30
|
+
import "./castArray-15070be9.js";
|
|
31
|
+
import "./index-4a3f30c5.js";
|
|
32
|
+
import "./scroll-41b4f625.js";
|
|
33
|
+
import "./debounce-e9e47f9a.js";
|
|
34
|
+
import "./vnode-06571d5b.js";
|
|
35
35
|
import "./typescript-7ae59c4c.js";
|
|
36
|
-
import "./config-provider-
|
|
37
|
-
import "./validator-
|
|
38
|
-
import "./_initCloneObject-
|
|
39
|
-
const K = (f) => (ye("data-v-b5dcb4b8"), f = f(), Ee(), f), Ie = { class: "custom-header" }, Me = { class: "left" }, Oe = ["id"], Be = { class: "right" }, qe = { class: "manage-dialog-body" }, Re = { class: "func-list" },
|
|
36
|
+
import "./config-provider-2e85eee8.js";
|
|
37
|
+
import "./validator-4160d9e7.js";
|
|
38
|
+
import "./_initCloneObject-382335b2.js";
|
|
39
|
+
const K = (f) => (ye("data-v-b5dcb4b8"), f = f(), Ee(), f), Ie = { class: "custom-header" }, Me = { class: "left" }, Oe = ["id"], Be = { class: "right" }, qe = { class: "manage-dialog-body" }, Re = { class: "func-list" }, je = { class: "search" }, Ue = /* @__PURE__ */ K(() => /* @__PURE__ */ a("span", null, "输入函数关键字", -1)), Te = ["onClick"], Le = { class: "icon-box" }, We = { class: "rule-form" }, Ae = { class: "header" }, Pe = /* @__PURE__ */ K(() => /* @__PURE__ */ a("span", null, "函数名称:", -1)), Ge = { class: "right" }, Ke = /* @__PURE__ */ K(() => /* @__PURE__ */ a("div", { class: "tip-box" }, "说明: 公式里可以使用变量, 变量名命名格式: ${变量名}, 后续可在应用函数时填写具体值, 系统会自动换算", -1)), He = { class: "custom-header" }, Je = { class: "left" }, Qe = ["id"], Xe = { class: "right" }, Ye = { class: "content" }, Ze = { class: "dialog-footer" }, et = {
|
|
40
40
|
__name: "ManageDialog",
|
|
41
41
|
props: {
|
|
42
42
|
data: {
|
|
@@ -227,7 +227,7 @@ const K = (f) => (ye("data-v-b5dcb4b8"), f = f(), Ee(), f), Ie = { class: "custo
|
|
|
227
227
|
a("div", Me, [
|
|
228
228
|
a("span", {
|
|
229
229
|
id: u,
|
|
230
|
-
class:
|
|
230
|
+
class: j(F)
|
|
231
231
|
}, " 自定义函数管理面板 ", 10, Oe)
|
|
232
232
|
]),
|
|
233
233
|
a("div", Be, [
|
|
@@ -245,8 +245,8 @@ const K = (f) => (ye("data-v-b5dcb4b8"), f = f(), Ee(), f), Ie = { class: "custo
|
|
|
245
245
|
default: s(() => [
|
|
246
246
|
a("div", qe, [
|
|
247
247
|
a("div", Re, [
|
|
248
|
-
a("div",
|
|
249
|
-
|
|
248
|
+
a("div", je, [
|
|
249
|
+
Ue,
|
|
250
250
|
t(r, {
|
|
251
251
|
modelValue: w.value,
|
|
252
252
|
"onUpdate:modelValue": e[1] || (e[1] = (u) => w.value = u),
|
|
@@ -266,12 +266,12 @@ const K = (f) => (ye("data-v-b5dcb4b8"), f = f(), Ee(), f), Ie = { class: "custo
|
|
|
266
266
|
default: s(() => [
|
|
267
267
|
x.value.length ? (D(!0), L(le, { key: 0 }, se(x.value, (u) => (D(), L("div", {
|
|
268
268
|
key: u.id,
|
|
269
|
-
class:
|
|
269
|
+
class: j([{ "active-list-item": l.id === u.id }, "list-item"])
|
|
270
270
|
}, [
|
|
271
271
|
a("span", {
|
|
272
272
|
class: "func-name",
|
|
273
273
|
onClick: (F) => I(u)
|
|
274
|
-
},
|
|
274
|
+
}, U(u.funcName), 9, Te),
|
|
275
275
|
a("div", Le, [
|
|
276
276
|
t(c, null, {
|
|
277
277
|
default: s(() => [
|
|
@@ -387,7 +387,7 @@ const K = (f) => (ye("data-v-b5dcb4b8"), f = f(), Ee(), f), Ie = { class: "custo
|
|
|
387
387
|
a("div", Je, [
|
|
388
388
|
a("span", {
|
|
389
389
|
id: u,
|
|
390
|
-
class:
|
|
390
|
+
class: j(F)
|
|
391
391
|
}, " 日志明细 ", 10, Qe)
|
|
392
392
|
]),
|
|
393
393
|
a("div", Xe, [
|
|
@@ -421,7 +421,7 @@ const K = (f) => (ye("data-v-b5dcb4b8"), f = f(), Ee(), f), Ie = { class: "custo
|
|
|
421
421
|
height: "600px"
|
|
422
422
|
}, {
|
|
423
423
|
default: s(() => [
|
|
424
|
-
a("pre", null,
|
|
424
|
+
a("pre", null, U(n.code), 1)
|
|
425
425
|
]),
|
|
426
426
|
_: 1
|
|
427
427
|
}),
|
|
@@ -429,8 +429,8 @@ const K = (f) => (ye("data-v-b5dcb4b8"), f = f(), Ee(), f), Ie = { class: "custo
|
|
|
429
429
|
t(_, { height: "600px" }, {
|
|
430
430
|
default: s(() => [
|
|
431
431
|
a("pre", {
|
|
432
|
-
class:
|
|
433
|
-
},
|
|
432
|
+
class: j(n.result === 1 ? "success-log" : "error-log")
|
|
433
|
+
}, U(n.result === 1 ? `✅️ 测试通过
|
|
434
434
|
${n.detail}` : n.detail), 3)
|
|
435
435
|
]),
|
|
436
436
|
_: 1
|
|
@@ -525,7 +525,7 @@ const ot = { class: "custom-function" }, nt = { class: "func-option" }, lt = { c
|
|
|
525
525
|
}, {
|
|
526
526
|
default: s(() => [
|
|
527
527
|
a("div", nt, [
|
|
528
|
-
a("span", null,
|
|
528
|
+
a("span", null, U(p.funcName), 1),
|
|
529
529
|
a("div", lt, [
|
|
530
530
|
t(i, {
|
|
531
531
|
onClick: T((q) => x("copy", p), ["stop"])
|
package/es/FactorWarning.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import "./base-
|
|
2
|
-
import { z as re, E as ne } from "./zh-cn-
|
|
3
|
-
import { E as ue } from "./el-dialog-
|
|
4
|
-
import "./el-overlay-
|
|
5
|
-
import "./el-tag-
|
|
1
|
+
import "./base-ff0e366f.js";
|
|
2
|
+
import { z as re, E as ne } from "./zh-cn-5df98ac2.js";
|
|
3
|
+
import { E as ue } from "./el-dialog-d328e0d8.js";
|
|
4
|
+
import "./el-overlay-981f8d49.js";
|
|
5
|
+
import "./el-tag-f13f463b.js";
|
|
6
6
|
import "./el-tooltip-4ed993c7.js";
|
|
7
|
-
import { E as se } from "./el-popper-
|
|
8
|
-
import { E as ie, a as ce } from "./el-table-column-
|
|
9
|
-
import { E as de, a as me } from "./el-checkbox-
|
|
7
|
+
import { E as se } from "./el-popper-fdc7c793.js";
|
|
8
|
+
import { E as ie, a as ce } from "./el-table-column-d0c374cf.js";
|
|
9
|
+
import { E as de, a as me } from "./el-checkbox-058dba2d.js";
|
|
10
10
|
import "./el-scrollbar-323542e7.js";
|
|
11
|
-
import { E as fe } from "./el-popconfirm-
|
|
11
|
+
import { E as fe } from "./el-popconfirm-005013fa.js";
|
|
12
12
|
import "./el-popover-4ed993c7.js";
|
|
13
|
-
import { E as pe } from "./el-button-
|
|
14
|
-
import {
|
|
15
|
-
import { E as _e } from "./el-input-
|
|
16
|
-
import { E as be } from "./el-text-
|
|
17
|
-
import { E as he } from "./el-input-number-
|
|
13
|
+
import { E as pe } from "./el-button-f08c0639.js";
|
|
14
|
+
import { E as ye, a as ve } from "./el-form-item-cb328886.js";
|
|
15
|
+
import { E as _e } from "./el-input-0f6ead19.js";
|
|
16
|
+
import { E as be } from "./el-text-27cef2be.js";
|
|
17
|
+
import { E as he } from "./el-input-number-66e68609.js";
|
|
18
18
|
import "./el-checkbox-group-4ed993c7.js";
|
|
19
|
-
import { E as ge } from "./el-segmented-
|
|
19
|
+
import { E as ge } from "./el-segmented-050d0090.js";
|
|
20
20
|
import { mergeModels as R, ref as x, useModel as ke, watch as Ce, openBlock as o, createElementBlock as d, createVNode as a, unref as k, withCtx as l, createElementVNode as f, normalizeClass as Te, toDisplayString as C, createTextVNode as m, createBlock as p, createCommentVNode as y, Fragment as S, renderList as N, pushScopeId as we, popScopeId as xe } from "vue";
|
|
21
|
-
import { i as j, E as Se } from "./index-
|
|
21
|
+
import { i as j, E as Se } from "./index-ec7ad93f.js";
|
|
22
22
|
import { G as Ee } from "./index-7ed0999e.js";
|
|
23
23
|
import { _ as Ve } from "./_plugin-vue_export-helper-dad06003.js";
|
|
24
|
-
import { E as Ne } from "./el-message-box-
|
|
25
|
-
import { E as Fe } from "./index-
|
|
26
|
-
import "./config-provider-
|
|
27
|
-
import "./use-global-config-
|
|
28
|
-
import "./use-form-common-props-
|
|
29
|
-
import "./index-
|
|
30
|
-
import "./index-
|
|
31
|
-
import "./index-
|
|
24
|
+
import { E as Ne } from "./el-message-box-6db52b29.js";
|
|
25
|
+
import { E as Fe } from "./index-15b9603e.js";
|
|
26
|
+
import "./config-provider-2e85eee8.js";
|
|
27
|
+
import "./use-global-config-5d001623.js";
|
|
28
|
+
import "./use-form-common-props-631cacae.js";
|
|
29
|
+
import "./index-269b8a8c.js";
|
|
30
|
+
import "./index-93a8960e.js";
|
|
31
|
+
import "./index-09bd2621.js";
|
|
32
32
|
import "./index-2e331d74.js";
|
|
33
|
-
import "./vnode-
|
|
34
|
-
import "./scroll-
|
|
35
|
-
import "./index-
|
|
36
|
-
import "./_initCloneObject-
|
|
37
|
-
import "./castArray-
|
|
38
|
-
import "./debounce-
|
|
39
|
-
import "./raf-
|
|
33
|
+
import "./vnode-06571d5b.js";
|
|
34
|
+
import "./scroll-41b4f625.js";
|
|
35
|
+
import "./index-e0901394.js";
|
|
36
|
+
import "./_initCloneObject-382335b2.js";
|
|
37
|
+
import "./castArray-15070be9.js";
|
|
38
|
+
import "./debounce-e9e47f9a.js";
|
|
39
|
+
import "./raf-8e05a7f4.js";
|
|
40
40
|
import "./index-657047bb.js";
|
|
41
41
|
import "./typescript-7ae59c4c.js";
|
|
42
|
-
import "./index-
|
|
43
|
-
import "./validator-
|
|
42
|
+
import "./index-4a3f30c5.js";
|
|
43
|
+
import "./validator-4160d9e7.js";
|
|
44
44
|
const Le = {
|
|
45
45
|
// 表单字段
|
|
46
46
|
ruleFormPrice: !0,
|
package/es/Kline.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import "./base-
|
|
2
|
-
import { E as he, a as Ce } from "./el-menu-item-
|
|
1
|
+
import "./base-ff0e366f.js";
|
|
2
|
+
import { E as he, a as Ce } from "./el-menu-item-0ee8ad18.js";
|
|
3
3
|
import "./el-tooltip-4ed993c7.js";
|
|
4
|
-
import "./el-popper-
|
|
4
|
+
import "./el-popper-fdc7c793.js";
|
|
5
5
|
import { defineComponent as Me, openBlock as h, createElementBlock as k, createElementVNode as K, Fragment as ae, renderList as le, normalizeStyle as ye, toDisplayString as q, ref as S, renderSlot as De, createCommentVNode as xe, nextTick as Ye, computed as W, watch as H, onMounted as de, onUnmounted as ge, createVNode as V, withCtx as X, createBlock as Ae, createTextVNode as Oe, normalizeClass as ke } from "vue";
|
|
6
6
|
import * as oe from "echarts";
|
|
7
7
|
import { _ as $ } from "./_plugin-vue_export-helper-dad06003.js";
|
|
8
8
|
import { x as re } from "./index-7ed0999e.js";
|
|
9
9
|
import { i as ve, t as be } from "./index.esm-8d9a2abe.js";
|
|
10
|
-
import "./el-tag-
|
|
11
|
-
import { E as Ee, a as Se } from "./el-select-
|
|
10
|
+
import "./el-tag-f13f463b.js";
|
|
11
|
+
import { E as Ee, a as Se } from "./el-select-23a1f302.js";
|
|
12
12
|
import "./el-scrollbar-323542e7.js";
|
|
13
|
-
import "./use-form-common-props-
|
|
14
|
-
import "./index-
|
|
15
|
-
import "./index-
|
|
13
|
+
import "./use-form-common-props-631cacae.js";
|
|
14
|
+
import "./index-269b8a8c.js";
|
|
15
|
+
import "./index-ec7ad93f.js";
|
|
16
16
|
import "./index-657047bb.js";
|
|
17
17
|
import "./typescript-7ae59c4c.js";
|
|
18
|
-
import "./vnode-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import "./index-
|
|
23
|
-
import "./castArray-
|
|
24
|
-
import "./index-
|
|
25
|
-
import "./scroll-
|
|
26
|
-
import "./debounce-
|
|
18
|
+
import "./vnode-06571d5b.js";
|
|
19
|
+
import "./index-09bd2621.js";
|
|
20
|
+
import "./index-93a8960e.js";
|
|
21
|
+
import "./index-e0901394.js";
|
|
22
|
+
import "./index-15b9603e.js";
|
|
23
|
+
import "./castArray-15070be9.js";
|
|
24
|
+
import "./index-4a3f30c5.js";
|
|
25
|
+
import "./scroll-41b4f625.js";
|
|
26
|
+
import "./debounce-e9e47f9a.js";
|
|
27
27
|
const Fe = { class: "st-kline-tips" }, Qe = { class: "st-kline-tips-row" }, _e = /* @__PURE__ */ Me({
|
|
28
28
|
__name: "index",
|
|
29
29
|
props: {
|
package/es/KlineBasic.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./base-ef747d02.cjs");const Ye=require("./el-dialog-ad7309e9.cjs");require("./el-overlay-d7a6e4a9.cjs");require("./el-input-172c49f8.cjs");const Se=require("./el-input-number-c2e71528.cjs"),De=require("./el-button-68baab7b.cjs"),Ve=require("./el-empty-1697ded8.cjs"),ce=require("./el-menu-item-7f986598.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-7ba87e05.cjs");const e=require("vue"),V=require("./dayjs.min-2c20abe6.cjs"),Me=require("echarts"),N=require("./index-8901a38c.cjs"),te=require("./el-message-a86c0efa.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-789f05d3.cjs");const ue=require("./el-select-12f6deb7.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./index-cebc7160.cjs");require("./use-form-common-props-344056f9.cjs");require("./index-9780a537.cjs");require("./index-bb833443.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-cf78ebac.cjs");require("./index-4f48940d.cjs");require("./typescript-b63f8e83.cjs");require("./index-c04f444f.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-2182708a.cjs");require("./index-8de94a49.cjs");require("./index-696b6a94.cjs");require("./castArray-35947698.cjs");require("./debounce-62f5b6e8.cjs");function Le(n){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const _ in n)if(_!=="default"){const l=Object.getOwnPropertyDescriptor(n,_);Object.defineProperty(k,_,l.get?l:{enumerable:!0,get:()=>n[_]})}}return k.default=n,Object.freeze(k)}const le=Le(Me);let C=null;const Fe=n=>{const k=N.y(n,{handleReq:_=>{N.v()&&(_.headers.token=N.U())},handleRes:_=>{const{data:l}=_;if(l.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:N.K(),!0}});k.get,C=k.post},Be=n=>C("/middleLayer/kline/getKlineBasic",{...n,userId:N.V("id")}),Te=n=>C("/middleLayer/kline/getKline",n),Ne=async n=>C("/alarm/deliversign/addAlarmPrice",{...n,userId:N.V("id")}),Ee=async n=>C("/alarm/deliversign/findAlarmPriceByUserId",{...n,userId:N.V("id")}),fe=async n=>C("/alarm/deliversign/updateAlarmPrice",{...n,userId:N.V("id")}),qe=async n=>C("/alarm/deliversign/deleteAlarmPrice",{...n,userId:N.V("id")}),{round:W}=N.x,Ae=(n,k,_,l,p)=>{const{data:t,time:h}=n,{gridTop:c,gridRight:b,gridLeft:m,maxShowCounts:g,showSubChart:S}=k;return{animation:!1,grid:{top:`${c}px`,right:`${b}px`,bottom:S?"6px":"24px",left:`${m}px`},dataZoom:[{type:"inside",startValue:_,endValue:l,maxValueSpan:g}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:r=>{const{axisDimension:w,value:i}=r;return w==="x"?S?"":["6","7","8"].includes(p)?V.dayjs(i).format("YYYY-MM-DD"):i:String(W(i))}}},formatter:()=>""},xAxis:{show:!S,type:"category",data:h,splitLine:{show:!1},axisLabel:{formatter:r=>["6","7","8"].includes(p)?V.dayjs(r).format("YYYY-MM-DD"):r}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:r=>W(r.min),max:r=>W(r.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...n.mainIndicator.map(r=>({name:r.key,type:"line",silent:!0,symbol:"none",data:r.data,lineStyle:{width:r.width||1},itemStyle:{color:r.color}}))],toolbox:{show:!1},brush:{xAxisIndex:"all",brushLink:"all",transformable:!1,outOfBrush:{colorAlpha:2},brushStyle:{color:"rgba(255,255,255,0.1)",borderColor:"rgba(255,255,255,0.4)"}}}},Re=(n,k,_,l,p)=>{const{variety:t,featureId:h,featureType:c}=_,{gridTop:b,gridLeft:m,gridRight:g}=l;return k.reduce((S,r)=>{const{warnPrice:w}=r,i=n==null?void 0:n.convertToPixel({yAxisIndex:0},w);if(i<=b||i>=(n==null?void 0:n.getHeight()))return S;let M=0;return[...S,{type:"group",name:"warningLine",info:r,draggable:"vertical",children:[{type:"line",info:r,shape:{x1:m,y1:i,x2:(n==null?void 0:n.getWidth())-g,y2:i},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:r,x:(n==null?void 0:n.getWidth())-g,y:i-5,style:{fill:"#FFF",text:w,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:D=>{M=D.offsetY},ondrag:D=>{var q;if(D.target&&D.target.childAt(1)){const A=n.convertFromPixel({yAxisIndex:0},i+(D.offsetY-M));(q=D.target.childAt(1))==null||q.animate("style",!1).when(1,{text:W(A,3)}).start()}},ondragend:async D=>{const A=D.offsetY-M;if(A!==0){const j=n==null?void 0:n.convertFromPixel({yAxisIndex:0},A+i),v={id:r.id,warnPrice:W(j,3),featureId:h,featureCode:t,featureType:c};await fe(v),te.ElMessage.success("画线预警修改成功"),p&&p()}}}]},[])};function pe(n){function k(l){if(typeof l=="number")return Number.isFinite(l)?l:null;if(typeof l=="string"){const p=l.trim();if(p==="")return null;const t=Number(p);return Number.isFinite(t)?t:null}return null}const _=k(n);if(_===null)return"-";try{if(_>=1||_<=-1)return W(_);{const l=_.toPrecision(3);return W(l,l.split(".")[1].length-1)}}catch{return"-"}}const Oe=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){const k=n,_=e.ref(null),l=e.ref([]);return e.watch(()=>k.data,()=>{l.value.length===0&&e.nextTick(()=>{Array.from(_.value.children).forEach((p,t)=>{var h,c,b,m,g,S,r,w;((c=(h=k.data)==null?void 0:h[t])==null?void 0:c.label)==="涨跌"?l.value[t]="85px":((m=(b=k.data)==null?void 0:b[t])==null?void 0:m.label)==="至今涨幅"?l.value[t]="115px":((S=(g=k.data)==null?void 0:g[t])==null?void 0:S.label)==="额"?l.value[t]="85px":["开","高","低","收"].includes((w=(r=k.data)==null?void 0:r[t])==null?void 0:w.label)?l.value[t]=`${p.offsetWidth+24}px`:l.value[t]=`${p.offsetWidth+36}px`})})}),(p,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:_},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(h,c)=>(e.openBlock(),e.createElementBlock("div",{key:c,class:"kline-tips-item",style:e.normalizeStyle({color:h.color,width:l.value[c]?l.value[c]:null})},e.toDisplayString(h.label)+" "+e.toDisplayString(h.value),5))),128))],512))}});const de=U._export_sfc(Oe,[["__scopeId","data-v-096c0d10"]]);const Ie={class:"kline-tips"},je={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(n){const{round:k,formatValue:_}=N.x,l=n,p=e.ref(null);e.watch(()=>l.activeIndex,()=>{p.value===null&&(p.value=l.data.data[l.activeIndex][1])}),e.watch(()=>l.data,()=>{p.value===null&&(p.value=l.data.data[l.activeIndex][1])}),e.watch(()=>l.variety,()=>{p.value=null});const t=e.computed(()=>{const{data:c,activeIndex:b}=l;if(c.data&&c.data[b]){const m=c.data[b],g=[{label:"开",value:m[0]},{label:"高",value:m[3]},{label:"低",value:m[2]},{label:"收",value:m[1]}];m[4]!==null&&g.push({label:"额",value:_(m[4])});let S;m[6]>0?S="red":m[6]<0&&(S="green"),g.push({label:"涨跌",value:`${k(m[6])}%`,color:S});const r=(p.value/m[1]-1)*100;let w;return r>0?w="red":r<0&&(w="green"),g.push({label:"至今涨幅",value:`${k(r)}%`,color:w}),g}return[]}),h=e.computed(()=>{var m;const{data:c,activeIndex:b}=l;return((m=c==null?void 0:c.mainIndicator)==null?void 0:m.map(g=>({label:g.key,value:pe(g.data[b]),color:g.color})))||[]});return(c,b)=>(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(de,{data:t.value},null,8,["data"]),e.createVNode(de,{data:h.value},null,8,["data"])]))}},$e=U._export_sfc(je,[["__scopeId","data-v-5be4d504"]]),Pe={class:"kline-averageTips"},We=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){return(k,_)=>(e.openBlock(),e.createElementBlock("div",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(l,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:"kline-averageTips-item",style:e.normalizeStyle({color:l.color})},e.toDisplayString(l.label)+" "+e.toDisplayString(l.value),5))),128))]))}});const Ce=U._export_sfc(We,[["__scopeId","data-v-2ce54548"]]);const ze={class:"klineSub"},Ze={class:"klineSub-tips"},Ue={key:0,class:"klineSub-tips-select"},He={__name:"index",props:{cycle:{type:[String,Number],default:()=>null},data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{expose:k,emit:_}){const{round:l}=N.x;let p,t;const h=_,c=n,b=e.ref(),m=e.computed({get(){return c.modelValue},set(r){h("update:modelValue",r)}}),g=e.computed(()=>{var i;const{data:r,activeIndex:w}=c;return((i=r==null?void 0:r.subIndicator)==null?void 0:i.map(M=>({label:M.key,color:M.color,value:pe(M.data[w])})))||[]});e.onMounted(()=>{p=le.init(b.value);let r=!0;t=new ResizeObserver(()=>{if(r){r=null;return}p.resize()}),t.observe(b.value)}),e.onUnmounted(()=>{p.dispose(),t.disconnect(),t=null});const S=(r,w)=>{const i=r[w],M=w===0?r[w]:r[w-1];return i[0]===i[1]?i[0]>=M[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:i[1]>i[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return k({connect:r=>{le.connect([r,p])},draw:(r,w)=>{e.nextTick(()=>{const{startValue:i,endValue:M,maxValueSpan:D}=r,{leftYAxisRange:q,rightYAxisRange:A}=c.data.subIndicator[0],j=c.data.subIndicator.map(v=>{if(v.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:v.data.map((B,F)=>v.seriesColor==="kline"?{value:B,itemStyle:S(c.data.data,F)}:v.seriesColor==="value"?{value:B,itemStyle:{color:B>=0?"#FF0000":"#00FFFF"}}:{value:B,itemStyle:{color:v.seriesColor}})};if(v.series==="line")return{xAxisIndex:0,yAxisIndex:v.yAxis==="right"?2:1,name:v.key,type:"line",silent:!0,symbol:"none",data:v.data,lineStyle:{width:1},itemStyle:{color:v.color}}});p.setOption({animation:!1,grid:{left:`${w.gridLeft}px`,top:"10px",right:`${w.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:i,endValue:M,maxValueSpan:D}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:v=>{const{axisDimension:B,value:F}=v;if(B==="x")return["6","7","8"].includes(c.cycle)?V.dayjs(F).format("YYYY-MM-DD"):F;if(v.axisIndex===1)return String(l(F))}}},formatter:()=>""},xAxis:{type:"category",data:c.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:v=>["6","7","8"].includes(c.cycle)?V.dayjs(v).format("YYYY-MM-DD"):v}},yAxis:[{position:"right"},{position:"left",min:q==="cover"?v=>v.min:null,max:q==="cover"?v=>v.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:A==="cover"?v=>v.min:null,max:A==="cover"?v=>v.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:j},!0)})}}),(r,w)=>{const i=ue.ElOption,M=ue.ElSelect;return e.openBlock(),e.createElementBlock("div",ze,[e.createElementVNode("div",Ze,[g.value.length?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(M,{modelValue:m.value,"onUpdate:modelValue":w[0]||(w[0]=D=>m.value=D),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.subIndicatorList,D=>(e.openBlock(),e.createBlock(i,{key:D.value,label:D.label,value:D.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(Ce,{data:g.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:b},null,512)])}}},Ke=U._export_sfc(He,[["__scopeId","data-v-a6bfe8fe"]]),Xe=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(n,{emit:k}){const _=k,l=e.ref(),p=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),h=()=>{t.value.display="none",_("closeContextMenuCallBack"),document.removeEventListener("click",h)},c=b=>{if(b.preventDefault(),t.value.display==="block"){const{offsetX:m,offsetY:g}=b,{offsetWidth:S,offsetHeight:r}=p.value;if(m<=S&&g<=r)return}l.value.click(),t.value={display:"block",top:`${b.offsetY}px`,left:`${b.offsetX}px`},e.nextTick(()=>{const m=l.value.getBoundingClientRect(),g=p.value.getBoundingClientRect();g.left+g.width>=m.right&&(t.value.left=`${b.offsetX-g.width}px`),g.top+g.height>=m.bottom&&(console.log("高度超出"),t.value.top=`${b.offsetY-g.height}px`)}),document.addEventListener("click",h)};return(b,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:l,class:"contextmenu",onContextmenu:c,onMouseleave:h},[e.renderSlot(b.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:p,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(b.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const Ge=U._export_sfc(Xe,[["__scopeId","data-v-811db6b4"]]);const me=n=>(e.pushScopeId("data-v-8efc10f3"),n=n(),e.popScopeId(),n),Je={class:"klineBasic-tips"},Qe={key:0,class:"klineBasic-sub"},et={key:1,class:"klineBasic-empty"},tt={key:2,class:"klineBasic-error"},nt=me(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),ot={style:{"text-align":"center"}},at=me(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),lt={class:"dialog-footer"},rt={__name:"index",props:{variety:{type:[String,Number],default:()=>null},varietyName:{type:[String,Number],default:()=>null},featureId:{type:[String,Number],default:()=>null},featureType:{type:[String,Number],default:()=>null},cycle:{type:[String,Number],default:()=>null},mainIndicator:{type:String,default:()=>""},indicatorStore:{type:Object,default:()=>null},startTime:{type:String,default:()=>null},endTime:{type:String,default:()=>null},right:{type:[String,Number],default:1},config:{type:Object,default:()=>({})},env:{type:Object,default:()=>({})},brushRange:{type:[Array,null],default:()=>null}},emits:["change","getFactorData"],setup(n,{expose:k,emit:_}){const l=[{label:"画线预警",key:"drawWarningLine"}];let p=null,t=null,h=null,c=null,b=null,m,g,S=!1,r=!1;const w=_,i=n,M=e.ref(!1),D=e.ref(!1),q=e.ref(!1),A=e.ref(null),j=e.ref(null),v=e.ref("VOL"),B=e.ref(0),F=e.ref({}),H=e.ref([]),G=e.ref({}),J=e.ref(!1),Q=e.ref(""),ne=e.ref([...l]),R=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,showSubChart:!0,gridTop:48,gridLeft:80,gridRight:50,showWarningLine:!0,getFactorData:!0,...i.config})),ye=()=>{t||(t=le.init(A.value),_e(),R.value.showSubChart&&j.value.connect(t),p=N.D(A.value),p.listen(()=>{requestAnimationFrame(()=>{t==null||t.resize(),K()})}))},oe=()=>{t&&!t.isDisposed()&&t.hideLoading()},re=(s=!1)=>{h&&(cancelAnimationFrame(h),h=null),h=requestAnimationFrame(()=>{ge(s),h=requestAnimationFrame(()=>{ve(),h=requestAnimationFrame(()=>{K(),h=null})})})},ge=(s=!1)=>{var u,Y,L;if(!t||t.isDisposed())return;const{time:o}=F.value,{defaultShowCounts:x}=R.value;let d=o.length-1-x,f=o.length-1;if(s&&t){const y=t.getOption(),T=(Y=(u=y==null?void 0:y.xAxis)==null?void 0:u[0])==null?void 0:Y.data,O=(L=y==null?void 0:y.dataZoom)==null?void 0:L[0];if(T!=null&&T.length&&O){const $=T[O.startValue],P=T[O.endValue];if($&&P){const z=o.findIndex(X=>new Date(X).getTime()>=new Date($).getTime()),Z=o.findLastIndex(X=>new Date(X).getTime()<=new Date(P).getTime());d=z!==-1?z:0,f=Z!==-1?Z:o.length-1,d>f&&(d=Math.max(0,f-Math.min(100,o.length-1)))}}}const a=Ae(F.value,R.value,d,f,i.cycle);requestAnimationFrame(()=>{t==null||t.setOption(a,!0),B.value=f,requestAnimationFrame(()=>{xe()})})},ve=()=>{var Y;if(!R.value.showSubChart||!j.value)return;const{time:s}=F.value,{gridLeft:o,gridRight:x,maxShowCounts:d,defaultShowCounts:f}=R.value;let a=s.length-1-f,u=s.length-1;if(t&&!t.isDisposed()){const L=t.getOption();if((Y=L==null?void 0:L.dataZoom)!=null&&Y[0]){const{startValue:y,endValue:T}=L.dataZoom[0];y!==void 0&&T!==void 0&&(a=y,u=T)}}requestAnimationFrame(()=>{j.value.draw({startValue:a,endValue:u,maxValueSpan:d},{gridLeft:o,gridRight:x})})},K=()=>{t&&(c&&(cancelAnimationFrame(c),c=null),c=requestAnimationFrame(()=>{if(!(t==null?void 0:t.getOption()))return;const o=t==null?void 0:t.getWidth(),x=t==null?void 0:t.getHeight();!o||!x||(t==null||t.setOption({graphic:Re(t,H.value,i,R.value,()=>{ee()})},{notMerge:!1,replaceMerge:["graphic"],lazyUpdate:!0}),c=null)}))},xe=()=>{b&&cancelAnimationFrame(b),b=requestAnimationFrame(()=>{const{time:s}=F.value;if(!i.brushRange||!(s!=null&&s.length)||!t)return;let o=V.dayjs(i.brushRange[0]).format("YYYY-MM-DD 00:00:00"),x=V.dayjs(i.brushRange[1]).format("YYYY-MM-DD 23:59:59"),d=null,f=null;switch(String(i.cycle)){case"6":{d=s.find(a=>V.dayjs(a).format("YYYY-MM-DD")===V.dayjs(o).format("YYYY-MM-DD")),f=d;break}case"7":{d=s.find(a=>V.dayjs(a).day(5).format("YYYY-MM-DD")===V.dayjs(o).day(5).format("YYYY-MM-DD")),f=s.findLast(a=>V.dayjs(a).day(5).format("YYYY-MM-DD")===V.dayjs(x).day(5).format("YYYY-MM-DD"));break}case"8":{d=s.find(a=>V.dayjs(a).endOf("month").format("YYYY-MM-DD")===V.dayjs(o).endOf("month").format("YYYY-MM-DD")),f=s.findLast(a=>V.dayjs(a).endOf("month").format("YYYY-MM-DD")===V.dayjs(x).endOf("month").format("YYYY-MM-DD"));break}default:d=s.find(a=>{const u=V.dayjs(a).format("YYYY-MM-DD")===V.dayjs(o).format("YYYY-MM-DD"),Y=new Date(a).getTime()>=new Date(o).getTime();return u&&Y}),f=s.findLast(a=>{const u=V.dayjs(a).format("YYYY-MM-DD")===V.dayjs(x).format("YYYY-MM-DD"),Y=new Date(a).getTime()<=new Date(x).getTime();return u&&Y})}d&&f&&t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[d,f],xAxisIndex:0}]}),b=null})},ae=async()=>{var s,o,x,d,f,a;try{if(!i.variety||!i.cycle)return;const{variety:u,featureId:Y,cycle:L,indicatorStore:y,mainIndicator:T,right:O,startTime:$,endTime:P}=i,{defaultShowCounts:z,addCounts:Z,showWarningLine:X,getFactorData:se}=R.value;ye(),t&&!t.isDisposed()&&t.showLoading({text:"加载中...",color:"#409eff",textColor:"#fff",maskColor:"rgba(0, 0, 0, 0.7)",zlevel:0});const I={variety:u,featureId:Y,cycle:L,mainIndicatorList:y.getIndicatorParams(T),subIndicator:v.value,right:O,showWarningLine:X,getFactorData:se};$&&P?(I.startTime=$,I.endTime=P):$?(I.startTime=$,I.limit=z+Z):P?(I.endTime=P,I.limit=z+Z):(I.endTime=V.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),I.limit=z+Z);const E=await Be(I);if(!((x=(o=(s=E==null?void 0:E.body)==null?void 0:s.kline)==null?void 0:o.time)!=null&&x.length)){D.value=!0,q.value=!1,oe();return}D.value=!1,q.value=!1,F.value=(d=E==null?void 0:E.body)==null?void 0:d.kline,H.value=((f=E==null?void 0:E.body)==null?void 0:f.warningLine)||[],await e.nextTick(),re(!1),se&&w("getFactorData",(a=E==null?void 0:E.body)==null?void 0:a.factor),oe()}catch(u){throw oe(),q.value=!0,D.value=!1,new Error(u)}},be=async s=>{const{variety:o,cycle:x,indicatorStore:d,mainIndicator:f,right:a}=i,{addCounts:u}=R.value,{time:Y}=F.value;if(s==="history"){const L=await Te({variety:o,cycle:x,endTime:Y[0],limit:u,mainIndicatorList:d.getIndicatorParams(f),subIndicator:v.value,right:a});F.value={time:[...L.body.time,...F.value.time.slice(1)],data:[...L.body.data,...F.value.data.slice(1)],mainIndicator:F.value.mainIndicator.map((y,T)=>{var O;return{...y,data:[...((O=L.body.mainIndicator[T])==null?void 0:O.data)??[],...y.data.slice(1)]}}),subIndicator:F.value.subIndicator.map((y,T)=>{var O;return{...y,data:[...((O=L.body.subIndicator[T])==null?void 0:O.data)??[],...y.data.slice(1)]}})},console.log("触发了加载更多数据"),await e.nextTick(),re(!0),L.body.data.length<u&&(r=!0,console.log("历史数据已经全部加载完毕")),S=!1}},ie=({code:s,ctrlKey:o})=>{if(!(o||M.value))return;const{xAxis:x,dataZoom:d}=t.getOption(),{data:f}=(x==null?void 0:x[0])??{data:[]};let{startValue:a,endValue:u}=(d==null?void 0:d[0])??{};if(f!=null&&f.length){switch(s){case"ArrowUp":{if(u-a<5)return;const Y=Math.floor((u-a)/2)+1;a=a+Y,u-a<5&&(a=u-4);break}case"ArrowDown":{const Y=Math.min(500,u-a);a=a-Y-1;break}case"ArrowLeft":{a>0&&(a-=1,u-=1),B.value>0&&(B.value-=1);break}case"ArrowRight":{u<f.length-1&&(a+=1,u+=1),M.value&&B.value<f.length-1&&(B.value+=1);break}}requestAnimationFrame(()=>{t.dispatchAction({type:"dataZoom",startValue:a,endValue:u}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:M.value?B.value:null}),t.dispatchAction({type:"highlight",dataIndex:M.value?B.value:u})})}},_e=()=>{t==null||t.on("datazoom",o=>{clearTimeout(g),g=setTimeout(()=>{var d,f,a,u;const{loadCheckCounts:x}=R.value;if((f=(d=t==null?void 0:t.getOption())==null?void 0:d.dataZoom)!=null&&f[0]){const{startValue:Y}=(u=(a=t==null?void 0:t.getOption())==null?void 0:a.dataZoom)==null?void 0:u[0];Y<x&&!S&&!r&&(S=!0,be("history")),K()}clearTimeout(g)},100)}),t==null||t.on("highlight",o=>{var d,f;let x=o.dataIndex||-1;o.batch&&(x=typeof((d=o==null?void 0:o.batch[0])==null?void 0:d.dataIndex)=="number"?(f=o==null?void 0:o.batch[0])==null?void 0:f.dataIndex:-1),clearTimeout(m),m=setTimeout(()=>{B.value=x,clearTimeout(m)},20)}),t==null||t.on("globalout",()=>{const o=setTimeout(()=>{var d,f,a;clearTimeout(o);const x=(a=(f=(d=t==null?void 0:t.getOption())==null?void 0:d.dataZoom)==null?void 0:f[0])==null?void 0:a.endValue;B.value=x},30)});let s=null;t==null||t.on("contextmenu",o=>{s=setTimeout(()=>{o.componentType==="graphic"&&(G.value=o.info,ne.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}]),clearTimeout(s),s=null})})},ee=async()=>{const s=await Ee({featureId:i.featureId});H.value=(s==null?void 0:s.body)||[],K(),w("change","warningLine",H.value)},he=async s=>{const{variety:o,varietyName:x,featureId:d,featureType:f}=i;if(s.key==="drawWarningLine"){const a=t==null?void 0:t.getOption(),u=a.tooltip[0];t==null||t.setOption({...a,tooltip:{...u,axisPointer:{...u.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...u.axisPointer.label,backgroundColor:"transparent",formatter:()=>""}}}});const Y=async L=>{t==null||t.getZr().off("mousedown",Y);const y=t==null?void 0:t.convertFromPixel({yAxisIndex:0},L.offsetY),T=Math.round(y*1e3)/1e3;t==null||t.setOption({...a,tooltip:{...u,axisPointer:{...u.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...u.axisPointer.label,backgroundColor:null}}}}),await Ne({featureCode:o,featureName:x,featureId:d,featureType:f,warnPrice:T}),te.ElMessage.success("画线预警成功!"),ee()};t==null||t.getZr().on("mousedown",Y)}else s.key==="deleteWarningLine"?(await qe({id:G.value.id}),te.ElMessage.success("画线预警删除成功"),ee()):s.key==="changeWarningLine"&&(J.value=!0,Q.value=G.value.warnPrice)},ke=async()=>{const{variety:s,varietyName:o,featureId:x,featureType:d}=i;await fe({id:G.value.id,featureCode:s,featureName:o,featureId:x,featureType:d,warnPrice:Q.value}),te.ElMessage.success("画线预警修改成功"),ee()},we=()=>{ne.value=[...l]};return e.onMounted(()=>{Fe(i.env),ae(),window.addEventListener("keydown",ie)}),e.watch(()=>{var s,o;return[i.variety,i.cycle,i.mainIndicator,v.value,(s=i.indicatorStore)==null?void 0:s.filterIndicator,(o=i.indicatorStore)==null?void 0:o.customIndicator]},()=>{S=!1,r=!1,ae()},{deep:!0}),e.onUnmounted(()=>{h&&(cancelAnimationFrame(h),h=null),c&&(cancelAnimationFrame(c),c=null),t==null||t.off("datazoom"),t==null||t.off("highlight"),t==null||t.off("globalout"),t==null||t.dispose(),p==null||p.dispose(),window.removeEventListener("keydown",ie)}),k({draw:(s,o)=>{s==="warningLine"&&(H.value=o,K())}}),(s,o)=>{var L;const x=ce.ElMenuItem,d=ce.ElMenu,f=Ve.ElEmpty,a=De.ElButton,u=Se.ElInputNumber,Y=Ye.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:o[1]||(o[1]=y=>M.value=!0),onMouseout:o[2]||(o[2]=y=>M.value=!1)},[e.createElementVNode("div",Je,[e.createVNode($e,{variety:n.variety,data:F.value,activeIndex:B.value},null,8,["variety","data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:R.value.showSubChart?"70%":"100%"})},[e.createVNode(Ge,{onCloseContextMenuCallBack:we},{popover:e.withCtx(()=>[e.createVNode(d,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,y=>(e.openBlock(),e.createBlock(x,{style:{height:"36px"},key:y.key,index:y.key,onClick:T=>he(y)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:A,style:{height:"100%"}},null,512)]),_:1})],4),R.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(Ke,{ref_key:"klineSubRef",ref:j,modelValue:v.value,"onUpdate:modelValue":o[0]||(o[0]=y=>v.value=y),data:F.value,cycle:n.cycle,activeIndex:B.value,subIndicatorList:(L=n.indicatorStore)==null?void 0:L.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),D.value?(e.openBlock(),e.createElementBlock("div",et,[e.createVNode(f,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),q.value?(e.openBlock(),e.createElementBlock("div",tt,[nt,e.createElementVNode("div",ot,[e.createVNode(a,{onClick:ae},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(Y,{modelValue:J.value,"onUpdate:modelValue":o[5]||(o[5]=y=>J.value=y),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",lt,[e.createVNode(a,{onClick:o[4]||(o[4]=y=>J.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(a,{type:"primary",onClick:ke},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[at,e.createVNode(u,{modelValue:Q.value,"onUpdate:modelValue":o[3]||(o[3]=y=>Q.value=y),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},it=U._export_sfc(rt,[["__scopeId","data-v-8efc10f3"]]),st={install(n){n.component("st-klineBasic",it)}};module.exports=st;
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const ke=require("./el-dialog-ad7309e9.cjs");require("./el-overlay-d7a6e4a9.cjs");require("./el-input-172c49f8.cjs");const we=require("./el-input-number-c2e71528.cjs"),Ye=require("./el-button-68baab7b.cjs"),De=require("./el-empty-1697ded8.cjs"),ie=require("./el-menu-item-7f986598.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-7ba87e05.cjs");const e=require("vue"),L=require("./dayjs.min-2c20abe6.cjs"),Se=require("echarts"),N=require("./index-8901a38c.cjs"),J=require("./el-message-a86c0efa.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-789f05d3.cjs");const se=require("./el-select-12f6deb7.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./index-cebc7160.cjs");require("./use-form-common-props-344056f9.cjs");require("./index-9780a537.cjs");require("./index-bb833443.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-cf78ebac.cjs");require("./index-4f48940d.cjs");require("./typescript-b63f8e83.cjs");require("./index-c04f444f.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-2182708a.cjs");require("./index-8de94a49.cjs");require("./index-696b6a94.cjs");require("./castArray-35947698.cjs");require("./debounce-62f5b6e8.cjs");function Ve(n){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const b in n)if(b!=="default"){const r=Object.getOwnPropertyDescriptor(n,b);Object.defineProperty(w,b,r.get?r:{enumerable:!0,get:()=>n[b]})}}return w.default=n,Object.freeze(w)}const oe=Ve(Se);let z=null;const Me=n=>{const w=N.y(n,{handleReq:b=>{N.v()&&(b.headers.token=N.U())},handleRes:b=>{const{data:r}=b;if(r.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:N.K(),!0}});w.get,z=w.post},Le=n=>z("/middleLayer/kline/getKlineBasic",{...n,userId:N.V("id")}),Be=n=>z("/middleLayer/kline/getKline",n),Fe=async n=>z("/alarm/deliversign/addAlarmPrice",{...n,userId:N.V("id")}),Ne=async n=>z("/alarm/deliversign/findAlarmPriceByUserId",{...n,userId:N.V("id")}),ce=async n=>z("/alarm/deliversign/updateAlarmPrice",{...n,userId:N.V("id")}),Ae=async n=>z("/alarm/deliversign/deleteAlarmPrice",{...n,userId:N.V("id")}),{round:C}=N.x,Ee=(n,w,b,r,s)=>{const{data:t,time:y}=n,{gridTop:u,gridRight:f,gridLeft:p,maxShowCounts:g,showSubChart:Y}=w;return{animation:!1,grid:{top:`${u}px`,right:`${f}px`,bottom:Y?"6px":"24px",left:`${p}px`},dataZoom:[{type:"inside",startValue:b,endValue:r,maxValueSpan:g}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:l=>{const{axisDimension:m,value:k}=l;return m==="x"?Y?"":["6","7","8"].includes(s)?L.dayjs(k).format("YYYY-MM-DD"):k:String(C(k))}}},formatter:()=>""},xAxis:{show:!Y,type:"category",data:y,splitLine:{show:!1},axisLabel:{formatter:l=>["6","7","8"].includes(s)?L.dayjs(l).format("YYYY-MM-DD"):l}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:l=>C(l.min),max:l=>C(l.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...n.mainIndicator.map(l=>({name:l.key,type:"line",silent:!0,symbol:"none",data:l.data,lineStyle:{width:l.width||1},itemStyle:{color:l.color}}))],toolbox:{show:!1},brush:{xAxisIndex:"all",brushLink:"all",transformable:!1,outOfBrush:{colorAlpha:2},brushStyle:{color:"rgba(255,255,255,0.1)",borderColor:"rgba(255,255,255,0.4)"}}}},qe=(n,w,b,r,s)=>{const{variety:t,featureId:y,featureType:u}=b,{gridTop:f,gridLeft:p,gridRight:g}=r;return w.reduce((Y,l)=>{const{warnPrice:m}=l,k=n==null?void 0:n.convertToPixel({yAxisIndex:0},m);if(k<=f||k>=(n==null?void 0:n.getHeight()))return Y;let M=0;return[...Y,{type:"group",name:"warningLine",info:l,draggable:"vertical",children:[{type:"line",info:l,shape:{x1:p,y1:k,x2:(n==null?void 0:n.getWidth())-g,y2:k},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:l,x:(n==null?void 0:n.getWidth())-g,y:k-5,style:{fill:"#FFF",text:m,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:D=>{M=D.offsetY},ondrag:D=>{var A;if(D.target&&D.target.childAt(1)){const q=n.convertFromPixel({yAxisIndex:0},k+(D.offsetY-M));(A=D.target.childAt(1))==null||A.animate("style",!1).when(1,{text:C(q,3)}).start()}},ondragend:async D=>{const q=D.offsetY-M;if(q!==0){const E=n==null?void 0:n.convertFromPixel({yAxisIndex:0},q+k),F={id:l.id,warnPrice:C(E,3),featureId:y,featureCode:t,featureType:u};await ce(F),J.ElMessage.success("画线预警修改成功"),s&&s()}}}]},[])};function de(n){function w(r){if(typeof r=="number")return Number.isFinite(r)?r:null;if(typeof r=="string"){const s=r.trim();if(s==="")return null;const t=Number(s);return Number.isFinite(t)?t:null}return null}const b=w(n);if(b===null)return"-";try{if(b>=1||b<=-1)return C(b);{const r=b.toPrecision(3);return C(r,r.split(".")[1].length-1)}}catch{return"-"}}const Te=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){const w=n,b=e.ref(null),r=e.ref([]);return e.watch(()=>w.data,()=>{r.value.length===0&&e.nextTick(()=>{Array.from(b.value.children).forEach((s,t)=>{var y,u,f,p,g,Y,l,m;((u=(y=w.data)==null?void 0:y[t])==null?void 0:u.label)==="涨跌"?r.value[t]="85px":((p=(f=w.data)==null?void 0:f[t])==null?void 0:p.label)==="至今涨幅"?r.value[t]="115px":((Y=(g=w.data)==null?void 0:g[t])==null?void 0:Y.label)==="额"?r.value[t]="85px":["开","高","低","收"].includes((m=(l=w.data)==null?void 0:l[t])==null?void 0:m.label)?r.value[t]=`${s.offsetWidth+24}px`:r.value[t]=`${s.offsetWidth+36}px`})})}),(s,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:b},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(y,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"kline-tips-item",style:e.normalizeStyle({color:y.color,width:r.value[u]?r.value[u]:null})},e.toDisplayString(y.label)+" "+e.toDisplayString(y.value),5))),128))],512))}});const ue=U._export_sfc(Te,[["__scopeId","data-v-096c0d10"]]);const Re={class:"kline-tips"},Oe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(n){const{round:w,formatValue:b}=N.x,r=n,s=e.ref(null);e.watch(()=>r.activeIndex,()=>{var u;s.value===null&&(s.value=((u=r.data.data[r.activeIndex])==null?void 0:u[1])??0)}),e.watch(()=>r.data,()=>{var u;s.value===null&&(s.value=((u=r.data.data[r.activeIndex])==null?void 0:u[1])??0)}),e.watch(()=>r.variety,()=>{s.value=null});const t=e.computed(()=>{const{data:u,activeIndex:f}=r;if(u.data&&u.data[f]){const p=u.data[f],g=[{label:"开",value:p[0]},{label:"高",value:p[3]},{label:"低",value:p[2]},{label:"收",value:p[1]}];p[4]!==null&&g.push({label:"额",value:b(p[4])});let Y;p[6]>0?Y="red":p[6]<0&&(Y="green"),g.push({label:"涨跌",value:`${w(p[6])}%`,color:Y});const l=(s.value/p[1]-1)*100;let m;return l>0?m="red":l<0&&(m="green"),g.push({label:"至今涨幅",value:`${w(l)}%`,color:m}),g}return[]}),y=e.computed(()=>{var p;const{data:u,activeIndex:f}=r;return((p=u==null?void 0:u.mainIndicator)==null?void 0:p.map(g=>({label:g.key,value:de(g.data[f]),color:g.color})))||[]});return(u,f)=>(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(ue,{data:t.value},null,8,["data"]),e.createVNode(ue,{data:y.value},null,8,["data"])]))}},Ie=U._export_sfc(Oe,[["__scopeId","data-v-832d18ff"]]),je={class:"kline-averageTips"},$e=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){return(w,b)=>(e.openBlock(),e.createElementBlock("div",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(r,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"kline-averageTips-item",style:e.normalizeStyle({color:r.color})},e.toDisplayString(r.label)+" "+e.toDisplayString(r.value),5))),128))]))}});const Pe=U._export_sfc($e,[["__scopeId","data-v-2ce54548"]]);const We={class:"klineSub"},Ce={class:"klineSub-tips"},ze={key:0,class:"klineSub-tips-select"},Ze={__name:"index",props:{cycle:{type:[String,Number],default:()=>null},data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{expose:w,emit:b}){const{round:r}=N.x;let s=null,t=null;const y=e.ref(!0),u=b,f=n,p=e.ref(),g=e.computed({get(){return f.modelValue},set(m){u("update:modelValue",m)}}),Y=e.computed(()=>{var M;if(!y.value)return[];const{data:m,activeIndex:k}=f;return((M=m==null?void 0:m.subIndicator)==null?void 0:M.map(D=>({label:D.key,color:D.color,value:de(D.data[k])})))||[]});e.onMounted(()=>{if(y.value=!0,!p.value)return;s=oe.init(p.value);let m=!0;t=new ResizeObserver(()=>{if(m){m=!1;return}y.value&&s&&!s.isDisposed()&&s.resize()}),t.observe(p.value)}),e.onUnmounted(()=>{y.value=!1,s&&!s.isDisposed()&&(s.dispose(),s=null),t&&(t.disconnect(),t=null)});const l=(m,k)=>{const M=m[k],D=k===0?m[k]:m[k-1];return M[0]===M[1]?M[0]>=D[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:M[1]>M[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return w({connect:m=>{!y.value||!s||s.isDisposed()||oe.connect([m,s])},draw:(m,k)=>{!y.value||!s||s.isDisposed()||e.nextTick(()=>{if(!y.value||!s||s.isDisposed())return;const{startValue:M,endValue:D,maxValueSpan:A}=m,{leftYAxisRange:q,rightYAxisRange:E}=f.data.subIndicator[0],F=f.data.subIndicator.map(_=>{if(_.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:_.data.map((O,j)=>_.seriesColor==="kline"?{value:O,itemStyle:l(f.data.data,j)}:_.seriesColor==="value"?{value:O,itemStyle:{color:O>=0?"#FF0000":"#00FFFF"}}:{value:O,itemStyle:{color:_.seriesColor}})};if(_.series==="line")return{xAxisIndex:0,yAxisIndex:_.yAxis==="right"?2:1,name:_.key,type:"line",silent:!0,symbol:"none",data:_.data,lineStyle:{width:1},itemStyle:{color:_.color}}});s.setOption({animation:!1,grid:{left:`${k.gridLeft}px`,top:"10px",right:`${k.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:M,endValue:D,maxValueSpan:A}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:_=>{const{axisDimension:O,value:j}=_;if(O==="x")return["6","7","8"].includes(f.cycle)?L.dayjs(j).format("YYYY-MM-DD"):j;if(_.axisIndex===1)return String(r(j))}}},formatter:()=>""},xAxis:{type:"category",data:f.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:_=>["6","7","8"].includes(f.cycle)?L.dayjs(_).format("YYYY-MM-DD"):_}},yAxis:[{position:"right"},{position:"left",min:q==="cover"?_=>_.min:null,max:q==="cover"?_=>_.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:E==="cover"?_=>_.min:null,max:E==="cover"?_=>_.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:F},!0)})}}),(m,k)=>{const M=se.ElOption,D=se.ElSelect;return e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",Ce,[Y.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(D,{modelValue:g.value,"onUpdate:modelValue":k[0]||(k[0]=A=>g.value=A),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.subIndicatorList,A=>(e.openBlock(),e.createBlock(M,{key:A.value,label:A.label,value:A.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(Pe,{data:Y.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:p},null,512)])}}},Ue=U._export_sfc(Ze,[["__scopeId","data-v-d720c2c7"]]),He=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(n,{emit:w}){const b=w,r=e.ref(),s=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),y=()=>{t.value.display="none",b("closeContextMenuCallBack"),document.removeEventListener("click",y)},u=f=>{if(f.preventDefault(),t.value.display==="block"){const{offsetX:p,offsetY:g}=f,{offsetWidth:Y,offsetHeight:l}=s.value;if(p<=Y&&g<=l)return}r.value.click(),t.value={display:"block",top:`${f.offsetY}px`,left:`${f.offsetX}px`},e.nextTick(()=>{const p=r.value.getBoundingClientRect(),g=s.value.getBoundingClientRect();g.left+g.width>=p.right&&(t.value.left=`${f.offsetX-g.width}px`),g.top+g.height>=p.bottom&&(console.log("高度超出"),t.value.top=`${f.offsetY-g.height}px`)}),document.addEventListener("click",y)};return(f,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:r,class:"contextmenu",onContextmenu:u,onMouseleave:y},[e.renderSlot(f.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:s,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(f.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const Ke=U._export_sfc(He,[["__scopeId","data-v-811db6b4"]]);const fe=n=>(e.pushScopeId("data-v-ae370bef"),n=n(),e.popScopeId(),n),Ge={key:0,class:"klineBasic-tips"},Xe={key:1,class:"klineBasic-sub"},Je={key:2,class:"klineBasic-empty"},Qe={key:3,class:"klineBasic-error"},et=fe(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),tt={style:{"text-align":"center"}},nt=fe(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),ot={class:"dialog-footer"},at={__name:"index",props:{variety:{type:[String,Number],default:()=>null},varietyName:{type:[String,Number],default:()=>null},featureId:{type:[String,Number],default:()=>null},featureType:{type:[String,Number],default:()=>null},cycle:{type:[String,Number],default:()=>null},mainIndicator:{type:String,default:()=>""},indicatorStore:{type:Object,default:()=>null},startTime:{type:String,default:()=>null},endTime:{type:String,default:()=>null},right:{type:[String,Number],default:1},config:{type:Object,default:()=>({})},env:{type:Object,default:()=>({})},brushRange:{type:[Array,null],default:()=>null}},emits:["change","getFactorData"],setup(n,{expose:w,emit:b}){const r=[{label:"画线预警",key:"drawWarningLine"}];let s=null,t=null,y=null,u=null,f=null,p=!1,g=!1;const Y=b,l=n,m=e.ref(!1),k=e.ref(!1),M=e.ref(!1),D=e.ref(null),A=e.ref(null),q=e.ref("VOL"),E=e.ref(0),F=e.ref({}),_=e.ref([]),O=e.ref({}),j=e.ref(!1),G=e.ref(""),Q=e.ref([...r]),I=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,gridTop:48,gridLeft:80,gridRight:50,showSubChart:!0,showWarningLine:!0,getFactorData:!0,...l.config})),pe=()=>{t||(t=oe.init(D.value),xe(),I.value.showSubChart&&A.value.connect(t),s=N.D(D.value),s.listen(()=>{requestAnimationFrame(()=>{t==null||t.resize(),H()})}))},ee=()=>{t&&!t.isDisposed()&&t.hideLoading()},ae=(o=!1)=>{y&&(cancelAnimationFrame(y),y=null),y=requestAnimationFrame(()=>{me(o),y=requestAnimationFrame(()=>{ye(),y=requestAnimationFrame(()=>{H(),y=null})})})},me=(o=!1)=>{var c,S,B;if(!t||t.isDisposed())return;const{time:a}=F.value,{defaultShowCounts:v}=I.value;let d=a.length-1-v,x=a.length-1;if(o&&t){const V=t.getOption(),h=(S=(c=V==null?void 0:V.xAxis)==null?void 0:c[0])==null?void 0:S.data,T=(B=V==null?void 0:V.dataZoom)==null?void 0:B[0];if(h!=null&&h.length&&T){const P=h[T.startValue],W=h[T.endValue];if(P&&W){const ne=a.findIndex(K=>new Date(K).getTime()>=new Date(P).getTime()),Z=a.findLastIndex(K=>new Date(K).getTime()<=new Date(W).getTime());d=ne!==-1?ne:0,x=Z!==-1?Z:a.length-1,d>x&&(d=Math.max(0,x-Math.min(100,a.length-1)))}}}const i=Ee(F.value,I.value,d,x,l.cycle);requestAnimationFrame(()=>{t==null||t.setOption(i,!0),E.value=x,requestAnimationFrame(()=>{ve()})})},ye=()=>{var S;if(!I.value.showSubChart||!A.value)return;const{time:o}=F.value,{gridLeft:a,gridRight:v,maxShowCounts:d,defaultShowCounts:x}=I.value;let i=o.length-1-x,c=o.length-1;if(t&&!t.isDisposed()){const B=t.getOption();if((S=B==null?void 0:B.dataZoom)!=null&&S[0]){const{startValue:V,endValue:h}=B.dataZoom[0];V!==void 0&&h!==void 0&&(i=V,c=h)}}requestAnimationFrame(()=>{A.value.draw({startValue:i,endValue:c,maxValueSpan:d},{gridLeft:a,gridRight:v})})},H=()=>{t&&(u&&(cancelAnimationFrame(u),u=null),u=requestAnimationFrame(()=>{if(!(t==null?void 0:t.getOption()))return;const a=t==null?void 0:t.getWidth(),v=t==null?void 0:t.getHeight();!a||!v||(t==null||t.setOption({graphic:qe(t,_.value,l,I.value,()=>{X()})},{notMerge:!1,replaceMerge:["graphic"],lazyUpdate:!0}),u=null)}))},ve=()=>{f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{const{time:o}=F.value;if(!l.brushRange||!(o!=null&&o.length)||!t)return;let a=L.dayjs(l.brushRange[0]).format("YYYY-MM-DD 00:00:00"),v=L.dayjs(l.brushRange[1]).format("YYYY-MM-DD 23:59:59"),d=null,x=null;switch(String(l.cycle)){case"6":{d=o.find(i=>L.dayjs(i).format("YYYY-MM-DD")===L.dayjs(a).format("YYYY-MM-DD")),x=d;break}case"7":{d=o.find(i=>L.dayjs(i).day(5).format("YYYY-MM-DD")===L.dayjs(a).day(5).format("YYYY-MM-DD")),x=o.findLast(i=>L.dayjs(i).day(5).format("YYYY-MM-DD")===L.dayjs(v).day(5).format("YYYY-MM-DD"));break}case"8":{d=o.find(i=>L.dayjs(i).endOf("month").format("YYYY-MM-DD")===L.dayjs(a).endOf("month").format("YYYY-MM-DD")),x=o.findLast(i=>L.dayjs(i).endOf("month").format("YYYY-MM-DD")===L.dayjs(v).endOf("month").format("YYYY-MM-DD"));break}default:d=o.find(i=>{const c=L.dayjs(i).format("YYYY-MM-DD")===L.dayjs(a).format("YYYY-MM-DD"),S=new Date(i).getTime()>=new Date(a).getTime();return c&&S}),x=o.findLast(i=>{const c=L.dayjs(i).format("YYYY-MM-DD")===L.dayjs(v).format("YYYY-MM-DD"),S=new Date(i).getTime()<=new Date(v).getTime();return c&&S})}d&&x&&t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[d,x],xAxisIndex:0}]}),f=null})},te=async()=>{var o,a,v,d,x,i;try{if(!l.variety||!l.cycle)return;const{variety:c,featureId:S,cycle:B,indicatorStore:V,mainIndicator:h,right:T,startTime:P,endTime:W}=l,{defaultShowCounts:ne,addCounts:Z,showWarningLine:K,getFactorData:re}=I.value;pe(),t&&!t.isDisposed()&&t.showLoading({text:"加载中...",color:"#409eff",textColor:"#fff",maskColor:"rgba(0, 0, 0, 0.7)",zlevel:0});const $={variety:c,featureId:S,cycle:B,mainIndicatorList:V.getIndicatorParams(h),subIndicator:q.value,right:T,showWarningLine:K,getFactorData:re};P&&W?($.startTime=P,$.endTime=W):P?($.startTime=P,$.limit=Z):W?($.endTime=W,$.limit=Z):($.endTime=L.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),$.limit=Z);const R=await Le($);if(!((v=(a=(o=R==null?void 0:R.body)==null?void 0:o.kline)==null?void 0:a.time)!=null&&v.length)){k.value=!0,M.value=!1,ee();return}k.value=!1,M.value=!1,F.value=(d=R==null?void 0:R.body)==null?void 0:d.kline,_.value=((x=R==null?void 0:R.body)==null?void 0:x.warningLine)||[],await e.nextTick(),ae(!1),re&&Y("getFactorData",(i=R==null?void 0:R.body)==null?void 0:i.factor),ee()}catch(c){throw ee(),M.value=!0,k.value=!1,new Error(c)}},ge=async o=>{const{variety:a,cycle:v,indicatorStore:d,mainIndicator:x,right:i}=l,{addCounts:c}=I.value,{time:S}=F.value;if(o==="history"){const B=await Be({variety:a,cycle:v,endTime:S[0],limit:c,mainIndicatorList:d.getIndicatorParams(x),subIndicator:q.value,right:i});F.value={time:[...B.body.time,...F.value.time.slice(1)],data:[...B.body.data,...F.value.data.slice(1)],mainIndicator:F.value.mainIndicator.map((V,h)=>{var T;return{...V,data:[...((T=B.body.mainIndicator[h])==null?void 0:T.data)??[],...V.data.slice(1)]}}),subIndicator:F.value.subIndicator.map((V,h)=>{var T;return{...V,data:[...((T=B.body.subIndicator[h])==null?void 0:T.data)??[],...V.data.slice(1)]}})},console.log("触发了加载更多数据"),await e.nextTick(),ae(!0),B.body.data.length<c&&(g=!0,console.log("历史数据已经全部加载完毕")),p=!1}},le=({code:o,ctrlKey:a})=>{if(!(a||m.value))return;const{xAxis:v,dataZoom:d}=t.getOption(),{data:x}=(v==null?void 0:v[0])??{data:[]};let{startValue:i,endValue:c}=(d==null?void 0:d[0])??{};if(x!=null&&x.length){switch(o){case"ArrowUp":{if(c-i<5)return;const S=Math.floor((c-i)/2)+1;i=i+S,c-i<5&&(i=c-4);break}case"ArrowDown":{const S=Math.min(500,c-i);i=i-S-1;break}case"ArrowLeft":{i>0&&(i-=1,c-=1),E.value>0&&(E.value-=1);break}case"ArrowRight":{c<x.length-1&&(i+=1,c+=1),m.value&&E.value<x.length-1&&(E.value+=1);break}}requestAnimationFrame(()=>{t.dispatchAction({type:"dataZoom",startValue:i,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:m.value?E.value:null}),t.dispatchAction({type:"highlight",dataIndex:m.value?E.value:c})})}},xe=()=>{t==null||t.on("datazoom",N.G(o=>{var v,d,x,i;const{loadCheckCounts:a}=I.value;if((d=(v=t==null?void 0:t.getOption())==null?void 0:v.dataZoom)!=null&&d[0]){const{startValue:c}=(i=(x=t==null?void 0:t.getOption())==null?void 0:x.dataZoom)==null?void 0:i[0];c<a&&!p&&!g&&(p=!0,ge("history")),H()}},100)),t==null||t.on("highlight",N.G(o=>{var v,d;let a=o.dataIndex||-1;o.batch&&(a=typeof((v=o==null?void 0:o.batch[0])==null?void 0:v.dataIndex)=="number"?(d=o==null?void 0:o.batch[0])==null?void 0:d.dataIndex:-1),E.value=a},20)),t==null||t.on("globalout",N.G(()=>{var o,a,v;if(t){const d=(v=(a=(o=t==null?void 0:t.getOption())==null?void 0:o.dataZoom)==null?void 0:a[0])==null?void 0:v.endValue;E.value=d}},30)),t==null||t.on("contextmenu",N.G(o=>{o.componentType==="graphic"&&(O.value=o.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}])},0))},X=async()=>{const o=await Ne({featureId:l.featureId});_.value=(o==null?void 0:o.body)||[],H(),Y("change","warningLine",_.value)},be=async o=>{const{variety:a,varietyName:v,featureId:d,featureType:x}=l;if(o.key==="drawWarningLine"){const i=t==null?void 0:t.getOption(),c=i.tooltip[0];t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...c.axisPointer.label,backgroundColor:"transparent",formatter:()=>""}}}});const S=async B=>{t==null||t.getZr().off("mousedown",S);const V=t==null?void 0:t.convertFromPixel({yAxisIndex:0},B.offsetY),h=Math.round(V*1e3)/1e3;t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...c.axisPointer.label,backgroundColor:null}}}}),await Fe({featureCode:a,featureName:v,featureId:d,featureType:x,warnPrice:h}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",S)}else o.key==="deleteWarningLine"?(await Ae({id:O.value.id}),J.ElMessage.success("画线预警删除成功"),X()):o.key==="changeWarningLine"&&(j.value=!0,G.value=O.value.warnPrice)},_e=async()=>{const{variety:o,varietyName:a,featureId:v,featureType:d}=l;await ce({id:O.value.id,featureCode:o,featureName:a,featureId:v,featureType:d,warnPrice:G.value}),J.ElMessage.success("画线预警修改成功"),X()},he=()=>{Q.value=[...r]};return e.onMounted(()=>{Me(l.env),te(),window.addEventListener("keydown",le)}),e.watch(()=>{var o,a;return[l.variety,l.cycle,l.mainIndicator,q.value,(o=l.indicatorStore)==null?void 0:o.filterIndicator,(a=l.indicatorStore)==null?void 0:a.customIndicator]},()=>{p=!1,g=!1,te()},{deep:!0}),e.onUnmounted(()=>{y&&(cancelAnimationFrame(y),y=null),u&&(cancelAnimationFrame(u),u=null),t==null||t.off("datazoom"),t==null||t.off("highlight"),t==null||t.off("globalout"),t==null||t.dispose(),s==null||s.dispose(),window.removeEventListener("keydown",le)}),w({draw:(o,a)=>{o==="warningLine"&&(_.value=a,H())}}),(o,a)=>{var B,V;const v=ie.ElMenuItem,d=ie.ElMenu,x=De.ElEmpty,i=Ye.ElButton,c=we.ElInputNumber,S=ke.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:a[1]||(a[1]=h=>m.value=!0),onMouseout:a[2]||(a[2]=h=>m.value=!1)},[(B=F.value.time)!=null&&B.length?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(Ie,{variety:n.variety,data:F.value,activeIndex:E.value},null,8,["variety","data","activeIndex"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:I.value.showSubChart?"70%":"100%"})},[e.createVNode(Ke,{onCloseContextMenuCallBack:he},{popover:e.withCtx(()=>[e.createVNode(d,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,h=>(e.openBlock(),e.createBlock(v,{style:{height:"36px"},key:h.key,index:h.key,onClick:T=>be(h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:D,style:{height:"100%"}},null,512)]),_:1})],4),I.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(Ue,{ref_key:"klineSubRef",ref:A,modelValue:q.value,"onUpdate:modelValue":a[0]||(a[0]=h=>q.value=h),data:F.value,cycle:n.cycle,activeIndex:E.value,subIndicatorList:(V=n.indicatorStore)==null?void 0:V.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",Je,[e.createVNode(x,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createElementBlock("div",Qe,[et,e.createElementVNode("div",tt,[e.createVNode(i,{onClick:te},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(S,{modelValue:j.value,"onUpdate:modelValue":a[5]||(a[5]=h=>j.value=h),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",ot,[e.createVNode(i,{onClick:a[4]||(a[4]=h=>j.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(i,{type:"primary",onClick:_e},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[nt,e.createVNode(c,{modelValue:G.value,"onUpdate:modelValue":a[3]||(a[3]=h=>G.value=h),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},lt=U._export_sfc(at,[["__scopeId","data-v-ae370bef"]]),rt={install(n){n.component("st-klineBasic",lt)}};module.exports=rt;
|