|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import { FC, Suspense } from 'react';
|
|
|
|
|
import type { FC } from 'react';
|
|
|
|
|
import { Suspense } from 'react';
|
|
|
|
|
import { Avatar, Card, Col, List, Skeleton, Row, Statistic, Descriptions, Progress, Table, Button } from 'antd';
|
|
|
|
|
import { Line, Radar } from '@ant-design/charts';
|
|
|
|
|
import { Link, history, useRequest } from 'umi';
|
|
|
|
@ -7,10 +8,11 @@ import moment from 'moment';
|
|
|
|
|
import EditableLinkGroup from './components/EditableLinkGroup';
|
|
|
|
|
import styles from './style.less';
|
|
|
|
|
import type { ActivitiesType, CurrentUser } from './data.d';
|
|
|
|
|
import { queryProjectNotice, queryActivities, fakeChartData } from './service';
|
|
|
|
|
import dataSource from 'mock/dataSource';
|
|
|
|
|
import { personLastLearning, queryActivities, fakeChartData } from './service';
|
|
|
|
|
import cookie from 'react-cookies';
|
|
|
|
|
import OfflineData from './components/OfflineData';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const examinations = [
|
|
|
|
|
{
|
|
|
|
|
key: '1',
|
|
|
|
@ -71,7 +73,7 @@ const examinationColumns = [
|
|
|
|
|
dataIndex: 'option',
|
|
|
|
|
key: 'option',
|
|
|
|
|
render: (_, record, index, action) => {
|
|
|
|
|
return record?.status === 0 ? <Button type="primary" onClick={()=>{ history.push('/registration')}} style={{minWidth:88}}>去报名</Button> : <Button type="primary" onClick={()=>{ history.push('/examination/paper')}} style={{minWidth:88}}>参加考试</Button>
|
|
|
|
|
return record?.status === 0 ? <Button type="primary" onClick={() => { history.push('/registration') }} style={{ minWidth: 88 }}>去报名</Button> : <Button type="primary" onClick={() => { history.push('/examination/paper') }} style={{ minWidth: 88 }}>参加考试</Button>
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
@ -139,11 +141,17 @@ const certificates = [
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const Workplace: FC = () => {
|
|
|
|
|
// const { loading: lastLearningLoading, data: lastLearningList = [] } = useRequest(
|
|
|
|
|
// personLastLearning(
|
|
|
|
|
// {
|
|
|
|
|
// identity_id: cookie.load('identity_id'),
|
|
|
|
|
// person_id: cookie.load('person_id')
|
|
|
|
|
// }));
|
|
|
|
|
const { loading: activitiesLoading, data: activities = [] } = useRequest(queryActivities);
|
|
|
|
|
const { loading: offlineChartLoading, data: offlineChartData = [] } = useRequest(fakeChartData);
|
|
|
|
|
|
|
|
|
|
const { data } = useRequest(fakeChartData); // 证书
|
|
|
|
|
|
|
|
|
|
const { data } = useRequest(fakeChartData); // 证书
|
|
|
|
|
console.log('lastLearningList', lastLearningList)
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Row gutter={24}>
|
|
|
|
@ -159,18 +167,18 @@ const Workplace: FC = () => {
|
|
|
|
|
>
|
|
|
|
|
<div className={styles.extraContent}>
|
|
|
|
|
<div className={styles.statItem}>
|
|
|
|
|
<Statistic title="今日学习" value={56} suffix=" 分钟"/>
|
|
|
|
|
<Statistic title="今日学习" value={56} suffix=" 分钟" />
|
|
|
|
|
</div>
|
|
|
|
|
<div className={styles.statItem}>
|
|
|
|
|
<Statistic title="累计登录天数" value={8} suffix=" 天" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ width:'100%',padding:24}}>
|
|
|
|
|
<Line
|
|
|
|
|
<div style={{ width: '100%', padding: 24 }}>
|
|
|
|
|
<Line
|
|
|
|
|
color={'#1859ff'}
|
|
|
|
|
forceFit
|
|
|
|
|
height={400}
|
|
|
|
|
data={[{date:'2022/10/20', value:50},{date:'2022/10/21', value:300},{date:'2022/10/22', value:480},{date:'2022/10/23', value:210},{date:'2022/10/24', value:250},{date:'2022/10/25', value:240}]}
|
|
|
|
|
data={[{ date: '2022/10/20', value: 50 }, { date: '2022/10/21', value: 300 }, { date: '2022/10/22', value: 480 }, { date: '2022/10/23', value: 210 }, { date: '2022/10/24', value: 250 }, { date: '2022/10/25', value: 240 }]}
|
|
|
|
|
//responsive
|
|
|
|
|
xField="date"
|
|
|
|
|
yField="value"
|
|
|
|
@ -178,7 +186,7 @@ const Workplace: FC = () => {
|
|
|
|
|
legend={{
|
|
|
|
|
position: 'top-center',
|
|
|
|
|
}}
|
|
|
|
|
point={{size:5}}
|
|
|
|
|
point={{ size: 5 }}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
@ -207,7 +215,7 @@ const Workplace: FC = () => {
|
|
|
|
|
bodyStyle={{ padding: 0 }}
|
|
|
|
|
>
|
|
|
|
|
<div className={styles.chart}><Table dataSource={examinations} columns={examinationColumns} pagination={false} /></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</Card>
|
|
|
|
|
<Card
|
|
|
|
|
style={{ marginBottom: 24 }}
|
|
|
|
@ -216,9 +224,9 @@ const Workplace: FC = () => {
|
|
|
|
|
loading={data?.radarData?.length === 0}
|
|
|
|
|
>
|
|
|
|
|
<div className={styles.chart}>
|
|
|
|
|
<Table dataSource={certificates} columns={certificateColumns} pagination={false} />
|
|
|
|
|
<Table dataSource={certificates} columns={certificateColumns} pagination={false} />
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
</Card>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</>
|
|
|
|
|