import{d as $,b as h,r as v,p as B,c as i,e as E,f as w,g as d,h as t,i as o,u as a,a1 as O,F as x,j as Q,k as R,m as r,t as g,q as G,E as C,N as H,_ as J}from"./index.0308b213.js";import{g as V,c as S,a as X}from"./discount.df6366e3.js";import{_ as Y}from"./DiscountSetting.vue_vue_type_script_setup_true_lang.d45f1b22.js";import{A as Z}from"./index.1d26a072.js";import"./useInstance.233fbdde.js";import"./install.524ae6f2.js";import"./useAgent.c0cb1751.js";import"./list.5526c7ef.js";const ee={class:"filter-form"},te=r("\u7B5B\u9009"),le={class:"data"},ne={class:"operation-container"},ae={class:"operation-btn"},oe=r("\u6279\u91CF\u8BBE\u7F6E\u6298\u6263"),ue=r("\u6279\u91CF\u53D6\u6D88"),se={class:"table"},ie={class:"table-operation-btn"},de={class:"top"},re=r("\u6E05\u9664\u6298\u6263"),ce={class:"bottom"},pe={class:"pagination"},_e=$({setup(me){const l=h({keyword:"",agentid:"",areaid:"",page:1,limit:20}),p=h({list:[],count:0});let c=v([]),k=v("");const _=()=>{V(l).then(u=>{p.list=u.list,p.count=u.count})};_();let m=v(!1);const A=()=>{if(c.value.length===0){C({message:"\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u6570\u636E",type:"error"});return}m.value=!0},L=()=>{c.value=[],_()},U=()=>{if(c.value.length===0){C({message:"\u8BF7\u9009\u62E9\u9700\u8981\u64CD\u4F5C\u7684\u6570\u636E",type:"error"});return}k.value=String(c.value),S({sid:String(c.value)}).then(u=>{console.log(u)})},F=()=>{l.page=1,_()},z=u=>{c.value=u.map(n=>String(n.id))};let b=h({list:[]});const y=()=>{X({agentid:Number(l.agentid)}).then(u=>{b.list=u,console.log(b.list)})},N=u=>{H.confirm("\u786E\u5B9A\u6E05\u9664\u6298\u6263\u5417\uFF1F","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{S({sid:String(u)}).then(n=>{_()})}).catch(()=>{C({type:"info",message:"\u5DF2\u53D6\u6D88\u6E05\u9664"})})};y();const q=()=>{V(l).then(u=>{p.list=u.list,p.count=u.count})};return B(()=>l.agentid,()=>{l.agentid>0&&y()},{immediate:!0}),B(()=>[l.page,l.limit],()=>{_()}),(u,n)=>{const I=i("el-input"),M=i("el-option"),P=i("el-select"),D=i("el-form-item"),f=i("el-button"),T=i("el-form"),s=i("el-table-column"),W=i("el-table"),j=i("el-pagination");return E(),w(x,null,[d("div",ee,[t(T,{model:a(l),"label-width":"80px"},{default:o(()=>[t(D,{class:"tn-el-form-item",label:"\u5176\u4ED6"},{default:o(()=>[t(a(Z),{modelValue:a(l).agentid,"onUpdate:modelValue":n[0]||(n[0]=e=>a(l).agentid=e),onChange:F},null,8,["modelValue"]),t(I,{modelValue:a(l).keyword,"onUpdate:modelValue":n[1]||(n[1]=e=>a(l).keyword=e),placeholder:"\u95E8\u5E97\u540D\u79F0/\u95E8\u5E97id",onKeyup:n[2]||(n[2]=O(e=>q(),["enter"])),style:{width:"auto","margin-left":"10px"}},null,8,["modelValue"]),t(P,{modelValue:a(l).areaid,"onUpdate:modelValue":n[3]||(n[3]=e=>a(l).areaid=e),placeholder:"\u8BF7\u9009\u62E9\u5546\u5708",filterable:"",clearable:"",style:{width:"auto","margin-left":"10px"}},{default:o(()=>[(E(!0),w(x,null,Q(a(b).list,(e,K)=>(E(),R(M,{value:e.id,label:e.title},{default:o(()=>[r(g(e.title),1)]),_:2},1032,["value","label"]))),256))]),_:1},8,["modelValue"])]),_:1}),t(D,null,{default:o(()=>[t(f,{type:"primary",onClick:F},{default:o(()=>[te]),_:1})]),_:1})]),_:1},8,["model"])]),d("div",le,[d("div",ne,[d("div",ae,[t(f,{class:"btn tn-button tn-button--blue--light",type:"primary",onClick:A},{default:o(()=>[oe]),_:1}),t(f,{class:"btn tn-button tn-button--blue--light",type:"primary",onClick:U},{default:o(()=>[ue]),_:1})])]),d("div",se,[t(W,{data:a(p).list,onSelectionChange:z},{default:o(()=>[t(s,{type:"selection",width:"55"}),t(s,{label:"id",prop:"id"}),t(s,{label:"\u5E97\u94FA\u540D\u79F0",prop:"title"}),t(s,{label:"\u6240\u5C5E\u57CE\u5E02"},{default:o(({row:e})=>[r(g(e.agent_title),1)]),_:1}),t(s,{label:"\u6240\u5C5E\u5546\u5708",prop:"store_area_title"}),t(s,{label:"\u6298\u6263"},{default:o(({row:e})=>[r(g(e.discount),1)]),_:1}),t(s,{label:"\u5F00\u59CB\u65F6\u95F4"},{default:o(({row:e})=>[r(g(e.discount_starttime),1)]),_:1}),t(s,{label:"\u7ED3\u675F\u65F6\u95F4"},{default:o(({row:e})=>[r(g(e.discount_endtime),1)]),_:1}),t(s,{fixed:"right",label:"\u64CD\u4F5C"},{default:o(({row:e})=>[d("div",ie,[d("div",de,[t(f,{onClick:K=>N(e.id)},{default:o(()=>[re]),_:2},1032,["onClick"])])])]),_:1})]),_:1},8,["data"])])]),d("div",ce,[d("div",pe,[t(j,{currentPage:a(l).page,"onUpdate:currentPage":n[4]||(n[4]=e=>a(l).page=e),"page-size":a(l).limit,"onUpdate:page-size":n[5]||(n[5]=e=>a(l).limit=e),"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:a(p).count},null,8,["currentPage","page-size","total"])])]),t(Y,{modelValue:a(m),"onUpdate:modelValue":n[6]||(n[6]=e=>G(m)?m.value=e:m=e),ids:a(c),onOnClose:L},null,8,["modelValue","ids"])],64)}}});const ye=J(_e,[["__scopeId","data-v-e0dca62e"]]);export{ye as default};
