"use strict";const t=require("../../../common/vendor.js"),e=require("../../../request/api.js"),o=require("../../../utils/util.js"),i=require("../../../common/assets.js"),a=require("../../../uni_modules/lime-echart/static/echarts.min.js"),s={data:()=>({navH:t.inject("navHeight"),contentTop:"",navTitle:"",type:"",eventId:"",stockCode:"",categoryList:["分时图","日K线"],selectCategory:0,option:{title:{show:!1},tooltip:{position:function(t,e,o,i,a){var s={top:"10%"};return s[["left","right"][+(t[0]{if(200==e.code){this.navTitle=e.data.basic_info.stock_name+"("+e.data.basic_info.stock_code+")";let t=e.data.minute_chart_data,a=[],s=[],n=t[0].open;for(let e of t){a.push(e.time);let t=o.accMul(o.accDiv(o.accSub(e.close,n),n).toFixed(4),100);s.push([e.time,e.close,e.high,e.open,e.low,t])}let r=n,c=0;for(let e of s){let t=e[1];parseFloat(t)c&&(c=parseFloat(t))}let l=(n-r)/3,d=(c-n)/3,h=[];if(l>d){for(var i=3;i>0;i--)h.push(n-i*l);for(i=0;i<4;i++)h.push(n+i*l)}else{for(i=3;i>0;i--)h.push(n-i*d);for(i=0;i<4;i++)h.push(n+i*d)}this.option1.xAxis.data=a,this.option1.yAxis.min=h[0].toFixed(2),this.option1.yAxis.max=h[h.length-1].toFixed(2),this.option1.series.data=s;let p=[],y=e.data.event_info;for(let e of h)p.push({xAxis:y,lineStyle:{type:"solid",width:1,color:"#ffd700"},label:{position:"middle",formatter:"事件发生",color:"#ffd700"}},{yAxis:e,label:{show:!0,position:"start",color:"#333"}},{yAxis:e,label:{show:!0,position:"end",formatter:o.accMul(o.accDiv(o.accSub(e,n),n).toFixed(4),100)+"%",color:"#333"}});this.option1.series.markLine.data=p;let m=e.data.related_desc;m&&(this.relatedDesc=m.relation_desc,m.retrieved_sources&&(this.sourceList=m.retrieved_sources)),this.init()}else t.index.showToast({title:e.message,icon:"none"})})).catch((t=>{}))},getStockCandlestickChartData(){let t=this.stockCode,o={chart_type:"minute"};1==this.selectCategory&&(o.chart_type="daily"),e.stockCandlestickChartData(t,o).then((t=>{let e=t.data,o=[],i=[];for(let a of e)o.push(a.time),i.push([a.open,a.close,a.low,a.high]);this.option.xAxis.data=o,this.option.series[0].data=i,this.init()})).catch((t=>{}))}}};if(!Array){(t.resolveComponent("navBar")+t.resolveComponent("l-echart"))()}Math||((()=>"../../../components/navBar/navBar.js")+(()=>"../../../uni_modules/lime-echart/components/l-echart/l-echart.js"))();const n=t._export_sfc(s,[["render",function(e,o,a,s,n,r){return t.e({a:t.p({leftText:n.navTitle}),b:i._imports_0,c:1==n.type},1==n.type?{d:t.f(n.categoryList,((e,o,i)=>t.e({a:t.t(e),b:n.selectCategory==o},(n.selectCategory,{}),{c:t.n("item relative "+(n.selectCategory==o?"select":"")),d:o,e:t.o((t=>r.clickCategoryItem(o)),o)}))),e:t.s("top:"+n.navH+"px;")}:{},{f:1==n.type},1==n.type?{g:t.sr("chartRef","ab03f7e6-1")}:{},{h:t.t(n.relatedDesc),i:1==n.type&&n.sourceList.length>0},(1==n.type&&n.sourceList.length,{}),{j:t.f(n.sourceList,((e,o,i)=>({a:t.t(e.sentences),b:t.t(e.report_title),c:t.t(e.author),d:t.t(n.getLocalDate(e.declare_date)),e:o}))),k:t.n("contentC fixed "+(2==n.type?"radius":"")),l:t.s("top:"+n.contentTop+"px;")})}]]);wx.createPage(n);