st-comp 0.0.260 → 0.0.262
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ChartLayout.js +4 -4
- package/es/CustomFunction.js +31 -31
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +36 -37
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +1593 -839
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +1 -1197
- package/es/KlineConfig.js +89 -89
- package/es/KlineNew.js +17 -17
- package/es/KlinePlus.js +20 -20
- package/es/MonacoEditor.js +25 -25
- package/es/Pagination.js +113 -113
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.js +29 -29
- package/es/User.js +25 -25
- package/es/VarSelectDialog.cjs +1 -1
- package/es/VarSelectDialog.js +27 -27
- package/es/VarietyAiHelper.cjs +3 -5
- package/es/VarietyAiHelper.js +244 -330
- package/es/VarietyAutoComplete.js +11 -11
- package/es/VarietySearch.cjs +18 -19
- package/es/VarietySearch.js +1169 -1205
- package/es/{VarietySelect-9f267958.js → VarietySelect-faef4799.js} +4 -4
- package/es/VarietyTextCopy.js +13 -13
- package/es/VirtualTable.js +74 -74
- package/es/{_initCloneObject-69c8ae23.js → _initCloneObject-009eedf8.js} +7 -7
- package/es/aiTools-2e1f92d2.cjs +3 -0
- package/es/aiTools-faa0a14d.js +90 -0
- package/es/{base-29f73b05.js → base-7ff209fc.js} +40 -40
- package/es/{castArray-609a313e.js → castArray-b9f1609f.js} +1 -1
- package/es/{config-provider-7860903c.js → config-provider-071b8bec.js} +6 -6
- package/es/{debounce-a09ce9a3.js → debounce-23c2f7e1.js} +1 -1
- package/es/{dropdown-497442b7.js → dropdown-9941f401.js} +4 -4
- package/es/{el-autocomplete-27c60cc8.js → el-autocomplete-43f205b0.js} +17 -17
- package/es/{el-button-e2c63c08.js → el-button-7f58608d.js} +33 -33
- package/es/{el-checkbox-71ebd862.js → el-checkbox-40664b27.js} +17 -17
- package/es/{el-input-number-c8018cb1.js → el-checkbox-group-3ddad0d7.js} +34 -34
- package/es/{el-input-number-3d94fa58.cjs → el-checkbox-group-f775e73f.cjs} +1 -1
- package/es/{el-dialog-eedcfd3e.js → el-dialog-2f10a2f4.js} +15 -15
- package/es/{el-divider-523e5874.js → el-divider-4e66c835.js} +1 -1
- package/es/{el-empty-f5a1607a.js → el-empty-e0d826de.js} +5 -5
- package/es/{el-form-item-bdcfd297.js → el-form-item-2b68cdf5.js} +36 -36
- package/es/{el-input-d47281da.js → el-input-31a818d4.js} +36 -36
- package/es/{el-loading-0cd81d05.js → el-loading-3e350f5e.js} +5 -5
- package/es/{el-message-box-fea4fca8.js → el-message-box-a3aa9b89.js} +11 -11
- package/es/{el-overlay-1ee0338d.js → el-overlay-4e9a99e0.js} +59 -59
- package/es/{el-popconfirm-089b8bec.js → el-popconfirm-c2896741.js} +12 -12
- package/es/{el-popper-c9b3d3cf.js → el-popper-003b3af7.js} +177 -177
- package/es/{el-segmented-9d3a9e11.js → el-segmented-4ae54e6a.js} +8 -8
- package/es/{el-select-e51e11c1.js → el-select-19ee0e79.js} +65 -65
- package/es/{el-table-column-05d292a8.js → el-table-column-3be856d7.js} +16 -16
- package/es/{el-tag-17cd04a1.js → el-tag-19cc5b59.js} +14 -14
- package/es/{el-text-2710fff3.js → el-text-9a7a4f0f.js} +2 -2
- package/es/{index-0f79095c.js → index-19ac550e.js} +49 -49
- package/es/{index-1d9b50de.js → index-308aab33.js} +34 -34
- package/es/{index-8a54ceeb.js → index-41dd5a1c.js} +10 -10
- package/es/{index-0ee486ad.js → index-6917da9d.js} +43 -43
- package/es/{index-bcd895a0.js → index-6d530e54.js} +13 -13
- package/es/{index-c71e37dc.js → index-808db9b4.js} +11 -11
- package/es/{index-f30561d3.js → index-99abf4ff.js} +17 -17
- package/es/{index-95e5d454.js → index-b56d81e8.js} +3 -3
- package/es/{index-8391a3df.js → index-d898531c.js} +37 -37
- package/es/{index-c2b9bbfd.js → index-e17987ac.js} +30 -30
- package/es/{index-b0117ba2.js → index-f3799536.js} +2 -2
- package/es/{index-de24705f.js → index-f402d1da.js} +1 -1
- package/es/{python-99011a53.js → python-be79c7c1.js} +25 -25
- package/es/raf-ba3dfafe.js +6 -0
- package/es/{scroll-6799bafc.js → scroll-8642151c.js} +5 -5
- package/es/style.css +1 -1
- package/es/{use-form-common-props-cb0ca65c.js → use-form-common-props-d170ccfd.js} +72 -72
- package/es/{use-global-config-cdaeca54.js → use-global-config-74436b92.js} +14 -14
- package/es/{validator-4ab9774f.js → validator-672bad4a.js} +1 -1
- package/es/{vnode-a83e6de8.js → vnode-6d2615f0.js} +1 -1
- package/es/{zh-cn-8a6390a4.js → zh-cn-ed10eeb1.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +150 -151
- package/lib/{index-107e931f.js → index-c3ddbee7.js} +7463 -7499
- package/lib/{python-5735efdf.js → python-da8fd227.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/VarietyAiHelper/index.vue +3 -3
- package/packages/VarietySearch/components/FactorScreen/index.vue +20 -7
- package/packages/VarietySearch/components/FactorScreen/tools.js +0 -41
- package/es/el-checkbox-group-0ea8fbf8.cjs +0 -1
- package/es/el-checkbox-group-4ed993c7.js +0 -1
- package/es/el-menu-item-26071fd6.cjs +0 -1
- package/es/el-menu-item-dac65bb3.js +0 -769
- package/es/raf-744cf95a.js +0 -6
package/es/KlineBasic.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./base-ef747d02.cjs");const ke=require("./el-dialog-1b185570.cjs");require("./el-overlay-ea65cb05.cjs");require("./el-input-fa18ef84.cjs");const we=require("./el-input-number-3d94fa58.cjs"),Ye=require("./el-button-974ff9e9.cjs"),De=require("./el-empty-1697ded8.cjs"),ie=require("./el-menu-item-26071fd6.cjs");require("./el-tooltip-0ea8fbf8.cjs");require("./el-popper-2d3914e4.cjs");const e=require("vue"),L=require("./dayjs.min-2c20abe6.cjs"),Se=require("echarts"),q=require("./index-8901a38c.cjs");require("./el-message-0ea8fbf8.cjs");const J=require("./index-6ca95c8a.cjs"),U=require("./_plugin-vue_export-helper-f246444f.cjs");require("./el-tag-6d8e653e.cjs");const se=require("./el-select-a11f33e8.cjs");require("./el-scrollbar-bc3f790d.cjs");require("./index-28e03bad.cjs");require("./index-9780a537.cjs");require("./use-form-common-props-d3ed62c6.cjs");require("./index-33f80550.cjs");require("./index-bb833443.cjs");require("./index-f1c702f6.cjs");require("./vnode-b906ae6d.cjs");require("./scroll-b108dabd.cjs");require("./use-global-config-c80f33a4.cjs");require("./index-37b8d3c6.cjs");require("./typescript-b63f8e83.cjs");require("./index-7dce9f59.cjs");require("./index-eea0bcb3.cjs");require("./config-provider-2ae47cc8.cjs");require("./index-e8eeea22.cjs");require("./index-6b99def3.cjs");require("./castArray-35947698.cjs");require("./debounce-62f5b6e8.cjs");function Ve(n){const w=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const b in n)if(b!=="default"){const r=Object.getOwnPropertyDescriptor(n,b);Object.defineProperty(w,b,r.get?r:{enumerable:!0,get:()=>n[b]})}}return w.default=n,Object.freeze(w)}const oe=Ve(Se);let z=null;const Me=n=>{const w=q.y(n,{handleReq:b=>{q.v()&&(b.headers.token=q.U())},handleRes:b=>{const{data:r}=b;if(r.code===401)return location.origin.includes("localhost")?location.href=`${location.origin}/#/404`:q.K(),!0}});w.get,z=w.post},Le=n=>z("/middleLayer/kline/getKlineBasic",{...n,userId:q.V("id")}),Be=n=>z("/middleLayer/kline/getKline",n),Fe=async n=>z("/alarm/deliversign/addAlarmPrice",{...n,userId:q.V("id")}),qe=async n=>z("/alarm/deliversign/findAlarmPriceByUserId",{...n,userId:q.V("id")}),ce=async n=>z("/alarm/deliversign/updateAlarmPrice",{...n,userId:q.V("id")}),Ne=async n=>z("/alarm/deliversign/deleteAlarmPrice",{...n,userId:q.V("id")}),{round:C}=q.x,Ae=(n,w,b,r,s)=>{const{data:t,time:y}=n,{gridTop:u,gridRight:f,gridLeft:p,maxShowCounts:g,showSubChart:Y}=w;return{animation:!1,grid:{top:`${u}px`,right:`${f}px`,bottom:Y?"6px":"24px",left:`${p}px`},dataZoom:[{type:"inside",startValue:b,endValue:r,maxValueSpan:g}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:l=>{const{axisDimension:m,value:k}=l;return m==="x"?Y?"":["6","7","8"].includes(s)?L.dayjs(k).format("YYYY-MM-DD"):k:String(C(k))}}},formatter:()=>""},xAxis:{show:!Y,type:"category",data:y,splitLine:{show:!1},axisLabel:{formatter:l=>["6","7","8"].includes(s)?L.dayjs(l).format("YYYY-MM-DD"):l}},yAxis:{type:"value",axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}},min:l=>C(l.min),max:l=>C(l.max)},series:[{type:"candlestick",data:t,itemStyle:{color:"transparent",color0:"#00FFFF",borderColor:"#FF0000",borderColor0:"#00FFFF",borderWidth:1}},...n.mainIndicator.map(l=>({name:l.key,type:"line",silent:!0,symbol:"none",data:l.data,lineStyle:{width:l.width||1},itemStyle:{color:l.color}}))],toolbox:{show:!1},brush:{xAxisIndex:"all",brushLink:"all",transformable:!1,outOfBrush:{colorAlpha:2},brushStyle:{color:"rgba(255,255,255,0.1)",borderColor:"rgba(255,255,255,0.4)"}}}},Ee=(n,w,b,r,s)=>{const{variety:t,featureId:y,featureType:u}=b,{gridTop:f,gridLeft:p,gridRight:g}=r;return w.reduce((Y,l)=>{const{warnPrice:m}=l,k=n==null?void 0:n.convertToPixel({yAxisIndex:0},m);if(k<=f||k>=(n==null?void 0:n.getHeight()))return Y;let M=0;return[...Y,{type:"group",name:"warningLine",info:l,draggable:"vertical",children:[{type:"line",info:l,shape:{x1:p,y1:k,x2:(n==null?void 0:n.getWidth())-g,y2:k},style:{stroke:"#FFF",lineWidth:1,lineDash:[8,4]},z:10},{type:"text",info:l,x:(n==null?void 0:n.getWidth())-g,y:k-5,style:{fill:"#FFF",text:m,stroke:"#000",lineWidth:1,opacity:1},z:10}],ondragstart:D=>{M=D.offsetY},ondrag:D=>{var N;if(D.target&&D.target.childAt(1)){const E=n.convertFromPixel({yAxisIndex:0},k+(D.offsetY-M));(N=D.target.childAt(1))==null||N.animate("style",!1).when(1,{text:C(E,3)}).start()}},ondragend:async D=>{const E=D.offsetY-M;if(E!==0){const A=n==null?void 0:n.convertFromPixel({yAxisIndex:0},E+k),F={id:l.id,warnPrice:C(A,3),featureId:y,featureCode:t,featureType:u};await ce(F),J.ElMessage.success("画线预警修改成功"),s&&s()}}}]},[])};function de(n){function w(r){if(typeof r=="number")return Number.isFinite(r)?r:null;if(typeof r=="string"){const s=r.trim();if(s==="")return null;const t=Number(s);return Number.isFinite(t)?t:null}return null}const b=w(n);if(b===null)return"-";try{if(b>=1||b<=-1)return C(b);{const r=b.toPrecision(3);return C(r,r.split(".")[1].length-1)}}catch{return"-"}}const Te=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){const w=n,b=e.ref(null),r=e.ref([]);return e.watch(()=>w.data,()=>{r.value.length===0&&e.nextTick(()=>{Array.from(b.value.children).forEach((s,t)=>{var y,u,f,p,g,Y,l,m;((u=(y=w.data)==null?void 0:y[t])==null?void 0:u.label)==="涨跌"?r.value[t]="85px":((p=(f=w.data)==null?void 0:f[t])==null?void 0:p.label)==="至今涨幅"?r.value[t]="115px":((Y=(g=w.data)==null?void 0:g[t])==null?void 0:Y.label)==="额"?r.value[t]="85px":["开","高","低","收"].includes((m=(l=w.data)==null?void 0:l[t])==null?void 0:m.label)?r.value[t]=`${s.offsetWidth+24}px`:r.value[t]=`${s.offsetWidth+36}px`})})}),(s,t)=>(e.openBlock(),e.createElementBlock("div",{class:"kline-tips",ref_key:"tipsRef",ref:b},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(y,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"kline-tips-item",style:e.normalizeStyle({color:y.color,width:r.value[u]?r.value[u]:null})},e.toDisplayString(y.label)+" "+e.toDisplayString(y.value),5))),128))],512))}});const ue=U._export_sfc(Te,[["__scopeId","data-v-096c0d10"]]);const Re={class:"kline-tips"},Oe={__name:"index",props:{data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},variety:{type:[String,Number],default:()=>null}},setup(n){const{round:w,formatValue:b}=q.x,r=n,s=e.ref(null);e.watch(()=>r.activeIndex,()=>{var u;s.value===null&&(s.value=((u=r.data.data[r.activeIndex])==null?void 0:u[1])??0)}),e.watch(()=>r.data,()=>{var u;s.value===null&&(s.value=((u=r.data.data[r.activeIndex])==null?void 0:u[1])??0)}),e.watch(()=>r.variety,()=>{s.value=null});const t=e.computed(()=>{const{data:u,activeIndex:f}=r;if(u.data&&u.data[f]){const p=u.data[f],g=[{label:"开",value:p[0]},{label:"高",value:p[3]},{label:"低",value:p[2]},{label:"收",value:p[1]}];p[4]!==null&&g.push({label:"额",value:b(p[4])});let Y;p[6]>0?Y="red":p[6]<0&&(Y="green"),g.push({label:"涨跌",value:`${w(p[6])}%`,color:Y});const l=(s.value/p[1]-1)*100;let m;return l>0?m="red":l<0&&(m="green"),g.push({label:"至今涨幅",value:`${w(l)}%`,color:m}),g}return[]}),y=e.computed(()=>{var p;const{data:u,activeIndex:f}=r;return((p=u==null?void 0:u.mainIndicator)==null?void 0:p.map(g=>({label:g.key,value:de(g.data[f]),color:g.color})))||[]});return(u,f)=>(e.openBlock(),e.createElementBlock("div",Re,[e.createVNode(ue,{data:t.value},null,8,["data"]),e.createVNode(ue,{data:y.value},null,8,["data"])]))}},Ie=U._export_sfc(Oe,[["__scopeId","data-v-832d18ff"]]),$e={class:"kline-averageTips"},je=e.defineComponent({__name:"index",props:{data:{type:Array,require:!0}},setup(n){return(w,b)=>(e.openBlock(),e.createElementBlock("div",$e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.data,(r,s)=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"kline-averageTips-item",style:e.normalizeStyle({color:r.color})},e.toDisplayString(r.label)+" "+e.toDisplayString(r.value),5))),128))]))}});const Pe=U._export_sfc(je,[["__scopeId","data-v-2ce54548"]]);const We={class:"klineSub"},Ce={class:"klineSub-tips"},ze={key:0,class:"klineSub-tips-select"},Ze={__name:"index",props:{cycle:{type:[String,Number],default:()=>null},data:{type:Object,require:!0},activeIndex:{type:[Number,String],require:!0},modelValue:{type:String,required:!0},subIndicatorList:{type:Array,required:!0}},emits:["update:modelValue"],setup(n,{expose:w,emit:b}){const{round:r}=q.x;let s=null,t=null;const y=e.ref(!0),u=b,f=n,p=e.ref(),g=e.computed({get(){return f.modelValue},set(m){u("update:modelValue",m)}}),Y=e.computed(()=>{var M;if(!y.value)return[];const{data:m,activeIndex:k}=f;return((M=m==null?void 0:m.subIndicator)==null?void 0:M.map(D=>({label:D.key,color:D.color,value:de(D.data[k])})))||[]});e.onMounted(()=>{if(y.value=!0,!p.value)return;s=oe.init(p.value);let m=!0;t=new ResizeObserver(()=>{if(m){m=!1;return}y.value&&s&&!s.isDisposed()&&s.resize()}),t.observe(p.value)}),e.onUnmounted(()=>{y.value=!1,s&&!s.isDisposed()&&(s.dispose(),s=null),t&&(t.disconnect(),t=null)});const l=(m,k)=>{const M=m[k],D=k===0?m[k]:m[k-1];return M[0]===M[1]?M[0]>=D[1]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}:M[1]>M[0]?{color:"transparent",borderColor:"#FF0000"}:{color:"#00FFFF"}};return w({connect:m=>{!y.value||!s||s.isDisposed()||oe.connect([m,s])},draw:(m,k)=>{!y.value||!s||s.isDisposed()||e.nextTick(()=>{if(!y.value||!s||s.isDisposed())return;const{startValue:M,endValue:D,maxValueSpan:N}=m,{leftYAxisRange:E,rightYAxisRange:A}=f.data.subIndicator[0],F=f.data.subIndicator.map(_=>{if(_.series==="bar")return{name:"subMain",xAxisIndex:0,yAxisIndex:1,type:"bar",silent:!0,symbol:"none",data:_.data.map((O,$)=>_.seriesColor==="kline"?{value:O,itemStyle:l(f.data.data,$)}:_.seriesColor==="value"?{value:O,itemStyle:{color:O>=0?"#FF0000":"#00FFFF"}}:{value:O,itemStyle:{color:_.seriesColor}})};if(_.series==="line")return{xAxisIndex:0,yAxisIndex:_.yAxis==="right"?2:1,name:_.key,type:"line",silent:!0,symbol:"none",data:_.data,lineStyle:{width:1},itemStyle:{color:_.color}}});s.setOption({animation:!1,grid:{left:`${k.gridLeft}px`,top:"10px",right:`${k.gridRight}px`,bottom:"20px"},dataZoom:[{type:"inside",startValue:M,endValue:D,maxValueSpan:N}],tooltip:{trigger:"axis",appendToBody:!0,confine:!0,axisPointer:{type:"cross",label:{rich:{},formatter:_=>{const{axisDimension:O,value:$}=_;if(O==="x")return["6","7","8"].includes(f.cycle)?L.dayjs($).format("YYYY-MM-DD"):$;if(_.axisIndex===1)return String(r($))}}},formatter:()=>""},xAxis:{type:"category",data:f.data.time,axisLine:{show:!0},splitLine:{show:!1},axisLabel:{formatter:_=>["6","7","8"].includes(f.cycle)?L.dayjs(_).format("YYYY-MM-DD"):_}},yAxis:[{position:"right"},{position:"left",min:E==="cover"?_=>_.min:null,max:E==="cover"?_=>_.max:null,splitNumber:1,axisLine:{show:!0},splitLine:{show:!0,lineStyle:{type:"dotted",color:"#333"}}},{position:"right",min:A==="cover"?_=>_.min:null,max:A==="cover"?_=>_.max:null,splitNumber:1,axisLine:{show:!1},splitLine:{show:!1},axisLabel:{show:!1}}],series:F},!0)})}}),(m,k)=>{const M=se.ElOption,D=se.ElSelect;return e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("div",Ce,[Y.value.length?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(D,{modelValue:g.value,"onUpdate:modelValue":k[0]||(k[0]=N=>g.value=N),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,N=>(e.openBlock(),e.createBlock(M,{key:N.value,label:N.label,value:N.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),e.createVNode(Pe,{data:Y.value},null,8,["data"])]),e.createElementVNode("div",{class:"klineSub-chart",ref_key:"subChartRef",ref:p},null,512)])}}},Ue=U._export_sfc(Ze,[["__scopeId","data-v-d720c2c7"]]),He=e.defineComponent({__name:"index",emits:["closeContextMenuCallBack"],setup(n,{emit:w}){const b=w,r=e.ref(),s=e.ref(),t=e.ref({display:"none",top:"0px",left:"0px"}),y=()=>{t.value.display="none",b("closeContextMenuCallBack"),document.removeEventListener("click",y)},u=f=>{if(f.preventDefault(),t.value.display==="block"){const{offsetX:p,offsetY:g}=f,{offsetWidth:Y,offsetHeight:l}=s.value;if(p<=Y&&g<=l)return}r.value.click(),t.value={display:"block",top:`${f.offsetY}px`,left:`${f.offsetX}px`},e.nextTick(()=>{const p=r.value.getBoundingClientRect(),g=s.value.getBoundingClientRect();g.left+g.width>=p.right&&(t.value.left=`${f.offsetX-g.width}px`),g.top+g.height>=p.bottom&&(console.log("高度超出"),t.value.top=`${f.offsetY-g.height}px`)}),document.addEventListener("click",y)};return(f,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"contextmenuRef",ref:r,class:"contextmenu",onContextmenu:u,onMouseleave:y},[e.renderSlot(f.$slots,"default",{},void 0,!0),t.value.display!=="none"?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"contextmenuContentRef",ref:s,class:"contextmenu-popover",style:e.normalizeStyle(t.value)},[e.renderSlot(f.$slots,"popover",{},void 0,!0)],4)):e.createCommentVNode("",!0)],544))}});const Ke=U._export_sfc(He,[["__scopeId","data-v-811db6b4"]]);const fe=n=>(e.pushScopeId("data-v-ae370bef"),n=n(),e.popScopeId(),n),Ge={key:0,class:"klineBasic-tips"},Xe={key:1,class:"klineBasic-sub"},Je={key:2,class:"klineBasic-empty"},Qe={key:3,class:"klineBasic-error"},et=fe(()=>e.createElementVNode("div",{class:"klineBasic-error-content"},"加载失败,请刷新重试",-1)),tt={style:{"text-align":"center"}},nt=fe(()=>e.createElementVNode("span",{style:{"margin-right":"10px"}},"预警价格:",-1)),ot={class:"dialog-footer"},at={__name:"index",props:{variety:{type:[String,Number],default:()=>null},varietyName:{type:[String,Number],default:()=>null},featureId:{type:[String,Number],default:()=>null},featureType:{type:[String,Number],default:()=>null},cycle:{type:[String,Number],default:()=>null},mainIndicator:{type:String,default:()=>""},indicatorStore:{type:Object,default:()=>null},startTime:{type:String,default:()=>null},endTime:{type:String,default:()=>null},right:{type:[String,Number],default:1},config:{type:Object,default:()=>({})},env:{type:Object,default:()=>({})},brushRange:{type:[Array,null],default:()=>null}},emits:["change","getFactorData"],setup(n,{expose:w,emit:b}){const r=[{label:"画线预警",key:"drawWarningLine"}];let s=null,t=null,y=null,u=null,f=null,p=!1,g=!1;const Y=b,l=n,m=e.ref(!1),k=e.ref(!1),M=e.ref(!1),D=e.ref(null),N=e.ref(null),E=e.ref("VOL"),A=e.ref(0),F=e.ref({}),_=e.ref([]),O=e.ref({}),$=e.ref(!1),G=e.ref(""),Q=e.ref([...r]),I=e.computed(()=>({defaultShowCounts:500,addCounts:2e3,maxShowCounts:5e3,loadCheckCounts:500,gridTop:48,gridLeft:80,gridRight:50,showSubChart:!0,showWarningLine:!0,getFactorData:!0,...l.config})),pe=()=>{t||(t=oe.init(D.value),xe(),I.value.showSubChart&&N.value.connect(t),s=q.D(D.value),s.listen(()=>{requestAnimationFrame(()=>{t==null||t.resize(),H()})}))},ee=()=>{t&&!t.isDisposed()&&t.hideLoading()},ae=(o=!1)=>{y&&(cancelAnimationFrame(y),y=null),y=requestAnimationFrame(()=>{me(o),y=requestAnimationFrame(()=>{ye(),y=requestAnimationFrame(()=>{H(),y=null})})})},me=(o=!1)=>{var c,S,B;if(!t||t.isDisposed())return;const{time:a}=F.value,{defaultShowCounts:v}=I.value;let d=a.length-1-v,x=a.length-1;if(o&&t){const V=t.getOption(),h=(S=(c=V==null?void 0:V.xAxis)==null?void 0:c[0])==null?void 0:S.data,T=(B=V==null?void 0:V.dataZoom)==null?void 0:B[0];if(h!=null&&h.length&&T){const P=h[T.startValue],W=h[T.endValue];if(P&&W){const ne=a.findIndex(K=>new Date(K).getTime()>=new Date(P).getTime()),Z=a.findLastIndex(K=>new Date(K).getTime()<=new Date(W).getTime());d=ne!==-1?ne:0,x=Z!==-1?Z:a.length-1,d>x&&(d=Math.max(0,x-Math.min(100,a.length-1)))}}}const i=Ae(F.value,I.value,d,x,l.cycle);requestAnimationFrame(()=>{t==null||t.setOption(i,!0),A.value=x,requestAnimationFrame(()=>{ve()})})},ye=()=>{var S;if(!I.value.showSubChart||!N.value)return;const{time:o}=F.value,{gridLeft:a,gridRight:v,maxShowCounts:d,defaultShowCounts:x}=I.value;let i=o.length-1-x,c=o.length-1;if(t&&!t.isDisposed()){const B=t.getOption();if((S=B==null?void 0:B.dataZoom)!=null&&S[0]){const{startValue:V,endValue:h}=B.dataZoom[0];V!==void 0&&h!==void 0&&(i=V,c=h)}}requestAnimationFrame(()=>{N.value.draw({startValue:i,endValue:c,maxValueSpan:d},{gridLeft:a,gridRight:v})})},H=()=>{t&&(u&&(cancelAnimationFrame(u),u=null),u=requestAnimationFrame(()=>{if(!(t==null?void 0:t.getOption()))return;const a=t==null?void 0:t.getWidth(),v=t==null?void 0:t.getHeight();!a||!v||(t==null||t.setOption({graphic:Ee(t,_.value,l,I.value,()=>{X()})},{notMerge:!1,replaceMerge:["graphic"],lazyUpdate:!0}),u=null)}))},ve=()=>{f&&cancelAnimationFrame(f),f=requestAnimationFrame(()=>{const{time:o}=F.value;if(!l.brushRange||!(o!=null&&o.length)||!t)return;let a=L.dayjs(l.brushRange[0]).format("YYYY-MM-DD 00:00:00"),v=L.dayjs(l.brushRange[1]).format("YYYY-MM-DD 23:59:59"),d=null,x=null;switch(String(l.cycle)){case"6":{d=o.find(i=>L.dayjs(i).format("YYYY-MM-DD")===L.dayjs(a).format("YYYY-MM-DD")),x=d;break}case"7":{d=o.find(i=>L.dayjs(i).day(5).format("YYYY-MM-DD")===L.dayjs(a).day(5).format("YYYY-MM-DD")),x=o.findLast(i=>L.dayjs(i).day(5).format("YYYY-MM-DD")===L.dayjs(v).day(5).format("YYYY-MM-DD"));break}case"8":{d=o.find(i=>L.dayjs(i).endOf("month").format("YYYY-MM-DD")===L.dayjs(a).endOf("month").format("YYYY-MM-DD")),x=o.findLast(i=>L.dayjs(i).endOf("month").format("YYYY-MM-DD")===L.dayjs(v).endOf("month").format("YYYY-MM-DD"));break}default:d=o.find(i=>{const c=L.dayjs(i).format("YYYY-MM-DD")===L.dayjs(a).format("YYYY-MM-DD"),S=new Date(i).getTime()>=new Date(a).getTime();return c&&S}),x=o.findLast(i=>{const c=L.dayjs(i).format("YYYY-MM-DD")===L.dayjs(v).format("YYYY-MM-DD"),S=new Date(i).getTime()<=new Date(v).getTime();return c&&S})}d&&x&&t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[d,x],xAxisIndex:0}]}),f=null})},te=async()=>{var o,a,v,d,x,i;try{if(!l.variety||!l.cycle)return;const{variety:c,featureId:S,cycle:B,indicatorStore:V,mainIndicator:h,right:T,startTime:P,endTime:W}=l,{defaultShowCounts:ne,addCounts:Z,showWarningLine:K,getFactorData:re}=I.value;pe(),t&&!t.isDisposed()&&t.showLoading({text:"加载中...",color:"#409eff",textColor:"#fff",maskColor:"rgba(0, 0, 0, 0.7)",zlevel:0});const j={variety:c,featureId:S,cycle:B,mainIndicatorList:V.getIndicatorParams(h),subIndicator:E.value,right:T,showWarningLine:K,getFactorData:re};P&&W?(j.startTime=P,j.endTime=W):P?(j.startTime=P,j.limit=Z):W?(j.endTime=W,j.limit=Z):(j.endTime=L.dayjs().add(1,"hour").format("YYYY-MM-DD HH:mm:ss"),j.limit=Z);const R=await Le(j);if(!((v=(a=(o=R==null?void 0:R.body)==null?void 0:o.kline)==null?void 0:a.time)!=null&&v.length)){k.value=!0,M.value=!1,ee();return}k.value=!1,M.value=!1,F.value=(d=R==null?void 0:R.body)==null?void 0:d.kline,_.value=((x=R==null?void 0:R.body)==null?void 0:x.warningLine)||[],await e.nextTick(),ae(!1),re&&Y("getFactorData",(i=R==null?void 0:R.body)==null?void 0:i.factor),ee()}catch(c){throw ee(),M.value=!0,k.value=!1,new Error(c)}},ge=async o=>{const{variety:a,cycle:v,indicatorStore:d,mainIndicator:x,right:i}=l,{addCounts:c}=I.value,{time:S}=F.value;if(o==="history"){const B=await Be({variety:a,cycle:v,endTime:S[0],limit:c,mainIndicatorList:d.getIndicatorParams(x),subIndicator:E.value,right:i});F.value={time:[...B.body.time,...F.value.time.slice(1)],data:[...B.body.data,...F.value.data.slice(1)],mainIndicator:F.value.mainIndicator.map((V,h)=>{var T;return{...V,data:[...((T=B.body.mainIndicator[h])==null?void 0:T.data)??[],...V.data.slice(1)]}}),subIndicator:F.value.subIndicator.map((V,h)=>{var T;return{...V,data:[...((T=B.body.subIndicator[h])==null?void 0:T.data)??[],...V.data.slice(1)]}})},console.log("触发了加载更多数据"),await e.nextTick(),ae(!0),B.body.data.length<c&&(g=!0,console.log("历史数据已经全部加载完毕")),p=!1}},le=({code:o,ctrlKey:a})=>{if(!(a||m.value))return;const{xAxis:v,dataZoom:d}=t.getOption(),{data:x}=(v==null?void 0:v[0])??{data:[]};let{startValue:i,endValue:c}=(d==null?void 0:d[0])??{};if(x!=null&&x.length){switch(o){case"ArrowUp":{if(c-i<5)return;const S=Math.floor((c-i)/2)+1;i=i+S,c-i<5&&(i=c-4);break}case"ArrowDown":{const S=Math.min(500,c-i);i=i-S-1;break}case"ArrowLeft":{i>0&&(i-=1,c-=1),A.value>0&&(A.value-=1);break}case"ArrowRight":{c<x.length-1&&(i+=1,c+=1),m.value&&A.value<x.length-1&&(A.value+=1);break}}requestAnimationFrame(()=>{t.dispatchAction({type:"dataZoom",startValue:i,endValue:c}),t.dispatchAction({type:"updateAxisPointer",seriesIndex:0,dataIndex:m.value?A.value:null}),t.dispatchAction({type:"highlight",dataIndex:m.value?A.value:c})})}},xe=()=>{t==null||t.on("datazoom",q.G(o=>{var v,d,x,i;const{loadCheckCounts:a}=I.value;if((d=(v=t==null?void 0:t.getOption())==null?void 0:v.dataZoom)!=null&&d[0]){const{startValue:c}=(i=(x=t==null?void 0:t.getOption())==null?void 0:x.dataZoom)==null?void 0:i[0];c<a&&!p&&!g&&(p=!0,ge("history")),H()}},100)),t==null||t.on("highlight",q.G(o=>{var v,d;let a=o.dataIndex||-1;o.batch&&(a=typeof((v=o==null?void 0:o.batch[0])==null?void 0:v.dataIndex)=="number"?(d=o==null?void 0:o.batch[0])==null?void 0:d.dataIndex:-1),A.value=a},20)),t==null||t.on("globalout",q.G(()=>{var o,a,v;if(t){const d=(v=(a=(o=t==null?void 0:t.getOption())==null?void 0:o.dataZoom)==null?void 0:a[0])==null?void 0:v.endValue;A.value=d}},30)),t==null||t.on("contextmenu",q.G(o=>{o.componentType==="graphic"&&(O.value=o.info,Q.value=[{label:"删除画线",key:"deleteWarningLine"},{label:"修改画线",key:"changeWarningLine"}])},0))},X=async()=>{const o=await qe({featureId:l.featureId});_.value=(o==null?void 0:o.body)||[],H(),Y("change","warningLine",_.value)},be=async o=>{const{variety:a,varietyName:v,featureId:d,featureType:x}=l;if(o.key==="drawWarningLine"){const i=t==null?void 0:t.getOption(),c=i.tooltip[0];t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:0},crossStyle:{width:2},label:{...c.axisPointer.label,backgroundColor:"transparent",formatter:()=>""}}}});const S=async B=>{t==null||t.getZr().off("mousedown",S);const V=t==null?void 0:t.convertFromPixel({yAxisIndex:0},B.offsetY),h=Math.round(V*1e3)/1e3;t==null||t.setOption({...i,tooltip:{...c,axisPointer:{...c.axisPointer,lineStyle:{width:1},crossStyle:{width:1},label:{...c.axisPointer.label,backgroundColor:null}}}}),await Fe({featureCode:a,featureName:v,featureId:d,featureType:x,warnPrice:h}),J.ElMessage.success("画线预警成功!"),X()};t==null||t.getZr().on("mousedown",S)}else o.key==="deleteWarningLine"?(await Ne({id:O.value.id}),J.ElMessage.success("画线预警删除成功"),X()):o.key==="changeWarningLine"&&($.value=!0,G.value=O.value.warnPrice)},_e=async()=>{const{variety:o,varietyName:a,featureId:v,featureType:d}=l;await ce({id:O.value.id,featureCode:o,featureName:a,featureId:v,featureType:d,warnPrice:G.value}),J.ElMessage.success("画线预警修改成功"),X()},he=()=>{Q.value=[...r]};return e.onMounted(()=>{Me(l.env),te(),window.addEventListener("keydown",le)}),e.watch(()=>{var o,a;return[l.variety,l.cycle,l.mainIndicator,E.value,(o=l.indicatorStore)==null?void 0:o.filterIndicator,(a=l.indicatorStore)==null?void 0:a.customIndicator]},()=>{p=!1,g=!1,te()},{deep:!0}),e.onUnmounted(()=>{y&&(cancelAnimationFrame(y),y=null),u&&(cancelAnimationFrame(u),u=null),t==null||t.off("datazoom"),t==null||t.off("highlight"),t==null||t.off("globalout"),t==null||t.dispose(),s==null||s.dispose(),window.removeEventListener("keydown",le)}),w({draw:(o,a)=>{o==="warningLine"&&(_.value=a,H())}}),(o,a)=>{var B,V;const v=ie.ElMenuItem,d=ie.ElMenu,x=De.ElEmpty,i=Ye.ElButton,c=we.ElInputNumber,S=ke.ElDialog;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"klineBasic",onMousemove:a[1]||(a[1]=h=>m.value=!0),onMouseout:a[2]||(a[2]=h=>m.value=!1)},[(B=F.value.time)!=null&&B.length?(e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(Ie,{variety:n.variety,data:F.value,activeIndex:A.value},null,8,["variety","data","activeIndex"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"klineBasic-main",style:e.normalizeStyle({height:I.value.showSubChart?"70%":"100%"})},[e.createVNode(Ke,{onCloseContextMenuCallBack:he},{popover:e.withCtx(()=>[e.createVNode(d,{style:{borderRadius:"4px",overflow:"hidden",background:"#fff",borderRight:0}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,h=>(e.openBlock(),e.createBlock(v,{style:{height:"36px"},key:h.key,index:h.key,onClick:T=>be(h)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label),1)]),_:2},1032,["index","onClick"]))),128))]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"klineBasicMainRef",ref:D,style:{height:"100%"}},null,512)]),_:1})],4),I.value.showSubChart?(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(Ue,{ref_key:"klineSubRef",ref:N,modelValue:E.value,"onUpdate:modelValue":a[0]||(a[0]=h=>E.value=h),data:F.value,cycle:n.cycle,activeIndex:A.value,subIndicatorList:(V=n.indicatorStore)==null?void 0:V.subIndicatorList},null,8,["modelValue","data","cycle","activeIndex","subIndicatorList"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",Je,[e.createVNode(x,{class:"klineBasic-empty-content",description:"暂无数据"})])):e.createCommentVNode("",!0),M.value?(e.openBlock(),e.createElementBlock("div",Qe,[et,e.createElementVNode("div",tt,[e.createVNode(i,{onClick:te},{default:e.withCtx(()=>[e.createTextVNode("刷新")]),_:1})])])):e.createCommentVNode("",!0)],32),e.createVNode(S,{modelValue:$.value,"onUpdate:modelValue":a[5]||(a[5]=h=>$.value=h),title:"画线预警-修改价格",width:"30%","align-center":""},{footer:e.withCtx(()=>[e.createElementVNode("span",ot,[e.createVNode(i,{onClick:a[4]||(a[4]=h=>$.value=!1)},{default:e.withCtx(()=>[e.createTextVNode("取消")]),_:1}),e.createVNode(i,{type:"primary",onClick:_e},{default:e.withCtx(()=>[e.createTextVNode("确定")]),_:1})])]),default:e.withCtx(()=>[nt,e.createVNode(c,{modelValue:G.value,"onUpdate:modelValue":a[3]||(a[3]=h=>G.value=h),placeholder:"输入预警价格"},null,8,["modelValue"])]),_:1},8,["modelValue"])],64)}}},lt=U._export_sfc(at,[["__scopeId","data-v-ae370bef"]]),rt={install(n){n.component("st-klineBasic",lt)}};module.exports=rt;
|
|
1
|
+
"use strict";
|