import{aa as p,d as N,r as B,b as H,p as L,c as _,e as m,k as g,i as e,h as t,u as l,f as x,j as C,m as s,t as j,F as D,A as q,a2 as M,E as v}from"./index.0308b213.js";const oe=o=>p.post("agent/agentset.HourSetting/list",o),T=o=>p.get(`agent/agentset.HourSetting/detail?id=${o}`),$=o=>p.post("agent/agentset.HourSetting/add",o),z=o=>p.post("agent/agentset.HourSetting/edit",o),se=o=>p.post("agent/agentset.HourSetting/delete",{id:o}),G=()=>p.post("agent/agentset.HourSetting/getAreas"),J=s("\u5546\u5708"),K=s("\u661F\u671F\u4E00"),O=s("\u661F\u671F\u4E8C"),P=s("\u661F\u671F\u4E09"),Q=s("\u661F\u671F\u56DB"),W=s("\u661F\u671F\u4E94"),X=s("\u661F\u671F\u516D"),Y=s("\u661F\u671F\u5929"),Z=s("\u6DFB\u52A0\u8425\u4E1A\u65F6\u95F4"),ee=s("\u5220\u9664\u8425\u4E1A\u65F6\u95F4"),te=s("\u63D0\u4EA4"),ue=s("\u53D6\u6D88"),de=N({props:{show:{type:Boolean,default:!1},EditId:{type:Number,default:0}},emits:["hideEdit","refresh"],setup(o,{emit:F}){const f=o,n=B(1),w=()=>{if(n.value>=3){v({message:"\u8425\u4E1A\u65F6\u95F4\u6700\u591A\u53EA\u80FD\u6DFB\u52A03\u4E2A",type:"error"});return}n.value=n.value+1},S=()=>{if(n.value==1){v({message:"\u8425\u4E1A\u65F6\u95F4\u6700\u5C11\u4FDD\u75591\u4E2A",type:"error"});return}n.value=n.value-1};let u=H({id:0,agentid:0,area_ids:[],type:"area",week:[],execute_time:"",business_hours:[],agent_ids:[]}),h=H([]);(()=>{G().then(d=>{h.list=d})})(),B(!1);const I=()=>{f.EditId?(u.id=f.EditId,z(u).then(d=>{F("hideEdit"),F("refresh")})):$(u).then(d=>{F("hideEdit"),F("refresh")})},E=()=>{F("hideEdit")};return L(()=>f.EditId,()=>{f.EditId>0&&T(f.EditId).then(d=>{u.type=d.data.type,u.execute_time=d.data.execute_time,u.business_hours=d.data.business_hours,u.week=d.data.week,n.value=d.data.business_hours.length,u.agent_ids=d.data.agent_ids,u.area_ids=d.data.area_ids})},{immediate:!0}),(d,i)=>{const U=_("el-radio"),c=_("el-form-item"),r=_("el-checkbox"),b=_("el-checkbox-group"),k=_("el-time-picker"),y=_("el-link"),A=_("el-button"),R=_("el-dialog");return m(),g(R,{modelValue:o.show,title:o.EditId?"\u7F16\u8F91\u8BBE\u7F6E":"\u65B0\u589E\u8BBE\u7F6E",width:"50%",onClose:E},{default:e(()=>[t(l(M),{model:l(u),"label-width":"120px"},{default:e(()=>[t(c,{label:"\u6839\u636E\u7C7B\u578B",prop:"type"},{default:e(()=>[t(U,{modelValue:l(u).type,"onUpdate:modelValue":i[0]||(i[0]=a=>l(u).type=a),label:"area"},{default:e(()=>[J]),_:1},8,["modelValue"])]),_:1}),l(u).type=="area"?(m(),g(c,{key:0,label:"\u8BF7\u9009\u62E9\u5546\u5708",prop:"area_ids"},{default:e(()=>[t(b,{modelValue:l(u).area_ids,"onUpdate:modelValue":i[1]||(i[1]=a=>l(u).area_ids=a)},{default:e(()=>[(m(!0),x(D,null,C(l(h).list,(a,V)=>(m(),g(r,{key:a.id,label:a.id},{default:e(()=>[s(j(a.title),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})):q("",!0),t(c,{label:"\u661F\u671F\u51E0",prop:"week"},{default:e(()=>[t(b,{modelValue:l(u).week,"onUpdate:modelValue":i[2]||(i[2]=a=>l(u).week=a)},{default:e(()=>[t(r,{key:"1",label:"1"},{default:e(()=>[K]),_:1}),t(r,{key:"2",label:"2"},{default:e(()=>[O]),_:1}),t(r,{key:"3",label:"3"},{default:e(()=>[P]),_:1}),t(r,{key:"4",label:"4"},{default:e(()=>[Q]),_:1}),t(r,{key:"5",label:"5"},{default:e(()=>[W]),_:1}),t(r,{key:"6",label:"6"},{default:e(()=>[X]),_:1}),t(r,{key:"0",label:"0"},{default:e(()=>[Y]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(c,{label:"\u6267\u884C\u65F6\u95F4",prop:"execute_time"},{default:e(()=>[t(k,{modelValue:l(u).execute_time,"onUpdate:modelValue":i[3]||(i[3]=a=>l(u).execute_time=a),placeholder:"\u9009\u62E9\u65F6\u95F4",format:"HH:mm","value-format":"HH:mm"},null,8,["modelValue"])]),_:1}),(m(!0),x(D,null,C(n.value,a=>(m(),g(c,{label:"\u8425\u4E1A\u65F6\u95F4",prop:"business_hours",key:a},{default:e(()=>[t(k,{modelValue:l(u).business_hours[a-1],"onUpdate:modelValue":V=>l(u).business_hours[a-1]=V,"is-range":"","range-separator":"\u81F3","start-placeholder":"\u5F00\u59CB\u65F6\u95F4","end-placeholder":"\u7ED3\u675F\u65F6\u95F4",placeholder:"\u9009\u62E9\u65F6\u95F4\u8303\u56F4",format:"HH:mm","value-format":"HH:mm"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024))),128)),t(c,{label:""},{default:e(()=>[t(y,{type:"primary",onClick:w},{default:e(()=>[Z]),_:1}),t(y,{type:"danger",onClick:S,style:{"margin-left":"10px"}},{default:e(()=>[ee]),_:1})]),_:1}),t(c,null,{default:e(()=>[t(A,{type:"primary",onClick:I},{default:e(()=>[te]),_:1}),t(A,{onClick:E},{default:e(()=>[ue]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{de as _,se as d,oe as g};
