Commit 5454a14c by 潘建波

feat chrome视频播放

1 parent 226e2835
NODE_ENV = 'development'
VUE_APP_URL = 'http://192.168.9.133:20080'
\ No newline at end of file
VUE_APP_URL = 'http://192.168.9.233:20080'
\ No newline at end of file
.DS_Store
node_modules
/dist
dist
# local env files
.env.local
.env.*.local
......
This file is too large to display.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -43,6 +43,7 @@
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"generate-asset-webpack-plugin": "^0.3.0",
"node-sass": "^4.12.0",
"prettier": "^1.18.2",
"sass-loader": "^8.0.0",
......
......@@ -17,6 +17,8 @@
<script src="<%= BASE_URL %>zTree_v3/js/jquery.ztree.exhide.min.js"></script>
<script src="<%= BASE_URL %>zTree_v3/js/fuzzysearch.js"></script>
<script src="<%= BASE_URL %>js/keymaster.js"></script>
<script src="<%= BASE_URL %>js/config.js"></script>
<script src="<%= BASE_URL %>js/NodePlayer-full.min.js"></script>
</head>
<body id="theme-name">
<noscript>
......
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
export let config = {
"logstatus":false, //是否开启日志收集
window.config = {
"logstatus":true, //是否开启日志收集
"hadertitle":"AI视频分析平台",//系统标题
"logintitle":"AI视频分析平台",//展示标题
"https": false,
"isvideo":0,
"bigtree":false,//大数据展示树
"host":"http://10.1.200.100:20080",
"ddurl":"http://aaa.zzgx.gov.cn",
"ddloginurl":"http://10.1.200.97:29090",
"huasanDD": 'http://aaa.zzgx.gov.cn/oauth/authorize?response_type=code&scope=read&client_id=KLjmdAH0',
"ddwsurl":"10.1.200.97:29090",
"isdd":false, //是否开启钉钉登录
}
{"commit":"396f8de8bfd915640ef731d378a7bdc81e4bdfbf","commitDate":"2021-1-18 15:21","buildDate":"2021-2-23 18:8","version":"2.0.9","info":"临时提交文件"}
\ No newline at end of file
{"commit":"226e28357cc713ecc9f9cf3535515e003387c606","commitDate":"2021-2-23 18:45","buildDate":"2021-4-23 11:7","version":"2.1.0","info":"feat✨ 设备树搜索改为服务端搜索"}
\ No newline at end of file
{
"logstatus":false, //是否开启日志收集
"hadertitle":"AI视频分析平台",//系统标题
"logintitle":"AI视频分析平台",//展示标题
"https": false,
"isvideo":1,
"bigtree":false,//大数据展示树
}
......@@ -10,16 +10,19 @@ import ops from "./ops";
import {config} from '../../public/js/config.js'
import baseurl from './baseUrl'
let wsIP = "";
let flvIP = "";
switch (process.env.NODE_ENV) {
case "development":
wsIP = config.https?"192.168.9.227:20070":"192.168.9.227:20080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
wsIP = window.config.https?"192.168.9.227:20070":"192.168.9.233:20080"; // 测试环境url
flvIP = window.config.https?"192.168.9.245:8080":"192.168.9.245:8080";
break;
case "pre":
wsIP = ""; // 预上线环境url
break;
case "production":
wsIP = location.host; // 生产环境url
flvIP = "192.168.9.245" + ":8080"
// flvIP = location.hostname + ":8080"
break;
}
export default {
......@@ -33,5 +36,6 @@ export default {
codes,
ops,
wsIP,
flvIP,
baseurl
};
let baseUrl = "/api"; // 本地代理
import {config} from '../../public/js/config.js'
console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) {
case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = config.https?"https://192.168.9.233:20070":"http://192.168.9.245:20080"; // 测试环境url
baseUrl = window.config.https?"https://192.168.9.233:20070":"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';
......@@ -14,7 +13,7 @@ switch (process.env.NODE_ENV) {
break;
case "production":
baseUrl = config.https?`https://${location.host}`:`http://${location.host}`; // 生产环境url
baseUrl = window.config.https?`https://${location.host}`:`http://${location.host}`; // 生产环境url
break;
}
......
......@@ -41,5 +41,8 @@ export default {
},
deleteTrafficCode(cate_unid,code_unid,params) {
return api.delete(urls.editTrafficCode(cate_unid, code_unid), params);
},
editcustomCode(cate_unid,code_unid,params) {
return api.post(urls.editcustomCode(cate_unid, code_unid), params);
}
};
......@@ -17,5 +17,8 @@ export default {
},
editTrafficCode(cate_unid, code_unid) {
return `${baseUrl}/api/v1/codes/traffic/cates/${cate_unid}/codes/${code_unid}`;
},
editcustomCode(cate_unid,code_unid){
return `${baseUrl}/api/v1/codes/custom/cates/${cate_unid}/codes/${code_unid}`;
}
};
......@@ -26,8 +26,14 @@ export default {
url = "/vchans?vchan_type=vfile";
break;
}
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`
if(window.config.bigtree) {
return `${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}` //ztree版本
} else {
return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${devuid}${url}`, params);
}
},
getDevtreeLike(devuid, devname, params){
let url = "";
switch (devname) {
......
import api from './index';
import baseurl from './baseUrl';
import moment from "moment";
import {config} from '../../public/js/config'
let oplogurl = `${baseurl}/api/v1/log_serv/user_oper_logs`
let userlogurl = `${baseurl}/api/v1/log_serv/system_logs/`
......@@ -15,7 +14,7 @@ let servicename = {
}
const oplogs = function(data,service,action) {
//开启日志模式才进行日志收集
if(config.logstatus) {
if(window.config.logstatus) {
let username = localStorage.getItem('uname');
let baseData = {
"dt": moment().locale('zh-cn'),
......
......@@ -14,5 +14,11 @@ export default {
},
storeconfs(params, id) {
return api.get(urls.storeconfs, params);
},
ddlogout:(params) => {
return api.post(urls.ddout,params)
},
ddlogin:(params) => {
return api.get(urls.ddlogin,params)
}
};
......@@ -6,6 +6,8 @@ export default {
cates: baseUrl + "/api/v1/codes/traffic/cates",
codes: baseUrl + "/api/v1/codes/traffic/cates/",
customCode:baseUrl + "/api/v1/codes/custom/cates",
menus:baseUrl + "/api/v1/auth/apps/0d88c025fafc5ad1189670655597c183/menus"
menus:baseUrl + "/api/v1/auth/apps/0d88c025fafc5ad1189670655597c183/menus",
ddout:`${window.config.ddloginurl}/api/v1/huasan/code/hs/logout`,
ddlogin:`${window.config.ddloginurl}/ddlogin`
// getApps:baseUrl + "/api/v1/auth/apps"
};
......@@ -284,6 +284,13 @@ Vue.prototype.base64Img = function(file) {
};
});
};
/**
* 判断是否是chrome浏览器
*/
Vue.prototype.checkchrome = function() {
var isWebKit = navigator.userAgent.indexOf('WebKit') > -1 //
return isWebKit
};
/**
* code操作
......
......@@ -27,7 +27,7 @@ import {config} from '../../public/js/config'
this.player = document.getElementById('playerVideo');
console.log(this.player)
this.player.loop = true;
if(config.https) {
if(window.config.https) {
let loc = location.host
this.player.src = `https://${loc}/${play_url.split(":20080")[1]}`
} else {
......
......@@ -36,7 +36,3 @@ new Vue({
store,
render: h => h(App)
}).$mount("#app");
//用户退出时清除相关信息
// window.onunload = function() {
// localStorage.clear();
// };
......@@ -23,6 +23,10 @@ export const constantRouterMap = [{
]
},
{
path: "/ddlogin",
name: "ddlogin",
component: resolve => require(["../views/ddlogin.vue"], resolve)
},{
path: "/login",
name: "login",
// route level code-splitting
......
......@@ -135,19 +135,29 @@ export default {
},
handleCommand(command){
window.document.documentElement.setAttribute('data-theme',command);
localStorage.setItem("theme",command)
localStorage.setItem("fxtheme",command)
},
ddlogout(){
let params = {
"access_token":localStorage.getItem("access_token")
}
this.$api.login.ddlogout(params).then(res=> {
console.log("dingding",res)
})
},
logout() {
localStorage.removeItem("menu");
localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atoken");
this.$logs.oplogs('','serv_login',`登出了平台`);
if(window.config.isdd) {
this.ddlogout()
}
localStorage.removeItem("atoken");
this.$router.push("/login").catch(err => {
err;
});
location.reload();
// location.reload();
},
resetpass() {
......@@ -157,7 +167,7 @@ export default {
}
},
created() {
this.headertitle = config.hadertitle;
this.headertitle = window.config.hadertitle;
this.$api.device.getDev().then(m => {
if (m.length < 1) {
this.$message({
......@@ -174,7 +184,7 @@ export default {
menus
},
mounted() {
let theme = localStorage.getItem("theme") || 'light';
let theme = localStorage.getItem("fxtheme") || 'light';
window.document.documentElement.setAttribute('data-theme',theme);
console.log(this.permission_routers);
this.conHeight = window.innerHeight - 65;
......@@ -200,7 +210,6 @@ export default {
clearTimeout(window.mousetimer);
}
window.mousetimer = setTimeout(() => {
debugger
clearTimeout(window.mousetimer);
window.mousetimer = null;
this.logout();
......@@ -239,7 +248,7 @@ export default {
let uid = localStorage.getItem("user_unid");
let clientid = localStorage.getItem("client_unid");
this.$api.device.getGlobalWs(uid, clientid).then(data => {
if(config.https) {
if(window.config.https) {
let url = data.ws_url.replace("ws://","wss://")
this.globalWs = new WebSocket(url.replace("20080","20070"));
} else {
......
<template>
<div id="login" :style="{ height: innerHeight + 'px' }" class="js-count-particles" >
<div class="ddclosebtn"><span class="el-icon-close" @click="closedd" v-if="isdd" v-show="showdd"></span></div>
<!-- ie空白解决方法https://blog.csdn.net/heyNewbie/article/details/99623550 -->
<!-- <vue-particles
color="#dedede"
......@@ -48,6 +49,10 @@
>
</el-form-item>
</el-form>
<div class="ddbox" v-show="isdd">
<img class="ddimg" src="../assets/img/login/dd@2x.png" alt="">
<span class="title" @click="switchLogin">钉钉登录</span>
</div>
<div class="syversion">版本:v{{ versioninfo.version }}</div>
</div>
</div>
......@@ -79,12 +84,17 @@ export default {
return {
username: "",
password: "",
showdd:true,
innerHeight: 0,
logintitle:"",
isdd:window.config.isdd,
webSocketL:null,
ddWindow:null,
ruleForm: {
username: "",
password: ""
},
ddurl:`${window.config.ddurl}/oauth/authorize?response_type=code&scope=read&client_id=KLjmdAH0&redirect_uri=${window.config.ddloginurl}/api/v1/huasan/code/call`,
versioninfo: versioninfo,
rules: {
password: [{ validator: validatePass, trigger: "change" }],
......@@ -102,6 +112,9 @@ export default {
}
});
},
closedd(){
this.showdd = false;
},
initHeight() {
this.innerHeight = window.innerHeight;
},
......@@ -115,6 +128,22 @@ export default {
})
.then(res => {
if (!res.ecode) {
this.loginMount(res,"user")
} else {
this.$message({
type: "error",
message: res.enote
});
}
})
.catch(err => {
this.$message({
type: "error",
message: err
});
});
},
loginMount(res,logintype){
this.$store.commit(types.ATOKEN, res.atoken);
// localStorage.setItem('rtoken',m.data.rtoken)
sessionStorage.setItem("user_unid", res.user_unid);
......@@ -122,11 +151,12 @@ export default {
localStorage.setItem("atoken", res.atoken);
localStorage.setItem("uname", res.user_name);
this.$logs.oplogs(res.user_name,'serv_login',`登录了平台`);
localStorage.setItem("access_token",res.access_token || '')
// 处理登录用户权限菜单显示问题;
if(res.firstLogin) {
this.$router.push('resetpass')
return;
}
// if(res.firstLogin && logintype !== "dingding") {
// this.$router.push('resetpass')
// return;
// }
//算法配置列表
this.algoList();
//存储配置列表
......@@ -138,19 +168,6 @@ export default {
this.getEventList();
this.getDev();
this.getMenu(res.user_unid);
} else {
this.$message({
type: "error",
message: res.enote
});
}
})
.catch(err => {
this.$message({
type: "error",
message: err
});
});
},
getMenu(id) {
//获取菜单
......@@ -253,6 +270,7 @@ export default {
});
});
},
switchLogin(){},
getOneEventList(code, id) {
this.$api.codes.eventType({}, id).then(res => {
// 存储cate列表
......@@ -296,8 +314,9 @@ export default {
document.body.style.overflow = "hidden";
},
created() {
this.logintitle = config.logintitle;
this.logintitle = window.config.logintitle;
this.initHeight();
// this.isdd? this.switchLogin():null;
let _this = this;
document.onkeydown = function(e) {
let _key = window.event.keyCode;
......@@ -429,4 +448,32 @@ p:nth-child(1) {
.syversion {
color: rgb(199, 197, 197);
}
.ddbox {
margin-top: -10px;
.ddimg{
height: 20px;
width: 20px;
vertical-align: middle;
margin: -5px 10px 0 0;
}
.title {
cursor: pointer;
color: #0069ff;
font-size: 14px;
}
}
.ddiframe{
position: relative;
height: 100%;
width: 100%;
z-index: 1000;
}
.ddclosebtn{
position: absolute;
right: 20px;
top: 10px;
color: #ccc;
z-index:10001;
cursor: pointer;
}
</style>
<template>
<div class="login-bg"></div>
</template>
<script>
import types from "../store/types.js";
export default {
data() {
return {
ddLoginUrl: ""
};
},
created() {
let host = `http://${location.host}`;
this.ddLoginUrl = `${
window.config.huasanDD
}&redirect_uri=${`${ window.config.host}/#/ddlogin`}`;
this.switchLogin();
},
mounted() {},
methods: {
switchLogin() {
setTimeout(() => {
let { href } = window.location,
code = "";
console.log(href, href.includes("code"));
if (href.includes("code")) {
code = href.split("?")[1].split("#")[0];
}
console.log("code", code);
if (code) {
this.getLoginInfo(code);
} else {
window.location.href = this.ddLoginUrl;
}
}, 200);
},
getLoginInfo(code) {
this.$api.login.ddlogin({"code":code.split("=")[1]}).then(res => {
if (res.code == 200) {
this.loginMount(res.data);
} else if (res.code == 500) {
window.location.href = this.ddLoginUrl;
}
});
},
dealRedirect (){
let { redirect } ="";
if(redirect) {
redirect = redirect.split('/')[ redirect.split('/').length - 1 ];
}
return redirect
},
loginMount(res, logintype) {
this.$store.commit(types.ATOKEN, res.atoken);
// localStorage.setItem('rtoken',m.data.rtoken)
sessionStorage.setItem("user_unid", res.user_unid);
//本系统可以直接用本地缓存做
localStorage.setItem("atoken", res.atoken);
localStorage.setItem("uname", res.user_name);
this.$logs.oplogs(res.user_name, "serv_login", `登录了平台`);
localStorage.setItem("access_token", res.access_token || "");
// 处理登录用户权限菜单显示问题;
// if(res.firstLogin && logintype !== "dingding") {
// this.$router.push('resetpass')
// return;
// }
//算法配置列表
this.algoList();
//存储配置列表
this.storeConfList();
//code列表
this.getCatesList();
this.getCodeList();
this.getCustomCode();
this.getEventList();
this.getDev();
this.getMenu(res.user_unid);
},
getMenu(id) {
//获取菜单
this.$api.login
.getMenus({
shape: "tree"
})
.then(res => {
localStorage.setItem(
"menu",
JSON.stringify(res.menu_tree[0].children)
);
this.$store
.dispatch("GetMenuRole", res.menu_tree[0].children)
.then(r => {
this.$router
.push(res.menu_tree[0].children[0].children[0].path)
.catch(err => {
err;
});
});
});
},
algoList() {
this.$api.login
.algocombs({
limit: "",
algo_set: "video"
})
.then(res => {
if (!res.ecode) {
this.$store.commit(types.ALGO, res.list_data);
}
})
.catch(err => {});
},
storeConfList() {
this.$api.login
.storeconfs({
offset: 0,
limit: ""
})
.then(res => {
if (!res.ecode) {
this.$store.commit(types.STORECONF, res.list_data);
}
})
.catch(err => {});
},
getCodeList() {
this.$api.codes
.cates()
.then(res => {
res.list_data.forEach(item => {
this.$api.codes
.codes({ active: true }, item.cate_unid)
.then(res => {
// 存储code列表
window.localStorage.setItem(
item.name,
JSON.stringify(res.list_data)
);
// 存储单独code
res.list_data.forEach(chilItem => {
window.localStorage.setItem(
item.name + "-" + chilItem.code,
chilItem.name
);
});
})
.catch(err => {});
});
})
.catch(err => {});
},
getCustomCode() {
this.$api.codes
.customCode()
.then(res => {
if (res.list_data.length > 0) {
res.list_data.forEach(item => {
window.localStorage.setItem(
item.name + "-" + item.cate,
item.unid
);
});
} else {
this.$message({
type: "warning",
message: "获取自定义编码失败!"
});
}
})
.catch(err => {});
},
getCatesList() {
this.$api.codes.eventCates({}).then(res => {
// 存储cate列表
window.localStorage.setItem("cate列表", JSON.stringify(res.list_data));
// 存储单独code
res.list_data.forEach(item => {
this.getOneEventList(item.code, item.event_cate_unid);
});
});
},
getOneEventList(code, id) {
this.$api.codes.eventType({}, id).then(res => {
// 存储cate列表
window.localStorage.setItem(code, JSON.stringify(res.list_data));
});
},
getEventList() {
this.$api.search.eventTypes({ active: true }).then(res => {
// 存储code列表
window.localStorage.setItem("安防事件", JSON.stringify(res.list_data));
// 存储单独code
res.list_data.forEach(item => {
window.localStorage.setItem("安防事件-" + item.code, item.name);
});
});
},
getDev() {
this.$api.resource.devs().then(res => {
localStorage.setItem("dev_unid", res[0].dev_unid);
this.getDevsName(res[0].dev_unid);
});
},
getDevsName(id) {
this.$api.resource
.getDevsName(
{
is_leaf: 0
},
id
)
.then(res => {
if (res.list_data.length > 0) {
sessionStorage.setItem("device_id", res.list_data[0].device_id);
}
});
}
}
};
</script>
<style scoped>
.login-bg {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background-image: url("../assets/img/login/background.png");
background-size: 100% 100%;
}
</style>
\ No newline at end of file
......@@ -238,7 +238,6 @@
message: '删除成功!'
});
this.getTableList();
debugger
this.$logs.oplogs(res,'serv_auth',`删除角色${row.name}`);
}else{
this.$message({
......@@ -247,7 +246,6 @@
});
}
})
}).catch(() => {
this.$message({
type: 'info',
......@@ -270,7 +268,6 @@
}
})
this.$refs.editTree.setCheckedKeys(permarr);
this.editUnid=row.role_unid;
})
},
......@@ -302,7 +299,6 @@
message: data.enote
});
}
})
}else{
this.$message({
......@@ -339,7 +335,6 @@
message: data.enote
});
}
})
}else{
this.$message({
......
......@@ -49,7 +49,7 @@
<el-button
size="small"
type="primary"
@click="submitUpload"
@click="submitUpload('config')"
plain
class="plainButton"
>参数导入</el-button
......@@ -151,6 +151,47 @@
</div>
</el-form>
</div>
<!-- 数据备份 -->
<div class="lineBox big"><i class="el-icon-share"></i>设备鉴权</div>
<div class="radioContent">
<div class="lineBox">
<span class="upTit">鉴权文件</span
><span class="upTit2">选择导入文件</span>
<div class="upInput">
<el-input v-model="authfilename"></el-input>
</div>
<span style="display: inline-block;">
<el-upload
class="upload-demo"
ref="authupload"
:on-change="authfileChange"
:multiple="false"
:show-file-list="false"
:auto-upload="false"
:action="authexurl"
:on-success="authsuccessback"
:data="updata"
:on-error="onerrorback"
>
<el-button
slot="trigger"
size="small"
type="primary"
class="primaryButton upButton"
>浏览</el-button
>
<el-button
size="small"
type="primary"
@click="submitUpload('auth')"
plain
class="plainButton"
>鉴权</el-button
>
</el-upload>
</span>
</div>
</div>
</el-form>
</div>
</template>
......@@ -160,8 +201,15 @@ export default {
return {
openRestart: false,
selectFilename: "",
authfilename:"",
authfile:null,
updata:{
name:'',
vchan_type:"authfile"
},
timeArr: [],
exurl: "http://" + location.host + "/api/v1/devconf_fx/restore",
authexurl:`http://${location.host}/api/v1/devconf_fx/devs/${localStorage.getItem("dev_unid")}/vfile_vchans`,
file: null,
dev_unid: localStorage.getItem("dev_unid"),
device_id: sessionStorage.getItem("device_id")
......@@ -196,12 +244,18 @@ export default {
});
}
},
submitUpload() {
submitUpload(type) {
if(type === 'config') {
let importFileExt = this.file.name.substr(
this.file.name.lastIndexOf(".")
);
this.$refs.upload.submit(); // 这里是执行文件上传的函数,其实也就是获取我们要上传的文件
} else if(type === 'auth'){
this.$refs.authupload.submit();
}
},
successback() {
this.$message({
type: "success",
......@@ -211,6 +265,15 @@ export default {
this.file = null;
this.$logs.oplogs(res,'serv_system',`参数导入`);
},
authsuccessback(){
this.$message({
type: "success",
message: "上传成功!"
});
this.selectFilename = "";
this.file = null;
this.$logs.oplogs(res,'serv_system',`鉴权文件导入`);
},
onerrorback() {
this.file = null;
},
......@@ -218,6 +281,11 @@ export default {
this.selectFilename = file.name;
this.file = file;
},
authfileChange(file, fileList) {
this.authfilename = file.name;
this.updata.name = file.name;
this.authfile = file;
},
reset() {
this.$confirm("此操作将恢复出厂设置, 是否继续?", "提示", {
confirmButtonText: "确定",
......
<template>
<div class="ocxbox">
<canvas id="video1" style="width:100%;height:100%;" class="fvideo"></canvas>
<div class="control" hidden>
<span :class="{'videostatus':true,'el-icon-video-play':videostatus,'el-icon-video-pause':!videostatus }" @click="controlvideo"></span>
<!-- <span :class="{'el-icon-full-screen':!furllstatus,'el-icon-circle-close':furllstatus,'videostatus':true, 'full-icon':true}" @click="fullvideo" id="full"></span> -->
</div>
</div>
</template>
<script>
var player;
export default {
data() {
return {
show: true,
videostatus:false,
furllstatus:false
};
},
computed: {},
methods: {
controlvideo() {
this.videostatus = !this.videostatus
if(!this.videostatus) {
this.startFunc()
} else {
this.stopFunc()
}
},
fullvideo(ev){
if(!this.furllstatus){
this.furllstatus = true;
this.fullel();
} else {
this.furllstatus = false;
this.exitFullscreen();
}
},
fullel(){
var ele = document.getElementById("full")
if (ele.requestFullscreen) {
ele.requestFullscreen();
} else if (ele.mozRequestFullScreen) {
ele.mozRequestFullScreen();
} else if (ele.webkitRequestFullScreen) {
ele.webkitRequestFullScreen();
}
},
exitFullscreen(){
var de = document
if (de.exitFullscreen) {
de.exitFullscreen();
} else if (de.mozCancelFullScreen) {
de.mozCancelFullScreen();
} else if (de.webkitCancelFullScreen) {
de.webkitCancelFullScreen();
}
},
startFunc(url) {
this.stopFunc()
/**
* 设置解密密码,必须是16字节
*/
player.setCryptoKey("");
/**
* 开始播放,参数为 http-flv或 websocket-flv 的url
*/
player.start(url);
},
stopFunc() {
/**
* 停止播放
*/
player.stop();
},
fullFunc() {
/**
* 全屏播放
*/
player.fullscreen();
},
volumeChange(event) {
/**
* 设置音量
* 0.0 ~~ 1.0
* 当为0.0时,完全静音, 最大1.0
*/
player.setVolume(event.target.value / 100.0);
},
bufferChange(event) {
player.setBufferTime(event.target.value);
},
scaleModeChange(event) {
/**
* 视频缩放模式, 当视频分辨率比例与Canvas显示区域比例不同时,缩放效果不同:
* 0 视频画面完全填充canvas区域,画面会被拉伸 --- 默认值
* 1 视频画面做等比缩放后,对齐Canvas区域,画面不被拉伸,但有黑边
* 2 视频画面做等比缩放后,完全填充Canvas区域,画面不被拉伸,没有黑边,但画面显示不全
* 软解时有效
*/
player.setScaleMode(event.target.value);
}
},
mounted() {
NodePlayer.load(() => {
/**
* 是否打印debug信息
*/
// NodePlayer.debug(true);
player = new NodePlayer();
/**
* 自动测试浏览器是否支持MSE播放,如不支持,仍然使用软解码。
* 紧随 new 后调用
* 不调用则只使用软解
*/
//player.useMSE();
/**
* 传入 canvas视图的id,当使用mse时,自动转换为video标签
*/
player.setView("video1");
/**
* 是否开启屏幕常亮
* 在手机浏览器上,canvas标签渲染视频并不会像video标签那样保持屏幕常亮
* 如果需要该功能, 可以调用此方法, 会有少量cpu消耗, pc浏览器不会执行
*/
player.setKeepScreenOn();
/**
* 设置为等比缩放模式
*/
player.setScaleMode(1);
/**
* 设置最大缓冲时长,单位毫秒,只在软解时有效
*/
player.setBufferTime(1000);
player.on("start", () => {
console.log("player on start");
});
player.on("stop", () => {
console.log("player on stop");
});
player.on("error", e => {
console.log("player on error", e);
});
player.on("videoInfo", (w, h) => {
console.log("player on video info width=" + w + " height=" + h);
});
player.on("audioInfo", (r, c) => {
console.log("player on audio info samplerate=" + r + " channels=" + c);
});
player.on("stats", stats => {
// console.log("player on stats=", stats);
});
player.on("metadata", metadata => {
var m = NodePlayer.AMF.parseScriptData(
metadata.buffer,
0,
metadata.length
);
console.log(m);
});
});
}
};
</script>
<style lang="stylus">
.ocxbox {
height: 100%;
position: relative;
.fvideo {
height: 100%;
width: 100%;
}
.control {
position: absolute;
bottom: 0;
height: 40px;
width: 100%;
background: rgba(255, 255, 255, 0.2);
display none
.videostatus {
cursor: pointer;
color: #fff;
font-size: 30px;
line-height: 40px;
padding-left: 10px;
}
.full-icon{
float right
margin-right 20px
font-size 25px
}
}
}
.ocxbox:hover {
.control{
// display block
cursor pointer
}
}
</style>
......@@ -26,6 +26,8 @@ export default {
props: ["playurl", "type"],
methods: {
videoPlay: function() {
debugger
this.urlFlag = false;
console.log(this.playurl);
if (!this.playurl.sip_serv_ip) {
......
......@@ -104,7 +104,7 @@ export default {
connectwebsocket(type) {
let that = this;
this.connect_id = new Date().getTime();
if(config.https) {
if(window.config.https) {
this.cws = new WebSocket(
`wss://${this.$api.wsIP}/websocket/v1/recv_data/connects/${this.connect_id}`
);
......
......@@ -63,7 +63,8 @@
<el-col :span="15" class="ht100">
<div class="video-box">
<div class="play-box">
<videoplay ref="videoplay" :playurl="playurl"></videoplay>
<videoplay ref="videoplay" :playurl="playurl" v-if="!ischrome"></videoplay>
<flvvideo ref="flvideo" v-if="ischrome"></flvvideo>
</div>
<div class>
<setting
......@@ -89,6 +90,7 @@
</template>
<script>
import videoplay from "../public/videoPlay";
import flvvideo from "../public/flvvideo"
import InfoDialog from "../public/infodialog";
import setting from "./setting";
import eventtab from "./eventTab";
......@@ -97,6 +99,7 @@ export default {
videoplay,
InfoDialog,
setting,
flvvideo,
eventtab
},
data() {
......@@ -109,6 +112,7 @@ export default {
subindex: -1,
playurl: "",
taskID: "",
streamclock:null,
currentSubtaskId: "",
defaultProps: {
children: "children",
......@@ -160,14 +164,7 @@ export default {
},
//发送推流请求
pushSteam(vdata) {
let data = {
send_stream: true,
task_id: this.currentSubtaskId,
is_analyse: true
};
this.$api.task
.getStream(this.dev_unid, vdata.vchan.vchan_refid, data)
.then(m => {
this.steam(vdata).then(m => {
if (m.ecode) {
this.$message({
message: "发送推流请求失败:" + m.enote,
......@@ -175,11 +172,36 @@ export default {
});
} else {
this.vchandata = vdata.vchan;
clearInterval(this.streamclock)
this.streamclock = null;
this.getPlayUrl();
}
})
},
steam(vdata){
return new Promise((resolve, reject) =>{
let data = {
send_stream: true,
task_id: this.currentSubtaskId,
is_analyse: true
};
this.$api.task
.getStream(this.dev_unid, vdata.vchan.vchan_refid, data)
.then(m => {
resolve(m);
});
})
},
getPlayUrl: function() {
if(this.ischrome) {
let ip = this.$api.flvIP;
let url = `http://${ip}/live/${this.currentSubtaskId}.flv`
console.log("FLV播放地址:", url)
this.$refs.flvideo.startFunc(url);
this.streamclock = setInterval(()=> {
this.steam(this.subtaskdata)
},9000)
}
this.$api.task.getPlayUrl(this.currentSubtaskId).then(res => {
this.playurl = res;
if (this.playurl.rtsp_url) {
......@@ -188,7 +210,7 @@ export default {
type: "success"
});
setTimeout(() => {
this.$refs.videoplay.videoPlay();
!this.ischrome?this.$refs.videoplay.videoPlay():null;
}, 2000);
console.info("视频播放地址:", this.playurl.rtsp_url);
} else {
......@@ -216,10 +238,16 @@ export default {
},
created() {
this.getTask();
this.ischrome = this.checkchrome();
},
mounted() {
},
beforeDestroy(){
clearInterval(this.streamclock);
this.streamclock = null;
}
};
</script>
......
......@@ -95,7 +95,7 @@ export default {
this.subtaskid = subid;
this.subtask_name = subdata.subtask_name;
this.dialogVisible = true;
this.uploadurl = `${config.https?'https':'http'}://${location.host}/api/v1/devconf_fx/import/${this.subtaskid}`;
this.uploadurl = `${window.config.https?'https':'http'}://${location.host}/api/v1/devconf_fx/import/${this.subtaskid}`;
this.fileList = [];
this.$store.commit("setocxstate", 0);
},
......
......@@ -471,7 +471,7 @@ export default {
this.conditions.location_code
? this.conditions.location_code.replace(/\s\s*/g, "")
: this.conditions.location_code
}&event_cate=${cate}`;
}&event_cate=${cate}&event_type=${this.conditions.type}`;
this.$logs.oplogs({},'serv_serarch',`事件数据导出`);
window.open(encodeURI(url));
},
......
......@@ -132,6 +132,10 @@
</el-date-picker>
</span>
</el-form-item>
<el-form-item label="导出设置">
<el-checkbox v-model="checked" true-label="1" false-label="0">
<span> 带视频导出</span></el-checkbox>
</el-form-item>
</el-form>
</el-col>
<el-col :span="2">
......@@ -159,6 +163,7 @@
:data="formatterData"
:height="tableHeight"
v-loading="loading"
ref="eventTable"
stripe
border
@selection-change="handleSelectionChange"
......@@ -435,6 +440,7 @@ export default {
return {
loading: false,
playurl: "",
checked:"0",
detailObj: {},
carImg: require("@/assets/img/home/defaultImg.png"),
detailImg: "",
......@@ -465,6 +471,7 @@ export default {
page: 1,
pageSize: 30,
selectcheck: [],
exportevent:[],
currentIndex: 0,
taskList: [],
displaystatus:'table',
......@@ -560,7 +567,11 @@ export default {
"&is_key_vehicle=" +
this.conditions.is_key_vehicle +
"&illegal_code=" +
this.conditions.illegal
this.conditions.illegal +
"&isHasVideo=" +
this.checked +
"&event_unids=" +
this.exportevent.join(",")
)
);
},
......@@ -622,8 +633,10 @@ export default {
},
handleSelectionChange(obj) {
this.selectcheck = [];
this.exportevent = [];
obj.forEach(item => {
this.selectcheck.push(item.id);
this.exportevent.push(item.unid);
});
},
handleSizeChange(val) {
......
......@@ -253,23 +253,39 @@
@refresh="getTaskList"
></editset>
<editvideo
v-if="!isbigtree"
ref="editvideo"
:parentData="curtask"
:pedittype="pedittype"
@refresh="getTaskList"
></editvideo>
<editVidebigree
v-if="isbigtree"
ref="editvideo"
:parentData="curtask"
:pedittype="pedittype"
@refresh="getTaskList"
></editVidebigree>
</div>
</div>
</template>
<script>
import editset from "./editSet";
import editvideo from "./editVideo";
import editVidebigree from "./editVidebigree";
import subTaskInfo from "./subtask.vue";
import mixin from "../../assets/js/mixin";
export default {
components: {
editset,
editvideo,
editVidebigree,
subTaskInfo
},
mixins: [mixin],
data() {
return {
isbigtree:window.config.bigtree,
task_name: "",
curtask: "",
task_algo_type: "",
......@@ -288,11 +304,6 @@ export default {
curscrollTop: 0
};
},
components: {
editset,
editvideo,
subTaskInfo
},
methods: {
expandchange(row, prow) {
......
No preview for this file type
......@@ -5,6 +5,7 @@ const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
.BundleAnalyzerPlugin;
module.exports = {
productionSourceMap: false,
lintOnSave: false,
publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
// ...
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!