import{o as p,g as l,b as i,u as t,w as r,h as f,d as x,e as b,a as c,f as a,F as v,i as u,t as _}from"./app-SC54XQDl.js";import{i as k,c as g}from"./app-Ba7ZqSpq.js";import{_ as w}from"./app-BY_oRVaR.js";import{L as C,s as m}from"./app-Crd12MWL.js";import{_ as y}from"./app-B218Uy2Z.js";import{_ as $}from"./app-D9UgVOV0.js";import"./app-DHsI_tns.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-DnXuoh8P.js";import"./app-CCkWSX4Q.js";import"./app-C8HFiBxn.js";import"./app-BjSCO7rC.js";import"./app-g-bJrEAS.js";import"./app-DZaelcLs.js";import"./app-D_RBJHM6.js";import"./app-CmrRgGIA.js";import"./app-DyP4Nide.js";import"./app-CL60OiIv.js";import"./app-D9TrJBlL.js";import"./app-_Ovp2dOH.js";import"./app-Dhl-Bw0H.js";import"./app-B2C_dtYI.js";import"./app-COidJXl1.js";import"./app-C28obFWS.js";import"./app-CkINxBL9.js";import"./app--Lj8zATS.js";import"./app-C2mBgI5Z.js";function R(){const{utils:e,Tea:o}=k(this);this.createRoute=function(){e.popup("/ns/routes/createPopup",{width:"50em",height:"40em",callback:function(){e.success("保存成功",function(){e.reload()})}})},this.updateRoute=function(n){e.popup("/ns/routes/updatePopup?routeId="+n,{width:"50em",height:"40em",callback:function(){e.success("保存成功",function(){e.reload()})}})},this.deleteRoute=function(n){let d=this;e.confirm("确定要删除此线路吗？",function(){d.$post(".delete").params({routeId:n}).success(function(){e.reload()})})},this.sortTable=function(n){this.$post(".sort").params({routeIds:n}).success(function(){e.successToast("排序保存成功")})}}const T={key:0},N=["onClick"],S=c("i",{class:"icon expand small"},null,-1),V=["onClick"],z=["onClick"],B={key:0,class:"comment flex items-center"},I=c("i",{class:"icon bars"},null,-1),ut={__name:"index",setup(e){const o=g(new R);return(n,d)=>(p(),l(v,null,[i(y,{ctx:t(o),"active-tab":"index"},null,8,["ctx"]),t(o).routes.length==0?(p(),l("div",T,[i($,{"disable-spacing":""},{default:r(()=>[a("暂时还没有线路。")]),_:1})])):f("",!0),x(c("div",null,[i(C,{items:t(o).routes,onSort:t(o).sortTable},{default:r(()=>[i(t(m),{"row-reorder":"",style:{width:"3em"},frozen:""}),i(t(m),{header:"线路名称",class:"name-column",frozen:""},{body:r(({data:s})=>[c("a",{href:"",onClick:u(h=>t(o).updateRoute(s.id),["prevent"])},[a(_(s.name)+" ",1),S],8,N)]),_:1}),i(t(m),{header:"代号",class:"name-column"},{body:r(({data:s})=>[a(" id:"+_(s.id),1)]),_:1}),i(t(m),{header:"状态",class:"status-column"},{body:r(({data:s})=>[i(w,{"v-is-on":s.isOn},null,8,["v-is-on"])]),_:1}),i(t(m),{header:"操作",class:"two op","align-frozen":"right"},{body:r(({data:s})=>[c("a",{href:"",onClick:u(h=>t(o).updateRoute(s.id),["prevent"])},"修改",8,V),a("   "),c("a",{href:"",onClick:u(h=>t(o).deleteRoute(s.id),["prevent"])},"删除",8,z)]),_:1})]),_:1},8,["items","onSort"]),t(o).routes.length>0?(p(),l("p",B,[a("可以拖动左侧的"),I,a("排序。 ")])):f("",!0)],512),[[b,t(o).routes.length>0]])],64))}};export{ut as default};
