<template>
|
<div class="page-container colorfff">
|
<div class="nav">
|
<img
|
class="nav-icon"
|
:src="require('@/assets/safety/location.png')"
|
alt=""
|
/>
|
<div class="nav-content" @click="goBack">
|
<span>线路评价 </span>
|
<i class="el-icon el-icon-arrow-right"></i>
|
<div class="pointer pos-rel">单条线路</div>
|
</div>
|
</div>
|
|
<div class="content page-branch">
|
<!-- 查询条件 -->
|
<div class="filter-section">
|
<el-form
|
style="flex: 1"
|
:inline="true"
|
:model="filterForm"
|
ref="filterForm"
|
>
|
<el-form-item label="数据维度">
|
<el-select
|
style="width: 154px"
|
v-model="filterForm.disScreen"
|
popper-class="safety-report-filter"
|
@change="disScreenChange"
|
>
|
<el-option
|
v-for="item in disScreenOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option
|
>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="时间筛选">
|
<el-date-picker
|
v-if="
|
filterForm.disScreen == 'month' ||
|
filterForm.disScreen == 'year' ||
|
filterForm.disScreen == 'quarter'
|
"
|
v-model="timeRange"
|
type="monthrange"
|
placeholder=""
|
style="width: 184px"
|
:clearable="true"
|
@change="timeChange"
|
>
|
</el-date-picker>
|
<el-date-picker
|
v-if="filterForm.disScreen == 'day' || filterForm.disScreen == 'default'"
|
v-model="timeRange"
|
type="daterange"
|
placeholder=""
|
style="width: 204px"
|
:clearable="filterForm.disScreen == 'default' ? false : true"
|
@change="timeChange"
|
>
|
</el-date-picker>
|
</el-form-item>
|
</el-form>
|
<div class="action-bar">
|
<div class="action-item orange pointer" @click="exportData">
|
数据导出
|
</div>
|
<div
|
class="action-item blue pointer"
|
@click="$to('/lineCenter?lineName=' + $route.query.lineName, 3)"
|
>
|
切换到图表
|
</div>
|
</div>
|
</div>
|
<!-- 数据表格 -->
|
<div class="table-container">
|
<el-table
|
stripe
|
style="width: 100%"
|
header-row-class-name="table-header"
|
:height="'calc(100vh - 400px)'"
|
:data="dataList"
|
highlight-current-row
|
class="bs"
|
v-loading="loading"
|
@sort-change="handleSortChange"
|
>
|
<el-table-column
|
align="center"
|
prop="busLineName"
|
label="线路名称"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="statisticalDate"
|
label="统计时间"
|
width="140"
|
v-if="filterForm.disScreen != 'default'"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="onTimeRate"
|
label="班次发车准点率"
|
width="150"
|
sortable="custom"
|
>
|
<template slot-scope="scope"
|
>{{ Number(scope.row.onTimeRate).toFixed(0) }}%
|
</template
|
>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="onTimeRateF"
|
label="首班准点率"
|
width="120"
|
sortable="custom"
|
>
|
<template slot-scope="scope"
|
>{{ Number(scope.row.onTimeRateF).toFixed(0) }}%
|
</template
|
>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="onTimeRateL"
|
label="末班准点率"
|
width="120"
|
sortable="custom"
|
>
|
<template slot-scope="scope"
|
>{{ Number(scope.row.onTimeRateL).toFixed(0) }}%
|
</template
|
>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="sumVolumePeople"
|
label="客流总量(人)"
|
width="140"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="totalMileageByDay"
|
label="行驶总里程(km)"
|
width="150"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="complaintsNum"
|
label="投诉数量"
|
width="120"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="avgDepartureIntervalG"
|
label="高峰发车间隔(分钟)"
|
width="170"
|
sortable="custom"
|
>
|
<template slot-scope="scope">{{ decimal(scope.row.avgDepartureIntervalG, 0) }}</template>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="avgDepartureIntervalP"
|
label="平峰发车间隔(分钟)"
|
width="170"
|
sortable="custom"
|
>
|
<template slot-scope="scope">{{ decimal(scope.row.avgDepartureIntervalP, 0) }}</template>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="numberLargeIntervals"
|
label="大间隔次数"
|
width="120"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="plannedShift"
|
label="总计划班次"
|
width="120"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="operateShift"
|
label="总营运班次"
|
width="120"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="numberShiftsPlannedG"
|
label="高峰班计划数"
|
width="140"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="numberShiftsActualG"
|
label="高峰班完成数"
|
width="140"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="completionRateG"
|
label="高峰班完成率"
|
width="140"
|
sortable="custom"
|
>
|
<template slot-scope="scope">{{ scope.row.completionRateG }}%</template>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="numberShiftsPlannedP"
|
label="保障班计划数"
|
width="140"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="numberShiftsActualP"
|
label="保障班完成数"
|
width="140"
|
sortable="custom"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="completionRateP"
|
label="保障班完成率"
|
width="140"
|
sortable="custom"
|
>
|
<template slot-scope="scope">{{ scope.row.completionRateP }}%</template>
|
</el-table-column>
|
</el-table>
|
<div class="pagination-block">
|
<el-pagination
|
layout="total, prev, pager, next"
|
:total="total"
|
:current-page="filterForm.pageNum"
|
:page-size="filterForm.pageSize"
|
background
|
prev-text="上一页"
|
next-text="下一页"
|
@current-change="pageChange"
|
></el-pagination>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import moment from "moment";
|
import qs from "qs";
|
|
export default {
|
name: "busLine",
|
data() {
|
return {
|
loading: false,
|
total: 0,
|
filterForm: {
|
disScreen: "default",
|
busLineName: "",
|
endDate: moment().format('yyyy-MM-DD'),
|
startDate: moment().subtract(7, 'day').format('yyyy-MM-DD'),
|
pageSize: 20,
|
pageNum: 1,
|
},
|
timeRange: [moment().subtract(7, 'day'), moment()],
|
disScreenOptions: [
|
{label: "月", value: "month"},
|
{label: "日", value: "day"},
|
{label: "默认", value: "default"},
|
],
|
dataList: [],
|
};
|
},
|
created() {
|
},
|
activated() {
|
let id = this.$route.query.busLineId;
|
if (!id) {
|
this.dataList = [];
|
return;
|
}
|
this.currentBusLineId = id;
|
this.getList();
|
},
|
methods: {
|
handleSortChange(opt){
|
let {prop, order} = opt;
|
},
|
handleChange() {
|
this.filterForm.pageNum = 1;
|
this.dataList = [];
|
this.getList();
|
},
|
disScreenChange() {
|
this.filterForm.startDate = "";
|
this.filterForm.endDate = "";
|
this.timeRange = null;
|
|
switch (this.filterForm.disScreen) {
|
case 'day':
|
case 'default':
|
this.filterForm.startDate = moment().subtract(7, 'day').format('yyyy-MM-DD');
|
this.filterForm.endDate = moment().format('yyyy-MM-DD');
|
this.timeRange = [moment().subtract(7, 'day'), moment()];
|
break;
|
case 'month':
|
this.filterForm.startDate = moment().subtract(1, 'month').startOf('month').format('yyyy-MM-DD HH:mm:ss');
|
this.filterForm.endDate = moment().endOf('month').format('yyyy-MM-DD HH:mm:ss');
|
this.timeRange = [moment().subtract(1, 'month'), moment()];
|
break;
|
}
|
this.handleChange();
|
},
|
timeChange() {
|
if (this.timeRange && Array.isArray(this.timeRange)) {
|
let start = this.timeRange[0];
|
let end = this.timeRange[1];
|
this.filterForm.startDate =
|
moment(start).format("yyyy-MM-DD") + " 00:00:00";
|
this.filterForm.endDate =
|
moment(end).format("yyyy-MM-DD") + " 23:59:59";
|
if (this.filterForm.disScreen == "month") {
|
this.filterForm.endDate =
|
moment(end).endOf("month").format("yyyy-MM-DD") + " 23:59:59";
|
}
|
} else {
|
this.filterForm.startDate = "";
|
this.filterForm.endDate = "";
|
}
|
this.handleChange();
|
},
|
getList() {
|
this.loading = true;
|
const params = {};
|
if (this.filterForm.busLineName) {
|
params.busLineName = this.filterForm.busLineName;
|
}
|
if (this.filterForm.startDate) {
|
params.startDate = this.filterForm.startDate;
|
params.endDate = this.filterForm.endDate;
|
}
|
this.$axios
|
.get(this.$Interface.basicResource.singleLine, {
|
params: {
|
limit: this.filterForm.pageSize,
|
page: this.filterForm.pageNum,
|
oneLineName: this.currentBusLineId,
|
disScreen: this.filterForm.disScreen,
|
...params,
|
},
|
})
|
.then((res) => {
|
this.dataList = res.data.records;
|
this.total = Number(res.data.total);
|
this.loading = false;
|
});
|
},
|
exportData() {
|
const params = {};
|
if (this.filterForm.busLineName) {
|
params.busLineName = this.filterForm.busLineName;
|
}
|
if (this.filterForm.startDate) {
|
params.startDate = this.filterForm.startDate;
|
params.endDate = this.filterForm.endDate;
|
}
|
let token = localStorage.getItem("mtoken");
|
let _params = qs.stringify({
|
token,
|
busLineId: this.currentBusLineId,
|
disScreen: this.filterForm.disScreen,
|
oneLineName: this.currentBusLineId,
|
...params,
|
});
|
let a = document.createElement("a");
|
a.href = `${
|
this.$exportBase + this.$Interface.basicResource.export.singleLine
|
}?${_params}`;
|
a.click();
|
a = null;
|
},
|
pageChange(page) {
|
this.filterForm.pageNum = page;
|
this.getList();
|
},
|
goBack() {
|
this.$router.go(-1);
|
},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
@import url("../../assets/css/common.css");
|
|
@orange: #1cd1d3;
|
@blue: #3e89d3;
|
.page-container {
|
padding: 20px 30px;
|
padding-bottom: 0;
|
}
|
|
.nav {
|
display: flex;
|
font-size: 14px;
|
width: 100%;
|
height: 20px;
|
align-items: center;
|
position: relative;
|
|
.nav-icon {
|
width: 18px;
|
margin-left: 11px;
|
flex-shrink: 0;
|
margin-right: 11px;
|
}
|
|
.nav-content {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
}
|
}
|
|
.content {
|
margin-top: 16px;
|
|
.filter-section {
|
text-align: right;
|
display: flex;
|
align-items: flex-start;
|
|
/deep/ input {
|
height: 32px;
|
background: rgba(0, 131, 250, 0.1);
|
border: 1px solid rgba(20, 131, 242, 0.6);
|
border-radius: 0;
|
font-size: 12px;
|
|
::placeholder {
|
font-size: 12px;
|
}
|
|
color: #fff !important;
|
}
|
|
/deep/ .el-icon-arrow-up:before {
|
content: "\e78f";
|
}
|
|
/deep/ .el-form-item__label {
|
color: #fff;
|
}
|
|
/deep/ .el-icon-date::before {
|
content: "" !important;
|
}
|
|
/deep/ .el-range-editor.el-input__inner {
|
background: none;
|
height: 32px;
|
background: rgba(0, 131, 250, 0.1);
|
border: 1px solid rgba(20, 131, 242, 0.6);
|
border-radius: 0;
|
font-size: 12px;
|
margin-top: 6px;
|
|
input {
|
border: none;
|
background: none;
|
}
|
|
.el-range-separator {
|
color: #fff;
|
line-height: 20px;
|
}
|
|
.el-range__close-icon {
|
line-height: 24px;
|
}
|
}
|
}
|
|
.table-container {
|
margin: 0 72px;
|
|
.pagination-block {
|
text-align: center;
|
margin-top: 20px;
|
}
|
|
/deep/ .el-pagination__total {
|
color: #fff;
|
}
|
}
|
}
|
|
.action-bar {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
color: #fff;
|
font-size: 14px;
|
margin-left: 50px;
|
padding-top: 5px;
|
padding-right: 73px;
|
|
.action-item:first-child {
|
margin-right: 20px;
|
}
|
|
.action-item {
|
padding: 8px 30px;
|
border-left: 2px solid;
|
border-right: 2px solid;
|
opacity: 0.8;
|
}
|
|
.orange {
|
border-color: @orange;
|
background-color: rgba(28, 209, 211, 0.1);
|
}
|
|
.blue {
|
border-color: @blue;
|
background-color: rgba(62, 137, 211, 0.1);
|
}
|
}
|
|
.dialog {
|
width: 690px;
|
height: 768px;
|
opacity: 1;
|
background: linear-gradient(180deg, #06203f, #08141c);
|
border: 2px solid #2a488a;
|
margin: auto;
|
position: fixed;
|
top: 100px;
|
left: 0;
|
right: 0;
|
|
.title {
|
.title-icon {
|
margin: 17px 20px;
|
margin-right: 8px;
|
width: 20px;
|
}
|
}
|
|
.icon-close {
|
position: absolute;
|
top: 0;
|
right: -3px;
|
width: 42px;
|
cursor: pointer;
|
}
|
|
.action-bar {
|
position: absolute;
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
color: #fff;
|
font-size: 14px;
|
margin-top: 113px;
|
bottom: 60px;
|
|
.action-item:first-child {
|
margin-right: 96px;
|
}
|
|
.action-item {
|
padding: 8px 30px;
|
border-left: 2px solid;
|
border-right: 2px solid;
|
opacity: 0.8;
|
}
|
|
.orange {
|
border-color: @orange;
|
background-color: rgba(28, 209, 211, 0.1);
|
}
|
|
.blue {
|
border-color: @blue;
|
background-color: rgba(62, 137, 211, 0.1);
|
}
|
}
|
|
/deep/ .el-checkbox-group {
|
display: flex;
|
flex-direction: column;
|
margin-top: 50px;
|
margin-left: 100px;
|
|
label {
|
margin-bottom: 10px;
|
}
|
|
.el-checkbox__label {
|
color: #fff;
|
}
|
|
.is-checked + .el-checkbox__label {
|
color: #409eff;
|
}
|
}
|
}
|
</style>
|
<style lang="less">
|
.page-branch .el-table tr {
|
background: #161e2f !important;
|
height: 40px;
|
}
|
|
.page-branch .el-table td.el-table__cell {
|
border-bottom: none !important;
|
padding: 0 !important;
|
|
.cell {
|
color: #fff;
|
}
|
}
|
|
.page-branch
|
.el-table--striped
|
.el-table__body
|
tr.el-table__row--striped
|
td.el-table__cell {
|
background: #182237 !important;
|
}
|
|
.page-branch .table-header th {
|
height: 54px !important;
|
background: rgba(255, 255, 255, 0.04) !important;
|
color: rgba(255, 255, 255, 0.85);
|
}
|
|
.page-branch .el-table {
|
background: none !important;
|
}
|
|
.page-branch .el-table::before {
|
height: 0 !important;
|
}
|
|
.page-branch .table-header {
|
background: none;
|
}
|
|
.page-branch .el-table th.el-table__cell.is-leaf {
|
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
}
|
|
.page-branch .el-table__empty-block {
|
background: rgba(60, 129, 255, 0.04);
|
}
|
|
.page-branch .el-table__body tr.current-row > td.el-table__cell {
|
background: rgba(60, 129, 255, 0.1) !important;
|
}
|
|
.page-branch .el-table__body tr.hover-row > td.el-table__cell {
|
background: rgba(60, 129, 255, 0.1) !important;
|
}
|
|
.page-branch
|
.el-table--striped
|
.el-table__body
|
tr.current-row.el-table__row--striped
|
td.el-table__cell {
|
background: rgba(60, 129, 255, 0.1) !important;
|
}
|
|
.page-branch
|
.el-table--enable-row-hover
|
.el-table__body
|
tr:hover
|
> td.el-table__cell {
|
background: rgba(60, 129, 255, 0.1) !important;
|
|
.cell {
|
color: #fff !important;
|
}
|
}
|
|
.page-branch {
|
.pagination-block {
|
.el-pagination.is-background .btn-next,
|
.el-pagination.is-background .btn-prev,
|
.el-pagination.is-background .el-pager li {
|
background: none;
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
color: rgba(255, 255, 255, 0.65);
|
}
|
|
.el-pagination.is-background .el-pager li:not(.disabled).active {
|
background: #0179d0 !important;
|
}
|
|
.el-pagination.is-background .btn-next,
|
.el-pagination.is-background .btn-prev {
|
border: none !important;
|
}
|
}
|
|
.el-table--enable-row-hover .el-table__body tr:hover {
|
border: 1px solid rgba(0, 114, 194, 0.5);
|
}
|
|
.el-table--striped .el-table__body tr.current-row.el-table__row--striped {
|
border: 1px solid rgba(0, 114, 194, 0.5);
|
}
|
}
|
</style>
|