Commit 77350747 authored by zhanglw's avatar zhanglw

车辆实时历史报警

parent 9f0099e6
...@@ -3,10 +3,10 @@ ENV = 'development' ...@@ -3,10 +3,10 @@ ENV = 'development'
# 接口地址 # 接口地址
#VUE_APP_BASE_API = 'http://8.143.203.103:9091' #VUE_APP_BASE_API = 'http://8.143.203.103:9091'
VUE_APP_BASE_API = 'http://192.168.3.216:9092' #VUE_APP_BASE_API = 'http://192.168.3.216:9092'
VUE_APP_LOCAL_API = 'http://192.168.3.216:9092' #VUE_APP_LOCAL_API = 'http://192.168.3.216:9092'
#VUE_APP_BASE_API = 'http://192.168.3.23:9092' VUE_APP_BASE_API = 'http://192.168.3.23:9092'
#VUE_APP_LOCAL_API = 'http://192.168.3.23:9092' VUE_APP_LOCAL_API = 'http://192.168.3.23:9092'
VUE_APP_LOCAL_API2 = 'http://8.143.203.103:9091/' VUE_APP_LOCAL_API2 = 'http://8.143.203.103:9091/'
VUE_APP_WS_API = 'ws://8.143.203.103:9092/webSocket' VUE_APP_WS_API = 'ws://8.143.203.103:9092/webSocket'
......
...@@ -2677,14 +2677,6 @@ var HttpReq = function(){ ...@@ -2677,14 +2677,6 @@ var HttpReq = function(){
data:data, data:data,
}) })
}, },
//查询安检报告列表
// ajReportListFind: function(param){
// return request({
// url: '/api/anjian',
// method: 'get',
// params:param,
// })
// },
ajReportListFind: function(data){ ajReportListFind: function(data){
return request({ return request({
url: '/api/anjian/getAllAnJian', url: '/api/anjian/getAllAnJian',
...@@ -3031,6 +3023,21 @@ var HttpReq = function(){ ...@@ -3031,6 +3023,21 @@ var HttpReq = function(){
params:param, params:param,
}) })
}, },
propleGetLocus: function(param){
return request({
url: '/tab/perhis/locus',
method: 'get',
params:param,
})
},
propleGetLocusout: function(param){
return request({
url: '/tab/perhis/locusout',
method: 'get',
params:param,
responseType: 'blob'
})
},
propleGetPerabnormal: function(param){ propleGetPerabnormal: function(param){
return request({ return request({
url: '/tab/perabnormal', url: '/tab/perabnormal',
...@@ -3045,6 +3052,31 @@ var HttpReq = function(){ ...@@ -3045,6 +3052,31 @@ var HttpReq = function(){
data:data, data:data,
}) })
}, },
//获取车辆历史报警
cpGetAlarmHistory: function(param){
return request({
url: '/api/alarmHistory',
method: 'get',
params:param,
})
},
//获取车辆实时报警
cpGetRealTimeAlarm: function(param){
return request({
url: '/api/realTimeAlarm',
method: 'get',
params:param,
})
},
//解除车辆实时报警
cpPutRealTimeAlarm: function(data){
return request({
url: '/api/realTimeAlarm/remove',
method: 'PUT',
data: data,
})
},
}, },
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<label class="el-form-item-label" style="font-weight: 500;">牌号</label> <label class="el-form-item-label" style="font-weight: 500;">车牌号</label>
<el-select v-model="query.number" placeholder="车牌号" style="width:180px;"> <el-select v-model="query.number" placeholder="车牌号" style="width:180px;">
<el-option v-for="(obj,index) in carInforSelectList" :label="obj.number" :value="obj.number" :key="index"></el-option> <el-option v-for="(obj,index) in carInforSelectList" :label="obj.number" :value="obj.number" :key="index"></el-option>
</el-select> </el-select>
...@@ -20,14 +20,15 @@ ...@@ -20,14 +20,15 @@
<el-option v-for="(obj,index) in carTypeData" :label="obj.name" :value="obj.name" :key="index"></el-option> <el-option v-for="(obj,index) in carTypeData" :label="obj.name" :value="obj.name" :key="index"></el-option>
</el-select> </el-select>
<el-date-picker <label class="el-form-item-label" style="font-weight: 500;">日期范围</label>
v-model="query.createTime" <el-date-picker
v-model="query.timeList"
type="daterange" type="daterange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
<el-button size="mini" type="success" icon="el-icon-search" @click="toSearch">搜索</el-button> <el-button size="mini" type="success" icon="el-icon-search" @click="toSearch">搜索</el-button>
<el-button size="mini" icon="el-icon-refresh" @click="clearLimit">重置</el-button> <el-button size="mini" icon="el-icon-refresh" @click="clearLimit">重置</el-button>
</div> </div>
...@@ -43,18 +44,17 @@ ...@@ -43,18 +44,17 @@
<!-- <el-button size="mini" type="primary" icon="el-icon-plus" @click="toAdd">新增</el-button> --> <!-- <el-button size="mini" type="primary" icon="el-icon-plus" @click="toAdd">新增</el-button> -->
</div> </div>
<div class="content"> <div class="content">
<el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName" height="64vh"> <el-table :data="tableData" v-loading="loading" border style="width:auto" height="64vh">
<el-table-column prop="name" label="设备编号" align="center"></el-table-column> <el-table-column prop="equipmentNumber" label="设备编号" align="center"></el-table-column>
<el-table-column prop="alarmTime" label="报警时间" align="center"></el-table-column> <el-table-column prop="carNumber" label="车牌号" align="center"></el-table-column>
<el-table-column prop="number" label="车辆牌号" align="center"></el-table-column> <el-table-column prop="driver" label="司机" align="center"></el-table-column>
<el-table-column prop="carclass" label="车辆类型" align="center"></el-table-column> <el-table-column prop="carType" label="车辆类型" align="center"></el-table-column>
<el-table-column prop="driver" label="司机" align="center"></el-table-column> <el-table-column prop="alarmType" label="报警类型" align="center" :formatter="baojingleixingChange"></el-table-column>
<el-table-column prop="type" label="报警类型" align="center" :formatter="baojingleixingChange"></el-table-column> <el-table-column prop="alarmArea" label="报警区域" align="center"></el-table-column>
<el-table-column prop="areaName" label="报警区域" align="center"></el-table-column> <el-table-column prop="bjTime" label="报警时间" align="center"></el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="primary" @click="toRelieveAlarm(scope.row)" v-if="scope.row.status == 1">解除报警</el-button> <el-button style="margin:0" type="primary" icon="el-icon-close-notification" @click="toEdit(scope.row)"></el-button>
<span v-if="scope.row.status == 0">已解除报警</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -67,40 +67,29 @@ ...@@ -67,40 +67,29 @@
</div> </div>
<!-- 表单渲染 --> <!-- 表单渲染 -->
<el-dialog append-to-body :close-on-click-modal="true" :before-close="cancelForm" :visible.sync="form.visible" :title="form.title" width="700px"> <el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelForm" :visible.sync="editVisible" title="解除报警" width="500px">
<el-form :model="form.item" :rules="rules" ref="form1" :inline="true" size="small" label-width="150px"> <el-form :model="formData" :rules="rules" ref="formViewRef" :inline="true" label-width="180px">
<el-form-item label="报警名称" prop="name"> <el-form-item label="解除时长(h):" class="form-cell" prop="jcHours" style="width:100%">
<el-input v-model="form.item.name" style="width:280px;" placeholder="请输入报警名称"/> <div class="cell-box">
</el-form-item> <el-input v-model="formData.jcHours" class="cell-input" type="number"></el-input>
<el-form-item label="报警编码" prop="code"> </div>
<el-input v-model="form.item.code" style="width:280px;" placeholder="请输入车牌号"/> </el-form-item>
</el-form-item> <el-form-item label="报警原因:" class="form-cell" prop="bjReason">
<el-form-item label="报警状态" prop="status"> <div class="cell-box">
<el-select v-model="form.item.status" placeholder="请选择报警状态" style="width:280px;"> <el-input v-model="formData.bjReason" class="cell-input"></el-input>
<el-option label="正常" value="正常"></el-option> </div>
<el-option label="故障" value="故障"></el-option> </el-form-item>
</el-select> <el-form-item label="解除报警原因:" class="form-cell" prop="jcbjReason">
</el-form-item> <div class="cell-box">
<el-form-item label="终端车辆类型" prop="carclass"> <el-input v-model="formData.jcbjReason" class="cell-input"></el-input>
<el-select v-model="form.item.carclass" placeholder="请选择终端车辆类型" style="width:280px;"> </div>
<el-option label="卡车" value="卡车"></el-option> </el-form-item>
<el-option label="铲车" value="铲车"></el-option> </el-form>
</el-select> <div slot="footer" class="dialog-footer">
</el-form-item> <el-button type="text" @click="cancelForm">取消</el-button>
<el-form-item label="安装车辆" prop="carname"> <el-button type="primary" @click="submitForm('formViewRef', formData)">确认</el-button>
<el-select v-model="form.item.carname" placeholder="请选择安装车辆" style="width:280px;"> </div>
<el-option :label="item.name + '/' + item.number" :value="item.name + '/' + item.number" v-for="(item,index) in selectList" :key="index"></el-option> </el-dialog>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input type="textarea" v-model="form.item.remarks" style="width:280px;"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancelForm">取消</el-button>
<el-button :loading="form.status.cu === 2" type="primary" @click="submitForm('form1', form.item)">确认</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -114,6 +103,7 @@ export default { ...@@ -114,6 +103,7 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
editVisible: false,
page: 1, page: 1,
size: 10, size: 10,
total: 0, total: 0,
...@@ -126,17 +116,13 @@ export default { ...@@ -126,17 +116,13 @@ export default {
carInforSelectList:[], carInforSelectList:[],
//司机信息数据 //司机信息数据
driverInforSelectList:[], driverInforSelectList:[],
form: { formData: {
title:'新增报警', id: null,
visible:false, jcHours: 2,
reqType:'add', bjReason: '',
status:{cu:0}, jcbjReason: '',
item:{}, },
},
rules: { rules: {
// number: [
// {required: true, message: '请输入车牌号', trigger: 'blur' }
// ],
}, },
} }
}, },
...@@ -147,35 +133,19 @@ export default { ...@@ -147,35 +133,19 @@ export default {
loadData() { loadData() {
var param = {...this.query}; var param = {...this.query};
param.page = this.page - 1; param.page = this.page - 1;
param.size = this.size; param.pageSize = this.size;
param.sort = 'alarmTime,desc'; param.sort = 'alarmTime,desc';
param.startTime = undefined;
var param1 = {...this.query}; param.endTime = undefined;
param1.page = 0; if(param.timeList && param.timeList.length){
param1.size = 99999; param.startTime = param.timeList[0];
param.endTime = param.timeList[1];
}
this.$nextTick(()=>{ this.$nextTick(()=>{
if(this.query.createTime == undefined){ HttpReq.truckDispatching.cpGetRealTimeAlarm(param).then((res) => {
this.loading = false;
}else{ this.tableData = res.data.records;
console.log(this.query.createTime); this.total = res.data.total;
param.startTime = this.query.createTime[0]
param.endTime = this.query.createTime[1]
param1.startTime = this.query.createTime[0]
param1.endTime = this.query.createTime[1]
}
//获取报警信息
if(param.createTime){
delete param.createTime
}
if(param1.createTime){
delete param1.createTime
}
HttpReq.truckDispatching.apiMineAlarmHistoryLbQuery(param).then((res) => {
this.loading = false;
this.tableData = res.data;
})
HttpReq.truckDispatching.apiMineAlarmHistoryLbQuery(param1).then((res) => {
this.total = res.data.length;
}) })
//获取车辆类型 //获取车辆类型
HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => { HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => {
...@@ -196,18 +166,10 @@ export default { ...@@ -196,18 +166,10 @@ export default {
} }
}) })
}) })
},
tableRowClassName({row, rowIndex}) {
if (rowIndex === 1) {
return 'warning-row';
} else if (rowIndex === 3) {
return 'success-row';
}
return '';
}, },
cancelForm(a, b, c){ cancelForm(a, b, c){
this.form.visible = false; this.editVisible = false;
}, },
// 点击搜索 // 点击搜索
toSearch() { toSearch() {
...@@ -219,34 +181,15 @@ export default { ...@@ -219,34 +181,15 @@ export default {
this.query = {}; this.query = {};
this.loadData() this.loadData()
}, },
toAdd() { toEdit(item) {
// 请除表单验证 this.editVisible = true;
this.$refs['form1'] && this.$refs['form1'].clearValidate(); this.formData = {
this.form.title = '新增报警'; id: item.id,
this.form.status.cu = 0; jcHours: 2,
this.form.visible = true; bjReason: '',
this.form.reqType = 'add'; jcbjReason: '',
this.form.item = {}; }
}, },
toEdit(item) {
// 请除表单验证
this.$refs['form1'] && this.$refs['form1'].clearValidate();
this.form.title = '修改报警';
this.form.status.cu = 0;
this.form.visible = true;
this.form.item = {...item};
this.form.reqType = 'edit';
},
toDelete(item) {
var id = item.id;
this.$confirm('确认删除该条数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((e) => {
this.reqRemoveProject([id])
}).catch((e) => {})
},
pageChange(e) { pageChange(e) {
this.page = e this.page = e
this.loadData() this.loadData()
...@@ -256,122 +199,24 @@ export default { ...@@ -256,122 +199,24 @@ export default {
this.size = e this.size = e
this.loadData() this.loadData()
}, },
submitForm(validateName, item){ submitForm(validateName, item) {
if(!this.form.status.cu){ this.$refs[validateName].validate(valid => {
this.form.status.cu = 2; if (valid) {
this.$refs[validateName].validate(valid => { HttpReq.truckDispatching.cpPutRealTimeAlarm(item).then((res) => {
if(valid){ if (res.code == 200) {
if(this.form.reqType === 'add'){ this.$message({
this.reqAddItem(this.form, item) message: res.msg,
}else{ type: 'success'
this.reqUpdateItem(this.form, item) });
} this.cancelForm();
}else{ this.loadData()
this.form.status.cu = 0 }
} })
}); }
}; });
}, },
//新增报警
reqAddItem(form, item){
let lastData = {...item};
HttpReq.truckDispatching.callPoliceHistroyAdd(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
this.$notify({
title: '报警新增成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) {
form.status.cu = 0
});
},
//修改报警
reqUpdateItem(form, item){
let lastData = {...item};
HttpReq.truckDispatching.callPoliceHistroyUpdate(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
this.$notify({
title: '报警修改成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) {
form.status.cu = 0
});
},
//删除报警
reqRemoveProject(item){
HttpReq.truckDispatching.callPoliceHistroyDel(item).then((res) => {
if(res.status == 400){
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}else{
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
}
this.loadData();
})
},
//解除报警提示
toRelieveAlarm(item){
this.$confirm('确认解除报警吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((e) => {
this.relieveAlarm(item)
}).catch((e) => {})
},
//解除报警
relieveAlarm(item){
let lastData = {...item};
lastData.status = 0;
HttpReq.truckDispatching.callPoliceHistroyUpdate(lastData).then((res) => {
if(res.code == 200){
this.$notify({
title: '报警解除成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) {
form.status.cu = 0
});
},
baojingleixingChange(row){ baojingleixingChange(row){
return row.type == '1' ? '限入电子围栏报警' : row.type == '2' ? '限出电子围栏报警' : row.type == '3' ? '无故停车报警' : row.type == '4' ? '防碰撞报警' : '其他报警'; return row.alarmType == '1' ? '限入电子围栏报警' : row.alarmType == '2' ? '限出电子围栏报警' : row.alarmType == '3' ? '无故停车报警' : row.alarmType == '4' ? '防碰撞报警' : '其他报警';
} }
} }
} }
......
...@@ -5,29 +5,23 @@ ...@@ -5,29 +5,23 @@
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<label class="el-form-item-label" style="font-weight: 500;">车辆牌号</label> <label class="el-form-item-label" style="font-weight: 500;">车牌号</label>
<el-select v-model="query.number" placeholder="车辆牌号" style="width:180px;"> <el-input v-model="query.carNumber" clearable size="small" placeholder="请输入车牌号" style="width:180px;"/>
<el-option v-for="(obj,index) in carInforSelectList" :label="obj.number" :value="obj.number" :key="index"></el-option>
</el-select>
<label class="el-form-item-label" style="font-weight: 500;">司机姓名</label> <label class="el-form-item-label" style="font-weight: 500;">司机姓名</label>
<el-select v-model="query.driver" placeholder="司机姓名" style="width:180px;"> <el-input v-model="query.carNumber" clearable size="small" placeholder="请输入姓名" style="width:180px;"/>
<el-option v-for="(obj,index) in driverInforSelectList" :label="obj.name" :value="obj.name" :key="index"></el-option>
</el-select>
<label class="el-form-item-label" style="font-weight: 500;">报警类型</label> <label class="el-form-item-label" style="font-weight: 500;">报警类型</label>
<el-select v-model="query.carclass" placeholder="请选择卡车类型" style="width:180px;"> <el-select v-model="query.alarmType" placeholder="请选择">
<el-option v-for="(obj,index) in carTypeData" :label="obj.name" :value="obj.name" :key="index"></el-option> <el-option v-for="item in stuOpts" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
<label class="el-form-item-label" style="font-weight: 500;">日期范围</label>
<el-date-picker <el-date-picker
v-model="query.createTime" v-model="query.timeList"
type="daterange" type="daterange"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
<el-button size="mini" type="success" icon="el-icon-search" @click="toSearch">搜索</el-button> <el-button size="mini" type="success" icon="el-icon-search" @click="toSearch">搜索</el-button>
<el-button size="mini" icon="el-icon-refresh" @click="clearLimit">重置</el-button> <el-button size="mini" icon="el-icon-refresh" @click="clearLimit">重置</el-button>
</div> </div>
...@@ -43,23 +37,22 @@ ...@@ -43,23 +37,22 @@
<!-- <el-button size="mini" type="primary" icon="el-icon-plus" @click="toAdd">新增</el-button> --> <!-- <el-button size="mini" type="primary" icon="el-icon-plus" @click="toAdd">新增</el-button> -->
</div> </div>
<div class="content"> <div class="content">
<el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName" height="64vh"> <el-table :data="tableData" v-loading="loading" border style="width:auto" height="64vh">
<!-- <el-table-column prop="name" label="设备编号" align="center"></el-table-column>--> <!-- <el-table-column prop="name" label="设备编号" align="center"></el-table-column>-->
<el-table-column type="index" width="50" :index="indexMethod"></el-table-column> <el-table-column type="index" width="50" :index="indexMethod"></el-table-column>
<el-table-column prop="number" label="车辆牌号" align="center"></el-table-column> <el-table-column prop="carNumber" label="车牌号" align="center"></el-table-column>
<el-table-column prop="driver" label="司机" align="center"></el-table-column> <el-table-column prop="driver" label="司机" align="center"></el-table-column>
<el-table-column prop="type" label="报警类型" align="center" :formatter="baojingleixingChange"></el-table-column> <el-table-column label="状态" align="center">
<template slot-scope="scope">
<span v-show="scope.row.status===1">报警</span>
<span v-show="scope.row.status!==1">解除报警</span>
</template>
</el-table-column>
<el-table-column prop="alarmType" label="报警类型" align="center" :formatter="baojingleixingChange"></el-table-column>
<el-table-column prop="alarmTime" label="报警时间" align="center"></el-table-column> <el-table-column prop="alarmTime" label="报警时间" align="center"></el-table-column>
<el-table-column prop="carclass" label="报警原因" align="center"></el-table-column> <el-table-column prop="bjReason" label="报警原因" align="center"></el-table-column>
<el-table-column prop="areaName" label="状态" align="center"></el-table-column> <el-table-column prop="jcbjTime" label="解除报警时间" align="center"></el-table-column>
<el-table-column prop="operator" label="解除报警时间" align="center"></el-table-column> <el-table-column prop="jcbjReason" label="解除报警原因" align="center"></el-table-column>
<el-table-column prop="handleTime" label="解除报警原因" align="center"></el-table-column>
<!-- <el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" icon="el-icon-edit" @click="toEdit(scope.row)"></el-button>
<el-button size="mini" type="danger" icon="el-icon-delete" @click="toDelete(scope.row)"></el-button>
</template>
</el-table-column> -->
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<el-pagination :total="total" :current-page="page" style="margin-top: 8px;" layout="total, prev, pager, next, sizes" @size-change="sizeChange" @current-change="pageChange" /> <el-pagination :total="total" :current-page="page" style="margin-top: 8px;" layout="total, prev, pager, next, sizes" @size-change="sizeChange" @current-change="pageChange" />
...@@ -69,42 +62,6 @@ ...@@ -69,42 +62,6 @@
</div> </div>
</div> </div>
<!-- 表单渲染 -->
<el-dialog append-to-body :close-on-click-modal="true" :before-close="cancelForm" :visible.sync="form.visible" :title="form.title" width="700px">
<el-form :model="form.item" :rules="rules" ref="form1" :inline="true" size="small" label-width="150px">
<el-form-item label="报警名称" prop="name">
<el-input v-model="form.item.name" style="width:280px;" placeholder="请输入报警名称"/>
</el-form-item>
<el-form-item label="报警编码" prop="code">
<el-input v-model="form.item.code" style="width:280px;" placeholder="请输入车牌号"/>
</el-form-item>
<el-form-item label="报警状态" prop="status">
<el-select v-model="form.item.status" placeholder="请选择报警状态" style="width:280px;">
<el-option label="正常" value="正常"></el-option>
<el-option label="故障" value="故障"></el-option>
</el-select>
</el-form-item>
<el-form-item label="终端车辆类型" prop="carclass">
<el-select v-model="form.item.carclass" placeholder="请选择终端车辆类型" style="width:280px;">
<el-option label="卡车" value="卡车"></el-option>
<el-option label="铲车" value="铲车"></el-option>
</el-select>
</el-form-item>
<el-form-item label="安装车辆" prop="carname">
<el-select v-model="form.item.carname" placeholder="请选择安装车辆" style="width:280px;">
<el-option :label="item.name + '/' + item.number" :value="item.name + '/' + item.number" v-for="(item,index) in selectList" :key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input type="textarea" v-model="form.item.remarks" style="width:280px;"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="cancelForm">取消</el-button>
<el-button :loading="form.status.cu === 2" type="primary" @click="submitForm('form1', form.item)">确认</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -122,96 +79,45 @@ export default { ...@@ -122,96 +79,45 @@ export default {
total: 0, total: 0,
query:{}, query:{},
tableData: [], tableData: [],
selectList:[], stuOpts: [
//车辆类型数据 {label: '全部', value: undefined},
carTypeData:[], {label: '限入电子围栏报警', value: 1},
//车辆信息数据 {label: '限出电子围栏报警', value: 2},
carInforSelectList:[], {label: '无故停车报警', value: 3},
//司机信息数据 {label: '防碰撞报警', value: 4},
driverInforSelectList:[], ],
form: {
title:'新增报警',
visible:false,
reqType:'add',
status:{cu:0},
item:{},
},
rules: {
// number: [
// {required: true, message: '请输入车牌号', trigger: 'blur' }
// ],
},
} }
}, },
mounted() { mounted() {
this.loadData(); this.loadData();
}, },
methods: { methods: {
baojingleixingChange(row){
return row.alarmType == '1' ? '限入电子围栏报警' : row.alarmType == '2' ? '限出电子围栏报警' : row.alarmType == '3' ? '无故停车报警' : row.alarmType == '4' ? '防碰撞报警' : '其他报警';
},
indexMethod(index) { indexMethod(index) {
return 1+index+this.page*this.size-this.size; return 1+index+this.page*this.size-this.size;
}, },
loadData() { loadData() {
var param = {...this.query}; var param = {...this.query};
param.page = this.page - 1; param.page = this.page - 1;
param.size = this.size; param.pageSize = this.size;
param.sort = 'alarmTime,desc'; param.sort = 'alarmTime,desc';
param.startTime = undefined;
var param1 = {...this.query}; param.endTime = undefined;
param1.page = 0; if(param.timeList && param.timeList.length){
param1.size = 99999; param.startTime = param.timeList[0];
param.endTime = param.timeList[1];
}
this.$nextTick(()=>{ this.$nextTick(()=>{
if(this.query.createTime == undefined){ HttpReq.truckDispatching.cpGetAlarmHistory(param).then((res) => {
}else{
console.log(this.query.createTime);
param.startTime = this.query.createTime[0]
param.endTime = this.query.createTime[1]
param1.startTime = this.query.createTime[0]
param1.endTime = this.query.createTime[1]
}
//获取报警信息
if(param.createTime){
delete param.createTime
}
if(param1.createTime){
delete param1.createTime
}
HttpReq.truckDispatching.apiMineAlarmHistoryLbQuery(param).then((res) => {
this.loading = false; this.loading = false;
this.tableData = res.data; this.tableData = res.data.records;
}) this.total = res.data.total;
HttpReq.truckDispatching.apiMineAlarmHistoryLbQuery(param1).then((res) => {
this.total = res.data.length;
})
//获取车辆类型
HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => {
if(res.code == 200){
this.carTypeData = res.data.content;
}
})
//获取车辆信息
HttpReq.truckDispatching.carInformationQuery({size:9999}).then((res) => {
if(res.code == 200){
this.carInforSelectList = res.data.content;
}
})
//获取司机人员信息
HttpReq.truckDispatching.driverManagementPCQuery({size:9999}).then((res) => {
if(res.code == 200){
this.driverInforSelectList = res.data.content;
}
}) })
}) })
}, },
tableRowClassName({row, rowIndex}) {
if (rowIndex === 1) {
return 'warning-row';
} else if (rowIndex === 3) {
return 'success-row';
}
return '';
},
cancelForm(a, b, c){ cancelForm(a, b, c){
this.form.visible = false; this.form.visible = false;
}, },
...@@ -225,24 +131,6 @@ export default { ...@@ -225,24 +131,6 @@ export default {
this.query = {}; this.query = {};
this.loadData() this.loadData()
}, },
toAdd() {
// 请除表单验证
this.$refs['form1'] && this.$refs['form1'].clearValidate();
this.form.title = '新增报警';
this.form.status.cu = 0;
this.form.visible = true;
this.form.reqType = 'add';
this.form.item = {};
},
toEdit(item) {
// 请除表单验证
this.$refs['form1'] && this.$refs['form1'].clearValidate();
this.form.title = '修改报警';
this.form.status.cu = 0;
this.form.visible = true;
this.form.item = {...item};
this.form.reqType = 'edit';
},
toDelete(item) { toDelete(item) {
var id = item.id; var id = item.id;
this.$confirm('确认删除该条数据吗?', '提示', { this.$confirm('确认删除该条数据吗?', '提示', {
...@@ -262,123 +150,6 @@ export default { ...@@ -262,123 +150,6 @@ export default {
this.size = e this.size = e
this.loadData() this.loadData()
}, },
submitForm(validateName, item){
if(!this.form.status.cu){
this.form.status.cu = 2;
this.$refs[validateName].validate(valid => {
if(valid){
if(this.form.reqType === 'add'){
this.reqAddItem(this.form, item)
}else{
this.reqUpdateItem(this.form, item)
}
}else{
this.form.status.cu = 0
}
});
}
},
//新增报警
reqAddItem(form, item){
let lastData = {...item};
HttpReq.truckDispatching.callPoliceHistroyAdd(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
this.$notify({
title: '报警新增成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) {
form.status.cu = 0
});
},
//修改报警
reqUpdateItem(form, item){
let lastData = {...item};
HttpReq.truckDispatching.callPoliceHistroyUpdate(lastData).then((res) => {
form.visible = false;
if(res.code == 200){
this.$notify({
title: '报警修改成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) {
form.status.cu = 0
});
},
//删除报警
reqRemoveProject(item){
HttpReq.truckDispatching.callPoliceHistroyDel(item).then((res) => {
if(res.status == 400){
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}else{
this.$notify({
title: '删除成功!',
type: 'success',
duration: 2500
});
}
this.loadData();
})
},
//解除报警提示
toRelieveAlarm(item){
this.$confirm('确认解除报警吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((e) => {
this.relieveAlarm(item)
}).catch((e) => {})
},
//解除报警
relieveAlarm(item){
let lastData = {...item};
lastData.status = 0;
HttpReq.truckDispatching.callPoliceHistroyUpdate(lastData).then((res) => {
if(res.code == 200){
this.$notify({
title: '报警解除成功!',
type: 'success',
duration: 2500
});
this.loadData()
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) {
form.status.cu = 0
});
},
baojingleixingChange(row){
return row.type == '1' ? '限入电子围栏报警' : row.type == '2' ? '限出电子围栏报警' : row.type == '3' ? '无故停车报警' : row.type == '4' ? '防碰撞报警' : '其他报警';
}
} }
} }
</script> </script>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</div> </div>
<!-- 嵌入三维地图页面 --> <!-- 嵌入三维地图页面 -->
<!-- <iframe :src="url" frameborder="0" class="mapcontainer1"></iframe>--> <!-- <iframe :src="url" frameborder="0" class="mapcontainer1"></iframe>-->
<!-- <iframe ref="iframe" src="http://192.168.3.60:18041//#/Index" frameborder="0" class="mapcontainer1"></iframe>--> <iframe ref="iframe" src="http://192.168.3.60:18041//#/Index" frameborder="0" class="mapcontainer1"></iframe>
<!-- <iframe ref="iframe" src="http://192.168.3.38:3002/#/Index" frameborder="0" class="mapcontainer1"></iframe>--> <!-- <iframe ref="iframe" src="http://192.168.3.38:3002/#/Index" frameborder="0" class="mapcontainer1"></iframe>-->
<!-- 单个车辆视频监控 --> <!-- 单个车辆视频监控 -->
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<el-table-column label="操作" align="center" fixed="right"> <el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="link-cell">轨迹回放</span> <span class="link-cell">轨迹回放</span>
<span class="link-cell">轨迹数据</span> <span class="link-cell" @click="openPosView(scope.row)">轨迹数据</span>
<span v-show="scope.row.userid" class="link-cell" @click="openvideoView(scope.row)">视频回放</span> <span v-show="scope.row.userid" class="link-cell" @click="openvideoView(scope.row)">视频回放</span>
<span v-show="scope.row.userid" class="link-cell" @click="openPhotoView(scope.row)">相册</span> <span v-show="scope.row.userid" class="link-cell" @click="openPhotoView(scope.row)">相册</span>
</template> </template>
...@@ -58,6 +58,32 @@ ...@@ -58,6 +58,32 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 轨迹数据 -->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelForm" :visible="posView" title="轨迹数据" width="900px">
<div class="head-container">
<label class="el-form-item-label" style="font-weight: 500;">日期范围</label>
<el-date-picker
v-model="posDate"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
<el-button size="mini" type="success" icon="el-icon-search" @click="loadPosList">查询</el-button>
<el-button size="mini" icon="el-icon-document" @click="downloadFilePos">导出</el-button>
</div>
<el-table :data="posList" border style="width:auto;overflow-y:auto;" height="46vh">
<el-table-column type="index" width="50" :index="indexMethod"></el-table-column>
<el-table-column prop="safetyhatmac" label="安全帽MAC" align="center"></el-table-column>
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
<el-table-column prop="x" label="X坐标" align="center"></el-table-column>
<el-table-column prop="y" label="Y坐标" align="center"></el-table-column>
<el-table-column prop="time" label="时间" align="center"></el-table-column>
</el-table>
<el-pagination :total="totalPos" :current-page="pagePos" style="margin-top: 8px;"
layout="total, prev, pager, next, sizes" @size-change="sizeChangePos" @current-change="pageChangePso"/>
</el-dialog>
<!-- 视频 --> <!-- 视频 -->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelFormViedoRtc" :visible="videoRtc" title="实况" width="800px"> <el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelFormViedoRtc" :visible="videoRtc" title="实况" width="800px">
<video id="remoteVideo" controls style="width:100%;height:440px;"></video> <video id="remoteVideo" controls style="width:100%;height:440px;"></video>
...@@ -71,7 +97,7 @@ ...@@ -71,7 +97,7 @@
</el-dialog> </el-dialog>
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelForm" :visible="videoView" :title="title" width="800px"> <el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelForm" :visible="videoView" :title="title" width="800px">
<div class="head-container"> <div class="head-container">
<label class="el-form-item-label" style="font-weight: 500;">日期范围</label> <label class="el-form-item-label" style="font-weight: 500;">日期</label>
<el-date-picker <el-date-picker
v-model="videoDate" v-model="videoDate"
type="date" type="date"
...@@ -131,6 +157,7 @@ export default { ...@@ -131,6 +157,7 @@ export default {
loading: false, loading: false,
videoDia: false, videoDia: false,
videoRtc: false, videoRtc: false,
posView: false,
page: 1, page: 1,
size: 10, size: 10,
total: 0, total: 0,
...@@ -148,6 +175,11 @@ export default { ...@@ -148,6 +175,11 @@ export default {
videoDate: '', videoDate: '',
videoList: [], videoList: [],
peoItem: null, peoItem: null,
posDate: [],
posList: [],
pagePos: 1,
sizePos: 10,
totalPos: 0,
} }
}, },
mounted() { mounted() {
...@@ -234,6 +266,30 @@ export default { ...@@ -234,6 +266,30 @@ export default {
}) })
}) })
}, },
indexMethod(index) {
return 1+index+this.pagePos*this.sizePos-this.sizePos;
},
loadPosList() {
let param = {
safetyhatmac: this.peoItem.safetyhatmac,
page: this.pagePos - 1,
size: this.sizePos,
};
param.daterange = undefined;
if (this.posDate && this.posDate.length) {
param.daterange = this.posDate.join(',');
}
this.$nextTick(() => {
HttpReq.truckDispatching.propleGetLocus(param).then((res) => {
if (res.code == 200) {
if(res.body){
this.posList = res.body.list;
this.totalPos = res.body.total;
}
}
})
})
},
openPhotoView(item) { openPhotoView(item) {
this.title = '相册'; this.title = '相册';
this.photoView = true; this.photoView = true;
...@@ -303,6 +359,16 @@ export default { ...@@ -303,6 +359,16 @@ export default {
let d = time ? new Date(time * 1000) : new Date(); let d = time ? new Date(time * 1000) : new Date();
return `${d.getFullYear()}/${('0' + (d.getMonth() + 1)).substr(-2)}/${('0' + (d.getDate())).substr(-2)} ${('0' + (d.getHours())).substr(-2)}:${('0' + (d.getMinutes())).substr(-2)}:${('0' + (d.getSeconds())).substr(-2)}`; return `${d.getFullYear()}/${('0' + (d.getMonth() + 1)).substr(-2)}/${('0' + (d.getDate())).substr(-2)} ${('0' + (d.getHours())).substr(-2)}:${('0' + (d.getMinutes())).substr(-2)}:${('0' + (d.getSeconds())).substr(-2)}`;
}, },
openPosView(item) {
this.posView = true;
this.peoItem = item;
this.posList = [];
this.posDate = [];
this.pagePos = 1;
this.sizePos = 10;
this.totalPos = 0;
this.loadPosList();
},
openvideoView(item) { openvideoView(item) {
this.title = '视频回放'; this.title = '视频回放';
this.videoView = true; this.videoView = true;
...@@ -340,6 +406,28 @@ export default { ...@@ -340,6 +406,28 @@ export default {
this.download(res, `人员设备历史记录${d.getFullYear()}${('0'+(d.getMonth()+1)).substr(-2)}${('0'+(d.getDate())).substr(-2)}`, 'xlsx') this.download(res, `人员设备历史记录${d.getFullYear()}${('0'+(d.getMonth()+1)).substr(-2)}${('0'+(d.getDate())).substr(-2)}`, 'xlsx')
}) })
}, },
downloadFilePos() {
var loading = this.$loading({
lock: true,
text: '请稍后.....',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let param = {
safetyhatmac: this.peoItem.safetyhatmac,
page: this.pagePos - 1,
size: this.sizePos,
};
param.daterange = undefined;
if (this.posDate && this.posDate.length) {
param.daterange = this.posDate.join(',');
}
HttpReq.truckDispatching.propleGetLocusout(param).then((res) => {
loading.close();
let d = new Date();
this.download(res, `轨迹数据${d.getFullYear()}${('0'+(d.getMonth()+1)).substr(-2)}${('0'+(d.getDate())).substr(-2)}`, 'xlsx')
})
},
cancelFormViedoRtc(){ cancelFormViedoRtc(){
this.videoRtc = false; this.videoRtc = false;
if(this.videoRtcPlayer){ if(this.videoRtcPlayer){
...@@ -354,6 +442,7 @@ export default { ...@@ -354,6 +442,7 @@ export default {
this.photoView = false; this.photoView = false;
this.videoView = false; this.videoView = false;
this.videoDia = false; this.videoDia = false;
this.posView = false;
}, },
// 点击搜索 // 点击搜索
toSearch() { toSearch() {
...@@ -369,11 +458,20 @@ export default { ...@@ -369,11 +458,20 @@ export default {
this.page = e this.page = e
this.loadData() this.loadData()
}, },
pageChangePso(e) {
this.pagePos = e
this.loadPosList()
},
sizeChange(e) { sizeChange(e) {
this.page = 1 this.page = 1
this.size = e this.size = e
this.loadData() this.loadData()
}, },
sizeChangePos(e) {
this.pagePos = 1
this.sizePos = e
this.loadPosList()
},
priorP(){ priorP(){
this.pageP -= 1; this.pageP -= 1;
this.loadDataP() this.loadDataP()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment