Commit fe11597d by 潘建波

违停设置提交

1 parent 5e95618e
No preview for this file type
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
<style lang="scss"> <style lang="scss">
#app { #app {
height: 100%; height: 100%;
font-family: MicrosoftYaHeiUI; font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
......
...@@ -69,5 +69,8 @@ export default { ...@@ -69,5 +69,8 @@ export default {
}, },
getRebootSetting(params,id,id2){ getRebootSetting(params,id,id2){
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/reboot/auto`, params) return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs/${id2}/reboot/auto`, params)
},
downloadOcx(params) {
return api.get(`${baseUrl}/api/v1/devconf_fx/dlfile`, params)
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -39,5 +39,17 @@ export default { ...@@ -39,5 +39,17 @@ export default {
getDevList(devid) { getDevList(devid) {
// 获取设备信息 // 获取设备信息
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/9cb6e39adc5176b81879f6c22f1d962/vchan_struct?typea=1&s=1578967233185&limit=1000000`); return api.get(`${baseUrl}/api/v1/devconf_fx/devs/9cb6e39adc5176b81879f6c22f1d962/vchan_struct?typea=1&s=1578967233185&limit=1000000`);
} },
addShowUrl(params) {
//添加展示
return api.post(`${baseUrl}/api/v1/datahandle/vchan/conf`, params);
},
editShowUrl(params, unid) {
//添加展示
return api.post(`${baseUrl}/api/v1/datahandle/vchan/conf/${unid}`, params);
},
getShowUrl(params) {
//修改展示
return api.get(`${baseUrl}/api/v1/datahandle/vchan/conf`, params);
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -27,8 +27,8 @@ export default { ...@@ -27,8 +27,8 @@ export default {
getSubTask(taskid) { getSubTask(taskid) {
return api.get(urls.getSubTask(taskid)); return api.get(urls.getSubTask(taskid));
}, },
getStream(devid, vrefid) { getStream(devid, vrefid, params) {
return api.get(urls.getstream(devid, vrefid)); return api.post(urls.getstream(devid, vrefid), params);
}, },
getPlayUrl(subid) { getPlayUrl(subid) {
return api.get(urls.getPlayUrl(subid)); // 获取播放地址 return api.get(urls.getPlayUrl(subid)); // 获取播放地址
...@@ -47,5 +47,14 @@ export default { ...@@ -47,5 +47,14 @@ export default {
}, },
setTaskStatus(taskid, params) { setTaskStatus(taskid, params) {
return api.post(urls.changeTask(taskid), params); return api.post(urls.changeTask(taskid), params);
},
moveTask(taskid, params) {
return api.post(urls.movetask(taskid), params);
},
switchScene(taskid, subtaskid, scene_unid) {
return api.get(urls.switchScene(taskid, subtaskid, scene_unid));
},
suspendAlternate(taskid, subtaskid, suspend) {
return api.get(urls.suspendAlternate(taskid, subtaskid, suspend));
} }
}; };
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
return `${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtask`; return `${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtask`;
}, },
getstream: (devid, vrefid) => { getstream: (devid, vrefid) => {
return `${baseUrl}/api/v1/stream/devs/${devid}/vchans/${vrefid}/live/is_sending?s=${gitTimer()}`; return `${baseUrl}/api/v1/devconf_fx/devs/${devid}/vchans/${vrefid}/live`;
}, },
getPlayUrl: subid => { getPlayUrl: subid => {
return `${baseUrl}/api/v1/devconf_fx/analyse/live/play_url?subtask_id=${subid}`; // 获取播放地址 return `${baseUrl}/api/v1/devconf_fx/analyse/live/play_url?subtask_id=${subid}`; // 获取播放地址
...@@ -42,5 +42,14 @@ export default { ...@@ -42,5 +42,14 @@ export default {
}, },
changeTask: taskid => { changeTask: taskid => {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/start_or_stop?s=${gitTimer()}`; // 切换任务 return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/start_or_stop?s=${gitTimer()}`; // 切换任务
},
movetask: taskid => {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/mount`; // 迁移任务
},
switchScene: (taskid, subtaskid, scene_unid) => {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/switch_scene?scene_unid=${scene_unid}`; // 切换预置位
},
suspendAlternate: (taskid, subtaskid, suspend) => {
return `${baseUrl}/api/v1/devconf_fx/tasks/${taskid}/subtask/${subtaskid}/suspend_alternate_task?suspend=${suspend}`; // 开启关闭轮询
} }
}; };
html,body{ html,body{
height: 100%; height: 100%;
} }
*{ *{
padding: 0; padding: 0;
...@@ -267,3 +268,23 @@ body{ ...@@ -267,3 +268,23 @@ body{
-moz-transition: all .25s ease; -moz-transition: all .25s ease;
transition: all .25s ease; transition: all .25s ease;
} }
.statusbox {
display: inline-block;
width: 60px;
border-radius: 2px;
background:rgba(204,204,204,1);
color: #fff;
font-size: 14px;
}
.runningbox {
background: #36BEA6;
}
.finishedbox{
background:rgba(255,198,46,1);
}
.pausebox{
background:rgba(232,84,30,1);
}
.errorbox{
}
\ No newline at end of file \ No newline at end of file
...@@ -33,3 +33,7 @@ new Vue({ ...@@ -33,3 +33,7 @@ new Vue({
store, store,
render: h => h(App) render: h => h(App)
}).$mount("#app"); }).$mount("#app");
//用户退出时清除相关信息
// window.onunload = function() {
// localStorage.clear();
// };
...@@ -127,131 +127,159 @@ export default { ...@@ -127,131 +127,159 @@ export default {
this.getDev(); this.getDev();
this.getMenu(res.user_unid); this.getMenu(res.user_unid);
} }
}).catch((err) => {
}) })
.catch(err => {});
}, },
getMenu(id){ getMenu(id) {
//获取菜单 //获取菜单
this.$api.login.getMenus({ this.$api.login
"shape":"tree" .getMenus({
}).then(res=>{ shape: "tree"
localStorage.setItem('menu', JSON.stringify(res.menu_tree[0].children))
this.$store.dispatch('GetMenuRole',res.menu_tree[0].children).then(res => {
this.$router.push('/trficcshow')
})
}) })
.then(res => {
localStorage.setItem(
"menu",
JSON.stringify(res.menu_tree[0].children)
);
this.$store
.dispatch("GetMenuRole", res.menu_tree[0].children)
.then(res => {
this.$router.push("/trficcshow");
});
});
}, },
algoList() { algoList() {
this.$api.login.algocombs({ this.$api.login
limit: '', .algocombs({
algo_set: 'video' limit: "",
}).then(res => { algo_set: "video"
if(!res.ecode){ })
this.$store.commit(types.ALGO,res.list_data); .then(res => {
if (!res.ecode) {
this.$store.commit(types.ALGO, res.list_data);
} }
}).catch((err) => {
}) })
.catch(err => {});
}, },
storeConfList(){ storeConfList() {
this.$api.login.storeconfs({ this.$api.login
.storeconfs({
offset: 0, offset: 0,
limit: '' limit: ""
}).then(res => { })
if(!res.ecode){ .then(res => {
this.$store.commit(types.STORECONF,res.list_data); if (!res.ecode) {
this.$store.commit(types.STORECONF, res.list_data);
} }
}).catch((err) => {
}) })
.catch(err => {});
}, },
getCodeList(){ getCodeList() {
this.$api.codes.cates().then(res => { this.$api.codes
res.list_data.forEach(item=>{ .cates()
this.$api.codes.codes({ .then(res => {
},item.cate_unid).then(res => { res.list_data.forEach(item => {
this.$api.codes
.codes({}, item.cate_unid)
.then(res => {
// 存储code列表 // 存储code列表
window.localStorage.setItem(item.name,JSON.stringify(res.list_data)) window.localStorage.setItem(
item.name,
JSON.stringify(res.list_data)
);
// 存储单独code // 存储单独code
res.list_data.forEach(chilItem=>{ res.list_data.forEach(chilItem => {
window.localStorage.setItem(item.name+'-'+chilItem.code,chilItem.name) window.localStorage.setItem(
}) item.name + "-" + chilItem.code,
}).catch((err) => { chilItem.name
}) );
});
}) })
}).catch((err) => { .catch(err => {});
});
}) })
.catch(err => {});
}, },
getCustomCode(){ getCustomCode() {
this.$api.codes.customCode().then(res => { this.$api.codes
if(res.list_data.length > 0) { .customCode()
res.list_data.forEach((item) => { .then(res => {
window.localStorage.setItem(item.name + '-' + item.cate, item.unid); if (res.list_data.length > 0) {
}) res.list_data.forEach(item => {
window.localStorage.setItem(
item.name + "-" + item.cate,
item.unid
);
});
} else { } else {
this.$message({ this.$message({
type: 'warning', type: "warning",
message: '获取自定义编码失败!' message: "获取自定义编码失败!"
}) });
} }
}).catch((err) => {
}) })
.catch(err => {});
}, },
getCatesList(){ getCatesList() {
this.$api.codes.eventCates({}).then(res=>{ this.$api.codes.eventCates({}).then(res => {
// 存储cate列表 // 存储cate列表
window.localStorage.setItem('cate列表',JSON.stringify(res.list_data)) window.localStorage.setItem("cate列表", JSON.stringify(res.list_data));
// 存储单独code // 存储单独code
res.list_data.forEach(item=>{ res.list_data.forEach(item => {
this.getOneEventList(item.code,item.event_cate_unid) this.getOneEventList(item.code, item.event_cate_unid);
}) });
}) });
}, },
getOneEventList(code,id){ getOneEventList(code, id) {
this.$api.codes.eventType({},id).then(res=>{ this.$api.codes.eventType({}, id).then(res => {
// 存储cate列表 // 存储cate列表
window.localStorage.setItem(code,JSON.stringify(res.list_data)) window.localStorage.setItem(code, JSON.stringify(res.list_data));
}) });
}, },
getEventList(){ getEventList() {
this.$api.search.eventTypes({}).then(res=>{ this.$api.search.eventTypes({}).then(res => {
// 存储code列表 // 存储code列表
window.localStorage.setItem('安防事件',JSON.stringify(res.list_data)) window.localStorage.setItem("安防事件", JSON.stringify(res.list_data));
// 存储单独code // 存储单独code
res.list_data.forEach(item=>{ res.list_data.forEach(item => {
window.localStorage.setItem('安防事件-'+item.code,item.name) window.localStorage.setItem("安防事件-" + item.code, item.name);
}) });
}) });
}, },
getDev() { getDev() {
this.$api.resource.devs().then(res => { this.$api.resource.devs().then(res => {
localStorage.setItem('dev_unid',res[0].dev_unid); localStorage.setItem("dev_unid", res[0].dev_unid);
this.getDevsName(res[0].dev_unid); this.getDevsName(res[0].dev_unid);
}) });
}, },
getDevsName(id){ getDevsName(id) {
this.$api.resource.getDevsName({ this.$api.resource
.getDevsName(
{
is_leaf: 0 is_leaf: 0
},id).then(res=>{
if(res.list_data.length>0){
sessionStorage.setItem('device_id',res.list_data[0].device_id);
}
})
}, },
id
)
.then(res => {
if (res.list_data.length > 0) {
sessionStorage.setItem("device_id", res.list_data[0].device_id);
}
});
}
}, },
watch: {}, watch: {},
mounted() { mounted() {},
},
created() { created() {
this.initHeight(); this.initHeight();
let _this=this; let _this = this;
document.onkeydown = function(e){ document.onkeydown = function(e) {
let _key = window.event.keyCode; let _key = window.event.keyCode;
if(_key === 13){ if (_key === 13) {
_this.submitForm('ruleForm'); _this.submitForm("ruleForm");
}
}
} }
};
} }
};
</script> </script>
<!-- Add "scoped" attribute to limit CSS to this component only --> <!-- Add "scoped" attribute to limit CSS to this component only -->
......
<template> <template>
<div class="devinfo-box"> <div class="devinfo-box">
<div class="item-box"> <div class="item-box">
<div class="icon el-icon-cpu"></div> <div class="icon icon-fanxing-fenxiziyuan"></div>
<div class="item-info-box"> <div class="item-info-box">
<div>分析资源</div> <div>分析资源</div>
<div><span>64</span></div> <div><span>64</span></div>
</div> </div>
</div> </div>
<div class="item-box"> <div class="item-box">
<div class="icon el-icon-view"></div> <div class="icon icon-fanxing-yunhanglushu"></div>
<div class="item-info-box"> <div class="item-info-box">
<div>运行路数</div> <div>运行路数</div>
<div> <span>47</span></div> <div> <span>47</span></div>
</div> </div>
</div> </div>
<div class="item-box"> <div class="item-box">
<div class="icon el-icon-bell"></div> <div class="icon icon-fanxing-yunhangyichang"></div>
<div class="item-info-box"> <div class="item-info-box">
<div>运行异常</div> <div>运行异常</div>
<div><span>6</span></div> <div><span>6</span></div>
</div> </div>
</div> </div>
<div class="item-box"> <div class="item-box">
<div class="icon el-icon-s-order"></div> <div class="icon icon-fanxing-xinxicunchu"></div>
<div class="item-info-box"> <div class="item-info-box">
<div>信息存储量</div> <div>信息存储量</div>
<div><span>1.2</span> T</div> <div><span>1.2</span> T</div>
...@@ -45,6 +45,9 @@ export default { ...@@ -45,6 +45,9 @@ export default {
height: 28vh; height: 28vh;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.19); box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.19);
background:rgba(255,255,255,1);
box-shadow:0px 5px 8px 0px rgba(0,0,0,0.2),0px 0px 4px 0px rgba(0,0,0,0.19);
border-radius:6px;
overflow hidden overflow hidden
.item-box{ .item-box{
margin-top 2vh margin-top 2vh
......
...@@ -22,30 +22,97 @@ ...@@ -22,30 +22,97 @@
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data(){ data() {
return{ return {
activeName: 'first', activeName: "first",
height:'', height: "",
formLabelAlign:{ vchan_conf_unid: "",
video1:"", formLabelAlign: {
video2:"", video1: "",
video3:"", video2: "",
video4:"", video3: "",
} video4: ""
} }
};
}, },
mounted(){ mounted() {},
methods: {
handleClick(tab, event) {},
getshow() {
this.$api.show.getShowUrl().then(res => {
if (res.length > 0 && res[0].conf.length > 0) {
this.formLabelAlign = {
video1: res[0].conf[0].url,
video2: res[0].conf[1].url,
video3: res[0].conf[2].url,
video4: res[0].conf[3].url
};
this.vchan_conf_unid = res[0].vchan_conf_unid;
}
});
}, },
methods:{ onSubmit() {
handleClick(tab, event) { let data = {
conf: [
{
name: "1",
url: this.formLabelAlign.video1,
isActive: true
}, },
onSubmit(){ {
name: "1",
url: this.formLabelAlign.video2,
isActive: true
},
{
name: "1",
url: this.formLabelAlign.video3,
isActive: true
},
{
name: "1",
url: this.formLabelAlign.video4,
isActive: true
}
]
};
if (this.vchan_conf_unid) {
this.$api.show.editShowUrl(data, this.vchan_conf_unid).then(res => {
console.log(res);
if (res.ecode == 200) {
this.$message({
type: "success",
message: "设置成功!"
});
} else {
this.$message({
type: "error",
message: "设置失败!"
});
}
});
} else {
this.$api.show.addShowUrl(data).then(res => {
if (res.ecode == 200) {
this.$message({
type: "success",
message: "设置成功!"
});
} else {
this.$message({
type: "error",
message: "设置失败!"
});
}
});
}
} }
}, },
created() {
this.getshow();
} }
};
</script> </script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<style lang="scss" scoped></style>
<template> <template>
<div class="contentBox minHeight"> <div class="contentBox minHeight">
<div :style="{'background': '#FFFFFF','min-height': height}"> <div :style="{ background: '#FFFFFF', 'min-height': height }">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="校时设置" name="first"> <el-tab-pane label="校时设置" name="first">
<proofreadtime></proofreadtime> <proofreadtime></proofreadtime>
...@@ -13,32 +13,32 @@ ...@@ -13,32 +13,32 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import proofreadtime from './systemComponents/proofreadtime' import proofreadtime from "./systemComponents/proofreadtime";
import sytemset from './systemComponents/sytemSet' import sytemset from "./systemComponents/sytemSet";
import showset from './systemComponents/showSet' import showset from "./systemComponents/showSet";
export default { export default {
data(){ data() {
return{ return {
activeName: 'first', activeName: "first",
height:'' height: ""
} };
}, },
components:{ components: {
proofreadtime,sytemset,showset proofreadtime,
sytemset,
showset
}, },
mounted(){ mounted() {
this.height=document.body.clientHeight - 140 + 'px' this.height = document.body.clientHeight - 140 + "px";
}, },
methods:{ methods: {
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); console.log(tab, event);
} }
},
} }
};
</script> </script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<style lang="scss" scoped></style>
<template> <template>
<div class="ocx-box" id="ocx-box" v-show="isShow"> <div class="ocx-box" id="ocx-box" v-show="isShow">
<object id="VionVideo1" classid="clsid:93F960BB-5AF9-402B-A3DF-06112F14DC02" codebase="VionPlatformVideo.ocx" width="100%" <object
height="100%"> id="VionVideo1"
classid="clsid:93F960BB-5AF9-402B-A3DF-06112F14DC02"
codebase="VionPlatformVideo.ocx"
width="100%"
height="100%"
>
<!-- <param name="_Version" value="65536"> <!-- <param name="_Version" value="65536">
<param name="_ExtentX" value="2646"> <param name="_ExtentX" value="2646">
<param name="_ExtentY" value="1323"> <param name="_ExtentY" value="1323">
...@@ -10,55 +15,66 @@ ...@@ -10,55 +15,66 @@
</div> </div>
</template> </template>
<script> <script>
import { import { mapState } from "vuex";
mapState export default {
} from 'vuex'
export default {
data() { data() {
return { return {
urlFlag:false, urlFlag: false,
isShow:true isShow: true
}; };
}, },
props: ['playurl', 'type'], props: ["playurl", "type"],
methods: { methods: {
videoPlay: function () { videoPlay: function() {
this.urlFlag = false this.urlFlag = false;
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 ocxPlayRes = document.getElementById('VionVideo1').StartPlay(url, 0); let ocxPlayRes = document
console.log('video Ocx播放rtsp流返回值:', ocxPlayRes); .getElementById("VionVideo1")
.StartPlay(url, 0);
console.log("video Ocx播放rtsp流返回值:", ocxPlayRes);
if (ocxPlayRes != 0) { if (ocxPlayRes != 0) {
alert('播放失败!'); alert("播放失败!");
} }
} else { } else {
let OcxResponse = document.getElementById('VionVideo1').StartPlaySip(this.playurl.sip_serv_id, this.playurl.sip_serv_ip, let OcxResponse = document
this.playurl.sip_serv_port, this.playurl.sip_unid, this.playurl.sip_password, this.playurl.devId, 0) .getElementById("VionVideo1")
console.log('video Ocx播放sip流返回值:', OcxResponse); .StartPlaySip(
this.playurl.sip_serv_id,
this.playurl.sip_serv_ip,
this.playurl.sip_serv_port,
this.playurl.sip_unid,
this.playurl.sip_password,
this.playurl.devId,
0
);
console.log("video Ocx播放sip流返回值:", OcxResponse);
if (OcxResponse != 0 && OcxResponse != 200) { if (OcxResponse != 0 && OcxResponse != 200) {
alert('播放失败!'); alert("播放失败!");
} }
} }
}, },
downOcx: function () { downOcx: function() {
if (this.fileUrl !== '' && !this.installOcx) { if (this.fileUrl !== "" && !this.installOcx) {
location.href = this.fileUrl; location.href = this.fileUrl;
} }
}, },
installOcxInfo: function () { installOcxInfo: function() {
this.$confirm('为了正常使用,是否安装OCX控件?', '友情提示', { this.$confirm("为了正常使用,是否安装OCX控件?", "友情提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}).then(() => { })
.then(() => {
this.installOcx = false; this.installOcx = false;
this.downOcx(); this.downOcx();
}).catch(() => { })
.catch(() => {
this.installOcxInfo(); this.installOcxInfo();
}); });
}, },
initocx() { initocx() {
VionVideo1.Init(0, 'Null', 4); VionVideo1.Init(0, "Null", 4);
}, },
downloadOCx() { downloadOCx() {
// if (navigator.userAgent.indexOf('Trident') > -1) { // if (navigator.userAgent.indexOf('Trident') > -1) {
...@@ -76,7 +92,10 @@ ...@@ -76,7 +92,10 @@
}, },
checkIE() { checkIE() {
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
if (/(msie\s|trident.*rv:)([\w.]+)/.test(agent) && document.documentMode < 10) { if (
/(msie\s|trident.*rv:)([\w.]+)/.test(agent) &&
document.documentMode < 10
) {
this.$message.error("IE 版本过低请升级到IE10级以上版本!"); this.$message.error("IE 版本过低请升级到IE10级以上版本!");
} }
} }
...@@ -85,7 +104,7 @@ ...@@ -85,7 +104,7 @@
// this.checkIE(); // this.checkIE();
}, },
computed: { computed: {
...mapState(['ocxstate']) ...mapState(["ocxstate"])
}, },
mounted() { mounted() {
// VionVideo1.Init(0, 'Null', 4); // VionVideo1.Init(0, 'Null', 4);
...@@ -99,26 +118,24 @@ ...@@ -99,26 +118,24 @@
watch: { watch: {
ocxstate(val) { ocxstate(val) {
try { try {
if(val == 0){ if (val == 0) {
this.isShow = false this.isShow = false;
document.getElementById("VionVideo1").StartPlay(1); document.getElementById("VionVideo1").StartPlay(1);
} else { } else {
this.isShow = true this.isShow = true;
document.getElementById("VionVideo1").StartPlay(0); document.getElementById("VionVideo1").StartPlay(0);
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error);
}
} }
},
}, },
beforeDestroy: function () { beforeDestroy: function() {
// if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) { // if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) {
// this.videoplayer.pause(); // this.videoplayer.pause();
// } // }
} }
}; };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
......
...@@ -25,7 +25,14 @@ ...@@ -25,7 +25,14 @@
export default { export default {
data() { data() {
return {}; return {
playlist:{
video1:'',
video2:'',
video3:'',
video4:'',
}
};
}, },
props: ["playersrc", "vnum"], props: ["playersrc", "vnum"],
methods: { methods: {
...@@ -46,6 +53,21 @@ export default { ...@@ -46,6 +53,21 @@ export default {
this.$message.error("视频控件加载失败请用IE10及以上版本打开!"); this.$message.error("视频控件加载失败请用IE10及以上版本打开!");
} }
}, },
playurl() {
this.$api.show.getShowUrl().then(res => {
if (res.length > 0 && res[0].conf.length > 0) {
this.playlist = {
video1: res[0].conf[0].url,
video2: res[0].conf[1].url,
video3: res[0].conf[2].url,
video4: res[0].conf[3].url
};
res[0].conf.map(ele => {
nvrTotalOcx.PlayRealVideo(ele.url,1,'video','192.168.9.133',0);
})
}
});
},
checkIE() { checkIE() {
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
if (/(msie\s|trident.*rv:)([\w.]+)/.test(agent) && document.documentMode < 10) { if (/(msie\s|trident.*rv:)([\w.]+)/.test(agent) && document.documentMode < 10) {
...@@ -56,28 +78,19 @@ export default { ...@@ -56,28 +78,19 @@ export default {
created() { created() {
this.checkIE(); this.checkIE();
}, },
computed(){
},
mounted() { mounted() {
var testStr = 'Null'; var testStr = 'Null';
setTimeout(()=> {
nvrTotalOcx.Init(2, testStr, 4); nvrTotalOcx.Init(2, testStr, 4);
nvrTotalOcx.SetSingleWindow(true); nvrTotalOcx.SetSingleWindow(true);
nvrTotalOcx.SetParam("SetLanguage", "Chinese"); nvrTotalOcx.SetParam("SetLanguage", "Chinese");
nvrTotalOcx.SetParam("VideoSize", 0); nvrTotalOcx.SetParam("VideoSize", 0);
this.playurl();
},3000)
var medianame = '视频0'; var medianame = '视频0';
var hostname = window.location.hostname;
var port,url;
port=8554;
url = "rtsp://192.168.9.133:8554//opt/data/vedio/1579253441478.264";
let a = ''
setTimeout(()=>{
a = nvrTotalOcx.PlayRealVideo(url,1,'video','192.168.9.133',0);
},500)
setTimeout(()=>{
a = nvrTotalOcx.PlayRealVideo(url,1,'video','192.168.9.133',0);
},1000)
console.log('shipin'+a)
}, },
watch: {}, watch: {},
beforeDestroy: function () { beforeDestroy: function () {
...@@ -93,5 +106,8 @@ export default { ...@@ -93,5 +106,8 @@ export default {
.ocx-box{ .ocx-box{
height 50vh height 50vh
width 35vw width 35vw
background:rgba(255,255,255,1);
box-shadow:0px 2px 18px 0px rgba(0,26,70,0.3);
border-radius:10px;
} }
</style> </style>
<template> <template>
<div class="ocx-box" id="ocx-box" v-show="isShow"> <div class="ocx-box" id="ocx-box" v-show="isShow">
<object id="VionVideo" classid="clsid:93F960BB-5AF9-402B-A3DF-06112F14DC02" codebase="VionPlatformVideo.ocx" width="100%" <object
height="100%"> id="VionVideo"
classid="clsid:93F960BB-5AF9-402B-A3DF-06112F14DC02"
codebase="VionPlatformVideo.ocx"
width="100%"
height="100%"
>
<!-- <param name="_Version" value="65536"> <!-- <param name="_Version" value="65536">
<param name="_ExtentX" value="2646"> <param name="_ExtentX" value="2646">
<param name="_ExtentY" value="1323"> <param name="_ExtentY" value="1323">
...@@ -10,73 +15,93 @@ ...@@ -10,73 +15,93 @@
</div> </div>
</template> </template>
<script> <script>
import { import { mapState } from "vuex";
mapState export default {
} from 'vuex'
export default {
data() { data() {
return { return {
urlFlag:false, urlFlag: false,
isShow:true isShow: true
}; };
}, },
props: ['playurl', 'type'], props: ["playurl", "type"],
methods: { methods: {
videoPlay: function () { videoPlay: function() {
this.urlFlag = false this.urlFlag = false;
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 ocxPlayRes = document.getElementById('VionVideo').StartPlay(url, 0); let myVideo = document.getElementById("VionVideo");
console.log('video Ocx播放rtsp流返回值:', ocxPlayRes); try {
let isLoadingOcx = typeof myVideo.GetVersion() === "string" ? true : false;
if (isLoadingOcx) {
let ocxPlayRes = document.getElementById("VionVideo").StartPlay(url, 0);
console.log("video Ocx播放rtsp流返回值:", ocxPlayRes);
} else {
this.installOcxInfo();
}
if (ocxPlayRes != 0) { if (ocxPlayRes != 0) {
alert('播放失败!'); alert("播放失败!");
}
} catch (error) {
console.log(error);
} }
} else { } else {
let OcxResponse = document.getElementById('VionVideo').StartPlaySip(this.playurl.sip_serv_id, this.playurl.sip_serv_ip, let OcxResponse = document
this.playurl.sip_serv_port, this.playurl.sip_unid, this.playurl.sip_password, this.playurl.devId, 0) .getElementById("VionVideo")
console.log('video Ocx播放sip流返回值:', OcxResponse); .StartPlaySip(
this.playurl.sip_serv_id,
this.playurl.sip_serv_ip,
this.playurl.sip_serv_port,
this.playurl.sip_unid,
this.playurl.sip_password,
this.playurl.devId,
0
);
console.log("video Ocx播放sip流返回值:", OcxResponse);
if (OcxResponse != 0 && OcxResponse != 200) { if (OcxResponse != 0 && OcxResponse != 200) {
alert('播放失败!'); alert("播放失败!");
} }
} }
}, },
downOcx: function () { downOcx: function() {
if (this.fileUrl !== '' && !this.installOcx) { if (this.fileUrl !== "" && !this.installOcx) {
location.href = this.fileUrl; location.href = this.fileUrl;
} }
}, },
installOcxInfo: function () { installOcxInfo: function() {
this.$confirm('为了正常使用,是否安装OCX控件?', '友情提示', { this.$confirm("为了正常使用,是否安装OCX控件?", "友情提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning"
}).then(() => { })
.then(() => {
this.installOcx = false; this.installOcx = false;
this.downOcx(); this.downloadOCx();
}).catch(() => { })
.catch(() => {
this.installOcxInfo(); this.installOcxInfo();
}); });
}, },
initocx() { initocx() {
VionVideo.Init(0, 'Null', 4); VionVideo.Init(0, "Null", 4);
}, },
downloadOCx() { downloadOCx() {
// if (navigator.userAgent.indexOf('Trident') > -1) { if (navigator.userAgent.indexOf("Trident") > -1) {
// this.axios.get(IP + "/api/v1/device/dlfile", { let params = {
// params: { file_type: "video_ocx"
// file_type: "video_ocx" };
// } this.$api.ops.downloadOcx(params).then(response => {
// }) location.href = response.data.file_url;
// .then(response => { });
// location.href = response.data.file_url; } else {
// }); this.$message.error("视频控件加载失败请用IE10及以上版本打开!");
// } else { }
// this.$message.error("视频控件加载失败请用IE10及以上版本打开!");
// }
}, },
checkIE() { checkIE() {
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
if (/(msie\s|trident.*rv:)([\w.]+)/.test(agent) && document.documentMode < 10) { if (
/(msie\s|trident.*rv:)([\w.]+)/.test(agent) &&
document.documentMode < 10
) {
this.$message.error("IE 版本过低请升级到IE10级以上版本!"); this.$message.error("IE 版本过低请升级到IE10级以上版本!");
} }
} }
...@@ -85,40 +110,29 @@ ...@@ -85,40 +110,29 @@
// this.checkIE(); // this.checkIE();
}, },
computed: { computed: {
...mapState(['ocxstate']) ...mapState(["ocxstate"])
},
mounted() {
// VionVideo.Init(0, 'Null', 4);
// try {
// if (document.getElementById("VionVideo").GetVersion()) {
// }
// } catch (error) {
// this.downloadOCx();
// }
}, },
watch: { watch: {
ocxstate(val) { ocxstate(val) {
try { try {
if(val == 0){ if (val == 0) {
this.isShow = false this.isShow = false;
document.getElementById("VionVideo").StartPlay(1); document.getElementById("VionVideo").StartPlay(1);
} else { } else {
this.isShow = true this.isShow = true;
document.getElementById("VionVideo").StartPlay(0); document.getElementById("VionVideo").StartPlay(0);
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error);
}
} }
},
}, },
beforeDestroy: function () { beforeDestroy: function() {
// if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) { // if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) {
// this.videoplayer.pause(); // this.videoplayer.pause();
// } // }
} }
}; };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
......
...@@ -2,45 +2,60 @@ ...@@ -2,45 +2,60 @@
<div class="item"> <div class="item">
<div class="player"> <div class="player">
<div class="ocx-box"> <div class="ocx-box">
<object id="VionVideo" classid="clsid:96DFBBAF-4220-4978-9681-4ABA534A7718" <object
width="98%" height="550" style="margin-left:.9%"> id="VionVideo"
classid="clsid:96DFBBAF-4220-4978-9681-4ABA534A7718"
width="98%"
height="550"
style="margin-left:.9%"
>
</object> </object>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import {mapState} from 'vuex' import { mapState } from "vuex";
export default { export default {
data() { data() {
return {}; return {};
}, },
props: ['playurl', 'type'], props: ["playurl", "type"],
methods: { methods: {
videoPlay: function () { videoPlay: function() {
this.urlFlag = false this.urlFlag = false;
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 ocxPlayRes = document.getElementById('VionVideo').StartPlay(url, 0); let ocxPlayRes = document.getElementById("VionVideo").StartPlay(url, 0);
console.log('video Ocx播放rtsp流返回值:', ocxPlayRes); console.log("video Ocx播放rtsp流返回值:", ocxPlayRes);
if (ocxPlayRes != 0) { if (ocxPlayRes != 0) {
alert('播放失败!'); alert("播放失败!");
} }
} else { } else {
let OcxResponse = document.getElementById('VionVideo').StartPlaySip(this.playurl.sip_serv_id, this.playurl.sip_serv_ip, let OcxResponse = document
this.playurl.sip_serv_port, this.playurl.sip_unid, this.playurl.sip_password, this.playurl.devId, 0) .getElementById("VionVideo")
console.log('video Ocx播放sip流返回值:', OcxResponse); .StartPlaySip(
this.playurl.sip_serv_id,
this.playurl.sip_serv_ip,
this.playurl.sip_serv_port,
this.playurl.sip_unid,
this.playurl.sip_password,
this.playurl.devId,
0
);
console.log("video Ocx播放sip流返回值:", OcxResponse);
if (OcxResponse != 0 && OcxResponse != 200) { if (OcxResponse != 0 && OcxResponse != 200) {
alert('播放失败!'); alert("播放失败!");
} }
} }
}, },
initocx(){ initocx() {
VionVideo.Init(0, 'Null', 4); VionVideo.Init(0, "Null", 4);
}, },
downloadOCx() { downloadOCx() {
if (navigator.userAgent.indexOf('Trident') > -1) { if (navigator.userAgent.indexOf("Trident") > -1) {
this.axios.get(IP + "/api/v1/device/dlfile", { this.axios
.get(IP + "/api/v1/device/dlfile", {
params: { params: {
file_type: "video_ocx" file_type: "video_ocx"
} }
...@@ -54,7 +69,10 @@ export default { ...@@ -54,7 +69,10 @@ export default {
}, },
checkIE() { checkIE() {
var agent = navigator.userAgent.toLowerCase(); var agent = navigator.userAgent.toLowerCase();
if (/(msie\s|trident.*rv:)([\w.]+)/.test(agent) && document.documentMode < 10) { if (
/(msie\s|trident.*rv:)([\w.]+)/.test(agent) &&
document.documentMode < 10
) {
this.$message.error("IE 版本过低请升级到IE10级以上版本!"); this.$message.error("IE 版本过低请升级到IE10级以上版本!");
} }
} }
...@@ -64,7 +82,7 @@ export default { ...@@ -64,7 +82,7 @@ export default {
}, },
mounted() { mounted() {
VionVideo.Init(0, 'Null', 4); VionVideo.Init(0, "Null", 4);
try { try {
if (document.getElementById("VionVideo").GetVersion()) { if (document.getElementById("VionVideo").GetVersion()) {
} }
...@@ -73,20 +91,15 @@ export default { ...@@ -73,20 +91,15 @@ export default {
} }
}, },
computed: { computed: {
...mapState(['ocxstate']) ...mapState(["ocxstate"])
}, },
watch: { watch: {},
beforeDestroy: function() {
},
beforeDestroy: function () {
if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) { if (this.videoplayer.techName_ == "Flash" && this.videoplayer.pause) {
this.videoplayer.pause(); this.videoplayer.pause();
} }
} }
}; };
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped></style>
</style>
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
:popper-append-to-body="false" :popper-append-to-body="false"
> >
<el-option <el-option
v-for="item in catesData" v-for="(item, index) in catesData"
:key="item" :key="index"
:value="item.cate_unid" :value="item.cate_unid"
:label="item.name" :label="item.name"
></el-option> ></el-option>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
{ required: true, message: 'code不能为空!', trigger: 'blur' } { required: true, message: 'code不能为空!', trigger: 'blur' }
]" ]"
> >
<el-input v-model="codeData.code"></el-input> <el-input v-model="codeData.code" :disabled="editdis"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="名称" label="名称"
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
{ required: true, message: '备注名称不能为空!', trigger: 'blur' } { required: true, message: '备注名称不能为空!', trigger: 'blur' }
]" ]"
> >
<el-input v-model="codeData.name"></el-input> <el-input v-model="codeData.note"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -153,7 +153,8 @@ export default { ...@@ -153,7 +153,8 @@ export default {
selectDevs: "", selectDevs: "",
detailVisible: false, detailVisible: false,
codeStatus: 0, codeStatus: 0,
codeData: {} codeData: {},
editdis:false,
}; };
}, },
components: {}, components: {},
...@@ -178,11 +179,13 @@ export default { ...@@ -178,11 +179,13 @@ export default {
this.codeStatus = 0; this.codeStatus = 0;
this.detailVisible = true; this.detailVisible = true;
this.codeData.catename = this.getCateName(this.curCateUnid); this.codeData.catename = this.getCateName(this.curCateUnid);
this.editdis = false;
}, },
editCode(index, row) { editCode(index, row) {
this.codeStatus = 1; this.codeStatus = 1;
this.detailVisible = true; this.detailVisible = true;
this.codeData = row; this.codeData = row;
this.editdis = true;
this.codeData.catename = this.getCateName(this.curCateUnid); this.codeData.catename = this.getCateName(this.curCateUnid);
}, },
getCateName(cateunid) { getCateName(cateunid) {
......
...@@ -151,18 +151,23 @@ export default { ...@@ -151,18 +151,23 @@ export default {
}, },
//发送推流请求 //发送推流请求
pushSteam(vdata) { pushSteam(vdata) {
this.$api.task.getStream(this.dev_unid, vdata.vchan.vchan_id).then(m => { let data = {
console.log(m); send_stream: true,
task_id: this.currentSubtaskId,
is_analyse: true,
};
this.$api.task
.getStream(this.dev_unid, vdata.vchan.vchan_refid, data)
.then(m => {
if (m.ecode) { if (m.ecode) {
this.$message({ this.$message({
message: "发送推流请求失败:" + m.enote, message: "发送推流请求失败:" + m.enote,
type: "error" type: "error"
}); });
} else { } else {
console.log("请求推送分析流成功", JSON.stringify(m));
setTimeout(() => { setTimeout(() => {
this.getPlayUrl(); this.getPlayUrl();
}, 500); }, 2000);
} }
}); });
}, },
...@@ -182,9 +187,6 @@ export default { ...@@ -182,9 +187,6 @@ export default {
message: "获取rtsp播放地址失败!请重试!", message: "获取rtsp播放地址失败!请重试!",
type: "error" type: "error"
}); });
setTimeout(() => {
alert("获取rtsp播放地址失败!请重试!");
}, 0);
} }
}); });
}, },
......
...@@ -2006,10 +2006,10 @@ export default { ...@@ -2006,10 +2006,10 @@ export default {
linetype = 10; linetype = 10;
break; break;
case "4": case "4":
linetype = ""; linetype = 13;
break; break;
case "5": case "5":
linetype = ""; linetype = 14;
break; break;
default: default:
break; break;
...@@ -2090,7 +2090,9 @@ export default { ...@@ -2090,7 +2090,9 @@ export default {
} }
}); });
}); });
} catch (error) {} } catch (error) {
console.log(error);
}
// 红绿灯区域 // 红绿灯区域
let lightAry = []; let lightAry = [];
...@@ -2109,7 +2111,9 @@ export default { ...@@ -2109,7 +2111,9 @@ export default {
light_regions: ele.light_regions light_regions: ele.light_regions
}); });
}); });
} catch (error) {} } catch (error) {
console.log(error);
}
this.roiBody.lights = { this.roiBody.lights = {
light_count: lightAry.length, light_count: lightAry.length,
light: lightAry light: lightAry
...@@ -2135,7 +2139,9 @@ export default { ...@@ -2135,7 +2139,9 @@ export default {
point: ary point: ary
}); });
}); });
} catch (error) {} } catch (error) {
console.log(error);
}
this.roiBody.no_stop_region = { this.roiBody.no_stop_region = {
region_count: noStopAry.length, region_count: noStopAry.length,
...@@ -2171,7 +2177,9 @@ export default { ...@@ -2171,7 +2177,9 @@ export default {
point: bicAry point: bicAry
}); });
}); });
} catch (error) {} } catch (error) {
console.log(error);
}
this.roiBody.pedestrian_detection_region = { this.roiBody.pedestrian_detection_region = {
region_count: bicArys.length, region_count: bicArys.length,
...@@ -2202,7 +2210,9 @@ export default { ...@@ -2202,7 +2210,9 @@ export default {
point: denAry point: denAry
}); });
}); });
} catch (error) {} } catch (error) {
console.log(error);
}
this.roiBody.pedestrian_density_region = { this.roiBody.pedestrian_density_region = {
region_count: densityAry.length, region_count: densityAry.length,
...@@ -2229,7 +2239,9 @@ export default { ...@@ -2229,7 +2239,9 @@ export default {
point: foAry point: foAry
}); });
}); });
} catch (error) {} } catch (error) {
console.log(error);
}
this.roiBody.foreign_detection_region = { this.roiBody.foreign_detection_region = {
region_count: foreignAry.length, region_count: foreignAry.length,
...@@ -2256,7 +2268,9 @@ export default { ...@@ -2256,7 +2268,9 @@ export default {
point: foAry point: foAry
}); });
}); });
} catch (error) {} } catch (error) {
console.log(error);
}
this.roiBody.test_result_region = { this.roiBody.test_result_region = {
region_count: foreignAry.length, region_count: foreignAry.length,
......
...@@ -12,18 +12,17 @@ ...@@ -12,18 +12,17 @@
> >
<el-table-column label="序号" type="index" width="50" align="center"> <el-table-column label="序号" type="index" width="50" align="center">
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="center" label="预置位编号" width="180">
prop="position_num" <template slot-scope="scope">
align="center" <div>
label="预置位编号" {{ setpositionnum(scope.row.position_num) }}
width="180" </div>
> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="预设位置配置" width="180"> <el-table-column align="center" label="预设位置配置" width="180">
<template> <template>
<div class="yzw-setbox"> <div class="yzw-setbox">
<span class="icon el-icon-folder-add"></span> <span class="icon el-icon-delete" @click="resetRoi"></span>
<span class="icon el-icon-delete"></span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -32,7 +31,9 @@ ...@@ -32,7 +31,9 @@
<div class="table-set"> <div class="table-set">
<span @click="setParam(scope.row, scope.$index)">参数设置</span> <span @click="setParam(scope.row, scope.$index)">参数设置</span>
<span @click="setArea(scope.row, scope.$index)">区域设置</span> <span @click="setArea(scope.row, scope.$index)">区域设置</span>
<span @click="setDemarcate(scope.row, scope.$index)">标定设置</span> <span @click="setDemarcate(scope.row, scope.$index)"
>标定设置</span
>
<span @click="setTimer(scope.row, scope.$index)">时间设置</span> <span @click="setTimer(scope.row, scope.$index)">时间设置</span>
</div> </div>
</template> </template>
...@@ -46,7 +47,8 @@ ...@@ -46,7 +47,8 @@
<div class="set-item"> <div class="set-item">
轮询播放 轮询播放
<span class="set-icon"> <span class="set-icon">
<el-switch :width="25" v-model="switchstate"> </el-switch> <el-switch :width="25" v-model="switchstate" @change="suspends">
</el-switch>
</span> </span>
</div> </div>
<div class="set-item" @click="handleparam('upload')"> <div class="set-item" @click="handleparam('upload')">
...@@ -62,7 +64,11 @@ ...@@ -62,7 +64,11 @@
<handleparam ref="handleparam"></handleparam> <handleparam ref="handleparam"></handleparam>
</div> </div>
<div class="yt-box"> <div class="yt-box">
<ytconfig ref="yt" @subpostion="submitPosion"></ytconfig> <ytconfig
ref="yt"
@subpostion="submitPosion"
@deleteytconfig="deleteytconfig"
></ytconfig>
</div> </div>
<div> <div>
<parameter ref="parameter"></parameter> <parameter ref="parameter"></parameter>
...@@ -117,7 +123,8 @@ ...@@ -117,7 +123,8 @@
width="30" width="30"
v-model="polling_state" v-model="polling_state"
active-color="#13ce66" active-color="#13ce66"
inactive-color="#ff4949"> inactive-color="#ff4949"
>
</el-switch> </el-switch>
</div> </div>
</div> </div>
...@@ -166,22 +173,30 @@ export default { ...@@ -166,22 +173,30 @@ export default {
}, },
methods: { methods: {
setParam(scenesdata, index) { setParam(scenesdata, index) {
if (this.checkpollstate()) {
this.curindex = index; this.curindex = index;
this.$refs.parameter.init(scenesdata); this.$refs.parameter.init(scenesdata);
}
}, },
setArea(roidata, index) { setArea(roidata, index) {
if (this.checkpollstate()) {
this.curindex = index; this.curindex = index;
this.$refs.areas.showModal(roidata, this.taskInfo); this.$refs.areas.showModal(roidata, this.taskInfo);
}
}, },
setDemarcate(scenesdata, index) { setDemarcate(scenesdata, index) {
if (this.checkpollstate()) {
this.curindex = index; this.curindex = index;
this.$refs.demarcate.showModal(scenesdata); this.$refs.demarcate.showModal(scenesdata);
}
}, },
handleparam(type) { handleparam(type) {
this.$refs.handleparam.show(type); this.$refs.handleparam.show(type);
}, },
setsounces() { setsounces() {
if (this.checkpollstate()) {
this.$refs.yt.openyt(this.currentRow); this.$refs.yt.openyt(this.currentRow);
}
}, },
getTaskParams() { getTaskParams() {
this.$api.task.getTaskParams(this.taskid, this.subtaskid).then(data => { this.$api.task.getTaskParams(this.taskid, this.subtaskid).then(data => {
...@@ -194,12 +209,52 @@ export default { ...@@ -194,12 +209,52 @@ export default {
this.$store.commit("setocxstate", 0); this.$store.commit("setocxstate", 0);
this.timerDialog = true; this.timerDialog = true;
}, },
resetRoi() {
this.taskInfo.mtasks[0].scenes.map(ele => {
if (ele.scene_unid == this.currentRow.scene_unid) {
ele.config = {};
ele.rois = [];
}
});
this.subRoi(this.taskInfo.mtasks);
},
setpositionnum(index) {
return index == -1 ? "未设置" : index;
},
handleTimerClose() { handleTimerClose() {
this.timerDialog = false; this.timerDialog = false;
this.$store.commit("setocxstate", 1); this.$store.commit("setocxstate", 1);
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.currentRow = val; this.currentRow = val;
this.$api.task
.switchScene(this.taskid, this.subtaskid, val.scene_unid)
.then(res => {
console.log(res);
});
},
suspends() {
if (this.subtaskid) {
let _s = this.switchstate ? 1 : 0;
this.$api.task
.suspendAlternate(this.taskid, this.subtaskid, _s)
.then(res => {
console.log(res);
});
}
},
checkpollstate() {
let state = false;
if (this.switchstate) {
this.$message({
message: "请先关闭预置位在进行操作!",
type: "warning"
});
state = false;
} else {
state = true;
}
return state;
}, },
submitPosion(positionnum) { submitPosion(positionnum) {
this.taskInfo.mtasks[0].scenes.map(ele => { this.taskInfo.mtasks[0].scenes.map(ele => {
...@@ -209,6 +264,14 @@ export default { ...@@ -209,6 +264,14 @@ export default {
}); });
this.subRoi(this.taskInfo.mtasks); this.subRoi(this.taskInfo.mtasks);
}, },
deleteytconfig(positionnum) {
this.taskInfo.mtasks[0].scenes.map(ele => {
if (ele.scene_unid == this.currentRow.scene_unid) {
ele.position_num = -1;
}
});
this.subRoi(this.taskInfo.mtasks);
},
submitTimer(item) { submitTimer(item) {
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) {
...@@ -309,6 +372,7 @@ export default { ...@@ -309,6 +372,7 @@ export default {
subtaskid(val) { subtaskid(val) {
this.$api.task.getTaskParams(this.taskid, val).then(res => { this.$api.task.getTaskParams(this.taskid, val).then(res => {
this.taskInfo = res; this.taskInfo = res;
this.switchstate = res.alternate_status == 1 ? true : false;
console.log(res.data); console.log(res.data);
}); });
} }
......
...@@ -80,6 +80,9 @@ ...@@ -80,6 +80,9 @@
<div class="closebtn item-box"> <div class="closebtn item-box">
<el-button @click="closeyt">关闭</el-button> <el-button @click="closeyt">关闭</el-button>
</div> </div>
<div class="delbtn item-box">
<el-button @click="deleteytconfig" type="danger">删除</el-button>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -133,6 +136,10 @@ export default { ...@@ -133,6 +136,10 @@ export default {
}, },
subset() { subset() {
this.$emit("subpostion", this.presetindex); this.$emit("subpostion", this.presetindex);
},
deleteytconfig() {
this.$emit("deleteytconfig", this.presetindex);
this.showyt = false;
} }
} }
}; };
...@@ -207,4 +214,7 @@ export default { ...@@ -207,4 +214,7 @@ export default {
.subbtn { .subbtn {
margin: 1vh 0.3vw 0 2vw; margin: 1vh 0.3vw 0 2vw;
} }
.delbtn {
margin-left:.4vw
}
</style> </style>
...@@ -183,8 +183,8 @@ export default { ...@@ -183,8 +183,8 @@ export default {
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.setUtcTime(this.formData.timer[0]), start_dt: this.formData.period === 1 ? "2020-03-27 00:00:00" : this.setUtcTime(this.formData.timer[0]),
end_dt: this.setUtcTime(this.formData.timer[1]), end_dt: this.formData.period === 1 ? "2020-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,
...@@ -202,7 +202,7 @@ export default { ...@@ -202,7 +202,7 @@ export default {
this.addTask(formData); this.addTask(formData);
} }
if (this.pedittype == "edit") { if (this.pedittype == "edit") {
this.editTask(formData); this.editTask(postData);
} }
}, },
addTask(data) { addTask(data) {
......
...@@ -7,20 +7,7 @@ ...@@ -7,20 +7,7 @@
width="906px" width="906px"
:before-close="handleClose" :before-close="handleClose"
> >
<!-- 内层dialog --> <moveTask ref="movetask"></moveTask>
<!-- <el-dialog width="630px" title="视频迁移" :visible.sync="innerVisible" append-to-body >
<el-table height="286" :data="taskData" stripe border style="width: 100%">
<el-table-column align="center" prop="name" label="任务名称"></el-table-column>
<el-table-column align="center" prop="status" label="状态">
<template slot-scope="scope">
<el-tag :key="scope.$index" type="warning" effect="dark">{{ scope.row.status}}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="type" label="算法类型"></el-table-column>
<el-table-column align="center" prop="set" label="储存配置"></el-table-column>
<el-table-column align="center" prop="per" label="场景占用"></el-table-column>
</el-table>
</el-dialog> -->
<div> <div>
<!-- 外层内容 --> <!-- 外层内容 -->
<div class="leftBox"> <div class="leftBox">
...@@ -55,11 +42,11 @@ ...@@ -55,11 +42,11 @@
prop="name" prop="name"
label="视频源名称" label="视频源名称"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column align="center" label="视频状态">
align="center" <template slot-scope="scope">
prop="running_status" <div v-html="statusFormatter(scope.row)"></div>
label="视频状态" </template>
></el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
width="136" width="136"
...@@ -106,16 +93,17 @@ ...@@ -106,16 +93,17 @@
</template> </template>
<script> <script>
import videoplay from "../public/videoPlay"; import videoplay from "../public/videoPlay";
import moveTask from "./moveSubTask";
export default { export default {
data() { data() {
return { return {
innerVisible: false,
tableData: [], tableData: [],
play_url: "", play_url: "",
user_unid: "", user_unid: "",
formData: {}, formData: {},
editData: {}, editData: {},
taskData:{}, taskData:{},
moveTaskData:[],
setvisible: false, setvisible: false,
props: { props: {
id: "vchan_refid", id: "vchan_refid",
...@@ -146,7 +134,8 @@ export default { ...@@ -146,7 +134,8 @@ export default {
} }
}, },
components: { components: {
videoplay videoplay,
moveTask
}, },
mounted() { mounted() {
console.log(this.setvisible); console.log(this.setvisible);
...@@ -166,7 +155,7 @@ export default { ...@@ -166,7 +155,7 @@ 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.running_status = data[i].running_status data[i].vchan.running_status = data[i].running_status;
} else { } else {
data.vchan = { data.vchan = {
subtask_id: data[i].subtask_id, subtask_id: data[i].subtask_id,
...@@ -182,6 +171,21 @@ export default { ...@@ -182,6 +171,21 @@ export default {
this.checkvckan(); this.checkvckan();
}); });
}, },
statusFormatter(row) {
if (row.running_status == "Running") {
return "<span class='runningbox statusbox'>工作中</span>";
} else if (row.running_status == "Finished") {
return "<span class='finishedbox statusbox'>已完成</span>";
} else if (row.running_status == "Pause") {
return "<span class='pausebox statusbox'>暂停</span>";
} else if (row.running_status == "Error") {
return "<span class='errorbox statusbox'>异常</span>";
} else if (row.running_status == "Deleted") {
return "<span class='deletebox statusbox'>已删除</span>";
} else {
return "<span class='nomoralbox statusbox'>未部署</span>";
}
},
handleCheckChange(data, node) { handleCheckChange(data, node) {
console.log(node); console.log(node);
let staus = false; let staus = false;
...@@ -344,7 +348,9 @@ export default { ...@@ -344,7 +348,9 @@ export default {
try { try {
window.clearTimeout(this.timeout1); window.clearTimeout(this.timeout1);
window.clearTimeout(this.timeout2); window.clearTimeout(this.timeout2);
} catch (err) {} } catch (err) {
console.log(err);
}
// var e = e || window.event; // var e = e || window.event;
this.play_url = ""; this.play_url = "";
// if (this.testIe.isIe) { // if (this.testIe.isIe) {
...@@ -443,7 +449,7 @@ export default { ...@@ -443,7 +449,7 @@ export default {
this.setvisible = false; this.setvisible = false;
}, },
moveFun(index, row) { moveFun(index, row) {
this.innerVisible = true; this.$refs.movetask.initMoveTask(row, this.taskData);
} }
}, },
created() { created() {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div class="rightBox"> <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">80</div> <div class="topText">{{total}}</div>
<div class="bottomText">任务数量</div> <div class="bottomText">任务数量</div>
</span> </span>
</div> </div>
...@@ -97,12 +97,12 @@ ...@@ -97,12 +97,12 @@
</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 <el-table-column align="center" label="状态">
align="center"
prop="status"
:formatter="statusFormatter"
label="状态"
> >
<template slot-scope="scope">
<div v-html="statusFormatter(scope.row)">
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -117,11 +117,11 @@ ...@@ -117,11 +117,11 @@
label="存储配置" label="存储配置"
> >
</el-table-column> </el-table-column>
<el-table-column align="center" prop="workers_count" 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 align="center" prop="workers_count" label="资源用量">
</el-table-column> </el-table-column>
<el-table-column align="center" prop="workers_count" label="设备类型"> <el-table-column align="center" prop="plate_type" label="设备类型">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
:visible-arrow="false" :visible-arrow="false"
> >
<span <span
class="icon-fanxing-xiugai editIcon" class="el-icon-video-camera-solid editIcon"
@click="editVideo(scope.$index, scope.row)" @click="editVideo(scope.$index, scope.row)"
></span> ></span>
</el-tooltip> </el-tooltip>
...@@ -303,19 +303,19 @@ export default { ...@@ -303,19 +303,19 @@ export default {
row.isexpand = false; row.isexpand = false;
} }
}, },
statusFormatter(row, column, cellValue, index) { statusFormatter(row) {
if (cellValue == "Running") { if (row.status == "Running") {
return "工作中"; return "<span class='runningbox statusbox'>工作中</span>";
} else if (cellValue == "Finished") { } else if (row.status == "Finished") {
return "已完成"; return "<span class='finishedbox statusbox'>已完成</span>";
} else if (cellValue == "Pause") { } else if (row.status == "Pause") {
return "暂停"; return "<span class='pausebox statusbox'>暂停</span>";
} else if (cellValue == "Error") { } else if (row.status == "Error") {
return "异常"; return "<span class='errorbox statusbox'>异常</span>";
} else if (cellValue == "Deleted") { } else if (row.status == "Deleted") {
return "已删除"; return "<span class='deletebox statusbox'>已删除</span>";
} else { } else {
return "未部署"; return "<span class='nomoralbox statusbox'>未部署</span>";
} }
}, },
priorityFormatter(row, column, cellValue, index) { priorityFormatter(row, column, cellValue, index) {
...@@ -337,13 +337,12 @@ export default { ...@@ -337,13 +337,12 @@ export default {
}, },
dateFormatter(row, column, cellValue, index) { dateFormatter(row, column, cellValue, index) {
if (row.period) { if (row.period) {
return "全天" return "全天";
} else { } else {
let startDate = cellValue ? cellValue.split(" ")[0] : ""; let startDate = cellValue ? cellValue.split(" ")[0] : "";
let endDate = row.end_dt ? row.end_dt.split(" ")[0] : ""; let endDate = row.end_dt ? row.end_dt.split(" ")[0] : "";
return startDate + " ~ " + endDate; return startDate + " ~ " + endDate;
} }
}, },
typeFormatter(row, column, cellValue, index) { typeFormatter(row, column, cellValue, index) {
if (cellValue == 0) { if (cellValue == 0) {
...@@ -589,4 +588,7 @@ export default { ...@@ -589,4 +588,7 @@ export default {
color: #f2365a; color: #f2365a;
font-size: 16px; font-size: 16px;
} }
.statusbox {
background: red;
}
</style> </style>
<template>
<!-- 内层dialog -->
<el-dialog
width="630px"
title="视频迁移"
:visible.sync="innerVisible"
append-to-body
>
<el-table
height="286"
:data="moveTaskData"
stripe
border
style="width: 100%"
highlight-current-row
@current-change="handleCurrentChange"
>
<el-table-column
align="center"
prop="task_name"
label="任务名称"
></el-table-column>
<el-table-column align="center" prop="status" label="状态">
<template slot-scope="scope">
<div v-html="statusFormatter(scope.row)"></div>
</template>
</el-table-column>
<el-table-column
align="center"
prop="task_algo_type"
label="算法类型"
:formatter="typeFormatter"
></el-table-column>
<el-table-column
align="center"
prop="store_conf.name"
label="储存配置"
></el-table-column>
<el-table-column
align="center"
prop="resource_use"
label="场景占用"
></el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="movetask">确 定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
innerVisible: false,
moveTaskData: [],
curTaskData: {},
curSubTaskData: {},
curRow: {}
};
},
methods: {
initMoveTask(sutaskdata, taskData) {
this.curTaskData = taskData;
this.curSubTaskData = sutaskdata;
this.getTaskList();
},
handleClose() {
this.innerVisible = false;
},
handleCurrentChange(val) {
this.curRow = val;
},
getTaskList() {
this.tableData = [];
let offset = (this.page - 1) * this.pageSize;
this.$api.task
.getTask({
limit: 10000,
offset: 0,
task_algo_type: this.curTaskData.task_algo_type,
source_type: "pull_video_stream",
task_type: "normal",
resource_use: this.curTaskData.resource_use || ""
})
.then(res => {
this.total = res.total_num;
if (res.list_data == null) {
this.tableData = [];
} else {
let taskArr = [];
for (let i = 0; i < res.list_data.length; i++) {
if (res.list_data[i].task_id == this.curTaskData.task_id) {
break;
} else {
taskArr.push(res.list_data[i]);
}
}
if (taskArr.length > 0) {
this.moveTaskData = taskArr;
this.innerVisible = true;
} else {
this.$message({
message: "没有符合的任务",
type: "warning"
});
}
}
})
.catch(error => {});
},
typeFormatter(row, column, cellValue, index) {
if (cellValue == 0) {
return "交通";
} else if (cellValue == 1) {
return "客流";
} else if (cellValue == 2) {
return "行为分析";
} else if (cellValue == 3) {
return "违停";
} else if (cellValue == 5) {
return "交通行人";
} else if (cellValue == 7) {
return "综合流量";
} else {
return "未知";
}
},
statusFormatter(row) {
if (row.status == "Running") {
return "<span class='runningbox statusbox'>工作中</span>";
} else if (row.status == "Finished") {
return "<span class='finishedbox statusbox'>已完成</span>";
} else if (row.status == "Pause") {
return "<span class='pausebox statusbox'>暂停</span>";
} else if (row.status == "Error") {
return "<span class='errorbox statusbox'>异常</span>";
} else if (row.status == "Deleted") {
return "<span class='deletebox statusbox'>已删除</span>";
} else {
return "<span class='nomoralbox statusbox'>未部署</span>";
}
},
movetask() {
let data = {
subtask_id: this.curSubTaskData.subtask_id
};
this.$api.task.moveTask(this.curTaskData.task_id, data).then(res => {
console.log(res);
});
}
}
};
</script>
<style></style>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<el-col :span="7"> <el-col :span="7">
<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="item-num">{{ snapData.kakou_total_snap_num }}</div> <div class="item-num">{{ snapData.kakou_total_snap_num }}</div>
...@@ -205,6 +205,11 @@ export default { ...@@ -205,6 +205,11 @@ export default {
.header-title { .header-title {
padding: 10px 0px 0 20px; padding: 10px 0px 0 20px;
width:113px;
height:20px;
font-size:14px;
color:rgba(0,0,0,1);
line-height:20px;
} }
.collect-content { .collect-content {
...@@ -367,42 +372,22 @@ export default { ...@@ -367,42 +372,22 @@ export default {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin: 1vh 0.3vw; margin: 1vh 0.3vw;
overflow hidden
.left-icon { .left-icon {
width: 3vw; width: 3vw;
height: 6vh; height: 6vh;
line-height: 6vh; line-height: 6vh;
text-align: center; text-align: center;
overflow hidden
span { span {
font-size: 30px; font-size: 30px;
color rgba(179,229,252,1);
background #3BB7FF;
} }
} }
} }
.car-dis-info:nth-child(2) {
.left-icon {
span {
color: #FF9630;
}
}
}
.car-dis-info:nth-child(3) {
.left-icon {
span {
color: #F56C6C;
}
}
}
.car-dis-info:nth-child(4) {
.left-icon {
span {
color: #36BEA6;
}
}
}
.car-num { .car-num {
font-size: 22px; font-size: 22px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!