master
zhengpengju 3 years ago
parent 1d0325761d
commit aeb6853c00

@ -2,7 +2,7 @@
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import { useRequest, history } from 'umi'; import { useRequest, history } from 'umi';
import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons'; import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload, Form, Popconfirm } from 'antd'; import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload, Form, Popconfirm, Typography } from 'antd';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import type { ActionType } from '@ant-design/pro-table'; import type { ActionType } from '@ant-design/pro-table';
import type { ProColumns } from '@ant-design/pro-table'; import type { ProColumns } from '@ant-design/pro-table';
@ -296,10 +296,9 @@ const ExaminationList: React.FC = () => {
}} }}
> >
<a <a
key="detail" key="publish"
> >
{record.b_use == 1 ? "已发布" : "未发布"} {record.b_use == 1 ? <Typography.Text type="success"></Typography.Text> : <Typography.Text type="warning"></Typography.Text>}
</a> </a>
</Popconfirm> </Popconfirm>
@ -312,9 +311,6 @@ const ExaminationList: React.FC = () => {
record.apply_time = [record.apply_start_time, record.apply_end_time] record.apply_time = [record.apply_start_time, record.apply_end_time]
record.examination_time = [record.examination_end_time, record.examination_end_time] record.examination_time = [record.examination_end_time, record.examination_end_time]
record.apply_time = [record.apply_start_time, record.apply_end_time] record.apply_time = [record.apply_start_time, record.apply_end_time]
setCurrentRow(record); setCurrentRow(record);
}} }}
> >

@ -2,7 +2,7 @@
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import { useRequest, history } from 'umi'; import { useRequest, history } from 'umi';
import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons'; import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload } from 'antd'; import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload, Typography } from 'antd';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import type { ProColumns, ActionType } from '@ant-design/pro-table'; import type { ProColumns, ActionType } from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
@ -222,6 +222,7 @@ const ExaminationRules: React.FC = () => {
}}> }}>
</a>, </a>,
/*
<a <a
key="registration" key="registration"
onClick={() => { onClick={() => {
@ -229,8 +230,8 @@ const ExaminationRules: React.FC = () => {
//setCurrentRow(record); //setCurrentRow(record);
}} }}
> >
{record.b_use == 1 ? <Typography.Text type="success"></Typography.Text> : <Typography.Text type="secondary"></Typography.Text>}
</a>, </a>*/,
] ]
}, },
}, },

@ -20,7 +20,7 @@ import { saveRules, querySubjectList, queryRulesView, queryRulesList, queryRules
import { queryQuestionType } from '@/pages/questionbank/service'; import { queryQuestionType } from '@/pages/questionbank/service';
import ProTable, { ActionType, EditableProTable, ProColumns } from '@ant-design/pro-table'; import ProTable, { ActionType, EditableProTable, ProColumns } from '@ant-design/pro-table';
import { TableListPagination } from '@/pages/ListTableList2/data'; import { TableListPagination } from '@/pages/ListTableList2/data';
import { PlusOutlined } from '@ant-design/icons'; import { DiffOutlined, PlusOutlined } from '@ant-design/icons';
import { TableListItem } from '../../components/QuestionSelector'; import { TableListItem } from '../../components/QuestionSelector';
import ScoreSetter from '../../components/ScoreSetter'; import ScoreSetter from '../../components/ScoreSetter';
import AutoSelector from '../components/AutoSelector'; import AutoSelector from '../components/AutoSelector';
@ -62,8 +62,8 @@ export default () => {
dataIndex: 'examination_time', dataIndex: 'examination_time',
valueType: 'text', valueType: 'text',
sorter: false, sorter: false,
hideInTable: false, hideInTable: true,
hideInForm: false, hideInForm: true,
hideInSearch: true, hideInSearch: true,
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val}`,
}, },
@ -71,13 +71,13 @@ export default () => {
title: '关联主题', title: '关联主题',
dataIndex: 'subject_name', dataIndex: 'subject_name',
valueType: 'text', valueType: 'text',
hideInTable: false, hideInTable: true,
hideInForm: false, hideInForm: true,
hideInSearch: true, hideInSearch: true,
}, },
{ {
title: '题型设置', title: '题型设置',
dataIndex: 'subject_id', dataIndex: 'question_type_count',
valueType: 'text', valueType: 'text',
hideInTable: true, hideInTable: true,
hideInForm: false, hideInForm: false,
@ -93,9 +93,9 @@ export default () => {
sinfo.push({ label: Items.list[i].subject_name, value: Items.list[i].subject_id }) sinfo.push({ label: Items.list[i].subject_name, value: Items.list[i].subject_id })
} }
console.log(sinfo, 'sinfo'); console.log(sinfo, 'sinfo');
*/ */
return []; return [];
}, },
}, },
{ {
title: '总分', title: '总分',
@ -104,7 +104,7 @@ export default () => {
valueType: 'text', valueType: 'text',
hideInSearch: true, hideInSearch: true,
hideInForm: false, hideInForm: false,
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val || 0} `,
}, },
{ {
title: '通过线', title: '通过线',
@ -113,12 +113,13 @@ export default () => {
valueType: 'text', valueType: 'text',
hideInSearch: true, hideInSearch: true,
hideInForm: false, hideInForm: false,
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val || '-'}`,
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'option', dataIndex: 'option',
valueType: 'option', valueType: 'option',
width: 200,
render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => { render: (_dom: any, record: React.SetStateAction<TableListItem | undefined>) => {
console.log(record, 'record') console.log(record, 'record')
return [ return [
@ -305,32 +306,36 @@ export default () => {
> >
<div style={{ margin: '0' }}> <div style={{ margin: '0' }}>
<ProTable<TableListItem, TableListPagination> <ProTable<TableListItem, TableListPagination>
page
headerTitle={false} headerTitle={false}
actionRef={actionRef} actionRef={actionRef}
rowKey="examination_id" rowKey="examination_id"
options={false} options={false}
search={false} search={false}
toolBarRender={() => [ toolBarRender={() => (
<Button <Space style={{margin:-24}} >
type="primary" <Button
key="primary" type="primary"
onClick={() => { key="primary"
handleAutoModalVisible(true) onClick={() => {
}} handleAutoModalVisible(true)
> }}
<PlusOutlined /> >
</Button>, <PlusOutlined />
<Button </Button>
type="primary" <Button
key="primary" type="primary"
onClick={() => { key="primary"
handleScoreModalVisible(true) onClick={() => {
}} handleScoreModalVisible(true)
> }}
<PlusOutlined /> >
</Button> <DiffOutlined />
]} </Button>
</Space>
)}
request={async (value) => { request={async (value) => {
console.log('queryRulesPaper::')
const _data = await queryRulesPaper( const _data = await queryRulesPaper(
{ {
rules_id: params?.id, rules_id: params?.id,
@ -340,7 +345,7 @@ export default () => {
); );
return { return {
current: _data?.pageNumber, current: _data?.pageNumber,
data: _data?.table_List, data: _data?.question_list,
pageSize: _data?.pageSize, pageSize: _data?.pageSize,
total: _data?.totalRow || 0, total: _data?.totalRow || 0,
}; };
@ -407,6 +412,7 @@ export default () => {
console.log('paper', paper) console.log('paper', paper)
// setUuidPaper(paper?.paper_uuid) // setUuidPaper(paper?.paper_uuid)
// message.success('提交成功'); // message.success('提交成功');
actionRef.current?.reload()
handleAutoModalVisible(false) handleAutoModalVisible(false)
return true; return true;
}} }}

@ -2,7 +2,7 @@
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import { useRequest, history } from 'umi'; import { useRequest, history } from 'umi';
import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons'; import { PlusOutlined, TagsOutlined, UploadOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload } from 'antd'; import { Button, message, Input, Drawer, Modal, Col, Row, Space, Upload, Typography } from 'antd';
import { PageContainer, FooterToolbar } from '@ant-design/pro-layout'; import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import type { ProColumns, ActionType } from '@ant-design/pro-table'; import type { ProColumns, ActionType } from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
@ -194,7 +194,7 @@ const ExaminationRules: React.FC = () => {
setSelectedRows([]); setSelectedRows([]);
actionRef.current?.reloadAndRest?.(); actionRef.current?.reloadAndRest?.();
}}> }}>
<Typography.Text type="danger"></Typography.Text>
</a>, </a>,
<a <a
key="b_use" key="b_use"
@ -206,7 +206,7 @@ const ExaminationRules: React.FC = () => {
actionRef.current?.reloadAndRest?.(); actionRef.current?.reloadAndRest?.();
}} }}
> >
{record.b_use == 0 ? "未发布" : "已发布"} {record.b_use == 1 ? <Typography.Text type="success"></Typography.Text> : <Typography.Text type="secondary"></Typography.Text>}
</a>, </a>,
] ]
}, },

@ -209,4 +209,4 @@ export async function autoPaperOfficial(data: Record<string, any>, options?: Rec
requestType: "form", requestType: "form",
...(options || {}), ...(options || {}),
}); });
} }

@ -185,21 +185,31 @@ const QuestionBank = () => {
hideInForm: false, hideInForm: false,
hideInSearch: true, hideInSearch: true,
renderFormItem: (item, { defaultRender, ...rest }, form) => ( renderFormItem: (item, { defaultRender, ...rest }, form) => (
<ProFormList <Checkbox.Group style={{ width: '100%' }} onChange={(e)=>{
name='answertrue' //console.log(`checked = ${e.target.checked}`);
children={undefined} }}>
creatorButtonProps={false} <Row>
creatorRecord={{ <Col span={3}>
useMode: 'none', <Checkbox value="A">A</Checkbox>
}} </Col>
/> <Col span={3}>
<Checkbox value="B">B</Checkbox>
</Col>
<Col span={3}>
<Checkbox value="C">C</Checkbox>
</Col>
<Col span={3}>
<Checkbox value="D">D</Checkbox>
</Col>
</Row>
</Checkbox.Group>
) )
/* /*
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
required: true, required: true,
message: '请填写试题解析', message: '请填答案',
}, },
] ]
},*/ },*/
@ -231,7 +241,6 @@ const QuestionBank = () => {
// rules={[{ required: true }]} // rules={[{ required: true }]}
value="锦书" value="锦书"
// disabled // disabled
/> />
), ),
}, },

Loading…
Cancel
Save