Commit 07463a28 by 潘建波

稳定版本保存

1 parent 97a3bd35
Showing 67 changed files with 1511 additions and 783 deletions
No preview for this file type
No preview for this file type
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"moment": "^2.24.0", "moment": "^2.24.0",
"ol": "^6.1.1", "ol": "^6.1.1",
"particles.js": "^2.0.0", "particles.js": "^2.0.0",
"rimraf": "^3.0.2",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.0.1" "vuex": "^3.0.1"
......
...@@ -114,17 +114,27 @@ ...@@ -114,17 +114,27 @@
//加载参数树 //加载参数树
function loadParameterTree(xmlK, xmlV) { function loadParameterTree(xmlK, xmlV) {
let xmlValue = $.parseXML(xmlV) let xmlValue = "";
let xmlKey = "";
try {
xmlValue = $.parseXML(xmlV)
edit_xml = xmlValue; edit_xml = xmlValue;
console.log(edit_xml)
let xmlKey = $.parseXML(xmlK); } catch (error) {
console.log(xmlKey) console.error("baseconfig,xml结构解析失败请检查格式是否正确")
console.log(xmlValue) console.log("basXML",xmlV)
}
try {
xmlKey = $.parseXML(xmlK);
} catch (error) {
console.error("config,xml结构解析失败请检查格式是否正确")
console.log("configxml",xmlV)
}
let jsonData = convertXmlToJson(xmlKey, xmlValue); let jsonData = convertXmlToJson(xmlKey, xmlValue);
window.xmlStr = ""; //XMLtoString(jsonData); window.xmlStr = ""; //XMLtoString(jsonData);
$('.datagrid-body').html('') $('.datagrid-body').html('')
$("#ptree").tree("loadData", jsonData); $("#ptree").tree("loadData", jsonData);
// var url = "/do/trafficController/configVal?t=" + new Date().getTime(); // var url = "/do/trafficController/configVal?t=" + new Date().getTime();
// var dataUrl = "/do/trafficController/configKey?t=" + new Date().getTime(); // var dataUrl = "/do/trafficController/configKey?t=" + new Date().getTime();
// if (isDebug) { // if (isDebug) {
......
{"version":"2.0.2","Info":"��ɶ","Bug":"��ɶ","date":"2020-05-07T05:51:19.187Z"}
\ No newline at end of file \ No newline at end of file
{"version":"2.0.3","Info":"ɶ�ط�","Bug":"ɶ�ط�","date":"2020-05-07T02:48:19.951Z"}
\ No newline at end of file \ No newline at end of file
...@@ -16,7 +16,7 @@ export default { ...@@ -16,7 +16,7 @@ export default {
} }
let token = localStorage.getItem("atoken"); let token = localStorage.getItem("atoken");
if (!token) { if (!token) {
this.$router.push("/login"); this.$router.push("/login").catch(err => {err});
} }
}, },
mounted() { mounted() {
......
...@@ -43,7 +43,7 @@ service.interceptors.request.use( ...@@ -43,7 +43,7 @@ service.interceptors.request.use(
config.headers.authorization = atoken; config.headers.authorization = atoken;
} }
} else { } else {
router.push("/login"); router.push("/login").catch(err => {err});
// endLoading(); // endLoading();
} }
if (config.method == "get") { if (config.method == "get") {
......
...@@ -3,7 +3,9 @@ import axios from "axios"; ...@@ -3,7 +3,9 @@ import axios from "axios";
console.log(process.env.NODE_ENV); console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = "http://192.168.9.233:20080"; // 测试环境url baseUrl = "http://192.168.9.233:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510'; // baseUrl = 'http://vion-panda.51vip.biz:52510';
break; break;
......
...@@ -16,6 +16,6 @@ export default { ...@@ -16,6 +16,6 @@ export default {
return `${baseUrl}/api/v1/codes/traffic/cates/${cate_unid}/codes`; return `${baseUrl}/api/v1/codes/traffic/cates/${cate_unid}/codes`;
}, },
editTrafficCode(cate_unid, code_unid) { editTrafficCode(cate_unid, code_unid) {
return `${baseUrl}/api/v1/codes/traffic/cates/${cate_unid}}/codes/${code_unid}`; return `${baseUrl}/api/v1/codes/traffic/cates/${cate_unid}/codes/${code_unid}`;
} }
}; };
...@@ -32,12 +32,18 @@ export default { ...@@ -32,12 +32,18 @@ export default {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}/vchans/${refid}`); //获取分析流 return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}/vchans/${refid}`); //获取分析流
}, },
sipSet(devid, userid) { sipSet(devid, userid) {
return api.get(`${baseUrl}/devconf_fx/devs/${devid}/${userid}/sip_server`); return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devid}/${userid}/sip_server`);
}, },
getStore(params) { getStore(params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params); return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params);
}, },
getFreelist(dev_unid, params) { getFreelist(dev_unid, params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${dev_unid}/fx_devs/free`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${dev_unid}/fx_devs/free`, params);
},
getDevStatus(dev_unid, params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${dev_unid}/status`, params);
},
getSubTaskStatus() {
return api.get(`${baseUrl}/api/v1/devconf_fx/tasks/subtasks/status`);
} }
}; };
import api from "../index"; import api from "../index";
import baseUrl from "../baseUrl"; import baseUrl from "../baseUrl";
export default { export default {
devs(params){ devs(params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs`, params);
}, },
treeList(params,id) { treeList(params, id) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchan_struct`, params) return api.get(
}, `${baseUrl}/api/v1/devconf_fx/devs/${id}/vchan_struct`,
getVideoList(params,id) { params
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params) );
}, },
addCode(params,id) { getVideoList(params, id) {
return api.post(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params);
}, },
addNode(params,id){ addCode(params, id) {
return api.post(`${baseUrl}/api/v1/org`, params) return api.post(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes`, params);
}, },
getCode(params,id){ addNode(params, id) {
return api.get(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes`, params) return api.post(`${baseUrl}/api/v1/org`, params);
}, },
editCode(params,id,unid){ getCode(params, id) {
return api.post(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes/${unid}`, params) return api.get(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes`, params);
}, },
delCode(params,id,unid){ editCode(params, id, unid) {
return api.delete(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes/${unid}`, params) return api.post(
}, `${baseUrl}/api/v1/codes/custom/cates/${id}/codes/${unid}`,
delOrg(params,id){ params
return api.delete(`${baseUrl}/api/v1/org/${id}`, params) );
}, },
delCamera(params,id,id2){ delCode(params, id, unid) {
return api.delete(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params) return api.delete(
}, `${baseUrl}/api/v1/codes/custom/cates/${id}/codes/${unid}`,
getCameraTable(params,id,id2){ params
console.log(id2) );
if(id2){ },
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params) delOrg(params, id) {
}else{ return api.delete(`${baseUrl}/api/v1/org/${id}`, params);
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params) },
} delCamera(params, id, id2) {
}, return api.delete(
editVideo(params,id,id2){ `${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`,
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params) params
}, );
delVideo(params,id,id2){ },
return api.delete(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params) getCameraTable(params, id, id2) {
}, console.log(id2);
addCamera(params,id){ if (id2) {
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params) return api.get(
}, `${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`,
editCamera(params,id,id2){ params
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params) );
}, } else {
uploadFile(params,id){ return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params);
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vfile_vchans`, params,{'Content-Type': 'multipart/form-data'}) }
}, },
editVideo(params, id, id2) {
return api.post(
`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`,
params
);
},
delVideo(params, id, id2) {
return api.delete(
`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`,
params
);
},
addCamera(params, id) {
return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params);
},
editCamera(params, id, id2) {
return api.post(
`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`,
params
);
},
uploadFile(params, id) {
return api.post(
`${baseUrl}/api/v1/devconf_fx/devs/${id}/vfile_vchans`,
params,
{ "Content-Type": "multipart/form-data" }
);
},
getResource(params, id) { getResource(params, id) {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/status`, params); return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/status`, params);
......
...@@ -293,4 +293,7 @@ body{ ...@@ -293,4 +293,7 @@ body{
} }
.el-submenu__title{ .el-submenu__title{
font-size: 15px; font-size: 15px;
}
.el-table--small td, .el-table--small th {
height: 55px;
} }
\ No newline at end of file \ No newline at end of file
...@@ -152,6 +152,7 @@ class Codes { ...@@ -152,6 +152,7 @@ class Codes {
} }
// 违法类型 // 违法类型
try { try {
this.result.illegalTypestate = parseInt(this.allData.event_data.illegal.state);
this.result.illegalType = this.result.illegalType =
parseInt(this.allData.event_data.illegal.state) === 1 parseInt(this.allData.event_data.illegal.state) === 1
? this.getCode("违法类型", this.allData.event_data.illegal.code) ? this.getCode("违法类型", this.allData.event_data.illegal.code)
......
module.exports = {
data(){
return {
workers: {
video_free: 0,
video_busy: 0
},
dev_unid: localStorage.getItem("dev_unid"),
taskstatus:{
running: 0,
total: 0
}
}
},
methods: {
getDevStatus() {
this.$api.device.getDevStatus(this.dev_unid).then(res => {
if (res.ecode != 500) {
this.workers = res.works;
} else {
this.$message({
type: "error",
message: res.enote
});
}
});
},
getSubTaskStatus() {
this.$api.device.getSubTaskStatus().then(res => {
if (res.ecode != 500) {
this.taskstatus = res;
} else {
this.$message({
type: "error",
message: res.enote
});
}
});
}
},
created() {
this.getSubTaskStatus();
this.getDevStatus();
}
}
\ No newline at end of file \ No newline at end of file
...@@ -20,14 +20,12 @@ Vue.prototype.$moment = moment; ...@@ -20,14 +20,12 @@ Vue.prototype.$moment = moment;
Vue.prototype.$buildCode = buildCode; Vue.prototype.$buildCode = buildCode;
Vue.prototype.oParse = new XML.ObjTree(); Vue.prototype.oParse = new XML.ObjTree();
Vue.prototype.axios = axios; Vue.prototype.axios = axios;
// import VueParticles from "vue-particles"; // import VueParticles from "vue-particles";
// Vue.use(VueParticles); // Vue.use(VueParticles);
Vue.use(api); Vue.use(api);
Vue.use(ElementUI, { size: "small", zIndex: 3000 }); Vue.use(ElementUI, { size: "small", zIndex: 3000 });
Vue.use(resetCss); Vue.use(resetCss);
Vue.config.productionTip = false; Vue.config.productionTip = false;
new Vue({ new Vue({
router, router,
...@@ -38,3 +36,4 @@ new Vue({ ...@@ -38,3 +36,4 @@ new Vue({
// window.onunload = function() { // window.onunload = function() {
// localStorage.clear(); // localStorage.clear();
// }; // };
...@@ -127,7 +127,7 @@ export default { ...@@ -127,7 +127,7 @@ export default {
localStorage.removeItem("curmenu"); localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, ""); this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atoken"); localStorage.removeItem("atoken");
this.$router.push("/login"); this.$router.push("/login").catch(err => {err});
} }
}, },
created() { created() {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
:unique-opened="true" :unique-opened="true"
wdth="116vw" wdth="116vw"
> >
<el-submenu index="1" class="menu-icon"> <!-- <el-submenu index="1" class="menu-icon">
<template slot="title"> <template slot="title">
<i class="icon-fanxing-iconxuanzhongshouye1"></i> <i class="icon-fanxing-iconxuanzhongshouye1"></i>
<span slot="title">态势总览</span> <span slot="title">态势总览</span>
...@@ -16,17 +16,26 @@ ...@@ -16,17 +16,26 @@
<el-menu-item index="/trficcshow"> <el-menu-item index="/trficcshow">
<i class="submenuicon"></i>交通展示 <i class="submenuicon"></i>交通展示
</el-menu-item> </el-menu-item>
<!-- <el-menu-item index="/behaviorshow"> <el-menu-item index="/behaviorshow">
<i class="submenuicon"></i>综治展示 <i class="submenuicon"></i>综治展示
</el-menu-item> --> </el-menu-item>
</el-submenu> </el-submenu> -->
<el-submenu v-for="(fristmenu,index) in permission_routers" :index="fristmenu.path" :key="index" class="menu-icon"> <el-submenu
v-for="(fristmenu, index) in permission_routers"
:index="fristmenu.path"
:key="index"
class="menu-icon"
>
<template slot="title"> <template slot="title">
<i :class="fristmenu.meta.icon"></i> <i :class="fristmenu.meta.icon"></i>
<span slot="title">{{fristmenu.name}}</span> <span slot="title">{{ fristmenu.name }}</span>
</template> </template>
<el-menu-item v-for="(twomenu,index) in fristmenu.children" :key="index" :index="twomenu.path"> <el-menu-item
<i class="submenuicon"></i>{{twomenu.name}} v-for="(twomenu, index) in fristmenu.children"
:key="index"
:index="twomenu.path"
>
<i class="submenuicon"></i>{{ twomenu.name }}
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
</el-menu> </el-menu>
...@@ -42,12 +51,14 @@ export default { ...@@ -42,12 +51,14 @@ export default {
full: false, full: false,
isCollapse: false, isCollapse: false,
activemenu: "/indexshow", activemenu: "/indexshow",
topbar:[] topbar: []
}; };
}, },
methods: { methods: {
handleSelect(key, keyPath) { handleSelect(key, keyPath) {
this.$router.push(key); this.$router.push(key).catch(err => {
err;
});
localStorage.setItem("curmenu", key); localStorage.setItem("curmenu", key);
this.activemenu = key; this.activemenu = key;
}, },
...@@ -60,24 +71,27 @@ export default { ...@@ -60,24 +71,27 @@ export default {
}, },
created() { created() {
// let activemenu = localStorage.getItem("curmenu"); // let activemenu = localStorage.getItem("curmenu");
let activemenu = location.href.split('#')[1]; let activemenu = location.href.split("#")[1];
if (activemenu) { if (activemenu) {
this.activemenu = activemenu; this.activemenu = activemenu;
this.$router.push(activemenu); this.$router.push(activemenu).catch(err => {
err;
});
} else { } else {
this.$router.push("/"); this.$router.push("/").catch(err => {
this.activemenu = '/'; err;
});
this.activemenu = "/";
} }
}, },
watch:{ watch: {
$route(t, f){ $route(t, f) {
console.log('to',t)
let obj = { let obj = {
name:t.name, name: t.name,
path:t.path, path: t.path
// icon:t.meta.icon // icon:t.meta.icon
} };
this.$emit("setTopBar",obj) this.$emit("setTopBar", obj);
} }
} }
}; };
...@@ -108,4 +122,4 @@ export default { ...@@ -108,4 +122,4 @@ export default {
margin-right 10px; margin-right 10px;
padding-right:0px; padding-right:0px;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -145,7 +145,7 @@ export default { ...@@ -145,7 +145,7 @@ export default {
this.$store this.$store
.dispatch("GetMenuRole", res.menu_tree[0].children) .dispatch("GetMenuRole", res.menu_tree[0].children)
.then(res => { .then(res => {
this.$router.push("/trficcshow"); this.$router.push("/video_task/config").catch(err => {err});
}); });
}); });
}, },
...@@ -357,12 +357,15 @@ h1 { ...@@ -357,12 +357,15 @@ h1 {
outline: none; outline: none;
box-shadow: none; box-shadow: none;
} }
.box { .box {
width: 25%; width: 25%;
position: absolute; position: absolute;
left: 52%; left: 52%;
top: 20%; top: 20%;
} }
button { button {
width: 100%; width: 100%;
margin-top: 40px; margin-top: 40px;
......
<template> <template>
<div class> <div class>
<el-header class="headers"> <el-header class="headers">
<span class="title">分析展示</span> <span class="title">分析展示</span>
</el-header> </el-header>
<el-container style="min-height:calc(100vh - 64px);" class="showbox"> <el-container style="min-height:calc(100vh - 64px);" class="showbox">
<el-main style="padding: 12px;overflow:hidden"> <el-main style="padding: 12px;overflow:hidden">
...@@ -129,17 +129,15 @@ export default { ...@@ -129,17 +129,15 @@ export default {
}; };
}, },
created() { created() {
let url = location.href; let url = location.href;
let params = url.split("?")[1]; let params = url.split("?")[1];
this.taskid = this.getQueryVariable("taskid"); this.taskid = this.getQueryVariable("taskid");
this.subtaskid = this.getQueryVariable("subtaskid"); this.subtaskid = this.getQueryVariable("subtaskid");
this.playurl = this.getQueryVariable("playurl"); this.playurl = this.getQueryVariable("playurl");
}, },
mounted() { mounted() {
this.$refs.videoplay.videoPlay();
this.$refs.videoplay.videoPlay();
}, },
components: { components: {
videoplay videoplay
...@@ -181,7 +179,7 @@ export default { ...@@ -181,7 +179,7 @@ export default {
data.bigpic = data.bigpic =
data.pics[0].src_url || data.pics[0].src_url ||
"data:image/jpeg;base64," + data.pics[0].pic_base64; "data:image/jpeg;base64," + data.pics[0].pic_base64;
that.$buildCode.init(data); that.$buildCode.init(data);
if (that.resultData.length > 4) { if (that.resultData.length > 4) {
that.resultData.pop(data); that.resultData.pop(data);
} else { } else {
...@@ -258,7 +256,7 @@ export default { ...@@ -258,7 +256,7 @@ export default {
} }
}; };
</script> </script>
<style scoped="scoped" lang="scss"> <style scoped="scoped">
.headers { .headers {
line-height: 60px; line-height: 60px;
} }
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<div class="item-box"> <div class="item-box">
<div class="item-info-box"> <div class="item-info-box">
<div>分析资源</div> <div>分析资源</div>
<div><span>64</span></div> <div><span>{{workers.video_free + workers.video_busy}}</span></div>
</div> </div>
</div> </div>
<div class="item-box"> <div class="item-box">
<div class="item-info-box"> <div class="item-info-box">
<div>运行路数</div> <div>运行路数</div>
<div> <span>47</span></div> <div> <span>{{taskstatus.running}}</span></div>
</div> </div>
</div> </div>
<div class="item-box"> <div class="item-box">
...@@ -28,9 +28,20 @@ ...@@ -28,9 +28,20 @@
</template> </template>
<script> <script>
import mixin from "../../assets/js/mixin";
export default { export default {
mixins:[mixin],
data() { data() {
return {}; return {
};
},
methods:{
},
created() {
} }
}; };
</script> </script>
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
}, },
methods:{ methods:{
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event);
}, },
timer(){ timer(){
setInterval(()=>{ setInterval(()=>{
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event);
} }
} }
}; };
......
...@@ -27,20 +27,20 @@ export default { ...@@ -27,20 +27,20 @@ export default {
methods: { methods: {
videoPlay: function() { videoPlay: function() {
this.urlFlag = false; this.urlFlag = false;
console.log(this.playurl)
if (!this.playurl.sip_serv_ip) { if (!this.playurl.sip_serv_ip) {
let url = this.playurl.rtsp_url; let url = this.playurl.rtsp_url;
let myVideo = document.getElementById("VionVideo");
try { try {
let isLoadingOcx = typeof myVideo.GetVersion() === "string" ? true : false; let isLoadingOcx = typeof document.getElementById("VionVideo").GetVersion() === "string" ? true : false;
if (isLoadingOcx) { if (isLoadingOcx) {
let ocxPlayRes = document.getElementById("VionVideo").StartPlay(url, 0); let ocxPlayRes = document.getElementById("VionVideo").StartPlay(url, 0);
console.log("视频流:", url); console.log("视频流:", url);
if (ocxPlayRes != 0) {
alert("播放失败!");
}
} else { } else {
this.installOcxInfo(); this.installOcxInfo();
} }
if (ocxPlayRes != 0) {
alert("播放失败!");
}
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
......
...@@ -120,7 +120,6 @@ export default { ...@@ -120,7 +120,6 @@ export default {
authordetail authordetail
}, },
created() { created() {
this.getCates();
}, },
methods: { methods: {
submitUpload() { submitUpload() {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
export default { export default {
data() { data() {
return { return {
detailVisible: true, detailVisible: false,
detailData: {} detailData: {}
}; };
}, },
......
...@@ -248,10 +248,16 @@ export default { ...@@ -248,10 +248,16 @@ export default {
console.log(res); console.log(res);
}); });
}, },
saveEditCode() { saveEditCode() {
let data = {
"code_unid": this.codeData.code_unid,
"code":this.codeData.code,
"name":this.codeData.name,
"note":this.codeData.note,
"active":this.codeData.active }
this.$api.codes this.$api.codes
.editTrafficCode( .editTrafficCode(
this.codeData, data,
this.curCateUnid, this.curCateUnid,
this.codeData.code_unid this.codeData.code_unid
) )
......
<template> <template>
<div class="innnerBox"> <div class="innnerBox">
<div class="title">sip视频设置</div> <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
<el-form-item :model="sipSetting"
label="用户名" ref="form"
prop="sip_username"> :rules="rules"
<div style="width: 30%;"> label-width="100px"
<el-input v-model="sipSetting.sip_username" autocomplete="off"></el-input> class="demo-ruleForm"
</div> inline-message
</el-form-item> hide-required-asterisk
<el-form-item label="密码" prop="sip_password"> >
<div style="width: 30%;"> <el-form-item label="用户名" prop="sip_username">
<el-input type="password" v-model="sipSetting.sip_password" autocomplete="off"></el-input> <div style="width: 30%;">
</div> <el-input
</el-form-item> v-model="sipSetting.sip_username"
<el-form-item> autocomplete="off"
<el-button type="primary" @click="addSip('form')" v-if="!isGetted">提交</el-button> ></el-input>
<el-button type="primary" @click="editSip('form')" v-if="isGetted">编辑</el-button> </div>
<el-button type="primary" @click="delFun()" v-if="isGetted">删除</el-button> </el-form-item>
</el-form-item> <el-form-item label="密码" prop="sip_password">
</el-form> <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> </div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
var validateUser = (rule, value, callback) => { var validateUser = (rule, value, callback) => {
if (value === '') { if (value === "") {
callback(new Error('请输入用户名')); callback(new Error("请输入用户名"));
} else { } else {
callback(); callback();
} }
}; };
var validatePass = (rule, value, callback) => { var validatePass = (rule, value, callback) => {
if (value === '') { if (value === "") {
callback(new Error('请输入密码')); callback(new Error("请输入密码"));
} else { } else {
callback(); callback();
} }
}; };
return{ return {
rules: { rules: {
sip_username:[ sip_username: [{ validator: validateUser, trigger: "change" }],
{ validator: validateUser, trigger: 'change' } sip_password: [{ validator: validatePass, trigger: "change" }]
], },
sip_password: [ user_unid: sessionStorage.getItem("user_unid"),
{ validator: validatePass, trigger: 'change' } dev_unid: localStorage.getItem("dev_unid"),
], isGetted: false,
}, sipSetting: {
user_unid:sessionStorage.getItem('user_unid'), sip_username: "", // string
dev_unid:localStorage.getItem('dev_unid'), sip_password: ""
isGetted:false, },
sipSetting:{ sip_unid: ""
sip_username: '', // string };
sip_password: '' },
}, watch: {},
sip_unid:'' components: {},
} mounted() {
}, this.getSipParam();
watch:{}, },
components:{}, methods: {
mounted(){ addSip(formName) {
this.getSipParam(); this.$refs[formName].validate(valid => {
}, if (valid) {
methods:{ this.$api.resource
addSip(formName) { .addSip(this.sipSetting, this.dev_unid, this.user_unid)
this.$refs[formName].validate((valid) => { .then(res => {
if (valid) { // console.log(res.data);
this.$api.resource.addSip(this.sipSetting,this.dev_unid,this.user_unid).then(res=>{ if (res.ecode == 200) {
// console.log(res.data); this.isGetted = true;
if(res.ecode == 200) { this.$message({
this.isGetted = true; type: "success",
this.$message({ message: res.enote
type: 'success', });
message: res.enote } else {
}) this.isGetted = false;
} else { this.$message({
this.isGetted = false; type: "error",
this.$message({ message: res.enote
type: 'error', });
message: res.enote }
}) });
} } else {
return false;
}) }
} else { });
return false; },
} editSip(formName) {
}); this.$refs[formName].validate(valid => {
}, if (valid) {
editSip(formName){ this.$api.resource
this.$refs[formName].validate((valid) => { .editSip(
if (valid) { this.sipSetting,
this.$api.resource.editSip(this.sipSetting,this.dev_unid,this.user_unid,this.sip_unid).then(res=>{ this.dev_unid,
// console.log(res.data); this.user_unid,
if(res.ecode == 200) { this.sip_unid
this.$message({ )
type: 'success', .then(res => {
message: '修改成功!' // console.log(res.data);
}) if (res.ecode == 200) {
} else { this.$message({
this.$message({ type: "success",
type: 'error', message: "修改成功!"
message: res.enote });
}) } else {
} this.$message({
}) type: "error",
} else { message: res.enote
return false; });
} }
}); });
}, } else {
delFun(){ return false;
this.$confirm('此操作将永久删除, 是否继续?', '提示', { }
confirmButtonText: '确定', });
cancelButtonText: '取消', },
type: 'warning' delFun() {
}).then(() => { this.$confirm("此操作将永久删除, 是否继续?", "提示", {
this.$api.resource.delSip(this.sipSetting,this.dev_unid,this.user_unid,this.sip_unid).then(res=>{ confirmButtonText: "确定",
if(res.ecode == 200) { cancelButtonText: "取消",
this.$message({ type: "warning"
type: 'success', })
message: '删除成功!' .then(() => {
}) this.$api.resource
for(let j in this.sipSetting) { .delSip(
this.sipSetting[j] = ''; this.sipSetting,
} this.dev_unid,
this.isGetted = false; this.user_unid,
} else { this.sip_unid
this.$message({ )
type: 'error', .then(res => {
message: res.enote if (res.ecode == 200) {
}) this.$message({
} type: "success",
}) message: "删除成功!"
}).catch(() => { });
this.$message({ for (let j in this.sipSetting) {
type: 'info', this.sipSetting[j] = "";
message: '已取消' }
}); this.isGetted = false;
}); } else {
}, this.$message({
getSipParam() { type: "error",
this.$api.resource.getsip({},this.dev_unid,this.user_unid).then(res=>{ message: res.enote
if(res.ecode) { });
this.isGetted = false; }
} else { });
this.isGetted = true; })
this.sipSetting.sip_username = res.sip_username; .catch(() => {
this.sipSetting.sip_password = res.sip_password; this.$message({
this.sip_unid = res.sip_unid; 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> </script>
<style lang="scss" scoped> <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
.title {
height: 30px;
line-height: 30px;
padding-left: 30px;
font-size: 14px;
background: #3bb7ff;
color: #ffffff;
margin-bottom: 20px;
}
</style>
<template>
<div>
<!-- 添加相机 -->
<el-dialog title="设备详情" :visible.sync="cameraAddVisible" width="450px">
<div>
<el-form
label-position="left"
label-width="120px"
:model="addVideoParam"
ref="cameraDialog"
inline-message
hide-required-asterisk
>
<el-form-item label="设备编号">
<el-input v-model="initParam.id" disabled></el-input>
</el-form-item>
<el-form-item label="设备名称">
<el-input v-model="initParam.label" disabled></el-input>
</el-form-item>
<el-form-item label="地点编号">
<el-input v-model="initParam.addr_unid" disabled></el-input>
</el-form-item>
<el-form-item label="地点名称">
<el-input v-model="initParam.addr_name" disabled></el-input>
</el-form-item>
<el-form-item label="IP地址">
<el-input v-model="addVideoParam.ip"></el-input>
</el-form-item>
<el-form-item label="端口" prop="port">
<el-input v-model="addVideoParam.port"></el-input>
</el-form-item>
<el-form-item label="协议">
<el-select
v-model="addVideoParam.video_protocol_id"
placeholder="请选择协议"
:popper-append-to-body="false"
>
<el-option label="rtsp" value="rtsp"></el-option>
<el-option label="onvif" value="onvif"></el-option>
</el-select>
</el-form-item>
<el-form-item label="取流地址" prop="video_source_url">
<el-input v-model="addVideoParam.video_source_url"></el-input>
</el-form-item>
<el-form-item label="用户名">
<el-input v-model="addVideoParam.user_name"></el-input>
</el-form-item>
<el-form-item label="密码">
<el-input v-model="addVideoParam.password"></el-input>
</el-form-item>
<el-form-item label="经度">
<el-input v-model="addVideoParam.longitude"></el-input>
</el-form-item>
<el-form-item label="纬度">
<el-input v-model="addVideoParam.latitude"></el-input>
</el-form-item>
<el-form-item label="扩展字段1">
<el-input v-model="addVideoParam.extend_1"></el-input>
</el-form-item>
<el-form-item label="扩展字段2">
<el-input v-model="addVideoParam.extend_2"></el-input>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="cameraAddVisible = false">取 消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
addVideoParam:{},
initParam: {},
cameraAddVisible: false,
type: "",
devsId: ""
};
},
methods: {
initDialog(node, type, devsId) {
this.cameraAddVisible = true;
this.initParam = node;
}
}
};
</script>
<style></style>
<template>
<div class="sync-tree scrollbar">
<el-tree
ref="synctree"
v-if="isLoadingTree"
:accordion="true"
:filter-node-method="filterNode"
:data="syncTreeData"
class="resource-wrap"
node-key="id"
:expand-on-click-node="false"
@node-click="handleNodeClick"
></el-tree>
</div>
</template>
<script>
// import TreeRender from "../treeRender";
export default {
data() {
return {
isLoadingTree: false,
syncTreeData: [
{
id: "0",
unid: "0",
label: "平台同步资源",
root: "平台同步资源",
children: []
}
],
defaultProps: {
children: "children",
label: "label"
}
};
},
props: {
filterText: {
type: String,
default: ""
},
treeDatas: {
type: Array,
defalut: []
}
},
components: {},
watch: {
filterText(val) {
this.$refs.synctree.filter(val);
},
treeDatas(val) {
this.treeData[0].childs = val;
}
},
methods: {
initTree(data) {
this.syncTreeData[0].children = data;
this.isLoadingTree = true;
},
filterNode(value, data) {
// console.log('filterNode:', data)
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
handleNodeClick(data){
if(data.label === "平台同步资源") return;
this.$emit('syncTable', data)
},
handleRefresh(s, d, n) {
// console.log(s, d, n)
console.log("调用父级方法: ", this);
this.syncTreeData = [
{
id: "1",
label: "平台同步资源",
root: "平台同步资源",
children: []
}
];
this.$parent.getSyncTree();
}
}
};
</script>
<style scoped>
.sync-tree {
/* max-height: 216px; */
/* overflow: hidden; */
}
</style>
<template> <template>
<div> <div>
<el-tree <el-tree
class="filter-tree" class="filter-tree"
accordion accordion
:data="treeData" :data="treeData"
:props='defaultProps' :props="defaultProps"
@node-click="handleNodeClick" @node-click="handleNodeClick"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree"> ref="tree"
<span class="custom-tree-node" slot-scope="{ node, data }"> >
<span> <span class="custom-tree-node" slot-scope="{ node, data }">
<span class="tree-label">{{ data.vchan_name=="" ? '未命名' : data.vchan_name}}</span> <span>
</span> <span class="tree-label">{{
<span class="tree-btn" v-if="data.org_type"> data.vchan_name == "" ? "未命名" : data.vchan_name
<i class="el-icon-plus" @click.stop="nodeAddClick(node,data)"></i> }}</span>
</span> </span>
</span> <span class="tree-btn" v-if="data.org_type">
</el-tree> <i class="el-icon-plus" @click.stop="nodeAddClick(node, data)"></i>
<el-dialog </span>
title="添加" </span>
:visible.sync="addVisible" </el-tree>
width="450px"> <el-dialog title="添加" :visible.sync="addVisible" width="450px">
<div> <div>
<el-form label-position="left" label-width="120px"> <el-form label-position="left" label-width="120px">
<el-form-item label="添加录像"> <el-form-item label="添加录像">
<el-upload <el-upload
ref="upload" ref="upload"
action="uploadUrl" :action="uploadUrl"
:http-request="httpRequest" :before-upload="beforeup"
multiple multiple
name="file" :data="updata"
:auto-upload="false"> name="file"
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> :auto-upload="false"
<!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> --> :on-success="upsuccess"
</el-upload> :on-error="uperror"
</el-form-item> >
</el-form> <el-button slot="trigger" size="small" type="primary"
</div> >选取文件</el-button
<span slot="footer" class="dialog-footer"> >
<el-button @click="addVisible=false">取 消</el-button> <!-- <div slot="tip" class="el-upload__tip">只能上传视频文件</div> -->
<el-button type="primary" @click="save">上 传</el-button> </el-upload>
</span> </el-form-item>
</el-dialog> </el-form>
</div> </div>
<span slot="footer" class="dialog-footer">
<el-button @click="addVisible = false">取 消</el-button>
<el-button type="primary" @click="save">上 传</el-button>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
import baseUrl from '../../../api/baseUrl' import baseUrl from "../../../api/baseUrl";
export default{ export default {
data(){ data() {
return{ return {
uploadUrl: '', uploadUrl: `${baseUrl}/api/v1/devconf_fx/devs/${this.devsId}/vfile_vchans`,
file:[], file: [],
treeData: [ updata: {},
{ treeData: [
unid: '0', {
org_pid: '0', unid: "0",
vchan_name: '手动添加录像资源', org_pid: "0",
org_type: 'video', vchan_name: "手动添加录像资源",
childs: [] org_type: "video",
} childs: []
], }
defaultProps:{ ],
children: "childs", defaultProps: {
disabled: "disabled", children: "childs",
label: "vchan_name" disabled: "disabled",
}, label: "vchan_name"
addVisible:false, },
} addVisible: false
}, };
components:{ },
}, components: {},
props:{ props: {
filterText:{ filterText: {
type:String, type: String,
default:'' default: ""
}, },
treeDatas:{ treeDatas: {
type:Array, type: Array,
defalut:[] defalut: []
}, },
devsId:{ devsId: {
type:String, type: String,
default:'' default: ""
} }
}, },
watch:{ watch: {
filterText(val) { filterText(val) {
this.$refs.tree.filter(val); setTimeout(() => {
}, this.$refs.tree.filter(val);
treeDatas(val){ }, 100);
this.treeData[0].childs=val; },
}, treeDatas(val) {
devsId(val){ this.treeData[0].childs = val;
this.devsId=val; },
} devsId(val) {
}, this.devsId = val;
methods:{ }
// 自定义的上传函数 },
httpRequest(param) { methods: {
this.file=[]; // 自定义的上传函数
// 一般情况下是在这里创建FormData对象,但我们需要上传多个文件,为避免发送多次请求,因此在这里只进行文件的获取,param可以拿到文件上传的所有信息 httpRequest(param) {
this.file.push(param.file) this.file = [];
}, // 一般情况下是在这里创建FormData对象,但我们需要上传多个文件,为避免发送多次请求,因此在这里只进行文件的获取,param可以拿到文件上传的所有信息
handleNodeClick(data){ this.file.push(param.file);
this.$emit('clickHandle',data,'video'); },
// this.$parent.$parent.getVideoTable(data,'video') beforeup(file) {
}, this.updata.name = file.name;
nodeAddClick(node,data){ this.updata.vchan_type = "vfile";
this.addVisible=true; this.updata.vchan_refid = new Date().getTime();
}, },
save(){ upsuccess(req) {
this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件 if (req.ecode == 200) {
// 最重要的就是这段代码 this.$message({
var upData = new FormData() // 首先创建FormData对象 message: "添加成功",
this.file.forEach(function (file) { type: "success"
upData.append('file', file); // 因为要上传多个文件,所以需要遍历一下才行 });
upData.append('name', file.name); this.$parent.$parent.$parent.getVideoTree();
upData.append('vchan_type', 'vfile'); } else {
upData.append('vchan_refid', new Date().getTime()); this.$message({
}) message: req.enote,
const loading = this.$loading({ type: "error"
lock: true, });
text: 'Loading', }
spinner: 'el-icon-loading', },
background: 'rgba(0, 0, 0, 0.7)' uperror(req) {
}); console.log("error", req);
this.$api.resource.uploadFile(upData,this.devsId).then(res=>{ },
if(res.enote==400){ handleNodeClick(data) {
this.$message.error(res.ecode); debugger
}else{ this.$emit("clickHandle", data, "video");
this.$emit('getTree'); // this.$parent.$parent.getVideoTable(data,'video')
this.$message({ },
message: '添加成功', nodeAddClick(node, data) {
type: 'success' this.addVisible = true;
}); },
this.addVisible=false; save() {
loading.close(); this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
} },
}) filterNode(value, data) {
if (!value) return true;
}, return data.vchan_name.indexOf(value) !== -1;
filterNode(value, data) { }
if (!value) return true; }
return data.org_name.indexOf(value) !== -1; };
},
}
}
</script> </script>
<style> <style></style>
</style>
<template> <template>
<div class="pic-content scrollbar"> <div class="pic-content scrollbar">
<el-row v-if="illegalAlarmData.length > 0"> <el-row v-if="illegalAlarmData.length > 0">
<!-- 交通事件类 --> <!-- 交通事件类 -->
<!-- 机动车事件 --> <!-- 机动车事件 -->
<el-col :span="22" class="pic-box" v-for="(item, index) in illegalAlarmData" :key="index" v-if="item.event_cate !== 'flow'"> <el-col
<el-col :span="12" v-if='item.task_algo_type!="1"'> :span="22"
<el-card :body-style="{ padding: 0 }"> class="pic-box"
<div class="img-wrap" @click="showInfo(index)"> v-for="(item, index) in illegalAlarmData"
<b class="img-border"></b> :key="index"
<div class="picbackground"> v-if="item.event_cate !== 'flow'"
<img v-lazy="item.pic" class="photos"/> >
</div> <el-col :span="12" v-if="item.task_algo_type != '1'">
</div> <el-card :body-style="{ padding: 0 }">
</el-card> <div class="img-wrap" @click="showInfo(index)">
</el-col> <b class="img-border"></b>
<el-col :lg="11" :md="14" :sm="13" v-if="item.event_type === 'vehicle' || item.event_type === 'xcycle'"> <div class="picbackground">
<ul class="pic-info"> <img :src="item.pic" class="photos" />
<!-- <li :title="item.shoot_date"> </div>
</div>
</el-card>
</el-col>
<el-col
:lg="11"
:md="14"
:sm="13"
v-if="item.event_type === 'vehicle' || item.event_type === 'xcycle'"
>
<ul class="pic-info">
<!-- <li :title="item.shoot_date">
<span>抓拍日期:</span> <span>抓拍日期:</span>
<span>{{ item.shoot_date }}</span> <span>{{ item.shoot_date }}</span>
</li> </li>
...@@ -28,49 +39,70 @@ ...@@ -28,49 +39,70 @@
<span>地点名称:</span> <span>地点名称:</span>
<span>{{ item.location_name }}</span> <span>{{ item.location_name }}</span>
</li> --> </li> -->
<li v-if="item.event_type === 'vehicle'" :title="item.vehicle_plate_text"> <li
<span>车牌号码:</span> v-if="item.event_type === 'vehicle'"
<span>{{ item.vehicle_plate_text }}</span> :title="item.vehicle_plate_text"
</li> >
<!-- <li v-if="item.event_type === 'vehicle'" :title="item.vehicle_body_type_text"> <span>车牌号码:</span>
<span>{{ item.vehicle_plate_text }}</span>
</li>
<!-- <li v-if="item.event_type === 'vehicle'" :title="item.vehicle_body_type_text">
<span>车辆类型:</span> <span>车辆类型:</span>
<span>{{ item.vehicle_body_type_text }}</span> <span>{{ item.vehicle_body_type_text }}</span>
</li> --> </li> -->
<li v-if="item.event_type === 'vehicle'" :title="item.vehicle_body_color_text"> <li
<span>车身颜色:</span> v-if="item.event_type === 'vehicle'"
<span>{{ item.vehicle_body_color_text }}</span> :title="item.vehicle_body_color_text"
</li> >
<li v-if="item.event_type === 'vehicle'" :title="item.vehicle_body_logo_text"> <span>车身颜色:</span>
<span>车辆品牌:</span> <span>{{ item.vehicle_body_color_text }}</span>
<span>{{ item.vehicle_body_logo_text }}</span> </li>
</li> <li
<li v-if="item.event_type === 'vehicle'" :title="item.vehicle_plate_text"> v-if="item.event_type === 'vehicle'"
<span>违法类型:</span> :title="item.vehicle_body_logo_text"
<span>{{ item.illegalType}}</span> >
</li> <span>车辆品牌:</span>
<!-- 非机动车 --> <span>{{ item.vehicle_body_logo_text }}</span>
<li v-if="item.event_type === 'xcycle'" :title="item.xcycle_type_text"> </li>
<span>骑车类型:</span> <li
<span>{{ item.xcycle_type_text }}</span> v-if="item.event_type === 'vehicle'"
</li> :title="item.vehicle_plate_text"
<li v-if="item.event_type === 'xcycle'" :title="item.xcycle_color_type"> >
<span>车辆颜色:</span> <span>违法类型:</span>
<span>{{ item.xcycle_color_type }}</span> <span>{{ item.illegalType }}</span>
</li> </li>
<li :title="item.driver_face_lobody_text" v-if="item.event_type === 'xcycle'"> <!-- 非机动车 -->
<span>速度:</span> <li
<span>{{ item.location_speed }}</span> v-if="item.event_type === 'xcycle'"
</li> :title="item.xcycle_type_text"
<li v-if="item.event_type === 'xcycle'"> >
<span>违法类型:</span> <span>骑车类型:</span>
<span>{{ item.illegalType}}</span> <span>{{ item.xcycle_type_text }}</span>
</li> </li>
</ul> <li
</el-col> v-if="item.event_type === 'xcycle'"
<!-- 行人事件 --> :title="item.xcycle_color_type"
<el-col :span="12" v-if="item.event_type === 'pedestrian'"> >
<ul class="pic-info"> <span>车辆颜色:</span>
<!-- <li :title="item.shoot_date"> <span>{{ item.xcycle_color_type }}</span>
</li>
<li
:title="item.driver_face_lobody_text"
v-if="item.event_type === 'xcycle'"
>
<span>速度:</span>
<span>{{ item.location_speed }}</span>
</li>
<li v-if="item.event_type === 'xcycle'">
<span>违法类型:</span>
<span>{{ item.illegalType }}</span>
</li>
</ul>
</el-col>
<!-- 行人事件 -->
<el-col :span="12" v-if="item.event_type === 'pedestrian'">
<ul class="pic-info">
<!-- <li :title="item.shoot_date">
<span>抓拍日期:</span> <span>抓拍日期:</span>
<span>{{ item.shoot_date }}</span> <span>{{ item.shoot_date }}</span>
</li> </li>
...@@ -78,84 +110,82 @@ ...@@ -78,84 +110,82 @@
<span>抓拍时间:</span> <span>抓拍时间:</span>
<span>{{ item.shoot_time }}</span> <span>{{ item.shoot_time }}</span>
</li> --> </li> -->
<li :title="item.driver_face_sex"> <li :title="item.driver_face_sex">
<span>性别:</span> <span>性别:</span>
<span>{{ item.driver_face_sex }}</span> <span>{{ item.driver_face_sex }}</span>
</li> </li>
<li :title="item.pedestrian_height"> <li :title="item.pedestrian_height">
<span>身高:</span> <span>身高:</span>
<span>{{ item.pedestrian_height }}</span> <span>{{ item.pedestrian_height }}</span>
</li> </li>
<li :title="item.driver_face_lobody_text"> <li :title="item.driver_face_lobody_text">
<span>速度:</span> <span>速度:</span>
<span>{{ item.location_speed }}</span> <span>{{ item.location_speed }}</span>
</li> </li>
<li v-if="item.illegalType" :title="item.illegalType"> <li v-if="item.illegalType" :title="item.illegalType">
<span>违法类型:</span> <span>违法类型:</span>
<span>{{ item.illegalType }}</span> <span>{{ item.illegalType }}</span>
</li> </li>
</ul> </ul>
</el-col> </el-col>
<!--安防事件--> <!--安防事件-->
<el-col :span="12" v-if="item.event_cate === 'behavior'"> <el-col :span="12" v-if="item.event_cate === 'behavior'">
<ul class="pic-info"> <ul class="pic-info">
<li :title="item.shoot_date"> <li :title="item.shoot_date">
<span>抓拍日期:</span> <span>抓拍日期:</span>
<span>{{ item.shoot_date }}</span> <span>{{ item.shoot_date }}</span>
</li> </li>
<li :title="item.shoot_time"> <li :title="item.shoot_time">
<span>抓拍时间:</span> <span>抓拍时间:</span>
<span>{{ item.shoot_time }}</span> <span>{{ item.shoot_time }}</span>
</li> </li>
<li :title="getCode('安防事件',item.event_type)"> <li :title="item.event_type">
<span>事件类型:</span> <span>事件类型:</span>
<span>{{ getCode('安防事件',item.event_type) }}</span> <span>{{ item.event_type }}</span>
</li> </li>
<li v-if="item.illegalType" :title="item.illegalType"> <li v-if="item.illegalType" :title="item.illegalType">
<span>违法类型:</span> <span>违法类型:</span>
<span>{{ item.illegalType }}</span> <span>{{ item.illegalType }}</span>
</li> </li>
</ul> </ul>
</el-col> </el-col>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return{ return {
illegalAlarmData:[] illegalAlarmData: []
} };
}, },
props:["itemData"], props: ["itemData"],
methods:{ methods: {
showInfo: function(index) { showInfo: function(index) {
this.curPicData = this.illegalAlarmData[index]; this.curPicData = this.illegalAlarmData[index];
if(this.curPicData) { if (this.curPicData) {
this.$emit("showDitail",this.curPicData) this.$emit("showDitail", this.curPicData);
} }
} }
},
created() {
},
mounted() {
}, },
watch:{ created() {},
itemData(val){ mounted() {},
if(val == '') { watch: {
this.illegalAlarmData = []; itemData(val) {
return if (val == "") {
} this.illegalAlarmData = [];
if(val.illegalTypeCode && val.illegalTypeCode == 1) { return;
this.illegalAlarmData.push(val); }
} if (val.illegalType && val.illegalTypestate == 1) {
if (this.illegalAlarmData.length > 20) {
this.illegalAlarmData.pop();
} else {
this.illegalAlarmData.unshift(val);
}
}
} }
} }
} };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped></style>
</style>
...@@ -52,9 +52,7 @@ export default { ...@@ -52,9 +52,7 @@ export default {
// ...mapState(["eventData", "wsclient"]) // ...mapState(["eventData", "wsclient"])
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {},
console.log(tab, event);
},
dataInit(cid, type) { dataInit(cid, type) {
this.$refs.allalarm.allAlarmData = []; this.$refs.allalarm.allAlarmData = [];
this.$refs.caralarm.carAlarmData = []; this.$refs.caralarm.carAlarmData = [];
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
v-for="(item, index) in taskdata" v-for="(item, index) in taskdata"
:key="index" :key="index"
@click="selecttask(item, index)" @click="selecttask(item, index)"
v-if=" item.status == 'Running'"
> >
<span <span
:class="{ :class="{
...@@ -71,6 +72,7 @@ ...@@ -71,6 +72,7 @@
:subtaskid="currentSubtaskId" :subtaskid="currentSubtaskId"
:subtaskdata="subtaskdata" :subtaskdata="subtaskdata"
:playurl="playurl" :playurl="playurl"
:vchan="vchandata"
></setting> ></setting>
</div> </div>
</div> </div>
...@@ -103,6 +105,7 @@ export default { ...@@ -103,6 +105,7 @@ export default {
taskdata: [], taskdata: [],
subtaskdata: "", subtaskdata: "",
subTasks: [], subTasks: [],
vchandata:{},
subindex: -1, subindex: -1,
playurl: "", playurl: "",
taskID: "", taskID: "",
...@@ -167,6 +170,7 @@ export default { ...@@ -167,6 +170,7 @@ export default {
type: "error" type: "error"
}); });
} else { } else {
this.vchandata = vdata.vchan;
setTimeout(() => { setTimeout(() => {
this.getPlayUrl(); this.getPlayUrl();
}, 2000); }, 2000);
...@@ -184,7 +188,7 @@ export default { ...@@ -184,7 +188,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.$refs.videoplay.videoPlay(); this.$refs.videoplay.videoPlay();
}, 2000); }, 2000);
console.log("视频播放地址:", this.playurl.rtsp_url); console.info("视频播放地址:", this.playurl.rtsp_url);
} else { } else {
this.$message({ this.$message({
message: "获取rtsp播放地址失败!请重试!", message: "获取rtsp播放地址失败!请重试!",
...@@ -220,6 +224,7 @@ export default { ...@@ -220,6 +224,7 @@ export default {
margin 2px auto margin 2px auto
color #fff color #fff
overflow hidden overflow hidden
min-height 700px
padding 10px padding 10px
} }
.tree-box{ .tree-box{
......
...@@ -80,6 +80,15 @@ ...@@ -80,6 +80,15 @@
<i class="el-icon-delete icon"></i> <i class="el-icon-delete icon"></i>
</span> </span>
</div> </div>
<div>
<span
@click="cutpic"
class="delbtn editbtn"
v-if="!canvasState"
>
<i class="el-icon-picture icon" style="color:#3bb7ff;"></i>
</span>
</div>
</div> </div>
</div> </div>
</el-row> </el-row>
...@@ -128,13 +137,15 @@ export default { ...@@ -128,13 +137,15 @@ export default {
XMLStr: "", XMLStr: "",
modelnum: 0, //标记模型编号 modelnum: 0, //标记模型编号
bgUrl: "", bgUrl: "",
taskData: "" taskData: "",
mtaskdata: ""
}; };
}, },
// props: ['bgUrl'], // props: ['bgUrl'],
methods: { methods: {
checkBrower: function() {}, checkBrower: function() {},
showModal: function(data, mtaskdata) { showModal: function(data, mtaskdata) {
this.mtaskdata = mtaskdata;
var _this = this; var _this = this;
this.$store.commit("setocxstate", 0); this.$store.commit("setocxstate", 0);
this.taskData = data; this.taskData = data;
...@@ -143,21 +154,7 @@ export default { ...@@ -143,21 +154,7 @@ export default {
// this.type = 2; // this.type = 2;
this.bgUrl = ""; this.bgUrl = "";
//获取视频截图 //获取视频截图
this.$api.task this.cutpic(mtaskdata);
.cutpic(
mtaskdata.vchan.vdev_unid,
mtaskdata.vchan.vchan_refid,
mtaskdata.subtask_id
).then(res => {
if (!res.ecode) {
this.src = "data:image/png;base64," + res.pic_base64;
} else {
alert("标定设置截图失败!" + res.enote);
}
})
.catch(err => {
console.log("标定设置截图返回异常:", err.message);
});
// this.src = document.getElementById('VionVideo').CapturePicture(filePath) + '?stamp=' + new Date().getTime(); // this.src = document.getElementById('VionVideo').CapturePicture(filePath) + '?stamp=' + new Date().getTime();
if (this.src) { if (this.src) {
setTimeout(() => { setTimeout(() => {
...@@ -220,9 +217,29 @@ export default { ...@@ -220,9 +217,29 @@ export default {
} }
}, 0); }, 0);
}, },
cutpic() {
var mtaskdata = this.mtaskdata;
this.src = "";
//获取视频截图
this.$api.task
.cutpic(
mtaskdata.vchan.vdev_unid,
mtaskdata.vchan.vchan_refid,
mtaskdata.subtask_id
)
.then(res => {
if (!res.ecode) {
this.src = "data:image/png;base64," + res.pic_base64;
} else {
alert("标定设置截图失败!" + res.enote);
}
})
.catch(err => {
console.error("标定设置截图返回异常:", err.message);
});
},
configInit: function(xml) { configInit: function(xml) {
if (!xml) { if (!xml) {
console.log("xml 为空!");
xml = configxml.xml; xml = configxml.xml;
} }
let allline = []; let allline = [];
...@@ -270,7 +287,35 @@ export default { ...@@ -270,7 +287,35 @@ export default {
this.signLayer.add(line); this.signLayer.add(line);
} }
}); });
changeModelData("car")
this.initModel();
},
initModel(){
//初始化一个模型
let po = [354, 313, 360, 244];
this.getModelData(po);
var line = this.drawLine(
{
x: po[0],
y: po[1]
},
{
x: po[2],
y: po[3]
},
"red",
11
);
this.signLayer.add(line);
this.stage.draw(); this.stage.draw();
let P1 = {},
P2 = {};
P1.x = Number((po[0] / 800).toFixed(6));
P1.y = Number((po[1] / 500).toFixed(6));
P2.x = Number((po[2] / 800).toFixed(6));
P2.y = Number((po[3] / 500).toFixed(6));
this.drawArrows(P1, P2);
}, },
beforeHideModal: function() { beforeHideModal: function() {
this.clear(); this.clear();
...@@ -307,7 +352,9 @@ export default { ...@@ -307,7 +352,9 @@ export default {
this.signLayer.draw(); this.signLayer.draw();
//变换线模型 //变换线模型
let mtype = index == 0 ? "car" : "person"; let mtype = index == 0 ? "car" : "person";
changeModelData(mtype); changeModelData(mtype);
this.initModel();
}, },
changeCanvasState: function() { changeCanvasState: function() {
...@@ -533,7 +580,7 @@ export default { ...@@ -533,7 +580,7 @@ export default {
topY = headlen * Math.sin(angle1), topY = headlen * Math.sin(angle1),
botX = headlen * Math.cos(angle2), botX = headlen * Math.cos(angle2),
botY = headlen * Math.sin(angle2); botY = headlen * Math.sin(angle2);
var arrowX = c1.x * 800 - topX, var arrowX = c1.x * 800 - topX ,
arrowY = c1.y * 500 - topY; arrowY = c1.y * 500 - topY;
arrowX = c2.x * 800 + topX; arrowX = c2.x * 800 + topX;
arrowY = c2.y * 500 + topY; arrowY = c2.y * 500 + topY;
...@@ -628,6 +675,7 @@ export default { ...@@ -628,6 +675,7 @@ export default {
}, },
//根据模型线改变模型改变箭头 //根据模型线改变模型改变箭头
changeModel(modelnum) { changeModel(modelnum) {
console.log(modelnum);
let mlinepoints = this.selectedShape.attrs.points; let mlinepoints = this.selectedShape.attrs.points;
let curmodel = this.signLayer.get(".model"); let curmodel = this.signLayer.get(".model");
let arrows = this.signLayer.get(".arrows"); let arrows = this.signLayer.get(".arrows");
...@@ -661,6 +709,7 @@ export default { ...@@ -661,6 +709,7 @@ export default {
}); });
}, },
drawLine: function(start, end, col, types, linenum) { drawLine: function(start, end, col, types, linenum) {
debugger;
linenum = linenum ? linenum : 0; linenum = linenum ? linenum : 0;
let points = [start.x, start.y, end.x, end.y]; let points = [start.x, start.y, end.x, end.y];
let line = new Kinetic.Line({ let line = new Kinetic.Line({
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="预设位置配置" width="120"> <el-table-column align="center" label="预设位置配置" width="120">
<template> <template slot-scope="scope">
<div class="yzw-setbox"> <div class="yzw-setbox">
<span class="icon el-icon-delete" @click="resetRoi"></span> <span class="icon el-icon-delete" @click="resetRoi(scope.row)"></span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="yzw-setbox"> <div class="yzw-setbox">
<setTimer <setTimer
ref="settimer" ref="settimer"
:runtime="scope.row.runtime" :runtime="scope.row.runtime"
:runindex="scope.$index" :runindex="scope.$index"
...@@ -59,7 +58,7 @@ ...@@ -59,7 +58,7 @@
场景配置 <span class="set-icon el-icon-circle-plus"></span> 场景配置 <span class="set-icon el-icon-circle-plus"></span>
</div> </div>
<div class="set-item"> <div class="set-item">
播放 播放
<span class="set-icon"> <span class="set-icon">
<el-switch :width="25" v-model="switchstate" @change="suspends"> <el-switch :width="25" v-model="switchstate" @change="suspends">
</el-switch> </el-switch>
...@@ -82,6 +81,7 @@ ...@@ -82,6 +81,7 @@
ref="yt" ref="yt"
@subpostion="submitPosion" @subpostion="submitPosion"
@deleteytconfig="deleteytconfig" @deleteytconfig="deleteytconfig"
:vchan="vchan"
></ytconfig> ></ytconfig>
</div> </div>
<div> <div>
...@@ -107,7 +107,8 @@ export default { ...@@ -107,7 +107,8 @@ export default {
data() { data() {
return { return {
timer: 0, timer: 0,
loading:false, user_unid: "",
loading: false,
polling_state: false, polling_state: false,
timersel: 0, timersel: 0,
timerDialog: false, timerDialog: false,
...@@ -124,7 +125,7 @@ export default { ...@@ -124,7 +125,7 @@ export default {
switchstate: false switchstate: false
}; };
}, },
props: ["taskid", "subtaskid", "playurl"], props: ["taskid", "subtaskid", "playurl", "vchan"],
components: { components: {
areas, areas,
demarcate, demarcate,
...@@ -149,7 +150,7 @@ export default { ...@@ -149,7 +150,7 @@ export default {
setDemarcate(scenesdata, index) { setDemarcate(scenesdata, index) {
if (this.checkpollstate()) { if (this.checkpollstate()) {
this.curindex = index; this.curindex = index;
console.log("scenesdata",scenesdata) console.log("scenesdata", scenesdata);
this.$refs.demarcate.showModal(scenesdata, this.taskInfo); this.$refs.demarcate.showModal(scenesdata, this.taskInfo);
} }
}, },
...@@ -159,13 +160,42 @@ export default { ...@@ -159,13 +160,42 @@ export default {
setsounces() { setsounces() {
if (this.checkpollstate()) { if (this.checkpollstate()) {
this.$refs.yt.openyt(this.currentRow); this.$refs.yt.openyt(this.currentRow);
this.getSipSetting();
}
},
getSipSetting: function() {
if (this.dev_unid) {
this.$api.device.sipSet(this.dev_unid, this.user_unid).then(res => {
if (!res.ecode) {
console.log("获取sip配置返回:", JSON.stringify(res));
document
.getElementById("VionVideo")
.PtzRegistDev(
res.sip_serv_ip,
res.sip_unid,
res.sip_password,
res.sip_serv_id
);
} else {
this.$message({
message: "获取播放地址失败,请前往配置sip服务!!请重试!",
type: "error"
});
}
});
} else {
console.log("运维ID获取失败");
this.$message({
type: "warning",
message: "运维ID获取失败"
});
} }
}, },
TaskParams(subid) { TaskParams(subid) {
this.loading = true; this.loading = true;
this.$api.task.getTaskParams(this.taskid, subid).then(res => { this.$api.task.getTaskParams(this.taskid, subid).then(res => {
this.taskInfo = res; this.taskInfo = res;
this.switchstate = res.alternate_status == 1 ? true : false; this.switchstate = res.alternate_status == "1" ? true : false;
this.loading = false; this.loading = false;
this.$forceUpdate(); this.$forceUpdate();
}); });
...@@ -177,7 +207,8 @@ export default { ...@@ -177,7 +207,8 @@ export default {
this.timerDialog = true; this.timerDialog = true;
this.timer = data.runtime; this.timer = data.runtime;
}, },
resetRoi() { resetRoi(row) {
var that = this;
this.$store.commit("setocxstate", 0); this.$store.commit("setocxstate", 0);
this.$confirm("删除参数设置,区域设置,标定设置信息?", "提示", { this.$confirm("删除参数设置,区域设置,标定设置信息?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
...@@ -185,14 +216,15 @@ export default { ...@@ -185,14 +216,15 @@ export default {
type: "warning" type: "warning"
}) })
.then(() => { .then(() => {
this.taskInfo.mtasks[0].scenes.map(ele => { debugger
if (ele.scene_unid == this.currentRow.scene_unid) { that.taskInfo.mtasks[0].scenes.map(ele => {
if (ele.scene_unid == row.scene_unid) {
ele.config = {}; ele.config = {};
ele.rois = []; ele.rois[0].roi = '<?xml version="1.0" encoding="UTF-8" ?><roi><flow_roi><flow_type></flow_type><flow_region><polygon_point_count>0</polygon_point_count></flow_region></flow_roi><plate_detect_region><detect_polygon><polygon_point_count>0</polygon_point_count></detect_polygon></plate_detect_region><lane_line><line_count>0</line_count></lane_line><lanes><lane_count>0</lane_count></lanes><lights><light_count>0</light_count></lights><no_stop_region><region_count>0</region_count></no_stop_region><pedestrian_detection_region><region_count>0</region_count></pedestrian_detection_region><median_lines><lane_count>0</lane_count></median_lines><pedestrian_density_region><region_count>0</region_count></pedestrian_density_region><foreign_detection_region><region_count>0</region_count></foreign_detection_region><test_result_region><region_count>0</region_count></test_result_region></roi>';
ele.runtime = 0; ele.runtime = 0;
} }
}); });
this.subRoi(this.taskInfo.mtasks); that.subRoi(that.taskInfo.mtasks);
}) })
.catch(() => { .catch(() => {
this.$store.commit("setocxstate", 1); this.$store.commit("setocxstate", 1);
...@@ -210,12 +242,14 @@ export default { ...@@ -210,12 +242,14 @@ export default {
this.$store.commit("setocxstate", 1); this.$store.commit("setocxstate", 1);
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentRow = val; if (val.algo_type == 3) {
this.$api.task this.currentRow = val;
.switchScene(this.taskid, this.subtaskid, val.scene_unid) this.$api.task
.then(res => { .switchScene(this.taskid, this.subtaskid, val.scene_unid)
console.log(res); .then(res => {
}); console.log(res);
});
}
}, },
suspends() { suspends() {
if (this.subtaskid) { if (this.subtaskid) {
...@@ -231,7 +265,7 @@ export default { ...@@ -231,7 +265,7 @@ export default {
let state = false; let state = false;
if (this.switchstate) { if (this.switchstate) {
this.$message({ this.$message({
message: "请先关闭预置位在进行操作!", message: "请先关闭轮循再进行操作!",
type: "warning" type: "warning"
}); });
state = false; state = false;
...@@ -241,7 +275,6 @@ export default { ...@@ -241,7 +275,6 @@ export default {
return state; return state;
}, },
submitPosion(positionnum) { submitPosion(positionnum) {
debugger
this.taskInfo.mtasks[0].scenes.map(ele => { this.taskInfo.mtasks[0].scenes.map(ele => {
if (ele.scene_unid == this.currentRow.scene_unid) { if (ele.scene_unid == this.currentRow.scene_unid) {
ele.position_num = positionnum; ele.position_num = positionnum;
...@@ -353,6 +386,9 @@ export default { ...@@ -353,6 +386,9 @@ export default {
}); });
} }
}, },
created(){
this.user_unid = window.sessionStorage.getItem("user_unid");
},
watch: { watch: {
// subtaskid(val) { // subtaskid(val) {
// this.loading = true; // this.loading = true;
...@@ -401,14 +437,15 @@ export default { ...@@ -401,14 +437,15 @@ export default {
color #3BB7FF color #3BB7FF
} }
.set-header{ .set-header{
height 3vh height 30px
line-height 3vh line-height 30px
text-align center text-align center
background #ACC1FF background #ACC1FF
} }
.set-item{ .set-item{
height 3vh height 3vh
line-height 3vh line-height 3vh
min-height 30px
padding:0 10px padding:0 10px
color #555555 color #555555
margin-top 1vh margin-top 1vh
......
...@@ -7,6 +7,13 @@ ...@@ -7,6 +7,13 @@
:before-close="handleClose" :before-close="handleClose"
> >
<span> <span>
<el-input placeholder="请输入内容" v-model="paramsval" class="input-with-select">
<el-button
slot="append"
icon="el-icon-search"
@click="$refs.iframe.contentWindow.clickButton(paramsval)"
></el-button>
</el-input>
<iframe <iframe
id="iframe" id="iframe"
ref="iframe" ref="iframe"
...@@ -28,6 +35,7 @@ ...@@ -28,6 +35,7 @@
export default { export default {
data() { data() {
return { return {
paramsval:"",
dialogVisible: false, dialogVisible: false,
XMLStr: "", XMLStr: "",
basicXml: "", basicXml: "",
...@@ -54,21 +62,24 @@ export default { ...@@ -54,21 +62,24 @@ export default {
xmlInit: function(obj) { xmlInit: function(obj) {
this.XMLStr = this.XMLStr =
obj.config.xml || '<?xml version="1.0" encoding="GBK"?><root></root>'; obj.config.xml || '<?xml version="1.0" encoding="GBK"?><root></root>';
console.log("XML:" + this.XMLStr.split("@").length);
if (this.XMLStr.split("@").length > 1) { if (this.XMLStr.split("@").length > 1) {
this.XMLStr = '<?xml version="1.0" encoding="GBK"?><root></root>'; this.XMLStr = '<?xml version="1.0" encoding="GBK"?><root></root>';
} }
this.basicXml = obj.basicConfig.xml; if (obj && obj.basicConfig && obj.basicConfig.xml) {
this.$refs.iframe.contentWindow.loadParameterTree( this.basicXml = obj.basicConfig.xml;
this.basicXml, this.$refs.iframe.contentWindow.loadParameterTree(
this.XMLStr this.basicXml,
); this.XMLStr
);
} else {
console.error("参数配置存在错误!请检测basicConfig是否为空");
}
}, },
save: function() { save: function() {
this.$refs.iframe.contentWindow.submit(); this.$refs.iframe.contentWindow.submit();
//ifram 传递回来的饿xml //ifram 传递回来的饿xml
this.XMLStr = this.$refs.iframe.contentWindow.xmlStr; this.XMLStr = this.$refs.iframe.contentWindow.xmlStr;
this.dialogVisible = false; this.handleClose();
this.$parent.submit(this.XMLStr, "config"); this.$parent.submit(this.XMLStr, "config");
}, },
handleClose(done) { handleClose(done) {
...@@ -78,4 +89,9 @@ export default { ...@@ -78,4 +89,9 @@ export default {
} }
}; };
</script> </script>
<style lang="stylus" scoped></style> <style lang="stylus" scoped>
.input-with-select{
width 300px
margin-bottom 5px;
}
</style>
<template> <template>
<div class="control-box" v-show="showyt"> <div class="control-box" v-show="showyt">
<div class="control-let-box"> <div class="control-let-box">
<div> <div class="yzw-box">
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_UPLEFT')" @mousedown="Ytontroller(5)"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_UPLEFT')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-zuoshang" class="control-btn icon-fanxing-zuoshang"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_UP')" @mousedown="Ytontroller(3)"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_UP')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-shang" class="control-btn icon-fanxing-shang"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_UPRIGHT')" @mousedown="Ytontroller(6)"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_UPRIGHT')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-youshang" class="control-btn icon-fanxing-youshang"
></span> ></span>
</div> </div>
<div> <div class="yzw-box">
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_LEFT')" @mousedown="Ytontroller(1)"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_LEFT')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-zuo" class="control-btn icon-fanxing-zuo"
></span> ></span>
<span <span
@mousedown="Ytontroller('12')" @mousedown="Ytontroller('12')"
@mouseup="stopYtontroller('12')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-zhongzhi" class="control-btn icon-fanxing-zhongzhi"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_RIGHT')" @mousedown="Ytontroller(2)"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_RIGHT')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-you" class="control-btn icon-fanxing-you"
></span> ></span>
</div> </div>
<div> <div class="yzw-box">
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_DOWNLEFT')" @mousedown="Ytontroller(7)"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWNLEFT')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-zuoxia" class="control-btn icon-fanxing-zuoxia"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_DOWN')" @mousedown="Ytontroller(4)"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWN')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-xia" class="control-btn icon-fanxing-xia"
></span> ></span>
<span <span
@mousedown="Ytontroller('SIP_CTRL_PTZ_DOWNRIGHT')" @mousedown="Ytontroller(8)"
@mouseup="stopYtontroller('SIP_CTRL_PTZ_DOWNRIGHT')" @mouseup="stopYtontroller(11)"
class="control-btn icon-fanxing-youxia" class="control-btn icon-fanxing-youxia"
></span> ></span>
</div> </div>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</div> </div>
<div class="right-bottom-box"> <div class="right-bottom-box">
<div class="setyzw item-box"> <div class="setyzw item-box">
<el-input placeholder="预置位编号" v-model="presetindex"></el-input> <el-input placeholder="预置位编号" v-model="presetindex"></el-input>
</div> </div>
<div class="subbtn item-box"> <div class="subbtn item-box">
<el-button @click="subset">确定</el-button> <el-button @click="subset">确定</el-button>
...@@ -108,9 +108,10 @@ export default { ...@@ -108,9 +108,10 @@ export default {
value3: 0, value3: 0,
value4: 0, value4: 0,
presetindex: "", presetindex: "",
curtask:{}, curtask: {}
}; };
}, },
props: ["vchan"],
methods: { methods: {
openyt(curtask) { openyt(curtask) {
if (curtask) { if (curtask) {
...@@ -132,9 +133,27 @@ export default { ...@@ -132,9 +133,27 @@ export default {
* @param {code} * @param {code}
*/ */
Ytontroller(nType, nParam = null) { Ytontroller(nType, nParam = null) {
VionVideo.VionPTZonrol(null, nType, nParam); try {
let vrefid = this.vchan.refid || this.vchan.vchan_refid;
document
.getElementById("VionVideo")
.VionPTZControl(String(vrefid), Number(nType), 1);
} catch (error) {
console.log(error);
}
console.log(nType);
},
stopYtontroller(nType) {
let vrefid = this.vchan.refid || this.vchan.vchan_refid;
document
.getElementById("VionVideo")
.VionPTZControl(String(vrefid), Number(nType), 1);
}, },
subset() { subset() {
let vrefid = this.vchan.refid || this.vchan.vchan_refid;
document
.getElementById("VionVideo")
.VionPTZControl(String(vrefid), Number(18), Number(this.presetindex));
this.$emit("subpostion", this.presetindex); this.$emit("subpostion", this.presetindex);
}, },
deleteytconfig() { deleteytconfig() {
...@@ -217,4 +236,7 @@ export default { ...@@ -217,4 +236,7 @@ export default {
.delbtn { .delbtn {
margin-left:.4vw margin-left:.4vw
} }
.yzw-box .control-btn:hover{
color #409EFF
}
</style> </style>
...@@ -12,20 +12,32 @@ ...@@ -12,20 +12,32 @@
label-width="80px" label-width="80px"
:model="formData" :model="formData"
:rules="rules" :rules="rules"
ref="taskForm"
> >
<el-form-item label="任务名称" prop="taskname" class="form-item"> <el-form-item
label="任务名称"
prop="task_name"
class="form-item"
:rules="[
{ required: true, message: '请输入任务名称', trigger: 'blur' }
]"
>
<el-input <el-input
v-model="formData.task_name" v-model="formData.task_name"
placeholder="请输入任务名称" placeholder="请输入任务名称"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="算法类型" prop="algotype" class="form-item"> <el-form-item
label="算法类型"
prop="task_algo_type"
class="form-item"
>
<el-select <el-select
v-model="formData.task_algo_type" v-model="formData.task_algo_type"
placeholder="请选择" placeholder="请选择"
:popper-append-to-body="false" :popper-append-to-body="false"
> >
<el-option value label="--"></el-option> <el-option value="" label="--"></el-option>
<el-option value="0" label="交通"></el-option> <el-option value="0" label="交通"></el-option>
<el-option value="1" label="客流"></el-option> <el-option value="1" label="客流"></el-option>
<el-option value="2" label="行为分析"></el-option> <el-option value="2" label="行为分析"></el-option>
...@@ -33,13 +45,16 @@ ...@@ -33,13 +45,16 @@
<el-option value="5" label="交通行人"></el-option> <el-option value="5" label="交通行人"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="场景占用" class="form-item"> <el-form-item label="场景占用" class="form-item" prop="resource_use">
<el-input <el-select
v-model="formData.resource_use" v-model="formData.resource_use"
placeholder="请选择" placeholder="请选择"
:popper-append-to-body="false" :popper-append-to-body="false"
> >
</el-input> <el-option value="1" label="1 (200w-300w像素)"></el-option>
<el-option value="2" label="2 (400w-600w像素)"></el-option>
<el-option value="2.5" label="2.5 (700w-900w像素)"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间计划" class="form-item"> <el-form-item label="时间计划" class="form-item">
<el-select v-model="formData.period"> <el-select v-model="formData.period">
...@@ -47,16 +62,33 @@ ...@@ -47,16 +62,33 @@
<el-option :value="false" label="时间"></el-option> <el-option :value="false" label="时间"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="时间" v-show="formData.plate_time != 'day'" prop="timer" class="form-item"> <el-form-item
<el-date-picker label="时间"
style="width:100%" v-show="formData.plate_time != 'day'"
prop="timer"
class="form-item"
>
<!-- <el-date-picker
v-model="formData.timer" v-model="formData.timer"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" type="daterange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
></el-date-picker> ></el-date-picker> -->
<el-time-picker
is-range
style="width:100%"
value-format="HH:mm:ss"
v-model="timer"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围"
:disabled="pedittype != 'add'"
>
</el-time-picker>
</el-form-item> </el-form-item>
<el-form-item label="存储配置" class="form-item"> <el-form-item label="存储配置" class="form-item">
<el-select <el-select
...@@ -73,13 +105,13 @@ ...@@ -73,13 +105,13 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备类型" class="form-item"> <el-form-item label="设备类型" class="form-item">
<el-select v-model="formData.plate_type"> <el-select v-model="formData.plate_type" :disabled="pedittype != 'add'">
<el-option <el-option
v-for="(item, index) in freeList" v-for="(item, index) in platT"
:key="index" :key="index"
:value="item.device_id" :value="item"
> >
{{ item.device_id }} {{ item }}
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -109,26 +141,29 @@ export default { ...@@ -109,26 +141,29 @@ export default {
data() { data() {
return { return {
setvisible: false, setvisible: false,
timer:["00:00:00", "23:59:59"],
formData: { formData: {
task_name: "", task_name: "",
task_algo_type: "", task_algo_type: "",
timer: "",
store_conf: { store_conf: {
unid: "" unid: ""
}, },
priority: "", priority: "normal",
period: true period: true
}, },
vchanAry: [], vchanAry: [],
platT: [],
sessionData: {}, sessionData: {},
store_confs: [], store_confs: [],
rules: { rules: {
taskname: [{ required: true, message: "请输入任务名称", trigger: "blur" }], task_algo_type: [
algotype: [ { required: true, message: "请选择算法类型", trigger: "change" }
{ required: true, message: "请选择算法类型", trigger: "blur" }
], ],
timer: [ stores: [
{ required: true, message: "时间设置不能为空", trigger: "blur" } { required: true, message: "存储配置不能为空!", trigger: "change" }
],
resource_use:[
{ required: true, message: "场景占用不能为空!", trigger: "change" }
] ]
} }
}; };
...@@ -140,33 +175,50 @@ export default { ...@@ -140,33 +175,50 @@ export default {
}, },
freeList: { freeList: {
type: Array, type: Array,
// eslint-disable-next-line vue/require-valid-default-prop
default: [] default: []
} }
}, },
watch: {}, watch: {},
mounted() { mounted() {},
console.log("mounted", this.formData);
},
methods: { methods: {
getFress() {
if (this.freeList && this.freeList.length > 0) {
var freeArr = [];
this.freeList.forEach(ele => {
if (ele.license_info && ele.license_info.platType) {
this.platT.push(ele.license_info.platType);
}
});
this.platT = new Set(this.platT);
}
},
initData(type, pdata) { initData(type, pdata) {
debugger; this.platT = [];
this.setvisible = true; this.setvisible = true;
if (type == "add") { if (type == "add") {
//timer单独拿到form外层是因为element一个bug放到内层后不能修改时间
this.timer = ["00:00:00", "23:59:59"];
this.formData = { this.formData = {
task_name: "", task_name: "",
task_algo_type: "", task_algo_type: "",
timer: "",
store_conf: { store_conf: {
unid: "" unid: ""
}, },
priority: "", priority: "normal",
plate_type: "", plate_type: "",
plate_time: "", plate_time: "",
period: true period: true
}; };
} }
if (type == "edit") { if (type == "edit") {
pdata.timer = [pdata.start_dt, pdata.end_dt]; if (pdata.start_time) {
let startT = pdata.start_time;
let endT = pdata.end_time;
this.timer = [startT, endT];
} else {
this.timer = null;
}
this.formData = pdata; this.formData = pdata;
this.$api.task.getSubTask(pdata.task_id).then(res => { this.$api.task.getSubTask(pdata.task_id).then(res => {
let ary = []; let ary = [];
...@@ -189,6 +241,7 @@ export default { ...@@ -189,6 +241,7 @@ export default {
this.vchanAry = ary; this.vchanAry = ary;
}); });
} }
this.getFress();
}, },
handleClose() { handleClose() {
this.setvisible = false; this.setvisible = false;
...@@ -201,20 +254,16 @@ export default { ...@@ -201,20 +254,16 @@ export default {
}, },
save() { save() {
this.sessionData = JSON.parse(JSON.stringify(this.formData)); this.sessionData = JSON.parse(JSON.stringify(this.formData));
this.setvisible = false;
//
let postData = { let postData = {
task_name: this.formData.task_name, task_name: this.formData.task_name,
task_algo_type: this.formData.task_algo_type, task_algo_type: this.formData.task_algo_type,
source_type: "pull_video_stream", source_type: "pull_video_stream",
dev_unid: this.dev_unid, dev_unid: this.dev_unid,
node_count: 0, node_count: 0,
start_dt: this.formData.period start_dt: "2020-03-27 00:00:00",
? "2020-03-27 00:00:00" end_dt: "3020-03-27 00:00:00",
: this.setUtcTime(this.formData.timer[0]), start_time: this.formData.period ? "00:00:00" : this.timer[0],
end_dt: this.formData.period end_time: this.formData.period ? "23:59:59" : this.timer[1],
? "3020-03-27 00:00:00"
: this.setUtcTime(this.formData.timer[1]),
priority: this.formData.priority, priority: this.formData.priority,
store_conf_unid: this.formData.store_conf.unid, store_conf_unid: this.formData.store_conf.unid,
period: this.formData.period, period: this.formData.period,
...@@ -236,17 +285,24 @@ export default { ...@@ -236,17 +285,24 @@ export default {
} }
}, },
addTask(data) { addTask(data) {
this.$api.task this.$refs["taskForm"].validate(valid => {
.addTask(data, { if (valid) {
"content-type": "multipart/form-data" this.$api.task
}) .addTask(data, {
.then(res => { "content-type": "multipart/form-data"
console.log(res); })
this.$emit("refresh"); .then(res => {
}); this.setvisible = false;
this.$emit("refresh");
});
} else {
console.log("error submit!!");
}
});
}, },
editTask(data) { editTask(data) {
this.$api.task.editTask(data, this.formData.task_id).then(res => { this.$api.task.editTask(data, this.formData.task_id).then(res => {
this.setvisible = false;
this.$emit("refresh"); this.$emit("refresh");
}); });
}, },
...@@ -271,4 +327,3 @@ export default { ...@@ -271,4 +327,3 @@ export default {
margin-bottom 13px margin-bottom 13px
} }
</style> </style>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
@node-click="vchanClick" @node-click="vchanClick"
ref="tree" ref="tree"
@check="handleCheckChange" @check="handleCheckChange"
:render-content="renderContent"
></el-tree> ></el-tree>
</div> </div>
</div> </div>
...@@ -33,10 +34,9 @@ ...@@ -33,10 +34,9 @@
<el-table <el-table
height="286" height="286"
:data="tableData" :data="tableData"
stripe
border border
@current-change="rowclick" @current-change="rowclick"
style="width: 100%" width="300"
> >
<el-table-column <el-table-column
align="center" align="center"
...@@ -190,11 +190,11 @@ export default { ...@@ -190,11 +190,11 @@ export default {
} }
}, },
handleCheckChange(data, node) { handleCheckChange(data, node) {
console.log(node); console.log(data);
let staus = false; let staus = false;
if (this.tableData.length > 0) { if (this.tableData.length > 0) {
for (let i = 0; i < this.tableData.length; i++) { for (let i = 0; i < this.tableData.length; i++) {
if (this.tableData[i].vchan_id == data.vchan_id) { if (this.tableData[i].vchan_refid == data.vchan_refid) {
this.delFun(i, this.tableData[i], "tree"); this.delFun(i, this.tableData[i], "tree");
staus = true; staus = true;
break; break;
...@@ -222,10 +222,14 @@ export default { ...@@ -222,10 +222,14 @@ export default {
vchan_duid: vchan.duid || vchan.vchan_duid, vchan_duid: vchan.duid || vchan.vchan_duid,
vdev_unid: this.dev_unid, vdev_unid: this.dev_unid,
vchan_name: vchan.name vchan_name: vchan.name
},
assign_to: {
id: this.taskData.plate_type,
flag: 1
} }
}; };
this.$api.task.editSubTask(this.editData.task_id, data).then(res => { this.$api.task.editSubTask(this.editData.task_id, data).then(res => {
if (res.ecode == 200) { if (res && res.ecode != "500") {
this.$message({ this.$message({
message: "添加成功", message: "添加成功",
type: "success" type: "success"
...@@ -240,6 +244,7 @@ export default { ...@@ -240,6 +244,7 @@ export default {
console.log("b", data); console.log("b", data);
}, },
delFun(index, data, action = "tree") { delFun(index, data, action = "tree") {
console.log("da",data);
this.$store.commit("setocxstate", 0); this.$store.commit("setocxstate", 0);
this.$confirm("删除视频源, 是否继续?", "提示", { this.$confirm("删除视频源, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
...@@ -286,16 +291,17 @@ export default { ...@@ -286,16 +291,17 @@ export default {
this.tableData.forEach(ele => { this.tableData.forEach(ele => {
arr.push(ele.vchan_refid); arr.push(ele.vchan_refid);
}); });
console.log(arr)
this.$refs.tree.setCheckedKeys(arr); this.$refs.tree.setCheckedKeys(arr);
}, },
rowclick(row) { rowclick(row) {
console.log("row", row); // console.log("row", row);
this.play_url = { // this.play_url = {
rtsp_url: row.play_url // rtsp_url: row.play_url
}; // };
setTimeout(() => { // setTimeout(() => {
this.$refs.video.videoPlay(); // this.$refs.video.videoPlay();
}, 100); // }, 100);
}, },
loadNode(node, resolve) { loadNode(node, resolve) {
if (node.level === 0) { if (node.level === 0) {
...@@ -351,11 +357,13 @@ export default { ...@@ -351,11 +357,13 @@ export default {
if (vchan.leaf) { if (vchan.leaf) {
vchan.childs = ""; vchan.childs = "";
} }
vchan.vchan_refid = vchan.refid || vchan.vchan_refid
} }
resolve(vchans); resolve(vchans);
setTimeout(() => { setTimeout(() => {
this.checkvckan(); this.checkvckan();
}, 0); }, 200);
}); });
return; return;
} }
...@@ -380,6 +388,19 @@ export default { ...@@ -380,6 +388,19 @@ export default {
} }
return resolve(node.data.childs); return resolve(node.data.childs);
}, },
renderContent(h, { node, data, store }){
return (
<span class="custom-tree-node">
<el-tooltip
class="item"
effect="dark"
content={node.label}
placement="top-start"
>
<span>{node.label}</span>
</el-tooltip>
</span>);
},
vchanClick(node) { vchanClick(node) {
if (!node.refid && !node.vchan_refid) { if (!node.refid && !node.vchan_refid) {
return; return;
...@@ -435,14 +456,14 @@ export default { ...@@ -435,14 +456,14 @@ export default {
}, },
getSipSetting: function(refid) { getSipSetting: function(refid) {
if (this.dev_unid) { if (this.dev_unid) {
this.$api.device.setsip(this.dev_unid, this.user_unid).then(res => { this.$api.device.sipSet(this.dev_unid, this.user_unid).then(res => {
if (!res.ecode) { if (!res.ecode) {
console.log("获取sip配置返回:", JSON.stringify(res.data)); console.log("获取sip配置返回:", JSON.stringify(res));
this.playUrl = res.res; this.play_url = res;
this.playUrl.devId = refid; this.play_url.devId = refid;
console.log("playUrl", JSON.stringify(res)); console.log("playUrl", JSON.stringify(res));
for (let attr of Object.keys(this.playUrl)) { for (let attr of Object.keys(this.play_url)) {
if (this.playUrl[attr] === "") { if (this.play_url[attr] === "") {
setTimeout(() => { setTimeout(() => {
this.$message({ this.$message({
message: "获取播放地址失败,请前往配置sip服务!!请重试!", message: "获取播放地址失败,请前往配置sip服务!!请重试!",
...@@ -454,7 +475,7 @@ export default { ...@@ -454,7 +475,7 @@ export default {
} }
setTimeout(() => { setTimeout(() => {
this.$refs.video.videoPlay(); this.$refs.video.videoPlay();
}, 0); }, 100);
} else { } else {
this.$message({ this.$message({
message: "获取播放地址失败,请前往配置sip服务!!请重试!", message: "获取播放地址失败,请前往配置sip服务!!请重试!",
...@@ -480,19 +501,28 @@ export default { ...@@ -480,19 +501,28 @@ export default {
console.log(data); console.log(data);
}, },
handleClose() { handleClose() {
this.setvisible = false; let video_ocx = document.getElementById("VionVideo");
this.$store.commit("setocxstate", 0); try {
this.$refs.tree.setCheckedKeys([]); let stopRes = video_ocx.StopPlaySip(0);
let stopRtspRes = video_ocx.StopPlay(0);
this.setvisible = false;
this.$store.commit("setocxstate", 0);
this.$refs.tree.setCheckedKeys([]);
} catch (error) {
this.setvisible = false;
console.log(error);
}
}, },
save() { save() {
this.setvisible = false; this.setvisible = false;
this.$emit("refresh");
}, },
moveFun(index, row) { moveFun(index, row) {
this.$refs.movetask.initMoveTask(row, this.taskData); this.$refs.movetask.initMoveTask(row, this.taskData);
} }
}, },
created() { created() {
this.user_unid = window.localStorage.getItem("user_unid"); this.user_unid = window.sessionStorage.getItem("user_unid");
} }
}; };
</script> </script>
...@@ -536,6 +566,8 @@ export default { ...@@ -536,6 +566,8 @@ export default {
} }
.rightBox { .rightBox {
float: left; float: left;
width: 599px;
overflow: hidden;
} }
.imgBox { .imgBox {
width: 587px; width: 587px;
...@@ -543,4 +575,4 @@ export default { ...@@ -543,4 +575,4 @@ export default {
border: 1px solid #444444; border: 1px solid #444444;
margin-bottom: 14px; margin-bottom: 14px;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="rightBox"> <div class="rightBox">
<img src="../../assets/img/taskmanage/pic1.png" alt="" /> <img src="../../assets/img/taskmanage/pic1.png" alt="" />
<span class="textCon"> <span class="textCon">
<div class="topText">80</div> <div class="topText">{{ workers.video_free }}</div>
<div class="bottomText">可用分析资源</div> <div class="bottomText">可用分析资源</div>
</span> </span>
</div> </div>
...@@ -20,15 +20,23 @@ ...@@ -20,15 +20,23 @@
<div class="rightBox"> <div class="rightBox">
<img src="../../assets/img/taskmanage/pic2.png" alt="" /> <img src="../../assets/img/taskmanage/pic2.png" alt="" />
<span class="textCon"> <span class="textCon">
<div class="topText">80</div> <div class="topText">{{ workers.video_busy }}</div>
<div class="bottomText">在用分析资源</div> <div class="bottomText">在用分析资源</div>
</span> </span>
</div> </div>
<span class="border"></span> <span class="border"></span>
<div class="rightBox"> <div class="rightBox">
<img src="../../assets/img/taskmanage/run1.png" alt="" />
<span class="textCon">
<div class="topText">{{ taskstatus.running }}</div>
<div class="bottomText">运行任务数量</div>
</span>
</div>
<span class="border"></span>
<div class="rightBox">
<img src="../../assets/img/taskmanage/pic3.png" alt="" /> <img src="../../assets/img/taskmanage/pic3.png" alt="" />
<span class="textCon"> <span class="textCon">
<div class="topText">{{total}}</div> <div class="topText">{{ taskstatus.total }}</div>
<div class="bottomText">任务数量</div> <div class="bottomText">任务数量</div>
</span> </span>
</div> </div>
...@@ -76,7 +84,7 @@ ...@@ -76,7 +84,7 @@
@expand-change="expandchange" @expand-change="expandchange"
> >
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="props" > <template slot-scope="props">
<subTaskInfo <subTaskInfo
v-for="(item, index) in props.row.subTaskData" v-for="(item, index) in props.row.subTaskData"
:key="index" :key="index"
...@@ -93,16 +101,16 @@ ...@@ -93,16 +101,16 @@
prop="num" prop="num"
:formatter="numFormatter" :formatter="numFormatter"
label="序号" label="序号"
width="60"
> >
</el-table-column> </el-table-column>
<el-table-column prop="task_name" align="center" label="任务名称"> <el-table-column prop="task_name" align="center" label="任务名称">
</el-table-column> </el-table-column>
<el-table-column align="center" label="状态"> <el-table-column align="center" label="状态">
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-html="statusFormatter(scope.row)"> <div v-html="statusFormatter(scope.row)"></div>
</div> </template>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -119,8 +127,6 @@ ...@@ -119,8 +127,6 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="resource_use" label="场景占用"> <el-table-column align="center" prop="resource_use" label="场景占用">
</el-table-column> </el-table-column>
<el-table-column align="center" prop="workers_count" label="资源用量">
</el-table-column>
<el-table-column align="center" prop="plate_type" label="设备类型"> <el-table-column align="center" prop="plate_type" label="设备类型">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -139,7 +145,7 @@ ...@@ -139,7 +145,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
width="300" width="240"
prop="operation" prop="operation"
label="操作" label="操作"
> >
...@@ -167,8 +173,12 @@ ...@@ -167,8 +173,12 @@
@click="editTask('edit', scope.$index, scope.row)" @click="editTask('edit', scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span
class="tableSpanBorder"
v-show="scope.row.status != 'Running'"
></span>
<el-tooltip <el-tooltip
v-show="scope.row.status != 'Running'"
content="启动" content="启动"
placement="bottom" placement="bottom"
effect="light" effect="light"
...@@ -179,8 +189,12 @@ ...@@ -179,8 +189,12 @@
@click="setTaskStatus(scope.row, 'start')" @click="setTaskStatus(scope.row, 'start')"
></span> ></span>
</el-tooltip> </el-tooltip>
<span class="tableSpanBorder"></span> <span
class="tableSpanBorder"
v-show="scope.row.status == 'Running'"
></span>
<el-tooltip <el-tooltip
v-show="scope.row.status == 'Running'"
content="暂停" content="暂停"
placement="bottom" placement="bottom"
effect="light" effect="light"
...@@ -242,7 +256,9 @@ ...@@ -242,7 +256,9 @@
import editset from "./editSet"; import editset from "./editSet";
import editvideo from "./editVideo"; import editvideo from "./editVideo";
import subTaskInfo from "./subtask.vue"; import subTaskInfo from "./subtask.vue";
import mixin from "../../assets/js/mixin";
export default { export default {
mixins: [mixin],
data() { data() {
return { return {
task_name: "", task_name: "",
...@@ -257,7 +273,6 @@ export default { ...@@ -257,7 +273,6 @@ export default {
editForm: {}, editForm: {},
tableData: [], tableData: [],
subTaskData: [], subTaskData: [],
pedittype: "add", pedittype: "add",
currentRow: {}, currentRow: {},
assign_ip: "" assign_ip: ""
...@@ -268,10 +283,7 @@ export default { ...@@ -268,10 +283,7 @@ export default {
editvideo, editvideo,
subTaskInfo subTaskInfo
}, },
mounted() {
this.getTaskList();
this.getFreelist();
},
methods: { methods: {
expandchange(row, prow) { expandchange(row, prow) {
if (!row.isexpand) { if (!row.isexpand) {
...@@ -285,15 +297,19 @@ export default { ...@@ -285,15 +297,19 @@ export default {
data[i].vchan.subtask_id = data[i].subtask_id; data[i].vchan.subtask_id = data[i].subtask_id;
data[i].vchan.refid = data[i].vchan.vchan_refid; data[i].vchan.refid = data[i].vchan.vchan_refid;
data[i].vchan.name = data[i].vchan.vchan_name; data[i].vchan.name = data[i].vchan.vchan_name;
data[i].vchan.assign_id = data[i].assign_to ?data[i].assign_to.id : ""; data[i].vchan.assign_id = data[i].assign_to
} else { ? data[i].assign_to.id
data.vchan = { : "";
subtask_id: data[i].subtask_id, data[i].vchan.device_ip = data[i].device_in_ip
refid: "", ? data[i].device_in_ip
vchan_name: data[i].subtask_name, : "";
name: data[i].subtask_name, data[i].vchan.video_busy = data[i].video_busy
assign_id: data[i].assign_id ? data[i].assign_to.id : "" ? data[i].video_busy
}; : "";
data[i].vchan.video_total = data[i].video_total
? data[i].video_total
: "";
data[i].vchan.plate_type = row.plate_type ? row.plate_type : "";
} }
ary.push(data[i].vchan); ary.push(data[i].vchan);
} }
...@@ -340,8 +356,8 @@ export default { ...@@ -340,8 +356,8 @@ export default {
if (row.period) { if (row.period) {
return "全天"; return "全天";
} else { } else {
let startDate = cellValue ? cellValue.split(" ")[0] : ""; let startDate = row.start_time ? row.start_time.split(" ")[0] : "";
let endDate = row.end_dt ? row.end_dt.split(" ")[0] : ""; let endDate = row.end_time ? row.end_time.split(" ")[0] : "";
return startDate + " ~ " + endDate; return startDate + " ~ " + endDate;
} }
}, },
...@@ -457,7 +473,13 @@ export default { ...@@ -457,7 +473,13 @@ export default {
} }
}); });
}); });
} },
},
mounted() {
this.getTaskList();
},
created() {
this.getFreelist();
} }
}; };
</script> </script>
...@@ -546,6 +568,16 @@ export default { ...@@ -546,6 +568,16 @@ export default {
} }
.rightBox:nth-of-type(3) { .rightBox:nth-of-type(3) {
img { img {
width: 40px;
height: 40px;
margin-left: 1vw;
}
.textCon {
margin-right: 114px;
}
}
.rightBox:nth-of-type(4) {
img {
width: 34px; width: 34px;
height: 35px; height: 35px;
margin-left: 1vw; margin-left: 1vw;
...@@ -581,7 +613,7 @@ export default { ...@@ -581,7 +613,7 @@ export default {
} }
.pauseIcon { .pauseIcon {
cursor: pointer; cursor: pointer;
color: #ffc62e; color: #c4c4c4;
font-size: 14px; font-size: 14px;
} }
.delIcon { .delIcon {
......
<template> <template>
<div class="expande-table-row"> <div class="expande-table-row">
<span class="label">{{subindex + 1}}</span> <span class="label">{{ subindex + 1 }}</span>
<span class="label">视频源文件</span> <span class="label">视频源文件</span>
<span class="subtask-info">{{ subTaskData.vchan_name }}</span> <span class="subtask-info">{{ subTaskData.vchan_name }}</span>
<span class="label">任务ID</span> <span class="label">任务ID</span>
<span class="subtask-info">{{subTaskData.subtask_id}}</span> <span class="subtask-info">{{ subTaskData.subtask_id }}</span>
<span class="label">设备地址</span> <span class="label">设备地址</span>
<span class="subtask-info">192.178.99.99</span> <span class="subtask-info">{{ subTaskData.device_ip }}</span>
<span class="label">已用资源</span> <span class="label">已用资源</span>
<span class="subtask-info">22</span> <span class="subtask-info">{{ subTaskData.video_busy }}</span>
<span class="label">设备容量</span> <span class="label">设备容量</span>
<span class="subtask-info">33</span> <span class="subtask-info">{{ subTaskData.video_total }}</span>
<span class="label">指定设备下发</span> <span class="label">指定设备下发</span>
<span class="subtask-info"> <span class="subtask-info">
<el-select v-model="assign_id"> <el-select v-model="assign_id">
...@@ -18,8 +18,19 @@ ...@@ -18,8 +18,19 @@
v-for="(item, index) in freeList" v-for="(item, index) in freeList"
:key="index" :key="index"
:value="item.device_id" :value="item.device_id"
:label="item.in_ip"
v-if="subTaskData.plate_type && item.license_info.platType === subTaskData.plate_type"
> >
{{ item.device_id }} {{ item.in_ip }} {{ item.license_info.platType }}
</el-option>
<el-option
v-for="(item, index) in freeList"
:key="index"
:value="item.device_id"
:label="item.in_ip"
v-if="!subTaskData.plate_type"
>
{{ item.in_ip }} {{ item.license_info.platType }}
</el-option> </el-option>
</el-select> </el-select>
</span> </span>
...@@ -66,12 +77,11 @@ export default { ...@@ -66,12 +77,11 @@ export default {
}); });
} }
}, },
created() {}, created() {
watch: { console.log(this.subTaskData);
}, },
watch: {},
mounted() { mounted() {
console.log("tasdata",this.subTaskData)
this.assign_id = this.subTaskData.assign_id this.assign_id = this.subTaskData.assign_id
? this.subTaskData.assign_id ? this.subTaskData.assign_id
: ""; : "";
......
<template> <template>
<div> <div>
<div class="chart-header-box"> <div class="chart-header-box">
<el-col :span="12" class="header-title">事件类型分布</el-col> <el-col :span="12" class="header-title">违法事件类型分布</el-col>
<el-col class="ev-box"> <el-col class="ev-box">
<el-select v-model="evtype" @change="getType"> <el-select v-model="evtype" @change="getType">
<el-option label="违法" value="1"></el-option> <el-option label="违法" value="1"></el-option>
......
<template> <template>
<div> <div>
<div class="chart-header-box"> <div class="chart-header-box">
<el-col :span="5" class="header-title">违法事件趋势</el-col> <el-col :span="6" class="header-title">违法事件发生趋势</el-col>
<div class="sel-box"> <div class="sel-box">
<span class="header-label">违法</span> <span class="header-label">违法</span>
<div class="header-select"> <div class="header-select">
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div style="clear: both;"></div> <div style="clear: both;"></div>
<el-row> <el-row>
<div class="collect-box card-hover"> <div class="collect-box card-hover">
<div class="header-title">重点车辆分布</div> <div class="header-title">今日数据统计</div>
<div class="collect-content"> <div class="collect-content">
<el-col :span="6" class="content-item"> <el-col :span="6" class="content-item">
<div class="zd-icon" style="color:#FF9630"> <div class="zd-icon" style="color:#FF9630">
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
></a> ></a>
<div class="" id="t-popup-content"></div> <div class="" id="t-popup-content"></div>
</div> </div>
<div id="videopopup" class="ol-popup"> <div id="videopopup" class="ol-popup video-popup">
<a <a
href="#" href="#"
id="popup-closer" id="popup-closer"
...@@ -20,11 +20,20 @@ ...@@ -20,11 +20,20 @@
<div class="mapvideo"> <div class="mapvideo">
<videoPlay ref="mapvideo" :playurl="playurl"></videoPlay> <videoPlay ref="mapvideo" :playurl="playurl"></videoPlay>
</div> </div>
<div class="video-info">
<el-col class="info-item" :span="24">
视频源名称:{{ curtaskname }}
</el-col>
<el-col class="info-item" :span="24">坐标点:{{ pcoordinate }}</el-col>
<el-col class="info-item" :span="24">
算法类型:{{ setalgo(curSubtask.task_algo_type) }}
</el-col>
</div>
</div> </div>
<div id="taskinfopopup" class="ol-popup info-popup"> <div id="taskinfopopup" class="ol-popup info-popup">
<div> <div>
<!-- <span>{{ infoData.vchan_name }}</span> --> <!-- <span>{{ infoData.vchan_name }}</span> -->
<span>鼠标点击显示视频</span> <span>{{ curtaskname }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -81,7 +90,7 @@ var closer = ""; ...@@ -81,7 +90,7 @@ var closer = "";
var taskcloser = ""; var taskcloser = "";
var overlay = ""; var overlay = "";
var infooverlay = ""; var infooverlay = "";
var mapcenter = [120.324447, 36.074594]; var mapcenter = [120.324447, 36.074594];
var RotateNorthControl = (function(Control) { var RotateNorthControl = (function(Control) {
function RotateNorthControl(opt_options) { function RotateNorthControl(opt_options) {
var options = opt_options || {}; var options = opt_options || {};
...@@ -120,7 +129,11 @@ export default { ...@@ -120,7 +129,11 @@ export default {
return { return {
devList: [], devList: [],
playurl: {}, playurl: {},
infoData: {} subtaskList: [],
infoData: {},
curtaskname: "",
pcoordinate: "",
curSubtask: {}
}; };
}, },
components: { components: {
...@@ -223,16 +236,14 @@ export default { ...@@ -223,16 +236,14 @@ export default {
map.on("click", e => { map.on("click", e => {
var pixel = map.getEventPixel(e.originalEvent); var pixel = map.getEventPixel(e.originalEvent);
console.log("地图坐标", e.coordinate);
//点击相机标注点 //点击相机标注点
map.forEachFeatureAtPixel(pixel, function(feature) { map.forEachFeatureAtPixel(pixel, function(feature) {
// var coodinate = e.coordinate;
// _this.unid = feature.getProperties().unid;
// Overlay.setPosition(coodinate);
// map.addOverlay(Overlay);
//播放视频操作
let data = feature.getProperties().cameraInfo; let data = feature.getProperties().cameraInfo;
that.playvideo(data); that.playvideo(data);
console.log("视频播放地址", data); that.curtaskname = data.name;
that.getSubTaskInfo(data.refid);
that.pcoordinate = `${data.longitude},${data.latitude}`;
}); });
}); });
//鼠标移入标注点 //鼠标移入标注点
...@@ -242,6 +253,7 @@ export default { ...@@ -242,6 +253,7 @@ export default {
map.forEachFeatureAtPixel(pixel, function(feature) { map.forEachFeatureAtPixel(pixel, function(feature) {
let data = feature.getProperties().cameraInfo; let data = feature.getProperties().cameraInfo;
that.infoData = data; that.infoData = data;
that.curtaskname = data.name;
that.showTaskInfo(data); that.showTaskInfo(data);
}); });
} else { } else {
...@@ -249,6 +261,7 @@ export default { ...@@ -249,6 +261,7 @@ export default {
} }
}); });
}, },
movemap(data, point, type) { movemap(data, point, type) {
let pos = point ? point : [120.324447, 36.074594]; let pos = point ? point : [120.324447, 36.074594];
Views.animate({ Views.animate({
...@@ -380,19 +393,6 @@ export default { ...@@ -380,19 +393,6 @@ export default {
} }
}); });
map.addOverlay(overlay); map.addOverlay(overlay);
// if (data.vchan_name == "视频1") {
// obj.rtsp_url =
// "rtsp://192.168.9.133:8554//opt/data/vedio/1579253441478.264";
// } else if (data.vchan_name == "视频2") {
// obj.rtsp_url =
// "rtsp://192.168.9.133:8554//opt/data/vedio/1577516797543.264";
// }
// this.playurl = obj;
// // this.$store.commit('setocxstate', 1)
// setTimeout(() => {
// this.$refs.mapvideo.videoPlay();
// }, 100);
console.log(data);
let vrefid = data.vchan_refid ? data.vchan_refid : data.refid; let vrefid = data.vchan_refid ? data.vchan_refid : data.refid;
// 获取视频流 // 获取视频流
this.$api.device.getFxStream(this.dev_unid, vrefid).then(res => { this.$api.device.getFxStream(this.dev_unid, vrefid).then(res => {
...@@ -405,7 +405,6 @@ export default { ...@@ -405,7 +405,6 @@ export default {
break; break;
} }
} }
console.log('playurl', obj)
this.playurl = obj; this.playurl = obj;
this.$refs.mapvideo.videoPlay(); this.$refs.mapvideo.videoPlay();
} else { } else {
...@@ -416,6 +415,36 @@ export default { ...@@ -416,6 +415,36 @@ export default {
} }
}); });
}, },
getSubTaskInfo(refid) {
if (this.subtaskList.length > 0) {
for (let i = 0; i < this.subtaskList.length; i++) {
if (refid == this.subtaskList[i].vchan.vchan_refid) {
this.curSubtask = this.subtaskList[i];
break;
}
}
}
},
setalgo(id) {
let algotype = "";
switch (id) {
case "0":
algotype = "交通";
break;
case "1":
algotype = "客流";
break;
case "2":
algotype = "客流";
break;
case "3":
algotype = "违停";
break;
default:
break;
}
return algotype;
},
getDevList() { getDevList() {
this.$api.show.getDevList(this.dev_unid).then(res => { this.$api.show.getDevList(this.dev_unid).then(res => {
let devlist = []; let devlist = [];
...@@ -451,6 +480,11 @@ export default { ...@@ -451,6 +480,11 @@ export default {
// this.InitMap(); // this.InitMap();
} }
}, },
created() {
this.$api.task.getSubTask("").then(res => {
this.subtaskList = res;
});
},
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
this.getDevList(); this.getDevList();
...@@ -506,6 +540,9 @@ export default { ...@@ -506,6 +540,9 @@ export default {
.img-popup { .img-popup {
height auto height auto
} }
.video-popup{
padding-bottom 75px
}
.ol-popup:after, .ol-popup:before { .ol-popup:after, .ol-popup:before {
top: 100%; top: 100%;
border: solid transparent; border: solid transparent;
...@@ -546,13 +583,15 @@ export default { ...@@ -546,13 +583,15 @@ export default {
} }
} }
.info-popup { .info-popup {
width 125px; width 150px;
text-align center
height 30px; height 30px;
line-height 30px; line-height 30px;
border-radius 5px border-radius 5px
padding 0 0 0 10px; padding 0 10px;
color #fff; color #fff;
background #333; background #333;
ovflow hidden
} }
.info-popup:after { .info-popup:after {
disply block disply block
...@@ -582,4 +621,11 @@ export default { ...@@ -582,4 +621,11 @@ export default {
height 100%; height 100%;
width 100%; width 100%;
} }
.video-info {
height 100px;
}
.info-item{
margin-bottom 4px;
color #66676a
}
</style> </style>
// const fs = require("fs");
// const readlineSync = require("readline-sync");
// const readline = require("readline");
// // 获取当前版本信息
// const vinfopath = "./public/js/version.json";
// var vinfo = fs.readFileSync(vinfopath, "utf8");
// console.log(vinfo);
// // 新版本设置
// var versionnum = readlineSync.question("new Vsersion:");
// var reg = /\d.\d.\d/;
// if (versionnum != "" && reg.test(versionnum)) {
// var varr = versionnum.split(".");
// var oldv = JSON.parse(vinfo).version.split(".");
// if (varr[0] >= oldv[0] && varr[1] >= oldv[1] && varr[2] > oldv[2]) {
// console.log(versionnum);
// } else {
// throw "新版本号必须大于旧版本号!";
// }
// } else {
// throw "版本号错误";
// }
// var info = readlineSync.question("EditInfo:", "utf8", {
// encoding:"UTF-8",
// hideEchoBack: true // The typed text on screen is hidden by `*` (default).
// });
// var buginfo = readlineSync.question("BugInfo:", "utf8", {
// encoding:"utf-8",
// hideEchoBack: true // The typed text on screen is hidden by `*` (default).
// });
// console.log(buginfo)
// var verinfo = fs.openSync(vinfopath, "w+");
// var obj = {
// version: versionnum,
// Info: info,
// Bug: buginfo,
// date: new Date()
// };
// var options = { encoding: 'UTF-8', mode: 438 /*=0666*/, flag: 'w' };
// fs.writeFileSync(verinfo, JSON.stringify(obj), options);
module.exports = { module.exports = {
lintOnSave: false, lintOnSave: false,
publicPath: process.env.NODE_ENV === "production" ? "./" : "/", publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
...@@ -9,17 +51,19 @@ module.exports = { ...@@ -9,17 +51,19 @@ module.exports = {
} }
} }
}, },
devServer:{ pluginOptions: {
proxy: { // 第三方插件配置
"/api": { },
target: "http://vion-panda.51vip.biz:52510", // 要访问的接口域名 devServer: {
ws: true, // 是否启用websockets proxy: {
changeOrigin: true, //开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题 "/api": {
pathRewrite: { target: "http://vion-panda.51vip.biz:52510", // 要访问的接口域名
"^/api": "" //这里理解成用'/api'代替target里面的地址,比如我要调用'http://40.00.100.100:3002/user/add',直接写'/api/user/add'即可 ws: true, // 是否启用websockets
} changeOrigin: true, //开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
} pathRewrite: {
} "^/api": "" //这里理解成用'/api'代替target里面的地址,比如我要调用'http://40.00.100.100:3002/user/add',直接写'/api/user/add'即可
} }
}
}
}
}; };
...@@ -6568,6 +6568,12 @@ rimraf@2.6.3: ...@@ -6568,6 +6568,12 @@ rimraf@2.6.3:
dependencies: dependencies:
glob "^7.1.3" glob "^7.1.3"
rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
dependencies:
glob "^7.1.3"
ripemd160@^2.0.0, ripemd160@^2.0.1: ripemd160@^2.0.0, ripemd160@^2.0.1:
version "2.0.2" version "2.0.2"
resolved "https://registry.npm.taobao.org/ripemd160/download/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" resolved "https://registry.npm.taobao.org/ripemd160/download/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!