st-comp 0.0.221 → 0.0.222
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 +28 -28
- 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 +1 -2
- package/es/TreeMap.js +1 -163
- 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-eaef9418.js → _initCloneObject-71a2d663.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-b16efd62.js → config-provider-ef3c8ca2.js} +6 -6
- package/es/{debounce-8d53f4dd.js → debounce-e9e47f9a.js} +1 -1
- package/es/{dropdown-a59bba73.js → dropdown-41512a70.js} +13 -13
- package/es/{el-autocomplete-ba808eb6.js → el-autocomplete-6b56f161.js} +16 -16
- package/es/{el-button-c95adb85.js → el-button-72e66b1c.js} +39 -39
- package/es/{el-checkbox-7421ccd3.js → el-checkbox-7df65088.js} +31 -31
- package/es/{el-dialog-41ab8417.js → el-dialog-7d6e8f91.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-c53c374d.js → el-form-item-706eb72e.js} +36 -36
- package/es/{el-input-2f75c4ba.js → el-input-8cafa639.js} +55 -55
- package/es/{el-input-number-5193fe6d.js → el-input-number-7907c63c.js} +36 -36
- package/es/{el-loading-f6022062.js → el-loading-3cfc4e19.js} +5 -5
- package/es/{el-menu-item-7e881203.js → el-menu-item-f7436984.js} +22 -22
- package/es/{el-message-box-a93d2f6a.js → el-message-box-8e4d6990.js} +11 -11
- package/es/{el-message-e544a8f5.js → el-message-f3d56a3e.js} +23 -23
- package/es/{el-overlay-09ad71cd.js → el-overlay-31707230.js} +56 -56
- package/es/{el-popconfirm-81dcd202.js → el-popconfirm-b113716a.js} +20 -20
- package/es/{el-popper-b4f97157.js → el-popper-f28554e1.js} +109 -109
- package/es/{el-segmented-b868d074.js → el-segmented-5f4d8e64.js} +8 -8
- package/es/{el-select-95627997.js → el-select-90ba1ff9.js} +64 -64
- package/es/{el-table-column-376cd907.js → el-table-column-bccab55d.js} +15 -15
- package/es/{el-tag-66cab138.js → el-tag-f03f602d.js} +15 -15
- package/es/{el-text-ac60d0f2.js → el-text-f106c80e.js} +2 -2
- package/es/{index-57672682.js → index-00e91ed2.js} +3 -3
- package/es/{index-a871c3eb.js → index-065f4c40.js} +29 -29
- package/es/{index-844bdd85.js → index-158df623.js} +34 -34
- package/es/{index-960806da.js → index-269b8a8c.js} +36 -36
- package/es/{index-d91dc23f.js → index-49767c81.js} +12 -12
- package/es/{index-e5566b94.js → index-60dd8509.js} +43 -43
- package/es/{index-88546436.js → index-89707217.js} +17 -17
- package/es/{index-d77a7336.js → index-93a8960e.js} +1 -1
- package/es/{index-1f7d4f70.js → index-b792012c.js} +2 -2
- 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-815d48a6.js → use-form-common-props-1f967d2e.js} +67 -67
- package/es/{use-global-config-b5e9d3d5.js → use-global-config-ded5e07b.js} +14 -14
- package/es/{validator-764a9db0.js → validator-5c8b5cdc.js} +1 -1
- package/es/{vnode-5ddb7ed1.js → vnode-06571d5b.js} +1 -1
- package/es/{zh-cn-e963c628.js → zh-cn-cae8ba43.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +1 -1
- package/lib/{index-d3e408b3.js → index-b2c7b8c5.js} +3 -3
- package/lib/{python-34cb78d0.js → python-430bbf9c.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/components/Tips/index.vue +2 -2
- 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,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-ff0e366f.js";
|
|
2
|
+
import { E as oe } from "./el-button-72e66b1c.js";
|
|
3
|
+
import "./el-tag-f03f602d.js";
|
|
4
|
+
import { E as ye, a as Ee } from "./el-select-90ba1ff9.js";
|
|
5
5
|
import "./el-scrollbar-323542e7.js";
|
|
6
|
-
import "./el-popper-
|
|
7
|
-
import { E as ne } from "./el-popconfirm-
|
|
6
|
+
import "./el-popper-f28554e1.js";
|
|
7
|
+
import { E as ne } from "./el-popconfirm-b113716a.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 { a as X, f as ie, g as ce, h as Ne, E as re, j as Se } from "./index-065f4c40.js";
|
|
11
|
+
import { E as De } from "./el-divider-4fe55ebe.js";
|
|
12
|
+
import { E as Fe } from "./el-dialog-7d6e8f91.js";
|
|
13
|
+
import "./el-overlay-31707230.js";
|
|
14
|
+
import { E as ze } from "./el-empty-ceecb81c.js";
|
|
15
|
+
import { E as te } from "./el-input-8cafa639.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-f3d56a3e.js";
|
|
18
|
+
import { E as Me } from "./el-message-box-8e4d6990.js";
|
|
19
|
+
import { a as Oe, E as Be } from "./el-form-item-706eb72e.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-158df623.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-ded5e07b.js";
|
|
24
|
+
import "./use-form-common-props-1f967d2e.js";
|
|
25
|
+
import "./index-269b8a8c.js";
|
|
26
|
+
import "./index-93a8960e.js";
|
|
27
|
+
import "./index-60dd8509.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-00e91ed2.js";
|
|
30
|
+
import "./castArray-15070be9.js";
|
|
31
|
+
import "./index-49767c81.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-
|
|
36
|
+
import "./config-provider-ef3c8ca2.js";
|
|
37
|
+
import "./validator-5c8b5cdc.js";
|
|
38
|
+
import "./_initCloneObject-71a2d663.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-ff0e366f.js";
|
|
2
|
+
import { z as re, E as ne } from "./zh-cn-cae8ba43.js";
|
|
3
|
+
import { E as ue } from "./el-dialog-7d6e8f91.js";
|
|
4
|
+
import "./el-overlay-31707230.js";
|
|
5
|
+
import "./el-tag-f03f602d.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-f28554e1.js";
|
|
8
|
+
import { E as ie, a as ce } from "./el-table-column-bccab55d.js";
|
|
9
|
+
import { E as de, a as me } from "./el-checkbox-7df65088.js";
|
|
10
10
|
import "./el-scrollbar-323542e7.js";
|
|
11
|
-
import { E as fe } from "./el-popconfirm-
|
|
11
|
+
import { E as fe } from "./el-popconfirm-b113716a.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-72e66b1c.js";
|
|
14
|
+
import { E as ye, a as ve } from "./el-form-item-706eb72e.js";
|
|
15
|
+
import { E as _e } from "./el-input-8cafa639.js";
|
|
16
|
+
import { E as be } from "./el-text-f106c80e.js";
|
|
17
|
+
import { E as he } from "./el-input-number-7907c63c.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-5f4d8e64.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-065f4c40.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-8e4d6990.js";
|
|
25
|
+
import { E as Fe } from "./index-00e91ed2.js";
|
|
26
|
+
import "./config-provider-ef3c8ca2.js";
|
|
27
|
+
import "./use-global-config-ded5e07b.js";
|
|
28
|
+
import "./use-form-common-props-1f967d2e.js";
|
|
29
|
+
import "./index-269b8a8c.js";
|
|
30
|
+
import "./index-93a8960e.js";
|
|
31
|
+
import "./index-60dd8509.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-158df623.js";
|
|
36
|
+
import "./_initCloneObject-71a2d663.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-49767c81.js";
|
|
43
|
+
import "./validator-5c8b5cdc.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-f7436984.js";
|
|
3
3
|
import "./el-tooltip-4ed993c7.js";
|
|
4
|
-
import "./el-popper-
|
|
4
|
+
import "./el-popper-f28554e1.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-f03f602d.js";
|
|
11
|
+
import { E as Ee, a as Se } from "./el-select-90ba1ff9.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-1f967d2e.js";
|
|
14
|
+
import "./index-269b8a8c.js";
|
|
15
|
+
import "./index-065f4c40.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-60dd8509.js";
|
|
20
|
+
import "./index-93a8960e.js";
|
|
21
|
+
import "./index-158df623.js";
|
|
22
|
+
import "./index-00e91ed2.js";
|
|
23
|
+
import "./castArray-15070be9.js";
|
|
24
|
+
import "./index-49767c81.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 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]="70px":m.value[t]=`${b.offsetWidth+14}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-fda69be8"]]);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"),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;
|
package/es/KlineBasic.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import "./base-
|
|
2
|
-
import { E as Be } from "./el-dialog-
|
|
3
|
-
import "./el-overlay-
|
|
4
|
-
import "./el-input-
|
|
5
|
-
import { E as Ie } from "./el-input-number-
|
|
6
|
-
import { E as Oe } from "./el-button-
|
|
7
|
-
import { E as $e } from "./el-empty-
|
|
8
|
-
import { E as Pe, a as We } from "./el-menu-item-
|
|
1
|
+
import "./base-ff0e366f.js";
|
|
2
|
+
import { E as Be } from "./el-dialog-7d6e8f91.js";
|
|
3
|
+
import "./el-overlay-31707230.js";
|
|
4
|
+
import "./el-input-8cafa639.js";
|
|
5
|
+
import { E as Ie } from "./el-input-number-7907c63c.js";
|
|
6
|
+
import { E as Oe } from "./el-button-72e66b1c.js";
|
|
7
|
+
import { E as $e } from "./el-empty-ceecb81c.js";
|
|
8
|
+
import { E as Pe, a as We } from "./el-menu-item-f7436984.js";
|
|
9
9
|
import "./el-tooltip-4ed993c7.js";
|
|
10
|
-
import "./el-popper-
|
|
10
|
+
import "./el-popper-f28554e1.js";
|
|
11
11
|
import { defineComponent as ye, ref as T, watch as we, nextTick as ge, openBlock as A, createElementBlock as E, Fragment as Q, renderList as ue, normalizeStyle as ce, toDisplayString as ee, computed as te, createVNode as I, onMounted as De, onUnmounted as ke, createElementVNode as U, withCtx as K, createBlock as Me, createCommentVNode as G, renderSlot as _e, createTextVNode as ie, pushScopeId as Ne, popScopeId as qe } from "vue";
|
|
12
12
|
import * as me from "echarts";
|
|
13
13
|
import { d as u } from "./dayjs.min-8313b006.js";
|
|
14
14
|
import { y as Ce, v as ze, U as Ke, K as Ue, V as ne, x as ve, D as He } from "./index-7ed0999e.js";
|
|
15
|
-
import { E as se } from "./el-message-
|
|
15
|
+
import { E as se } from "./el-message-f3d56a3e.js";
|
|
16
16
|
import { _ as X } from "./_plugin-vue_export-helper-dad06003.js";
|
|
17
|
-
import "./el-tag-
|
|
18
|
-
import { E as je, a as Ze } from "./el-select-
|
|
17
|
+
import "./el-tag-f03f602d.js";
|
|
18
|
+
import { E as je, a as Ze } from "./el-select-90ba1ff9.js";
|
|
19
19
|
import "./el-scrollbar-323542e7.js";
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./use-form-common-props-
|
|
22
|
-
import "./index-
|
|
23
|
-
import "./index-
|
|
20
|
+
import "./index-065f4c40.js";
|
|
21
|
+
import "./use-form-common-props-1f967d2e.js";
|
|
22
|
+
import "./index-269b8a8c.js";
|
|
23
|
+
import "./index-93a8960e.js";
|
|
24
24
|
import "./index-2e331d74.js";
|
|
25
|
-
import "./vnode-
|
|
26
|
-
import "./scroll-
|
|
27
|
-
import "./use-global-config-
|
|
28
|
-
import "./index-
|
|
25
|
+
import "./vnode-06571d5b.js";
|
|
26
|
+
import "./scroll-41b4f625.js";
|
|
27
|
+
import "./use-global-config-ded5e07b.js";
|
|
28
|
+
import "./index-60dd8509.js";
|
|
29
29
|
import "./typescript-7ae59c4c.js";
|
|
30
|
-
import "./index-
|
|
30
|
+
import "./index-49767c81.js";
|
|
31
31
|
import "./index-657047bb.js";
|
|
32
|
-
import "./config-provider-
|
|
33
|
-
import "./index-
|
|
34
|
-
import "./index-
|
|
35
|
-
import "./castArray-
|
|
36
|
-
import "./debounce-
|
|
32
|
+
import "./config-provider-ef3c8ca2.js";
|
|
33
|
+
import "./index-158df623.js";
|
|
34
|
+
import "./index-00e91ed2.js";
|
|
35
|
+
import "./castArray-15070be9.js";
|
|
36
|
+
import "./debounce-e9e47f9a.js";
|
|
37
37
|
let Z = null;
|
|
38
38
|
const Xe = (n) => {
|
|
39
39
|
const M = Ce(n, {
|
|
@@ -245,7 +245,7 @@ const Xe = (n) => {
|
|
|
245
245
|
x.value.length === 0 && ge(() => {
|
|
246
246
|
Array.from(S.value.children).forEach((v, e) => {
|
|
247
247
|
var m, f, i;
|
|
248
|
-
(i = String((f = (m = M.data) == null ? void 0 : m[e]) == null ? void 0 : f.value)) != null && i.includes("%") ? x.value[e] = "
|
|
248
|
+
(i = String((f = (m = M.data) == null ? void 0 : m[e]) == null ? void 0 : f.value)) != null && i.includes("%") ? x.value[e] = "80px" : x.value[e] = `${v.offsetWidth + 20}px`;
|
|
249
249
|
});
|
|
250
250
|
});
|
|
251
251
|
}), (v, e) => (A(), E("div", {
|
|
@@ -261,7 +261,7 @@ const Xe = (n) => {
|
|
|
261
261
|
], 512));
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
|
-
const Ye = /* @__PURE__ */ X(at, [["__scopeId", "data-v-
|
|
264
|
+
const Ye = /* @__PURE__ */ X(at, [["__scopeId", "data-v-de5227e4"]]);
|
|
265
265
|
const rt = { class: "kline-tips" }, lt = {
|
|
266
266
|
__name: "index",
|
|
267
267
|
props: {
|