st-comp 0.0.232 → 0.0.233

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/KlineBasic.cjs CHANGED
@@ -1 +1 @@
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 L=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=>{L=V.offsetY},ondrag:V=>{var R;if(V.target&&V.target.childAt(1)){const T=n.convertFromPixel({yAxisIndex:0},_+(V.offsetY-L));(R=V.target.childAt(1))==null||R.animate("style",!1).when(1,{text:z(T,3)}).start()}},ondragend:async V=>{const T=V.offsetY-L;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+20}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-1ccf76bf"]]);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(L=>({label:L.key,color:L.color,value:`${L.data[h]}-${ce(L.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],L=h===0?a[h]:a[h-1];return _[0]===_[1]?_[0]>=L[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:L,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:L,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,L=ie.ElSelect;return e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("div",Oe,[g.value.length?(e.openBlock(),e.createElementBlock("div",$e,[e.createVNode(L,{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-9af636f9"]]),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),L=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(L.value),pe(),C.value.showSubChart&&V.value.connect(t),u=A.D(L.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:B,indicatorStore:D,mainIndicator:O,right:P,startTime:W,endTime:N}=r,{defaultShowCounts:F,addCounts:w,showWarningLine:te,getFactorData:G}=C.value,q={variety:c,featureId:S,cycle:B,mainIndicatorList:D.getIndicatorParams(O),subIndicator:R.value,right:P,showWarningLine:te,getFactorData:G};W&&N?(q.startTime=W,q.endTime=N):W?(q.startTime=W,q.limit=F+w):N?(q.endTime=N,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 B=await Me({variety:o,cycle:k,endTime:S[0],limit:c,mainIndicatorList:y.getIndicatorParams(v),subIndicator:R.value,right:i});E.value={time:[...B.body.time,...E.value.time.slice(1)],data:[...B.body.data,...E.value.data.slice(1)],mainIndicator:E.value.mainIndicator.map((D,O)=>{var P;return{...D,data:[...((P=B.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=B.body.subIndicator[O])==null?void 0:P.data)??[],...D.data.slice(1)]}})},ae(!0),B.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,B=o.length-1;if(s){const N=t.getOption(),F=(P=(O=N==null?void 0:N.xAxis)==null?void 0:O[0])==null?void 0:P.data,w=(W=N==null?void 0:N.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),B=o.findIndex(q=>q===G)}const D=Le(E.value,C.value,S,B,r.cycle);if(t.setOption(D,!0),T.value=B,r.brushRange){let N=null,F=null;switch(r.cycle){case"6":{N=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":{N=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":{N=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:N=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(N,F),t.dispatchAction({type:"brush",areas:[{brushType:"lineX",coordRange:[N,F],xAxisIndex:0}]})}c&&V.value.draw({startValue:S,endValue:B,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:B=>""}}}});const S=async B=>{t==null||t.getZr().off("mousedown",S);const D=t==null?void 0:t.convertFromPixel({yAxisIndex:0},B.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 B;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:L,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:(B=n.indicatorStore)==null?void 0:B.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+20}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-1ccf76bf"]]);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,14 +1,14 @@
1
1
  import "./base-a5af3db3.js";
2
- import { E as $e } from "./el-dialog-41ab8417.js";
2
+ import { E as Be } from "./el-dialog-41ab8417.js";
3
3
  import "./el-overlay-09ad71cd.js";
4
4
  import "./el-input-2f75c4ba.js";
5
- import { E as Be } from "./el-input-number-5193fe6d.js";
6
- import { E as Oe } from "./el-button-c95adb85.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
8
  import { E as Pe, a as We } from "./el-menu-item-7e881203.js";
9
9
  import "./el-tooltip-4ed993c7.js";
10
10
  import "./el-popper-b4f97157.js";
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 $, 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";
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";
@@ -155,7 +155,7 @@ const Ge = (n) => {
155
155
  const { warnPrice: b } = o, x = n == null ? void 0 : n.convertToPixel({ yAxisIndex: 0 }, b);
156
156
  if (x <= g || x >= (n == null ? void 0 : n.getHeight()))
157
157
  return a;
158
- let A = 0;
158
+ let V = 0;
159
159
  return [
160
160
  ...a,
161
161
  {
@@ -201,18 +201,18 @@ const Ge = (n) => {
201
201
  ],
202
202
  // 事件:开始拖拽
203
203
  ondragstart: (S) => {
204
- A = S.offsetY;
204
+ V = S.offsetY;
205
205
  },
206
206
  ondrag: (S) => {
207
207
  var N;
208
208
  if (S.target && S.target.childAt(1)) {
209
- const L = n.convertFromPixel({ yAxisIndex: 0 }, x + (S.offsetY - A));
209
+ const L = n.convertFromPixel({ yAxisIndex: 0 }, x + (S.offsetY - V));
210
210
  (N = S.target.childAt(1)) == null || N.animate("style", !1).when(1, { text: Z(L, 3) }).start();
211
211
  }
212
212
  },
213
213
  // 事件:结束拖拽
214
214
  ondragend: async (S) => {
215
- const L = S.offsetY - A;
215
+ const L = S.offsetY - V;
216
216
  if (L !== 0) {
217
217
  const I = n == null ? void 0 : n.convertFromPixel({ yAxisIndex: 0 }, L + x), p = {
218
218
  id: o.id,
@@ -339,8 +339,8 @@ const lt = { class: "kline-tips" }, it = {
339
339
  return ((f = c == null ? void 0 : c.mainIndicator) == null ? void 0 : f.map((y) => ({ label: y.key, value: Te(y.data[g]), color: y.color }))) || [];
340
340
  });
341
341
  return (c, g) => (F(), E("div", lt, [
342
- $(we, { data: e.value }, null, 8, ["data"]),
343
- $(we, { data: k.value }, null, 8, ["data"])
342
+ B(we, { data: e.value }, null, 8, ["data"]),
343
+ B(we, { data: k.value }, null, 8, ["data"])
344
344
  ]));
345
345
  }
346
346
  }, st = /* @__PURE__ */ G(it, [["__scopeId", "data-v-5be4d504"]]), ut = { class: "kline-averageTips" }, ct = /* @__PURE__ */ ve({
@@ -395,7 +395,7 @@ const ft = { class: "klineSub" }, pt = { class: "klineSub-tips" }, mt = {
395
395
  }), y = ne(() => {
396
396
  var x;
397
397
  const { data: o, activeIndex: b } = c;
398
- return ((x = o == null ? void 0 : o.subIndicator) == null ? void 0 : x.map((A) => ({ label: A.key, color: A.color, value: `${A.data[b]}-${Te(A.data[b])}` }))) || [];
398
+ return ((x = o == null ? void 0 : o.subIndicator) == null ? void 0 : x.map((V) => ({ label: V.key, color: V.color, value: Te(V.data[b]) }))) || [];
399
399
  });
400
400
  De(() => {
401
401
  s = ye.init(g.value);
@@ -411,8 +411,8 @@ const ft = { class: "klineSub" }, pt = { class: "klineSub-tips" }, mt = {
411
411
  s.dispose(), e.disconnect(), e = null;
412
412
  });
413
413
  const a = (o, b) => {
414
- const x = o[b], A = b === 0 ? o[b] : o[b - 1];
415
- return x[0] === x[1] ? x[0] >= A[1] ? {
414
+ const x = o[b], V = b === 0 ? o[b] : o[b - 1];
415
+ return x[0] === x[1] ? x[0] >= V[1] ? {
416
416
  color: "transparent",
417
417
  borderColor: "#FF0000"
418
418
  } : {
@@ -431,7 +431,7 @@ const ft = { class: "klineSub" }, pt = { class: "klineSub-tips" }, mt = {
431
431
  // 联动
432
432
  draw: (o, b) => {
433
433
  ge(() => {
434
- const { startValue: x, endValue: A, maxValueSpan: S } = o, { leftYAxisRange: N, rightYAxisRange: L } = c.data.subIndicator[0], I = c.data.subIndicator.map((p) => {
434
+ const { startValue: x, endValue: V, maxValueSpan: S } = o, { leftYAxisRange: N, rightYAxisRange: L } = c.data.subIndicator[0], I = c.data.subIndicator.map((p) => {
435
435
  if (p.series === "bar")
436
436
  return {
437
437
  name: "subMain",
@@ -485,7 +485,7 @@ const ft = { class: "klineSub" }, pt = { class: "klineSub-tips" }, mt = {
485
485
  {
486
486
  type: "inside",
487
487
  startValue: x,
488
- endValue: A,
488
+ endValue: V,
489
489
  maxValueSpan: S
490
490
  }
491
491
  ],
@@ -565,11 +565,11 @@ const ft = { class: "klineSub" }, pt = { class: "klineSub-tips" }, mt = {
565
565
  }
566
566
  // 重置
567
567
  }), (o, b) => {
568
- const x = Ze, A = Xe;
568
+ const x = Ze, V = Xe;
569
569
  return F(), E("div", ft, [
570
570
  U("div", pt, [
571
571
  y.value.length ? (F(), E("div", mt, [
572
- $(A, {
572
+ B(V, {
573
573
  modelValue: f.value,
574
574
  "onUpdate:modelValue": b[0] || (b[0] = (S) => f.value = S),
575
575
  size: "small",
@@ -586,7 +586,7 @@ const ft = { class: "klineSub" }, pt = { class: "klineSub-tips" }, mt = {
586
586
  _: 1
587
587
  }, 8, ["modelValue"])
588
588
  ])) : Q("", !0),
589
- $(dt, { data: y.value }, null, 8, ["data"])
589
+ B(dt, { data: y.value }, null, 8, ["data"])
590
590
  ]),
591
591
  U("div", {
592
592
  class: "klineSub-chart",
@@ -596,7 +596,7 @@ const ft = { class: "klineSub" }, pt = { class: "klineSub-tips" }, mt = {
596
596
  ]);
597
597
  };
598
598
  }
599
- }, vt = /* @__PURE__ */ G(yt, [["__scopeId", "data-v-9af636f9"]]), gt = /* @__PURE__ */ ve({
599
+ }, vt = /* @__PURE__ */ G(yt, [["__scopeId", "data-v-a6bfe8fe"]]), gt = /* @__PURE__ */ ve({
600
600
  __name: "index",
601
601
  emits: ["closeContextMenuCallBack"],
602
602
  setup(n, { emit: D }) {
@@ -722,7 +722,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
722
722
  setup(n, { expose: D, emit: Y }) {
723
723
  const l = [{ label: "画线预警", key: "drawWarningLine" }];
724
724
  let s = null, e = null, k, c, g = !1, f = !1;
725
- const y = Y, a = n, o = T(!1), b = T(!1), x = T(!1), A = T(null), S = T(null), N = T("VOL"), L = T(0), I = T({}), p = T([]), W = T({}), C = T(!1), ae = T(""), fe = T([...l]), H = ne(() => ({
725
+ const y = Y, a = n, o = T(!1), b = T(!1), x = T(!1), V = T(null), S = T(null), N = T("VOL"), L = T(0), I = T({}), p = T([]), W = T({}), C = T(!1), ae = T(""), fe = T([...l]), H = ne(() => ({
726
726
  defaultShowCounts: 500,
727
727
  // 默认展示条数
728
728
  addCounts: 2e3,
@@ -760,7 +760,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
760
760
  e == null || e.off("datazoom"), e == null || e.off("highlight"), e == null || e.off("globalout"), e == null || e.dispose(), s == null || s.dispose(), window.removeEventListener("keydown", xe);
761
761
  });
762
762
  const Fe = () => {
763
- e || (e = ye.init(A.value), Ae(), H.value.showSubChart && S.value.connect(e), s = je(A.value), s.listen(() => {
763
+ e || (e = ye.init(V.value), Ae(), H.value.showSubChart && S.value.connect(e), s = je(V.value), s.listen(() => {
764
764
  requestAnimationFrame(() => {
765
765
  e.resize();
766
766
  });
@@ -845,18 +845,18 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
845
845
  try {
846
846
  if (!a.variety || !a.cycle)
847
847
  return;
848
- const { variety: u, featureId: M, cycle: R, indicatorStore: w, mainIndicator: q, right: z, startTime: j, endTime: V } = a, { defaultShowCounts: B, addCounts: _, showWarningLine: me, getFactorData: ie } = H.value, O = {
848
+ const { variety: u, featureId: M, cycle: A, indicatorStore: w, mainIndicator: q, right: z, startTime: j, endTime: R } = a, { defaultShowCounts: O, addCounts: _, showWarningLine: me, getFactorData: ie } = H.value, $ = {
849
849
  variety: u,
850
850
  featureId: M,
851
- cycle: R,
851
+ cycle: A,
852
852
  mainIndicatorList: w.getIndicatorParams(q),
853
853
  subIndicator: N.value,
854
854
  right: z,
855
855
  showWarningLine: me,
856
856
  getFactorData: ie
857
857
  };
858
- j && V ? (O.startTime = j, O.endTime = V) : j ? (O.startTime = j, O.limit = B + _) : V ? (O.endTime = V, O.limit = B + _) : (O.endTime = d().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), O.limit = B + _);
859
- const P = await Je(O);
858
+ j && R ? ($.startTime = j, $.endTime = R) : j ? ($.startTime = j, $.limit = O + _) : R ? ($.endTime = R, $.limit = O + _) : ($.endTime = d().add(1, "hour").format("YYYY-MM-DD HH:mm:ss"), $.limit = O + _);
859
+ const P = await Je($);
860
860
  if ((h = (t = (i = P == null ? void 0 : P.body) == null ? void 0 : i.kline) == null ? void 0 : t.time) != null && h.length)
861
861
  b.value = !1, x.value = !1;
862
862
  else {
@@ -870,7 +870,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
870
870
  }, Re = async (i) => {
871
871
  const { variety: t, cycle: h, indicatorStore: m, mainIndicator: v, right: r } = a, { addCounts: u } = H.value, { time: M } = I.value;
872
872
  if (i === "history") {
873
- const R = await Qe({
873
+ const A = await Qe({
874
874
  variety: t,
875
875
  cycle: h,
876
876
  endTime: M[0],
@@ -880,64 +880,64 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
880
880
  right: r
881
881
  });
882
882
  I.value = {
883
- time: [...R.body.time, ...I.value.time.slice(1)],
884
- data: [...R.body.data, ...I.value.data.slice(1)],
883
+ time: [...A.body.time, ...I.value.time.slice(1)],
884
+ data: [...A.body.data, ...I.value.data.slice(1)],
885
885
  mainIndicator: I.value.mainIndicator.map((w, q) => {
886
886
  var z;
887
887
  return {
888
888
  ...w,
889
- data: [...((z = R.body.mainIndicator[q]) == null ? void 0 : z.data) ?? [], ...w.data.slice(1)]
889
+ data: [...((z = A.body.mainIndicator[q]) == null ? void 0 : z.data) ?? [], ...w.data.slice(1)]
890
890
  };
891
891
  }),
892
892
  subIndicator: I.value.subIndicator.map((w, q) => {
893
893
  var z;
894
894
  return {
895
895
  ...w,
896
- data: [...((z = R.body.subIndicator[q]) == null ? void 0 : z.data) ?? [], ...w.data.slice(1)]
896
+ data: [...((z = A.body.subIndicator[q]) == null ? void 0 : z.data) ?? [], ...w.data.slice(1)]
897
897
  };
898
898
  })
899
- }, he(!0), R.body.data.length < u && (f = !0), g = !1;
899
+ }, he(!0), A.body.data.length < u && (f = !0), g = !1;
900
900
  }
901
901
  }, he = (i = !1) => {
902
902
  var q, z, j;
903
903
  Fe();
904
904
  const { time: t } = I.value, { gridRight: h, gridLeft: m, defaultShowCounts: v, maxShowCounts: r, showSubChart: u } = H.value;
905
- let M = t.length - 1 - v, R = t.length - 1;
905
+ let M = t.length - 1 - v, A = t.length - 1;
906
906
  if (i) {
907
- const V = e.getOption(), B = (z = (q = V == null ? void 0 : V.xAxis) == null ? void 0 : q[0]) == null ? void 0 : z.data, _ = (j = V == null ? void 0 : V.dataZoom) == null ? void 0 : j[0], me = B[_ == null ? void 0 : _.startValue], ie = B[_ == null ? void 0 : _.endValue];
908
- M = t.findIndex((O) => O === me), R = t.findIndex((O) => O === ie);
907
+ const R = e.getOption(), O = (z = (q = R == null ? void 0 : R.xAxis) == null ? void 0 : q[0]) == null ? void 0 : z.data, _ = (j = R == null ? void 0 : R.dataZoom) == null ? void 0 : j[0], me = O[_ == null ? void 0 : _.startValue], ie = O[_ == null ? void 0 : _.endValue];
908
+ M = t.findIndex(($) => $ === me), A = t.findIndex(($) => $ === ie);
909
909
  }
910
- const w = ot(I.value, H.value, M, R, a.cycle);
911
- if (e.setOption(w, !0), L.value = R, a.brushRange) {
912
- let V = null, B = null;
910
+ const w = ot(I.value, H.value, M, A, a.cycle);
911
+ if (e.setOption(w, !0), L.value = A, a.brushRange) {
912
+ let R = null, O = null;
913
913
  switch (a.cycle) {
914
914
  case "6": {
915
- V = t.find((_) => new Date(_).getTime() >= new Date(a.brushRange[0]).getTime() || d(_).format("YYYY-MM-DD") === d(a.brushRange[0]).format("YYYY-MM-DD")), B = t.findLast((_) => new Date(_).getTime() <= new Date(a.brushRange[1]).getTime() || d(_).format("YYYY-MM-DD") === d(a.brushRange[1]).format("YYYY-MM-DD"));
915
+ R = t.find((_) => new Date(_).getTime() >= new Date(a.brushRange[0]).getTime() || d(_).format("YYYY-MM-DD") === d(a.brushRange[0]).format("YYYY-MM-DD")), O = t.findLast((_) => new Date(_).getTime() <= new Date(a.brushRange[1]).getTime() || d(_).format("YYYY-MM-DD") === d(a.brushRange[1]).format("YYYY-MM-DD"));
916
916
  break;
917
917
  }
918
918
  case "7": {
919
- V = t.find((_) => d(_).day(5).format("YYYY-MM-DD") === d(a.brushRange[0]).day(5).format("YYYY-MM-DD")), B = t.findLast((_) => d(_).day(5).format("YYYY-MM-DD") === d(a.brushRange[1]).day(5).format("YYYY-MM-DD"));
919
+ R = t.find((_) => d(_).day(5).format("YYYY-MM-DD") === d(a.brushRange[0]).day(5).format("YYYY-MM-DD")), O = t.findLast((_) => d(_).day(5).format("YYYY-MM-DD") === d(a.brushRange[1]).day(5).format("YYYY-MM-DD"));
920
920
  break;
921
921
  }
922
922
  case "8": {
923
- V = t.find((_) => d(_).endOf("month").format("YYYY-MM-DD") === d(a.brushRange[0]).endOf("month").format("YYYY-MM-DD")), B = t.findLast((_) => d(_).endOf("month").format("YYYY-MM-DD") === d(a.brushRange[1]).endOf("month").format("YYYY-MM-DD"));
923
+ R = t.find((_) => d(_).endOf("month").format("YYYY-MM-DD") === d(a.brushRange[0]).endOf("month").format("YYYY-MM-DD")), O = t.findLast((_) => d(_).endOf("month").format("YYYY-MM-DD") === d(a.brushRange[1]).endOf("month").format("YYYY-MM-DD"));
924
924
  break;
925
925
  }
926
926
  default:
927
- V = t.find((_) => new Date(_).getTime() >= new Date(a.brushRange[0]).getTime()), B = t.findLast((_) => new Date(_).getTime() <= new Date(a.brushRange[1]).getTime());
927
+ R = t.find((_) => new Date(_).getTime() >= new Date(a.brushRange[0]).getTime()), O = t.findLast((_) => new Date(_).getTime() <= new Date(a.brushRange[1]).getTime());
928
928
  }
929
- console.log(V, B), e.dispatchAction({
929
+ console.log(R, O), e.dispatchAction({
930
930
  type: "brush",
931
931
  areas: [
932
932
  {
933
933
  brushType: "lineX",
934
- coordRange: [V, B],
934
+ coordRange: [R, O],
935
935
  xAxisIndex: 0
936
936
  }
937
937
  ]
938
938
  });
939
939
  }
940
- u && S.value.draw({ startValue: M, endValue: R, maxValueSpan: r }, { gridLeft: m, gridRight: h }), _e();
940
+ u && S.value.draw({ startValue: M, endValue: A, maxValueSpan: r }, { gridLeft: m, gridRight: h }), _e();
941
941
  }, re = () => {
942
942
  if (!e)
943
943
  return;
@@ -1021,14 +1021,14 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1021
1021
  // 颜色改为透明
1022
1022
  backgroundColor: "transparent",
1023
1023
  // 仅显示Y轴值
1024
- formatter: (R) => ""
1024
+ formatter: (A) => ""
1025
1025
  }
1026
1026
  }
1027
1027
  }
1028
1028
  });
1029
- const M = async (R) => {
1029
+ const M = async (A) => {
1030
1030
  e == null || e.getZr().off("mousedown", M);
1031
- const w = e == null ? void 0 : e.convertFromPixel({ yAxisIndex: 0 }, R.offsetY), q = Math.round(w * 1e3) / 1e3;
1031
+ const w = e == null ? void 0 : e.convertFromPixel({ yAxisIndex: 0 }, A.offsetY), q = Math.round(w * 1e3) / 1e3;
1032
1032
  e == null || e.setOption({
1033
1033
  ...r,
1034
1034
  // 指示器样式
@@ -1085,8 +1085,8 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1085
1085
  i === "warningLine" && (p.value = t, re());
1086
1086
  }
1087
1087
  }), (i, t) => {
1088
- var R;
1089
- const h = Pe, m = We, v = Ne, r = Oe, u = Be, M = $e;
1088
+ var A;
1089
+ const h = Pe, m = We, v = Ne, r = $e, u = Oe, M = Be;
1090
1090
  return F(), E(ee, null, [
1091
1091
  U("div", {
1092
1092
  class: "klineBasic",
@@ -1094,7 +1094,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1094
1094
  onMouseout: t[2] || (t[2] = (w) => o.value = !1)
1095
1095
  }, [
1096
1096
  U("div", xt, [
1097
- $(st, {
1097
+ B(st, {
1098
1098
  variety: n.variety,
1099
1099
  data: I.value,
1100
1100
  activeIndex: L.value
@@ -1104,9 +1104,9 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1104
1104
  class: "klineBasic-main",
1105
1105
  style: de({ height: H.value.showSubChart ? "70%" : "100%" })
1106
1106
  }, [
1107
- $(bt, { onCloseContextMenuCallBack: Ie }, {
1107
+ B(bt, { onCloseContextMenuCallBack: Ie }, {
1108
1108
  popover: K(() => [
1109
- $(m, { style: {
1109
+ B(m, { style: {
1110
1110
  borderRadius: "4px",
1111
1111
  overflow: "hidden",
1112
1112
  background: "#fff",
@@ -1131,7 +1131,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1131
1131
  default: K(() => [
1132
1132
  U("div", {
1133
1133
  ref_key: "klineBasicMainRef",
1134
- ref: A,
1134
+ ref: V,
1135
1135
  style: { height: "100%" }
1136
1136
  }, null, 512)
1137
1137
  ]),
@@ -1139,7 +1139,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1139
1139
  })
1140
1140
  ], 4),
1141
1141
  H.value.showSubChart ? (F(), E("div", ht, [
1142
- $(vt, {
1142
+ B(vt, {
1143
1143
  ref_key: "klineSubRef",
1144
1144
  ref: S,
1145
1145
  modelValue: N.value,
@@ -1147,11 +1147,11 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1147
1147
  data: I.value,
1148
1148
  cycle: n.cycle,
1149
1149
  activeIndex: L.value,
1150
- subIndicatorList: (R = n.indicatorStore) == null ? void 0 : R.subIndicatorList
1150
+ subIndicatorList: (A = n.indicatorStore) == null ? void 0 : A.subIndicatorList
1151
1151
  }, null, 8, ["modelValue", "data", "cycle", "activeIndex", "subIndicatorList"])
1152
1152
  ])) : Q("", !0),
1153
1153
  b.value ? (F(), E("div", _t, [
1154
- $(v, {
1154
+ B(v, {
1155
1155
  class: "klineBasic-empty-content",
1156
1156
  description: "暂无数据"
1157
1157
  })
@@ -1159,7 +1159,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1159
1159
  x.value ? (F(), E("div", Yt, [
1160
1160
  wt,
1161
1161
  U("div", Dt, [
1162
- $(r, { onClick: pe }, {
1162
+ B(r, { onClick: pe }, {
1163
1163
  default: K(() => [
1164
1164
  se("刷新")
1165
1165
  ]),
@@ -1168,7 +1168,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1168
1168
  ])
1169
1169
  ])) : Q("", !0)
1170
1170
  ], 32),
1171
- $(M, {
1171
+ B(M, {
1172
1172
  modelValue: C.value,
1173
1173
  "onUpdate:modelValue": t[5] || (t[5] = (w) => C.value = w),
1174
1174
  title: "画线预警-修改价格",
@@ -1177,7 +1177,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1177
1177
  }, {
1178
1178
  footer: K(() => [
1179
1179
  U("span", Mt, [
1180
- $(r, {
1180
+ B(r, {
1181
1181
  onClick: t[4] || (t[4] = (w) => C.value = !1)
1182
1182
  }, {
1183
1183
  default: K(() => [
@@ -1185,7 +1185,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1185
1185
  ]),
1186
1186
  _: 1
1187
1187
  }),
1188
- $(r, {
1188
+ B(r, {
1189
1189
  type: "primary",
1190
1190
  onClick: Ee
1191
1191
  }, {
@@ -1198,7 +1198,7 @@ const Le = (n) => (qe("data-v-e675b051"), n = n(), Ce(), n), xt = { class: "klin
1198
1198
  ]),
1199
1199
  default: K(() => [
1200
1200
  kt,
1201
- $(u, {
1201
+ B(u, {
1202
1202
  modelValue: ae.value,
1203
1203
  "onUpdate:modelValue": t[3] || (t[3] = (w) => ae.value = w),
1204
1204
  placeholder: "输入预警价格"
@@ -1,5 +1,5 @@
1
- "use strict";require("./base-ef747d02.cjs");const v=require("./el-input-7fd293af.cjs");require("./el-tooltip-0ea8fbf8.cjs");const q=require("./el-popper-b6c99b28.cjs"),e=require("vue"),i=require("./index-098c2447.cjs"),V=require("./el-message-5e6a6be9.cjs"),f=require("./_plugin-vue_export-helper-f246444f.cjs");require("./use-form-common-props-fd9b61a0.cjs");require("./index-9780a537.cjs");require("./typescript-b63f8e83.cjs");require("./index-11547a0c.cjs");require("./use-global-config-30d7d8ce.cjs");require("./index-bb833443.cjs");require("./index-c108567d.cjs");require("./config-provider-a584d81e.cjs");const c=r=>(e.pushScopeId("data-v-445e2903"),r=r(),e.popScopeId(),r),h={class:"variety-text-copy"},y={class:"stats-container"},N={class:"stat-item"},g=c(()=>e.createElementVNode("span",{class:"label"},"品种数量统计:",-1)),E={class:"value"},C=c(()=>e.createElementVNode("br",null,null,-1)),I=c(()=>e.createElementVNode("br",null,null,-1)),w={__name:"index",props:{required:{type:Boolean,default:!0}},setup(r,{expose:u}){const d=e.inject("stConfig"),p=r,o=e.ref(""),_=e.computed(()=>l(o.value).length),l=n=>n?n.split(`
2
- `).reduce((s,a)=>{const t=a.trim().replace(/\s+/gi," ").split(" ")[0];return t&&s.push(t),s},[]):[];return u({validate:n=>new Promise(async(s,a)=>{try{if(p.required&&(!o.value||o.value.trim()===""))return V.ElMessage.error("品种内容不可为空"),n(!1);const{body:t}=await d.request.post("/invest/analysis/strategy/verifyCodes",{codes:l(o.value)});return n(!0,t)}catch(t){return a(t)}})}),(n,s)=>{const a=i.ElIcon,t=q.ElTooltip,x=v.ElInput;return e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",y,[e.createElementVNode("div",N,[g,e.createElementVNode("span",E,e.toDisplayString(_.value),1),e.createVNode(t,{class:"box-item",effect:"dark",placement:"right"},{content:e.withCtx(()=>[e.createTextVNode(" 仅统计符合输入格式的数量, 输入格式示例(代码和名称需空格隔开, 名称可不写):"),C,e.createTextVNode("hc8888 热轧卷板期货指数 "),I,e.createTextVNode("sp8888 纸浆期货指数")]),default:e.withCtx(()=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.info_filled_default))]),_:1})]),_:1})])]),e.createVNode(x,{class:"textarea",modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=m=>o.value=m),resize:"none",type:"textarea",placeholder:`文本格式要求示例:
1
+ "use strict";require("./base-ef747d02.cjs");const v=require("./el-input-7fd293af.cjs");require("./el-tooltip-0ea8fbf8.cjs");const q=require("./el-popper-b6c99b28.cjs"),e=require("vue"),i=require("./index-098c2447.cjs"),V=require("./_plugin-vue_export-helper-f246444f.cjs"),f=require("./el-message-5e6a6be9.cjs");require("./use-form-common-props-fd9b61a0.cjs");require("./index-9780a537.cjs");require("./typescript-b63f8e83.cjs");require("./index-11547a0c.cjs");require("./use-global-config-30d7d8ce.cjs");require("./index-bb833443.cjs");require("./index-c108567d.cjs");require("./config-provider-a584d81e.cjs");const c=r=>(e.pushScopeId("data-v-445e2903"),r=r(),e.popScopeId(),r),h={class:"variety-text-copy"},y={class:"stats-container"},N={class:"stat-item"},g=c(()=>e.createElementVNode("span",{class:"label"},"品种数量统计:",-1)),E={class:"value"},C=c(()=>e.createElementVNode("br",null,null,-1)),I=c(()=>e.createElementVNode("br",null,null,-1)),w={__name:"index",props:{required:{type:Boolean,default:!0}},setup(r,{expose:u}){const d=e.inject("stConfig"),p=r,o=e.ref(""),_=e.computed(()=>l(o.value).length),l=n=>n?n.split(`
2
+ `).reduce((s,a)=>{const t=a.trim().replace(/\s+/gi," ").split(" ")[0];return t&&s.push(t),s},[]):[];return u({validate:n=>new Promise(async(s,a)=>{try{if(p.required&&(!o.value||o.value.trim()===""))return f.ElMessage.error("品种内容不可为空"),n(!1);const{body:t}=await d.request.post("/invest/analysis/strategy/verifyCodes",{codes:l(o.value)});return n(!0,t)}catch(t){return a(t)}})}),(n,s)=>{const a=i.ElIcon,t=q.ElTooltip,x=v.ElInput;return e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",y,[e.createElementVNode("div",N,[g,e.createElementVNode("span",E,e.toDisplayString(_.value),1),e.createVNode(t,{class:"box-item",effect:"dark",placement:"right"},{content:e.withCtx(()=>[e.createTextVNode(" 仅统计符合输入格式的数量, 输入格式示例(代码和名称需空格隔开, 名称可不写):"),C,e.createTextVNode("hc8888 热轧卷板期货指数 "),I,e.createTextVNode("sp8888 纸浆期货指数")]),default:e.withCtx(()=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.info_filled_default))]),_:1})]),_:1})])]),e.createVNode(x,{class:"textarea",modelValue:o.value,"onUpdate:modelValue":s[0]||(s[0]=m=>o.value=m),resize:"none",type:"textarea",placeholder:`文本格式要求示例:
3
3
  hc8888  热轧卷板期货指数
4
4
  sp8888  纸浆期货指数
5
- bu8888  石油沥青期货指数`},null,8,["modelValue"])])}}},S=f._export_sfc(w,[["__scopeId","data-v-445e2903"]]),T={install(r){r.component("st-varietyTextCopy",S)}};module.exports=T;
5
+ bu8888  石油沥青期货指数`},null,8,["modelValue"])])}}},S=V._export_sfc(w,[["__scopeId","data-v-445e2903"]]),T={install(r){r.component("st-varietyTextCopy",S)}};module.exports=T;
@@ -4,8 +4,8 @@ import "./el-tooltip-4ed993c7.js";
4
4
  import { E as h } from "./el-popper-b4f97157.js";
5
5
  import { inject as g, ref as E, computed as C, openBlock as V, createElementBlock as I, createElementVNode as n, toDisplayString as S, createVNode as i, withCtx as l, createTextVNode as c, unref as b, pushScopeId as w, popScopeId as T } from "vue";
6
6
  import { i as q, E as B } from "./index-a871c3eb.js";
7
- import { E as N } from "./el-message-e544a8f5.js";
8
- import { _ as k } from "./_plugin-vue_export-helper-dad06003.js";
7
+ import { _ as N } from "./_plugin-vue_export-helper-dad06003.js";
8
+ import { E as k } from "./el-message-e544a8f5.js";
9
9
  import "./use-form-common-props-815d48a6.js";
10
10
  import "./index-960806da.js";
11
11
  import "./typescript-7ae59c4c.js";
@@ -28,7 +28,7 @@ const p = (t) => (w("data-v-445e2903"), t = t(), T(), t), j = { class: "variety-
28
28
  return d({ validate: (s) => new Promise(async (r, a) => {
29
29
  try {
30
30
  if (m.required && (!o.value || o.value.trim() === ""))
31
- return N.error("品种内容不可为空"), s(!1);
31
+ return k.error("品种内容不可为空"), s(!1);
32
32
  const { body: e } = await _.request.post("/invest/analysis/strategy/verifyCodes", { codes: u(o.value) });
33
33
  return s(!0, e);
34
34
  } catch (e) {
@@ -79,7 +79,7 @@ bu8888  石油沥青期货指数`
79
79
  ]);
80
80
  };
81
81
  }
82
- }, G = /* @__PURE__ */ k(A, [["__scopeId", "data-v-445e2903"]]), ne = {
82
+ }, G = /* @__PURE__ */ N(A, [["__scopeId", "data-v-445e2903"]]), ne = {
83
83
  install(t) {
84
84
  t.component("st-varietyTextCopy", G);
85
85
  }