st-comp 0.0.237 → 0.0.239
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/components.d.ts +0 -1
- package/es/CustomFunction.cjs +1 -1
- package/es/CustomFunction.js +21 -21
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +25 -25
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +10 -10
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +18 -18
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +15 -15
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +9 -9
- package/es/KlinePlus.cjs +1 -1
- package/es/KlinePlus.js +11 -11
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +3 -31
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +13 -13
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +2 -2
- package/es/Table.cjs +1 -1
- package/es/Table.js +17 -17
- package/es/User.cjs +1 -1
- package/es/User.js +18 -18
- package/es/VarSelectDialog.cjs +3 -3
- package/es/VarSelectDialog.js +178 -122
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +7 -7
- package/es/VarietySearch.cjs +17 -18
- package/es/VarietySearch.js +2592 -2705
- package/es/VarietyTextCopy.cjs +1 -1
- package/es/VarietyTextCopy.js +9 -9
- package/es/VirtualTable.cjs +1 -1
- package/es/VirtualTable.js +61 -61
- package/es/{_initCloneObject-3823a101.cjs → _initCloneObject-52b6a510.cjs} +1 -1
- package/es/{_initCloneObject-c34c65bc.js → _initCloneObject-eaef9418.js} +2 -2
- package/es/{config-provider-2182708a.cjs → config-provider-a584d81e.cjs} +1 -1
- package/es/{config-provider-06a63185.js → config-provider-b16efd62.js} +3 -3
- package/es/{dropdown-89b74bc9.cjs → dropdown-071c5d7e.cjs} +1 -1
- package/es/{dropdown-302f71e7.js → dropdown-a59bba73.js} +2 -2
- package/es/{el-autocomplete-b9a3054a.cjs → el-autocomplete-a07e9439.cjs} +1 -1
- package/es/{el-autocomplete-ed75a659.js → el-autocomplete-ba808eb6.js} +5 -5
- package/es/{el-button-d09ff85f.js → el-button-c95adb85.js} +3 -3
- package/es/{el-button-68baab7b.cjs → el-button-eec58cff.cjs} +1 -1
- package/es/{el-checkbox-64648e02.js → el-checkbox-7421ccd3.js} +3 -3
- package/es/{el-checkbox-b982e2ef.cjs → el-checkbox-c25236a6.cjs} +1 -1
- package/es/{el-dialog-6a80e3d8.js → el-dialog-41ab8417.js} +4 -4
- package/es/{el-dialog-ad7309e9.cjs → el-dialog-ae86edb8.cjs} +1 -1
- package/es/{el-form-item-4076e55f.cjs → el-form-item-c3fe189b.cjs} +1 -1
- package/es/{el-form-item-4eca95be.js → el-form-item-c53c374d.js} +5 -5
- package/es/{el-input-cae60510.js → el-input-2f75c4ba.js} +49 -49
- package/es/{el-input-172c49f8.cjs → el-input-7fd293af.cjs} +1 -1
- package/es/{el-input-number-c2e71528.cjs → el-input-number-22e21d16.cjs} +1 -1
- package/es/{el-input-number-c2499410.js → el-input-number-5193fe6d.js} +4 -4
- package/es/{el-loading-05826e64.cjs → el-loading-cfd86c15.cjs} +1 -1
- package/es/{el-loading-c738468d.js → el-loading-f6022062.js} +1 -1
- package/es/{el-menu-item-7f986598.cjs → el-menu-item-17dc717e.cjs} +1 -1
- package/es/{el-menu-item-f904f685.js → el-menu-item-7e881203.js} +4 -4
- package/es/{el-message-a86c0efa.cjs → el-message-5e6a6be9.cjs} +1 -1
- package/es/{el-message-box-05d8cf39.js → el-message-box-a93d2f6a.js} +9 -9
- package/es/{el-message-box-40ff2af5.cjs → el-message-box-c10adb52.cjs} +1 -1
- package/es/{el-message-0df23ae7.js → el-message-e544a8f5.js} +5 -5
- package/es/{el-overlay-cc9bc792.js → el-overlay-09ad71cd.js} +18 -18
- package/es/{el-overlay-d7a6e4a9.cjs → el-overlay-9e34965f.cjs} +1 -1
- package/es/{el-popconfirm-737a015b.cjs → el-popconfirm-70a976bf.cjs} +1 -1
- package/es/{el-popconfirm-a6f66a0e.js → el-popconfirm-81dcd202.js} +4 -4
- package/es/{el-popper-a38874f4.js → el-popper-b4f97157.js} +1 -1
- package/es/{el-popper-7ba87e05.cjs → el-popper-b6c99b28.cjs} +1 -1
- package/es/{el-segmented-51b1c797.js → el-segmented-b868d074.js} +2 -2
- package/es/{el-segmented-3fd66a0e.cjs → el-segmented-f8fce9ac.cjs} +1 -1
- package/es/{el-select-1b149fab.js → el-select-95627997.js} +8 -8
- package/es/{el-select-12f6deb7.cjs → el-select-d8d91db1.cjs} +1 -1
- package/es/{el-table-column-3e30ebae.js → el-table-column-376cd907.js} +9 -9
- package/es/{el-table-column-516a0ed9.cjs → el-table-column-c974cb96.cjs} +1 -1
- package/es/{el-tag-0a25efdf.js → el-tag-66cab138.js} +2 -2
- package/es/{el-tag-789f05d3.cjs → el-tag-a33c4b22.cjs} +1 -1
- package/es/{el-text-73d899ff.js → el-text-ac60d0f2.js} +1 -1
- package/es/{el-text-1470de46.cjs → el-text-c20a9f48.cjs} +1 -1
- package/es/{index-cebc7160.cjs → index-098c2447.cjs} +1 -1
- package/es/{index-c04f444f.cjs → index-11547a0c.cjs} +1 -1
- package/es/{index-4194c942.js → index-1f7d4f70.js} +1 -1
- package/es/{index-8de94a49.cjs → index-298075cf.cjs} +1 -1
- package/es/{index-94e43e0d.js → index-57672682.js} +2 -2
- package/es/{index-6806997d.js → index-844bdd85.js} +2 -2
- package/es/{index-6e967429.js → index-88546436.js} +2 -2
- package/es/{index-ee977f79.cjs → index-9b9ef5dd.cjs} +1 -1
- package/es/{index-87b4bf61.js → index-a871c3eb.js} +60 -75
- package/es/{index-ac98a4d8.js → index-bc8e277e.js} +12573 -12827
- package/es/{index-4f48940d.cjs → index-c108567d.cjs} +1 -1
- package/es/{index-2375023e.cjs → index-d725fef6.cjs} +137 -138
- package/es/{index-54d289d1.js → index-d91dc23f.js} +2 -2
- package/es/{index-42e59bf5.js → index-e5566b94.js} +1 -1
- package/es/{index-696b6a94.cjs → index-f3562b52.cjs} +1 -1
- package/es/{index-269b22da.cjs → index-f967d6c1.cjs} +1 -1
- package/es/{python-c67c8901.cjs → python-c27ba105.cjs} +2 -2
- package/es/{python-a914569a.js → python-ecde9ff2.js} +11 -39
- package/es/style.css +1 -1
- package/es/{use-form-common-props-47e50c10.js → use-form-common-props-815d48a6.js} +28 -28
- package/es/{use-form-common-props-344056f9.cjs → use-form-common-props-fd9b61a0.cjs} +1 -1
- package/es/{use-global-config-cf78ebac.cjs → use-global-config-30d7d8ce.cjs} +1 -1
- package/es/{use-global-config-f52caea0.js → use-global-config-b5e9d3d5.js} +4 -4
- package/es/{validator-3cad04b2.cjs → validator-1b8a6128.cjs} +1 -1
- package/es/{validator-94c04152.js → validator-764a9db0.js} +1 -1
- package/es/{zh-cn-aabfaa94.cjs → zh-cn-90317f62.cjs} +1 -1
- package/es/{zh-cn-4921961d.js → zh-cn-e963c628.js} +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +225 -227
- package/lib/{index-c6d17ca2.js → index-d976d634.js} +31621 -31989
- package/lib/{python-09a6fcf8.js → python-12eba14f.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -2
- package/packages/MonacoEditor/index.vue +70 -741
- package/packages/VarietySearch/components/AddTag/index.vue +85 -20
- package/packages/VarietySearch/components/FactorScreen/index.vue +12 -80
- package/packages/VarietySearch/components/FactorScreen/tools.js +0 -41
- package/src/main.ts +11 -16
- package/src/pages/MonacoEditor/index.vue +0 -1
- package/es/VarietySelect-2fd501da.cjs +0 -1
- package/es/VarietySelect-5a9dd50b.js +0 -68
package/es/Kline.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import "./base-a5af3db3.js";
|
|
2
|
-
import { E as he, a as Ce } from "./el-menu-item-
|
|
2
|
+
import { E as he, a as Ce } from "./el-menu-item-7e881203.js";
|
|
3
3
|
import "./el-tooltip-4ed993c7.js";
|
|
4
|
-
import "./el-popper-
|
|
4
|
+
import "./el-popper-b4f97157.js";
|
|
5
5
|
import { defineComponent as Me, openBlock as h, createElementBlock as k, createElementVNode as K, Fragment as ae, renderList as le, normalizeStyle as ye, toDisplayString as q, ref as S, renderSlot as De, createCommentVNode as xe, nextTick as Ye, computed as W, watch as H, onMounted as de, onUnmounted as ge, createVNode as V, withCtx as X, createBlock as Ae, createTextVNode as Oe, normalizeClass as ke } from "vue";
|
|
6
6
|
import * as oe from "echarts";
|
|
7
7
|
import { _ as $ } from "./_plugin-vue_export-helper-dad06003.js";
|
|
8
8
|
import { x as re } from "./index-7ed0999e.js";
|
|
9
9
|
import { i as ve, t as be } from "./index.esm-8d9a2abe.js";
|
|
10
|
-
import "./el-tag-
|
|
11
|
-
import { E as Ee, a as Se } from "./el-select-
|
|
10
|
+
import "./el-tag-66cab138.js";
|
|
11
|
+
import { E as Ee, a as Se } from "./el-select-95627997.js";
|
|
12
12
|
import "./el-scrollbar-323542e7.js";
|
|
13
|
-
import "./use-form-common-props-
|
|
13
|
+
import "./use-form-common-props-815d48a6.js";
|
|
14
14
|
import "./index-960806da.js";
|
|
15
|
-
import "./index-
|
|
15
|
+
import "./index-a871c3eb.js";
|
|
16
16
|
import "./index-657047bb.js";
|
|
17
17
|
import "./typescript-7ae59c4c.js";
|
|
18
18
|
import "./vnode-5ddb7ed1.js";
|
|
19
|
-
import "./index-
|
|
19
|
+
import "./index-e5566b94.js";
|
|
20
20
|
import "./index-d77a7336.js";
|
|
21
|
-
import "./index-
|
|
22
|
-
import "./index-
|
|
21
|
+
import "./index-844bdd85.js";
|
|
22
|
+
import "./index-57672682.js";
|
|
23
23
|
import "./castArray-7741a212.js";
|
|
24
|
-
import "./index-
|
|
24
|
+
import "./index-d91dc23f.js";
|
|
25
25
|
import "./scroll-679bd6bf.js";
|
|
26
26
|
import "./debounce-8d53f4dd.js";
|
|
27
27
|
const Fe = { class: "st-kline-tips" }, Qe = { class: "st-kline-tips-row" }, _e = /* @__PURE__ */ Me({
|
package/es/KlineBasic.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./base-ef747d02.cjs");const be=require("./el-dialog-ad7309e9.cjs");require("./el-overlay-d7a6e4a9.cjs");require("./el-input-172c49f8.cjs");const xe=require("./el-input-number-c2e71528.cjs"),he=require("./el-button-68baab7b.cjs"),_e=require("./el-empty-1697ded8.cjs"),le=require("./el-menu-item-7f986598.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-7ba87e05.cjs");const e=require("vue"),Ye=require("echarts"),f=require("./dayjs.min-2c20abe6.cjs"),A=require("./index-8901a38c.cjs"),J=require("./el-message-a86c0efa.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-789f05d3.cjs");const ie=require("./el-select-12f6deb7.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./index-cebc7160.cjs");require("./use-form-common-props-344056f9.cjs");require("./index-9780a537.cjs");require("./index-bb833443.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-cf78ebac.cjs");require("./index-4f48940d.cjs");require("./typescript-b63f8e83.cjs");require("./index-c04f444f.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-2182708a.cjs");require("./index-8de94a49.cjs");require("./index-696b6a94.cjs");require("./castArray-35947698.cjs");require("./debounce-62f5b6e8.cjs");function ke(n){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const b in n)if(b!=="default"){const l=Object.getOwnPropertyDescriptor(n,b);Object.defineProperty(Y,b,l.get?l:{enumerable:!0,get:()=>n[b]})}}return Y.default=n,Object.freeze(Y)}const ne=ke(Ye);let K=null;const we=n=>{const Y=A.y(n,{handleReq:b=>{A.v()&&(b.headers.token=A.U())},handleRes:b=>{const{data:l}=b;if(l.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:A.K(),!0}});Y.get,K=Y.post},De=n=>K("/middleLayer/kline/getKlineBasic",{...n,userId:A.V("id")}),Me=n=>K("/middleLayer/kline/getKline",n),Se=async n=>K("/alarm/deliversign/addAlarmPrice",{...n,userId:A.V("id")}),Ve=async n=>K("/alarm/deliversign/findAlarmPriceByUserId",{...n,userId:A.V("id")}),ue=async n=>K("/alarm/deliversign/updateAlarmPrice",{...n,userId:A.V("id")}),Te=async n=>K("/alarm/deliversign/deleteAlarmPrice",{...n,userId:A.V("id")}),{round:z}=A.x,Le=(n,Y,b,l,u)=>{const{data:t,time:M}=n,{gridTop:d,gridRight:x,gridLeft:p,maxShowCounts:g,showSubChart:r}=Y;return{animation:!1,grid:{top:`${d}px`,right:`${x}px`,bottom:r?"6px":"24px",left:`${p}px`},dataZoom:[{type:"inside",startValue:b,endValue:l,maxValueSpan:g}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:a=>{const{axisDimension:h,value:_}=a;return h==="x"?r?"":["6","7","8"].includes(u)?f.dayjs(_).format("YYYY-MM-DD"):_:String(z(_))}}},formatter:()=>""},xAxis:{show:!r,type:"category",data:M,splitLine:{show:!1},axisLabel:{formatter:a=>["6","7","8"].includes(u)?f.dayjs(a).format("YYYY-MM-DD"):a}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:a=>z(a.min),max:a=>z(a.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...n.mainIndicator.map(a=>({name:a.key,type:"line",silent:!0,symbol:"none",data:a.data,lineStyle:{width:a.width||1},itemStyle:{color:a.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)"}}}},Be=(n,Y,b,l,u)=>{const{variety:t,featureId:M,featureType:d}=b,{gridTop:x,gridLeft:p,gridRight:g}=l;return Y.reduce((r,a)=>{const{warnPrice:h}=a,_=n==null?void 0:n.convertToPixel({yAxisIndex:0},h);if(_<=x||_>=(n==null?void 0:n.getHeight()))return r;let N=0;return[...r,{type:"group",name:"warningLine",info:a,draggable:"vertical",children:[{type:"line",info:a,shape:{x1:p,y1:_,x2:(n==null?void 0:n.getWidth())-g,y2:_},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:a,x:(n==null?void 0:n.getWidth())-g,y:_-5,style:{fill:"#FFF",text:h,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:V=>{N=V.offsetY},ondrag:V=>{var R;if(V.target&&V.target.childAt(1)){const T=n.convertFromPixel({yAxisIndex:0},_+(V.offsetY-N));(R=V.target.childAt(1))==null||R.animate("style",!1).when(1,{text:z(T,3)}).start()}},ondragend:async V=>{const T=V.offsetY-N;if(T!==0){const E=n==null?void 0:n.convertFromPixel({yAxisIndex:0},T+_),m={id:a.id,warnPrice:z(E,3),featureId:M,featureCode:t,featureType:d};await ue(m),J.ElMessage.success("画线预警修改成功"),u&&u()}}}]},[])};function ce(n){function Y(l){if(typeof l=="number")return Number.isFinite(l)?l:null;if(typeof l=="string"){const u=l.trim();if(u==="")return null;const t=Number(u);return Number.isFinite(t)?t:null}return null}const b=Y(n);if(b===null)return"-";try{if(b>=1||b<=-1)return z(b);{const l=b.toPrecision(3);return z(l,l.split(".")[1].length-1)}}catch{return"-"}}const Ne=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){const Y=n,b=e.ref(null),l=e.ref([]);return e.watch(()=>Y.data,()=>{l.value.length===0&&e.nextTick(()=>{Array.from(b.value.children).forEach((u,t)=>{var M,d,x,p,g,r,a,h;((d=(M=Y.data)==null?void 0:M[t])==null?void 0:d.label)==="涨跌"?l.value[t]="85px":((p=(x=Y.data)==null?void 0:x[t])==null?void 0:p.label)==="至今涨幅"?l.value[t]="115px":((r=(g=Y.data)==null?void 0:g[t])==null?void 0:r.label)==="额"?l.value[t]="85px":["开","高","低","收"].includes((h=(a=Y.data)==null?void 0:a[t])==null?void 0:h.label)?l.value[t]=`${u.offsetWidth+24}px`:l.value[t]=`${u.offsetWidth+36}px`})})}),(u,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:b},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(M,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"kline-tips-item",style:e.normalizeStyle({color:M.color,width:l.value[d]?l.value[d]:null})},e.toDisplayString(M.label)+" "+e.toDisplayString(M.value),5))),128))],512))}});const se=U._export_sfc(Ne,[["__scopeId","data-v-096c0d10"]]);const Ee={class:"kline-tips"},Fe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(n){const{round:Y,formatValue:b}=A.x,l=n,u=e.ref(null);e.watch(()=>l.activeIndex,()=>{u.value===null&&(u.value=l.data.data[l.activeIndex][1])}),e.watch(()=>l.data,()=>{u.value===null&&(u.value=l.data.data[l.activeIndex][1])}),e.watch(()=>l.variety,()=>{u.value=null});const t=e.computed(()=>{const{data:d,activeIndex:x}=l;if(d.data&&d.data[x]){const p=d.data[x],g=[{label:"开",value:p[0]},{label:"高",value:p[3]},{label:"低",value:p[2]},{label:"收",value:p[1]}];p[4]!==null&&g.push({label:"额",value:b(p[4])});let r;p[6]>0?r="red":p[6]<0&&(r="green"),g.push({label:"涨跌",value:`${Y(p[6])}%`,color:r});const a=(u.value/p[1]-1)*100;let h;return a>0?h="red":a<0&&(h="green"),g.push({label:"至今涨幅",value:`${Y(a)}%`,color:h}),g}return[]}),M=e.computed(()=>{var p;const{data:d,activeIndex:x}=l;return((p=d==null?void 0:d.mainIndicator)==null?void 0:p.map(g=>({label:g.key,value:ce(g.data[x]),color:g.color})))||[]});return(d,x)=>(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(se,{data:t.value},null,8,["data"]),e.createVNode(se,{data:M.value},null,8,["data"])]))}},qe=U._export_sfc(Fe,[["__scopeId","data-v-5be4d504"]]),Ae={class:"kline-averageTips"},Re=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){return(Y,b)=>(e.openBlock(),e.createElementBlock("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(l,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"kline-averageTips-item",style:e.normalizeStyle({color:l.color})},e.toDisplayString(l.label)+" "+e.toDisplayString(l.value),5))),128))]))}});const je=U._export_sfc(Re,[["__scopeId","data-v-2ce54548"]]);const Ie={class:"klineSub"},Oe={class:"klineSub-tips"},$e={key:0,class:"klineSub-tips-select"},Pe={__name:"index",props:{cycle:{type:[String,Number],default:()=>null},data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{expose:Y,emit:b}){const{round:l}=A.x;let u,t;const M=b,d=n,x=e.ref(),p=e.computed({get(){return d.modelValue},set(a){M("update:modelValue",a)}}),g=e.computed(()=>{var _;const{data:a,activeIndex:h}=d;return((_=a==null?void 0:a.subIndicator)==null?void 0:_.map(N=>({label:N.key,color:N.color,value:ce(N.data[h])})))||[]});e.onMounted(()=>{u=ne.init(x.value);let a=!0;t=new ResizeObserver(()=>{if(a){a=null;return}u.resize()}),t.observe(x.value)}),e.onUnmounted(()=>{u.dispose(),t.disconnect(),t=null});const r=(a,h)=>{const _=a[h],N=h===0?a[h]:a[h-1];return _[0]===_[1]?_[0]>=N[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:_[1]>_[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return Y({connect:a=>{ne.connect([a,u])},draw:(a,h)=>{e.nextTick(()=>{const{startValue:_,endValue:N,maxValueSpan:V}=a,{leftYAxisRange:R,rightYAxisRange:T}=d.data.subIndicator[0],E=d.data.subIndicator.map(m=>{if(m.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:m.data.map((I,$)=>m.seriesColor==="kline"?{value:I,itemStyle:r(d.data.data,$)}:m.seriesColor==="value"?{value:I,itemStyle:{color:I>=0?"#FF0000":"#00FFFF"}}:{value:I,itemStyle:{color:m.seriesColor}})};if(m.series==="line")return{xAxisIndex:0,yAxisIndex:m.yAxis==="right"?2:1,name:m.key,type:"line",silent:!0,symbol:"none",data:m.data,lineStyle:{width:1},itemStyle:{color:m.color}}});u.setOption({animation:!1,grid:{left:`${h.gridLeft}px`,top:"10px",right:`${h.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:_,endValue:N,maxValueSpan:V}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:m=>{const{axisDimension:I,value:$}=m;if(I==="x")return["6","7","8"].includes(d.cycle)?f.dayjs($).format("YYYY-MM-DD"):$;if(m.axisIndex===1)return String(l($))}}},formatter:()=>""},xAxis:{type:"category",data:d.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:m=>["6","7","8"].includes(d.cycle)?f.dayjs(m).format("YYYY-MM-DD"):m}},yAxis:[{position:"right"},{position:"left",min:R==="cover"?m=>m.min:null,max:R==="cover"?m=>m.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:T==="cover"?m=>m.min:null,max:T==="cover"?m=>m.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:E},!0)})}}),(a,h)=>{const _=ie.ElOption,N=ie.ElSelect;return e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("div",Oe,[g.value.length?(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(N,{modelValue:p.value,"onUpdate:modelValue":h[0]||(h[0]=V=>p.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(n.subIndicatorList,V=>(e.openBlock(),e.createBlock(_,{key:V.value,label:V.label,value:V.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(je,{data:g.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:x},null,512)])}}},Ce=U._export_sfc(Pe,[["__scopeId","data-v-a6bfe8fe"]]),We=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(n,{emit:Y}){const b=Y,l=e.ref(),u=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),M=()=>{t.value.display="none",b("closeContextMenuCallBack"),document.removeEventListener("click",M)},d=x=>{if(x.preventDefault(),t.value.display==="block"){const{offsetX:p,offsetY:g}=x,{offsetWidth:r,offsetHeight:a}=u.value;if(p<=r&&g<=a)return}l.value.click(),t.value={display:"block",top:`${x.offsetY}px`,left:`${x.offsetX}px`},e.nextTick(()=>{const p=l.value.getBoundingClientRect(),g=u.value.getBoundingClientRect();g.left+g.width>=p.right&&(t.value.left=`${x.offsetX-g.width}px`),g.top+g.height>=p.bottom&&(console.log("高度超出"),t.value.top=`${x.offsetY-g.height}px`)}),document.addEventListener("click",M)};return(x,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:l,class:"contextmenu",onContextmenu:d,onMouseleave:M},[e.renderSlot(x.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:u,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(x.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const ze=U._export_sfc(We,[["__scopeId","data-v-811db6b4"]]);const de=n=>(e.pushScopeId("data-v-e675b051"),n=n(),e.popScopeId(),n),Ke={class:"klineBasic-tips"},Ue={key:0,class:"klineBasic-sub"},He={key:1,class:"klineBasic-empty"},Ze={key:2,class:"klineBasic-error"},Xe=de(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),Ge={style:{"text-align":"center"}},Je=de(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),Qe={class:"dialog-footer"},et={__name:"index",props:{variety:{type:[String,Number],default:()=>null},varietyName:{type:[String,Number],default:()=>null},featureId:{type:[String,Number],default:()=>null},featureType:{type:[String,Number],default:()=>null},cycle:{type:[String,Number],default:()=>null},mainIndicator:{type:String,default:()=>""},indicatorStore:{type:Object,default:()=>null},startTime:{type:String,default:()=>null},endTime:{type:String,default:()=>null},right:{type:[String,Number],default:1},config:{type:Object,default:()=>({})},env:{type:Object,default:()=>({})},brushRange:{type:[Array,null],default:()=>null}},emits:["change","getFactorData"],setup(n,{expose:Y,emit:b}){const l=[{label:"画线预警",key:"drawWarningLine"}];let u=null,t=null,M,d,x=!1,p=!1;const g=b,r=n,a=e.ref(!1),h=e.ref(!1),_=e.ref(!1),N=e.ref(null),V=e.ref(null),R=e.ref("VOL"),T=e.ref(0),E=e.ref({}),m=e.ref([]),I=e.ref({}),$=e.ref(!1),H=e.ref(""),Q=e.ref([...l]),C=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,showSubChart:!0,gridTop:48,gridLeft:80,gridRight:50,showWarningLine:!0,getFactorData:!0,...r.config}));e.watch(()=>{var s,o;return[r.variety,r.cycle,r.mainIndicator,R.value,(s=r.indicatorStore)==null?void 0:s.filterIndicator,(o=r.indicatorStore)==null?void 0:o.customIndicator]},()=>{ee()},{deep:!0}),e.onMounted(()=>{we(r.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(),u==null||u.dispose(),window.removeEventListener("keydown",oe)});const fe=()=>{t||(t=ne.init(N.value),pe(),C.value.showSubChart&&V.value.connect(t),u=A.D(N.value),u.listen(()=>{requestAnimationFrame(()=>{t.resize()})}))},oe=({code:s,ctrlKey:o})=>{if(!(o||a.value))return;const{xAxis:k,dataZoom:y}=t.getOption(),{data:v}=(k==null?void 0:k[0])??{data:[]};let{startValue:i,endValue:c}=(y==null?void 0:y[0])??{};if(v!=null&&v.length){switch(s){case"ArrowUp":{if(c-i<5)return;const S=Math.floor((c-i)/2)+1;i=i+S,c-i<5&&(i=c-4);break}case"ArrowDown":{const S=Math.min(500,c-i);i=i-S-1;break}case"ArrowLeft":{i>0&&(i-=1,c-=1),T.value>0&&(T.value-=1);break}case"ArrowRight":{c<v.length-1&&(i+=1,c+=1),a.value&&T.value<v.length-1&&(T.value+=1);break}}t.dispatchAction({type:"dataZoom",startValue:i,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:a.value?T.value:null}),t.dispatchAction({type:"highlight",dataIndex:a.value?T.value:c})}},pe=()=>{t==null||t.on("datazoom",o=>{clearTimeout(d),d=setTimeout(()=>{var y,v,i,c;const{loadCheckCounts:k}=C.value;if((v=(y=t==null?void 0:t.getOption())==null?void 0:y.dataZoom)!=null&&v[0]){const{startValue:S}=(c=(i=t==null?void 0:t.getOption())==null?void 0:i.dataZoom)==null?void 0:c[0];S<k&&x===!1&&p===!1&&(x=!0,me("history")),Z()}clearTimeout(d)},100)}),t==null||t.on("highlight",o=>{var y,v;let k=o.dataIndex||-1;o.batch&&(k=typeof((y=o==null?void 0:o.batch[0])==null?void 0:y.dataIndex)=="number"?(v=o==null?void 0:o.batch[0])==null?void 0:v.dataIndex:-1),clearTimeout(M),M=setTimeout(()=>{T.value=k,clearTimeout(M)},20)}),t==null||t.on("globalout",()=>{const o=setTimeout(()=>{var y,v,i;clearTimeout(o);const k=(i=(v=(y=t==null?void 0:t.getOption())==null?void 0:y.dataZoom)==null?void 0:v[0])==null?void 0:i.endValue;T.value=k},30)});let s=null;t==null||t.on("contextmenu",o=>{s=setTimeout(()=>{o.componentType==="graphic"&&(I.value=o.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}]),clearTimeout(s),s=null})})},ee=async()=>{var s,o,k,y,v,i;try{if(!r.variety||!r.cycle)return;const{variety:c,featureId:S,cycle:L,indicatorStore:D,mainIndicator:O,right:P,startTime:W,endTime:B}=r,{defaultShowCounts:F,addCounts:w,showWarningLine:te,getFactorData:G}=C.value,q={variety:c,featureId:S,cycle:L,mainIndicatorList:D.getIndicatorParams(O),subIndicator:R.value,right:P,showWarningLine:te,getFactorData:G};W&&B?(q.startTime=W,q.endTime=B):W?(q.startTime=W,q.limit=F+w):B?(q.endTime=B,q.limit=F+w):(q.endTime=f.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),q.limit=F+w);const j=await De(q);if((k=(o=(s=j==null?void 0:j.body)==null?void 0:s.kline)==null?void 0:o.time)!=null&&k.length)h.value=!1,_.value=!1;else{h.value=!0,_.value=!1;return}E.value=(y=j==null?void 0:j.body)==null?void 0:y.kline,m.value=((v=j==null?void 0:j.body)==null?void 0:v.warningLine)||[],ae(),Z(),G&&g("getFactorData",(i=j==null?void 0:j.body)==null?void 0:i.factor)}catch(c){throw _.value=!0,h.value=!1,new Error(c)}},me=async s=>{const{variety:o,cycle:k,indicatorStore:y,mainIndicator:v,right:i}=r,{addCounts:c}=C.value,{time:S}=E.value;if(s==="history"){const L=await Me({variety:o,cycle:k,endTime:S[0],limit:c,mainIndicatorList:y.getIndicatorParams(v),subIndicator:R.value,right:i});E.value={time:[...L.body.time,...E.value.time.slice(1)],data:[...L.body.data,...E.value.data.slice(1)],mainIndicator:E.value.mainIndicator.map((D,O)=>{var P;return{...D,data:[...((P=L.body.mainIndicator[O])==null?void 0:P.data)??[],...D.data.slice(1)]}}),subIndicator:E.value.subIndicator.map((D,O)=>{var P;return{...D,data:[...((P=L.body.subIndicator[O])==null?void 0:P.data)??[],...D.data.slice(1)]}})},ae(!0),L.body.data.length<c&&(p=!0),x=!1}},ae=(s=!1)=>{var O,P,W;fe();const{time:o}=E.value,{gridRight:k,gridLeft:y,defaultShowCounts:v,maxShowCounts:i,showSubChart:c}=C.value;let S=o.length-1-v,L=o.length-1;if(s){const B=t.getOption(),F=(P=(O=B==null?void 0:B.xAxis)==null?void 0:O[0])==null?void 0:P.data,w=(W=B==null?void 0:B.dataZoom)==null?void 0:W[0],te=F[w==null?void 0:w.startValue],G=F[w==null?void 0:w.endValue];S=o.findIndex(q=>q===te),L=o.findIndex(q=>q===G)}const D=Le(E.value,C.value,S,L,r.cycle);if(t.setOption(D,!0),T.value=L,r.brushRange){let B=null,F=null;switch(r.cycle){case"6":{B=o.find(w=>new Date(w).getTime()>=new Date(r.brushRange[0]).getTime()||f.dayjs(w).format("YYYY-MM-DD")===f.dayjs(r.brushRange[0]).format("YYYY-MM-DD")),F=o.findLast(w=>new Date(w).getTime()<=new Date(r.brushRange[1]).getTime()||f.dayjs(w).format("YYYY-MM-DD")===f.dayjs(r.brushRange[1]).format("YYYY-MM-DD"));break}case"7":{B=o.find(w=>f.dayjs(w).day(5).format("YYYY-MM-DD")===f.dayjs(r.brushRange[0]).day(5).format("YYYY-MM-DD")),F=o.findLast(w=>f.dayjs(w).day(5).format("YYYY-MM-DD")===f.dayjs(r.brushRange[1]).day(5).format("YYYY-MM-DD"));break}case"8":{B=o.find(w=>f.dayjs(w).endOf("month").format("YYYY-MM-DD")===f.dayjs(r.brushRange[0]).endOf("month").format("YYYY-MM-DD")),F=o.findLast(w=>f.dayjs(w).endOf("month").format("YYYY-MM-DD")===f.dayjs(r.brushRange[1]).endOf("month").format("YYYY-MM-DD"));break}default:B=o.find(w=>new Date(w).getTime()>=new Date(r.brushRange[0]).getTime()),F=o.findLast(w=>new Date(w).getTime()<=new Date(r.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:i},{gridLeft:y,gridRight:k}),re()},Z=()=>{if(!t)return;const s=t==null?void 0:t.getOption();s&&(t==null||t.setOption({...s,graphic:[...Be(t,m.value,r,C.value,()=>{X()})]},!0),re())},re=()=>{const{time:s}=E.value;if(r.brushRange&&(s!=null&&s.length)){let o=f.dayjs(r.brushRange[0]).format("YYYY-MM-DD 00:00:00"),k=f.dayjs(r.brushRange[1]).format("YYYY-MM-DD 23:59:59"),y=null,v=null;switch(r.cycle){case"6":{y=s.find(i=>f.dayjs(i).format("YYYY-MM-DD")===f.dayjs(o).format("YYYY-MM-DD")),v=y;break}case"7":{y=s.find(i=>f.dayjs(i).day(5).format("YYYY-MM-DD")===f.dayjs(o).day(5).format("YYYY-MM-DD")),v=s.findLast(i=>f.dayjs(i).day(5).format("YYYY-MM-DD")===f.dayjs(k).day(5).format("YYYY-MM-DD"));break}case"8":{y=s.find(i=>f.dayjs(i).endOf("month").format("YYYY-MM-DD")===f.dayjs(o).endOf("month").format("YYYY-MM-DD")),v=s.findLast(i=>f.dayjs(i).endOf("month").format("YYYY-MM-DD")===f.dayjs(k).endOf("month").format("YYYY-MM-DD"));break}default:y=s.find(i=>{const c=f.dayjs(i).format("YYYY-MM-DD")===f.dayjs(o).format("YYYY-MM-DD"),S=new Date(i).getTime()>=new Date(o).getTime();return c&&S}),v=s.findLast(i=>{const c=f.dayjs(i).format("YYYY-MM-DD")===f.dayjs(k).format("YYYY-MM-DD"),S=new Date(i).getTime()<=new Date(k).getTime();return c&&S})}t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[y,v],xAxisIndex:0}]})}},X=async()=>{const s=await Ve({featureId:r.featureId});m.value=(s==null?void 0:s.body)||[],Z(),g("change","warningLine",m.value)},ye=async s=>{const{variety:o,varietyName:k,featureId:y,featureType:v}=r;if(s.key==="drawWarningLine"){const i=t==null?void 0:t.getOption(),c=i.tooltip[0];t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...c.axisPointer.label,backgroundColor:"transparent",formatter:L=>""}}}});const S=async L=>{t==null||t.getZr().off("mousedown",S);const D=t==null?void 0:t.convertFromPixel({yAxisIndex:0},L.offsetY),O=Math.round(D*1e3)/1e3;t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...c.axisPointer.label,backgroundColor:null}}}}),await Se({featureCode:o,featureName:k,featureId:y,featureType:v,warnPrice:O}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",S)}else s.key==="deleteWarningLine"?(await Te({id:I.value.id}),J.ElMessage.success("画线预警删除成功"),X()):s.key==="changeWarningLine"&&($.value=!0,H.value=I.value.warnPrice)},ge=async()=>{const{variety:s,varietyName:o,featureId:k,featureType:y}=r;await ue({id:I.value.id,featureCode:s,featureName:o,featureId:k,featureType:y,warnPrice:H.value}),J.ElMessage.success("画线预警修改成功"),X()},ve=()=>{Q.value=[...l]};return Y({draw:(s,o)=>{s==="warningLine"&&(m.value=o,Z())}}),(s,o)=>{var L;const k=le.ElMenuItem,y=le.ElMenu,v=_e.ElEmpty,i=he.ElButton,c=xe.ElInputNumber,S=be.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:o[1]||(o[1]=D=>a.value=!0),onMouseout:o[2]||(o[2]=D=>a.value=!1)},[e.createElementVNode("div",Ke,[e.createVNode(qe,{variety:n.variety,data:E.value,activeIndex:T.value},null,8,["variety","data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:C.value.showSubChart?"70%":"100%"})},[e.createVNode(ze,{onCloseContextMenuCallBack:ve},{popover:e.withCtx(()=>[e.createVNode(y,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,D=>(e.openBlock(),e.createBlock(k,{style:{height:"36px"},key:D.key,index:D.key,onClick:O=>ye(D)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(D.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:N,style:{height:"100%"}},null,512)]),_:1})],4),C.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(Ce,{ref_key:"klineSubRef",ref:V,modelValue:R.value,"onUpdate:modelValue":o[0]||(o[0]=D=>R.value=D),data:E.value,cycle:n.cycle,activeIndex:T.value,subIndicatorList:(L=n.indicatorStore)==null?void 0:L.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("div",He,[e.createVNode(v,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",Ze,[Xe,e.createElementVNode("div",Ge,[e.createVNode(i,{onClick:ee},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(S,{modelValue:$.value,"onUpdate:modelValue":o[5]||(o[5]=D=>$.value=D),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",Qe,[e.createVNode(i,{onClick:o[4]||(o[4]=D=>$.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(i,{type:"primary",onClick:ge},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[Je,e.createVNode(c,{modelValue:H.value,"onUpdate:modelValue":o[3]||(o[3]=D=>H.value=D),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},tt=U._export_sfc(et,[["__scopeId","data-v-e675b051"]]),nt={install(n){n.component("st-klineBasic",tt)}};module.exports=nt;
|
|
1
|
+
"use strict";require("./base-ef747d02.cjs");const be=require("./el-dialog-ae86edb8.cjs");require("./el-overlay-9e34965f.cjs");require("./el-input-7fd293af.cjs");const xe=require("./el-input-number-22e21d16.cjs"),he=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"),Ye=require("echarts"),f=require("./dayjs.min-2c20abe6.cjs"),A=require("./index-8901a38c.cjs"),J=require("./el-message-5e6a6be9.cjs"),U=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 ke(n){const Y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const b in n)if(b!=="default"){const l=Object.getOwnPropertyDescriptor(n,b);Object.defineProperty(Y,b,l.get?l:{enumerable:!0,get:()=>n[b]})}}return Y.default=n,Object.freeze(Y)}const ne=ke(Ye);let K=null;const we=n=>{const Y=A.y(n,{handleReq:b=>{A.v()&&(b.headers.token=A.U())},handleRes:b=>{const{data:l}=b;if(l.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:A.K(),!0}});Y.get,K=Y.post},De=n=>K("/middleLayer/kline/getKlineBasic",{...n,userId:A.V("id")}),Me=n=>K("/middleLayer/kline/getKline",n),Se=async n=>K("/alarm/deliversign/addAlarmPrice",{...n,userId:A.V("id")}),Ve=async n=>K("/alarm/deliversign/findAlarmPriceByUserId",{...n,userId:A.V("id")}),ue=async n=>K("/alarm/deliversign/updateAlarmPrice",{...n,userId:A.V("id")}),Te=async n=>K("/alarm/deliversign/deleteAlarmPrice",{...n,userId:A.V("id")}),{round:z}=A.x,Le=(n,Y,b,l,u)=>{const{data:t,time:M}=n,{gridTop:d,gridRight:x,gridLeft:p,maxShowCounts:g,showSubChart:r}=Y;return{animation:!1,grid:{top:`${d}px`,right:`${x}px`,bottom:r?"6px":"24px",left:`${p}px`},dataZoom:[{type:"inside",startValue:b,endValue:l,maxValueSpan:g}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:a=>{const{axisDimension:h,value:_}=a;return h==="x"?r?"":["6","7","8"].includes(u)?f.dayjs(_).format("YYYY-MM-DD"):_:String(z(_))}}},formatter:()=>""},xAxis:{show:!r,type:"category",data:M,splitLine:{show:!1},axisLabel:{formatter:a=>["6","7","8"].includes(u)?f.dayjs(a).format("YYYY-MM-DD"):a}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:a=>z(a.min),max:a=>z(a.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...n.mainIndicator.map(a=>({name:a.key,type:"line",silent:!0,symbol:"none",data:a.data,lineStyle:{width:a.width||1},itemStyle:{color:a.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)"}}}},Be=(n,Y,b,l,u)=>{const{variety:t,featureId:M,featureType:d}=b,{gridTop:x,gridLeft:p,gridRight:g}=l;return Y.reduce((r,a)=>{const{warnPrice:h}=a,_=n==null?void 0:n.convertToPixel({yAxisIndex:0},h);if(_<=x||_>=(n==null?void 0:n.getHeight()))return r;let N=0;return[...r,{type:"group",name:"warningLine",info:a,draggable:"vertical",children:[{type:"line",info:a,shape:{x1:p,y1:_,x2:(n==null?void 0:n.getWidth())-g,y2:_},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:a,x:(n==null?void 0:n.getWidth())-g,y:_-5,style:{fill:"#FFF",text:h,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:V=>{N=V.offsetY},ondrag:V=>{var R;if(V.target&&V.target.childAt(1)){const T=n.convertFromPixel({yAxisIndex:0},_+(V.offsetY-N));(R=V.target.childAt(1))==null||R.animate("style",!1).when(1,{text:z(T,3)}).start()}},ondragend:async V=>{const T=V.offsetY-N;if(T!==0){const E=n==null?void 0:n.convertFromPixel({yAxisIndex:0},T+_),m={id:a.id,warnPrice:z(E,3),featureId:M,featureCode:t,featureType:d};await ue(m),J.ElMessage.success("画线预警修改成功"),u&&u()}}}]},[])};function ce(n){function Y(l){if(typeof l=="number")return Number.isFinite(l)?l:null;if(typeof l=="string"){const u=l.trim();if(u==="")return null;const t=Number(u);return Number.isFinite(t)?t:null}return null}const b=Y(n);if(b===null)return"-";try{if(b>=1||b<=-1)return z(b);{const l=b.toPrecision(3);return z(l,l.split(".")[1].length-1)}}catch{return"-"}}const Ne=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){const Y=n,b=e.ref(null),l=e.ref([]);return e.watch(()=>Y.data,()=>{l.value.length===0&&e.nextTick(()=>{Array.from(b.value.children).forEach((u,t)=>{var M,d,x,p,g,r,a,h;((d=(M=Y.data)==null?void 0:M[t])==null?void 0:d.label)==="涨跌"?l.value[t]="85px":((p=(x=Y.data)==null?void 0:x[t])==null?void 0:p.label)==="至今涨幅"?l.value[t]="115px":((r=(g=Y.data)==null?void 0:g[t])==null?void 0:r.label)==="额"?l.value[t]="85px":["开","高","低","收"].includes((h=(a=Y.data)==null?void 0:a[t])==null?void 0:h.label)?l.value[t]=`${u.offsetWidth+24}px`:l.value[t]=`${u.offsetWidth+36}px`})})}),(u,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:b},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(M,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"kline-tips-item",style:e.normalizeStyle({color:M.color,width:l.value[d]?l.value[d]:null})},e.toDisplayString(M.label)+" "+e.toDisplayString(M.value),5))),128))],512))}});const se=U._export_sfc(Ne,[["__scopeId","data-v-096c0d10"]]);const Ee={class:"kline-tips"},Fe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(n){const{round:Y,formatValue:b}=A.x,l=n,u=e.ref(null);e.watch(()=>l.activeIndex,()=>{u.value===null&&(u.value=l.data.data[l.activeIndex][1])}),e.watch(()=>l.data,()=>{u.value===null&&(u.value=l.data.data[l.activeIndex][1])}),e.watch(()=>l.variety,()=>{u.value=null});const t=e.computed(()=>{const{data:d,activeIndex:x}=l;if(d.data&&d.data[x]){const p=d.data[x],g=[{label:"开",value:p[0]},{label:"高",value:p[3]},{label:"低",value:p[2]},{label:"收",value:p[1]}];p[4]!==null&&g.push({label:"额",value:b(p[4])});let r;p[6]>0?r="red":p[6]<0&&(r="green"),g.push({label:"涨跌",value:`${Y(p[6])}%`,color:r});const a=(u.value/p[1]-1)*100;let h;return a>0?h="red":a<0&&(h="green"),g.push({label:"至今涨幅",value:`${Y(a)}%`,color:h}),g}return[]}),M=e.computed(()=>{var p;const{data:d,activeIndex:x}=l;return((p=d==null?void 0:d.mainIndicator)==null?void 0:p.map(g=>({label:g.key,value:ce(g.data[x]),color:g.color})))||[]});return(d,x)=>(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(se,{data:t.value},null,8,["data"]),e.createVNode(se,{data:M.value},null,8,["data"])]))}},qe=U._export_sfc(Fe,[["__scopeId","data-v-5be4d504"]]),Ae={class:"kline-averageTips"},Re=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){return(Y,b)=>(e.openBlock(),e.createElementBlock("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(l,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"kline-averageTips-item",style:e.normalizeStyle({color:l.color})},e.toDisplayString(l.label)+" "+e.toDisplayString(l.value),5))),128))]))}});const je=U._export_sfc(Re,[["__scopeId","data-v-2ce54548"]]);const Ie={class:"klineSub"},Oe={class:"klineSub-tips"},$e={key:0,class:"klineSub-tips-select"},Pe={__name:"index",props:{cycle:{type:[String,Number],default:()=>null},data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{expose:Y,emit:b}){const{round:l}=A.x;let u,t;const M=b,d=n,x=e.ref(),p=e.computed({get(){return d.modelValue},set(a){M("update:modelValue",a)}}),g=e.computed(()=>{var _;const{data:a,activeIndex:h}=d;return((_=a==null?void 0:a.subIndicator)==null?void 0:_.map(N=>({label:N.key,color:N.color,value:ce(N.data[h])})))||[]});e.onMounted(()=>{u=ne.init(x.value);let a=!0;t=new ResizeObserver(()=>{if(a){a=null;return}u.resize()}),t.observe(x.value)}),e.onUnmounted(()=>{u.dispose(),t.disconnect(),t=null});const r=(a,h)=>{const _=a[h],N=h===0?a[h]:a[h-1];return _[0]===_[1]?_[0]>=N[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:_[1]>_[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return Y({connect:a=>{ne.connect([a,u])},draw:(a,h)=>{e.nextTick(()=>{const{startValue:_,endValue:N,maxValueSpan:V}=a,{leftYAxisRange:R,rightYAxisRange:T}=d.data.subIndicator[0],E=d.data.subIndicator.map(m=>{if(m.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:m.data.map((I,$)=>m.seriesColor==="kline"?{value:I,itemStyle:r(d.data.data,$)}:m.seriesColor==="value"?{value:I,itemStyle:{color:I>=0?"#FF0000":"#00FFFF"}}:{value:I,itemStyle:{color:m.seriesColor}})};if(m.series==="line")return{xAxisIndex:0,yAxisIndex:m.yAxis==="right"?2:1,name:m.key,type:"line",silent:!0,symbol:"none",data:m.data,lineStyle:{width:1},itemStyle:{color:m.color}}});u.setOption({animation:!1,grid:{left:`${h.gridLeft}px`,top:"10px",right:`${h.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:_,endValue:N,maxValueSpan:V}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:m=>{const{axisDimension:I,value:$}=m;if(I==="x")return["6","7","8"].includes(d.cycle)?f.dayjs($).format("YYYY-MM-DD"):$;if(m.axisIndex===1)return String(l($))}}},formatter:()=>""},xAxis:{type:"category",data:d.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:m=>["6","7","8"].includes(d.cycle)?f.dayjs(m).format("YYYY-MM-DD"):m}},yAxis:[{position:"right"},{position:"left",min:R==="cover"?m=>m.min:null,max:R==="cover"?m=>m.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:T==="cover"?m=>m.min:null,max:T==="cover"?m=>m.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:E},!0)})}}),(a,h)=>{const _=ie.ElOption,N=ie.ElSelect;return e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("div",Oe,[g.value.length?(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(N,{modelValue:p.value,"onUpdate:modelValue":h[0]||(h[0]=V=>p.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(n.subIndicatorList,V=>(e.openBlock(),e.createBlock(_,{key:V.value,label:V.label,value:V.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(je,{data:g.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:x},null,512)])}}},Ce=U._export_sfc(Pe,[["__scopeId","data-v-a6bfe8fe"]]),We=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(n,{emit:Y}){const b=Y,l=e.ref(),u=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),M=()=>{t.value.display="none",b("closeContextMenuCallBack"),document.removeEventListener("click",M)},d=x=>{if(x.preventDefault(),t.value.display==="block"){const{offsetX:p,offsetY:g}=x,{offsetWidth:r,offsetHeight:a}=u.value;if(p<=r&&g<=a)return}l.value.click(),t.value={display:"block",top:`${x.offsetY}px`,left:`${x.offsetX}px`},e.nextTick(()=>{const p=l.value.getBoundingClientRect(),g=u.value.getBoundingClientRect();g.left+g.width>=p.right&&(t.value.left=`${x.offsetX-g.width}px`),g.top+g.height>=p.bottom&&(console.log("高度超出"),t.value.top=`${x.offsetY-g.height}px`)}),document.addEventListener("click",M)};return(x,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:l,class:"contextmenu",onContextmenu:d,onMouseleave:M},[e.renderSlot(x.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:u,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(x.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const ze=U._export_sfc(We,[["__scopeId","data-v-811db6b4"]]);const de=n=>(e.pushScopeId("data-v-e675b051"),n=n(),e.popScopeId(),n),Ke={class:"klineBasic-tips"},Ue={key:0,class:"klineBasic-sub"},He={key:1,class:"klineBasic-empty"},Ze={key:2,class:"klineBasic-error"},Xe=de(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),Ge={style:{"text-align":"center"}},Je=de(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),Qe={class:"dialog-footer"},et={__name:"index",props:{variety:{type:[String,Number],default:()=>null},varietyName:{type:[String,Number],default:()=>null},featureId:{type:[String,Number],default:()=>null},featureType:{type:[String,Number],default:()=>null},cycle:{type:[String,Number],default:()=>null},mainIndicator:{type:String,default:()=>""},indicatorStore:{type:Object,default:()=>null},startTime:{type:String,default:()=>null},endTime:{type:String,default:()=>null},right:{type:[String,Number],default:1},config:{type:Object,default:()=>({})},env:{type:Object,default:()=>({})},brushRange:{type:[Array,null],default:()=>null}},emits:["change","getFactorData"],setup(n,{expose:Y,emit:b}){const l=[{label:"画线预警",key:"drawWarningLine"}];let u=null,t=null,M,d,x=!1,p=!1;const g=b,r=n,a=e.ref(!1),h=e.ref(!1),_=e.ref(!1),N=e.ref(null),V=e.ref(null),R=e.ref("VOL"),T=e.ref(0),E=e.ref({}),m=e.ref([]),I=e.ref({}),$=e.ref(!1),H=e.ref(""),Q=e.ref([...l]),C=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,showSubChart:!0,gridTop:48,gridLeft:80,gridRight:50,showWarningLine:!0,getFactorData:!0,...r.config}));e.watch(()=>{var s,o;return[r.variety,r.cycle,r.mainIndicator,R.value,(s=r.indicatorStore)==null?void 0:s.filterIndicator,(o=r.indicatorStore)==null?void 0:o.customIndicator]},()=>{ee()},{deep:!0}),e.onMounted(()=>{we(r.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(),u==null||u.dispose(),window.removeEventListener("keydown",oe)});const fe=()=>{t||(t=ne.init(N.value),pe(),C.value.showSubChart&&V.value.connect(t),u=A.D(N.value),u.listen(()=>{requestAnimationFrame(()=>{t.resize()})}))},oe=({code:s,ctrlKey:o})=>{if(!(o||a.value))return;const{xAxis:k,dataZoom:y}=t.getOption(),{data:v}=(k==null?void 0:k[0])??{data:[]};let{startValue:i,endValue:c}=(y==null?void 0:y[0])??{};if(v!=null&&v.length){switch(s){case"ArrowUp":{if(c-i<5)return;const S=Math.floor((c-i)/2)+1;i=i+S,c-i<5&&(i=c-4);break}case"ArrowDown":{const S=Math.min(500,c-i);i=i-S-1;break}case"ArrowLeft":{i>0&&(i-=1,c-=1),T.value>0&&(T.value-=1);break}case"ArrowRight":{c<v.length-1&&(i+=1,c+=1),a.value&&T.value<v.length-1&&(T.value+=1);break}}t.dispatchAction({type:"dataZoom",startValue:i,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:a.value?T.value:null}),t.dispatchAction({type:"highlight",dataIndex:a.value?T.value:c})}},pe=()=>{t==null||t.on("datazoom",o=>{clearTimeout(d),d=setTimeout(()=>{var y,v,i,c;const{loadCheckCounts:k}=C.value;if((v=(y=t==null?void 0:t.getOption())==null?void 0:y.dataZoom)!=null&&v[0]){const{startValue:S}=(c=(i=t==null?void 0:t.getOption())==null?void 0:i.dataZoom)==null?void 0:c[0];S<k&&x===!1&&p===!1&&(x=!0,me("history")),Z()}clearTimeout(d)},100)}),t==null||t.on("highlight",o=>{var y,v;let k=o.dataIndex||-1;o.batch&&(k=typeof((y=o==null?void 0:o.batch[0])==null?void 0:y.dataIndex)=="number"?(v=o==null?void 0:o.batch[0])==null?void 0:v.dataIndex:-1),clearTimeout(M),M=setTimeout(()=>{T.value=k,clearTimeout(M)},20)}),t==null||t.on("globalout",()=>{const o=setTimeout(()=>{var y,v,i;clearTimeout(o);const k=(i=(v=(y=t==null?void 0:t.getOption())==null?void 0:y.dataZoom)==null?void 0:v[0])==null?void 0:i.endValue;T.value=k},30)});let s=null;t==null||t.on("contextmenu",o=>{s=setTimeout(()=>{o.componentType==="graphic"&&(I.value=o.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}]),clearTimeout(s),s=null})})},ee=async()=>{var s,o,k,y,v,i;try{if(!r.variety||!r.cycle)return;const{variety:c,featureId:S,cycle:L,indicatorStore:D,mainIndicator:O,right:P,startTime:W,endTime:B}=r,{defaultShowCounts:F,addCounts:w,showWarningLine:te,getFactorData:G}=C.value,q={variety:c,featureId:S,cycle:L,mainIndicatorList:D.getIndicatorParams(O),subIndicator:R.value,right:P,showWarningLine:te,getFactorData:G};W&&B?(q.startTime=W,q.endTime=B):W?(q.startTime=W,q.limit=F+w):B?(q.endTime=B,q.limit=F+w):(q.endTime=f.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),q.limit=F+w);const j=await De(q);if((k=(o=(s=j==null?void 0:j.body)==null?void 0:s.kline)==null?void 0:o.time)!=null&&k.length)h.value=!1,_.value=!1;else{h.value=!0,_.value=!1;return}E.value=(y=j==null?void 0:j.body)==null?void 0:y.kline,m.value=((v=j==null?void 0:j.body)==null?void 0:v.warningLine)||[],ae(),Z(),G&&g("getFactorData",(i=j==null?void 0:j.body)==null?void 0:i.factor)}catch(c){throw _.value=!0,h.value=!1,new Error(c)}},me=async s=>{const{variety:o,cycle:k,indicatorStore:y,mainIndicator:v,right:i}=r,{addCounts:c}=C.value,{time:S}=E.value;if(s==="history"){const L=await Me({variety:o,cycle:k,endTime:S[0],limit:c,mainIndicatorList:y.getIndicatorParams(v),subIndicator:R.value,right:i});E.value={time:[...L.body.time,...E.value.time.slice(1)],data:[...L.body.data,...E.value.data.slice(1)],mainIndicator:E.value.mainIndicator.map((D,O)=>{var P;return{...D,data:[...((P=L.body.mainIndicator[O])==null?void 0:P.data)??[],...D.data.slice(1)]}}),subIndicator:E.value.subIndicator.map((D,O)=>{var P;return{...D,data:[...((P=L.body.subIndicator[O])==null?void 0:P.data)??[],...D.data.slice(1)]}})},ae(!0),L.body.data.length<c&&(p=!0),x=!1}},ae=(s=!1)=>{var O,P,W;fe();const{time:o}=E.value,{gridRight:k,gridLeft:y,defaultShowCounts:v,maxShowCounts:i,showSubChart:c}=C.value;let S=o.length-1-v,L=o.length-1;if(s){const B=t.getOption(),F=(P=(O=B==null?void 0:B.xAxis)==null?void 0:O[0])==null?void 0:P.data,w=(W=B==null?void 0:B.dataZoom)==null?void 0:W[0],te=F[w==null?void 0:w.startValue],G=F[w==null?void 0:w.endValue];S=o.findIndex(q=>q===te),L=o.findIndex(q=>q===G)}const D=Le(E.value,C.value,S,L,r.cycle);if(t.setOption(D,!0),T.value=L,r.brushRange){let B=null,F=null;switch(r.cycle){case"6":{B=o.find(w=>new Date(w).getTime()>=new Date(r.brushRange[0]).getTime()||f.dayjs(w).format("YYYY-MM-DD")===f.dayjs(r.brushRange[0]).format("YYYY-MM-DD")),F=o.findLast(w=>new Date(w).getTime()<=new Date(r.brushRange[1]).getTime()||f.dayjs(w).format("YYYY-MM-DD")===f.dayjs(r.brushRange[1]).format("YYYY-MM-DD"));break}case"7":{B=o.find(w=>f.dayjs(w).day(5).format("YYYY-MM-DD")===f.dayjs(r.brushRange[0]).day(5).format("YYYY-MM-DD")),F=o.findLast(w=>f.dayjs(w).day(5).format("YYYY-MM-DD")===f.dayjs(r.brushRange[1]).day(5).format("YYYY-MM-DD"));break}case"8":{B=o.find(w=>f.dayjs(w).endOf("month").format("YYYY-MM-DD")===f.dayjs(r.brushRange[0]).endOf("month").format("YYYY-MM-DD")),F=o.findLast(w=>f.dayjs(w).endOf("month").format("YYYY-MM-DD")===f.dayjs(r.brushRange[1]).endOf("month").format("YYYY-MM-DD"));break}default:B=o.find(w=>new Date(w).getTime()>=new Date(r.brushRange[0]).getTime()),F=o.findLast(w=>new Date(w).getTime()<=new Date(r.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:i},{gridLeft:y,gridRight:k}),re()},Z=()=>{if(!t)return;const s=t==null?void 0:t.getOption();s&&(t==null||t.setOption({...s,graphic:[...Be(t,m.value,r,C.value,()=>{X()})]},!0),re())},re=()=>{const{time:s}=E.value;if(r.brushRange&&(s!=null&&s.length)){let o=f.dayjs(r.brushRange[0]).format("YYYY-MM-DD 00:00:00"),k=f.dayjs(r.brushRange[1]).format("YYYY-MM-DD 23:59:59"),y=null,v=null;switch(r.cycle){case"6":{y=s.find(i=>f.dayjs(i).format("YYYY-MM-DD")===f.dayjs(o).format("YYYY-MM-DD")),v=y;break}case"7":{y=s.find(i=>f.dayjs(i).day(5).format("YYYY-MM-DD")===f.dayjs(o).day(5).format("YYYY-MM-DD")),v=s.findLast(i=>f.dayjs(i).day(5).format("YYYY-MM-DD")===f.dayjs(k).day(5).format("YYYY-MM-DD"));break}case"8":{y=s.find(i=>f.dayjs(i).endOf("month").format("YYYY-MM-DD")===f.dayjs(o).endOf("month").format("YYYY-MM-DD")),v=s.findLast(i=>f.dayjs(i).endOf("month").format("YYYY-MM-DD")===f.dayjs(k).endOf("month").format("YYYY-MM-DD"));break}default:y=s.find(i=>{const c=f.dayjs(i).format("YYYY-MM-DD")===f.dayjs(o).format("YYYY-MM-DD"),S=new Date(i).getTime()>=new Date(o).getTime();return c&&S}),v=s.findLast(i=>{const c=f.dayjs(i).format("YYYY-MM-DD")===f.dayjs(k).format("YYYY-MM-DD"),S=new Date(i).getTime()<=new Date(k).getTime();return c&&S})}t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[y,v],xAxisIndex:0}]})}},X=async()=>{const s=await Ve({featureId:r.featureId});m.value=(s==null?void 0:s.body)||[],Z(),g("change","warningLine",m.value)},ye=async s=>{const{variety:o,varietyName:k,featureId:y,featureType:v}=r;if(s.key==="drawWarningLine"){const i=t==null?void 0:t.getOption(),c=i.tooltip[0];t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...c.axisPointer.label,backgroundColor:"transparent",formatter:L=>""}}}});const S=async L=>{t==null||t.getZr().off("mousedown",S);const D=t==null?void 0:t.convertFromPixel({yAxisIndex:0},L.offsetY),O=Math.round(D*1e3)/1e3;t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...c.axisPointer.label,backgroundColor:null}}}}),await Se({featureCode:o,featureName:k,featureId:y,featureType:v,warnPrice:O}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",S)}else s.key==="deleteWarningLine"?(await Te({id:I.value.id}),J.ElMessage.success("画线预警删除成功"),X()):s.key==="changeWarningLine"&&($.value=!0,H.value=I.value.warnPrice)},ge=async()=>{const{variety:s,varietyName:o,featureId:k,featureType:y}=r;await ue({id:I.value.id,featureCode:s,featureName:o,featureId:k,featureType:y,warnPrice:H.value}),J.ElMessage.success("画线预警修改成功"),X()},ve=()=>{Q.value=[...l]};return Y({draw:(s,o)=>{s==="warningLine"&&(m.value=o,Z())}}),(s,o)=>{var L;const k=le.ElMenuItem,y=le.ElMenu,v=_e.ElEmpty,i=he.ElButton,c=xe.ElInputNumber,S=be.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:o[1]||(o[1]=D=>a.value=!0),onMouseout:o[2]||(o[2]=D=>a.value=!1)},[e.createElementVNode("div",Ke,[e.createVNode(qe,{variety:n.variety,data:E.value,activeIndex:T.value},null,8,["variety","data","activeIndex"])]),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:C.value.showSubChart?"70%":"100%"})},[e.createVNode(ze,{onCloseContextMenuCallBack:ve},{popover:e.withCtx(()=>[e.createVNode(y,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,D=>(e.openBlock(),e.createBlock(k,{style:{height:"36px"},key:D.key,index:D.key,onClick:O=>ye(D)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(D.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:N,style:{height:"100%"}},null,512)]),_:1})],4),C.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(Ce,{ref_key:"klineSubRef",ref:V,modelValue:R.value,"onUpdate:modelValue":o[0]||(o[0]=D=>R.value=D),data:E.value,cycle:n.cycle,activeIndex:T.value,subIndicatorList:(L=n.indicatorStore)==null?void 0:L.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("div",He,[e.createVNode(v,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",Ze,[Xe,e.createElementVNode("div",Ge,[e.createVNode(i,{onClick:ee},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(S,{modelValue:$.value,"onUpdate:modelValue":o[5]||(o[5]=D=>$.value=D),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",Qe,[e.createVNode(i,{onClick:o[4]||(o[4]=D=>$.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(i,{type:"primary",onClick:ge},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[Je,e.createVNode(c,{modelValue:H.value,"onUpdate:modelValue":o[3]||(o[3]=D=>H.value=D),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},tt=U._export_sfc(et,[["__scopeId","data-v-e675b051"]]),nt={install(n){n.component("st-klineBasic",tt)}};module.exports=nt;
|
package/es/KlineBasic.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import "./base-a5af3db3.js";
|
|
2
|
-
import { E as Be } from "./el-dialog-
|
|
3
|
-
import "./el-overlay-
|
|
4
|
-
import "./el-input-
|
|
5
|
-
import { E as Oe } from "./el-input-number-
|
|
6
|
-
import { E as $e } from "./el-button-
|
|
2
|
+
import { E as Be } from "./el-dialog-41ab8417.js";
|
|
3
|
+
import "./el-overlay-09ad71cd.js";
|
|
4
|
+
import "./el-input-2f75c4ba.js";
|
|
5
|
+
import { E as Oe } from "./el-input-number-5193fe6d.js";
|
|
6
|
+
import { E as $e } from "./el-button-c95adb85.js";
|
|
7
7
|
import { E as Ne } from "./el-empty-33cb66f1.js";
|
|
8
|
-
import { E as Pe, a as We } from "./el-menu-item-
|
|
8
|
+
import { E as Pe, a as We } from "./el-menu-item-7e881203.js";
|
|
9
9
|
import "./el-tooltip-4ed993c7.js";
|
|
10
|
-
import "./el-popper-
|
|
10
|
+
import "./el-popper-b4f97157.js";
|
|
11
11
|
import { defineComponent as ve, ref as T, watch as J, nextTick as ge, openBlock as F, createElementBlock as E, Fragment as ee, renderList as ce, normalizeStyle as de, toDisplayString as te, computed as ne, createVNode as B, onMounted as De, onUnmounted as ke, createElementVNode as U, withCtx as K, createBlock as Me, createCommentVNode as Q, renderSlot as Ye, createTextVNode as se, pushScopeId as qe, popScopeId as Ce } from "vue";
|
|
12
12
|
import * as ye from "echarts";
|
|
13
13
|
import { d } from "./dayjs.min-8313b006.js";
|
|
14
14
|
import { y as ze, v as Ke, U as Ue, K as He, V as oe, x as be, D as je } from "./index-7ed0999e.js";
|
|
15
|
-
import { E as ue } from "./el-message-
|
|
15
|
+
import { E as ue } from "./el-message-e544a8f5.js";
|
|
16
16
|
import { _ as G } from "./_plugin-vue_export-helper-dad06003.js";
|
|
17
|
-
import "./el-tag-
|
|
18
|
-
import { E as Ze, a as Xe } from "./el-select-
|
|
17
|
+
import "./el-tag-66cab138.js";
|
|
18
|
+
import { E as Ze, a as Xe } from "./el-select-95627997.js";
|
|
19
19
|
import "./el-scrollbar-323542e7.js";
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./use-form-common-props-
|
|
20
|
+
import "./index-a871c3eb.js";
|
|
21
|
+
import "./use-form-common-props-815d48a6.js";
|
|
22
22
|
import "./index-960806da.js";
|
|
23
23
|
import "./index-d77a7336.js";
|
|
24
24
|
import "./index-2e331d74.js";
|
|
25
25
|
import "./vnode-5ddb7ed1.js";
|
|
26
26
|
import "./scroll-679bd6bf.js";
|
|
27
|
-
import "./use-global-config-
|
|
28
|
-
import "./index-
|
|
27
|
+
import "./use-global-config-b5e9d3d5.js";
|
|
28
|
+
import "./index-e5566b94.js";
|
|
29
29
|
import "./typescript-7ae59c4c.js";
|
|
30
|
-
import "./index-
|
|
30
|
+
import "./index-d91dc23f.js";
|
|
31
31
|
import "./index-657047bb.js";
|
|
32
|
-
import "./config-provider-
|
|
33
|
-
import "./index-
|
|
34
|
-
import "./index-
|
|
32
|
+
import "./config-provider-b16efd62.js";
|
|
33
|
+
import "./index-844bdd85.js";
|
|
34
|
+
import "./index-57672682.js";
|
|
35
35
|
import "./castArray-7741a212.js";
|
|
36
36
|
import "./debounce-8d53f4dd.js";
|
|
37
37
|
let X = null;
|
package/es/KlineConfig.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("./base-ef747d02.cjs"),A=require("./el-overlay-d7a6e4a9.cjs"),F=require("./el-button-68baab7b.cjs");require("./el-scrollbar-bc3f790d.cjs");const R=require("./el-segmented-3fd66a0e.cjs"),x=require("./el-checkbox-b982e2ef.cjs");require("./el-tag-789f05d3.cjs");const U=require("./el-select-12f6deb7.cjs"),h=require("./el-popper-7ba87e05.cjs"),M=require("./el-divider-4713d74c.cjs"),e=require("vue"),$=require("./_plugin-vue_export-helper-f246444f.cjs"),T=require("./index-cebc7160.cjs"),K=require("./validator-3cad04b2.cjs"),E=require("./use-form-common-props-344056f9.cjs"),H=require("./index-8de94a49.cjs"),j=require("./index-f1c702f6.cjs"),G=require("./index-bb833443.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./index-9780a537.cjs");require("./use-global-config-cf78ebac.cjs");require("./index-4f48940d.cjs");require("./index-eea0bcb3.cjs");require("./index-696b6a94.cjs");require("./castArray-35947698.cjs");require("./index-c04f444f.cjs");require("./debounce-62f5b6e8.cjs");const J=u.buildProps({...A.dialogProps,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},resizable:Boolean,size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),W=A.dialogEmits;function X(r,w){const{width:v,height:c}=E.useWindowSize(),V=e.computed(()=>["ltr","rtl"].includes(r.direction)),b=e.computed(()=>["ltr","ttb"].includes(r.direction)?1:-1),s=e.computed(()=>V.value?v.value:c.value),l=e.computed(()=>u.clamp(p.value+b.value*y.value,4,s.value)),p=e.ref(0),y=e.ref(0),g=e.ref(!1),S=e.ref(!1);let C=[],I=[];const d=()=>{var f;const N=(f=w.value)==null?void 0:f.closest('[aria-modal="true"]');return N?V.value?N.offsetWidth:N.offsetHeight:100};e.watch(()=>[r.size,r.resizable],()=>{S.value=!1,p.value=0,y.value=0,i()});const a=f=>{r.resizable&&(S.value||(p.value=d(),S.value=!0),C=[f.pageX,f.pageY],g.value=!0,I.push(E.useEventListener(window,"mouseup",i),E.useEventListener(window,"mousemove",B)))},B=f=>{const{pageX:N,pageY:t}=f,m=N-C[0],z=t-C[1];y.value=V.value?m:z},i=()=>{C=[],p.value=l.value,y.value=0,g.value=!1,I.forEach(f=>f==null?void 0:f()),I=[]},k=E.useEventListener(w,"mousedown",a);return e.onBeforeUnmount(()=>{k(),i()}),{size:e.computed(()=>S.value?`${l.value}px`:u.addUnit(r.size)),isResizing:g,isHorizontal:V}}const Y=e.defineComponent({name:"ElDrawer",inheritAttrs:!1}),Q=e.defineComponent({...Y,props:J,emits:W,setup(r,{expose:w}){const v=r,c=e.useSlots();j.useDeprecated({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},e.computed(()=>!!c.title));const V=e.ref(),b=e.ref(),s=e.ref(),l=u.useNamespace("drawer"),{t:p}=G.useLocale(),{afterEnter:y,afterLeave:g,beforeLeave:S,visible:C,rendered:I,titleId:d,bodyId:a,zIndex:B,onModalClick:i,onOpenAutoFocus:k,onCloseAutoFocus:f,onFocusoutPrevented:N,onCloseRequested:t,handleClose:m}=A.useDialog(v,V),{isHorizontal:z,size:P,isResizing:o}=X(v,s);return w({handleClose:m,afterEnter:y,afterLeave:g}),(n,L)=>(e.openBlock(),e.createBlock(e.unref(h.ElTeleport),{to:n.appendTo,disabled:n.appendTo!=="body"?!1:!n.appendToBody},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:e.unref(l).b("fade"),onAfterEnter:e.unref(y),onAfterLeave:e.unref(g),onBeforeLeave:e.unref(S),persisted:""},{default:e.withCtx(()=>{var q;return[e.withDirectives(e.createVNode(e.unref(A.ElOverlay),{mask:n.modal,"overlay-class":[e.unref(l).is("drawer"),(q=n.modalClass)!=null?q:""],"z-index":e.unref(B),onClick:e.unref(i)},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElFocusTrap),{loop:"",trapped:e.unref(C),"focus-trap-el":V.value,"focus-start-el":b.value,onFocusAfterTrapped:e.unref(k),onFocusAfterReleased:e.unref(f),onFocusoutPrevented:e.unref(N),onReleaseRequested:e.unref(t)},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"drawerRef",ref:V,"aria-modal":"true","aria-label":n.title||void 0,"aria-labelledby":n.title?void 0:e.unref(d),"aria-describedby":e.unref(a)},n.$attrs,{class:[e.unref(l).b(),n.direction,e.unref(C)&&"open",e.unref(l).is("dragging",e.unref(o))],style:{[e.unref(z)?"width":"height"]:e.unref(P)},role:"dialog",onClick:e.withModifiers(()=>{},["stop"])}),[e.createElementVNode("span",{ref_key:"focusStartRef",ref:b,class:e.normalizeClass(e.unref(l).e("sr-focus")),tabindex:"-1"},null,2),n.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([e.unref(l).e("header"),n.headerClass])},[n.$slots.title?e.renderSlot(n.$slots,"title",{key:1},()=>[e.createCommentVNode(" DEPRECATED SLOT ")]):e.renderSlot(n.$slots,"header",{key:0,close:e.unref(m),titleId:e.unref(d),titleClass:e.unref(l).e("title")},()=>[e.createElementVNode("span",{id:e.unref(d),role:"heading","aria-level":n.headerAriaLevel,class:e.normalizeClass(e.unref(l).e("title"))},e.toDisplayString(n.title),11,["id","aria-level"])]),n.showClose?(e.openBlock(),e.createElementBlock("button",{key:2,"aria-label":e.unref(p)("el.drawer.close"),class:e.normalizeClass(e.unref(l).e("close-btn")),type:"button",onClick:e.unref(m)},[e.createVNode(e.unref(T.ElIcon),{class:e.normalizeClass(e.unref(l).e("close"))},{default:e.withCtx(()=>[e.createVNode(e.unref(T.close_default))]),_:1},8,["class"])],10,["aria-label","onClick"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.unref(I)?(e.openBlock(),e.createElementBlock("div",{key:1,id:e.unref(a),class:e.normalizeClass([e.unref(l).e("body"),n.bodyClass])},[e.renderSlot(n.$slots,"default")],10,["id"])):e.createCommentVNode("v-if",!0),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(l).e("footer"),n.footerClass])},[e.renderSlot(n.$slots,"footer")],2)):e.createCommentVNode("v-if",!0),n.resizable?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"draggerRef",ref:s,style:e.normalizeStyle({zIndex:e.unref(B)}),class:e.normalizeClass(e.unref(l).e("dragger"))},null,6)):e.createCommentVNode("v-if",!0)],16,["aria-label","aria-labelledby","aria-describedby","onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[e.vShow,e.unref(C)]])]}),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var Z=u._export_sfc(Q,[["__file","drawer.vue"]]);const ee=u.withInstall(Z),te=u.buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:K.isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:E.iconPropType},activeActionIcon:{type:E.iconPropType},activeIcon:{type:E.iconPropType},inactiveIcon:{type:E.iconPropType},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:u.definePropType(Function)},id:String,tabindex:{type:[String,Number]},...h.useAriaProps(["ariaLabel"])}),le={[h.UPDATE_MODEL_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r),[h.CHANGE_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r),[h.INPUT_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r)},O="ElSwitch",oe=e.defineComponent({name:O}),ae=e.defineComponent({...oe,props:te,emits:le,setup(r,{expose:w,emit:v}){const c=r,{formItem:V}=E.useFormItem(),b=E.useFormSize(),s=u.useNamespace("switch"),{inputId:l}=E.useFormItemInputId(c,{formItemContext:V}),p=E.useFormDisabled(e.computed(()=>c.loading)),y=e.ref(c.modelValue!==!1),g=e.ref(),S=e.ref(),C=e.computed(()=>[s.b(),s.m(b.value),s.is("disabled",p.value),s.is("checked",i.value)]),I=e.computed(()=>[s.e("label"),s.em("label","left"),s.is("active",!i.value)]),d=e.computed(()=>[s.e("label"),s.em("label","right"),s.is("active",i.value)]),a=e.computed(()=>({width:u.addUnit(c.width)}));e.watch(()=>c.modelValue,()=>{y.value=!0});const B=e.computed(()=>y.value?c.modelValue:!1),i=e.computed(()=>B.value===c.activeValue);[c.activeValue,c.inactiveValue].includes(B.value)||(v(h.UPDATE_MODEL_EVENT,c.inactiveValue),v(h.CHANGE_EVENT,c.inactiveValue),v(h.INPUT_EVENT,c.inactiveValue)),e.watch(i,t=>{var m;g.value.checked=t,c.validateEvent&&((m=V==null?void 0:V.validate)==null||m.call(V,"change").catch(z=>h.debugWarn()))});const k=()=>{const t=i.value?c.inactiveValue:c.activeValue;v(h.UPDATE_MODEL_EVENT,t),v(h.CHANGE_EVENT,t),v(h.INPUT_EVENT,t),e.nextTick(()=>{g.value.checked=i.value})},f=()=>{if(p.value)return;const{beforeChange:t}=c;if(!t){k();return}const m=t();[u.isPromise(m),u.isBoolean(m)].includes(!0)||h.throwError(O,"beforeChange must return type `Promise<boolean>` or `boolean`"),u.isPromise(m)?m.then(P=>{P&&k()}).catch(P=>{}):m&&k()},N=()=>{var t,m;(m=(t=g.value)==null?void 0:t.focus)==null||m.call(t)};return e.onMounted(()=>{g.value.checked=i.value}),w({focus:N,checked:i}),(t,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(C)),onClick:e.withModifiers(f,["prevent"])},[e.createElementVNode("input",{id:e.unref(l),ref_key:"input",ref:g,class:e.normalizeClass(e.unref(s).e("input")),type:"checkbox",role:"switch","aria-checked":e.unref(i),"aria-disabled":e.unref(p),"aria-label":t.ariaLabel,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:e.unref(p),tabindex:t.tabindex,onChange:k,onKeydown:e.withKeys(f,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!t.inlinePrompt&&(t.inactiveIcon||t.inactiveText)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(I))},[t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inactiveIcon)))]),_:1})):e.createCommentVNode("v-if",!0),!t.inactiveIcon&&t.inactiveText?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-hidden":e.unref(i)},e.toDisplayString(t.inactiveText),9,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{ref_key:"core",ref:S,class:e.normalizeClass(e.unref(s).e("core")),style:e.normalizeStyle(e.unref(a))},[t.inlinePrompt?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(s).e("inner"))},[t.activeIcon||t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0,class:e.normalizeClass(e.unref(s).is("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i)?t.activeIcon:t.inactiveIcon)))]),_:1},8,["class"])):t.activeText||t.inactiveText?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s).is("text")),"aria-hidden":!e.unref(i)},e.toDisplayString(e.unref(i)?t.activeText:t.inactiveText),11,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("action"))},[t.loading?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0,class:e.normalizeClass(e.unref(s).is("loading"))},{default:e.withCtx(()=>[e.createVNode(e.unref(T.loading_default))]),_:1},8,["class"])):e.unref(i)?e.renderSlot(t.$slots,"active-action",{key:1},()=>[t.activeActionIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)]):e.unref(i)?e.createCommentVNode("v-if",!0):e.renderSlot(t.$slots,"inactive-action",{key:2},()=>[t.inactiveActionIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inactiveActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)])],2)],6),!t.inlinePrompt&&(t.activeIcon||t.activeText)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(d))},[t.activeIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeIcon)))]),_:1})):e.createCommentVNode("v-if",!0),!t.activeIcon&&t.activeText?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-hidden":!e.unref(i)},e.toDisplayString(t.activeText),9,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0)],10,["onClick"]))}});var ne=u._export_sfc(ae,[["__file","switch.vue"]]);const re=u.withInstall(ne);const se=[{label:"买卖",value:0},{label:"开平",value:1}],D=()=>({mainIndicator:"MA",sellBuy:1,sellBuyByPrice:1,singelCycle:"6",multiCycleNum:6,multiCycleList:["1","2","3","4","5","6"],pageType:1,enable_tradeLogBrush:!0,enable_showScreenTimeRange:!0,enable_showScreenMaxPrice:!0,enable_dbClickOpenSingel:!0,enable_subChart:!0,enable_sliderChart:!0}),ie=(r,w)=>{var v;return((v=w.find(c=>c.value===r))==null?void 0:v.label)??"-"};const _=r=>(e.pushScopeId("data-v-6e5050a9"),r=r(),e.popScopeId(),r),ce={class:"kline-config element-dark"},ue={class:"setting-item"},de=_(()=>e.createElementVNode("span",{class:"label"},"主图指标: ",-1)),me={class:"setting-item"},pe=_(()=>e.createElementVNode("span",{class:"label"},"交易点位: ",-1)),fe={class:"setting-item"},ve=_(()=>e.createElementVNode("span",{class:"label"},"开平点按价格标: ",-1)),Ve={class:"setting-item"},be=_(()=>e.createElementVNode("span",{class:"label"},"单周期: ",-1)),ye={class:"setting-item"},ge=_(()=>e.createElementVNode("span",{class:"label"},"多周期: ",-1)),he={class:"mode"},ke={class:"cycleName"},Ce={class:"content"},Ne={class:"setting-item"},Ee=_(()=>e.createElementVNode("span",{class:"label"},"默认展示: ",-1)),_e={class:"setting-item"},Be=_(()=>e.createElementVNode("span",{class:"label"},"高亮交易范围: ",-1)),we={class:"setting-item"},Se=_(()=>e.createElementVNode("span",{class:"label"},"展示当屏时间: ",-1)),Ie={class:"setting-item"},Te=_(()=>e.createElementVNode("span",{class:"label"},"展示当屏最高价: ",-1)),ze={class:"setting-item"},Pe=_(()=>e.createElementVNode("span",{class:"label"},"多周期双击图表切换至单周期: ",-1)),Le={class:"setting-item"},qe=_(()=>e.createElementVNode("span",{class:"label"},"开启副图: ",-1)),De={class:"setting-item"},Ae=_(()=>e.createElementVNode("span",{class:"label"},"开启拖拽轴: ",-1)),Ue={class:"setting-footer"},Oe={__name:"index",props:{indicatorStore:{type:Object,default:()=>({})},origin:{type:String,default:"server"},cycleOptions:{type:Array,default:()=>[]}},emits:"callBack",setup(r,{expose:w,emit:v}){const{request:c}=e.inject("stConfig"),V=v,b=r,s=e.ref(!1),l=e.reactive({}),p=e.ref([]),y=e.ref([]),g=()=>{Object.assign(l,D())},S=async()=>{const d=JSON.stringify(l);b.origin==="server"?await c.post("/common/qt/updateUserConfig",{appId:1,json:d}):localStorage.setItem("userKlineConfig",d),V("callBack",d),s.value=!1},C=async()=>{if(b.origin==="server"){const{body:d}=await c.post("/common/qt/getUserConfig",{appId:1});Object.assign(l,D(),d?JSON.parse(d):{})}else{const d=localStorage.getItem("userKlineConfig");Object.assign(l,D(),d?JSON.parse(d):{})}},I=async()=>{if(b.origin==="server"){const{body:d}=await c.post("/common/qt/getDict",{dictIds:[1002]});p.value=d[1002].map(a=>({label:a.dictName,value:a.dictCode}))}else p.value=b.cycleOptions};return e.onMounted(()=>{I(),y.value=b.indicatorStore.mainIndicatorList??[]}),e.watch(()=>b.indicatorStore.mainIndicatorList,()=>{y.value=b.indicatorStore.mainIndicatorList??[]}),w({open:async()=>{await C(),s.value=!0},getDefaultUserKlineConfig:D}),(d,a)=>{const B=M.ElDivider,i=U.ElOption,k=U.ElSelect,f=x.ElCheckbox,N=R.ElSegmented,t=re,m=H.ElScrollbar,z=F.ElButton,P=ee;return e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(P,{modelValue:s.value,"onUpdate:modelValue":a[12]||(a[12]=o=>s.value=o),title:"K线自定义配置",size:320},{default:e.withCtx(()=>[e.createVNode(m,{class:"setting-main"},{default:e.withCtx(()=>[e.createVNode(B,{style:{"margin-top":"8px"}},{default:e.withCtx(()=>[e.createTextVNode("偏好设置")]),_:1}),e.createElementVNode("div",ue,[de,e.createVNode(k,{modelValue:l.mainIndicator,"onUpdate:modelValue":a[0]||(a[0]=o=>l.mainIndicator=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",me,[pe,e.createVNode(k,{modelValue:l.sellBuy,"onUpdate:modelValue":a[1]||(a[1]=o=>l.sellBuy=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(se),(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",fe,[ve,e.createVNode(f,{modelValue:l.sellBuyByPrice,"onUpdate:modelValue":a[2]||(a[2]=o=>l.sellBuyByPrice=o),"true-value":1,"false-value":0},null,8,["modelValue"])]),e.createElementVNode("div",Ve,[be,e.createVNode(k,{modelValue:l.singelCycle,"onUpdate:modelValue":a[3]||(a[3]=o=>l.singelCycle=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",ye,[ge,e.createVNode(N,{size:"small",modelValue:l.multiCycleNum,"onUpdate:modelValue":a[4]||(a[4]=o=>l.multiCycleNum=o),options:[{label:"二图",value:2},{label:"四图",value:4},{label:"六图",value:6}],style:{height:"26px"}},null,8,["modelValue"])]),e.createElementVNode("div",{class:e.normalizeClass(`setting-multi-box grid-${l.multiCycleNum}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.multiCycleList.slice(0,l.multiCycleNum),(o,n)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[e.createElementVNode("span",null,e.toDisplayString(e.unref(ie)(l.multiCycleList[n],p.value)),1),e.createVNode(k,{modelValue:l.multiCycleList[n],"onUpdate:modelValue":L=>l.multiCycleList[n]=L,"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(L,q)=>(e.openBlock(),e.createBlock(i,{key:q,label:L.label,value:L.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("span",Ce,e.toDisplayString(n+1)+"号位K线",1)]))),256))],2),e.createElementVNode("div",Ne,[Ee,e.createVNode(N,{size:"small",modelValue:l.pageType,"onUpdate:modelValue":a[5]||(a[5]=o=>l.pageType=o),options:[{label:"单周期",value:1},{label:"多周期",value:2}],style:{height:"26px"}},null,8,["modelValue"])]),e.createVNode(B,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[e.createTextVNode("功能配置")]),_:1}),e.createElementVNode("div",_e,[Be,e.createVNode(t,{modelValue:l.enable_tradeLogBrush,"onUpdate:modelValue":a[6]||(a[6]=o=>l.enable_tradeLogBrush=o)},null,8,["modelValue"])]),e.createElementVNode("div",we,[Se,e.createVNode(t,{modelValue:l.enable_showScreenTimeRange,"onUpdate:modelValue":a[7]||(a[7]=o=>l.enable_showScreenTimeRange=o)},null,8,["modelValue"])]),e.createElementVNode("div",Ie,[Te,e.createVNode(t,{modelValue:l.enable_showScreenMaxPrice,"onUpdate:modelValue":a[8]||(a[8]=o=>l.enable_showScreenMaxPrice=o)},null,8,["modelValue"])]),e.createElementVNode("div",ze,[Pe,e.createVNode(t,{modelValue:l.enable_dbClickOpenSingel,"onUpdate:modelValue":a[9]||(a[9]=o=>l.enable_dbClickOpenSingel=o)},null,8,["modelValue"])]),e.createVNode(B,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[e.createTextVNode("组件开关")]),_:1}),e.createElementVNode("div",Le,[qe,e.createVNode(t,{modelValue:l.enable_subChart,"onUpdate:modelValue":a[10]||(a[10]=o=>l.enable_subChart=o)},null,8,["modelValue"])]),e.createElementVNode("div",De,[Ae,e.createVNode(t,{modelValue:l.enable_sliderChart,"onUpdate:modelValue":a[11]||(a[11]=o=>l.enable_sliderChart=o)},null,8,["modelValue"])])]),_:1}),e.createElementVNode("div",Ue,[e.createVNode(z,{onClick:g},{default:e.withCtx(()=>[e.createTextVNode(" 恢复默认 ")]),_:1}),e.createVNode(z,{type:"primary",onClick:S},{default:e.withCtx(()=>[e.createTextVNode(" 保存配置 ")]),_:1})])]),_:1},8,["modelValue"])])}}},Fe=$._export_sfc(Oe,[["__scopeId","data-v-6e5050a9"]]),Re={install(r){r.component("st-klineConfig",Fe)}};module.exports=Re;
|
|
1
|
+
"use strict";const u=require("./base-ef747d02.cjs"),A=require("./el-overlay-9e34965f.cjs"),F=require("./el-button-eec58cff.cjs");require("./el-scrollbar-bc3f790d.cjs");const R=require("./el-segmented-f8fce9ac.cjs"),x=require("./el-checkbox-c25236a6.cjs");require("./el-tag-a33c4b22.cjs");const U=require("./el-select-d8d91db1.cjs"),h=require("./el-popper-b6c99b28.cjs"),M=require("./el-divider-4713d74c.cjs"),e=require("vue"),$=require("./_plugin-vue_export-helper-f246444f.cjs"),T=require("./index-098c2447.cjs"),K=require("./validator-1b8a6128.cjs"),E=require("./use-form-common-props-fd9b61a0.cjs"),H=require("./index-298075cf.cjs"),j=require("./index-f1c702f6.cjs"),G=require("./index-bb833443.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./index-9780a537.cjs");require("./use-global-config-30d7d8ce.cjs");require("./index-c108567d.cjs");require("./index-eea0bcb3.cjs");require("./index-f3562b52.cjs");require("./castArray-35947698.cjs");require("./index-11547a0c.cjs");require("./debounce-62f5b6e8.cjs");const J=u.buildProps({...A.dialogProps,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},resizable:Boolean,size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),W=A.dialogEmits;function X(r,w){const{width:v,height:c}=E.useWindowSize(),V=e.computed(()=>["ltr","rtl"].includes(r.direction)),b=e.computed(()=>["ltr","ttb"].includes(r.direction)?1:-1),s=e.computed(()=>V.value?v.value:c.value),l=e.computed(()=>u.clamp(p.value+b.value*y.value,4,s.value)),p=e.ref(0),y=e.ref(0),g=e.ref(!1),S=e.ref(!1);let C=[],I=[];const d=()=>{var f;const N=(f=w.value)==null?void 0:f.closest('[aria-modal="true"]');return N?V.value?N.offsetWidth:N.offsetHeight:100};e.watch(()=>[r.size,r.resizable],()=>{S.value=!1,p.value=0,y.value=0,i()});const a=f=>{r.resizable&&(S.value||(p.value=d(),S.value=!0),C=[f.pageX,f.pageY],g.value=!0,I.push(E.useEventListener(window,"mouseup",i),E.useEventListener(window,"mousemove",B)))},B=f=>{const{pageX:N,pageY:t}=f,m=N-C[0],z=t-C[1];y.value=V.value?m:z},i=()=>{C=[],p.value=l.value,y.value=0,g.value=!1,I.forEach(f=>f==null?void 0:f()),I=[]},k=E.useEventListener(w,"mousedown",a);return e.onBeforeUnmount(()=>{k(),i()}),{size:e.computed(()=>S.value?`${l.value}px`:u.addUnit(r.size)),isResizing:g,isHorizontal:V}}const Y=e.defineComponent({name:"ElDrawer",inheritAttrs:!1}),Q=e.defineComponent({...Y,props:J,emits:W,setup(r,{expose:w}){const v=r,c=e.useSlots();j.useDeprecated({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},e.computed(()=>!!c.title));const V=e.ref(),b=e.ref(),s=e.ref(),l=u.useNamespace("drawer"),{t:p}=G.useLocale(),{afterEnter:y,afterLeave:g,beforeLeave:S,visible:C,rendered:I,titleId:d,bodyId:a,zIndex:B,onModalClick:i,onOpenAutoFocus:k,onCloseAutoFocus:f,onFocusoutPrevented:N,onCloseRequested:t,handleClose:m}=A.useDialog(v,V),{isHorizontal:z,size:P,isResizing:o}=X(v,s);return w({handleClose:m,afterEnter:y,afterLeave:g}),(n,L)=>(e.openBlock(),e.createBlock(e.unref(h.ElTeleport),{to:n.appendTo,disabled:n.appendTo!=="body"?!1:!n.appendToBody},{default:e.withCtx(()=>[e.createVNode(e.Transition,{name:e.unref(l).b("fade"),onAfterEnter:e.unref(y),onAfterLeave:e.unref(g),onBeforeLeave:e.unref(S),persisted:""},{default:e.withCtx(()=>{var q;return[e.withDirectives(e.createVNode(e.unref(A.ElOverlay),{mask:n.modal,"overlay-class":[e.unref(l).is("drawer"),(q=n.modalClass)!=null?q:""],"z-index":e.unref(B),onClick:e.unref(i)},{default:e.withCtx(()=>[e.createVNode(e.unref(h.ElFocusTrap),{loop:"",trapped:e.unref(C),"focus-trap-el":V.value,"focus-start-el":b.value,onFocusAfterTrapped:e.unref(k),onFocusAfterReleased:e.unref(f),onFocusoutPrevented:e.unref(N),onReleaseRequested:e.unref(t)},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"drawerRef",ref:V,"aria-modal":"true","aria-label":n.title||void 0,"aria-labelledby":n.title?void 0:e.unref(d),"aria-describedby":e.unref(a)},n.$attrs,{class:[e.unref(l).b(),n.direction,e.unref(C)&&"open",e.unref(l).is("dragging",e.unref(o))],style:{[e.unref(z)?"width":"height"]:e.unref(P)},role:"dialog",onClick:e.withModifiers(()=>{},["stop"])}),[e.createElementVNode("span",{ref_key:"focusStartRef",ref:b,class:e.normalizeClass(e.unref(l).e("sr-focus")),tabindex:"-1"},null,2),n.withHeader?(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass([e.unref(l).e("header"),n.headerClass])},[n.$slots.title?e.renderSlot(n.$slots,"title",{key:1},()=>[e.createCommentVNode(" DEPRECATED SLOT ")]):e.renderSlot(n.$slots,"header",{key:0,close:e.unref(m),titleId:e.unref(d),titleClass:e.unref(l).e("title")},()=>[e.createElementVNode("span",{id:e.unref(d),role:"heading","aria-level":n.headerAriaLevel,class:e.normalizeClass(e.unref(l).e("title"))},e.toDisplayString(n.title),11,["id","aria-level"])]),n.showClose?(e.openBlock(),e.createElementBlock("button",{key:2,"aria-label":e.unref(p)("el.drawer.close"),class:e.normalizeClass(e.unref(l).e("close-btn")),type:"button",onClick:e.unref(m)},[e.createVNode(e.unref(T.ElIcon),{class:e.normalizeClass(e.unref(l).e("close"))},{default:e.withCtx(()=>[e.createVNode(e.unref(T.close_default))]),_:1},8,["class"])],10,["aria-label","onClick"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.unref(I)?(e.openBlock(),e.createElementBlock("div",{key:1,id:e.unref(a),class:e.normalizeClass([e.unref(l).e("body"),n.bodyClass])},[e.renderSlot(n.$slots,"default")],10,["id"])):e.createCommentVNode("v-if",!0),n.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass([e.unref(l).e("footer"),n.footerClass])},[e.renderSlot(n.$slots,"footer")],2)):e.createCommentVNode("v-if",!0),n.resizable?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"draggerRef",ref:s,style:e.normalizeStyle({zIndex:e.unref(B)}),class:e.normalizeClass(e.unref(l).e("dragger"))},null,6)):e.createCommentVNode("v-if",!0)],16,["aria-label","aria-labelledby","aria-describedby","onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[e.vShow,e.unref(C)]])]}),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var Z=u._export_sfc(Q,[["__file","drawer.vue"]]);const ee=u.withInstall(Z),te=u.buildProps({modelValue:{type:[Boolean,String,Number],default:!1},disabled:Boolean,loading:Boolean,size:{type:String,validator:K.isValidComponentSize},width:{type:[String,Number],default:""},inlinePrompt:Boolean,inactiveActionIcon:{type:E.iconPropType},activeActionIcon:{type:E.iconPropType},activeIcon:{type:E.iconPropType},inactiveIcon:{type:E.iconPropType},activeText:{type:String,default:""},inactiveText:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},beforeChange:{type:u.definePropType(Function)},id:String,tabindex:{type:[String,Number]},...h.useAriaProps(["ariaLabel"])}),le={[h.UPDATE_MODEL_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r),[h.CHANGE_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r),[h.INPUT_EVENT]:r=>u.isBoolean(r)||u.isString(r)||u.isNumber(r)},O="ElSwitch",oe=e.defineComponent({name:O}),ae=e.defineComponent({...oe,props:te,emits:le,setup(r,{expose:w,emit:v}){const c=r,{formItem:V}=E.useFormItem(),b=E.useFormSize(),s=u.useNamespace("switch"),{inputId:l}=E.useFormItemInputId(c,{formItemContext:V}),p=E.useFormDisabled(e.computed(()=>c.loading)),y=e.ref(c.modelValue!==!1),g=e.ref(),S=e.ref(),C=e.computed(()=>[s.b(),s.m(b.value),s.is("disabled",p.value),s.is("checked",i.value)]),I=e.computed(()=>[s.e("label"),s.em("label","left"),s.is("active",!i.value)]),d=e.computed(()=>[s.e("label"),s.em("label","right"),s.is("active",i.value)]),a=e.computed(()=>({width:u.addUnit(c.width)}));e.watch(()=>c.modelValue,()=>{y.value=!0});const B=e.computed(()=>y.value?c.modelValue:!1),i=e.computed(()=>B.value===c.activeValue);[c.activeValue,c.inactiveValue].includes(B.value)||(v(h.UPDATE_MODEL_EVENT,c.inactiveValue),v(h.CHANGE_EVENT,c.inactiveValue),v(h.INPUT_EVENT,c.inactiveValue)),e.watch(i,t=>{var m;g.value.checked=t,c.validateEvent&&((m=V==null?void 0:V.validate)==null||m.call(V,"change").catch(z=>h.debugWarn()))});const k=()=>{const t=i.value?c.inactiveValue:c.activeValue;v(h.UPDATE_MODEL_EVENT,t),v(h.CHANGE_EVENT,t),v(h.INPUT_EVENT,t),e.nextTick(()=>{g.value.checked=i.value})},f=()=>{if(p.value)return;const{beforeChange:t}=c;if(!t){k();return}const m=t();[u.isPromise(m),u.isBoolean(m)].includes(!0)||h.throwError(O,"beforeChange must return type `Promise<boolean>` or `boolean`"),u.isPromise(m)?m.then(P=>{P&&k()}).catch(P=>{}):m&&k()},N=()=>{var t,m;(m=(t=g.value)==null?void 0:t.focus)==null||m.call(t)};return e.onMounted(()=>{g.value.checked=i.value}),w({focus:N,checked:i}),(t,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(C)),onClick:e.withModifiers(f,["prevent"])},[e.createElementVNode("input",{id:e.unref(l),ref_key:"input",ref:g,class:e.normalizeClass(e.unref(s).e("input")),type:"checkbox",role:"switch","aria-checked":e.unref(i),"aria-disabled":e.unref(p),"aria-label":t.ariaLabel,name:t.name,"true-value":t.activeValue,"false-value":t.inactiveValue,disabled:e.unref(p),tabindex:t.tabindex,onChange:k,onKeydown:e.withKeys(f,["enter"])},null,42,["id","aria-checked","aria-disabled","aria-label","name","true-value","false-value","disabled","tabindex","onKeydown"]),!t.inlinePrompt&&(t.inactiveIcon||t.inactiveText)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(I))},[t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inactiveIcon)))]),_:1})):e.createCommentVNode("v-if",!0),!t.inactiveIcon&&t.inactiveText?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-hidden":e.unref(i)},e.toDisplayString(t.inactiveText),9,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("span",{ref_key:"core",ref:S,class:e.normalizeClass(e.unref(s).e("core")),style:e.normalizeStyle(e.unref(a))},[t.inlinePrompt?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(s).e("inner"))},[t.activeIcon||t.inactiveIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0,class:e.normalizeClass(e.unref(s).is("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i)?t.activeIcon:t.inactiveIcon)))]),_:1},8,["class"])):t.activeText||t.inactiveText?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(s).is("text")),"aria-hidden":!e.unref(i)},e.toDisplayString(e.unref(i)?t.activeText:t.inactiveText),11,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(s).e("action"))},[t.loading?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0,class:e.normalizeClass(e.unref(s).is("loading"))},{default:e.withCtx(()=>[e.createVNode(e.unref(T.loading_default))]),_:1},8,["class"])):e.unref(i)?e.renderSlot(t.$slots,"active-action",{key:1},()=>[t.activeActionIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)]):e.unref(i)?e.createCommentVNode("v-if",!0):e.renderSlot(t.$slots,"inactive-action",{key:2},()=>[t.inactiveActionIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.inactiveActionIcon)))]),_:1})):e.createCommentVNode("v-if",!0)])],2)],6),!t.inlinePrompt&&(t.activeIcon||t.activeText)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(d))},[t.activeIcon?(e.openBlock(),e.createBlock(e.unref(T.ElIcon),{key:0},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.activeIcon)))]),_:1})):e.createCommentVNode("v-if",!0),!t.activeIcon&&t.activeText?(e.openBlock(),e.createElementBlock("span",{key:1,"aria-hidden":!e.unref(i)},e.toDisplayString(t.activeText),9,["aria-hidden"])):e.createCommentVNode("v-if",!0)],2)):e.createCommentVNode("v-if",!0)],10,["onClick"]))}});var ne=u._export_sfc(ae,[["__file","switch.vue"]]);const re=u.withInstall(ne);const se=[{label:"买卖",value:0},{label:"开平",value:1}],D=()=>({mainIndicator:"MA",sellBuy:1,sellBuyByPrice:1,singelCycle:"6",multiCycleNum:6,multiCycleList:["1","2","3","4","5","6"],pageType:1,enable_tradeLogBrush:!0,enable_showScreenTimeRange:!0,enable_showScreenMaxPrice:!0,enable_dbClickOpenSingel:!0,enable_subChart:!0,enable_sliderChart:!0}),ie=(r,w)=>{var v;return((v=w.find(c=>c.value===r))==null?void 0:v.label)??"-"};const _=r=>(e.pushScopeId("data-v-6e5050a9"),r=r(),e.popScopeId(),r),ce={class:"kline-config element-dark"},ue={class:"setting-item"},de=_(()=>e.createElementVNode("span",{class:"label"},"主图指标: ",-1)),me={class:"setting-item"},pe=_(()=>e.createElementVNode("span",{class:"label"},"交易点位: ",-1)),fe={class:"setting-item"},ve=_(()=>e.createElementVNode("span",{class:"label"},"开平点按价格标: ",-1)),Ve={class:"setting-item"},be=_(()=>e.createElementVNode("span",{class:"label"},"单周期: ",-1)),ye={class:"setting-item"},ge=_(()=>e.createElementVNode("span",{class:"label"},"多周期: ",-1)),he={class:"mode"},ke={class:"cycleName"},Ce={class:"content"},Ne={class:"setting-item"},Ee=_(()=>e.createElementVNode("span",{class:"label"},"默认展示: ",-1)),_e={class:"setting-item"},Be=_(()=>e.createElementVNode("span",{class:"label"},"高亮交易范围: ",-1)),we={class:"setting-item"},Se=_(()=>e.createElementVNode("span",{class:"label"},"展示当屏时间: ",-1)),Ie={class:"setting-item"},Te=_(()=>e.createElementVNode("span",{class:"label"},"展示当屏最高价: ",-1)),ze={class:"setting-item"},Pe=_(()=>e.createElementVNode("span",{class:"label"},"多周期双击图表切换至单周期: ",-1)),Le={class:"setting-item"},qe=_(()=>e.createElementVNode("span",{class:"label"},"开启副图: ",-1)),De={class:"setting-item"},Ae=_(()=>e.createElementVNode("span",{class:"label"},"开启拖拽轴: ",-1)),Ue={class:"setting-footer"},Oe={__name:"index",props:{indicatorStore:{type:Object,default:()=>({})},origin:{type:String,default:"server"},cycleOptions:{type:Array,default:()=>[]}},emits:"callBack",setup(r,{expose:w,emit:v}){const{request:c}=e.inject("stConfig"),V=v,b=r,s=e.ref(!1),l=e.reactive({}),p=e.ref([]),y=e.ref([]),g=()=>{Object.assign(l,D())},S=async()=>{const d=JSON.stringify(l);b.origin==="server"?await c.post("/common/qt/updateUserConfig",{appId:1,json:d}):localStorage.setItem("userKlineConfig",d),V("callBack",d),s.value=!1},C=async()=>{if(b.origin==="server"){const{body:d}=await c.post("/common/qt/getUserConfig",{appId:1});Object.assign(l,D(),d?JSON.parse(d):{})}else{const d=localStorage.getItem("userKlineConfig");Object.assign(l,D(),d?JSON.parse(d):{})}},I=async()=>{if(b.origin==="server"){const{body:d}=await c.post("/common/qt/getDict",{dictIds:[1002]});p.value=d[1002].map(a=>({label:a.dictName,value:a.dictCode}))}else p.value=b.cycleOptions};return e.onMounted(()=>{I(),y.value=b.indicatorStore.mainIndicatorList??[]}),e.watch(()=>b.indicatorStore.mainIndicatorList,()=>{y.value=b.indicatorStore.mainIndicatorList??[]}),w({open:async()=>{await C(),s.value=!0},getDefaultUserKlineConfig:D}),(d,a)=>{const B=M.ElDivider,i=U.ElOption,k=U.ElSelect,f=x.ElCheckbox,N=R.ElSegmented,t=re,m=H.ElScrollbar,z=F.ElButton,P=ee;return e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(P,{modelValue:s.value,"onUpdate:modelValue":a[12]||(a[12]=o=>s.value=o),title:"K线自定义配置",size:320},{default:e.withCtx(()=>[e.createVNode(m,{class:"setting-main"},{default:e.withCtx(()=>[e.createVNode(B,{style:{"margin-top":"8px"}},{default:e.withCtx(()=>[e.createTextVNode("偏好设置")]),_:1}),e.createElementVNode("div",ue,[de,e.createVNode(k,{modelValue:l.mainIndicator,"onUpdate:modelValue":a[0]||(a[0]=o=>l.mainIndicator=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",me,[pe,e.createVNode(k,{modelValue:l.sellBuy,"onUpdate:modelValue":a[1]||(a[1]=o=>l.sellBuy=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(se),(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",fe,[ve,e.createVNode(f,{modelValue:l.sellBuyByPrice,"onUpdate:modelValue":a[2]||(a[2]=o=>l.sellBuyByPrice=o),"true-value":1,"false-value":0},null,8,["modelValue"])]),e.createElementVNode("div",Ve,[be,e.createVNode(k,{modelValue:l.singelCycle,"onUpdate:modelValue":a[3]||(a[3]=o=>l.singelCycle=o),"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(o,n)=>(e.openBlock(),e.createBlock(i,{key:n,label:o.label,value:o.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),e.createElementVNode("div",ye,[ge,e.createVNode(N,{size:"small",modelValue:l.multiCycleNum,"onUpdate:modelValue":a[4]||(a[4]=o=>l.multiCycleNum=o),options:[{label:"二图",value:2},{label:"四图",value:4},{label:"六图",value:6}],style:{height:"26px"}},null,8,["modelValue"])]),e.createElementVNode("div",{class:e.normalizeClass(`setting-multi-box grid-${l.multiCycleNum}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.multiCycleList.slice(0,l.multiCycleNum),(o,n)=>(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[e.createElementVNode("span",null,e.toDisplayString(e.unref(ie)(l.multiCycleList[n],p.value)),1),e.createVNode(k,{modelValue:l.multiCycleList[n],"onUpdate:modelValue":L=>l.multiCycleList[n]=L,"popper-class":"element-dark"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(L,q)=>(e.openBlock(),e.createBlock(i,{key:q,label:L.label,value:L.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("span",Ce,e.toDisplayString(n+1)+"号位K线",1)]))),256))],2),e.createElementVNode("div",Ne,[Ee,e.createVNode(N,{size:"small",modelValue:l.pageType,"onUpdate:modelValue":a[5]||(a[5]=o=>l.pageType=o),options:[{label:"单周期",value:1},{label:"多周期",value:2}],style:{height:"26px"}},null,8,["modelValue"])]),e.createVNode(B,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[e.createTextVNode("功能配置")]),_:1}),e.createElementVNode("div",_e,[Be,e.createVNode(t,{modelValue:l.enable_tradeLogBrush,"onUpdate:modelValue":a[6]||(a[6]=o=>l.enable_tradeLogBrush=o)},null,8,["modelValue"])]),e.createElementVNode("div",we,[Se,e.createVNode(t,{modelValue:l.enable_showScreenTimeRange,"onUpdate:modelValue":a[7]||(a[7]=o=>l.enable_showScreenTimeRange=o)},null,8,["modelValue"])]),e.createElementVNode("div",Ie,[Te,e.createVNode(t,{modelValue:l.enable_showScreenMaxPrice,"onUpdate:modelValue":a[8]||(a[8]=o=>l.enable_showScreenMaxPrice=o)},null,8,["modelValue"])]),e.createElementVNode("div",ze,[Pe,e.createVNode(t,{modelValue:l.enable_dbClickOpenSingel,"onUpdate:modelValue":a[9]||(a[9]=o=>l.enable_dbClickOpenSingel=o)},null,8,["modelValue"])]),e.createVNode(B,{style:{"margin-top":"44px"}},{default:e.withCtx(()=>[e.createTextVNode("组件开关")]),_:1}),e.createElementVNode("div",Le,[qe,e.createVNode(t,{modelValue:l.enable_subChart,"onUpdate:modelValue":a[10]||(a[10]=o=>l.enable_subChart=o)},null,8,["modelValue"])]),e.createElementVNode("div",De,[Ae,e.createVNode(t,{modelValue:l.enable_sliderChart,"onUpdate:modelValue":a[11]||(a[11]=o=>l.enable_sliderChart=o)},null,8,["modelValue"])])]),_:1}),e.createElementVNode("div",Ue,[e.createVNode(z,{onClick:g},{default:e.withCtx(()=>[e.createTextVNode(" 恢复默认 ")]),_:1}),e.createVNode(z,{type:"primary",onClick:S},{default:e.withCtx(()=>[e.createTextVNode(" 保存配置 ")]),_:1})])]),_:1},8,["modelValue"])])}}},Fe=$._export_sfc(Oe,[["__scopeId","data-v-6e5050a9"]]),Re={install(r){r.component("st-klineConfig",Fe)}};module.exports=Re;
|
package/es/KlineConfig.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { b as ne, m as fe, n as ie, u as re, _ as ue, w as de, e as be, o as G, c as x, p as ee, q as oe } from "./base-a5af3db3.js";
|
|
2
|
-
import { d as ye, a as ge, u as he, E as _e } from "./el-overlay-
|
|
3
|
-
import { E as Ce } from "./el-button-
|
|
2
|
+
import { d as ye, a as ge, u as he, E as _e } from "./el-overlay-09ad71cd.js";
|
|
3
|
+
import { E as Ce } from "./el-button-c95adb85.js";
|
|
4
4
|
import "./el-scrollbar-323542e7.js";
|
|
5
|
-
import { E as ke } from "./el-segmented-
|
|
6
|
-
import { E as we } from "./el-checkbox-
|
|
7
|
-
import "./el-tag-
|
|
8
|
-
import { E as Ve, a as Se } from "./el-select-
|
|
9
|
-
import { c as Ie, e as Ee, u as Te, U as te, C as ae, I as se, d as Be, b as ze } from "./el-popper-
|
|
5
|
+
import { E as ke } from "./el-segmented-b868d074.js";
|
|
6
|
+
import { E as we } from "./el-checkbox-7421ccd3.js";
|
|
7
|
+
import "./el-tag-66cab138.js";
|
|
8
|
+
import { E as Ve, a as Se } from "./el-select-95627997.js";
|
|
9
|
+
import { c as Ie, e as Ee, u as Te, U as te, C as ae, I as se, d as Be, b as ze } from "./el-popper-b4f97157.js";
|
|
10
10
|
import { E as Ne } from "./el-divider-4e059794.js";
|
|
11
11
|
import { computed as T, ref as B, watch as Q, onBeforeUnmount as Pe, defineComponent as Z, useSlots as Le, openBlock as o, createBlock as k, unref as e, withCtx as p, createVNode as m, Transition as Ae, withDirectives as Oe, createElementVNode as n, mergeProps as Ue, withModifiers as ce, normalizeClass as b, createElementBlock as y, renderSlot as $, toDisplayString as M, createCommentVNode as _, normalizeStyle as me, vShow as Re, onMounted as pe, withKeys as De, resolveDynamicComponent as q, nextTick as Fe, inject as $e, reactive as Me, createTextVNode as j, Fragment as H, renderList as J, pushScopeId as Ke, popScopeId as qe } from "vue";
|
|
12
12
|
import { _ as je } from "./_plugin-vue_export-helper-dad06003.js";
|
|
13
|
-
import { E as D, c as He, l as Je } from "./index-
|
|
14
|
-
import { i as We } from "./validator-
|
|
15
|
-
import { b as Xe, c as le, i as X, d as Ye, e as Ge, f as Qe, g as Ze } from "./use-form-common-props-
|
|
16
|
-
import { E as xe } from "./index-
|
|
13
|
+
import { E as D, c as He, l as Je } from "./index-a871c3eb.js";
|
|
14
|
+
import { i as We } from "./validator-764a9db0.js";
|
|
15
|
+
import { b as Xe, c as le, i as X, d as Ye, e as Ge, f as Qe, g as Ze } from "./use-form-common-props-815d48a6.js";
|
|
16
|
+
import { E as xe } from "./index-844bdd85.js";
|
|
17
17
|
import { u as el } from "./index-2e331d74.js";
|
|
18
18
|
import { u as ll } from "./index-d77a7336.js";
|
|
19
19
|
import "./vnode-5ddb7ed1.js";
|
|
20
20
|
import "./scroll-679bd6bf.js";
|
|
21
21
|
import "./index-960806da.js";
|
|
22
|
-
import "./use-global-config-
|
|
23
|
-
import "./index-
|
|
22
|
+
import "./use-global-config-b5e9d3d5.js";
|
|
23
|
+
import "./index-e5566b94.js";
|
|
24
24
|
import "./index-657047bb.js";
|
|
25
|
-
import "./index-
|
|
25
|
+
import "./index-57672682.js";
|
|
26
26
|
import "./castArray-7741a212.js";
|
|
27
|
-
import "./index-
|
|
27
|
+
import "./index-d91dc23f.js";
|
|
28
28
|
import "./debounce-8d53f4dd.js";
|
|
29
29
|
const tl = ne({
|
|
30
30
|
...ye,
|
package/es/KlineNew.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),C=require("./index.esm-94a95a2a.cjs"),L=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./index-8901a38c.cjs");require("./base-ef747d02.cjs");require("./el-tag-789f05d3.cjs");const R=require("./el-select-12f6deb7.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-7ba87e05.cjs");const $=require("echarts");require("./index-4f48940d.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-344056f9.cjs");require("./index-cebc7160.cjs");require("./index-bb833443.cjs");require("./index-8de94a49.cjs");require("./index-696b6a94.cjs");require("./castArray-35947698.cjs");require("./index-c04f444f.cjs");require("./scroll-b108dabd.cjs");require("./debounce-62f5b6e8.cjs");require("./vnode-b906ae6d.cjs");function N(m){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const S in m)if(S!=="default"){const g=Object.getOwnPropertyDescriptor(m,S);Object.defineProperty(A,S,g.get?g:{enumerable:!0,get:()=>m[S]})}}return A.default=m,Object.freeze(A)}const E=N($),M=t.defineComponent({__name:"index",setup(m,{expose:A}){let S=!1,g=!0,v=[];const I=(h,u)=>h.length>u?h.slice(h.length-u):h;return A({initTalib:async()=>{if(!S)S=!0,await C.init("./talib.wasm"),g=!1,v.forEach(h=>{h()});else if(g)return new Promise(h=>{v.push(h)})},handleKeyDown:(h,u)=>{let{startValue:o,endValue:d,maxIndex:f}=u;if(h.code==="ArrowLeft"){if(o===0)return;o=o-1,d=d-1}else if(h.code==="ArrowRight"){if(d===f)return;o=o+1,d=d+1}else if(h.code==="ArrowUp"){if(d-o<5)return;const p=Math.floor((d-o)/2)+1;o=o+p,d-o<5&&(o=d-4)}else if(h.code==="ArrowDown"){const p=Math.min(500,d-o);o=o-p-1}return{startValue:o,endValue:d}},getDataZoomInfoByTime:h=>{const{showStartTime:u,showEndTime:o,xAxisData:d,maxShowDays:f}=h;let p=-1,e=-1,i={};return d.forEach((a,n)=>{const l=a.split(" ")[0];i[l]=i[l]||0,i[l]+=1,new Date(a)>=new Date(u)&&p===-1&&(p=n),new Date(a)<=new Date(o)&&(e=n)}),{startValue:p,endValue:e,maxValueSpan:Math.max(...Object.values(i))*f}},formatDataBySlide:h=>{const{originDrawData:u,addData:o,startTime:d,endTime:f}=h,{mainIndicator:p,mainIndicatorList:e,subIndicator:i,subIndicatorList:a,config:n,timeRange:l}=h,{loadAddCount:D,preLoadCount:q}=n;let _=[],b=[],F=[],w=[];d&&f?(_=o.filter(s=>new Date(s[0])>=new Date(d)&&new Date(s[0])<=new Date(f)),w=[...o]):f?(_=[...o.filter((s,r)=>r>=o.length-D&&new Date(l[0])<=new Date(s[0])&&new Date(s[0])<=new Date(l[1])),...u.originData],w=[...o,...u.originData]):d&&(_=[...u.originData,...o.filter((s,r)=>r>=q&&new Date(l[0])<=new Date(s[0])&&new Date(s[0])<=new Date(l[1]))],w=_),_.forEach((s,r)=>{b.push([s[1],s[4],s[3],s[2],r===0?0:_[r-1][4],s[6]]),F.push(s[0])});let c=[],x=[];const y={time:[],open:[],close:[],high:[],low:[],originData:w};let B=null,T=null;return w.forEach((s,r)=>{y.time.push(s[0]),y.open.push(s[1]),y.close.push(s[4]),y.high.push(s[2]),y.low.push(s[3]),s[0]===_[0][0]&&(B=r),s[0]===_[_.length-1][0]&&(T=r+1)}),c=e.find(({value:s})=>s===p).config.map(s=>{const{calculationFn:r}=s,k={time:[],open:[],close:[],high:[],low:[],originData:[]};return{...s,data:r?r(C.talib,y,k).slice(B,T):[]}}),x=a.find(({value:s})=>s===i).config.reduce((s,r)=>{const{source:k,calculationFn:V}=r;return k==="calculation"?[...s,{...r,data:V?V(C.talib,y).slice(B,T):[]}]:s},[]),{originData:_,candlestickData:b,mainIndicatorData:c,subIndicatorData:x,xAxisData:F,startTime:_[0][0],endTime:_[_.length-1][0],length:_.length}},formatDataByCount:h=>{const{originDrawData:u,addData:o,mainIndicator:d,mainIndicatorList:f,subIndicator:p,subIndicatorList:e,config:i}=h;let a={};const{addCount:n,preLoadCount:l}=i,D=[],q=[],_=[],b=[],F=[];let w=[],c=[];const x=o.filter((r,k)=>(D.push(r[0]),q.push(r[1]),_.push(r[4]),b.push(r[2]),F.push(r[3]),w.push(r[0]),c.push([r[1],r[4],r[3],r[2],k===0?0:o[k-1][4],r[6]]),o.length>=n+l-1?k>=l:!0));w=I(w,x.length),c=I(c,x.length);const y={time:D,open:q,close:_,high:b,low:F,originData:o},T=f.find(r=>r.value===d).config.map(r=>({...r,data:I(r.calculationFn?r.calculationFn(C.talib,y,{time:[],open:[],close:[],high:[],low:[],originData:[]}):[],w.length)}));let s=[];return p&&e&&(s=e.find(k=>k.value===p).config.reduce((k,V)=>V.source==="calculation"?[...k,{...V,data:I(V.calculationFn?V.calculationFn(C.talib,y):[],w.length)}]:k,[])),u.length?a={originData:[...x,...u.originData],xAxisData:[...w,...u.xAxisData],candlestickData:[...c,...u.candlestickData],mainIndicatorData:u.mainIndicatorData.map((r,k)=>({...r,data:[...T[k].data,...r.data]})),subIndicatorData:u.subIndicatorData.map((r,k)=>({...r,data:[...s[k].data,...r.data]}))}:a={originData:x,xAxisData:w,candlestickData:c,mainIndicatorData:T,subIndicatorData:s},a.length=a.xAxisData.length,a.startTime=a.xAxisData[0],a.endTime=a.xAxisData[a.length-1],a},fn:()=>{}}),(h,u)=>null}}),j={class:"kline-tips"},P=t.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(m){return(A,S)=>(t.openBlock(),t.createElementBlock("div",j,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.data,(g,v)=>(t.openBlock(),t.createElementBlock("div",{key:v,class:"kline-tips-item",style:t.normalizeStyle({color:g.color})},t.toDisplayString(g.label)+" "+t.toDisplayString(g.value),5))),128))]))}});const O=L._export_sfc(P,[["__scopeId","data-v-2a02e841"]]),K={class:"kline-tips"},U=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},candlestickData:{type:Array,default:()=>null},mainIndicatorData:{type:Array,default:()=>null},activeIndex:{type:Number,require:!0}},setup(m){const{round:A,multiply:S,divide:g,subtract:v,formatValue:I}=z.x,h=m,u=t.computed(()=>{const{drawData:d,activeIndex:f,candlestickData:p}=h;if(p!=null&&p.length&&p[f]){let e;return p[f][6]>0?e="red":p[f][6]<0&&(e="green"),[{label:"开",value:p[f][0]},{label:"高",value:p[f][3]},{label:"低",value:p[f][2]},{label:"收",value:p[f][1]},{label:"额",value:I(p[f][4])},{label:"涨跌",value:`${A(p[f][6])}%`,color:e}]}else if(d.candlestickData&&d.candlestickData[f]){const e=d.candlestickData[f],i=[{label:"开",value:e[0]},{label:"高",value:e[3]},{label:"低",value:e[2]},{label:"收",value:e[1]}];e[5]!==void 0&&i.push({label:"额",value:I(e[5])});const a=A(S(g(v(e[1],e[4]),Math.abs(e[4])),100));let n;return a>0?n="red":a<0&&(n="green"),i.push({label:"涨跌",value:`${a}%`,color:n}),i}return[]}),o=t.computed(()=>{var p;const{drawData:d,activeIndex:f}=h;return((p=d==null?void 0:d.mainIndicatorData)==null?void 0:p.map(e=>({label:e.key,value:A(e.data[f]),color:e.color})))||[]});return(d,f)=>(t.openBlock(),t.createElementBlock("div",K,[t.createVNode(O,{data:u.value},null,8,["data"]),t.createVNode(O,{data:o.value},null,8,["data"])]))}});const Z=L._export_sfc(U,[["__scopeId","data-v-e75a1234"]]),Y={class:"klineSub"},H={class:"klineSub-tips"},G={key:0,class:"klineSub-tips-select"},J=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0},config:{type:Object,require:!0}},emits:["update:modelValue"],setup(m,{expose:A,emit:S}){const{round:g}=z.x;let v,I;const h=S,u=m,o=t.ref(),d=t.computed({get(){return u.modelValue},set(e){h("update:modelValue",e)}}),f=t.computed(()=>{const{drawData:e,activeIndex:i}=u,a=u.subIndicatorList.find(n=>n.value===d.value);return e.originData&&e.originData[i]?a.config.map(n=>{var D,q;let l="-";return n.source==="origin"?l=e.originData[i][n.dataIndex]||"-":n.source==="calculation"&&(l=(((q=(D=e.subIndicatorData)==null?void 0:D.find(b=>b.key===n.key))==null?void 0:q.data)||[])[i]),{label:n.key,color:n.color,value:l==="-"?l:g(l)}}):[]});t.onMounted(()=>{v=E.init(o.value);let e=!0;I=new ResizeObserver(()=>{if(e){e=null;return}v.resize()}),I.observe(o.value)}),t.onUnmounted(()=>{v.dispose(),I.disconnect(),I=null});const p=(e,i)=>{const a=e[i],n=i===0?e[i]:e[i-1];return a[0]===a[1]?a[0]>=n[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:a[1]>a[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return A({connect:e=>{E.connect([e,v])},draw:e=>{t.nextTick(()=>{var w;const{startValue:i,endValue:a,maxValueSpan:n}=e,{xAxisData:l,subIndicatorData:D,candlestickData:q,originData:_}=u.drawData,b=u.subIndicatorList.find(c=>c.value===d.value),F=[];if(b.series==="bar"){let c=[];b.source==="origin"?c=_.map(x=>x[b.dataIndex]):c=((w=D==null?void 0:D.find(x=>x.key===b.dataIndex))==null?void 0:w.data)||[],F.push({name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:c.map((x,y)=>b.color==="kline"?{value:x,itemStyle:p(q,y)}:b.color==="value"?{value:x,itemStyle:{color:x>=0?"#FF0000":"#00FFFF"}}:{value:x,itemStyle:{color:b.color}})})}D.forEach(c=>{if(c.series==="line"){let x=[];c.source==="origin"?x=_.map(y=>y[c.dataIndex]):c.source==="calculation"&&(x=c.data),F.push({xAxisIndex:0,yAxisIndex:c.yAxis==="right"?2:1,name:c.key,type:"line",silent:!0,symbol:"none",data:x,lineStyle:{width:1},itemStyle:{color:c.color}})}}),v.setOption({animation:!1,grid:{left:`${u.config.gridLeft}px`,top:"10px",right:`${u.config.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:i,endValue:a,maxValueSpan:n}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:c=>{const{axisDimension:x,value:y}=c;if(x==="x")return y;if(c.axisIndex===1)return String(g(y))}}},formatter:()=>""},xAxis:{type:"category",data:l,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!0,formatter:c=>c}},yAxis:[{position:"right"},{position:"left",min:b.leftYAxisRange==="cover"?c=>c.min:null,max:b.leftYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:b.rightYAxisRange==="cover"?c=>c.min:null,max:b.rightYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:F},!0)})}}),(e,i)=>{const a=R.ElOption,n=R.ElSelect;return t.openBlock(),t.createElementBlock("div",Y,[t.createElementVNode("div",H,[f.value.length?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(n,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=l=>d.value=l),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.subIndicatorList,l=>(t.openBlock(),t.createBlock(a,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):t.createCommentVNode("",!0),t.createVNode(O,{data:f.value},null,8,["data"])]),t.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:o},null,512)])}}});const Q=L._export_sfc(J,[["__scopeId","data-v-0a2f256e"]]),W=t.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(m,{expose:A,emit:S}){let g,v,I=null;const h=S,u=m,o=t.ref();t.watch(()=>u.data,()=>{p()},{deep:!0}),t.onMounted(()=>{g=E.init(o.value),d(),p();let e=!0;v=new ResizeObserver(()=>{if(e){e=null;return}g.resize()}),v.observe(o.value)}),t.onUnmounted(()=>{g.off("datazoom"),g.dispose(),v.disconnect(),v=null});const d=()=>{g.on("datazoom",e=>{e.dataZoomId&&(clearTimeout(I),I=setTimeout(()=>{const{data:i}=u,{start:a,end:n}=e,l=Math.floor(a*i.length/100),D=n===100?i.length-1:Math.floor(n*i.length/100);f(l,D),clearTimeout(I)},100))})},f=(e,i)=>{const a=u.data;if(a.length===0)return;const n=a[e][0].split(" ")[0],l=a[i][0].split(" ")[0];h("change",{startTime:`${n} 00:00:00`,endTime:`${l} 24:00:00`})},p=()=>{const{data:e}=u;if(e.length===0)return;const i=e.map(n=>n[0].split(" ")[0]),a=e.map(n=>n[1]);g.setOption({grid:{height:0,left:"80px",right:"80px"},xAxis:{type:"category",data:i,show:!1},yAxis:{type:"value"},series:[{data:a,type:"line"}]},!0)};return A({resetSlide:(e,i,a)=>{let n=-1,l=-1;u.data.forEach((D,q)=>{n===-1&&D[0]===e?n=q:n===-1&&new Date(D[0])>new Date(e)&&(n=q-1),(l===-1&&D[0]===i||l===-1&&new Date(D[0])>new Date(i))&&(l=q)}),l=l===-1?u.data.length-1:l,g.setOption({dataZoom:[{show:!0,startValue:n,endValue:l,maxValueSpan:a,textStyle:{color:"#ccc"}},{type:"inside",startValue:n,endValue:l,maxValueSpan:a}]})},resize:()=>{g==null||g.resize()}}),(e,i)=>(t.openBlock(),t.createElementBlock("div",{class:"klineSlide",ref_key:"slideChartRef",ref:o},null,512))}});const X=L._export_sfc(W,[["__scopeId","data-v-5008746a"]]),ee={install(m){m.component("st-klineUtils",M),m.component("st-klineSub",Q),m.component("st-klineTips",Z),m.component("st-klineSlide",X)}};module.exports=ee;
|
|
1
|
+
"use strict";const t=require("vue"),C=require("./index.esm-94a95a2a.cjs"),L=require("./_plugin-vue_export-helper-f246444f.cjs"),z=require("./index-8901a38c.cjs");require("./base-ef747d02.cjs");require("./el-tag-a33c4b22.cjs");const R=require("./el-select-d8d91db1.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./el-popper-b6c99b28.cjs");const $=require("echarts");require("./index-c108567d.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-fd9b61a0.cjs");require("./index-098c2447.cjs");require("./index-bb833443.cjs");require("./index-298075cf.cjs");require("./index-f3562b52.cjs");require("./castArray-35947698.cjs");require("./index-11547a0c.cjs");require("./scroll-b108dabd.cjs");require("./debounce-62f5b6e8.cjs");require("./vnode-b906ae6d.cjs");function N(m){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const S in m)if(S!=="default"){const g=Object.getOwnPropertyDescriptor(m,S);Object.defineProperty(A,S,g.get?g:{enumerable:!0,get:()=>m[S]})}}return A.default=m,Object.freeze(A)}const E=N($),M=t.defineComponent({__name:"index",setup(m,{expose:A}){let S=!1,g=!0,v=[];const I=(h,u)=>h.length>u?h.slice(h.length-u):h;return A({initTalib:async()=>{if(!S)S=!0,await C.init("./talib.wasm"),g=!1,v.forEach(h=>{h()});else if(g)return new Promise(h=>{v.push(h)})},handleKeyDown:(h,u)=>{let{startValue:o,endValue:d,maxIndex:f}=u;if(h.code==="ArrowLeft"){if(o===0)return;o=o-1,d=d-1}else if(h.code==="ArrowRight"){if(d===f)return;o=o+1,d=d+1}else if(h.code==="ArrowUp"){if(d-o<5)return;const p=Math.floor((d-o)/2)+1;o=o+p,d-o<5&&(o=d-4)}else if(h.code==="ArrowDown"){const p=Math.min(500,d-o);o=o-p-1}return{startValue:o,endValue:d}},getDataZoomInfoByTime:h=>{const{showStartTime:u,showEndTime:o,xAxisData:d,maxShowDays:f}=h;let p=-1,e=-1,i={};return d.forEach((a,n)=>{const l=a.split(" ")[0];i[l]=i[l]||0,i[l]+=1,new Date(a)>=new Date(u)&&p===-1&&(p=n),new Date(a)<=new Date(o)&&(e=n)}),{startValue:p,endValue:e,maxValueSpan:Math.max(...Object.values(i))*f}},formatDataBySlide:h=>{const{originDrawData:u,addData:o,startTime:d,endTime:f}=h,{mainIndicator:p,mainIndicatorList:e,subIndicator:i,subIndicatorList:a,config:n,timeRange:l}=h,{loadAddCount:D,preLoadCount:q}=n;let _=[],b=[],F=[],w=[];d&&f?(_=o.filter(s=>new Date(s[0])>=new Date(d)&&new Date(s[0])<=new Date(f)),w=[...o]):f?(_=[...o.filter((s,r)=>r>=o.length-D&&new Date(l[0])<=new Date(s[0])&&new Date(s[0])<=new Date(l[1])),...u.originData],w=[...o,...u.originData]):d&&(_=[...u.originData,...o.filter((s,r)=>r>=q&&new Date(l[0])<=new Date(s[0])&&new Date(s[0])<=new Date(l[1]))],w=_),_.forEach((s,r)=>{b.push([s[1],s[4],s[3],s[2],r===0?0:_[r-1][4],s[6]]),F.push(s[0])});let c=[],x=[];const y={time:[],open:[],close:[],high:[],low:[],originData:w};let B=null,T=null;return w.forEach((s,r)=>{y.time.push(s[0]),y.open.push(s[1]),y.close.push(s[4]),y.high.push(s[2]),y.low.push(s[3]),s[0]===_[0][0]&&(B=r),s[0]===_[_.length-1][0]&&(T=r+1)}),c=e.find(({value:s})=>s===p).config.map(s=>{const{calculationFn:r}=s,k={time:[],open:[],close:[],high:[],low:[],originData:[]};return{...s,data:r?r(C.talib,y,k).slice(B,T):[]}}),x=a.find(({value:s})=>s===i).config.reduce((s,r)=>{const{source:k,calculationFn:V}=r;return k==="calculation"?[...s,{...r,data:V?V(C.talib,y).slice(B,T):[]}]:s},[]),{originData:_,candlestickData:b,mainIndicatorData:c,subIndicatorData:x,xAxisData:F,startTime:_[0][0],endTime:_[_.length-1][0],length:_.length}},formatDataByCount:h=>{const{originDrawData:u,addData:o,mainIndicator:d,mainIndicatorList:f,subIndicator:p,subIndicatorList:e,config:i}=h;let a={};const{addCount:n,preLoadCount:l}=i,D=[],q=[],_=[],b=[],F=[];let w=[],c=[];const x=o.filter((r,k)=>(D.push(r[0]),q.push(r[1]),_.push(r[4]),b.push(r[2]),F.push(r[3]),w.push(r[0]),c.push([r[1],r[4],r[3],r[2],k===0?0:o[k-1][4],r[6]]),o.length>=n+l-1?k>=l:!0));w=I(w,x.length),c=I(c,x.length);const y={time:D,open:q,close:_,high:b,low:F,originData:o},T=f.find(r=>r.value===d).config.map(r=>({...r,data:I(r.calculationFn?r.calculationFn(C.talib,y,{time:[],open:[],close:[],high:[],low:[],originData:[]}):[],w.length)}));let s=[];return p&&e&&(s=e.find(k=>k.value===p).config.reduce((k,V)=>V.source==="calculation"?[...k,{...V,data:I(V.calculationFn?V.calculationFn(C.talib,y):[],w.length)}]:k,[])),u.length?a={originData:[...x,...u.originData],xAxisData:[...w,...u.xAxisData],candlestickData:[...c,...u.candlestickData],mainIndicatorData:u.mainIndicatorData.map((r,k)=>({...r,data:[...T[k].data,...r.data]})),subIndicatorData:u.subIndicatorData.map((r,k)=>({...r,data:[...s[k].data,...r.data]}))}:a={originData:x,xAxisData:w,candlestickData:c,mainIndicatorData:T,subIndicatorData:s},a.length=a.xAxisData.length,a.startTime=a.xAxisData[0],a.endTime=a.xAxisData[a.length-1],a},fn:()=>{}}),(h,u)=>null}}),j={class:"kline-tips"},P=t.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(m){return(A,S)=>(t.openBlock(),t.createElementBlock("div",j,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.data,(g,v)=>(t.openBlock(),t.createElementBlock("div",{key:v,class:"kline-tips-item",style:t.normalizeStyle({color:g.color})},t.toDisplayString(g.label)+" "+t.toDisplayString(g.value),5))),128))]))}});const O=L._export_sfc(P,[["__scopeId","data-v-2a02e841"]]),K={class:"kline-tips"},U=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},candlestickData:{type:Array,default:()=>null},mainIndicatorData:{type:Array,default:()=>null},activeIndex:{type:Number,require:!0}},setup(m){const{round:A,multiply:S,divide:g,subtract:v,formatValue:I}=z.x,h=m,u=t.computed(()=>{const{drawData:d,activeIndex:f,candlestickData:p}=h;if(p!=null&&p.length&&p[f]){let e;return p[f][6]>0?e="red":p[f][6]<0&&(e="green"),[{label:"开",value:p[f][0]},{label:"高",value:p[f][3]},{label:"低",value:p[f][2]},{label:"收",value:p[f][1]},{label:"额",value:I(p[f][4])},{label:"涨跌",value:`${A(p[f][6])}%`,color:e}]}else if(d.candlestickData&&d.candlestickData[f]){const e=d.candlestickData[f],i=[{label:"开",value:e[0]},{label:"高",value:e[3]},{label:"低",value:e[2]},{label:"收",value:e[1]}];e[5]!==void 0&&i.push({label:"额",value:I(e[5])});const a=A(S(g(v(e[1],e[4]),Math.abs(e[4])),100));let n;return a>0?n="red":a<0&&(n="green"),i.push({label:"涨跌",value:`${a}%`,color:n}),i}return[]}),o=t.computed(()=>{var p;const{drawData:d,activeIndex:f}=h;return((p=d==null?void 0:d.mainIndicatorData)==null?void 0:p.map(e=>({label:e.key,value:A(e.data[f]),color:e.color})))||[]});return(d,f)=>(t.openBlock(),t.createElementBlock("div",K,[t.createVNode(O,{data:u.value},null,8,["data"]),t.createVNode(O,{data:o.value},null,8,["data"])]))}});const Z=L._export_sfc(U,[["__scopeId","data-v-e75a1234"]]),Y={class:"klineSub"},H={class:"klineSub-tips"},G={key:0,class:"klineSub-tips-select"},J=t.defineComponent({__name:"index",props:{drawData:{type:Object,require:!0},activeIndex:{type:Number,require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0},config:{type:Object,require:!0}},emits:["update:modelValue"],setup(m,{expose:A,emit:S}){const{round:g}=z.x;let v,I;const h=S,u=m,o=t.ref(),d=t.computed({get(){return u.modelValue},set(e){h("update:modelValue",e)}}),f=t.computed(()=>{const{drawData:e,activeIndex:i}=u,a=u.subIndicatorList.find(n=>n.value===d.value);return e.originData&&e.originData[i]?a.config.map(n=>{var D,q;let l="-";return n.source==="origin"?l=e.originData[i][n.dataIndex]||"-":n.source==="calculation"&&(l=(((q=(D=e.subIndicatorData)==null?void 0:D.find(b=>b.key===n.key))==null?void 0:q.data)||[])[i]),{label:n.key,color:n.color,value:l==="-"?l:g(l)}}):[]});t.onMounted(()=>{v=E.init(o.value);let e=!0;I=new ResizeObserver(()=>{if(e){e=null;return}v.resize()}),I.observe(o.value)}),t.onUnmounted(()=>{v.dispose(),I.disconnect(),I=null});const p=(e,i)=>{const a=e[i],n=i===0?e[i]:e[i-1];return a[0]===a[1]?a[0]>=n[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:a[1]>a[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return A({connect:e=>{E.connect([e,v])},draw:e=>{t.nextTick(()=>{var w;const{startValue:i,endValue:a,maxValueSpan:n}=e,{xAxisData:l,subIndicatorData:D,candlestickData:q,originData:_}=u.drawData,b=u.subIndicatorList.find(c=>c.value===d.value),F=[];if(b.series==="bar"){let c=[];b.source==="origin"?c=_.map(x=>x[b.dataIndex]):c=((w=D==null?void 0:D.find(x=>x.key===b.dataIndex))==null?void 0:w.data)||[],F.push({name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:c.map((x,y)=>b.color==="kline"?{value:x,itemStyle:p(q,y)}:b.color==="value"?{value:x,itemStyle:{color:x>=0?"#FF0000":"#00FFFF"}}:{value:x,itemStyle:{color:b.color}})})}D.forEach(c=>{if(c.series==="line"){let x=[];c.source==="origin"?x=_.map(y=>y[c.dataIndex]):c.source==="calculation"&&(x=c.data),F.push({xAxisIndex:0,yAxisIndex:c.yAxis==="right"?2:1,name:c.key,type:"line",silent:!0,symbol:"none",data:x,lineStyle:{width:1},itemStyle:{color:c.color}})}}),v.setOption({animation:!1,grid:{left:`${u.config.gridLeft}px`,top:"10px",right:`${u.config.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:i,endValue:a,maxValueSpan:n}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:c=>{const{axisDimension:x,value:y}=c;if(x==="x")return y;if(c.axisIndex===1)return String(g(y))}}},formatter:()=>""},xAxis:{type:"category",data:l,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{show:!0,formatter:c=>c}},yAxis:[{position:"right"},{position:"left",min:b.leftYAxisRange==="cover"?c=>c.min:null,max:b.leftYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:b.rightYAxisRange==="cover"?c=>c.min:null,max:b.rightYAxisRange==="cover"?c=>c.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:F},!0)})}}),(e,i)=>{const a=R.ElOption,n=R.ElSelect;return t.openBlock(),t.createElementBlock("div",Y,[t.createElementVNode("div",H,[f.value.length?(t.openBlock(),t.createElementBlock("div",G,[t.createVNode(n,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=l=>d.value=l),size:"small","popper-class":"element-dark",class:"element-dark subIndicator"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.subIndicatorList,l=>(t.openBlock(),t.createBlock(a,{key:l.value,label:l.label,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):t.createCommentVNode("",!0),t.createVNode(O,{data:f.value},null,8,["data"])]),t.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:o},null,512)])}}});const Q=L._export_sfc(J,[["__scopeId","data-v-0a2f256e"]]),W=t.defineComponent({__name:"index",props:{data:{type:Array,default:()=>[]}},emits:["change"],setup(m,{expose:A,emit:S}){let g,v,I=null;const h=S,u=m,o=t.ref();t.watch(()=>u.data,()=>{p()},{deep:!0}),t.onMounted(()=>{g=E.init(o.value),d(),p();let e=!0;v=new ResizeObserver(()=>{if(e){e=null;return}g.resize()}),v.observe(o.value)}),t.onUnmounted(()=>{g.off("datazoom"),g.dispose(),v.disconnect(),v=null});const d=()=>{g.on("datazoom",e=>{e.dataZoomId&&(clearTimeout(I),I=setTimeout(()=>{const{data:i}=u,{start:a,end:n}=e,l=Math.floor(a*i.length/100),D=n===100?i.length-1:Math.floor(n*i.length/100);f(l,D),clearTimeout(I)},100))})},f=(e,i)=>{const a=u.data;if(a.length===0)return;const n=a[e][0].split(" ")[0],l=a[i][0].split(" ")[0];h("change",{startTime:`${n} 00:00:00`,endTime:`${l} 24:00:00`})},p=()=>{const{data:e}=u;if(e.length===0)return;const i=e.map(n=>n[0].split(" ")[0]),a=e.map(n=>n[1]);g.setOption({grid:{height:0,left:"80px",right:"80px"},xAxis:{type:"category",data:i,show:!1},yAxis:{type:"value"},series:[{data:a,type:"line"}]},!0)};return A({resetSlide:(e,i,a)=>{let n=-1,l=-1;u.data.forEach((D,q)=>{n===-1&&D[0]===e?n=q:n===-1&&new Date(D[0])>new Date(e)&&(n=q-1),(l===-1&&D[0]===i||l===-1&&new Date(D[0])>new Date(i))&&(l=q)}),l=l===-1?u.data.length-1:l,g.setOption({dataZoom:[{show:!0,startValue:n,endValue:l,maxValueSpan:a,textStyle:{color:"#ccc"}},{type:"inside",startValue:n,endValue:l,maxValueSpan:a}]})},resize:()=>{g==null||g.resize()}}),(e,i)=>(t.openBlock(),t.createElementBlock("div",{class:"klineSlide",ref_key:"slideChartRef",ref:o},null,512))}});const X=L._export_sfc(W,[["__scopeId","data-v-5008746a"]]),ee={install(m){m.component("st-klineUtils",M),m.component("st-klineSub",Q),m.component("st-klineTips",Z),m.component("st-klineSlide",X)}};module.exports=ee;
|
package/es/KlineNew.js
CHANGED
|
@@ -3,20 +3,20 @@ import { i as te, t as z } from "./index.esm-8d9a2abe.js";
|
|
|
3
3
|
import { _ as q } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
4
|
import { x as G } from "./index-7ed0999e.js";
|
|
5
5
|
import "./base-a5af3db3.js";
|
|
6
|
-
import "./el-tag-
|
|
7
|
-
import { E as ae, a as ne } from "./el-select-
|
|
6
|
+
import "./el-tag-66cab138.js";
|
|
7
|
+
import { E as ae, a as ne } from "./el-select-95627997.js";
|
|
8
8
|
import "./el-scrollbar-323542e7.js";
|
|
9
|
-
import "./el-popper-
|
|
9
|
+
import "./el-popper-b4f97157.js";
|
|
10
10
|
import * as B from "echarts";
|
|
11
|
-
import "./index-
|
|
11
|
+
import "./index-e5566b94.js";
|
|
12
12
|
import "./index-960806da.js";
|
|
13
|
-
import "./use-form-common-props-
|
|
14
|
-
import "./index-
|
|
13
|
+
import "./use-form-common-props-815d48a6.js";
|
|
14
|
+
import "./index-a871c3eb.js";
|
|
15
15
|
import "./index-d77a7336.js";
|
|
16
|
-
import "./index-
|
|
17
|
-
import "./index-
|
|
16
|
+
import "./index-844bdd85.js";
|
|
17
|
+
import "./index-57672682.js";
|
|
18
18
|
import "./castArray-7741a212.js";
|
|
19
|
-
import "./index-
|
|
19
|
+
import "./index-d91dc23f.js";
|
|
20
20
|
import "./scroll-679bd6bf.js";
|
|
21
21
|
import "./debounce-8d53f4dd.js";
|
|
22
22
|
import "./vnode-5ddb7ed1.js";
|