import{_ as $,g as q,a as I,d as M,b as O,e as S,c as j}from"./EditCircleDialog.vue_vue_type_script_setup_true_lang.1f78a77e.js";import{A as G}from"./index.1d26a072.js";import{d as R,a6 as H,b as C,r,p as J,c,e as B,f as y,u as s,h as e,i as u,A,g as n,k as K,q as Q,F as W,m as E,y as F,N as X,E as b,_ as Y}from"./index.0308b213.js";import"./useInstance.233fbdde.js";import"./index.dfdc0704.js";import"./index.vue_vue_type_style_index_0_scoped_f00ed21d_lang.2c48f49b.js";import"./vuedraggable.umd.405b1bec.js";import"./index.35b8c9ab.js";import"./index.9e8820cd.js";import"./sort_out.2008c10d.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const Z={key:0,class:"filter-form"},ee=E("\u67E5\u8BE2"),te={class:"data"},ae={class:"operation-container"},le={class:"operation-btn"},se=E("\u6DFB\u52A0"),oe={class:"table"},ue={class:"image"},ne=["src"],ie={class:"table-operation-btn"},ce={class:"top"},de=E("\u4FEE\u6539"),_e=E("\u5220\u9664"),pe={class:"bottom"},re={class:"pagination"},me=R({setup(he){const{OpPlatform:m}=H(),o=C({page:1,limit:10,agentid:0,sid:""}),d=C({list:[],count:0});r([]);const _=()=>{m.value==="shangpu"?q(o).then(t=>{d.list=t.list,d.count=t.count}):I(o).then(t=>{d.list=t.list,d.count=t.count})};_(),C({list:[]}),r(!1),r(!1),J(()=>[o.page,o.limit],()=>{_()});const D=()=>{_()};let p=r(!1),h=r(!1),g=r(0);const V=()=>{g.value=0,h.value=!0,F(()=>{p.value=!0})},k=t=>{g.value=t,h.value=!0,F(()=>{p.value=!0})},w=()=>{g.value=0,F(()=>{h.value=!1}),_()},z=t=>{X.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{m.value=="shangpu"?M({id:t}).then(()=>{b({message:"\u5220\u9664\u6210\u529F",type:"success"}),_()}):O({id:t}).then(()=>{b({message:"\u5220\u9664\u6210\u529F",type:"success"}),_()})}).catch(()=>{})},U=t=>{if(m.value=="shangpu"){let a=t;a.is_auth=t.is_auth==1?0:1,t.is_auth==1?a.is_auth=0:a.is_auth=1,S(a).then(()=>{b({message:"\u4FEE\u6539\u6210\u529F",type:"success"})})}else{let a=t;a.is_auth=t.is_auth==1?0:1,t.is_auth==1?a.is_auth=0:a.is_auth=1,j(a).then(()=>{b({message:"\u4FEE\u6539\u6210\u529F",type:"success"})})}};return(t,a)=>{const x=c("el-form-item"),f=c("el-button"),N=c("el-form"),i=c("el-table-column"),P=c("el-switch"),T=c("el-table"),L=c("el-pagination");return B(),y(W,null,[s(m)==="shangpu"?(B(),y("div",Z,[e(N,{model:s(o),"label-width":"90px"},{default:u(()=>[e(x,{class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:u(()=>[e(s(G),{modelValue:s(o).agentid,"onUpdate:modelValue":a[0]||(a[0]=l=>s(o).agentid=l)},null,8,["modelValue"])]),_:1}),e(x,null,{default:u(()=>[e(f,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:D},{default:u(()=>[ee]),_:1})]),_:1})]),_:1},8,["model"])])):A("",!0),n("div",te,[n("div",ae,[n("div",le,[e(f,{class:"btn",type:"primary",onClick:V},{default:u(()=>[se]),_:1})])]),n("div",oe,[e(T,{data:s(d).list},{default:u(()=>[e(i,{label:"\u5BFC\u822Aid",prop:"id"}),e(i,{label:"\u6240\u5C5E\u57CE\u5E02",prop:"agent_title"}),e(i,{label:"\u5708\u5B50\u540D\u79F0",prop:"title"}),e(i,{label:"\u5708\u5B50\u56FE\u7247"},{default:u(({row:l})=>[n("div",ue,[n("img",{src:l.image,style:{width:"80px",height:"80px"}},null,8,ne)])]),_:1}),e(i,{label:"\u5708\u5B50\u7B80\u4ECB",prop:"description"}),e(i,{label:"\u8BA4\u8BC1\u72B6\u6001"},{default:u(l=>[e(P,{modelValue:l.row.is_auth,"onUpdate:modelValue":v=>l.row.is_auth=v,size:"large",width:60,"inline-prompt":"","active-text":"\u5F00\u542F","inactive-text":"\u5173\u95ED","active-value":1,"inactive-value":0,onChange:v=>U(l.row)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),e(i,{label:"\u5708\u5B50\u8303\u56F4(\u516C\u91CC)",prop:"distance"}),e(i,{label:"\u64CD\u4F5C",width:"290px"},{default:u(l=>[n("div",ie,[n("div",ce,[e(f,{type:"primary",onClick:v=>k(l.row.id)},{default:u(()=>[de]),_:2},1032,["onClick"]),e(f,{type:"danger",onClick:v=>z(l.row.id)},{default:u(()=>[_e]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),n("div",pe,[n("div",re,[e(L,{currentPage:s(o).page,"onUpdate:currentPage":a[1]||(a[1]=l=>s(o).page=l),"page-size":s(o).limit,"onUpdate:page-size":a[2]||(a[2]=l=>s(o).limit=l),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:s(d).count},null,8,["currentPage","page-size","total"])])]),s(h)?(B(),K($,{key:1,modelValue:s(p),"onUpdate:modelValue":a[3]||(a[3]=l=>Q(p)?p.value=l:p=l),id:s(g),onOnClose:w},null,8,["modelValue","id"])):A("",!0)],64)}}});const ke=Y(me,[["__scopeId","data-v-7254c651"]]);export{ke as default};
