Commit 2e31fbc3 by 潘建波

fix🐛 1.修改标定设置有原来的实时绘制改为800毫秒绘制1次从而减标定消失次数

1 parent f2aebd67
No preview for this file type
No preview for this file type
......@@ -2,20 +2,40 @@
<div>
<el-tabs v-model="activeName2" @tab-click="handleClick">
<el-tab-pane label="全卡口" name="first">
<Allalarm @showDitail="showDitail" :itemData="resultData" ref="allalarm"></Allalarm>
<Allalarm
@showDitail="showDitail"
:itemData="resultData"
ref="allalarm"
></Allalarm>
</el-tab-pane>
<el-tab-pane label="机动车" name="second">
<CarAlarm @showDitail="showDitail" :itemData="resultData" ref="caralarm"></CarAlarm>
<CarAlarm
@showDitail="showDitail"
:itemData="resultData"
ref="caralarm"
></CarAlarm>
</el-tab-pane>
<el-tab-pane label="违法" name="third">
<IllegalAlarm @showDitail="showDitail" :itemData="resultData" ref="illegalalarm"></IllegalAlarm>
<IllegalAlarm
@showDitail="showDitail"
:itemData="resultData"
ref="illegalalarm"
></IllegalAlarm>
</el-tab-pane>
<el-tab-pane label="事件" name="fourth">
<Eventalarm @showDitail="showDitail" :itemData="resultData" ref="eventalarm"></Eventalarm>
<Eventalarm
@showDitail="showDitail"
:itemData="resultData"
ref="eventalarm"
></Eventalarm>
</el-tab-pane>
</el-tabs>
<div>
<EventDetail ref="detail" @closeDetailModal="closeDetailModal" :curData="curdata"></EventDetail>
<EventDetail
ref="detail"
@closeDetailModal="closeDetailModal"
:curData="curdata"
></EventDetail>
</div>
</div>
</template>
......@@ -38,8 +58,8 @@ export default {
curentId: "",
cws: "",
keepAlive: "",
curType:'',
quitws:false
curType: "",
quitws: false
};
},
components: {
......@@ -103,6 +123,7 @@ export default {
this.cws.onmessage = evt => {
let data = JSON.parse(evt.data);
if (data.command) {
console.log("");
} else if (data.type == "response") {
console.log("请求任务推送成功");
} else if (data.event_cate) {
......@@ -119,7 +140,6 @@ export default {
"data:image/jpeg;base64," + data.pics[0].pic_base64;
let img = new Image();
let picOffset = data.pics[0].object_rect;
canvas.width =
data.pics[0].width * (picOffset.right - picOffset.left) ||
189;
......@@ -164,7 +184,7 @@ export default {
that.$buildCode.init(data);
setTimeout(() => {
that.resultData = data
that.resultData = data;
}, 500);
} catch (err) {
console.log(err);
......@@ -205,19 +225,19 @@ export default {
};
//监听断开
this.cws.onclose = ()=> {
if(this.quitws) return
this.cws.onclose = () => {
if (this.quitws) return;
window.clearInterval(this.keepAlive);
this.connectwebsocket(1);
};
},
beforeDestroy() {
this.cws.close();
this.quitws = true
this.quitws = true;
try {
window.clearTimeout(this.keepAlive);
} catch (error) {
console.log(error)
console.log(error);
}
}
};
......
......@@ -137,7 +137,10 @@ export default {
modelnum: 0, //标记模型编号
bgUrl: "",
taskData: "",
mtaskdata: ""
mtaskdata: "",
startTimer: null,
valid: true,
ModelData: []
};
},
// props: ['bgUrl'],
......@@ -289,7 +292,7 @@ export default {
changeModelData("car");
this.initModel();
},
initModel(){
initModel() {
//初始化一个模型
let po = [354, 313, 360, 244];
this.getModelData(po);
......@@ -502,13 +505,18 @@ export default {
//测试验证
let data = CalcCarOutline(P1, P2, [{}, {}, {}, {}, {}, {}, {}, {}]);
this.drawModel(data);
this.drawArrows(P1, P2);
if (this.startTimer == null) {
this.startTimer = setTimeout(() => {
this.startTimer = null;
this.drawModel(data);
}, 800);
}
},
//绘制模型线
drawModel(data) {
console.log(data);
if (this.editIndex != "") {
this.modelnum = this.editIndex;
}
......@@ -580,7 +588,7 @@ export default {
topY = headlen * Math.sin(angle1),
botX = headlen * Math.cos(angle2),
botY = headlen * Math.sin(angle2);
var arrowX = c1.x * 800 - topX ,
var arrowX = c1.x * 800 - topX,
arrowY = c1.y * 500 - topY;
arrowX = c2.x * 800 + topX;
arrowY = c2.y * 500 + topY;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!