import{d as A,r as U,G as I,o as R,g as n,c as r,k as d,e as t,F as f,y as v,w as m,l as y,R as B,t as F,C as H,_ as L}from"./index-CUnFTKV2.js";const N={class:"prize-reward-config"},P=A({__name:"PrizeRewardConfig",props:{modelValue:{default:()=>[]}},emits:["update:modelValue"],setup(V,{emit:g}){const u=V,p=g,h=[{label:"钻石",value:1},{label:"HH币",value:2},{label:"哈尼券",value:3}],l=U([]);I(()=>u.modelValue,e=>{Array.isArray(e)&&e.length>0?l.value=e.map(o=>({...o})):l.value=[]},{immediate:!0,deep:!0});const c=()=>{p("update:modelValue",l.value.map(e=>({...e})))},C=()=>{l.value.push({type:1,amount:0})},b=e=>{l.value.splice(e,1),p("update:modelValue",l.value.map(o=>({...o})))};return R(()=>{Array.isArray(u.modelValue)&&u.modelValue.length>0&&(l.value=u.modelValue.map(e=>({...e})))}),(e,o)=>{const x=n("el-option"),k=n("el-select"),w=n("el-input-number"),i=n("el-button"),z=n("el-icon");return d(),r("div",N,[(d(!0),r(f,null,v(l.value,(s,_)=>(d(),r("div",{key:_,class:"reward-item"},[t(k,{modelValue:s.type,"onUpdate:modelValue":a=>s.type=a,placeholder:"奖励类型",style:{width:"120px"},onChange:c},{default:m(()=>[(d(),r(f,null,v(h,a=>t(x,{key:a.value,label:a.label,value:a.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"]),t(w,{modelValue:s.amount,"onUpdate:modelValue":a=>s.amount=a,min:0,max:999999999,placeholder:"数量",style:{width:"150px","margin-left":"8px"},onChange:c},null,8,["modelValue","onUpdate:modelValue"]),t(i,{type:"danger",icon:y(B),circle:"",size:"small",style:{"margin-left":"8px"},onClick:a=>b(_)},null,8,["icon","onClick"])]))),128)),t(i,{type:"primary",link:"",onClick:C,style:{"margin-top":"8px"}},{default:m(()=>[t(z,null,{default:m(()=>[t(y(H))]),_:1}),o[0]||(o[0]=F("添加奖励 ",-1))]),_:1})])}}}),E=L(P,[["__scopeId","data-v-7c871fae"]]);export{E as default};
