first commit

This commit is contained in:
wang_yp 2025-01-16 17:46:44 +08:00
parent 398907603e
commit 50c95399ae
39 changed files with 474 additions and 1145 deletions

535
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-react": "^1.0.6",
"ali-oss": "^6.18.1",
"antd": "^5.21.6",
"antd": "^5.23.1",
"axios": "^1.2.1",
"babel-jest": "^27.4.2",
"babel-loader": "^8.2.3",

View File

@ -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";
const BTable = (props: any) => {
const { store, dataSource, selectCallback, scroll } = props;
@ -24,6 +33,34 @@ const BTable = (props: any) => {
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 (
<>
<Table
@ -32,7 +69,7 @@ const BTable = (props: any) => {
scroll={scroll}
loading={store.listStatus}
rowSelection={rowSelection}
columns={props.columns}
columns={[...props.columns, actionColumn]}
dataSource={dataSource}
/>
<div style={{ textAlign: "right", padding: "10px" }}>

View File

@ -9,7 +9,7 @@ export const FormSelect = (v: FormDatas) => {
if (v.selectList && v.selectList.length > 0) {
setList(v.selectList);
} 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 ?? []);
});
}

View File

@ -5,7 +5,7 @@ import { FormSelect } from "./select";
import AliUpload from "../ali_upload";
import MyEditor from "../edittor";
import MapFrom from "../map/MapFrom";
import VideoSelect from "../video_select";
// import VideoSelect from "../video_select";
const { TextArea } = Input;
const SimpleForm = (props: SimpleFormData) => {
const [form] = Form.useForm();
@ -55,18 +55,7 @@ const SimpleForm = (props: SimpleFormData) => {
<InputNumber defaultValue={v.value} value={v.value} />
</Form.Item>
);
// case FormType.fetchList:
// return (
// <Form.Item
// key={v.label}
// label={v.label}
// name={v.name}
// rules={v.rules}
// >
// <Dumbselect />
// </Form.Item>
// );
case "password":
case FormType.password:
return (
<Form.Item
key={v.label}
@ -105,21 +94,7 @@ const SimpleForm = (props: SimpleFormData) => {
/>
</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:
return FormSelect(v);
case FormType.upload:

View File

@ -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 { 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 { 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 { Dropdown } from "antd/lib";
import { Outlet, useNavigate } from "react-router";
const LayOut = (props: Store) => {
const { usrStore } = props;
const [collapsed, setCollapsed] = useState(false);
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(() => {
// if (usrStore.isNeedLogin) {
// nav("/login");
@ -21,43 +30,56 @@ const LayOut = (props: Store) => {
}, [usrStore.isNeedLogin]);
return (
<div className="layout">
<Header
style={{
position: "sticky",
top: 0,
zIndex: 9,
width: "100%",
display: "flex",
alignItems: "center",
padding: "0 10px",
boxSizing: "border-box",
}}
<Layout>
<Header style={headStyle}>
<div style={logoStyle}>logo</div>
<Dropdown menu={{ items }}>
<Avatar icon={<UserOutlined />} />
</Dropdown>
</Header>
<Layout>
<Sider
width={150}
style={{ background: colorBgContainer }}
collapsible
collapsed={collapsed}
onCollapse={(value) => setCollapsed(value)}
>
<HomeTwoTone
onClick={() => nav("/")}
style={{ fontSize: "36px", marginRight: "10px" }}
/>
<Menu
mode="inline"
theme="dark"
mode="horizontal"
defaultSelectedKeys={[location.pathname]}
defaultSelectedKeys={["1"]}
defaultOpenKeys={["sub1"]}
style={{ height: "100%", borderRight: 0 }}
items={items}
onClick={(e) => {
console.log(e);
nav(e.key);
}}
style={{ flex: 1, minWidth: 0 }}
/>
<span style={{ color: "#fff" }} onClick={() => usrStore.logOut()}>退</span>
</Header>
<Content style={{ padding: "0 20px" }}>
</Sider>
<Layout style={{ padding: "0 15px 15px" }}>
<Breadcrumb
items={[{ title: "Home" }, { title: "List" }, { title: "App" }]}
style={{ margin: "10px 0" }}
/>
<Content
style={{
padding: 12,
margin: 0,
minHeight: 280,
background: colorBgContainer,
borderRadius: borderRadiusLG,
}}
>
<Outlet />
</Content>
<Footer style={{ textAlign: "center" }}>
©{new Date().getFullYear()} Created
Ant Design ©{new Date().getFullYear()} Created by Ant UED
</Footer>
</div>
</Layout>
</Layout>
</Layout>
);
};

View File

@ -1,87 +1,35 @@
export const items = [
{
key: "/admin/user",
key: "/",
label: `首页看板`,
},
{
key: "/user",
label: `用户管理`,
children: [
{
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: "/user/list", label: `用户管理` },
],
},
{
key: "/admin/archives/box",
label: `档案管理`,
},
{
key: "/admin/material",
label: `物资管理`,
key: "/data",
label: `数据管理`,
children: [
{
key: "/admin/whse/whseMgmt",
label: `仓库管理`,
},
{
key: "/admin/materialMgmt",
label: `物资管理`,
},
{ label: "数据管理", key: "/data/list" },
],
},
{
key: "/admin/leaveApproval",
label: `请假审批`,
},
{
key: "/admin/political",
label: `政治法规`,
key: "/permission",
label: `权限管理`,
children: [
{
key: "/admin/politicalStudy",
label: `政治学习`,
},
{
key: `/admin/polRegulations`,
label: `政治法规管理`,
},
{ label: `角色管理`, key: "/permission/role" },
{ label: `菜单管理`, key: "/permission/menu" },
],
},
{
key: "/admin/task",
label: `任务管理`,
children: [
{ label: "处突任务", key: "/admin/emergency" },
{ label: "巡逻任务", key: "/admin/patrol" },
{ label: "训练任务", key: "/admin/training" },
],
},
{
key: "/admin/sys",
key: "/sys",
label: `系统管理`,
children: [
{ label: `部门管理`, key: "/admin/dep" },
{ label: "系统设置", key: "/admin/sys/setting" },
{ label: "光荣牌审核", key: "/admin/sys/gp" },
{ label: "评优审核", key: "/admin/sys/exce_compet" },
{ label: `部门管理`, key: "/dep" },
],
},
];

View File

@ -1,67 +1,33 @@
import homeStore from "@/store/home";
import { TreeSelect, TreeSelectProps } from "antd";
import { useEffect, useState } from "react";
// import { TreeSelect, TreeSelectProps } from "antd";
// import { useEffect, useState } from "react";
const VideoSelect = (props) => {
const { changes } = props;
const [value, setValue] = useState<string>();
const [treeData, setTreeData] = useState<Array<any>>([]);
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 { changes } = props;
// const [value, setValue] = useState<string>();
// useEffect(() => {}, []);
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,
});
});
// const onLoadData: TreeSelectProps["loadData"] = async ({ id }) => {};
setTreeData((prev)=>{
return [...prev,...valuList]
});
};
const onChange = (newValue: string) => {
if (newValue.length > 4) return;
setValue(newValue);
changes(newValue);
};
return (
<div>
<TreeSelect
treeDataSimpleMode
multiple
treeCheckable
style={{ width: "100%" }}
value={value}
dropdownStyle={{ maxHeight: 400, overflow: "auto" }}
placeholder="Please select"
onChange={onChange}
loadData={onLoadData}
treeData={treeData}
/>
</div>
);
// const onChange = (newValue: string) => {
// if (newValue.length > 4) return;
// setValue(newValue);
// changes(newValue);
// };
// return (
// <div>
// <TreeSelect
// treeDataSimpleMode
// multiple
// treeCheckable
// style={{ width: "100%" }}
// value={value}
// dropdownStyle={{ maxHeight: 400, overflow: "auto" }}
// placeholder="Please select"
// onChange={onChange}
// loadData={onLoadData}
// />
// </div>
// );
};
export default VideoSelect;

View File

@ -76,7 +76,6 @@ code {
.owner_model {
padding-bottom: 0px !important;
.ant-modal-content {
background: url("static/frame_s@1x.png");
background-size: 100% 100%;
background-position: center center; /* 可选,确保图片在容器中居中 */
background-repeat: no-repeat; /* 确保图片不会重复 */

View File

@ -0,0 +1,8 @@
.contentBox{
overflow-y: auto;
height: 100%;
.tableName{
height: 100%;
overflow-y: auto;
}
}

View File

@ -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));

View File

@ -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;
}

View File

@ -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>23,</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;

View File

@ -1,7 +1,6 @@
.login_model {
width: 100%;
height: 100%;
background-image: url("../../static/jun.png");
background-repeat: no-repeat;
background-size: 100% 100%;
display: flex;

View File

@ -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));

View File

@ -1,5 +1,4 @@
.contentBox{
padding: 10px;
overflow-y: auto;
height: 100%;
.tableName{

View File

@ -6,7 +6,6 @@ import { Store } from "antd/lib/form/interface";
import React from "react";
import { columns } from "./user_config";
import "./user.less";
import Move from "./move";
const User = (props: Store) => {
const { usrStore } = props;
@ -14,56 +13,24 @@ const User = (props: Store) => {
const formRef = React.useRef<FormInstance>(null);
const [userId, setId] = useState<Number | null>(null);
const edit = (record) => {};
useEffect(() => {}, [usrStore]);
const addHandler = () => {};
return (
<div className="contentBox">
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
<Space direction="horizontal" size={"middle"}>
<Button type="default" onClick={() => addHandler()}>
</Button>
</Space>
<BTable
store={usrStore}
scroll={{ x: "max-content" }}
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>
),
},
]}
columns={columns}
dataSource={usrStore.list}
/>
<Modal
title={!userId ? "添加民兵" : "编辑民兵"}
title={!userId ? "添加用户" : "编辑用户"}
width={800}
open={isModalOpen}
afterClose={() => formRef.current?.resetFields()}
@ -74,9 +41,7 @@ const User = (props: Store) => {
setId(null);
setIsModalOpen(false);
}}
>
</Modal>
></Modal>
</Space>
</div>
);

View File

@ -2,9 +2,8 @@ import { FormType } from "@/components/form/interface";
import { UserDataType } from "@/model/userModel";
import { ColumnsType } from "antd/lib/table";
import { Image } from "antd";
import { getAgeByIDCard, getBirthDateAndGender } from "@/util/util";
export const defaultConfig =(team,per)=>
[
import { getBirthDateAndGender } from "@/util/util";
export const defaultConfig = (team, per) => [
{
type: FormType.input,
label: "用户名",
@ -12,74 +11,7 @@ export const defaultConfig =(team,per)=>
value: "",
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,
label: "年龄",
@ -102,25 +34,6 @@ export const defaultConfig =(team,per)=>
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,
label: "联系电话",
@ -128,95 +41,12 @@ export const defaultConfig =(team,per)=>
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,
label: "邮箱",
name: "email",
value: "",
},
{
type: FormType.textarea,
label: "描述",
name: "remark",
value: "",
},
{
type: FormType.upload,
label: "头像",
@ -235,19 +65,17 @@ export const columns: ColumnsType<UserDataType> = [
{
title: "性别",
width: 150,
render: (render) => <span>{getBirthDateAndGender(render.id_card)?.gender}</span>,
},
{
title: "年龄",
width: 150,
render: (render) => <span>{getAgeByIDCard(render.id_card)}</span>,
render: (render) => (
<span>{getBirthDateAndGender(render.id_card)?.gender}</span>
),
},
{
title: "头像",
dataIndex: "head_img",
width: 150,
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,
dataIndex: "account",
},
{
title: "家庭住址",
width: 150,
dataIndex: "home_addr",
},
{
title: "身份证",
width: 150,
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: "联系电话",
width: 150,
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",
},
];

View File

@ -1,17 +1,30 @@
import { createHashRouter } from "react-router-dom";
import App from "@/App";
import LayOut from "@/components/layout/layout";
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([
{
path: "/",
element: <App />,
element: <LayOut />,
children: [
{
path: "/",
index: true,
element: <Dashbord />,
},
{
path: "/user/list",
index: true,
element: <User />,
},
],
},
{
path: "/login",
element: <Login />,
},
...homeRouter
]);
export { routers };

View File

@ -1,12 +1,6 @@
import LayOut from "@/components/layout/layout";
import Home from "@/pages/home/home";
import User from "@/pages/user/user";
export const homeRouter = [
{
path: "/",
index: true,
element: <Home />,
},
{
path: "/admin",
element: <LayOut />,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

View File

@ -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();

View File

@ -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;

View File

@ -1,11 +1,7 @@
import usrStore from '@/store/user'
import homeStore from './home';
import { communityStore } from './community';
const store = {
usrStore,
homeStore,
communityStore,
};
export default store;

View File

@ -17,10 +17,8 @@ class UserConfig {
static getPatrol: string = "/v1/user/getPatrol"
static videoLogin: string = "api/v1/login"
static siteList: string = "/v1/user/site"
}
class UserStore extends BaseStore<UserDataType> {
_userinfo: UserInfos = {}; // 用户信息
userDetail = {}