Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-skynet-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-skynet-admin
Commits
445eb574
Commit
445eb574
authored
Nov 11, 2021
by
朱松文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
c8bd4248
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
15 deletions
+34
-15
index.vue
src/components/Camera/index.vue
+1
-1
data.d.ts
src/components/DogInfo/data.d.ts
+1
-0
data.d.ts
src/components/MyVideo/data.d.ts
+1
-0
index.vue
src/components/MyVideo/index.vue
+2
-3
index.ts
src/components/MyVideo/track/index.ts
+21
-11
CameraService.ts
src/service/CameraService.ts
+1
-0
common.ts
src/utils/common.ts
+7
-0
No files found.
src/components/Camera/index.vue
View file @
445eb574
...
@@ -54,7 +54,7 @@ export default class Camera extends BaseVue {
...
@@ -54,7 +54,7 @@ export default class Camera extends BaseVue {
}
}
handleClickCamera
(
cameraId
:
string
):
void
{
handleClickCamera
(
cameraId
:
string
):
void
{
this
.
$emit
(
"
clickCamera
"
,
{
cameraId
});
this
.
$emit
(
"
clickCamera
"
,
{
cameraId
,
groupName
:
this
.
groupName
});
}
}
handleCameraName
(
name
:
string
)
{
handleCameraName
(
name
:
string
)
{
...
...
src/components/DogInfo/data.d.ts
View file @
445eb574
...
@@ -16,4 +16,5 @@ export interface DogData {
...
@@ -16,4 +16,5 @@ export interface DogData {
frameCountWithRope
?:
number
;
frameCountWithRope
?:
number
;
frameCountWithoutRope
?:
number
;
frameCountWithoutRope
?:
number
;
withRopeRatio
?:
number
;
withRopeRatio
?:
number
;
objId
?:
string
}
}
src/components/MyVideo/data.d.ts
View file @
445eb574
...
@@ -2,6 +2,7 @@ export interface TrackData {
...
@@ -2,6 +2,7 @@ export interface TrackData {
DogId
:
string
,
DogId
:
string
,
FrameIndex
:
numbner
,
FrameIndex
:
numbner
,
HasRope
:
boolean
,
HasRope
:
boolean
,
obj_id
:
number
,
x1
:
number
,
x1
:
number
,
y1
:
number
,
y1
:
number
,
x2
:
number
,
x2
:
number
,
...
...
src/components/MyVideo/index.vue
View file @
445eb574
...
@@ -83,13 +83,12 @@ export default class MyVideo extends Vue {
...
@@ -83,13 +83,12 @@ export default class MyVideo extends Vue {
onSrcChange
(
dog
:
DogData
)
{
onSrcChange
(
dog
:
DogData
)
{
this
.
player
.
src
(
dog
.
fileName
);
this
.
player
.
src
(
dog
.
fileName
);
// this.player.currentTime((dog.startFrameIndex * 40) / 1000);
this
.
player
.
play
();
this
.
player
.
play
();
}
}
onTrackDataChange
(
dogIds
:
any
,
trackData
:
any
,
currentDogId
:
string
)
{
onTrackDataChange
(
dogIds
:
any
,
trackData
:
any
,
dog
:
DogData
)
{
//切换视频隐藏跟踪框
//切换视频隐藏跟踪框
this
.
dogTrack
.
initData
(
dogIds
,
trackData
,
currentDogId
);
this
.
dogTrack
.
initData
(
dogIds
,
trackData
,
dog
);
}
}
beforeDestroy
()
{
beforeDestroy
()
{
...
...
src/components/MyVideo/track/index.ts
View file @
445eb574
...
@@ -11,6 +11,7 @@ class DogTrack extends Component {
...
@@ -11,6 +11,7 @@ class DogTrack extends Component {
isReplaceDisplayNone
=
false
isReplaceDisplayNone
=
false
arrayIndex
=
0
arrayIndex
=
0
preCurrentTime
=
0
preCurrentTime
=
0
isExtract
=
false
constructor
(
player
,
options
)
{
constructor
(
player
,
options
)
{
super
(
player
,
options
);
super
(
player
,
options
);
...
@@ -28,16 +29,9 @@ class DogTrack extends Component {
...
@@ -28,16 +29,9 @@ class DogTrack extends Component {
// })
// })
}
}
// fullScreenChange(e, player) {
// if (player.isFullscreen()) {
// console.log("full", e.currentTarget.offsetWidth, e.currentTarget.offsetHeight)
// }
// }
update
()
{
update
()
{
if
(
this
.
processing
||
this
.
trackData
.
length
===
0
)
return
if
(
this
.
processing
||
this
.
trackData
.
length
===
0
)
return
// const now = new Date().getTime()
// console.log("call", this.arrayIndex)
this
.
processing
=
true
this
.
processing
=
true
const
currentTime
=
this
.
player_
.
currentTime
()
*
1000
const
currentTime
=
this
.
player_
.
currentTime
()
*
1000
//假如调整的播放时间则初始数组索引
//假如调整的播放时间则初始数组索引
...
@@ -54,15 +48,23 @@ class DogTrack extends Component {
...
@@ -54,15 +48,23 @@ class DogTrack extends Component {
}
}
for
(
let
i
=
this
.
arrayIndex
;
i
<
this
.
trackData
.
length
;
i
++
)
{
for
(
let
i
=
this
.
arrayIndex
;
i
<
this
.
trackData
.
length
;
i
++
)
{
const
d
=
this
.
trackData
[
i
]
const
d
=
this
.
trackData
[
i
]
// console.log(i, currentTime, d[0] * 40)
if
(
this
.
isExtract
)
{
if
(
firstFrameIndex
<=
currentTime
&&
currentTime
<=
d
[
0
]
*
40
)
{
const
time
=
Math
.
abs
(
d
[
0
]
*
40
-
currentTime
)
if
(
time
<
300
)
{
this
.
arrayIndex
=
i
==
0
?
1
:
i
this
.
trackDogs
(
d
[
1
])
console
.
log
(
'
extract
'
,
time
,
d
[
0
],
currentTime
)
break
;
}
else
{
this
.
hideTrack
()
}
}
else
if
(
firstFrameIndex
<=
currentTime
&&
currentTime
<=
d
[
0
]
*
40
)
{
this
.
arrayIndex
=
i
this
.
arrayIndex
=
i
this
.
trackDogs
(
d
[
1
])
this
.
trackDogs
(
d
[
1
])
break
;
break
;
}
}
}
}
this
.
processing
=
false
this
.
processing
=
false
// console.log("currentTime 循环耗时", new Date().getTime() - now)
}
}
trackDogs
(
dogs
)
{
trackDogs
(
dogs
)
{
...
@@ -93,8 +95,17 @@ class DogTrack extends Component {
...
@@ -93,8 +95,17 @@ class DogTrack extends Component {
}
}
}
}
hideTrack
()
{
for
(
const
id
of
this
.
dogDiv
.
keys
())
{
const
arrEl
=
this
.
dogDiv
.
get
(
id
)
arrEl
[
0
].
classList
.
add
(
"
display-none
"
)
arrEl
[
1
].
classList
.
add
(
"
display-none
"
)
}
}
initData
(
dogIds
:
any
,
data
:
any
,
currentDog
:
DogData
)
{
initData
(
dogIds
:
any
,
data
:
any
,
currentDog
:
DogData
)
{
if
(
!
data
||
data
.
length
===
0
)
return
;
if
(
!
data
||
data
.
length
===
0
)
return
;
this
.
isExtract
=
currentDog
.
labelFileName
.
indexOf
(
'
extract
'
)
>
-
1
//先清理之前狗跟踪的div
//先清理之前狗跟踪的div
this
.
clearOldDogDiv
()
this
.
clearOldDogDiv
()
this
.
dispose
()
this
.
dispose
()
...
@@ -124,7 +135,6 @@ class DogTrack extends Component {
...
@@ -124,7 +135,6 @@ class DogTrack extends Component {
createDogDiv
(
dogIds
:
any
,
currentDogId
:
string
)
{
createDogDiv
(
dogIds
:
any
,
currentDogId
:
string
)
{
if
(
!
dogIds
||
dogIds
.
size
===
0
)
return
;
if
(
!
dogIds
||
dogIds
.
size
===
0
)
return
;
console
.
log
(
'
dogId
'
,
currentDogId
,
dogIds
)
//@ts-ignore
//@ts-ignore
const
myContainer
=
this
.
player_
.
el_
;
const
myContainer
=
this
.
player_
.
el_
;
// console.log("key currentDogId", dogIds, currentDogId, myContainer)
// console.log("key currentDogId", dogIds, currentDogId, myContainer)
...
...
src/service/CameraService.ts
View file @
445eb574
...
@@ -4,6 +4,7 @@ import api from '@/configs/apiConfig'
...
@@ -4,6 +4,7 @@ import api from '@/configs/apiConfig'
import
{
TrackData
}
from
"
@/components/MyVideo/data
"
;
import
{
TrackData
}
from
"
@/components/MyVideo/data
"
;
import
{
getItem
,
setItem
}
from
'
@/utils/indexdbHelper
'
import
{
getItem
,
setItem
}
from
'
@/utils/indexdbHelper
'
import
{
Message
}
from
'
element-ui
'
import
{
Message
}
from
'
element-ui
'
import
{
extractFile
}
from
'
@/utils/common
'
export
function
getCamera
(
pageData
:
any
):
Promise
<
responseData
>
{
export
function
getCamera
(
pageData
:
any
):
Promise
<
responseData
>
{
return
NetUtil
.
fetch_request
(
'
camera/paging
'
,
'
POST
'
,
pageData
)
return
NetUtil
.
fetch_request
(
'
camera/paging
'
,
'
POST
'
,
pageData
)
...
...
src/utils/common.ts
0 → 100644
View file @
445eb574
export
function
extractFile
(
fileName
:
string
)
{
if
(
!
fileName
)
return
fileName
if
(
fileName
.
indexOf
(
'
.
'
)
<
0
)
return
fileName
const
ar
=
fileName
.
split
(
'
.
'
)
if
(
ar
.
length
!=
2
)
return
fileName
return
`
${
ar
[
0
]}
_extract.
${
ar
[
1
]}
`
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment