import{u as T}from"./useInstance.233fbdde.js";import{az as r,d as x,a6 as N,s as P,r as F,b as E,p as R,c as p,e as k,k as B,i as d,h as u,u as a,A as q,a2 as z,m as C,E as _}from"./index.0308b213.js";import{a as G,b as I,c as L}from"./index.6effa892.js";import{A as M}from"./index.1d26a072.js";const X=s=>r.get("addon/cutTime.web.cut_time/list",{params:s}),O=s=>r.get("addon/cutTime.web.cut_time/detail",{params:s}),S=s=>r.post("addon/cutTime.web.cut_time/add",s),$=s=>r.post("addon/cutTime.web.cut_time/edit",s),Y=s=>r.post("addon/cutTime.web.cut_time/delete",s),j=C("\u63D0\u4EA4"),H=C("\u53D6\u6D88"),Z=x({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(s,{emit:V}){const n=s,{OpPlatform:c}=N(),{global:y}=T();let D=P(()=>Number(n.id)>0);const f=F(!1),b=F(),e=E({id:"",agentid:0,send_time:"",cut_time:"",remark:"",status:!0,is_countdown:!1}),h=()=>{e.id>0?c.value=="shangpu"?$(e).then(t=>{_({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),m()}):G(e).then(t=>{_({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),m()}):c.value=="shangpu"?S(e).then(t=>{_({message:"\u65B0\u589E\u6210\u529F",type:"success"}),m()}):I(e).then(t=>{_({message:"\u65B0\u589E\u6210\u529F",type:"success"}),m()})};R(()=>n.modelValue,t=>{f.value=t,t&&n.id&&(console.log("props.id",n.id),e.id=n.id,v())}),E({list:[]});const v=()=>{c.value=="shangpu"?O({id:n.id}).then(t=>{e.agentid=t.data.agentid||0,e.send_time=t.data.send_time||"",e.cut_time=t.data.cut_time||"",e.remark=t.data.remark||"",e.status=t.data.status||!0,e.is_countdown=t.data.is_countdown||!1}):L({id:n.id}).then(t=>{e.agentid=t.data.agentid||0,e.send_time=t.data.send_time||"",e.cut_time=t.data.cut_time||"",e.remark=t.data.remark||"",e.status=t.data.status||!0,e.is_countdown=t.data.is_countdown||!1,console.log("formData",e)})},m=()=>{V("update:modelValue",!1),V("onClose"),y.$resetForm(b.value,e)};return(t,l)=>{const i=p("el-form-item"),g=p("el-input"),A=p("el-switch"),w=p("el-button"),U=p("el-dialog");return k(),B(U,{modelValue:f.value,"onUpdate:modelValue":l[6]||(l[6]=o=>f.value=o),title:a(D)?"\u67E5\u770B":"\u65B0\u589E",width:"70%","destroy-on-close":"",onClose:m},{default:d(()=>[u(a(z),{ref_key:"formRef",ref:b,model:a(e),"inline-message":!0,"label-width":"160px"},{default:d(()=>[a(c)==="shangpu"?(k(),B(i,{key:0,label:"\u6240\u5C5E\u4EE3\u7406"},{default:d(()=>[u(a(M),{modelValue:a(e).agentid,"onUpdate:modelValue":l[0]||(l[0]=o=>a(e).agentid=o)},null,8,["modelValue"])]),_:1})):q("",!0),u(i,{label:"\u9884\u8BA1\u9001\u8FBE\u65F6\u95F4"},{default:d(()=>[u(g,{modelValue:a(e).send_time,"onUpdate:modelValue":l[1]||(l[1]=o=>a(e).send_time=o),placeholder:"02:00"},null,8,["modelValue"])]),_:1}),u(i,{label:"\u622A\u5355\u65F6\u95F4"},{default:d(()=>[u(g,{modelValue:a(e).cut_time,"onUpdate:modelValue":l[2]||(l[2]=o=>a(e).cut_time=o),placeholder:"01:30"},null,8,["modelValue"])]),_:1}),u(i,{label:"\u6E29\u99A8\u63D0\u793A"},{default:d(()=>[u(g,{modelValue:a(e).remark,"onUpdate:modelValue":l[3]||(l[3]=o=>a(e).remark=o)},null,8,["modelValue"])]),_:1}),u(i,{label:"\u72B6\u6001"},{default:d(()=>[u(A,{modelValue:a(e).status,"onUpdate:modelValue":l[4]||(l[4]=o=>a(e).status=o)},null,8,["modelValue"])]),_:1}),u(i,{label:"\u662F\u5426\u663E\u793A\u5012\u8BA1\u65F6"},{default:d(()=>[u(A,{modelValue:a(e).is_countdown,"onUpdate:modelValue":l[5]||(l[5]=o=>a(e).is_countdown=o)},null,8,["modelValue"])]),_:1}),u(i,null,{default:d(()=>[u(w,{type:"primary",onClick:h},{default:d(()=>[j]),_:1}),u(w,{onClick:m},{default:d(()=>[H]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{Z as _,Y as d,X as g};
