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'; 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 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>(); const actionRef = useRef<ActionType>();
return ( return (
<PageContainer content={false} extraContent={false}> <PageContainer content={false} extraContent={false}>
<div className={styles.cardList}> <div className={styles.cardList}>
<ProTable<GithubIssueItem> <ProTable
columns={columns} columns={columns}
actionRef={actionRef} actionRef={actionRef}
request={async (value) => { request={async (value) => {
@ -70,23 +82,35 @@ const SubjectList = () => {
rules_type: 0 rules_type: 0
}) })
console.log(RulesData.table_List) 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 } return { data: RulesData.table_List }
}} }}
editable={{ /*editable={{
type: 'multiple', type: 'multiple',
}} }}
columnsState={{ columnsState={{
persistenceKey: 'pro-table-singe-demos', persistenceKey: 'pro-table-singe-demos',
persistenceType: 'localStorage', persistenceType: 'localStorage',
}} }}*/
search={false} search={false}
rowKey="id" rowKey="id"
toolBarRender={false} toolBarRender={false}
pagination={{ pagination={{
pageSize: 10, pageSize: 10,
}} }}
dateFormatter="string" //dateFormatter="string"
headerTitle="高级表格" //headerTitle="高级表格"
/> />
</div> </div>
</PageContainer> </PageContainer>

Loading…
Cancel
Save