Commit 1167aacc by 潘建波

增加算法折线区域

1 parent 06c3c266
...@@ -3,7 +3,7 @@ console.log(process.env.NODE_ENV); ...@@ -3,7 +3,7 @@ console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url // baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = "http://192.168.9.233:20080"; // 测试环境url baseUrl = "http://192.168.9.133:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url // baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510'; // baseUrl = 'http://vion-panda.51vip.biz:52510';
......
...@@ -143,6 +143,7 @@ export default { ...@@ -143,6 +143,7 @@ export default {
localStorage.removeItem("curmenu"); localStorage.removeItem("curmenu");
this.$store.commit(types.ATOKEN, ""); this.$store.commit(types.ATOKEN, "");
localStorage.removeItem("atoken"); localStorage.removeItem("atoken");
this.$logs.oplogs('','serv_login',`退出了平台`);
this.$router.push("/login").catch(err => { this.$router.push("/login").catch(err => {
err; err;
}); });
......
...@@ -109,7 +109,8 @@ export default { ...@@ -109,7 +109,8 @@ export default {
this.$api.login this.$api.login
.login({ .login({
username: this.ruleForm.username, username: this.ruleForm.username,
password: this.baseencode(this.ruleForm.password), // password: this.baseencode(this.ruleForm.password),
password: this.ruleForm.password,
user_type: "user" user_type: "user"
}) })
.then(res => { .then(res => {
...@@ -120,7 +121,7 @@ export default { ...@@ -120,7 +121,7 @@ export default {
//本系统可以直接用本地缓存做 //本系统可以直接用本地缓存做
localStorage.setItem("atoken", res.atoken); localStorage.setItem("atoken", res.atoken);
localStorage.setItem("uname", res.user_name); localStorage.setItem("uname", res.user_name);
this.$logs.oplogs(res,'serv_login',`登录了平台`); this.$logs.oplogs(res.user_name,'serv_login',`登录了平台`);
// 处理登录用户权限菜单显示问题; // 处理登录用户权限菜单显示问题;
if(res.firstLogin) { if(res.firstLogin) {
this.$router.push('resetpass') this.$router.push('resetpass')
......
...@@ -32,6 +32,7 @@ import FlowCanvas from "./areaconfig/FlowCanvas"; ...@@ -32,6 +32,7 @@ import FlowCanvas from "./areaconfig/FlowCanvas";
import SafeCanvas from "./areaconfig/SafeCanvas"; import SafeCanvas from "./areaconfig/SafeCanvas";
import FaceCanvas from "./areaconfig/FaceCanvas"; import FaceCanvas from "./areaconfig/FaceCanvas";
import ComplexCanvas from "./areaconfig/ComplexCanvas"; import ComplexCanvas from "./areaconfig/ComplexCanvas";
import {roi} from "./areaconfig/roi_1"
export default { export default {
data() { data() {
return { return {
...@@ -94,7 +95,8 @@ export default { ...@@ -94,7 +95,8 @@ export default {
setTimeout(() => { setTimeout(() => {
_this.$refs.canvas.stageInit(); _this.$refs.canvas.stageInit();
if (data.rois) { if (data.rois) {
_this.$refs.canvas.configInit(data.rois[0].roi); // _this.$refs.canvas.configInit(data.rois[0].roi);
_this.$refs.canvas.configInit(roi);
} }
}, 300); }, 300);
}, },
......
...@@ -530,6 +530,7 @@ export default { ...@@ -530,6 +530,7 @@ export default {
//TODO handle the exception //TODO handle the exception
console.log(e); console.log(e);
} }
debugger
//车道和行人 //车道和行人
if (obj.median_lines.lane_count > 0) { if (obj.median_lines.lane_count > 0) {
let ary = obj.median_lines.lane; let ary = obj.median_lines.lane;
...@@ -1193,6 +1194,8 @@ export default { ...@@ -1193,6 +1194,8 @@ export default {
if (!this.needRect) return; if (!this.needRect) return;
this.needRect = false; this.needRect = false;
if (this.drawState == 3) { if (this.drawState == 3) {
//车道属性
debugger
let layer = this.layers[this.drawState]; let layer = this.layers[this.drawState];
let rects = layer.get(".rect"); let rects = layer.get(".rect");
let rect = rects[rects.length - 1]; let rect = rects[rects.length - 1];
...@@ -1635,7 +1638,6 @@ export default { ...@@ -1635,7 +1638,6 @@ export default {
}, },
//生成车道 //生成车道
drawRoad: function() { drawRoad: function() {
debugger;
if (this.roadFlag === true) return; if (this.roadFlag === true) return;
if (this.roadFlag === false) { if (this.roadFlag === false) {
this.$alert("车道线有修改,请逐一检查车道属性是否正确", "提示", { this.$alert("车道线有修改,请逐一检查车道属性是否正确", "提示", {
...@@ -1671,7 +1673,16 @@ export default { ...@@ -1671,7 +1673,16 @@ export default {
var len = arr.length; var len = arr.length;
for (var i = 0; i < len; i++) { for (var i = 0; i < len; i++) {
for (var j = 0; j < len - 1 - i; j++) { for (var j = 0; j < len - 1 - i; j++) {
if (arr[j].attrs.points[0] > arr[j + 1].attrs.points[0]) { let startpointx = arr[j].attrs.points[0];
let endpointx = arr[j].attrs.points[arr[j].attrs.points.length -2];
let centerx = (endpointx - startpointx) /2 + startpointx;
let nextstartpointx = arr[j+1].attrs.points[0];
let nextendpointx = arr[j + 1].attrs.points[arr[j + 1].attrs.points.length -2];
let nextcenterx = (nextstartpointx - nextendpointx) /2 + nextstartpointx;
// let startpointy = arr[j].attrs.points[1];
// let endpointy = arr[j].attrs.points[arr[j].attrs.points.length -2];
// let centery = (endpointy -startpointy) /2 + startpointy;
if (centerx > nextcenterx) {
//相邻元素两两对比 //相邻元素两两对比
var temp = arr[j + 1]; //元素交换 var temp = arr[j + 1]; //元素交换
arr[j + 1] = arr[j]; arr[j + 1] = arr[j];
...@@ -1681,8 +1692,9 @@ export default { ...@@ -1681,8 +1692,9 @@ export default {
} }
return arr; return arr;
} }
console.log("排序后的蓝色车道线"); // this.blueLines = sortBlueLine(this.blueLines);
console.log(sortBlueLine(this.blueLines)); console.log("蓝色车道线",this.blueLines);
// console.log(sortBlueLine(this.blueLines));
this.blueLines.forEach((ele, index) => { this.blueLines.forEach((ele, index) => {
let points = this.sortLinePoints(ele.attrs.points); let points = this.sortLinePoints(ele.attrs.points);
if (index > 0) { if (index > 0) {
...@@ -1708,19 +1720,37 @@ export default { ...@@ -1708,19 +1720,37 @@ export default {
Math.pow(points[points.length - 1] - lastPoints[1], 2); Math.pow(points[points.length - 1] - lastPoints[1], 2);
let mPoints; let mPoints;
if (num1 < num2) { if (num1 < num2) {
mPoints = points.concat([ var arr = [];
lastPoints[lastPoints.length - 2], var len = lastPoints.length
lastPoints[lastPoints.length - 1], for(var i = len; 0 < i ; i--) {
lastPoints[0], if(i%2 == 0){
lastPoints[1] arr.push(lastPoints[i-2])
]); arr.push(lastPoints[i-1])
}
}
// mPoints = points.concat([
// lastPoints[lastPoints.length - 2],
// lastPoints[lastPoints.length - 1],
// lastPoints[0],
// lastPoints[1]
// ]);
mPoints = points.concat(arr)
} else { } else {
mPoints = points.concat([ let arr = [];
lastPoints[0], let len = lastPoints.length
lastPoints[1], for(let i = 0; i < len; i++) {
lastPoints[lastPoints.length - 2], if(i%2 == 0){
lastPoints[lastPoints.length - 1] a.push(lastPoints[i])
]); a.push(lastPoints[i+1])
}
}
mPoints = points.concat(arr)
// mPoints = points.concat([
// lastPoints[0],
// lastPoints[1],
// lastPoints[lastPoints.length - 2],
// lastPoints[lastPoints.length - 1]
// ]);
} }
let rect = this.drawRect( let rect = this.drawRect(
"morePoints", "morePoints",
...@@ -1730,17 +1760,18 @@ export default { ...@@ -1730,17 +1760,18 @@ export default {
); );
rect.roadIndex = index - 1; rect.roadIndex = index - 1;
this.roadLayer.add(rect); this.roadLayer.add(rect);
//绘制车道中线 //绘制车道
debugger
if (!this.roads[index - 1]) { if (!this.roads[index - 1]) {
this.roads[index - 1] = {}; this.roads[index - 1] = {};
} }
var newmPoints = mPoints.filter(item => item); var newmPoints = mPoints.filter(item => item);
let road = this.roads[index - 1]; let road = this.roads[index - 1];
let cPoints = [ let cPoints = [
(newmPoints[0] + newmPoints[6]) / 2, (newmPoints[0] + newmPoints[newmPoints.length -2]) / 2,
(newmPoints[1] + newmPoints[7]) / 2, (newmPoints[1] + newmPoints[newmPoints.length -1]) / 2,
(newmPoints[2] + newmPoints[4]) / 2, (newmPoints[2] + newmPoints[newmPoints.length - 4]) / 2,
(newmPoints[3] + newmPoints[5]) / 2 (newmPoints[3] + newmPoints[newmPoints.length -3]) / 2
]; ];
road.cPoints = cPoints; road.cPoints = cPoints;
let cLine = this.drawLine("morePoints", cPoints, this.color[2]); let cLine = this.drawLine("morePoints", cPoints, this.color[2]);
...@@ -1919,6 +1950,7 @@ export default { ...@@ -1919,6 +1950,7 @@ export default {
rectPoints2 = this.sortLinePoints( rectPoints2 = this.sortLinePoints(
this.blueLines[index + 1].attrs.points this.blueLines[index + 1].attrs.points
); );
debugger
let options = { let options = {
lane_seq: index + 1, lane_seq: index + 1,
lane_no: midLine.index, lane_no: midLine.index,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!