st-comp 0.0.222 → 0.0.224
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 +30 -30
- package/es/FactorWarning.js +33 -33
- package/es/Kline.js +17 -17
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +381 -374
- package/es/KlineConfig.js +61 -61
- package/es/KlineNew.js +16 -16
- package/es/KlinePlus.js +19 -19
- package/es/Pagination.js +73 -73
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.js +38 -38
- package/es/TreeMap.cjs +2 -1
- package/es/TreeMap.js +163 -1
- package/es/User.js +44 -44
- package/es/VarSelectDialog.js +24 -24
- package/es/VarietyAutoComplete.js +10 -10
- package/es/VarietySearch.js +35 -35
- package/es/VarietyTextCopy.cjs +3 -3
- package/es/VarietyTextCopy.js +15 -15
- package/es/VirtualTable.js +70 -70
- package/es/{_initCloneObject-71a2d663.js → _initCloneObject-eaef9418.js} +7 -7
- package/es/{base-ff0e366f.js → base-a5af3db3.js} +40 -40
- package/es/{castArray-15070be9.js → castArray-7741a212.js} +1 -1
- package/es/{config-provider-ef3c8ca2.js → config-provider-b16efd62.js} +6 -6
- package/es/{debounce-e9e47f9a.js → debounce-8d53f4dd.js} +1 -1
- package/es/{dropdown-41512a70.js → dropdown-a59bba73.js} +13 -13
- package/es/{el-autocomplete-6b56f161.js → el-autocomplete-ba808eb6.js} +16 -16
- package/es/{el-button-72e66b1c.js → el-button-c95adb85.js} +39 -39
- package/es/{el-checkbox-7df65088.js → el-checkbox-7421ccd3.js} +31 -31
- package/es/{el-dialog-7d6e8f91.js → el-dialog-41ab8417.js} +15 -15
- package/es/{el-divider-4fe55ebe.js → el-divider-4e059794.js} +1 -1
- package/es/{el-empty-ceecb81c.js → el-empty-33cb66f1.js} +5 -5
- package/es/{el-form-item-706eb72e.js → el-form-item-c53c374d.js} +36 -36
- package/es/{el-input-8cafa639.js → el-input-2f75c4ba.js} +55 -55
- package/es/{el-input-number-7907c63c.js → el-input-number-5193fe6d.js} +36 -36
- package/es/{el-loading-3cfc4e19.js → el-loading-f6022062.js} +5 -5
- package/es/{el-menu-item-f7436984.js → el-menu-item-7e881203.js} +22 -22
- package/es/{el-message-box-8e4d6990.js → el-message-box-a93d2f6a.js} +11 -11
- package/es/{el-message-f3d56a3e.js → el-message-e544a8f5.js} +23 -23
- package/es/{el-overlay-31707230.js → el-overlay-09ad71cd.js} +56 -56
- package/es/{el-popconfirm-b113716a.js → el-popconfirm-81dcd202.js} +20 -20
- package/es/{el-popper-f28554e1.js → el-popper-b4f97157.js} +109 -109
- package/es/{el-segmented-5f4d8e64.js → el-segmented-b868d074.js} +8 -8
- package/es/{el-select-90ba1ff9.js → el-select-95627997.js} +64 -64
- package/es/{el-table-column-bccab55d.js → el-table-column-376cd907.js} +15 -15
- package/es/{el-tag-f03f602d.js → el-tag-66cab138.js} +15 -15
- package/es/{el-text-f106c80e.js → el-text-ac60d0f2.js} +2 -2
- package/es/{index-b792012c.js → index-1f7d4f70.js} +2 -2
- package/es/{index-00e91ed2.js → index-57672682.js} +3 -3
- package/es/{index-158df623.js → index-844bdd85.js} +34 -34
- package/es/{index-89707217.js → index-88546436.js} +17 -17
- package/es/{index-269b8a8c.js → index-960806da.js} +36 -36
- package/es/{index-065f4c40.js → index-a871c3eb.js} +29 -29
- package/es/{index-93a8960e.js → index-d77a7336.js} +1 -1
- package/es/{index-49767c81.js → index-d91dc23f.js} +12 -12
- package/es/{index-60dd8509.js → index-e5566b94.js} +43 -43
- package/es/raf-80ef0c0a.js +6 -0
- package/es/{scroll-41b4f625.js → scroll-679bd6bf.js} +5 -5
- package/es/style.css +1 -1
- package/es/{use-form-common-props-1f967d2e.js → use-form-common-props-815d48a6.js} +67 -67
- package/es/{use-global-config-ded5e07b.js → use-global-config-b5e9d3d5.js} +14 -14
- package/es/{validator-5c8b5cdc.js → validator-764a9db0.js} +1 -1
- package/es/{vnode-06571d5b.js → vnode-5ddb7ed1.js} +1 -1
- package/es/{zh-cn-cae8ba43.js → zh-cn-e963c628.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +1 -1
- package/lib/{index-b2c7b8c5.js → index-f21f4ed2.js} +377 -370
- package/lib/{python-430bbf9c.js → python-dfab6a0b.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/components/KlineTips/index.vue +17 -1
- package/packages/KlineBasic/components/Tips/index.vue +7 -4
- package/es/raf-8e05a7f4.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-a5af3db3.js";
|
|
2
|
+
import { E as d } from "./el-empty-33cb66f1.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-960806da.js";
|
|
6
|
+
import "./index-d77a7336.js";
|
|
7
7
|
const f = {
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
package/es/CustomFunction.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import "./base-
|
|
2
|
-
import { E as oe } from "./el-button-
|
|
3
|
-
import "./el-tag-
|
|
4
|
-
import { E as ye, a as Ee } from "./el-select-
|
|
1
|
+
import "./base-a5af3db3.js";
|
|
2
|
+
import { E as oe } from "./el-button-c95adb85.js";
|
|
3
|
+
import "./el-tag-66cab138.js";
|
|
4
|
+
import { E as ye, a as Ee } from "./el-select-95627997.js";
|
|
5
5
|
import "./el-scrollbar-323542e7.js";
|
|
6
|
-
import "./el-popper-
|
|
7
|
-
import { E as ne } from "./el-popconfirm-
|
|
6
|
+
import "./el-popper-b4f97157.js";
|
|
7
|
+
import { E as ne } from "./el-popconfirm-81dcd202.js";
|
|
8
8
|
import "./el-popover-4ed993c7.js";
|
|
9
9
|
import { inject as le, ref as f, reactive as J, computed as be, watch as Ce, nextTick as ee, resolveComponent as Q, openBlock as I, createBlock as Y, withCtx as n, createElementVNode as l, normalizeClass as B, createVNode as t, unref as h, createTextVNode as k, createElementBlock as P, Fragment as se, renderList as ae, toDisplayString as L, withModifiers as W, pushScopeId as Ve, popScopeId as ke, h as U, onMounted as we, normalizeStyle as $e } from "vue";
|
|
10
|
-
import {
|
|
11
|
-
import { E as De } from "./el-divider-
|
|
12
|
-
import { E as Fe } from "./el-dialog-
|
|
13
|
-
import "./el-overlay-
|
|
14
|
-
import { E as ze } from "./el-empty-
|
|
15
|
-
import { E as te } from "./el-input-
|
|
10
|
+
import { c as X, d as ie, a as ce, b as Ne, E as re, e as Se } from "./index-a871c3eb.js";
|
|
11
|
+
import { E as De } from "./el-divider-4e059794.js";
|
|
12
|
+
import { E as Fe } from "./el-dialog-41ab8417.js";
|
|
13
|
+
import "./el-overlay-09ad71cd.js";
|
|
14
|
+
import { E as ze } from "./el-empty-33cb66f1.js";
|
|
15
|
+
import { E as te } from "./el-input-2f75c4ba.js";
|
|
16
16
|
import { G as Ie } from "./index-7ed0999e.js";
|
|
17
|
-
import { E as V } from "./el-message-
|
|
18
|
-
import { E as Me } from "./el-message-box-
|
|
19
|
-
import {
|
|
17
|
+
import { E as V } from "./el-message-e544a8f5.js";
|
|
18
|
+
import { E as Me } from "./el-message-box-a93d2f6a.js";
|
|
19
|
+
import { E as Oe, a as Be } from "./el-form-item-c53c374d.js";
|
|
20
20
|
import { _ as ue } from "./_plugin-vue_export-helper-dad06003.js";
|
|
21
|
-
import { E as Ue } from "./index-
|
|
21
|
+
import { E as Ue } from "./index-844bdd85.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-b5e9d3d5.js";
|
|
24
|
+
import "./use-form-common-props-815d48a6.js";
|
|
25
|
+
import "./index-960806da.js";
|
|
26
|
+
import "./index-d77a7336.js";
|
|
27
|
+
import "./index-e5566b94.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-57672682.js";
|
|
30
|
+
import "./castArray-7741a212.js";
|
|
31
|
+
import "./index-d91dc23f.js";
|
|
32
|
+
import "./scroll-679bd6bf.js";
|
|
33
|
+
import "./debounce-8d53f4dd.js";
|
|
34
|
+
import "./vnode-5ddb7ed1.js";
|
|
35
35
|
import "./typescript-7ae59c4c.js";
|
|
36
|
-
import "./config-provider-
|
|
37
|
-
import "./validator-
|
|
38
|
-
import "./_initCloneObject-
|
|
36
|
+
import "./config-provider-b16efd62.js";
|
|
37
|
+
import "./validator-764a9db0.js";
|
|
38
|
+
import "./_initCloneObject-eaef9418.js";
|
|
39
39
|
const Z = (p) => (Ve("data-v-cbbcbba3"), p = p(), ke(), p), qe = { class: "custom-header" }, Re = { class: "left" }, je = ["id"], Te = { class: "right" }, Ae = { class: "manage-dialog-body" }, Le = { class: "func-list" }, We = { class: "search" }, Pe = /* @__PURE__ */ Z(() => /* @__PURE__ */ l("span", null, "输入函数关键字", -1)), Ge = ["onClick"], Ke = { class: "icon-box" }, He = { class: "rule-form" }, Je = { class: "header" }, Qe = /* @__PURE__ */ Z(() => /* @__PURE__ */ l("span", null, "函数名称:", -1)), Xe = { class: "right" }, Ye = /* @__PURE__ */ Z(() => /* @__PURE__ */ l("div", { class: "tip-box" }, "说明: 公式里可以使用变量, 变量名命名格式: ${变量名}, 后续可在应用函数时填写具体值, 系统会自动换算", -1)), Ze = { class: "custom-header" }, et = { class: "left" }, tt = ["id"], ot = { class: "right" }, nt = { class: "dialog-footer" }, lt = { class: "custom-header" }, st = { class: "left" }, at = ["id"], it = { class: "right" }, ct = { class: "content" }, rt = { class: "dialog-footer" }, ut = {
|
|
40
40
|
__name: "ManageDialog",
|
|
41
41
|
props: {
|
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-a5af3db3.js";
|
|
2
|
+
import { z as re, E as ne } from "./zh-cn-e963c628.js";
|
|
3
|
+
import { E as ue } from "./el-dialog-41ab8417.js";
|
|
4
|
+
import "./el-overlay-09ad71cd.js";
|
|
5
|
+
import "./el-tag-66cab138.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-b4f97157.js";
|
|
8
|
+
import { E as ie, a as ce } from "./el-table-column-376cd907.js";
|
|
9
|
+
import { E as de, a as me } from "./el-checkbox-7421ccd3.js";
|
|
10
10
|
import "./el-scrollbar-323542e7.js";
|
|
11
|
-
import { E as fe } from "./el-popconfirm-
|
|
11
|
+
import { E as fe } from "./el-popconfirm-81dcd202.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-c95adb85.js";
|
|
14
|
+
import { a as ye, E as ve } from "./el-form-item-c53c374d.js";
|
|
15
|
+
import { E as _e } from "./el-input-2f75c4ba.js";
|
|
16
|
+
import { E as be } from "./el-text-ac60d0f2.js";
|
|
17
|
+
import { E as he } from "./el-input-number-5193fe6d.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-b868d074.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-a871c3eb.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-a93d2f6a.js";
|
|
25
|
+
import { E as Fe } from "./index-57672682.js";
|
|
26
|
+
import "./config-provider-b16efd62.js";
|
|
27
|
+
import "./use-global-config-b5e9d3d5.js";
|
|
28
|
+
import "./use-form-common-props-815d48a6.js";
|
|
29
|
+
import "./index-960806da.js";
|
|
30
|
+
import "./index-d77a7336.js";
|
|
31
|
+
import "./index-e5566b94.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-5ddb7ed1.js";
|
|
34
|
+
import "./scroll-679bd6bf.js";
|
|
35
|
+
import "./index-844bdd85.js";
|
|
36
|
+
import "./_initCloneObject-eaef9418.js";
|
|
37
|
+
import "./castArray-7741a212.js";
|
|
38
|
+
import "./debounce-8d53f4dd.js";
|
|
39
|
+
import "./raf-80ef0c0a.js";
|
|
40
40
|
import "./index-657047bb.js";
|
|
41
41
|
import "./typescript-7ae59c4c.js";
|
|
42
|
-
import "./index-
|
|
43
|
-
import "./validator-
|
|
42
|
+
import "./index-d91dc23f.js";
|
|
43
|
+
import "./validator-764a9db0.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-a5af3db3.js";
|
|
2
|
+
import { E as he, a as Ce } from "./el-menu-item-7e881203.js";
|
|
3
3
|
import "./el-tooltip-4ed993c7.js";
|
|
4
|
-
import "./el-popper-
|
|
4
|
+
import "./el-popper-b4f97157.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-66cab138.js";
|
|
11
|
+
import { E as Ee, a as Se } from "./el-select-95627997.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-815d48a6.js";
|
|
14
|
+
import "./index-960806da.js";
|
|
15
|
+
import "./index-a871c3eb.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-5ddb7ed1.js";
|
|
19
|
+
import "./index-e5566b94.js";
|
|
20
|
+
import "./index-d77a7336.js";
|
|
21
|
+
import "./index-844bdd85.js";
|
|
22
|
+
import "./index-57672682.js";
|
|
23
|
+
import "./castArray-7741a212.js";
|
|
24
|
+
import "./index-d91dc23f.js";
|
|
25
|
+
import "./scroll-679bd6bf.js";
|
|
26
|
+
import "./debounce-8d53f4dd.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 ve=require("./el-dialog-ae86edb8.cjs");require("./el-overlay-9e34965f.cjs");require("./el-input-7fd293af.cjs");const xe=require("./el-input-number-22e21d16.cjs"),be=require("./el-button-eec58cff.cjs"),_e=require("./el-empty-1697ded8.cjs"),le=require("./el-menu-item-17dc717e.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-b6c99b28.cjs");const e=require("vue"),he=require("echarts"),u=require("./dayjs.min-2c20abe6.cjs"),A=require("./index-8901a38c.cjs"),J=require("./el-message-5e6a6be9.cjs"),K=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-a33c4b22.cjs");const ie=require("./el-select-d8d91db1.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./index-098c2447.cjs");require("./use-form-common-props-fd9b61a0.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-30d7d8ce.cjs");require("./index-c108567d.cjs");require("./typescript-b63f8e83.cjs");require("./index-11547a0c.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-a584d81e.cjs");require("./index-298075cf.cjs");require("./index-f3562b52.cjs");require("./castArray-35947698.cjs");require("./debounce-62f5b6e8.cjs");function Ye(o){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const Y in o)if(Y!=="default"){const m=Object.getOwnPropertyDescriptor(o,Y);Object.defineProperty(k,Y,m.get?m:{enumerable:!0,get:()=>o[Y]})}}return k.default=o,Object.freeze(k)}const ne=Ye(he);let z=null;const ke=o=>{const k=A.y(o,{handleReq:Y=>{A.v()&&(Y.headers.token=A.U())},handleRes:Y=>{const{data:m}=Y;if(m.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:A.K(),!0}});k.get,z=k.post},we=o=>z("/middleLayer/kline/getKlineBasic",{...o,userId:A.V("id")}),De=o=>z("/middleLayer/kline/getKline",o),Me=async o=>z("/alarm/deliversign/addAlarmPrice",{...o,userId:A.V("id")}),Se=async o=>z("/alarm/deliversign/findAlarmPriceByUserId",{...o,userId:A.V("id")}),ce=async o=>z("/alarm/deliversign/updateAlarmPrice",{...o,userId:A.V("id")}),Ve=async o=>z("/alarm/deliversign/deleteAlarmPrice",{...o,userId:A.V("id")}),{round:U}=A.x,Te=(o,k,Y,m,b)=>{const{data:t,time:g}=o,{gridTop:p,gridRight:s,gridLeft:w,maxShowCounts:D,showSubChart:l}=k;return{animation:!1,grid:{top:`${p}px`,right:`${s}px`,bottom:l?"6px":"24px",left:`${w}px`},dataZoom:[{type:"inside",startValue:Y,endValue:m,maxValueSpan:D}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:r=>{const{axisDimension:M,value:v}=r;return M==="x"?l?"":["6","7","8"].includes(b)?u.dayjs(v).format("YYYY-MM-DD"):v:String(U(v))}}},formatter:()=>""},xAxis:{show:!l,type:"category",data:g,splitLine:{show:!1},axisLabel:{formatter:r=>["6","7","8"].includes(b)?u.dayjs(r).format("YYYY-MM-DD"):r}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:r=>U(r.min),max:r=>U(r.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...o.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)"}}}},Le=(o,k,Y,m,b)=>{const{variety:t,featureId:g,featureType:p}=Y,{gridTop:s,gridLeft:w,gridRight:D}=m;return k.reduce((l,r)=>{const{warnPrice:M}=r,v=o==null?void 0:o.convertToPixel({yAxisIndex:0},M);if(v<=s||v>=(o==null?void 0:o.getHeight()))return l;let E=0;return[...l,{type:"group",name:"warningLine",info:r,draggable:"vertical",children:[{type:"line",info:r,shape:{x1:w,y1:v,x2:(o==null?void 0:o.getWidth())-D,y2:v},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:r,x:(o==null?void 0:o.getWidth())-D,y:v-5,style:{fill:"#FFF",text:M,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:V=>{E=V.offsetY},ondrag:V=>{var R;if(V.target&&V.target.childAt(1)){const T=o.convertFromPixel({yAxisIndex:0},v+(V.offsetY-E));(R=V.target.childAt(1))==null||R.animate("style",!1).when(1,{text:U(T,3)}).start()}},ondragend:async V=>{const T=V.offsetY-E;if(T!==0){const N=o==null?void 0:o.convertFromPixel({yAxisIndex:0},T+v),d={id:r.id,warnPrice:U(N,3),featureId:g,featureCode:t,featureType:p};await ce(d),J.ElMessage.success("画线预警修改成功"),b&&b()}}}]},[])},Be=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){const k=o,Y=e.ref(null),m=e.ref([]);return e.watch(()=>k.data,()=>{m.value.length===0&&e.nextTick(()=>{Array.from(Y.value.children).forEach((b,t)=>{var g,p,s;(s=String((p=(g=k.data)==null?void 0:g[t])==null?void 0:p.value))!=null&&s.includes("%")?m.value[t]="80px":m.value[t]=`${b.offsetWidth+20}px`})})}),(b,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:Y},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.data,(g,p)=>(e.openBlock(),e.createElementBlock("div",{key:p,class:"kline-tips-item",style:e.normalizeStyle({color:g.color,width:m.value[p]?m.value[p]:null})},e.toDisplayString(g.label)+" "+e.toDisplayString(g.value),5))),128))],512))}});const se=K._export_sfc(Be,[["__scopeId","data-v-de5227e4"]]);const Ee={class:"kline-tips"},Ne={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0}},setup(o){const{round:k,formatValue:Y}=A.x,m=o,b=e.computed(()=>{const{data:g,activeIndex:p}=m;if(g.data&&g.data[p]){const s=g.data[p],w=[{label:"开",value:s[0]},{label:"高",value:s[3]},{label:"低",value:s[2]},{label:"收",value:s[1]}];s[4]!==null&&w.push({label:"额",value:Y(s[4])});let D;return s[6]>0?D="red":s[6]<0&&(D="green"),w.push({label:"涨跌",value:`${k(s[6])}%`,color:D}),w}return[]}),t=e.computed(()=>{var s;const{data:g,activeIndex:p}=m;return((s=g==null?void 0:g.mainIndicator)==null?void 0:s.map(w=>({label:w.key,value:k(w.data[p]),color:w.color})))||[]});return(g,p)=>(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(se,{data:b.value},null,8,["data"]),e.createVNode(se,{data:t.value},null,8,["data"])]))}},Fe=K._export_sfc(Ne,[["__scopeId","data-v-ffa125ec"]]),qe={class:"kline-averageTips"},Ae=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){return(k,Y)=>(e.openBlock(),e.createElementBlock("div",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.data,(m,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"kline-averageTips-item",style:e.normalizeStyle({color:m.color,width:`calc(100% / ${o.data.length} - 10px)`})},e.toDisplayString(m.label)+" "+e.toDisplayString(m.value),5))),128))]))}});const Re=K._export_sfc(Ae,[["__scopeId","data-v-c47865cb"]]);const je={class:"klineSub"},Oe={class:"klineSub-tips"},Ie={key:0,class:"klineSub-tips-select"},$e={__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(o,{expose:k,emit:Y}){const{round:m}=A.x;let b,t;const g=Y,p=o,s=e.ref(),w=e.computed({get(){return p.modelValue},set(r){g("update:modelValue",r)}}),D=e.computed(()=>{var v;const{data:r,activeIndex:M}=p;return((v=r==null?void 0:r.subIndicator)==null?void 0:v.map(E=>({label:E.key,color:E.color,value:E.data[M]||"-"})))||[]});e.onMounted(()=>{b=ne.init(s.value);let r=!0;t=new ResizeObserver(()=>{if(r){r=null;return}b.resize()}),t.observe(s.value)}),e.onUnmounted(()=>{b.dispose(),t.disconnect(),t=null});const l=(r,M)=>{const v=r[M],E=M===0?r[M]:r[M-1];return v[0]===v[1]?v[0]>=E[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:v[1]>v[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return k({connect:r=>{ne.connect([r,b])},draw:(r,M)=>{e.nextTick(()=>{const{startValue:v,endValue:E,maxValueSpan:V}=r,{leftYAxisRange:R,rightYAxisRange:T}=p.data.subIndicator[0],N=p.data.subIndicator.map(d=>{if(d.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:d.data.map((O,$)=>d.seriesColor==="kline"?{value:O,itemStyle:l(p.data.data,$)}:d.seriesColor==="value"?{value:O,itemStyle:{color:O>=0?"#FF0000":"#00FFFF"}}:{value:O,itemStyle:{color:d.seriesColor}})};if(d.series==="line")return{xAxisIndex:0,yAxisIndex:d.yAxis==="right"?2:1,name:d.key,type:"line",silent:!0,symbol:"none",data:d.data,lineStyle:{width:1},itemStyle:{color:d.color}}});b.setOption({animation:!1,grid:{left:`${M.gridLeft}px`,top:"10px",right:`${M.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:v,endValue:E,maxValueSpan:V}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:d=>{const{axisDimension:O,value:$}=d;if(O==="x")return["6","7","8"].includes(p.cycle)?u.dayjs($).format("YYYY-MM-DD"):$;if(d.axisIndex===1)return String(m($))}}},formatter:()=>""},xAxis:{type:"category",data:p.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:d=>["6","7","8"].includes(p.cycle)?u.dayjs(d).format("YYYY-MM-DD"):d}},yAxis:[{position:"right"},{position:"left",min:R==="cover"?d=>d.min:null,max:R==="cover"?d=>d.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:T==="cover"?d=>d.min:null,max:T==="cover"?d=>d.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:N},!0)})}}),(r,M)=>{const v=ie.ElOption,E=ie.ElSelect;return e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Oe,[D.value.length?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(E,{modelValue:w.value,"onUpdate:modelValue":M[0]||(M[0]=V=>w.value=V),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.subIndicatorList,V=>(e.openBlock(),e.createBlock(v,{key:V.value,label:V.label,value:V.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(Re,{data:D.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:s},null,512)])}}},Pe=K._export_sfc($e,[["__scopeId","data-v-7ec4c8cf"]]),Ce=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(o,{emit:k}){const Y=k,m=e.ref(),b=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),g=()=>{t.value.display="none",Y("closeContextMenuCallBack"),document.removeEventListener("click",g)},p=s=>{if(s.preventDefault(),t.value.display==="block"){const{offsetX:w,offsetY:D}=s,{offsetWidth:l,offsetHeight:r}=b.value;if(w<=l&&D<=r)return}m.value.click(),t.value={display:"block",top:`${s.offsetY}px`,left:`${s.offsetX}px`},e.nextTick(()=>{const w=m.value.getBoundingClientRect(),D=b.value.getBoundingClientRect();D.left+D.width>=w.right&&(t.value.left=`${s.offsetX-D.width}px`),D.top+D.height>=w.bottom&&(console.log("高度超出"),t.value.top=`${s.offsetY-D.height}px`)}),document.addEventListener("click",g)};return(s,w)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:m,class:"contextmenu",onContextmenu:p,onMouseleave:g},[e.renderSlot(s.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:b,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(s.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const We=K._export_sfc(Ce,[["__scopeId","data-v-811db6b4"]]);const ue=o=>(e.pushScopeId("data-v-9e6456be"),o=o(),e.popScopeId(),o),ze={class:"klineBasic-tips"},Ke={key:0,class:"klineBasic-sub"},Ue={key:1,class:"klineBasic-empty"},He={key:2,class:"klineBasic-error"},Ze=ue(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),Xe={style:{"text-align":"center"}},Ge=ue(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),Je={class:"dialog-footer"},Qe={__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(o,{expose:k,emit:Y}){const m=[{label:"画线预警",key:"drawWarningLine"}];let b=null,t=null,g,p,s=!1,w=!1;const D=Y,l=o,r=e.ref(!1),M=e.ref(!1),v=e.ref(!1),E=e.ref(null),V=e.ref(null),R=e.ref("VOL"),T=e.ref(0),N=e.ref({}),d=e.ref([]),O=e.ref({}),$=e.ref(!1),H=e.ref(""),Q=e.ref([...m]),C=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,showSubChart:!0,gridTop:48,gridLeft:80,gridRight:50,showWarningLine:!0,getFactorData:!0,...l.config}));e.watch(()=>{var i,n;return[l.variety,l.cycle,l.mainIndicator,R.value,(i=l.indicatorStore)==null?void 0:i.filterIndicator,(n=l.indicatorStore)==null?void 0:n.customIndicator]},()=>{ee()},{deep:!0}),e.onMounted(()=>{ke(l.env),ee(),window.addEventListener("keydown",oe)}),e.onUnmounted(()=>{t==null||t.off("datazoom"),t==null||t.off("highlight"),t==null||t.off("globalout"),t==null||t.dispose(),b==null||b.dispose(),window.removeEventListener("keydown",oe)});const de=()=>{t||(t=ne.init(E.value),fe(),C.value.showSubChart&&V.value.connect(t),b=A.D(E.value),b.listen(()=>{requestAnimationFrame(()=>{t.resize()})}))},oe=({code:i,ctrlKey:n})=>{if(!(n||r.value))return;const{xAxis:x,dataZoom:f}=t.getOption(),{data:y}=(x==null?void 0:x[0])??{data:[]};let{startValue:a,endValue:c}=(f==null?void 0:f[0])??{};if(y!=null&&y.length){switch(i){case"ArrowUp":{if(c-a<5)return;const S=Math.floor((c-a)/2)+1;a=a+S,c-a<5&&(a=c-4);break}case"ArrowDown":{const S=Math.min(500,c-a);a=a-S-1;break}case"ArrowLeft":{a>0&&(a-=1,c-=1),T.value>0&&(T.value-=1);break}case"ArrowRight":{c<y.length-1&&(a+=1,c+=1),r.value&&T.value<y.length-1&&(T.value+=1);break}}t.dispatchAction({type:"dataZoom",startValue:a,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:r.value?T.value:null}),t.dispatchAction({type:"highlight",dataIndex:r.value?T.value:c})}},fe=()=>{t==null||t.on("datazoom",n=>{clearTimeout(p),p=setTimeout(()=>{var f,y,a,c;const{loadCheckCounts:x}=C.value;if((y=(f=t==null?void 0:t.getOption())==null?void 0:f.dataZoom)!=null&&y[0]){const{startValue:S}=(c=(a=t==null?void 0:t.getOption())==null?void 0:a.dataZoom)==null?void 0:c[0];S<x&&s===!1&&w===!1&&(s=!0,pe("history")),Z()}clearTimeout(p)},100)}),t==null||t.on("highlight",n=>{var f,y;let x=n.dataIndex||-1;n.batch&&(x=typeof((f=n==null?void 0:n.batch[0])==null?void 0:f.dataIndex)=="number"?(y=n==null?void 0:n.batch[0])==null?void 0:y.dataIndex:-1),clearTimeout(g),g=setTimeout(()=>{T.value=x,clearTimeout(g)},20)}),t==null||t.on("globalout",()=>{var x,f,y;const n=(y=(f=(x=t==null?void 0:t.getOption())==null?void 0:x.dataZoom)==null?void 0:f[0])==null?void 0:y.endValue;T.value=n});let i=null;t==null||t.on("contextmenu",n=>{i=setTimeout(()=>{n.componentType==="graphic"&&(O.value=n.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}]),clearTimeout(i),i=null})})},ee=async()=>{var i,n,x,f,y,a;try{if(!l.variety||!l.cycle)return;const{variety:c,featureId:S,cycle:L,indicatorStore:h,mainIndicator:I,right:P,startTime:W,endTime:B}=l,{defaultShowCounts:F,addCounts:_,showWarningLine:te,getFactorData:G}=C.value,q={variety:c,featureId:S,cycle:L,mainIndicatorList:h.getIndicatorParams(I),subIndicator:R.value,right:P,showWarningLine:te,getFactorData:G};W&&B?(q.startTime=W,q.endTime=B):W?(q.startTime=W,q.limit=F+_):B?(q.endTime=B,q.limit=F+_):(q.endTime=u.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),q.limit=F+_);const j=await we(q);if((x=(n=(i=j==null?void 0:j.body)==null?void 0:i.kline)==null?void 0:n.time)!=null&&x.length)M.value=!1,v.value=!1;else{M.value=!0,v.value=!1;return}N.value=(f=j==null?void 0:j.body)==null?void 0:f.kline,d.value=((y=j==null?void 0:j.body)==null?void 0:y.warningLine)||[],ae(),Z(),G&&D("getFactorData",(a=j==null?void 0:j.body)==null?void 0:a.factor)}catch(c){throw v.value=!0,M.value=!1,new Error(c)}},pe=async i=>{const{variety:n,cycle:x,indicatorStore:f,mainIndicator:y,right:a}=l,{addCounts:c}=C.value,{time:S}=N.value;if(i==="history"){const L=await De({variety:n,cycle:x,endTime:S[0],limit:c,mainIndicatorList:f.getIndicatorParams(y),subIndicator:R.value,right:a});N.value={time:[...L.body.time,...N.value.time.slice(1)],data:[...L.body.data,...N.value.data.slice(1)],mainIndicator:N.value.mainIndicator.map((h,I)=>{var P;return{...h,data:[...((P=L.body.mainIndicator[I])==null?void 0:P.data)??[],...h.data.slice(1)]}}),subIndicator:N.value.subIndicator.map((h,I)=>{var P;return{...h,data:[...((P=L.body.subIndicator[I])==null?void 0:P.data)??[],...h.data.slice(1)]}})},ae(!0),L.body.data.length<c&&(w=!0),s=!1}},ae=(i=!1)=>{var I,P,W;de();const{time:n}=N.value,{gridRight:x,gridLeft:f,defaultShowCounts:y,maxShowCounts:a,showSubChart:c}=C.value;let S=n.length-1-y,L=n.length-1;if(i){const B=t.getOption(),F=(P=(I=B==null?void 0:B.xAxis)==null?void 0:I[0])==null?void 0:P.data,_=(W=B==null?void 0:B.dataZoom)==null?void 0:W[0],te=F[_==null?void 0:_.startValue],G=F[_==null?void 0:_.endValue];S=n.findIndex(q=>q===te),L=n.findIndex(q=>q===G)}const h=Te(N.value,C.value,S,L,l.cycle);if(t.setOption(h,!0),T.value=L,l.brushRange){let B=null,F=null;switch(l.cycle){case"6":{B=n.find(_=>new Date(_).getTime()>=new Date(l.brushRange[0]).getTime()||u.dayjs(_).format("YYYY-MM-DD")===u.dayjs(l.brushRange[0]).format("YYYY-MM-DD")),F=n.findLast(_=>new Date(_).getTime()<=new Date(l.brushRange[1]).getTime()||u.dayjs(_).format("YYYY-MM-DD")===u.dayjs(l.brushRange[1]).format("YYYY-MM-DD"));break}case"7":{B=n.find(_=>u.dayjs(_).day(5).format("YYYY-MM-DD")===u.dayjs(l.brushRange[0]).day(5).format("YYYY-MM-DD")),F=n.findLast(_=>u.dayjs(_).day(5).format("YYYY-MM-DD")===u.dayjs(l.brushRange[1]).day(5).format("YYYY-MM-DD"));break}case"8":{B=n.find(_=>u.dayjs(_).endOf("month").format("YYYY-MM-DD")===u.dayjs(l.brushRange[0]).endOf("month").format("YYYY-MM-DD")),F=n.findLast(_=>u.dayjs(_).endOf("month").format("YYYY-MM-DD")===u.dayjs(l.brushRange[1]).endOf("month").format("YYYY-MM-DD"));break}default:B=n.find(_=>new Date(_).getTime()>=new Date(l.brushRange[0]).getTime()),F=n.findLast(_=>new Date(_).getTime()<=new Date(l.brushRange[1]).getTime())}console.log(B,F),t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[B,F],xAxisIndex:0}]})}c&&V.value.draw({startValue:S,endValue:L,maxValueSpan:a},{gridLeft:f,gridRight:x}),re()},Z=()=>{if(!t)return;const i=t==null?void 0:t.getOption();i&&(t==null||t.setOption({...i,graphic:[...Le(t,d.value,l,C.value,()=>{X()})]},!0),re())},re=()=>{const{time:i}=N.value;if(l.brushRange&&(i!=null&&i.length)){let n=u.dayjs(l.brushRange[0]).format("YYYY-MM-DD 00:00:00"),x=u.dayjs(l.brushRange[1]).format("YYYY-MM-DD 23:59:59"),f=null,y=null;switch(l.cycle){case"6":{f=i.find(a=>u.dayjs(a).format("YYYY-MM-DD")===u.dayjs(n).format("YYYY-MM-DD")),y=f;break}case"7":{f=i.find(a=>u.dayjs(a).day(5).format("YYYY-MM-DD")===u.dayjs(n).day(5).format("YYYY-MM-DD")),y=i.findLast(a=>u.dayjs(a).day(5).format("YYYY-MM-DD")===u.dayjs(x).day(5).format("YYYY-MM-DD"));break}case"8":{f=i.find(a=>u.dayjs(a).endOf("month").format("YYYY-MM-DD")===u.dayjs(n).endOf("month").format("YYYY-MM-DD")),y=i.findLast(a=>u.dayjs(a).endOf("month").format("YYYY-MM-DD")===u.dayjs(x).endOf("month").format("YYYY-MM-DD"));break}default:f=i.find(a=>{const c=u.dayjs(a).format("YYYY-MM-DD")===u.dayjs(n).format("YYYY-MM-DD"),S=new Date(a).getTime()>=new Date(n).getTime();return c&&S}),y=i.findLast(a=>{const c=u.dayjs(a).format("YYYY-MM-DD")===u.dayjs(x).format("YYYY-MM-DD"),S=new Date(a).getTime()<=new Date(x).getTime();return c&&S})}t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[f,y],xAxisIndex:0}]})}},X=async()=>{const i=await Se({featureId:l.featureId});d.value=(i==null?void 0:i.body)||[],Z(),D("change","warningLine",d.value)},ye=async i=>{const{variety:n,varietyName:x,featureId:f,featureType:y}=l;if(i.key==="drawWarningLine"){const a=t==null?void 0:t.getOption(),c=a.tooltip[0];t==null||t.setOption({...a,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...c.axisPointer.label,backgroundColor:"transparent",formatter:L=>""}}}});const S=async L=>{t==null||t.getZr().off("mousedown",S);const h=t==null?void 0:t.convertFromPixel({yAxisIndex:0},L.offsetY),I=Math.round(h*1e3)/1e3;t==null||t.setOption({...a,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...c.axisPointer.label,backgroundColor:null}}}}),await Me({featureCode:n,featureName:x,featureId:f,featureType:y,warnPrice:I}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",S)}else i.key==="deleteWarningLine"?(await Ve({id:O.value.id}),J.ElMessage.success("画线预警删除成功"),X()):i.key==="changeWarningLine"&&($.value=!0,H.value=O.value.warnPrice)},me=async()=>{const{variety:i,varietyName:n,featureId:x,featureType:f}=l;await ce({id:O.value.id,featureCode:i,featureName:n,featureId:x,featureType:f,warnPrice:H.value}),J.ElMessage.success("画线预警修改成功"),X()},ge=()=>{Q.value=[...m]};return k({draw:(i,n)=>{i==="warningLine"&&(d.value=n,Z())}}),(i,n)=>{var L;const x=le.ElMenuItem,f=le.ElMenu,y=_e.ElEmpty,a=be.ElButton,c=xe.ElInputNumber,S=ve.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:n[1]||(n[1]=h=>r.value=!0),onMouseout:n[2]||(n[2]=h=>r.value=!1)},[e.createElementVNode("div",ze,[e.createVNode(Fe,{data:N.value,activeIndex:T.value},null,8,["data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:C.value.showSubChart?"70%":"100%"})},[e.createVNode(We,{onCloseContextMenuCallBack:ge},{popover:e.withCtx(()=>[e.createVNode(f,{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(x,{style:{height:"36px"},key:h.key,index:h.key,onClick:I=>ye(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:E,style:{height:"100%"}},null,512)]),_:1})],4),C.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(Pe,{ref_key:"klineSubRef",ref:V,modelValue:R.value,"onUpdate:modelValue":n[0]||(n[0]=h=>R.value=h),data:N.value,cycle:o.cycle,activeIndex:T.value,subIndicatorList:(L=o.indicatorStore)==null?void 0:L.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(y,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("div",He,[Ze,e.createElementVNode("div",Xe,[e.createVNode(a,{onClick:ee},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(S,{modelValue:$.value,"onUpdate:modelValue":n[5]||(n[5]=h=>$.value=h),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",Je,[e.createVNode(a,{onClick:n[4]||(n[4]=h=>$.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(a,{type:"primary",onClick:me},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[Ge,e.createVNode(c,{modelValue:H.value,"onUpdate:modelValue":n[3]||(n[3]=h=>H.value=h),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},et=K._export_sfc(Qe,[["__scopeId","data-v-9e6456be"]]),tt={install(o){o.component("st-klineBasic",et)}};module.exports=tt;
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const ve=require("./el-dialog-ae86edb8.cjs");require("./el-overlay-9e34965f.cjs");require("./el-input-7fd293af.cjs");const xe=require("./el-input-number-22e21d16.cjs"),be=require("./el-button-eec58cff.cjs"),_e=require("./el-empty-1697ded8.cjs"),le=require("./el-menu-item-17dc717e.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-b6c99b28.cjs");const e=require("vue"),he=require("echarts"),d=require("./dayjs.min-2c20abe6.cjs"),A=require("./index-8901a38c.cjs"),J=require("./el-message-5e6a6be9.cjs"),K=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-a33c4b22.cjs");const ie=require("./el-select-d8d91db1.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./index-098c2447.cjs");require("./use-form-common-props-fd9b61a0.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-30d7d8ce.cjs");require("./index-c108567d.cjs");require("./typescript-b63f8e83.cjs");require("./index-11547a0c.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-a584d81e.cjs");require("./index-298075cf.cjs");require("./index-f3562b52.cjs");require("./castArray-35947698.cjs");require("./debounce-62f5b6e8.cjs");function Ye(o){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const D in o)if(D!=="default"){const s=Object.getOwnPropertyDescriptor(o,D);Object.defineProperty(Y,D,s.get?s:{enumerable:!0,get:()=>o[D]})}}return Y.default=o,Object.freeze(Y)}const ne=Ye(he);let z=null;const ke=o=>{const Y=A.y(o,{handleReq:D=>{A.v()&&(D.headers.token=A.U())},handleRes:D=>{const{data:s}=D;if(s.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:A.K(),!0}});Y.get,z=Y.post},we=o=>z("/middleLayer/kline/getKlineBasic",{...o,userId:A.V("id")}),De=o=>z("/middleLayer/kline/getKline",o),Me=async o=>z("/alarm/deliversign/addAlarmPrice",{...o,userId:A.V("id")}),Se=async o=>z("/alarm/deliversign/findAlarmPriceByUserId",{...o,userId:A.V("id")}),ce=async o=>z("/alarm/deliversign/updateAlarmPrice",{...o,userId:A.V("id")}),Ve=async o=>z("/alarm/deliversign/deleteAlarmPrice",{...o,userId:A.V("id")}),{round:U}=A.x,Te=(o,Y,D,s,v)=>{const{data:t,time:M}=o,{gridTop:u,gridRight:x,gridLeft:f,maxShowCounts:m,showSubChart:a}=Y;return{animation:!1,grid:{top:`${u}px`,right:`${x}px`,bottom:a?"6px":"24px",left:`${f}px`},dataZoom:[{type:"inside",startValue:D,endValue:s,maxValueSpan:m}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:r=>{const{axisDimension:k,value:b}=r;return k==="x"?a?"":["6","7","8"].includes(v)?d.dayjs(b).format("YYYY-MM-DD"):b:String(U(b))}}},formatter:()=>""},xAxis:{show:!a,type:"category",data:M,splitLine:{show:!1},axisLabel:{formatter:r=>["6","7","8"].includes(v)?d.dayjs(r).format("YYYY-MM-DD"):r}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:r=>U(r.min),max:r=>U(r.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...o.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)"}}}},Le=(o,Y,D,s,v)=>{const{variety:t,featureId:M,featureType:u}=D,{gridTop:x,gridLeft:f,gridRight:m}=s;return Y.reduce((a,r)=>{const{warnPrice:k}=r,b=o==null?void 0:o.convertToPixel({yAxisIndex:0},k);if(b<=x||b>=(o==null?void 0:o.getHeight()))return a;let E=0;return[...a,{type:"group",name:"warningLine",info:r,draggable:"vertical",children:[{type:"line",info:r,shape:{x1:f,y1:b,x2:(o==null?void 0:o.getWidth())-m,y2:b},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:r,x:(o==null?void 0:o.getWidth())-m,y:b-5,style:{fill:"#FFF",text:k,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:V=>{E=V.offsetY},ondrag:V=>{var R;if(V.target&&V.target.childAt(1)){const T=o.convertFromPixel({yAxisIndex:0},b+(V.offsetY-E));(R=V.target.childAt(1))==null||R.animate("style",!1).when(1,{text:U(T,3)}).start()}},ondragend:async V=>{const T=V.offsetY-E;if(T!==0){const N=o==null?void 0:o.convertFromPixel({yAxisIndex:0},T+b),p={id:r.id,warnPrice:U(N,3),featureId:M,featureCode:t,featureType:u};await ce(p),J.ElMessage.success("画线预警修改成功"),v&&v()}}}]},[])},Be=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){const Y=o,D=e.ref(null),s=e.ref([]);return e.watch(()=>Y.data,()=>{s.value.length===0&&e.nextTick(()=>{Array.from(D.value.children).forEach((v,t)=>{var M,u,x,f,m,a;((u=(M=Y.data)==null?void 0:M[t])==null?void 0:u.label)==="涨跌"?s.value[t]="85px":((f=(x=Y.data)==null?void 0:x[t])==null?void 0:f.label)==="至今涨跌"?s.value[t]="100px":((a=(m=Y.data)==null?void 0:m[t])==null?void 0:a.label)==="额"?s.value[t]="75px":s.value[t]=`${v.offsetWidth+30}px`})})}),(v,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:D},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.data,(M,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"kline-tips-item",style:e.normalizeStyle({color:M.color,width:s.value[u]?s.value[u]:null})},e.toDisplayString(M.label)+" "+e.toDisplayString(M.value),5))),128))],512))}});const se=K._export_sfc(Be,[["__scopeId","data-v-72cabbd6"]]);const Ee={class:"kline-tips"},Ne={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0}},setup(o){const{round:Y,formatValue:D}=A.x,s=o,v=e.ref(null);e.watch(()=>s.activeIndex,()=>{v.value===null&&(v.value=s.data.data[s.activeIndex][1])});const t=e.computed(()=>{const{data:u,activeIndex:x}=s;if(u.data&&u.data[x]){const f=u.data[x],m=[{label:"开",value:f[0]},{label:"高",value:f[3]},{label:"低",value:f[2]},{label:"收",value:f[1]}];f[4]!==null&&m.push({label:"额",value:D(f[4])});let a;f[6]>0?a="red":f[6]<0&&(a="green"),m.push({label:"涨跌",value:`${Y(f[6])}%`,color:a});const r=(v.value/f[1]-1)*100;let k;return r>0?k="red":r<0&&(k="green"),m.push({label:"至今涨幅",value:`${Y(r)}%`,color:k}),m}return[]}),M=e.computed(()=>{var f;const{data:u,activeIndex:x}=s;return((f=u==null?void 0:u.mainIndicator)==null?void 0:f.map(m=>({label:m.key,value:Y(m.data[x]),color:m.color})))||[]});return(u,x)=>(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(se,{data:t.value},null,8,["data"]),e.createVNode(se,{data:M.value},null,8,["data"])]))}},Fe=K._export_sfc(Ne,[["__scopeId","data-v-85e9befe"]]),qe={class:"kline-averageTips"},Ae=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){return(Y,D)=>(e.openBlock(),e.createElementBlock("div",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.data,(s,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"kline-averageTips-item",style:e.normalizeStyle({color:s.color,width:`calc(100% / ${o.data.length} - 10px)`})},e.toDisplayString(s.label)+" "+e.toDisplayString(s.value),5))),128))]))}});const Re=K._export_sfc(Ae,[["__scopeId","data-v-c47865cb"]]);const je={class:"klineSub"},Oe={class:"klineSub-tips"},Ie={key:0,class:"klineSub-tips-select"},$e={__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(o,{expose:Y,emit:D}){const{round:s}=A.x;let v,t;const M=D,u=o,x=e.ref(),f=e.computed({get(){return u.modelValue},set(r){M("update:modelValue",r)}}),m=e.computed(()=>{var b;const{data:r,activeIndex:k}=u;return((b=r==null?void 0:r.subIndicator)==null?void 0:b.map(E=>({label:E.key,color:E.color,value:E.data[k]||"-"})))||[]});e.onMounted(()=>{v=ne.init(x.value);let r=!0;t=new ResizeObserver(()=>{if(r){r=null;return}v.resize()}),t.observe(x.value)}),e.onUnmounted(()=>{v.dispose(),t.disconnect(),t=null});const a=(r,k)=>{const b=r[k],E=k===0?r[k]:r[k-1];return b[0]===b[1]?b[0]>=E[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:b[1]>b[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return Y({connect:r=>{ne.connect([r,v])},draw:(r,k)=>{e.nextTick(()=>{const{startValue:b,endValue:E,maxValueSpan:V}=r,{leftYAxisRange:R,rightYAxisRange:T}=u.data.subIndicator[0],N=u.data.subIndicator.map(p=>{if(p.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:p.data.map((O,$)=>p.seriesColor==="kline"?{value:O,itemStyle:a(u.data.data,$)}:p.seriesColor==="value"?{value:O,itemStyle:{color:O>=0?"#FF0000":"#00FFFF"}}:{value:O,itemStyle:{color:p.seriesColor}})};if(p.series==="line")return{xAxisIndex:0,yAxisIndex:p.yAxis==="right"?2:1,name:p.key,type:"line",silent:!0,symbol:"none",data:p.data,lineStyle:{width:1},itemStyle:{color:p.color}}});v.setOption({animation:!1,grid:{left:`${k.gridLeft}px`,top:"10px",right:`${k.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:b,endValue:E,maxValueSpan:V}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:p=>{const{axisDimension:O,value:$}=p;if(O==="x")return["6","7","8"].includes(u.cycle)?d.dayjs($).format("YYYY-MM-DD"):$;if(p.axisIndex===1)return String(s($))}}},formatter:()=>""},xAxis:{type:"category",data:u.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:p=>["6","7","8"].includes(u.cycle)?d.dayjs(p).format("YYYY-MM-DD"):p}},yAxis:[{position:"right"},{position:"left",min:R==="cover"?p=>p.min:null,max:R==="cover"?p=>p.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:T==="cover"?p=>p.min:null,max:T==="cover"?p=>p.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:N},!0)})}}),(r,k)=>{const b=ie.ElOption,E=ie.ElSelect;return e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Oe,[m.value.length?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(E,{modelValue:f.value,"onUpdate:modelValue":k[0]||(k[0]=V=>f.value=V),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.subIndicatorList,V=>(e.openBlock(),e.createBlock(b,{key:V.value,label:V.label,value:V.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(Re,{data:m.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:x},null,512)])}}},Pe=K._export_sfc($e,[["__scopeId","data-v-7ec4c8cf"]]),Ce=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(o,{emit:Y}){const D=Y,s=e.ref(),v=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),M=()=>{t.value.display="none",D("closeContextMenuCallBack"),document.removeEventListener("click",M)},u=x=>{if(x.preventDefault(),t.value.display==="block"){const{offsetX:f,offsetY:m}=x,{offsetWidth:a,offsetHeight:r}=v.value;if(f<=a&&m<=r)return}s.value.click(),t.value={display:"block",top:`${x.offsetY}px`,left:`${x.offsetX}px`},e.nextTick(()=>{const f=s.value.getBoundingClientRect(),m=v.value.getBoundingClientRect();m.left+m.width>=f.right&&(t.value.left=`${x.offsetX-m.width}px`),m.top+m.height>=f.bottom&&(console.log("高度超出"),t.value.top=`${x.offsetY-m.height}px`)}),document.addEventListener("click",M)};return(x,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:s,class:"contextmenu",onContextmenu:u,onMouseleave:M},[e.renderSlot(x.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:v,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(x.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const We=K._export_sfc(Ce,[["__scopeId","data-v-811db6b4"]]);const ue=o=>(e.pushScopeId("data-v-9e6456be"),o=o(),e.popScopeId(),o),ze={class:"klineBasic-tips"},Ke={key:0,class:"klineBasic-sub"},Ue={key:1,class:"klineBasic-empty"},He={key:2,class:"klineBasic-error"},Ze=ue(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),Xe={style:{"text-align":"center"}},Ge=ue(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),Je={class:"dialog-footer"},Qe={__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(o,{expose:Y,emit:D}){const s=[{label:"画线预警",key:"drawWarningLine"}];let v=null,t=null,M,u,x=!1,f=!1;const m=D,a=o,r=e.ref(!1),k=e.ref(!1),b=e.ref(!1),E=e.ref(null),V=e.ref(null),R=e.ref("VOL"),T=e.ref(0),N=e.ref({}),p=e.ref([]),O=e.ref({}),$=e.ref(!1),H=e.ref(""),Q=e.ref([...s]),C=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,showSubChart:!0,gridTop:48,gridLeft:80,gridRight:50,showWarningLine:!0,getFactorData:!0,...a.config}));e.watch(()=>{var i,n;return[a.variety,a.cycle,a.mainIndicator,R.value,(i=a.indicatorStore)==null?void 0:i.filterIndicator,(n=a.indicatorStore)==null?void 0:n.customIndicator]},()=>{ee()},{deep:!0}),e.onMounted(()=>{ke(a.env),ee(),window.addEventListener("keydown",oe)}),e.onUnmounted(()=>{t==null||t.off("datazoom"),t==null||t.off("highlight"),t==null||t.off("globalout"),t==null||t.dispose(),v==null||v.dispose(),window.removeEventListener("keydown",oe)});const de=()=>{t||(t=ne.init(E.value),fe(),C.value.showSubChart&&V.value.connect(t),v=A.D(E.value),v.listen(()=>{requestAnimationFrame(()=>{t.resize()})}))},oe=({code:i,ctrlKey:n})=>{if(!(n||r.value))return;const{xAxis:_,dataZoom:y}=t.getOption(),{data:g}=(_==null?void 0:_[0])??{data:[]};let{startValue:l,endValue:c}=(y==null?void 0:y[0])??{};if(g!=null&&g.length){switch(i){case"ArrowUp":{if(c-l<5)return;const S=Math.floor((c-l)/2)+1;l=l+S,c-l<5&&(l=c-4);break}case"ArrowDown":{const S=Math.min(500,c-l);l=l-S-1;break}case"ArrowLeft":{l>0&&(l-=1,c-=1),T.value>0&&(T.value-=1);break}case"ArrowRight":{c<g.length-1&&(l+=1,c+=1),r.value&&T.value<g.length-1&&(T.value+=1);break}}t.dispatchAction({type:"dataZoom",startValue:l,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:r.value?T.value:null}),t.dispatchAction({type:"highlight",dataIndex:r.value?T.value:c})}},fe=()=>{t==null||t.on("datazoom",n=>{clearTimeout(u),u=setTimeout(()=>{var y,g,l,c;const{loadCheckCounts:_}=C.value;if((g=(y=t==null?void 0:t.getOption())==null?void 0:y.dataZoom)!=null&&g[0]){const{startValue:S}=(c=(l=t==null?void 0:t.getOption())==null?void 0:l.dataZoom)==null?void 0:c[0];S<_&&x===!1&&f===!1&&(x=!0,pe("history")),Z()}clearTimeout(u)},100)}),t==null||t.on("highlight",n=>{var y,g;let _=n.dataIndex||-1;n.batch&&(_=typeof((y=n==null?void 0:n.batch[0])==null?void 0:y.dataIndex)=="number"?(g=n==null?void 0:n.batch[0])==null?void 0:g.dataIndex:-1),clearTimeout(M),M=setTimeout(()=>{T.value=_,clearTimeout(M)},20)}),t==null||t.on("globalout",()=>{var _,y,g;const n=(g=(y=(_=t==null?void 0:t.getOption())==null?void 0:_.dataZoom)==null?void 0:y[0])==null?void 0:g.endValue;T.value=n});let i=null;t==null||t.on("contextmenu",n=>{i=setTimeout(()=>{n.componentType==="graphic"&&(O.value=n.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}]),clearTimeout(i),i=null})})},ee=async()=>{var i,n,_,y,g,l;try{if(!a.variety||!a.cycle)return;const{variety:c,featureId:S,cycle:L,indicatorStore:w,mainIndicator:I,right:P,startTime:W,endTime:B}=a,{defaultShowCounts:F,addCounts:h,showWarningLine:te,getFactorData:G}=C.value,q={variety:c,featureId:S,cycle:L,mainIndicatorList:w.getIndicatorParams(I),subIndicator:R.value,right:P,showWarningLine:te,getFactorData:G};W&&B?(q.startTime=W,q.endTime=B):W?(q.startTime=W,q.limit=F+h):B?(q.endTime=B,q.limit=F+h):(q.endTime=d.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),q.limit=F+h);const j=await we(q);if((_=(n=(i=j==null?void 0:j.body)==null?void 0:i.kline)==null?void 0:n.time)!=null&&_.length)k.value=!1,b.value=!1;else{k.value=!0,b.value=!1;return}N.value=(y=j==null?void 0:j.body)==null?void 0:y.kline,p.value=((g=j==null?void 0:j.body)==null?void 0:g.warningLine)||[],ae(),Z(),G&&m("getFactorData",(l=j==null?void 0:j.body)==null?void 0:l.factor)}catch(c){throw b.value=!0,k.value=!1,new Error(c)}},pe=async i=>{const{variety:n,cycle:_,indicatorStore:y,mainIndicator:g,right:l}=a,{addCounts:c}=C.value,{time:S}=N.value;if(i==="history"){const L=await De({variety:n,cycle:_,endTime:S[0],limit:c,mainIndicatorList:y.getIndicatorParams(g),subIndicator:R.value,right:l});N.value={time:[...L.body.time,...N.value.time.slice(1)],data:[...L.body.data,...N.value.data.slice(1)],mainIndicator:N.value.mainIndicator.map((w,I)=>{var P;return{...w,data:[...((P=L.body.mainIndicator[I])==null?void 0:P.data)??[],...w.data.slice(1)]}}),subIndicator:N.value.subIndicator.map((w,I)=>{var P;return{...w,data:[...((P=L.body.subIndicator[I])==null?void 0:P.data)??[],...w.data.slice(1)]}})},ae(!0),L.body.data.length<c&&(f=!0),x=!1}},ae=(i=!1)=>{var I,P,W;de();const{time:n}=N.value,{gridRight:_,gridLeft:y,defaultShowCounts:g,maxShowCounts:l,showSubChart:c}=C.value;let S=n.length-1-g,L=n.length-1;if(i){const B=t.getOption(),F=(P=(I=B==null?void 0:B.xAxis)==null?void 0:I[0])==null?void 0:P.data,h=(W=B==null?void 0:B.dataZoom)==null?void 0:W[0],te=F[h==null?void 0:h.startValue],G=F[h==null?void 0:h.endValue];S=n.findIndex(q=>q===te),L=n.findIndex(q=>q===G)}const w=Te(N.value,C.value,S,L,a.cycle);if(t.setOption(w,!0),T.value=L,a.brushRange){let B=null,F=null;switch(a.cycle){case"6":{B=n.find(h=>new Date(h).getTime()>=new Date(a.brushRange[0]).getTime()||d.dayjs(h).format("YYYY-MM-DD")===d.dayjs(a.brushRange[0]).format("YYYY-MM-DD")),F=n.findLast(h=>new Date(h).getTime()<=new Date(a.brushRange[1]).getTime()||d.dayjs(h).format("YYYY-MM-DD")===d.dayjs(a.brushRange[1]).format("YYYY-MM-DD"));break}case"7":{B=n.find(h=>d.dayjs(h).day(5).format("YYYY-MM-DD")===d.dayjs(a.brushRange[0]).day(5).format("YYYY-MM-DD")),F=n.findLast(h=>d.dayjs(h).day(5).format("YYYY-MM-DD")===d.dayjs(a.brushRange[1]).day(5).format("YYYY-MM-DD"));break}case"8":{B=n.find(h=>d.dayjs(h).endOf("month").format("YYYY-MM-DD")===d.dayjs(a.brushRange[0]).endOf("month").format("YYYY-MM-DD")),F=n.findLast(h=>d.dayjs(h).endOf("month").format("YYYY-MM-DD")===d.dayjs(a.brushRange[1]).endOf("month").format("YYYY-MM-DD"));break}default:B=n.find(h=>new Date(h).getTime()>=new Date(a.brushRange[0]).getTime()),F=n.findLast(h=>new Date(h).getTime()<=new Date(a.brushRange[1]).getTime())}console.log(B,F),t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[B,F],xAxisIndex:0}]})}c&&V.value.draw({startValue:S,endValue:L,maxValueSpan:l},{gridLeft:y,gridRight:_}),re()},Z=()=>{if(!t)return;const i=t==null?void 0:t.getOption();i&&(t==null||t.setOption({...i,graphic:[...Le(t,p.value,a,C.value,()=>{X()})]},!0),re())},re=()=>{const{time:i}=N.value;if(a.brushRange&&(i!=null&&i.length)){let n=d.dayjs(a.brushRange[0]).format("YYYY-MM-DD 00:00:00"),_=d.dayjs(a.brushRange[1]).format("YYYY-MM-DD 23:59:59"),y=null,g=null;switch(a.cycle){case"6":{y=i.find(l=>d.dayjs(l).format("YYYY-MM-DD")===d.dayjs(n).format("YYYY-MM-DD")),g=y;break}case"7":{y=i.find(l=>d.dayjs(l).day(5).format("YYYY-MM-DD")===d.dayjs(n).day(5).format("YYYY-MM-DD")),g=i.findLast(l=>d.dayjs(l).day(5).format("YYYY-MM-DD")===d.dayjs(_).day(5).format("YYYY-MM-DD"));break}case"8":{y=i.find(l=>d.dayjs(l).endOf("month").format("YYYY-MM-DD")===d.dayjs(n).endOf("month").format("YYYY-MM-DD")),g=i.findLast(l=>d.dayjs(l).endOf("month").format("YYYY-MM-DD")===d.dayjs(_).endOf("month").format("YYYY-MM-DD"));break}default:y=i.find(l=>{const c=d.dayjs(l).format("YYYY-MM-DD")===d.dayjs(n).format("YYYY-MM-DD"),S=new Date(l).getTime()>=new Date(n).getTime();return c&&S}),g=i.findLast(l=>{const c=d.dayjs(l).format("YYYY-MM-DD")===d.dayjs(_).format("YYYY-MM-DD"),S=new Date(l).getTime()<=new Date(_).getTime();return c&&S})}t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[y,g],xAxisIndex:0}]})}},X=async()=>{const i=await Se({featureId:a.featureId});p.value=(i==null?void 0:i.body)||[],Z(),m("change","warningLine",p.value)},ye=async i=>{const{variety:n,varietyName:_,featureId:y,featureType:g}=a;if(i.key==="drawWarningLine"){const l=t==null?void 0:t.getOption(),c=l.tooltip[0];t==null||t.setOption({...l,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...c.axisPointer.label,backgroundColor:"transparent",formatter:L=>""}}}});const S=async L=>{t==null||t.getZr().off("mousedown",S);const w=t==null?void 0:t.convertFromPixel({yAxisIndex:0},L.offsetY),I=Math.round(w*1e3)/1e3;t==null||t.setOption({...l,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...c.axisPointer.label,backgroundColor:null}}}}),await Me({featureCode:n,featureName:_,featureId:y,featureType:g,warnPrice:I}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",S)}else i.key==="deleteWarningLine"?(await Ve({id:O.value.id}),J.ElMessage.success("画线预警删除成功"),X()):i.key==="changeWarningLine"&&($.value=!0,H.value=O.value.warnPrice)},me=async()=>{const{variety:i,varietyName:n,featureId:_,featureType:y}=a;await ce({id:O.value.id,featureCode:i,featureName:n,featureId:_,featureType:y,warnPrice:H.value}),J.ElMessage.success("画线预警修改成功"),X()},ge=()=>{Q.value=[...s]};return Y({draw:(i,n)=>{i==="warningLine"&&(p.value=n,Z())}}),(i,n)=>{var L;const _=le.ElMenuItem,y=le.ElMenu,g=_e.ElEmpty,l=be.ElButton,c=xe.ElInputNumber,S=ve.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:n[1]||(n[1]=w=>r.value=!0),onMouseout:n[2]||(n[2]=w=>r.value=!1)},[e.createElementVNode("div",ze,[e.createVNode(Fe,{data:N.value,activeIndex:T.value},null,8,["data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:C.value.showSubChart?"70%":"100%"})},[e.createVNode(We,{onCloseContextMenuCallBack:ge},{popover:e.withCtx(()=>[e.createVNode(y,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,w=>(e.openBlock(),e.createBlock(_,{style:{height:"36px"},key:w.key,index:w.key,onClick:I=>ye(w)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:E,style:{height:"100%"}},null,512)]),_:1})],4),C.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(Pe,{ref_key:"klineSubRef",ref:V,modelValue:R.value,"onUpdate:modelValue":n[0]||(n[0]=w=>R.value=w),data:N.value,cycle:o.cycle,activeIndex:T.value,subIndicatorList:(L=o.indicatorStore)==null?void 0:L.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(g,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("div",He,[Ze,e.createElementVNode("div",Xe,[e.createVNode(l,{onClick:ee},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(S,{modelValue:$.value,"onUpdate:modelValue":n[5]||(n[5]=w=>$.value=w),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",Je,[e.createVNode(l,{onClick:n[4]||(n[4]=w=>$.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(l,{type:"primary",onClick:me},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[Ge,e.createVNode(c,{modelValue:H.value,"onUpdate:modelValue":n[3]||(n[3]=w=>H.value=w),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},et=K._export_sfc(Qe,[["__scopeId","data-v-9e6456be"]]),tt={install(o){o.component("st-klineBasic",et)}};module.exports=tt;
|