zhengpengju 3 years ago
commit 8e4dd72592

@ -1,32 +1,10 @@
import { DefaultFooter } from '@ant-design/pro-layout';
export default () => { export default () => {
const defaultMessage = '东北师大理想软件股份有限公司';
const currentYear = new Date().getFullYear();
return ( return (
<DefaultFooter <div style={{
copyright={`${currentYear} ${defaultMessage}`} textAlign: 'center', width: "100%", marginBottom: 40, color: "rgba(0,0,0,.45)", fontSize: 14
links={[ }} >
/* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; < br />
{ 22010202000105&nbsp;&nbsp;&nbsp;&nbsp;ICP13001399-2&nbsp;&nbsp; B2-20150068
key: 'Ant Design Pro', </div >
title: 'Ant Design Pro',
href: 'https://pro.ant.design',
blankTarget: true,
},
{
key: 'github',
title: <GithubOutlined />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
},
{
key: 'Ant Design',
title: 'Ant Design',
href: 'https://ant.design',
blankTarget: true,
},*/
]}
/>
); );
}; };

@ -95,6 +95,9 @@ const ExaminationList: React.FC = () => {
hideInTable: false, hideInTable: false,
hideInForm: false, hideInForm: false,
hideInSearch: false, hideInSearch: false,
fieldProps: {
maxLength: 64
},
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
@ -145,8 +148,8 @@ const ExaminationList: React.FC = () => {
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'create_time', dataIndex: 'create_time',
valueType: 'dateTimeRange', valueType: 'dateTime',
hideInTable: true, hideInTable: false,
hideInForm: true, hideInForm: true,
hideInSearch: false, hideInSearch: false,
}, },
@ -215,6 +218,9 @@ const ExaminationList: React.FC = () => {
hideInSearch: true, hideInSearch: true,
hideInTable: true, hideInTable: true,
renderText: (val: string) => `${val}`, renderText: (val: string) => `${val}`,
fieldProps: {
maxLength: 3
},
formItemProps: { formItemProps: {
rules: [ rules: [
{ {
@ -298,7 +304,7 @@ const ExaminationList: React.FC = () => {
> >
<a <a
key="publish" key="publish"
style={{display:'inline-block',width:50}} style={{ display: 'inline-block', width: 50 }}
> >
{record.b_use == 1 ? <Typography.Text type="success"></Typography.Text> : <Typography.Text type="warning"></Typography.Text>} {record.b_use == 1 ? <Typography.Text type="success"></Typography.Text> : <Typography.Text type="warning"></Typography.Text>}
</a> </a>
@ -317,22 +323,20 @@ 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]
setCurrentRow(record); setCurrentRow(record);
}} }}
style={{padding:'0 2px 0 0'}} style={{ padding: '0 2px 0 0' }}
> >
</Button>, </Button>,
<Button <Popconfirm key="popconfirm" title={`确认删除当前项吗?`} okText="是" cancelText="否"
type="link" onConfirm={async () => {
key="remove"
onClick={() => {
handleRemove([{ key: record?.examination_id }], record); // 调用批量删除函数如果接口不支持批量需要在service中处理 handleRemove([{ key: record?.examination_id }], record); // 调用批量删除函数如果接口不支持批量需要在service中处理
setSelectedRows([]); setSelectedRows([]);
actionRef.current?.reloadAndRest?.(); actionRef.current?.reloadAndRest?.();
}} }}
style={{padding:'0 2px 0 0'}}
> >
<a key="remove"></a>
</Button>, </Popconfirm>
,
<a <a
key="registration" key="registration"
onClick={() => { onClick={() => {
@ -340,7 +344,7 @@ const ExaminationList: React.FC = () => {
//setCurrentRow(record); //setCurrentRow(record);
}} }}
> >
</a>, </a>,
], ],
}, },
@ -485,11 +489,11 @@ const ExaminationList: React.FC = () => {
<Modal <Modal
title="新建考试" title="新建考试"
// destroyOnClose
width="60%" width="60%"
visible={createModalVisible} visible={createModalVisible}
destroyOnClose
onCancel={() => { onCancel={() => {
schemaForm.resetFields()
handleCreateModalVisible(false); handleCreateModalVisible(false);
}} }}
footer={null} footer={null}
@ -530,40 +534,10 @@ const ExaminationList: React.FC = () => {
await handleUpdate(params); await handleUpdate(params);
handleCreateModalVisible(false); handleCreateModalVisible(false);
actionRef.current?.reloadAndRest?.(); schemaForm.resetFields()
}}
/*
onFinish={async (values: any) => {
// 表单处理
console.log('columns:', columns);
console.log('values:', values);
// if (params.id) {
// fileds = { ...fileds, id: params.id }
// }
// console.log(fileds, 'fileds', params);
// // return false
const res = await updateExamination({
...values,
apply_end_time: values.apply_time[0],
apply_start_time: values.apply_time[1],
course_end_time: values.course_time[0],
course_start_time: values.course_time[0],
examination_start_time: values.examination_time[0],
examination_end_time: values.examination_time[0],
});
console.log(res, 'resresresres');
// // await waitTime(2000);
// return true;
}} }}
*/
submitter={{ submitter={{
render: (props, doms) => ( render: (props, doms) => (
@ -574,8 +548,6 @@ const ExaminationList: React.FC = () => {
</Row> </Row>
), ),
}} }}
// action = ''
title="新建"
columns={columns} columns={columns}
/> />
</Modal> </Modal>

@ -196,7 +196,7 @@ export async function getAsyncOrgTree(params: {
page_size: number; page_size: number;
//count: number; //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> { }): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('dsideal_yy/org/getAsyncOrgTree', { return request('/dsideal_yy/org/getAsyncOrgTree', {
params, params,
}); });
} }

@ -45,7 +45,7 @@ export async function getAsyncOrgTree(params: {
page_size: number; page_size: number;
//count: number; //count: number;
}): Promise<{ data: { list: CardListItemDataType[] } }> { }): Promise<{ data: { list: CardListItemDataType[] } }> {
return request('dsideal_yy/org/getAsyncOrgTree', { return request('/dsideal_yy/org/getAsyncOrgTree', {
params, params,
}); });
} }

@ -1,5 +1,5 @@
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import { Button, message, Input, Drawer, Row, Col, Space, Modal } from 'antd'; import { Button, message, Input, Drawer, Row, Col, Space, Modal, Popconfirm } from 'antd';
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
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';
@ -283,36 +283,25 @@ const TableList: React.FC = () => {
key="update" key="update"
onClick={() => { onClick={() => {
handleUpdateModalVisible(true); handleUpdateModalVisible(true);
// const _record = JSON.parse(JSON.stringify(record))
// const idsArr = _record?.org_ids?.split(",")
// const orgName = _record.org_names != "" ? _record.org_names.split(",") : ""
// const idsData = []
// if (_record?.org_ids != false) {
// idsArr.map((e, i) => {
// idsData.push({
// label: orgName[i], value: Number(e)
// })
// })
// }
// _record.org_names = idsData
// _record.date_time = [_record.start_time, _record.end_time]
// console.log("2323", _record);
setCurrentRow(record); setCurrentRow(record);
}} }}
> >
</a>, </a>,
<a
key="remove"
onClick={() => {
<Popconfirm key="popconfirm" title={`确认删除当前项吗?`} okText="是" cancelText="否"
onConfirm={async () => {
handleRemove([{ key: record?.train_id }]); // 调用批量删除函数如果接口不支持批量需要在service中处理 handleRemove([{ key: record?.train_id }]); // 调用批量删除函数如果接口不支持批量需要在service中处理
setSelectedRows([]); setSelectedRows([]);
actionRef.current?.reloadAndRest?.(); actionRef.current?.reloadAndRest?.();
}}> }}
>
</a>, <a key="remove"></a>
</Popconfirm>
], ],
}, },
]; ];
@ -425,13 +414,8 @@ const TableList: React.FC = () => {
// 表单处理 // 表单处理
//console.log('columns:', columns); //console.log('columns:', columns);
console.log('values1:', values, orgTree); console.log('values1:', values, orgTree);
//return false;
// values.attachment_json.response.file.response.url
const tree = orgTree.filter((item, idx, self) => { const tree = orgTree.filter((item, idx, self) => {
return (values.org_names.indexOf(item.id) !== -1) return (values.org_names.indexOf(item.id) !== -1)
}); });
@ -505,8 +489,6 @@ const TableList: React.FC = () => {
data.date_time = [currentRow.start_time, currentRow.end_time] data.date_time = [currentRow.start_time, currentRow.end_time]
data.org_names = [] data.org_names = []
data.target_list.map((e) => { data.target_list.map((e) => {
console.log('1111', e);
data.org_names.push({ data.org_names.push({
value: e.org_id, value: e.org_id,
label: e.org_name label: e.org_name
@ -522,14 +504,15 @@ const TableList: React.FC = () => {
onFinish={async (values: any) => { onFinish={async (values: any) => {
// 表单处理 // 表单处理
//console.log('columns:', columns); //console.log('columns:', columns);
console.log('values1:', values, orgTree); console.log('values1:', values, values.org_names.value);
//return false; //return false;
// values.attachment_json.response.file.response.url // values.attachment_json.response.file.response.url
// 处理机构数据。直接编辑与回显结构不够
let tree = [] let tree = []
if (typeof values.org_names[0] === 'number') { if (typeof values.org_names[0] === 'number') {
// tree = values.org_names // tree = values.org_names
console.log('true values.org_names', tree, orgTree, values) console.log('true values.org_names', tree, values)
tree = orgTree?.filter((item, idx, self) => { tree = orgTree?.filter((item, idx, self) => {
return (values?.org_names?.indexOf(item?.id) !== -1) return (values?.org_names?.indexOf(item?.id) !== -1)
}); });
@ -543,14 +526,15 @@ const TableList: React.FC = () => {
delete tree[i].pId delete tree[i].pId
}) })
} else { } else {
values.org_names.map((e) => {
console.log(e, 'e');
values.org_names.map((e) => {
tree.push({
org_type: 2,
org_id: e.value,
org_name: e.label
})
}) })
// tree[i].org_id = e.id
// tree[i].org_name = e.name
console.log(values.org_names, 'false values.org_names')
} }

@ -1,32 +1,10 @@
import { DefaultFooter } from '@ant-design/pro-layout';
export default () => { export default () => {
const defaultMessage = '东北师大理想软件股份有限公司<br> 123';
const currentYear = new Date().getFullYear();
return ( return (
<DefaultFooter <div style={{
copyright={`${currentYear} ${defaultMessage}`} textAlign: 'center', width: "100%", marginBottom: 40, color: "rgba(0,0,0,.45)", fontSize: 14
links={[ }} >
/* &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; < br />
{ 22010202000105&nbsp;&nbsp;&nbsp;&nbsp;ICP13001399-2&nbsp;&nbsp; B2-20150068
key: 'Ant Design Pro', </div >
title: 'Ant Design Pro',
href: 'https://pro.ant.design',
blankTarget: true,
},
{
key: 'github',
title: <GithubOutlined />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
},
{
key: 'Ant Design',
title: 'Ant Design',
href: 'https://ant.design',
blankTarget: true,
},*/
]}
/>
); );
}; };

@ -159,6 +159,30 @@ const CardList = () => {
} }
// 题型回数字
const tiTypeNum = (a: number) => {
switch (a) {
case 0:
return "一、"
break;
case 1:
return "二、"
break;
case 2:
return "三、"
break;
default:
return ""
break;
}
}
// 根据题型返回题数、分数、总分 // 根据题型返回题数、分数、总分
const showQuestionTypeSocore = (questionType) => { const showQuestionTypeSocore = (questionType) => {
let num = 0 let num = 0
@ -190,7 +214,7 @@ const CardList = () => {
return <List return <List
key={i} key={i}
header={e.question_type_name} header={tiTypeNum(e.question_type) + e.question_type_name}
footer={false} footer={false}
bordered bordered
dataSource={e.question_list} dataSource={e.question_list}
@ -235,7 +259,7 @@ const CardList = () => {
<Col span={13} style={{ background: '#ffffff', padding: 0 }}> <Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard <ProCard
title={showQuestionTypeSocore(questionNow.question_type)} title={tiTypeNum(questionNow.question_type) + showQuestionTypeSocore(questionNow.question_type)}
extra={false} extra={false}
split='vertical' split='vertical'
bordered bordered

@ -189,6 +189,27 @@ const CardList = () => {
} }
// 题型回数字
const tiTypeNum = (a: number) => {
switch (a) {
case 0:
return "一、"
break;
case 1:
return "二、"
break;
case 2:
return "三、"
break;
default:
return ""
break;
}
}
// 根据题型返回题数、分数、总分 // 根据题型返回题数、分数、总分
const showQuestionTypeSocore = (questionType) => { const showQuestionTypeSocore = (questionType) => {
let num = 0 let num = 0
@ -222,7 +243,7 @@ const CardList = () => {
return <List return <List
key={i} key={i}
header={e.question_type_name} header={tiTypeNum(e.question_type) + e.question_type_name}
footer={false} footer={false}
bordered bordered
dataSource={e.question_list} dataSource={e.question_list}
@ -266,7 +287,7 @@ const CardList = () => {
</Col> </Col>
<Col span={13} style={{ background: '#ffffff', padding: 0 }}> <Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard <ProCard
title={showQuestionTypeSocore(questionNow.question_type)} title={tiTypeNum(questionNow.question_type) + showQuestionTypeSocore(questionNow.question_type)}
extra={false} extra={false}
split='vertical' split='vertical'
bordered bordered

@ -70,7 +70,9 @@ const CardList = () => {
const params = useParams(); const params = useParams();
// 组卷详情查询 // 组卷详情查询
const [rulesPaperInfo, setRulesPaperInfo] = useState({}); const [rulesPaperInfo, setRulesPaperInfo] = useState({
question_type_count: []
});
// 试题分数 // 试题分数
const [rulesPaperScore, setRulesPaperScore] = useState([]); const [rulesPaperScore, setRulesPaperScore] = useState([]);
// 试题列表 // 试题列表
@ -279,6 +281,8 @@ const CardList = () => {
for (let i = 0; i < 50; i++) { for (let i = 0; i < 50; i++) {
numbers.push({ id: `${i}` }) numbers.push({ id: `${i}` })
} }
// 序号回数字
const tiNum = (a: number) => { const tiNum = (a: number) => {
switch (a) { switch (a) {
case 0: case 0:
@ -317,6 +321,25 @@ const CardList = () => {
} }
} }
// 题型回数字
const tiTypeNum = (a: number) => {
switch (a) {
case 0:
return "一、"
break;
case 1:
return "二、"
break;
case 2:
return "三、"
break;
default:
return ""
break;
}
}
// 根据题型返回题数、分数、总分 // 根据题型返回题数、分数、总分
const showQuestionTypeSocore = (questionType) => { const showQuestionTypeSocore = (questionType) => {
@ -340,12 +363,17 @@ const CardList = () => {
let score = 0 let score = 0
// 当前分类下试题总数 // 当前分类下试题总数
if (JSON.stringify(rulesPaperInfo) !== "{}" && rulesPaperInfo.length > 0) { if (JSON.stringify(rulesPaperInfo) !== "{}" && rulesPaperInfo.length !== 0) {
rulesPaperInf?.question_type_count.map((e, i) => {
rulesPaperInfo.question_type_count.map((e, i) => {
console.log(e, 'eeeeee');
if (e.question_type === questionType) { if (e.question_type === questionType) {
num = e.count num = e.count
questionName = e.type_name questionName = e.type_name
} }
}) })
@ -388,7 +416,7 @@ const CardList = () => {
return <List return <List
key={i} key={i}
header={e.type_name} header={tiTypeNum(e.question_type) + e.type_name}
footer={false} footer={false}
bordered bordered
dataSource={e.children} dataSource={e.children}
@ -432,10 +460,7 @@ const CardList = () => {
</Col> </Col>
<Col span={13} style={{ background: '#ffffff', padding: 0 }}> <Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard <ProCard
title={ title={tiTypeNum(questionNow.question_type) + showQuestionTypeSocore(questionNow.question_type)}
showQuestionTypeSocore(questionNow.question_type)
}
extra={false} extra={false}
split='vertical' split='vertical'
bordered bordered

Loading…
Cancel
Save