zhengpengju 3 years ago
commit 8e4dd72592

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

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

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

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

@ -1,5 +1,5 @@
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 { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
import type { ProColumns, ActionType } from '@ant-design/pro-table';
@ -283,36 +283,25 @@ const TableList: React.FC = () => {
key="update"
onClick={() => {
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);
}}
>
</a>,
<a
key="remove"
onClick={() => {
<Popconfirm key="popconfirm" title={`确认删除当前项吗?`} okText="是" cancelText="否"
onConfirm={async () => {
handleRemove([{ key: record?.train_id }]); // 调用批量删除函数如果接口不支持批量需要在service中处理
setSelectedRows([]);
actionRef.current?.reloadAndRest?.();
}}>
</a>,
}}
>
<a key="remove"></a>
</Popconfirm>
],
},
];
@ -393,7 +382,7 @@ const TableList: React.FC = () => {
>
<Button
onClick={async () => {
await handleRemove(selectedRowsState);
setSelectedRows([]);
actionRef.current?.reloadAndRest?.();
@ -425,13 +414,8 @@ const TableList: React.FC = () => {
// 表单处理
//console.log('columns:', columns);
console.log('values1:', values, orgTree);
//return false;
// values.attachment_json.response.file.response.url
const tree = orgTree.filter((item, idx, self) => {
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.org_names = []
data.target_list.map((e) => {
console.log('1111', e);
data.org_names.push({
value: e.org_id,
label: e.org_name
@ -522,14 +504,15 @@ const TableList: React.FC = () => {
onFinish={async (values: any) => {
// 表单处理
//console.log('columns:', columns);
console.log('values1:', values, orgTree);
console.log('values1:', values, values.org_names.value);
//return false;
// values.attachment_json.response.file.response.url
// 处理机构数据。直接编辑与回显结构不够
let tree = []
if (typeof values.org_names[0] === 'number') {
// 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) => {
return (values?.org_names?.indexOf(item?.id) !== -1)
});
@ -543,14 +526,15 @@ const TableList: React.FC = () => {
delete tree[i].pId
})
} 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 () => {
const defaultMessage = '东北师大理想软件股份有限公司<br> 123';
const currentYear = new Date().getFullYear();
return (
<DefaultFooter
copyright={`${currentYear} ${defaultMessage}`}
links={[
/*
{
key: 'Ant Design Pro',
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,
},*/
]}
/>
<div style={{
textAlign: 'center', width: "100%", marginBottom: 40, color: "rgba(0,0,0,.45)", fontSize: 14
}} >
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; < br />
22010202000105&nbsp;&nbsp;&nbsp;&nbsp;ICP13001399-2&nbsp;&nbsp; B2-20150068
</div >
);
};

@ -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) => {
let num = 0
@ -190,7 +214,7 @@ const CardList = () => {
return <List
key={i}
header={e.question_type_name}
header={tiTypeNum(e.question_type) + e.question_type_name}
footer={false}
bordered
dataSource={e.question_list}
@ -235,7 +259,7 @@ const CardList = () => {
<Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard
title={showQuestionTypeSocore(questionNow.question_type)}
title={tiTypeNum(questionNow.question_type) + showQuestionTypeSocore(questionNow.question_type)}
extra={false}
split='vertical'
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) => {
let num = 0
@ -222,7 +243,7 @@ const CardList = () => {
return <List
key={i}
header={e.question_type_name}
header={tiTypeNum(e.question_type) + e.question_type_name}
footer={false}
bordered
dataSource={e.question_list}
@ -266,7 +287,7 @@ const CardList = () => {
</Col>
<Col span={13} style={{ background: '#ffffff', padding: 0 }}>
<ProCard
title={showQuestionTypeSocore(questionNow.question_type)}
title={tiTypeNum(questionNow.question_type) + showQuestionTypeSocore(questionNow.question_type)}
extra={false}
split='vertical'
bordered

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

Loading…
Cancel
Save