import{_ as L,a as J,u as T,r as m,J as M,ah as G,$ as H,o as d,y as g,q as n,n as a,c as S,p as o,P as $,x as C,t as I,v as u,F as D,A as E,s as K,E as Q,i as W,k as X,j as Y,m as Z,ak as ee,l as le,bv as ae,a0 as te,a1 as se,D as oe}from"./index.8d733f79.js";import{b as ne,e as ie,f as de}from"./multiDiagnosis.8917b8b6.js";const R=v=>(te("data-v-35dc8ab7"),v=v(),se(),v),ue={class:"form-container"},re={class:"form-section"},ce=R(()=>u("div",{class:"sub-title"},"\u6700\u8FD1\u4E00\u6B21\u8BBE\u5907\u72B6\u6001",-1)),pe={class:"box"},me={class:"form-section"},ve=R(()=>u("div",{class:"sub-title"},"\u5F53\u524D\u8BBE\u5907\u72B6\u6001",-1)),fe={class:"box"},_e={key:0,class:"dialog-footer"},ge={__name:"deviceStatusDialog",emits:["refresh"],setup(v,{expose:x,emit:U}){const{proxy:b}=oe();J(),T();const r=m(!1),f=m(!1),h=m(""),i=m({}),s=m({deviceId:null,advice:"",diagnosis:"",runStatus:null}),V=M.session.getJSON("enums").runStatus,N=G({runStatus:[{required:!0,message:"\u8BF7\u9009\u62E9\u8FD0\u884C\u72B6\u6001",trigger:"change"}],advice:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BCA\u65AD\u7ED3\u8BBA",trigger:"blur"}],diagnosis:[{required:!0,message:"\u8BF7\u8F93\u5165\u7EF4\u62A4\u7EF4\u4FEE\u5EFA\u8BAE",trigger:"blur"}]});function O(t,e,c=!1){r.value=!0,f.value=c,s.value.deviceId=t.deviceId||t.id,h.value=t.label,z(t),e&&(s.value.id=e.id,s.value.runStatus=e.runStatus,s.value.advice=e.advice,s.value.diagnosis=e.diagnosis)}const z=t=>{ne({deviceId:t.deviceId||t.id}).then(e=>{e.data?i.value=e.data:i.value={}})},A=()=>{b.$refs.formRef.validate(t=>{t?(s.value.id?ie:de)(s.value).then(c=>{b.$modal.msgSuccess(c.msg),U("refresh"),r.value=!1}):console.log("error submit!")})},B=()=>{i.value.runStatus&&(s.value.runStatus=i.value.runStatus,s.value.advice=i.value.advice,s.value.diagnosis=i.value.diagnosis)},F=()=>{s.value={},setTimeout(()=>{b.$refs.formRef.clearValidate()},0)};return x({showDialog:O}),(t,e)=>{const c=Q,y=W,p=X,_=Y,w=Z,P=H("Right"),q=ee,k=le,j=ae;return d(),g(j,{title:`\u8BBE\u5907\u72B6\u6001\u7EF4\u62A4(${a(h)})`,modelValue:a(r),"onUpdate:modelValue":e[7]||(e[7]=l=>K(r)?r.value=l:null),width:"1100","align-center":!0,onClosed:F},{footer:n(()=>[a(f)?I("",!0):(d(),S("div",_e,[o(k,{onClick:e[6]||(e[6]=l=>r.value=!1)},{default:n(()=>[$(C(t.$t("cancel")),1)]),_:1}),o(k,{type:"primary",onClick:A},{default:n(()=>[$(C(t.$t("confirm")),1)]),_:1})]))]),default:n(()=>[u("div",ue,[u("div",re,[ce,o(w,{model:a(i),disabled:"","label-width":"96","label-position":"left"},{default:n(()=>[u("div",pe,[o(p,{label:"\u8FD0\u884C\u72B6\u6001",prop:"runStatus"},{default:n(()=>[o(y,{modelValue:a(i).runStatus,"onUpdate:modelValue":e[0]||(e[0]=l=>a(i).runStatus=l),style:{width:"100%"},teleported:!1},{default:n(()=>[(d(!0),S(D,null,E(a(V),l=>(d(),g(c,{key:l.key,label:l.desc,value:l.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(p,{label:t.$t("diagnosisConclusion"),prop:"diagnosis"},{default:n(()=>[o(_,{type:"textarea",modelValue:a(i).diagnosis,"onUpdate:modelValue":e[1]||(e[1]=l=>a(i).diagnosis=l),maxlength:"300",rows:"5",resize:"none","show-word-limit":"",placeholder:t.$t("diagnosisConclusionP")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(p,{label:t.$t("repairAdvice"),prop:"advice"},{default:n(()=>[o(_,{type:"textarea",modelValue:a(i).advice,"onUpdate:modelValue":e[2]||(e[2]=l=>a(i).advice=l),maxlength:"300",rows:"5",resize:"none","show-word-limit":"",placeholder:t.$t("repairAdviceP")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])])]),_:1},8,["model"])]),a(f)?I("",!0):(d(),g(q,{key:0,size:"20",style:{cursor:"pointer",margin:"0 10px"},onClick:B},{default:n(()=>[o(P)]),_:1})),u("div",me,[ve,o(w,{ref:"formRef",model:a(s),disabled:a(f),rules:a(N),"label-width":"110","label-position":"left"},{default:n(()=>[u("div",fe,[o(p,{label:"\u8FD0\u884C\u72B6\u6001",prop:"runStatus"},{default:n(()=>[o(y,{modelValue:a(s).runStatus,"onUpdate:modelValue":e[3]||(e[3]=l=>a(s).runStatus=l),style:{width:"100%"},teleported:!1},{default:n(()=>[(d(!0),S(D,null,E(a(V),l=>(d(),g(c,{key:l.key,label:l.desc,value:l.key},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(p,{label:t.$t("diagnosisConclusion"),prop:"diagnosis"},{default:n(()=>[o(_,{type:"textarea",modelValue:a(s).diagnosis,"onUpdate:modelValue":e[4]||(e[4]=l=>a(s).diagnosis=l),maxlength:"300",rows:"5",resize:"none","show-word-limit":"",placeholder:t.$t("diagnosisConclusionP")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(p,{label:t.$t("repairAdvice"),prop:"advice"},{default:n(()=>[o(_,{type:"textarea",modelValue:a(s).advice,"onUpdate:modelValue":e[5]||(e[5]=l=>a(s).advice=l),maxlength:"300",rows:"5",resize:"none","show-word-limit":"",placeholder:t.$t("repairAdviceP")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])])]),_:1},8,["model","disabled","rules"])])])]),_:1},8,["title","modelValue"])}}},he=L(ge,[["__scopeId","data-v-35dc8ab7"]]);export{he as default};
