Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
fanxing_new
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2fe5bf34
authored
Mar 06, 2020
by
潘建波
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改冲突提交
1 parent
4aaf34ab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
90 deletions
src/views/sceneManage/setting/areaconfig/TraficCanvas.vue
src/views/sceneManage/setting/areaconfig/TraficCanvas.vue
View file @
2fe5bf3
...
@@ -341,12 +341,12 @@ export default {
...
@@ -341,12 +341,12 @@ export default {
typeFlag
:
1
,
//选择属性弹窗状态
typeFlag
:
1
,
//选择属性弹窗状态
lineNum
:
1
,
//车道线/车道序号
lineNum
:
1
,
//车道线/车道序号
curLayerstate
:
false
,
//行人检测区域属性设置
curLayerstate
:
false
,
//行人检测区域属性设置
testLayerstate
:
false
,
//测试检测区域属性设置
testLayerstate
:
false
,
//测试检测区域属性设置
polygon_id
:
""
,
//行人检测区域id
polygon_id
:
""
,
//行人检测区域id
polygon_name
:
""
,
//行人检测区域name
polygon_name
:
""
,
//行人检测区域name
markLineType
:
"0"
,
markLineType
:
"0"
,
lanuse
:
'0'
,
//车道属性类型
lanuse
:
"0"
,
//车道属性类型
guidingtype
:
''
,
//车道导向类型
guidingtype
:
""
,
//车道导向类型
markLineDirect
:
""
,
markLineDirect
:
""
,
childUrl
:
""
,
//红绿灯区域截图
childUrl
:
""
,
//红绿灯区域截图
scale
:
{},
//红绿灯区域截图放大倍数
scale
:
{},
//红绿灯区域截图放大倍数
...
@@ -354,11 +354,11 @@ export default {
...
@@ -354,11 +354,11 @@ export default {
type
:
"1"
,
type
:
"1"
,
distribute
:
"1"
,
distribute
:
"1"
,
shap
:
"1"
,
shap
:
"1"
,
delay
:
3
delay
:
3
},
},
roiBody
:
{},
roiBody
:
{},
XMLStr
:
""
,
XMLStr
:
""
,
eventData
:
[]
eventData
:
[]
};
};
},
},
props
:
[
"bgUrl"
],
props
:
[
"bgUrl"
],
...
@@ -401,21 +401,25 @@ export default {
...
@@ -401,21 +401,25 @@ export default {
id
:
"noStopLayer"
,
id
:
"noStopLayer"
,
name
:
"layer"
name
:
"layer"
});
});
this
.
bicyLayer
=
new
Kinetic
.
Layer
({
//行人检测区域
this
.
bicyLayer
=
new
Kinetic
.
Layer
({
//行人检测区域
id
:
"bicyLayer"
,
id
:
"bicyLayer"
,
name
:
"layer"
name
:
"layer"
});
});
this
.
densityLayer
=
new
Kinetic
.
Layer
({
//密度
this
.
densityLayer
=
new
Kinetic
.
Layer
({
id
:
'densityLayer'
,
//密度
name
:
"layer"
id
:
"densityLayer"
,
name
:
"layer"
});
});
this
.
foreignLayer
=
new
Kinetic
.
Layer
({
//异物
this
.
foreignLayer
=
new
Kinetic
.
Layer
({
id
:
'foreignLayer'
,
//异物
name
:
"layer"
id
:
"foreignLayer"
,
name
:
"layer"
});
});
this
.
testRegionLayer
=
new
Kinetic
.
Layer
({
//测试检测区域
this
.
testRegionLayer
=
new
Kinetic
.
Layer
({
id
:
'testRegionLayer'
,
//测试检测区域
name
:
"layer"
id
:
"testRegionLayer"
,
name
:
"layer"
});
});
let
shadow
=
new
Kinetic
.
Rect
({
let
shadow
=
new
Kinetic
.
Rect
({
...
@@ -455,7 +459,7 @@ export default {
...
@@ -455,7 +459,7 @@ export default {
this
.
stage
.
add
(
this
.
noStopLayer
);
this
.
stage
.
add
(
this
.
noStopLayer
);
this
.
stage
.
add
(
this
.
densityLayer
);
this
.
stage
.
add
(
this
.
densityLayer
);
this
.
stage
.
add
(
this
.
foreignLayer
);
this
.
stage
.
add
(
this
.
foreignLayer
);
this
.
stage
.
add
(
this
.
testRegionLayer
)
this
.
stage
.
add
(
this
.
testRegionLayer
);
this
.
layers
=
[
this
.
layers
=
[
this
.
testLayer
,
this
.
testLayer
,
this
.
lineLayer
,
this
.
lineLayer
,
...
@@ -602,19 +606,19 @@ export default {
...
@@ -602,19 +606,19 @@ export default {
line
.
index
=
ele
.
lane_no
;
line
.
index
=
ele
.
lane_no
;
let
lane_guid_type
=
0
;
let
lane_guid_type
=
0
;
let
lane_use
=
0
;
let
lane_use
=
0
;
if
(
obj
.
lanes
.
lane_count
==
1
)
{
if
(
obj
.
lanes
.
lane_count
==
1
)
{
lane_guid_type
=
obj
.
lanes
.
lane
.
lane_guiding_type
lane_guid_type
=
obj
.
lanes
.
lane
.
lane_guiding_type
;
lane_use
=
obj
.
lanes
.
lane
.
lane_use_type
lane_use
=
obj
.
lanes
.
lane
.
lane_use_type
;
}
else
{
}
else
{
lane_guid_type
=
obj
.
lanes
.
lane
[
index
].
lane_guiding_type
;
lane_guid_type
=
obj
.
lanes
.
lane
[
index
].
lane_guiding_type
;
lane_use
=
obj
.
lanes
.
lane
[
index
].
lane_use_type
lane_use
=
obj
.
lanes
.
lane
[
index
].
lane_use_type
;
}
}
this
.
roads
[
parseInt
(
ele
.
lane_seq
-
1
)]
=
{
this
.
roads
[
parseInt
(
ele
.
lane_seq
-
1
)]
=
{
type
:
ele
.
lane_type
,
type
:
ele
.
lane_type
,
index
:
ele
.
lane_no
,
index
:
ele
.
lane_no
,
direct
:
direct
,
direct
:
direct
,
lane_guiding_type
:
lane_guid
_type
,
lane_guiding_type
:
obj
.
lanes
.
lane
[
index
].
lane_guiding
_type
,
lane_use_type
:
lane_us
e
lane_use_type
:
obj
.
lanes
.
lane
[
index
].
lane_use_typ
e
};
};
}
}
});
});
...
@@ -636,6 +640,7 @@ export default {
...
@@ -636,6 +640,7 @@ export default {
let
bottom
=
points
.
bottom
*
500
;
let
bottom
=
points
.
bottom
*
500
;
let
pointsAry
=
[
left
,
top
,
left
,
bottom
,
right
,
bottom
,
right
,
top
];
let
pointsAry
=
[
left
,
top
,
left
,
bottom
,
right
,
bottom
,
right
,
top
];
let
rect
=
this
.
drawRect
(
"morePoints"
,
pointsAry
,
this
.
color
[
3
]);
let
rect
=
this
.
drawRect
(
"morePoints"
,
pointsAry
,
this
.
color
[
3
]);
let
linghtRoi
=
{
let
linghtRoi
=
{
light_region_seq
:
1
,
light_region_seq
:
1
,
top
:
(
top
/
500
).
toFixed
(
6
),
top
:
(
top
/
500
).
toFixed
(
6
),
...
@@ -647,7 +652,8 @@ export default {
...
@@ -647,7 +652,8 @@ export default {
(
rect
.
light_type
=
ele
.
light_type
),
(
rect
.
light_type
=
ele
.
light_type
),
(
rect
.
light_distribute
=
ele
.
light_distribute
),
(
rect
.
light_distribute
=
ele
.
light_distribute
),
(
rect
.
light_shape
=
ele
.
light_shape
),
(
rect
.
light_shape
=
ele
.
light_shape
),
(
rect
.
light_delay
=
ele
.
light_yellow_delay
||
ele
.
light_yellow_interval
),
(
rect
.
light_delay
=
ele
.
light_yellow_delay
||
ele
.
light_yellow_interval
),
(
rect
.
light_regions
=
{
(
rect
.
light_regions
=
{
light_region_count
:
1
,
light_region_count
:
1
,
light_region
:
linghtRoi
light_region
:
linghtRoi
...
@@ -986,7 +992,7 @@ export default {
...
@@ -986,7 +992,7 @@ export default {
this
.
markLineType
=
this
.
roads
[
shape
.
roadIndex
].
type
;
this
.
markLineType
=
this
.
roads
[
shape
.
roadIndex
].
type
;
this
.
markLineDirect
=
this
.
roads
[
shape
.
roadIndex
].
direct
;
this
.
markLineDirect
=
this
.
roads
[
shape
.
roadIndex
].
direct
;
this
.
guidingtype
=
this
.
roads
[
shape
.
roadIndex
].
lane_guiding_type
;
this
.
guidingtype
=
this
.
roads
[
shape
.
roadIndex
].
lane_guiding_type
;
this
.
lanuse
=
this
.
roads
[
shape
.
roadIndex
].
lane_use_type
||
'0'
;
this
.
lanuse
=
this
.
roads
[
shape
.
roadIndex
].
lane_use_type
||
"0"
;
shape
.
setFill
(
"rgba("
+
this
.
color
[
1
]
+
",0.3)"
);
shape
.
setFill
(
"rgba("
+
this
.
color
[
1
]
+
",0.3)"
);
let
gLine
=
this
.
greenLines
[
shape
.
roadIndex
];
let
gLine
=
this
.
greenLines
[
shape
.
roadIndex
];
if
(
gLine
.
getParent
().
attrs
.
name
==
"arr"
)
{
if
(
gLine
.
getParent
().
attrs
.
name
==
"arr"
)
{
...
@@ -1030,13 +1036,12 @@ export default {
...
@@ -1030,13 +1036,12 @@ export default {
type
:
shape
.
light_type
,
type
:
shape
.
light_type
,
shap
:
shape
.
light_shape
,
shap
:
shape
.
light_shape
,
distribute
:
shape
.
light_distribute
,
distribute
:
shape
.
light_distribute
,
delay
:
shape
.
light_delay
delay
:
shape
.
light_delay
};
};
}
else
if
(
}
else
if
(
this
.
drawState
==
6
||
this
.
drawState
==
6
||
this
.
drawState
==
7
||
this
.
drawState
==
7
||
this
.
drawState
==
8
||
this
.
drawState
==
8
this
.
drawState
==
9
)
{
)
{
this
.
polygon_name
=
shape
.
polygon_name
;
this
.
polygon_name
=
shape
.
polygon_name
;
this
.
polygon_id
=
shape
.
polygon_id
;
this
.
polygon_id
=
shape
.
polygon_id
;
...
@@ -1115,7 +1120,7 @@ export default {
...
@@ -1115,7 +1120,7 @@ export default {
type
:
"1"
,
type
:
"1"
,
distribute
:
"1"
,
distribute
:
"1"
,
shap
:
"1"
,
shap
:
"1"
,
delay
:
3
delay
:
3
};
};
this
.
layers
[
this
.
drawState
].
draw
();
this
.
layers
[
this
.
drawState
].
draw
();
},
},
...
@@ -1246,12 +1251,10 @@ export default {
...
@@ -1246,12 +1251,10 @@ export default {
},
0
);
},
0
);
layer
.
draw
();
layer
.
draw
();
}
}
if
(
this
.
drawState
==
6
||
if
(
this
.
drawState
==
6
||
this
.
drawState
==
7
||
this
.
drawState
==
8
)
{
this
.
drawState
==
7
||
this
.
drawState
==
8
)
{
this
.
curLayerstate
=
true
;
this
.
curLayerstate
=
true
;
}
}
if
(
this
.
drawState
==
9
)
{
if
(
this
.
drawState
==
9
)
{
this
.
testLayerstate
=
true
;
this
.
testLayerstate
=
true
;
}
}
},
},
...
@@ -1316,7 +1319,6 @@ export default {
...
@@ -1316,7 +1319,6 @@ export default {
//清空输入框
//清空输入框
this
.
polygon_id
=
""
;
this
.
polygon_id
=
""
;
this
.
polygon_name
=
""
;
this
.
polygon_name
=
""
;
},
},
curlayCancel
()
{
curlayCancel
()
{
let
curLayers
=
this
.
layers
[
this
.
drawState
].
get
(
".rect"
);
let
curLayers
=
this
.
layers
[
this
.
drawState
].
get
(
".rect"
);
...
@@ -1442,6 +1444,7 @@ export default {
...
@@ -1442,6 +1444,7 @@ export default {
this
.
roadFlag
=
false
;
this
.
roadFlag
=
false
;
break
;
break
;
case
2
:
case
2
:
// eslint-disable-next-line no-case-declarations
let
rindex
=
this
.
roads
.
indexOf
(
this
.
selectedShape
);
let
rindex
=
this
.
roads
.
indexOf
(
this
.
selectedShape
);
console
.
log
(
rindex
);
console
.
log
(
rindex
);
this
.
roads
[
rindex
]
=
""
;
this
.
roads
[
rindex
]
=
""
;
...
@@ -1449,6 +1452,7 @@ export default {
...
@@ -1449,6 +1452,7 @@ export default {
case
6
:
case
6
:
this
.
polygon_name
=
""
;
this
.
polygon_name
=
""
;
this
.
polygon_id
=
""
;
this
.
polygon_id
=
""
;
// eslint-disable-next-line no-fallthrough
default
:
default
:
break
;
break
;
}
}
...
@@ -1575,7 +1579,7 @@ export default {
...
@@ -1575,7 +1579,7 @@ export default {
type
:
"1"
,
type
:
"1"
,
distribute
:
"1"
,
distribute
:
"1"
,
shap
:
"1"
,
shap
:
"1"
,
delay
:
3
delay
:
3
};
};
this
.
selectedShape
=
null
;
this
.
selectedShape
=
null
;
},
},
...
@@ -1597,9 +1601,9 @@ export default {
...
@@ -1597,9 +1601,9 @@ export default {
color
=
typeof
color
!=
"color"
?
color
:
"#000"
;
color
=
typeof
color
!=
"color"
?
color
:
"#000"
;
// 计算各角度和对应的P2,P3坐标
// 计算各角度和对应的P2,P3坐标
var
angle
=
Math
.
atan2
(
c1
[
1
]
-
c2
[
1
],
c1
[
0
]
-
c2
[
0
])
*
180
/
Math
.
PI
,
var
angle
=
(
Math
.
atan2
(
c1
[
1
]
-
c2
[
1
],
c1
[
0
]
-
c2
[
0
])
*
180
)
/
Math
.
PI
,
angle1
=
(
angle
+
theta
)
*
Math
.
PI
/
180
,
angle1
=
((
angle
+
theta
)
*
Math
.
PI
)
/
180
,
angle2
=
(
angle
-
theta
)
*
Math
.
PI
/
180
,
angle2
=
((
angle
-
theta
)
*
Math
.
PI
)
/
180
,
topX
=
headlen
*
Math
.
cos
(
angle1
),
topX
=
headlen
*
Math
.
cos
(
angle1
),
topY
=
headlen
*
Math
.
sin
(
angle1
),
topY
=
headlen
*
Math
.
sin
(
angle1
),
botX
=
headlen
*
Math
.
cos
(
angle2
),
botX
=
headlen
*
Math
.
cos
(
angle2
),
...
@@ -1609,7 +1613,7 @@ export default {
...
@@ -1609,7 +1613,7 @@ export default {
arrowY
=
c1
[
1
]
-
topY
;
arrowY
=
c1
[
1
]
-
topY
;
// let line = this.drawLine({x:c1[0],y:c1[1]},{x:c2[0],y:c2[1]},color)
// let line = this.drawLine({x:c1[0],y:c1[1]},{x:c2[0],y:c2[1]},color)
line
.
attrs
.
name
=
"`centerLine`
"
;
line
.
attrs
.
name
=
"centerLine
"
;
arrowX
=
c2
[
0
]
+
topX
;
arrowX
=
c2
[
0
]
+
topX
;
arrowY
=
c2
[
1
]
+
topY
;
arrowY
=
c2
[
1
]
+
topY
;
...
@@ -1656,38 +1660,41 @@ export default {
...
@@ -1656,38 +1660,41 @@ export default {
// 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
[
2
];
ele
.
attrs
.
points
[
1
]
=
copypoint
[
3
]
ele
.
attrs
.
points
[
1
]
=
copypoint
[
3
];
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)
}
}
});
})
//车道线根据坐标排序
//车道线根据坐标排序
function
sortBlueLine
(
arr
){
// eslint-disable-next-line no-inner-declarations
function
sortBlueLine
(
arr
)
{
var
len
=
arr
.
length
;
var
len
=
arr
.
length
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
j
=
0
;
j
<
len
-
1
-
i
;
j
++
)
{
for
(
var
j
=
0
;
j
<
len
-
1
-
i
;
j
++
)
{
if
(
arr
[
j
].
attrs
.
points
[
0
]
>
arr
[
j
+
1
].
attrs
.
points
[
0
])
{
//相邻元素两两对比
if
(
arr
[
j
].
attrs
.
points
[
0
]
>
arr
[
j
+
1
].
attrs
.
points
[
0
])
{
var
temp
=
arr
[
j
+
1
];
//元素交换
//相邻元素两两对比
arr
[
j
+
1
]
=
arr
[
j
];
var
temp
=
arr
[
j
+
1
];
//元素交换
arr
[
j
+
1
]
=
arr
[
j
];
arr
[
j
]
=
temp
;
arr
[
j
]
=
temp
;
}
}
}
}
}
}
return
arr
;
return
arr
;
}
}
console
.
log
(
'排序后的蓝色车道线'
)
console
.
log
(
"排序后的蓝色车道线"
);
console
.
log
(
sortBlueLine
(
this
.
blueLines
))
console
.
log
(
sortBlueLine
(
this
.
blueLines
));
this
.
blueLines
.
forEach
((
ele
,
index
)
=>
{
this
.
blueLines
.
forEach
((
ele
,
index
)
=>
{
let
points
=
this
.
sortLinePoints
(
ele
.
attrs
.
points
);
let
points
=
this
.
sortLinePoints
(
ele
.
attrs
.
points
);
if
(
index
>
0
)
{
if
(
index
>
0
)
{
//绘制车道
//绘制车道
let
lastPoints
=
this
.
sortLinePoints
(
this
.
blueLines
[
index
-
1
].
attrs
.
points
);
let
lastPoints
=
this
.
sortLinePoints
(
this
.
blueLines
[
index
-
1
].
attrs
.
points
);
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
)
+
...
@@ -1731,8 +1738,7 @@ export default {
...
@@ -1731,8 +1738,7 @@ export default {
(
mPoints
[
0
]
+
mPoints
[
6
])
/
2
,
(
mPoints
[
0
]
+
mPoints
[
6
])
/
2
,
(
mPoints
[
1
]
+
mPoints
[
7
])
/
2
,
(
mPoints
[
1
]
+
mPoints
[
7
])
/
2
,
(
mPoints
[
2
]
+
mPoints
[
4
])
/
2
,
(
mPoints
[
2
]
+
mPoints
[
4
])
/
2
,
(
mPoints
[
3
]
+
mPoints
[
5
])
/
2
,
(
mPoints
[
3
]
+
mPoints
[
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
]);
...
@@ -1789,7 +1795,6 @@ export default {
...
@@ -1789,7 +1795,6 @@ export default {
childCancle
:
function
()
{
childCancle
:
function
()
{
this
.
$refs
.
lightCanvas
.
cancle
();
this
.
$refs
.
lightCanvas
.
cancle
();
},
},
//生成xml
save
:
function
()
{
save
:
function
()
{
this
.
cancleSelectedGroup
();
this
.
cancleSelectedGroup
();
//车牌检测区域
//车牌检测区域
...
@@ -2051,7 +2056,7 @@ export default {
...
@@ -2051,7 +2056,7 @@ export default {
this
.
roiBody
.
lanes
=
{
this
.
roiBody
.
lanes
=
{
lane_count
:
lanaAry
.
length
?
lanaAry
.
length
:
0
,
lane_count
:
lanaAry
.
length
?
lanaAry
.
length
:
0
,
lane
:
lanaAry
?
lanaAry
:
[]
lane
:
lanaAry
?
lanaAry
:
[]
}
};
//对向车道
//对向车道
try
{
try
{
this
.
subtendLayer
.
get
(
".rect"
).
forEach
((
el
,
index
)
=>
{
this
.
subtendLayer
.
get
(
".rect"
).
forEach
((
el
,
index
)
=>
{
...
@@ -2094,14 +2099,14 @@ export default {
...
@@ -2094,14 +2099,14 @@ export default {
lightAry
.
push
({
lightAry
.
push
({
light_seq
:
index
+
1
,
light_seq
:
index
+
1
,
light_type
:
ele
.
light_type
,
light_type
:
ele
.
light_type
,
light_id
:
ele
.
light_type
,
light_id
:
ele
.
light_type
,
light_distribute
:
ele
.
light_distribute
,
light_distribute
:
ele
.
light_distribute
,
light_number_type
:
ele
.
light_distribute
,
light_number_type
:
ele
.
light_distribute
,
light_yellow_delay
:
Number
(
ele
.
light_delay
),
light_yellow_delay
:
Number
(
ele
.
light_delay
),
light_yellow_interval
:
Number
(
ele
.
light_delay
),
light_yellow_interval
:
Number
(
ele
.
light_delay
),
light_shape
:
ele
.
light_shape
,
light_shape
:
ele
.
light_shape
,
light_shape_type
:
ele
.
light_shape
,
light_shape_type
:
ele
.
light_shape
,
light_regions
:
ele
.
light_regions
,
light_regions
:
ele
.
light_regions
});
});
});
});
}
catch
(
error
)
{}
}
catch
(
error
)
{}
...
@@ -2245,8 +2250,8 @@ export default {
...
@@ -2245,8 +2250,8 @@ export default {
});
});
}
}
testRegion
.
push
({
testRegion
.
push
({
polygon_id
:
el
.
polygon_id
,
polygon_id
:
el
.
polygon_id
,
polygon_name
:
el
.
polygon_name
,
polygon_name
:
el
.
polygon_name
,
polygon_point_count
:
foAry
.
length
,
polygon_point_count
:
foAry
.
length
,
point
:
foAry
point
:
foAry
});
});
...
@@ -2270,48 +2275,48 @@ export default {
...
@@ -2270,48 +2275,48 @@ export default {
(
this
.
needRect
=
false
),
(
this
.
needRect
=
false
),
(
this
.
needLine
=
false
),
(
this
.
needLine
=
false
),
(
this
.
canvasState
=
0
),
(
this
.
canvasState
=
0
),
(
this
.
polygon_name
=
''
),
(
this
.
polygon_name
=
""
),
(
this
.
polygon_id
=
''
),
(
this
.
polygon_id
=
""
),
(
this
.
polyline
=
0
);
(
this
.
polyline
=
0
);
$
(
".modal-lt button"
).
removeClass
(
"active"
);
$
(
".modal-lt button"
).
removeClass
(
"active"
);
},
},
sortLinePoints
(
pointarr
)
{
sortLinePoints
(
pointarr
)
{
try
{
try
{
let
newpoint
=
[];
let
newpoint
=
[];
if
((
pointarr
[
1
]
-
pointarr
[
3
])
>
0
)
{
if
(
pointarr
[
1
]
-
pointarr
[
3
]
>
0
)
{
newpoint
[
0
]
=
pointarr
[
2
]
newpoint
[
0
]
=
pointarr
[
2
];
newpoint
[
1
]
=
pointarr
[
3
]
newpoint
[
1
]
=
pointarr
[
3
];
newpoint
[
2
]
=
pointarr
[
0
]
newpoint
[
2
]
=
pointarr
[
0
];
newpoint
[
3
]
=
pointarr
[
1
]
newpoint
[
3
]
=
pointarr
[
1
];
}
else
{
}
else
{
newpoint
=
pointarr
newpoint
=
pointarr
;
}
}
return
newpoint
return
newpoint
;
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
log
(
err
)
console
.
log
(
err
);
}
}
},
},
changetestid
()
{
changetestid
()
{
this
.
eventData
.
forEach
(
ele
=>
{
this
.
eventData
.
forEach
(
ele
=>
{
if
(
ele
.
value
==
this
.
polygon_id
)
{
if
(
ele
.
value
==
this
.
polygon_id
)
{
this
.
polygon_name
=
ele
.
name
this
.
polygon_name
=
ele
.
name
;
}
}
})
});
}
}
},
},
mounted
()
{
mounted
()
{
console
.
log
(
eventJson
)
console
.
log
(
eventJson
);
this
.
eventData
=
eventJson
this
.
eventData
=
eventJson
;
// this.stageInit()
// this.stageInit()
key
(
'alt+1'
,()
=>
{
key
(
"alt+1"
,
()
=>
{
if
(
this
.
istest
)
{
if
(
this
.
istest
)
{
this
.
istest
=
false
this
.
istest
=
false
;
}
else
{
}
else
{
this
.
istest
=
true
this
.
istest
=
true
;
}
}
})
});
}
}
};
};
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment