Commit cf955c5a by 张杰

修复bug

1 parent 2a4bac46
import moment from '@/common/moment' import moment from '@/common/moment'
// 警情中心-围栏报警 // 全部
export const fenceShortcuts = [ let allDays = {
{
text: '全部', text: '全部',
onClick(picker) { onClick(picker) {
picker.$emit('pick', []) picker.$emit('pick', [])
}, },
}, }
{ // 本月
text: '今日', let currentMonth = {
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
picker.$emit('pick', [end, end])
},
},
{
text: '昨日',
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD')
const end = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '近7天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 6)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '近15天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 14)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '近30天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 29)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
]
// 警情中心-停驶报警
export const shutDownShortcuts = [
{
text: '全部',
onClick(picker) {
picker.$emit('pick', [])
},
},
{
text: '近3天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 2)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '近7天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 6)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '本月', text: '本月',
onClick(picker) { onClick(picker) {
const start = moment().add('month', 0).format('YYYY-MM') + '-01' const start = moment().add('month', 0).format('YYYY-MM') + '-01'
const end = moment().format('YYYY-MM-DD') const end = moment().format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, },
}, }
]
// 里程统计详情 // 今日
export const mileageDetailShortcuts = [ let currentDay = {
{ text: '今日',
text: '全部',
onClick(picker) { onClick(picker) {
picker.$emit('pick', []) const end = moment().format('YYYY-MM-DD')
}, picker.$emit('pick', [end, end])
}, },
{ }
// 昨日
let yesterday = {
text: '昨日', text: '昨日',
onClick(picker) { onClick(picker) {
const start = moment() const start = moment()
...@@ -115,82 +37,23 @@ export const mileageDetailShortcuts = [ ...@@ -115,82 +37,23 @@ export const mileageDetailShortcuts = [
.day(moment().day() - 1) .day(moment().day() - 1)
.format('YYYY-MM-DD') .format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, }
}, }
{
text: '本周',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment().weekday(0).format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '上周',
onClick(picker) {
let weekOfDay = parseInt(moment().format('E'))
const end = moment().subtract(weekOfDay, 'days').format('YYYY-MM-DD')
const start = moment()
.subtract(weekOfDay + 7 - 1, 'days')
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '本月',
onClick(picker) {
const start = moment().add('month', 0).format('YYYY-MM') + '-01'
const end = moment().format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '上月',
onClick(picker) {
const end = moment()
.month(moment().month() - 1)
.endOf('month')
.format('YYYY-MM-DD')
const start = moment()
.month(moment().month() - 1)
.startOf('month')
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
]
// 设备激活时间 // 近3天
export const deviceActivedShortcuts = [ let nearly3Days = {
{ text: '近3天',
text: '全部',
onClick(picker) {
const end = ''
const start = ''
picker.$emit('pick', [start, end])
},
},
{
text: '今日',
onClick(picker) { onClick(picker) {
const end = moment().format('YYYY-MM-DD') const end = moment().format('YYYY-MM-DD')
const start = moment().format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '昨日',
onClick(picker) {
const start = moment() const start = moment()
.day(moment().day() - 1) .day(moment().day() - 2)
.format('YYYY-MM-DD')
const end = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD') .format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, },
}, }
{
// 近7天
let nearly7Days = {
text: '近7天', text: '近7天',
onClick(picker) { onClick(picker) {
const end = moment().format('YYYY-MM-DD') const end = moment().format('YYYY-MM-DD')
...@@ -198,9 +61,11 @@ export const deviceActivedShortcuts = [ ...@@ -198,9 +61,11 @@ export const deviceActivedShortcuts = [
.day(moment().day() - 6) .day(moment().day() - 6)
.format('YYYY-MM-DD') .format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, }
}, }
{
// 近15天
let nearly15Days = {
text: '近15天', text: '近15天',
onClick(picker) { onClick(picker) {
const end = moment().format('YYYY-MM-DD') const end = moment().format('YYYY-MM-DD')
...@@ -208,9 +73,11 @@ export const deviceActivedShortcuts = [ ...@@ -208,9 +73,11 @@ export const deviceActivedShortcuts = [
.day(moment().day() - 14) .day(moment().day() - 14)
.format('YYYY-MM-DD') .format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, }
}, }
{
// 近30天
let nearly30Days = {
text: '近30天', text: '近30天',
onClick(picker) { onClick(picker) {
const end = moment().format('YYYY-MM-DD') const end = moment().format('YYYY-MM-DD')
...@@ -218,52 +85,11 @@ export const deviceActivedShortcuts = [ ...@@ -218,52 +85,11 @@ export const deviceActivedShortcuts = [
.day(moment().day() - 29) .day(moment().day() - 29)
.format('YYYY-MM-DD') .format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, }
}, }
]
// 超速报警 // 上月
export const speedShortcuts = [ let lastMonth = {
{
text: '全部',
onClick(picker) {
const end = ''
const start = ''
picker.$emit('pick', [start, end])
},
},
{
text: '昨日',
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD')
const end = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '上周',
onClick(picker) {
let weekOfDay = parseInt(moment().format('E'))
const end = moment().subtract(weekOfDay, 'days').format('YYYY-MM-DD')
const start = moment()
.subtract(weekOfDay + 7 - 1, 'days')
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '本月',
onClick(picker) {
const start = moment().add('month', 0).format('YYYY-MM') + '-01'
const end = moment().format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '上月', text: '上月',
onClick(picker) { onClick(picker) {
const end = moment() const end = moment()
...@@ -276,40 +102,10 @@ export const speedShortcuts = [ ...@@ -276,40 +102,10 @@ export const speedShortcuts = [
.format('YYYY-MM-DD') .format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, },
}, }
]
// 运营统计报表-车辆维度 // 上周
export const staticReportCarShortcuts = [ let lastWeek = {
{
text: '全部',
onClick(picker) {
const end = ''
const start = ''
picker.$emit('pick', [start, end])
},
},
{
text: '昨日',
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD')
const end = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '本周',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment().weekday(0).format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
},
{
text: '上周', text: '上周',
onClick(picker) { onClick(picker) {
let weekOfDay = parseInt(moment().format('E')) let weekOfDay = parseInt(moment().format('E'))
...@@ -319,27 +115,71 @@ export const staticReportCarShortcuts = [ ...@@ -319,27 +115,71 @@ export const staticReportCarShortcuts = [
.format('YYYY-MM-DD') .format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, },
}, }
{
text: '本月', // 本周
let currentWeek = {
text: '本周',
onClick(picker) { onClick(picker) {
const start = moment().add('month', 0).format('YYYY-MM') + '-01'
const end = moment().format('YYYY-MM-DD') const end = moment().format('YYYY-MM-DD')
const start = moment().weekday(0).format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) picker.$emit('pick', [start, end])
}, },
}, }
{
text: '上月', // 警情中心-围栏报警
onClick(picker) { export const fenceShortcuts = [
const end = moment() allDays,
.month(moment().month() - 1) currentDay,
.endOf('month') yesterday,
.format('YYYY-MM-DD') nearly7Days,
const start = moment() nearly15Days,
.month(moment().month() - 1) nearly30Days
.startOf('month') ]
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end]) // 警情中心-停驶报警
}, export const shutDownShortcuts = [
}, allDays,
nearly3Days,
nearly7Days,
currentMonth,
]
// 里程统计详情
export const mileageDetailShortcuts = [
allDays,
yesterday,
currentWeek,
lastWeek,
currentMonth,
lastMonth
]
// 设备激活时间
export const deviceActivedShortcuts = [
allDays,
currentDay,
nearly7Days,
currentMonth,
lastMonth,
nearly30Days
]
// 超速报警
export const speedShortcuts = [
allDays,
yesterday,
lastWeek,
currentMonth,
lastMonth,
]
// 运营统计报表-车辆维度
export const staticReportCarShortcuts = [
allDays,
yesterday,
currentWeek,
lastWeek,
currentMonth,
lastMonth
] ]
\ No newline at end of file \ No newline at end of file
...@@ -103,6 +103,7 @@ export default { ...@@ -103,6 +103,7 @@ export default {
*/ */
changePageSize: function (e) { changePageSize: function (e) {
this.pageSize = e; this.pageSize = e;
this.currentPage = 1;
this.getList(); this.getList();
}, },
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" prop="lastGpsAddress"> <el-table-column label="操作" prop="lastGpsAddress">
<template slot-scope="{row}"> <template slot-scope="{row}">
<el-link class="el_link" type="primary" @click="lookDetail(row)">常住地</el-link> <el-link class="el_link" type="primary" @click="lookDetail(row)">常驻地</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" :size="btn_size" icon="el-icon-search" @click="getList()">搜索</el-button> <el-button type="primary" :size="btn_size" icon="el-icon-search" @click="searchEvent()">搜索</el-button>
<el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</el-button> <el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -439,7 +439,7 @@ export default { ...@@ -439,7 +439,7 @@ export default {
return { return {
VEHICLE_USE_LIST, VEHICLE_USE_LIST,
VEHICLE_TAG_LIST, VEHICLE_TAG_LIST,
searchForm: {}, searchForm: {settleFlag:''},
getListApi: getVehicleList, getListApi: getVehicleList,
authList: [ authList: [
...@@ -1715,6 +1715,12 @@ export default { ...@@ -1715,6 +1715,12 @@ export default {
// 是否有权限 // 是否有权限
hasPermission(id){ hasPermission(id){
return this.$hasPermission(id) return this.$hasPermission(id)
},
// 搜索
searchEvent(){
this.pageNumber = 1;
this.getList()
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!