first commit

This commit is contained in:
wang_yp 2025-02-25 00:33:41 +08:00
parent 31063a8407
commit 483bc1220b
11 changed files with 310 additions and 7 deletions

View File

@ -111,6 +111,7 @@ const SimpleForm = (props: SimpleFormData) => {
case FormType.select: case FormType.select:
return FormSelect(v); return FormSelect(v);
case FormType.upload: case FormType.upload:
console.log(form.getFieldValue(v.name))
return ( return (
<Form.Item <Form.Item
key={v.label} key={v.label}
@ -123,6 +124,7 @@ const SimpleForm = (props: SimpleFormData) => {
if (Array.isArray(e)) { if (Array.isArray(e)) {
return e; return e;
} }
console.log(e)
return e && e.fileList; return e && e.fileList;
}} }}
> >

View File

@ -74,6 +74,16 @@ export const items = [
{ label: "训练任务", key: "/admin/training" }, { label: "训练任务", key: "/admin/training" },
], ],
}, },
{
key: "/admin/kaoqin",
label: `考勤管理`,
children: [
{
key: "/admin/singin",
label: `签到管理`,
},
],
},
{ {
key: "/admin/sys", key: "/admin/sys",
label: `系统管理`, label: `系统管理`,

View File

@ -3,11 +3,14 @@ import { inject, observer } from "mobx-react";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Video from "./video"; import Video from "./video";
import "./video.less"; import "./video.less";
import { ZoomInOutlined } from "@ant-design/icons";
const HomeVideo = (props: Store) => { const HomeVideo = (props: Store) => {
const { homeStore } = props; const { homeStore } = props;
const [videoUrls, setVideoUrl] = useState<Array<string> | null>([]); const [videoUrls, setVideoUrl] = useState<Array<string> | null>([]);
const [showVideo, setShowVideo] = useState<boolean>(false); const [showVideo, setShowVideo] = useState<boolean>(false);
const [obj, setPbj] = useState<any>({
width: "300px",
});
useEffect(() => { useEffect(() => {
homeStore.getNewTask().then((res) => { homeStore.getNewTask().then((res) => {
setVideoUrl(res); setVideoUrl(res);
@ -15,9 +18,29 @@ const HomeVideo = (props: Store) => {
setShowVideo(homeStore.showVideo); setShowVideo(homeStore.showVideo);
}, [homeStore, homeStore.showVideo]); }, [homeStore, homeStore.showVideo]);
return ( return (
<> <div className="homeVideos">
<ZoomInOutlined
style={{
color: "#fff",
display: "block",
textAlign: "right",
zIndex: 999,
marginRight: "20px",
}}
onClick={() => {
if (obj.width === "300px") {
setPbj({
width: "0px",
});
} else {
setPbj({
width: "300px",
});
}
}}
/>
{showVideo ? ( {showVideo ? (
<div className="homeVideoBox" style={{width: "300px"}}> <div className="homeVideoBox" style={obj}>
{videoUrls?.map((videoUrl, index) => { {videoUrls?.map((videoUrl, index) => {
return ( return (
<div key={videoUrl} style={{ flex: "1", margin: "5px" }}> <div key={videoUrl} style={{ flex: "1", margin: "5px" }}>
@ -27,7 +50,7 @@ const HomeVideo = (props: Store) => {
})} })}
</div> </div>
) : null} ) : null}
</> </div>
); );
}; };

View File

@ -0,0 +1,68 @@
import { FormType } from "@/components/form/interface";
import { UserDataType } from "@/model/userModel";
import { ColumnsType } from "antd/lib/table";
import dayjs from "dayjs";
export const studyColumns: ColumnsType<UserDataType> = [
{
title: "姓名",
dataIndex: "user_name",
},
{
title: "身份证",
dataIndex: "id_card",
},
{
title: "联系电话",
dataIndex: "tel",
},
{
title: "签到时间",
dataIndex: "created_at",
render(leave_start_time) {
return dayjs(leave_start_time).format("YYYY-MM-DD HH:mm");
},
},
{
title: "签到地址",
dataIndex: "address",
},
// {
// title: "经度",
// dataIndex: "long",
// },
// {
// title: "纬度",
// dataIndex: "lat",
// },
];
export const serchConfig = [
{
type: FormType.input,
label: "用户名",
name: "user_name",
value: "",
rules: [],
},
{
type: FormType.input,
label: "身份证号",
name: "id_card",
value: "",
rules: [],
},
{
type: FormType.date,
label: "开始时间",
name: "start_time",
value: "",
rules: [],
},
{
type: FormType.date,
label: "结束时间",
name: "end_time",
value: "",
rules: [],
},
];

View File

@ -0,0 +1,82 @@
import { Button, FormInstance, Space } from "antd";
import { inject, observer } from "mobx-react";
import BTable from "@/components/b_table";
import { useEffect } from "react";
import { Store } from "antd/lib/form/interface";
import React from "react";
import { serchConfig, studyColumns } from "./column";
import SimpleForm from "@/components/form/simple_form";
const Signin = (props: Store) => {
const { signinStore } = props;
const serchFormRef = React.useRef<FormInstance>(null);
useEffect(() => {
signinStore.getSignList();
}, [signinStore]);
const onSerchFinish = (values: any) => {
let query = {
...values,
start_time: values.start_time?.format("YYYY-MM-DD HH:mm"),
end_time: values.end_time?.format("YYYY-MM-DD HH:mm"),
page: 1,
page_size: 10,
};
signinStore.getSignList(query);
};
const onFinishFailed = () => {};
return (
<div className="contentBox">
<Space direction="vertical" size="middle" style={{ display: "flex" }}>
<Space
direction="horizontal"
size={"middle"}
style={{ display: "flex", justifyContent: "space-between" }}
>
<SimpleForm
formRef={serchFormRef}
createCallback={() => {}}
formName="serch_basic"
colProps={30}
span={8}
layout="inline"
formDatas={serchConfig}
onFinish={onSerchFinish}
initialValues={true}
onFinishFailed={onFinishFailed}
>
<Space>
<Button
type="primary"
onClick={() => {
serchFormRef.current?.submit();
}}
>
</Button>
<Button
onClick={() => {
serchFormRef.current?.resetFields();
serchFormRef.current?.submit();
}}
>
</Button>
<Button onClick={() => {
signinStore.exports();
}}></Button>
</Space>
</SimpleForm>
</Space>
<BTable
store={signinStore}
columns={studyColumns}
dataSource={signinStore.signList}
/>
</Space>
</div>
);
};
export default inject("signinStore")(observer(Signin));

View File

@ -28,11 +28,13 @@ const User = (props: Store) => {
...record, ...record,
vet_in_time: dayjs(record.vet_in_time), vet_in_time: dayjs(record.vet_in_time),
vet_out_time: dayjs(record.vet_out_time), vet_out_time: dayjs(record.vet_out_time),
imageUrl: [{ url: record.imageUrl }],
team_link_user:record.team.map(item => item.team_identity), team_link_user:record.team.map(item => item.team_identity),
pers_link_user:record.pers.map(item=>item.pers_identity) pers_link_user:record.pers.map(item=>item.pers_identity),
head_img:[{ url: record.head_img }],
}; };
setProjectConfig(defaultConfig(team, per)); setProjectConfig(defaultConfig(team, per));
console.log(records)
setIsModalOpen(true); setIsModalOpen(true);
setRecord(records); setRecord(records);
setId(records.id); setId(records.id);
@ -164,6 +166,15 @@ const User = (props: Store) => {
> >
</Button> </Button>
<Button
type="dashed"
size="small"
onClick={() => {
usrStore.reSetPwd(record.identity);
}}
>
</Button>
</Space> </Space>
), ),
}, },

View File

@ -46,6 +46,40 @@ export const defaultConfig =(team,per)=>
value: 0, value: 0,
rules: [{ required: true, message: "请选择是否网格员" }], rules: [{ required: true, message: "请选择是否网格员" }],
}, },
{
type: FormType.radio,
label: "是否微网格员",
name: "grid_letter_user",
radioData: [
{
key: "是",
val: 1,
},
{
key: "否",
val: 2,
},
],
value: 0,
rules: [],
},
{
type: FormType.radio,
label: "是否两委人员",
name: "two_committees",
radioData: [
{
key: "是",
val: 1,
},
{
key: "否",
val: 2,
},
],
value: 0,
rules: [],
},
{ {
type: FormType.radio, type: FormType.radio,
label: "是否为巡防大队", label: "是否为巡防大队",
@ -309,6 +343,18 @@ export const columns: ColumnsType<UserDataType> = [
dataIndex: "vet", dataIndex: "vet",
render: (vet) => <span>{vet === 1 ? "是" : "否"}</span>, render: (vet) => <span>{vet === 1 ? "是" : "否"}</span>,
}, },
{
title: "是否两委人员",
dataIndex: "two_committees",
width: 150,
render: (vet) => <span>{vet === 1 ? "是" : "否"}</span>,
},
{
title: "是否微网格员",
dataIndex: "grid_letter_user",
width: 150,
render: (vet) => <span>{vet === 1 ? "是" : "否"}</span>,
},
{ {
title: "备注", title: "备注",
width: 150, width: 150,

View File

@ -27,6 +27,7 @@ import Grid from "@/pages/grid";
import Community from "@/pages/community"; import Community from "@/pages/community";
import PatrolBrigade from "@/pages/patrolBrigade"; import PatrolBrigade from "@/pages/patrolBrigade";
import ExceCompet from "@/pages/exce_compet"; import ExceCompet from "@/pages/exce_compet";
import Signin from "@/pages/signin";
export const homeRouter = [ export const homeRouter = [
{ {
path: "/", path: "/",
@ -166,6 +167,10 @@ export const homeRouter = [
}, },
], ],
}, },
{
path: "/admin/singin",
element: <Signin />,
},
{ {
path: "/admin/sys", path: "/admin/sys",
element: <WhseMgmtRoute />, element: <WhseMgmtRoute />,

View File

@ -26,6 +26,8 @@ import { communityStore } from './community';
import { gridStore } from './grid'; import { gridStore } from './grid';
import { patrolBrigadeStore } from './patrol_brigade'; import { patrolBrigadeStore } from './patrol_brigade';
import { exceCompetStore } from './exce_compet'; import { exceCompetStore } from './exce_compet';
import signinStore from './singin';
@ -57,7 +59,8 @@ const store = {
gridStore, gridStore,
communityStore, communityStore,
patrolBrigadeStore, patrolBrigadeStore,
exceCompetStore exceCompetStore,
signinStore
}; };
export default store; export default store;

46
src/store/singin.ts Normal file
View File

@ -0,0 +1,46 @@
import { action, makeObservable, observable } from "mobx";
// 用户信息
import BaseStore from "./baseStore";
import { TagDataType } from "@/model/userModel";
import baseHttp from '@/service/base';
class SigninConfig {
static LISTs: string = "/v1/user/signin"
static Export: string = "/v1/user/signin/export"
}
class SigninStore extends BaseStore<TagDataType> {
signList = []
constructor() {
super(SigninConfig)
makeObservable(this, {
signList: observable,
getSignList: action,
})
}
async getSignList(query) {
let list =await baseHttp.get(SigninConfig.LISTs, {
size: query?.Size ?? 20,
offset: query?.Offset ?? 1,
user_name: query?.user_name,
id_card: query?.id_card ?? '',
start_time: query?.start_time ,
end_time: query?.end_time ,
})
this.signList = list?.data.record;
}
async exports(query) {
await baseHttp.get(SigninConfig.Export, {
size: query?.Size ?? 20,
offset: query?.Offset ?? 1,
user_name: query?.user_name,
id_card: query?.id_card ?? '',
start_time: query?.start_time ,
end_time: query?.end_time ,
})
}
}
export const signinStore = new SigninStore();
export default signinStore;

View File

@ -18,6 +18,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"
static reSetPwd: string = "/v1/user/reSetPwd"
@ -68,6 +70,11 @@ class UserStore extends BaseStore<UserDataType> {
return await baseHttp.put(UserConfig.siteList + "/" + id.id, id) return await baseHttp.put(UserConfig.siteList + "/" + id.id, id)
} }
async reSetPwd(id) {
await baseHttp.put(UserConfig.reSetPwd+"/"+id,{})
message.success("密码重置成功")
}
get userInfo(): UserInfos { get userInfo(): UserInfos {