import{az as f,d as k,r as V,b as y,p as q,c as i,e as x,k as w,i as o,h as t,u,a2 as H,q as U,m as _,E as B}from"./index.0308b213.js";import{A as N}from"./index.1d26a072.js";const R=l=>(console.log(l,"id"),f.request({url:"addon/hand2.hand_config/detail",params:{id:l}})),S=l=>f.request({url:"addon/hand2.hand_config/edit",method:"POST",data:l}),T=l=>f.request({url:"addon/hand2.hand_config/add",method:"POST",data:l}),v=_("\u9700\u8981"),O=_("\u4E0D\u9700\u8981"),P=_("\u63D0\u4EA4"),z=_("\u53D6\u6D88"),j=k({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(l,{emit:c}){const s=l;let r=V(!1);const F=V(),e=y({id:0,agentid:"",name:"",is_audit:0});q(()=>s.modelValue,a=>{r.value=a,console.log(s.id,a,"props.id,val"),a&&s.id&&(e.id=s.id,h())});const C=()=>{e.id?S(e).then(()=>{B.success("\u7F16\u8F91\u4E8C\u624B\u5E02\u573A\u8BBE\u7F6E\u6210\u529F"),m()}):T(e).then(()=>{B.success("\u6DFB\u52A0\u4E8C\u624B\u5E02\u573A\u8BBE\u7F6E\u6210\u529F"),m()})},h=()=>{console.log(s.id,"props.id"),R(s.id).then(a=>{e.agentid=a.agentid||"",e.name=a.name||"",e.is_audit=a.is_audit||0})},m=()=>{c("update:modelValue",!1),c("onClose")};return(a,d)=>{const p=i("el-form-item"),A=i("el-input"),g=i("el-radio"),b=i("el-radio-group"),E=i("el-button"),D=i("el-dialog");return x(),w(D,{modelValue:u(r),"onUpdate:modelValue":d[3]||(d[3]=n=>U(r)?r.value=n:r=n),title:Number(s.id)>0?"\u7F16\u8F91\u8BBE\u7F6E":"\u6DFB\u52A0\u8BBE\u7F6E",width:"70%","destroy-on-close":"",onClose:m},{footer:o(()=>[t(E,{type:"primary",onClick:C},{default:o(()=>[P]),_:1}),t(E,{type:"danger",onClick:m},{default:o(()=>[z]),_:1})]),default:o(()=>[t(u(H),{ref_key:"formRef",ref:F,model:u(e),"label-width":"150px"},{default:o(()=>[t(p,{label:"\u4EE3\u7406\u533A\u57DF"},{default:o(()=>[t(u(N),{modelValue:u(e).agentid,"onUpdate:modelValue":d[0]||(d[0]=n=>u(e).agentid=n)},null,8,["modelValue"])]),_:1}),t(p,{label:"\u6807\u9898"},{default:o(()=>[t(A,{modelValue:u(e).name,"onUpdate:modelValue":d[1]||(d[1]=n=>u(e).name=n)},null,8,["modelValue"])]),_:1}),t(p,{label:"\u662F\u5426\u9700\u8981\u5BA1\u6838"},{default:o(()=>[t(b,{modelValue:u(e).is_audit,"onUpdate:modelValue":d[2]||(d[2]=n=>u(e).is_audit=n)},{default:o(()=>[t(g,{label:1},{default:o(()=>[v]),_:1}),t(g,{label:0},{default:o(()=>[O]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{j as _};
