Commit ce1ef9ef by chenshu

fix:修复

parent c0fdfc4b
...@@ -554,6 +554,7 @@ class KnowledgeBaseList extends React.Component { ...@@ -554,6 +554,7 @@ class KnowledgeBaseList extends React.Component {
const { current, size } = query; const { current, size } = query;
const rowSelection = { const rowSelection = {
selectedRowKeys, selectedRowKeys,
preserveSelectedRowKeys: true,
onChange: onSelectChange, onChange: onSelectChange,
} }
return ( return (
......
...@@ -236,6 +236,7 @@ export default function KnowledgeBaseOpt({ ...@@ -236,6 +236,7 @@ export default function KnowledgeBaseOpt({
visible={openMoveModal} visible={openMoveModal}
title="知识" title="知识"
data={data} data={data}
categoryId={categoryId}
length={selectedRowKeys.length} length={selectedRowKeys.length}
onCancel={() => setOpenMoveModal(false)} onCancel={() => setOpenMoveModal(false)}
onOk={(categoryId) => { onOk={(categoryId) => {
......
...@@ -55,7 +55,7 @@ function ExaminationManager(props: any) { ...@@ -55,7 +55,7 @@ function ExaminationManager(props: any) {
const [modal, setModal] = useState(null); const [modal, setModal] = useState(null);
const [questionCntSort, setQuestionCntSort] = useState(sortState) const [questionCntSort, setQuestionCntSort] = useState(sortState)
const [openPreviewModal, setOpenPreviewModal] = useState(false); const [openPreviewModal, setOpenPreviewModal] = useState(false);
const [info, setInfo] = useState({}); const [info, setInfo] = useState({ examDuration: 0 });
const queryRef = useRef({}); const queryRef = useRef({});
const orderEnum = { const orderEnum = {
...@@ -430,7 +430,7 @@ function ExaminationManager(props: any) { ...@@ -430,7 +430,7 @@ function ExaminationManager(props: any) {
</div> </div>
{openPreviewModal && {openPreviewModal &&
<PreviewModal <PreviewModal
info={info} info={{ ...info, examDuration: (info.examDuration || 0) / 60000 }}
onClose={() => { setOpenPreviewModal(false) }} onClose={() => { setOpenPreviewModal(false) }}
/> />
} }
......
...@@ -14,9 +14,21 @@ class MoveModal extends React.Component { ...@@ -14,9 +14,21 @@ class MoveModal extends React.Component {
this.setState({ categoryId: value, categoryName: label[0] }); this.setState({ categoryId: value, categoryName: label[0] });
}; };
filterData = (data, id) => {
let newTreeData = data.map((item) => {
(id === item.id) && (item.disabled = true);
if (item.sonCategoryList) {
item.children = this.filterData(item.sonCategoryList);
}
return item;
});
return newTreeData;
}
render() { render() {
const { visible, title, onCancel, onOk, data, length } = this.props; const { visible, title, onCancel, onOk, data, length, categoryId: id } = this.props;
const { categoryId } = this.state; const { categoryId } = this.state;
const moveData = this.filterData(data, id);
return ( return (
<Modal <Modal
title={`移动${title}`} title={`移动${title}`}
...@@ -37,7 +49,7 @@ class MoveModal extends React.Component { ...@@ -37,7 +49,7 @@ class MoveModal extends React.Component {
treeNodeFilterProp="title" treeNodeFilterProp="title"
style={{ width: 240 }} style={{ width: 240 }}
dropdownStyle={{ maxHeight: 220 }} dropdownStyle={{ maxHeight: 220 }}
treeData={data} treeData={moveData}
placeholder="请选择分类" placeholder="请选择分类"
allowClear allowClear
value={categoryId} value={categoryId}
......
...@@ -519,6 +519,7 @@ class PaperList extends Component { ...@@ -519,6 +519,7 @@ class PaperList extends Component {
const { current, size, categoryId, paperName } = query; const { current, size, categoryId, paperName } = query;
const paperRowSelection = { const paperRowSelection = {
selectedRowKeys: selectedPaperKeys, selectedRowKeys: selectedPaperKeys,
preserveSelectedRowKeys: true,
onChange: this.onSelectPaper, onChange: this.onSelectPaper,
} }
const rowSelection = { const rowSelection = {
...@@ -651,6 +652,7 @@ class PaperList extends Component { ...@@ -651,6 +652,7 @@ class PaperList extends Component {
visible={openMoveModal} visible={openMoveModal}
title="试卷" title="试卷"
data={paperData} data={paperData}
categoryId={query.categoryId}
length={selectedRowKeys.length} length={selectedRowKeys.length}
onCancel={() => this.setState({ openMoveModal: false })} onCancel={() => this.setState({ openMoveModal: false })}
onOk={(categoryId) => { onOk={(categoryId) => {
......
...@@ -593,6 +593,7 @@ class QuestionList extends Component { ...@@ -593,6 +593,7 @@ class QuestionList extends Component {
const { match } = this.props; const { match } = this.props;
const rowSelection = { const rowSelection = {
selectedRowKeys, selectedRowKeys,
preserveSelectedRowKeys: true,
onChange: this.onSelectChange, onChange: this.onSelectChange,
}; };
return ( return (
...@@ -745,6 +746,7 @@ class QuestionList extends Component { ...@@ -745,6 +746,7 @@ class QuestionList extends Component {
visible={openMoveModal} visible={openMoveModal}
title="题目" title="题目"
data={questionData} data={questionData}
categoryId={query.categoryId}
length={selectedRowKeys.length} length={selectedRowKeys.length}
onCancel={() => this.setState({ openMoveModal: false })} onCancel={() => this.setState({ openMoveModal: false })}
onOk={(categoryId) => { onOk={(categoryId) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment