import{t as g}from"./debounce-Xd493GvO.js";import{r as m}from"./request-CEvu378m.js";import{ar as x}from"./echarts-DB130vfq.js";import{s as L,r as y,ax as _,c as V,w as b,j as q,n as z,X as S,B as W,z as k}from"./vue-BJk78QHK.js";import{_ as C}from"./index-M_JNBppB.js";import"./element-3_pOinej.js";import"./utils-YI6ye1sf.js";import"./threejs-BafxXW5-.js";import"./vxe-Dx3zSILm.js";const K=Object.assign({name:"LongitudinalLine"},{__name:"LongitudinalLine",props:{propValue:{type:Object,default:()=>({})},request:{type:Object,default:()=>({})},element:{type:Object,default:()=>({})}},setup(v){const e=v,a=L(null),d=y(null),n=y(null),s=_(),w=V(()=>{const o=e.element.style.width,r=e.element.style.height;return{width:o,height:r}});b(w,g(()=>{c()},500),{deep:!0}),b(()=>e.propValue,g(()=>{f()},500),{deep:!0}),q(()=>{var o,r;e.request&&(n.value=m(e.request,e.propValue,"list")),((r=(o=e.request)==null?void 0:o.global)==null?void 0:r.length)>0&&s.watch(()=>s.state.globalKey,()=>{e.request.global.forEach(u=>{const i=s.state.globalKey.findIndex(l=>l.globalKey===u);if(i>-1){const l=[s.state.globalKey[i].globalKey,s.state.globalKey[i].globalValue],t=e.request.data.findIndex(p=>p[0]===l[0]);t>-1?e.request.data[t][1]=l[1]:e.request.data.push(l)}}),n.value(),n.value=m(e.request,e.propValue,"list")},{deep:!0}),a.value=x(d.value,"vintage"),z(()=>{f()}),window.addEventListener("resize",c)}),S(()=>{window.removeEventListener("resize",c),a.value&&(a.value.clear(),a.value=null),e.request&&n.value&&n.value()});function f(){let o={},r=e.propValue.list,u=[],i=[],l={value:-0,symbol:"none"};r.map((t,p)=>{u.push({date:t.policy_time,title:t.policy_title,country:t.policy_country,value:0,label:{show:!0,lineHeight:20,color:e.propValue.contentColor,fontWeight:e.propValue.contentfontWeight,fontSize:e.propValue.contentfontSize,align:p%2==0?"left":"right",padding:20,position:p%2==0?"left":"right",formatter(h){return`{bolder|${h.name}}
${h.data.title}`},rich:{bolder:{fontWeight:e.propValue.yearfontWeight,fontSize:e.propValue.yearfontSize,color:e.propValue.yearColor}}}})}),u.map((t,p)=>{i.push(`${t.date}  ${t.country}`)}),o={backgroundColor:e.propValue.backgroundColor,grid:{top:0,left:"50%",right:"30%",bottom:0},legend:{bottom:0,itemWidth:10,itemHeight:10,textStyle:{padding:[2,0,0,0]}},xAxis:{show:!1,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!1},splitLine:{show:!1},min:0,max:0},yAxis:{type:"category",axisLine:{show:!0,lineStyle:{width:4,color:"#F5222D"}},axisTick:{show:!1,alignWithLabel:!0},splitLine:{show:!1},axisLabel:{margin:30,alignWithLabel:!0,show:!1},data:["",...i,""]},color:["#333"],series:[{type:"line",symbolSize:8,itemStyle:{color:"red",borderColor:"red",borderWidth:2},hoverAnimation:!1,legendHoverLink:!1,data:[l,...u,l],lineStyle:{color:"#F5222D"}}]},a.value.setOption(o,!0)}function c(){a.value&&a.value.resize()}return(o,r)=>(k(),W("div",{ref_key:"chartRef",ref:d,style:{width:"100%",height:"100%"}},null,512))}}),T=C(K,[["__scopeId","data-v-60d74fd7"]]);export{T as default};
