import{_ as U,g as $,a as L,d as q,b as I}from"./AreaDialog.vue_vue_type_script_setup_true_lang.c5ca9848.js";import{A as O}from"./index.1d26a072.js";import{d as P,a6 as S,r as A,b as D,p as j,c,e as b,f as R,g as i,h as o,i as s,u as e,k as h,A as x,q as G,F as H,m as v,y as E,N as J,E as F,_ as K}from"./index.0308b213.js";import"./useInstance.233fbdde.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const Q={class:"filter-form"},W=v("\u67E5\u8BE2"),X={class:"data"},Y={class:"operation-btn",style:{"margin-bottom":"10px"}},Z=v("\u6DFB\u52A0\u533A\u57DF"),ee={class:"table"},te={class:"table-operation-btn"},ae={class:"top"},oe=v("\u4FEE\u6539"),le=v("\u5220\u9664"),ne={class:"bottom"},se={class:"pagination"},ue=P({setup(ie){const{OpPlatform:m}=S();let r=A(!1),_=A(!1),g=A(0);const l=D({agentid:"",page:1,limit:10}),d=D({count:0,list:[]}),u=()=>{m.value==="agent"?$(l).then(n=>{d.list=n.list,d.count=n.count}):L(l).then(n=>{d.list=n.list,d.count=n.count})};u(),j(()=>[l.page,l.limit,l.agentid],()=>{u()});const B=()=>{u()},y=()=>{g.value=0,E(()=>{_.value=!1}),u()},k=()=>{g.value=0,_.value=!0,E(()=>{r.value=!0})},V=n=>{g.value=n,_.value=!0,E(()=>{r.value=!0})},w=n=>{J.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u533A\u57DF\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{m.value==="agent"?q(n).then(t=>{F({message:"\u5220\u9664\u533A\u57DF\u6210\u529F",type:"success"}),u()}):I(n).then(t=>{F({message:"\u5220\u9664\u533A\u57DF\u6210\u529F",type:"success"}),u()})}).catch(()=>{})};return(n,t)=>{const C=c("el-form-item"),f=c("el-button"),M=c("el-form"),p=c("el-table-column"),z=c("el-table"),N=c("el-pagination");return b(),R(H,null,[i("div",Q,[o(M,{model:e(l),"label-width":"90px"},{default:s(()=>[e(m)==="shangpu"?(b(),h(C,{key:0,class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:s(()=>[o(e(O),{modelValue:e(l).agentid,"onUpdate:modelValue":t[0]||(t[0]=a=>e(l).agentid=a)},null,8,["modelValue"])]),_:1})):x("",!0),o(C,null,{default:s(()=>[o(f,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:B},{default:s(()=>[W]),_:1})]),_:1})]),_:1},8,["model"])]),i("div",X,[i("div",Y,[o(f,{class:"btn",type:"primary",onClick:k},{default:s(()=>[Z]),_:1})]),i("div",ee,[o(z,{data:e(d).list},{default:s(()=>[o(p,{label:"id",prop:"id"}),e(m)==="shangpu"?(b(),h(p,{key:0,label:"\u4EE3\u7406\u533A\u57DF",prop:"agent_title"})):x("",!0),o(p,{label:"\u533A\u57DF\u540D\u79F0",prop:"name"}),o(p,{label:"\u6392\u5E8F",prop:"weigh"}),o(p,{label:"\u64CD\u4F5C",align:"center"},{default:s(a=>[i("div",te,[i("div",ae,[o(f,{type:"primary",onClick:T=>V(a.row.id)},{default:s(()=>[oe]),_:2},1032,["onClick"]),o(f,{type:"danger",onClick:T=>w(a.row.id)},{default:s(()=>[le]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),i("div",ne,[i("div",se,[o(N,{"current-page":e(l).page,"onUpdate:current-page":t[1]||(t[1]=a=>e(l).page=a),"page-size":e(l).limit,"onUpdate:page-size":t[2]||(t[2]=a=>e(l).limit=a),"page-limit":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:e(d).count,onSizeChange:t[3]||(t[3]=a=>u()),onCurrentChange:t[4]||(t[4]=a=>u())},null,8,["current-page","page-size","total"])])]),e(_)?(b(),h(U,{key:0,modelValue:e(r),"onUpdate:modelValue":t[5]||(t[5]=a=>G(r)?r.value=a:r=a),id:e(g),onOnClose:y},null,8,["modelValue","id"])):x("",!0)],64)}}});const fe=K(ue,[["__scopeId","data-v-8bc86327"]]);export{fe as default};
