Commit b250341a authored by 朱松文's avatar 朱松文

合并跟踪模式和抽针模式判断逻辑

parent 445eb574
......@@ -40,28 +40,22 @@ class DogTrack extends Component {
}
//上次播放时间
this.preCurrentTime = currentTime
const firstFrameIndex = this.trackData[0][0] * 40
const firstFrameIndexTime = this.trackData[0][0] * 40
//当前时间小于第一帧时间则直接跳过循环
if (currentTime < firstFrameIndex) {
if (currentTime < firstFrameIndexTime) {
this.processing = false
return
}
for (let i = this.arrayIndex; i < this.trackData.length; i++) {
const d = this.trackData[i]
if (this.isExtract) {
const time = Math.abs(d[0] * 40 - currentTime)
if (time < 300) {
const diffTime = Math.abs(d[0] * 40 - currentTime)
if (this.isExtract && diffTime < 300 || !this.isExtract && diffTime < 100 && currentTime <= d[0] * 40) {
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.trackDogs(d[1])
break;
else {
this.hideTrack()
}
}
this.processing = false
......@@ -98,10 +92,14 @@ class DogTrack extends Component {
hideTrack() {
for (const id of this.dogDiv.keys()) {
const arrEl = this.dogDiv.get(id)
if (!arrEl[0].classList.contains('display-none')) {
arrEl[0].classList.add("display-none")
}
if (!arrEl[1].classList.contains('display-none')) {
arrEl[1].classList.add("display-none")
}
}
}
initData(dogIds: any, data: any, currentDog: DogData) {
if (!data || data.length === 0) return;
......
......@@ -4,7 +4,6 @@ import api from '@/configs/apiConfig'
import { TrackData } from "@/components/MyVideo/data";
import { getItem, setItem } from '@/utils/indexdbHelper'
import { Message } from 'element-ui'
import { extractFile } from '@/utils/common'
export function getCamera(pageData: any): Promise<responseData> {
return NetUtil.fetch_request('camera/paging', 'POST', pageData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment