import{_ as A,a5 as G,a as H,r as v,J as w,o as u,y as _,q as e,p as d,n as o,s as D,v as p,x as t,P as r,c as f,t as C,F as V,A as $,C as Q,cG as W,cH as X,S as Y,cI as Z,cJ as ee,l as le,E as ae,i as te,j as oe,br as ne,bv as se}from"./index.8d733f79.js";import{E as de,a as ce}from"./el-tab-pane.27bff4fc.js";import{E as ue}from"./el-input-number.60463ef8.js";import{a as ie,u as pe}from"./faultType.8bb3732b.js";import"./index.28f6da25.js";const re={class:"cell-item"},me={class:"cell-item"},_e={class:"cell-item"},ve={class:"cell-item"},fe={class:"cell-item"},ye={class:"cell-item"},be={class:"cell-item"},he={class:"cell-item"},Ve={key:0},$e={style:{display:"flex","justify-content":"flex-end"}},Ie={class:"component-title"},ge={class:"cell-item"},Ee={key:0},Te=G({name:"DeviceInfo"}),ke=Object.assign(Te,{setup(we,{expose:N}){const P=H(),b=v("deviceInfo"),I=v(),g=v(),y=v(!1),n=v({}),U=v(P.query.type==="view");let h;const F=w.session.getJSON("enums").deviceForm,B=w.session.getJSON("enums").supportType;function S(l){y.value=!0,b.value="deviceInfo",h=l,M()}function M(){ie({faultCaseId:h.caseId}).then(l=>{n.value=l.data,n.value.components.forEach(c=>{c.params.forEach(s=>{(s.dataType===0||s.dataType===1)&&s.value&&(s.value=+s.value)})}),I.value=F.find(c=>+c.key===n.value.deviceForm).desc,g.value=B.find(c=>+c.key===n.value.supportType).desc}).catch(()=>{})}function L(){y.value=!1,n.value={}}const J=()=>{const l={components:n.value.components,faultCaseId:h.caseId};pe(l).then(c=>{Y.success(c.msg)})};return N({showModal:S}),(l,c)=>{const s=Z,E=ee,T=de,O=le,k=ue,j=ae,K=te,q=oe,R=ne,x=ce,z=se;return u(),_(z,{title:l.$t("deviceInfo"),modelValue:o(y),"onUpdate:modelValue":c[2]||(c[2]=m=>D(y)?y.value=m:null),width:"70%","align-center":!0,onClose:L,class:"deviceInfo_dialog","append-to-body":""},{default:e(()=>[d(x,{type:"card",modelValue:o(b),"onUpdate:modelValue":c[1]||(c[1]=m=>D(b)?b.value=m:null),class:"noBorderTabs"},{default:e(()=>[d(T,{label:l.$t("deviceBaseInfo"),name:"deviceInfo"},{default:e(()=>[d(E,{column:3,border:""},{default:e(()=>[d(s,null,{label:e(()=>[p("div",re,t(l.$t("deviceId")),1)]),default:e(()=>[r(" "+t(o(n).id),1)]),_:1}),d(s,null,{label:e(()=>[p("div",me,t(l.$t("deviceName")),1)]),default:e(()=>[r(" "+t(o(n).name),1)]),_:1}),d(s,null,{label:e(()=>[p("div",_e,t(l.$t("deviceCode")),1)]),default:e(()=>[r(" "+t(o(n).showCode),1)]),_:1}),d(s,null,{label:e(()=>[p("div",ve,t(l.$t("deviceForm")),1)]),default:e(()=>[r(" "+t(o(I)),1)]),_:1}),d(s,null,{label:e(()=>[p("div",fe,t(l.$t("deviceType")),1)]),default:e(()=>[r(" "+t(o(n).deviceTypeName),1)]),_:1}),d(s,null,{label:e(()=>[p("div",ye,t(l.$t("supportType")),1)]),default:e(()=>[r(" "+t(o(g)),1)]),_:1}),d(s,null,{label:e(()=>[p("div",be,t(l.$t("importantLevel")),1)]),default:e(()=>[r(" "+t(o(n).importantLevel),1)]),_:1}),d(s,null,{label:e(()=>[p("div",he,t(l.$t("location")),1)]),default:e(()=>[o(n).xcoordinate?(u(),f("div",Ve," F"+t(o(n).floor+" "+o(n).xcoordinate+"/"+o(n).ycoordinate),1)):C("",!0)]),_:1})]),_:1})]),_:1},8,["label"]),d(T,{label:l.$t("componentParams"),name:"component",lazy:""},{default:e(()=>[p("div",$e,[d(O,{type:"primary",onClick:J,disabled:o(U)},{default:e(()=>[r(t(l.$t("save")),1)]),_:1},8,["disabled"])]),d(R,{style:{height:"calc(100% - 32px)"}},{default:e(()=>[(u(!0),f(V,null,$(o(n).components,m=>(u(),f("div",{key:m.identifier},[p("div",Ie,t(m.name),1),d(E,{column:3,border:"",style:{"margin-bottom":"20px"}},{default:e(()=>[(u(!0),f(V,null,$(m.params,a=>(u(),_(s,{key:a.identifier,width:"300",span:1},{label:e(()=>[p("div",ge,[r(t(a.name),1),a.unit?(u(),f("span",Ee,"("+t(a.unit)+")",1)):C("",!0)])]),default:e(()=>[a.dataType===0?(u(),_(k,{key:0,modelValue:a.value,"onUpdate:modelValue":i=>a.value=i,precision:0,max:99999,min:0,controls:!1,placeholder:`${l.$t("inputP")}${a.name}`,class:"input-number"},null,8,["modelValue","onUpdate:modelValue","placeholder"])):a.dataType===1?(u(),_(k,{key:1,modelValue:a.value,"onUpdate:modelValue":i=>a.value=i,step:.001,onMousewheel:c[0]||(c[0]=Q(()=>{},["prevent"])),max:99999,min:0,controls:!1,onKeydown:o(W),onPaste:o(X),placeholder:`${l.$t("inputP")}${a.name}`,class:"input-number"},null,8,["modelValue","onUpdate:modelValue","step","onKeydown","onPaste","placeholder"])):a.dataType===2?(u(),_(K,{key:2,teleported:!1,modelValue:a.value,"onUpdate:modelValue":i=>a.value=i,placeholder:`${l.$t("selectP")}${a.name}`,style:{width:"calc(100%)"}},{default:e(()=>[(u(!0),f(V,null,$(a.enums,i=>(u(),_(j,{key:i,label:i,value:i},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):(u(),_(q,{key:3,modelValue:a.value,"onUpdate:modelValue":i=>a.value=i,placeholder:`${l.$t("inputP")}${a.name}`,maxlength:"50"},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1024))),128))]),_:2},1024)]))),128))]),_:1})]),_:1},8,["label"])]),_:1},8,["modelValue"])]),_:1},8,["title","modelValue"])}}}),Fe=A(ke,[["__scopeId","data-v-f1ab2356"]]);export{Fe as default};
