diff --git a/web/config/config.ts b/web/config/config.ts
index fb81209..845566b 100644
--- a/web/config/config.ts
+++ b/web/config/config.ts
@@ -80,7 +80,7 @@ export default defineConfig({
{
name: '报名',
icon: 'smile',
- path: '/registration',
+ path: '/registration/:examination_id',
component: './registration',
},
{
@@ -127,8 +127,23 @@ export default defineConfig({
{
name: '模拟考试',
icon: 'dashboard',
- path: '/test',
- component: './test',
+ path: '/RulesList',
+ routes: [
+ {
+ name: '考试概况(暂时废弃)',
+ icon: 'smile',
+ path: '/examination/intro',
+ component: './examination/intro',
+ hideInMenu: true,
+ },
+ {
+ name: '考试信息',
+ icon: 'smile',
+ path: '/examination/info/:examination_id',
+ component: './examination/info',
+ hideInMenu: true,
+ },
+ ]
},
{
path: '/examination',
@@ -142,6 +157,13 @@ export default defineConfig({
component: './examination/intro',
hideInMenu: true,
},
+ {
+ name: '考试信息',
+ icon: 'smile',
+ path: '/examination/info/:examination_id',
+ component: './examination/info',
+ hideInMenu: true,
+ },
{
name: '考试试卷',
icon: 'smile',
diff --git a/web/src/pages/dashboard/workplace/index.tsx b/web/src/pages/dashboard/workplace/index.tsx
index a3175a8..3606ca5 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 { useEffect } 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, personLearningDayStatistics, getPersonExaminationList, getExaminationList } from './service';
+import cookie from 'react-cookies';
import OfflineData from './components/OfflineData';
+
const examinations = [
{
key: '1',
@@ -53,25 +55,51 @@ const examinations = [
const examinationColumns = [
{
title: '考试项目',
- dataIndex: 'name',
+ dataIndex: 'examination_name',
key: 'name',
},
{
title: '报名时间',
dataIndex: 'appyTime',
key: 'appyTime',
+ render: (dom, entity) => {
+ return
开始时间:{entity.apply_start_time}
结束时间:{entity.apply_end_time}
+
+ },
},
{
title: '考试时间',
dataIndex: 'examTime',
key: 'examTime',
+ render: (dom, entity) => {
+ return 开始时间:{entity.examination_start_time}
结束时间:{entity.examination_end_time}
+ },
},
{
- title: '',
+ title: '操作',
dataIndex: 'option',
key: 'option',
render: (_, record, index, action) => {
- return record?.status === 0 ? :
+ // return record?.status === 0 ? :
+ switch (record.status_type) {
+ case 0:
+ return "待报名"
+ break;
+ case 1:
+ return "报名中"
+ break;
+ case 2:
+ return "待考试"
+ break;
+ case 3:
+ return
+ break;
+ case 4:
+ return "考试完成"
+ break;
+ default:
+ break;
+ }
},
},
];
@@ -80,23 +108,33 @@ const examinationColumns = [
const certificateColumns = [
{
title: '考试项目',
- dataIndex: 'name',
+ dataIndex: 'examination_name',
key: 'name',
},
{
title: '考试时间',
dataIndex: 'examTime',
key: 'examTime',
+ render: (dom, entity) => {
+ return 开始时间:{entity.examination_start_time}
结束时间:{entity.examination_end_time}
+
+ },
},
{
title: '通过情况',
- dataIndex: 'statusExam',
+ dataIndex: 'is_pass',
key: 'statusExam',
+ render: (dom, entity) => {
+ return entity.is_pass = 1 ? "已通过" : "未通过"
+ }
},
{
title: '证书情况',
- dataIndex: 'statusCertificate',
+ dataIndex: 'accreditation_status',
key: 'statusCertificate',
+ render: (dom, entity) => {
+ return entity.is_pass = 1 ? "已制证" : "未制证"
+ }
},
];
@@ -139,46 +177,87 @@ const certificates = [
];
const Workplace: FC = () => {
- const { loading: activitiesLoading, data: activities = [] } = useRequest(queryActivities);
- const { loading: offlineChartLoading, data: offlineChartData = [] } = useRequest(fakeChartData);
-
- const { data } = useRequest(fakeChartData); // 证书
+ // 当前学习
+ const { loading: lastLearningLoading, data: lastLearningList = [] } = useRequest(
+ () => personLastLearning(
+ {
+ identity_id: cookie.load('identity_id'),
+ person_id: cookie.load('person_id')
+ }));
+
+ // 资质考试列表
+ const { loading: lastexaminationLoading, data: examinationList } = useRequest(
+ () => getExaminationList(
+ {
+ person_id: cookie.load('person_id')
+ }), {
+ formatResult: (result) => {
+ return result.table_List;
+ }
+ });
+
+ // 学习概况
+ const { loading: activitiesLoading, data: learningDayStatistics = [] } = useRequest(
+ () => personLearningDayStatistics(
+ {
+ identity_id: cookie.load('identity_id'),
+ person_id: cookie.load('person_id')
+ }));
+
+
+ // 证书查询
+ const { loading: personExaminationLoading, data: personExaminationList = [] } = useRequest(
+ () => getPersonExaminationList(
+ {
+ identity_id: cookie.load('identity_id'),
+ person_id: cookie.load('person_id')
+ }), {
+ formatResult: (result) => {
+ return result.table_List;
+ }
+ });
+
+
+
+
+ useEffect(() => {
+ console.log('lastLearningList', personExaminationList)
+
+ })
return (
<>
-
+
-
-
+
@@ -188,37 +267,37 @@ const Workplace: FC = () => {
className={styles.studyCard}
title="当前学习"
loading={activitiesLoading}
- cover={
}
+ cover={
}
>
-
- 盖笑松
- 生涯决策
- 1234123421
- 40分钟
+
+ {lastLearningList?.lecture_teacher}
+ {lastLearningList?.chapter_name}
+ {lastLearningList?.subject_name}
+ {lastLearningList?.total_course_minutes}分钟
-
+
-
+
-
-
+
+
-
+
>
diff --git a/web/src/pages/dashboard/workplace/service.ts b/web/src/pages/dashboard/workplace/service.ts
index dd4cc47..e1d98c9 100644
--- a/web/src/pages/dashboard/workplace/service.ts
+++ b/web/src/pages/dashboard/workplace/service.ts
@@ -1,6 +1,76 @@
import { request } from 'umi';
import type { NoticeType, ActivitiesType, AnalysisData } from './data';
+/**
+ * 【6.4】(教师首页)每日学习时长统计
+ * /dsideal_yy/ypt/careerTraining/report/personLearningDayStatistics
+ * @param params
+ * @returns
+ */
+export async function personLearningDayStatistics(params: {
+ page_size: number;
+ //count: number;
+}): Promise<{ data: { list: CardListItemDataType[] } }> {
+ return request('/dsideal_yy/ypt/careerTraining/report/personLearningDayStatistics', {
+ params,
+ });
+}
+/**
+ * 【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,
+ });
+}
+/**
+ * 01 获取教师端考试列表
+ * /dsideal_yy/zygh/training/examination/getExaminationList
+ * @param params
+ * @returns
+ */
+export async function getExaminationList(params: {
+ page_size: number;
+ //count: number;
+}): Promise<{ data: { list: CardListItemDataType[] } }> {
+ return request(' /dsideal_yy/zygh/training/examination/getExaminationList', {
+ params,
+ });
+}
+
+
+/**
+ * 01 获取教师端考试列表
+ * /dsideal_yy/zygh/training/examination/getPersonExaminationList
+ * @param params
+ * @returns
+ */
+export async function getPersonExaminationList(params: {
+ page_size: number;
+ //count: number;
+}): Promise<{ data: { list: CardListItemDataType[] } }> {
+ return request(' /dsideal_yy/zygh/training/examination/getPersonExaminationList', {
+ params,
+ });
+}
+
+
+
+
+
+
+
+
+
+
+
+
export async function queryProjectNotice(): Promise<{ data: NoticeType[] }> {
return request('/api/project/notice');
}
diff --git a/web/src/pages/examination/info.tsx b/web/src/pages/examination/info.tsx
new file mode 100644
index 0000000..ce44c95
--- /dev/null
+++ b/web/src/pages/examination/info.tsx
@@ -0,0 +1,154 @@
+import { PlusOutlined } from '@ant-design/icons';
+import { Button, Card, Descriptions, Alert, Typography } from 'antd';
+import { PageContainer } from '@ant-design/pro-layout';
+import { useRequest, useParams } from 'umi';
+import { getExaminationById, getRulesById } from './service';
+import type { CardListItemDataType } from './data.d';
+import styles from './style.less';
+import { useEffect, useRef } from 'react';
+import type { ProDescriptionsActionType } from '@ant-design/pro-descriptions';
+import ProDescriptions from '@ant-design/pro-descriptions';
+const { Paragraph } = Typography;
+import ProCard from '@ant-design/pro-card';
+
+
+
+
+
+const CardList = () => {
+ const params = useParams();
+
+
+ // 获取考试详情
+ // const { loading: personExaminationLoading, data: examinationInfo = [] } = useRequest(
+ // () => getExaminationById(
+ // {
+ // examination_id: params.examination_id
+ // }), {
+ // formatResult: (result) => {
+ // return result.bean;
+ // }
+ // });
+
+ // useEffect(() => {
+ // console.log('examinationInfo', examinationInfo)
+
+ // })
+
+
+
+ const actionRef = useRef();
+
+
+
+
+ return (
+
+
+ {
+ const examinationInfo = await getExaminationById({ examination_id: params.examination_id })
+
+ const rulesInfo = await getRulesById({ id: examinationInfo.bean.rules_id })
+
+ const exData = { data: { ...examinationInfo.bean, ...rulesInfo.bean } }
+ console.log("exData", exData);
+
+ return exData;
+ }}
+ layout='horizontal'
+ columns={[
+ {
+ title: '考试项目',
+ key: 'text',
+ dataIndex: 'examination_name',
+ },
+
+ {
+ title: '考试时间',
+ key: 'state2',
+ render: (dom, entity, index, action) => {
+ return entity.examination_start_time + " - " + entity.examination_end_time
+ },
+ },
+ {
+ title: '考试时长',
+ key: 'examination_time',
+ dataIndex: 'examination_time',
+ valueType: 'text',
+ render: (dom, entity, index, action) => {
+ // return entity.examination_start_time + " - " + entity.examination_start_time
+ const d1 = new Date(entity.examination_start_time);
+ const d2 = new Date(entity.examination_end_time);
+ const examination_time = parseInt((d2 - d1) / 1000 / 60)
+ return examination_time + "分钟"
+ },
+ },
+ {
+ title: '满分',
+ key: 'sum_score',
+ dataIndex: 'sum_score',
+ valueType: 'text',
+
+ },
+ {
+ title: '通过标准',
+ key: 'pass_score',
+ dataIndex: 'pass_score',
+ valueType: 'text',
+ },
+
+ {
+ title: '操作',
+ valueType: 'option',
+ render: () => [
+
+ 链路
+ ,
+
+ 报警
+ ,
+
+ 查看
+ ,
+ ],
+ },
+ ]}
+ column={1}
+ >
+
+
+
+
+
+
+
+ {/*
+
+ {this.data.id}
+
+
+
+
+
+
+
+ */}
+
+
+
+
+ );
+};
+
+export default CardList;
diff --git a/web/src/pages/examination/service.ts b/web/src/pages/examination/service.ts
index fee9a31..67933d4 100644
--- a/web/src/pages/examination/service.ts
+++ b/web/src/pages/examination/service.ts
@@ -1,10 +1,31 @@
import { request } from 'umi';
import type { CardListItemDataType } from './data.d';
-export async function queryFakeList(params: {
- count: number;
+/**
+ * 获取考试详情
+ * /dsideal_yy/zygh/training/examination/getExaminationById
+ * @param params
+ * @returns
+ */
+export async function getExaminationById(params: {
+ page_size: number;
+ //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> {
- return request('/api/card_fake_list', {
+ return request('/dsideal_yy/zygh/training/examination/getExaminationById', {
params,
});
}
+/**
+ * 获取考试规则详情
+ * /dsideal_yy/zygh/training/rules/getRulesById
+ * @param params
+ * @returns
+ */
+export async function getRulesById(params: {
+ page_size: number;
+ //count: number;
+}): Promise<{ data: { list: CardListItemDataType[] } }> {
+ return request('/dsideal_yy/zygh/training/rules/getRulesById', {
+ params,
+ });
+}
\ No newline at end of file