Commit ce1ef9ef by chenshu

fix:修复

parent c0fdfc4b
......@@ -554,6 +554,7 @@ class KnowledgeBaseList extends React.Component {
const { current, size } = query;
const rowSelection = {
selectedRowKeys,
preserveSelectedRowKeys: true,
onChange: onSelectChange,
}
return (
......
......@@ -236,6 +236,7 @@ export default function KnowledgeBaseOpt({
visible={openMoveModal}
title="知识"
data={data}
categoryId={categoryId}
length={selectedRowKeys.length}
onCancel={() => setOpenMoveModal(false)}
onOk={(categoryId) => {
......
......@@ -55,7 +55,7 @@ function ExaminationManager(props: any) {
const [modal, setModal] = useState(null);
const [questionCntSort, setQuestionCntSort] = useState(sortState)
const [openPreviewModal, setOpenPreviewModal] = useState(false);
const [info, setInfo] = useState({});
const [info, setInfo] = useState({ examDuration: 0 });
const queryRef = useRef({});
const orderEnum = {
......@@ -430,7 +430,7 @@ function ExaminationManager(props: any) {
</div>
{openPreviewModal &&
<PreviewModal
info={info}
info={{ ...info, examDuration: (info.examDuration || 0) / 60000 }}
onClose={() => { setOpenPreviewModal(false) }}
/>
}
......
......@@ -14,9 +14,21 @@ class MoveModal extends React.Component {
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() {
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 moveData = this.filterData(data, id);
return (
<Modal
title={`移动${title}`}
......@@ -37,7 +49,7 @@ class MoveModal extends React.Component {
treeNodeFilterProp="title"
style={{ width: 240 }}
dropdownStyle={{ maxHeight: 220 }}
treeData={data}
treeData={moveData}
placeholder="请选择分类"
allowClear
value={categoryId}
......
......@@ -519,6 +519,7 @@ class PaperList extends Component {
const { current, size, categoryId, paperName } = query;
const paperRowSelection = {
selectedRowKeys: selectedPaperKeys,
preserveSelectedRowKeys: true,
onChange: this.onSelectPaper,
}
const rowSelection = {
......@@ -651,6 +652,7 @@ class PaperList extends Component {
visible={openMoveModal}
title="试卷"
data={paperData}
categoryId={query.categoryId}
length={selectedRowKeys.length}
onCancel={() => this.setState({ openMoveModal: false })}
onOk={(categoryId) => {
......
......@@ -593,6 +593,7 @@ class QuestionList extends Component {
const { match } = this.props;
const rowSelection = {
selectedRowKeys,
preserveSelectedRowKeys: true,
onChange: this.onSelectChange,
};
return (
......@@ -745,6 +746,7 @@ class QuestionList extends Component {
visible={openMoveModal}
title="题目"
data={questionData}
categoryId={query.categoryId}
length={selectedRowKeys.length}
onCancel={() => this.setState({ openMoveModal: false })}
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