Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
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 a498f4cd
authored
Apr 02, 2022
by
李君
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
抓拍聚类增加特征划线
1 parent
edf49477
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
6 deletions
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
src/views/SnapshotCluster/ClusterResult/ClusterResultApi.js
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecord.vue
src/views/SnapshotCluster/imgDialog.vue
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
View file @
a498f4c
...
...
@@ -114,7 +114,7 @@
</div>
<el-image
:src=
"item.picture_url"
:fit=
"'fill'"
class=
"single-image"
>
class=
"single-image"
@
click=
"handleClick(item.picture_url,item.features_url)"
>
</el-image>
<div>
时间:
{{
item
.
counttime
}}
</div>
<div>
方向:
{{
formatDirection
(
item
.
direction
)
}}
</div>
...
...
@@ -136,6 +136,7 @@
style="text-align:center"
/>
</div>
<imgDialog
ref=
'imgModelRef'
></imgDialog>
</
template
>
<
script
>
...
...
@@ -144,8 +145,11 @@ import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResul
import
{
isArray
}
from
'@/PublicUtil/Judgment'
import
moment
from
'moment'
import
{
filterEmptyValueInObject
,
formatDate
,
formatTime
,
getPagedList
}
from
'@/PublicUtil/PublicUtil'
import
imgDialog
from
'../imgDialog.vue'
export
default
{
components
:{
imgDialog
},
setup
()
{
// scalar
const
pageNum
=
ref
(
1
)
...
...
@@ -158,7 +162,7 @@ export default {
const
plazaList
=
ref
([])
const
zoneList
=
ref
([])
const
gateList
=
ref
([])
const
imgModelRef
=
ref
();
const
pagedTableDataList
=
computed
(
()
=>
{
return
getPagedList
(
dataList
.
value
,
8
)
...
...
@@ -385,6 +389,14 @@ export default {
window
.
open
(
url
)
}
const
handleClick
=
function
(
url
,
feature
){
clusterResultApi
.
getBodyPoint
({
'feature_url'
:
feature
}).
then
(
(
r
)
=>
{
imgModelRef
.
value
.
initDialog
(
url
,
r
.
data
);
}
)
}
const
__main
=
function
()
{
getAccountList
()
}
...
...
@@ -416,6 +428,9 @@ export default {
formatDirection
,
downloadFile
,
getPagedList
,
handleClick
,
// ref
imgModelRef
}
}
}
...
...
src/views/SnapshotCluster/ClusterResult/ClusterResultApi.js
View file @
a498f4c
...
...
@@ -69,6 +69,17 @@ class ClusterResultApi {
)
}
getBodyPoint
(
data
)
{
return
axiosInstance
.
request
(
{
method
:
'GET'
,
url
:
`/feature/bodyPoint`
,
params
:
filterEmptyValueInObject
(
data
)
}
)
}
}
const
clusterResultApi
=
new
ClusterResultApi
()
...
...
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecord.vue
View file @
a498f4c
...
...
@@ -105,7 +105,7 @@
</div>
<el-image
:src=
"item.picture_url"
:fit=
"'fill'"
class=
"single-image"
>
class=
"single-image"
@
click=
"handleClick(item.picture_url,item.features_url)"
>
</el-image>
<div>
时间:
{{
item
.
counttime
}}
</div>
<div>
方向:
{{
formatDirection
(
item
.
direction
)
}}
</div>
...
...
@@ -127,16 +127,22 @@
style="text-align:center"
/>
</div>
<imgDialog
ref=
'imgModelRef'
></imgDialog>
</
template
>
<
script
>
import
{
computed
,
reactive
,
ref
,
toRaw
}
from
'vue'
import
snapshotRecordApi
from
'@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import
clusterResultApi
from
'@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import
{
isArray
}
from
'@/PublicUtil/Judgment'
import
moment
from
'moment'
import
{
filterEmptyValueInObject
,
formatDate
,
formatTime
,
getPagedList
}
from
'@/PublicUtil/PublicUtil'
import
imgDialog
from
'../imgDialog.vue'
export
default
{
components
:{
imgDialog
},
setup
()
{
// scalar
const
pageNum
=
ref
(
1
)
...
...
@@ -149,7 +155,7 @@ export default {
const
plazaList
=
ref
([])
const
zoneList
=
ref
([])
const
gateList
=
ref
([])
const
imgModelRef
=
ref
();
const
pagedTableDataList
=
computed
(
()
=>
{
return
getPagedList
(
dataList
.
value
,
8
)
...
...
@@ -361,7 +367,13 @@ export default {
const
downloadFile
=
function
(
url
)
{
window
.
open
(
url
)
}
const
handleClick
=
function
(
url
,
feature
){
clusterResultApi
.
getBodyPoint
({
'feature_url'
:
feature
}).
then
(
(
r
)
=>
{
imgModelRef
.
value
.
initDialog
(
url
,
r
.
data
);
}
)
}
const
__main
=
function
()
{
getAccountList
()
}
...
...
@@ -391,6 +403,9 @@ export default {
confirmSearch
,
formatDirection
,
downloadFile
,
handleClick
,
//ref
imgModelRef
}
}
}
...
...
src/views/SnapshotCluster/imgDialog.vue
0 → 100644
View file @
a498f4c
<
template
>
<a-modal
title=
"图片"
v-if=
'isVisible'
v-model:visible=
"isVisible"
width=
"1200px"
height=
'90%'
class=
"detail-modal"
>
<canvas
id=
"myCanvas"
></canvas>
<img
:src=
"imgUrl"
alt=
""
id=
"img"
>
<template
#
footer
>
<a-button
@
click=
"onCancel"
>
返回
</a-button>
</
template
>
</a-modal>
</template>
<
script
>
import
{
reactive
,
ref
}
from
"vue"
;
export
default
{
setup
()
{
const
isVisible
=
ref
(
false
);
const
isLoading
=
ref
(
false
);
const
detailData
=
ref
({});
const
imgUrl
=
ref
()
const
canvas
=
ref
()
const
ctx
=
ref
()
const
initDialog
=
(
url
,
data
)
=>
{
imgUrl
.
value
=
url
isVisible
.
value
=
true
;
setTimeout
(()
=>
{
debugger
var
imgscream
=
document
.
getElementById
(
"img"
);
let
height
=
imgscream
.
offsetHeight
;
let
width
=
imgscream
.
offsetWidth
;
canvas
.
value
=
document
.
getElementById
(
"myCanvas"
);
//初始化
canvas
.
value
.
height
=
height
;
canvas
.
value
.
width
=
width
;
ctx
.
value
=
canvas
.
value
.
getContext
(
"2d"
)
ctx
.
value
.
drawImage
(
imgscream
,
0
,
0
,
width
,
height
);
ctx
.
value
.
beginPath
();
ctx
.
value
.
lineWidth
=
3
ctx
.
value
.
strokeStyle
=
"red"
;
ctx
.
value
.
moveTo
(
data
.
head_x_inSmall
,
data
.
head_y_inSmall
);
//起始位置
ctx
.
value
.
lineTo
(
data
.
foot_x_inSmall
,
data
.
foot_y_inSmall
);
//停止位置
ctx
.
value
.
stroke
();
},
0
)
};
const
onCancel
=
()
=>
{
canvas
.
value
=
''
isVisible
.
value
=
false
;
};
return
{
isVisible
,
onCancel
,
initDialog
,
isLoading
,
imgUrl
,
detailData
};
},
};
</
script
>
<
style
lang=
"less"
scoped
>
#myCanvas
{
display
:
block
;
margin
:
0
auto
;
}
#img
{
position
:
relative
;
top
:
-5000px
;
float
:
left
;
}
</
style
>
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