import{d as M,r as D,b as T,c as o,e as z,f as H,g as d,h as u,i as l,u as n,aT as L,t as b,m as i,aU as R,aV as j,E as p,R as q,S as G,_ as J}from"./index.0308b213.js";const V=m=>(q("data-v-189db845"),m=m(),G(),m),K={class:"seckill-config"},O={class:"header-card"},P={class:"status-wrapper"},Q=V(()=>d("span",{class:"status-label"},"\u79D2\u6740\u6D3B\u52A8\u603B\u5F00\u5173\uFF1A",-1)),W=i("\u65B0\u589E\u6D3B\u52A8 "),X={class:"content-card"},Y={class:"time-text"},Z={class:"duration-text"},tt=i("\u7F16\u8F91 "),et=i("\u5220\u9664 "),ut={class:"time-range-wrapper"},at=i("\u70B9\u5F00\u59CB"),lt=V(()=>d("span",{class:"separator"},"\u6301\u7EED",-1)),st=i("\u5C0F\u65F6"),ot=i("\u53D6\u6D88"),nt=i("\u786E\u5B9A"),dt=M({setup(m){const v=D(0),_=D(!1),f=D([{id:1,start_hour:10,duration:2,status:1},{id:2,start_hour:14,duration:2,status:1}]),t=T({id:null,start_hour:null,duration:null,status:1}),C=()=>{p.success(`\u79D2\u6740\u529F\u80FD\u5DF2${v.value?"\u5F00\u542F":"\u5173\u95ED"}`)},E=()=>{t.id=null,t.start_hour=null,t.duration=1,t.status=1,_.value=!0},k=s=>{t.id=s.id,t.start_hour=s.start_hour,t.duration=s.duration,t.status=s.status||1,_.value=!0},y=s=>{p.success("\u6D3B\u52A8\u5DF2\u5220\u9664"),f.value=f.value.filter(e=>e.id!==s)},w=()=>{if(t.start_hour===null||!t.duration){p.warning("\u8BF7\u586B\u5199\u5B8C\u6574\u4FE1\u606F");return}const s={...t,id:t.id||Date.now()};t.id?p.success("\u6D3B\u52A8\u5DF2\u66F4\u65B0"):(p.success("\u6D3B\u52A8\u5DF2\u521B\u5EFA"),f.value.push(s)),_.value=!1},x=(s,e)=>{let r=parseInt(s);isNaN(r)||r<0?t[e]=0:r>23?t[e]=23:t[e]=r},A=s=>{let e=parseInt(s);isNaN(e)||e<1?t.duration=1:e>24?t.duration=24:t.duration=e};return(s,e)=>{const r=o("el-switch"),h=o("el-icon"),c=o("el-button"),F=o("el-table-column"),I=o("el-tag"),S=o("el-table"),g=o("el-input"),B=o("el-form-item"),N=o("el-form"),U=o("el-dialog");return z(),H("div",K,[d("div",O,[d("div",P,[Q,u(r,{modelValue:v.value,"onUpdate:modelValue":e[0]||(e[0]=a=>v.value=a),"active-value":1,"inactive-value":0,"active-text":"\u5DF2\u5F00\u542F","inactive-text":"\u5DF2\u5173\u95ED",onChange:C},null,8,["modelValue"])]),u(c,{type:"primary",class:"add-btn",onClick:E},{default:l(()=>[u(h,null,{default:l(()=>[u(n(L))]),_:1}),W]),_:1})]),d("div",X,[u(S,{data:f.value,style:{width:"100%"},"header-cell-style":{background:"#f5f7fa",color:"#606266"}},{default:l(()=>[u(F,{prop:"start_hour",label:"\u5F00\u542F\u65F6\u95F4",align:"center"},{default:l(({row:a})=>[d("span",Y,b(a.start_hour)+":00",1)]),_:1}),u(F,{prop:"duration",label:"\u6301\u7EED\u65F6\u95F4",align:"center"},{default:l(({row:a})=>[d("span",Z,b(a.duration)+"\u5C0F\u65F6",1)]),_:1}),u(F,{prop:"status",label:"\u72B6\u6001",align:"center",width:"120"},{default:l(({row:a})=>[u(I,{type:a.status===1?"success":"info",size:"small"},{default:l(()=>[i(b(a.status===1?"\u542F\u7528":"\u7981\u7528"),1)]),_:2},1032,["type"])]),_:1}),u(F,{label:"\u64CD\u4F5C",align:"center",width:"180"},{default:l(a=>[u(c,{type:"primary",link:"",onClick:$=>k(a.row)},{default:l(()=>[u(h,null,{default:l(()=>[u(n(R))]),_:1}),tt]),_:2},1032,["onClick"]),u(c,{type:"danger",link:"",onClick:$=>y(a.row.id)},{default:l(()=>[u(h,null,{default:l(()=>[u(n(j))]),_:1}),et]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),u(U,{modelValue:_.value,"onUpdate:modelValue":e[6]||(e[6]=a=>_.value=a),title:"\u6D3B\u52A8\u914D\u7F6E",width:"560px","destroy-on-close":""},{footer:l(()=>[u(c,{onClick:e[5]||(e[5]=a=>_.value=!1)},{default:l(()=>[ot]),_:1}),u(c,{type:"primary",onClick:w},{default:l(()=>[nt]),_:1})]),default:l(()=>[u(N,{model:n(t),"label-width":"100px",class:"dialog-form"},{default:l(()=>[u(B,{label:"\u6D3B\u52A8\u65F6\u95F4"},{default:l(()=>[d("div",ut,[u(g,{modelValue:n(t).start_hour,"onUpdate:modelValue":e[1]||(e[1]=a=>n(t).start_hour=a),modelModifiers:{number:!0},placeholder:"\u5F00\u542F\u65F6\u95F4(0-23)",class:"time-input",onInput:e[2]||(e[2]=a=>x(a,"start_hour"))},{append:l(()=>[at]),_:1},8,["modelValue"]),lt,u(g,{modelValue:n(t).duration,"onUpdate:modelValue":e[3]||(e[3]=a=>n(t).duration=a),modelModifiers:{number:!0},placeholder:"\u6301\u7EED\u65F6\u95F4",class:"duration-input",onInput:A},{append:l(()=>[st]),_:1},8,["modelValue"])])]),_:1}),u(B,{label:"\u6D3B\u52A8\u72B6\u6001"},{default:l(()=>[u(r,{modelValue:n(t).status,"onUpdate:modelValue":e[4]||(e[4]=a=>n(t).status=a),"active-value":1,"inactive-value":0,"active-text":"\u542F\u7528","inactive-text":"\u7981\u7528"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])])}}});const rt=J(dt,[["__scopeId","data-v-189db845"]]);export{rt as default};
