import{az as p,d as O,s as S,r as E,b as V,p as T,c as r,e as f,k as y,i as d,h as t,u as a,f as P,j as M,F as N,a2 as L,m as g,E as B}from"./index.0308b213.js";import{s as R}from"./degree.24566a4c.js";import{T as j}from"./TEditor.fed75c12.js";import{M as z}from"./index.dfdc0704.js";const h=n=>p.request({url:"addon/svip.web.s_vip_setting/list",params:n}),G=n=>p.request({url:"addon/svip.web.s_vip_setting/add",method:"POST",data:n}),H=n=>p.request({url:"addon/svip.web.s_vip_setting/edit",method:"POST",data:n}),ee=n=>p.request({url:"addon/svip.web.s_vip_setting/delete",method:"POST",data:n}),I=n=>p.request({url:"addon/svip.web.s_vip_setting/detail",params:n}),le=n=>p.request({url:"addon/svip.web.s_vip_setting/changeStatus",method:"POST",data:n}),J=g("\u5929"),K=g("\u63D0\u4EA4"),Q=g("\u53D6\u6D88"),te=O({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(n,{emit:b}){const m=n;let w=S(()=>Number(m.id)>0);const _=E(!1),D=E(),v=V({list:[]});(()=>{R().then(u=>{v.list=u})})();const e=V({id:"",title:"",description:"",days:"",price:"",oldprice:"",displayorder:"",status:1,content:"",image:"",degree:"",send_balance:""}),U=()=>{e.id>0?H(e).then(u=>{B({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),c()}):G(e).then(u=>{B({message:"\u65B0\u589E\u6210\u529F",type:"success"}),c()})};T(()=>m.modelValue,u=>{_.value=u,u&&m.id&&(e.id=m.id,A())}),V({list:[]});const A=()=>{I({id:m.id}).then(u=>{console.log("res",u),e.id=u.data.id,e.title=u.data.title,e.description=u.data.description,e.days=u.data.days,e.price=u.data.price,e.oldprice=u.data.oldprice,e.displayorder=u.data.displayorder,e.status=u.data.status,e.content=u.data.content,e.image=u.data.image,e.degree=u.data.degree,e.send_balance=u.data.send_balance})},c=()=>{b("update:modelValue",!1),b("onClose")};return(u,o)=>{const C=r("el-option"),k=r("el-select"),s=r("el-form-item"),i=r("el-input"),q=r("el-switch"),F=r("el-button"),x=r("el-dialog");return f(),y(x,{modelValue:_.value,"onUpdate:modelValue":o[11]||(o[11]=l=>_.value=l),title:a(w)?"\u67E5\u770B":"\u65B0\u589E",width:"70%","destroy-on-close":"",onClose:c},{default:d(()=>[t(a(L),{ref_key:"formRef",ref:D,model:a(e),"inline-message":!0,"label-width":"160px"},{default:d(()=>[t(s,{label:"\u5BF9\u5E94\u7B49\u7EA7"},{default:d(()=>[t(k,{modelValue:a(e).degree,"onUpdate:modelValue":o[0]||(o[0]=l=>a(e).degree=l),placeholder:"\u8BF7\u9009\u62E9\u5BF9\u5E94\u7B49\u7EA7",clearable:""},{default:d(()=>[(f(!0),P(N,null,M(a(v).list,l=>(f(),y(C,{key:l.value,label:l.title,value:l.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(s,{label:"\u5957\u9910\u540D\u79F0"},{default:d(()=>[t(i,{modelValue:a(e).title,"onUpdate:modelValue":o[1]||(o[1]=l=>a(e).title=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u5957\u9910\u63D0\u793A"},{default:d(()=>[t(i,{modelValue:a(e).description,"onUpdate:modelValue":o[2]||(o[2]=l=>a(e).description=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u5957\u9910\u65F6\u957F"},{default:d(()=>[t(i,{modelValue:a(e).days,"onUpdate:modelValue":o[3]||(o[3]=l=>a(e).days=l)},{append:d(()=>[J]),_:1},8,["modelValue"])]),_:1}),t(s,{label:"\u5957\u9910\u73B0\u4EF7"},{default:d(()=>[t(i,{modelValue:a(e).price,"onUpdate:modelValue":o[4]||(o[4]=l=>a(e).price=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u5957\u9910\u539F\u4EF7"},{default:d(()=>[t(i,{modelValue:a(e).oldprice,"onUpdate:modelValue":o[5]||(o[5]=l=>a(e).oldprice=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u8D60\u9001\u4F59\u989D"},{default:d(()=>[t(i,{modelValue:a(e).send_balance,"onUpdate:modelValue":o[6]||(o[6]=l=>a(e).send_balance=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u6392\u5E8F"},{default:d(()=>[t(i,{modelValue:a(e).displayorder,"onUpdate:modelValue":o[7]||(o[7]=l=>a(e).displayorder=l)},null,8,["modelValue"])]),_:1}),t(s,{label:"\u72B6\u6001"},{default:d(()=>[t(q,{modelValue:a(e).status,"onUpdate:modelValue":o[8]||(o[8]=l=>a(e).status=l),"active-value":1,"inactive-value":0,"active-text":"\u542F\u7528","inactive-text":"\u9690\u85CF"},null,8,["modelValue"])]),_:1}),t(s,{label:"\u56FE\u7247",prop:"image"},{default:d(()=>[t(z,{modelValue:a(e).image,"onUpdate:modelValue":o[9]||(o[9]=l=>a(e).image=l),limit:1},null,8,["modelValue"])]),_:1}),t(s,{label:"\u5185\u5BB9"},{default:d(()=>[t(j,{modelValue:a(e).content,"onUpdate:modelValue":o[10]||(o[10]=l=>a(e).content=l)},null,8,["modelValue"])]),_:1}),t(s,null,{default:d(()=>[t(F,{type:"primary",onClick:U},{default:d(()=>[K]),_:1}),t(F,{onClick:c},{default:d(()=>[Q]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{te as _,le as c,ee as d,h as l};
