master
zhengpengju 3 years ago
parent f0302dda20
commit 9b01d7b7bc

@ -8,59 +8,71 @@ import styles from './style.less';
import ProTable from '@ant-design/pro-table';
const columns: ProColumns<GithubIssueItem>[] = [
{
dataIndex: 'index',
valueType: 'indexBorder',
width: 48,
},
{
title: '标题',
dataIndex: 'rules_name',
},
{
title: '考试时间',
key: 'examination_time',
dataIndex: 'examination_time',
valueType: 'text',
},
{
title: '总分',
key: 'sum_score',
dataIndex: 'sum_score',
valueType: 'text',
},
{
title: '及格',
key: 'pass_score',
dataIndex: 'pass_score',
valueType: 'text',
},
{
title: '操作',
valueType: 'option',
render: (text, record, _, action) => [
<a
key="editable"
onClick={() => {
history.push(`/mockExamination/index/paper/${record.id}/${record.examination_time}`);
}}
>
</a>,
],
},
];
const SubjectList = () => {
const columns: ProColumns<GithubIssueItem>[] = [
{
dataIndex: 'index',
valueType: 'indexBorder',
width: 48,
},
{
title: '封面',
valueType: 'text',
request: async (params) => {
//alert(123)
// console.log('arr',arr)
// const {tags} = arr;
console.log('params::::', params );
const { data } = await getRulesList({b_use: 0});
return '123';
},
},
{
title: '标题',
dataIndex: 'rules_name',
},
{
title: '考试时间',
key: 'examination_time',
dataIndex: 'examination_time',
valueType: 'text',
},
{
title: '总分',
key: 'sum_score',
dataIndex: 'sum_score',
valueType: 'text',
},
{
title: '及格',
key: 'pass_score',
dataIndex: 'pass_score',
valueType: 'text',
},
{
title: '操作',
valueType: 'option',
render: (text, record, _, action) => [
<a
key="editable"
onClick={() => {
history.push(`/mockExamination/index/paper/${record.id}/${record.examination_time}`);
}}
>
</a>,
],
},
];
const actionRef = useRef<ActionType>();
return (
<PageContainer content={false} extraContent={false}>
<div className={styles.cardList}>
<ProTable<GithubIssueItem>
<ProTable
columns={columns}
actionRef={actionRef}
request={async (value) => {
@ -70,23 +82,35 @@ const SubjectList = () => {
rules_type: 0
})
console.log(RulesData.table_List)
const _data = await getRulesList({
...value,
b_use: 1,
rules_type: 0
});
const _data1 = await getRulesList({
...value,
b_use: 1,
rules_type: 0
});
return { data: RulesData.table_List }
}}
editable={{
/*editable={{
type: 'multiple',
}}
columnsState={{
persistenceKey: 'pro-table-singe-demos',
persistenceType: 'localStorage',
}}
}}*/
search={false}
rowKey="id"
toolBarRender={false}
pagination={{
pageSize: 10,
}}
dateFormatter="string"
headerTitle="高级表格"
//dateFormatter="string"
//headerTitle="高级表格"
/>
</div>
</PageContainer>

Loading…
Cancel
Save