import{M as y}from"./index.dfdc0704.js";import{az as m,d as h,r as _,s as k,b as q,p as w,c as r,e as x,k as A,i as s,h as o,u as t,a2 as S,q as N,g as C,m as E,E as U}from"./index.0308b213.js";const M=l=>m.request({url:"addon/visa.material/editSave",method:"POST",data:l}),G=l=>m.request({url:"addon/visa.material/list",method:"POST",data:l}),R=l=>m.request({url:"addon/visa.material/detail",params:{id:l}}),H=l=>m.request({url:"addon/visa.material/delete",params:{id:l}}),T=C("div",{class:"tn-form-item__tips"},"\u586B\u5199\u6807\u9898\u540D\u79F0",-1),O=C("div",{class:"tn-form-item__tips"},"\u7528\u4E8E\u4ECB\u7ECD\u6750\u6599\u7684\u8BF4\u660E",-1),P=E("\u63D0\u4EA4"),z=E("\u53D6\u6D88"),J=h({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(l,{emit:f}){const i=l;let n=_(!1),D=k(()=>Number(i.id)>0);_([]);const F=_(),e=q({id:0,title:"",desc:"",img_ur:""});w(()=>i.modelValue,d=>{n.value=d,d&&i.id&&(e.id=i.id,v())});const v=()=>{R(i.id).then(d=>{e.title=d.data.title||"",e.desc=d.data.desc||""})},b=()=>{M(e).then(()=>{U.success("\u4FDD\u5B58\u6210\u529F"),p()})},p=()=>{f("update:modelValue",!1),f("onClose")};return(d,a)=>{const V=r("el-input"),c=r("el-form-item"),g=r("el-button"),B=r("el-dialog");return x(),A(B,{modelValue:t(n),"onUpdate:modelValue":a[3]||(a[3]=u=>N(n)?n.value=u:n=u),title:t(D)?"\u7F16\u8F91":"\u65B0\u589E",width:"80%","destroy-on-close":"",onClose:p},{footer:s(()=>[o(g,{type:"primary",onClick:b},{default:s(()=>[P]),_:1}),o(g,{type:"danger",onClick:p},{default:s(()=>[z]),_:1})]),default:s(()=>[o(t(S),{ref_key:"formRef",ref:F,model:t(e),"label-width":"150px"},{default:s(()=>[o(c,{label:"\u6807\u9898",prop:"title"},{default:s(()=>[o(V,{modelValue:t(e).title,"onUpdate:modelValue":a[0]||(a[0]=u=>t(e).title=u)},null,8,["modelValue"]),T]),_:1}),o(c,{label:"\u56FE\u7247",prop:"img_url"},{default:s(()=>[o(y,{modelValue:t(e).img_url,"onUpdate:modelValue":a[1]||(a[1]=u=>t(e).img_url=u),limit:1,show_type:"all"},null,8,["modelValue"])]),_:1}),o(c,{label:"\u63CF\u8FF0",prop:"desc"},{default:s(()=>[o(V,{modelValue:t(e).desc,"onUpdate:modelValue":a[2]||(a[2]=u=>t(e).desc=u),type:"textarea",rows:6},null,8,["modelValue"]),O]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{J as _,H as d,G as l};
