Commit b6069f54 by 夏新然

拉取cate

1 parent 5fcce698
Stack trace:
Frame Function Args
00000010002 0018006021E (00180241C10, 001802340B9, 00000010002, 000FFFFBA40)
00000010002 00180048859 (00000000001, 00180328B38, 00000000001, 00180328B38)
00000010002 00180048892 (00000000001, 00180328E48, 00000010002, 00000000008)
00000010002 001800598BC (001800C0322, 00000000000, 00000000000, 00000000000)
000FFFFCCD0 0018005994E (000FFFFCDF0, 000FFFFCCD0, FFFFFFFFFFFFFFD8, 00000000000)
000FFFFCCD0 00180048FE1 (00000000000, 00000000000, 00000000000, 00000000000)
00000000000 00180047963 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0 00180047A14 (00000000000, 00000000000, 00000000000, 00000000000)
End of stack trace
......@@ -36,5 +36,35 @@ export default {
},
bindRole(params,id){
return api.post(`${baseUrl}/api/v1/auth/users/${id}/roles`, params)
},
getDevsTime(params,id,id2){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/time`, params)
},
manualTime(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/time`, params)
},
getNtp(params,id,id2){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/timing/ntp`, params)
},
ntpTime(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/timing/ntp`, params)
},
factoryReset(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/factory-reset`, params)
},
importParams(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/parameters/import`, params,{'Content-Type': 'multipart/form-data'})
},
exportParams(params,id,id2){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/parameters/export`, params)
},
manualReboot(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/reboot/manual`, params)
},
intervalReboot(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/reboot/auto`, params)
},
getRebootSetting(params,id,id2){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/reboot/auto`, params)
}
}
\ No newline at end of file
......@@ -66,4 +66,17 @@ export default {
delStore(params,id){
return api.delete(`${baseUrl}/api/v1/devconf_fx/store_confs/${id}`, params)
},
getsip(params,id,id2){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/sip_server`, params)
},
addSip(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/sip_server`, params)
},
editSip(params,id,id2,id3){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`, params)
},
delSip(params,id,id2,id3){
return api.delete(`${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`, params)
}
}
\ No newline at end of file
......@@ -349,6 +349,10 @@ class Codes {
this.result.xcycle_plate_text = "未识别";
}
// 骑车类型
console.log(this.allData.event_data.xcycle_type)
if(!this.allData.event_data.xcycle_type){
this.result.xcycle_type_text = "行人";
}else{
try {
switch (this.allData.event_data.xcycle_type) {
case "motorcycle":
......@@ -366,6 +370,8 @@ class Codes {
} catch (err) {
this.result.xcycle_type_text = "未识别";
}
}
try {
if (this.result.xcycle_type_text === "自行车") {
this.result.company = this.allData.event_data.xcycle.company.name;
......
......@@ -89,24 +89,24 @@ export const asyncRouterMap = [
},
{
path: "/search/xcycle",
name: "非机动车检索",
name: "行人非机动车检索",
meta: {
icon: "el-icon-user"
},
component: resolve => require(["../views/search/xcycle.vue"], resolve)
},
{
path: "/search/pedestrian",
name: "行人检索",
meta: {
icon: "el-icon-location"
},
component: resolve =>
require(["../views/search/pedestrian.vue"], resolve)
},
// {
// path: "/search/pedestrian",
// name: "行人检索",
// meta: {
// icon: "el-icon-location"
// },
// component: resolve =>
// require(["../views/search/pedestrian.vue"], resolve)
// },
{
path: "/search/event",
name: "事件查询",
name: "事件检索",
meta: {
icon: "el-icon-location"
},
......@@ -114,7 +114,7 @@ export const asyncRouterMap = [
},
{
path: "/search/illegal",
name: "违法记录查询",
name: "违法检索",
meta: {
icon: "el-icon-location"
},
......@@ -122,19 +122,20 @@ export const asyncRouterMap = [
},
{
path: "/search/traficflow",
name: "交通流量",
name: "流量检索",
meta: {
icon: "el-icon-location"
},
component: resolve => require(["../views/search/traficflow.vue"], resolve),
},{
path: "/search/flow",
name: "公共客流",
meta: {
icon: "el-icon-location"
},
component: resolve => require(["../views/search/publicFlow.vue"], resolve),
}
// {
// path: "/search/flow",
// name: "公共客流",
// meta: {
// icon: "el-icon-location"
// },
// component: resolve => require(["../views/search/publicFlow.vue"], resolve),
// }
]
},
{
......@@ -169,7 +170,14 @@ export const asyncRouterMap = [
},
component: resolve => require(["../views/resource/store_confs.vue"], resolve),
},
{
path: "/resource/nationalStandard",
name: "国标配置",
meta: {
icon: "el-icon-location"
},
component: resolve => require(["../views/resource/nationalStandard.vue"], resolve),
},
]
},{
path: "/ops",
......
......@@ -55,7 +55,6 @@ import types from '../store/types.js'
sessionStorage.setItem('user_unid',res.user_unid)
//本系统可以直接用本地缓存做
this.getMenu(res.user_unid)
// localStorage.setItem('user_name',this.username)
// 处理登录用户权限菜单显示问题;
//算法配置列表
......@@ -67,6 +66,7 @@ import types from '../store/types.js'
this.getCustomCode();
this.getEventList();
this.getDev();
this.getMenu(res.user_unid);
}
}).catch((err) => {
......@@ -150,7 +150,17 @@ import types from '../store/types.js'
},
getDev() {
this.$api.resource.devs().then(res => {
sessionStorage.setItem('dev_unid',res[0].dev_unid)
sessionStorage.setItem('dev_unid',res[0].dev_unid);
this.getDevsName(res[0].dev_unid);
})
},
getDevsName(id){
this.$api.resource.getDevsName({
is_leaf: 0
},id).then(res=>{
if(res.list_data.length>0){
sessionStorage.setItem('device_id',res.list_data[0].device_id);
}
})
},
},
......
......@@ -3,67 +3,74 @@
<el-form ref="form" label-width="100px">
<!-- 手动校时 -->
<div class="lineBox big">
<el-radio v-model="radio" label="1">手动校时</el-radio>
<el-radio v-model="typeRadio" label="1">手动校时</el-radio>
</div>
<div class="radioContent">
<div class="lineBox">
<el-form-item label="当前时间:">
<span>2020-02-11 16:08:01</span>
<span>{{computerTime}}</span>
</el-form-item>
</div>
<div class="lineBox">
<el-form-item label="设备时间:">
<el-date-picker
:disabled="typeRadio=='2'"
v-model="systemTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
<span style="margin-left: 30px;"> <el-checkbox v-model="syncTime">与计算机时间同步</el-checkbox></span>
<el-button type="primary" size="small" class="primaryButton rightButton">校时</el-button>
<span style="margin-left: 30px;"> <el-checkbox v-model="syncTime" @change="syncTimeFun" :disabled="typeRadio=='2'">与计算机时间同步</el-checkbox></span>
<el-button type="primary" size="small" class="primaryButton rightButton" :disabled="typeRadio=='2'" @click="manualClick">校时</el-button>
</el-form-item>
</div>
</div>
<div class="line"></div>
<!-- NTP校时 -->
<div class="lineBox big">
<el-radio v-model="radio" label="2">NTP校时</el-radio>
<el-radio v-model="typeRadio" label="2">NTP校时</el-radio>
</div>
<div class="radioContent">
<div class="lineBox">
<el-form-item label="服务器地址:">
<span class="inputBox">
<el-input placeholder="请输入服务器地址" v-model="url"></el-input>
<el-input placeholder="请输入服务器地址" v-model="serverAdr" :disabled="typeRadio=='1'"></el-input>
</span>
</el-form-item>
</div>
<div class="lineBox">
<el-form-item label="NTP端口:">
<span class="inputBox">
<el-input placeholder="请输入NTP端口" v-model="ntpPort"></el-input>
<el-input placeholder="请输入NTP端口" v-model="ntpPort" :disabled="typeRadio=='1'"></el-input>
</span>
</el-form-item>
</div>
<div class="lineBox">
<el-radio v-model="ntpRadio" label="2">定时校时</el-radio>
<el-radio v-model="ntpRadio" label="1" :disabled="typeRadio=='1'">定时校时</el-radio>
</div>
<el-form ref="inlineform" label-width="100px" inline>
<div class="lineBox">
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="typeRadio=='1'||ntpRadio=='2'"
v-model="timeArr[0]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="typeRadio=='1'||ntpRadio=='2'"
value-format="HH:mm"
v-model="timeArr[1]"
placeholder="选择时间">
</el-time-select>
</el-form-item>
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="typeRadio=='1'||ntpRadio=='2'"
v-model="timeArr[2]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
......@@ -71,13 +78,17 @@
<div class="lineBox">
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="typeRadio=='1'||ntpRadio=='2'"
v-model="timeArr[3]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="typeRadio=='1'||ntpRadio=='2'"
v-model="timeArr[4]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
......@@ -87,15 +98,15 @@
</div>
</el-form>
<div class="lineBox">
<el-radio v-model="ntpRadio" label="2">周期校时</el-radio>
<el-radio v-model="ntpRadio" label="2" :disabled="typeRadio=='1'">周期校时</el-radio>
</div>
<div class="lineBox">
<el-form-item label="每隔:">
<span class="inputBox" style="width: 60px;">
<el-input placeholder="请输入NTP端口" v-model="ntpPort"></el-input>
<el-input placeholder="" v-model.number="weekMinutes" :disabled="typeRadio=='1'||ntpRadio=='1'"></el-input>
</span>
<span style="margin-left: 14px;">秒,自动进行校时</span>
<el-button type="primary" size="small" class="primaryButton rightButton">保存设置</el-button>
<el-button type="primary" size="small" class="primaryButton rightButton" :disabled="typeRadio=='1'" @click="saveClick">保存设置</el-button>
</el-form-item>
</div>
</div>
......@@ -106,19 +117,175 @@
export default {
data(){
return{
time:'',
url:'',
typeRadio:'1',
ntpRadio:'1',
timeArr:['','','','',''],
ntpPort:'',
weekMinutes:'',
activeName: 'first',
systemTime:'',
syncTime:false
syncTime:false,
computerTime:this.$moment().format("YYYY-MM-DD HH:mm:ss"),
dev_unid:sessionStorage.getItem('dev_unid'),
device_id:sessionStorage.getItem('device_id'),
serverAdr:''
}
},
components:{},
mounted(){},
mounted(){
this.timer();
this.getDevTimes();
this.getNtpTimes();
},
methods:{
handleClick(tab, event) {
console.log(tab, event);
},
timer(){
setInterval(()=>{
this.computerTime=this.$moment().format("YYYY-MM-DD HH:mm:ss")
},1000)
},
getDevTimes () {
this.$api.ops.getDevsTime({
},this.dev_unid,this.device_id).then(res=>{
if (res.ecode != undefined && res.ecode != 200) {
//console.log('获取设备时间失败!' + utcTimes.enote);
this.$message({
type: 'error',
message: '获取设备时间失败!' + res.enote
});
} else {
if(res && typeof res === 'string') {
//先转utc格式
let date = this.$moment.utc(res).format();
//再utc时间转本地时间
this.systemTime = this.$moment(date)
.local()
.format("YYYY-MM-DD HH:mm:ss");
}
}
})
},
syncTimeFun(){
if(this.syncTime){
this.systemTime=this.computerTime;
}
},
manualClick() {
let time=this.$moment(this.systemTime).utc().format("YYYY-MM-DD HH:mm:ss");
this.$api.ops.manualTime({
time:time
},this.dev_unid,this.device_id).then(res=>{
if(res.ecode != 200) {
this.$message({
type: 'error',
message: '手动校时失败!' + res.enote
})
} else {
this.$message({
type: 'success',
message: '手动校时成功!'
})
}
})
},
getNtpTimes () {
//获取ntp校时配置
this.$api.ops.getNtp({
},this.dev_unid,this.device_id).then(res=>{
if(res.ecode != undefined && res.ecode != 200) {
this.$message({
type: 'error',
message: '获取NTP校时失败!' + res.enote
});
} else {
if(res.enable_ntp == 1) {
this.typeRadio = '2';
this.serverAdr = res.ntp_server_ip;
this.ntpPort = res.ntp_server_port;
console.log('获取NTP时间:', res.timing_times)
this.timeArr=res.timing_times;
this.weekMinutes = res.timing_interval;
if(res.timing_policy == "fix"){
this.ntpRadio = '1';
}
if(res.timing_policy == "interval"){
this.ntpRadio = '2';
}
} else {
this.typeRadio = '1';
}
}
}).catch(err => {
console.log('获取ntp校时设置异常:', err.message);
});
},
saveClick() {
if(this.serverAdr != "" &&this.ntpPort != ""){
let timing_policy=''
if(this.ntpRadio=='1'){
//如果定时校时
timing_policy='fix'
//数组去空值
let arr=[];
this.timeArr.forEach(item=>{
if(item!=""&&typeof(item)!="undefined"){
arr.push(item)
}
})
if(new Set(arr).size !== arr.length){
  this.$message({
type: 'error',
message: '定时时间重复,请重新选择'
});
return false;
}
}else if(this.ntpRadio=='2'){
//周期校时
timing_policy='interval'
if(this.weekMinutes === '') {
this.$message({
type: 'warning',
message: '未设置周期时间!'
})
return;
}
}
let ntpTimingData = {
device_id: this.device_id,
enable_ntp: 1,
ntp_server_ip: this.serverAdr,
ntp_server_port: this.ntpPort,
timing_policy: timing_policy,
timing_times: this.timeArr,
timing_interval: this.weekMinutes
}
this.ntpTimeSet(ntpTimingData);
}else {
this.$message({
type: 'warning',
message: '服务器地址以及ntp端口不能为空!'
})
}
},
ntpTimeSet(data){
this.$api.ops.ntpTime(data,this.dev_unid,this.device_id).then(res=>{
if(res.ecode == 200){
this.$message({
type: 'success',
message: 'NTP校时成功!'
})
} else {
this.$message({
type: 'error',
message: 'NTP校时失败!' + res.enote
})
}
}).catch(err => {
console.log('ntp校时异常:', error.message)
});
}
},
}
......
......@@ -7,7 +7,7 @@
</div>
<div class="radioContent">
<div class="lineBox">
<el-button type="primary" size="small" class="primaryButton">恢复出厂设置</el-button>
<el-button type="primary" size="small" class="primaryButton" @click="reset">恢复出厂设置</el-button>
</div>
<div class="lineBox">
<span class="tip">恢复出厂设置说明:完全恢复设备参数到出厂设置</span>
......@@ -47,7 +47,7 @@
</div>
<div class="radioContent">
<div class="lineBox">
<el-button size="small" type="primary" class="primaryButton">手动重启</el-button>
<el-button size="small" type="primary" class="primaryButton" @click="manualRebootClick">手动重启</el-button>
</div>
<div class="lineBox">
<el-checkbox v-model="openRestart">开启定时重启</el-checkbox>
......@@ -56,19 +56,25 @@
<div class="lineBox">
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="!openRestart"
v-model="timeArr[0]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="!openRestart"
v-model="timeArr[1]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="!openRestart"
v-model="timeArr[2]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
......@@ -76,13 +82,17 @@
<div class="lineBox">
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="!openRestart"
v-model="timeArr[3]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
<el-form-item label="每天:">
<el-time-select
v-model="time"
:disabled="!openRestart"
v-model="timeArr[4]"
value-format="HH:mm"
placeholder="选择时间">
</el-time-select>
</el-form-item>
......@@ -90,7 +100,7 @@
<span>自动进行校时(可设置多个时间点,不得超过5个)</span>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" size="small" class="primaryButton rightButton">保存</el-button>
<el-button type="primary" size="small" class="primaryButton rightButton" :disabled="!openRestart" @click="intervalRebootClick">保存</el-button>
</el-form-item>
</div>
......@@ -105,26 +115,192 @@
return{
openRestart:false,
selectFilename:'',
time:'',
url:'',
ntpPort:'',
activeName: 'first',
systemTime:'',
syncTime:false
timeArr:[],
file:null,
dev_unid:sessionStorage.getItem('dev_unid'),
device_id:sessionStorage.getItem('device_id'),
}
},
components:{},
mounted(){},
mounted(){
this.getRebootSetting();
},
methods:{
handleClick(tab, event) {
console.log(tab, event);
getRebootSetting() {
if(this.dev_unid != '' && this.device_id != ''){
this.$api.ops.getRebootSetting({},this.dev_unid,this.device_id).then(res=>{
if(!res.ecode){
if(res.enabled == 1){
this.openRestart = true;
this.timeArr=res.reboot_time
}
} else {
this.$message({
type: 'error',
message: res.enote
})
}
})
}else{
this.$message({
type: 'info',
message: '未找到设备ID,请重新登录'
});
}
},
submitUpload(){
this.$refs.upload.submit();
let importFileExt = this.file.name.substr(this.file.name.lastIndexOf('.'));
if(importFileExt !== ".zip"){
this.$message({
type: 'warning',
message: '只支持"*.zip"文件'
})
return;
}
this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
// 最重要的就是这段代码
var importParams = new FormData() // 首先创建FormData对象
importParams.append('file',this.file);
this.$api.ops.importParams(importParams,this.dev_unid,this.device_id).then(res=>{
if(res.ecode != undefined && res.ecode != 200) {
this.$message({
type: 'error',
message: '导入失败!' + res.enote
})
} else {
this.$message({
type: 'success',
message: '导入成功!'
})
}
})
},
fileChange(file,fileList){
console.log(file,fileList)
this.selectFilename=file.name;
this.file=file;
},
reset(){
this.$confirm('此操作将恢复出厂设置, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if(this.dev_unid != '' && this.device_id != ''){
this.$api.ops.factoryReset({},this.dev_unid,this.device_id).then(res=>{
if(res.ecode == 200){
this.$message({
type: 'success',
message: '恢复出厂设置成功!'
})
} else {
this.$message({
type: 'error',
message: '恢复出厂设置失败!' + res.enote
})
}
})
}else{
this.$message({
type: 'info',
message: '未找到设备ID,请重新登录'
});
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
exportFileClick(){
if(this.dev_unid != '' && this.device_id != ''){
this.$api.ops.exportParams({},this.dev_unid,this.device_id).then(res=>{
if(res.ecode && res.ecode != 200) {
this.$message({
type: 'error',
message: res.enote
})
} else {
let exportFileUrl = res.file_path;
window.location.href = exportFileUrl;
}
})
}else{
this.$message({
type: 'info',
message: '未找到设备ID,请重新登录'
});
}
},
manualRebootClick () {
this.$confirm('此操作将重启设备, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if(this.dev_unid != '' && this.device_id != ''){
this.$api.ops.manualReboot({},this.dev_unid,this.device_id).then(res=>{
if(res.ecode == 200){
this.$message({
type: 'success',
message: '重启成功!'
})
} else {
this.$message({
type: 'error',
message: '重启失败!' + res.enote
})
}
})
}else{
this.$message({
type: 'info',
message: '未找到设备ID,请重新登录'
});
}
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
intervalRebootClick(){
//数组去空值
let arr=[];
this.timeArr.forEach(item=>{
if(item!=""&&typeof(item)!="undefined"){
arr.push(item)
}
})
if(new Set(arr).size !== arr.length){
  this.$message({
type: 'error',
message: '定时时间重复,请重新选择'
});
return false;
}
let autoRebootParams = {
enabled: 1,
reboot_policy: "day",
reboot_time: this.timeArr
}
this.$api.ops.intervalReboot(autoRebootParams,this.dev_unid,this.device_id).then(res=>{
if(res.ecode == 200){
this.$message({
type: 'success',
message: '自动重启配置成功!!'
})
this.getRebootSetting();
} else {
}
})
}
},
}
......
<template>
<div class="innnerBox">
<div class="title">sip视频设置</div>
<el-form :model="sipSetting" ref="form" :rules="rules" label-width="100px" class="demo-ruleForm" inline-message hide-required-asterisk>
<el-form-item
label="用户名"
prop="sip_username">
<div style="width: 30%;">
<el-input v-model="sipSetting.sip_username" autocomplete="off"></el-input>
</div>
</el-form-item>
<el-form-item label="密码" prop="sip_password">
<div style="width: 30%;">
<el-input type="password" v-model="sipSetting.sip_password" autocomplete="off"></el-input>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="addSip('form')" v-if="!isGetted">提交</el-button>
<el-button type="primary" @click="editSip('form')" v-if="isGetted">编辑</el-button>
<el-button type="primary" @click="delFun()" v-if="isGetted">删除</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
data(){
var validateUser = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入用户名'));
} else {
callback();
}
};
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
} else {
callback();
}
};
return{
rules: {
sip_username:[
{ validator: validateUser, trigger: 'change' }
],
sip_password: [
{ validator: validatePass, trigger: 'change' }
],
},
user_unid:sessionStorage.getItem('user_unid'),
dev_unid:sessionStorage.getItem('dev_unid'),
isGetted:false,
sipSetting:{
sip_username: '', // string
sip_password: ''
},
sip_unid:''
}
},
watch:{},
components:{},
mounted(){
this.getSipParam();
},
methods:{
addSip(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$api.resource.addSip(this.sipSetting,this.dev_unid,this.user_unid).then(res=>{
// console.log(res.data);
if(res.ecode == 200) {
this.isGetted = true;
this.$message({
type: 'success',
message: res.enote
})
} else {
this.isGetted = false;
this.$message({
type: 'error',
message: res.enote
})
}
})
} else {
return false;
}
});
},
editSip(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
this.$api.resource.editSip(this.sipSetting,this.dev_unid,this.user_unid,this.sip_unid).then(res=>{
// console.log(res.data);
if(res.ecode == 200) {
this.$message({
type: 'success',
message: '修改成功!'
})
} else {
this.$message({
type: 'error',
message: res.enote
})
}
})
} else {
return false;
}
});
},
delFun(){
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$api.resource.delSip(this.sipSetting,this.dev_unid,this.user_unid,this.sip_unid).then(res=>{
if(res.ecode == 200) {
this.$message({
type: 'success',
message: '删除成功!'
})
for(let j in this.sipSetting) {
this.sipSetting[j] = '';
}
this.isGetted = false;
} else {
this.$message({
type: 'error',
message: res.enote
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
getSipParam() {
this.$api.resource.getsip({},this.dev_unid,this.user_unid).then(res=>{
if(res.ecode) {
this.isGetted = false;
} else {
this.isGetted = true;
this.sipSetting.sip_username = res.sip_username;
this.sipSetting.sip_password = res.sip_password;
this.sip_unid = res.sip_unid;
}
})
}
},
}
</script>
<style lang="scss" scoped>
.title{
height: 30px;
line-height: 30px;
padding-left: 30px;
font-size: 14px;
background: #3bb7ff;
color: #FFFFFF;
margin-bottom: 20px;
}
</style>
\ No newline at end of file
......@@ -2,14 +2,6 @@
<div class="innnerBox">
<el-col :span="22">
<el-form ref="form" label-width="80px" inline>
<el-form-item label="资源类型" >
<span class="inputBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.source_type">
<el-option value="pull_video_stream" label='拉取视频'></el-option>
<el-option value="pull_pic_files" label='拉取图片'></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="事件类型">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.type">
......
......@@ -4,7 +4,7 @@
<el-form ref="form" label-width="80px" inline>
<el-form-item label="地点名称">
<span class="inputBox">
<el-input placeholder="请输入任务名称" v-model="conditions.location_name"></el-input>
<el-input placeholder="请输入地点名称" v-model="conditions.location_name"></el-input>
</span>
</el-form-item>
<el-form-item label="相机名称" >
......
......@@ -2,29 +2,38 @@
<div class="innnerBox">
<el-col :span="22">
<el-form ref="form" label-width="80px" inline>
<el-form-item label="资源类型">
<!-- <el-form-item label="资源类型">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.source_type">
<el-option value="pull_video_stream" label='拉取视频'></el-option>
<el-option value="pull_pic_files" label='拉取图片'></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="相机名称" >
</el-form-item> -->
<el-form-item label="任务名称">
<span class="inputBox">
<el-input placeholder="请输入相机名称" v-model="conditions.vchan_name"></el-input>
<el-input placeholder="请输入任务名称" v-model="conditions.task_name"></el-input>
</span>
</el-form-item>
<el-form-item label="任务名称">
<el-form-item label="视频名称" >
<span class="inputBox">
<el-input placeholder="请输入任务名称" v-model="conditions.task_name"></el-input>
<el-input placeholder="请输入视频名称" v-model="conditions.vchan_name"></el-input>
</span>
</el-form-item>
<el-form-item label="车牌号码">
<span class="inputBox">
<el-input placeholder="请输入车牌号码" v-model="conditions.plate"></el-input>
</span>
</el-form-item>
<el-form-item label="车牌类型">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.plate_type" >
<el-option value="" label='全部'></el-option>
<!-- <el-option v-for='item in vehicleTypeList' :value="item.code" :key="item.code" :label='item.name'></el-option> -->
</el-select>
</span>
</el-form-item>
<el-form-item label="车辆类型">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_type" >
......@@ -49,7 +58,7 @@
</el-select>
</span>
</el-form-item>
<el-form-item label="标志物">
<!-- <el-form-item label="标志物">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.marker">
<el-option value="" label='全部'></el-option>
......@@ -59,7 +68,7 @@
<el-option value="3" label='遮阳板'></el-option>
</el-select>
</span>
</el-form-item>
</el-form-item> -->
<el-form-item label="特殊车辆">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.special_type">
......@@ -115,23 +124,28 @@
<el-table-column
prop="vehicle_body_type_text"
align="center"
label="车辆类型">
label="车牌类型">
</el-table-column>
<el-table-column
prop="vehicle_body_type_text"
align="center"
label="车辆类型">
</el-table-column>
<!-- <el-table-column
prop="vehicle_body_logo_text"
align="center"
label="车辆品牌">
</el-table-column>
</el-table-column> -->
<el-table-column
prop="vehicle_body_color_text"
align="center"
label="车颜色">
label="车颜色">
</el-table-column>
<el-table-column
<!-- <el-table-column
prop="RefinedFeature_text"
align="center"
label="标识物">
</el-table-column>
</el-table-column> -->
<el-table-column
prop="special_text"
align="center"
......@@ -260,6 +274,7 @@
start_dt:start_dt,
end_dt:end_dt,
source_type: 'pull_video_stream',
plate_type:'',
marker: '',
car_type: '',
car_color: '',
......@@ -294,7 +309,7 @@
},
methods:{
exportFun(){
window.open(encodeURI(process.env.VUE_APP_URL + '/api/v1/traffic/events/export?s=' + Math.random()+'&event_type=&event_dt__gte='+this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss')+'&event_dt__lt='+this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss')+'&source_type='+this.conditions.source_type+'&vchan_name__like='+this.conditions.vchan_name+'&vehicle_type='+this.conditions.car_type+'&body_color='+this.conditions.car_color+'&logo_type='+this.conditions.logo_type+'&plate_number__like='+this.conditions.plate+'&marker='+this.conditions.marker+'&task_name='+this.conditions.task_name+'&special_type='+this.conditions.special_type))
window.open(encodeURI(process.env.VUE_APP_URL + '/api/v1/traffic/events/export?s=' + Math.random()+'&event_type=&event_dt__gte='+this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss')+'&event_dt__lt='+this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss')+'&vchan_name__like='+this.conditions.vchan_name+'&vehicle_type='+this.conditions.car_type+'&body_color='+this.conditions.car_color+'&logo_type='+this.conditions.logo_type+'&plate_number__like='+this.conditions.plate+'&task_name='+this.conditions.task_name+'&special_type='+this.conditions.special_type))
},
batchdel(){
if(this.selectcheck.length==0){
......@@ -376,13 +391,14 @@
offset: offset,
event_dt__gte: this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss'),
event_dt__lt:this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss'),
source_type: this.conditions.source_type,
// source_type: this.conditions.source_type,
vchan_name__like: this.conditions.vchan_name,
vehicle_type: this.conditions.car_type,
body_color: this.conditions.car_color,
logo_type: this.conditions.logo_type,
plate_number__like: this.conditions.plate,
marker: this.conditions.marker,
// marker: this.conditions.marker,
plate_type: this.conditions.plate_type,
event_type: '',
special_type:this.conditions.special_type,
task_name: this.conditions.task_name ? this.conditions.task_name.replace(/\s\s*/g, '') : this.conditions.task_name
......
......@@ -2,23 +2,72 @@
<div class="innnerBox">
<el-col :span="22">
<el-form ref="form" label-width="80px" inline>
<el-form-item label="抓拍地点" >
<el-form-item label="任务名称">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.task_id" @change="getSubTask">
<el-option v-for='item in taskList' :value="item.task_id" :key="item.task_id" :label='item.task_name'></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="相机名称">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.subtask_id">
<el-option v-for='item in subTaskList' :value="item.subtask_id" :key="item.subtask_id" :label='item.subtask_name'></el-option>
</el-select>
</span>
</el-form-item>
<!-- <el-form-item label="抓拍地点" >
<span class="inputBox">
<el-input placeholder="请输入抓拍地点" v-model="conditions.location_name"></el-input>
</span>
</el-form-item> -->
<el-form-item label="类型">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.event_type" @change="typeChange">
<el-option value="xcycle" label="非机动车"></el-option>
<el-option value="pedestrian" label="行人"></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="任务名称">
<el-form-item label="检索类型" >
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.xcycle_type">
<el-option value="" label='全部'></el-option>
<el-option value="motorcycle" label="摩托车" v-show="conditions.event_type == 'xcycle'"></el-option>
<el-option value="bicycle" label="自行车" v-show="conditions.event_type == 'xcycle'"></el-option>
<el-option value="tricycle" label="三轮车" v-show="conditions.event_type == 'xcycle'"></el-option>
<el-option value="aaa" label="行人" v-show="conditions.event_type == 'pedestrian'"></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="性别">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.sex">
<el-option value="" label="全部"></el-option>
<el-option value="1" label="男"></el-option>
<el-option value="2" label="女"></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="运营公司">
<span class="inputBox">
<el-input placeholder="请输入任务名称" v-model="conditions.task_name"></el-input>
<el-input placeholder="请输入任务名称" v-model="conditions.company"></el-input>
</span>
</el-form-item>
<el-form-item label="非机动车类型" label-width="110px" >
<el-form-item label="上身颜色">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.xcycle_type">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.upbodyColor">
<el-option value="" label='全部'></el-option>
<el-option v-for='item in bodyColorList' :value="item.value" :key="item.value" :label='item.label'></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="下身颜色">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.lobodyColor">
<el-option value="" label='全部'></el-option>
<el-option value="motorcycle" label="摩托车"></el-option>
<el-option value="bicycle" label="自行车"></el-option>
<el-option value="tricycle" label="三轮车"></el-option>
<el-option v-for='item in bodyColorList' :value="item.value" :key="item.value" :label='item.label'></el-option>
</el-select>
</span>
</el-form-item>
......@@ -61,12 +110,27 @@
<el-table-column
prop="xcycle_type_text"
align="center"
label="非机动车类型 ">
label="检测类型">
</el-table-column>
<el-table-column
prop="driver_face_sex"
align="center"
label="性别">
</el-table-column>
<el-table-column
prop="driver_face_upbody_text"
align="center"
label="上身颜色">
</el-table-column>
<el-table-column
prop="xcycle_plate_text"
prop="driver_face_lobody_text"
align="center"
label="车牌号码 ">
label="下身颜色">
</el-table-column>
<el-table-column
prop="company"
align="center"
label="运营公司">
</el-table-column>
<el-table-column
prop="shoot_date"
......@@ -82,11 +146,6 @@
label="抓拍地点">
</el-table-column>
<el-table-column
prop="company"
align="center"
label="运营公司 ">
</el-table-column>
<el-table-column
align="center"
label="操作">
<template slot-scope="scope">
......@@ -131,12 +190,12 @@
</el-image>
<el-form label-width="120px" inline>
<div>
<el-form-item label="车牌号码:">
<span>{{ detailObj.xcycle_plate_text }}</span>
</el-form-item>
<el-form-item label="非机动车类型:">
<el-form-item label="检测类型:">
<span>{{ detailObj.xcycle_type_text }}</span>
</el-form-item>
<el-form-item label="经过地点:">
<span>{{ detailObj.location_name }}</span>
</el-form-item>
</div>
<div>
<el-form-item label="经过日期:">
......@@ -147,11 +206,12 @@
</el-form-item>
</div>
<div>
<el-form-item label="经过地点:">
<span>{{ detailObj.location_name }}</span>
<el-form-item label="身高:">
<span>{{ detailObj.driver_height }}</span>
</el-form-item>
<el-form-item label="车辆颜色:">
<span>{{ detailObj.xcycle_color_type }}</span>
<el-form-item label="速度:">
<span>{{ detailObj.location_speed }}</span>
</el-form-item>
</div>
<div>
......@@ -166,8 +226,8 @@
<el-form-item label="上身颜色:">
<span>{{ detailObj.driver_face_upbody_text }}</span>
</el-form-item>
<el-form-item label="速度:">
<span>{{ detailObj.location_speed }}</span>
<el-form-item label="下身颜色:">
<span>{{ detailObj.driver_face_lobody_text }}</span>
</el-form-item>
</div>
<div>
......@@ -197,6 +257,7 @@
return{
detailObj:{},
carImg:require("@/assets/img/home/defaultImg.png"),
bodyColorList:this.$buildCode.getCodeList('车身颜色'),
detailImg:'',
detailVisible:false,
dates:[ start_dt,end_dt ],
......@@ -204,9 +265,13 @@
start_dt:start_dt,
end_dt:end_dt,
event_type: 'xcycle',
subtask_id:null,
task_id:null,
xcycle_type:'',
location_name:'',
task_name:''
sex:'',
company:'',
upbodyColor:'',
lobodyColor:''
},
brandList:this.$buildCode.getCodeList('车辆品牌'),
vehicleTypeList:this.$buildCode.getCodeList('车辆类型'),
......@@ -217,7 +282,9 @@
page:1,
pageSize:30,
selectcheck:[],
currentIndex:0
currentIndex:0,
taskList:[],
subTaskList:[]
}
},
watch:{
......@@ -228,26 +295,81 @@
},
components:{},
mounted(){
this.getTaskList();
this.getData()
},
methods:{
getTaskList(){
this.$api.task.getTask({
source_type: "pull_video_stream",
task_type: "normal"
}).then(res=>{
this.taskList=res.list_data;
})
},
getSubTask(){
this.conditions.subtask_id=null;
this.$api.task.getSubTask(this.conditions.task_id).then(res => {
this.subTaskList = res.list_data;
if( this.subTaskList.length>0){
this.conditions.subtask_id=this.subTaskList[0].subtask_id
}
})
},
typeChange(){
this.conditions.xcycle_type='';
},
exportFun(){
window.open(
encodeURI(
process.env.VUE_APP_URL+
let url='';
if(this.conditions.event_type=='xcycle'){
url = process.env.VUE_APP_URL+
"/api/v1/traffic/events/export?s=" +
Math.random() +
"&event_type=xcycle&event_dt__gte=" +
"&event_type=" +
this.conditions.event_type +
"event_dt__gte=" +
this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
"&event_dt__lt=" +
this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
"&xcycle_type=" +
this.conditions.xcycle_type +
"&location_name=" +
this.conditions.location_name +
"&task_name=" +
this.conditions.task_name
)
"&sex=" +
this.conditions.sex +
"&task_id=" +
this.conditions.task_id +
"&subtask_id=" +
this.conditions.subtask_id +
"&company_like=" +
this.conditions.company +
"&upbodyColor=" +
this.conditions.upbodyColor +
"&lobodyColor=" +
this.conditions.lobodyColor
}else{
url = process.env.VUE_APP_URL+
"/api/v1/traffic/events/export?s=" +
Math.random() +
"&event_type=" +
this.conditions.event_type +
"&event_dt__gte=" +
this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
"&event_dt__lt=" +
this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
"&sex=" +
this.conditions.sex +
"&task_id=" +
this.conditions.task_id +
"&subtask_id=" +
this.conditions.subtask_id +
"&company_like=" +
this.conditions.company +
"&upbodyColor=" +
this.conditions.upbodyColor +
"&lobodyColor=" +
this.conditions.lobodyColor
}
window.open(
encodeURI(url)
);
},
batchdel(){
......@@ -330,10 +452,16 @@
offset: offset,
event_dt__gte: this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss'),
event_dt__lt:this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss'),
task_name: this.conditions.task_name ? this.conditions.task_name.replace(/\s\s*/g, '') : this.conditions.task_name,
event_type: "xcycle",
xcycle_type: this.conditions.xcycle_type,
location_name: this.conditions.location_name
task_id: this.conditions.task_id,
subtask_id: this.conditions.subtask_id,
event_type: this.conditions.event_type,
sex: this.conditions.sex,
company_like:this.conditions.company,
upbodyColor: this.conditions.upbodyColor,
lobodyColor: this.conditions.lobodyColor
}
if( this.conditions.event_type=='xcycle'){
search_params.xcycle_type=this.conditions.xcycle_type;
}
this.$api.search.tableList(search_params
).then((res)=>{
......
<template>
<div class="innnerBox">
<el-col :span="22">
<el-form ref="form" label-width="80px" inline>
<el-form-item label="抓拍地点" >
<span class="inputBox">
<el-input placeholder="请输入抓拍地点" v-model="conditions.location_name"></el-input>
</span>
</el-form-item>
<el-form-item label="任务名称">
<span class="inputBox">
<el-input placeholder="请输入任务名称" v-model="conditions.task_name"></el-input>
</span>
</el-form-item>
<el-form-item label="非机动车类型" label-width="110px" >
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.xcycle_type">
<el-option value="" label='全部'></el-option>
<el-option value="motorcycle" label="摩托车"></el-option>
<el-option value="bicycle" label="自行车"></el-option>
<el-option value="tricycle" label="三轮车"></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="起始时间">
<span class="dateBox">
<el-date-picker
v-model="dates"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00', '23:59:59']"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</span>
</el-form-item>
</el-form>
</el-col>
<el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;">
<el-button type="primary" style="" @click="query" class="block">查询</el-button>
<el-button type="success" class="block" @click="exportFun">导出</el-button>
</div>
<div>
<el-button type="success" class="block" @click="batchdel">批量删除</el-button>
</div>
</el-col>
<div style="">
<el-table
:data="formattterData"
height="574"
stripe
border
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
align="center"
width="55">
</el-table-column>
<el-table-column
prop="xcycle_type_text"
align="center"
label="非机动车类型 ">
</el-table-column>
<el-table-column
prop="xcycle_plate_text"
align="center"
label="车牌号码 ">
</el-table-column>
<el-table-column
prop="shoot_date"
align="center"
label="抓拍时间">
<template slot-scope="scope">
<span>{{scope.row.shoot_date}} {{scope.row.shoot_time}}</span>
</template>
</el-table-column>
<el-table-column
prop="location_name"
align="center"
label="抓拍地点">
</el-table-column>
<el-table-column
prop="company"
align="center"
label="运营公司 ">
</el-table-column>
<el-table-column
align="center"
label="操作">
<template slot-scope="scope">
<el-tooltip content="详情" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-xiugai editIcon" @click="detailFun(scope.$index, scope.row)"></span>
</el-tooltip>
<span class="tableSpanBorder"></span>
<el-tooltip content="删除" placement="bottom" effect="light" :visible-arrow=false>
<span class="iconfont icon-detail delIcon" @click="delFun(scope.$index, scope.row)"></span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 28px;">
<el-pagination
style="float: right;"
background
prev-text="上一页"
next-text="下一页"
:page-sizes="[30, 50, 100, 200]"
layout="prev, pager, next,sizes"
:current-page="page"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:total="total">
</el-pagination>
<div style="clear: both;"></div>
</div>
</div>
<el-dialog
title="详情"
top="12vh"
:visible.sync="detailVisible"
width="700px">
<div style="position: relative;padding: 10px 20px;">
<div class="leftArrow" @click="leftFun"><i class="el-icon-d-arrow-left"></i></div>
<div class="detaiCon">
<el-image style="width: 100%;" :src="this.detailImg">
<div slot="error" class="image-slot">
<img :src="carImg" alt="" style="width: 40%;display: block;margin: 0 auto;">
</div>
</el-image>
<el-form label-width="120px" inline>
<div>
<el-form-item label="车牌号码:">
<span>{{ detailObj.xcycle_plate_text }}</span>
</el-form-item>
<el-form-item label="非机动车类型:">
<span>{{ detailObj.xcycle_type_text }}</span>
</el-form-item>
</div>
<div>
<el-form-item label="经过日期:">
<span>{{ detailObj.shoot_date ? detailObj.shoot_date : '' }}</span>
</el-form-item>
<el-form-item label="经过时间:">
<span>{{ detailObj.shoot_time ? detailObj.shoot_time : '' }}</span>
</el-form-item>
</div>
<div>
<el-form-item label="经过地点:">
<span>{{ detailObj.location_name }}</span>
</el-form-item>
<el-form-item label="车辆颜色:">
<span>{{ detailObj.xcycle_color_type }}</span>
</el-form-item>
</div>
<div>
<el-form-item label="性别:">
<span>{{ detailObj.driver_face_sex }}</span>
</el-form-item>
<el-form-item label="运营公司:">
<span>{{ detailObj.company }}</span>
</el-form-item>
</div>
<div>
<el-form-item label="上身颜色:">
<span>{{ detailObj.driver_face_upbody_text }}</span>
</el-form-item>
<el-form-item label="速度:">
<span>{{ detailObj.location_speed }}</span>
</el-form-item>
</div>
<div>
<el-form-item label="戴帽子:">
<span>{{ detailObj.driver_face_with_hats }}</span>
</el-form-item>
<el-form-item label="违法类型:">
<span>{{ detailObj.illegalType }}</span>
</el-form-item>
</div>
</el-form>
</div>
<div class="rightArrow" @click="rightFun"><i class="el-icon-d-arrow-right"></i></div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="detailDel">删 除</el-button>
<el-button type="primary" @click="detailVisible = false">关 闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data(){
let start_dt = this.$moment('2019-12-20').format('YYYY-MM-DD')+' 00:00:00';
let end_dt = this.$moment().format('YYYY-MM-DD')+' 23:59:59';
return{
detailObj:{},
carImg:require("@/assets/img/home/defaultImg.png"),
detailImg:'',
detailVisible:false,
dates:[ start_dt,end_dt ],
conditions: {
start_dt:start_dt,
end_dt:end_dt,
event_type: 'xcycle',
xcycle_type:'',
location_name:'',
task_name:''
},
brandList:this.$buildCode.getCodeList('车辆品牌'),
vehicleTypeList:this.$buildCode.getCodeList('车辆类型'),
vehicleColorList:this.$buildCode.getCodeList('车身颜色'),
tableData:[],
formattterData:[],
total:0,
page:1,
pageSize:30,
selectcheck:[],
currentIndex:0
}
},
watch:{
dates(val){
this.conditions.start_dt=val[0];
this.conditions.end_dt=val[1];
}
},
components:{},
mounted(){
this.getData()
},
methods:{
exportFun(){
window.open(
encodeURI(
process.env.VUE_APP_URL+
"/api/v1/traffic/events/export?s=" +
Math.random() +
"&event_type=xcycle&event_dt__gte=" +
this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
"&event_dt__lt=" +
this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
"&xcycle_type=" +
this.conditions.xcycle_type +
"&location_name=" +
this.conditions.location_name +
"&task_name=" +
this.conditions.task_name
)
);
},
batchdel(){
if(this.selectcheck.length==0){
this.$message({
message: '请选择至少一条记录',
type: 'warning'
});
return false
}
this.$confirm('此操作将永久删除选中记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$api.search.patchdel({
"event_unids":this.selectcheck
}).then(res=>{
if(res.ecode == '200'){
this.$message({
type: 'success',
message: '删除成功!'
});
this.getData();
}else{
this.$message.error('删除失败!');
}
})
})
},
leftFun(){
if(this.currentIndex-1<0){
this.$message({
message: '目前为第一条',
type: 'warning'
});
return false;
}
this.detailObj=this.formattterData[this.currentIndex-1];
this.currentIndex-=1;
this.getImg(this.detailObj.pics[0].pic_unid);
},
rightFun(){
if(this.currentIndex==this.formattterData.length-1){
this.$message({
message: '目前为最后一条',
type: 'warning'
});
return false;
}
this.detailObj=this.formattterData[this.currentIndex+1];
this.currentIndex+=1;
this.getImg(this.detailObj.pics[0].pic_unid);
},
handleSelectionChange(obj){
this.selectcheck = [];
obj.forEach(item => {
this.selectcheck.push(item.id)
});
},
handleSizeChange(val) {
this.pageSize=val;
this.getData();
},
handleCurrentChange(val) {
this.page=val;
this.getData();
},
query(){
this.getData();
},
getData(){
this.formattterData=[];
let offset = (this.page - 1) * this.pageSize;
let search_params = {
limit: this.pageSize,
offset: offset,
event_dt__gte: this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss'),
event_dt__lt:this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss'),
task_name: this.conditions.task_name ? this.conditions.task_name.replace(/\s\s*/g, '') : this.conditions.task_name,
event_type: "xcycle",
xcycle_type: this.conditions.xcycle_type,
location_name: this.conditions.location_name
}
this.$api.search.tableList(search_params
).then((res)=>{
this.total=res.total_num;
res.list_data.forEach((item,index)=>{
this.formattterData.push(this.$buildCode.init(item));
})
}).catch((err)=>{
})
},
getImg(unid){
this.$api.search.detailImg({
},unid).then(res=>{
this.detailImg=res.pic_url ? res.pic_url : carImg;
}).catch(e=>{
})
},
detailFun(index,row){
this.currentIndex=index;
if(row.pics.length>0){
this.detailObj = Object.assign({},row);
this.getImg(row.pics[0].pic_unid);
}
this.detailVisible=true;
},
delFun(index,row){
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$api.search.delVehicle({
},row.id).then(res=>{
if(res.ecode==200){
this.formattterData.splice(index);
this.$message({
type: 'success',
message: '删除成功!'
});
}else{
this.$message.error('删除失败!');
}
}).catch(e=>{
this.$message.error('删除失败!');
})
})
},
detailDel(){
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$api.search.delVehicle({},this.detailObj.id).then(res=>{
if(res.ecode==200){
this.formattterData.splice(this.currentIndex,1);
this.detailObj = Object.assign({},this.formattterData[this.currentIndex]);
this.getImg(this.formattterData[this.currentIndex].pics[0].pic_unid);
this.$message({
type: 'success',
message: '删除成功!'
});
}else{
this.$message.error('删除失败!');
}
}).catch(e=>{
this.$message.error('删除失败!');
})
})
}
},
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!