From 903f892d7b5c0eb41171dff07d5d386bdfc953e6 Mon Sep 17 00:00:00 2001 From: wangxi <123456> Date: Thu, 3 Mar 2022 17:00:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E8=80=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/config/config.ts | 75 ++- .../dashboard/qualification/examAnser.ts | 126 +++++ .../dashboard/qualification/examAnswer.tsx | 520 ++++++++++++++++++ .../pages/dashboard/qualification/index.less | 39 ++ .../pages/dashboard/qualification/index.tsx | 97 ++++ .../pages/dashboard/qualification/result.tsx | 92 ++++ .../pages/dashboard/qualification/service.ts | 36 ++ .../pages/dashboard/qualification/style.less | 153 ++++++ .../dashboard/qualification/utils/utils.less | 50 ++ web/src/pages/dashboard/workplace/index.tsx | 2 +- web/src/pages/registration/service.ts | 2 +- 11 files changed, 1163 insertions(+), 29 deletions(-) create mode 100644 web/src/pages/dashboard/qualification/examAnser.ts create mode 100644 web/src/pages/dashboard/qualification/examAnswer.tsx create mode 100644 web/src/pages/dashboard/qualification/index.less create mode 100644 web/src/pages/dashboard/qualification/index.tsx create mode 100644 web/src/pages/dashboard/qualification/result.tsx create mode 100644 web/src/pages/dashboard/qualification/service.ts create mode 100644 web/src/pages/dashboard/qualification/style.less create mode 100644 web/src/pages/dashboard/qualification/utils/utils.less diff --git a/web/config/config.ts b/web/config/config.ts index 2e78b03..286d864 100644 --- a/web/config/config.ts +++ b/web/config/config.ts @@ -72,6 +72,27 @@ export default defineConfig({ path: '/dashboard/workplace', component: './dashboard/workplace', }, + { + name: '考试首页', + icon: 'dashboard', + path: '/dashboard/qualification/:examination_id', + component: './dashboard/qualification', + hideInMenu: true, + }, + { + name: '资质考试答题', + icon: 'dashboard', + path: '/dashboard/qualification/examAnswer/:examination_id/:examination_name', + component: './dashboard/qualification/examAnswer', + hideInMenu: true, + }, + { + name: '资质考试結果頁面', + icon: 'dashboard', + path: '/dashboard/qualification/result/:pass_score/:score/:sum_score/:examination_id/:examination_name', + component: './dashboard/qualification/result', + hideInMenu: true, + }, { name: '考试报名', icon: 'dashboard', @@ -164,33 +185,33 @@ export default defineConfig({ }, ] }, - { - path: '/examination', - icon: 'table', - name: '资质考试', - 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, - }, - { - name: '考试试卷', - icon: 'smile', - path: '/examination/paper', - component: './examination/paper', - }, - ], - }, + // { + // path: '/examination', + // icon: 'table', + // name: '资质考试', + // 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, + // }, + // { + // name: '考试试卷', + // icon: 'smile', + // path: '/examination/paper', + // component: './examination/paper', + // }, + // ], + // }, { name: '个人中心', icon: 'dashboard', diff --git a/web/src/pages/dashboard/qualification/examAnser.ts b/web/src/pages/dashboard/qualification/examAnser.ts new file mode 100644 index 0000000..6aee046 --- /dev/null +++ b/web/src/pages/dashboard/qualification/examAnser.ts @@ -0,0 +1,126 @@ +import { request } from 'umi'; +import type { CardListItemDataType } from './data.d'; + +/** + * 【6.5】(教师首页)当前学习主题课程信息 + * /dsideal_yy/ypt/careerTraining/learning/listMyLearningSubject + * @param params + * @returns + */ +export async function listMyLearningSubject(params: { + page_size: number; + //count: number; +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request('/dsideal_yy/ypt/careerTraining/learning/listMyLearningSubject', { + params, + }); +} +/** + * 【6.5】(教师首页)当前学习主题课程信息 + * /dsideal_yy/ypt/careerTraining/learning/listMyLearningSubject + * @param params + * @returns + */ +export async function getRulesList(params: { + page_size: number; + //count: number; +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request('/dsideal_yy/zygh/training/rules/getRulesList', { + params, + }); +} +/** + * 05 组卷详情查询 + * /dsideal_yy/zygh/training/rules/getRulesPaper + * @param params + * @returns + */ +export async function getRulesPaper(params: { + page_size: number; + //count: number; +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request('/dsideal_yy/zygh/training/rules/getRulesPaper', { + params, + }); +} +/** + * 14 保存考试结果,返回当前得分 + * /dsideal_yy/zygh/training/person/finishExamination + * @param params + * @returns + */ + +export async function finishExamination( + params: ParamsType, +): Promise<{ data: { list: BasicListItemDataType[] } }> { + return request('/dsideal_yy/zygh/training/person/finishExamination', { + method: 'POST', + requestType: 'form', + data: { + ...params, + }, + }); +} + + + + + + +/** + * 06 获取试卷内容 + * /dsideal_yy/zygh/training/rules/getPaperQuestionList + * @param params + * @returns + */ +export async function getPaperQuestionList(params: { + page_size: number; + //count: number; +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request('/dsideal_yy/zygh/training/rules/getPaperQuestionList', { + params, + }); +} + +export async function viewMyLearningSubject(params: { + identity_id: number; + person_id: number; + data_id: number; + data_type: number; + subject_id: number +}) { + return request(' /dsideal_yy/ypt/careerTraining/learning/viewMyLearningSubject', { + params, + }); +} + +export async function listMyLearningChapterCourse(params: { + chapter_id: number; + identity_id: number; + person_id: number; + subject_id: number +}) { + return request(' /dsideal_yy/ypt/careerTraining/learning/listMyLearningChapterCourse', { + params, + }); +} + +export async function getCourseExaminationProgressList(params: { + chapter_id: number; + identity_id: number; + person_id: number; + subject_id: number +}) { + return request('/dsideal_yy/zygh/training/mock/getCourseExaminationProgressList', { + params, + }); +} + +//13 开始考试前获取试卷id +export async function getPersonPaperId(params: { + +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request(' /dsideal_yy/zygh/training/person/getPersonPaperId', { + params, + }); +} diff --git a/web/src/pages/dashboard/qualification/examAnswer.tsx b/web/src/pages/dashboard/qualification/examAnswer.tsx new file mode 100644 index 0000000..0c41c9a --- /dev/null +++ b/web/src/pages/dashboard/qualification/examAnswer.tsx @@ -0,0 +1,520 @@ +/** 资质考试 */ +import { AlignLeftOutlined, PlusOutlined } from '@ant-design/icons'; +import { Switch, Button, Card, Col, List, Menu, Progress, Row, Typography, Space, Divider, Radio, Checkbox, Form } from 'antd'; +import { PageContainer } from '@ant-design/pro-layout'; +import { useParams, useRequest,history } from 'umi'; +import { useEffect, useRef, useState } from 'react'; +const { Text, Link } = Typography; +import { getRulesPaper, getPaperQuestionList, finishExamination,getPersonPaperId } from './examAnser'; +import type { CardListItemDataType } from '../data'; +import styles from './style.less'; +import cookie from 'react-cookies'; + +import ProCard from '@ant-design/pro-card'; +const CheckboxGroup = Checkbox.Group; + +const { Paragraph } = Typography; + +const CardList = () => { + const formRef = useRef(); + + // 组卷详情查询 + const [rulesPaperInfo, setRulesPaperInfo] = useState([]); + //规则 + const [ruleId, setRuleId] = useState([]); + // 试题列表 + const [paperInfo, setPaperInfo] = useState([]); + //答题卡列表 + const [questionTypeList, setQuestionTypeList] = useState([]) + // 当前答题id + const [questionNow, setQuestionNow] = useState({}) + // 解析可见 + const [parsingShow, setParsingShow] = useState(false) + + + const [lastBtnShow, setLastBtnShow] = useState(true) + const [nextBtnShow, setNextBtnShow] = useState(false) + + // 当前题号 + const [questionNowNum, setQuestionNowNum] = useState(0) + const [questionNum, setQuestioNum] = useState(0) + + + + + + const params = useParams(); + const { loading, data } = useRequest(() => { + return getPersonPaperId({ + examination_id: params.examination_id, + person_id:cookie.load('person_id') + }); + }, + { + formatResult: (result) => { + return result; + }, + onSuccess: (result) => { + if (result.success) { + setRulesPaperInfo(result.paper_id) + run({ paper_id: result.paper_id }) + // setQuestionTypeList(result.question_list[0].question_type_count) + } + } + }); + + const { run } = useRequest(getPaperQuestionList, + { + refreshDeps: [rulesPaperInfo], + manual: true, + formatResult: (result) => { + return result; + }, + onSuccess: (result, params) => { + // setRulesPaperInfo(result || []) + if (result.success) { + // 试题列表 + + const paperList = result.question_list; + let arr=[[],[],[]]; + let question_type_count=[ + {count:0,question_type:0,type_name:'单选'}, + {count:0,question_type:1,type_name:'多选'}, + {count:0,question_type:2,type_name:'填空'}, + ]; + if(result.question_list.length!==0){ + setRuleId(result.question_list[0].rules_id) + result.question_list.forEach((item)=>{ + if(item.question_type===0){ + arr[0].push(item) + }else if(item.question_type===1){ + arr[1].push(item) + }else { + arr[2].push(item) + } + }) + } + question_type_count[0].count=arr[0].length; + question_type_count[1].count=arr[1].length; + question_type_count[2].count=arr[2].length; + + const qList = question_type_count + const questionList: any[] = [] + qList.map((e, i) => { + if (e.count > 0) { + questionList.push({ + children: [], + ...e + }) + } + }) + + + // 根据分类拆分试题 左侧答题卡 state:0 未答题 1 : 已答题 + paperList.map((e) => { + questionList.map((item, index) => { + if (item.question_type == e.question_type) { + questionList[index].children.push({ ...e, question_type: item.question_type, answerSelect: "", state: 0, answerId: "" }) + } + }) + }) + + // 根据答题卡生成考试顺序 + const questionInfo = [] + for (let i = 0; i < questionList.length; i++) { + questionList[i].children.map((e, index) => { + questionInfo.push({ ...e, index: index }) + }) + } + + + setPaperInfo(questionInfo || []) + setQuestionNow(questionInfo[0] || []) + setQuestionTypeList(questionList || []) + + setQuestioNum(questionInfo.length) + } + } + }); + + + + const { run: runFinishExamination } = useRequest(finishExamination, + { + refreshDeps: [rulesPaperInfo], + manual: true, + formatResult: (result) => { + return result; + }, + onSuccess: (result, params) => { + if(result.success){ + history.push(`/dashboard/qualification/result/${result.data.pass_score}/${result.data.score}/${result.data.sum_score}/${params.examination_id}/${params.examination_name}`); + } + } + }); + + + + + + useEffect(() => { + // 已选择题目回显 + formRef?.current?.setFieldsValue({ note: questionNow.answerId }); + + paperInfo.map((item, index) => { + if (item.id === questionNow.id) { + setQuestionNowNum(index + 1) + } + }) + }, [questionNow]); + + useEffect(() => { + setLastBtnShow(questionNowNum == 1 ? true : false) + setNextBtnShow(questionNowNum == questionNum ? true : false) + }, [questionNowNum]) + + const content = ( +
+

+ {/* 试卷信息:{rulesPaperInfo?.question_list[0].rules_name} */} +

+
+ ); + + + // console.log(rulesPaperInfo, 'rulesPaperInfo', questionList) + + const numbers = []; + for (let i = 0; i < 50; i++) { + numbers.push({ id: `${i}` }) + } + const tiNum = (a: number) => { + switch (a) { + case 0: + return "A:" + break; + case 1: + return "B:" + break; + case 2: + return "C:" + break; + case 3: + return "D:" + break; + case 4: + return "E:" + break; + case 5: + return "F:" + break; + case 6: + return "G:" + break; + case 7: + return "H:" + break; + case 8: + return "I:" + break; + case 9: + return "J:" + break; + default: + return "" + break; + } + + } + return ( + + + + + { + + questionTypeList && ( + + questionTypeList.map((e, i) => { + + return { + // console.log(item, 'list') + return + }} + style={{ background: '#ffffff', margin: '-25px -24px 24px -24px' }} + /> + } + ) + + + )} + + + + + + + {questionNow?.question_stem} + {/* {console.log(questionNow.answerId, 'answerId', questionNow.answerId)} */} + + +
+ + + {questionNow.question_type === 0 ? + + ( + + + {questionNow?.answers?.map((item, index) => { + + return { + const qArr = [] + // 默认输出答案0,0,0,0 + questionNow?.answers?.map(() => { + qArr.push("0") + + }) + // 修改用户答案 + qArr[index] = item.is_true + + const questionList = questionTypeList + const questionAnswer = qArr.join(",") + // 修改答题卡状态 写入答案以及修改答题状态 + const qX = questionNow?.question_type; + const qI = questionNow?.index; + questionList[qX].children[qI].answerSelect = questionAnswer; + // 答题状态 + questionList[qX].children[qI].state = 1 + questionList[qX].children[qI].answerId = item.id + // 提交答题卡 + setQuestionTypeList(questionList) + + // console.log('0', questionList, questionNow, item, qX, qI) + }} + value={item.id} + style={{ padding: 5, fontSize: 16 }} + >{tiNum(index)}{item.answer} + + })} + ) : questionNow.question_type === 1 ? { + const qArr = [] + // 默认输出答案0,0,0,0 + questionNow?.answers?.map((item) => { + if (e.indexOf(item.id) > -1) { + qArr.push("1") + } else { + qArr.push("0") + } + }) + const questionList = questionTypeList + const questionAnswer = qArr.join(",") + // 修改答题卡状态 写入答案以及修改答题状态 + const qX = questionNow?.question_type; + const qI = questionNow?.index; + questionList[qX].children[qI].answerSelect = questionAnswer; + // 答题状态 + questionList[qX].children[qI].state = 1 + questionList[qX].children[qI].answerId = e + // 提交答题卡 + setQuestionTypeList(questionList) + + // console.log('0', questionList, questionNow, item, qX, qI) + }}> + {questionNow?.answers?.map((item, index) => { + + return {tiNum(index)}{item.answer} + + })} + : questionNow.question_type === 2 ? ( + + + {questionNow?.answers?.map((item, index) => { + + return { + const qArr = [] + // 默认输出答案0,0,0,0 + questionNow?.answers?.map(() => { + qArr.push("0") + }) + // 修改用户答案 + qArr[index] = item.is_true + + const questionList = questionTypeList + const questionAnswer = qArr.join(",") + // 修改答题卡状态 写入答案以及修改答题状态 + const qX = questionNow?.question_type; + const qI = questionNow?.index; + questionList[qX].children[qI].answerSelect = questionAnswer; + // 答题状态 + questionList[qX].children[qI].state = 1 + questionList[qX].children[qI].answerId = item.id + // 提交答题卡 + setQuestionTypeList(questionList) + + // console.log('0', questionList, questionNow, item, qX, qI) + }} + value={item.id} + style={{ padding: 5, fontSize: 16 }} + >{tiNum(index)}{item.answer} + + })} + ) : "" + } + +
+
+ + {/* { return true }} value={0} size="large">*/} + {/**/} + {/**/} + {/*
*/} + {/**/} + {/**/} + + + + +
+ + 剩余时间 + 6分14秒 + + 答题序号 + {questionNowNum}/{questionNum} + + + + + + +
+ + + + ); +}; + +export default CardList; diff --git a/web/src/pages/dashboard/qualification/index.less b/web/src/pages/dashboard/qualification/index.less new file mode 100644 index 0000000..d844769 --- /dev/null +++ b/web/src/pages/dashboard/qualification/index.less @@ -0,0 +1,39 @@ +@import '~antd/es/style/themes/default.less'; + +.qualification{ + .condition{ + width:30rem; + margin-bottom: 2rem; + .condition-title{ + text-align: right; + width:5rem; + display: inline-block; + } + .condition-text{ + width: 23rem; + margin-left:2rem; + overflow:hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + .tip{ + color:red; + font-size:12px; + text-align: center; + margin-top:3rem + } + .top{ + width: 100%; + height:5rem; + text-align: center; + line-height: 5rem; + font-size: 2rem; + margin-bottom: 2rem; + font-weight: bold; + background: #fff; + } + .title a:hover{ + color:#1890FF + } +} diff --git a/web/src/pages/dashboard/qualification/index.tsx b/web/src/pages/dashboard/qualification/index.tsx new file mode 100644 index 0000000..1850bd5 --- /dev/null +++ b/web/src/pages/dashboard/qualification/index.tsx @@ -0,0 +1,97 @@ +import type { FC } from 'react'; +import { useEffect ,useState} from 'react'; +import { message, Button } from 'antd'; +import { Line, Radar } from '@ant-design/charts'; +import { Link, history, useRequest,useParams } from 'umi'; +import { PageContainer } from '@ant-design/pro-layout'; +import moment from 'moment'; +import EditableLinkGroup from './components/EditableLinkGroup'; +import styles from './style.less'; +import {getExaminationById,getExaminationRuleById ,getPersonPaperId } from './service'; +import cookie from 'react-cookies'; +import OfflineData from './components/OfflineData'; + +import './index.less'; +const Qualification = () => { + const [examinationInfo, setExamination] = useState({}); + const [rule, setRule] = useState({}); + const [paperId, setPaperId] = useState(''); + const params = useParams(); + //获取考试详情 + const data = useRequest(() => { + return getExaminationById({ + examination_id:params.examination_id + }); + },{ + formatResult: (result) => { + console.log('result',result); + setExamination(result.bean) + } + }); + const ruleInfo = useRequest(() => { + return getExaminationRuleById({ + examination_id:params.examination_id + }); + },{ + formatResult: (result) => { + console.log('result规则',result); + setRule(result.bean) + } + }); + + const paperInfo = useRequest(() => { + return getPersonPaperId({ + examination_id:params.examination_id, + person_id:cookie.load('person_id') + }); + },{ + formatResult: (result) => { + setPaperId(result.paper_id) + } + }); + + return ( +
+
{history.push('/dashboard/workplace')}} style={{color:'#8C8C8C',cursor:'pointer',}}>首页 / 资质考试
+
+
+
考试项目:
+ {examinationInfo?.examination_name} +
+
+
考试时间:
+ {examinationInfo?.examination_start_time}-{examinationInfo?.examination_end_time} +
+
+
考试时长:
+ {rule?.examination_time}分钟 +
+
+
满分:
+ {rule?rule.sum_score===null?'--':rule.sum_score:'--'}分 +
+
+
通过标准:
+ {rule?rule.pass_score===null?'--':rule.pass_score:'--'}分 +
+
+ +
+ +
+
+ *考试开始后,不可随意离开,离开答题页,依然记录时间 +
+
+ ); +}; + +export default Qualification; diff --git a/web/src/pages/dashboard/qualification/result.tsx b/web/src/pages/dashboard/qualification/result.tsx new file mode 100644 index 0000000..251ddf3 --- /dev/null +++ b/web/src/pages/dashboard/qualification/result.tsx @@ -0,0 +1,92 @@ +import type { FC } from 'react'; +import { useEffect ,useState} 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,useParams } from 'umi'; +import { PageContainer } from '@ant-design/pro-layout'; +import moment from 'moment'; +import EditableLinkGroup from './components/EditableLinkGroup'; +import styles from './style.less'; +import {getExaminationById,getPersonPaperId } from './service'; +import cookie from 'react-cookies'; +import OfflineData from './components/OfflineData'; + +import './index.less'; +const Result = () => { + const [examinationInfo, setExamination] = useState({}); + const [rule, setRule] = useState({}); + const [buttonText, setButtonText] = useState('返回'); + const [passInfo, setPassInfo] = useState(false); + const params = useParams(); + //获取考试详情 + // const a=2; + // const b=3; + const getPass=()=>{ + if(params.score>=params.pass_score){ + // if(a>=b){ + setPassInfo(true) + setButtonText('返回') + }else { + setPassInfo(false); + run(); + } + }; + useEffect(() => { + getPass() + }, []); + + const { data: chapterCourse, run } = useRequest(() => { + return getPersonPaperId({ + examination_id:params.examination_id, + person_id:cookie.load('person_id') + }); + },{ + manual:true, + formatResult:(result)=>{ + const paper_id='1'; + if(result.paper_id===''){ + // if(paper_id===''){ + setButtonText('返回') + }else { + setButtonText('重新考试') + } + } + }); + + return ( +
+
{history.push('/dashboard/workplace')}}>首页 / 资质考试 / {params.examination_name}
+
{params.examination_name}
+
+
+
考试用时:
+ --分钟 +
+
+
得分情况:
+ {params.score}分/{params.sum_score}分 +
+
+
通过情况:
+ {passInfo?'通过':'未通过'} +
+
+
+ { + !passInfo&&buttonText==='返回'?'* 本次考试不及格学员,下次考试时间统一参加补考!':'' + } +
+
+ +
+
+ ); +}; + +export default Result; diff --git a/web/src/pages/dashboard/qualification/service.ts b/web/src/pages/dashboard/qualification/service.ts new file mode 100644 index 0000000..63ff853 --- /dev/null +++ b/web/src/pages/dashboard/qualification/service.ts @@ -0,0 +1,36 @@ +import { request } from 'umi'; + + +// 获取人员信息 +export async function getExaminationById(params: { + examination_id: number; +}) { + return request(' /dsideal_yy/zygh/training/examination/getExaminationById', { + params, + }); +} +export async function getExaminationRuleById(params: { + examination_id: number; +}) +{ + return request('/dsideal_yy/zygh/training/person/getExaminationRuleById', { + params, + }); +} + +//13 开始考试前获取试卷id +export async function getPersonPaperId(params: { + +}): Promise<{ data: { list: CardListItemDataType[] } }> { + return request(' /dsideal_yy/zygh/training/person/getPersonPaperId', { + params, + }); +} + + + + + + + + diff --git a/web/src/pages/dashboard/qualification/style.less b/web/src/pages/dashboard/qualification/style.less new file mode 100644 index 0000000..e441454 --- /dev/null +++ b/web/src/pages/dashboard/qualification/style.less @@ -0,0 +1,153 @@ +@import '~antd/es/style/themes/default.less'; +@import './utils/utils.less'; + +.cardList { + .card { + :global { + .ant-card-meta-title { + margin-bottom: 12px; + & > a { + display: inline-block; + max-width: 100%; + color: @heading-color; + } + } + .ant-card-body:hover { + .ant-card-meta-title > a { + color: @primary-color; + } + } + } + } + .item { + height: 64px; + } + +} + +:global { + + .ant-list .ant-list-item-content-single { + max-width: 100%; + } + .ant-list-items{ + display: block; + padding: 10px; + } + .ant-list-bordered .ant-list-item{ + display: inline-block; + width: 50px; + height: 50px; + padding: 5px; + margin: 0; + .ant-typography:hover{ + cursor: pointer; + } + .ant-typography{ + color:#999999; + border: #CCCCCC 1px solid; + border-radius: 5px; + font-weight: bolder; + background-color: #f0f0f0; + display: inline-block; + width: 100%; + height: 100%; + font-size: 18px; + text-align: center; + vertical-align: middle; + span{ + text-align: center; + display: block; + font-size: 18px; + line-height: 18px; + padding: 8px 8px; + } + + mark{ + margin: -1px; + border: #1890ff 1px solid; + border-radius: 5px; + color: #1890ff; + display: block; + width: 40px; + height: 40px; + background-color: #e6f7ff; + } + } + } +} +.extraImg { + width: 155px; + margin-top: -20px; + text-align: center; + img { + width: 100%; + } +} + +.newButton { + width: 100%; + height: 201px; + color: @text-color-secondary; + background-color: @component-background; + border-color: @border-color-base; +} + +.cardAvatar { + width: 48px; + height: 48px; + border-radius: 48px; +} + +.cardDescription { + .textOverflowMulti(); +} + +.pageHeaderContent { + position: relative; +} + +.contentLink { + margin-top: 16px; + a { + margin-right: 32px; + img { + width: 24px; + } + } + img { + margin-right: 8px; + vertical-align: middle; + } +} + +@media screen and (max-width: @screen-lg) { + .contentLink { + a { + margin-right: 16px; + } + } +} +@media screen and (max-width: @screen-md) { + .extraImg { + display: none; + } +} + +@media screen and (max-width: @screen-sm) { + .pageHeaderContent { + padding-bottom: 30px; + } + .contentLink { + position: absolute; + bottom: -4px; + left: 0; + width: 1000px; + a { + margin-right: 16px; + } + img { + margin-right: 4px; + } + } +} diff --git a/web/src/pages/dashboard/qualification/utils/utils.less b/web/src/pages/dashboard/qualification/utils/utils.less new file mode 100644 index 0000000..de1aa64 --- /dev/null +++ b/web/src/pages/dashboard/qualification/utils/utils.less @@ -0,0 +1,50 @@ +.textOverflow() { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + word-break: break-all; +} + +.textOverflowMulti(@line: 3, @bg: #fff) { + position: relative; + max-height: @line * 1.5em; + margin-right: -1em; + padding-right: 1em; + overflow: hidden; + line-height: 1.5em; + text-align: justify; + &::before { + position: absolute; + right: 14px; + bottom: 0; + padding: 0 1px; + background: @bg; + content: '...'; + } + &::after { + position: absolute; + right: 14px; + width: 1em; + height: 1em; + margin-top: 0.2em; + background: white; + content: ''; + } +} + +// mixins for clearfix +// ------------------------ +.clearfix() { + zoom: 1; + &::before, + &::after { + display: table; + content: ' '; + } + &::after { + clear: both; + height: 0; + font-size: 0; + visibility: hidden; + } +} diff --git a/web/src/pages/dashboard/workplace/index.tsx b/web/src/pages/dashboard/workplace/index.tsx index 64570ec..05358e8 100644 --- a/web/src/pages/dashboard/workplace/index.tsx +++ b/web/src/pages/dashboard/workplace/index.tsx @@ -92,7 +92,7 @@ const examinationColumns = [ return break; case 3://考试中 - return + return break; case 4: return "考试完成" diff --git a/web/src/pages/registration/service.ts b/web/src/pages/registration/service.ts index ff0d162..6fe6a79 100644 --- a/web/src/pages/registration/service.ts +++ b/web/src/pages/registration/service.ts @@ -8,7 +8,7 @@ import {TableListItem} from "../../../../admin/src/pages/course/option/data"; * @returns */ export async function queryExaminationRule(params: { - examination_id: 1; + examination_id: number; //count: number; }) // : Promise<{ data: { list: CardListItemDataType[] } }>