text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-063d3574"],{"1c16":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("el-row",[n("el-button",{attrs:{type:"primary",size:"medium"}},[n("router-link",{attrs:{to:"lines/add"}},[e._v("新增")])],1)],1),e._v(" "),n("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"输入车次名称",prop:"input"}},[n("el-input",{attrs:{placeholder:"线路名称，例：快线1, 55"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.goSearch("form")}},model:{value:e.form.input,callback:function(t){e.$set(e.form,"input",t)},expression:"form.input"}},[n("template",{slot:"prepend"},[e._v("线路")]),e._v(" "),n("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(t){return e.goSearch("form")}},slot:"append"},[e._v("搜索")])],2)],1)],1),e._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.list,"element-loading-text":"Loading",border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{align:"center",label:"ID",width:"70"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.row.id)+"\n      ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"车次信息"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.row.name)+"\n      ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"price",width:"110",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.price))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"类型",width:"110",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n        "+e._s(t.row.car_type)+"\n      ")]}}])}),e._v(" "),n("el-table-column",{attrs:{"class-name":"status-col",label:"审核通过",width:"110",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[0===t.row.is_show?n("el-tag",[e._v("未审核")]):1===t.row.is_show?n("el-tag",{attrs:{type:"success"}},[e._v("通过")]):n("el-tag",{attrs:{type:"warning"}},[e._v("不通过")])]}}])}),e._v(" "),n("el-table-column",{attrs:{align:"center",prop:"created_at",label:"创建时间",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("i",{staticClass:"el-icon-time"}),e._v(" "),n("span",[e._v(e._s(t.row.created_at))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{size:"mini"},on:{click:function(n){return e.handleEdit(t.$index,t.row)}}},[e._v("编辑")]),e._v(" "),n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(n){return e.handleDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1),e._v(" "),n("div",{staticClass:"pagination"},[n("el-pagination",{attrs:{total:e.total,"current-page":e.currentpage,"page-sizes":[10,20,30,50,100],"page-size":e.perpage,layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1)},r=[],i=n("35f8"),s={filters:{statusFilter:function(e){var t={1:"success",0:"gray","-1":"danger"};return t[e]}},data:function(){return{list:null,listLoading:!0,perpage:10,total:1e3,currentpage:1,listQuery:{page:1},form:{input:""},rules:{input:[{required:!0,message:"请输入线路名称",trigger:"blur"}]}}},created:function(){this.listQuery=this.$route.query,this.currentpage=parseInt(this.listQuery.page);var e=parseInt(this.$route.query.perPage);this.perpage=isNaN(e)?this.perpage:e,this.fetchData()},methods:{fetchData:function(){var e=this;this.listLoading=!0;var t=Object.assign({page:this.listQuery.page},{perPage:this.perpage});Object(i["d"])(t).then((function(t){e.list=t.data.data,e.listLoading=!1,e.total=t.data.total}))},handleEdit:function(e,t){this.$router.push({path:"lines/edit/"+t.id})},handleDelete:function(e,t){var n=this;this.$confirm("此操作将永久删除该数据, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(i["a"])(t.id).then((function(e){n.loading=!1,200===e.code?(n.$message({message:"操作成功",type:"success"}),n.fetchData()):n.$message.error(e.reason)})),n.$message({type:"success",message:"删除成功!"})})).catch((function(){n.$message({type:"info",message:"已取消删除"})}))},handleSizeChange:function(e){this.perpage=e,this.$router.push({path:"",query:{page:this.listQuery.page,perPage:e}}),this.fetchData()},handleCurrentChange:function(e){this.listQuery={page:e},this.$router.push({path:"",query:{page:e,perPage:this.perpage}}),this.fetchData({page:e})},goSearch:function(e){var t=this;this.$refs[e].validate((function(e){if(!e)return!1;t.listLoading=!0;var n={wd:t.form.input};Object(i["c"])(n).then((function(e){t.listLoading=!1,200===e.code?(t.form.isShow=!0,t.list=e.data.data,t.total=e.data.total):t.$message.error(e.reason)}))}))}}},o=s,l=(n("9934"),n("2877")),u=Object(l["a"])(o,a,r,!1,null,"46c1eafa",null);t["default"]=u.exports},"35f8":function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return s})),n.d(t,"f",(function(){return o})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return u}));var a=n("b775");function r(e){return Object(a["a"])({url:"/api/lines",method:"get",params:e})}function i(e){return a["a"].post("/api/lines",e)}function s(e){return a["a"].get("/api/lines/"+e)}function o(e,t){return a["a"].patch("/api/lines/"+e,t)}function l(e){return a["a"].delete("/api/lines/"+e)}function u(e){return Object(a["a"])({url:"/api/line_search",method:"get",params:e})}},"8ac6":function(e,t,n){},9934:function(e,t,n){"use strict";n("8ac6")}}]);