2 lines
9.0 KiB
JavaScript
2 lines
9.0 KiB
JavaScript
import{M as Y,_ as Z,a as ee,b as ae,c as te,d as se,e as oe,f as ne,g as le,h as ie,i as ue,j as re,k as ce,l as ge,m as _e,n as ve,o as de,p as pe,q as fe,r as we}from"./index-535eef0a.js";import{d as me,r as c,a0 as Ae,w as V,b as he,c as W,e as B,f as E,h as m,i as z,g as t,t as d,S as Ie,T as be,F as ye,j as Fe,p as Ne,q as Se,s as Be,_ as Ee}from"./index-ccab2584.js";import{_ as xe}from"./\u89C6\u9891-03c25095.js";import{_ as Me}from"./\u62A5\u8B66-7c613339.js";import{o as q,p as R,h as D,i as P,q as Ce,A as Le,r as ke}from"./goverment-af43d804.js";import{i as ze}from"./AMap-2a1da440.js";import{L as De}from"./LeftMenu-58ad9ebd.js";import"./index-19fed1a2.js";const b=y=>(Se("data-v-a462c993"),y=y(),Be(),y),Pe={class:"warning-page"},Ge=b(()=>t("div",{id:"map-container",class:"map"},null,-1)),je=["onClick"],Te={class:"projectName"},Ve={class:"leftMenu_item flx-justify-between"},We={class:"flx-justify-between"},qe=b(()=>t("img",{src:xe,alt:""},null,-1)),Re={class:"middleSize"},Oe=b(()=>t("img",{src:Me,alt:""},null,-1)),Ue={class:"middleSize"},$e={class:"bottom_item flx-justify-between",style:{"margin-top":"6px"}},Je={class:"bottomSize"},Qe={class:"bottomSize"},He={class:"title flx-justify-between"},Ke={class:"info-top"},Xe={class:"ellipsisName"},Ye={key:0,class:"flag"},Ze={class:"card flx-column"},ea={style:{color:"#cf2c22"}},aa=b(()=>t("hr",{style:{"background-color":"#e5e5e5",height:"1px",border:"none"}},null,-1)),ta=b(()=>t("div",null,"\u62A5\u8B66\u8BB0\u5F55",-1)),sa=["src"],oa=me({__name:"index",setup(y){const p=c(0),i=c({pageNo:1,pageSize:6,total:0}),O=c({installed:"\u5DF2\u5B89\u88C5AI\u8BBE\u5907\u5DE5\u7A0B",rate:"AI\u8BBE\u5907\u5B89\u88C5\u8986\u76D6\u7387",accumulate:"\u7D2F\u8BA1AI\u9884\u8B66\u6B21\u6570"}),_=c([]),n=c([]),G=c([]),l=c(),A=c(!1),I=c(""),x=c(!1),M=c(),f=c({createTime:"",name:"",projectName:"",aiMonitorAlarmList:[],countGroupByType:[],engineeringName:""}),w=Ae(),F=async e=>{var g;const a=n.value.find(u=>p.value===0?u.projectSn===e.projectSn:u.engineeringSn===e.engineeringSn);n.value=n.value.map(u=>u===a?{...a,showGif:!0}:{...u,showGif:!1}),e.longitude&&e.latitude&&((g=w.value)==null||g.setCenter([+e.longitude,+e.latitude]),U(a))},U=async e=>{var s;const a=o=>new URL(Object.assign({})[`../../../assets/images/AIwaring/${o}`],self.location).href;let g=C("selected",e.environAlarmFlag===!1?a("clouding.gif"):a("warnclouding.gif")),u=new l.value.Marker({position:new l.value.LngLat(Number(e.longitude)||113,Number(e.latitude)||21),icon:g,offset:new l.value.Pixel(-13,-30)});(s=w.value)==null||s.add([u]),n.value=n.value.map(o=>o.latitude==e.latitude&&o.longitude==e.longitude?{...e,showGif:!0}:{...o,showGif:!1,showInfo:!1});const v=n.value.find(o=>o.showGif);if(v.showInfo=!v.showInfo,x.value=e.aiAlarmFlag,p.value===0){I.value=e.projectName;const{result:o}=await q({projectId:e.projectId});f.value=o}else{I.value=e.engineeringName;const{result:o}=await R({id:e.id});f.value=o}v.showInfo?(A.value=!0,new l.value.InfoWindow({isCustom:!0,content:M.value,offset:new AMap.Pixel(16,-45)}).open(w.value,u.getPosition())):(A.value=!1,L())},$=async e=>{if(p.value===0){const{result:a}=await D({projectName:e,...i.value});_.value=a.records}else{const{result:a}=await P({engineeringName:e,...i.value});_.value=a.records}},J=async e=>{if(p.value===0){const{result:a}=await D({...i.value,pageNo:e});_.value=a.records,i.value.total=+a.total}else{const{result:a}=await P({...i.value,pageNo:e});_.value=a.records,i.value.total=+a.total}},N=e=>new URL(Object.assign({"../../../../assets/images/AIwaring/AI\u8BBE\u5907\u5B89\u88C5\u8986\u76D6\u7387.png":Z,"../../../../assets/images/AIwaring/blueCloud.png":ee,"../../../../assets/images/AIwaring/clouding.gif":ae,"../../../../assets/images/AIwaring/dustMap.png":te,"../../../../assets/images/AIwaring/redCloud.png":se,"../../../../assets/images/AIwaring/warnclouding.gif":oe,"../../../../assets/images/AIwaring/warning.gif":ne,"../../../../assets/images/AIwaring/zhengchang.png":le,"../../../../assets/images/AIwaring/zhenging.gif":ie,"../../../../assets/images/AIwaring/\u5347\u964D\u673A.png":ue,"../../../../assets/images/AIwaring/\u5854\u540A.png":re,"../../../../assets/images/AIwaring/\u5DF2\u5B89\u88C5AI\u8BBE\u5907\u5DE5\u7A0B.png":ce,"../../../../assets/images/AIwaring/\u5DF2\u6574\u6539\u9690\u60A3.png":ge,"../../../../assets/images/AIwaring/\u6293\u62CD.png":_e,"../../../../assets/images/AIwaring/\u62A5\u8B66.png":ve,"../../../../assets/images/AIwaring/\u7D2F\u8BA1AI\u9884\u8B66\u6B21\u6570.png":de,"../../../../assets/images/AIwaring/\u89C6\u9891.png":pe,"../../../../assets/images/AIwaring/\u9690\u60A3.png":fe,"../../../../assets/images/AIwaring/\u9884\u8B66.png":we})[`../../../../assets/images/AIwaring/${e}`],self.location).href,C=(e,a)=>e==="start"?new l.value.Icon({size:new l.value.Size(52,52),image:a,imageSize:new l.value.Size(52,52)}):new l.value.Icon({size:new l.value.Size(52,52),image:a,imageSize:new l.value.Size(52,52)}),S=()=>{var e;(e=w.value)==null||e.clearMap(),n.value.forEach(a=>{var s;let g=C("start",a.aiAlarmFlag===!1?N("zhengchang.png"):N("\u9884\u8B66.png")),u=C("selected",a.aiAlarmFlag===!1?N("zhenging.gif"):N("warning.gif")),v=new l.value.Marker({position:new l.value.LngLat(Number(a.longitude)||113,Number(a.latitude)||21),icon:a.showGif?u:g,offset:new l.value.Pixel(-13,-30)});(s=w.value)==null||s.add([v]),v.on("click",async function(o){n.value=n.value.map(r=>r===a?{...a,showGif:!0}:{...r,showGif:!1,showInfo:!1});const h=n.value.find(r=>r.showGif);if(h.showInfo=!h.showInfo,x.value=a.aiAlarmFlag,p.value===0){I.value=a.projectName;const{result:r}=await q({projectId:a.projectId});f.value=r}else{I.value=a.engineeringName;const{result:r}=await R({id:a.id});f.value=r}h.showInfo?(A.value=!0,new l.value.InfoWindow({isCustom:!0,content:M.value,offset:new AMap.Pixel(16,-45)}).open(w.value,v.getPosition())):(A.value=!1,L())})})},Q=async()=>{const e=await ze();l.value=e,w.value=new e.Map("map-container",{zoom:7,center:[116.481181,39.90923],viewMode:"2D",resizeEnable:!0})},L=()=>{var e;(e=w.value)==null||e.clearInfoWindow(),n.value=n.value.map(a=>({...a,showInfo:!1})),A.value=!1},j=async()=>{const{result:e}=await D(i.value);_.value=e.records,i.value.total=Number(e.total)},H=async()=>{const{result:e}=await P(i.value);_.value=e.records,i.value.total=+e.total},K=async()=>{const e=await Ce();G.value=e.result},T=async()=>{const{result:e}=await Le({});n.value=e},X=async()=>{const{result:e}=await ke({});n.value=e};V(()=>p.value,async e=>{i.value.pageNo=1,i.value.total=0,e===0?(await j(),await T(),F(_.value[0]),S()):(await H(),await X(),F(_.value[0]),S())},{deep:!0}),V(()=>n.value,()=>{S()});function k(e){return e.trim()?JSON.parse(e):{}}return he(async()=>{await Q(),K(),T(),await j(),F(_.value[0]),S()}),(e,a)=>{var v;const g=W("el-table-column"),u=W("el-table");return B(),E("div",Pe,[Ge,m(De,{modelValue:p.value,"onUpdate:modelValue":a[0]||(a[0]=s=>p.value=s),tabs:["\u9879\u76EE\u540D\u79F0","\u5DE5\u7A0B\u540D\u79F0"],records:_.value,pageable:i.value,class:"LeftMenu",onSearch:$,onChangePage:J},{default:z(({data:s})=>{var o,h,r;return[t("div",{class:"leftProject",onClick:na=>F(s)},[t("span",Te,d(s.projectName||s.engineeringName),1),t("div",Ve,[t("div",We,[qe,t("span",Re,"\u63A5\u5165\u89C6\u9891\u8DEF\u6570\uFF1A"+d(s.deviceNum),1)]),t("div",null,[Oe,t("span",Ue,"\u4ECA\u65E5\u62A5\u8B66\u6B21\u6570\uFF1A"+d(s.aiAlarmStat===null?0:(o=k(s.aiAlarmStat))==null?void 0:o.todayAlarm),1)])]),t("div",$e,[t("div",null,[t("span",Je,"\u4ECA\u65E5\u5F85\u6574\u6539\u95EE\u9898\uFF1A"+d(s.aiAlarmStat===null?0:(h=k(s.aiAlarmStat))==null?void 0:h.questionNum),1)]),t("div",null,[t("span",Qe,"\u4ECA\u65E5\u5DF2\u6574\u6539\u95EE\u9898\uFF1A"+d(s.aiAlarmStat===null?0:(r=k(s.aiAlarmStat))==null?void 0:r.solveQuestionNum),1)])])],8,je)]}),_:1},8,["modelValue","records","pageable"]),m(Y,{data:G.value,title:O.value},null,8,["data","title"]),Ie(t("div",{class:"infowindows",ref_key:"infoWindowPage",ref:M},[t("div",He,[t("span",null,d(I.value),1),t("p",{onClick:L},"x")]),t("div",Ke,[t("div",Xe,"\u8BBE\u5907\u540D\u79F0\uFF1A"+d(f.value.deviceName),1),t("div",null,"\u6700\u540E\u4E00\u6B21\u4E0A\u4F20\u65F6\u95F4\uFF1A"+d((v=f.value.aiMonitorAlarmList[0])==null?void 0:v.reportTime),1),x.value?(B(),E("div",Ye,[(B(!0),E(ye,null,Fe(f.value.countGroupByType,s=>(B(),E("div",{key:s.typeName},[t("div",Ze,[t("span",ea,d(s.num)+"\u6B21 ",1),t("span",null,d(s.typeName),1)])]))),128))])):Ne("",!0),aa,ta,m(u,{ref:"proTable","header-cell-style":{textAlign:"center"},"cell-style":{textAlign:"center"},data:f.value.aiMonitorAlarmList,"max-height":"250",style:{background:"transparent !important"}},{default:z(()=>[m(g,{"show-overflow-tooltip":"",label:"\u62A5\u8B66\u4E8B\u4EF6",property:"typeName"}),m(g,{"show-overflow-tooltip":"",label:"\u62A5\u8B66\u65F6\u95F4",property:"reportTime"}),m(g,{"show-overflow-tooltip":"",label:"\u663E\u793A\u56FE\u7247",property:"image"},{default:z(({row:s})=>[t("img",{style:{width:"42px",height:"24px"},src:s.image},null,8,sa)]),_:1}),m(g,{"show-overflow-tooltip":"",label:"\u4F4D\u7F6E",property:"deviceName"})]),_:1},8,["data"])])],512),[[be,A.value]])])}}});const da=Ee(oa,[["__scopeId","data-v-a462c993"]]);export{da as default};
|