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-DA7OTM4Q.js";import{i as k,c as g}from"./app-BT68AfZ-.js";import{_ as w}from"./app-CHDDk_lH.js";import{L as C,s as m}from"./app-CjSxNKvA.js";import{_ as y}from"./app-B3ug1_yd.js";import{_ as $}from"./app-BWsCS5pa.js";import"./app-z_TsLOhk.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-Dxa5h-uG.js";import"./app-AbPAjGV5.js";import"./app-BqY8p2gl.js";import"./app-C-GI59rl.js";import"./app-DSiZNBrr.js";import"./app-BotiHebp.js";import"./app-DUjqI3OV.js";import"./app-CnGe5nlE.js";import"./app-45ZaIHUI.js";import"./app-KNE_24OY.js";import"./app-SLkqftrw.js";import"./app-BxVwOz69.js";import"./app-WOreqTiW.js";import"./app-scFtFqL8.js";import"./app-DREBJ-ou.js";import"./app-CWBL8eTX.js";import"./app-OC5wWJiS.js";import"./app-BX4pd6U-.js";import"./app-Bhreb6Cm.js";import"./app-up4gT9D9.js";import"./app-D29bbm9n.js";import"./app-B_5dka6q.js";import"./app-CQwVTjAx.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};
