import{u as A}from"./useInstance.233fbdde.js";import{az as a,d as C,s as B,r as V,b as y,p as h,c as r,e as q,k as x,i as s,h as t,u,a2 as T,m as I,E as F}from"./index.0308b213.js";const z=o=>a.request({url:"addon/deposit.DepositLock/list",params:o}),M=o=>a.request({url:"addon/deposit.DepositLock/delete",method:"POST",data:o}),w=o=>a.request({url:"addon/deposit.DepositLock/detail",params:o}),O=o=>a.request({url:"addon/deposit.DepositLock/edit",method:"POST",data:o}),U=o=>a.request({url:"addon/deposit.DepositLock/add",method:"POST",data:o}),N=I("\u63D0\u4EA4"),P=I("\u53D6\u6D88"),$=C({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(o,{emit:f}){const n=o,{global:v}=A();let g=B(()=>Number(n.id)>0);const p=V(!1),_=V(),e=y({id:"",deviceId:"",ccid:"",unisdk_deviceId:""}),E=()=>{e.id>0?O(e).then(d=>{F({message:"\u7F16\u8F91\u9501\u63A7\u677F\u6210\u529F",type:"success"})}):U(e).then(d=>{F({message:"\u65B0\u589E\u9501\u63A7\u677F\u6210\u529F",type:"success"})})};h(()=>n.modelValue,d=>{p.value=d,d&&n.id&&(e.id=n.id,L())});const L=()=>{w({id:n.id}).then(d=>{e.deviceId=d.depositlock.deviceId||"",e.ccid=d.depositlock.ccid||"",e.unisdk_deviceId=d.depositlock.unisdk_deviceId||""})},k=()=>{f("update:modelValue",!1),f("onClose"),v.$resetForm(_.value,e)};return(d,l)=>{const m=r("el-input"),c=r("el-form-item"),D=r("el-button"),b=r("el-dialog");return q(),x(b,{modelValue:p.value,"onUpdate:modelValue":l[3]||(l[3]=i=>p.value=i),title:u(g)?"\u67E5\u770B\u9501\u63A7\u677F\u4FE1\u606F":"\u65B0\u589E\u9501\u63A7\u677F\u4FE1\u606F",width:"70%","destroy-on-close":"",onClose:k},{default:s(()=>[t(u(T),{ref_key:"formRef",ref:_,model:u(e),"inline-message":!0,"label-width":"160px"},{default:s(()=>[t(c,{label:"\u677F\u5B50ID"},{default:s(()=>[t(m,{modelValue:u(e).deviceId,"onUpdate:modelValue":l[0]||(l[0]=i=>u(e).deviceId=i)},null,8,["modelValue"])]),_:1}),t(c,{label:"\u6D41\u91CF\u5361\u53F7"},{default:s(()=>[t(m,{modelValue:u(e).ccid,"onUpdate:modelValue":l[1]||(l[1]=i=>u(e).ccid=i)},null,8,["modelValue"])]),_:1}),t(c,{label:"IOT\u8BBE\u5907ID"},{default:s(()=>[t(m,{modelValue:u(e).unisdk_deviceId,"onUpdate:modelValue":l[2]||(l[2]=i=>u(e).unisdk_deviceId=i)},null,8,["modelValue"])]),_:1}),t(c,null,{default:s(()=>[t(D,{type:"primary",onClick:E},{default:s(()=>[N]),_:1}),t(D,{onClick:k},{default:s(()=>[P]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{$ as _,M as d,z as g};
