Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
fanxing_new
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1167aacc
authored
Oct 29, 2020
by
潘建波
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加算法折线区域
1 parent
06c3c266
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
25 deletions
src/api/baseUrl.js
src/views/Layout/index.vue
src/views/Login.vue
src/views/sceneManage/setting/area.vue
src/views/sceneManage/setting/areaconfig/TraficCanvas.vue
src/views/sceneManage/setting/areaconfig/roi_1.js
src/api/baseUrl.js
View file @
1167aac
...
...
@@ -3,7 +3,7 @@ console.log(process.env.NODE_ENV);
switch
(
process
.
env
.
NODE_ENV
)
{
case
"development"
:
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl
=
"http://192.168.9.
2
33:20080"
;
// 测试环境url
baseUrl
=
"http://192.168.9.
1
33:20080"
;
// 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510';
...
...
src/views/Layout/index.vue
View file @
1167aac
...
...
@@ -143,6 +143,7 @@ export default {
localStorage
.
removeItem
(
"curmenu"
);
this
.
$store
.
commit
(
types
.
ATOKEN
,
""
);
localStorage
.
removeItem
(
"atoken"
);
this
.
$logs
.
oplogs
(
''
,
'serv_login'
,
`退出了平台`
);
this
.
$router
.
push
(
"/login"
).
catch
(
err
=>
{
err
;
});
...
...
src/views/Login.vue
View file @
1167aac
...
...
@@ -109,7 +109,8 @@ export default {
this
.
$api
.
login
.
login
({
username
:
this
.
ruleForm
.
username
,
password
:
this
.
baseencode
(
this
.
ruleForm
.
password
),
// password: this.baseencode(this.ruleForm.password),
password
:
this
.
ruleForm
.
password
,
user_type
:
"user"
})
.
then
(
res
=>
{
...
...
@@ -120,7 +121,7 @@ export default {
//本系统可以直接用本地缓存做
localStorage
.
setItem
(
"atoken"
,
res
.
atoken
);
localStorage
.
setItem
(
"uname"
,
res
.
user_name
);
this
.
$logs
.
oplogs
(
res
,
'serv_login'
,
`登录了平台`
);
this
.
$logs
.
oplogs
(
res
.
user_name
,
'serv_login'
,
`登录了平台`
);
// 处理登录用户权限菜单显示问题;
if
(
res
.
firstLogin
)
{
this
.
$router
.
push
(
'resetpass'
)
...
...
src/views/sceneManage/setting/area.vue
View file @
1167aac
...
...
@@ -32,6 +32,7 @@ import FlowCanvas from "./areaconfig/FlowCanvas";
import
SafeCanvas
from
"./areaconfig/SafeCanvas"
;
import
FaceCanvas
from
"./areaconfig/FaceCanvas"
;
import
ComplexCanvas
from
"./areaconfig/ComplexCanvas"
;
import
{
roi
}
from
"./areaconfig/roi_1"
export
default
{
data
()
{
return
{
...
...
@@ -94,7 +95,8 @@ export default {
setTimeout
(()
=>
{
_this
.
$refs
.
canvas
.
stageInit
();
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
);
},
...
...
src/views/sceneManage/setting/areaconfig/TraficCanvas.vue
View file @
1167aac
...
...
@@ -530,6 +530,7 @@ export default {
//TODO handle the exception
console
.
log
(
e
);
}
debugger
//车道和行人
if
(
obj
.
median_lines
.
lane_count
>
0
)
{
let
ary
=
obj
.
median_lines
.
lane
;
...
...
@@ -1193,6 +1194,8 @@ export default {
if
(
!
this
.
needRect
)
return
;
this
.
needRect
=
false
;
if
(
this
.
drawState
==
3
)
{
//车道属性
debugger
let
layer
=
this
.
layers
[
this
.
drawState
];
let
rects
=
layer
.
get
(
".rect"
);
let
rect
=
rects
[
rects
.
length
-
1
];
...
...
@@ -1635,7 +1638,6 @@ export default {
},
//生成车道
drawRoad
:
function
()
{
debugger
;
if
(
this
.
roadFlag
===
true
)
return
;
if
(
this
.
roadFlag
===
false
)
{
this
.
$alert
(
"车道线有修改,请逐一检查车道属性是否正确"
,
"提示"
,
{
...
...
@@ -1671,7 +1673,16 @@ export default {
var
len
=
arr
.
length
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
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
];
//元素交换
arr
[
j
+
1
]
=
arr
[
j
];
...
...
@@ -1681,8 +1692,9 @@ export default {
}
return
arr
;
}
console
.
log
(
"排序后的蓝色车道线"
);
console
.
log
(
sortBlueLine
(
this
.
blueLines
));
// this.blueLines = sortBlueLine(this.blueLines);
console
.
log
(
"蓝色车道线"
,
this
.
blueLines
);
// console.log(sortBlueLine(this.blueLines));
this
.
blueLines
.
forEach
((
ele
,
index
)
=>
{
let
points
=
this
.
sortLinePoints
(
ele
.
attrs
.
points
);
if
(
index
>
0
)
{
...
...
@@ -1708,19 +1720,37 @@ export default {
Math
.
pow
(
points
[
points
.
length
-
1
]
-
lastPoints
[
1
],
2
);
let
mPoints
;
if
(
num1
<
num2
)
{
mPoints
=
points
.
concat
([
lastPoints
[
lastPoints
.
length
-
2
],
lastPoints
[
lastPoints
.
length
-
1
],
lastPoints
[
0
],
lastPoints
[
1
]
]);
var
arr
=
[];
var
len
=
lastPoints
.
length
for
(
var
i
=
len
;
0
<
i
;
i
--
)
{
if
(
i
%
2
==
0
){
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
{
mPoints
=
points
.
concat
([
lastPoints
[
0
],
lastPoints
[
1
],
lastPoints
[
lastPoints
.
length
-
2
],
lastPoints
[
lastPoints
.
length
-
1
]
]);
let
arr
=
[];
let
len
=
lastPoints
.
length
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
if
(
i
%
2
==
0
){
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
(
"morePoints"
,
...
...
@@ -1730,17 +1760,18 @@ export default {
);
rect
.
roadIndex
=
index
-
1
;
this
.
roadLayer
.
add
(
rect
);
//绘制车道中线
//绘制车道
debugger
if
(
!
this
.
roads
[
index
-
1
])
{
this
.
roads
[
index
-
1
]
=
{};
}
var
newmPoints
=
mPoints
.
filter
(
item
=>
item
);
let
road
=
this
.
roads
[
index
-
1
];
let
cPoints
=
[
(
newmPoints
[
0
]
+
newmPoints
[
6
])
/
2
,
(
newmPoints
[
1
]
+
newmPoints
[
7
])
/
2
,
(
newmPoints
[
2
]
+
newmPoints
[
4
])
/
2
,
(
newmPoints
[
3
]
+
newmPoints
[
5
])
/
2
(
newmPoints
[
0
]
+
newmPoints
[
newmPoints
.
length
-
2
])
/
2
,
(
newmPoints
[
1
]
+
newmPoints
[
newmPoints
.
length
-
1
])
/
2
,
(
newmPoints
[
2
]
+
newmPoints
[
newmPoints
.
length
-
4
])
/
2
,
(
newmPoints
[
3
]
+
newmPoints
[
newmPoints
.
length
-
3
])
/
2
];
road
.
cPoints
=
cPoints
;
let
cLine
=
this
.
drawLine
(
"morePoints"
,
cPoints
,
this
.
color
[
2
]);
...
...
@@ -1919,6 +1950,7 @@ export default {
rectPoints2
=
this
.
sortLinePoints
(
this
.
blueLines
[
index
+
1
].
attrs
.
points
);
debugger
let
options
=
{
lane_seq
:
index
+
1
,
lane_no
:
midLine
.
index
,
...
...
src/views/sceneManage/setting/areaconfig/roi_1.js
0 → 100644
View file @
1167aac
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment