st-comp 0.0.192 → 0.0.194
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.cjs +1 -1
- package/es/CustomFunction.js +32 -32
- package/es/FactorWarning.js +29 -29
- package/es/Kline.js +15 -15
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +110 -104
- package/es/KlineConfig.js +20 -20
- package/es/KlineNew.js +14 -14
- package/es/KlinePlus.js +17 -17
- package/es/Map.cjs +1 -1
- package/es/Map.js +1 -102944
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +1 -1
- package/es/Pagination.js +69 -69
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.js +29 -29
- package/es/User.js +21 -21
- package/es/VarSelectDialog.js +22 -22
- package/es/VarietyAutoComplete.js +9 -9
- package/es/VarietySearch.cjs +6 -6
- package/es/VarietySearch.js +523 -507
- package/es/VirtualTable.js +13 -13
- package/es/{_initCloneObject-d37d0044.js → _initCloneObject-25087817.js} +9 -9
- package/es/{base-62a70f61.js → base-f5b11441.js} +40 -40
- package/es/{config-provider-eb54307e.js → config-provider-95d27ce2.js} +6 -6
- package/es/{debounce-ccdceb02.js → debounce-06f59c68.js} +9 -9
- package/es/{dropdown-e0119d36.js → dropdown-7a853d45.js} +9 -9
- package/es/{el-autocomplete-fdd72342.js → el-autocomplete-e74d589c.js} +15 -15
- package/es/{el-button-17a2e708.js → el-button-5a260464.js} +33 -33
- package/es/{el-dialog-2fbffe7d.js → el-dialog-8d8f6443.js} +15 -15
- package/es/{el-divider-2f300113.js → el-divider-4e1c0fb8.js} +1 -1
- package/es/{el-empty-34086220.js → el-empty-deee6b39.js} +5 -5
- package/es/{el-form-item-5f9d8170.js → el-form-item-3167d76a.js} +33 -33
- package/es/{el-input-c2f1f98c.js → el-input-03aad76d.js} +33 -33
- package/es/{el-input-number-429626d1.js → el-input-number-12c09ac3.js} +35 -35
- package/es/{el-loading-a45d849f.js → el-loading-86fdef94.js} +5 -5
- package/es/{el-menu-item-1bbf217d.js → el-menu-item-1172154b.js} +22 -22
- package/es/{el-message-179d8e61.js → el-message-35d4e3ac.js} +23 -23
- package/es/{el-message-box-869d122c.js → el-message-box-f43b6e7a.js} +20 -20
- package/es/{el-overlay-56098a38.js → el-overlay-04659660.js} +47 -47
- package/es/{el-popconfirm-6f9a189f.js → el-popconfirm-29d538b6.js} +20 -20
- package/es/{el-popper-d236d5d3.js → el-popper-ee1f8186.js} +125 -125
- package/es/{el-scrollbar-191aee47.js → el-scrollbar-09769d9e.js} +48 -48
- package/es/{el-segmented-d74e1fd8.js → el-segmented-916b982a.js} +8 -8
- package/es/{el-select-b26edf16.js → el-select-8cb88e3c.js} +307 -307
- package/es/{el-table-column-cc880936.js → el-table-column-0c899664.js} +12 -12
- package/es/{el-tag-b79bf878.js → el-tag-554c333b.js} +21 -21
- package/es/{index-89502796.js → index-34048a1d.js} +36 -36
- package/es/{index-7926ee44.js → index-384ed4b0.js} +3 -3
- package/es/{index-5beb56b8.js → index-5b62ea0e.js} +52 -52
- package/es/{index-63a17b07.js → index-69a9bd75.js} +2 -2
- package/es/{index-a137018b.js → index-a8ee0e8c.js} +15 -3
- package/es/{index-524e4e84.js → index-b07f58c9.js} +31 -31
- package/es/{index-97658183.js → index-b7fd560c.js} +12 -12
- package/es/{index-482f09b5.js → index-cfeda35a.js} +1 -1
- package/es/{index-08cdcff5.js → index-df06f32a.js} +15 -15
- package/es/{index-b2b45b6e.cjs → index-fdb71325.cjs} +2 -2
- package/es/{python-2b765700.cjs → python-0405c62e.cjs} +1 -1
- package/es/{python-2cff7134.js → python-791e6a42.js} +1 -1
- package/es/raf-fa761d02.js +6 -0
- package/es/{scroll-7d352c1f.js → scroll-9e2dd92b.js} +5 -5
- package/es/style.css +1 -1
- package/es/{use-global-config-88d2fb63.js → use-global-config-1923bb6f.js} +16 -16
- package/es/{validator-6d37dbfa.js → validator-fd32f925.js} +1 -1
- package/es/{vnode-c51c8aa3.js → vnode-f9752526.js} +1 -1
- package/es/{zh-cn-47b11646.js → zh-cn-d667062d.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +33 -33
- package/lib/{index-e33e2a73.js → index-db060de6.js} +603 -569
- package/lib/{python-bfee2b7e.js → python-077c8efa.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/index.vue +2 -2
- package/packages/MonacoEditor/index.vue +22 -0
- package/packages/VarietySearch/components/FactorScreen/index.vue +33 -12
- package/packages/VarietySearch/config.js +2 -2
- package/es/raf-41aed4d4.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-f5b11441.js";
|
|
2
|
+
import { E as d } from "./el-empty-deee6b39.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-34048a1d.js";
|
|
6
|
+
import "./index-cfeda35a.js";
|
|
7
7
|
const f = {
|
|
8
8
|
__name: "index",
|
|
9
9
|
props: {
|
package/es/CustomFunction.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./base-ef747d02.cjs");const O=require("./el-dialog-a24f4f8f.cjs");require("./el-overlay-ef92f51f.cjs");const $=require("./el-input-06243b61.cjs"),T=require("./el-button-5973d99c.cjs");require("./el-tag-fe492a6d.cjs");const y=require("./el-select-6d813c15.cjs");require("./el-scrollbar-05815cf5.cjs");require("./el-popper-c9e0136d.cjs");const R=require("./el-popconfirm-58a1b946.cjs");require("./el-popover-0ea8fbf8.cjs");const e=require("vue"),u=require("./index-eab8a286.cjs"),
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const O=require("./el-dialog-a24f4f8f.cjs");require("./el-overlay-ef92f51f.cjs");const $=require("./el-input-06243b61.cjs"),T=require("./el-button-5973d99c.cjs");require("./el-tag-fe492a6d.cjs");const y=require("./el-select-6d813c15.cjs");require("./el-scrollbar-05815cf5.cjs");require("./el-popper-c9e0136d.cjs");const R=require("./el-popconfirm-58a1b946.cjs");require("./el-popover-0ea8fbf8.cjs");const e=require("vue"),u=require("./index-eab8a286.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs"),_=require("./el-message-0aeea1a3.cjs");require("./index-bb833443.cjs");require("./index-9780a537.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-c2c5ca8f.cjs");require("./index-ca7dbd47.cjs");require("./typescript-b63f8e83.cjs");require("./index-7e4e0bd3.cjs");require("./index-eea0bcb3.cjs");require("./index-a9d4ef0f.cjs");require("./debounce-62f5b6e8.cjs");require("./config-provider-79c2df1b.cjs");const j=s=>(e.pushScopeId("data-v-3e8a98d7"),s=s(),e.popScopeId(),s),L={class:"custom-function"},P={class:"func-option"},W={class:"icons"},A={class:"custom-header"},H={class:"left"},G=["id"],J={class:"right"},K={style:{display:"flex","align-items":"center","margin-bottom":"10px"}},Q=j(()=>e.createElementVNode("span",null,"函数名称:",-1)),X={class:"dialog-footer"},Y={__name:"index",props:{size:{type:String,default:"small"},selectWidth:{type:String,default:"200px"}},emits:["insert"],setup(s,{emit:C}){const{request:v}=e.inject("stConfig"),c=e.ref(null),h=e.ref(null),E=C,d=e.ref(null),i=e.ref(""),f=e.ref([]),r=e.ref(!1),l=e.reactive({id:null,funcName:"",funcExpression:""}),x=e.ref(!1),N=async()=>{const{body:n}=await v.post("/common/qt/querySearchFunctions");if(f.value=n??[],d.value===null)i.value="";else{const t=f.value.find(({id:a})=>a===d.value);i.value=t?t.funcName:""}},q=n=>{var t;n?d.value=(t=f.value.find(a=>a.funcName===n))==null?void 0:t.id:d.value=null},w=async n=>{await v.post("/common/qt/deleteSearchFunctionById",{id:n.id}),N()},V=(n,t)=>{switch(!!n){case!1:{Object.assign(l,{id:null,funcName:"",funcExpression:""});break}case!0:{Object.assign(l,{id:n.id,funcName:n.funcName,funcExpression:n.funcExpression});break}}t&&(l.id=null,l.funcName=`${l.funcName}-复制`),r.value=!0},k=async()=>{try{if(x.value=!0,l.funcExpression=c.value.getValue(),!l.funcName)return _.ElMessage.error("函数名称不可为空");if(!l.funcExpression)return _.ElMessage.error("函数内容不可为空");await v.post("/common/qt/saveOrUpdateSearchFunction",l),_.ElMessage.success("操作成功"),r.value=!1,await N()}finally{x.value=!1}},g=()=>{if(!i.value)return _.ElMessage.error("请先选择自定义函数后, 再执行插入");E("insert",i.value)},b=()=>{h.value.open(c.value)};return e.onMounted(()=>{N()}),e.watch(()=>r.value,n=>{switch(n){case!0:{e.nextTick(()=>{var t,a;(t=c.value)==null||t.setValue(l.funcExpression),(a=c.value)==null||a.resize()});break}case!1:{h.value.close();break}}}),(n,t)=>{const a=u.ElIcon,S=R.ElPopconfirm,z=y.ElOption,F=y.ElSelect,m=T.ElButton,M=$.ElInput,B=e.resolveComponent("st-monacoEditor"),D=O.ElDialog,I=e.resolveComponent("st-varSelectDialog");return e.openBlock(),e.createElementBlock("div",L,[e.createVNode(F,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=o=>i.value=o),size:s.size,placeholder:"自定义函数","no-match-text":"无匹配选项","no-data-text":"无选项数据",clearable:"",filterable:"",onChange:q,style:e.normalizeStyle({width:s.selectWidth})},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,o=>(e.openBlock(),e.createBlock(z,{key:o.id,label:o.funcName,value:o.funcName,onClick:g},{default:e.withCtx(()=>[e.createElementVNode("div",P,[e.createElementVNode("span",null,e.toDisplayString(o.funcName),1),e.createElementVNode("div",W,[e.createVNode(a,{onClick:e.withModifiers(p=>V(o,!0),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(u.document_copy_default))]),_:2},1032,["onClick"]),e.createVNode(a,{onClick:e.withModifiers(p=>V(o),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(u.edit_default))]),_:2},1032,["onClick"]),e.createVNode(S,{title:"确认是否删除?","confirm-button-text":"确认","cancel-button-text":"取消",onConfirm:p=>w(o)},{reference:e.withCtx(()=>[e.createVNode(a,{onClick:e.withModifiers(()=>{},["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(u.delete_default))]),_:1})]),_:2},1032,["onConfirm"])])])]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","size","style"]),e.createVNode(m,{type:"primary",size:s.size,onClick:g},{default:e.withCtx(()=>[e.createTextVNode(" 插入 ")]),_:1},8,["size"]),e.createVNode(m,{type:"primary",size:s.size,onClick:t[1]||(t[1]=o=>V())},{default:e.withCtx(()=>[e.createTextVNode(" 新建 ")]),_:1},8,["size"]),e.createVNode(D,{"modal-class":"add-or-edit-dialog",modelValue:r.value,"onUpdate:modelValue":t[4]||(t[4]=o=>r.value=o),width:"1000","align-center":"","append-to-body":"",draggable:"",overflow:"",modal:!1,"modal-penetrable":!0,"show-close":!1},{header:e.withCtx(({titleId:o,titleClass:p})=>[e.createElementVNode("div",A,[e.createElementVNode("div",H,[e.createElementVNode("span",{id:o,class:e.normalizeClass(p)},e.toDisplayString(l.id?"编辑自定义函数":"新建自定义函数"),11,G)]),e.createElementVNode("div",J,[e.createVNode(m,{size:"small",type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(" 变量选择器 ")]),_:1}),e.createVNode(a,{onClick:t[2]||(t[2]=te=>r.value=!1)},{default:e.withCtx(()=>[e.createVNode(e.unref(u.close_default))]),_:1})])])]),footer:e.withCtx(()=>[e.createElementVNode("div",X,[e.createVNode(m,{type:"primary",loading:x.value,onClick:k},{default:e.withCtx(()=>[e.createTextVNode(" 确定 ")]),_:1},8,["loading"])])]),default:e.withCtx(()=>[e.createElementVNode("div",K,[Q,e.createVNode(M,{modelValue:l.funcName,"onUpdate:modelValue":t[3]||(t[3]=o=>l.funcName=o),style:{width:"300px","margin-left":"10px"}},null,8,["modelValue"])]),e.createVNode(B,{ref_key:"stMonacoEditorRef",ref:c,language:"lua",style:{width:"968px",height:"400px"}},null,512)]),_:1},8,["modelValue"]),e.createVNode(I,{ref_key:"stVarSelectDialogRef",ref:h},null,512)])}}},Z=U._export_sfc(Y,[["__scopeId","data-v-3e8a98d7"]]),ee={install(s){s.component("st-customFunction",Z)}};module.exports=ee;
|
package/es/CustomFunction.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import "./base-
|
|
2
|
-
import { E as A } from "./el-dialog-
|
|
3
|
-
import "./el-overlay-
|
|
4
|
-
import { E as P } from "./el-input-
|
|
5
|
-
import { E as G } from "./el-button-
|
|
6
|
-
import "./el-tag-
|
|
7
|
-
import { E as H, a as J } from "./el-select-
|
|
8
|
-
import "./el-scrollbar-
|
|
9
|
-
import "./el-popper-
|
|
10
|
-
import { E as K } from "./el-popconfirm-
|
|
1
|
+
import "./base-f5b11441.js";
|
|
2
|
+
import { E as A } from "./el-dialog-8d8f6443.js";
|
|
3
|
+
import "./el-overlay-04659660.js";
|
|
4
|
+
import { E as P } from "./el-input-03aad76d.js";
|
|
5
|
+
import { E as G } from "./el-button-5a260464.js";
|
|
6
|
+
import "./el-tag-554c333b.js";
|
|
7
|
+
import { E as H, a as J } from "./el-select-8cb88e3c.js";
|
|
8
|
+
import "./el-scrollbar-09769d9e.js";
|
|
9
|
+
import "./el-popper-ee1f8186.js";
|
|
10
|
+
import { E as K } from "./el-popconfirm-29d538b6.js";
|
|
11
11
|
import "./el-popover-4ed993c7.js";
|
|
12
12
|
import { inject as Q, ref as r, reactive as X, onMounted as Y, watch as Z, nextTick as ee, resolveComponent as w, openBlock as N, createElementBlock as z, createVNode as t, normalizeStyle as te, withCtx as l, Fragment as oe, renderList as ne, createBlock as le, createElementVNode as c, toDisplayString as F, withModifiers as S, unref as g, createTextVNode as y, normalizeClass as ae, pushScopeId as se, popScopeId as ie } from "vue";
|
|
13
|
-
import { d as ce, e as re,
|
|
14
|
-
import { E as h } from "./el-message-179d8e61.js";
|
|
13
|
+
import { d as ce, e as re, b as ue, a as de, E as me } from "./index-b07f58c9.js";
|
|
15
14
|
import { _ as pe } from "./_plugin-vue_export-helper-dad06003.js";
|
|
16
|
-
import "./
|
|
17
|
-
import "./index-
|
|
15
|
+
import { E as h } from "./el-message-35d4e3ac.js";
|
|
16
|
+
import "./index-cfeda35a.js";
|
|
17
|
+
import "./index-34048a1d.js";
|
|
18
18
|
import "./index-2e331d74.js";
|
|
19
|
-
import "./vnode-
|
|
20
|
-
import "./scroll-
|
|
21
|
-
import "./use-global-config-
|
|
22
|
-
import "./index-
|
|
19
|
+
import "./vnode-f9752526.js";
|
|
20
|
+
import "./scroll-9e2dd92b.js";
|
|
21
|
+
import "./use-global-config-1923bb6f.js";
|
|
22
|
+
import "./index-5b62ea0e.js";
|
|
23
23
|
import "./typescript-7ae59c4c.js";
|
|
24
|
-
import "./index-
|
|
24
|
+
import "./index-b7fd560c.js";
|
|
25
25
|
import "./index-657047bb.js";
|
|
26
|
-
import "./index-
|
|
27
|
-
import "./debounce-
|
|
28
|
-
import "./config-provider-
|
|
29
|
-
const fe = (i) => (se("data-v-3e8a98d7"), i = i(), ie(), i), _e = { class: "custom-function" }, ve = { class: "func-option" }, ge = { class: "icons" }, ye = { class: "custom-header" }, he = { class: "left" }, xe = ["id"], Ee = { class: "right" },
|
|
26
|
+
import "./index-384ed4b0.js";
|
|
27
|
+
import "./debounce-06f59c68.js";
|
|
28
|
+
import "./config-provider-95d27ce2.js";
|
|
29
|
+
const fe = (i) => (se("data-v-3e8a98d7"), i = i(), ie(), i), _e = { class: "custom-function" }, ve = { class: "func-option" }, ge = { class: "icons" }, ye = { class: "custom-header" }, he = { class: "left" }, xe = ["id"], Ee = { class: "right" }, be = { style: { display: "flex", "align-items": "center", "margin-bottom": "10px" } }, ke = /* @__PURE__ */ fe(() => /* @__PURE__ */ c("span", null, "函数名称:", -1)), Ce = { class: "dialog-footer" }, Ne = {
|
|
30
30
|
__name: "index",
|
|
31
31
|
props: {
|
|
32
32
|
size: { type: String, default: "small" },
|
|
@@ -38,7 +38,7 @@ const fe = (i) => (se("data-v-3e8a98d7"), i = i(), ie(), i), _e = { class: "cust
|
|
|
38
38
|
id: null,
|
|
39
39
|
funcName: "",
|
|
40
40
|
funcExpression: ""
|
|
41
|
-
}),
|
|
41
|
+
}), b = r(!1), k = async () => {
|
|
42
42
|
const { body: n } = await x.post("/common/qt/querySearchFunctions");
|
|
43
43
|
if (f.value = n ?? [], p.value === null)
|
|
44
44
|
u.value = "";
|
|
@@ -50,7 +50,7 @@ const fe = (i) => (se("data-v-3e8a98d7"), i = i(), ie(), i), _e = { class: "cust
|
|
|
50
50
|
var e;
|
|
51
51
|
n ? p.value = (e = f.value.find((s) => s.funcName === n)) == null ? void 0 : e.id : p.value = null;
|
|
52
52
|
}, B = async (n) => {
|
|
53
|
-
await x.post("/common/qt/deleteSearchFunctionById", { id: n.id }),
|
|
53
|
+
await x.post("/common/qt/deleteSearchFunctionById", { id: n.id }), k();
|
|
54
54
|
}, C = (n, e) => {
|
|
55
55
|
switch (!!n) {
|
|
56
56
|
case !1: {
|
|
@@ -73,13 +73,13 @@ const fe = (i) => (se("data-v-3e8a98d7"), i = i(), ie(), i), _e = { class: "cust
|
|
|
73
73
|
e && (a.id = null, a.funcName = `${a.funcName}-复制`), d.value = !0;
|
|
74
74
|
}, $ = async () => {
|
|
75
75
|
try {
|
|
76
|
-
if (
|
|
76
|
+
if (b.value = !0, a.funcExpression = m.value.getValue(), !a.funcName)
|
|
77
77
|
return h.error("函数名称不可为空");
|
|
78
78
|
if (!a.funcExpression)
|
|
79
79
|
return h.error("函数内容不可为空");
|
|
80
|
-
await x.post("/common/qt/saveOrUpdateSearchFunction", a), h.success("操作成功"), d.value = !1, await
|
|
80
|
+
await x.post("/common/qt/saveOrUpdateSearchFunction", a), h.success("操作成功"), d.value = !1, await k();
|
|
81
81
|
} finally {
|
|
82
|
-
|
|
82
|
+
b.value = !1;
|
|
83
83
|
}
|
|
84
84
|
}, V = () => {
|
|
85
85
|
if (!u.value)
|
|
@@ -89,7 +89,7 @@ const fe = (i) => (se("data-v-3e8a98d7"), i = i(), ie(), i), _e = { class: "cust
|
|
|
89
89
|
E.value.open(m.value);
|
|
90
90
|
};
|
|
91
91
|
return Y(() => {
|
|
92
|
-
|
|
92
|
+
k();
|
|
93
93
|
}), Z(
|
|
94
94
|
() => d.value,
|
|
95
95
|
(n) => {
|
|
@@ -243,7 +243,7 @@ const fe = (i) => (se("data-v-3e8a98d7"), i = i(), ie(), i), _e = { class: "cust
|
|
|
243
243
|
c("div", Ce, [
|
|
244
244
|
t(_, {
|
|
245
245
|
type: "primary",
|
|
246
|
-
loading:
|
|
246
|
+
loading: b.value,
|
|
247
247
|
onClick: $
|
|
248
248
|
}, {
|
|
249
249
|
default: l(() => [
|
|
@@ -254,8 +254,8 @@ const fe = (i) => (se("data-v-3e8a98d7"), i = i(), ie(), i), _e = { class: "cust
|
|
|
254
254
|
])
|
|
255
255
|
]),
|
|
256
256
|
default: l(() => [
|
|
257
|
-
c("div",
|
|
258
|
-
|
|
257
|
+
c("div", be, [
|
|
258
|
+
ke,
|
|
259
259
|
t(j, {
|
|
260
260
|
modelValue: a.funcName,
|
|
261
261
|
"onUpdate:modelValue": e[3] || (e[3] = (o) => a.funcName = o),
|
package/es/FactorWarning.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
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-f5b11441.js";
|
|
2
|
+
import { z as re, E as ne } from "./zh-cn-d667062d.js";
|
|
3
|
+
import { E as ue } from "./el-dialog-8d8f6443.js";
|
|
4
|
+
import "./el-overlay-04659660.js";
|
|
5
|
+
import "./el-tag-554c333b.js";
|
|
6
6
|
import "./el-tooltip-4ed993c7.js";
|
|
7
|
-
import { E as se } from "./el-popper-
|
|
8
|
-
import { E as ie, a as ce, b as de, c as me } from "./el-table-column-
|
|
9
|
-
import "./el-scrollbar-
|
|
10
|
-
import { E as fe } from "./el-popconfirm-
|
|
7
|
+
import { E as se } from "./el-popper-ee1f8186.js";
|
|
8
|
+
import { E as ie, a as ce, b as de, c as me } from "./el-table-column-0c899664.js";
|
|
9
|
+
import "./el-scrollbar-09769d9e.js";
|
|
10
|
+
import { E as fe } from "./el-popconfirm-29d538b6.js";
|
|
11
11
|
import "./el-popover-4ed993c7.js";
|
|
12
|
-
import { E as pe } from "./el-button-
|
|
13
|
-
import { E as ye, a as ve } from "./el-form-item-
|
|
14
|
-
import { E as _e } from "./el-input-
|
|
15
|
-
import { E as be, a as he } from "./el-message-box-
|
|
16
|
-
import { E as ge } from "./el-input-number-
|
|
17
|
-
import { E as ke } from "./el-segmented-
|
|
12
|
+
import { E as pe } from "./el-button-5a260464.js";
|
|
13
|
+
import { E as ye, a as ve } from "./el-form-item-3167d76a.js";
|
|
14
|
+
import { E as _e } from "./el-input-03aad76d.js";
|
|
15
|
+
import { E as be, a as he } from "./el-message-box-f43b6e7a.js";
|
|
16
|
+
import { E as ge } from "./el-input-number-12c09ac3.js";
|
|
17
|
+
import { E as ke } from "./el-segmented-916b982a.js";
|
|
18
18
|
import { mergeModels as R, ref as w, useModel as Ce, watch as Te, openBlock as o, createElementBlock as c, createVNode as a, unref as g, withCtx as l, createElementVNode as m, normalizeClass as we, toDisplayString as k, createTextVNode as d, createBlock as f, createCommentVNode as p, Fragment as x, renderList as N, pushScopeId as xe, popScopeId as Se } from "vue";
|
|
19
|
-
import { i as j, E as Ve } from "./index-
|
|
19
|
+
import { i as j, E as Ve } from "./index-b07f58c9.js";
|
|
20
20
|
import { G as Ee } from "./index-7ed0999e.js";
|
|
21
21
|
import { _ as Ne } from "./_plugin-vue_export-helper-dad06003.js";
|
|
22
|
-
import { E as Fe } from "./index-
|
|
23
|
-
import "./config-provider-
|
|
24
|
-
import "./use-global-config-
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-
|
|
27
|
-
import "./index-
|
|
22
|
+
import { E as Fe } from "./index-384ed4b0.js";
|
|
23
|
+
import "./config-provider-95d27ce2.js";
|
|
24
|
+
import "./use-global-config-1923bb6f.js";
|
|
25
|
+
import "./index-cfeda35a.js";
|
|
26
|
+
import "./index-34048a1d.js";
|
|
27
|
+
import "./index-5b62ea0e.js";
|
|
28
28
|
import "./index-2e331d74.js";
|
|
29
|
-
import "./vnode-
|
|
30
|
-
import "./scroll-
|
|
31
|
-
import "./_initCloneObject-
|
|
32
|
-
import "./debounce-
|
|
33
|
-
import "./raf-
|
|
29
|
+
import "./vnode-f9752526.js";
|
|
30
|
+
import "./scroll-9e2dd92b.js";
|
|
31
|
+
import "./_initCloneObject-25087817.js";
|
|
32
|
+
import "./debounce-06f59c68.js";
|
|
33
|
+
import "./raf-fa761d02.js";
|
|
34
34
|
import "./index-657047bb.js";
|
|
35
35
|
import "./typescript-7ae59c4c.js";
|
|
36
|
-
import "./index-
|
|
37
|
-
import "./validator-
|
|
36
|
+
import "./index-b7fd560c.js";
|
|
37
|
+
import "./validator-fd32f925.js";
|
|
38
38
|
const Le = {
|
|
39
39
|
// 表单字段
|
|
40
40
|
ruleFormPrice: !0,
|
package/es/Kline.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import "./base-
|
|
2
|
-
import { E as he, a as Ce } from "./el-menu-item-
|
|
1
|
+
import "./base-f5b11441.js";
|
|
2
|
+
import { E as he, a as Ce } from "./el-menu-item-1172154b.js";
|
|
3
3
|
import "./el-tooltip-4ed993c7.js";
|
|
4
|
-
import "./el-popper-
|
|
4
|
+
import "./el-popper-ee1f8186.js";
|
|
5
5
|
import { defineComponent as Me, openBlock as C, createElementBlock as v, 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-
|
|
12
|
-
import "./el-scrollbar-
|
|
13
|
-
import "./index-
|
|
10
|
+
import "./el-tag-554c333b.js";
|
|
11
|
+
import { E as Ee, a as Se } from "./el-select-8cb88e3c.js";
|
|
12
|
+
import "./el-scrollbar-09769d9e.js";
|
|
13
|
+
import "./index-b07f58c9.js";
|
|
14
14
|
import "./index-657047bb.js";
|
|
15
15
|
import "./typescript-7ae59c4c.js";
|
|
16
|
-
import "./vnode-
|
|
17
|
-
import "./index-
|
|
18
|
-
import "./index-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import "./scroll-
|
|
23
|
-
import "./debounce-
|
|
16
|
+
import "./vnode-f9752526.js";
|
|
17
|
+
import "./index-34048a1d.js";
|
|
18
|
+
import "./index-5b62ea0e.js";
|
|
19
|
+
import "./index-cfeda35a.js";
|
|
20
|
+
import "./index-384ed4b0.js";
|
|
21
|
+
import "./index-b7fd560c.js";
|
|
22
|
+
import "./scroll-9e2dd92b.js";
|
|
23
|
+
import "./debounce-06f59c68.js";
|
|
24
24
|
const Fe = { class: "st-kline-tips" }, Qe = { class: "st-kline-tips-row" }, _e = /* @__PURE__ */ Me({
|
|
25
25
|
__name: "index",
|
|
26
26
|
props: {
|
package/es/KlineBasic.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./base-ef747d02.cjs");const ve=require("./el-dialog-a24f4f8f.cjs");require("./el-overlay-ef92f51f.cjs");require("./el-input-06243b61.cjs");const xe=require("./el-input-number-854b2066.cjs"),be=require("./el-button-5973d99c.cjs"),he=require("./el-empty-1697ded8.cjs"),ie=require("./el-menu-item-6522d54c.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-c9e0136d.cjs");const e=require("vue"),_e=require("echarts"),c=require("./dayjs.min-2c20abe6.cjs"),j=require("./index-8901a38c.cjs"),J=require("./el-message-0aeea1a3.cjs"),K=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-fe492a6d.cjs");const se=require("./el-select-6d813c15.cjs");require("./el-scrollbar-05815cf5.cjs");require("./index-eab8a286.cjs");require("./index-bb833443.cjs");require("./index-9780a537.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-c2c5ca8f.cjs");require("./index-ca7dbd47.cjs");require("./typescript-b63f8e83.cjs");require("./index-7e4e0bd3.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-79c2df1b.cjs");require("./index-a9d4ef0f.cjs");require("./debounce-62f5b6e8.cjs");function Ye(o){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const S in o)if(S!=="default"){const h=Object.getOwnPropertyDescriptor(o,S);Object.defineProperty(b,S,h.get?h:{enumerable:!0,get:()=>o[S]})}}return b.default=o,Object.freeze(b)}const ne=Ye(_e);let W=null;const ke=o=>{const b=j.y(o,{handleReq:S=>{j.v()&&(S.headers.token=j.U())},handleRes:S=>{const{data:h}=S;if(h.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:j.K(),!0}});b.get,W=b.post},we=o=>W("/middleLayer/kline/getKlineBasic",{...o,userId:j.V("id")}),De=o=>W("/middleLayer/kline/getKline",o),Me=async o=>W("/alarm/deliversign/addAlarmPrice",{...o,userId:j.V("id")}),Se=async o=>W("/alarm/deliversign/findAlarmPriceByUserId",{...o,userId:j.V("id")}),ue=async o=>W("/alarm/deliversign/updateAlarmPrice",{...o,userId:j.V("id")}),Ve=async o=>W("/alarm/deliversign/deleteAlarmPrice",{...o,userId:j.V("id")}),{round:z}=j.x,Le=(o,b,S,h,v)=>{const{data:t,time:w}=o,{gridTop:_,gridRight:u,gridLeft:Y,maxShowCounts:k,showSubChart:l}=b;return{animation:!1,grid:{top:`${_}px`,right:`${u}px`,bottom:l?"6px":"24px",left:`${Y}px`},dataZoom:[{type:"inside",startValue:S,endValue:h,maxValueSpan:k}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:r=>{const{axisDimension:D,value:y}=r;return D==="x"?l?"":["6","7","8"].includes(v)?c.dayjs(y).format("YYYY-MM-DD"):y:String(z(y))}}},formatter:()=>""},xAxis:{show:!l,type:"category",data:w,splitLine:{show:!1},axisLabel:{formatter:r=>["6","7","8"].includes(v)?c.dayjs(r).format("YYYY-MM-DD"):r}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:r=>z(r.min),max:r=>z(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)"}}}},Te=(o,b,S,h,v)=>{const{variety:t,featureId:w,featureType:_}=S,{gridTop:u,gridLeft:Y,gridRight:k}=h;return b.reduce((l,r)=>{const{warnPrice:D}=r,y=o==null?void 0:o.convertToPixel({yAxisIndex:0},D);if(y<=u||y>=(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:Y,y1:y,x2:(o==null?void 0:o.getWidth())-k,y2:y},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:r,x:(o==null?void 0:o.getWidth())-k,y:y-5,style:{fill:"#FFF",text:D,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 L=o.convertFromPixel({yAxisIndex:0},y+(V.offsetY-E));(R=V.target.childAt(1))==null||R.animate("style",!1).when(1,{text:z(L,3)}).start()}},ondragend:async V=>{const L=V.offsetY-E;if(L!==0){const N=o==null?void 0:o.convertFromPixel({yAxisIndex:0},L+y),d={id:r.id,warnPrice:z(N,3),featureId:w,featureCode:t,featureType:_};await ue(d),J.ElMessage.success("画线预警修改成功"),v&&v()}}}]},[])},Be={class:"kline-tips"},Ee=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){return(b,S)=>(e.openBlock(),e.createElementBlock("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.data,(h,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"kline-tips-item",style:e.normalizeStyle({color:h.color})},e.toDisplayString(h.label)+" "+e.toDisplayString(h.value),5))),128))]))}});const oe=K._export_sfc(Ee,[["__scopeId","data-v-f83b6b36"]]);const Ne={class:"kline-tips"},Fe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0}},setup(o){const{round:b,formatValue:S}=j.x,h=o,v=e.computed(()=>{const{data:w,activeIndex:_}=h;if(w.data&&w.data[_]){const u=w.data[_],Y=[{label:"开",value:b(u[0])},{label:"高",value:b(u[3])},{label:"低",value:b(u[2])},{label:"收",value:b(u[1])}];u[4]!==null&&Y.push({label:"额",value:S(u[4])});let k;return u[6]>0?k="red":u[6]<0&&(k="green"),Y.push({label:"涨跌",value:`${b(u[6])}%`,color:k}),Y}return[]}),t=e.computed(()=>{var u;const{data:w,activeIndex:_}=h;return((u=w==null?void 0:w.mainIndicator)==null?void 0:u.map(Y=>({label:Y.key,value:b(Y.data[_]),color:Y.color})))||[]});return(w,_)=>(e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(oe,{data:v.value},null,8,["data"]),e.createVNode(oe,{data:t.value},null,8,["data"])]))}},qe=K._export_sfc(Fe,[["__scopeId","data-v-64b5c2a3"]]);const je={class:"klineSub"},Re={class:"klineSub-tips"},Ae={key:0,class:"klineSub-tips-select"},Oe={__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:b,emit:S}){const{round:h}=j.x;let v,t;const w=S,_=o,u=e.ref(),Y=e.computed({get(){return _.modelValue},set(r){w("update:modelValue",r)}}),k=e.computed(()=>{var y;const{data:r,activeIndex:D}=_;return((y=r==null?void 0:r.subIndicator)==null?void 0:y.map(E=>({label:E.key,color:E.color,value:E.data[D]||"-"})))||[]});e.onMounted(()=>{v=ne.init(u.value);let r=!0;t=new ResizeObserver(()=>{if(r){r=null;return}v.resize()}),t.observe(u.value)}),e.onUnmounted(()=>{v.dispose(),t.disconnect(),t=null});const l=(r,D)=>{const y=r[D],E=D===0?r[D]:r[D-1];return y[0]===y[1]?y[0]>=E[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:y[1]>y[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return b({connect:r=>{ne.connect([r,v])},draw:(r,D)=>{e.nextTick(()=>{const{startValue:y,endValue:E,maxValueSpan:V}=r,{leftYAxisRange:R,rightYAxisRange:L}=_.data.subIndicator[0],N=_.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,P)=>d.seriesColor==="kline"?{value:O,itemStyle:l(_.data.data,P)}: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}}});v.setOption({animation:!1,grid:{left:`${D.gridLeft}px`,top:"10px",right:`${D.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:y,endValue:E,maxValueSpan:V}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:d=>{const{axisDimension:O,value:P}=d;if(O==="x")return["6","7","8"].includes(_.cycle)?c.dayjs(P).format("YYYY-MM-DD"):P;if(d.axisIndex===1)return String(h(P))}}},formatter:()=>""},xAxis:{type:"category",data:_.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:d=>["6","7","8"].includes(_.cycle)?c.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:L==="cover"?d=>d.min:null,max:L==="cover"?d=>d.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:N},!0)})}}),(r,D)=>{const y=se.ElOption,E=se.ElSelect;return e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[k.value.length?(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(E,{modelValue:Y.value,"onUpdate:modelValue":D[0]||(D[0]=V=>Y.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(y,{key:V.value,label:V.label,value:V.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(oe,{data:k.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:u},null,512)])}}},Ie=K._export_sfc(Oe,[["__scopeId","data-v-ab519de5"]]),Pe=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(o,{emit:b}){const S=b,h=e.ref(),v=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),w=()=>{t.value.display="none",S("closeContextMenuCallBack"),document.removeEventListener("click",w)},_=u=>{if(u.preventDefault(),t.value.display==="block"){const{offsetX:Y,offsetY:k}=u,{offsetWidth:l,offsetHeight:r}=v.value;if(Y<=l&&k<=r)return}h.value.click(),t.value={display:"block",top:`${u.offsetY}px`,left:`${u.offsetX}px`},e.nextTick(()=>{const Y=h.value.getBoundingClientRect(),k=v.value.getBoundingClientRect();k.left+k.width>=Y.right&&(t.value.left=`${u.offsetX-k.width}px`),k.top+k.height>=Y.bottom&&(console.log("高度超出"),t.value.top=`${u.offsetY-k.height}px`)}),document.addEventListener("click",w)};return(u,Y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:h,class:"contextmenu",onContextmenu:_,onMouseleave:w},[e.renderSlot(u.$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(u.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const $e=K._export_sfc(Pe,[["__scopeId","data-v-811db6b4"]]);const ce=o=>(e.pushScopeId("data-v-79254471"),o=o(),e.popScopeId(),o),Ce={class:"klineBasic-tips"},We={key:0,class:"klineBasic-sub"},ze={key:1,class:"klineBasic-empty"},Ke={key:2,class:"klineBasic-error"},Ue=ce(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),He={style:{"text-align":"center"}},Ze=ce(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),Xe={class:"dialog-footer"},Ge={__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:b,emit:S}){const h=[{label:"画线预警",key:"drawWarningLine"}];let v=null,t=null,w,_,u=!1,Y=!1;const k=S,l=o,r=e.ref(!1),D=e.ref(!1),y=e.ref(!1),E=e.ref(null),V=e.ref(null),R=e.ref("VOL"),L=e.ref(0),N=e.ref({}),d=e.ref([]),O=e.ref({}),P=e.ref(!1),U=e.ref(""),Q=e.ref([...h]),$=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",ae)}),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",ae)});const de=()=>{t||(t=ne.init(E.value),fe(),$.value.showSubChart&&V.value.connect(t),v=j.D(E.value),v.listen(()=>{requestAnimationFrame(()=>{t.resize()})}))},ae=({code:i,ctrlKey:n})=>{if(!(n||r.value))return;const{xAxis:m,dataZoom:f}=t.getOption(),{data:p}=(m==null?void 0:m[0])??{data:[]};let{startValue:a,endValue:s}=(f==null?void 0:f[0])??{};if(p!=null&&p.length){switch(i){case"ArrowUp":{if(s-a<5)return;const M=Math.floor((s-a)/2)+1;a=a+M,s-a<5&&(a=s-4);break}case"ArrowDown":{const M=Math.min(500,s-a);a=a-M-1;break}case"ArrowLeft":{a>0&&(a-=1,s-=1),L.value>0&&(L.value-=1);break}case"ArrowRight":{s<p.length-1&&(a+=1,s+=1),r.value&&L.value<p.length-1&&(L.value+=1);break}}t.dispatchAction({type:"dataZoom",startValue:a,endValue:s}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:r.value?L.value:null}),t.dispatchAction({type:"highlight",dataIndex:r.value?L.value:s})}},fe=()=>{t==null||t.on("datazoom",n=>{clearTimeout(_),_=setTimeout(()=>{var f,p,a,s;const{loadCheckCounts:m}=$.value;if((p=(f=t==null?void 0:t.getOption())==null?void 0:f.dataZoom)!=null&&p[0]){const{startValue:M}=(s=(a=t==null?void 0:t.getOption())==null?void 0:a.dataZoom)==null?void 0:s[0];M<m&&u===!1&&Y===!1&&(u=!0,pe("history")),H()}clearTimeout(_)},100)}),t==null||t.on("highlight",n=>{var f,p;let m=n.dataIndex||-1;n.batch&&(m=typeof((f=n==null?void 0:n.batch[0])==null?void 0:f.dataIndex)=="number"?(p=n==null?void 0:n.batch[0])==null?void 0:p.dataIndex:-1),clearTimeout(w),w=setTimeout(()=>{L.value=m,clearTimeout(w)},20)}),t==null||t.on("globalout",()=>{var m,f,p;const n=(p=(f=(m=t==null?void 0:t.getOption())==null?void 0:m.dataZoom)==null?void 0:f[0])==null?void 0:p.endValue;L.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,m,f,p,a;try{if(!l.variety||!l.cycle)return;const{variety:s,featureId:M,cycle:T,indicatorStore:x,mainIndicator:I,right:X,startTime:C,endTime:B}=l,{defaultShowCounts:F,addCounts:g,showWarningLine:te,getFactorData:G}=$.value,q={variety:s,featureId:M,cycle:T,mainIndicatorList:x.getIndicatorParams(I),subIndicator:R.value,right:X,showWarningLine:te,getFactorData:G};C&&B?(q.startTime=C,q.endTime=B):C?(q.startTime=C,q.limit=F+g):B?(q.endTime=B,q.limit=F+g):(q.endTime=c.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),q.limit=F+g);const A=await we(q);if((m=(n=(i=A==null?void 0:A.body)==null?void 0:i.kline)==null?void 0:n.time)!=null&&m.length)D.value=!1,y.value=!1;else{D.value=!0,y.value=!1;return}N.value=(f=A==null?void 0:A.body)==null?void 0:f.kline,d.value=((p=A==null?void 0:A.body)==null?void 0:p.warningLine)||[],re(),H(),G&&k("getFactorData",(a=A==null?void 0:A.body)==null?void 0:a.factor)}catch(s){throw y.value=!0,D.value=!1,new Error(s)}},pe=async i=>{const{variety:n,cycle:m,indicatorStore:f,mainIndicator:p,right:a}=l,{addCounts:s}=$.value,{time:M}=N.value;if(i==="history"){const T=await De({variety:n,cycle:m,endTime:M[0],limit:s,mainIndicatorList:f.getIndicatorParams(p),subIndicator:R.value,right:a});N.value={time:[...T.body.time,...N.value.time.slice(1)],data:[...T.body.data,...N.value.data.slice(1)],mainIndicator:N.value.mainIndicator.map((x,I)=>({...x,data:[...T.body.mainIndicator[I].data,...x.data.slice(1)]})),subIndicator:N.value.subIndicator.map((x,I)=>({...x,data:[...T.body.subIndicator[I].data,...x.data.slice(1)]}))},re(!0),T.body.data.length<s&&(Y=!0),u=!1}},re=(i=!1)=>{var I,X,C;de();const{time:n}=N.value,{gridRight:m,gridLeft:f,defaultShowCounts:p,maxShowCounts:a,showSubChart:s}=$.value;let M=n.length-1-p,T=n.length-1;if(i){const B=t.getOption(),F=(X=(I=B==null?void 0:B.xAxis)==null?void 0:I[0])==null?void 0:X.data,g=(C=B==null?void 0:B.dataZoom)==null?void 0:C[0],te=F[g==null?void 0:g.startValue],G=F[g==null?void 0:g.endValue];M=n.findIndex(q=>q===te),T=n.findIndex(q=>q===G)}const x=Le(N.value,$.value,M,T,l.cycle);if(t.setOption(x,!0),L.value=T,l.brushRange){let B=null,F=null;switch(l.cycle){case"6":{B=n.find(g=>new Date(g).getTime()>=new Date(l.brushRange[0]).getTime()||c.dayjs(g).format("YYYY-MM-DD")===c.dayjs(l.brushRange[0]).format("YYYY-MM-DD")),F=n.findLast(g=>new Date(g).getTime()<=new Date(l.brushRange[1]).getTime()||c.dayjs(g).format("YYYY-MM-DD")===c.dayjs(l.brushRange[1]).format("YYYY-MM-DD"));break}case"7":{B=n.find(g=>c.dayjs(g).day(5).format("YYYY-MM-DD")===c.dayjs(l.brushRange[0]).day(5).format("YYYY-MM-DD")),F=n.findLast(g=>c.dayjs(g).day(5).format("YYYY-MM-DD")===c.dayjs(l.brushRange[1]).day(5).format("YYYY-MM-DD"));break}case"8":{B=n.find(g=>c.dayjs(g).endOf("month").format("YYYY-MM-DD")===c.dayjs(l.brushRange[0]).endOf("month").format("YYYY-MM-DD")),F=n.findLast(g=>c.dayjs(g).endOf("month").format("YYYY-MM-DD")===c.dayjs(l.brushRange[1]).endOf("month").format("YYYY-MM-DD"));break}default:B=n.find(g=>new Date(g).getTime()>=new Date(l.brushRange[0]).getTime()),F=n.findLast(g=>new Date(g).getTime()<=new Date(l.brushRange[1]).getTime())}console.log(B,F),t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[B,F],xAxisIndex:0}]})}s&&V.value.draw({startValue:M,endValue:T,maxValueSpan:a},{gridLeft:f,gridRight:m}),le()},H=()=>{if(!t)return;const i=t==null?void 0:t.getOption();i&&(t==null||t.setOption({...i,graphic:[...Te(t,d.value,l,$.value,()=>{Z()})]},!0),le())},le=()=>{const{time:i}=N.value;if(l.brushRange&&(i!=null&&i.length)){let n=c.dayjs(l.brushRange[0]).format("YYYY-MM-DD 00:00:00"),m=c.dayjs(l.brushRange[1]).format("YYYY-MM-DD 23:59:59"),f=null,p=null;switch(l.cycle){case"6":{f=i.find(a=>c.dayjs(a).format("YYYY-MM-DD")===c.dayjs(n).format("YYYY-MM-DD")),p=f;break}case"7":{f=i.find(a=>c.dayjs(a).day(5).format("YYYY-MM-DD")===c.dayjs(n).day(5).format("YYYY-MM-DD")),p=i.findLast(a=>c.dayjs(a).day(5).format("YYYY-MM-DD")===c.dayjs(m).day(5).format("YYYY-MM-DD"));break}case"8":{f=i.find(a=>c.dayjs(a).endOf("month").format("YYYY-MM-DD")===c.dayjs(n).endOf("month").format("YYYY-MM-DD")),p=i.findLast(a=>c.dayjs(a).endOf("month").format("YYYY-MM-DD")===c.dayjs(m).endOf("month").format("YYYY-MM-DD"));break}default:f=i.find(a=>{const s=c.dayjs(a).format("YYYY-MM-DD")===c.dayjs(n).format("YYYY-MM-DD"),M=new Date(a).getTime()>=new Date(n).getTime();return s&&M}),p=i.findLast(a=>{const s=c.dayjs(a).format("YYYY-MM-DD")===c.dayjs(m).format("YYYY-MM-DD"),M=new Date(a).getTime()<=new Date(m).getTime();return s&&M})}t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[f,p],xAxisIndex:0}]})}},Z=async()=>{const i=await Se({featureId:l.featureId});d.value=(i==null?void 0:i.body)||[],H(),k("change","warningLine",d.value)},ye=async i=>{const{variety:n,varietyName:m,featureId:f,featureType:p}=l;if(i.key==="drawWarningLine"){const a=t==null?void 0:t.getOption(),s=a.tooltip[0];t==null||t.setOption({...a,tooltip:{...s,axisPointer:{...s.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...s.axisPointer.label,backgroundColor:"transparent",formatter:T=>""}}}});const M=async T=>{t==null||t.getZr().off("mousedown",M);const x=t==null?void 0:t.convertFromPixel({yAxisIndex:0},T.offsetY),I=Math.round(x*1e3)/1e3;t==null||t.setOption({...a,tooltip:{...s,axisPointer:{...s.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...s.axisPointer.label,backgroundColor:null}}}}),await Me({featureCode:n,featureName:m,featureId:f,featureType:p,warnPrice:I}),J.ElMessage.success("画线预警成功!"),Z()};t==null||t.getZr().on("mousedown",M)}else i.key==="deleteWarningLine"?(await Ve({id:O.value.id}),J.ElMessage.success("画线预警删除成功"),Z()):i.key==="changeWarningLine"&&(P.value=!0,U.value=O.value.warnPrice)},me=async()=>{const{variety:i,varietyName:n,featureId:m,featureType:f}=l;await ue({id:O.value.id,featureCode:i,featureName:n,featureId:m,featureType:f,warnPrice:U.value}),J.ElMessage.success("画线预警修改成功"),Z()},ge=()=>{Q.value=[...h]};return b({draw:(i,n)=>{i==="warningLine"&&(d.value=n,H())}}),(i,n)=>{var T;const m=ie.ElMenuItem,f=ie.ElMenu,p=he.ElEmpty,a=be.ElButton,s=xe.ElInputNumber,M=ve.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:n[1]||(n[1]=x=>r.value=!0),onMouseout:n[2]||(n[2]=x=>r.value=!1)},[e.createElementVNode("div",Ce,[e.createVNode(qe,{data:N.value,activeIndex:L.value},null,8,["data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:$.value.showSubChart?"70%":"100%"})},[e.createVNode($e,{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,x=>(e.openBlock(),e.createBlock(m,{style:{height:"36px"},key:x.key,index:x.key,onClick:I=>ye(x)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.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),$.value.showSubChart?(e.openBlock(),e.createElementBlock("div",We,[e.createVNode(Ie,{ref_key:"klineSubRef",ref:V,modelValue:R.value,"onUpdate:modelValue":n[0]||(n[0]=x=>R.value=x),data:N.value,cycle:o.cycle,activeIndex:L.value,subIndicatorList:(T=o.indicatorStore)==null?void 0:T.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),D.value?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(p,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",Ke,[Ue,e.createElementVNode("div",He,[e.createVNode(a,{onClick:ee},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(M,{modelValue:P.value,"onUpdate:modelValue":n[5]||(n[5]=x=>P.value=x),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",Xe,[e.createVNode(a,{onClick:n[4]||(n[4]=x=>P.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(a,{type:"primary",onClick:me},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[Ze,e.createVNode(s,{modelValue:U.value,"onUpdate:modelValue":n[3]||(n[3]=x=>U.value=x),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},Je=K._export_sfc(Ge,[["__scopeId","data-v-79254471"]]),Qe={install(o){o.component("st-klineBasic",Je)}};module.exports=Qe;
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const ve=require("./el-dialog-a24f4f8f.cjs");require("./el-overlay-ef92f51f.cjs");require("./el-input-06243b61.cjs");const xe=require("./el-input-number-854b2066.cjs"),be=require("./el-button-5973d99c.cjs"),he=require("./el-empty-1697ded8.cjs"),ie=require("./el-menu-item-6522d54c.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-c9e0136d.cjs");const e=require("vue"),_e=require("echarts"),c=require("./dayjs.min-2c20abe6.cjs"),j=require("./index-8901a38c.cjs"),J=require("./el-message-0aeea1a3.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-fe492a6d.cjs");const se=require("./el-select-6d813c15.cjs");require("./el-scrollbar-05815cf5.cjs");require("./index-eab8a286.cjs");require("./index-bb833443.cjs");require("./index-9780a537.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-c2c5ca8f.cjs");require("./index-ca7dbd47.cjs");require("./typescript-b63f8e83.cjs");require("./index-7e4e0bd3.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-79c2df1b.cjs");require("./index-a9d4ef0f.cjs");require("./debounce-62f5b6e8.cjs");function Ye(o){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const S in o)if(S!=="default"){const h=Object.getOwnPropertyDescriptor(o,S);Object.defineProperty(b,S,h.get?h:{enumerable:!0,get:()=>o[S]})}}return b.default=o,Object.freeze(b)}const ne=Ye(_e);let z=null;const ke=o=>{const b=j.y(o,{handleReq:S=>{j.v()&&(S.headers.token=j.U())},handleRes:S=>{const{data:h}=S;if(h.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:j.K(),!0}});b.get,z=b.post},we=o=>z("/middleLayer/kline/getKlineBasic",{...o,userId:j.V("id")}),De=o=>z("/middleLayer/kline/getKline",o),Me=async o=>z("/alarm/deliversign/addAlarmPrice",{...o,userId:j.V("id")}),Se=async o=>z("/alarm/deliversign/findAlarmPriceByUserId",{...o,userId:j.V("id")}),ue=async o=>z("/alarm/deliversign/updateAlarmPrice",{...o,userId:j.V("id")}),Ve=async o=>z("/alarm/deliversign/deleteAlarmPrice",{...o,userId:j.V("id")}),{round:K}=j.x,Le=(o,b,S,h,v)=>{const{data:t,time:w}=o,{gridTop:_,gridRight:u,gridLeft:Y,maxShowCounts:k,showSubChart:l}=b;return{animation:!1,grid:{top:`${_}px`,right:`${u}px`,bottom:l?"6px":"24px",left:`${Y}px`},dataZoom:[{type:"inside",startValue:S,endValue:h,maxValueSpan:k}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:r=>{const{axisDimension:D,value:y}=r;return D==="x"?l?"":["6","7","8"].includes(v)?c.dayjs(y).format("YYYY-MM-DD"):y:String(K(y))}}},formatter:()=>""},xAxis:{show:!l,type:"category",data:w,splitLine:{show:!1},axisLabel:{formatter:r=>["6","7","8"].includes(v)?c.dayjs(r).format("YYYY-MM-DD"):r}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:r=>K(r.min),max:r=>K(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)"}}}},Te=(o,b,S,h,v)=>{const{variety:t,featureId:w,featureType:_}=S,{gridTop:u,gridLeft:Y,gridRight:k}=h;return b.reduce((l,r)=>{const{warnPrice:D}=r,y=o==null?void 0:o.convertToPixel({yAxisIndex:0},D);if(y<=u||y>=(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:Y,y1:y,x2:(o==null?void 0:o.getWidth())-k,y2:y},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:r,x:(o==null?void 0:o.getWidth())-k,y:y-5,style:{fill:"#FFF",text:D,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 L=o.convertFromPixel({yAxisIndex:0},y+(V.offsetY-E));(R=V.target.childAt(1))==null||R.animate("style",!1).when(1,{text:K(L,3)}).start()}},ondragend:async V=>{const L=V.offsetY-E;if(L!==0){const N=o==null?void 0:o.convertFromPixel({yAxisIndex:0},L+y),d={id:r.id,warnPrice:K(N,3),featureId:w,featureCode:t,featureType:_};await ue(d),J.ElMessage.success("画线预警修改成功"),v&&v()}}}]},[])},Be={class:"kline-tips"},Ee=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(o){return(b,S)=>(e.openBlock(),e.createElementBlock("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.data,(h,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"kline-tips-item",style:e.normalizeStyle({color:h.color})},e.toDisplayString(h.label)+" "+e.toDisplayString(h.value),5))),128))]))}});const oe=U._export_sfc(Ee,[["__scopeId","data-v-f83b6b36"]]);const Ne={class:"kline-tips"},Fe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0}},setup(o){const{round:b,formatValue:S}=j.x,h=o,v=e.computed(()=>{const{data:w,activeIndex:_}=h;if(w.data&&w.data[_]){const u=w.data[_],Y=[{label:"开",value:b(u[0])},{label:"高",value:b(u[3])},{label:"低",value:b(u[2])},{label:"收",value:b(u[1])}];u[4]!==null&&Y.push({label:"额",value:S(u[4])});let k;return u[6]>0?k="red":u[6]<0&&(k="green"),Y.push({label:"涨跌",value:`${b(u[6])}%`,color:k}),Y}return[]}),t=e.computed(()=>{var u;const{data:w,activeIndex:_}=h;return((u=w==null?void 0:w.mainIndicator)==null?void 0:u.map(Y=>({label:Y.key,value:b(Y.data[_]),color:Y.color})))||[]});return(w,_)=>(e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(oe,{data:v.value},null,8,["data"]),e.createVNode(oe,{data:t.value},null,8,["data"])]))}},qe=U._export_sfc(Fe,[["__scopeId","data-v-64b5c2a3"]]);const je={class:"klineSub"},Re={class:"klineSub-tips"},Ae={key:0,class:"klineSub-tips-select"},Oe={__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:b,emit:S}){const{round:h}=j.x;let v,t;const w=S,_=o,u=e.ref(),Y=e.computed({get(){return _.modelValue},set(r){w("update:modelValue",r)}}),k=e.computed(()=>{var y;const{data:r,activeIndex:D}=_;return((y=r==null?void 0:r.subIndicator)==null?void 0:y.map(E=>({label:E.key,color:E.color,value:E.data[D]||"-"})))||[]});e.onMounted(()=>{v=ne.init(u.value);let r=!0;t=new ResizeObserver(()=>{if(r){r=null;return}v.resize()}),t.observe(u.value)}),e.onUnmounted(()=>{v.dispose(),t.disconnect(),t=null});const l=(r,D)=>{const y=r[D],E=D===0?r[D]:r[D-1];return y[0]===y[1]?y[0]>=E[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:y[1]>y[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return b({connect:r=>{ne.connect([r,v])},draw:(r,D)=>{e.nextTick(()=>{const{startValue:y,endValue:E,maxValueSpan:V}=r,{leftYAxisRange:R,rightYAxisRange:L}=_.data.subIndicator[0],N=_.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,P)=>d.seriesColor==="kline"?{value:O,itemStyle:l(_.data.data,P)}: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}}});v.setOption({animation:!1,grid:{left:`${D.gridLeft}px`,top:"10px",right:`${D.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:y,endValue:E,maxValueSpan:V}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:d=>{const{axisDimension:O,value:P}=d;if(O==="x")return["6","7","8"].includes(_.cycle)?c.dayjs(P).format("YYYY-MM-DD"):P;if(d.axisIndex===1)return String(h(P))}}},formatter:()=>""},xAxis:{type:"category",data:_.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:d=>["6","7","8"].includes(_.cycle)?c.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:L==="cover"?d=>d.min:null,max:L==="cover"?d=>d.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:N},!0)})}}),(r,D)=>{const y=se.ElOption,E=se.ElSelect;return e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[k.value.length?(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(E,{modelValue:Y.value,"onUpdate:modelValue":D[0]||(D[0]=V=>Y.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(y,{key:V.value,label:V.label,value:V.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(oe,{data:k.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:u},null,512)])}}},Ie=U._export_sfc(Oe,[["__scopeId","data-v-ab519de5"]]),Pe=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(o,{emit:b}){const S=b,h=e.ref(),v=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),w=()=>{t.value.display="none",S("closeContextMenuCallBack"),document.removeEventListener("click",w)},_=u=>{if(u.preventDefault(),t.value.display==="block"){const{offsetX:Y,offsetY:k}=u,{offsetWidth:l,offsetHeight:r}=v.value;if(Y<=l&&k<=r)return}h.value.click(),t.value={display:"block",top:`${u.offsetY}px`,left:`${u.offsetX}px`},e.nextTick(()=>{const Y=h.value.getBoundingClientRect(),k=v.value.getBoundingClientRect();k.left+k.width>=Y.right&&(t.value.left=`${u.offsetX-k.width}px`),k.top+k.height>=Y.bottom&&(console.log("高度超出"),t.value.top=`${u.offsetY-k.height}px`)}),document.addEventListener("click",w)};return(u,Y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:h,class:"contextmenu",onContextmenu:_,onMouseleave:w},[e.renderSlot(u.$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(u.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const $e=U._export_sfc(Pe,[["__scopeId","data-v-811db6b4"]]);const ce=o=>(e.pushScopeId("data-v-9e6456be"),o=o(),e.popScopeId(),o),Ce={class:"klineBasic-tips"},We={key:0,class:"klineBasic-sub"},ze={key:1,class:"klineBasic-empty"},Ke={key:2,class:"klineBasic-error"},Ue=ce(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),He={style:{"text-align":"center"}},Ze=ce(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),Xe={class:"dialog-footer"},Ge={__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:b,emit:S}){const h=[{label:"画线预警",key:"drawWarningLine"}];let v=null,t=null,w,_,u=!1,Y=!1;const k=S,l=o,r=e.ref(!1),D=e.ref(!1),y=e.ref(!1),E=e.ref(null),V=e.ref(null),R=e.ref("VOL"),L=e.ref(0),N=e.ref({}),d=e.ref([]),O=e.ref({}),P=e.ref(!1),H=e.ref(""),Q=e.ref([...h]),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",ae)}),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",ae)});const de=()=>{t||(t=ne.init(E.value),fe(),C.value.showSubChart&&V.value.connect(t),v=j.D(E.value),v.listen(()=>{requestAnimationFrame(()=>{t.resize()})}))},ae=({code:i,ctrlKey:n})=>{if(!(n||r.value))return;const{xAxis:m,dataZoom:f}=t.getOption(),{data:p}=(m==null?void 0:m[0])??{data:[]};let{startValue:a,endValue:s}=(f==null?void 0:f[0])??{};if(p!=null&&p.length){switch(i){case"ArrowUp":{if(s-a<5)return;const M=Math.floor((s-a)/2)+1;a=a+M,s-a<5&&(a=s-4);break}case"ArrowDown":{const M=Math.min(500,s-a);a=a-M-1;break}case"ArrowLeft":{a>0&&(a-=1,s-=1),L.value>0&&(L.value-=1);break}case"ArrowRight":{s<p.length-1&&(a+=1,s+=1),r.value&&L.value<p.length-1&&(L.value+=1);break}}t.dispatchAction({type:"dataZoom",startValue:a,endValue:s}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:r.value?L.value:null}),t.dispatchAction({type:"highlight",dataIndex:r.value?L.value:s})}},fe=()=>{t==null||t.on("datazoom",n=>{clearTimeout(_),_=setTimeout(()=>{var f,p,a,s;const{loadCheckCounts:m}=C.value;if((p=(f=t==null?void 0:t.getOption())==null?void 0:f.dataZoom)!=null&&p[0]){const{startValue:M}=(s=(a=t==null?void 0:t.getOption())==null?void 0:a.dataZoom)==null?void 0:s[0];M<m&&u===!1&&Y===!1&&(u=!0,pe("history")),Z()}clearTimeout(_)},100)}),t==null||t.on("highlight",n=>{var f,p;let m=n.dataIndex||-1;n.batch&&(m=typeof((f=n==null?void 0:n.batch[0])==null?void 0:f.dataIndex)=="number"?(p=n==null?void 0:n.batch[0])==null?void 0:p.dataIndex:-1),clearTimeout(w),w=setTimeout(()=>{L.value=m,clearTimeout(w)},20)}),t==null||t.on("globalout",()=>{var m,f,p;const n=(p=(f=(m=t==null?void 0:t.getOption())==null?void 0:m.dataZoom)==null?void 0:f[0])==null?void 0:p.endValue;L.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,m,f,p,a;try{if(!l.variety||!l.cycle)return;const{variety:s,featureId:M,cycle:T,indicatorStore:x,mainIndicator:I,right:$,startTime:W,endTime:B}=l,{defaultShowCounts:F,addCounts:g,showWarningLine:te,getFactorData:G}=C.value,q={variety:s,featureId:M,cycle:T,mainIndicatorList:x.getIndicatorParams(I),subIndicator:R.value,right:$,showWarningLine:te,getFactorData:G};W&&B?(q.startTime=W,q.endTime=B):W?(q.startTime=W,q.limit=F+g):B?(q.endTime=B,q.limit=F+g):(q.endTime=c.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),q.limit=F+g);const A=await we(q);if((m=(n=(i=A==null?void 0:A.body)==null?void 0:i.kline)==null?void 0:n.time)!=null&&m.length)D.value=!1,y.value=!1;else{D.value=!0,y.value=!1;return}N.value=(f=A==null?void 0:A.body)==null?void 0:f.kline,d.value=((p=A==null?void 0:A.body)==null?void 0:p.warningLine)||[],re(),Z(),G&&k("getFactorData",(a=A==null?void 0:A.body)==null?void 0:a.factor)}catch(s){throw y.value=!0,D.value=!1,new Error(s)}},pe=async i=>{const{variety:n,cycle:m,indicatorStore:f,mainIndicator:p,right:a}=l,{addCounts:s}=C.value,{time:M}=N.value;if(i==="history"){const T=await De({variety:n,cycle:m,endTime:M[0],limit:s,mainIndicatorList:f.getIndicatorParams(p),subIndicator:R.value,right:a});N.value={time:[...T.body.time,...N.value.time.slice(1)],data:[...T.body.data,...N.value.data.slice(1)],mainIndicator:N.value.mainIndicator.map((x,I)=>{var $;return{...x,data:[...(($=T.body.mainIndicator[I])==null?void 0:$.data)??[],...x.data.slice(1)]}}),subIndicator:N.value.subIndicator.map((x,I)=>{var $;return{...x,data:[...(($=T.body.subIndicator[I])==null?void 0:$.data)??[],...x.data.slice(1)]}})},re(!0),T.body.data.length<s&&(Y=!0),u=!1}},re=(i=!1)=>{var I,$,W;de();const{time:n}=N.value,{gridRight:m,gridLeft:f,defaultShowCounts:p,maxShowCounts:a,showSubChart:s}=C.value;let M=n.length-1-p,T=n.length-1;if(i){const B=t.getOption(),F=($=(I=B==null?void 0:B.xAxis)==null?void 0:I[0])==null?void 0:$.data,g=(W=B==null?void 0:B.dataZoom)==null?void 0:W[0],te=F[g==null?void 0:g.startValue],G=F[g==null?void 0:g.endValue];M=n.findIndex(q=>q===te),T=n.findIndex(q=>q===G)}const x=Le(N.value,C.value,M,T,l.cycle);if(t.setOption(x,!0),L.value=T,l.brushRange){let B=null,F=null;switch(l.cycle){case"6":{B=n.find(g=>new Date(g).getTime()>=new Date(l.brushRange[0]).getTime()||c.dayjs(g).format("YYYY-MM-DD")===c.dayjs(l.brushRange[0]).format("YYYY-MM-DD")),F=n.findLast(g=>new Date(g).getTime()<=new Date(l.brushRange[1]).getTime()||c.dayjs(g).format("YYYY-MM-DD")===c.dayjs(l.brushRange[1]).format("YYYY-MM-DD"));break}case"7":{B=n.find(g=>c.dayjs(g).day(5).format("YYYY-MM-DD")===c.dayjs(l.brushRange[0]).day(5).format("YYYY-MM-DD")),F=n.findLast(g=>c.dayjs(g).day(5).format("YYYY-MM-DD")===c.dayjs(l.brushRange[1]).day(5).format("YYYY-MM-DD"));break}case"8":{B=n.find(g=>c.dayjs(g).endOf("month").format("YYYY-MM-DD")===c.dayjs(l.brushRange[0]).endOf("month").format("YYYY-MM-DD")),F=n.findLast(g=>c.dayjs(g).endOf("month").format("YYYY-MM-DD")===c.dayjs(l.brushRange[1]).endOf("month").format("YYYY-MM-DD"));break}default:B=n.find(g=>new Date(g).getTime()>=new Date(l.brushRange[0]).getTime()),F=n.findLast(g=>new Date(g).getTime()<=new Date(l.brushRange[1]).getTime())}console.log(B,F),t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[B,F],xAxisIndex:0}]})}s&&V.value.draw({startValue:M,endValue:T,maxValueSpan:a},{gridLeft:f,gridRight:m}),le()},Z=()=>{if(!t)return;const i=t==null?void 0:t.getOption();i&&(t==null||t.setOption({...i,graphic:[...Te(t,d.value,l,C.value,()=>{X()})]},!0),le())},le=()=>{const{time:i}=N.value;if(l.brushRange&&(i!=null&&i.length)){let n=c.dayjs(l.brushRange[0]).format("YYYY-MM-DD 00:00:00"),m=c.dayjs(l.brushRange[1]).format("YYYY-MM-DD 23:59:59"),f=null,p=null;switch(l.cycle){case"6":{f=i.find(a=>c.dayjs(a).format("YYYY-MM-DD")===c.dayjs(n).format("YYYY-MM-DD")),p=f;break}case"7":{f=i.find(a=>c.dayjs(a).day(5).format("YYYY-MM-DD")===c.dayjs(n).day(5).format("YYYY-MM-DD")),p=i.findLast(a=>c.dayjs(a).day(5).format("YYYY-MM-DD")===c.dayjs(m).day(5).format("YYYY-MM-DD"));break}case"8":{f=i.find(a=>c.dayjs(a).endOf("month").format("YYYY-MM-DD")===c.dayjs(n).endOf("month").format("YYYY-MM-DD")),p=i.findLast(a=>c.dayjs(a).endOf("month").format("YYYY-MM-DD")===c.dayjs(m).endOf("month").format("YYYY-MM-DD"));break}default:f=i.find(a=>{const s=c.dayjs(a).format("YYYY-MM-DD")===c.dayjs(n).format("YYYY-MM-DD"),M=new Date(a).getTime()>=new Date(n).getTime();return s&&M}),p=i.findLast(a=>{const s=c.dayjs(a).format("YYYY-MM-DD")===c.dayjs(m).format("YYYY-MM-DD"),M=new Date(a).getTime()<=new Date(m).getTime();return s&&M})}t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[f,p],xAxisIndex:0}]})}},X=async()=>{const i=await Se({featureId:l.featureId});d.value=(i==null?void 0:i.body)||[],Z(),k("change","warningLine",d.value)},ye=async i=>{const{variety:n,varietyName:m,featureId:f,featureType:p}=l;if(i.key==="drawWarningLine"){const a=t==null?void 0:t.getOption(),s=a.tooltip[0];t==null||t.setOption({...a,tooltip:{...s,axisPointer:{...s.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...s.axisPointer.label,backgroundColor:"transparent",formatter:T=>""}}}});const M=async T=>{t==null||t.getZr().off("mousedown",M);const x=t==null?void 0:t.convertFromPixel({yAxisIndex:0},T.offsetY),I=Math.round(x*1e3)/1e3;t==null||t.setOption({...a,tooltip:{...s,axisPointer:{...s.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...s.axisPointer.label,backgroundColor:null}}}}),await Me({featureCode:n,featureName:m,featureId:f,featureType:p,warnPrice:I}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",M)}else i.key==="deleteWarningLine"?(await Ve({id:O.value.id}),J.ElMessage.success("画线预警删除成功"),X()):i.key==="changeWarningLine"&&(P.value=!0,H.value=O.value.warnPrice)},me=async()=>{const{variety:i,varietyName:n,featureId:m,featureType:f}=l;await ue({id:O.value.id,featureCode:i,featureName:n,featureId:m,featureType:f,warnPrice:H.value}),J.ElMessage.success("画线预警修改成功"),X()},ge=()=>{Q.value=[...h]};return b({draw:(i,n)=>{i==="warningLine"&&(d.value=n,Z())}}),(i,n)=>{var T;const m=ie.ElMenuItem,f=ie.ElMenu,p=he.ElEmpty,a=be.ElButton,s=xe.ElInputNumber,M=ve.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:n[1]||(n[1]=x=>r.value=!0),onMouseout:n[2]||(n[2]=x=>r.value=!1)},[e.createElementVNode("div",Ce,[e.createVNode(qe,{data:N.value,activeIndex:L.value},null,8,["data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:C.value.showSubChart?"70%":"100%"})},[e.createVNode($e,{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,x=>(e.openBlock(),e.createBlock(m,{style:{height:"36px"},key:x.key,index:x.key,onClick:I=>ye(x)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.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",We,[e.createVNode(Ie,{ref_key:"klineSubRef",ref:V,modelValue:R.value,"onUpdate:modelValue":n[0]||(n[0]=x=>R.value=x),data:N.value,cycle:o.cycle,activeIndex:L.value,subIndicatorList:(T=o.indicatorStore)==null?void 0:T.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),D.value?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(p,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("div",Ke,[Ue,e.createElementVNode("div",He,[e.createVNode(a,{onClick:ee},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(M,{modelValue:P.value,"onUpdate:modelValue":n[5]||(n[5]=x=>P.value=x),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",Xe,[e.createVNode(a,{onClick:n[4]||(n[4]=x=>P.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(a,{type:"primary",onClick:me},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[Ze,e.createVNode(s,{modelValue:H.value,"onUpdate:modelValue":n[3]||(n[3]=x=>H.value=x),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},Je=U._export_sfc(Ge,[["__scopeId","data-v-9e6456be"]]),Qe={install(o){o.component("st-klineBasic",Je)}};module.exports=Qe;
|