first commit
This commit is contained in:
parent
ed062c2c4c
commit
15c6892955
|
@ -65,5 +65,5 @@ export default function MapContainer() {
|
||||||
amap.setFitView();
|
amap.setFitView();
|
||||||
};
|
};
|
||||||
|
|
||||||
return <div id="container" style={{ height: "100vh" }}></div>;
|
return <div id="container" style={{ height: "100vh",width:"100%" }}></div>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
import MapContainer from "@/components/map/MapComponent";
|
import MapContainer from "@/components/map/MapComponent";
|
||||||
import MapUtl from "@/components/map/mapUtil";
|
import MapUtl from "@/components/map/mapUtil";
|
||||||
import { Button, Modal } from "antd";
|
import { Button, message, Modal } from "antd";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
const Move = () => {
|
const Move = (props) => {
|
||||||
|
const { usrStore, id } = props;
|
||||||
const [isOpen, setOpen] = useState<boolean>(false);
|
const [isOpen, setOpen] = useState<boolean>(false);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -18,11 +20,13 @@ const Move = () => {
|
||||||
</Button>
|
</Button>
|
||||||
<Modal
|
<Modal
|
||||||
title={"轨迹回放"}
|
title={"轨迹回放"}
|
||||||
width={1200}
|
width={"80%"}
|
||||||
open={isOpen}
|
open={isOpen}
|
||||||
|
centered
|
||||||
okText="确定"
|
okText="确定"
|
||||||
cancelText="取消"
|
cancelText="取消"
|
||||||
footer={null}
|
footer={null}
|
||||||
|
destroyOnClose={true}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
}}
|
}}
|
||||||
|
@ -32,7 +36,21 @@ const Move = () => {
|
||||||
type="dashed"
|
type="dashed"
|
||||||
size="small"
|
size="small"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
MapUtl.polyline([[116.478935,39.997761],[116.478939,39.997825],[116.478912,39.998549],[116.478912,39.998549],[116.478998,39.998555],[116.478998,39.998555],[116.479282,39.99856],[116.479658,39.998528],[116.480151,39.998453],[116.480784,39.998302],[116.480784,39.998302],[116.481149,39.998184],[116.481573,39.997997],[116.481863,39.997846],[116.482072,39.997718],[116.482362,39.997718],[116.483633,39.998935],[116.48367,39.998968],[116.484648,39.999861]])
|
usrStore.getSite(id).then((res) => {
|
||||||
|
let data: any = [];
|
||||||
|
if (res.data && res.data.record) {
|
||||||
|
res.data.record.forEach((element) => {
|
||||||
|
data.push([element.long, element.lat]);
|
||||||
|
});
|
||||||
|
if (data.length === 0) {
|
||||||
|
message.info("暂无轨迹数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (data.length > 0) {
|
||||||
|
MapUtl.polyline(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
查看轨迹信息
|
查看轨迹信息
|
||||||
|
@ -44,4 +62,6 @@ const Move = () => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default Move;
|
|
||||||
|
// getSite
|
||||||
|
export default inject("usrStore")(observer(Move));
|
||||||
|
|
|
@ -113,7 +113,7 @@ const User = (props: Store) => {
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</Button>
|
</Button>
|
||||||
<Move />
|
<Move id={record.identity}/>
|
||||||
<Button
|
<Button
|
||||||
type="dashed"
|
type="dashed"
|
||||||
danger
|
danger
|
||||||
|
|
|
@ -16,6 +16,8 @@ class UserConfig {
|
||||||
static serch: string = "/v1/user/serch"
|
static serch: string = "/v1/user/serch"
|
||||||
static getPatrol: string = "/v1/user/getPatrol"
|
static getPatrol: string = "/v1/user/getPatrol"
|
||||||
static videoLogin: string = "api/v1/login"
|
static videoLogin: string = "api/v1/login"
|
||||||
|
static siteList: string = "/v1/user/site"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,6 +38,7 @@ class UserStore extends BaseStore<UserDataType> {
|
||||||
setPoverDe: action,
|
setPoverDe: action,
|
||||||
setUserDetaul: action,
|
setUserDetaul: action,
|
||||||
getPatrol: action,
|
getPatrol: action,
|
||||||
|
getSite: action,
|
||||||
_userinfo: observable,
|
_userinfo: observable,
|
||||||
isNeedLogin: observable,
|
isNeedLogin: observable,
|
||||||
poverDetail: observable,
|
poverDetail: observable,
|
||||||
|
@ -60,6 +63,12 @@ class UserStore extends BaseStore<UserDataType> {
|
||||||
return await baseHttp.get(UserConfig.getPatrol, {})
|
return await baseHttp.get(UserConfig.getPatrol, {})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getSite(id) {
|
||||||
|
return await baseHttp.get(UserConfig.siteList + "/" + id, {})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
get userInfo(): UserInfos {
|
get userInfo(): UserInfos {
|
||||||
if (!this._userinfo.token) {
|
if (!this._userinfo.token) {
|
||||||
let token = window.localStorage.getItem("token")
|
let token = window.localStorage.getItem("token")
|
||||||
|
|
Loading…
Reference in New Issue