fix(amap):core
This commit is contained in:
parent
622bc2ea8b
commit
e96a1efe47
|
@ -1,8 +1,7 @@
|
|||
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);
|
||||
if (data.type === "accpt") {
|
||||
|
@ -25,7 +24,7 @@ const onMessage = (e: any) => {
|
|||
}
|
||||
};
|
||||
|
||||
// socketService.on("message", onMessage);
|
||||
socketService.on("message", onMessage);
|
||||
const App = () => {
|
||||
return (
|
||||
<>
|
||||
|
|
|
@ -48,7 +48,7 @@ const Ec = (props: Store) => {
|
|||
{userList.map((item: any) => {
|
||||
return (
|
||||
<div key={item.account}>
|
||||
<div>姓名:{item.account} : 未在线</div>
|
||||
<div>姓名:{item.user_name} : 未在线</div>
|
||||
<p></p>
|
||||
<div>
|
||||
点击呼叫:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Button, Space, Modal, FormInstance } from "antd";
|
||||
import { Button, Space, Modal, FormInstance, Form } from "antd";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import type { ColumnsType } from "antd/es/table";
|
||||
import BTable from "@/components/b_table";
|
||||
|
@ -10,15 +10,21 @@ import React from "react";
|
|||
import { FormType } from "@/components/form/interface";
|
||||
import baseHttp from "@/service/base";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
import DebounceSelect from "@/components/form/featch_select";
|
||||
interface UserValue {
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
const Patrol = (props: Store) => {
|
||||
const { patrolStore } = props;
|
||||
const { patrolStore, usrStore } = props;
|
||||
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
||||
const [projectConfig, setProjectConfig] = useState<any>([]);
|
||||
const formRef = React.useRef<FormInstance>(null);
|
||||
const [record, setRecord] = useState<any>(null);
|
||||
const [tagId, setId] = useState<Number | null>(null);
|
||||
const [userList, setUserList] = useState<Array<any>>([]);
|
||||
const [value, setValue] = useState<UserValue[]>([]);
|
||||
|
||||
const columns: ColumnsType<UserDataType> = [
|
||||
{ title: "任务标题", dataIndex: "title" },
|
||||
{ title: "任务描述", dataIndex: "patrol_desc" },
|
||||
|
@ -54,7 +60,10 @@ const Patrol = (props: Store) => {
|
|||
type="dashed"
|
||||
size="small"
|
||||
onClick={() => {
|
||||
patrolStore.deleteItem(record.id);
|
||||
patrolStore.putItem(record.id, {
|
||||
...record,
|
||||
status: 1,
|
||||
});
|
||||
}}
|
||||
>
|
||||
完成
|
||||
|
@ -64,7 +73,7 @@ const Patrol = (props: Store) => {
|
|||
danger
|
||||
size="small"
|
||||
onClick={() => {
|
||||
patrolStore.deleteItem(record.id);
|
||||
patrolStore.deleteItem(record.identity);
|
||||
}}
|
||||
>
|
||||
删除
|
||||
|
@ -89,6 +98,7 @@ const Patrol = (props: Store) => {
|
|||
let data = {
|
||||
...values,
|
||||
score: Number(values.score ?? 0),
|
||||
user_identity: values.user_identity.map((item) => item.value),
|
||||
};
|
||||
if (!tagId) {
|
||||
patrolStore.add(data);
|
||||
|
@ -102,7 +112,7 @@ const Patrol = (props: Store) => {
|
|||
baseHttp.get("/user/list", null).then((res) => {
|
||||
let data = res.data?.record ?? [];
|
||||
data.forEach((item) => {
|
||||
item.label = item.account;
|
||||
item.label = item.user_name;
|
||||
item.value = item.identity;
|
||||
});
|
||||
setUserList(data ?? []);
|
||||
|
@ -121,7 +131,6 @@ const Patrol = (props: Store) => {
|
|||
label: "任务描述",
|
||||
name: "patrol_desc",
|
||||
value: "",
|
||||
rules: [{ required: true, message: "请输入任务描述!" }],
|
||||
},
|
||||
{
|
||||
type: FormType.input,
|
||||
|
@ -151,16 +160,24 @@ const Patrol = (props: Store) => {
|
|||
value: "",
|
||||
rules: [{ required: true, message: "请输入任务积分!" }],
|
||||
},
|
||||
{
|
||||
type: FormType.cehckboxGroup,
|
||||
label: "任务参与人",
|
||||
name: "user_identity",
|
||||
value: [],
|
||||
checkboxData: userList,
|
||||
rules: [{ required: true, message: "请选择参与人!" }],
|
||||
},
|
||||
// {
|
||||
// type: FormType.cehckboxGroup,
|
||||
// label: "任务参与人",
|
||||
// name: "user_identity",
|
||||
// value: [],
|
||||
// checkboxData: userList,
|
||||
// rules: [{ required: true, message: "请选择参与人!" }],
|
||||
// },
|
||||
];
|
||||
const onFinishFailed = () => {};
|
||||
async function fetchUserList(username: string): Promise<UserValue[]> {
|
||||
return usrStore.serchUser(username).then((res) => {
|
||||
return res.data.record.map((item) => ({
|
||||
label: item.user_name,
|
||||
value: item.identity,
|
||||
}));
|
||||
});
|
||||
}
|
||||
// 用户选择回调
|
||||
return (
|
||||
<div className="contentBox">
|
||||
|
@ -208,11 +225,29 @@ const Patrol = (props: Store) => {
|
|||
onFinish={onFinish}
|
||||
initialValues={true}
|
||||
onFinishFailed={onFinishFailed}
|
||||
/>
|
||||
childrenPosi={true}
|
||||
>
|
||||
<>
|
||||
<Form.Item
|
||||
key={"user_identity"}
|
||||
label={"巡逻人员"}
|
||||
name={"user_identity"}
|
||||
rules={[{ required: true, message: "请选择巡逻人员!" }]}
|
||||
>
|
||||
<DebounceSelect
|
||||
mode="multiple"
|
||||
value={value}
|
||||
placeholder="输入搜索"
|
||||
fetchOptions={fetchUserList}
|
||||
style={{ width: "100%" }}
|
||||
/>
|
||||
</Form.Item>
|
||||
</>
|
||||
</SimpleForm>
|
||||
</Modal>
|
||||
</Space>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default inject("patrolStore")(observer(Patrol));
|
||||
export default inject("patrolStore", "usrStore")(observer(Patrol));
|
||||
|
|
|
@ -2,6 +2,7 @@ import { FormType } from "@/components/form/interface";
|
|||
import { UserDataType } from "@/model/userModel";
|
||||
import { ColumnsType } from "antd/lib/table";
|
||||
import { Image } from "antd";
|
||||
import Config from "@/util/config";
|
||||
export const defaultConfig =(team,per)=>
|
||||
[
|
||||
{
|
||||
|
@ -315,7 +316,9 @@ export const columns: ColumnsType<UserDataType> = [
|
|||
title: "头像",
|
||||
dataIndex: "head_img",
|
||||
width: 150,
|
||||
render: (headImg) => <Image src={headImg}></Image>,
|
||||
render: (headImg) =>{
|
||||
return <Image src={Config.userStatic+headImg+'.jpg'}></Image>
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
class Config {
|
||||
// static baseUrl = "https://rw.quwanya.cn/";
|
||||
static baseUrl = "https://rw.quwanya.cn/";
|
||||
static uploadUrl = "https://rw.quwanya.cn/";
|
||||
// static ws = "wss://rw.quwanya.cn/wsadmin?id=admin";
|
||||
static ws = "wss://rw.quwanya.cn/wsadmin?id=admin";
|
||||
static rtc = "wss://rw.quwanya.cn/ws";
|
||||
static ws = "ws://127.0.0.1:12214/ws?id=admin";
|
||||
static baseUrl = "http://127.0.0.1:12214/";
|
||||
// static uploadUrl = "http://127.0.0.1:12214/";
|
||||
|
||||
static userStatic = "https://rw.quwanya.cn/uploads/user/";
|
||||
// https://rw.quwanya.cn/uploads/user/%E5%B4%94%E6%96%87%E8%8C%9C.jpg
|
||||
}
|
||||
export default Config;
|
||||
|
||||
|
|
Loading…
Reference in New Issue