import{E as O,g as j,d as R,c as G}from"./EditDialog.354c5c7a.js";import{d as H,a6 as J,b as x,r as u,p as K,c as d,at as Q,e as h,f as y,g as i,h as t,i as n,u as a,k,A as D,w as W,q as X,F as Y,m as b,y as V,N as Z,E as B,_ as ee}from"./index.0308b213.js";import{A as te}from"./index.1d26a072.js";import{_ as ae}from"./index.vue_vue_type_script_setup_true_lang.8a761348.js";import"./useInstance.233fbdde.js";import"./index.6dd89ec0.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const le={class:"filter-form"},oe=b("\u67E5\u8BE2"),se={class:"data"},ne={class:"operation-container"},ie={class:"operation-btn"},ue=b("\u6DFB\u52A0"),de={class:"table"},ce={class:"table-operation-btn"},re={class:"top"},pe=b("\u7F16\u8F91"),_e=b("\u5220\u9664"),me={class:"bottom"},ge={class:"pagination"},fe=H({setup(ve){const{OpPlatform:F}=J(),l=x({page:1,limit:10,agentid:"",sid:"",areaid:"",keywords:"",account_id:""}),E=u(!1);x({store:[]});const _=x({list:[],count:0});let A=u([]);const r=()=>{E.value=!0,j(l).then(o=>{_.list=o.list,_.count=o.count,E.value=!1})};r(),u(!1),u(!1),K(()=>[l.page,l.limit],()=>{r()});const w=()=>{r()};let c=u(!1),m=u(!1),g=u(0);const z=()=>{g.value=0,m.value=!0,V(()=>{c.value=!0})},U=o=>{g.value=o,m.value=!0,V(()=>{c.value=!0})},N=()=>{g.value=0,V(()=>{m.value=!1}),r()},P=o=>{Z.alert("\u786E\u5B9A\u9700\u8981\u5220\u9664\u6570\u636E\u5417?","\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",showCancelButton:!0,cancelButtonText:"\u53D6\u6D88"}).then(()=>{R({id:o}).then(()=>{B({message:"\u5220\u9664\u6210\u529F",type:"success"}),r()})}).catch(()=>{})},S=o=>{A.value=o.map(s=>s.id)},T=o=>{G({id:o.id,status:o.status}).then(()=>{B({message:"\u4FEE\u6539\u6210\u529F",type:"success"})})};return(o,s)=>{const C=d("el-form-item"),f=d("el-button"),I=d("el-form"),p=d("el-table-column"),$=d("el-switch"),q=d("el-table"),L=d("el-pagination"),M=Q("loading");return h(),y(Y,null,[i("div",le,[t(I,{model:a(l),"label-width":"90px"},{default:n(()=>[a(F)==="shangpu"?(h(),k(C,{key:0,class:"tn-el-form-item",label:"\u4EE3\u7406\u533A\u57DF"},{default:n(()=>[t(a(te),{modelValue:a(l).agentid,"onUpdate:modelValue":s[0]||(s[0]=e=>a(l).agentid=e)},null,8,["modelValue"])]),_:1})):D("",!0),t(C,{label:"\u5546\u6237",prop:"sid",ref:"stores"},{default:n(()=>[t(ae,{modelValue:a(l).sid,"onUpdate:modelValue":s[1]||(s[1]=e=>a(l).sid=e),agentid:a(l).agentid},null,8,["modelValue","agentid"])]),_:1},512),t(C,null,{default:n(()=>[t(f,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:w},{default:n(()=>[oe]),_:1})]),_:1})]),_:1},8,["model"])]),i("div",se,[i("div",ne,[i("div",ie,[t(f,{class:"btn",type:"primary",onClick:z},{default:n(()=>[ue]),_:1})])]),W((h(),y("div",de,[t(q,{data:a(_).list,onSelectionChange:S},{default:n(()=>[t(p,{align:"center",type:"selection"}),t(p,{label:"\u4EE3\u7406",prop:"agent_title"}),t(p,{label:"\u5546\u6237",prop:"store_title"}),t(p,{label:"\u72B6\u6001",prop:"status"},{default:n(({row:e})=>[t($,{modelValue:e.status,"onUpdate:modelValue":v=>e.status=v,"active-value":1,"inactive-value":0,"active-text":"\u542F\u7528","inactive-text":"\u7981\u7528",onChange:v=>T(e)},null,8,["modelValue","onUpdate:modelValue","onChange"])]),_:1}),t(p,{fixed:"right",label:"\u64CD\u4F5C",width:"290px"},{default:n(({row:e})=>[i("div",ce,[i("div",re,[t(f,{size:"small",type:"primary",onClick:v=>U(e.id)},{default:n(()=>[pe]),_:2},1032,["onClick"]),t(f,{size:"small",type:"danger",onClick:v=>P(e.id)},{default:n(()=>[_e]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])),[[M,E.value]])]),i("div",me,[i("div",ge,[t(L,{currentPage:a(l).page,"onUpdate:currentPage":s[2]||(s[2]=e=>a(l).page=e),"page-size":a(l).limit,"onUpdate:page-size":s[3]||(s[3]=e=>a(l).limit=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:a(_).count},null,8,["currentPage","page-size","total"])])]),a(m)?(h(),k(O,{key:0,modelValue:a(c),"onUpdate:modelValue":s[4]||(s[4]=e=>X(c)?c.value=e:c=e),id:a(g),onOnClose:N},null,8,["modelValue","id"])):D("",!0)],64)}}});const Be=ee(fe,[["__scopeId","data-v-7c0ab384"]]);export{Be as default};
