import{u as O}from"./useInstance.233fbdde.js";import{az as _,d as P,s as R,r as F,b as h,p as x,c as d,e as m,k as c,i as l,h as u,u as o,A as k,f as j,j as M,m as i,t as $,F as G,a2 as H,E as q}from"./index.0308b213.js";import{A as J}from"./index.1d26a072.js";const de=n=>_.request({url:"addon/securityDeposit.web.setting/list",params:n}),ie=n=>_.request({url:"addon/securityDeposit.web.setting/delete",method:"POST",data:n}),K=n=>_.request({url:"addon/securityDeposit.web.setting/detail",params:n}),Q=n=>_.request({url:"addon/securityDeposit.web.setting/edit",method:"POST",data:n}),W=n=>_.request({url:"addon/securityDeposit.web.setting/add",method:"POST",data:n}),X=n=>_.request({url:"addon/securityDeposit.web.setting/getBatchInfo",params:n}),Y=i("\u662F"),Z=i("\u5426"),ee=i("\u662F"),te=i("\u5426"),le=i("\u5168\u9009"),oe=i("\u63D0\u4EA4"),se=i("\u53D6\u6D88"),re=P({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(n,{emit:y}){const p=n,{global:v}=O();let V=R(()=>Number(p.id)>0);const E=F(!1),B=F(),e=h({id:"",agentid:"",is_batch:0,is_open:1,min_threshold:"",agentids_arr:[]});h({list:[]});const U=()=>{e.id>0?Q(e).then(t=>{q({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),f()}):W(e).then(t=>{q({message:"\u65B0\u589E\u6210\u529F",type:"success"}),f()})};x(()=>p.modelValue,t=>{E.value=t,t&&p.id&&(e.id=p.id,z())}),h({list:[]});const z=()=>{K({id:p.id}).then(t=>{t=t.data,e.id=t.id,e.agentid=t.agentid,e.is_open=t.is_open,e.min_threshold=t.min_threshold})},f=()=>{y("update:modelValue",!1),y("onClose"),v.$resetForm(B.value,e)},g=h({list:[]});x(()=>e.is_batch,t=>{t&&S()});const S=()=>{g.list=[],X({}).then(t=>{console.log("res",t),g.list=t})},C=F(!1),I=t=>{t?e.agentids_arr=g.list.map(a=>a.id):e.agentids_arr=[]};return(t,a)=>{const b=d("el-radio"),D=d("el-radio-group"),r=d("el-form-item"),N=d("el-input"),A=d("el-checkbox"),T=d("el-checkbox-group"),w=d("el-button"),L=d("el-dialog");return m(),c(L,{modelValue:E.value,"onUpdate:modelValue":a[6]||(a[6]=s=>E.value=s),title:o(V)?"\u67E5\u770B":"\u65B0\u589E",width:"70%","destroy-on-close":"",onClose:f},{default:l(()=>[u(o(H),{ref_key:"formRef",ref:B,model:o(e),"inline-message":!0,"label-width":"160px"},{default:l(()=>[o(V)?k("",!0):(m(),c(r,{key:0,label:"\u662F\u5426\u6279\u91CF\u8BBE\u7F6E"},{default:l(()=>[u(D,{modelValue:o(e).is_batch,"onUpdate:modelValue":a[0]||(a[0]=s=>o(e).is_batch=s)},{default:l(()=>[u(b,{label:1,size:"large"},{default:l(()=>[Y]),_:1}),u(b,{label:0,size:"large"},{default:l(()=>[Z]),_:1})]),_:1},8,["modelValue"])]),_:1})),!o(V)&&!o(e).is_batch?(m(),c(r,{key:1,label:"\u4EE3\u7406",prop:"agentid"},{default:l(()=>[u(o(J),{modelValue:o(e).agentid,"onUpdate:modelValue":a[1]||(a[1]=s=>o(e).agentid=s)},null,8,["modelValue"])]),_:1})):k("",!0),u(r,{label:"\u662F\u5426\u5F00\u542F"},{default:l(()=>[u(D,{modelValue:o(e).is_open,"onUpdate:modelValue":a[2]||(a[2]=s=>o(e).is_open=s)},{default:l(()=>[u(b,{label:1,size:"large"},{default:l(()=>[ee]),_:1}),u(b,{label:0,size:"large"},{default:l(()=>[te]),_:1})]),_:1},8,["modelValue"])]),_:1}),u(r,{label:"\u6700\u4F4E\u9600\u503C",prop:"min_threshold"},{default:l(()=>[u(N,{modelValue:o(e).min_threshold,"onUpdate:modelValue":a[3]||(a[3]=s=>o(e).min_threshold=s)},null,8,["modelValue"])]),_:1}),o(e).is_batch?(m(),c(r,{key:2,label:"\u5C06\u4EE5\u4E0A\u8BBE\u7F6E",class:"continer-item"},{default:l(()=>[u(T,{modelValue:o(e).agentids_arr,"onUpdate:modelValue":a[4]||(a[4]=s=>o(e).agentids_arr=s)},{default:l(()=>[(m(!0),j(G,null,M(o(g).list,s=>(m(),c(A,{key:s.id,label:s.id},{default:l(()=>[i($(s.title),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"]),u(A,{onChange:I,modelValue:C.value,"onUpdate:modelValue":a[5]||(a[5]=s=>C.value=s)},{default:l(()=>[le]),_:1},8,["modelValue"])]),_:1})):k("",!0),u(r,null,{default:l(()=>[u(w,{type:"primary",onClick:U},{default:l(()=>[oe]),_:1}),u(w,{onClick:f},{default:l(()=>[se]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{re as _,ie as d,de as g};
