import{az as h,aa as V,d as $,a as i,a6 as q,b as w,c as r,e as E,f as g,g as m,h as u,i as o,u as _,F as U,j,m as d,R as z,S as I,_ as P}from"./index.0308b213.js";const Y=()=>h.request({url:"addon/deliveryStation.web.Config/edit"}),N=n=>h.request({url:"addon/deliveryStation.web.Config/save",method:"post",data:n}),O=()=>V.request({url:"agent/plugin.deliveryStation.Config/edit"}),T=n=>V.request({url:"agent/plugin.deliveryStation.Config/save",method:"post",data:n}),c=n=>(z("data-v-2e63518e"),n=n(),I(),n),M={class:"config-continer"},L=c(()=>m("div",{class:"operation"},"\u57FA\u7840\u8BBE\u7F6E",-1)),R={class:"config-form"},G=d("\u5F00\u542F"),J=d("\u5173\u95ED"),K=c(()=>m("div",{class:"form-tips"},"\u5F00\u542F\u540E\u914D\u9001\u5458\u53EF\u5728\u9A91\u624B\u7AEFAPP\u8FDB\u884C\u626B\u7801,\u5F55\u7801,\u4E2D\u8F6C,\u9001\u8FBE\u7B49\u76F8\u5173\u64CD\u4F5C",-1)),Q=d("\u5F00\u542F"),W=d("\u5173\u95ED"),X=c(()=>m("div",{class:"form-tips"},"\u5F00\u542F\u540E\u8BA2\u5355\u8FDB\u5165\u4E2D\u8F6C\u7AD9\u65E0\u9700\u5206\u62E3\u5458\u8FDB\u884C\u786E\u8BA4\u64CD\u4F5C,\u672B\u7AEF\u9A91\u624B\u4FBF\u53EF\u81EA\u4E3B\u6536\u5355",-1)),Z=c(()=>m("span",null,"-",-1)),ee=d("\u5220\u9664"),te=c(()=>m("div",{class:"form-tips"},"\u914D\u9001\u65F6\u95F4\u6BB5\u53EF\u8BBE\u7F6E\u591A\u4E2A\u65F6\u6BB5,\u5728\u8BE5\u65F6\u6BB5\u5185\u5F00\u542F\u96C6\u4E2D\u914D\u9001\u6A21\u5F0F(\u4E0D\u8BBE\u7F6E\u65F6\u6BB5\u9ED8\u8BA4\u5168\u5929\u5F00\u542F)",-1)),ue=d("\u6DFB\u52A0\u65F6\u95F4\u6BB5"),oe=d("\u4FDD\u5B58"),ae=$({setup(n){const f=i().format("YYYY-MM-DD"),{OpPlatform:y}=q(),e=w({status:1,station_auto_confirm:0,delivery_time:[{start:i(`${f} 08:00`).toDate(),end:i(`${f} 20:00`).toDate()}]}),p=t=>t.map((s,v)=>({start:i(`${f} ${s.start}`).toDate(),end:i(`${f} ${s.end}`).toDate()})),A=t=>t.map(a=>({start:i(a.start).format("HH:mm"),end:i(a.end).format("HH:mm")}));(()=>{y.value==="agent"?O().then(t=>{t?(Object.assign(e,t),e.delivery_time=p(t.delivery_time)):e.delivery_time=p(e.delivery_time)}):Y().then(t=>{t?(Object.assign(e,t),e.delivery_time=p(t.delivery_time)):e.delivery_time=p(e.delivery_time)})})();const k=()=>{let t={start:"",end:""};e.delivery_time.push(t)},x=t=>{e.delivery_time=e.delivery_time.filter((a,s)=>s!=t)},H=()=>{y.value==="agent"?T({status:e.status,station_auto_confirm:e.station_auto_confirm,delivery_time:A(e.delivery_time)}):N({status:e.status,station_auto_confirm:e.station_auto_confirm,delivery_time:A(e.delivery_time)})};return(t,a)=>{const s=r("el-radio"),v=r("el-radio-group"),F=r("el-form-item"),C=r("el-time-picker"),D=r("el-button"),S=r("el-form");return E(),g("div",M,[L,m("div",R,[u(S,{model:_(e),ref:"form","label-width":"200px","label-position":"left"},{default:o(()=>[u(F,{label:"\u662F\u5426\u542F\u7528\u96C6\u4E2D\u914D\u9001\u6A21\u5F0F"},{default:o(()=>[u(v,{modelValue:_(e).status,"onUpdate:modelValue":a[0]||(a[0]=l=>_(e).status=l),onChange:a[1]||(a[1]=()=>{})},{default:o(()=>[u(s,{label:1},{default:o(()=>[G]),_:1}),u(s,{label:0},{default:o(()=>[J]),_:1})]),_:1},8,["modelValue"]),K]),_:1}),u(F,{label:"\u662F\u5426\u5F00\u542F\u81EA\u52A8\u786E\u8BA4"},{default:o(()=>[u(v,{modelValue:_(e).station_auto_confirm,"onUpdate:modelValue":a[2]||(a[2]=l=>_(e).station_auto_confirm=l),onChange:a[3]||(a[3]=()=>{})},{default:o(()=>[u(s,{label:1},{default:o(()=>[Q]),_:1}),u(s,{label:0},{default:o(()=>[W]),_:1})]),_:1},8,["modelValue"]),X]),_:1}),u(F,{label:"\u96C6\u4E2D\u914D\u9001\u65F6\u95F4\u6BB5"},{default:o(()=>[(E(!0),g(U,null,j(_(e).delivery_time,(l,b)=>(E(),g("div",{class:"form-item-flex",key:b},[u(C,{modelValue:l.start,"onUpdate:modelValue":B=>l.start=B,format:"HH:mm"},null,8,["modelValue","onUpdate:modelValue"]),Z,u(C,{modelValue:l.end,"onUpdate:modelValue":B=>l.end=B,format:"HH:mm"},null,8,["modelValue","onUpdate:modelValue"]),u(D,{type:"danger",size:"default",onClick:B=>x(b)},{default:o(()=>[ee]),_:2},1032,["onClick"])]))),128)),te,u(D,{type:"primary",size:"default",onClick:k},{default:o(()=>[ue]),_:1})]),_:1})]),_:1},8,["model"]),u(F,null,{default:o(()=>[u(D,{type:"primary",size:"default",onClick:H},{default:o(()=>[oe]),_:1})]),_:1})])])}}});const le=P(ae,[["__scopeId","data-v-2e63518e"]]);export{le as default};
