Commit 8603f28b authored by 朱松文's avatar 朱松文

查询狗优化

parent de754ce8
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
.najiu-dog-track { .najiu-dog-track {
position: absolute; position: absolute;
border: 2px solid #d7d7d7; border: 2px solid #0079fe;
} }
.najiu-dog-track-current { .najiu-dog-track-current {
position: absolute; position: absolute;
border: 2px solid blue; border: 2px solid #f95e5a;
z-index: 100; z-index: 100;
} }
\ No newline at end of file
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<div class="col-left">是否牵狗绳</div> <div class="col-left">是否牵狗绳</div>
</td> </td>
<td> <td>
<div>{{ `${dog.withRopeRatio*100}%` }}</div> <div>{{ dog.withRopeRatio>0.1 ? "" : "" }}</div>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -104,7 +104,7 @@ export default class DogInfo extends BaseVue { ...@@ -104,7 +104,7 @@ export default class DogInfo extends BaseVue {
} }
.active { .active {
background-color: #333333; background-color: #333333;
border: 1px solid blue; border: 1px solid #f95e5a;
} }
a { a {
cursor: pointer; cursor: pointer;
......
...@@ -41,8 +41,8 @@ class DogTrack extends Component { ...@@ -41,8 +41,8 @@ class DogTrack extends Component {
update() { update() {
if (this.processing || this.trackData.length === 0) return if (this.processing || this.trackData.length === 0) return
const now = new Date().getTime() // const now = new Date().getTime()
console.log("call", this.arrayIndex) // console.log("call", this.arrayIndex)
this.processing = true this.processing = true
const currentTime = this.player_.currentTime() * 1000 const currentTime = this.player_.currentTime() * 1000
//假如调整的播放时间则初始数组索引 //假如调整的播放时间则初始数组索引
...@@ -59,7 +59,7 @@ class DogTrack extends Component { ...@@ -59,7 +59,7 @@ 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) // console.log(i, currentTime, d[0] * 40)
if (firstFrameIndex <= currentTime && currentTime <= d[0] * 40) { if (firstFrameIndex <= currentTime && currentTime <= d[0] * 40) {
this.arrayIndex = i this.arrayIndex = i
this.trackDogs(d[1]) this.trackDogs(d[1])
...@@ -67,7 +67,7 @@ class DogTrack extends Component { ...@@ -67,7 +67,7 @@ class DogTrack extends Component {
} }
} }
this.processing = false this.processing = false
console.log("currentTime 循环耗时", new Date().getTime() - now) // console.log("currentTime 循环耗时", new Date().getTime() - now)
} }
trackDogs(dogs) { trackDogs(dogs) {
...@@ -81,7 +81,7 @@ class DogTrack extends Component { ...@@ -81,7 +81,7 @@ class DogTrack extends Component {
//跟踪框位置 //跟踪框位置
myel.style.top = `${value.y1 * this.defaultHeight}px` myel.style.top = `${value.y1 * this.defaultHeight}px`
myel.style.left = `${value.x1 * this.defaultWidth}px` myel.style.left = `${value.x1 * this.defaultWidth}px`
console.log(`top:${myel.style.top},left:${myel.style.left},screen-width:${this.defaultWidth},screen-height:${this.defaultHeight},dogs:${JSON.stringify(value)}`) // console.log(`top:${myel.style.top},left:${myel.style.left},screen-width:${this.defaultWidth},screen-height:${this.defaultHeight},dogs:${JSON.stringify(value)}`)
} else { } else {
myel.style.width = `${(value.x2 - value.x1) * this.fullWidth}px` myel.style.width = `${(value.x2 - value.x1) * this.fullWidth}px`
myel.style.height = `${(value.y2 - value.y1) * (this.fullHeight + 30)}px` myel.style.height = `${(value.y2 - value.y1) * (this.fullHeight + 30)}px`
...@@ -130,7 +130,9 @@ class DogTrack extends Component { ...@@ -130,7 +130,9 @@ class DogTrack extends Component {
const el = document.createElement("div") const el = document.createElement("div")
el.id = `dog_${key}` el.id = `dog_${key}`
el.classList.add("display-none") el.classList.add("display-none")
if (key === currentDogId) { // console.log("dogId", `当前狗id:${currentDogId},遍历狗id:${key}`)
if (key == currentDogId) {
// console.log("currentDogId", currentDogId)
el.classList.add("najiu-dog-track-current") el.classList.add("najiu-dog-track-current")
} else { } else {
el.classList.add("najiu-dog-track") el.classList.add("najiu-dog-track")
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
background background
small small
layout="total,prev, pager, next" layout="total,prev, pager, next"
:current-page.sync="queryCameryParam.current" :current-page.sync="queryDogParam.current"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:total="dogTotal" :total="dogTotal"
></el-pagination> ></el-pagination>
...@@ -117,7 +117,7 @@ export default class Dashboard extends BaseVue { ...@@ -117,7 +117,7 @@ export default class Dashboard extends BaseVue {
async handlePlay(dog: DogData): Promise<void> { async handlePlay(dog: DogData): Promise<void> {
if (!dog) return; if (!dog) return;
// console.log("dogInfo", dog); console.log("dogInfo", dog);
this.currentDogId = dog.id; this.currentDogId = dog.id;
this.videoUrl = dog.fileName; //dog.videoUrl; this.videoUrl = dog.fileName; //dog.videoUrl;
const this_ = this; const this_ = this;
...@@ -154,8 +154,15 @@ export default class Dashboard extends BaseVue { ...@@ -154,8 +154,15 @@ export default class Dashboard extends BaseVue {
handleClickCamera({ cameraId }) { handleClickCamera({ cameraId }) {
this.currentCameraId = cameraId; this.currentCameraId = cameraId;
this.queryDogParam.cameraId = cameraId; this.queryDogParam.cameraId = cameraId;
this.queryDogParam.current = 1;
this.queryDogInfo(); this.queryDogInfo();
} }
//深度监听对象属性变换
@Watch("queryDogParam", { deep: true })
pageChange(newValue) {
console.log("pageChange", newValue);
}
async queryCamera() { async queryCamera() {
//查询摄像头数据 //查询摄像头数据
const data = await getCameraDogFormate({ ...this.queryCameryParam }); const data = await getCameraDogFormate({ ...this.queryCameryParam });
...@@ -191,7 +198,7 @@ export default class Dashboard extends BaseVue { ...@@ -191,7 +198,7 @@ export default class Dashboard extends BaseVue {
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.#{$prefixCls}-dashboard { .#{$prefixCls}-dashboard {
display: flex; display: flex;
max-width: 1905px; max-width: 1905px;
...@@ -254,5 +261,10 @@ export default class Dashboard extends BaseVue { ...@@ -254,5 +261,10 @@ export default class Dashboard extends BaseVue {
.el-pagination__total { .el-pagination__total {
color: #d7d7d7 !important; color: #d7d7d7 !important;
} }
::v-deep {
.el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: #0079fe;
}
}
} }
</style> </style>
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