Commit 5ef66a49 by zhujian

fix

parent a7e01f18
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { withRouter } from "react-router-dom";
import { Tabs } from 'antd';
import Service from '@/common/js/service';
import Breadcrumbs from "@/components/Breadcrumbs";
import DataInfo from './components/DataInfo'
import './index.less'
export default function DataCenter(){ function DataCenter(props: any) {
const { match: { params: { planId } } } = props;
const [info, setInfo] = useState<any>({})
return <div className="page"> useEffect(() => {
eweew getInfo()
}, [])
function getInfo() {
Service.Hades('public/hades/getTrainingPlanDetail', { planId }).then((res: any) => {
setInfo(res.result)
})
}
return <div className="page train-data-center">
<Breadcrumbs
navList="培训任务详情"
goBack={() => {
props.history.goBack();
}}
/>
<DataInfo info={info} />
</div> </div>
} }
\ No newline at end of file
export default withRouter(DataCenter)
import React, { useEffect, useState } from 'react';
import { withRouter } from "react-router-dom";
function DataInfo(props: any) {
return <div className="info_banner">
</div>
}
export default withRouter(DataInfo)
\ No newline at end of file
import React, { useEffect, useState } from 'react';
import { withRouter } from "react-router-dom";
import ENUM from '../../emun'
const defaultCover = 'https://image.xiaomaiketang.com/xm/rEAetaTEh3.png';
function DataInfo(props: any) {
return <div className="infoBox">
<div className="left">
<div className="banner">
<img src={props.info.coverUrl || defaultCover} alt="" />
</div>
<div className="textBox">
<div className="nameBox">
<div className="name">{props.info.planName}</div>
<div className="status" style={{ color: ENUM.trainStatus[props.info.status || 'UN_START'].color, background: ENUM.trainStatus[props.info.status || 'UN_START'].background }}>{ENUM.trainStatus[props.info.status || 'UN_START'].text}</div>
</div>
<div className="info">
<span> {`创建人: 文小白 `}</span>
<span style={{ marginLeft: 24 }}> {`培训时间:2021-07-01 00:00 至 2021-08-17 00:00`}</span>
</div>
<div className="info">
<div className="item">{`任务数: 98`}</div>
<div className="item">{`课程:98`}</div>
<div className="item">{`作业:4`}</div>
<div className="item">{`考试:4`}</div>
</div>
</div>
</div>
<div className="right"></div>
</div>
}
export default withRouter(DataInfo)
\ No newline at end of file
.train-data-center{
.infoBox{
background: #FFFFFF;
box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.05);
border-radius: 2px;
display: flex;
height: 141px;
justify-content: space-between;
margin: 0 16px 16px;
.left{
display: flex;
.banner{
margin-right: 16px;
img{
height: 141px;
}
}
.textBox{
padding-top: 1px;
.nameBox{
margin-top: 12px;
margin-bottom: 34px;
display: flex;
.name{
font-size: 18px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 25px;
}
.status{
width: 42px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #999999;
line-height: 20px;
text-align: center;
margin-left: 24px;
}
}
.info{
span,.item{
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 20px;
}
}
}
}
}
}
\ No newline at end of file
const ENUM:any= {
trainStatus: {
UN_START: {
text: "未开始",
color: "rgba(255, 178, 0, 1)",
background: "rgba(255, 178, 0, 0.1)",
},
STARTING: {
text: "进行中",
color: "rgba(41, 102, 255, 1)",
background: "rgba(41, 102, 255, 0.1)",
},
FINISH: {
text: "已结束",
color: "rgba(153, 153, 153, 1)",
background: "rgba(153, 153, 153, 0.1)",
},
}
}
export default ENUM
\ No newline at end of file
...@@ -53,7 +53,7 @@ function TrainTaskPage(props) { ...@@ -53,7 +53,7 @@ function TrainTaskPage(props) {
<TrainFilter onChange={queryChange} /> <TrainFilter onChange={queryChange} />
<TrainList trainListData={trainListData} query={query} totalCount={totalCount} onChange={queryChange} /> <TrainList trainListData={trainListData} query={query} totalCount={totalCount} onChange={queryChange} />
</div> </div>
<Route path={`${match.url}/data`} component={DataCenter} /> <Route path={`${match.url}/data/:planId`} component={DataCenter} />
</div> </div>
); );
} }
......
...@@ -19,6 +19,7 @@ function TrainList(props) { ...@@ -19,6 +19,7 @@ function TrainList(props) {
const { const {
query: { issueState, myAssist, current, size }, query: { issueState, myAssist, current, size },
totalCount, totalCount,
match
} = props; } = props;
function renderMoreOperate(item) { function renderMoreOperate(item) {
...@@ -162,7 +163,9 @@ function TrainList(props) { ...@@ -162,7 +163,9 @@ function TrainList(props) {
render: (val, record) => { render: (val, record) => {
return ( return (
<div className='operate'> <div className='operate'>
<div className='operate__item' onClick={() => toLearningDataPage(record)}> <div className='operate__item' onClick={() => {
props.history.push(`${match.path}/data/${record.planId}`)
}}>
数据 数据
</div> </div>
{record.enableState === 'YES' && ( {record.enableState === 'YES' && (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment