import{u as x}from"./useInstance.233fbdde.js";import{f as w,h as U,i as N,j as P,k as R,l as j}from"./category.da132df4.js";import{d as G,a6 as I,s as M,r as E,b as h,p as O,c as i,e as T,k as $,i as l,h as o,u as a,a2 as q,m as p,E as _}from"./index.0308b213.js";const z=p("\u4E2A\u4EBA"),H=p("\u4F01\u4E1A"),J=p("\u5F00\u542F"),K=p("\u5173\u95ED"),L=p("\u63D0\u4EA4"),Q=p("\u53D6\u6D88"),Y=G({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(F,{emit:c}){const n=F,{OpPlatform:g}=I(),{global:A}=x();let B=M(()=>Number(n.id)>0);const f=E(!1),V=E(),e=h({id:"",title:"",type:"person",status:"1"}),C=()=>{g.value=="shangpu"?e.id>0?N(e).then(t=>{_({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),d()}):P(e).then(t=>{_({message:"\u65B0\u589E\u6210\u529F",type:"success"}),d()}):e.id>0?R(e).then(t=>{_({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),d()}):j(e).then(t=>{_({message:"\u65B0\u589E\u6210\u529F",type:"success"}),d()})};O(()=>n.modelValue,t=>{f.value=t,t&&n.id&&(e.id=n.id,D())}),h({list:[]});const D=()=>{g.value=="shangpu"?w({id:n.id}).then(t=>{t=t.data,e.title=t.title,e.type=t.type,e.status=t.status}):U({id:n.id}).then(t=>{t=t.data,e.title=t.title,e.type=t.type,e.status=t.status})},d=()=>{c("update:modelValue",!1),c("onClose"),A.$resetForm(V.value,e)};return(t,s)=>{const k=i("el-input"),m=i("el-form-item"),r=i("el-radio"),y=i("el-radio-group"),b=i("el-button"),v=i("el-dialog");return T(),$(v,{modelValue:f.value,"onUpdate:modelValue":s[3]||(s[3]=u=>f.value=u),title:a(B)?"\u67E5\u770B":"\u65B0\u589E",width:"70%","destroy-on-close":"",onClose:d},{default:l(()=>[o(a(q),{ref_key:"formRef",ref:V,model:a(e),"inline-message":!0,"label-width":"160px"},{default:l(()=>[o(m,{label:"\u6807\u9898",prop:"title"},{default:l(()=>[o(k,{modelValue:a(e).title,"onUpdate:modelValue":s[0]||(s[0]=u=>a(e).title=u)},null,8,["modelValue"])]),_:1}),o(m,{label:"\u7C7B\u578B",prop:"type"},{default:l(()=>[o(y,{modelValue:a(e).type,"onUpdate:modelValue":s[1]||(s[1]=u=>a(e).type=u)},{default:l(()=>[o(r,{label:"person"},{default:l(()=>[z]),_:1}),o(r,{label:"enterprise"},{default:l(()=>[H]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(m,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[o(y,{modelValue:a(e).status,"onUpdate:modelValue":s[2]||(s[2]=u=>a(e).status=u)},{default:l(()=>[o(r,{label:"1"},{default:l(()=>[J]),_:1}),o(r,{label:"0"},{default:l(()=>[K]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(m,null,{default:l(()=>[o(b,{type:"primary",onClick:C},{default:l(()=>[L]),_:1}),o(b,{onClick:d},{default:l(()=>[Q]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{Y as _};
