import{_ as $,g as q,a as I,d as M,b as O,e as S,c as j}from"./EditCircleNavDialog.vue_vue_type_script_setup_true_lang.38a642cc.js";import{A as G}from"./index.1d26a072.js";import{d as R,a6 as H,b as C,r as m,p as J,c,e as F,f as y,u as l,h as t,i as u,A as B,g as n,k as K,q as Q,F as W,m as E,y as A,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"./index.de7bcb5e.js";import"./install.524ae6f2.js";import"./index.e2f68f5b.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"},se={class:"operation-btn"},le=E("\u6DFB\u52A0"),oe={class:"table"},ue={class:"image"},ne=["src"],ie={class:"table-operation-btn"},ce={class:"top"},de=E("\u4FEE\u6539"),pe=E("\u5220\u9664"),re={class:"bottom"},me={class:"pagination"},_e=R({setup(ge){const{OpPlatform:_}=H(),o=C({page:1,limit:10,agentid:0,sid:""}),d=C({list:[],count:0});m([]);const p=()=>{_.value==="shangpu"?q(o).then(a=>{d.list=a.list,d.count=a.count}):I(o).then(a=>{d.list=a.list,d.count=a.count})};p(),C({list:[]}),m(!1),m(!1),J(()=>[o.page,o.limit],()=>{p()});const D=()=>{p()};let r=m(!1),g=m(!1),f=m(0);const V=()=>{f.value=0,g.value=!0,A(()=>{r.value=!0})},k=a=>{f.value=a,g.value=!0,A(()=>{r.value=!0})},w=()=>{f.value=0,A(()=>{g.value=!1}),p()},z=a=>{X.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{_.value=="shangpu"?M({id:a}).then(()=>{b({message:"\u5220\u9664\u6210\u529F",type:"success"}),p()}):O({id:a}).then(()=>{b({message:"\u5220\u9664\u6210\u529F",type:"success"}),p()})}).catch(()=>{})},U=a=>{if(_.value=="shangpu"){let e=a;e.status=a.status==1?0:1,a.status==1?e.status=0:e.status=1,console.log("formData.status",e.status),S(e).then(()=>{b({message:"\u4FEE\u6539\u6210\u529F",type:"success"})})}else{let e=a;e.status=a.status==1?0:1,a.status==1?e.status=0:e.status=1,j(e).then(()=>{b({message:"\u4FEE\u6539\u6210\u529F",type:"success"})})}};return(a,e)=>{const x=c("el-form-item"),h=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 F(),y(W,null,[l(_)==="shangpu"?(F(),y("div",Z,[t(N,{model:l(o),"label-width":"90px"},{default:u(()=>[t(x,{class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:u(()=>[t(l(G),{modelValue:l(o).agentid,"onUpdate:modelValue":e[0]||(e[0]=s=>l(o).agentid=s)},null,8,["modelValue"])]),_:1}),t(x,null,{default:u(()=>[t(h,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:D},{default:u(()=>[ee]),_:1})]),_:1})]),_:1},8,["model"])])):B("",!0),n("div",te,[n("div",ae,[n("div",se,[t(h,{class:"btn",type:"primary",onClick:V},{default:u(()=>[le]),_:1})])]),n("div",oe,[t(T,{data:l(d).list},{default:u(()=>[t(i,{label:"\u5BFC\u822Aid",prop:"id"}),t(i,{label:"\u6240\u5C5E\u57CE\u5E02",prop:"agent_title"}),t(i,{label:"\u5BFC\u822A\u6807\u9898",prop:"title"}),t(i,{label:"\u5BFC\u822A\u56FE\u6807"},{default:u(({row:s})=>[n("div",ue,[n("img",{src:s.image,style:{width:"80px",height:"80px"}},null,8,ne)])]),_:1}),t(i,{label:"\u5BFC\u822A\u94FE\u63A5",prop:"url"}),t(i,{label:"\u72B6\u6001"},{default:u(s=>[t(P,{modelValue:s.row.status,"onUpdate:modelValue":v=>s.row.status=v,size:"large",width:60,"inline-prompt":"","active-text":"\u5F00\u542F","inactive-text":"\u5173\u95ED","active-value":1,"inactive-value":0,onChange:v=>U(s.row)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(i,{label:"\u6743\u91CD",prop:"weigh"}),t(i,{label:"\u64CD\u4F5C",width:"290px"},{default:u(s=>[n("div",ie,[n("div",ce,[t(h,{type:"primary",onClick:v=>k(s.row.id)},{default:u(()=>[de]),_:2},1032,["onClick"]),t(h,{type:"danger",onClick:v=>z(s.row.id)},{default:u(()=>[pe]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),n("div",re,[n("div",me,[t(L,{currentPage:l(o).page,"onUpdate:currentPage":e[1]||(e[1]=s=>l(o).page=s),"page-size":l(o).limit,"onUpdate:page-size":e[2]||(e[2]=s=>l(o).limit=s),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:l(d).count},null,8,["currentPage","page-size","total"])])]),l(g)?(F(),K($,{key:1,modelValue:l(r),"onUpdate:modelValue":e[3]||(e[3]=s=>Q(r)?r.value=s:r=s),id:l(f),onOnClose:w},null,8,["modelValue","id"])):B("",!0)],64)}}});const ze=Y(_e,[["__scopeId","data-v-65959cd4"]]);export{ze as default};
