Commit e099984c by 潘建波

🐛【BUG】修改车道线不能用折线问题

【BUG】检测区域和车道区域用曲线标识
【BUG】优化标定绘制长时间绘制会消失问题
【BUG】修改智能检索图片放大后关闭按钮标识不明显问题
1 parent dcb9d66c
No preview for this file type
{"commit":"c790af3c1814219815649c0ceaa1a520d7bfde97","commitDate":"2020-7-15 16:58","buildDate":"2020-7-15 18:13","version":"2.0.5","info":"fix🐛 修改事件导出bug"}
\ No newline at end of file \ No newline at end of file
{"commit":"dcb9d66c635c688972056ce7870ea62d69070588","commitDate":"2020-7-16 14:28","buildDate":"2020-7-16 18:33","version":"2.0.5","info":"🐛修改任务下发后再获取下发设备显示依旧是空的问题"}
\ No newline at end of file \ No newline at end of file
...@@ -27,7 +27,7 @@ function endLoading() { ...@@ -27,7 +27,7 @@ function endLoading() {
// 创建 axios 实例 // 创建 axios 实例
let service = axios.create({ let service = axios.create({
// headers: {'Content-Type': 'application/json'}, // headers: {'Content-Type': 'application/json'},
timeout: 60000 timeout: 600000
}); });
// 添加请求拦截器 // 添加请求拦截器
......
...@@ -308,4 +308,7 @@ body{ ...@@ -308,4 +308,7 @@ body{
.show-box .el-image__inner--center{ .show-box .el-image__inner--center{
transform:none; transform:none;
left: 0; left: 0;
}
.detailDialog .el-icon-circle-close{
color: #fff;
} }
\ No newline at end of file \ No newline at end of file
...@@ -939,7 +939,7 @@ ...@@ -939,7 +939,7 @@
width: 100px; width: 100px;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
background: #3a51f2; background: #3a51;
color: #fff; color: #fff;
border: 0; border: 0;
} }
......
...@@ -151,12 +151,13 @@ ...@@ -151,12 +151,13 @@
<!-- <button>撤销</button> --> <!-- <button>撤销</button> -->
<el-radio-group v-model="polyline" @change="polyChang"> <el-radio-group v-model="polyline" @change="polyChang">
<div> <div>
<el-radio <el-radio
class="radio" class="radio"
:label="0" :label="0"
:style="lineRadioStyle" :style="lineRadioStyle"
v-if="drawState == 1" v-if="drawState == 1"
>直线</el-radio> >直线</el-radio
>
</div> </div>
<el-radio <el-radio
class="radio" class="radio"
...@@ -183,29 +184,13 @@ ...@@ -183,29 +184,13 @@
<span v-if="typeFlag != 3">类型:</span> <span v-if="typeFlag != 3">类型:</span>
<div> <div>
<el-select v-if="typeFlag == 1" v-model="markLineType"> <el-select v-if="typeFlag == 1" v-model="markLineType">
<el-option <el-option value="0" label="普通车道线"></el-option>
value="0" <el-option value="7" label="白实线"></el-option>
label="普通车道线" <el-option value="1" label="黄实线"></el-option>
v-if="!polyline" <el-option value="2" label="停止线"></el-option>
></el-option> <el-option value="3" label="左转判定线"></el-option>
<el-option value="7" label="白实线" v-if="!polyline"></el-option> <el-option value="4" label="右转判定线"></el-option>
<el-option value="1" label="黄实线" v-if="!polyline"></el-option> <el-option value="5" label="直行判定线"></el-option>
<el-option value="2" label="停止线" v-if="!polyline"></el-option>
<el-option
value="3"
label="左转判定线"
v-if="!polyline"
></el-option>
<el-option
value="4"
label="右转判定线"
v-if="!polyline"
></el-option>
<el-option
value="5"
label="直行判定线"
v-if="!polyline"
></el-option>
<el-option value="9" label="左转弯弧度判定线"></el-option> <el-option value="9" label="左转弯弧度判定线"></el-option>
</el-select> </el-select>
<el-select v-if="typeFlag == 0" v-model="markLineType"> <el-select v-if="typeFlag == 0" v-model="markLineType">
...@@ -987,7 +972,6 @@ export default { ...@@ -987,7 +972,6 @@ export default {
}, },
//改变选中图形样式 //改变选中图形样式
makeSelectedGroup: function(shape) { makeSelectedGroup: function(shape) {
debugger
console.log(shape); console.log(shape);
let points = shape.attrs.points; let points = shape.attrs.points;
let lineType = shape.line_type; let lineType = shape.line_type;
...@@ -1410,8 +1394,10 @@ export default { ...@@ -1410,8 +1394,10 @@ export default {
points: points, points: points,
// tension: 0.5, // tension: 0.5,
closed: true, closed: true,
dashEnabled: true,
dash: ["8"],
stroke: "rgb(" + color + ")", stroke: "rgb(" + color + ")",
strokeWidth: 4, strokeWidth: 2,
name: "rect", name: "rect",
fill: isFill ? "rgba(" + color + ",0.3)" : "transparent" fill: isFill ? "rgba(" + color + ",0.3)" : "transparent"
}); });
...@@ -1579,7 +1565,7 @@ export default { ...@@ -1579,7 +1565,7 @@ export default {
}); });
this.childCirAry = []; this.childCirAry = [];
} }
this.markLineType = "0"; // this.markLineType = "0";
this.lightInfo = { this.lightInfo = {
type: "1", type: "1",
distribute: "1", distribute: "1",
...@@ -1646,6 +1632,7 @@ export default { ...@@ -1646,6 +1632,7 @@ export default {
}, },
//生成车道 //生成车道
drawRoad: function() { drawRoad: function() {
debugger;
if (this.roadFlag === true) return; if (this.roadFlag === true) return;
if (this.roadFlag === false) { if (this.roadFlag === false) {
this.$alert("车道线有修改,请逐一检查车道属性是否正确", "提示", { this.$alert("车道线有修改,请逐一检查车道属性是否正确", "提示", {
...@@ -1662,19 +1649,19 @@ export default { ...@@ -1662,19 +1649,19 @@ export default {
this.roadLayer.draw(); this.roadLayer.draw();
try { try {
// console.log('蓝色车道线') console.log("蓝色车道线");
// console.log(this.blueLines) console.log(this.blueLines);
this.blueLines.forEach((ele, index) => { // this.blueLines.forEach((ele, index) => {
if (ele.attrs.points[1] - ele.attrs.points[3] > 0) { // if (ele.attrs.points[1] - ele.attrs.points[3] > 0) {
var copypoint = Array.from(ele.attrs.points); // var copypoint = Array.from(ele.attrs.points);
ele.attrs.points[0] = copypoint[2]; // ele.attrs.points[0] = copypoint[copypoint.length - 2];
ele.attrs.points[1] = copypoint[3]; // ele.attrs.points[1] = copypoint[copypoint.length - 1];
ele.attrs.points[2] = copypoint[0]; // ele.attrs.points[2] = copypoint[0];
ele.attrs.points[3] = copypoint[1]; // ele.attrs.points[3] = copypoint[1];
// console.log('*******蓝色车道线*******') // console.log('*******蓝色车道线*******')
// console.log(ele) // console.log(ele)
} // }
}); // });
//车道线根据坐标排序 //车道线根据坐标排序
// eslint-disable-next-line no-inner-declarations // eslint-disable-next-line no-inner-declarations
function sortBlueLine(arr) { function sortBlueLine(arr) {
...@@ -1703,18 +1690,24 @@ export default { ...@@ -1703,18 +1690,24 @@ export default {
let num1 = let num1 =
Math.pow(points[0] - lastPoints[0], 2) + Math.pow(points[0] - lastPoints[0], 2) +
Math.pow(points[1] - lastPoints[1], 2) + Math.pow(points[1] - lastPoints[1], 2) +
Math.pow(points[2] - lastPoints[2], 2) + Math.pow(
Math.pow(points[3] - lastPoints[3], 2); points[points.length - 2] - lastPoints[lastPoints.length - 2],
2
) +
Math.pow(
points[points.length - 1] - lastPoints[lastPoints.length - 1],
2
);
let num2 = let num2 =
Math.pow(points[0] - lastPoints[2], 2) + Math.pow(points[0] - lastPoints[lastPoints.length - 2], 2) +
Math.pow(points[1] - lastPoints[3], 2) + Math.pow(points[1] - lastPoints[lastPoints.length - 1], 2) +
Math.pow(points[2] - lastPoints[0], 2) + Math.pow(points[points.length - 2] - lastPoints[0], 2) +
Math.pow(points[3] - lastPoints[1], 2); Math.pow(points[points.length - 1] - lastPoints[1], 2);
let mPoints; let mPoints;
if (num1 < num2) { if (num1 < num2) {
mPoints = points.concat([ mPoints = points.concat([
lastPoints[2], lastPoints[lastPoints.length - 2],
lastPoints[3], lastPoints[lastPoints.length - 1],
lastPoints[0], lastPoints[0],
lastPoints[1] lastPoints[1]
]); ]);
...@@ -1722,8 +1715,8 @@ export default { ...@@ -1722,8 +1715,8 @@ export default {
mPoints = points.concat([ mPoints = points.concat([
lastPoints[0], lastPoints[0],
lastPoints[1], lastPoints[1],
lastPoints[2], lastPoints[lastPoints.length - 2],
lastPoints[3] lastPoints[lastPoints.length - 1]
]); ]);
} }
let rect = this.drawRect( let rect = this.drawRect(
...@@ -1738,12 +1731,13 @@ export default { ...@@ -1738,12 +1731,13 @@ export default {
if (!this.roads[index - 1]) { if (!this.roads[index - 1]) {
this.roads[index - 1] = {}; this.roads[index - 1] = {};
} }
var newmPoints = mPoints.filter(item => item);
let road = this.roads[index - 1]; let road = this.roads[index - 1];
let cPoints = [ let cPoints = [
(mPoints[0] + mPoints[6]) / 2, (newmPoints[0] + newmPoints[6]) / 2,
(mPoints[1] + mPoints[7]) / 2, (newmPoints[1] + newmPoints[7]) / 2,
(mPoints[2] + mPoints[4]) / 2, (newmPoints[2] + newmPoints[4]) / 2,
(mPoints[3] + mPoints[5]) / 2 (newmPoints[3] + newmPoints[5]) / 2
]; ];
road.cPoints = cPoints; road.cPoints = cPoints;
let cLine = this.drawLine("morePoints", cPoints, this.color[2]); let cLine = this.drawLine("morePoints", cPoints, this.color[2]);
...@@ -1754,7 +1748,7 @@ export default { ...@@ -1754,7 +1748,7 @@ export default {
} else if (road.direct == "1") { } else if (road.direct == "1") {
this.drawArrow( this.drawArrow(
[cPoints[0], cPoints[1]], [cPoints[0], cPoints[1]],
[cPoints[2], cPoints[3]], [cPoints[cPoints.length - 2], cPoints[cPoints.length - 1]],
30, 30,
20, 20,
3, 3,
...@@ -1765,7 +1759,7 @@ export default { ...@@ -1765,7 +1759,7 @@ export default {
); );
} else if (road.direct == "0") { } else if (road.direct == "0") {
this.drawArrow( this.drawArrow(
[cPoints[2], cPoints[3]], [cPoints[cPoints.length - 2], cPoints[cPoints.length - 1]],
[cPoints[0], cPoints[1]], [cPoints[0], cPoints[1]],
30, 30,
20, 20,
...@@ -1834,24 +1828,35 @@ export default { ...@@ -1834,24 +1828,35 @@ export default {
try { try {
this.blueLines.forEach((ele, index) => { this.blueLines.forEach((ele, index) => {
let points = ele.attrs.points; let points = ele.attrs.points;
let pointarr = [];
for (let i = 0; i < points.length / 2; i++) {
let obj = {
point_seq: i + 1,
x: (points[2 * i] / 800).toFixed(6),
y: (points[2 * i + 1] / 500).toFixed(6)
};
pointarr.push(obj);
}
console.log("pointarr", pointarr);
lineAry.push({ lineAry.push({
line_seq: index + 1, line_seq: index + 1,
lane_no: 1, lane_no: 1,
line_type: ele.line_type, line_type: ele.line_type,
points: { points: {
point_count: 2, point_count: pointarr.length,
point: [ point: pointarr
{ // [
point_seq: 1, // {
x: (points[0] / 800).toFixed(6), // point_seq: 1,
y: (points[1] / 500).toFixed(6) // x: (points[0] / 800).toFixed(6),
}, // y: (points[1] / 500).toFixed(6)
{ // },
point_seq: 2, // {
x: (points[2] / 800).toFixed(6), // point_seq: 2,
y: (points[3] / 500).toFixed(6) // x: (points[2] / 800).toFixed(6),
} // y: (points[3] / 500).toFixed(6)
] // }
// ]
} }
}); });
}); });
...@@ -2055,7 +2060,7 @@ export default { ...@@ -2055,7 +2060,7 @@ export default {
} catch (error) { } catch (error) {
console.log(error); console.log(error);
} }
//对向车道 //对向车道
try { try {
this.subtendLayer.get(".rect").forEach((el, index) => { this.subtendLayer.get(".rect").forEach((el, index) => {
...@@ -2302,11 +2307,11 @@ export default { ...@@ -2302,11 +2307,11 @@ export default {
sortLinePoints(pointarr) { sortLinePoints(pointarr) {
try { try {
let newpoint = []; let newpoint = [];
if (pointarr[1] - pointarr[3] > 0) { if (pointarr[1] - pointarr[pointarr.length - 1] > 0) {
newpoint[0] = pointarr[2]; newpoint[0] = pointarr[pointarr.length - 2];
newpoint[1] = pointarr[3]; newpoint[1] = pointarr[pointarr.length - 1];
newpoint[2] = pointarr[0]; newpoint[pointarr.length - 2] = pointarr[0];
newpoint[3] = pointarr[1]; newpoint[pointarr.length - 1] = pointarr[1];
} else { } else {
newpoint = pointarr; newpoint = pointarr;
} }
...@@ -2450,7 +2455,7 @@ el-select { ...@@ -2450,7 +2455,7 @@ el-select {
width: 100px; width: 100px;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
background: #3a51f2f7; background: #3a51f2;
color: #fff; color: #fff;
border: 0; border: 0;
} }
......
<?xml version="1.0" encoding="UTF-8" ?><roi><flow_roi><flow_type></flow_type><flow_region><polygon_point_count>0</polygon_point_count></flow_region></flow_roi><plate_detect_region><detect_polygon><polygon_point_count>0</polygon_point_count></detect_polygon></plate_detect_region><lane_line><line_count>2</line_count><line><line_seq>1</line_seq><lane_no>1</lane_no><line_type>0</line_type><points><point_count>0</point_count><point><point_seq>1</point_seq><x>0.301250</x><y>0.858000</y></point><point><point_seq>2</point_seq><x>0.242500</x><y>0.574000</y></point></points></line><line><line_seq>2</line_seq><lane_no>1</lane_no><line_type>0</line_type><points><point_count>0</point_count><point><point_seq>1</point_seq><x>0.545000</x><y>0.830000</y></point><point><point_seq>2</point_seq><x>0.533750</x><y>0.682000</y></point></points></line></lane_line><lanes><lane_count>1</lane_count><lane><lane_seq>1</lane_seq><lane_no>11</lane_no><line><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.461875</x><y>0.263000</y></point><point><point_seq>2</point_seq><x>0.423125</x><y>0.844000</y></point></line><direction_polygon><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.461875</x><y>0.263000</y></point><point><point_seq>2</point_seq><x>0.423125</x><y>0.844000</y></point></direction_polygon><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>NaN</x><y>NaN</y></point><point><point_seq>2</point_seq><x>0.362500</x><y>0.114000</y></point><point><point_seq>3</point_seq><x>0.561250</x><y>0.412000</y></point><point><point_seq>4</point_seq><x>NaN</x><y>NaN</y></point></lane_polygon><lane_type>2</lane_type><lane_use_type>0</lane_use_type><lane_guiding_type>0</lane_guiding_type><lane_user_id>11</lane_user_id><lane_middle_line><polygon_point_count>2</polygon_point_count><point1><x>0.461875</x><y>0.263000</y></point1><point2><x>0.423125</x><y>0.844000</y></point2></lane_middle_line><lane_directions><lane_direction_count>1</lane_direction_count><lane_direction><lane_direction_type>1</lane_direction_type><lane_direction_time>00:00:00-23:59:59</lane_direction_time></lane_direction></lane_directions></lane></lanes><lights><light_count>0</light_count></lights><no_stop_region><region_count>0</region_count></no_stop_region><pedestrian_detection_region><region_count>0</region_count></pedestrian_detection_region><median_lines><lane_count>1</lane_count><lane><lane_seq>1</lane_seq><lane_no>11</lane_no><line><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.461875</x><y>0.263000</y></point><point><point_seq>2</point_seq><x>0.423125</x><y>0.844000</y></point></line><direction_polygon><polygon_point_count>2</polygon_point_count><point><point_seq>1</point_seq><x>0.461875</x><y>0.263000</y></point><point><point_seq>2</point_seq><x>0.423125</x><y>0.844000</y></point></direction_polygon><lane_polygon><polygon_point_count>4</polygon_point_count><point><point_seq>1</point_seq><x>NaN</x><y>NaN</y></point><point><point_seq>2</point_seq><x>0.362500</x><y>0.114000</y></point><point><point_seq>3</point_seq><x>0.561250</x><y>0.412000</y></point><point><point_seq>4</point_seq><x>NaN</x><y>NaN</y></point></lane_polygon><lane_type>2</lane_type></lane></median_lines><pedestrian_density_region><region_count>0</region_count></pedestrian_density_region><foreign_detection_region><region_count>0</region_count></foreign_detection_region><test_result_region><region_count>0</region_count></test_result_region></roi>
...@@ -2427,7 +2427,7 @@ el-select { ...@@ -2427,7 +2427,7 @@ el-select {
width: 100px; width: 100px;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
background: #3a51f2f7; background: #3a51f2;
color: #fff; color: #fff;
border: 0; border: 0;
} }
......
...@@ -563,6 +563,7 @@ export default { ...@@ -563,6 +563,7 @@ export default {
} }
}); });
this.signLayer.add(customShape); this.signLayer.add(customShape);
this.signLayer.clearCache();//清除画布缓存
this.signLayer.draw(); this.signLayer.draw();
this.canvasState = 0; this.canvasState = 0;
}, },
...@@ -711,6 +712,7 @@ export default { ...@@ -711,6 +712,7 @@ export default {
this.editIndex = modelnum; this.editIndex = modelnum;
if (e.attrs.modelnum == modelnum) { if (e.attrs.modelnum == modelnum) {
e.destroy(); e.destroy();
e.clearCache();//清除缓存
} }
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!