index.vue
2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<template>
<div style="margin:40px" class="app-container">
<el-form :inline="true" :model="queryParams" class="demo-form-inline" size="small">
<el-form-item label="航班号">
<el-input v-model="queryParams.purposeOfFlightNo" placeholder="航班号"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList" size="mini">查询</el-button>
</el-form-item>
</el-form>
<el-button style="margin-bottom:20px" type="primary" icon="el-icon-plus" size="mini">添加</el-button>
<el-table
:data="flyList"
style="width: 800px"
v-loading="loading" size="small"
>
<el-table-column prop="purposeOfFlightNo" label="航班号" align="center"></el-table-column>
<el-table-column label="操作" prop="id" align="center">
<template slot-scope="scope" >
<el-button type="text" size="mini" icon="el-icon-view" @click="handleClick(scope.row.id, 'detail')">查看</el-button>
<el-button type="text" size="mini" icon="el-icon-edit" @click="handleClick(scope.row.id, 'update')">修改</el-button>
<el-button type="text" size="mini" icon="el-icon-delete">删除</el-button>
<el-button type="text" size="mini" icon="el-icon-video-play">启用</el-button>
<el-button type="text" size="mini" icon="el-icon-video-pause">停用</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="getList"
@current-change="getList"
:current-page.sync="curPage"
:page-sizes="[10, 20, 30, 40]"
:page-size.sync="limit"
layout="prev, pager, next, jumper, sizes, total"
:total="total"
background
:hide-on-single-page="true"
style="margin-top:40px; text-align:right">
</el-pagination>
</div>
</template>
<script>
import {
findFlightNo
} from "@/api/destinationFlight";
export default {
data() {
return {
queryParams: {
purposeOfFlightNo: '',
start:0,
limit:10
},
flyList:[],
curPage:1,
limit:10,
total:0,
loading:false,
}
},
methods: {
getList(){
this.queryParams.limit = this.limit;
if (this.curPage > 1) {
this.queryParams.start = (this.curPage - 1) * this.queryParams.limit
}else {
this.queryParams.start = 0;
}
this.loading = true;
findFlightNo(this.queryParams).then(response => {
this.flyList = response.data.list;
this.total = response.data.totalCount;
this.loading = false;
});
},
//跳转到查看,修改页面
handleClick(flightiId, handle){
this.$router.push({ name: 'info', params: { handle: handle, id:flightiId }});
},
//删除,启用,停用
changeStatus(id, handle){
}
},
created() {
this.getList();
}
}
</script>