import{l as z}from"./vue-draggable-plus-31efe107-1782572373740v=1.0.0.js";import{m as P,n as Q}from"./eventListApi-0bc79350-1782572373740v=1.0.0.js";import{v as $,_ as j}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{y as G,r as c,m as H,al as s,z as i,A as m,B as v,R as u,J as t,Q as K,a4 as W,u as a,P as X,M as h,k as V,O as p}from"./vendor-866bb149-1782572373740v=1.0.0.js";import"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";const Y={class:"schedule-selector-container"},Z={class:"schedule-selector-content"},ee={class:"schedule-selector-item-name"},ue={key:0,class:"schedule-selector-item-action"},te={key:0},le={key:1},oe={class:"schedule-selector-next-button-container"},ne=G({__name:"ScheduleSelector",props:{eventId:{default:""},list:{}},emits:["next"],setup(D,{emit:x}){const E=D,S=x,l=c([]),B=()=>{d.value=!0},A=()=>{_.value.name="",d.value=!1},b=async()=>{try{let e=(await P({eventId:E.eventId})).data,r=$(E.list);r&&r.length>0?l.value=r:l.value=JSON.parse(e)}catch(o){console.error("\u83B7\u53D6\u5B57\u6BB5\u5217\u8868",o)}};H(()=>{b()});const d=c(!1),y=c(),_=c({name:""}),R=()=>{var o;(o=y.value)==null||o.validate(e=>{e&&(d.value=!1,l.value.push({name:_.value.name,isSelect:1}))})},I=o=>{l.value.splice(o,1)},N=c({name:[{required:!0,message:"\u8BF7\u8F93\u5165\u6A21\u5757\u540D\u79F0",trigger:"blur"}]}),F=c(!1),L=async()=>{F.value=!0;let o={eventId:E.eventId,eventRegulationFieldJsonDTOList:l.value};try{let e=await Q(o);e.code===0&&(F.value=!1),S("next")}catch(e){console.error("\u4E0B\u4E00\u6B65",e),F.value=!1}};return(o,e)=>{const r=s("el-checkbox"),U=s("Rank"),C=s("el-icon"),w=s("Delete"),f=s("el-button"),J=s("el-empty"),M=s("el-input"),O=s("el-form-item"),T=s("el-form"),q=s("el-dialog");return i(),m("div",Y,[e[8]||(e[8]=v("div",{class:"schedule-selector-title"}," \u9009\u62E9\u8D5B\u7A0B\u4FE1\u606F\u540E\u751F\u6210\u7CFB\u7EDF\u6807\u51C6\u7248\uFF0C\u53EF\u79FB\u52A8\u8D5B\u7A0B\u4FE1\u606F\u4F4D\u7F6E\uFF08\u9664\u6807\u9898\u5916\uFF09\uFF0C\u4E5F\u53EF\u4EE5\u81EA\u5B9A\u4E49\u589E\u52A0\u8D5B\u7A0B\u4FE1\u606F\u6A21\u5757\uFF0C\u589E\u52A0\u540E\u53EF\u81EA\u884C\u5F55\u5165\u4FE1\u606F\u3002 ",-1)),v("div",Z,[u(a(z),{ref:"el",modelValue:a(l),"onUpdate:modelValue":e[0]||(e[0]=n=>V(l)?l.value=n:null)},{default:t(()=>[(i(!0),m(K,null,W(a(l),(n,g)=>(i(),m("div",{key:g,class:"schedule-selector-item"},[u(r,{modelValue:n.isSelect,"onUpdate:modelValue":k=>n.isSelect=k,"true-value":1,"false-value":0,class:"schedule-selector-item-checkbox"},null,8,["modelValue","onUpdate:modelValue"]),v("span",ee,X(n.name),1),n.name!=="\u6807\u9898"?(i(),m("div",ue,[u(C,null,{default:t(()=>[u(U)]),_:1}),u(C,{onClick:k=>I(g),style:{"margin-left":"10px"}},{default:t(()=>[u(w)]),_:2},1032,["onClick"])])):h("v-if",!0)]))),128))]),_:1},8,["modelValue"]),a(l).length===0?(i(),m("div",te,[u(J,{description:"\u6682\u65E0\u8D5B\u7A0B\u4FE1\u606F\uFF0C\u8BF7\u65B0\u589E\u6A21\u5757"},{default:t(()=>[u(f,{type:"primary",onClick:B},{default:t(()=>e[3]||(e[3]=[p("\u65B0\u589E\u6A21\u5757",-1)])),_:1,__:[3]})]),_:1})])):(i(),m("div",le,[u(f,{onClick:B,class:"schedule-selector-add-button"},{default:t(()=>e[4]||(e[4]=[p("\u65B0\u589E\u6A21\u5757",-1)])),_:1,__:[4]})])),v("div",oe,[u(f,{type:"primary",loading:a(F),onClick:L},{default:t(()=>e[5]||(e[5]=[p("\u4E0B\u4E00\u6B65",-1)])),_:1,__:[5]},8,["loading"])])]),h(" \u65B0\u589E\u6A21\u5757 "),u(q,{modelValue:a(d),"onUpdate:modelValue":e[2]||(e[2]=n=>V(d)?d.value=n:null),title:"\u65B0\u589E\u6A21\u5757",width:"600px",onClose:A},{footer:t(()=>[u(f,{onClick:A},{default:t(()=>e[6]||(e[6]=[p("\u53D6\u6D88",-1)])),_:1,__:[6]}),u(f,{type:"primary",onClick:R},{default:t(()=>e[7]||(e[7]=[p("\u786E\u5B9A",-1)])),_:1,__:[7]})]),default:t(()=>[u(T,{model:a(_),rules:a(N),ref_key:"formRef",ref:y},{default:t(()=>[u(O,{label:"\u6A21\u5757\u540D\u79F0",prop:"name"},{default:t(()=>[u(M,{modelValue:a(_).name,"onUpdate:modelValue":e[1]||(e[1]=n=>a(_).name=n),placeholder:"\u8BF7\u8F93\u5165\u6A21\u5757\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}}});const ie=j(ne,[["__scopeId","data-v-45ddf5ff"]]);export{ie as default};
