first commit
This commit is contained in:
parent
cf98c949cd
commit
bf61fd7815
|
@ -1,3 +1,6 @@
|
|||
import makers from "../../static/map-maker.png";
|
||||
import makers1 from "../../static/map-maker (1).png";
|
||||
import makers2 from "../../static/map-maker (2).png";
|
||||
interface makersInf {
|
||||
userIdentity: string,
|
||||
marker: any
|
||||
|
@ -10,15 +13,37 @@ class MapUtl {
|
|||
|
||||
static addMaker(data: any) {
|
||||
const { lng, lat, title, users } = data;
|
||||
let mk,dep = "";
|
||||
if(users?.militia_type===1){
|
||||
mk = makers
|
||||
dep = "民兵"
|
||||
}
|
||||
if(users?.grid_user===1){
|
||||
mk = makers1
|
||||
dep = "网格员"
|
||||
}
|
||||
if(users?.patrol_user===1){
|
||||
mk = makers2
|
||||
dep = "巡防大队"
|
||||
}
|
||||
|
||||
// if (MapUtl.loadMap === null) return;
|
||||
const marker = new MapUtl.loadMap.Marker({
|
||||
position: new MapUtl.loadMap.LngLat(lng, lat),
|
||||
title: title,
|
||||
icon: new MapUtl.loadMap.Icon({
|
||||
imageSize: [20, 20],
|
||||
image: mk,
|
||||
style: {
|
||||
backgroundImage:"red"
|
||||
}// 默认的样式名
|
||||
}),
|
||||
});
|
||||
var content = [
|
||||
"<div><b>姓名 :" + users?.user_name + "</b>",
|
||||
"职位 : " + users.pos_held,
|
||||
"电话 : " + users.tel,
|
||||
"部门 : " + dep,
|
||||
"</div>",
|
||||
];
|
||||
var infoWindow = new MapUtl.loadMap.InfoWindow({
|
||||
|
|
|
@ -21,7 +21,7 @@ import MinusCircleOutlined from "@ant-design/icons/lib/icons/MinusCircleOutlined
|
|||
const { Option } = Select;
|
||||
|
||||
const Dispath = (props: Store) => {
|
||||
const { trainingStore, trainingCatStore } = props;
|
||||
const { trainingStore, trainingCatStore,homeStore } = props;
|
||||
const formRef = React.useRef<FormInstance>(null);
|
||||
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
||||
const [projectConfig, setProjectConfig] = useState<any>([]);
|
||||
|
@ -97,7 +97,10 @@ const Dispath = (props: Store) => {
|
|||
count: Number(values.count),
|
||||
};
|
||||
data.task_video = task_videos;
|
||||
trainingStore.add(data);
|
||||
trainingStore.add(data).then(()=>{
|
||||
homeStore.getNewTask()
|
||||
});
|
||||
|
||||
setIsModalOpen(false);
|
||||
};
|
||||
const handleSearch = (newValue: string) => {
|
||||
|
@ -253,4 +256,4 @@ const Dispath = (props: Store) => {
|
|||
</>
|
||||
);
|
||||
};
|
||||
export default inject("trainingStore", "trainingCatStore")(observer(Dispath));
|
||||
export default inject("trainingStore", "trainingCatStore","homeStore")(observer(Dispath));
|
||||
|
|
|
@ -44,9 +44,11 @@ const Emr = (props: Store) => {
|
|||
});
|
||||
}
|
||||
data.task_video = task_video;
|
||||
emergencyStore.add(data);
|
||||
emergencyStore.add(data).then(()=>{
|
||||
homeStore.getNewTask()
|
||||
});
|
||||
setIsModalOpen(false);
|
||||
homeStore.getNewTask();
|
||||
|
||||
};
|
||||
const handleSearch = (newValue: string) => {
|
||||
if (newValue === "") return;
|
||||
|
|
|
@ -6,14 +6,31 @@ import { Modal } from "antd";
|
|||
import { Store } from "antd/es/form/interface";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { useEffect, useState } from "react";
|
||||
import MapUtl from "@/components/map/mapUtil";
|
||||
const Orgin = (props: Store) => {
|
||||
const { homeStore } = props;
|
||||
const [isModalOpen, setIsModalOpen] = 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(() => {
|
||||
homeStore.getOgCount();
|
||||
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]);
|
||||
const showModal = () => {
|
||||
setIsModalOpen(true);
|
||||
|
|
|
@ -15,7 +15,6 @@ const HomeVideo = (props: Store) => {
|
|||
}, [homeStore]);
|
||||
return (
|
||||
<div>
|
||||
<span style={{ color: "#fff" }}>隐藏</span>
|
||||
{homeStore.showVideo ? (
|
||||
<div
|
||||
className="homeVideoBox"
|
||||
|
|
|
@ -39,7 +39,6 @@ const Videos = (props: Store) => {
|
|||
player?.autoplay(videoJsOptions?.autoplay);
|
||||
player.src(videoJsOptions?.sources);
|
||||
}
|
||||
console.log(videoJsOptions.sources)
|
||||
return () => {
|
||||
if (playerRef.current) {
|
||||
playerRef.current.dispose();
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
|
@ -13,6 +13,8 @@ class HomeConfig {
|
|||
static mm: string = "/v1/public/mm"
|
||||
static rm: string = "/v1/public/rm"
|
||||
static ae: string = "/v1/public/ae"
|
||||
static con: string = "/v1/user/mapMakerUser"
|
||||
|
||||
static newTask: string = "/v1/user/newTask"
|
||||
static taskulist: string = "/v1/public/taskInUser"
|
||||
static deviceList: string = "/api/v1/devicesconfig" //设备列表
|
||||
|
@ -54,6 +56,10 @@ class HomeStore extends BaseStore<TagDataType> {
|
|||
async getAe() {
|
||||
return await baseHttp.get(HomeConfig.ae, {});
|
||||
}
|
||||
// 获取联系人
|
||||
async getContact() {
|
||||
return await baseHttp.get(HomeConfig.con, {});
|
||||
}
|
||||
|
||||
// 获取视频推流连接
|
||||
async getVideoUrlList() {
|
||||
|
|
|
@ -5,7 +5,7 @@ import BaseStore from "./baseStore";
|
|||
import { UserDataType, UserInfos } from "@/model/userModel";
|
||||
import { message } from "antd";
|
||||
class UserConfig {
|
||||
static LOGINURI: string = "/v1/anth/login"
|
||||
static LOGINURI: string = "/v1/anth/login/pc"
|
||||
static LIST: string = "/v1/user/list"
|
||||
static ADD: string = "/v1/user"
|
||||
static DELETE: string = "/v1/user"
|
||||
|
|
Loading…
Reference in New Issue