import{A as I}from"./index.1d26a072.js";import S from"./EditActivity.be83ae85.js";import{u as L}from"./useAgent.c0cb1751.js";import{c as $,d as q,e as M}from"./activity.736c114f.js";import{d as R,r as b,b as E,p as j,c as d,e as A,f as H,g as s,h as t,i as l,u as a,m as c,t as G,k as J,q as K,A as O,F as P,y,N as Q,E as W,_ as X}from"./index.0308b213.js";import"./install.524ae6f2.js";import"./TEditor.fed75c12.js";import"./index.esm.3fe50213.js";import"./list.5526c7ef.js";const Y={class:"filter-form"},Z=c("\u67E5\u8BE2"),tt={class:"data"},et={class:"operation-btn",style:{"margin-bottom":"10px"}},at=c("\u6DFB\u52A0\u6D3B\u52A8"),lt={class:"table"},ot={class:"table-operation-btn"},nt={class:"top"},ut=c("\u590D\u5236\u94FE\u63A5"),it=c("\u4FEE\u6539"),st=c("\u5220\u9664"),dt={class:"bottom"},rt={class:"pagination"},ct=R({setup(pt){let r=b(!1),m=b(!1),g=b(0);const o=E({agentid:"",page:1,limit:10}),f=E({limit:"",page:"",pages:1,total:0,list:[]}),p=()=>{$(o).then(u=>{f.list=u.list,f.total=u.count})},C=u=>{g.value=u,m.value=!0,y(()=>{r.value=!0})},B=()=>{m.value=!1,g.value=0},D=()=>{g.value=0,m.value=!0,y(()=>{r.value=!0})},x=u=>{Q.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{q(u).then(n=>{W({message:"\u5220\u9664\u6D3B\u52A8\u6210\u529F",type:"success"}),p()})}).catch(()=>{})},F=u=>{M(u)};p();const w=()=>{p()};j(()=>[o.page,o.limit,o.agentid],()=>{p()});const{getAgentList:V,getAgentTitle:k}=L();return V(),(u,n)=>{const h=d("el-form-item"),_=d("el-button"),U=d("el-form"),i=d("el-table-column"),z=d("el-switch"),N=d("el-table"),T=d("el-pagination");return A(),H(P,null,[s("div",Y,[t(U,{model:a(o),"label-width":"90px"},{default:l(()=>[t(h,{class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:l(()=>[t(a(I),{modelValue:a(o).agentid,"onUpdate:modelValue":n[0]||(n[0]=e=>a(o).agentid=e)},null,8,["modelValue"])]),_:1}),t(h,null,{default:l(()=>[t(_,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:w},{default:l(()=>[Z]),_:1})]),_:1})]),_:1},8,["model"])]),s("div",tt,[s("div",et,[t(_,{class:"btn",type:"primary",onClick:D},{default:l(()=>[at]),_:1})]),s("div",lt,[t(N,{data:a(f).list},{default:l(()=>[t(i,{type:"selection",width:"55"}),t(i,{label:"id",prop:"id"}),t(i,{label:" \u6D3B\u52A8\u540D\u79F0",prop:"name"}),t(i,{label:"\u6240\u5C5E\u57CE\u5E02",width:"100px"},{default:l(({row:e})=>[c(G(a(k)(e.agentid)),1)]),_:1}),t(i,{label:" \u6BCF\u4EBA\u6BCF\u65E5\u6295\u7968\u6570",prop:"day_vote_num"}),t(i,{label:" \u865A\u62DF\u7968\u6570",prop:"virtual_poll_num"}),t(i,{label:" \u865A\u62DF\u4EBA\u6C14",prop:"virtual_views_num"}),t(i,{label:"\u5F00\u542F\u72B6\u6001"},{default:l(e=>[t(z,{modelValue:e.row.status,"onUpdate:modelValue":v=>e.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=>F(e.row.id)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(i,{label:"\u64CD\u4F5C"},{default:l(e=>[s("div",ot,[s("div",nt,[t(_,{type:"primary",class:"copy-btn","data-clipboard-text":"/vote-page/activity/index?id="+e.row.id},{default:l(()=>[ut]),_:2},1032,["data-clipboard-text"]),t(_,{type:"primary",onClick:v=>C(e.row.id)},{default:l(()=>[it]),_:2},1032,["onClick"]),t(_,{type:"danger",onClick:v=>x(e.row.id)},{default:l(()=>[st]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),s("div",dt,[s("div",rt,[t(T,{"current-page":a(o).page,"onUpdate:current-page":n[1]||(n[1]=e=>a(o).page=e),"page-size":a(o).limit,"onUpdate:page-size":n[2]||(n[2]=e=>a(o).limit=e),"page-limit":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:a(f).total},null,8,["current-page","page-size","total"])])]),a(m)?(A(),J(S,{key:0,modelValue:a(r),"onUpdate:modelValue":n[3]||(n[3]=e=>K(r)?r.value=e:r=e),EditId:a(g),onHideEdit:B,onRefresh:n[4]||(n[4]=e=>p())},null,8,["modelValue","EditId"])):O("",!0)],64)}}});const yt=X(ct,[["__scopeId","data-v-24ec89ff"]]);export{yt as default};
