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