first commit
This commit is contained in:
parent
31063a8407
commit
483bc1220b
|
@ -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;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -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: `系统管理`,
|
||||||
|
|
|
@ -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>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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: [],
|
||||||
|
},
|
||||||
|
];
|
|
@ -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));
|
|
@ -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>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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 />,
|
||||||
|
|
|
@ -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;
|
|
@ -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;
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue