Commit 25189f3f by zhujian

fix

parent 50ceb59d
...@@ -63,7 +63,7 @@ function DataCenter(props: any) { ...@@ -63,7 +63,7 @@ function DataCenter(props: any) {
tabList.map((item: any) => { tabList.map((item: any) => {
return <TabPane tab={item.name} key={item.key}> return <TabPane tab={item.name} key={item.key}>
{ {
<item.compoment info={info} /> <item.compoment info={info} taskId={taskId} />
} }
</TabPane> </TabPane>
}) })
......
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import { PageControl, XMTable } from '@/components';
import Service from '@/common/js/service';
import User from '@/common/js/user';
function CourseTable(props: any) {
return <div className="info_banner"> function ExamTable(props: any) {
const [query, setQuery] = useState<any>({
current: 1, size: 10,
taskId: props.taskId,
source: 0,
tenantId: User.getStoreId(),
userId: User.getStoreUserId(),
});
const [list, setList] = useState<any[]>([]);
const [total, setTotal] = useState<any>(0);
useEffect(() => {
getList()
}, [query])
function getList() {
Service.Hades('public/hades/queryTrainingExamUserData', query).then((res: any) => {
setList(res.result.records)
setTotal(res.result.tatal)
})
}
const columns = [
{
title: '考试名称',
key: 'examName',
},
{
title: '完成人数',
key: 'finishCnt',
dataIndex: 'finishCnt',
},
{
title: '平均分',
key: 'averageScore',
dataIndex: 'averageScore',
},
{
title: '及格人数',
key: 'passCnt',
dataIndex: 'passCnt',
},
{
title: '及格率',
key: 'passPercentage',
dataIndex: 'passPercentage',
render: (val: any, record: any) => {
return <div></div>;
},
},
{
title: '操作',
key: 'operate',
dataIndex: 'operate',
render: (val: any, record: any) => {
return (
<div className='operate-area'>
<span className='operate-item' onClick={() => { }}>
查看数据
</span>
</div>
);
},
},
];
return <div className="study_Table">
<div style={{ marginTop: 12 }}>
<XMTable
renderEmpty={{
type: 'college',
description: '暂无数据',
}}
rowKey={(record: any) => record.storeCustomerId}
dataSource={list}
columns={columns}
pagination={false}
className='user-learning-table'
onChange={() => { }}
showSorterTooltip={false}
bordered
/>
{list.length > 0 && (
<div className='box-footer'>
<PageControl
current={query.current - 1}
pageSize={query.size}
total={total}
toPage={(page: any) => {
setQuery({ ...query, current: query.current + 1 })
}}
/>
</div>
)}
</div>
</div> </div>
} }
export default withRouter(CourseTable) export default withRouter(ExamTable)
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,9 @@ import { Route, withRouter } from "react-router-dom"; ...@@ -3,7 +3,9 @@ import { Route, withRouter } from "react-router-dom";
import { Row, Input, Select, Tooltip, Col } from 'antd'; import { Row, Input, Select, Tooltip, Col } from 'antd';
import RangePicker from '@/modules/common/DateRangePicker'; import RangePicker from '@/modules/common/DateRangePicker';
import { PageControl, XMTable } from '@/components'; import { PageControl, XMTable } from '@/components';
import Service from '@/common/js/service';
import ENUM from '../../enum'; import ENUM from '../../enum';
import User from '@/common/js/user';
import moment from 'moment'; import moment from 'moment';
import UserLearningData from '../UserLearningData'; import UserLearningData from '../UserLearningData';
const { Search } = Input; const { Search } = Input;
...@@ -11,16 +13,32 @@ const { Option } = Select; ...@@ -11,16 +13,32 @@ const { Option } = Select;
declare var formatDate: any; declare var formatDate: any;
function StudyTable(props: any) { function StudyTable(props: any) {
const [query, setQuery] = useState<any>({ current: 1, size: 10 }); const [query, setQuery] = useState<any>({
const [list,setList] = useState<any[]>([ current: 1, size: 10,
{ taskId: props.taskId,
storeCustomerName: 'yat', source: 0,
learnState2: '技术部', storeId: User.getStoreId(),
learnState1: '前端', storeUserId: User.getStoreUserId(),
learnState: 'UN_PLAY', userId: User.getStoreUserId(),
} });
]); const [list, setList] = useState<any[]>([]);
const [total,setTotal] = useState<any>(0); const [total, setTotal] = useState<any>(0);
useEffect(() => {
getList()
}, [query])
function getList() {
Service.Hades('public/hades/getTaskCustomerRecordPage', query).then((res: any) => {
setList(res.result.records)
setTotal(res.result.tatal)
})
}
const columns = [ const columns = [
{ {
...@@ -200,7 +218,7 @@ function StudyTable(props: any) { ...@@ -200,7 +218,7 @@ function StudyTable(props: any) {
pageSize={query.size} pageSize={query.size}
total={total} total={total}
toPage={(page:any) => { toPage={(page:any) => {
setQuery({ ...query, current: query.current + 1 })
}} }}
/> />
......
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