diff --git a/src/App.tsx b/src/App.tsx index 344a22d..c2d25b4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,10 +1,10 @@ import { Outlet } from "react-router"; import MapUtl from "./components/map/mapUtil"; -import { useEffect } from "react"; -// import SocketService from "./util/socket"; -// const socketService = SocketService.getInstance(); +import SocketService from "./util/socket"; +const socketService = SocketService.getInstance(); const onMessage = (e: any) => { let data = JSON.parse(e); + console.log(data) if (data.type === "accpt") { let body = JSON.parse(data.content.body); MapUtl.addMaker({ @@ -23,9 +23,19 @@ const onMessage = (e: any) => { }); maker?.setPosition([body.long, body.lat]); } + else if (data.type === "move") { + let maker: any = null; + let body = JSON.parse(data.content.body); + MapUtl.makerList?.forEach((e) => { + if (e.userIdentity === body?.user_identity) { + maker = e.marker; + } + }); + maker?.setPosition([body.long, body.lat]); + } }; -// socketService.on("message", onMessage); +socketService.on("message", onMessage); const App = () => { return ( <> diff --git a/src/pages/home/homeBottom/ec.tsx b/src/pages/home/homeBottom/ec.tsx index 6d0e807..c614722 100644 --- a/src/pages/home/homeBottom/ec.tsx +++ b/src/pages/home/homeBottom/ec.tsx @@ -48,7 +48,7 @@ const Ec = (props: Store) => { {userList.map((item: any) => { return (
-
姓名:{item.account} : 未在线
+
姓名:{item.user_name} : 未在线

点击呼叫: diff --git a/src/pages/polRegulations/regulations_column.tsx b/src/pages/polRegulations/regulations_column.tsx index 0c67b03..0548a16 100644 --- a/src/pages/polRegulations/regulations_column.tsx +++ b/src/pages/polRegulations/regulations_column.tsx @@ -23,7 +23,6 @@ export const columns: ColumnsType = [ ]; export const defaultConfig = [ - { type: FormType.input, label: "法规标题", @@ -31,21 +30,26 @@ export const defaultConfig = [ value: "", rules: [{ required: true, message: "请输入法规标题!" }], }, - + { + type: FormType.inputNumber, + label: "等级排序", + name: "level", + value: 1, + }, { type: FormType.input, label: "法规副标题", name: "sub_title", value: "", - rules: [{ required: true, message: "请输入法规副标题!" }], }, { - type: "editor", + type: FormType.editor, label: "内容", name: "content", value: "", rules: [{ required: true, message: "请填写内容" }], }, + { type: "upload", label: "附件图片", diff --git a/src/pages/system/dict.tsx b/src/pages/system/dict.tsx index c60d03c..7e87926 100644 --- a/src/pages/system/dict.tsx +++ b/src/pages/system/dict.tsx @@ -7,17 +7,7 @@ import SimpleForm from "@/components/form/simple_form"; import React from "react"; import { columns, defaultCatConfig } from "./dict_column"; const { Option } = Select; -const list = [ - { id: 1, name: "婚姻" }, - { id: 2, name: "政治面貌" }, - { id: 3, name: "文化程度" }, - { id: 4, name: "民族" }, - { id: 5, name: "单位性质" }, - { id: 6, name: "服役军兵种" }, - { id: 7, name: "军衔" }, - { id: 8, name: "技术职称" }, - { id: 9, name: "职务级别" }, -]; + const Dict = (props: Store) => { const { sysStore } = props; const [isModalOpen, setIsModalOpen] = useState(false); @@ -130,7 +120,7 @@ const Dict = (props: Store) => { <>