var p=Object.defineProperty;var f=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var u=(i,o,e)=>o in i?p(i,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[o]=e,h=(i,o)=>{for(var e in o||(o={}))y.call(o,e)&&u(i,e,o[e]);if(f)for(var e of f(o))g.call(o,e)&&u(i,e,o[e]);return i};import{N as b,_ as k,m as x,o as n,e as m,n as L,p as v,F as V,C,f as c,W as D,t as _}from"./index.6de4a353.js";const F={data(){return{roadVisible:!1,roadList:[{name:"\u7545\u901A",value:"0km",color:"#3fff00"},{name:"\u7F13\u6162",value:"0km",color:"#fff700"},{name:"\u62E5\u5835",value:"0km",color:"#ffa500"},{name:"\u4E25\u91CD\u62E5\u5835",value:"0km",color:"#ff0000"},{name:"\u4EA4\u901A\u7BA1\u5236",value:"0km",color:"#710505"}],infoData:{}}},computed:h({},b({map:i=>i.map.map,getTrafficMileage:i=>i.trafficMileage})),watch:{getTrafficMileage:{handler(i,o){if(this.infoData=i,i&&i.mileage){let e={};const l=i.mileage,t=this.$store.state.road.selectRoadId;if(t&&t.length>0){let s={};for(let r in l)t.length==3&&l[r].id==t[2]&&(s[r]=l[r]),t.length==2&&l[r].level2==t[1]&&(s[r]=l[r]),t.length==1&&l[r].level1==t[0]&&(s[r]=l[r]);e=s}else e=l;let a={m:0,m0:0,m1:0,m2:0,m3:0,m4:0};for(let s in e)e[s].level2&&(a.m0+=e[s].m0,a.m1+=e[s].m1,a.m2+=e[s].m2,a.m3+=e[s].m3,a.m4+=e[s].m4,a.m=a.m+e[s].m);let d=a.m0+a.m2+a.m3+a.m4;a.m1=a.m-d,this.roadList[0].value=a.m1.toFixed(2),this.roadList[1].value=a.m2.toFixed(2),this.roadList[2].value=a.m3.toFixed(2),this.roadList[3].value=a.m0.toFixed(2),this.roadList[4].value=a.m4.toFixed(2)}},deep:!0,immediate:!0}},created(){this.$route.name=="operationOverview"&&(this.roadVisible=!0)},methods:{change(i){this.roadVisible=i;const o=this,e=this.map.getAllLayers();let l=[];for(let t in e)t.indexOf("trafficlayer")>-1&&l.push(t);i?(this.infoData.visibility="visible",l.forEach(t=>{o.map.setLayoutProperty(t,"visibility","visible")})):(this.infoData.visibility="none",l.forEach(t=>{o.map.setLayoutProperty(t,"visibility","none")})),this.$store.commit("changeTrafficMileage",this.infoData)}}},M={class:"roadContanier"},N={key:0,class:"btn"},S={key:1,class:"detail"},B={class:"name"},E={class:"val"};function R(i,o,e,l,t,a){const d=x("el-switch");return n(),m("div",M,[t.infoData.visibility?(n(),m("div",N,[L(d,{modelValue:t.roadVisible,"onUpdate:modelValue":o[0]||(o[0]=s=>t.roadVisible=s),"active-text":`${t.roadVisible?"\u9690\u85CF":"\u663E\u793A"}\u5F53\u524D\u8DEF\u51B5(\u53CC\u5411)`,onChange:a.change},null,8,["modelValue","active-text","onChange"])])):v("",!0),t.roadVisible?(n(),m("div",S,[(n(!0),m(V,null,C(t.roadList,(s,r)=>(n(),m("div",{class:"detail-item",key:r},[c("div",B,[c("div",{class:"icon",style:D({background:s.color})},null,4),c("span",null,_(s.name),1)]),c("span",E,_(s.value)+"km",1)]))),128))])):v("",!0)])}var I=k(F,[["render",R],["__scopeId","data-v-362cc978"]]);export{I as R};
