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