import{b as z,J as P,ah as D,w as F,bM as y,o as f,c as v,p as l,q as s,P as u,n as o,F as h,A as U,y as w,x as g,aj as A,l as q,k as O,E as j,i as J,j as L,m as M,D as W}from"./index.8d733f79.js";import{a as G,d as H}from"./multiDiagnosis.8917b8b6.js";import K from"./deviceStatusDialog.20e27268.js";const Q={style:{height:"100%"},class:"df-c"},ae={__name:"tabPane4",setup(X,{expose:$}){const{t:T,locale:Y}=z(),{proxy:i}=W(),S=P.session.getJSON("enums").runStatus,c=D({total:0,tableData:[],columns:[{prop:"deviceName",label:"deviceName"},{prop:"runStatus",label:"runState",formatter:e=>S.find(n=>n.key===e.runStatus).desc},{prop:"diagnosis",label:"diagnosisConclusion"},{prop:"advice",label:"repairAdvice"},{prop:"createBy",label:"createBy"},{prop:"createTime",label:"effectiveTime",width:200},{prop:"updateBy",label:"updateBy"},{prop:"updateTime",label:"modifyTime",width:200},{label:"action",type:"action",width:150,fixed:"right"}]}),a=D({factoryId:null,deviceId:null,startTime:"",endTime:"",runStatus:null,advice:"",diagnosis:"",pageNo:1,pageSize:10});let p;F(()=>y().atlasTimeRange,e=>{console.log("\u65F6\u95F4\u9009\u62E9",e),_(p)});const _=e=>{p=e,a.factoryId=e.factoryId,a.deviceId=e.deviceId||e.id,a.startTime=y().atlasTimeRange[0],a.endTime=y().atlasTimeRange[1],d()};async function d(){const e=await G(a);c.total=e.data.totalElements,c.tableData=e.data.content}const C=()=>{i.$refs.formRef.resetFields(),d()},I=()=>{i.$refs.deviceStatusDialogRef.showDialog(p)},V=e=>{i.$refs.deviceStatusDialogRef.showDialog(p,e,!1)},N=e=>{i.$refs.deviceStatusDialogRef.showDialog(p,e,!0)},R=e=>{i.$modal.confirm(T("confirmDelete")).then(()=>{H({statusId:e.id}).then(n=>{i.$modal.msgSuccess(n.msg),d()})}).catch(()=>{})};return $({initData:_}),(e,n)=>{const r=q,m=O,E=j,B=J,b=L,x=M;return f(),v("div",Q,[l(x,{ref:"formRef",model:o(a),inline:!0},{default:s(()=>[l(m,null,{default:s(()=>[l(r,{type:"primary",onClick:I},{default:s(()=>[u("\u65B0\u589E")]),_:1})]),_:1}),l(m,{label:"\u8FD0\u884C\u72B6\u6001",prop:"runStatus"},{default:s(()=>[l(B,{modelValue:o(a).runStatus,"onUpdate:modelValue":n[0]||(n[0]=t=>o(a).runStatus=t),clearable:""},{default:s(()=>[(f(!0),v(h,null,U(o(S),t=>(f(),w(E,{key:t.key,label:t.desc,value:t.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(m,{label:"\u8BCA\u65AD\u7ED3\u8BBA",prop:"diagnosis"},{default:s(()=>[l(b,{modelValue:o(a).diagnosis,"onUpdate:modelValue":n[1]||(n[1]=t=>o(a).diagnosis=t),placeholder:"\u8BF7\u8F93\u5165",maxlength:"300",style:{width:"236px"}},null,8,["modelValue"])]),_:1}),l(m,{label:"\u7EF4\u62A4\u7EF4\u4FEE\u5EFA\u8BAE",prop:"advice"},{default:s(()=>[l(b,{modelValue:o(a).advice,"onUpdate:modelValue":n[2]||(n[2]=t=>o(a).advice=t),placeholder:"\u8BF7\u8F93\u5165",maxlength:"300",style:{width:"236px"}},null,8,["modelValue"])]),_:1}),l(m,null,{default:s(()=>[l(r,{type:"primary",onClick:d},{default:s(()=>[u(g(e.$t("query")),1)]),_:1}),l(r,{onClick:C},{default:s(()=>[u(g(e.$t("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"]),l(o(A),{tableWrapId:"deviceStatusDialog",class:"f-h",columns:o(c).columns,tableData:o(c).tableData,total:o(c).total,pageNum:o(a).pageNo,"onUpdate:pageNum":n[3]||(n[3]=t=>o(a).pageNo=t),pageSize:o(a).pageSize,"onUpdate:pageSize":n[4]||(n[4]=t=>o(a).pageSize=t),onPagination:d},{action:s(({scope:t})=>[t.row.latestRecord?(f(),v(h,{key:0},[l(r,{link:"",type:"primary",onClick:k=>V(t.row)},{default:s(()=>[u(g(e.$t("edit")),1)]),_:2},1032,["onClick"]),l(r,{link:"",type:"primary",onClick:k=>R(t.row)},{default:s(()=>[u(g(e.$t("delete")),1)]),_:2},1032,["onClick"])],64)):(f(),w(r,{key:1,link:"",type:"primary",onClick:k=>N(t.row)},{default:s(()=>[u(g(e.$t("view")||"\u67E5\u770B"),1)]),_:2},1032,["onClick"]))]),_:1},8,["columns","tableData","total","pageNum","pageSize"]),l(K,{ref:"deviceStatusDialogRef",onRefresh:d},null,512)])}}};export{ae as default};
