题库管理和试卷管理代码提交

main
hujunpeng 3 months ago
parent e9093ceb57
commit 2a7edb37ee
  1. 107
      packages/examination/src/api/examPaper/index.tsx
  2. 1
      packages/examination/src/api/question/index.tsx
  3. 162
      packages/examination/src/views/examPaper/examPaperAdd.tsx
  4. 303
      packages/examination/src/views/examPaper/examPaperList.tsx
  5. 131
      packages/examination/src/views/examPaper/examPaperView.tsx
  6. 342
      packages/examination/src/views/question/questionAdd.tsx
  7. 21
      packages/examination/src/views/question/questionEdit.tsx
  8. 37
      packages/examination/src/views/question/questionList.tsx

@ -1,111 +1,80 @@
import axios from '../axios'; import axios from '../axios';
/* /**
* *
*/ */
export function getList(num: number, page: number, obj:object){ export function getList(data: any) {
const rData = {
num:num,
page:page,
industryId:obj['industryId'],
paperName:obj['paperName']
};
return axios({ return axios({
url: "/ex/examPaper/list", url: "/ex/examPaper/getList",
method: 'post', method: 'post',
data: rData data: data
})
}
/*
* ()
*/
export function deleteSingle(id: number) {
return axios({
url: '/ex/examPaper/delete?id=' + id,
method: 'get'
}); });
} }
/* /**
* *
*/ */
export function deleteMultiple(ids: any) { export function delExamPaper(ids: any) {
return axios({ return axios({
url: '/ex/examPaper/deleteList', url: '/ex/examPaper/delExamPaper',
method: 'post', method: 'post',
data: ids data: ids
}); });
} }
/* /**
* *
*/ */
export function updatePaperStatus(id: number, paperStatus:number) { export function upPaperStatus(ids: any, paperStatus: number) {
const data = { const data = {
id: id, ids: ids,
paperStatus:paperStatus paperStatus: paperStatus
}; };
return axios({ return axios({
url: '/ex/examPaper/updatePaperStatus', url: '/ex/examPaper/upPaperStatus',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/* /**
* *
*/ */
export function batchUpdatePaperStatus(data: any) { export function getExamPaperDetail(id: any) {
return axios({ return axios({
url: '/ex/examPaper/batchUpdatePaperStatus', url: '/ex/examPaper/getExamPaperDetail?id=' + id,
method: 'post',
data: data
});
}
/*
*
*/
export function getDetail(id: string|null) {
return axios({
url: '/ex/examPaper/getDetail?id=' + id,
method: 'get' method: 'get'
}); });
} }
/* /**
* *
*/ */
export function getRandomQuestions(industryId: string, questionCount: number){ export function getRandomQuestions(data: any) {
const data = {
industryId:industryId,
questionCount:questionCount
};
return axios({ return axios({
url: "/ex/examPaper/getRandomQuestions", url: "/ex/examPaper/getRandomQuestions",
method: 'post', method: 'post',
data: data data: data
}) });
} }
/* /**
* *
*/ */
export function save(data: object) { export function addExamPaper(data: any) {
return axios({ return axios({
url: "/ex/examPaper/add", url: "/ex/examPaper/addExamPaper",
method: 'post', method: 'post',
data: data data: data
}); });
} }
/* /**
* *
*/ */
export function update(data: object) { export function editExamPaper(data: any) {
return axios({ return axios({
url: "/ex/examPaper/update", url: "/ex/examPaper/editExamPaper",
method: 'post', method: 'post',
data: data data: data
}); });

@ -63,4 +63,3 @@ export function findIndustry() {
method: 'get' method: 'get'
}); });
} }

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Form, Input, Button, Radio, Checkbox, Select, message, Modal, Table } from 'antd'; import { Form, Input, Button, Radio, Checkbox, Select, message, Modal, Table } from 'antd';
import { getRandomQuestions, save, update, getDetail} from 'api/examPaper'; import { getRandomQuestions, addExamPaper, editExamPaper, getExamPaperDetail} from 'api/examPaper';
import { getList ,findIndustry} from 'api/question'; import { getList ,findIndustry} from 'api/question';
import { dictionary } from "../../api/dict"; import { dictionary } from "../../api/dict";
@ -11,7 +11,6 @@ interface optionsState {
label: string; label: string;
} }
// 定义单个试题的状态接口
interface QuestionState { interface QuestionState {
id: string; id: string;
serviceTypeId: string; serviceTypeId: string;
@ -21,21 +20,15 @@ interface QuestionState {
answer: string | null; answer: string | null;
} }
// 定义组件的状态接口
interface States { interface States {
id: string| null; id: string| null;
isEdit: string| null; isEdit: string| null;
num: number; num: number;
page: number; page: number;
total: number; total: number;
listQuery: {
industryId: string | undefined;
serviceTypeId: string | undefined;
questionContent: string | undefined;
};
industryDict: any; industryDict: any;
serviceTypeDict: any; serviceTypeDict: any;
isLoading: boolean; loading: boolean;
questions: QuestionState[]; questions: QuestionState[];
isModalVisible: boolean; isModalVisible: boolean;
selectedParams: any; selectedParams: any;
@ -57,14 +50,9 @@ class ExamPaperAdd extends Component<any, States> {
num: 10, num: 10,
page: 1, page: 1,
total: 0, total: 0,
listQuery: {
industryId: undefined,
serviceTypeId: undefined,
questionContent: undefined
},
industryDict: undefined, industryDict: undefined,
serviceTypeDict: undefined, serviceTypeDict: undefined,
isLoading: false, loading: false,
questions: [], questions: [],
isModalVisible: false, isModalVisible: false,
selectedParams: {}, selectedParams: {},
@ -74,41 +62,46 @@ class ExamPaperAdd extends Component<any, States> {
}; };
} }
// 初期
componentDidMount() { componentDidMount() {
this.handleFindDict();
const id = sessionStorage.getItem('id'); const id = sessionStorage.getItem('id');
const isEdit= sessionStorage.getItem('isEdit'); const isEdit= sessionStorage.getItem('isEdit');
this.setState({ id: id ,isEdit: isEdit}); this.setState({ id: id ,isEdit: isEdit});
sessionStorage.removeItem('id'); sessionStorage.removeItem('id');
sessionStorage.removeItem('isEdit'); sessionStorage.removeItem('isEdit');
this.findIndustry();
this.findDict();
if(isEdit === 'true'){ if(isEdit === 'true'){
this.getDetail(id); this.handleGetDetail(id);
} }
} }
// 字典
handleFindDict() {
// 监管行业 // 监管行业
findIndustry() { findIndustry()
findIndustry().then((res: any) => { .then((res: any) => {
if (res.data) { if (res.data) {
this.setState({ industryDict: res.data }); this.setState({ industryDict: res.data });
} }
})
.catch(() => {
message.error("获取监管行业字典数据失败,请稍后重试");
}); });
}
// AQ服务类型 // AQ服务类型
findDict() { dictionary("serviceTypeDict")
dictionary('serviceTypeDict').then((res) => { .then((res) => {
if (res.data) { if (res.data) {
this.setState({ serviceTypeDict: res.data }); this.setState({ serviceTypeDict: res.data });
} }
})
.catch(() => {
message.error("获取AQ服务类型字典数据失败,请稍后重试");
}); });
} }
// 试卷详情 // 试卷详情
getDetail = (id: string|null) => { handleGetDetail = (id: any) => {
getDetail(id).then((res: any) => { getExamPaperDetail(id).then((res: any) => {
if (res.data) { if (res.data) {
const newQuestions: QuestionState[] = res.data.data.map((questionData: any) => { const newQuestions: QuestionState[] = res.data.data.map((questionData: any) => {
const options = questionData.options.split(','); const options = questionData.options.split(',');
@ -128,11 +121,11 @@ class ExamPaperAdd extends Component<any, States> {
this.setState({ questions: newQuestions }); this.setState({ questions: newQuestions });
const formValues = {}; const formValues = {};
formValues['paperName'] = res.data.head.paperName; formValues['paperName'] = res.data.head.paperName;
formValues['industryId'] = res.data.head.industryId; formValues['industryId'] = String(res.data.head.industryId);
formValues['questionCount'] = res.data.head.questionCount; formValues['questionCount'] = res.data.head.questionCount;
formValues['totalScore'] = res.data.head.totalScore; formValues['totalScore'] = res.data.head.totalScore;
formValues['examDuration'] = res.data.head.examDuration; formValues['examDuration'] = res.data.head.examDuration;
formValues['durationType'] = res.data.head.durationType; formValues['durationType'] = String(res.data.head.durationType);
formValues['paperContent'] = res.data.head.paperContent; formValues['paperContent'] = res.data.head.paperContent;
this.formRef.current.setFieldsValue(formValues); this.formRef.current.setFieldsValue(formValues);
} }
@ -141,14 +134,15 @@ class ExamPaperAdd extends Component<any, States> {
}); });
}; };
// 随机生成题目 // 随机生成
handleRandomGenerate = () => { handleRandomQuestion = () => {
this.formRef.current.validateFields(['industryId', 'questionCount']) this.formRef.current.validateFields(['industryId', 'questionCount'])
.then((values: any) => { .then((values: any) => {
const industryId = values.industryId; const data = {
const questionCount = values.questionCount; industryId: values.industryId,
// 随机获取试题 questionCount: values.questionCount
getRandomQuestions(industryId, questionCount) };
getRandomQuestions(data)
.then((res: any) => { .then((res: any) => {
if (res.data) { if (res.data) {
if (res.data.length == 0) { if (res.data.length == 0) {
@ -184,10 +178,10 @@ class ExamPaperAdd extends Component<any, States> {
.catch(() => { }); .catch(() => { });
}; };
// 打开手动选题模态框 // 手动选题
handleOpenManualSelectionModal = () => { handleOpenModal = () => {
const { questions, selectedQuestionList } = this.state; const { questions, selectedQuestionList } = this.state;
this.formRef.current.validateFields(['industryId', 'questionCount']) this.formRef.current.validateFields(['industryId'])
.then((values: any) => { .then((values: any) => {
const industryId = values.industryId; const industryId = values.industryId;
const questionCount = values.questionCount; const questionCount = values.questionCount;
@ -202,19 +196,14 @@ class ExamPaperAdd extends Component<any, States> {
.catch(() => { }); .catch(() => { });
}; };
// 关闭手动选题模态框 // 关闭选题
handleCloseManualSelectionModal = () => { handleCloseModal = () => {
this.setState({ this.setState({
isModalVisible: false, isModalVisible: false,
selectedParams: {}, selectedParams: {},
selectedQuestionList: [], selectedQuestionList: [],
questionSelectList: [], questionSelectList: [],
selectedRowKeys: [], selectedRowKeys: [],
listQuery: {
industryId: undefined,
serviceTypeId: undefined,
questionContent: undefined
},
num: 10, num: 10,
page: 1, page: 1,
total: 0, total: 0,
@ -234,17 +223,13 @@ class ExamPaperAdd extends Component<any, States> {
// 处理查询 // 处理查询
handleQuery = () => { handleQuery = () => {
this.setState({ loading: true });
const values = this.formRefSub.current.getFieldsValue();
const { num, page, selectedParams } = this.state; const { num, page, selectedParams } = this.state;
const industryId = selectedParams.industryId; const industryId = selectedParams.industryId;
const { serviceTypeId } = this.formRefSub.current.getFieldsValue(['serviceTypeId']);
const { questionContent } = this.formRefSub.current.getFieldsValue(['questionContent']);
const listQuery = {
industryId,
serviceTypeId,
questionContent
};
const data = { const data = {
...listQuery, ...values,
industryId,
num, num,
page page
}; };
@ -270,12 +255,13 @@ class ExamPaperAdd extends Component<any, States> {
const { selectedQuestionList } = this.state; const { selectedQuestionList } = this.state;
const newSelectedRowKeys = selectedQuestionList.map(item => item.id); const newSelectedRowKeys = selectedQuestionList.map(item => item.id);
this.setState({ questionSelectList: newQuestions, selectedRowKeys: newSelectedRowKeys }); this.setState({ questionSelectList: newQuestions, selectedRowKeys: newSelectedRowKeys });
} else {
message.warning('未找到符合条件的试题');
} }
}) })
.catch(() => { .catch(() => {
message.error('检索试题失败'); message.error('获取数据失败');
})
.finally(() => {
this.setState({ loading: false });
}); });
}; };
@ -289,11 +275,6 @@ class ExamPaperAdd extends Component<any, States> {
selectedQuestionList: [], selectedQuestionList: [],
questionSelectList: [], questionSelectList: [],
selectedRowKeys: [], selectedRowKeys: [],
listQuery: {
industryId: undefined,
serviceTypeId: undefined,
questionContent: undefined
},
num: 10, num: 10,
page: 1, page: 1,
total: 0, total: 0,
@ -301,6 +282,7 @@ class ExamPaperAdd extends Component<any, States> {
if (this.formRefSub.current) { if (this.formRefSub.current) {
this.formRefSub.current.resetFields(); this.formRefSub.current.resetFields();
} }
this.formRef.current.setFieldsValue({ questionCount : selectedQuestionList.length });
}; };
// 保存试卷 // 保存试卷
@ -310,7 +292,7 @@ class ExamPaperAdd extends Component<any, States> {
.then((values: any) => { .then((values: any) => {
const { questions } = this.state; const { questions } = this.state;
if (questions === null || questions.length === 0) { if (questions === null || questions.length === 0) {
message.error('请至少选择一道题目'); message.error('请选择题目');
return; return;
} }
const questionIds = questions.map(question => question.id); const questionIds = questions.map(question => question.id);
@ -319,11 +301,11 @@ class ExamPaperAdd extends Component<any, States> {
id, id,
questionIds questionIds
}; };
this.setState({ isLoading: true });
if (isEdit === 'true') { if (isEdit === 'true') {
update(data) editExamPaper(data)
.then((res) => { .then((res) => {
if (res.data) { const success = res["success"];
if (success) {
message.success('试卷更新成功'); message.success('试卷更新成功');
this.props.history.push('/examPaperList'); this.props.history.push('/examPaperList');
} else { } else {
@ -333,13 +315,11 @@ class ExamPaperAdd extends Component<any, States> {
.catch(() => { .catch(() => {
message.error('试卷更新时出错,请稍后重试'); message.error('试卷更新时出错,请稍后重试');
}) })
.finally(() => {
this.setState({ isLoading: false });
});
} else { } else {
save(data) addExamPaper(data)
.then((res) => { .then((res) => {
if (res.data) { const success = res["success"];
if (success) {
message.success('试卷保存成功'); message.success('试卷保存成功');
this.props.history.push('/examPaperList'); this.props.history.push('/examPaperList');
} else { } else {
@ -349,28 +329,27 @@ class ExamPaperAdd extends Component<any, States> {
.catch(() => { .catch(() => {
message.error('试卷保存时出错,请稍后重试'); message.error('试卷保存时出错,请稍后重试');
}) })
.finally(() => {
this.setState({ isLoading: false });
});
} }
}); });
}; };
render() { render() {
const { industryDict, serviceTypeDict, questions, isLoading, isModalVisible, selectedQuestionList, questionSelectList, selectedRowKeys } = this.state; const {
// 分页切换 industryDict,
const changePage = (current: number, pageSize?: number) => { serviceTypeDict,
questions,
loading,
isModalVisible,
selectedQuestionList,
questionSelectList,
selectedRowKeys
} = this.state;
const changePage = (current: number, pageSize: number) => {
setTimeout(() => { setTimeout(() => {
this.setState({ page: current, num: pageSize || 20 }); this.setState({ page: current, num: pageSize });
this.handleQuery(); this.handleQuery();
}, 0); }, 0);
}; };
// 多少每页
const selectChange = (page: number, num: number) => {
this.setState({ page, num });
this.handleQuery();
};
// 页面跳转
const handleListQuestion = () => { const handleListQuestion = () => {
this.props.history.push('/examPaperList'); this.props.history.push('/examPaperList');
}; };
@ -403,7 +382,6 @@ class ExamPaperAdd extends Component<any, States> {
} }
]; ];
// 移除操作列
const columnsWithoutOperation = columns.filter((column: any) => column.dataIndex!== 'operation'); const columnsWithoutOperation = columns.filter((column: any) => column.dataIndex!== 'operation');
return ( return (
<div className="container"> <div className="container">
@ -486,10 +464,10 @@ class ExamPaperAdd extends Component<any, States> {
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
<h3 style={{ fontWeight: 'bold' }}></h3> <h3 style={{ fontWeight: 'bold' }}></h3>
<div> <div>
<Button type="link" onClick={this.handleRandomGenerate}> <Button type="link" onClick={this.handleRandomQuestion}>
</Button> </Button>
<Button type="link" onClick={this.handleOpenManualSelectionModal}> <Button type="link" onClick={this.handleOpenModal}>
</Button> </Button>
</div> </div>
@ -538,7 +516,7 @@ class ExamPaperAdd extends Component<any, States> {
<Button type="default" htmlType="button" onClick={handleListQuestion} style={{ marginRight: 10 }}> <Button type="default" htmlType="button" onClick={handleListQuestion} style={{ marginRight: 10 }}>
</Button> </Button>
<Button type="primary" htmlType="submit" loading={isLoading} onClick={this.handleSaveExamPaper}> <Button type="primary" htmlType="submit" onClick={this.handleSaveExamPaper}>
</Button> </Button>
</div> </div>
@ -547,9 +525,9 @@ class ExamPaperAdd extends Component<any, States> {
title="选择试题" title="选择试题"
open={isModalVisible} open={isModalVisible}
maskClosable={false} maskClosable={false}
onCancel={this.handleCloseManualSelectionModal} onCancel={this.handleCloseModal}
footer={[ footer={[
<Button key="cancel" onClick={this.handleCloseManualSelectionModal}> <Button key="cancel" onClick={this.handleCloseModal}>
</Button>, </Button>,
<Button key="ok" type="primary" onClick={this.handleConfirmSelection}> <Button key="ok" type="primary" onClick={this.handleConfirmSelection}>
@ -564,9 +542,6 @@ class ExamPaperAdd extends Component<any, States> {
<Table <Table
dataSource={selectedQuestionList} dataSource={selectedQuestionList}
columns={columns} columns={columns}
pagination={{
pageSize: 5
}}
/> />
</div> </div>
<div> <div>
@ -615,6 +590,7 @@ class ExamPaperAdd extends Component<any, States> {
dataSource={questionSelectList} dataSource={questionSelectList}
columns={columnsWithoutOperation} columns={columnsWithoutOperation}
rowKey="id" rowKey="id"
loading={loading}
rowSelection={{ rowSelection={{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: (newSelectedRowKeys, selectedRows) => { onChange: (newSelectedRowKeys, selectedRows) => {
@ -650,9 +626,7 @@ class ExamPaperAdd extends Component<any, States> {
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
showTotal: (total) => `${total}`, showTotal: (total) => `${total}`,
onShowSizeChange: selectChange, onChange: changePage
onChange: changePage,
pageSize: 5
}} }}
/> />
</Modal> </Modal>

@ -1,6 +1,6 @@
import React, { Component } from'react'; import React, { Component } from'react';
import { Form, Input, Button, Table, Select, message, Modal } from 'antd'; import { Form, Input, Button, Table, Select, message, Modal } from 'antd';
import { deleteSingle, deleteMultiple, getList, updatePaperStatus, batchUpdatePaperStatus } from 'api/examPaper'; import { delExamPaper, getList, upPaperStatus } from 'api/examPaper';
import { findIndustry } from 'api/question'; import { findIndustry } from 'api/question';
const { Option } = Select; const { Option } = Select;
@ -8,46 +8,42 @@ const { Option } = Select;
interface States { interface States {
num: number; num: number;
page: number; page: number;
listQuery: {
industryId: string | undefined;
paperName: string | undefined;
};
list: any[];
total: number; total: number;
list: any[];
loading: boolean; loading: boolean;
industryDict: any; industryDict: any;
serviceTypeDict: any;
selectedRowKeys: number[]; selectedRowKeys: number[];
} }
class ExamPaperList extends Component<any, States> { class ExamPaperList extends Component<any, States> {
formRef: any; formRef: any;
constructor(props: any) { constructor(props: any) {
super(props); super(props);
this.formRef = React.createRef(); this.formRef = React.createRef();
this.state = { this.state = {
num: 10, num: 10,
page: 1, page: 1,
listQuery: {
industryId: undefined,
paperName: undefined
},
list: [],
total: 0, total: 0,
list: [],
loading: false, loading: false,
industryDict: undefined, industryDict: [],
serviceTypeDict: undefined, selectedRowKeys: [],
selectedRowKeys: []
}; };
} }
componentDidMount() { componentDidMount() {
this.findIndustry(); this.handleFindIndustry();
this.getList(); const savedFormValues = sessionStorage.getItem('examPaperListFormValues');
if (savedFormValues) {
const values = JSON.parse(savedFormValues);
this.formRef.current.setFieldsValue(values);
}
this.handlegetList();
} }
// 监管行业 // 字典
findIndustry() { handleFindIndustry() {
findIndustry().then((res: any) => { findIndustry().then((res: any) => {
if (res.data) { if (res.data) {
this.setState({ industryDict: res.data }); this.setState({ industryDict: res.data });
@ -56,49 +52,49 @@ class ExamPaperList extends Component<any, States> {
} }
// 查询 // 查询
getList() { handlegetList() {
this.setState({ loading: true }); this.setState({ loading: true });
const { num, page, listQuery } = this.state; const values = this.formRef.current.getFieldsValue();
getList(num, page, listQuery).then((res) => { const { num, page } = this.state;
const data = {
...values,
num,
page
};
sessionStorage.setItem('examPaperListFormValues', JSON.stringify(values));
getList(data).then((res) => {
this.setState({ this.setState({
loading: false,
list: res.data.data, list: res.data.data,
total: res.data.total, total: res.data.total,
selectedRowKeys: [], selectedRowKeys: [],
}); });
this.setState({ loading: false }); })
}).catch(() => { .catch(() => {
message.error('获取数据失败');
})
.finally(() => {
this.setState({ loading: false }); this.setState({ loading: false });
}); });
} }
// 重置 // 重置
handleReset = () => { handleReset = () => {
if (this.formRef.current) { sessionStorage.removeItem('examPaperListFormValues');
// 重置表单字段
this.formRef.current.resetFields(); this.formRef.current.resetFields();
// 重置 listQuery 状态
this.setState({
listQuery: {
industryId: undefined,
paperName: undefined
},
selectedRowKeys: [],
});
}
}; };
// 删除(明细) // 删除问题
deleteSingle = (id: number) => { handleDeleteExamPaper = (id: number) => {
Modal.confirm({ Modal.confirm({
title: '确认删除', title: '确认删除',
content: '你确定要删除这个问题吗?', content: '你确定要删除这个试卷吗?',
onOk: () => { onOk: () => {
deleteSingle(id).then((res) => { const idList = [id];
const isSuccess = res.data; delExamPaper(idList).then((res) => {
if (isSuccess) { const success = res['success'];
if (success) {
message.success('删除成功'); message.success('删除成功');
this.getList(); this.handlegetList();
} else { } else {
message.error('删除失败,请稍后重试'); message.error('删除失败,请稍后重试');
} }
@ -111,23 +107,23 @@ class ExamPaperList extends Component<any, States> {
}); });
}; };
// 删除 // 批量删除问题
deleteMultiple = () => { handleBatchDeleteExamPaper = () => {
const { selectedRowKeys } = this.state; const { selectedRowKeys } = this.state;
if (selectedRowKeys.length === 0) { if (selectedRowKeys.length === 0) {
message.warning('请选择要删除的问题'); message.warning('请选择要删除的试卷');
return; return;
} }
Modal.confirm({ Modal.confirm({
title: '确认删除', title: '确认删除',
content: '你确定要删除这些选中的问题吗?', content: '你确定要删除这些选中的试卷吗?',
onOk: () => { onOk: () => {
deleteMultiple(selectedRowKeys) delExamPaper(selectedRowKeys)
.then((res) => { .then((res) => {
const isSuccess = res.data; const success = res['success'];
if (isSuccess) { if (success) {
message.success('删除成功'); message.success('删除成功');
this.getList(); this.handlegetList();
} else { } else {
message.error('删除失败,请稍后重试'); message.error('删除失败,请稍后重试');
} }
@ -141,72 +137,66 @@ class ExamPaperList extends Component<any, States> {
}); });
}; };
// 多选 // 行选择
onChange = (selectedRowKeys: React.Key[]) => { handleOnChange = (selectedRowKeys: React.Key[]) => {
this.setState({ this.setState({
selectedRowKeys: selectedRowKeys as number[], selectedRowKeys: selectedRowKeys as number[],
}); });
}; };
// 更新试卷状态 // 更新试卷状态
updatePaperStatus = (id: number, paperStatus: number) => { handleUpdatePaperStatus = (id: number, paperStatus: number) => {
const newStatus = paperStatus === 0? '启用' : '停用'; const newStatus = paperStatus === 0? 1 : 0;
updatePaperStatus(id, paperStatus).then((res) => { const newStatusText = paperStatus === 0? '启用' : '停用';
const isSuccess = res.data; const idList = [id];
if (isSuccess) { upPaperStatus(idList, newStatus).then((res) => {
message.success(`${newStatus}成功`); const success = res['success'];
const status = paperStatus === 0? 1 : 0; if (success) {
message.success(`${newStatusText}成功`);
this.setState((prevState) => ({ this.setState((prevState) => ({
list: prevState.list.map((item) => list: prevState.list.map((item) =>
item.id === id? { ...item, paperStatus: status } : item item.id === id? { ...item, paperStatus: newStatus } : item
) )
})); }));
} else { } else {
message.error(`${newStatus}失败,请稍后重试`); message.error(`${newStatusText}失败,请稍后重试`);
} }
}).catch(() => { }).catch(() => {
message.error(`${newStatus}时发生错误,请检查`); message.error(`${newStatusText}时发生错误,请检查`);
}); });
}; };
// 批量更新试卷状态 // 批量更新试卷状态
batchUpdatePaperStatus = (paperStatus: number) => { handleBatchUpdatePaperStatus = (paperStatus: number) => {
const newStatus = paperStatus === 0? 1 : 0;
const newStatusText = paperStatus === 0? '启用' : '停用';
const { selectedRowKeys } = this.state; const { selectedRowKeys } = this.state;
if (selectedRowKeys.length === 0) { if (selectedRowKeys.length === 0) {
message.warning('请选择要操作的试卷'); message.warning('请选择要操作的试卷');
return; return;
} }
const newStatus = paperStatus === 0? '启用' : '停用';
const { list } = this.state;
const selectedRecords = list.filter(record => selectedRowKeys.includes(record.id));
const invalidRecords = selectedRecords.filter(record => record.paperStatus !== paperStatus);
if (invalidRecords.length > 0) {
message.warning(`部分试卷已经处于${newStatus}状态,请重新选择`);
return;
}
Modal.confirm({ Modal.confirm({
title: `确认${newStatus}`, title: `确认${newStatusText}`,
content: `你确定要${newStatus}这些选中的试卷吗?`, content: `你确定要${newStatusText}这些选中的试卷吗?`,
onOk: () => { onOk: () => {
batchUpdatePaperStatus(selectedRecords) upPaperStatus(selectedRowKeys, newStatus)
.then((res) => { .then((res) => {
const isSuccess = res.data; const success = res['success'];
if (isSuccess) { if (success) {
message.success(`${newStatus}成功`); message.success(`${newStatusText}成功`);
const status = paperStatus === 0? 1 : 0;
this.setState((prevState) => ({ this.setState((prevState) => ({
list: prevState.list.map((item) => list: prevState.list.map((item) =>
selectedRowKeys.includes(item.id) selectedRowKeys.includes(item.id)
? { ...item, paperStatus: status } : item ? { ...item, paperStatus: newStatus } : item
) )
})); }));
} else { } else {
message.error(`${newStatus}失败,请稍后重试`); message.error(`${newStatusText}失败,请稍后重试`);
} }
}) })
.catch(() => { .catch(() => {
message.error(`${newStatus}时发生错误,请检查`); message.error(`${newStatusText}时发生错误,请检查`);
}); });
}, },
onCancel: () => { onCancel: () => {
@ -215,41 +205,88 @@ class ExamPaperList extends Component<any, States> {
}; };
render() { render() {
const onFinish = (values: object) => { const {
const _listQuery = { ...this.state.listQuery, ...values }; industryDict,
this.setState({ listQuery: _listQuery }); selectedRowKeys,
this.getList(); list,
}; loading,
page,
num
} = this.state;
const { industryDict, selectedRowKeys } = this.state; const changePage = (current: number, pageSize: number) => {
setTimeout(() => {
this.setState({ page: current, num: pageSize });
this.handlegetList();
}, 0);
};
const columns: any = [ const columns: any = [
{ title: '序号', dataIndex: 'index', key: 'index', align: 'center', width: 60, {
title: '序号',
dataIndex: 'index',
key: 'index',
align: 'center',
width: 60,
render: (_: number, __: number, index: number) => { render: (_: number, __: number, index: number) => {
const { page, num } = this.state;
return (page - 1) * num + index + 1; return (page - 1) * num + index + 1;
} }
}, },
{ title: '试卷名称', dataIndex: 'paperName', key: 'paperName', align: 'center', width: 300 }, {
{ title: '监管行业', dataIndex: 'industryId', key: 'industryId', align: 'center', width: 150, title: '试卷名称',
render: (industryId:any) => { dataIndex: 'paperName',
const industry = industryDict?.find((item: { industryId: string | number; industryName: string }) => String(item.industryId) === String(industryId)); key: 'paperName',
align: 'center',
width: 300
},
{
title: '监管行业',
dataIndex: 'industryId',
key: 'industryId',
align: 'center',
width: 150,
render: (industryId: any) => {
const industry = industryDict?.find((item: any) => item.industryId === String(industryId));
return industry? industry.industryName : industryId; return industry? industry.industryName : industryId;
} }
}, },
{ title: '题目数量', dataIndex: 'questionCount', key: 'questionCount', align: 'center', width: 120 }, {
{ title: '总分值', dataIndex: 'totalScore', key: 'totalScore', align: 'center', width: 90 }, title: '题目数量',
{ title: '考试时长', dataIndex: 'examDuration', key: 'examDuration', align: 'center', width: 120 }, dataIndex: 'questionCount',
{ title: '状态', dataIndex: 'paperStatus', key: 'paperStatus', align: 'center', width: 60, key: 'questionCount',
render: (paperStatus:any) => { align: 'center',
if (paperStatus === 0) { width: 120
return '停用'; },
} else if (paperStatus === 1) { {
return '启用'; title: '总分值',
dataIndex: 'totalScore',
key: 'totalScore',
align: 'center',
width: 90
},
{
title: '考试时长',
dataIndex: 'examDuration',
key: 'examDuration',
align: 'center',
width: 120
},
{
title: '状态',
dataIndex: 'paperStatus',
key: 'paperStatus',
align: 'center',
width: 60,
render: (paperStatus: any) => {
return paperStatus === 0? '停用' : '启用';
} }
return paperStatus;}
}, },
{ title: '操作', key: 'operation', align: 'center', fixed: 'right', width: 200, {
title: '操作',
key: 'operation',
align: 'center',
fixed: 'right',
width: 200,
render: (record: any) => [ render: (record: any) => [
<span className='mr10 link' onClick={() => { <span className='mr10 link' onClick={() => {
sessionStorage.setItem('id', String(record.id)); sessionStorage.setItem('id', String(record.id));
@ -261,48 +298,31 @@ class ExamPaperList extends Component<any, States> {
this.props.history.push(`/examPaperView`); this.props.history.push(`/examPaperView`);
}}></span>, }}></span>,
<span className='mr10 link' onClick={() => { <span className='mr10 link' onClick={() => {
this.updatePaperStatus(record.id, record.paperStatus); // 调用更新状态的方法 this.handleUpdatePaperStatus(record.id, record.paperStatus);
}}>{record.paperStatus === 0? '启用' : '停用'}</span>, // 根 }}>{record.paperStatus === 0? '启用' : '停用'}</span>,
<span className="mr10 link" onClick={() => { <span className="mr10 link" onClick={() => {
this.deleteSingle(record.id); this.handleDeleteExamPaper(record.id);
}}></span> }}></span>
] ]
}, },
]; ];
// 分页切换
const changePage = (current: number, pageSize?: number) => {
setTimeout(() => {
this.setState({page: current, num: pageSize || 20});
this.getList();
}, 0);
};
// 多少每页
const selectChange = (page: number, num: number) => {
this.setState({ page, num });
this.getList();
};
const { list, loading } = this.state;
return ( return (
<div className="container">
<div className="list-filter"> <div className="list-filter">
<Form <Form
ref={this.formRef} ref={this.formRef}
className="filter" className="filter"
layout="inline" layout="inline"
name="basic"
onFinish={onFinish}
> >
<Form.Item <Form.Item
label="监管行业:" label="监管行业:"
name="industryId" name="industryId"
> >
<Select placeholder="请选择监管行业" <Select
placeholder="请选择监管行业"
style={{ width: 240 }} style={{ width: 240 }}
allowClear> allowClear
>
{ {
industryDict && industryDict.length > 0? industryDict && industryDict.length > 0?
(() => { (() => {
@ -324,36 +344,33 @@ class ExamPaperList extends Component<any, States> {
label="试卷名称:" label="试卷名称:"
name="paperName" name="paperName"
> >
<Input placeholder="请输入试卷名称" style={{ width: 240 }}/> <Input placeholder="请输入试卷名称" style={{ width: 240 }} />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="default" onClick={this.handleReset}></Button> <Button type="default" onClick={this.handleReset}></Button>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit"></Button> <Button type="primary" htmlType="submit" onClick={() => {
this.handlegetList();
}}></Button>
</Form.Item> </Form.Item>
</Form> </Form>
</div>
<Form <Form
className="filter" className="filter"
layout="inline" layout="inline"
name="basic" style={{ justifyContent: 'flex-end' }}
onFinish={onFinish}
style={{ display: 'flex', justifyContent: 'flex-end' }}
> >
<Form.Item> <Form.Item>
<Button type="default" onClick={this.deleteMultiple}></Button> <Button type="default" onClick={this.handleBatchDeleteExamPaper}></Button>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="default" onClick={() => this.batchUpdatePaperStatus(1)}></Button> <Button type="default" onClick={() => this.handleBatchUpdatePaperStatus(1)}></Button>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="default" onClick={() => this.batchUpdatePaperStatus(0)}></Button> <Button type="default" onClick={() => this.handleBatchUpdatePaperStatus(0)}></Button>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" onClick={() => { <Button type="primary" onClick={() => { this.props.history.push(`/examPaperAdd`); }}></Button>
this.props.history.push(`/examPaperAdd`);
}}></Button>
</Form.Item> </Form.Item>
</Form> </Form>
<Table <Table
@ -363,7 +380,7 @@ class ExamPaperList extends Component<any, States> {
loading={loading} loading={loading}
rowSelection={{ rowSelection={{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: this.onChange, onChange: this.handleOnChange,
getCheckboxProps: () => ({ getCheckboxProps: () => ({
disabled: false disabled: false
}) })
@ -374,7 +391,6 @@ class ExamPaperList extends Component<any, States> {
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
showTotal: (total) => `${total}`, showTotal: (total) => `${total}`,
onShowSizeChange: selectChange,
onChange: changePage onChange: changePage
}} }}
/> />
@ -382,5 +398,4 @@ class ExamPaperList extends Component<any, States> {
); );
} }
} }
export default ExamPaperList; export default ExamPaperList;

@ -1,68 +1,64 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Form, Input, Button, Radio, Checkbox, Select, message} from 'antd'; import { Form, Button, Radio, Checkbox, message } from 'antd';
import { getDetail} from 'api/examPaper'; import { getExamPaperDetail } from 'api/examPaper';
import { findIndustry} from 'api/question'; import { findIndustry } from 'api/question';
const { Option } = Select;
interface optionsState { interface optionsState {
value: string; value: string;
label: string; label: string;
} }
// 定义单个试题的状态接口
interface QuestionState { interface QuestionState {
id: string; id: number;
serviceTypeId: string; serviceTypeId: number;
questionTypes: string; questionTypes: number;
questionContent: string; questionContent: string;
answerOptions: optionsState[]; answerOptions: optionsState[];
answer: string | null; answer: string;
} }
// 定义组件的状态接口
interface States { interface States {
id: string | undefined; id: string;
industryDict: any; paperName: string;
paperName : string | undefined; industryId: number | undefined;
industryId : number | undefined; questionCount: number | undefined;
questionCount : number | undefined; totalScore: number | undefined;
totalScore : number | undefined; examDuration: string;
examDuration : string | undefined; durationType: number | undefined;
durationType : number | undefined; paperContent: string;
paperContent : string | undefined;
questions: QuestionState[]; questions: QuestionState[];
industryDict: any;
} }
class ExamPaperView extends Component<any, States> { class ExamPaperView extends Component<any, States> {
formRef: any; formRef: any;
constructor(props: any) { constructor(props: any) {
super(props); super(props);
this.formRef = React.createRef(); this.formRef = React.createRef();
this.state = { this.state = {
id: undefined, id: '',
industryDict: undefined, paperName: '',
paperName: undefined,
industryId: undefined, industryId: undefined,
questionCount: undefined, questionCount: undefined,
totalScore: undefined, totalScore: undefined,
examDuration: undefined, examDuration: '',
durationType: undefined, durationType: undefined,
paperContent: undefined, paperContent: '',
questions: [], questions: [],
industryDict: undefined
}; };
} }
// 初期
componentDidMount() { componentDidMount() {
this.handleFindIndustry();
const id = sessionStorage.getItem('id'); const id = sessionStorage.getItem('id');
sessionStorage.removeItem('id'); sessionStorage.removeItem('id');
this.findIndustry(); this.handleGetDetail(id);
this.getDetail(id);
} }
// 监管行业 // 监管行业
findIndustry() { handleFindIndustry() {
findIndustry().then((res: any) => { findIndustry().then((res: any) => {
if (res.data) { if (res.data) {
this.setState({ industryDict: res.data }); this.setState({ industryDict: res.data });
@ -71,8 +67,8 @@ class ExamPaperView extends Component<any, States> {
} }
// 试卷详情 // 试卷详情
getDetail = (id: string | null) => { handleGetDetail = (id: string | null) => {
getDetail(id).then((res: any) => { getExamPaperDetail(id).then((res: any) => {
if (res.data) { if (res.data) {
const newQuestions: QuestionState[] = res.data.data.map((questionData: any) => { const newQuestions: QuestionState[] = res.data.data.map((questionData: any) => {
const options = questionData.options.split(','); const options = questionData.options.split(',');
@ -81,54 +77,30 @@ class ExamPaperView extends Component<any, States> {
return { value, label }; return { value, label };
}); });
return { return {
id: String(questionData.id), id: questionData.id,
serviceTypeId: String(questionData.serviceTypeId), serviceTypeId: questionData.serviceTypeId,
questionTypes: String(questionData.questionTypes), questionTypes: questionData.questionTypes,
questionContent: String(questionData.questionContent), questionContent: String(questionData.questionContent),
answerOptions: answerOptions, answerOptions: answerOptions,
answer: String(questionData.answer) answer: String(questionData.answer)
}; };
}); });
const paperName = res.data.head.paperName;
const industryId = res.data.head.industryId;
const questionCount = res.data.head.questionCount;
const totalScore = res.data.head.totalScore;
const examDuration = res.data.head.examDuration;
const durationType = res.data.head.durationType;
const paperContent = res.data.head.paperContent;
this.setState({ this.setState({
questions: newQuestions, questions: newQuestions,
paperName, paperName: res.data.head.paperName,
industryId, industryId: res.data.head.industryId,
questionCount, questionCount: res.data.head.questionCount,
totalScore, totalScore: res.data.head.totalScore,
examDuration, examDuration: res.data.head.examDuration,
durationType, durationType: res.data.head.durationType,
paperContent, paperContent: res.data.head.paperContent
}); });
} }
}).catch(() => { }).catch(() => {
message.error('获取题目详情失败,请重试'); message.error('获取题目详情失败,请重试');
}); });
}; };
findDurationTypeName = (durationType:number | undefined) => {
switch (durationType) {
case 1:
return '分(min)';
case 2:
return '时(h)';
default:
return '未知';
}
};
findIndustryName = (industryId:number | undefined) => {
const { industryDict } = this.state;
if (industryDict) {
const industry = industryDict.find((item:any) => item.industryId === String(industryId));
return industry ? industry.industryName : '未知行业';
}
return '未知行业';
};
render() { render() {
const { const {
questions, questions,
@ -139,11 +111,18 @@ class ExamPaperView extends Component<any, States> {
examDuration, examDuration,
durationType, durationType,
paperContent, paperContent,
industryDict
} = this.state; } = this.state;
// 页面跳转
const handleListQuestion = () => { const handleFindDurationTypeName = (durationType: number | undefined) => {
this.props.history.push('/examPaperList'); return durationType === 1? '分(min)' : '时(h)';
};
const handleFindIndustryName = (industryId: number | undefined) => {
const industry = industryDict?.find((item: any) => item.industryId === String(industryId));
return industry? industry.industryName : industryId;
}; };
return ( return (
<div className="container"> <div className="container">
<Form ref={this.formRef}> <Form ref={this.formRef}>
@ -153,7 +132,7 @@ class ExamPaperView extends Component<any, States> {
</Form.Item> </Form.Item>
<div style={{ display: 'flex', gap: 20 }}> <div style={{ display: 'flex', gap: 20 }}>
<Form.Item label="监管行业:"> <Form.Item label="监管行业:">
<span>{this.findIndustryName(industryId)}</span> <span>{handleFindIndustryName(industryId)}</span>
</Form.Item> </Form.Item>
<Form.Item label="题目数量:"> <Form.Item label="题目数量:">
<span>{questionCount}</span> <span>{questionCount}</span>
@ -165,7 +144,7 @@ class ExamPaperView extends Component<any, States> {
<span>{examDuration}</span> <span>{examDuration}</span>
</Form.Item> </Form.Item>
<Form.Item label=""> <Form.Item label="">
<span>{this.findDurationTypeName(durationType)}</span> <span>{handleFindDurationTypeName(durationType)}</span>
</Form.Item> </Form.Item>
</div> </div>
<Form.Item label="内容描述:"> <Form.Item label="内容描述:">
@ -184,7 +163,7 @@ class ExamPaperView extends Component<any, States> {
> >
<span style={{ fontWeight: 'bold' }}>{index + 1}. {question.questionContent}</span> <span style={{ fontWeight: 'bold' }}>{index + 1}. {question.questionContent}</span>
<Form.Item> <Form.Item>
{question.questionTypes === '1'? ( {question.questionTypes === 1? (
<Radio.Group value={question.answer}> <Radio.Group value={question.answer}>
{question.answerOptions.map((option) => ( {question.answerOptions.map((option) => (
<Radio value={option.value}> <Radio value={option.value}>
@ -211,13 +190,12 @@ class ExamPaperView extends Component<any, States> {
bottom: 10, bottom: 10,
right: 10, right: 10,
width: '100%', width: '100%',
backgroundColor: 'white',
zIndex: 1000 zIndex: 1000
}} }}
> >
<Button type="default" htmlType="button" onClick={ <Button type="default" htmlType="button" onClick={() => {
handleListQuestion this.props.history.push('/examPaperList');
}> }}>
</Button> </Button>
</div> </div>
@ -226,4 +204,5 @@ class ExamPaperView extends Component<any, States> {
); );
} }
} }
export default ExamPaperView; export default ExamPaperView;

@ -1,21 +1,23 @@
import React, { Component } from'react'; import React, { Component } from "react";
import { Form, Input, Button, Radio, Checkbox, Select, message } from 'antd'; import { Form, Input, Button, Radio, Checkbox, Select, message } from "antd";
import { dictionary } from "api/dict/index"; import { dictionary } from "api/dict/index";
import { addQuestion, findIndustry } from 'api/question'; import { addQuestion, findIndustry } from "api/question";
import * as XLSX from 'xlsx'; import * as XLSX from "xlsx";
import { saveAs } from 'file-saver'; import { saveAs } from "file-saver";
const { Option} = Select; const { Option } = Select;
interface States { interface States {
industryDict: any; industryDict: any;
serviceTypeDict: any; serviceTypeDict: any;
formCount: number; formIds: string[];
questionTypesMap: { [formId: string]: string };
} }
class QuestionAdd extends Component<any, States> { class QuestionAdd extends Component<any, States> {
formRef: any; formRef: any;
fileInputRef: any; fileInputRef: any;
constructor(props: any) { constructor(props: any) {
super(props); super(props);
this.formRef = React.createRef(); this.formRef = React.createRef();
@ -23,12 +25,20 @@ class QuestionAdd extends Component<any, States> {
this.state = { this.state = {
industryDict: [], industryDict: [],
serviceTypeDict: [], serviceTypeDict: [],
formCount: 1 formIds: ["form_0"],
questionTypesMap: { "form_0": "1" }
};
const formValues = {};
formValues[`questionTypes_form_0`] = '1';
this.componentDidMount = () => {
this.formRef.current?.setFieldsValue(formValues);
this.handleFindDict();
}; };
} }
componentDidMount() { componentDidMount() {
this.handleFindDict();
} }
// 字典 // 字典
@ -41,83 +51,142 @@ class QuestionAdd extends Component<any, States> {
} }
}) })
.catch(() => { .catch(() => {
message.error('获取监管行业字典数据失败,请稍后重试'); message.error("获取监管行业字典数据失败,请稍后重试");
}); });
// AQ服务类型 // AQ服务类型
dictionary('serviceTypeDict') dictionary("serviceTypeDict")
.then((res) => { .then((res) => {
if (res.data) { if (res.data) {
this.setState({ serviceTypeDict: res.data }); this.setState({ serviceTypeDict: res.data });
} }
}) })
.catch(() => { .catch(() => {
message.error('获取AQ服务类型字典数据失败,请稍后重试'); message.error("获取AQ服务类型字典数据失败,请稍后重试");
}); });
} }
// 题型切换 // 题型切换
handleQuestionTypeChange = (index: number, value: string) => { handleQuestionTypeChange = (formId: string, value: string) => {
const { questionTypesMap } = this.state;
const formValues = {}; const formValues = {};
formValues[`questionTypes_${index}`] = value; formValues[`questionTypes_${formId}`] = value;
formValues[`answer_${index}`] = '';
this.formRef.current.setFieldsValue(formValues); this.formRef.current.setFieldsValue(formValues);
this.setState((prevState) => ({
questionTypesMap: {
...prevState.questionTypesMap,
[formId]: value
}
}));
}; };
// 新增试题 // 新增试题
handleAddNewQuestion = () => { handleAddNewQuestion = () => {
const { formIds } = this.state;
const newId = `form_${formIds.length}`;
const formValues = {
[`questionTypes_${newId}`]: "1"
};
this.formRef.current.setFieldsValue(formValues);
this.setState((prevState) => ({ this.setState((prevState) => ({
formCount: prevState.formCount + 1, formIds: [...prevState.formIds, newId],
questionTypesMap: {
...prevState.questionTypesMap,
[newId]: "1"
}
})); }));
}; };
// 删除试题 // 删除试题
handleDeleteQuestion = (index: number) => { handleDeleteQuestion = (formId: string) => {
const formValues = {};
const fields = [
"questionTypes",
"industryId",
"serviceTypeId",
"questionContent",
"optionA",
"optionB",
"optionC",
"optionD",
"answer"
];
fields.forEach((field) => {
formValues[`${field}_${formId}`] = undefined;
});
this.formRef.current.setFieldsValue(formValues);
const { questionTypesMap } = this.state;
const newQuestionTypesMap = { ...questionTypesMap };
delete newQuestionTypesMap[formId];
this.setState((prevState) => ({ this.setState((prevState) => ({
formCount: prevState.formCount - 1, formIds: prevState.formIds.filter((id) => id!== formId),
questionTypesMap: newQuestionTypesMap
})); }));
}; };
// 处理表单提交 // 表单提交
handleSubmit = () => { handleSubmit = () => {
this.formRef.current.validateFields().then((values: any) => { this.formRef.current.validateFields().then((values: any) => {
const questions = []; const questions: any = [];
for (let i = 0; i < this.state.formCount; i++) { const { formIds } = this.state;
const question = {
questionTypes: values[`questionTypes_${i}`], formIds.forEach((formId) => {
industryId: values[`industryId_${i}`], let answer = values[`answer_${formId}`];
serviceTypeId: values[`serviceTypeId_${i}`], if (Array.isArray(answer)) {
questionContent: values[`questionContent_${i}`], answer.sort();
optionA: values[`optionA_${i}`], answer = answer.join(",");
optionB: values[`optionB_${i}`],
optionC: values[`optionC_${i}`],
optionD: values[`optionD_${i}`],
answer: values[`answer_${i}`],
};
questions.push(question);
} }
questions.push({
questionTypes: values[`questionTypes_${formId}`],
industryId: values[`industryId_${formId}`],
serviceTypeId: values[`serviceTypeId_${formId}`],
questionContent: values[`questionContent_${formId}`],
optionA: values[`optionA_${formId}`],
optionB: values[`optionB_${formId}`],
optionC: values[`optionC_${formId}`],
optionD: values[`optionD_${formId}`],
answer: answer
});
});
addQuestion(questions).then((res) => { addQuestion(questions).then((res) => {
const success = res['success']; const success = res["success"];
if (success) { if (success) {
message.success(`新增成功`); message.success(`新增成功`);
this.props.history.push('/questionList'); this.props.history.push("/questionList");
} else { } else {
message.error('新增试题失败,请稍后重试'); message.error("新增试题失败,请稍后重试");
} }
}).catch(() => { }).catch(() => {
message.error('新增试题时发生错误,请检查'); message.error("新增试题时发生错误,请检查");
}); });
}); });
}; };
// 下载模板 // 下载模板
handleDownloadTemplate = () => { handleDownloadTemplate = () => {
const headers = ['题型', '监管行业', 'AQ服务类型', '题干', '选项A', '选项B', '选项C', '选项D', '答案']; const headers = [
"题型",
"监管行业",
"AQ服务类型",
"题干",
"选项A",
"选项B",
"选项C",
"选项D",
"答案"
];
const ws = XLSX.utils.aoa_to_sheet([headers]); const ws = XLSX.utils.aoa_to_sheet([headers]);
const wb = XLSX.utils.book_new(); const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, '试题模板'); XLSX.utils.book_append_sheet(wb, ws, "试题模板");
const wbOut = XLSX.write(wb, { bookType: 'xlsx', type: 'array' }); const wbOut = XLSX.write(wb, { bookType: "xlsx", type: "array" });
saveAs(new Blob([wbOut], { type: 'application/octet-stream' }), '试题模板.xlsx'); saveAs(new Blob([wbOut], { type: "application/octet-stream" }), "试题模板.xlsx");
}; };
// 一键导入 // 一键导入
@ -127,24 +196,31 @@ class QuestionAdd extends Component<any, States> {
const reader = new FileReader(); const reader = new FileReader();
reader.onload = (event) => { reader.onload = (event) => {
const data = new Uint8Array(event.target?.result as ArrayBuffer); const data = new Uint8Array(event.target?.result as ArrayBuffer);
const workbook = XLSX.read(data, { type: 'array' }); const workbook = XLSX.read(data, { type: "array" });
const firstSheetName = workbook.SheetNames[0]; const firstSheetName = workbook.SheetNames[0];
const worksheet = workbook.Sheets[firstSheetName]; const worksheet = workbook.Sheets[firstSheetName];
const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }); const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 });
const rows = jsonData.slice(1); const rows = jsonData.slice(1);
const formValues = {}; const formValues = {};
const formIds: string[] = [];
const questionTypesMap = {};
rows.forEach((row: any, index) => { rows.forEach((row: any, index) => {
formValues[`questionTypes_${index}`] = String(row[0]); const formId = `form_${index}`;
formValues[`industryId_${index}`] = String(row[1]); formIds.push(formId);
formValues[`serviceTypeId_${index}`] = String(row[2]); formValues[`questionTypes_${formId}`] = String(row[0]);
formValues[`questionContent_${index}`] = String(row[3]); formValues[`industryId_${formId}`] = String(row[1]);
formValues[`optionA_${index}`] = String(row[4]); formValues[`serviceTypeId_${formId}`] = String(row[2]);
formValues[`optionB_${index}`] = String(row[5]); formValues[`questionContent_${formId}`] = String(row[3]);
formValues[`optionC_${index}`] = String(row[6]); formValues[`optionA_${formId}`] = String(row[4]);
formValues[`optionD_${index}`] = String(row[7]); formValues[`optionB_${formId}`] = String(row[5]);
formValues[`answer_${index}`] = String(row[8]); formValues[`optionC_${formId}`] = String(row[6]);
formValues[`optionD_${formId}`] = String(row[7]);
formValues[`answer_${formId}`] = String(row[8]);
questionTypesMap[formId] = String(row[0]);
}); });
this.setState({ formCount: rows.length }, () => {
this.setState({ formIds, questionTypesMap }, () => {
this.formRef.current.setFieldsValue(formValues); this.formRef.current.setFieldsValue(formValues);
}); });
}; };
@ -157,50 +233,56 @@ class QuestionAdd extends Component<any, States> {
} }
}; };
// 文件
handleImportClick = () => { handleImportClick = () => {
this.fileInputRef.current?.click(); this.fileInputRef.current?.click();
}; };
render() { render() {
const { industryDict, serviceTypeDict, formCount } = this.state; const { industryDict, serviceTypeDict, formIds, questionTypesMap } = this.state;
const handleListQuestion = () => { const handleListQuestion = () => {
this.props.history.push('/questionList'); this.props.history.push("/questionList");
}; };
return ( return (
<div className="container"> <div className="container">
<div style={{textAlign: 'right'}}> <div style={{ textAlign: "right" }}>
<Button type="default" style={{marginRight: 10}} onClick={this.handleDownloadTemplate}></Button> <Button type="default" style={{ marginRight: 10 }} onClick={this.handleDownloadTemplate}>
<Button type="default" onClick={this.handleImportClick}></Button>
</Button>
<Button type="default" onClick={this.handleImportClick}>
</Button>
<input <input
type="file" type="file"
ref={this.fileInputRef} ref={this.fileInputRef}
style={{display: 'none'}} style={{ display: "none" }}
accept=".xlsx,.xls" accept=".xlsx,.xls"
onChange={this.handleFileChange} onChange={this.handleFileChange}
/> />
</div> </div>
<Form ref={this.formRef} layout="inline"> <Form ref={this.formRef} layout="inline">
{Array.from({ length: formCount }, (_, index) => ( {formIds.map((formId, index) => (
<div key={index} style={{marginBottom: 30}}> <div key={formId} style={{ marginBottom: 30 }}>
<div style={{display: 'flex'}}> <div style={{ display: "flex" }}>
<Form.Item name={`questionTypes_${index}`}> <Form.Item name={`questionTypes_${formId}`}>
<Radio.Group <Radio.Group
onChange={(e) => this.handleQuestionTypeChange(index, e.target.value)}> onChange={(e) => this.handleQuestionTypeChange(formId, e.target.value)}
>
<Radio.Button value="1"></Radio.Button> <Radio.Button value="1"></Radio.Button>
<Radio.Button value="2"></Radio.Button> <Radio.Button value="2"></Radio.Button>
</Radio.Group> </Radio.Group>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="监管行业:" label="监管行业:"
name={`industryId_${index}`} name={`industryId_${formId}`}
rules={[{required: true, message: '请选择监管行业'}]} rules={[{ required: true, message: "请选择监管行业" }]}
> >
<Select placeholder="请选择监管行业" <Select
style={{width: 240}} placeholder="请选择监管行业"
allowClear> style={{ width: 240 }}
{ allowClear
industryDict && industryDict.length > 0 ? >
{industryDict && industryDict.length > 0? (
(() => { (() => {
let rows = []; let rows = [];
for (let i = 0; i < industryDict.length; i++) { for (let i = 0; i < industryDict.length; i++) {
@ -211,103 +293,123 @@ class QuestionAdd extends Component<any, States> {
} }
return rows; return rows;
})() })()
: ) : (
<Option disabled></Option> <Option disabled></Option>
} )}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="AQ服务类型:" label="AQ服务类型:"
name={`serviceTypeId_${index}`} name={`serviceTypeId_${formId}`}
rules={[{required: true, message: '请选择AQ服务类型'}]} rules={[{ required: true, message: "请选择AQ服务类型" }]}
>
<Select
placeholder="请选择AQ服务类型"
style={{ width: 240 }}
allowClear
> >
<Select placeholder="请选择AQ服务类型" {serviceTypeDict && serviceTypeDict.length > 0? (
style={{width: 240}}
allowClear>
{
serviceTypeDict && serviceTypeDict.length > 0 ?
(() => { (() => {
let rows = []; let rows = [];
for (let i = 0; i < serviceTypeDict.length; i++) { for (let i = 0; i < serviceTypeDict.length; i++) {
const item = serviceTypeDict[i]; const item = serviceTypeDict[i];
rows.push( rows.push(
<Option <Option value={String(item.dictKey)}>{item.dictValue}</Option>
value={String(item.dictKey)}>{item.dictValue}</Option>
); );
} }
return rows; return rows;
})() })()
: ) : (
<Option disabled></Option> <Option disabled></Option>
} )}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
{index > 0 && ( {index > 0 && (
<Button type="link" onClick={() => this.handleDeleteQuestion(index)}>X</Button>)} <Button type="link" onClick={() => this.handleDeleteQuestion(formId)}>
X
</Button>
)}
</Form.Item> </Form.Item>
</div> </div>
<div style={{display: 'flex'}}> <div style={{ display: "flex" }}>
<Form.Item <Form.Item
label="题干:" label="题干:"
name={`questionContent_${index}`} name={`questionContent_${formId}`}
style={{marginTop: 10}} style={{ marginTop: 10 }}
rules={[{required: true, message: '请输入题干内容'}]} rules={[{ required: true, message: "请输入题干内容" }]}
> >
<Input.TextArea <Input.TextArea
placeholder="请输入题干内容" placeholder="请输入题干内容"
style={{width: 1100, height: 60}} style={{ width: 1100, height: 60 }}
/> />
</Form.Item> </Form.Item>
</div> </div>
<div style={{marginTop: 10, marginLeft: 40}}> <div style={{ marginTop: 10, marginLeft: 40 }}>
<div style={{display: 'flex'}}> <div style={{ display: "flex" }}>
<Form.Item <Form.Item
name={`answer_${index}`} name={`answer_${formId}`}
rules={[{ required: true, message: '请选择答案' }]}> rules={[{ required: true, message: "请选择答案" }]}
{this.formRef.current && this.formRef.current.getFieldValue(`questionTypes_${index}`) === '1' ? ( >
{questionTypesMap[formId] === "1"? (
<Radio.Group> <Radio.Group>
<div style={{display: 'flex'}}> <div style={{ display: "flex" }}>
<Radio value="A">A</Radio> <Radio value="A">A</Radio>
<Form.Item name={`optionA_${index}`} rules={[{required: true, message: '请输入答案A'}]}> <Form.Item name={`optionA_${formId}`}
<Input placeholder="请输入答案" style={{width: 500}}/> rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
</Form.Item> </Form.Item>
<Radio value="B">B</Radio> <Radio value="B">B</Radio>
<Form.Item name={`optionB_${index}`} rules={[{required: true, message: '请输入答案B'}]}> <Form.Item name={`optionB_${formId}`}
<Input placeholder="请输入答案" style={{width: 500}}/> rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
</Form.Item> </Form.Item>
</div> </div>
<div style={{display: 'flex', marginTop: 10}}> <div style={{ display: "flex", marginTop: 10 }}>
<Radio value="C">C</Radio> <Radio value="C">C</Radio>
<Form.Item name={`optionC_${index}`} rules={[{required: true, message: '请输入答案C'}]}> <Form.Item name={`optionC_${formId}`}
<Input placeholder="请输入答案" style={{width: 500}}/> rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
</Form.Item> </Form.Item>
<Radio value="D">D</Radio> <Radio value="D">D</Radio>
<Form.Item name={`optionD_${index}`} rules={[{required: true, message: '请输入答案D'}]}> <Form.Item name={`optionD_${formId}`}
<Input placeholder="请输入答案" style={{width: 500}}/> rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
</Form.Item> </Form.Item>
</div> </div>
</Radio.Group> </Radio.Group>
) : ( ) : (
<Checkbox.Group> <Checkbox.Group>
<div style={{display: 'flex'}}> <div style={{ display: "flex" }}>
<Checkbox value="A">A</Checkbox> <Checkbox value="A">A</Checkbox>
<Form.Item name={`optionA_${index}`} rules={[{required: true, message: '请输入答案A'}]}> <Form.Item name={`optionA_${formId}`}
<Input placeholder="请输入答案" style={{width: 500}}/> rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
</Form.Item> </Form.Item>
<Checkbox value="B">B</Checkbox> <Checkbox value="B">B</Checkbox>
<Form.Item name={`optionB_${index}`} rules={[{required: true, message: '请输入答案B'}]}> <Form.Item name={`optionB_${formId}`}
<Input placeholder="请输入答案" style={{width: 500}}/> rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
</Form.Item> </Form.Item>
</div> </div>
<div style={{display: 'flex', marginTop: 10}}> <div style={{ display: "flex", marginTop: 10 }}>
<Checkbox value="C">C</Checkbox> <Checkbox value="C">C</Checkbox>
<Form.Item name={`optionC_${index}`} rules={[{required: true, message: '请输入答案C'}]}> <Form.Item name={`optionC_${formId}`}
<Input placeholder="请输入答案" style={{width: 500}}/> rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
</Form.Item> </Form.Item>
<Checkbox value="D">D</Checkbox> <Checkbox value="D">D</Checkbox>
<Form.Item name={`optionD_${index}`} rules={[{required: true, message: '请输入答案D'}]}> <Form.Item name={`optionD_${formId}`}
<Input placeholder="请输入答案" style={{width: 500}}/> rules={[{ required: true, message: "请输入答案" }]}
>
<Input placeholder="请输入答案" style={{ width: 500 }} />
</Form.Item> </Form.Item>
</div> </div>
</Checkbox.Group> </Checkbox.Group>
@ -318,20 +420,20 @@ class QuestionAdd extends Component<any, States> {
</div> </div>
))} ))}
</Form> </Form>
<div style={{textAlign: 'right'}}> <div style={{ textAlign: "right" }}>
<Button type="default" onClick={this.handleAddNewQuestion}> <Button type="default" onClick={this.handleAddNewQuestion}>
</Button> </Button>
</div> </div>
<div style={{ <div style={{
textAlign: 'right', textAlign: "right",
position: 'fixed', position: "fixed",
bottom: 10, bottom: 10,
right: 10, right: 10,
width: '100%', width: "100%",
zIndex: 1000 zIndex: 1000
}}> }}>
<Button type="default" htmlType="button" onClick={handleListQuestion} style={{marginRight: 10}}> <Button type="default" htmlType="button" onClick={handleListQuestion} style={{ marginRight: 10 }}>
</Button> </Button>
<Button type="primary" htmlType="submit" onClick={this.handleSubmit}> <Button type="primary" htmlType="submit" onClick={this.handleSubmit}>

@ -51,7 +51,7 @@ class QuestionEdit extends Component<any, States> {
sessionStorage.removeItem('id'); sessionStorage.removeItem('id');
getQuestionDetail(id).then((res: any) => { getQuestionDetail(id).then((res: any) => {
if (res.data) { if (res.data) {
//this.setState({ questionTypes: String(res.data.questionTypes) }); this.setState({ questionTypes: String(res.data.questionTypes) });
const formValues = {}; const formValues = {};
formValues['id'] = res.data.id; formValues['id'] = res.data.id;
formValues['questionTypes'] = String(res.data.questionTypes); formValues['questionTypes'] = String(res.data.questionTypes);
@ -78,9 +78,6 @@ class QuestionEdit extends Component<any, States> {
questionTypes: value questionTypes: value
}; };
}); });
const formValues = {};
formValues['answer'] = '';
this.formRef.current.setFieldsValue(formValues);
}; };
// 保存修改 // 保存修改
@ -199,7 +196,7 @@ class QuestionEdit extends Component<any, States> {
<Radio value="A">A</Radio> <Radio value="A">A</Radio>
<Form.Item <Form.Item
name={`optionA`} name={`optionA`}
rules={[{ required: true, message: '请输入答案A' }]} rules={[{ required: true, message: '请输入答案' }]}
> >
<Input <Input
placeholder="请输入答案" placeholder="请输入答案"
@ -209,7 +206,7 @@ class QuestionEdit extends Component<any, States> {
<Radio value="B">B</Radio> <Radio value="B">B</Radio>
<Form.Item <Form.Item
name={`optionB`} name={`optionB`}
rules={[{ required: true, message: '请输入答案B' }]} rules={[{ required: true, message: '请输入答案' }]}
> >
<Input <Input
placeholder="请输入答案" placeholder="请输入答案"
@ -221,7 +218,7 @@ class QuestionEdit extends Component<any, States> {
<Radio value="C">C</Radio> <Radio value="C">C</Radio>
<Form.Item <Form.Item
name={`optionC`} name={`optionC`}
rules={[{ required: true, message: '请输入答案C' }]} rules={[{ required: true, message: '请输入答案' }]}
> >
<Input <Input
placeholder="请输入答案" placeholder="请输入答案"
@ -231,7 +228,7 @@ class QuestionEdit extends Component<any, States> {
<Radio value="D">D</Radio> <Radio value="D">D</Radio>
<Form.Item <Form.Item
name={`optionD`} name={`optionD`}
rules={[{ required: true, message: '请输入答案D' }]} rules={[{ required: true, message: '请输入答案' }]}
> >
<Input <Input
placeholder="请输入答案" placeholder="请输入答案"
@ -246,7 +243,7 @@ class QuestionEdit extends Component<any, States> {
<Checkbox value="A">A</Checkbox> <Checkbox value="A">A</Checkbox>
<Form.Item <Form.Item
name={`optionA`} name={`optionA`}
rules={[{ required: true, message: '请输入答案A' }]} rules={[{ required: true, message: '请输入答案' }]}
> >
<Input <Input
placeholder="请输入答案" placeholder="请输入答案"
@ -256,7 +253,7 @@ class QuestionEdit extends Component<any, States> {
<Checkbox value="B">B</Checkbox> <Checkbox value="B">B</Checkbox>
<Form.Item <Form.Item
name={`optionB`} name={`optionB`}
rules={[{ required: true, message: '请输入答案B' }]} rules={[{ required: true, message: '请输入答案' }]}
> >
<Input <Input
placeholder="请输入答案" placeholder="请输入答案"
@ -268,7 +265,7 @@ class QuestionEdit extends Component<any, States> {
<Checkbox value="C">C</Checkbox> <Checkbox value="C">C</Checkbox>
<Form.Item <Form.Item
name={`optionC`} name={`optionC`}
rules={[{ required: true, message: '请输入答案C' }]} rules={[{ required: true, message: '请输入答案' }]}
> >
<Input <Input
placeholder="请输入答案" placeholder="请输入答案"
@ -278,7 +275,7 @@ class QuestionEdit extends Component<any, States> {
<Checkbox value="D">D</Checkbox> <Checkbox value="D">D</Checkbox>
<Form.Item <Form.Item
name={`optionD`} name={`optionD`}
rules={[{ required: true, message: '请输入答案D' }]} rules={[{ required: true, message: '请输入答案' }]}
> >
<Input <Input
placeholder="请输入答案" placeholder="请输入答案"

@ -35,12 +35,17 @@ class QuestionList extends Component<any, States> {
} }
componentDidMount() { componentDidMount() {
this.findDict(); this.handleFindDict();
const savedFormValues = sessionStorage.getItem('questionListFormValues');
if (savedFormValues) {
const values = JSON.parse(savedFormValues);
this.formRef.current.setFieldsValue(values);
}
this.handlegetList(); this.handlegetList();
} }
// 字典 // 字典
findDict() { handleFindDict() {
// 监管行业 // 监管行业
findIndustry() findIndustry()
.then((res: any) => { .then((res: any) => {
@ -75,7 +80,7 @@ class QuestionList extends Component<any, States> {
num, num,
page page
}; };
sessionStorage.setItem('questionListFormValues', JSON.stringify(values));
getList(data) getList(data)
.then((res) => { .then((res) => {
this.setState({ this.setState({
@ -94,6 +99,7 @@ class QuestionList extends Component<any, States> {
// 重置 // 重置
handleReset = () => { handleReset = () => {
sessionStorage.removeItem('questionListFormValues');
this.formRef.current.resetFields(); this.formRef.current.resetFields();
}; };
@ -156,20 +162,13 @@ class QuestionList extends Component<any, States> {
}; };
// 行选择 // 行选择
onChange = (selectedRowKeys: React.Key[]) => { handleOnChange = (selectedRowKeys: React.Key[]) => {
this.setState({ this.setState({
selectedRowKeys: selectedRowKeys as number[], selectedRowKeys: selectedRowKeys as number[],
}); });
}; };
render() { render() {
const changePage = (current: number, pageSize: number) => {
setTimeout(() => {
this.setState({ page: current, num: pageSize });
this.handlegetList();
}, 0);
};
const { const {
industryDict, industryDict,
serviceTypeDict, serviceTypeDict,
@ -180,6 +179,13 @@ class QuestionList extends Component<any, States> {
num num
} = this.state; } = this.state;
const changePage = (current: number, pageSize: number) => {
setTimeout(() => {
this.setState({ page: current, num: pageSize });
this.handlegetList();
}, 0);
};
const columns: any = [ const columns: any = [
{ {
title: '序号', title: '序号',
@ -288,7 +294,6 @@ class QuestionList extends Component<any, States> {
} }
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="AQ服务类型:" label="AQ服务类型:"
name="serviceTypeId" name="serviceTypeId"
@ -315,7 +320,6 @@ class QuestionList extends Component<any, States> {
} }
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="题干条件:" label="题干条件:"
name="questionContent" name="questionContent"
@ -325,18 +329,15 @@ class QuestionList extends Component<any, States> {
style={{ width: 240 }} style={{ width: 240 }}
/> />
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="default" onClick={this.handleReset}></Button> <Button type="default" onClick={this.handleReset}></Button>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit" onClick={() => { <Button type="primary" htmlType="submit" onClick={() => {
this.handlegetList(); this.handlegetList();
}}></Button> }}></Button>
</Form.Item> </Form.Item>
</Form> </Form>
<Form <Form
className="filter" className="filter"
layout="inline" layout="inline"
@ -345,14 +346,12 @@ class QuestionList extends Component<any, States> {
<Form.Item> <Form.Item>
<Button type="default" onClick={this.handleBatchDeleteQuestions}></Button> <Button type="default" onClick={this.handleBatchDeleteQuestions}></Button>
</Form.Item> </Form.Item>
<Form.Item> <Form.Item>
<Button type="primary" onClick={() => { <Button type="primary" onClick={() => {
this.props.history.push('/questionAdd'); this.props.history.push('/questionAdd');
}}></Button> }}></Button>
</Form.Item> </Form.Item>
</Form> </Form>
<Table <Table
dataSource={list} dataSource={list}
columns={columns} columns={columns}
@ -360,7 +359,7 @@ class QuestionList extends Component<any, States> {
loading={loading} loading={loading}
rowSelection={{ rowSelection={{
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: this.onChange, onChange: this.handleOnChange,
getCheckboxProps: () => ({ getCheckboxProps: () => ({
disabled: false disabled: false
}) })

Loading…
Cancel
Save