first commit
This commit is contained in:
parent
bf61fd7815
commit
ed062c2c4c
|
@ -7,8 +7,8 @@ const onMessage = (e: any) => {
|
||||||
if (data.type === "accpt") {
|
if (data.type === "accpt") {
|
||||||
let body = JSON.parse(data.content.body);
|
let body = JSON.parse(data.content.body);
|
||||||
MapUtl.addMaker({
|
MapUtl.addMaker({
|
||||||
lng: 103.55,
|
lng: 103.872802,
|
||||||
lat: 30.342,
|
lat: 30.523876,
|
||||||
title: body?.user_name,
|
title: body?.user_name,
|
||||||
users: body,
|
users: body,
|
||||||
});
|
});
|
||||||
|
|
|
@ -22,8 +22,8 @@ export default function MapContainer() {
|
||||||
|
|
||||||
amap = new Amap.Map("container", {
|
amap = new Amap.Map("container", {
|
||||||
viewMode: "2D", // 是否为3D地图模式
|
viewMode: "2D", // 是否为3D地图模式
|
||||||
zoom: 11, // 初始化地图级别
|
zoom: 15, // 初始化地图级别
|
||||||
center: [103.55, 30.34], // 初始化地图中心点位置
|
center: [103.872802, 30.523876], // 初始化地图中心点位置
|
||||||
mapStyle: "amap://styles/darkblue",
|
mapStyle: "amap://styles/darkblue",
|
||||||
resizeEnable: true,
|
resizeEnable: true,
|
||||||
});
|
});
|
||||||
|
@ -44,7 +44,6 @@ export default function MapContainer() {
|
||||||
// addMaket(Amap,amap);
|
// addMaket(Amap,amap);
|
||||||
MapUtl.loadMap = Amap;
|
MapUtl.loadMap = Amap;
|
||||||
MapUtl.amap = amap;
|
MapUtl.amap = amap;
|
||||||
|
|
||||||
[
|
[
|
||||||
{ title: "红桥微型消防站", po: [103.889435, 30.528084] },
|
{ title: "红桥微型消防站", po: [103.889435, 30.528084] },
|
||||||
{ title: "桃荚微型消防站", po: [103.89066, 30.506378] },
|
{ title: "桃荚微型消防站", po: [103.89066, 30.506378] },
|
||||||
|
|
|
@ -37,6 +37,7 @@ export default function MapFrom(props:any) {
|
||||||
// 开启坐标选择功能
|
// 开启坐标选择功能
|
||||||
mouseTool.on("draw", function (event) {
|
mouseTool.on("draw", function (event) {
|
||||||
var lnglat = event.obj.getBounds().getCenter(); // 获取图形的中心点坐标
|
var lnglat = event.obj.getBounds().getCenter(); // 获取图形的中心点坐标
|
||||||
|
console.log(lnglat)
|
||||||
markers = mouseTool.overlays.marker
|
markers = mouseTool.overlays.marker
|
||||||
props.onChange({lng:lnglat.lng,lat:lnglat.lat})
|
props.onChange({lng:lnglat.lng,lat:lnglat.lat})
|
||||||
var mk = []
|
var mk = []
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import makers from "../../static/map-maker.png";
|
import makers from "../../static/map-maker.png";
|
||||||
import makers1 from "../../static/map-maker (1).png";
|
import makers1 from "../../static/map-maker1.png";
|
||||||
import makers2 from "../../static/map-maker (2).png";
|
import makers2 from "../../static/map-maker2.png";
|
||||||
interface makersInf {
|
interface makersInf {
|
||||||
userIdentity: string,
|
userIdentity: string,
|
||||||
marker: any
|
marker: any
|
||||||
|
@ -13,16 +13,16 @@ class MapUtl {
|
||||||
|
|
||||||
static addMaker(data: any) {
|
static addMaker(data: any) {
|
||||||
const { lng, lat, title, users } = data;
|
const { lng, lat, title, users } = data;
|
||||||
let mk,dep = "";
|
let mk, dep = "";
|
||||||
if(users?.militia_type===1){
|
if (users?.militia_type === 1) {
|
||||||
mk = makers
|
mk = makers
|
||||||
dep = "民兵"
|
dep = "民兵"
|
||||||
}
|
}
|
||||||
if(users?.grid_user===1){
|
if (users?.grid_user === 1) {
|
||||||
mk = makers1
|
mk = makers1
|
||||||
dep = "网格员"
|
dep = "网格员"
|
||||||
}
|
}
|
||||||
if(users?.patrol_user===1){
|
if (users?.patrol_user === 1) {
|
||||||
mk = makers2
|
mk = makers2
|
||||||
dep = "巡防大队"
|
dep = "巡防大队"
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ class MapUtl {
|
||||||
imageSize: [20, 20],
|
imageSize: [20, 20],
|
||||||
image: mk,
|
image: mk,
|
||||||
style: {
|
style: {
|
||||||
backgroundImage:"red"
|
backgroundImage: "red"
|
||||||
}// 默认的样式名
|
}// 默认的样式名
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
@ -132,19 +132,7 @@ class MapUtl {
|
||||||
static getWecher() {
|
static getWecher() {
|
||||||
|
|
||||||
}
|
}
|
||||||
// 百度转高德
|
|
||||||
static bdConvertGd(coordinate) {
|
|
||||||
var bd_lng = coordinate[0];
|
|
||||||
var bd_lat = coordinate[1];
|
|
||||||
var pi = 3.14159265358979324 * 3000.0 / 180.0;
|
|
||||||
var x = bd_lng - 0.0065;
|
|
||||||
var y = bd_lat - 0.006;
|
|
||||||
var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi);
|
|
||||||
var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi);
|
|
||||||
var gd_lng = z * Math.cos(theta);
|
|
||||||
var gd_lat = z * Math.sin(theta);
|
|
||||||
return [gd_lng, gd_lat];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MapUtl;
|
export default MapUtl;
|
|
@ -127,13 +127,12 @@
|
||||||
bottom: 0px;
|
bottom: 0px;
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
background: rgba(37, 52, 70, 0.4);
|
background: rgba(37, 52, 70, 0.4);
|
||||||
height: 80px;
|
height: 60px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
.bottom_content {
|
.bottom_content {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-top: 15px;
|
|
||||||
> span {
|
> span {
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
180deg,
|
180deg,
|
||||||
|
|
|
@ -3,7 +3,57 @@ import WhichVideo from "./which_video";
|
||||||
import Ec from "./ec";
|
import Ec from "./ec";
|
||||||
import Emr from "./emr";
|
import Emr from "./emr";
|
||||||
import "./bot.less";
|
import "./bot.less";
|
||||||
const HomeBottom = () => {
|
import { Radio } from "antd";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
|
import { Store } from "antd/es/form/interface";
|
||||||
|
import MapUtl from "@/components/map/mapUtil";
|
||||||
|
|
||||||
|
const HomeBottom = (props: Store) => {
|
||||||
|
const { homeStore } = props;
|
||||||
|
const [size, changeSize] = useState("1");
|
||||||
|
const handleSizeChange = (e: any) => {
|
||||||
|
changeSize(e.target.value);
|
||||||
|
getUlist(e.target.value);
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
getUlist("1");
|
||||||
|
}, 2000);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const getUlist = (type) => {
|
||||||
|
let query = {};
|
||||||
|
switch (type) {
|
||||||
|
case "1":
|
||||||
|
query = { militia: 1 };
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
query = { grid_officer: 1 };
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
query = { patrol_brigade: 1 };
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
let marks = MapUtl.makerList;
|
||||||
|
if (marks.length) {
|
||||||
|
marks.forEach((item) => {
|
||||||
|
item?.marker.remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
homeStore.getContact(query).then((res) => {
|
||||||
|
let list = res.data.record;
|
||||||
|
list.forEach((element) => {
|
||||||
|
if (!element.lat || !element.long) return;
|
||||||
|
MapUtl.addMaker({
|
||||||
|
lng: element.long,
|
||||||
|
lat: element.lat,
|
||||||
|
title: element.user_name,
|
||||||
|
users: element,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div className="bottom_container">
|
<div className="bottom_container">
|
||||||
<div className="bottom_content">
|
<div className="bottom_content">
|
||||||
|
@ -11,9 +61,16 @@ const HomeBottom = () => {
|
||||||
<Emr />
|
<Emr />
|
||||||
<Ec />
|
<Ec />
|
||||||
<WhichVideo />
|
<WhichVideo />
|
||||||
|
{/* 切换marker查看 */}
|
||||||
|
<Radio.Group value={size} onChange={handleSizeChange}>
|
||||||
|
<Radio.Button value="1">民兵</Radio.Button>
|
||||||
|
<Radio.Button value="2">网格员</Radio.Button>
|
||||||
|
<Radio.Button value="3">巡防</Radio.Button>
|
||||||
|
</Radio.Group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default HomeBottom;
|
// export default HomeBottom;
|
||||||
|
export default inject("homeStore")(observer(HomeBottom));
|
||||||
|
|
|
@ -33,7 +33,7 @@ const WhichVideo = (props) => {
|
||||||
<Modal
|
<Modal
|
||||||
title={"视频查看"}
|
title={"视频查看"}
|
||||||
className="owner_model"
|
className="owner_model"
|
||||||
width={1000}
|
width={"80%"}
|
||||||
centered
|
centered
|
||||||
open={isModalOpen}
|
open={isModalOpen}
|
||||||
afterClose={() => {
|
afterClose={() => {
|
||||||
|
@ -48,9 +48,9 @@ const WhichVideo = (props) => {
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ height: "700px", overflowY: "scroll", width: "1000px" }}>
|
<div style={{ height: "700px", width: "100%" }}>
|
||||||
<div style={{ display: "flex" }}>
|
<div style={{ display: "flex" }}>
|
||||||
<div>
|
<div style={{overflowY: "scroll",height: "700px"}}>
|
||||||
{deviceList.map((item, index) => {
|
{deviceList.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
@ -73,7 +73,7 @@ const WhichVideo = (props) => {
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ width: "20px" }}></div>
|
<div style={{ width: "20px" }}></div>
|
||||||
<div>
|
<div style={{height:"700px",overflow:"scroll"}}>
|
||||||
{channelList.map((item, index) => {
|
{channelList.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -6,31 +6,14 @@ import { Modal } from "antd";
|
||||||
import { Store } from "antd/es/form/interface";
|
import { Store } from "antd/es/form/interface";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import MapUtl from "@/components/map/mapUtil";
|
|
||||||
const Orgin = (props: Store) => {
|
const Orgin = (props: Store) => {
|
||||||
const { homeStore } = props;
|
const { homeStore } = props;
|
||||||
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
||||||
const [isSelf, setIsSelf] = useState<boolean>(false);
|
const [isSelf, setIsSelf] = useState<boolean>(false);
|
||||||
const getRaud = (m: number,n:number) => {
|
|
||||||
var num = Math.floor(Math.random()*(m - n) + n);
|
|
||||||
return num
|
|
||||||
};
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
homeStore.getOgCount();
|
homeStore.getOgCount();
|
||||||
homeStore.getVideoUrlList();
|
homeStore.getVideoUrlList();
|
||||||
homeStore.getContact().then((res)=>{
|
|
||||||
let list = res.data.record;
|
|
||||||
list.forEach(element => {
|
|
||||||
let lng = "103.8"+getRaud(2000,12000)
|
|
||||||
let lat = "30.5"+getRaud(1000,12000)
|
|
||||||
MapUtl.addMaker({
|
|
||||||
lng:lng,
|
|
||||||
lat:lat,
|
|
||||||
title:element.user_name,
|
|
||||||
users:element
|
|
||||||
})
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}, [homeStore]);
|
}, [homeStore]);
|
||||||
const showModal = () => {
|
const showModal = () => {
|
||||||
setIsModalOpen(true);
|
setIsModalOpen(true);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.org {
|
.org {
|
||||||
flex:1;
|
flex: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -21,21 +21,24 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pyzx{
|
.pyzx {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
min-height: 200px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
overflow-y: auto;
|
margin-bottom: 10px;
|
||||||
.pyzx_title{
|
overflow-y: scroll;
|
||||||
|
flex: 1;
|
||||||
|
.pyzx_title {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 5px 4px;
|
padding: 5px 4px;
|
||||||
|
margin-bottom: 10px;
|
||||||
align-items: start;
|
align-items: start;
|
||||||
background: rgba(37, 52, 70, 0.4);
|
background: rgba(37, 52, 70, 0.4);
|
||||||
|
.content {
|
||||||
.content{
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
>img{
|
> img {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
@ -57,8 +57,8 @@ class HomeStore extends BaseStore<TagDataType> {
|
||||||
return await baseHttp.get(HomeConfig.ae, {});
|
return await baseHttp.get(HomeConfig.ae, {});
|
||||||
}
|
}
|
||||||
// 获取联系人
|
// 获取联系人
|
||||||
async getContact() {
|
async getContact(params) {
|
||||||
return await baseHttp.get(HomeConfig.con, {});
|
return await baseHttp.get(HomeConfig.con, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取视频推流连接
|
// 获取视频推流连接
|
||||||
|
|
Loading…
Reference in New Issue