import{u as U}from"./useInstance.233fbdde.js";import{az as i,d as N,a6 as O,s as T,b as _,r as C,p as F,c as d,e as c,k as y,i as u,h as s,u as a,A as R,f as j,j as z,m as h,t as I,F as M,a2 as $,E as S}from"./index.0308b213.js";import{A as G}from"./index.1d26a072.js";const oe=o=>i.request({url:"addon/storeWithdrawAutoPaySetting.web.store_withdraw_auto_pay_setting/list",params:o}),le=o=>i.request({url:"addon/storeWithdrawAutoPaySetting.web.store_withdraw_auto_pay_setting/delete",method:"POST",data:o}),H=o=>i.request({url:"addon/storeWithdrawAutoPaySetting.web.store_withdraw_auto_pay_setting/detail",params:o}),J=o=>i.request({url:"addon/storeWithdrawAutoPaySetting.web.store_withdraw_auto_pay_setting/edit",method:"POST",data:o}),K=o=>i.request({url:"addon/storeWithdrawAutoPaySetting.web.store_withdraw_auto_pay_setting/add",method:"POST",data:o}),Q=o=>i.request({url:"addon/storeWithdrawAutoPaySetting.web.store_withdraw_auto_pay_setting/getStoreList",params:o}),X=h("\u63D0\u4EA4"),Y=h("\u53D6\u6D88"),ue=N({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(o,{emit:V}){const r=o,{OpPlatform:g}=O(),{global:v}=U();let B=T(()=>Number(r.id)>0);_({list:[]});let f=_({list:[]});const w=C(!1),b=C(),e=_({id:"",agentid:"",sid:"",day:0,is_open:1}),P=()=>{g.value=="shangpu"&&(e.id>0?J(e).then(t=>{S({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),p()}):K(e).then(t=>{S({message:"\u65B0\u589E\u6210\u529F",type:"success"}),p()}))};F(()=>r.modelValue,t=>{w.value=t,t&&r.id&&(e.id=r.id,D())});const E=()=>{g.value=="shangpu"&&Q({agentid:e.agentid}).then(t=>{f.list=t})};E(),F(()=>e.agentid,t=>{t&&(t!=e.agentid&&(e.sid=""),f.list=[],E())},{immediate:!0}),_({list:[]});const D=()=>{H({id:r.id}).then(t=>{t=t.data,e.agentid=t.agentid,e.sid=t.sid,e.day=t.day,e.is_open=t.is_open?"1":"0"})},p=()=>{V("update:modelValue",!1),V("onClose"),v.$resetForm(b.value,e)};return(t,n)=>{const m=d("el-form-item"),k=d("el-option"),q=d("el-select"),x=d("el-input"),L=d("el-switch"),A=d("el-button"),W=d("el-dialog");return c(),y(W,{modelValue:w.value,"onUpdate:modelValue":n[4]||(n[4]=l=>w.value=l),title:a(B)?"\u67E5\u770B\u54C1\u724C\u95E8\u5E97":"\u65B0\u589E\u54C1\u724C\u95E8\u5E97",width:"70%","destroy-on-close":"",onClose:p},{default:u(()=>[s(a($),{ref_key:"formRef",ref:b,model:a(e),"inline-message":!0,"label-width":"160px"},{default:u(()=>[a(g)==="shangpu"?(c(),y(m,{key:0,label:"\u6240\u5C5E\u4EE3\u7406"},{default:u(()=>[s(a(G),{modelValue:a(e).agentid,"onUpdate:modelValue":n[0]||(n[0]=l=>a(e).agentid=l)},null,8,["modelValue"])]),_:1})):R("",!0),s(m,{label:"\u95E8\u5E97"},{default:u(()=>[s(q,{class:"agent-select",modelValue:a(e).sid,"onUpdate:modelValue":n[1]||(n[1]=l=>a(e).sid=l),placeholder:"\u8BF7\u9009\u62E9\u95E8\u5E97",filterable:"",clearable:""},{default:u(()=>[(c(!0),j(M,null,z(a(f).list,(l,Z)=>(c(),y(k,{value:l.id,label:l.title},{default:u(()=>[h(I(l.title),1)]),_:2},1032,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1}),s(m,{label:"\u63D0\u73B0\u5468\u671F(\u5929)"},{default:u(()=>[s(x,{modelValue:a(e).day,"onUpdate:modelValue":n[2]||(n[2]=l=>a(e).day=l),placeholder:"\u8BF7\u8F93\u5165\u63D0\u73B0\u5468\u671F(\u5929)"},null,8,["modelValue"])]),_:1}),s(m,{label:"\u5F00\u5173"},{default:u(()=>[s(L,{modelValue:a(e).is_open,"onUpdate:modelValue":n[3]||(n[3]=l=>a(e).is_open=l),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1}),s(m,null,{default:u(()=>[s(A,{type:"primary",onClick:P},{default:u(()=>[X]),_:1}),s(A,{onClick:p},{default:u(()=>[Y]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{ue as _,oe as a,le as d,Q as g};
