Files
safePower/dist/assets/087AC4D233B64EB0index.CVvjqFKt.js
xiaozhiyong 9c5961efe9 更新
2026-04-29 09:15:49 +08:00

5 lines
13 KiB
JavaScript

/*!
Build based on gin-vue-admin
Time : 1776662816000 */
import{s as e,a,G as t,q as l,H as o,I as n,g as i,c as s,o as r,b as c,f as d,x as u,F as p,J as v,w as m,K as f,t as y,e as b,d as h}from"./087AC4D233B64EB0index.D-00lXMX.js";import{L as g,E as x}from"./087AC4D233B64EB0index.D87tq4Bj.js";const S={class:"background-box"},w={class:"container"},L={class:"left"},z={class:"module-card left-first-module"},k={class:"device-stat-content"},C={class:"device-ring-chart"},M={class:"device-list"},_={class:"device-name"},A={key:0,class:"device-percent"},E={class:"module-card left-second-module"},F={class:"device-status-content"},D={class:"module-card left-third-module"},W={class:"project-bar-chart"},R={class:"center"},T={class:"top2"},P={class:"card map-card"},H={class:"map-container-full",id:"chinaMap",ref:"chinaMap"},j={class:"map-control"},B={class:"control-top"},N={class:"control-value"},G={class:"bottom"},I={class:"scroll-container"},O={class:"scroll-text"},q={style:{"margin-left":"0.1rem"}},J={class:"right"},K={class:"module-card alarm-pending-module"},Q={class:"alarm-pending-chart"},U={class:"module-card alert-distribution-module"},V={class:"alert-distribution-content"},X={class:"alert-ring-chart"},Y={class:"alert-list"},Z={class:"alert-name"},$={class:"alert-count"},ee={class:"alert-percent"},ae={class:"module-card alert-trend-module"},te={class:"alert-trend-chart"},le={__name:"index",setup(le){const oe=a(null),ne=a(180),ie=a(null),se=a([]),re=a([]),ce=a([{name:"其他设备报警",count:1,percent:41.16,color:"#10b981"},{name:"分合闸报警",count:12,percent:39.22,color:"#3b82f6"},{name:"电压报警",count:2,percent:5.41,color:"#06b6d4"},{name:"其他",count:0,percent:14.21,color:"#f59e0b"}]),de=[{value:1,label:"线路1"},{value:2,label:"线路2"},{value:3,label:"线路3"},{value:4,label:"线路4"}],ue=a([]),pe=a([]),ve=a(null),me=a(null),fe=a(null),ye=a(null),be=a(null),he=a([]),ge=a([]),xe=t(()=>ge.value.length);t(()=>ge.value.filter(e=>"online"===e.status).length),t(()=>ge.value.filter(e=>"offline"===e.status).length),t(()=>ge.value.filter(e=>"alarm"===e.status).length);const Se=t(()=>({tooltip:{trigger:"axis",backgroundColor:"rgba(15, 23, 42, 0.9)",borderColor:"#1e3a8a",textStyle:{color:"#e2e8f0"}},grid:{top:"15%",left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:["02-17","02-22","02-27","03-04","03-09","03-14"],axisLine:{lineStyle:{color:"#1e3a8a"}},axisLabel:{color:"#64748b",fontSize:10}},yAxis:{type:"value",name:"次数",nameTextStyle:{color:"#64748b",fontSize:10},splitLine:{lineStyle:{color:"#1e3a8a",type:"dashed"}},axisLine:{lineStyle:{color:"#1e3a8a"}},axisLabel:{color:"#64748b",fontSize:10}},series:[{name:"待处理报警",data:[1,3,2,5,2,3],type:"line",smooth:!0,lineStyle:{color:"#00d4ff",width:2},itemStyle:{color:"#00d4ff"},areaStyle:{color:new g(0,0,0,1,[{offset:0,color:"rgba(0, 212, 255, 0.3)"},{offset:1,color:"rgba(0, 212, 255, 0)"}])},markPoint:{data:[{type:"max",name:"Max"},{type:"min",name:"Min"}]}}]})),we=t(()=>(e=>({series:[{type:"pie",radius:["45%","70%"],center:["50%","50%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:8,borderColor:"#0f172a",borderWidth:2},label:{show:!0,position:"center",formatter:"{total|15}\n{name|报警总数}",rich:{total:{fontSize:28,fontWeight:"bold",color:"#e2e8f0",lineHeight:35},name:{fontSize:14,color:"#94a3b8"}}},labelLine:{show:!1},data:e.map(e=>({value:e.count,name:e.name,itemStyle:{color:e.color}}))}]}))(ce.value)),Le=t(()=>(e=>{const a=e.reduce((e,a)=>e+(a.count||a.value||0),0);return{grid:{top:0,left:0,right:0,bottom:0,containLabel:!1},series:[{type:"pie",radius:["45%","70%"],center:["50%","50%"],avoidLabelOverlap:!1,itemStyle:{borderRadius:8,borderColor:"#0f172a",borderWidth:2},label:{show:!0,position:"center",formatter:"{total|".concat(a,"}\n{name|设备总数}"),rich:{total:{fontSize:18,fontWeight:"bold",color:"#e2e8f0",lineHeight:35},name:{fontSize:12,color:"#94a3b8"}}},labelLine:{show:!1},data:e.map(e=>({value:e.count||0,name:e.cb_type_name||"未知",itemStyle:{color:e.color}}))}]}})(ue.value)),ze=t(()=>(e=>({tooltip:{trigger:"axis",backgroundColor:"rgba(15, 23, 42, 0.9)",borderColor:"#1e3a8a",textStyle:{color:"#e2e8f0"}},grid:{top:"10%",left:"10%",right:"5%",bottom:"15%",containLabel:!0},xAxis:{type:"category",data:e.map(e=>e.projectName||e.name||"未知"),axisLine:{lineStyle:{color:"#1e3a8a"}},axisLabel:{color:"#64748b",fontSize:9,rotate:30,interval:0,overflow:"truncate",width:60,margin:8}},yAxis:{type:"value",name:"数量",nameTextStyle:{color:"#64748b",fontSize:10},splitLine:{lineStyle:{color:"#1e3a8a",type:"dashed"}},axisLine:{lineStyle:{color:"#1e3a8a"}},axisLabel:{color:"#64748b",fontSize:10}},series:[{name:"网关数量",data:e.map(e=>e.gatewayNum||e.count||0),type:"bar",barWidth:"40%",itemStyle:{color:new g(0,0,0,1,[{offset:0,color:"#00d4ff"},{offset:1,color:"#3b82f6"}]),borderRadius:[4,4,0,0]}}]}))(he.value)),ke=t(()=>({tooltip:{trigger:"axis",backgroundColor:"rgba(15, 23, 42, 0.9)",borderColor:"#1e3a8a",textStyle:{color:"#e2e8f0"}},legend:{data:["二级报警","报警","预警"],right:10,top:0,textStyle:{color:"#94a3b8",fontSize:10},itemWidth:10,itemHeight:10},grid:{top:"15%",left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:["01","05","10","15","20","25","30"],axisLine:{lineStyle:{color:"#1e3a8a"}},axisLabel:{color:"#64748b",fontSize:10}},yAxis:{type:"value",name:"数量",nameTextStyle:{color:"#64748b",fontSize:10},splitLine:{lineStyle:{color:"#1e3a8a",type:"dashed"}},axisLine:{lineStyle:{color:"#1e3a8a"}},axisLabel:{color:"#64748b",fontSize:10}},series:[{name:"二级报警",data:[0,1,1,2,0,0,3],type:"line",smooth:!0,lineStyle:{color:"#a855f7",width:2},itemStyle:{color:"#a855f7"},markPoint:{data:[{type:"max",name:"Max"},{type:"min",name:"Min"}]}},{name:"报警",data:[1,0,0,1,1,1,0],type:"line",smooth:!0,lineStyle:{color:"#ef4444",width:2},itemStyle:{color:"#ef4444"},markPoint:{data:[{type:"max",name:"Max"},{type:"min",name:"Min"}]}},{name:"预警",data:[0,1,1,0,1,1,1],type:"line",smooth:!0,lineStyle:{color:"#f59e0b",width:2},itemStyle:{color:"#f59e0b"},markPoint:{data:[{type:"max",name:"Max"},{type:"min",name:"Min"}]}}]})),Ce=()=>{const e=(document.documentElement.clientWidth||document.body.clientWidth)/1920,a=(document.documentElement.clientHeight||document.body.clientHeight)/1080,t=100*Math.min(e,a);document.documentElement.style.fontSize=t+"px"};l(()=>{Ce(),window.addEventListener("resize",Ce),o(()=>{oe.value&&(ne.value=oe.value.offsetHeight)}),Me(),_e(),Ae(),Ee(),Fe(),De()});const Me=()=>{e({url:"/device/getDeviceWarningList",method:"post"}).then(e=>{0===e.code&&(re.value=e.data)})},_e=()=>{e({url:"/device/getDeviceCategoryGroup",method:"post"}).then(e=>{if(0===e.code){const a=["#FFED71","#009FFF","#53E8FF","#C790FF","#9EFFDD","#FFB57D"];ue.value=e.data.map((e,t)=>({name:e.cb_type_name||"--",count:e.count||0,color:a[t%a.length]}))}})},Ae=()=>{e({url:"/device/getDeviceChangeList",method:"post"}).then(e=>{0===e.code&&(pe.value=e.data)})},Ee=()=>{e({url:"/device/getProjectCategoryGroup",method:"post"}).then(e=>{0===e.code&&(he.value=e.data)})},Fe=()=>{e({url:"/device/getDeviceGatewayList",method:"post"}).then(e=>{0===e.code&&(ge.value=e.data.map(e=>({...e,status:e.status||"online"})),o(()=>{We()}))})},De=()=>{"undefined"!=typeof AMap&&(ie.value=new AMap.Map("chinaMap",{zoom:5,center:[116.4074,39.9042],mapStyle:"amap://styles/darkblue",viewMode:"2D",features:["bg","road","building","point"]}),ie.value.on("complete",()=>{ge.value&&ge.value.length>0&&We()}))},We=()=>{if(!ie.value||!ge.value||0===ge.value.length)return;se.value.forEach(e=>{ie.value.remove(e)}),se.value=[];ge.value.slice(0,20).forEach((e,a)=>{const t=new AMap.Marker({position:[e.gatewayLong,e.gatewayLat],content:Re(e.status),zIndex:5}),l=new AMap.InfoWindow({content:Te(e),offset:new AMap.Pixel(0,-30)});t.on("click",()=>{l.open(ie.value,t.getPosition())}),ie.value.add(t),se.value.push(t)})},Re=e=>{const a="online"===e?"#10b981":"alarm"===e?"#ef4444":"#64748b";return'\n <div style="\n width: 12px;\n height: 12px;\n background-color: '.concat(a,";\n border-radius: 50%;\n border: 2px solid #fff;\n box-shadow: 0 0 10px ").concat(a,';\n "></div>\n ')},Te=e=>{const a="online"===e.status?"在线":"alarm"===e.status?"告警":"离线",t="online"===e.status?"#10b981":"alarm"===e.status?"#ef4444":"#64748b";return'\n <div style="\n padding: 10px;\n background-color: rgba(15, 23, 42, 0.9);\n border: 1px solid #1e3a8a;\n border-radius: 4px;\n color: #e2e8f0;\n min-width: 150px;\n ">\n <div style="font-size: 12px; margin-bottom: 3px;">状态: <span style="color: '.concat(t,';">').concat(a,'</span></div>\n <div style="font-size: 12px;">地址: ').concat(e.gatewayAddress||"","</div>\n </div>\n ")};return n(()=>{window.removeEventListener("resize",Ce),document.documentElement.style.fontSize=""}),(e,a)=>{const t=i("el-table-column"),l=i("el-table");return r(),s("div",S,[c("div",w,[c("div",L,[c("div",z,[a[0]||(a[0]=c("div",{class:"module-header"},[c("div",{class:"module-title"},[c("span",{class:"title-icon"}),c("span",null,"设备统计")])],-1)),c("div",k,[c("div",C,[d(u(x),{ref_key:"deviceStatChartRef",ref:ye,option:Le.value,autoresize:""},null,8,["option"])]),c("div",M,[(r(!0),s(p,null,v(ue.value,(e,a)=>(r(),s("div",{class:"device-item",key:a},[c("span",{class:"device-dot",style:f({backgroundColor:e.color})},null,4),c("span",_,y(e.name||e.deviceTypeName),1),c("span",{class:"device-count",style:f({color:e.color})},y(e.count||e.value),5),void 0!==e.percent?(r(),s("span",A,y(e.percent)+"%",1)):h("",!0)]))),128))])])]),c("div",E,[a[1]||(a[1]=c("div",{class:"module-header"},[c("div",{class:"module-title"},[c("span",{class:"title-icon"}),c("span",null,"设备状态通知")])],-1)),c("div",F,[d(l,{data:pe.value,height:"20vh",style:{width:"100%"},"show-header":!1,"header-cell-style":{background:"transparent",color:"#fff",border:"none"},"cell-style":{color:"#fff",border:"none"}},{default:m(()=>[d(t,{prop:"cbTypeName",label:"设备名称",align:"center",width:"100"}),d(t,{prop:"type",label:"设备状态",align:"center",width:"70"},{default:m(({row:e})=>[c("span",{style:f({color:"device_online"===e.type?"green":"red"})},y("device_online"===e.type?"上线":"下线"),5)]),_:1}),d(t,{prop:"time",label:"时间",align:"center"})]),_:1},8,["data"])])]),c("div",D,[a[2]||(a[2]=c("div",{class:"module-header"},[c("div",{class:"module-title"},[c("span",{class:"title-icon"}),c("span",null,"项目数量")])],-1)),c("div",W,[d(u(x),{ref_key:"projectBarChartRef",ref:be,option:ze.value,autoresize:""},null,8,["option"])])])]),c("div",R,[a[6]||(a[6]=c("div",{class:"title"},"智慧用电安全监控平台",-1)),c("div",T,[c("div",P,[a[5]||(a[5]=c("div",{class:"card-title",style:{display:"none"}},"设备分布",-1)),c("div",H,[c("div",j,[c("div",B,[a[3]||(a[3]=c("div",{class:"control-title"},"设备总数量",-1)),c("div",N,y(xe.value),1)]),a[4]||(a[4]=b('<div class="control-bottom"><div class="control-title">设备状态</div><div class="status-list"><div class="status-item"><div class="status-dot online"></div><span>在线</span></div><div class="status-item"><div class="status-dot alarm"></div><span>告警</span></div><div class="status-item"><div class="status-dot offline"></div><span>离线</span></div></div></div>',1))])],512)])]),c("div",G,[c("div",{ref_key:"bottomRef",ref:oe,style:{height:"100%"}},[d(l,{data:re.value,height:ne.value,style:{width:"100%"},stripe:"","show-header":!0},{default:m(()=>[d(t,{type:"index",width:"50"}),d(t,{prop:"cbTypeName",label:"设备名称",align:"center"}),d(t,{prop:"gatewayAddress",label:"地点",align:"center"},{default:m(({row:e})=>[c("div",I,[c("div",O,[c("span",null,y(e.gatewayAddress),1),c("span",q,y(e.gatewayAddress),1)])])]),_:1}),d(t,{prop:"cbTypeCode",label:"设备型号",align:"center"}),d(t,{prop:"warningContent",label:"报警类型",align:"center"}),d(t,{prop:"rate",label:"线路",align:"center"},{default:m(({row:e})=>{var a;return[c("span",null,y((null==(a=de.find(a=>a.value===e.gatewayType))?void 0:a.label)||"-"),1)]}),_:1})]),_:1},8,["data","height"])],512)])]),c("div",J,[c("div",K,[a[7]||(a[7]=c("div",{class:"module-header"},[c("div",{class:"module-title"},[c("span",{class:"title-icon"}),c("span",null,"待处理报警")])],-1)),c("div",Q,[d(u(x),{ref_key:"alarmPendingChartRef",ref:ve,option:Se.value,autoresize:""},null,8,["option"])])]),c("div",U,[a[8]||(a[8]=c("div",{class:"module-header"},[c("div",{class:"module-title"},[c("span",{class:"title-icon"}),c("span",null,"警情分布")])],-1)),c("div",V,[c("div",X,[d(u(x),{ref_key:"alertDistributionChartRef",ref:me,option:we.value,autoresize:""},null,8,["option"])]),c("div",Y,[(r(!0),s(p,null,v(ce.value,(e,a)=>(r(),s("div",{class:"alert-item",key:a},[c("span",{class:"alert-dot",style:f({backgroundColor:e.color})},null,4),c("span",Z,y(e.name),1),c("span",$,y(e.count),1),c("span",ee,y(e.percent)+"%",1)]))),128))])])]),c("div",ae,[a[9]||(a[9]=c("div",{class:"module-header"},[c("div",{class:"module-title"},[c("span",{class:"title-icon"}),c("span",null,"警情趋势")])],-1)),c("div",te,[d(u(x),{ref_key:"alertTrendChartRef",ref:fe,option:ke.value,autoresize:""},null,8,["option"])])])])])])}}};export{le as default};