Commit fc2a6ee2 by 潘建波

合并冲突提交

2 parents 87761259 d60b57e4
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
...@@ -18,7 +18,17 @@ export default { ...@@ -18,7 +18,17 @@ export default {
} }
}, },
mounted(){ mounted(){
window.videoEquitTableHeight = document.body.clientHeight - 142 + 'px';
window.opsTableHeight = document.body.clientHeight - 260 + 'px';
if(document.body.clientWidth>1366){
window.oneSearchTableHeight = document.body.clientHeight - 250 + 'px';
window.twoSearchTableHeight = document.body.clientHeight - 280 + 'px';
}else {
window.oneSearchTableHeight = document.body.clientHeight - 280 + 'px';
window.twoSearchTableHeight = document.body.clientHeight - 315 + 'px';
}
} }
} }
</script> </script>
......
...@@ -36,5 +36,35 @@ export default { ...@@ -36,5 +36,35 @@ export default {
}, },
bindRole(params,id){ bindRole(params,id){
return api.post(`${baseUrl}/api/v1/auth/users/${id}/roles`, params) 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 \ No newline at end of file
...@@ -34,13 +34,14 @@ export default { ...@@ -34,13 +34,14 @@ export default {
getCameraTable(params,id,id2){ getCameraTable(params,id,id2){
console.log(id2) console.log(id2)
if(id2){ if(id2){
console.log('aa')
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params)
}else{ }else{
console.log('bb')
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params)
} }
}, },
editVideo(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params)
},
editCamera(params,id,id2){ editCamera(params,id,id2){
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params) return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params)
}, },
...@@ -66,4 +67,17 @@ export default { ...@@ -66,4 +67,17 @@ export default {
delStore(params,id){ delStore(params,id){
return api.delete(`${baseUrl}/api/v1/devconf_fx/store_confs/${id}`, params) 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 \ No newline at end of file
...@@ -349,23 +349,29 @@ class Codes { ...@@ -349,23 +349,29 @@ class Codes {
this.result.xcycle_plate_text = "未识别"; this.result.xcycle_plate_text = "未识别";
} }
// 骑车类型 // 骑车类型
try { console.log(this.allData.event_data.xcycle_type)
switch (this.allData.event_data.xcycle_type) { if(!this.allData.event_data.xcycle_type){
case "motorcycle": this.result.xcycle_type_text = "行人";
this.result.xcycle_type_text = "摩托车"; }else{
break; try {
case "bicycle": switch (this.allData.event_data.xcycle_type) {
this.result.xcycle_type_text = "自行车"; case "motorcycle":
break; this.result.xcycle_type_text = "摩托车";
case "tricycle": break;
this.result.xcycle_type_text = "三轮车"; case "bicycle":
break; this.result.xcycle_type_text = "自行车";
default: break;
break; case "tricycle":
} this.result.xcycle_type_text = "三轮车";
} catch (err) { break;
this.result.xcycle_type_text = "未识别"; default:
} break;
}
} catch (err) {
this.result.xcycle_type_text = "未识别";
}
}
try { try {
if (this.result.xcycle_type_text === "自行车") { if (this.result.xcycle_type_text === "自行车") {
this.result.company = this.allData.event_data.xcycle.company.name; this.result.company = this.allData.event_data.xcycle.company.name;
......
...@@ -23,6 +23,10 @@ body{ ...@@ -23,6 +23,10 @@ body{
font-size: 14px; font-size: 14px;
background: $bodyback-color; background: $bodyback-color;
} }
.minHeight{
height: calc(100vh - 140px);
overflow: auto;
}
input{ input{
font-family: "微软雅黑"; font-family: "微软雅黑";
} }
...@@ -164,3 +168,9 @@ a:active{ ...@@ -164,3 +168,9 @@ a:active{
color:#f2365a; color:#f2365a;
font-size:16px; font-size:16px;
} }
@media screen and (max-width: 1366px) {
.compatibleBtn {
margin-left: 0px!important;
margin-top: 6px!important;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -80,7 +80,7 @@ export const asyncRouterMap = [ ...@@ -80,7 +80,7 @@ export const asyncRouterMap = [
children: [ children: [
{ {
path: "/search/vehicle", path: "/search/vehicle",
name: "车辆检索", name: "过车检索",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
...@@ -89,24 +89,24 @@ export const asyncRouterMap = [ ...@@ -89,24 +89,24 @@ export const asyncRouterMap = [
}, },
{ {
path: "/search/xcycle", path: "/search/xcycle",
name: "非机动车检索", name: "行人非机动车检索",
meta: { meta: {
icon: "el-icon-user" icon: "el-icon-user"
}, },
component: resolve => require(["../views/search/xcycle.vue"], resolve) component: resolve => require(["../views/search/xcycle.vue"], resolve)
}, },
{ // {
path: "/search/pedestrian", // path: "/search/pedestrian",
name: "行人检索", // name: "行人检索",
meta: { // meta: {
icon: "el-icon-location" // icon: "el-icon-location"
}, // },
component: resolve => // component: resolve =>
require(["../views/search/pedestrian.vue"], resolve) // require(["../views/search/pedestrian.vue"], resolve)
}, // },
{ {
path: "/search/event", path: "/search/event",
name: "事件查询", name: "事件检索",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
...@@ -114,7 +114,7 @@ export const asyncRouterMap = [ ...@@ -114,7 +114,7 @@ export const asyncRouterMap = [
}, },
{ {
path: "/search/illegal", path: "/search/illegal",
name: "违法记录查询", name: "违法检索",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
...@@ -122,19 +122,21 @@ export const asyncRouterMap = [ ...@@ -122,19 +122,21 @@ export const asyncRouterMap = [
}, },
{ {
path: "/search/traficflow", path: "/search/traficflow",
name: "交通流量", name: "流量检索",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
component: resolve => require(["../views/search/traficflow.vue"], resolve), 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),
// }
] ]
}, },
{ {
...@@ -145,47 +147,63 @@ export const asyncRouterMap = [ ...@@ -145,47 +147,63 @@ export const asyncRouterMap = [
icon: "el-icon-location" icon: "el-icon-location"
}, },
children: [ children: [
{ {
path: "/resource/video", path: "/resource/video",
name: "视频设备", name: "视频设备",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
component: resolve => require(["../views/resource/videoEquipment.vue"], resolve), component: resolve =>
}, require(["../views/resource/videoEquipment.vue"], resolve)
{ },
path: "/resource/equipment", {
name: "分析设备", path: "/resource/equipment",
meta: { name: "分析设备",
icon: "el-icon-location" meta: {
}, icon: "el-icon-location"
component: resolve => require(["../views/resource/analysis.vue"], resolve), },
}, component: resolve =>
{ require(["../views/resource/analysis.vue"], resolve)
path: "/resource/store_confs", },
name: "存储配置", {
meta: { path: "/resource/store_confs",
icon: "el-icon-location" name: "存储配置",
}, meta: {
component: resolve => require(["../views/resource/store_confs.vue"], resolve), icon: "el-icon-location"
}, },
{ component: resolve =>
path: "/resource/author", require(["../views/resource/store_confs.vue"], resolve)
name: "授权管理", },
meta: { {
icon: "el-icon-location" path: "/resource/author",
}, name: "授权管理",
component: resolve => require(["../views/resource/Author/author.vue"], resolve), meta: {
},{ icon: "el-icon-location"
path: "/resource/codes", },
name: "字典管理", component: resolve =>
meta: { require(["../views/resource/Author/author.vue"], resolve)
icon: "el-icon-location" },
}, {
component: resolve => require(["../views/resource/Codes/codes.vue"], resolve), path: "/resource/nationalStandard",
}, name: "国标配置",
] meta: {
},{ icon: "el-icon-location"
},
component: resolve =>
require(["../views/resource/nationalStandard.vue"], resolve)
},
{
path: "/resource/codes",
name: "字典管理",
meta: {
icon: "el-icon-location"
},
component: resolve =>
require(["../views/resource/Codes/codes.vue"], resolve)
}
]
},
{
path: "/ops", path: "/ops",
name: "系统运维", name: "系统运维",
component: resolve => require(["../views/Layout/index.vue"], resolve), component: resolve => require(["../views/Layout/index.vue"], resolve),
...@@ -193,50 +211,56 @@ export const asyncRouterMap = [ ...@@ -193,50 +211,56 @@ export const asyncRouterMap = [
icon: "el-icon-location" icon: "el-icon-location"
}, },
children: [ children: [
{ {
path: "/ops/equipment_manage", path: "/ops/equipment_manage",
name: "设备管理", name: "设备管理",
meta: { meta: {
icon: "el-icon-location" icon: "el-icon-location"
}, },
component: resolve => require(["../views/ops/equipment_manage"], resolve), component: resolve =>
},{ require(["../views/ops/equipment_manage"], resolve)
path: "/ops/system_manage", },
name: "系统配置", {
meta: { path: "/ops/system_manage",
icon: "el-icon-location" name: "系统配置",
}, meta: {
component: resolve => require(["../views/ops/system_manage"], resolve), icon: "el-icon-location"
},{ },
path: "/ops/user_manage", component: resolve => require(["../views/ops/system_manage"], resolve)
name: "用户管理", },
meta: { {
icon: "el-icon-location" path: "/ops/user_manage",
}, name: "用户管理",
component: resolve => require(["../views/ops/user_manage.vue"], resolve), meta: {
},{ icon: "el-icon-location"
path: "/ops/role_manage", },
name: "角色管理", component: resolve => require(["../views/ops/user_manage.vue"], resolve)
meta: { },
icon: "el-icon-location" {
}, path: "/ops/role_manage",
component: resolve => require(["../views/ops/role_manage.vue"], resolve), name: "角色管理",
},{ meta: {
path: "/ops/batch_upgrade", icon: "el-icon-location"
name: "批量升级", },
meta: { component: resolve => require(["../views/ops/role_manage.vue"], resolve)
icon: "el-icon-location" },
}, {
component: resolve => require(["../views/ops/log_manage.vue"], resolve), path: "/ops/batch_upgrade",
},{ name: "批量升级",
path: "/ops/log_manage", meta: {
name: "日志管理", icon: "el-icon-location"
meta: { },
icon: "el-icon-location" component: resolve => require(["../views/ops/log_manage.vue"], resolve)
}, },
component: resolve => require(["../views/ops/log_manage.vue"], resolve), {
} path: "/ops/log_manage",
] name: "日志管理",
meta: {
icon: "el-icon-location"
},
component: resolve => require(["../views/ops/log_manage.vue"], resolve)
}
]
} }
]; ];
const router = new VueRouter({ const router = new VueRouter({
......
...@@ -55,7 +55,6 @@ import types from '../store/types.js' ...@@ -55,7 +55,6 @@ import types from '../store/types.js'
sessionStorage.setItem('user_unid',res.user_unid) sessionStorage.setItem('user_unid',res.user_unid)
//本系统可以直接用本地缓存做 //本系统可以直接用本地缓存做
this.getMenu(res.user_unid)
// localStorage.setItem('user_name',this.username) // localStorage.setItem('user_name',this.username)
// 处理登录用户权限菜单显示问题; // 处理登录用户权限菜单显示问题;
//算法配置列表 //算法配置列表
...@@ -63,10 +62,12 @@ import types from '../store/types.js' ...@@ -63,10 +62,12 @@ import types from '../store/types.js'
//存储配置列表 //存储配置列表
this.storeConfList(); this.storeConfList();
//code列表 //code列表
this.getCatesList();
this.getCodeList(); this.getCodeList();
this.getCustomCode(); this.getCustomCode();
this.getEventList(); this.getEventList();
this.getDev(); this.getDev();
this.getMenu(res.user_unid);
} }
}).catch((err) => { }).catch((err) => {
...@@ -138,6 +139,22 @@ import types from '../store/types.js' ...@@ -138,6 +139,22 @@ import types from '../store/types.js'
}) })
}, },
getCatesList(){
this.$api.codes.eventCates({}).then(res=>{
// 存储cate列表
window.localStorage.setItem('cate列表',JSON.stringify(res.list_data))
// 存储单独code
res.list_data.forEach(item=>{
this.getOneEventList(item.code,item.event_cate_unid)
})
})
},
getOneEventList(code,id){
this.$api.codes.eventType({},id).then(res=>{
// 存储cate列表
window.localStorage.setItem(code,JSON.stringify(res.list_data))
})
},
getEventList(){ getEventList(){
this.$api.search.eventTypes({}).then(res=>{ this.$api.search.eventTypes({}).then(res=>{
// 存储code列表 // 存储code列表
...@@ -150,9 +167,19 @@ import types from '../store/types.js' ...@@ -150,9 +167,19 @@ import types from '../store/types.js'
}, },
getDev() { getDev() {
this.$api.resource.devs().then(res => { 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);
}
})
},
}, },
watch: {}, watch: {},
mounted() { mounted() {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div style=""> <div style="">
<el-table <el-table
:data="tableData" :data="tableData"
height="574" :height="tableHeight"
stripe stripe
border> border>
<el-table-column <el-table-column
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
total:0, total:0,
page:1, page:1,
pageSize:30, pageSize:30,
tableHeight:window.opsTableHeight
} }
}, },
watch:{ watch:{
......
<template> <template>
<div class="contentBox"> <div class="contentBox">
<div class="content"> <div class="content">
<div style="padding: 20px 15px 20px 23px;"> <div style="padding:8px 20px;">
<span style="float: right;"> <span style="float: right;">
<el-button type="info" @click="addRole">添加新角色</el-button> <el-button type="info" @click="addRole">添加新角色</el-button>
</span> </span>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</div> </div>
<div style="padding: 0 15px 20px 23px;"> <div style="padding: 0 15px 20px 23px;">
<el-table <el-table
height="574" :height="tableHeight"
:data="tableData" :data="tableData"
stripe stripe
border border
...@@ -169,7 +169,8 @@ ...@@ -169,7 +169,8 @@
menu_unids: [ menu_unids: [
{ validator: checkMenu_unids, trigger: 'change' } { validator: checkMenu_unids, trigger: 'change' }
], ],
} },
tableHeight:window.opsTableHeight
} }
}, },
components:{ components:{
......
...@@ -3,67 +3,74 @@ ...@@ -3,67 +3,74 @@
<el-form ref="form" label-width="100px"> <el-form ref="form" label-width="100px">
<!-- 手动校时 --> <!-- 手动校时 -->
<div class="lineBox big"> <div class="lineBox big">
<el-radio v-model="radio" label="1">手动校时</el-radio> <el-radio v-model="typeRadio" label="1">手动校时</el-radio>
</div> </div>
<div class="radioContent"> <div class="radioContent">
<div class="lineBox"> <div class="lineBox">
<el-form-item label="当前时间:"> <el-form-item label="当前时间:">
<span>2020-02-11 16:08:01</span> <span>{{computerTime}}</span>
</el-form-item> </el-form-item>
</div> </div>
<div class="lineBox"> <div class="lineBox">
<el-form-item label="设备时间:"> <el-form-item label="设备时间:">
<el-date-picker <el-date-picker
:disabled="typeRadio=='2'"
v-model="systemTime" v-model="systemTime"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" type="datetime"
placeholder="选择日期时间"> placeholder="选择日期时间">
</el-date-picker> </el-date-picker>
<span style="margin-left: 30px;"> <el-checkbox v-model="syncTime">与计算机时间同步</el-checkbox></span> <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">校时</el-button> <el-button type="primary" size="small" class="primaryButton rightButton" :disabled="typeRadio=='2'" @click="manualClick">校时</el-button>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<div class="line"></div> <div class="line"></div>
<!-- NTP校时 --> <!-- NTP校时 -->
<div class="lineBox big"> <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>
<div class="radioContent"> <div class="radioContent">
<div class="lineBox"> <div class="lineBox">
<el-form-item label="服务器地址:"> <el-form-item label="服务器地址:">
<span class="inputBox"> <span class="inputBox">
<el-input placeholder="请输入服务器地址" v-model="url"></el-input> <el-input placeholder="请输入服务器地址" v-model="serverAdr" :disabled="typeRadio=='1'"></el-input>
</span> </span>
</el-form-item> </el-form-item>
</div> </div>
<div class="lineBox"> <div class="lineBox">
<el-form-item label="NTP端口:"> <el-form-item label="NTP端口:">
<span class="inputBox"> <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> </span>
</el-form-item> </el-form-item>
</div> </div>
<div class="lineBox"> <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> </div>
<el-form ref="inlineform" label-width="100px" inline> <el-form ref="inlineform" label-width="100px" inline>
<div class="lineBox"> <div class="lineBox">
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="typeRadio=='1'||ntpRadio=='2'"
v-model="timeArr[0]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="typeRadio=='1'||ntpRadio=='2'"
value-format="HH:mm"
v-model="timeArr[1]"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="typeRadio=='1'||ntpRadio=='2'"
v-model="timeArr[2]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
...@@ -71,13 +78,17 @@ ...@@ -71,13 +78,17 @@
<div class="lineBox"> <div class="lineBox">
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="typeRadio=='1'||ntpRadio=='2'"
v-model="timeArr[3]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="typeRadio=='1'||ntpRadio=='2'"
v-model="timeArr[4]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
...@@ -87,15 +98,15 @@ ...@@ -87,15 +98,15 @@
</div> </div>
</el-form> </el-form>
<div class="lineBox"> <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>
<div class="lineBox"> <div class="lineBox">
<el-form-item label="每隔:"> <el-form-item label="每隔:">
<span class="inputBox" style="width: 60px;"> <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>
<span style="margin-left: 14px;">秒,自动进行校时</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> </el-form-item>
</div> </div>
</div> </div>
...@@ -106,20 +117,176 @@ ...@@ -106,20 +117,176 @@
export default { export default {
data(){ data(){
return{ return{
time:'', typeRadio:'1',
url:'', ntpRadio:'1',
timeArr:['','','','',''],
ntpPort:'', ntpPort:'',
weekMinutes:'',
activeName: 'first', activeName: 'first',
systemTime:'', 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:{}, components:{},
mounted(){}, mounted(){
this.timer();
this.getDevTimes();
this.getNtpTimes();
},
methods:{ methods:{
handleClick(tab, event) { handleClick(tab, event) {
console.log(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)
});
}
}, },
} }
</script> </script>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<div class="radioContent"> <div class="radioContent">
<div class="lineBox"> <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>
<div class="lineBox"> <div class="lineBox">
<span class="tip">恢复出厂设置说明:完全恢复设备参数到出厂设置</span> <span class="tip">恢复出厂设置说明:完全恢复设备参数到出厂设置</span>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</div> </div>
<div class="radioContent"> <div class="radioContent">
<div class="lineBox"> <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>
<div class="lineBox"> <div class="lineBox">
<el-checkbox v-model="openRestart">开启定时重启</el-checkbox> <el-checkbox v-model="openRestart">开启定时重启</el-checkbox>
...@@ -56,19 +56,25 @@ ...@@ -56,19 +56,25 @@
<div class="lineBox"> <div class="lineBox">
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="!openRestart"
v-model="timeArr[0]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="!openRestart"
v-model="timeArr[1]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="!openRestart"
v-model="timeArr[2]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
...@@ -76,13 +82,17 @@ ...@@ -76,13 +82,17 @@
<div class="lineBox"> <div class="lineBox">
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="!openRestart"
v-model="timeArr[3]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
<el-form-item label="每天:"> <el-form-item label="每天:">
<el-time-select <el-time-select
v-model="time" :disabled="!openRestart"
v-model="timeArr[4]"
value-format="HH:mm"
placeholder="选择时间"> placeholder="选择时间">
</el-time-select> </el-time-select>
</el-form-item> </el-form-item>
...@@ -90,7 +100,7 @@ ...@@ -90,7 +100,7 @@
<span>自动进行校时(可设置多个时间点,不得超过5个)</span> <span>自动进行校时(可设置多个时间点,不得超过5个)</span>
</el-form-item> </el-form-item>
<el-form-item label=" "> <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> </el-form-item>
</div> </div>
...@@ -105,26 +115,192 @@ ...@@ -105,26 +115,192 @@
return{ return{
openRestart:false, openRestart:false,
selectFilename:'', selectFilename:'',
time:'', timeArr:[],
url:'', file:null,
ntpPort:'', dev_unid:sessionStorage.getItem('dev_unid'),
activeName: 'first', device_id:sessionStorage.getItem('device_id'),
systemTime:'',
syncTime:false
} }
}, },
components:{}, components:{},
mounted(){}, mounted(){
this.getRebootSetting();
},
methods:{ methods:{
handleClick(tab, event) { getRebootSetting() {
console.log(tab, event); 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(){ 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){ fileChange(file,fileList){
console.log(file,fileList)
this.selectFilename=file.name; 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> <template>
<div class="contentBox"> <div class="contentBox minHeight">
<div style="background: #FFFFFF;"> <div :style="{'background': '#FFFFFF','min-height': height}">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="校时设置" name="first"> <el-tab-pane label="校时设置" name="first">
<proofreadtime></proofreadtime> <proofreadtime></proofreadtime>
...@@ -20,13 +20,16 @@ ...@@ -20,13 +20,16 @@
export default { export default {
data(){ data(){
return{ return{
activeName: 'first' activeName: 'first',
height:''
} }
}, },
components:{ components:{
proofreadtime,sytemset proofreadtime,sytemset
}, },
mounted(){}, mounted(){
this.height=document.body.clientHeight - 140 + 'px'
},
methods:{ methods:{
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
......
<template> <template>
<div class="contentBox"> <div class="contentBox">
<div class="content"> <div class="content">
<div style="padding: 20px 15px 20px 23px;"> <div style="padding:8px 20px;">
<span style="float: right;"> <span style="float: right;">
<el-button type="info" @click="addUser">添加新用户</el-button> <el-button type="info" @click="addUser">添加新用户</el-button>
</span> </span>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</div> </div>
<div style="padding: 0 15px 20px 23px;"> <div style="padding: 0 15px 20px 23px;">
<el-table <el-table
height="574" :height="tableHeight"
:data="tableData" :data="tableData"
stripe stripe
border border
...@@ -200,7 +200,8 @@ ...@@ -200,7 +200,8 @@
checkPass:[ checkPass:[
{ validator: validatePass2, trigger: 'change' } { validator: validatePass2, trigger: 'change' }
] ]
} },
tableHeight:window.opsTableHeight
} }
}, },
components:{ components:{
...@@ -263,8 +264,8 @@ ...@@ -263,8 +264,8 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$api.ops.delUser({},row.unid).then(res=>{ this.$api.ops.delUser({},row.user_unid).then(res=>{
if(res.ecode==200){ if(!res.ecode){
this.$message({ this.$message({
type: 'success', type: 'success',
message: '删除成功!' message: '删除成功!'
......
<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 \ No newline at end of file
<template> <template>
<div class="contentBox"> <div class="contentBox">
<div class="content"> <div class="content">
<div style="padding: 20px 15px 20px 23px;"> <div style="padding:8px 20px;">
<span class="inputBox"> <span class="inputBox">
<el-input v-model="storename" placeholder="请输入存储配置名称"></el-input> <el-input v-model="storename" placeholder="请输入存储配置名称"></el-input>
</span> </span>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
<div style="padding: 0 15px 20px 23px;"> <div style="padding: 0 15px 20px 23px;">
<el-table <el-table
height="574" :height="tableHeight"
:data="tableData" :data="tableData"
stripe stripe
border border
...@@ -142,7 +142,8 @@ ...@@ -142,7 +142,8 @@
selectDevs:'', selectDevs:'',
detailVisible:false, detailVisible:false,
storename:'', storename:'',
curentSubList:[] curentSubList:[],
tableHeight:window.opsTableHeight
} }
}, },
components:{ components:{
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<div> <div>
<el-tree <el-tree
class="filter-tree" class="filter-tree"
accordion
:data="treeData" :data="treeData"
:props='defaultProps' :props='defaultProps'
default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
}, },
methods:{ methods:{
handleNodeClick(data){ handleNodeClick(data){
this.$parent.$parent.getTable(data,'camera') this.$emit('clickHandle',data,'camera');
}, },
nodeDelClick(node,data){ nodeDelClick(node,data){
this.$confirm('此操作将永久删除该选项, 是否继续?', '提示', { this.$confirm('此操作将永久删除该选项, 是否继续?', '提示', {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<div> <div>
<el-tree <el-tree
class="filter-tree" class="filter-tree"
accordion
:data="treeData" :data="treeData"
:props='defaultProps' :props='defaultProps'
default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
unid: '0', unid: '0',
org_pid: '0', org_pid: '0',
vchan_name: '手动添加录像资源', vchan_name: '手动添加录像资源',
org_type: 'root', org_type: 'video',
childs: [] childs: []
} }
], ],
...@@ -105,7 +105,9 @@ ...@@ -105,7 +105,9 @@
this.file.push(param.file) this.file.push(param.file)
}, },
handleNodeClick(data){ handleNodeClick(data){
this.$parent.$parent.getVideoTable(data,'video') console.log(data)
this.$emit('clickHandle',data,'video');
// this.$parent.$parent.getVideoTable(data,'video')
}, },
nodeAddClick(node,data){ nodeAddClick(node,data){
this.addVisible=true; this.addVisible=true;
......
<template> <template>
<div class="innnerBox"> <div class="innnerBox">
<el-col :span="4"> <el-row :gutter="12">
<el-col :span="4" class="treeBox minHeight">
<el-input class="search-input" prefix-icon="el-icon-search" placeholder="请输入内容" v-model="searchText"> <el-input class="search-input" prefix-icon="el-icon-search" placeholder="请输入内容" v-model="searchText">
</el-input> </el-input>
<cameraTree :filterText="searchText" :treeDatas="cameraTree"></cameraTree> <cameraTree :filterText="searchText" :treeDatas="cameraTree" @clickHandle="getTable"></cameraTree>
<videoTree :filterText="searchText" :treeDatas="videoTree" :devsId="dev_unid"></videoTree> <videoTree :filterText="searchText" :treeDatas="videoTree" :devsId="dev_unid" @clickHandle="getTable"></videoTree>
</el-col> </el-col>
<el-col :span="20"> <el-col :span="20" >
<el-table :data="formattterData" height="574" stripe border v-if="tableType=='camera'"> <el-table :data="formattterData" stripe border v-if="tableType=='camera'" :height="tableHeight">
<el-table-column prop="label" align="center" label="名称"> <el-table-column prop="label" align="center" label="名称">
</el-table-column> </el-table-column>
<el-table-column prop="url" align="center" label="取流地址"> <el-table-column prop="url" align="center" label="取流地址">
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-table :data="formattterData" height="574" stripe border v-else-if="tableType=='video'"> <el-table :data="formattterData" stripe border v-else-if="tableType=='video'" :height="tableHeight">
<el-table-column prop="vchan_name" align="center" label="名称"> <el-table-column prop="vchan_name" align="center" label="名称">
</el-table-column> </el-table-column>
<el-table-column prop="video_url" align="center" label="取流地址"> <el-table-column prop="video_url" align="center" label="取流地址">
...@@ -47,6 +48,26 @@ ...@@ -47,6 +48,26 @@
</el-table> </el-table>
</el-col> </el-col>
<cameraDialog ref="editCamera"></cameraDialog> <cameraDialog ref="editCamera"></cameraDialog>
<el-dialog
title="修改视频"
:visible.sync="videoEditVisible"
width="450px">
<div>
<el-form label-position="left" label-width="120px" :model="videoEditParam" ref="videoDialog" inline-message hide-required-asterisk>
<el-form-item label="名称" :rules="[ { required: true, message: '请输入名称', trigger: 'change' }]">
<el-input v-model="videoEditParam.vchan_name"></el-input>
</el-form-item>
<el-form-item label="取流地址">
<el-input v-model="videoEditParam.video_url" disabled></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="videoEditVisible=false">取 消</el-button>
<el-button type="primary" @click="editSave">确 定</el-button>
</span>
</el-dialog>
</el-row>
</div> </div>
</template> </template>
<script> <script>
...@@ -70,7 +91,14 @@ ...@@ -70,7 +91,14 @@
dev_unid: sessionStorage.getItem('dev_unid'), dev_unid: sessionStorage.getItem('dev_unid'),
cameraArr:[], cameraArr:[],
cameraTree:[], cameraTree:[],
videoTree:[] videoTree:[],
videoEditParam:{
vchan_name:'',
video_url:''
},
videoEditVisible:false,
vchan_duid:'',
tableHeight:window.videoEquitTableHeight
} }
}, },
watch: { watch: {
...@@ -79,6 +107,7 @@ ...@@ -79,6 +107,7 @@
cameraTree,cameraDialog,videoTree cameraTree,cameraDialog,videoTree
}, },
mounted() { mounted() {
console.log('aa',this.tableHeight)
this.getCameraTree(); this.getCameraTree();
this.getVideoTree(); this.getVideoTree();
}, },
...@@ -193,41 +222,50 @@ ...@@ -193,41 +222,50 @@
getTable(data,type) { getTable(data,type) {
if(data.org_type!="root"){ if(data.org_type!="root"){
this.tableType=type; this.tableType=type;
if(data.org_type){ if(this.tableType=="camera"){
this.tableType=type; if(data.org_type){
this.formattterData = []; this.tableType=type;
let filterData=[]; this.formattterData = [];
let search_params = { let filterData=[];
vchan_type: "camera", let search_params = {
org_unid:data.unid vchan_type: "camera",
} org_unid:data.unid
this.$api.resource.getCameraTable(search_params,this.dev_unid).then((res) => {
if(res.list_data.length > 0) {
for(var i = 0; i < res.list_data.length; i++) {
filterData = this.cameraArr.filter(list => {
return list.id === res.list_data[i].vchan_refid;
})
if(filterData.length > 0) {
this.formattterData.push(filterData[0]);
}
}
} }
}).catch((err) => { this.$api.resource.getCameraTable(search_params,this.dev_unid).then((res) => {
if(res.list_data.length > 0) {
}) for(var i = 0; i < res.list_data.length; i++) {
}else{ filterData = this.cameraArr.filter(list => {
this.formattterData = []; return list.id === res.list_data[i].vchan_refid;
let filterData=[]; })
this.$api.resource.getCameraTable({},this.dev_unid,data.vchan_refid).then((res) => { if(filterData.length > 0) {
filterData = this.cameraArr.filter(list => { this.formattterData.push(filterData[0]);
return list.id === res.refid; }
})
if(filterData.length > 0) {
this.formattterData.push(filterData[0]);
} }
}).catch((err) => { }
}).catch((err) => {
})
})
}else{
this.formattterData = [];
let filterData=[];
this.$api.resource.getCameraTable({},this.dev_unid,data.vchan_refid).then((res) => {
filterData = this.cameraArr.filter(list => {
return list.id === res.refid;
})
if(filterData.length > 0) {
this.formattterData.push(filterData[0]);
}
}).catch((err) => {
})
}
}else if(this.tableType=="video"){
if(data.org_type=='video'){
this.formattterData=data.childs;
}else{
this.formattterData=[];
this.formattterData.push(data)
}
} }
} }
...@@ -242,8 +280,33 @@ ...@@ -242,8 +280,33 @@
this.formattterData.push(data) this.formattterData.push(data)
} }
}, },
editVideo(){ editVideo(index,row){
this.vchan_duid=row.vchan_duid;
this.videoEditParam.vchan_name = row.vchan_name;
this.videoEditParam.video_url = row.video_url;
this.videoEditVisible=true;
},
editSave(){
this.$api.resource.editVideo({
name:this.videoEditParam.vchan_name
},this.dev_unid,this.vchan_duid).then(res=>{
if(res.ecode==200){
this.$message({
type: 'success',
message: res.enote
});
this.getVideoTree();
this.formattterData.forEach(item=>{
if(item.vchan_duid==this.vchan_duid){
item.vchan_name=this.videoEditParam.vchan_name
}
})
}else{
this.$message.error(res.enote);
}
this.videoEditVisible=false;
})
}, },
delVideo(){ delVideo(){
...@@ -252,4 +315,8 @@ ...@@ -252,4 +315,8 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.treeBox{
border: 1px solid #EBEEF5;
padding: 12px;
}
</style> </style>
...@@ -2,14 +2,28 @@ ...@@ -2,14 +2,28 @@
<div class="innnerBox"> <div class="innnerBox">
<el-col :span="22"> <el-col :span="22">
<el-form ref="form" label-width="80px" inline> <el-form ref="form" label-width="80px" inline>
<el-form-item label="资源类型" > <el-form-item label="任务名称">
<span class="inputBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.source_type"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.task_id" @change="getSubTask">
<el-option value="pull_video_stream" label='拉取视频'></el-option> <el-option v-for='item in taskList' :value="item.task_id" :key="item.task_id" :label='item.task_name'></el-option>
<el-option value="pull_pic_files" label='拉取图片'></el-option> </el-select>
</el-select> </span>
</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.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="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.event_cate" @change="cateChange">
<el-option value="安防事件" label="全部"></el-option>
<el-option v-for='item in cateList' :value="item.code" :key="item.code" :label='item.name'></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="事件类型"> <el-form-item label="事件类型">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.type"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.type">
...@@ -18,9 +32,9 @@ ...@@ -18,9 +32,9 @@
</el-select> </el-select>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="任务名称"> <el-form-item label="组织名称">
<span class="inputBox"> <span class="inputBox">
<el-input placeholder="请输入任务名称" v-model="conditions.task_name"></el-input> <el-input placeholder="请输入组织名称" v-model="conditions.location_code"></el-input>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="起始时间"> <el-form-item label="起始时间">
...@@ -41,71 +55,41 @@ ...@@ -41,71 +55,41 @@
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px;padding-top: 3px;">
<el-button type="primary" style="" @click="query" class="block">查询</el-button> <el-button type="primary" style="" @click="query" class="block">查询</el-button>
<el-button type="success" class="block" @click="exportFun">导出</el-button> <el-button type="success" class="block compatibleBtn" @click="exportFun">导出</el-button>
</div> </div>
</el-col> </el-col>
<div style=""> <div style="">
<el-table <el-table
:data="formattterData" :data="formattterData"
height="574" :height="tableHeight"
stripe stripe
border border
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
<el-table-column
prop="event_cate"
align="center"
:formatter="cateFormatter"
label="事件分类">
</el-table-column>
<el-table-column <el-table-column
prop="event_type" prop="event_type"
align="center" align="center"
label="事件类型"> label="事件类型">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="task_name" prop="event_data.location.code"
align="center" align="center"
label="任务名称"> label="组织名称">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="地点"> label="抓拍地点">
<template slot-scope="scope" > <template slot-scope="scope" >
<div> <div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data&&scope.row.event_data">{{scope.row.event_data.locate_name}}</span> <span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data&&scope.row.event_data">{{scope.row.event_data.locate_name}}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
align="center"
label="面积(㎡)">
<template slot-scope="scope" >
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data&&scope.row.event_data.area_list">{{scope.row.area_list[0].area}}</span>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="人数(个)">
<template slot-scope="scope" >
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data&&scope.row.event_data.area_list">{{scope.row.area_list[0].count}}</span>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="进入阈值">
<template slot-scope="scope" >
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data&&scope.row.event_data.area_list">{{scope.row.area_list[0].max_len}}</span>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="离开阈值">
<template slot-scope="scope" >
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data&&scope.row.event_data.area_list">{{scope.row.area_list[0].normal_len}}</span>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="shoot_date" prop="shoot_date"
align="center" align="center"
...@@ -114,51 +98,6 @@ ...@@ -114,51 +98,6 @@
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data">{{scope.row.shoot_date}} {{scope.row.shoot_time}}</span> <span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data">{{scope.row.shoot_date}} {{scope.row.shoot_time}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
align="center"
label="车道号">
<template slot-scope="scope">
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data">{{scope.row.event_data.lane.number}}</span>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="方向类型">
<template slot-scope="scope">
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data &&scope.row.event_type !=='jinggaidiushi'&&scope.row.event_type !=='daobantingche'">{{scope.row.direction_text}}</span>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="车道类型">
<template slot-scope="scope">
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data">{{scope.row.lane_text}}</span>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="事件发生时间">
<template slot-scope="scope">
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data">{{$moment($moment.utc(scope.row.event_data.start_dt).format()).local().format('YYYY-MM-DD HH:mm:ss')}}</span>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="事件结束时间">
<template slot-scope="scope">
<div>
<span v-if="scope.row.event_cate == 'behavior'&&scope.row.event_data">{{$moment($moment.utc(scope.row.event_data.end_dt).format()).local().format('YYYY-MM-DD HH:mm:ss')}}</span>
</div>
</template>
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="操作"> label="操作">
...@@ -243,8 +182,10 @@ ...@@ -243,8 +182,10 @@
start_dt:start_dt, start_dt:start_dt,
end_dt:end_dt, end_dt:end_dt,
type: '', type: '',
source_type:'', task_id:'',
task_name:'' subtask_id:'',
location_code:'',
event_cate:'安防事件'
}, },
tableData:[], tableData:[],
formattterData:[], formattterData:[],
...@@ -253,8 +194,12 @@ ...@@ -253,8 +194,12 @@
pageSize:30, pageSize:30,
selectcheck:[], selectcheck:[],
currentIndex:0, currentIndex:0,
cateList:JSON.parse(window.localStorage.getItem('cate列表')),
eventList:JSON.parse(window.localStorage.getItem('安防事件')), eventList:JSON.parse(window.localStorage.getItem('安防事件')),
playurl:'' playurl:'',
taskList:[],
subTaskList:[],
tableHeight:window.twoSearchTableHeight,
} }
}, },
watch:{ watch:{
...@@ -267,19 +212,62 @@ ...@@ -267,19 +212,62 @@
videoDialog videoDialog
}, },
mounted(){ mounted(){
this.getTaskList();
this.getData() this.getData()
}, },
methods:{ methods:{
cateFormatter(row, column, cellValue, index){
let name=''
this.cateList.forEach(item=>{
if(item.code==cellValue){
name=item.name
}
})
return name;
},
getTaskList(){
this.$api.task.getTask({
source_type: "pull_video_stream",
task_type: "normal"
}).then(res=>{
this.taskList=res.list_data;
this.taskList.unshift({
task_id:'',
task_name:'全部'
})
})
},
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
}
})
},
cateChange(){
let name=this.conditions.event_cate;
this.type = '';
this.eventList = JSON.parse(window.localStorage.getItem(name));
},
exportFun(){ exportFun(){
window.open( let cate='';
encodeURI( if(this.conditions.event_cate!='安防事件'){
cate=this.conditions.event_cate
}
let url=
process.env.VUE_APP_URL+ process.env.VUE_APP_URL+
"/api/v1/behavior/events/export?s=" + Math.random()+ "/api/v1/behavior/events/export?s=" + Math.random()+
'&event_dt__gte='+ this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss') + '&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') + '&event_dt__lt='+this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
'&task_name='+this.conditions.task_name+ '&task_id='+this.conditions.task_id+
'&event_type='+this.conditions.type '&subtask_id='+this.conditions.subtask_id+
) '&location_code__like='+this.conditions.location_code ? this.conditions.location_code.replace(/\s\s*/g, '') : this.conditions.location_code+
'&event_type='+this.conditions.type+
'&event_cate='+cate;
window.open(
encodeURI(url)
); );
}, },
leftFun(){ leftFun(){
...@@ -329,11 +317,18 @@ ...@@ -329,11 +317,18 @@
let search_params = { let search_params = {
limit: this.pageSize, limit: this.pageSize,
offset: offset, offset: offset,
task_name: this.conditions.task_name ? this.conditions.task_name.replace(/\s\s*/g, '') : this.conditions.task_name, task_id:this.conditions.task_id,
subtask_id:this.conditions.subtask_id,
location_code__like: this.conditions.location_code ? this.conditions.location_code.replace(/\s\s*/g, '') : this.conditions.location_code,
event_type: this.conditions.type, event_type: this.conditions.type,
event_dt__gte: this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss'), 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') event_dt__lt:this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss')
} }
if(this.conditions.event_cate=="安防事件"){
search_params.event_cate='';
}else{
search_params.event_cate=this.conditions.event_cate;
}
this.$api.search.eventTableList(search_params this.$api.search.eventTableList(search_params
).then((res)=>{ ).then((res)=>{
this.total=res.total_num; this.total=res.total_num;
......
...@@ -2,29 +2,33 @@ ...@@ -2,29 +2,33 @@
<div class="innnerBox"> <div class="innnerBox">
<el-col :span="22"> <el-col :span="22">
<el-form ref="form" label-width="80px" inline> <el-form ref="form" label-width="80px" inline>
<el-form-item label="资源类型"> <el-form-item label="任务名称">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.source_type"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.task_id" @change="getSubTask">
<el-option value="pull_video_stream" label='拉取视频'></el-option> <el-option v-for='item in taskList' :value="item.task_id" :key="item.task_id" :label='item.task_name'></el-option>
<el-option value="pull_pic_files" label='拉取图片'></el-option> </el-select>
</el-select> </span>
</span> </el-form-item>
</el-form-item> <el-form-item label="视频名称">
<el-form-item label="相机名称" > <span class="selectBox">
<span class="inputBox"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.subtask_id">
<el-input placeholder="请输入相机名称" v-model="conditions.vchan_name"></el-input> <el-option v-for='item in subTaskList' :value="item.subtask_id" :key="item.subtask_id" :label='item.subtask_name'></el-option>
</span> </el-select>
</el-form-item> </span>
<el-form-item label="任务名称"> </el-form-item>
<span class="inputBox">
<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"> <span class="inputBox">
<el-input placeholder="请输入车牌号码" v-model="conditions.plate"></el-input> <el-input placeholder="请输入车牌号码" v-model="conditions.plate"></el-input>
</span> </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.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="车辆类型"> <el-form-item label="车辆类型">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_type" > <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_type" >
...@@ -33,7 +37,7 @@ ...@@ -33,7 +37,7 @@
</el-select> </el-select>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="车颜色"> <el-form-item label="车颜色">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_color"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_color">
<el-option value="" label='全部'></el-option> <el-option value="" label='全部'></el-option>
...@@ -41,25 +45,6 @@ ...@@ -41,25 +45,6 @@
</el-select> </el-select>
</span> </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.logo_type">
<el-option value="" label='全部'></el-option>
<el-option v-for='item in brandList' :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.marker">
<el-option value="" label='全部'></el-option>
<el-option value="0" label='年检标志'></el-option>
<el-option value="1" label='摆件'></el-option>
<el-option value="2" label='吊坠'></el-option>
<el-option value="3" label='遮阳板'></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="违法类型"> <el-form-item label="违法类型">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.illegal"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.illegal">
...@@ -68,14 +53,6 @@ ...@@ -68,14 +53,6 @@
</el-select> </el-select>
</span> </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.is_key_vehicle">
<el-option :value="false" label='否'></el-option>
<el-option :value="true" label='是'></el-option>
</el-select>
</span>
</el-form-item>
<el-form-item label="起始时间"> <el-form-item label="起始时间">
<span class="dateBox"> <span class="dateBox">
...@@ -95,7 +72,7 @@ ...@@ -95,7 +72,7 @@
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px;padding-top: 3px;">
<el-button type="primary" style="" @click="query" class="block">查询</el-button> <el-button type="primary" style="" @click="query" class="block">查询</el-button>
<el-button type="success" class="block" @click="exportFun">导出</el-button> <el-button type="success" class="block compatibleBtn" @click="exportFun">导出</el-button>
</div> </div>
<div> <div>
<el-button type="success" class="block" @click="batchdel">批量删除</el-button> <el-button type="success" class="block" @click="batchdel">批量删除</el-button>
...@@ -104,7 +81,7 @@ ...@@ -104,7 +81,7 @@
<div style=""> <div style="">
<el-table <el-table
:data="formattterData" :data="formattterData"
height="574" :height="tableHeight"
stripe stripe
border border
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
...@@ -277,16 +254,15 @@ ...@@ -277,16 +254,15 @@
conditions: { conditions: {
start_dt:start_dt, start_dt:start_dt,
end_dt:end_dt, end_dt:end_dt,
source_type: 'pull_video_stream', task_id:'',
marker: '', subtask_id:'',
plate:'',
plate_type:'',
car_type: '', car_type: '',
car_color: '', car_color: '',
logo_type: '', illegal:'all',
plate:'', source_type: 'pull_video_stream',
task_name:'', is_key_vehicle:false,
vchan_name:'',
illegal:'all',
is_key_vehicle:false,
}, },
brandList:this.$buildCode.getCodeList('车辆品牌'), brandList:this.$buildCode.getCodeList('车辆品牌'),
vehicleTypeList:this.$buildCode.getCodeList('车辆类型'), vehicleTypeList:this.$buildCode.getCodeList('车辆类型'),
...@@ -298,7 +274,10 @@ ...@@ -298,7 +274,10 @@
page:1, page:1,
pageSize:30, pageSize:30,
selectcheck:[], selectcheck:[],
currentIndex:0 currentIndex:0,
taskList:[],
subTaskList:[],
tableHeight:window.twoSearchTableHeight,
} }
}, },
watch:{ watch:{
...@@ -309,9 +288,31 @@ ...@@ -309,9 +288,31 @@
}, },
components:{}, components:{},
mounted(){ mounted(){
this.getTaskList();
this.getData() this.getData()
}, },
methods:{ methods:{
getTaskList(){
this.$api.task.getTask({
source_type: "pull_video_stream",
task_type: "normal"
}).then(res=>{
this.taskList=res.list_data;
this.taskList.unshift({
task_id:'',
task_name:'全部'
})
})
},
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
}
})
},
playFun(index,row){ playFun(index,row){
if(!row.video) { if(!row.video) {
return return
...@@ -328,13 +329,12 @@ ...@@ -328,13 +329,12 @@
'&event_type=&event_dt__gte='+this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss')+ '&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')+ '&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+ '&task_id='+this.conditions.task_id+
'&subtask_id='+this.conditions.subtask_id+
'&plate_number__like='+this.conditions.plate+
'&plate_type='+this.conditions.plate_type+
'&vehicle_type='+this.conditions.car_type+ '&vehicle_type='+this.conditions.car_type+
'&body_color='+this.conditions.car_color+ '&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+
'&is_key_vehicle='+this.conditions.is_key_vehicle+ '&is_key_vehicle='+this.conditions.is_key_vehicle+
'&illegal_code='+this.conditions.illegal)) '&illegal_code='+this.conditions.illegal))
}, },
...@@ -418,17 +418,16 @@ ...@@ -418,17 +418,16 @@
offset: offset, offset: offset,
event_dt__gte: this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss'), 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'), event_dt__lt:this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss'),
source_type: this.conditions.source_type, task_id:this.conditions.task_id,
vchan_name__like: this.conditions.vchan_name, subtask_id:this.conditions.subtask_id,
plate_number__like: this.conditions.plate,
plate_type:this.conditions.plate_type,
vehicle_type: this.conditions.car_type, vehicle_type: this.conditions.car_type,
body_color: this.conditions.car_color, body_color: this.conditions.car_color,
logo_type: this.conditions.logo_type,
plate_number__like: this.conditions.plate,
marker: this.conditions.marker,
illegal_code:this.conditions.illegal, illegal_code:this.conditions.illegal,
source_type: this.conditions.source_type,
is_key_vehicle:this.conditions.is_key_vehicle, is_key_vehicle:this.conditions.is_key_vehicle,
event_type: '', event_type: '',
task_name: this.conditions.task_name ? this.conditions.task_name.replace(/\s\s*/g, '') : this.conditions.task_name
} }
this.$api.search.tableList(search_params this.$api.search.tableList(search_params
).then((res)=>{ ).then((res)=>{
......
...@@ -2,16 +2,30 @@ ...@@ -2,16 +2,30 @@
<div class="innnerBox"> <div class="innnerBox">
<el-col :span="22"> <el-col :span="22">
<el-form ref="form" label-width="80px" inline> <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"> <span class="inputBox">
<el-input placeholder="请输入任务名称" v-model="conditions.location_name"></el-input> <el-input placeholder="请输入地点名称" v-model="conditions.location_name"></el-input>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="相机名称" > <el-form-item label="相机名称" >
<span class="inputBox"> <span class="inputBox">
<el-input placeholder="请输入相机名称" v-model="conditions.device_name"></el-input> <el-input placeholder="请输入相机名称" v-model="conditions.device_name"></el-input>
</span> </span>
</el-form-item> </el-form-item> -->
<el-form-item label="检测类型"> <el-form-item label="检测类型">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.detection_type"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.detection_type">
...@@ -49,13 +63,13 @@ ...@@ -49,13 +63,13 @@
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px;padding-top: 3px;">
<el-button type="primary" style="" @click="query" class="block">查询</el-button> <el-button type="primary" style="" @click="query" class="block">查询</el-button>
<el-button type="success" class="block" @click="exportFun">导出</el-button> <el-button type="success" class="block compatibleBtn" @click="exportFun">导出</el-button>
</div> </div>
</el-col> </el-col>
<div style=""> <div style="">
<el-table <el-table
:data="formattterData" :data="formattterData"
height="574" :height="tableHeight"
stripe stripe
border> border>
<el-table-column <el-table-column
...@@ -64,9 +78,9 @@ ...@@ -64,9 +78,9 @@
label="时间"> label="时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="device_name" prop="location_name"
align="center" align="center"
label="相机名称"> label="地点名称">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="detection_type" prop="detection_type"
...@@ -80,7 +94,7 @@ ...@@ -80,7 +94,7 @@
align="center" align="center"
label="车道"> label="车道">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
v-if="conditions.statistic_type =='device'" v-if="conditions.statistic_type =='device'"
prop="direction" prop="direction"
align="center" align="center"
...@@ -90,7 +104,7 @@ ...@@ -90,7 +104,7 @@
{{scope.row.direction == 1?"来向":(scope.row.direction == 2?"去向":"来向")}} {{scope.row.direction == 1?"来向":(scope.row.direction == 2?"去向":"来向")}}
</div> </div>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
align="center" align="center"
label="平均速度(km/h)"> label="平均速度(km/h)">
...@@ -169,8 +183,8 @@ ...@@ -169,8 +183,8 @@
conditions: { conditions: {
start_dt:start_dt, start_dt:start_dt,
end_dt:end_dt, end_dt:end_dt,
location_name: '', task_id: '',
device_name: '', subtask_id: '',
detection_type: '', detection_type: '',
statistic_type: 'road' statistic_type: 'road'
}, },
...@@ -178,6 +192,9 @@ ...@@ -178,6 +192,9 @@
total:0, total:0,
page:1, page:1,
pageSize:30, pageSize:30,
taskList:[],
subTaskList:[],
tableHeight:window.oneSearchTableHeight
} }
}, },
watch:{ watch:{
...@@ -188,9 +205,31 @@ ...@@ -188,9 +205,31 @@
}, },
components:{}, components:{},
mounted(){ mounted(){
this.getData() this.getData();
this.getTaskList();
}, },
methods:{ methods:{
getTaskList(){
this.$api.task.getTask({
source_type: "pull_video_stream",
task_type: "normal"
}).then(res=>{
this.taskList=res.list_data;
this.taskList.unshift({
task_id:'',
task_name:'全部'
})
})
},
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
}
})
},
typeFormatter(row, column, cellValue, index){ typeFormatter(row, column, cellValue, index){
let codename = ''; let codename = '';
switch(cellValue){ switch(cellValue){
...@@ -216,8 +255,8 @@ ...@@ -216,8 +255,8 @@
process.env.VUE_APP_URL + '/api/v1/traffic/flow/statistics/export?s=' + Math.random()+ process.env.VUE_APP_URL + '/api/v1/traffic/flow/statistics/export?s=' + Math.random()+
'&event_type=&event_dt__gte='+this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss')+ '&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')+ '&event_dt__lt='+this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss')+
'&location_name='+this.conditions.location_name+ '&task_id='+this.conditions.task_id+
'&device_name='+this.conditions.device_name+ '&subtask_id='+this.conditions.subtask_id+
'&statistic_type='+this.conditions.statistic_type '&statistic_type='+this.conditions.statistic_type
)) ))
}, },
...@@ -240,8 +279,8 @@ ...@@ -240,8 +279,8 @@
offset: offset, offset: offset,
event_dt__gte: this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss'), 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'), event_dt__lt:this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss'),
location_name: this.conditions.location_name, task_id: this.conditions.task_id,
device_name: this.conditions.device_name, subtask_id: this.conditions.subtask_id,
detection_type: this.conditions.detection_type, detection_type: this.conditions.detection_type,
statistic_type: this.conditions.statistic_type statistic_type: this.conditions.statistic_type
} }
......
...@@ -2,29 +2,42 @@ ...@@ -2,29 +2,42 @@
<div class="innnerBox"> <div class="innnerBox">
<el-col :span="22"> <el-col :span="22">
<el-form ref="form" label-width="80px" inline> <el-form ref="form" label-width="80px" inline>
<el-form-item label="资源类型"> <!-- <el-form-item label="资源类型">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.source_type"> <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_video_stream" label='拉取视频'></el-option>
<el-option value="pull_pic_files" label='拉取图片'></el-option> <el-option value="pull_pic_files" label='拉取图片'></el-option>
</el-select> </el-select>
</span> </span>
</el-form-item> </el-form-item> -->
<el-form-item label="相机名称" > <el-form-item label="任务名称">
<span class="inputBox"> <span class="selectBox">
<el-input placeholder="请输入相机名称" v-model="conditions.vchan_name"></el-input> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.task_id" @change="getSubTask">
</span> <el-option v-for='item in taskList' :value="item.task_id" :key="item.task_id" :label='item.task_name'></el-option>
</el-form-item> </el-select>
<el-form-item label="任务名称"> </span>
<span class="inputBox"> </el-form-item>
<el-input placeholder="请输入任务名称" v-model="conditions.task_name"></el-input> <el-form-item label="视频名称">
</span> <span class="selectBox">
</el-form-item> <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="车牌号码"> <el-form-item label="车牌号码">
<span class="inputBox"> <span class="inputBox">
<el-input placeholder="请输入车牌号码" v-model="conditions.plate"></el-input> <el-input placeholder="请输入车牌号码" v-model="conditions.plate"></el-input>
</span> </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.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="车辆类型"> <el-form-item label="车辆类型">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_type" > <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_type" >
...@@ -33,7 +46,7 @@ ...@@ -33,7 +46,7 @@
</el-select> </el-select>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="车颜色"> <el-form-item label="车颜色">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_color"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.car_color">
<el-option value="" label='全部'></el-option> <el-option value="" label='全部'></el-option>
...@@ -41,15 +54,15 @@ ...@@ -41,15 +54,15 @@
</el-select> </el-select>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="车辆品牌"> <!-- <el-form-item label="车辆品牌">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.logo_type"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.logo_type">
<el-option value="" label='全部'></el-option> <el-option value="" label='全部'></el-option>
<el-option v-for='item in brandList' :value="item.code" :key="item.code" :label='item.name'></el-option> <el-option v-for='item in brandList' :value="item.code" :key="item.code" :label='item.name'></el-option>
</el-select> </el-select>
</span> </span>
</el-form-item> </el-form-item> -->
<el-form-item label="标志物"> <!-- <el-form-item label="标志物">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.marker"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.marker">
<el-option value="" label='全部'></el-option> <el-option value="" label='全部'></el-option>
...@@ -59,7 +72,7 @@ ...@@ -59,7 +72,7 @@
<el-option value="3" label='遮阳板'></el-option> <el-option value="3" label='遮阳板'></el-option>
</el-select> </el-select>
</span> </span>
</el-form-item> </el-form-item> -->
<el-form-item label="特殊车辆"> <el-form-item label="特殊车辆">
<span class="selectBox"> <span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.special_type"> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.special_type">
...@@ -89,7 +102,7 @@ ...@@ -89,7 +102,7 @@
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px;padding-top: 3px;">
<el-button type="primary" style="" @click="query" class="block">查询</el-button> <el-button type="primary" style="" @click="query" class="block">查询</el-button>
<el-button type="success" class="block" @click="exportFun">导出</el-button> <el-button type="success" class="block compatibleBtn" @click="exportFun">导出</el-button>
</div> </div>
<div> <div>
<el-button type="success" class="block" @click="batchdel">批量删除</el-button> <el-button type="success" class="block" @click="batchdel">批量删除</el-button>
...@@ -98,7 +111,7 @@ ...@@ -98,7 +111,7 @@
<div style=""> <div style="">
<el-table <el-table
:data="formattterData" :data="formattterData"
height="574" :height="tableHeight"
stripe stripe
border border
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
...@@ -112,26 +125,31 @@ ...@@ -112,26 +125,31 @@
align="center" align="center"
label="车牌号码"> label="车牌号码">
</el-table-column> </el-table-column>
<el-table-column
prop="vehicle_body_type_text"
align="center"
label="车牌类型">
</el-table-column>
<el-table-column <el-table-column
prop="vehicle_body_type_text" prop="vehicle_body_type_text"
align="center" align="center"
label="车辆类型"> label="车辆类型">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
prop="vehicle_body_logo_text" prop="vehicle_body_logo_text"
align="center" align="center"
label="车辆品牌"> label="车辆品牌">
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
prop="vehicle_body_color_text" prop="vehicle_body_color_text"
align="center" align="center"
label="车颜色"> label="车颜色">
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
prop="RefinedFeature_text" prop="RefinedFeature_text"
align="center" align="center"
label="标识物"> label="标识物">
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
prop="special_text" prop="special_text"
align="center" align="center"
...@@ -260,14 +278,15 @@ ...@@ -260,14 +278,15 @@
start_dt:start_dt, start_dt:start_dt,
end_dt:end_dt, end_dt:end_dt,
source_type: 'pull_video_stream', source_type: 'pull_video_stream',
plate_type:'',
marker: '', marker: '',
car_type: '', car_type: '',
car_color: '', car_color: '',
logo_type: '', logo_type: '',
plate:'', plate:'',
task_name:'', task_id:'',
curdelid:'', curdelid:'',
vchan_name:'', subtask_name:'',
special_type:'' special_type:''
}, },
brandList:this.$buildCode.getCodeList('车辆品牌'), brandList:this.$buildCode.getCodeList('车辆品牌'),
...@@ -279,7 +298,10 @@ ...@@ -279,7 +298,10 @@
page:1, page:1,
pageSize:30, pageSize:30,
selectcheck:[], selectcheck:[],
currentIndex:0 currentIndex:0,
taskList:[],
subTaskList:[],
tableHeight:window.twoSearchTableHeight,
} }
}, },
watch:{ watch:{
...@@ -291,10 +313,32 @@ ...@@ -291,10 +313,32 @@
components:{}, components:{},
mounted(){ mounted(){
this.getData() this.getData()
this.getTaskList();
}, },
methods:{ methods:{
getTaskList(){
this.$api.task.getTask({
source_type: "pull_video_stream",
task_type: "normal"
}).then(res=>{
this.taskList=res.list_data;
this.taskList.unshift({
task_id:'',
task_name:'全部'
})
})
},
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
}
})
},
exportFun(){ 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')+'&subtask_name='+this.conditions.subtask_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_id='+this.conditions.task_id+'&special_type='+this.conditions.special_type))
}, },
batchdel(){ batchdel(){
if(this.selectcheck.length==0){ if(this.selectcheck.length==0){
...@@ -376,16 +420,17 @@ ...@@ -376,16 +420,17 @@
offset: offset, offset: offset,
event_dt__gte: this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss'), 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'), 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, subtask_name: this.conditions.subtask_name,
vehicle_type: this.conditions.car_type, vehicle_type: this.conditions.car_type,
body_color: this.conditions.car_color, body_color: this.conditions.car_color,
logo_type: this.conditions.logo_type, logo_type: this.conditions.logo_type,
plate_number__like: this.conditions.plate, plate_number__like: this.conditions.plate,
marker: this.conditions.marker, // marker: this.conditions.marker,
plate_type: this.conditions.plate_type,
event_type: '', event_type: '',
special_type:this.conditions.special_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 task_id: this.conditions.task_id
} }
this.$api.search.tableList(search_params this.$api.search.tableList(search_params
).then((res)=>{ ).then((res)=>{
......
...@@ -2,25 +2,89 @@ ...@@ -2,25 +2,89 @@
<div class="innnerBox"> <div class="innnerBox">
<el-col :span="22"> <el-col :span="22">
<el-form ref="form" label-width="80px" inline> <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"> <span class="inputBox">
<el-input placeholder="请输入抓拍地点" v-model="conditions.location_name"></el-input> <el-input placeholder="请输入抓拍地点" v-model="conditions.location_name"></el-input>
</span> </span>
</el-form-item> </el-form-item> -->
<el-form-item label="任务名称"> <el-form-item label="检索对象">
<span class="inputBox"> <span class="selectBox">
<el-input placeholder="请输入任务名称" v-model="conditions.task_name"></el-input> <el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.event_type" @change="typeChange">
</span> <el-option value="xcycle" label="非机动车"></el-option>
</el-form-item> <el-option value="pedestrian" label="行人"></el-option>
<el-form-item label="非机动车类型" label-width="110px" > </el-select>
</span>
</el-form-item>
<el-form-item label="对象类型" >
<span class="selectBox"> <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.xcycle_type">
<el-option value="" label='全部'></el-option> <el-option value="" label='全部'></el-option>
<el-option value="motorcycle" label="摩托车"></el-option> <el-option value="motorcycle" label="摩托车" v-show="conditions.event_type == 'xcycle'"></el-option>
<el-option value="bicycle" label="自行车"></el-option> <el-option value="bicycle" label="自行车" v-show="conditions.event_type == 'xcycle'"></el-option>
<el-option value="tricycle" label="三轮车"></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.company"></el-input>
</span>
</el-form-item>
<el-form-item label="是否带盔">
<span class="selectBox">
<el-select placeholder="请选择" :popper-append-to-body=false v-model="conditions.with_hats">
<el-option value="" label='全部'></el-option>
<el-option :value="0" :key="0" label='不确定'></el-option>
<el-option :value="1" :key="1" label='带盔'></el-option>
<el-option :value="2" :key="2" 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.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 v-for='item in bodyColorList' :value="item.value" :key="item.value" :label='item.label'></el-option>
</el-select> </el-select>
</span> </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>
<el-form-item label="起始时间"> <el-form-item label="起始时间">
<span class="dateBox"> <span class="dateBox">
...@@ -40,7 +104,7 @@ ...@@ -40,7 +104,7 @@
<el-col :span="2"> <el-col :span="2">
<div style="margin-bottom: 6px;padding-top: 3px;"> <div style="margin-bottom: 6px;padding-top: 3px;">
<el-button type="primary" style="" @click="query" class="block">查询</el-button> <el-button type="primary" style="" @click="query" class="block">查询</el-button>
<el-button type="success" class="block" @click="exportFun">导出</el-button> <el-button type="success" class="block compatibleBtn" @click="exportFun">导出</el-button>
</div> </div>
<div> <div>
<el-button type="success" class="block" @click="batchdel">批量删除</el-button> <el-button type="success" class="block" @click="batchdel">批量删除</el-button>
...@@ -49,7 +113,7 @@ ...@@ -49,7 +113,7 @@
<div style=""> <div style="">
<el-table <el-table
:data="formattterData" :data="formattterData"
height="574" :height="tableHeight"
stripe stripe
border border
@selection-change="handleSelectionChange"> @selection-change="handleSelectionChange">
...@@ -61,31 +125,41 @@ ...@@ -61,31 +125,41 @@
<el-table-column <el-table-column
prop="xcycle_type_text" prop="xcycle_type_text"
align="center" align="center"
label="非机动车类型 "> label="检测类型">
</el-table-column> </el-table-column>
<el-table-column
prop="driver_face_sex"
align="center"
label="性别">
</el-table-column>
<el-table-column
prop="driver_face_with_hats"
align="center"
label="是否带盔">
</el-table-column>
<el-table-column
prop="xcycle_plate_text"
align="center"
label="车牌号码">
</el-table-column>
<el-table-column <el-table-column
prop="xcycle_plate_text" prop="company"
align="center" align="center"
label="车牌号码 "> label="运营公司">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="shoot_date" prop="shoot_date"
align="center" align="center"
label="抓拍时间"> label="抓拍时间">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.shoot_date}} {{scope.row.shoot_time}}</span> <span>{{scope.row.shoot_date}} {{scope.row.shoot_time}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="location_name" prop="location_name"
align="center" align="center"
label="抓拍地点"> label="抓拍地点">
</el-table-column> </el-table-column>
<el-table-column
prop="company"
align="center"
label="运营公司 ">
</el-table-column>
<el-table-column <el-table-column
align="center" align="center"
label="操作"> label="操作">
...@@ -131,12 +205,12 @@ ...@@ -131,12 +205,12 @@
</el-image> </el-image>
<el-form label-width="120px" inline> <el-form label-width="120px" inline>
<div> <div>
<el-form-item label="车牌号码:"> <el-form-item label="检测类型:">
<span>{{ detailObj.xcycle_plate_text }}</span>
</el-form-item>
<el-form-item label="非机动车类型:">
<span>{{ detailObj.xcycle_type_text }}</span> <span>{{ detailObj.xcycle_type_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="经过地点:">
<span>{{ detailObj.location_name }}</span>
</el-form-item>
</div> </div>
<div> <div>
<el-form-item label="经过日期:"> <el-form-item label="经过日期:">
...@@ -147,11 +221,12 @@ ...@@ -147,11 +221,12 @@
</el-form-item> </el-form-item>
</div> </div>
<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>
<el-form-item label="车辆颜色:"> <el-form-item label="速度:">
<span>{{ detailObj.xcycle_color_type }}</span> <span>{{ detailObj.location_speed }}</span>
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
...@@ -166,8 +241,8 @@ ...@@ -166,8 +241,8 @@
<el-form-item label="上身颜色:"> <el-form-item label="上身颜色:">
<span>{{ detailObj.driver_face_upbody_text }}</span> <span>{{ detailObj.driver_face_upbody_text }}</span>
</el-form-item> </el-form-item>
<el-form-item label="速度:"> <el-form-item label="下身颜色:">
<span>{{ detailObj.location_speed }}</span> <span>{{ detailObj.driver_face_lobody_text }}</span>
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
...@@ -197,6 +272,7 @@ ...@@ -197,6 +272,7 @@
return{ return{
detailObj:{}, detailObj:{},
carImg:require("@/assets/img/home/defaultImg.png"), carImg:require("@/assets/img/home/defaultImg.png"),
bodyColorList:this.$buildCode.getCodeList('车身颜色'),
detailImg:'', detailImg:'',
detailVisible:false, detailVisible:false,
dates:[ start_dt,end_dt ], dates:[ start_dt,end_dt ],
...@@ -204,9 +280,13 @@ ...@@ -204,9 +280,13 @@
start_dt:start_dt, start_dt:start_dt,
end_dt:end_dt, end_dt:end_dt,
event_type: 'xcycle', event_type: 'xcycle',
subtask_id:null,
task_id:null,
xcycle_type:'', xcycle_type:'',
location_name:'', sex:'',
task_name:'' company:'',
with_hats:'',
plate:''
}, },
brandList:this.$buildCode.getCodeList('车辆品牌'), brandList:this.$buildCode.getCodeList('车辆品牌'),
vehicleTypeList:this.$buildCode.getCodeList('车辆类型'), vehicleTypeList:this.$buildCode.getCodeList('车辆类型'),
...@@ -217,7 +297,10 @@ ...@@ -217,7 +297,10 @@
page:1, page:1,
pageSize:30, pageSize:30,
selectcheck:[], selectcheck:[],
currentIndex:0 currentIndex:0,
taskList:[],
subTaskList:[],
tableHeight:window.twoSearchTableHeight,
} }
}, },
watch:{ watch:{
...@@ -228,26 +311,85 @@ ...@@ -228,26 +311,85 @@
}, },
components:{}, components:{},
mounted(){ mounted(){
this.getTaskList();
this.getData() this.getData()
}, },
methods:{ methods:{
getTaskList(){
this.$api.task.getTask({
source_type: "pull_video_stream",
task_type: "normal"
}).then(res=>{
this.taskList=res.list_data;
this.taskList.unshift({
task_id:'',
task_name:'全部'
})
})
},
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(){ exportFun(){
window.open( let url='';
encodeURI( if(this.conditions.event_type=='xcycle'){
process.env.VUE_APP_URL+ url = process.env.VUE_APP_URL+
"/api/v1/traffic/events/export?s=" + "/api/v1/traffic/events/export?s=" +
Math.random() + 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') + this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
"&event_dt__lt=" + "&event_dt__lt=" +
this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss') + this.$moment(this.conditions.end_dt).utc().format('YYYY-MM-DD HH:mm:ss') +
"&xcycle_type=" + "&xcycle_type=" +
this.conditions.xcycle_type + this.conditions.xcycle_type +
"&location_name=" + "&sex=" +
this.conditions.location_name + this.conditions.sex +
"&task_name=" + "&task_id=" +
this.conditions.task_name this.conditions.task_id +
) "&subtask_id=" +
this.conditions.subtask_id +
"&company_like=" +
this.conditions.company +
"&with_hats=" +
this.conditions.with_hats +
"&plate_number__like=" +
this.conditions.plate
}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 +
"&with_hats=" +
this.conditions.with_hats +
"&plate_number__like=" +
this.conditions.plate
}
window.open(
encodeURI(url)
); );
}, },
batchdel(){ batchdel(){
...@@ -330,10 +472,16 @@ ...@@ -330,10 +472,16 @@
offset: offset, offset: offset,
event_dt__gte: this.$moment(this.conditions.start_dt).utc().format('YYYY-MM-DD HH:mm:ss'), 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'), 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, task_id: this.conditions.task_id,
event_type: "xcycle", subtask_id: this.conditions.subtask_id,
xcycle_type: this.conditions.xcycle_type, event_type: this.conditions.event_type,
location_name: this.conditions.location_name sex: this.conditions.sex,
company_like:this.conditions.company,
with_hats: this.conditions.with_hats,
plate_number__like: this.conditions.plate
}
if( this.conditions.event_type=='xcycle'){
search_params.xcycle_type=this.conditions.xcycle_type;
} }
this.$api.search.tableList(search_params this.$api.search.tableList(search_params
).then((res)=>{ ).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 \ 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!