import{_ as q,g as I,d as L,c as M,s as O}from"./EditCategoryDialog.vue_vue_type_script_setup_true_lang.359b9a8a.js";import{d as $,a6 as j,b as B,r as y,p as R,c as d,e as F,f as G,g as _,h as t,i as a,u as n,k as H,q as J,A as K,F as Q,m as f,N as W,E as C,y as b,_ as X}from"./index.0308b213.js";import{A as Y}from"./index.1d26a072.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={class:"filter-form"},ee=f("\u7B5B\u9009"),te={class:"data"},ae={class:"table"},le={class:"operation-container"},oe={class:"operation-btn"},ne=f("\u6DFB\u52A0\u5206\u7C7B"),se=f("\u63D0\u4EA4\u4FEE\u6539"),ue=f("\u7F16\u8F91"),ie=f("\u5220\u9664"),de={class:"pagination"},re=$({setup(ce){const{OpPlatform:E}=j(),u=B({page:1,limit:10,agentid:""}),g=B({lists:[],count:0}),r=()=>{E.value=="agent"||I(u).then(o=>{g.lists=o.lists,g.count=o.count})};r();const x=o=>{W.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u8BE5\u5206\u7C7B\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{E.value=="agent"||L({id:o}).then(()=>{C.success("\u5220\u9664\u5206\u7C7B\u6210\u529F"),r()})})};let p=y(!1),h=y(!1),v=y(0);const k=()=>{v.value=0,h.value=!0,b(()=>{p.value=!0})},A=o=>{v.value=o,h.value=!0,b(()=>{p.value=!0})},U=()=>{v.value=0,b(()=>{h.value=!1}),r()},D=(o,l)=>{M({id:l,status:o}).then(c=>{C({message:c.msg,type:"success"}),r()})},z=()=>{let o=[],l=[],c=[];g.lists.forEach((s,V)=>{o.push(s.id),l.push(s.name),c.push(s.displayorder)}),O({ids:o,titles:l,displayorders:c}).then(s=>{C({message:s.msg,type:"success"}),r()})};return R(()=>[u.page,u.limit],()=>{r()},{deep:!0}),(o,l)=>{const c=d("el-form-item"),s=d("el-button"),V=d("el-form"),m=d("el-table-column"),N=d("el-avatar"),w=d("el-input"),P=d("el-switch"),S=d("el-table"),T=d("el-pagination");return F(),G(Q,null,[_("div",Z,[t(V,null,{default:a(()=>[t(c,{label:"\u4EE3\u7406"},{default:a(()=>[t(n(Y),{modelValue:n(u).agentid,"onUpdate:modelValue":l[0]||(l[0]=e=>n(u).agentid=e)},null,8,["modelValue"])]),_:1}),t(c,null,{default:a(()=>[t(s,{type:"primary",onClick:r},{default:a(()=>[ee]),_:1})]),_:1})]),_:1})]),_("div",te,[_("div",ae,[_("div",le,[_("div",oe,[t(s,{class:"btn",type:"primary",onClick:k},{default:a(()=>[ne]),_:1}),t(s,{class:"btn",type:"warning",onClick:z},{default:a(()=>[se]),_:1})])]),t(S,{data:n(g).lists},{default:a(()=>[t(m,{label:"\u4EE3\u7406",prop:"agent_title"}),t(m,{label:"\u5546\u54C1\u7F29\u7565\u56FE","min-width":"60"},{default:a(({row:e})=>[t(N,{size:50,src:e.thumb},null,8,["src"])]),_:1}),t(m,{align:"center",label:"\u6392\u5E8F"},{default:a(e=>[t(w,{modelValue:e.row.displayorder,"onUpdate:modelValue":i=>e.row.displayorder=i},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(m,{align:"center",label:"\u6807\u9898"},{default:a(e=>[t(w,{modelValue:e.row.name,"onUpdate:modelValue":i=>e.row.name=i},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),t(m,{label:"\u662F\u5426\u542F\u7528"},{default:a(e=>[t(P,{modelValue:e.row.status,"onUpdate:modelValue":i=>e.row.status=i,size:"large",width:60,"inline-prompt":"","active-text":"\u542F\u7528","inactive-text":"\u7981\u7528","active-value":1,"inactive-value":0,onChange:i=>D(i,e.row.id)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(m,{align:"center",label:"\u4FEE\u6539/\u5220\u9664"},{default:a(e=>[t(s,{type:"primary",onClick:i=>A(e.row.id)},{default:a(()=>[ue]),_:2},1032,["onClick"]),t(s,{type:"danger",onClick:i=>x(e.row.id)},{default:a(()=>[ie]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])]),_("div",de,[t(T,{currentPage:n(u).page,"onUpdate:currentPage":l[1]||(l[1]=e=>n(u).page=e),"page-size":n(u).limit,"onUpdate:page-size":l[2]||(l[2]=e=>n(u).limit=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:n(g).count},null,8,["currentPage","page-size","total"])]),n(h)?(F(),H(q,{key:0,modelValue:n(p),"onUpdate:modelValue":l[3]||(l[3]=e=>J(p)?p.value=e:p=e),id:n(v),onOnClose:U},null,8,["modelValue","id"])):K("",!0)],64)}}});const Be=X(re,[["__scopeId","data-v-d38b33f6"]]);export{Be as default};
