You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
28 KiB
1 lines
28 KiB
import{k as e,_ as o,r as t,o as i,a8 as r,b as n,c as a,d as l,e as s,F as d,n as c}from"./index-7d881374.js";import{e as h}from"./marketTemperature-3afd7f01.js";import{t as m,c as u,a as w,l as x}from"./index-bce0856e.js";const p={class:"qxjmqbox"};var y=o({__name:"emotionDecod",setup(e,{expose:o}){o({initQXNLZHEcharts:function(e,o){w.value=o;const t=[];w.value.forEach(((e,o)=>{const[i,r,n,a,l,s,d,c,h,m]=e;t.push([o,0,l,1==h?"green":"transparent"]),t.push([o,1,a,1==c?"purple":"transparent"]),t.push([o,2,n,1==d?"red":"transparent"]),t.push([o,3,r,1==s?"yellow":"transparent"])})),u.value=t,x.value=w.value.map((e=>e[9])),console.log("热力图数据:",u.value),console.log("折线图数据:",x.value);const i=(e=>{const o=[];let t=[];for(let i=0;i<e.length;i++)o.push(e[i][0]),t.push(e[i].slice(1));return{categoryData:o,value:t}})(e),r={tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"cross",crossStyle:{color:"#999"}},formatter:function(e){if(!e||0===e.length)return"";const o=e.find((e=>"candlestick"===e.seriesType));if(!o)return"";return`日期: ${o.name}<br/>开盘价: ${o.data[1]}<br/>收盘价: ${o.data[2]}<br/>最低价: ${o.data[3]}<br/>最高价: ${o.data[4]}`}},grid:[{top:"5%",height:window.innerWidth<=768?"35%":"40%",width:window.innerWidth<=768?"70%":"80%",left:window.outerWidth<=768?"20%":"10%"},{top:window.innerWidth<=768?"40%":"45%",height:"35%",width:window.innerWidth<=768?"70%":"80%",left:window.outerWidth<=768?"20%":"10%"},{top:window.innerWidth<=768?"75%":"80%",height:"2%",width:window.innerWidth<=768?"70%":"80%",left:window.outerWidth<=768?"20%":"10%"}],visualMap:[{show:!1,seriesIndex:1,min:0,max:2e3,calculable:!0,orient:"horizontal",left:"center",bottom:"15%",inRange:{color:["transparent"]}}],xAxis:[{type:"category",gridIndex:0,data:i.categoryData,axisPointer:{show:!0,type:"line",label:{show:!0,backgroundColor:"rgba(0,191,255)",color:"black"}},axisTick:{show:!1},axisLabel:{show:!1,rotate:45},axisLine:{show:!0,lineStyle:{color:"white"}}},{type:"category",gridIndex:1,data:i.categoryData,axisTick:{show:!1},axisLabel:{show:!1,rotate:45},splitLine:{show:!0,lineStyle:{color:"white",type:"solid"},interval:0}},{type:"category",gridIndex:2,data:i.categoryData,axisLine:{lineStyle:{color:"white"}},axisPointer:{show:!1,label:{show:!1},type:"line"},axisTick:{show:!0,alignWithLabel:!0,lineStyle:{color:"white",width:1,type:"dashed"}}}],yAxis:[{scale:!0,axisLabel:{formatter:function(e){return e}},axisLine:{show:!0,lineStyle:{color:"white"}},splitLine:{show:!1},axisPointer:{show:!0,label:{show:!0,backgroundColor:"rgba(0,255,127)",color:"black"},type:"line"}},{gridIndex:1,type:"category",data:[0,1,2,3],axisLine:{lineStyle:{color:"white"}},axisLabel:{show:!1,color:"#fff",backgroundColor:"transparent",fontSize:12,margin:8},axisPointer:{show:!0,label:{show:!1},type:"line"},axisTick:{show:!1},splitLine:{show:!0,lineStyle:{color:"#8392A5",width:1,type:"solid"},interval:0}},{gridIndex:2,type:"value",axisLine:{show:!0,lineStyle:{color:"white"}},splitLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},axisPointer:{show:!1,label:{show:!1},type:"line"}}],dataZoom:[{textStyle:{color:"white"},dataBackground:{areaStyle:{color:"#8392A5"},lineStyle:{opacity:.8,color:"#8392A5"}},xAxisIndex:[0,1,2],start:50,end:100,bottom:window.innerWidth<=768?"5%":"7%"},{type:"inside",xAxisIndex:[0,1,2],filterMode:"filter"}],series:[{type:"candlestick",name:"日K",data:i.value,itemStyle:{normal:{color0:"red",color:"#0CF49B",borderColor0:"#FD1050",borderColor:"#0CF49B"}}},{name:"热力矩阵",type:"heatmap",gridIndex:1,xAxisIndex:1,yAxisIndex:1,data:t,coordinateSystem:"cartesian2d",tooltip:{trigger:"item",axisPointer:{type:"cross",crossStyle:{color:"#999"}},formatter:function(e){return`${e.value[2]}`}},label:{normal:{show:!0,color:"#fff",formatter:function(e){const o=e.value[2];return`{${e.value[3]}|${o}}`},rich:{green:{color:"#27ae60",fontWeight:"bold"},purple:{color:"#8e44ad",fontWeight:"bold"},red:{color:"#FF0000",fontWeight:"bold"},yellow:{color:"#FFFF00",fontWeight:"bold"},normal:{color:"#fff"}}}},itemStyle:{normal:{color:"transparent",borderWidth:2}},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}},{name:"凸起",type:"line",xAxisIndex:2,yAxisIndex:2,data:x.value,color:"black",lineStyle:{normal:{color:"red"}},symbol:"none",emphasis:{showSymbol:!0}}]};if(!c.value)return void console.error("DOM元素未准备好,无法初始化ECharts");m&&m.dispose();m=h.init(c.value),m.setOption(r),m&&(m.on("dataZoom",(()=>{window.handleChartInteractionStart&&window.handleChartInteractionStart()})),m.on("mousewheel",(()=>{window.handleChartInteractionStart&&window.handleChartInteractionStart()})),m.on("mousedown",(()=>{window.handleChartInteractionStart&&window.handleChartInteractionStart()})),m.on("mouseup",(()=>{window.handleChartInteractionEnd&&window.handleChartInteractionEnd()})),m.on("click",(()=>{window.handleChartInteractionStart&&window.handleChartInteractionStart()})));const n=(e,o)=>{let t;return function(...i){clearTimeout(t),t=setTimeout((()=>{clearTimeout(t),e(...i)}),o)}},a=n((()=>{if(m&&!m.isDisposed())try{m.resize(),console.log("情绪解码器图表已重新调整大小")}catch(e){console.error("情绪解码器图表resize失败:",e)}}),100);window.emotionDecodResizeHandler&&window.removeEventListener("resize",window.emotionDecodResizeHandler);if(window.addEventListener("resize",a),window.emotionDecodResizeHandler=a,c.value&&window.ResizeObserver){const e=new ResizeObserver(n((()=>{if(m&&!m.isDisposed())try{m.resize(),console.log("情绪解码器容器大小变化,图表已调整")}catch(e){console.error("情绪解码器容器resize失败:",e)}}),100));e.observe(c.value),window.emotionDecodContainerObserver=e}}});const c=t(null);let m=null;const u=t([]),w=t([]),x=t([]);const y=t(window.innerHeight),f=()=>{y.value=window.innerHeight};return i((()=>{window.emotionDecodHeightHandler||(window.addEventListener("resize",f),window.emotionDecodHeightHandler=f)})),r((()=>{m&&(m.dispose(),m=null),window.emotionDecodResizeHandler&&(window.removeEventListener("resize",window.emotionDecodResizeHandler),window.emotionDecodResizeHandler=null),window.emotionDecodHeightHandler&&(window.removeEventListener("resize",window.emotionDecodHeightHandler),window.emotionDecodHeightHandler=null),window.emotionDecodContainerObserver&&(window.emotionDecodContainerObserver.disconnect(),window.emotionDecodContainerObserver=null)})),(e,o)=>(n(),a(d,null,[l(' <div ref="qxnlzhqEchartsRef" id="qxnlzhqEcharts"></div> '),s("div",p,[s("div",{ref_key:"KlineCanvs",ref:c,class:"qxjmqEcharts"},null,512)])],2112))}},[["__scopeId","data-v-a3d8672a"],["__file","C:/Users/Administrator/Desktop/AIxiaocaishen/src/views/components/emotionDecod.vue"]]);function f(e){const{chart:o,container:t,option:i,beforeResize:r,name:n="图表"}=e;if(!o||!t)return console.warn(`${n}: 图表实例或容器不存在`),{cleanup:()=>{}};const a=function(e,o=100){let t;return function(...i){clearTimeout(t),t=setTimeout((()=>{clearTimeout(t),e(...i)}),o)}}((()=>{if(o&&!o.isDisposed())try{"function"==typeof r&&r(),i&&o.setOption(i,!0),o.resize(),console.log(`${n}响应式调整完成`)}catch(e){console.error(`${n}响应式调整失败:`,e)}}),100),l=a;let s=null;return window.ResizeObserver&&(s=new ResizeObserver(a),s.observe(t)),window.addEventListener("resize",l),{cleanup:()=>{window.removeEventListener("resize",l),s&&(s.disconnect(),s=null),console.log(`${n}响应式监听器已清理`)},triggerResize:a}}var b=o({__name:"emotionalBottomRadar",setup(e,{expose:o}){const i=t(null);let l=null,s=null;return o({initEmotionalBottomRadar:function(e,o){if(l&&(l.dispose(),l=null),!i.value)return void console.error("bottomRadarRef not found");l=h.init(i.value);let t=o.map((e=>e[0])),r=e.map((e=>[e[1],e[2],e[3],e[4]])),n=[];r.forEach((e=>{Array.isArray(e)&&e.length>=4&&n.push(e[0],e[1],e[2],e[3])}));let a=n.filter((e=>"number"==typeof e&&!isNaN(e))),d=Math.min(...a),c=Math.max(...a),m=Math.floor(d),u=Math.ceil(c),w=o.map((e=>e[1])),x=o.map((e=>e.slice(2,6))),p=[],y=[],b=[],g=[],v=[];x.forEach((e=>{e[0]?(p.push(4),e[3]?(g.push(36),e[2]?(b.push(40),v.push(0)):(b.push(0),v.push(0))):(g.push(0),e[2]?(b.push(76),v.push(0)):(b.push(0),v.push(0)))):e[0]||(p.push(0),e[3]?(g.push(40),e[2]?(b.push(40),v.push(0)):(b.push(0),v.push(0))):(g.push(0),e[2]?(b.push(79),v.push(1)):(b.push(0),v.push(0)))),e[1]?y.push(1):e[1]||y.push(0)}));let F={axisPointer:{link:{xAxisIndex:"all"}},tooltip:{show:!0,trigger:"axis",triggerOn:"mousemove",confine:!0,axisPointer:{type:"cross",crossStyle:{color:"grey",width:1,type:"dashed"},lineStyle:{color:"grey",width:1,type:"dashed"},label:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"#fff",borderColor:"#fff",borderWidth:1}},backgroundColor:"rgba(232, 232, 242, 0.87)",borderColor:"#fff",borderWidth:1,padding:10,textStyle:{color:"#fff",fontSize:12},formatter:function(e){if(!e||0===e.length)return"";if(e.some((e=>"红线"===e.seriesName&&1===e.axisIndex||2===e.axisIndex||"K线"!==e.seriesName&&"基础base"!==e.seriesName))&&!e.some((e=>"candlestick"===e.seriesType)))return"";let o=`<div style="font-weight: bold; color: black; margin-bottom: 8px;">${e[0].name}</div>`;return e.sort(((e,o)=>"candlestick"===e.seriesType?-1:"candlestick"===o.seriesType?1:"红线"===e.seriesName?-1:"红线"===o.seriesName?1:0)).forEach((e=>{let t=e.value,i=e.color;if("candlestick"===e.seriesType){let t=e.value;if(!Array.isArray(t)||t.length<4)return"";let i=t[1],n=t[2],a=t[3],l=t[4];if("number"!=typeof i||"number"!=typeof n||"number"!=typeof a||"number"!=typeof l)return"";let s=null;const d=e.dataIndex;if(d>0&&r&&r[d-1]){const e=r[d-1];e&&Array.isArray(e)&&e.length>=2&&(s=e[1])}if(o+='<div style="margin-bottom: 6px;">',o+=`<div style="color: black; font-weight: bold;">${e.seriesName}</div>`,o+=`<div style="color: black;">开盘价: ${i}</div>`,o+=`<div style="color: black;">收盘价: ${n}</div>`,o+=`<div style="color: black;">最低价: ${a}</div>`,o+=`<div style="color: black;">最高价: ${l}</div>`,null!==s&&"number"==typeof s){let e=n-s,t=(e/s*100).toFixed(2);o+=`<div style="color: ${e>=0?"#14b143":"#ef232a"};">涨跌: ${e>=0?"+":""}${e.toFixed(2)} (${t}%)</div>`}o+="</div>"}else"红线"===e.seriesName?o+=`<div style="color: #ef232a; margin-bottom: 4px;">${e.seriesName}: ${t}</div>`:"基础base"!==e.seriesName&&t>0&&(o+=`<div style="color: ${i}; margin-bottom: 4px;">${e.seriesName}: ${t}</div>`)})),o}},legend:{type:"scroll",pageButtonItemGap:2,pageButtonPosition:"end",textStyle:{color:"#666"}},grid:[{left:"10%",right:"3%",top:"20px",bottom:"50%",height:"150px",width:"85%"},{left:"10%",right:"3%",top:"170px",bottom:"25%",height:"150px",width:"85%"},{left:"10%",right:"3%",top:"320px",bottom:"50px",height:"150px",width:"85%"}],xAxis:[{type:"category",data:t,gridIndex:0,boundaryGap:!0,axisLine:{lineStyle:{color:"white"}},axisTick:{show:!1,alignWithLabel:!0,lineStyle:{color:"#999",width:1,type:"dashed"}},axisLabel:{show:!1},splitLine:{show:!1},axisPointer:{link:{xAxisIndex:"all"},label:{show:!1}}},{type:"category",data:t,gridIndex:1,boundaryGap:!0,axisLine:{lineStyle:{color:"white"}},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},axisPointer:{link:{xAxisIndex:"all"},label:{show:!1}}},{type:"category",data:t,gridIndex:2,axisLine:{lineStyle:{color:"white"}},axisTick:{show:!0,alignWithLabel:!0,lineStyle:{color:"#999",width:1,type:"solid"}},axisLabel:{color:"white",interval:"auto",rotate:0},splitLine:{show:!1},axisPointer:{link:{xAxisIndex:"all"}}}],yAxis:[{type:"value",gridIndex:0,splitNumber:4,min:m,max:u,interval:(u-m)/4,axisLine:{lineStyle:{color:"white"}},axisTick:{show:!0},axisLabel:{width:50,color:"white",formatter:function(e,o){return e.toFixed(0)}},splitLine:{show:!1,lineStyle:{color:"#837b7b",type:"dotted"}},scale:!0},{type:"value",gridIndex:1,splitNumber:3,axisLine:{lineStyle:{color:"white"}},axisTick:{show:!0},splitNumber:5,axisLabel:{width:50,color:"white",formatter:function(e,o){return 0===o?"0":5===o?"":e}},splitLine:{show:!1,lineStyle:{color:"#837b7b",type:"dotted"}}},{type:"value",gridIndex:2,splitNumber:2,axisLine:{lineStyle:{color:"white"}},axisTick:{show:!0},splitNumber:5,axisLabel:{width:50,color:"white",formatter:function(e,o){return 5===o?"":e}},splitLine:{show:!1,lineStyle:{color:"#837b7b",type:"dotted"}},splitNumber:5,min:function(e){return 0},max:function(e){return e.max+10}}],dataZoom:[{type:"slider",xAxisIndex:[0,1,2],start:50,end:100,show:!0,bottom:window.innerWidth>768?30:50,height:20,borderColor:"#CFD6E3",fillerColor:"rgba(135, 175, 274, 0.2)",handleStyle:{color:"#CFD6E3"},textStyle:{color:"#fff"},dataBackground:{lineStyle:{color:"#CFD6E3"},areaStyle:{color:"rgba(241,243,247,0.5)"}}},{type:"inside",xAxisIndex:[0,1,2],start:50,end:100,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1}],series:[{name:"K线",type:"candlestick",data:r,xAxisIndex:0,yAxisIndex:0,itemStyle:{color:"#14b143",color0:"#ef232a",borderColor:"#14b143",borderColor0:"#ef232a",normal:{color:"#14b143",color0:"#ef232a",borderColor:"#14b143",borderColor0:"#ef232a",opacity:function(e){return e.data[1]>e.data[0]?0:1}}}},{name:"红线",type:"line",data:w,xAxisIndex:1,yAxisIndex:1,symbol:"none",sampling:"average",itemStyle:{normal:{color:"#ef232a"}},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(33, 150, 243, 0.4)"},{offset:1,color:"rgba(33, 150, 243, 0)"}]}}},{name:"基础base",type:"bar",stack:"total",xAxisIndex:2,yAxisIndex:2,barCategoryGap:"0%",itemStyle:{normal:{color:"#ffffff",borderWidth:0}},data:v},{name:"黄色",type:"bar",stack:"total",xAxisIndex:2,yAxisIndex:2,barCategoryGap:"0%",itemStyle:{normal:{color:"rgba(255, 255, 0, 1)",borderWidth:0,label:{show:e=>y[e.dataIndex]>0,position:"top",textStyle:{color:"rgba(255, 255, 0, 1)"},formatter:e=>y[e.dataIndex]>0?"加仓资金":""}}},data:p},{name:"蓝色",type:"bar",stack:"total",xAxisIndex:2,yAxisIndex:2,barCategoryGap:"0%",label:{show:!0,position:"inside"},itemStyle:{normal:{color:"rgba(34, 196, 190, 1)",borderWidth:0}},data:g},{name:"紫色",type:"bar",stack:"total",xAxisIndex:2,yAxisIndex:2,barCategoryGap:"0%",label:{show:!0,position:"inside"},itemStyle:{normal:{color:"rgba(191, 87, 222, 1)",borderWidth:0}},data:b}]};function C(){window.innerWidth<=768&&(F.grid[0].height="150px",F.grid[1].height="150px",F.grid[2].height="150px",F.grid[0].left="15%",F.grid[1].left="15%",F.grid[2].left="15%",F.grid[1].top="170px",F.grid[2].top="320px",F.grid[0].width="80%",F.grid[1].width="80%",F.grid[2].width="80%"),l.setOption(F)}l.setOption(F),l&&(l.on("dataZoom",(()=>{window.handleChartInteractionStart&&window.handleChartInteractionStart()})),l.on("mousewheel",(()=>{window.handleChartInteractionStart&&window.handleChartInteractionStart()})),l.on("mousedown",(()=>{window.handleChartInteractionStart&&window.handleChartInteractionStart()})),l.on("mouseup",(()=>{window.handleChartInteractionEnd&&window.handleChartInteractionEnd()})),l.on("click",(()=>{window.handleChartInteractionStart&&window.handleChartInteractionStart()}))),i.value&&function(e){if(!e)return;Object.assign(e.style,{width:"100%",boxSizing:"border-box",overflow:"hidden",margin:"0",padding:"0"})}(i.value),s&&s.cleanup(),s=f({chart:l,container:i.value,option:F,beforeResize:C,name:"情绪探底雷达图表"}),setTimeout((()=>{s&&s.triggerResize()}),100),C()}}),r((()=>{s&&(s.cleanup(),s=null),l&&(l.dispose(),l=null)})),(e,o)=>(n(),a("div",{ref_key:"bottomRadarRef",ref:i,class:"bottomRadarChart"},null,512))}},[["__file","C:/Users/Administrator/Desktop/AIxiaocaishen/src/views/components/emotionalBottomRadar.vue"]]);var g=o({__name:"emoEnergyConverter",setup(o,{expose:i}){const{translate:l,t:s}=(()=>{const o=e((()=>e=>m.value&&e in m.value?m.value[e]:e)),t=e((()=>{var e;return(null==(e=m.value)?void 0:e.language)||"简体中文"}));return{t:m,translate:o,changeLanguage:u,availableLanguages:w,languagePacks:x,currentLanguage:t}})();i({initQXNLZHEcharts:function(e,o){const i=s.value;if(!d.value)return void console.log("DOM 元素未准备好,无法初始化 ECharts");p&&p.dispose();let r=[];Array.isArray(e)||console.log("不是");e.forEach((e=>{let o=e[0],t=[e[1],e[2],e[3],e[4]];r.push({date:o,value:t})})),y=[{min:o.dd,max:o.zc,name:"情绪冰点区",color:"#F5D6FF",fontColor:"#A7691C",fontSize:window.innerWidth>769?12:9,NumberColor:"white",left:null,right:"7%"},{min:o.zc,max:o.ht,name:"认知潜伏区",color:"#FFF6C4",fontColor:"#A7691C",NumberColor:"white",left:null,right:"7%"},{min:o.ht,max:o.qs,name:"多空消化区",color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#D7FF9B"},{offset:1,color:"#CEFF85"}]},fontColor:"#A7691C",NumberColor:"white",left:null,right:"7%"},{min:o.qs,max:o.tp,name:"共识加速区",color:"#FFDC8F",fontColor:"#A7691C",NumberColor:"white",left:null,right:"7%"},{min:o.tp,max:o.js,name:"情绪临界区",color:"#FFC0AA",fontColor:"#A7691C",NumberColor:"white",left:"32%",right:null}],-1!=Number(o.yl)&&y.push({min:o.js,max:o.yl,name:"杠杆失衡区",color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#FEA474"},{offset:1,color:"#FFAAF6"}]},fontColor:"#A7691C",NumberColor:"white",left:"32%",right:null});-1!=Number(o.gg)&&y.push({min:o.yl,max:o.gg,name:"情绪熔断区",color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#F66475"},{offset:1,color:"#FFB98E"}]},fontColor:"#A7691C",NumberColor:"white",left:"32%",right:null});const n=e.flatMap((e=>[e[1],e[2],e[3],e[4]]));Math.min(...n);const a=Math.max(...n),l=1.05*Number(o.cc),c=.97*Number(o.cc),m=Math.max(0,r.length-17),u=new Array(r.length).fill(null),w=new Array(r.length).fill(null);for(var x=m;x<r.length;x++)u[x]=l,w[x]=c;const b=[],v=[],F=[],C=t([]),S=t([]),z=t([]),A={data:{value:[0,0,0,0]}},k={data:{value:[0,0,0,0]}};let I=Math.max(1.02*a,1.02*l,o.cc,o.dd,o.gg,o.ht,o.js,o.qs,o.tp,o.yl,o.zc);function W(e,o){const t=document.createElement("canvas"),i=t.getContext("2d"),[r,n]=o.split(" ");t.width=parseInt(r)||60,t.height=parseInt(n)||60;const a=i.createLinearGradient(0,0,t.width,t.height);return a.addColorStop(.24,"rgba(0,0,0,0)"),a.addColorStop(.25,"rgba(255,255,255,0.7)"),a.addColorStop(.26,"rgba(0,0,0,0)"),a.addColorStop(.74,"rgba(0,0,0,0)"),a.addColorStop(.75,"rgba(255,255,255,0.7)"),a.addColorStop(.76,"rgba(0,0,0,0)"),i.fillStyle=a,i.fillRect(0,0,t.width,t.height),t}f=y.filter((e=>e.max<=I)),console.log("markLineMax",I,"markLineRegions",f),r.forEach(((e,t)=>{const[i,r,n,a]=e.value,l={date:e.date,value:[null,null,null,null]};(null==A||A.data.value[3]<a)&&(A.data=e,A.index=t),k.data=e,k.index=t;let s=!1,d=!1;o.topxh.includes(e.date)?(S.value.push({date:e.date,value:[e.value[0],e.value[1],e.value[0],e.value[1]]}),s=!0):S.value.push(l),o.lowxh.includes(e.date)?(z.value.push({date:e.date,value:[e.value[0],e.value[1],e.value[0],e.value[1]]}),d=!0):z.value.push(l),o.qixh.includes(e.date)?(console.log("item",e),C.value.push({date:e.date,value:[e.value[0],e.value[1],e.value[0],e.value[1]]})):C.value.push(l),s?(b.push(null),v.push(null)):d?(b.push({value:[t,r>i?r-i:i-r],itemStyle:{normal:{color:"#001EFF"}}}),v.push({value:[t,r>i?i:r],itemStyle:{normal:{color:"transparent"}}}),console.log("lowMiddleRangeData",b),console.log("lowMiddleRangeData111111",v)):(b.push(null),v.push(null))})),F.push({name:`${Number(A.data.value[3]).toFixed(2)}`,coord:[A.index,A.data.value[3]],itemStyle:{normal:{color:"rgba(0,0,0,0)"}},label:{normal:{show:!0,position:"top",formatter:`${Number(A.data.value[3]).toFixed(2)}`,textStyle:{color:"#2171DD",fontSize:window.innerWidth>769?12:9,textBorderColor:"#FFFFFF",textBorderWidth:2,fontWeight:"bold"}}}}),F.push({name:`${Number(k.data.value[3]).toFixed(2)}`,coord:[k.index,k.data.value[2]],itemStyle:{normal:{color:"rgba(0,0,0,0)"}},label:{normal:{show:!0,position:"bottom",formatter:`${Number(k.data.value[1]).toFixed(2)}`,textStyle:{color:"#3B8F08",fontSize:window.innerWidth>769?12:9,textBorderColor:"#FFFFFF",textBorderWidth:2,fontWeight:"bold"}}}});const L=[];y.forEach((e=>{"情绪熔断区"!=e.name&&"情绪临界区"!=e.name&&"情绪冰点区"!=e.name||L.push({name:e.name,min:e.min,max:e.max,backgroundSize:"10px 10px "})}));const E=[],$={};o.topxh&&o.topxh.length>0&&(E.push({name:"TOP",textStyle:{color:"#000000",fontSize:window.innerWidth>769?12:9,textBorderColor:"#FFFFFF",textBorderWidth:2,fontWeight:"bold"}}),$.TOP=!0);o.lowxh&&o.lowxh.length>0&&(E.push({name:"LOW",textStyle:{color:"#001EFF",fontSize:window.innerWidth>769?12:9,textBorderColor:"#FFFFFF",textBorderWidth:2,fontWeight:"bold"}}),$.LOW=!0);o.qixh&&o.qixh.length>0&&(E.push({name:"起",textStyle:{color:"#249409",fontSize:window.innerWidth>769?12:9,textBorderColor:"#FFFFFF",textBorderWidth:2,fontWeight:"bold"}}),$.起=!0);let N;p=h.init(d.value),N={legend:{data:E,selected:$,top:window.innerWidth>768?"0%":"1%",textStyle:{fontSize:window.matchMedia("(max-width: 767px)").matches?9:12}},tooltip:{show:!0,trigger:"axis",axisPointer:{type:"cross",lineStyle:{color:"grey",width:1,type:"dashed"},label:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"#fff",borderColor:"#fff",borderWidth:1}},backgroundColor:"rgba(232, 232, 242, 0.87)",borderColor:"#fff",borderWidth:1,borderRadius:8,padding:10,textStyle:{color:"#fff",fontSize:12},position:function(e,o,t,i,r){const n=window.matchMedia("(max-width: 768px)").matches,a=r.contentSize[0],l=r.contentSize[1],s=r.viewSize[0],d=r.viewSize[1];let c=e[0],h=e[1];return n?(c+a>s-10&&(c=s-a-10),c<10&&(c=10),h-l-20<0?(h+=20,h+l>d-60&&(h=Math.max(20,d-l-60))):h=h-l-20):(c+a>s-20?c=c-a-20:c+=20,h-l<20?h+=20:h=h-l-20),[c,h]},formatter:function(o){if(!o||0===o.length)return"";let t=`<div style="font-weight: bold; color: black; margin-bottom: 8px;">${o[0].name}</div>`;return o.forEach(((o,r)=>{console.log("参数索引:",r,"系列:",o);let n=o.value;if(o.color,"candlestick"===o.seriesType){const r=i.kai,a=i.shou,l=i.di,s=i.gao;let d,c,h=n[1],m=n[2],u=n[3],w=n[4];if("number"!=typeof h||"number"!=typeof m||"number"!=typeof u||"number"!=typeof w)return"";if(0!=o.data[0]){let t=e[o.data[0]-1][2];d=m-t,c=(d/t*100).toFixed(2)}let x=d>=0?"#32B520":"#D8001B";t+='<div style="margin-bottom: 6px;">',t+=`<div style="color: black;">${r}: ${h.toFixed(2)}</div>`,t+=`<div style="color: black;">${a}: ${m.toFixed(2)}</div>`,t+=`<div style="color: black;">${l}: ${u.toFixed(2)}</div>`,t+=`<div style="color: black;">${s}: ${w.toFixed(2)}</div>`,0!=o.data[0]&&(t+=`<div style="color: ${x};">涨跌: ${d>=0?"+":""}${d.toFixed(2)} (${c}%)</div>`,t+="</div>")}else"止盈线"===o.seriesName&&null!=n&&"number"==typeof n?t+=`<div style="color: #FF0000; margin-bottom: 4px;">${o.seriesName}: ${n.toFixed(2)}</div>`:"止损线"===o.seriesName&&null!=n&&"number"==typeof n&&(t+=`<div style="color: #001EFF; margin-bottom: 4px;">${o.seriesName}: ${n.toFixed(2)}</div>`)})),t}},dataZoom:[{top:window.innerWidth<=768?"86%":"",type:"slider",xAxisIndex:0,start:0,end:100,show:!0,bottom:40,height:20,borderColor:"#fff",fillerColor:"rgba(255, 255, 255, 0.2)",handleStyle:{color:"#fff",borderColor:"white"},textStyle:{color:"white",fontSize:window.innerWidth>769?12:9}},{type:"inside",xAxisIndex:0,start:0,end:100,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1}],xAxis:{type:"category",data:r.map((e=>e.date)),axisLabel:{rotate:0,color:"white",interval:"auto",fontSize:window.innerWidth>769?12:9,showMaxLabel:!0},axisLine:{onZero:!1,lineStyle:{color:"white"}},axisTick:{alignWithLabel:!0}},yAxis:{scale:!0,axisLine:{lineStyle:{color:"white"}},splitLine:{show:!1},axisLabel:{show:!0,color:"white",fontSize:window.innerWidth>769?12:9,formatter:function(e){return parseFloat(e.toFixed(2)).toString()}},axisTick:{show:!0,color:"white"},min:Math.min(o.dd,.98*c),max:Math.max(1.02*a,1.02*l,o.cc,o.dd,o.gg,o.ht,o.js,o.qs,o.tp,o.yl,o.zc)},graphic:g(Math.min(o.dd,.98*c),Math.max(1.02*a,1.02*l,o.cc,o.dd,o.gg,o.ht,o.js,o.qs,o.tp,o.yl,o.zc)),series:[{type:"candlestick",data:r.map((e=>e.value)),z:3,clip:!0,markPoint:{symbol:"circle",symbolSize:10,data:F,z:5},itemStyle:{normal:{color:"#00AAFF",color0:"#FF007F",borderColor:"#00AAFF",borderColor0:"#FF007F"}},markArea:{silent:!0,data:[...y.map((e=>[{x:"30%",yAxis:e.min,itemStyle:{normal:{color:e.color}}},{x:"95%",yAxis:e.max}])),...L.map((e=>[{x:"30%",yAxis:e.min,itemStyle:{normal:{color:{image:W(e.color,e.backgroundSize),repeat:"repeat"}}}},{x:"95%",yAxis:e.max}]))],markPoint:{symbol:"circle",symbolSize:10,data:F,z:5}},markLine:{silent:!0,symbol:"none",data:[...f.map((e=>[{name:`${Number(e.max).toFixed(2)}`,x:"30%",yAxis:e.max,label:{normal:{position:"start",color:("情绪冰点区"==e.name||"多空消化区"==e.name||e.name,"white"),fontSize:window.innerWidth>769?12:9}},lineStyle:{normal:{color:"#FFFFFF",width:2,type:"dashed"}}},{x:"95%",yAxis:e.max}])),[{name:`止盈${l.toFixed(2)}`,x:"60%",yAxis:l,label:{normal:{position:"start",fontSize:window.innerWidth>769?13:9,fontWeight:"bold",textBorderColor:"#FFFFFF",textBorderWidth:2}},lineStyle:{normal:{color:"#FF0000",width:2,type:"solid"}}},{x:"95%",yAxis:l}],[{name:`止损${c.toFixed(2)}`,x:"60%",yAxis:c,label:{normal:{position:"start",fontSize:window.innerWidth>769?13:9,fontWeight:"bold",textBorderColor:"#FFFFFF",textBorderWidth:2}},lineStyle:{normal:{color:"#001EFF",width:2,type:"solid"}}},{x:"95%",yAxis:c}]]}},{name:"起",type:"candlestick",data:C.value.map((e=>e.value)),itemStyle:{normal:{color:"#87FF6B",color0:"#87FF6B",borderColor:"#87FF6B",borderColor0:"#87FF6B"}},gridIndex:0,z:4,tooltip:{show:!1}},{name:"TOP",type:"candlestick",data:S.value.map((e=>e.value)),itemStyle:{normal:{color:"#000",color0:"#000",borderColor:"#000",borderColor0:"#000"}},gridIndex:0,z:4,tooltip:{show:!1}},{name:"LOW",type:"candlestick",data:z.value.map((e=>e.value)),itemStyle:{normal:{color:"#001EFF",color0:"#001EFF",borderColor:"#001EFF",borderColor0:"#001EFF"}},gridIndex:0,z:4,tooltip:{show:!1}}],grid:{left:window.innerWidth<=768?"2%":"5%",right:(window.innerWidth,"8%"),top:(window.innerWidth,"40"),bottom:"60",containLabel:!0,width:"auto",height:"auto",overflow:"hidden"}},p.setOption(N);const D=(e,o)=>{let t;return function(...i){clearTimeout(t),t=setTimeout((()=>{clearTimeout(t),e(...i)}),o)}},M=D((()=>{if(p&&!p.isDisposed())try{p.resize(),console.log("情绪能量转化器图表已重新调整大小")}catch(e){console.error("情绪能量转化器图表resize失败:",e)}}),100);window.emoEnergyConverterResizeHandler&&window.removeEventListener("resize",window.emoEnergyConverterResizeHandler);if(window.addEventListener("resize",M),window.emoEnergyConverterResizeHandler=M,d.value&&window.ResizeObserver){const e=new ResizeObserver(D((()=>{if(p&&!p.isDisposed())try{p.resize(),console.log("情绪能量转化器容器大小变化,图表已调整")}catch(e){console.error("情绪能量转化器容器resize失败:",e)}}),100));e.observe(d.value),window.emoEnergyConverterContainerObserver=e}}});let d=t(null),p=null,y=c([]),f=c([]);function b(e,o,t,i,r){const n=p.getHeight(),a=100+(window.innerHeight>769?17:14);return console.log("%",(o-Number(r))/(o-e)*(n-a)),console.log("chartHeight",n),(o-Number(r))/(o-e)*(n-a)}t(null);const g=(e,o)=>{let t,i;for(let r=0;r<y.length;r++)0==r?(t=Number(y[r].min),i=Number(y[r].max)):(t=Math.min(t,Number(y[r].min)),i=Math.max(i,Number(y[r].max)));return y.flatMap((t=>{if(!t.min||!t.max)return[](Number(t.min)+Number(t.max))/2;const i=(Math.max(e,t.min)+Math.min(o,t.max))/2,r=t.min>=e&&t.max<=o,n=t.min<o&&t.max>e&&!r,a=p?p.getHeight():400,l=Math.max(t.min,e),s=Math.min(t.max,o),d=[];return(r||n)&&(s-l)/(o-e)*(a-60)>=5&&d.push({type:"text",left:t.left,right:t.right,top:window.innerWidth>769?40+b(e,o,0,0,i)-6:40+b(e,o,0,0,i)-4.5,style:{text:t.name,fill:t.fontColor,fontSize:window.innerWidth>769?12:9,fontWeight:"bold",textVerticalAlign:"middle"},z:2}),d}))};return t(),t(),r((()=>{p&&(p.dispose(),p=null),window.emoEnergyConverterResizeHandler&&(window.removeEventListener("resize",window.emoEnergyConverterResizeHandler),window.emoEnergyConverterResizeHandler=null),window.emoEnergyConverterContainerObserver&&(window.emoEnergyConverterContainerObserver.disconnect(),window.emoEnergyConverterContainerObserver=null)})),(e,o)=>(n(),a("div",{ref_key:"qxnlzhqEchartsRef",ref:d,class:"qxnlzhqEcharts"},null,512))}},[["__scopeId","data-v-09eb69c0"],["__file","C:/Users/Administrator/Desktop/AIxiaocaishen/src/views/components/emoEnergyConverter.vue"]]);export{b as E,g as a,y as e};
|