Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
6f5359f6
Commit
6f5359f6
authored
Oct 11, 2022
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加危险范围的数据
parent
3e4baadd
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
605 additions
and
26 deletions
+605
-26
Danger2.vue
danger-manage-web/src/components/bigWindow/Danger2.vue
+119
-0
cesiumClass.js
danger-manage-web/src/utils/cesium/cesiumClass.js
+26
-11
dangerArr.js
danger-manage-web/src/utils/cesium/dangerArr.js
+416
-0
index.vue
danger-manage-web/src/views/index.vue
+44
-15
No files found.
danger-manage-web/src/components/bigWindow/Danger2.vue
0 → 100644
View file @
6f5359f6
<!--
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-06-21 09:24:11
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-10-11 18:06:41
* @FilePath: /danger-manage-web/src/components/bigWindow/Danger.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"danger-wrapper"
>
<div
class=
"close"
@
click=
"close"
>
<img
src=
"@/assets/images/closeBtn.png"
alt=
""
/>
</div>
<div
class=
"text"
>
{{
deviceData
.
name
}}
</div>
</div>
</
template
>
<
script
>
export
default
{
name
:
""
,
data
()
{
return
{};
},
mounted
()
{
console
.
log
(
this
.
deviceData
);
},
methods
:
{
close
()
{
//this.handleClose();
this
.
mapClass
.
clearInfoWindow
();
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.danger-wrapper
{
background-color
:
rgba
(
9
,
18
,
32
,
0
.6
);
position
:
absolute
;
padding
:
30px
;
padding-bottom
:
0
;
box-sizing
:
border-box
;
// width: 100px;
// height: 510px;
.text
{
color
:
#fff
;
padding-bottom
:
30px
;
}
.up
{
border-bottom
:
1px
solid
#cccccc
;
margin-bottom
:
15px
;
&
.noBroder
{
border-bottom
:
0px
solid
#cccccc
;
margin-bottom
:
10px
;
}
}
.tit
{
line-height
:
14px
;
color
:
#ffffff
;
font-weight
:
600
;
position
:
relative
;
margin-left
:
12px
;
&
:before
{
content
:
""
;
position
:
absolute
;
width
:
5px
;
height
:
15px
;
left
:
-12px
;
top
:
0
;
background
:
#fff
;
}
}
.close
{
position
:
absolute
;
right
:
15px
;
top
:
10px
;
cursor
:
pointer
;
}
.one
{
width
:
100%
;
flex-wrap
:
wrap
;
.flex-item
{
width
:
50%
;
margin-bottom
:
5px
;
.left
{
color
:
#cccccc
;
}
.right
{
color
:
#fff
;
margin-left
:
5px
;
}
}
}
.item
{
margin-bottom
:
5px
;
.left
{
color
:
#cccccc
;
}
.right
{
color
:
#fff
;
margin-left
:
5px
;
}
.img
{
width
:
300px
;
height
:
120px
;
display
:
inline-block
;
vertical-align
:
top
;
margin-left
:
5px
;
img
{
width
:
100%
;
height
:
100%
;
}
}
}
}
</
style
>
danger-manage-web/src/utils/cesium/cesiumClass.js
View file @
6f5359f6
/*
/*
* @Author: your name
* @Author: your name
* @Date: 2021-12-07 14:19:18
* @Date: 2021-12-07 14:19:18
* @LastEditTime: 2022-10-1
0 17:09
:52
* @LastEditTime: 2022-10-1
1 11:46
:52
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditors: 纪泽龙 jizelong@qq.com
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /cesium-vue/src/utils/seieumClass.js
* @FilePath: /cesium-vue/src/utils/seieumClass.js
*/
*/
window
.
danger
=
{
name
:
""
,
colorNum
:
null
,
path
:
[],
data
:
{}
};
window
.
dangerArr
=
JSON
.
parse
(
localStorage
.
getItem
(
'J'
)
).
length
>
0
?
JSON
.
parse
(
localStorage
.
getItem
(
'J'
)
):
[];
window
.
repeat
=
()
=>
{
window
.
danger
=
{
name
:
""
,
path
:
[],
data
:
{}
};
};
window
.
save
=
()
=>
{
window
.
dangerArr
.
push
(
window
.
danger
);
const
json
=
JSON
.
stringify
(
window
.
dangerArr
);
localStorage
.
setItem
(
"J"
,
json
);
console
.
log
(
json
)
window
.
repeat
()
};
var
viewModel
=
{
var
viewModel
=
{
silhouetteColor
:
"Yellow"
,
silhouetteColor
:
"Yellow"
,
...
@@ -87,8 +99,8 @@ const dangerColor = {
...
@@ -87,8 +99,8 @@ const dangerColor = {
// 1:Cesium.Color.fromCssColorString("red")
// 1:Cesium.Color.fromCssColorString("red")
1
:
Cesium
.
Color
.
RED
.
withAlpha
(
0.5
),
1
:
Cesium
.
Color
.
RED
.
withAlpha
(
0.5
),
2
:
Cesium
.
Color
.
ORANGE
.
withAlpha
(
0.5
),
2
:
Cesium
.
Color
.
ORANGE
.
withAlpha
(
0.5
),
3
:
Cesium
.
Color
.
BLUE
.
withAlpha
(
0.5
),
3
:
Cesium
.
Color
.
YELLOW
.
withAlpha
(
0.5
),
4
:
Cesium
.
Color
.
YELLOW
.
withAlpha
(
0.5
),
4
:
Cesium
.
Color
.
BLUE
.
withAlpha
(
0.5
),
};
};
// const picUrlList = {
// const picUrlList = {
...
@@ -316,7 +328,7 @@ export default class CreateCesium {
...
@@ -316,7 +328,7 @@ export default class CreateCesium {
let
offset
=
Cesium
.
Cartesian3
.
fromRadians
(
let
offset
=
Cesium
.
Cartesian3
.
fromRadians
(
Cesium
.
Math
.
toRadians
(
gps
[
0
]),
Cesium
.
Math
.
toRadians
(
gps
[
0
]),
Cesium
.
Math
.
toRadians
(
gps
[
1
]),
Cesium
.
Math
.
toRadians
(
gps
[
1
]),
-
16
0
-
16
1.1
);
);
// let offset = Cesium.Cartesian3.fromRadians(
// let offset = Cesium.Cartesian3.fromRadians(
// Cesium.Math.toRadians(gaodeLnglat.lng),
// Cesium.Math.toRadians(gaodeLnglat.lng),
...
@@ -383,7 +395,7 @@ export default class CreateCesium {
...
@@ -383,7 +395,7 @@ export default class CreateCesium {
this
.
createDevice
(
movement
);
this
.
createDevice
(
movement
);
}
}
var
picked
=
this
.
scene
.
pick
(
movement
.
position
);
var
picked
=
this
.
scene
.
pick
(
movement
.
position
);
console
.
log
(
"picked"
,
picked
);
//
console.log("picked", picked);
if
(
Cesium
.
defined
(
picked
))
{
if
(
Cesium
.
defined
(
picked
))
{
if
(
picked
.
id
&&
picked
.
id
instanceof
Cesium
.
Entity
)
{
if
(
picked
.
id
&&
picked
.
id
instanceof
Cesium
.
Entity
)
{
// console.log(picked.id)
// console.log(picked.id)
...
@@ -443,9 +455,12 @@ export default class CreateCesium {
...
@@ -443,9 +455,12 @@ export default class CreateCesium {
const
pitch
=
Cesium
.
Math
.
toDegrees
(
this
.
viewer
.
camera
.
pitch
).
toFixed
(
2
);
const
pitch
=
Cesium
.
Math
.
toDegrees
(
this
.
viewer
.
camera
.
pitch
).
toFixed
(
2
);
//围绕X轴旋转
//围绕X轴旋转
const
roll
=
Cesium
.
Math
.
toDegrees
(
this
.
viewer
.
camera
.
roll
).
toFixed
(
2
);
const
roll
=
Cesium
.
Math
.
toDegrees
(
this
.
viewer
.
camera
.
roll
).
toFixed
(
2
);
console
.
log
(
height
,
heading
,
pitch
,
roll
);
//
console.log(height, heading, pitch, roll);
const
ln
=
this
.
getLnglat
(
movement
);
const
ln
=
this
.
getLnglat
(
movement
);
console
.
log
(
ln
);
// console.log(ln);
window
.
danger
.
path
.
push
(
ln
);
console
.
log
(
window
.
danger
.
path
);
},
Cesium
.
ScreenSpaceEventType
.
LEFT_CLICK
);
},
Cesium
.
ScreenSpaceEventType
.
LEFT_CLICK
);
handler
.
setInputAction
((
movement
)
=>
{
handler
.
setInputAction
((
movement
)
=>
{
// 新建
// 新建
...
@@ -454,7 +469,7 @@ export default class CreateCesium {
...
@@ -454,7 +469,7 @@ export default class CreateCesium {
handler
.
setInputAction
((
movement
)
=>
{
handler
.
setInputAction
((
movement
)
=>
{
// 如果是鼠标按下的状态,则监听地图移动
// 如果是鼠标按下的状态,则监听地图移动
if
(
this
.
mouseDownFlag
)
{
if
(
this
.
mouseDownFlag
)
{
console
.
log
(
"地图移动"
);
//
console.log("地图移动");
// this.clearInfoWindow();
// this.clearInfoWindow();
// 改变位置
// 改变位置
// this.changePosition();
// this.changePosition();
...
@@ -479,7 +494,7 @@ export default class CreateCesium {
...
@@ -479,7 +494,7 @@ export default class CreateCesium {
// this.clearInfoWindow();
// this.clearInfoWindow();
var
picked
=
this
.
scene
.
pick
(
movement
.
position
);
var
picked
=
this
.
scene
.
pick
(
movement
.
position
);
console
.
log
(
movement
.
position
);
//
console.log(movement.position);
if
(
Cesium
.
defined
(
picked
))
{
if
(
Cesium
.
defined
(
picked
))
{
if
(
picked
.
id
&&
picked
.
id
instanceof
Cesium
.
Entity
)
{
if
(
picked
.
id
&&
picked
.
id
instanceof
Cesium
.
Entity
)
{
// console.log(picked.id)
// console.log(picked.id)
...
@@ -532,7 +547,7 @@ export default class CreateCesium {
...
@@ -532,7 +547,7 @@ export default class CreateCesium {
// 鼠标抬起
// 鼠标抬起
this
.
mouseDownFlag
=
false
;
this
.
mouseDownFlag
=
false
;
console
.
log
(
"up"
);
//
console.log("up");
// this.viewer.scene.screenSpaceCameraController.enableRotate = true;
// this.viewer.scene.screenSpaceCameraController.enableRotate = true;
// handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
// handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
...
@@ -565,7 +580,7 @@ export default class CreateCesium {
...
@@ -565,7 +580,7 @@ export default class CreateCesium {
// 打印中心点坐标、高度
// 打印中心点坐标、高度
// 当鼠地图移动的时候与相机事件隔离
// 当鼠地图移动的时候与相机事件隔离
if
(
!
this
.
mouseDownFlag
)
{
if
(
!
this
.
mouseDownFlag
)
{
console
.
log
(
"相机发生变化"
);
//
console.log("相机发生变化");
// this.clearInfoWindow();
// this.clearInfoWindow();
}
}
});
});
...
...
danger-manage-web/src/utils/cesium/dangerArr.js
0 → 100644
View file @
6f5359f6
This diff is collapsed.
Click to expand it.
danger-manage-web/src/views/index.vue
View file @
6f5359f6
...
@@ -2,14 +2,15 @@
...
@@ -2,14 +2,15 @@
* @Author: 纪泽龙 jizelong@qq.com
* @Author: 纪泽龙 jizelong@qq.com
* @Date: 2022-09-03 10:51:24
* @Date: 2022-09-03 10:51:24
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditors: 纪泽龙 jizelong@qq.com
* @LastEditTime: 2022-10-1
0 17:10:12
* @LastEditTime: 2022-10-1
1 17:40:35
* @FilePath: /danger-manage-web/src/views/index.vue
* @FilePath: /danger-manage-web/src/views/index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
<
template
>
<
template
>
<div
class=
"index-wrapper"
>
<div
class=
"index-wrapper"
>
<Top
/>
<Top
/>
<Left
v-if=
"charsShow"
<Left
v-if=
"charsShow"
ref=
"left"
ref=
"left"
@
clickShow=
"clickShow"
@
clickShow=
"clickShow"
@
dangerDeviceChange=
"dangerDeviceChange"
@
dangerDeviceChange=
"dangerDeviceChange"
...
@@ -31,6 +32,7 @@ import Video from "@/components/bigWindow/video";
...
@@ -31,6 +32,7 @@ import Video from "@/components/bigWindow/video";
import
tcq
from
"@/components/bigWindow/tcq"
;
import
tcq
from
"@/components/bigWindow/tcq"
;
import
Null
from
"@/components/bigWindow/Null"
;
import
Null
from
"@/components/bigWindow/Null"
;
import
Danger
from
"@/components/bigWindow/Danger"
;
import
Danger
from
"@/components/bigWindow/Danger"
;
import
Danger2
from
"@/components/bigWindow/Danger2"
;
import
weixiandian
from
"@/components/bigWindow/weixiandian"
;
import
weixiandian
from
"@/components/bigWindow/weixiandian"
;
import
ydqt
from
"@/components/bigWindow/ydqt"
;
import
ydqt
from
"@/components/bigWindow/ydqt"
;
import
danger
from
"@/assets/images/danger.png"
;
import
danger
from
"@/assets/images/danger.png"
;
...
@@ -41,13 +43,15 @@ import Right from "@/views/indexComponents/Right";
...
@@ -41,13 +43,15 @@ import Right from "@/views/indexComponents/Right";
import
Bottom
from
"@/views/indexComponents/Bottom"
;
import
Bottom
from
"@/views/indexComponents/Bottom"
;
import
{
deviceInfoLists
}
from
"@/api/map/deviceInfo"
;
import
{
deviceInfoLists
}
from
"@/api/map/deviceInfo"
;
import
{
dangerArr
}
from
"@/utils/cesium/dangerArr.js"
;
export
default
{
export
default
{
name
:
"shouye"
,
name
:
"shouye"
,
props
:{
props
:
{
charsShow
:
{
charsShow
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
true
,
default
:
true
,
}
},
},
},
components
:
{
components
:
{
Top
,
Top
,
...
@@ -382,10 +386,35 @@ export default {
...
@@ -382,10 +386,35 @@ export default {
this
.
Cesium
.
addDevice
(
item
,
"pic"
,
ydqt
);
this
.
Cesium
.
addDevice
(
item
,
"pic"
,
ydqt
);
}
}
});
});
this
.
danger
.
forEach
((
item
)
=>
{
// 如果有缓存
this
.
Cesium
.
addDanger
(
item
,
Danger
);
// const J = localStorage.getItem("J");
// if (J) {
// const data = JSON.parse(J);
// data
// .map((item) => {
// return {
// lnglatArr: item.path,
// ...item,
// };
// })
// .forEach((item) => {
// this.Cesium.addDanger(item, Null);
// });
// } else {
// this.danger.forEach((item) => {
// this.Cesium.addDanger(item, Danger);
// });
// }
dangerArr
.
map
((
item
)
=>
{
return
{
lnglatArr
:
item
.
path
,
...
item
,
};
})
.
forEach
((
item
)
=>
{
this
.
Cesium
.
addDanger
(
item
,
Danger2
);
});
});
this
.
data11
.
forEach
((
item
)
=>
{
this
.
data11
.
forEach
((
item
)
=>
{
item
.
config
=
{
scale
:
1
,
textHeight
:
-
32
};
item
.
config
=
{
scale
:
1
,
textHeight
:
-
32
};
this
.
Cesium
.
addDevice
(
item
,
"pic"
,
Video
);
this
.
Cesium
.
addDevice
(
item
,
"pic"
,
Video
);
...
@@ -409,15 +438,15 @@ export default {
...
@@ -409,15 +438,15 @@ export default {
obj
=
{
obj
=
{
latitude
:
item
.
latitude
,
latitude
:
item
.
latitude
,
longitude
:
item
.
longitude
,
longitude
:
item
.
longitude
,
deviceId
:
item
.
mapDeviceId
,
deviceId
:
item
.
mapDeviceId
,
shortNum
:
10
,
shortNum
:
10
,
deviceType
:
item
.
mapDeviceType
,
deviceType
:
item
.
mapDeviceType
,
title
:
item
.
mapDeviceName
,
title
:
item
.
mapDeviceName
,
config
:
{
scale
:
1
,
textHeight
:
-
32
},
config
:
{
scale
:
1
,
textHeight
:
-
32
},
};
};
}
else
{
}
else
{
obj
=
{
obj
=
{
deviceId
:
item
.
mapDeviceId
,
deviceId
:
item
.
mapDeviceId
,
latitude
:
item
.
latitude
,
latitude
:
item
.
latitude
,
longitude
:
item
.
longitude
,
longitude
:
item
.
longitude
,
deviceType
:
item
.
mapDeviceType
,
deviceType
:
item
.
mapDeviceType
,
...
@@ -430,7 +459,7 @@ export default {
...
@@ -430,7 +459,7 @@ export default {
sbzt
:
item
.
monitorDeviceStatus
,
sbzt
:
item
.
monitorDeviceStatus
,
jcz
:
item
.
monitorValue
+
""
+
item
.
mapDeviceUnit
,
jcz
:
item
.
monitorValue
+
""
+
item
.
mapDeviceUnit
,
shortNum
:
12
,
shortNum
:
12
,
config
:
{
scale
:
1
,
textHeight
:
-
94
},
config
:
{
scale
:
1
,
textHeight
:
-
94
},
};
};
}
}
return
obj
;
return
obj
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment