first commit
|
@ -22,7 +22,7 @@
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
"@wangeditor/editor-for-react": "^1.0.6",
|
"@wangeditor/editor-for-react": "^1.0.6",
|
||||||
"ali-oss": "^6.18.1",
|
"ali-oss": "^6.18.1",
|
||||||
"antd": "^5.21.6",
|
"antd": "^5.23.1",
|
||||||
"axios": "^1.2.1",
|
"axios": "^1.2.1",
|
||||||
"babel-jest": "^27.4.2",
|
"babel-jest": "^27.4.2",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.3",
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
import { Pagination, PaginationProps, Table } from "antd";
|
import {
|
||||||
|
Button,
|
||||||
|
message,
|
||||||
|
Pagination,
|
||||||
|
PaginationProps,
|
||||||
|
Popconfirm,
|
||||||
|
PopconfirmProps,
|
||||||
|
Space,
|
||||||
|
Table,
|
||||||
|
} from "antd";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
const BTable = (props: any) => {
|
const BTable = (props: any) => {
|
||||||
const { store, dataSource, selectCallback, scroll } = props;
|
const { store, dataSource, selectCallback, scroll } = props;
|
||||||
|
@ -24,15 +33,43 @@ const BTable = (props: any) => {
|
||||||
Size: 20,
|
Size: 20,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const cancel: PopconfirmProps["onCancel"] = (e) => {
|
||||||
|
message.error("Click on No");
|
||||||
|
};
|
||||||
|
const confirm: PopconfirmProps["onConfirm"] = (e) => {
|
||||||
|
message.success("Click on Yes");
|
||||||
|
};
|
||||||
|
const actionColumn = {
|
||||||
|
title: "操作",
|
||||||
|
fixed: "right",
|
||||||
|
with: 200,
|
||||||
|
render: (any, record) => (
|
||||||
|
<Space wrap>
|
||||||
|
<Button type="dashed" size="small">
|
||||||
|
编辑
|
||||||
|
</Button>
|
||||||
|
<Popconfirm
|
||||||
|
title="Delete the task"
|
||||||
|
description="Are you sure to delete this task?"
|
||||||
|
onConfirm={confirm}
|
||||||
|
onCancel={cancel}
|
||||||
|
okText="Yes"
|
||||||
|
cancelText="No"
|
||||||
|
>
|
||||||
|
<Button type="dashed" danger size="small">删除</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Table
|
<Table
|
||||||
style={{ height: "100%", overflow: "auto" }}
|
style={{ height: "100%", overflow: "auto" }}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
scroll={scroll }
|
scroll={scroll}
|
||||||
loading={store.listStatus}
|
loading={store.listStatus}
|
||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
columns={props.columns}
|
columns={[...props.columns, actionColumn]}
|
||||||
dataSource={dataSource}
|
dataSource={dataSource}
|
||||||
/>
|
/>
|
||||||
<div style={{ textAlign: "right", padding: "10px" }}>
|
<div style={{ textAlign: "right", padding: "10px" }}>
|
||||||
|
|
|
@ -9,7 +9,7 @@ export const FormSelect = (v: FormDatas) => {
|
||||||
if (v.selectList && v.selectList.length > 0) {
|
if (v.selectList && v.selectList.length > 0) {
|
||||||
setList(v.selectList);
|
setList(v.selectList);
|
||||||
} else {
|
} else {
|
||||||
baseHttp.get(`${v.selectUrl}/?size=50&offset=1` ?? "", "").then((res) => {
|
baseHttp.get(`${v.selectUrl}/?size=50&offset=1`, "").then((res) => {
|
||||||
setList(res.data.record ?? []);
|
setList(res.data.record ?? []);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { FormSelect } from "./select";
|
||||||
import AliUpload from "../ali_upload";
|
import AliUpload from "../ali_upload";
|
||||||
import MyEditor from "../edittor";
|
import MyEditor from "../edittor";
|
||||||
import MapFrom from "../map/MapFrom";
|
import MapFrom from "../map/MapFrom";
|
||||||
import VideoSelect from "../video_select";
|
// import VideoSelect from "../video_select";
|
||||||
const { TextArea } = Input;
|
const { TextArea } = Input;
|
||||||
const SimpleForm = (props: SimpleFormData) => {
|
const SimpleForm = (props: SimpleFormData) => {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
@ -55,18 +55,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
<InputNumber defaultValue={v.value} value={v.value} />
|
<InputNumber defaultValue={v.value} value={v.value} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
// case FormType.fetchList:
|
case FormType.password:
|
||||||
// return (
|
|
||||||
// <Form.Item
|
|
||||||
// key={v.label}
|
|
||||||
// label={v.label}
|
|
||||||
// name={v.name}
|
|
||||||
// rules={v.rules}
|
|
||||||
// >
|
|
||||||
// <Dumbselect />
|
|
||||||
// </Form.Item>
|
|
||||||
// );
|
|
||||||
case "password":
|
|
||||||
return (
|
return (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
key={v.label}
|
key={v.label}
|
||||||
|
@ -105,21 +94,7 @@ const SimpleForm = (props: SimpleFormData) => {
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
case FormType.treeVideo:
|
|
||||||
return (
|
|
||||||
<Form.Item
|
|
||||||
key={v.label}
|
|
||||||
label={v.label}
|
|
||||||
name={v.name}
|
|
||||||
rules={v.rules}
|
|
||||||
>
|
|
||||||
<VideoSelect
|
|
||||||
changes={(v) => {
|
|
||||||
form?.setFieldsValue({ task_video: v });
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
);
|
|
||||||
case FormType.select:
|
case FormType.select:
|
||||||
return FormSelect(v);
|
return FormSelect(v);
|
||||||
case FormType.upload:
|
case FormType.upload:
|
||||||
|
|
|
@ -1,18 +1,27 @@
|
||||||
import { Content, Header } from "antd/es/layout/layout";
|
import { Content, Footer, Header } from "antd/es/layout/layout";
|
||||||
import "./layout.less";
|
import "./layout.less";
|
||||||
import { Menu } from "antd";
|
|
||||||
import { Footer } from "antd/lib/layout/layout";
|
|
||||||
import { Outlet, useLocation, useNavigate } from "react-router";
|
|
||||||
import { HomeTwoTone } from "@ant-design/icons";
|
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { Store } from "antd/es/form/interface";
|
import { Store } from "antd/es/form/interface";
|
||||||
import { useEffect } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
import { Avatar, Breadcrumb, Layout, Menu, theme } from "antd";
|
||||||
|
import { UserOutlined } from "@ant-design/icons";
|
||||||
|
import Sider from "antd/es/layout/Sider";
|
||||||
import { items } from "./layout_config";
|
import { items } from "./layout_config";
|
||||||
|
import { Dropdown } from "antd/lib";
|
||||||
|
import { Outlet, useNavigate } from "react-router";
|
||||||
const LayOut = (props: Store) => {
|
const LayOut = (props: Store) => {
|
||||||
const { usrStore } = props;
|
const { usrStore } = props;
|
||||||
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
const nav = useNavigate();
|
const nav = useNavigate();
|
||||||
const location = useLocation();
|
const {
|
||||||
|
token: { colorBgContainer, borderRadiusLG },
|
||||||
|
} = theme.useToken();
|
||||||
|
const headStyle = {
|
||||||
|
display: "flex",
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
};
|
||||||
|
const logoStyle = { width: 60, color: "white" };
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// if (usrStore.isNeedLogin) {
|
// if (usrStore.isNeedLogin) {
|
||||||
// nav("/login");
|
// nav("/login");
|
||||||
|
@ -21,43 +30,56 @@ const LayOut = (props: Store) => {
|
||||||
}, [usrStore.isNeedLogin]);
|
}, [usrStore.isNeedLogin]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="layout">
|
<Layout>
|
||||||
<Header
|
<Header style={headStyle}>
|
||||||
style={{
|
<div style={logoStyle}>logo</div>
|
||||||
position: "sticky",
|
<Dropdown menu={{ items }}>
|
||||||
top: 0,
|
<Avatar icon={<UserOutlined />} />
|
||||||
zIndex: 9,
|
</Dropdown>
|
||||||
width: "100%",
|
</Header>
|
||||||
display: "flex",
|
<Layout>
|
||||||
alignItems: "center",
|
<Sider
|
||||||
padding: "0 10px",
|
width={150}
|
||||||
boxSizing: "border-box",
|
style={{ background: colorBgContainer }}
|
||||||
}}
|
collapsible
|
||||||
|
collapsed={collapsed}
|
||||||
|
onCollapse={(value) => setCollapsed(value)}
|
||||||
>
|
>
|
||||||
<HomeTwoTone
|
|
||||||
onClick={() => nav("/")}
|
|
||||||
style={{ fontSize: "36px", marginRight: "10px" }}
|
|
||||||
/>
|
|
||||||
<Menu
|
<Menu
|
||||||
|
mode="inline"
|
||||||
theme="dark"
|
theme="dark"
|
||||||
mode="horizontal"
|
defaultSelectedKeys={["1"]}
|
||||||
defaultSelectedKeys={[location.pathname]}
|
defaultOpenKeys={["sub1"]}
|
||||||
|
style={{ height: "100%", borderRight: 0 }}
|
||||||
items={items}
|
items={items}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
console.log(e);
|
||||||
nav(e.key);
|
nav(e.key);
|
||||||
}}
|
}}
|
||||||
style={{ flex: 1, minWidth: 0 }}
|
|
||||||
/>
|
/>
|
||||||
|
</Sider>
|
||||||
<span style={{ color: "#fff" }} onClick={() => usrStore.logOut()}>退出登录</span>
|
<Layout style={{ padding: "0 15px 15px" }}>
|
||||||
</Header>
|
<Breadcrumb
|
||||||
<Content style={{ padding: "0 20px" }}>
|
items={[{ title: "Home" }, { title: "List" }, { title: "App" }]}
|
||||||
|
style={{ margin: "10px 0" }}
|
||||||
|
/>
|
||||||
|
<Content
|
||||||
|
style={{
|
||||||
|
padding: 12,
|
||||||
|
margin: 0,
|
||||||
|
minHeight: 280,
|
||||||
|
background: colorBgContainer,
|
||||||
|
borderRadius: borderRadiusLG,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</Content>
|
</Content>
|
||||||
<Footer style={{ textAlign: "center" }}>
|
<Footer style={{ textAlign: "center" }}>
|
||||||
双流区黄水镇人民政府 ©{new Date().getFullYear()} Created
|
Ant Design ©{new Date().getFullYear()} Created by Ant UED
|
||||||
</Footer>
|
</Footer>
|
||||||
</div>
|
</Layout>
|
||||||
|
</Layout>
|
||||||
|
</Layout>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,87 +1,35 @@
|
||||||
export const items = [
|
export const items = [
|
||||||
{
|
{
|
||||||
key: "/admin/user",
|
key: "/",
|
||||||
|
label: `首页看板`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "/user",
|
||||||
label: `用户管理`,
|
label: `用户管理`,
|
||||||
children: [
|
children: [
|
||||||
{
|
{ key: "/user/list", label: `用户管理` },
|
||||||
key: "/admin/user",
|
|
||||||
label: `用户管理`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/teamMgmt",
|
|
||||||
label: `队伍属性管理`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/persMgmt",
|
|
||||||
label: `个人身份管理`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/community",
|
|
||||||
label: `社区管理`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/grid",
|
|
||||||
label: `网格管理`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/patrolBrigade",
|
|
||||||
label: `巡防大队`,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "/admin/archives/box",
|
key: "/data",
|
||||||
label: `档案管理`,
|
label: `数据管理`,
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/material",
|
|
||||||
label: `物资管理`,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{ label: "数据管理", key: "/data/list" },
|
||||||
key: "/admin/whse/whseMgmt",
|
|
||||||
label: `仓库管理`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/materialMgmt",
|
|
||||||
label: `物资管理`,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "/admin/leaveApproval",
|
key: "/permission",
|
||||||
label: `请假审批`,
|
label: `权限管理`,
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/political",
|
|
||||||
label: `政治法规`,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{ label: `角色管理`, key: "/permission/role" },
|
||||||
key: "/admin/politicalStudy",
|
{ label: `菜单管理`, key: "/permission/menu" },
|
||||||
label: `政治学习`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: `/admin/polRegulations`,
|
|
||||||
label: `政治法规管理`,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "/admin/task",
|
key: "/sys",
|
||||||
label: `任务管理`,
|
|
||||||
children: [
|
|
||||||
{ label: "处突任务", key: "/admin/emergency" },
|
|
||||||
{ label: "巡逻任务", key: "/admin/patrol" },
|
|
||||||
{ label: "训练任务", key: "/admin/training" },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "/admin/sys",
|
|
||||||
label: `系统管理`,
|
label: `系统管理`,
|
||||||
children: [
|
children: [
|
||||||
{ label: `部门管理`, key: "/admin/dep" },
|
{ label: `部门管理`, key: "/dep" },
|
||||||
{ label: "系统设置", key: "/admin/sys/setting" },
|
|
||||||
{ label: "光荣牌审核", key: "/admin/sys/gp" },
|
|
||||||
{ label: "评优审核", key: "/admin/sys/exce_compet" },
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
|
@ -1,67 +1,33 @@
|
||||||
import homeStore from "@/store/home";
|
// import { TreeSelect, TreeSelectProps } from "antd";
|
||||||
import { TreeSelect, TreeSelectProps } from "antd";
|
// import { useEffect, useState } from "react";
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
|
|
||||||
const VideoSelect = (props) => {
|
const VideoSelect = (props) => {
|
||||||
const { changes } = props;
|
// const { changes } = props;
|
||||||
const [value, setValue] = useState<string>();
|
// const [value, setValue] = useState<string>();
|
||||||
const [treeData, setTreeData] = useState<Array<any>>([]);
|
// useEffect(() => {}, []);
|
||||||
useEffect(() => {
|
|
||||||
homeStore.getVideoUrlList().then((res) => {
|
|
||||||
let valuList: any = [];
|
|
||||||
res.EasyDarwin.Body.Devices.forEach((element) => {
|
|
||||||
valuList.push({
|
|
||||||
id: element.DeviceID,
|
|
||||||
pId: 0,
|
|
||||||
value: element.DeviceID,
|
|
||||||
title: element.DeviceName,
|
|
||||||
disableCheckbox: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
setTreeData(valuList);
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const onLoadData: TreeSelectProps["loadData"] = async ({ id }) => {
|
// const onLoadData: TreeSelectProps["loadData"] = async ({ id }) => {};
|
||||||
let reqs = await homeStore.getChannerUrlList(id);
|
|
||||||
let valuList: any = [];
|
|
||||||
reqs.EasyDarwin.Body.Channels.forEach((item) => {
|
|
||||||
valuList.push({
|
|
||||||
key: id + "-" + item.ChannelID,
|
|
||||||
id: id + "-" + item.ChannelID,
|
|
||||||
pId: id,
|
|
||||||
value: id + "-" + item.ChannelID,
|
|
||||||
title: item.Name,
|
|
||||||
treeExpandAction: true,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
setTreeData((prev)=>{
|
// const onChange = (newValue: string) => {
|
||||||
return [...prev,...valuList]
|
// if (newValue.length > 4) return;
|
||||||
});
|
// setValue(newValue);
|
||||||
};
|
// changes(newValue);
|
||||||
|
// };
|
||||||
const onChange = (newValue: string) => {
|
// return (
|
||||||
if (newValue.length > 4) return;
|
// <div>
|
||||||
setValue(newValue);
|
// <TreeSelect
|
||||||
changes(newValue);
|
// treeDataSimpleMode
|
||||||
};
|
// multiple
|
||||||
return (
|
// treeCheckable
|
||||||
<div>
|
// style={{ width: "100%" }}
|
||||||
<TreeSelect
|
// value={value}
|
||||||
treeDataSimpleMode
|
// dropdownStyle={{ maxHeight: 400, overflow: "auto" }}
|
||||||
multiple
|
// placeholder="Please select"
|
||||||
treeCheckable
|
// onChange={onChange}
|
||||||
style={{ width: "100%" }}
|
// loadData={onLoadData}
|
||||||
value={value}
|
// />
|
||||||
dropdownStyle={{ maxHeight: 400, overflow: "auto" }}
|
// </div>
|
||||||
placeholder="Please select"
|
// );
|
||||||
onChange={onChange}
|
|
||||||
loadData={onLoadData}
|
|
||||||
treeData={treeData}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default VideoSelect;
|
export default VideoSelect;
|
||||||
|
|
|
@ -76,7 +76,6 @@ code {
|
||||||
.owner_model {
|
.owner_model {
|
||||||
padding-bottom: 0px !important;
|
padding-bottom: 0px !important;
|
||||||
.ant-modal-content {
|
.ant-modal-content {
|
||||||
background: url("static/frame_s@1x.png");
|
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
background-position: center center; /* 可选,确保图片在容器中居中 */
|
background-position: center center; /* 可选,确保图片在容器中居中 */
|
||||||
background-repeat: no-repeat; /* 确保图片不会重复 */
|
background-repeat: no-repeat; /* 确保图片不会重复 */
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
.contentBox{
|
||||||
|
overflow-y: auto;
|
||||||
|
height: 100%;
|
||||||
|
.tableName{
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { Button, Space } from "antd";
|
||||||
|
import { inject, observer } from "mobx-react";
|
||||||
|
import { Store } from "antd/lib/form/interface";
|
||||||
|
import React from "react";
|
||||||
|
import "./index.less";
|
||||||
|
|
||||||
|
const Dashbord = (props: Store) => {
|
||||||
|
return (
|
||||||
|
<div className="contentBox">
|
||||||
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
|
<Button type="primary" onClick={() => props.usrStore.getUserList()}>
|
||||||
|
获取用户列表
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default inject("usrStore")(observer(Dashbord));
|
|
@ -1,157 +0,0 @@
|
||||||
@keyframes scroll {
|
|
||||||
0% {
|
|
||||||
transform: translateX(100%);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
transform: translateX(-100%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.contents_center {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
.scr {
|
|
||||||
position: absolute;
|
|
||||||
top: 60px;
|
|
||||||
z-index: 9;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
.scrolling-text {
|
|
||||||
white-space: nowrap;
|
|
||||||
display: block;
|
|
||||||
animation: scroll 20s linear infinite;
|
|
||||||
color: #fff;
|
|
||||||
> span {
|
|
||||||
display: inline-block;
|
|
||||||
animation: scrollText 20s linear infinite; /* 动画 */
|
|
||||||
}
|
|
||||||
:hover > span {
|
|
||||||
animation-play-state: paused;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.map_container_t {
|
|
||||||
position: absolute;
|
|
||||||
height: 60px;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
background-image: url("../../static/head.png");
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
.map_container_t_c {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex: 5;
|
|
||||||
.title_img {
|
|
||||||
margin-left: 10px;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
.on_to {
|
|
||||||
transform: rotate(-180deg) rotateY(0deg);
|
|
||||||
}
|
|
||||||
.twp {
|
|
||||||
height: 30px;
|
|
||||||
}
|
|
||||||
> span {
|
|
||||||
margin-left: 15px;
|
|
||||||
margin-right: 15px;
|
|
||||||
color: #fff;
|
|
||||||
font-size:25px;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: normal;
|
|
||||||
letter-spacing: 0.1em;
|
|
||||||
font-variation-settings: "opsz" auto;
|
|
||||||
color: #ffffff;
|
|
||||||
text-shadow: 0px 0px 10px #29ecb4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.map_container_t_l {
|
|
||||||
flex: 1;
|
|
||||||
> span {
|
|
||||||
margin-left: 15px;
|
|
||||||
margin-right: 15px;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: normal;
|
|
||||||
letter-spacing: 0.1em;
|
|
||||||
font-variation-settings: "opsz" auto;
|
|
||||||
color: #ffffff;
|
|
||||||
text-shadow: 0px 0px 10px #29ecb4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.map_container_t_r {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.map_container_l {
|
|
||||||
position: absolute;
|
|
||||||
left: 0px;
|
|
||||||
top: 60px;
|
|
||||||
width: 20%;
|
|
||||||
bottom: 0px;
|
|
||||||
z-index: 2;
|
|
||||||
opacity: 1;
|
|
||||||
background: rgba(37, 52, 70, 0.4);
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
}
|
|
||||||
.map_container_r {
|
|
||||||
position: absolute;
|
|
||||||
right: 0px;
|
|
||||||
top: 60px;
|
|
||||||
bottom: 0px;
|
|
||||||
width: 20%;
|
|
||||||
z-index: 2;
|
|
||||||
opacity: 1;
|
|
||||||
background: rgba(37, 52, 70, 0.4);
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
}
|
|
||||||
.map_container_b {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0px;
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
background: rgba(37, 52, 70, 0.4);
|
|
||||||
height: 60px;
|
|
||||||
width: 100%;
|
|
||||||
z-index: 1;
|
|
||||||
text-align: center;
|
|
||||||
.bottom_content {
|
|
||||||
display: inline-block;
|
|
||||||
> span {
|
|
||||||
background: linear-gradient(
|
|
||||||
180deg,
|
|
||||||
rgba(0, 193, 153, 0.1) 0%,
|
|
||||||
rgba(0, 239, 151, 0.8) 100%
|
|
||||||
);
|
|
||||||
padding: 5px 10px;
|
|
||||||
color: #fff;
|
|
||||||
margin: 0 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.map_video_container {
|
|
||||||
position: absolute;
|
|
||||||
width: 350px;
|
|
||||||
top: 70px;
|
|
||||||
right: 300px;
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
import { observer } from "mobx-react";
|
|
||||||
import "./home.less";
|
|
||||||
import MapContainer from "@/components/map/MapComponent";
|
|
||||||
import image2 from "@/static/title_line@1x.png";
|
|
||||||
import { SettingOutlined } from "@ant-design/icons";
|
|
||||||
import { useNavigate } from "react-router";
|
|
||||||
|
|
||||||
const Home = observer(() => {
|
|
||||||
const navigate = useNavigate();
|
|
||||||
return (
|
|
||||||
<div className="contents_center">
|
|
||||||
<div className="map_container_t">
|
|
||||||
<div className="map_container_t_l"></div>
|
|
||||||
<div className="map_container_t_c">
|
|
||||||
<img className="twp on_to" src={image2} alt="" />
|
|
||||||
<span>黄水镇微网实格应急处突综合指挥服务平台</span>
|
|
||||||
<img className="twp" src={image2} alt="" />
|
|
||||||
</div>
|
|
||||||
<div className="map_container_t_r">
|
|
||||||
<SettingOutlined
|
|
||||||
onClick={() => {
|
|
||||||
navigate("admin/user");
|
|
||||||
}}
|
|
||||||
style={{ fontSize: "20px", color: "#f9f9f9", cursor: "pointer" }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="scr">
|
|
||||||
<div className="scrolling-text">
|
|
||||||
<span>仓库2,3号货架,单兵装备,即将临期</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="map_container_l"></div>
|
|
||||||
<MapContainer />
|
|
||||||
<div className="map_video_container"></div>
|
|
||||||
<div className="map_container_r"></div>
|
|
||||||
<div className="map_container_b"></div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
export default Home;
|
|
|
@ -1,7 +1,6 @@
|
||||||
.login_model {
|
.login_model {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-image: url("../../static/jun.png");
|
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import {inject, observer} from "mobx-react";
|
|
||||||
import { useEffect } from "react";
|
|
||||||
const Test = (store) =>{
|
|
||||||
const {testStore} = store;
|
|
||||||
useEffect(() => {
|
|
||||||
console.log(testStore.list);
|
|
||||||
|
|
||||||
// usrStore.getlist
|
|
||||||
}, []);
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<div>test</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
// admin
|
|
||||||
// systemCode
|
|
||||||
|
|
||||||
export default inject("testStore")(observer(Test));
|
|
|
@ -1,5 +1,4 @@
|
||||||
.contentBox{
|
.contentBox{
|
||||||
padding: 10px;
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.tableName{
|
.tableName{
|
||||||
|
|
|
@ -6,7 +6,6 @@ import { Store } from "antd/lib/form/interface";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { columns } from "./user_config";
|
import { columns } from "./user_config";
|
||||||
import "./user.less";
|
import "./user.less";
|
||||||
import Move from "./move";
|
|
||||||
|
|
||||||
const User = (props: Store) => {
|
const User = (props: Store) => {
|
||||||
const { usrStore } = props;
|
const { usrStore } = props;
|
||||||
|
@ -14,56 +13,24 @@ const User = (props: Store) => {
|
||||||
const formRef = React.useRef<FormInstance>(null);
|
const formRef = React.useRef<FormInstance>(null);
|
||||||
const [userId, setId] = useState<Number | null>(null);
|
const [userId, setId] = useState<Number | null>(null);
|
||||||
|
|
||||||
const edit = (record) => {};
|
|
||||||
useEffect(() => {}, [usrStore]);
|
useEffect(() => {}, [usrStore]);
|
||||||
|
|
||||||
const addHandler = () => {};
|
const addHandler = () => {};
|
||||||
return (
|
return (
|
||||||
<div className="contentBox">
|
<div className="contentBox">
|
||||||
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
|
||||||
<Space direction="horizontal" size={"middle"}>
|
|
||||||
<Button type="default" onClick={() => addHandler()}>
|
<Button type="default" onClick={() => addHandler()}>
|
||||||
添加民兵
|
添加用户
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
|
||||||
<BTable
|
<BTable
|
||||||
store={usrStore}
|
store={usrStore}
|
||||||
scroll={{ x: "max-content" }}
|
scroll={{ x: "max-content" }}
|
||||||
columns={[
|
columns={columns}
|
||||||
...columns,
|
|
||||||
{
|
|
||||||
title: "操作",
|
|
||||||
fixed: "right",
|
|
||||||
with: 200,
|
|
||||||
render: (any, record) => (
|
|
||||||
<Space wrap>
|
|
||||||
<Button
|
|
||||||
type="dashed"
|
|
||||||
size="small"
|
|
||||||
onClick={() => edit(record)}
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</Button>
|
|
||||||
<Move id={record.identity} />
|
|
||||||
<Button
|
|
||||||
type="dashed"
|
|
||||||
danger
|
|
||||||
size="small"
|
|
||||||
onClick={() => {
|
|
||||||
usrStore.deleteItem(record.id);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</Button>
|
|
||||||
</Space>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
dataSource={usrStore.list}
|
dataSource={usrStore.list}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
title={!userId ? "添加民兵" : "编辑民兵"}
|
title={!userId ? "添加用户" : "编辑用户"}
|
||||||
width={800}
|
width={800}
|
||||||
open={isModalOpen}
|
open={isModalOpen}
|
||||||
afterClose={() => formRef.current?.resetFields()}
|
afterClose={() => formRef.current?.resetFields()}
|
||||||
|
@ -74,9 +41,7 @@ const User = (props: Store) => {
|
||||||
setId(null);
|
setId(null);
|
||||||
setIsModalOpen(false);
|
setIsModalOpen(false);
|
||||||
}}
|
}}
|
||||||
>
|
></Modal>
|
||||||
|
|
||||||
</Modal>
|
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,9 +2,8 @@ import { FormType } from "@/components/form/interface";
|
||||||
import { UserDataType } from "@/model/userModel";
|
import { UserDataType } from "@/model/userModel";
|
||||||
import { ColumnsType } from "antd/lib/table";
|
import { ColumnsType } from "antd/lib/table";
|
||||||
import { Image } from "antd";
|
import { Image } from "antd";
|
||||||
import { getAgeByIDCard, getBirthDateAndGender } from "@/util/util";
|
import { getBirthDateAndGender } from "@/util/util";
|
||||||
export const defaultConfig =(team,per)=>
|
export const defaultConfig = (team, per) => [
|
||||||
[
|
|
||||||
{
|
{
|
||||||
type: FormType.input,
|
type: FormType.input,
|
||||||
label: "用户名",
|
label: "用户名",
|
||||||
|
@ -12,74 +11,7 @@ export const defaultConfig =(team,per)=>
|
||||||
value: "",
|
value: "",
|
||||||
rules: [{ required: true, message: "请输入用户名称!" }],
|
rules: [{ required: true, message: "请输入用户名称!" }],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type: FormType.radio,
|
|
||||||
label: "性别",
|
|
||||||
name: "sex",
|
|
||||||
radioData: [
|
|
||||||
{
|
|
||||||
key: "男",
|
|
||||||
val: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "女",
|
|
||||||
val: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
value: 0,
|
|
||||||
rules: [{ required: true, message: "请选择性别" }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.radio,
|
|
||||||
label: "是否网格员",
|
|
||||||
name: "grid_user",
|
|
||||||
radioData: [
|
|
||||||
{
|
|
||||||
key: "是",
|
|
||||||
val: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "否",
|
|
||||||
val: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
value: 0,
|
|
||||||
rules: [{ required: true, message: "请选择是否网格员" }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.radio,
|
|
||||||
label: "是否为巡防大队",
|
|
||||||
name: "patrol_user",
|
|
||||||
radioData: [
|
|
||||||
{
|
|
||||||
key: "是",
|
|
||||||
val: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "否",
|
|
||||||
val: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
value: 0,
|
|
||||||
rules: [{ required: true, message: "请选择是否为巡防大队" }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.radio,
|
|
||||||
label: "是否民兵",
|
|
||||||
name: "militia",
|
|
||||||
radioData: [
|
|
||||||
{
|
|
||||||
key: "是",
|
|
||||||
val: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "否",
|
|
||||||
val: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
value: 0,
|
|
||||||
rules: [{ required: true, message: "请选择是否民兵" }],
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: FormType.inputNumber,
|
type: FormType.inputNumber,
|
||||||
label: "年龄",
|
label: "年龄",
|
||||||
|
@ -102,25 +34,6 @@ export const defaultConfig =(team,per)=>
|
||||||
rules: [{ required: true, message: "请输入登录账号" }],
|
rules: [{ required: true, message: "请输入登录账号" }],
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
type: FormType.input,
|
|
||||||
label: "家庭住址",
|
|
||||||
name: "home_addr",
|
|
||||||
value: "",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
type: FormType.input,
|
|
||||||
label: "担任职务",
|
|
||||||
name: "pos_held",
|
|
||||||
value: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.input,
|
|
||||||
label: "通讯地址",
|
|
||||||
name: "mail_addr",
|
|
||||||
value: "",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: FormType.input,
|
type: FormType.input,
|
||||||
label: "联系电话",
|
label: "联系电话",
|
||||||
|
@ -128,95 +41,12 @@ export const defaultConfig =(team,per)=>
|
||||||
value: "",
|
value: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
type: FormType.cehckboxGroup,
|
|
||||||
label: "所属队伍",
|
|
||||||
name: "team_link_user",
|
|
||||||
checkboxData:team,
|
|
||||||
value: "",
|
|
||||||
rules: [{ required: true, message: "请选择所属队伍" }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.cehckboxGroup,
|
|
||||||
label: "个人身份属性",
|
|
||||||
name: "pers_link_user",
|
|
||||||
checkboxData:per,
|
|
||||||
value: "",
|
|
||||||
rules: [{ required: true, message: "请选择个人身份属性" }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.radio,
|
|
||||||
label: "是否党员",
|
|
||||||
name: "p_member",
|
|
||||||
value: 1,
|
|
||||||
radioData: [
|
|
||||||
{
|
|
||||||
key: "是",
|
|
||||||
val: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "否",
|
|
||||||
val: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
rules: [{ required: true, message: "是否党员不能为空" }],
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
type: FormType.radio,
|
|
||||||
label: "是否退役军人",
|
|
||||||
name: "vet",
|
|
||||||
value: 0,
|
|
||||||
radioData: [
|
|
||||||
{
|
|
||||||
key: "是",
|
|
||||||
val: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "否",
|
|
||||||
val: 2,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
rules: [{ required: true, message: "是否退役军人不能为空" }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.date,
|
|
||||||
label: "入伍时间",
|
|
||||||
name: "vet_in_time",
|
|
||||||
value: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.date,
|
|
||||||
label: "退伍时间",
|
|
||||||
name: "vet_out_time",
|
|
||||||
value: "",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: FormType.input,
|
|
||||||
label: "服役部队",
|
|
||||||
name: "serv_unit",
|
|
||||||
value: "",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
type: FormType.input,
|
|
||||||
label: "专业特长",
|
|
||||||
name: "spec",
|
|
||||||
value: "",
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
type: FormType.input,
|
type: FormType.input,
|
||||||
label: "邮箱",
|
label: "邮箱",
|
||||||
name: "email",
|
name: "email",
|
||||||
value: "",
|
value: "",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type: FormType.textarea,
|
|
||||||
label: "描述",
|
|
||||||
name: "remark",
|
|
||||||
value: "",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: FormType.upload,
|
type: FormType.upload,
|
||||||
label: "头像",
|
label: "头像",
|
||||||
|
@ -235,19 +65,17 @@ export const columns: ColumnsType<UserDataType> = [
|
||||||
{
|
{
|
||||||
title: "性别",
|
title: "性别",
|
||||||
width: 150,
|
width: 150,
|
||||||
render: (render) => <span>{getBirthDateAndGender(render.id_card)?.gender}</span>,
|
render: (render) => (
|
||||||
},
|
<span>{getBirthDateAndGender(render.id_card)?.gender}</span>
|
||||||
{
|
),
|
||||||
title: "年龄",
|
|
||||||
width: 150,
|
|
||||||
render: (render) => <span>{getAgeByIDCard(render.id_card)}岁</span>,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "头像",
|
title: "头像",
|
||||||
dataIndex: "head_img",
|
dataIndex: "head_img",
|
||||||
width: 150,
|
width: 150,
|
||||||
render: (head_img) =>{
|
render: (head_img) => {
|
||||||
return <Image src={head_img}></Image>
|
return <Image src={head_img}></Image>;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -256,71 +84,14 @@ export const columns: ColumnsType<UserDataType> = [
|
||||||
width: 150,
|
width: 150,
|
||||||
dataIndex: "account",
|
dataIndex: "account",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "家庭住址",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "home_addr",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "身份证",
|
title: "身份证",
|
||||||
width: 150,
|
width: 150,
|
||||||
dataIndex: "id_card",
|
dataIndex: "id_card",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "担任职务",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "pos_held",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "通讯地址",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "mail_addr",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "服役部队",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "serv_unit",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "贯籍",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "porig",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "专业特长",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "spec",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "邮箱",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "email",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "联系电话",
|
title: "联系电话",
|
||||||
width: 150,
|
width: 150,
|
||||||
dataIndex: "tel",
|
dataIndex: "tel",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "民族",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "eth",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "是否党员",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "p_member",
|
|
||||||
render: (p_member) => <span>{p_member === 1 ? "是" : "否"}</span>,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "是否退役军人",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "vet",
|
|
||||||
render: (vet) => <span>{vet === 1 ? "是" : "否"}</span>,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "备注",
|
|
||||||
width: 150,
|
|
||||||
dataIndex: "remark",
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,17 +1,30 @@
|
||||||
import { createHashRouter } from "react-router-dom";
|
import { createHashRouter } from "react-router-dom";
|
||||||
import App from "@/App";
|
import LayOut from "@/components/layout/layout";
|
||||||
import Login from "@/pages/login/login";
|
import Login from "@/pages/login/login";
|
||||||
import { homeRouter } from "@/router/routers/home_router";
|
import User from "@/pages/user/user";
|
||||||
|
import Dashbord from "@/pages/dashbord";
|
||||||
|
|
||||||
const routers = createHashRouter([
|
const routers = createHashRouter([
|
||||||
{
|
{
|
||||||
path: "/",
|
path: "/",
|
||||||
element: <App />,
|
element: <LayOut />,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "/",
|
||||||
|
index: true,
|
||||||
|
element: <Dashbord />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/user/list",
|
||||||
|
index: true,
|
||||||
|
element: <User />,
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/login",
|
path: "/login",
|
||||||
element: <Login />,
|
element: <Login />,
|
||||||
},
|
},
|
||||||
...homeRouter
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export { routers };
|
export { routers };
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
import LayOut from "@/components/layout/layout";
|
import LayOut from "@/components/layout/layout";
|
||||||
import Home from "@/pages/home/home";
|
|
||||||
import User from "@/pages/user/user";
|
import User from "@/pages/user/user";
|
||||||
export const homeRouter = [
|
export const homeRouter = [
|
||||||
{
|
|
||||||
path: "/",
|
|
||||||
index: true,
|
|
||||||
element: <Home />,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "/admin",
|
path: "/admin",
|
||||||
element: <LayOut />,
|
element: <LayOut />,
|
||||||
|
|
Before Width: | Height: | Size: 142 KiB |
Before Width: | Height: | Size: 82 KiB |
Before Width: | Height: | Size: 180 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 101 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 743 B |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 489 B |
Before Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 140 KiB |
|
@ -1,19 +0,0 @@
|
||||||
import { makeObservable } from "mobx";
|
|
||||||
import { TagDataType } from "@/model/userModel";
|
|
||||||
import BaseStore from "./baseStore";
|
|
||||||
|
|
||||||
// 社区
|
|
||||||
class CommunityConfig {
|
|
||||||
static LIST: string = "/v1/community/list"
|
|
||||||
static ADD: string = "/v1/community"
|
|
||||||
static DELETE: string = "/v1/community"
|
|
||||||
static EDIT: string = "/v1/community"
|
|
||||||
}
|
|
||||||
class CommunityStore extends BaseStore<TagDataType> {
|
|
||||||
constructor() {
|
|
||||||
super(CommunityConfig)
|
|
||||||
makeObservable(this, {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const communityStore = new CommunityStore();
|
|
|
@ -1,130 +0,0 @@
|
||||||
import { action, makeObservable, observable } from "mobx";
|
|
||||||
// 档案文件夹
|
|
||||||
import baseHttp from "@/service/base";
|
|
||||||
import BaseStore from "./baseStore";
|
|
||||||
import { TagDataType } from "@/model/userModel";
|
|
||||||
import MapUtl from "@/components/map/mapUtil";
|
|
||||||
import Config from "@/util/config";
|
|
||||||
|
|
||||||
class HomeConfig {
|
|
||||||
static os: string = "/v1/public/os"
|
|
||||||
static tr: string = "/v1/public/tr"
|
|
||||||
static af: string = "/v1/public/af"
|
|
||||||
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" //设备列表
|
|
||||||
static channerList: string = "/api/v1/channelsconfig" //设备列表
|
|
||||||
static channelstream: string = "/api/v1/devices/channelstream" //设备包活
|
|
||||||
|
|
||||||
}
|
|
||||||
class HomeStore extends BaseStore<TagDataType> {
|
|
||||||
constructor() {
|
|
||||||
super(HomeConfig)
|
|
||||||
makeObservable(this, {
|
|
||||||
getOgCount: action,
|
|
||||||
ogMap: observable,
|
|
||||||
alist: observable,
|
|
||||||
showVideo: observable,
|
|
||||||
ulist: observable,
|
|
||||||
showVideoHandler: action,
|
|
||||||
getTaskUserList: action,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
async getOgCount() {
|
|
||||||
let res = await baseHttp.get(HomeConfig.os, {});
|
|
||||||
this.ogMap = res.data.record
|
|
||||||
}
|
|
||||||
async getTr() {
|
|
||||||
return await baseHttp.get(HomeConfig.tr, {});
|
|
||||||
}
|
|
||||||
|
|
||||||
async getAf() {
|
|
||||||
return await baseHttp.get(HomeConfig.af, {});
|
|
||||||
}
|
|
||||||
async getMm() {
|
|
||||||
return await baseHttp.get(HomeConfig.mm, {});
|
|
||||||
}
|
|
||||||
async getRm() {
|
|
||||||
return await baseHttp.get(HomeConfig.rm, {});
|
|
||||||
}
|
|
||||||
async getAe() {
|
|
||||||
return await baseHttp.get(HomeConfig.ae, {});
|
|
||||||
}
|
|
||||||
// 获取联系人
|
|
||||||
async getContact(params) {
|
|
||||||
return await baseHttp.get(HomeConfig.con, params);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取视频推流连接
|
|
||||||
async getVideoUrlList() {
|
|
||||||
try {
|
|
||||||
let data = await baseHttp.gets(HomeConfig.deviceList, {
|
|
||||||
start: 0,
|
|
||||||
limit: 30
|
|
||||||
})
|
|
||||||
return data
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 通道列表
|
|
||||||
async getChannerUrlList(deviceId) {
|
|
||||||
try {
|
|
||||||
let data = await baseHttp.gets(Config.baseUrl+HomeConfig.channerList, {
|
|
||||||
start: 0,
|
|
||||||
limit: 30,
|
|
||||||
device: deviceId
|
|
||||||
})
|
|
||||||
return data;
|
|
||||||
} catch (error) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取通道流
|
|
||||||
async getChannerStrem(deviceId, channel) {
|
|
||||||
try {
|
|
||||||
let data = await baseHttp.gets(HomeConfig.channelstream, {
|
|
||||||
device: deviceId,
|
|
||||||
channel: channel,
|
|
||||||
protocol: "fmp4"
|
|
||||||
})
|
|
||||||
return data;
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async getNewTask() {
|
|
||||||
|
|
||||||
}
|
|
||||||
async getTaskUserList() {
|
|
||||||
let res = await baseHttp.get(HomeConfig.taskulist, {});
|
|
||||||
if (res.data?.record?.ulist && res.data?.record.ulist.length > 0) {
|
|
||||||
res.data?.record?.ulist.forEach(element => {
|
|
||||||
MapUtl.addMaker({
|
|
||||||
lng: element.long ?? 116.478935,
|
|
||||||
lat: element.lat ?? 39.997761,
|
|
||||||
title: element.user_name,
|
|
||||||
users: element
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
showVideoHandler(status) {
|
|
||||||
this.showVideo = status
|
|
||||||
}
|
|
||||||
ogMap!: Object;
|
|
||||||
showVideo!: boolean;
|
|
||||||
alist!: Array<any>;
|
|
||||||
ulist!: Array<any>;
|
|
||||||
}
|
|
||||||
const homeStore = new HomeStore()
|
|
||||||
export default homeStore;
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
import usrStore from '@/store/user'
|
import usrStore from '@/store/user'
|
||||||
import homeStore from './home';
|
|
||||||
import { communityStore } from './community';
|
|
||||||
|
|
||||||
const store = {
|
const store = {
|
||||||
usrStore,
|
usrStore,
|
||||||
homeStore,
|
|
||||||
communityStore,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default store;
|
export default store;
|
|
@ -17,10 +17,8 @@ class UserConfig {
|
||||||
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"
|
static siteList: string = "/v1/user/site"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class UserStore extends BaseStore<UserDataType> {
|
class UserStore extends BaseStore<UserDataType> {
|
||||||
_userinfo: UserInfos = {}; // 用户信息
|
_userinfo: UserInfos = {}; // 用户信息
|
||||||
userDetail = {}
|
userDetail = {}
|
||||||
|
|