From 8ee12c8b868608f704f1d431b35b37836c8ebad5 Mon Sep 17 00:00:00 2001 From: xialiang <1818147@qq.com> Date: Mon, 21 Feb 2022 10:44:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/pages/dashboard/workplace/index.tsx | 36 ++++++++++++-------- web/src/pages/dashboard/workplace/service.ts | 28 +++++++++++++++ 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/web/src/pages/dashboard/workplace/index.tsx b/web/src/pages/dashboard/workplace/index.tsx index a3175a8..a391cd3 100644 --- a/web/src/pages/dashboard/workplace/index.tsx +++ b/web/src/pages/dashboard/workplace/index.tsx @@ -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 ? : + return record?.status === 0 ? : }, }, ]; @@ -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 ( <> @@ -159,18 +167,18 @@ const Workplace: FC = () => { >
- +
-
- + { legend={{ position: 'top-center', }} - point={{size:5}} + point={{ size: 5 }} />
@@ -207,7 +215,7 @@ const Workplace: FC = () => { bodyStyle={{ padding: 0 }} >
- + { loading={data?.radarData?.length === 0} >
-
+
- + diff --git a/web/src/pages/dashboard/workplace/service.ts b/web/src/pages/dashboard/workplace/service.ts index dd4cc47..3d35af5 100644 --- a/web/src/pages/dashboard/workplace/service.ts +++ b/web/src/pages/dashboard/workplace/service.ts @@ -1,6 +1,34 @@ import { request } from 'umi'; import type { NoticeType, ActivitiesType, AnalysisData } from './data'; + +/** + * 【6.5】(教师首页)当前学习主题课程信息 + * /dsideal_yy/ypt/careerTraining/report/personLastLearning + * @param params + * @returns + */ +export async function personLastLearning(params: { + page_size: number; + //count: number; +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request('/dsideal_yy/ypt/careerTraining/report/personLastLearning', { + params, + }); +} + + + + + + + + + + + + + export async function queryProjectNotice(): Promise<{ data: NoticeType[] }> { return request('/api/project/notice'); }