import{u as e,r as a,b as t,ad as s,c as r,bQ as i,d as o,e as l,h as n,f as d,k as p,g as c,n as u,w as m,j as f,am as b,aO as h,E as g,q as v,p as j}from"./index.286e9b79.js";import{v as y}from"./loading.c49775a6.js";import{E as w}from"./pagination.22bb50f6.js";import{E as k}from"./input.31de1b37.js";/* empty css            */import"./select.297a82d5.js";import{E as _,a as x}from"./table-column.7b4f59a2.js";import"./checkbox.f06171a4.js";import{E as z}from"./switch.197584d0.js";import{E as C,a as E}from"./form.ad10dcd5.js";import"./form-item.9355e6dc.js";import{E as q}from"./message-box.6a8eb828.js";import"./overlay.2c1583ac.js";import{g as U}from"./http.f588794f.js";import{f as V}from"./days.686d9566.js";import"./isEqual.57d72c4a.js";import"./_initCloneObject.fb8fbaea.js";import"./event.776e7e11.js";import"./index.ed3ed02e.js";import"./index.27150c7e.js";import"./token.34cb8214.js";import"./strings.8c60bfae.js";import"./scroll.a50153b5.js";import"./_baseIteratee.9ead53a1.js";import"./debounce.caafe00b.js";import"./validator.18338d56.js";const B={class:"search"},F={class:"search-box"},O={canplay:"search-wrap"},S={class:"table-wrap"},T={class:"table-box"},I={class:"toolbar"},P={class:"tabs-content"},Q=n("span",{style:{"font-size":"14px","margin-left":"5px"}},"暂无数据",-1),R={class:"page"},W=n("div",{class:"l"},null,-1),A={class:"r"},D={__name:"index",setup(D){const G=e(),H=a([]);let J=a(!1);const K=t({keywords:"",current:1,size:10,total:0}),L=()=>{J.value=!0,U("shop.distribution/index",K).then((e=>{J.value=!1,e.code?(H.value=e.data.list,K.total=e.data.total):g.error(e.msg)})).catch((e=>{J.value=!1,g.error(e)}))};s((()=>{L()}));const M=e=>{K.size=e,K.current=1,L()},N=e=>{K.current=e,L()},X=()=>{G.push("/shop/distribution/editor")},Y=a(),Z=t({keywords:""}),$=()=>{if(Z.keywords.trim().length<=0)return g({message:"请输入搜索关键字",type:"warning"}),!1;K.keywords=Z.keywords,L()},ee=()=>{K.keywords="",L(),Y.value.resetFields()};return(e,a)=>{const t=k,s=C,D=v,ae=E,te=r("Warning"),se=j,re=_,ie=z,oe=x,le=w,ne=i("auth"),de=y;return o(),l("div",null,[n("div",B,[n("div",F,[n("div",O,[d(ae,{ref_key:"searchFormRef",ref:Y,inline:!0,model:c(Z)},{default:p((()=>[d(s,{label:"搜索内容",prop:"keywords"},{default:p((()=>[d(t,{modelValue:c(Z).keywords,"onUpdate:modelValue":a[0]||(a[0]=e=>c(Z).keywords=e),placeholder:"请输入搜索信息",class:"search-item-box"},null,8,["modelValue"])])),_:1}),d(s,null,{default:p((()=>[d(D,{type:"primary",onClick:$},{default:p((()=>[u("搜索")])),_:1}),d(D,{onClick:ee},{default:p((()=>[u("重置")])),_:1})])),_:1})])),_:1},8,["model"])])])]),n("div",S,[n("div",T,[n("div",I,[m((o(),f(D,{onClick:X},{default:p((()=>[u("添加")])),_:1})),[[ne,["shop.distribution/editor"]]])]),n("div",P,[m((o(),f(oe,{data:c(H),size:"large",style:{width:"100%"}},{empty:p((()=>[d(se,{size:"18",style:{position:"relative",top:"4px"}},{default:p((()=>[d(te)])),_:1}),Q])),default:p((()=>[d(re,{prop:"title",label:"物流名称","header-align":"center",align:"center"}),m((o(),f(re,{label:"状态","header-align":"center",align:"center",width:"80"},{default:p((e=>[d(ie,{"model-value":e.row.status,onChange:a=>((e,a)=>{let t=0==e[a]?1:0;U("shop.distribution/status",{id:e.id,type:a,value:t}).then((s=>{s.code&&(e[a]=t)}))})(e.row,"status"),"active-value":1,"inactive-value":0},null,8,["model-value","onChange"])])),_:1})),[[ne,["shop.distribution/status"]]]),d(re,{label:"时间","header-align":"center",align:"center",width:"180"},{default:p((e=>[u(b(c(V)(e.row.create_time)),1)])),_:1}),d(re,{label:"操作","header-align":"center",align:"center",width:"110"},{default:p((e=>[m((o(),f(D,{type:"primary",size:"small",onClick:h((a=>{return t=e.row.id,void G.push({path:"/shop/distribution/editor",query:{id:t}});var t}),["prevent"]),link:""},{default:p((()=>[u("编辑")])),_:2},1032,["onClick"])),[[ne,["shop.distribution/editor"]]]),m((o(),f(D,{disabled:!!e.row.is_lock,type:"danger",size:"small",onClick:h((a=>{return t=e.row.id,void q.confirm("您确定要删除该分类吗","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{U("shop.distribution/delete",{id:t}).then((e=>{e.code?(g.success("删除成功"),H.value=[],L()):g.error(e.msg)}))}));var t}),["prevent"]),link:""},{default:p((()=>[u("删除")])),_:2},1032,["disabled","onClick"])),[[ne,["shop.distribution/delete"]]])])),_:1})])),_:1},8,["data"])),[[de,c(J)]])]),n("div",R,[W,n("div",A,[d(le,{"current-page":c(K).current,"onUpdate:currentPage":a[1]||(a[1]=e=>c(K).current=e),"page-size":c(K).size,"onUpdate:pageSize":a[2]||(a[2]=e=>c(K).size=e),small:!0,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"prev, pager, next, jumper, sizes, total",total:c(K).total,onSizeChange:M,onCurrentChange:N},null,8,["current-page","page-size","total"])])])])])])}}};export{D as default};
