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