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-BYcXwl4U.js";import{i as k,c as g}from"./app-a6cKceqE.js";import{_ as w}from"./app-BUc97JYP.js";import{L as C,s as m}from"./app-W_y7sflh.js";import{_ as y}from"./app-xKOIoh_n.js";import{_ as $}from"./app-uhTxLRnQ.js";import"./app-CJCAnMrx.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-ysQ8KbGS.js";import"./app-BDgR0DSb.js";import"./app-Cc2zXvHs.js";import"./app-DPDEogA0.js";import"./app-aSafd0Me.js";import"./app-BHl80pFw.js";import"./app-Btbk6LWy.js";import"./app-CrkKi1Ag.js";import"./app-u5shTDG_.js";import"./app-DCd54JMo.js";import"./app-MrAtUXr3.js";import"./app-BWSI2Z1R.js";import"./app-DxjODhok.js";import"./app-CabATHnR.js";import"./app-BhzV4gWo.js";import"./app-CO4sV-Ic.js";import"./app-yt37eDzA.js";import"./app-BQ5ggxk2.js";import"./app-D3zbrzdO.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};
