import{a as M,u as J,ah as N,r as L,e as O,d_ as Y,$ as F,cE as T,o as k,c as H,v,p as l,q as o,x as r,n as t,s as U,P as h,aH as $,y as C,aj as Q,ak as j,k as G,l as K,m as W,D as X}from"./index.8d733f79.js";import{E as Z}from"./el-date-picker-panel.089dbe6d.js";import{u as D}from"./searchStore.0c98fb50.js";import"./panel-time-pick.b2dd8e75.js";import"./index.28f6da25.js";const x={class:"subPage-content"},ee={class:"nav"},ae={style:{"font-weight":"normal","font-size":"16px"}},te={class:"details-wrap df-c"},me={__name:"detailList",setup(se){const u=M(),c=J(),{proxy:y}=X(),S=[new Date(2e3,1,1,0,0,0),new Date(2e3,2,1,23,59,59)],A=u.query.deviceName,m=N({total:0,tableData:[],columns:[{prop:"diagnosisResult",label:"diagnosisResult",showAll:!0},{prop:"diagnosisTime",label:"diagnosisTime",width:220},{label:"action",type:"action",width:220,fixed:"right"}]}),a=N({deviceId:u.query.deviceId,startTime:"",endTime:"",pageNo:1,pageSize:10}),i=L([]),I=()=>{c.push("/alarm/intelligentDiagnosis")};O(()=>{u.query.ids&&(a.ids=u.query.ids),p()});const R=()=>{a.startTime=i.value.length?i.value[0]:"",a.endTime=i.value.length?i.value[1]:""};async function p(){const e=await Y(a);m.total=e.data.totalElements,m.tableData=e.data.content}const P=()=>{y.$refs.formRef.resetFields(),i.value=[],a.startTime="",a.endTime="",p()},w=e=>{c.push({path:"/alarm/intelligentDiagnosis/detail",query:{id:e.id,deviceName:e.deviceName,deviceId:e.deviceId}})},E=e=>{var s;if((s=e.alarmInfo)!=null&&s.length){const f=["raw","observe","fault","closed"].map(d=>e.alarmInfo.find(g=>g.status===d)).find(d=>d!==void 0);y.$router.hasRoute("smartAlarm")?(D().setAiAlarmTab(f.status),D().setJumpAlarmQuery({alarmList:JSON.stringify(e.alarmInfo)}),c.push("/alarm/process")):y.$router.hasRoute("allStatusAlarm")&&(D().setJumpAlarmQuery({status:f.status,alarmList:JSON.stringify(e.alarmInfo)}),c.push("/alarm/allAlarm"))}};return(e,s)=>{const b=F("Back"),f=j,d=Z,g=G,_=K,q=W,z=T("hasPermi"),B=T("hasMenuPer");return k(),H("div",x,[v("div",ee,[l(f,{color:"#0052D9",size:"24",onClick:I,style:{cursor:"pointer"}},{default:o(()=>[l(b)]),_:1}),v("span",null,r(e.$t("diagnosisDetail")),1),v("span",ae,r(e.$t("deviceName"))+"\uFF1A"+r(t(A)),1)]),v("div",te,[l(q,{ref:"formRef",model:t(a),inline:!0},{default:o(()=>[l(g,{label:e.$t("diagnosisTime"),prop:"timeRange"},{default:o(()=>[l(d,{modelValue:t(i),"onUpdate:modelValue":s[0]||(s[0]=n=>U(i)?i.value=n:null),type:"datetimerange","start-placeholder":e.$t("startTime"),"end-placeholder":e.$t("endTime"),"value-format":"YYYY-MM-DD HH:mm:ss","default-time":S,clearable:!1,onChange:R},null,8,["modelValue","start-placeholder","end-placeholder"])]),_:1},8,["label"]),l(g,null,{default:o(()=>[l(_,{type:"primary",onClick:p},{default:o(()=>[h(r(e.$t("query")),1)]),_:1}),l(_,{onClick:P},{default:o(()=>[h(r(e.$t("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"]),l(t(Q),{class:"f-h",columns:t(m).columns,tableData:t(m).tableData,total:t(m).total,pageNum:t(a).pageNo,"onUpdate:pageNum":s[1]||(s[1]=n=>t(a).pageNo=n),pageSize:t(a).pageSize,"onUpdate:pageSize":s[2]||(s[2]=n=>t(a).pageSize=n),onPagination:p},{action:o(({scope:n})=>[$((k(),C(_,{link:"",type:"primary",onClick:V=>w(n.row)},{default:o(()=>[h(r(e.$t("detail")),1)]),_:2},1032,["onClick"])),[[z,["alarm_intelligentDiagnosis_view"]]]),$((k(),C(_,{link:"",type:"primary",onClick:V=>E(n.row)},{default:o(()=>[h(r(e.$t("linkAlarm")),1)]),_:2},1032,["onClick"])),[[B,["process","allAlarm"]]])]),_:1},8,["columns","tableData","total","pageNum","pageSize"])])])}}};export{me as default};
