/* empty css             *//* empty css                   */import{_ as a}from"./index-ec277c8c.js";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang-e601cfd0.js";/* empty css                        *//* empty css                    *//* empty css               */import"./el-tooltip-4ed993c7.js";/* empty css                     *//* empty css                  *//* empty css                  */import{_ as t}from"./search.vue_vue_type_script_setup_true_lang-8a36466d.js";/* empty css                     *//* empty css                 */import l from"./create-f8fe786b.js";import o from"./paybackConfig-1367b074.js";import{u as i}from"./useGetList-33a80877.js";import{c as u}from"./index-54c69a0a.js";/* empty css                   */import"./http-795fd5dc.js";/* empty css                   */import{d as s,n,q as c,z as r,ao as d,o as m,c as p,a as _,w as v,f,e as b,Z as g,b as h,l as y,F as j,a7 as V,at as k,a5 as w,a6 as C,X as x,aa as A,ap as z,ab as U,a2 as I}from"./index-545c1a76.js";const J={class:"table-default"},q={class:"pt-5 pl-2"},D=s({__name:"index",setup(s){const{data:D,query:S,search:B,reset:N,loading:O}=i("callback/juliangAccount/list",!0),T=n((()=>{var a;return null==(a=D.value)?void 0:a.data})),F=c(!1),G=c({}),H=c([]),L=c(!1),R=a=>{switch(a){case"paybackVisible":L.value=!1;break;case"addAccountVisible":F.value=!1}B()},X=()=>{if(H.value.length<=0)return V.warning("至少选择一条数据");{const a="确定批量设置回传比例吗？";k.confirm(a,"提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{L.value=!0,G.value={account_id:"",account_name:"",min_money:null,max_money:null,state:1,protect_num:0,default_rate:0,rate_time_config:[]},G.value.ids=H.value.map((a=>a.id)),G.value.account_ids=H.value.map((a=>a.adv_account_id))})).catch((()=>{}))}},Z=a=>{H.value=a};return r((()=>{B()})),(i,s)=>{const n=w,c=C,r=t,k=x,D=A,H=z,$=U,E=e,K=a,M=d("action"),P=I;return m(),p(j,null,[_(r,{search:f(B),reset:f(N)},{body:v((()=>[_(c,{label:"巨量账户ID"},{default:v((()=>[_(n,{placeholder:"请输入巨量账户ID",class:"input",icon:"search",modelValue:f(S).account_id,"onUpdate:modelValue":s[0]||(s[0]=a=>f(S).account_id=a),clearable:""},null,8,["modelValue"])])),_:1}),_(c,{label:"巨量账户"},{default:v((()=>[_(n,{placeholder:"请输入巨量账户",class:"input",icon:"search",modelValue:f(S).account_name,"onUpdate:modelValue":s[1]||(s[1]=a=>f(S).account_name=a),clearable:""},null,8,["modelValue"])])),_:1})])),_:1},8,["search","reset"]),b("div",J,[g((m(),p("div",q,[_(k,{type:"primary",size:"default",onClick:s[2]||(s[2]=a=>{F.value=!0})},{default:v((()=>[h("新增账户")])),_:1}),_(k,{type:"primary",size:"default",onClick:X},{default:v((()=>[h("批量设置")])),_:1})])),[[M,"callback.JuliangAccount.addAccount"]]),g((m(),y($,{data:f(T),class:"mt-3",onSelectionChange:Z},{default:v((()=>[_(D,{type:"selection",width:"80"}),_(D,{label:"巨量账户ID",width:"260",prop:"adv_account_id"}),_(D,{label:"巨量账户",width:"260",prop:"adv_account_name"}),g((m(),y(D,{label:"回传开关",width:"150"},{default:v((a=>[b("div",null,[_(H,{modelValue:a.row.state,"onUpdate:modelValue":e=>a.row.state=e,onChange:e=>{return(t=a.row).id,t.state,void u({id:t.id,state:t.state}).then((a=>{V.success(a.message),B()}));var t},"active-value":1,"inactive-value":0},null,8,["modelValue","onUpdate:modelValue","onChange"])])])),_:1})),[[M,"callback.JuliangAccount.turnCallbackState"]]),_(D,{label:"操作"},{default:v((a=>[g((m(),y(k,{link:"",type:"primary",size:"default",onClick:e=>{return a.$index,t=a.row,G.value=t,"string"==typeof t.rate_time_config?G.value.rate_time_config=JSON.parse(t.rate_time_config):G.value.rate_time_config=t.rate_time_config,G.value.rate_time_config=G.value.rate_time_config.map((a=>({...a,time:[a.start_time,a.end_time]}))),G.value.account_name=G.value.adv_account_name,G.value.ids=[G.value.id],G.value.ids=[G.value.id],G.value.account_ids=[G.value.adv_account_id],void(L.value=!0);var t}},{default:v((()=>[h("回传配置")])),_:2},1032,["onClick"])),[[M,"callback.JuliangAccount.updateCallbackConfig"]])])),_:1})])),_:1},8,["data"])),[[P,f(O)]]),_(E)]),_(K,{modelValue:L.value,"onUpdate:modelValue":s[4]||(s[4]=a=>L.value=a),title:"设置回传配置",width:"80%","destroy-on-close":""},{default:v((()=>[_(o,{onClose:s[3]||(s[3]=a=>R("paybackVisible")),primary:G.value},null,8,["primary"])])),_:1},8,["modelValue"]),_(K,{modelValue:F.value,"onUpdate:modelValue":s[6]||(s[6]=a=>F.value=a),title:"添加账户",width:"80%","destroy-on-close":""},{default:v((()=>[_(l,{onClose:s[5]||(s[5]=a=>R("addAccountVisible"))})])),_:1},8,["modelValue"])],64)}}});export{D as _};
