import{u as S}from"./useInstance.233fbdde.js";import{M as k}from"./index.dfdc0704.js";import{az as n,d as x,r as V,b,p as T,c as i,e as U,k as O,i as l,h as t,u as a,a2 as P,m as p,E as F}from"./index.0308b213.js";import{A as w}from"./index.1d26a072.js";const K=u=>n.request({url:"addon/creditshop.category/lists",params:u}),Q=u=>n.request({url:"addon/creditshop.category/delete",method:"POST",data:u}),W=u=>n.request({url:"addon/creditshop.category/status",method:"POST",data:u}),X=u=>n.request({url:"addon/creditshop.category/submit",method:"POST",data:u}),M=u=>n.request({url:"addon/creditshop.category/detail",params:u}),N=u=>n.request({url:"addon/creditshop.category/edit",method:"POST",data:u}),z=u=>n.request({url:"addon/creditshop.category/add",method:"POST",data:u}),R=p("\u542F\u7528"),I=p("\u7981\u7528"),L=p("\u63D0\u4EA4"),$=p("\u53D6\u6D88"),Y=x({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(u,{emit:_}){const c=u,{global:A}=S(),g=V(!1),f=V(),D=b({name:[{required:!0,message:"\u5206\u7C7B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],thumb:[{required:!0,message:"\u5206\u7C7B\u56FE\u7247\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],displayorder:[{required:!0,message:"\u6392\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]}),e=b({id:0,name:"",thumb:"",displayorder:0,status:0,agentid:""}),E=()=>{M({id:e.id}).then(d=>{e.name=d.name,e.thumb=d.thumb,e.displayorder=d.displayorder,e.status=d.status,e.agentid=d.agentid})},B=()=>{var d;(d=f.value)==null||d.validate(o=>{o&&(e.id>0?N(e).then(s=>{F.success(s.msg),m()}):z(e).then(s=>{F.success(s.msg),m()}))})};T(()=>c.modelValue,d=>{g.value=d,e.id=c.id,e.id>0&&E()});const m=()=>{_("update:modelValue",!1),_("onClose"),A.$resetForm(f.value,e)};return(d,o)=>{const s=i("el-form-item"),y=i("el-input"),C=i("el-radio"),q=i("el-radio-group"),h=i("el-button"),v=i("el-dialog");return U(),O(v,{modelValue:g.value,"onUpdate:modelValue":o[5]||(o[5]=r=>g.value=r),title:Number(c.id)>0?"\u7F16\u8F91\u5206\u7C7B":"\u6DFB\u52A0\u5206\u7C7B",width:"50%","destroy-on-close":"",onClose:m},{default:l(()=>[t(a(P),{ref_key:"formRef",ref:f,model:a(e),rules:a(D),"label-width":"150px"},{default:l(()=>[t(s,{label:"\u4EE3\u7406",prop:"agentid"},{default:l(()=>[t(a(w),{modelValue:a(e).agentid,"onUpdate:modelValue":o[0]||(o[0]=r=>a(e).agentid=r)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u5206\u7C7B\u540D\u79F0",prop:"name"},{default:l(()=>[t(y,{modelValue:a(e).name,"onUpdate:modelValue":o[1]||(o[1]=r=>a(e).name=r),placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u5206\u7C7B\u56FE\u7247",prop:"thumb"},{default:l(()=>[t(k,{modelValue:a(e).thumb,"onUpdate:modelValue":o[2]||(o[2]=r=>a(e).thumb=r),limit:1,size:"80px"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u5206\u7C7B\u6392\u5E8F",prop:"displayorder"},{default:l(()=>[t(y,{modelValue:a(e).displayorder,"onUpdate:modelValue":o[3]||(o[3]=r=>a(e).displayorder=r),placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u6392\u5E8F"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u5206\u7C7B\u662F\u5426\u542F\u7528"},{default:l(()=>[t(q,{modelValue:a(e).status,"onUpdate:modelValue":o[4]||(o[4]=r=>a(e).status=r)},{default:l(()=>[t(C,{label:1},{default:l(()=>[R]),_:1}),t(C,{label:0},{default:l(()=>[I]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(s,null,{default:l(()=>[t(h,{type:"primary",onClick:B},{default:l(()=>[L]),_:1}),t(h,{onClick:m},{default:l(()=>[$]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"])}}});export{Y as _,W as c,Q as d,K as g,X as s};
