import{az as m,aa as c,d as D,a6 as S,r as B,b as v,p as P,c as g,e as O,k as T,i as n,h as u,u as o,a2 as U,q as k,m as y,E as f}from"./index.0308b213.js";import{M as x}from"./index.dfdc0704.js";import{A as w}from"./index.1d26a072.js";const Y=t=>m.request({url:"addon/hand2.hand_category/list",params:t}),Z=t=>m.request({url:"addon/hand2.hand_category/delete",method:"POST",data:{id:t}}),M=t=>(console.log(t,"id"),m.request({url:"addon/hand2.hand_category/detail",params:{id:t}})),N=t=>m.request({url:"addon/hand2.hand_category/edit",method:"POST",data:t}),R=t=>m.request({url:"addon/hand2.hand_category/add",method:"POST",data:t}),$=(t,s)=>m.request({url:"addon/hand2.hand_category/updateStatus",method:"POST",data:{id:t,status:s}}),ee=t=>c.request({url:"agent/plugin.hand2.hand_category/list",params:t}),te=t=>c.request({url:"agent/plugin.hand2.hand_category/delete",method:"POST",data:{id:t}}),z=t=>c.request({url:"agent/plugin.hand2.hand_category/detail",params:{id:t}}),I=t=>c.request({url:"agent/plugin.hand2.hand_category/edit",method:"POST",data:t}),j=t=>c.request({url:"agent/plugin.hand2.hand_category/add",method:"POST",data:t}),ae=(t,s)=>c.request({url:"agent/plugin.hand2.hand_category/updateStatus",method:"POST",data:{id:t,status:s}}),G=y("\u663E\u793A"),J=y("\u9690\u85CF"),K=y("\u63D0\u4EA4"),L=y("\u53D6\u6D88"),ue=D({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(t,{emit:s}){const r=t,{OpPlatform:C}=S();let _=B(!1);const F=B(),e=v({id:0,agentid:"",title:"",cover:"",displayorder:0,status:0,fee_rate:0});P(()=>r.modelValue,a=>{_.value=a,a&&r.id&&(e.id=r.id,b())});const E=()=>{C.value=="agent"?e.id?I(e).then(a=>{f.success("\u7F16\u8F91\u4E8C\u624B\u5E02\u573A\u5206\u7C7B\u6210\u529F"),i()}):j(e).then(a=>{f.success("\u6DFB\u52A0\u4E8C\u624B\u5E02\u573A\u5206\u7C7B\u6210\u529F"),i()}):e.id?N(e).then(a=>{f.success("\u7F16\u8F91\u4E8C\u624B\u5E02\u573A\u5206\u7C7B\u6210\u529F"),i()}):R(e).then(a=>{f.success("\u6DFB\u52A0\u4E8C\u624B\u5E02\u573A\u5206\u7C7B\u6210\u529F"),i()})},b=()=>{console.log(r.id,"props.id"),C.value=="agent"?z(r.id).then(a=>{e.agentid=a.agentid||"",e.title=a.title||"",e.cover=a.cover||"",e.displayorder=a.displayorder||0,e.status=a.status||0,e.fee_rate=a.fee_rate||0}):M(r.id).then(a=>{e.agentid=a.agentid||"",e.title=a.title||"",e.cover=a.cover||"",e.displayorder=a.displayorder||0,e.status=a.status||0,e.fee_rate=a.fee_rate||0})},i=()=>{s("update:modelValue",!1),s("onClose")};return(a,l)=>{const p=g("el-form-item"),h=g("el-input"),A=g("el-radio"),q=g("el-radio-group"),V=g("el-button"),H=g("el-dialog");return O(),T(H,{modelValue:o(_),"onUpdate:modelValue":l[6]||(l[6]=d=>k(_)?_.value=d:_=d),title:Number(r.id)>0?"\u7F16\u8F91\u5206\u7C7B":"\u6DFB\u52A0\u5206\u7C7B",width:"70%","destroy-on-close":"",onClose:i},{footer:n(()=>[u(V,{type:"primary",onClick:E},{default:n(()=>[K]),_:1}),u(V,{type:"danger",onClick:i},{default:n(()=>[L]),_:1})]),default:n(()=>[u(o(U),{ref_key:"formRef",ref:F,model:o(e),"label-width":"150px"},{default:n(()=>[u(p,{label:"\u4EE3\u7406\u533A\u57DF"},{default:n(()=>[u(o(w),{modelValue:o(e).agentid,"onUpdate:modelValue":l[0]||(l[0]=d=>o(e).agentid=d)},null,8,["modelValue"])]),_:1}),u(p,{label:"\u6807\u9898"},{default:n(()=>[u(h,{modelValue:o(e).title,"onUpdate:modelValue":l[1]||(l[1]=d=>o(e).title=d)},null,8,["modelValue"])]),_:1}),u(p,{label:"\u5206\u7C7B\u56FE\u7247"},{default:n(()=>[u(x,{modelValue:o(e).cover,"onUpdate:modelValue":l[2]||(l[2]=d=>o(e).cover=d),limit:1,size:"80px"},null,8,["modelValue"])]),_:1}),u(p,{label:"\u6392\u5E8F"},{default:n(()=>[u(h,{modelValue:o(e).displayorder,"onUpdate:modelValue":l[3]||(l[3]=d=>o(e).displayorder=d)},null,8,["modelValue"])]),_:1}),u(p,{label:"\u72B6\u6001"},{default:n(()=>[u(q,{modelValue:o(e).status,"onUpdate:modelValue":l[4]||(l[4]=d=>o(e).status=d)},{default:n(()=>[u(A,{label:1},{default:n(()=>[G]),_:1}),u(A,{label:0},{default:n(()=>[J]),_:1})]),_:1},8,["modelValue"])]),_:1}),u(p,{label:"\u62BD\u6210\u6BD4\u4F8B"},{default:n(()=>[u(h,{modelValue:o(e).fee_rate,"onUpdate:modelValue":l[5]||(l[5]=d=>o(e).fee_rate=d)},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{ue as _,Y as a,Z as b,$ as c,te as d,ee as g,ae as u};
