Commit 7cc59b41 by 潘建波

【new】多预置位提交

【new】flv播放断流问题
1 parent f25c960d
No preview for this file type
......@@ -2,7 +2,7 @@ window.config = {
"logstatus":true, //是否开启日志收集
"hadertitle":"AI视频分析平台",//系统标题
"logintitle":"AI视频分析平台",//展示标题
"https": false,
"https": true,
"isvideo":0,
"bigtree":false,//大数据展示树
"host":"http://10.1.200.100:20080",
......@@ -11,4 +11,6 @@ window.config = {
"huasanDD": 'http://aaa.zzgx.gov.cn/oauth/authorize?response_type=code&scope=read&client_id=KLjmdAH0',
"ddwsurl":"10.1.200.97:29090",
"isdd":false, //是否开启钉钉登录
"version":"2.1.0",
"encrypt":false,//是否加密true采用sha1加密,false不加密
}
{"commit":"e9b878f7deaf4f5dad924a65071186ebc6f970d7","commitDate":"2021-5-25 16:10","buildDate":"2021-5-27 19:23","version":"2.0.9","info":"【BUG】修改密码验证方式 【new】增加用户显示,增加推出提示 【new】过车增加速度"}
{"commit":"f25c960da3c22d3c221e8aea91f7d7a900b0205d","commitDate":"2021-5-31 14:0","buildDate":"2021-6-16 11:9","version":"2.1.0","info":"合并修改"}
\ No newline at end of file
......@@ -8,7 +8,13 @@ export default {
data() {
return {};
},
watch:{
$route(to,from){
if(!to.meta.isopen){
this.$router.push('/login')
}
}
},
created() {
let menus = JSON.parse(localStorage.getItem("menu"));
if (menus) {
......
......@@ -21,8 +21,8 @@ switch (process.env.NODE_ENV) {
break;
case "production":
wsIP = location.host; // 生产环境url
flvIP = "192.168.9.245" + ":8080"
// flvIP = location.hostname + ":8080"
// flvIP = "192.168.9.245" + ":8080"
flvIP = location.hostname + ":8080"
break;
}
export default {
......
......@@ -4,7 +4,7 @@ import axios from "axios";
switch (process.env.NODE_ENV) {
case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = window.config.https?"https://192.168.9.233:20070":"http://192.168.9.173:20080"; // 测试环境url
baseUrl = window.config.https?"https://192.168.9.245: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';
......
......@@ -167,27 +167,28 @@ function checkIE() {
return false;
}
}
let versioninfo = require("../../../public/js/version");
let sha1 = require('js-sha1')
Vue.prototype.baseencode = function(str){
// return str
let base = "";
// if(versioninfo && versioninfo.version ){
// let vsstring = versioninfo.version.split(".");
// let base = "";
// let version = window.config.version
// if(version ){
// let vsstring = version.split(".");
// let vs = Number(String(vsstring[0])+String(vsstring[1])+String(vsstring[2]))
// if(vs > 207) {
// if(vs > 210) {
// base = str;
// } else {
// var encode = encodeURI(str);
// // 对编码的字符串转化base64
// var base64 = btoa(encode);
// base = base64;
// }
// } else {
// base = str;
// base = sha1(str);
// }
// return str
return sha1(str);
var encode = encodeURI(str);
// 对编码的字符串转化base64
var base64 = btoa(encode);
var base = base64;
return base
// return sha1(str);
}
Vue.prototype.showLocalTime = function(obj) {
if (obj == undefined) return;
......
......@@ -8,6 +8,9 @@ export const constantRouterMap = [{
name: "交通态势",
component: resolve => require(["../views/Layout/index.vue"], resolve),
redirect: "/login",
meta:{
isopen:true
},
children: [{
path: "/trficcshow",
name: "状态展示",
......@@ -25,10 +28,16 @@ export const constantRouterMap = [{
{
path: "/ddlogin",
name: "ddlogin",
meta:{
isopen:true
},
component: resolve => require(["../views/ddlogin.vue"], resolve)
},{
path: "/login",
name: "login",
meta:{
isopen:true
},
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
......
......@@ -35,9 +35,11 @@ function filterAsyncRouter(asyncRouterMap, roles) {
var newData = [];
// return routers
asyncRouterMap.forEach((ele, index) => {
ele.meta.isopen = false
roles.map(m => {
if (ele.path == m.path) {
let obj = ele;
ele.meta.isopen = true
if (m.children && m.children.length > 0) {
obj.children = filterAsyncRouter(ele.children, m.children);
} else {
......
......@@ -64,7 +64,7 @@
<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 class="syversion">版本:v{{ versioninfo }}</div>
</div>
</div>
</div>
......@@ -72,8 +72,8 @@
<script>
let particlesConfig = require("../assets/js/particles.json");
let versioninfo = require("../../public/js/version");
// import { config } from "../../public/js/config";
let versioninfo = window.config.version
let sha1 = require('js-sha1')
import types from "../store/types.js";
export default {
name: "Login",
......@@ -97,6 +97,7 @@ export default {
password: "",
showdd: true,
innerHeight: 0,
step:0,
logintitle: "",
isdd: window.config.isdd,
webSocketL: null,
......@@ -129,11 +130,13 @@ export default {
initHeight() {
this.innerHeight = window.innerHeight;
},
login() {
//兼容处理
login(type) {
this.$api.login
.login({
username: this.ruleForm.username,
password: this.baseencode(this.ruleForm.password),
password: window.config.encrypt?sha1(this.ruleForm.password):this.baseencode(this.ruleForm.password),
// password: this.ruleForm.password,
user_type: "user",
})
......@@ -141,6 +144,10 @@ export default {
if (!res.ecode) {
this.loginMount(res, "user");
} else {
if(res.ecode == "1000"){
this.$router.push('resetpass')
return false
}
this.$message({
type: "error",
message: res.enote,
......@@ -173,10 +180,10 @@ export default {
//存储配置列表
this.storeConfList();
//code列表
this.getCatesList();
this.getCodeList();
this.getCustomCode();
this.getEventList();
// this.getCatesList();
// this.getCodeList();
// this.getCustomCode();
// this.getEventList();
this.getDev();
this.getMenu(res.user_unid);
},
......
......@@ -37,6 +37,7 @@
</template>
<script>
let sha1 = require('js-sha1')
export default {
data() {
var validatePass = (rule, value, callback) => {
......@@ -90,15 +91,16 @@ export default {
methods: {
submitForm(formName) {
let data = {
old_pwd: this.baseencode(this.ruleForm.oldpassword),
new_pwd: this.baseencode(this.ruleForm.newpassword)
old_pwd: window.config.encrypt?sha1(this.ruleForm.password):this.baseencode(this.ruleForm.password),
new_pwd: window.config.encrypt?sha1(this.ruleForm.newpassword):this.baseencode(this.ruleForm.newpassword),
};
this.$refs[formName].validate(valid => {
if (valid) {
let user_unid = sessionStorage.getItem("user_unid");
this.$api.ops.resetPwd(data, user_unid).then(res => {
this.$router.push("/login");
this.$logs.oplogs(res, "serv_login", `修改密码`);
this.$router.push("/login");
}).catch(err => {
if (err.response) {
this.$message({
......
......@@ -162,7 +162,7 @@
addAlgo(){
this.progress_status = true
var formData = new FormData();
formData.append('list[0].file', document.getElementById('algo_file').files[0]);
formData.append('list[0].file', "document.getElementById('algo_file').files[0]");
formData.append('list[0].file_type', this.algoType);
let formConf = {
headers: {
......
......@@ -75,7 +75,9 @@ export default {
this.getCustomCode();
this.getEventList();
this.getDev();
this.getMenu(res.user_unid);
setTimeout(() => {
this.getMenu(res.user_unid);
}, 10);
},
getMenu(id) {
//获取菜单
......
......@@ -178,6 +178,7 @@
</div>
</template>
<script>
let sha1 = require('js-sha1')
export default {
data() {
var checkRole = (rule, value, callback) => {
......@@ -202,6 +203,7 @@ export default {
} else {
callback();
}
callback();
};
var validatePass2 = (rule, value, callback) => {
if (value === "") {
......@@ -369,7 +371,9 @@ export default {
this.editVisible = true;
},
openAddDialog() {
this.$refs["addForm"].resetFields();
if(this.$refs["addForm"]){
this.$refs["addForm"].resetFields();
}
},
addUser() {
this.addVisible = true;
......@@ -381,10 +385,10 @@ export default {
.addUser({
norm_type: this.addForm.norm_type,
username: this.addForm.username,
password: this.baseencode(this.addForm.password)
password: window.config.encrypt?sha1(this.addForm.password):this.baseencode(this.addForm.password),
})
.then(res => {
if (!res.ecode) {
if (res.ecode == "200" || !res.ecode) {
this.$api.ops
.bindRole(
{
......@@ -409,9 +413,10 @@ export default {
}
});
} else {
debugger
this.$message({
type: "error",
message: "添加失败!"
message: res.enote
});
}
});
......
......@@ -16,6 +16,7 @@ export default {
show: true,
videostatus: false,
furllstatus: false,
cururl:"",
player: "",
};
},
......@@ -39,31 +40,77 @@ export default {
// this.flv_destroy();
// }
// }
debugger
if(this.player) {
this.destoryVideo(this.player);
}
this.cururl = url;
this.player = flvjs.createPlayer({
type: "flv",
isLive: true,
hasAudio: false,
url: url,
},{
enableWorker: false, //不启用分离线程
enableStashBuffer: false, //关闭IO隐藏缓冲区
reuseRedirectedURL: true, //重用301/302重定向url,用于随后的请求,如查找、重新连接等。
autoCleanupSourceBuffer: true //自动清除缓存
});
this.player.attachMediaElement(playerel);
this.player.load();
this.player.play();
this.player.on(flvjs.Events.ERROR, (errType, errDetail) => {
// alert("网络波动,正在尝试连接中...");
console.log("==============",errType)
debugger
if (this.player) {
this.reloadVideo(this.player);
}
// errType是 NetworkError时,对应errDetail有:Exception、HttpStatusCodeInvalid、ConnectingTimeout、EarlyEof、UnrecoverableEarlyEof
// errType是 MediaError时,对应errDetail是MediaMSEError 或MEDIA_SOURCE_ENDED
});
this.player.on("statistics_info", (res)=> {
if (this.lastDecodedFrame == 0) {
this.lastDecodedFrame = res.decodedFrames;
return;
}
if (this.lastDecodedFrame != res.decodedFrames) {
this.lastDecodedFrame = res.decodedFrames;
} else {
this.lastDecodedFrame = 0;
if (this.player) {
this.reloadVideo(this.player)
}
}
});
//2000毫秒执行一次
},
flv_start() {
this.player.play();
},
flv_pause() {
this.player.pause();
reloadVideo(flvPlayer) {
this.destoryVideo(flvPlayer);
this.startFunc(this.cururl);
},
destoryVideo(flvPlayer) {
flvPlayer.pause();
flvPlayer.unload();
flvPlayer.detachMediaElement();
flvPlayer.destroy();
flvPlayer = null;
},
flv_destroy() {
flv_pause() {
this.player.pause();
this.player.unload();
this.player.detachMediaElement();
this.player.destroy();
this.player = null;
},
},
mounted() {},
destroyed(){
if(this.player) {
this.destoryVideo(this.player)
}
}
};
</script>
<style lang="stylus">
......
......@@ -240,7 +240,7 @@
<li :title="getCode('安防事件', curPicData.event_type)">
<span>事件类型:</span>
<span>{{
getCode("安防事件", String(curPicData.event_type))
curPicData.event_type
}}</span>
</li>
<li
......
......@@ -69,7 +69,7 @@
</span>
</div>
<div style="color;#ccc;font-size:12px;margin-top:10px" v-show="showdirection">方向:1进入区域,2出去区域,3双向警告</div>
<div style="color;#ccc;font-size:12px;margin-top:10px" v-show="showligang">人数区间 1--10人</div>
</div>
</div>
</div>
......@@ -132,6 +132,7 @@ export default {
color: "#E34F51", //画笔颜色
//polygon 相关参数
polygonMode: false,
showligang:true,
pointArray: [],
lineArray: [],
activeShape: false,
......@@ -142,6 +143,7 @@ export default {
imgSrc: "",
polygonpoint:[],
canvas: null,
xmldata:null,
curklass:null, //活动对象
};
},
......@@ -224,13 +226,15 @@ export default {
mouseTo.y = points[1].y * 500;
},
clearcanvas(){
this.canvas.clear();
this.setAreaconfig();
this.klassarr.map((ele, i) => {
if (ele.key === this.citem.config["算法ID"]) {
this.klassarr.splice(i, 1);
for(let i = 0; i < this.klassarr.length; i++) {
if(this.klassarr[i].key == this.citem.config["算法ID"]) {
this.klassarr.splice(i, 1);
i--
}
});
}
console.log(this.klassarr);
this.canvas.clear();
},
intPolygon(points) {
mouseFrom.x = points[0].x * 700;
......@@ -252,11 +256,11 @@ export default {
if (!this.canvas) {
this.Initfab();
}
this.xmldata = data;
if (data.xml !== undefined && data.xml.indexOf('undefined')< 0) {
this.basconfig = Object.assign(
this.oParse.parseXML(xml),
this.oParse.parseXML(data.xml)
);
let base = this.oParse.parseXML(xml);
this.mapobj('root',base)
this.basconfig = base
} else {
this.basconfig = this.oParse.parseXML(xml);
}
......@@ -273,6 +277,25 @@ export default {
}, 1500);
} catch (error) {}
},
//深度遍历对象
mapobj(parents,obj){
for(var i in obj) {
if(typeof(obj[i]) =="object") {
let p = "";
if(i == 'root'){
p = "['"+i+"']"
} else{
p = parents+ "['"+i+"']"
}
this.mapobj(p,obj[i])
} else {
let p = parents + "['"+i+"']"
var base = this.oParse.parseXML(xml);
var config = this.oParse.parseXML( this.xmldata.xml);
eval('obj[i]'+'='+'config' + p )
}
}
},
getObjects(klass) {
//获取所有的列表对象
var group = this.canvas.getObjects();
......@@ -297,9 +320,6 @@ export default {
* tab切换保存之前绘制的数据
*/
changetype(data, index) {
var group = this.canvas.getObjects();
var confdata = this.basconfig[this.cindex];
confdata.roi = group;
this.canvas.clear();
},
/**
......@@ -362,6 +382,7 @@ export default {
}
});
this.showdirection = item.config.算法ID === 'RegionalInvasion'?true:false;
this.showligang =item.config.算法ID === 'AbsentDetection'?true:false;
this.setAreaconfig();
},
/**
......@@ -826,7 +847,7 @@ export default {
confdata.roi = group;
cvunselect = false;
// vthis.klassarr.push(this.canvasObject);
vthis.klassarr.push(vthis.canvasObject)
// vthis.klassarr.push(vthis.canvasObject)
});
this.canvasObject.id = vthis.uuid();
......@@ -913,11 +934,19 @@ export default {
}
}
});
var vthis = this;
this.canvas.on("mouse:up", function(options) {
var xy = transformMouse(options.e.offsetX, options.e.offsetY);
mouseTo.x = xy.x;
mouseTo.y = xy.y;
console.log(vthis.canvasObject)
if(vthis.canvasObject != null) {
vthis.klassarr.push( vthis.canvasObject);
}
vthis.canvasObject = null;
let unique = [...new Set(vthis.klassarr)]
vthis.klassarr = unique
console.log(vthis.klassarr)
drawingObject = null;
moveCount = 1;
doDrawing = false;
......
......@@ -788,6 +788,7 @@ export default {
},
//切换配置项
changeLayer: function(index) {
debugger
this.cindex = index;
if (this.needRect || this.needLine) {
let shape = this.needRect ? "区域" : "线段";
......@@ -1427,12 +1428,14 @@ export default {
if (!this.selectedShape) {
return;
}
debugger
switch (this.drawState) {
case 1:
if (
this.selectedShape.line_type != 0 &&
this.selectedShape.line_type != 1 &&
this.selectedShape.line_type != 7
this.selectedShape.line_type != 7 &&
this.selectedShape.line_type != 9
) {
let index = this.blueLines.indexOf(this.selectedShape);
this.blueLines.splice(index, 1);
......@@ -2423,7 +2426,7 @@ button {
position: relative;
float: right;
min-height: 450px;
width: 22%;
width: 28%;
color: #fff;
}
.modal-editbox .modal-lb {
......
export const xml = `<?xml version="1.0" encoding="GBK"?><root><算法功能><行为分析_BG><人员脱岗><算法ID>AbsentDetection</算法ID><告警门限值>60</告警门限值><告警间隔>5</告警间隔></人员脱岗><人员入侵><算法ID>RegionalInvasion</算法ID><方向>1</方向></人员入侵><物品遗留><算法ID>GoodsMovedDeteion</算法ID><灵敏度>60</灵敏度><上报频率>3</上报频率><背景刷新时间>5</背景刷新时间></物品遗留><越线><算法ID>CrossLineDetection</算法ID></越线></行为分析_BG></算法功能></root>`
\ No newline at end of file
export const xml = `<?xml version="1.0" encoding="GBK"?><root><算法功能><行为分析_BG><人员脱岗><算法ID>AbsentDetection</算法ID><告警门限值>60</告警门限值><告警间隔>5</告警间隔><值岗人数>1</值岗人数></人员脱岗><人员入侵><算法ID>RegionalInvasion</算法ID><方向>1</方向></人员入侵><物品遗留><算法ID>GoodsMovedDetetion</算法ID><灵敏度>60</灵敏度><上报频率>3</上报频率><背景刷新时间>5</背景刷新时间></物品遗留><越线><算法ID>CrossLineDetection</算法ID></越线></行为分析_BG></算法功能></root>`
\ No newline at end of file
......@@ -3,7 +3,6 @@
<div>
<el-table
:data="taskInfo.mtasks[0].scenes"
stripe
highlight-current-row
style="width: 80%;float:left"
height="25vh"
......@@ -65,6 +64,22 @@
<span @click="setDemarcate(scope.row, scope.$index)">标定设置</span>
</el-tooltip>
<!-- <span @click="setTimer(scope.row, scope.$index)">时间设置</span> -->
<el-tooltip
class="item"
effect="dark"
content="删除场景"
placement="top"
>
<span v-if="scope.$index!=taskInfo.mtasks[0].scenes.length - 1" @click="delsounces(scope.row, scope.$index)" class="el-icon-remove"></span>
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
content="增加场景"
placement="top"
>
<span @click="addsounces()" class="el-icon-circle-plus"></span>
</el-tooltip>
</div>
</template>
</el-table-column>
......@@ -93,6 +108,7 @@
效果展示
<span class="set-icon el-icon-s-help"></span>
</div>
</div>
<handleparam ref="handleparam" :subtaskid="subtaskid"></handleparam>
</div>
......@@ -188,6 +204,21 @@ export default {
this.getSipSetting();
}
},
//增加场景
addsounces(){
let scensinit = JSON.parse(JSON.stringify(this.taskInfo.mtasks[0].scenes[0]));
scensinit.config = {}
scensinit.rois = "";
scensinit.runtime = -1
scensinit.scene_unid = this.uuid()
scensinit.position_name = 1
scensinit.position_num = -1
this.taskInfo.mtasks[0].scenes.push(scensinit)
},
//删除场景
delsounces(row,index){
this.taskInfo.mtasks[0].scenes.splice(index,1)
},
getSipSetting: function() {
if (this.dev_unid) {
this.$api.device.sipSet(this.dev_unid, this.user_unid).then(res => {
......@@ -270,14 +301,14 @@ export default {
this.$store.commit("setocxstate", 1);
},
handleCurrentChange(val) {
if (val.algo_type == 3) {
// 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) {
......
......@@ -160,7 +160,8 @@
<el-table-column prop="shoot_date" align="center" label="抓拍时间">
<template slot-scope="scope">
<span v-if="scope.row.event_data"
>{{ scope.row.shoot_date }} {{ scope.row.shoot_time }}</span
>{{showLocalTime(scope.row.event_dt)}}</span
>
</template>
</el-table-column>
......
......@@ -337,6 +337,7 @@
<div class="detaiCon">
<el-image
style="width: 100%;"
z-index="100"
:src="this.detailImg"
:preview-src-list="srcList"
>
......@@ -723,5 +724,13 @@ export default {
};
</script>
<style lang="scss" scoped>
.imgaddbtn{
position: absolute;
z-index: 2000;
height: 200px;
width: 200px;
top:0;
left: 0;
background: red;
}
</style>
......@@ -46,15 +46,15 @@ module.exports = {
// 第三方插件配置
},
devServer: {
proxy: {
"/api/dashboards": {
target: "http://192.168.9.133:5000", // 要访问的接口域名
// ws: true, // 是否启用websockets
changeOrigin: true, //开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
pathRewrite: {
"^/api": "" //这里理解成用'/api'代替target里面的地址,比如我要调用'http://40.00.100.100:3002/user/add',直接写'/api/user/add'即可
}
}
}
// proxy: {
// "/api/dashboards": {
// target: "http://192.168.9.133:5000", // 要访问的接口域名
// // ws: true, // 是否启用websockets
// changeOrigin: true, //开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,并同时接收请求的数据,这样服务端和服务端进行数据的交互就不会有跨域问题
// pathRewrite: {
// "^/api": "" //这里理解成用'/api'代替target里面的地址,比如我要调用'http://40.00.100.100:3002/user/add',直接写'/api/user/add'即可
// }
// }
// }
}
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!