Commit da03cc27 by yuananting

fix:loading

parent 0c8b67b7
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 10:59:43 * @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-07 12:19:27 * @LastEditTime: 2021-04-10 10:59:32
* @Description: 助学工具-侧边课程分类树 * @Description: 助学工具-侧边课程分类树
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -131,7 +131,7 @@ class CourseCategorySiderTree extends Component { ...@@ -131,7 +131,7 @@ class CourseCategorySiderTree extends Component {
} else if (this.props.fromModule === "QUESTION_MODAL") { } else if (this.props.fromModule === "QUESTION_MODAL") {
Bus.trigger("queryQuestionModalList", selectedKeys[0]); Bus.trigger("queryQuestionModalList", selectedKeys[0]);
} else { } else {
Bus.trigger("queryPaperPageList", selectedKeys[0]); Bus.trigger("queryPaperPageList", selectedKeys[0], false);
} }
}); });
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-27 16:15:13 * @Date: 2021-03-27 16:15:13
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-07 12:56:49 * @LastEditTime: 2021-04-10 11:04:26
* @Description: 助学工具-新建/复制/编辑试卷 * @Description: 助学工具-新建/复制/编辑试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -18,6 +18,7 @@ import { ...@@ -18,6 +18,7 @@ import {
Tooltip, Tooltip,
message, message,
Modal, Modal,
Spin,
} from "antd"; } from "antd";
import { PlusOutlined } from "@ant-design/icons"; import { PlusOutlined } from "@ant-design/icons";
import ShowTips from "@/components/ShowTips"; import ShowTips from "@/components/ShowTips";
...@@ -69,6 +70,7 @@ class OperatePaper extends Component { ...@@ -69,6 +70,7 @@ class OperatePaper extends Component {
currentOperate: "", currentOperate: "",
currentNav: "", currentNav: "",
currentCategoryPapers: [], currentCategoryPapers: [],
loading: false,
}; };
} }
...@@ -110,7 +112,8 @@ class OperatePaper extends Component { ...@@ -110,7 +112,8 @@ class OperatePaper extends Component {
}; };
// 编辑/复制试卷时获取相应试卷详情 // 编辑/复制试卷时获取相应试卷详情
queryPaperDetail = () => { queryPaperDetail = async () => {
this.setState({ loading: true });
const { currentOperate } = this.state; const { currentOperate } = this.state;
let query = { let query = {
paperId: getParameterByName("paperId"), paperId: getParameterByName("paperId"),
...@@ -118,29 +121,29 @@ class OperatePaper extends Component { ...@@ -118,29 +121,29 @@ class OperatePaper extends Component {
userId: User.getStoreUserId(), userId: User.getStoreUserId(),
tenantId: User.getStoreId(), tenantId: User.getStoreId(),
}; };
AidToolService.queryPaperDetail(query).then((res) => { const res = await AidToolService.queryPaperDetail(query);
const { result } = res; const { result } = res;
const { paperName, passRate } = result; const { paperName, passRate } = result;
this.setState( this.setState(
{ {
selectQuestionList: result.questionList.sort( selectQuestionList: result.questionList.sort(
(a, b) => b.updateTime - a.updateTime (a, b) => b.updateTime - a.updateTime
), ),
formData: { formData: {
...result, ...result,
paperName: paperName:
currentOperate === "copy" ? paperName + "(复制)" : paperName, currentOperate === "copy" ? paperName + "(复制)" : paperName,
},
}, },
() => { loading: false,
this.formRef.current.setFieldsValue({ },
paperName: this.state.formData.paperName, () => {
passRate, this.formRef.current.setFieldsValue({
}); paperName: this.state.formData.paperName,
this.setFormData(result.questionList); passRate,
} });
); this.setFormData(result.questionList);
}); }
);
}; };
// 自定义表格空状态 // 自定义表格空状态
...@@ -324,7 +327,7 @@ class OperatePaper extends Component { ...@@ -324,7 +327,7 @@ class OperatePaper extends Component {
window.RCHistory.push({ window.RCHistory.push({
pathname: `/paper-manage-index?categoryId=${categoryId}`, pathname: `/paper-manage-index?categoryId=${categoryId}`,
}); });
Bus.trigger("queryPaperPageList", categoryId); Bus.trigger("queryPaperPageList", categoryId, true);
Bus.trigger("queryCategoryTree", "remain"); Bus.trigger("queryCategoryTree", "remain");
} }
}); });
...@@ -340,7 +343,7 @@ class OperatePaper extends Component { ...@@ -340,7 +343,7 @@ class OperatePaper extends Component {
"categoryId" "categoryId"
)}`, )}`,
}); });
Bus.trigger("queryPaperPageList", categoryId); Bus.trigger("queryPaperPageList", categoryId, true);
} }
}); });
} }
...@@ -482,7 +485,10 @@ class OperatePaper extends Component { ...@@ -482,7 +485,10 @@ class OperatePaper extends Component {
title: ( title: (
<Tooltip title="多选题和填空题的漏选/半对得分不能高于题目本身分值"> <Tooltip title="多选题和填空题的漏选/半对得分不能高于题目本身分值">
分值{" "} 分值{" "}
<span className="icon iconfont" style={{ color: "#BFBFBF" , fontSize: 14 }}> <span
className="icon iconfont"
style={{ color: "#BFBFBF", fontSize: 14 }}
>
&#xe7c4; &#xe7c4;
</span> </span>
</Tooltip> </Tooltip>
...@@ -603,6 +609,7 @@ class OperatePaper extends Component { ...@@ -603,6 +609,7 @@ class OperatePaper extends Component {
selectQuestionList, selectQuestionList,
currentNav, currentNav,
formData, formData,
loading,
} = this.state; } = this.state;
const { const {
singleChoiceCnt, singleChoiceCnt,
...@@ -626,133 +633,138 @@ class OperatePaper extends Component { ...@@ -626,133 +633,138 @@ class OperatePaper extends Component {
return ( return (
<div className="page operate-paper-page"> <div className="page operate-paper-page">
<Breadcrumbs navList={currentNav} goBack={() => this.handleGoBack()} /> <Breadcrumbs navList={currentNav} goBack={() => this.handleGoBack()} />
<div className="box"> <Spin spinning={loading}>
<div className="show-tips"> <div className="box">
<ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企培保有依据国家规定及平台规则进行处理的权利" /> <div className="show-tips">
</div> <ShowTips message="请遵守国家相关规定,切勿上传低俗色情、暴力恐怖、谣言诈骗、侵权盗版等相关内容,小麦企培保有依据国家规定及平台规则进行处理的权利" />
<Form ref={this.formRef} style={{ marginTop: 24 }}> </div>
<Form.Item <Form ref={this.formRef} style={{ marginTop: 24 }}>
name="paperName" <Form.Item
label="试卷名称:" name="paperName"
required label="试卷名称:"
rules={[ required
{ rules={[
required: true, {
message: "请输入试卷名称", required: true,
}, message: "请输入试卷名称",
({ getFieldValue }) => ({
validator(_, value) {
if (_that.checkExist(value)) {
return Promise.reject("该试卷名称已存在");
} else {
return Promise.resolve();
}
}, },
}), ({ getFieldValue }) => ({
]} validator(_, value) {
> if (_that.checkExist(value)) {
<Input return Promise.reject("该试卷名称已存在");
value={paperName} } else {
autoComplete="off" return Promise.resolve();
maxLength={40} }
style={{ width: 300 }}
placeholder="请输入试卷名称(40字以内)"
onChange={(e) => {
this.setState({
formData: {
...formData,
paperName: e.target.value.trim(),
}, },
}); }),
}} ]}
/> >
</Form.Item> <Input
value={paperName}
<Form.Item label="及格线:" required> autoComplete="off"
<div> maxLength={40}
<Form.Item style={{ width: 300 }}
noStyle placeholder="请输入试卷名称(40字以内)"
initialValue={60} onChange={(e) => {
name="passRate" this.setState({
rules={[ formData: {
({ getFieldValue }) => ({ ...formData,
validator(_, value) { paperName: e.target.value.trim(),
if (!value) {
return Promise.reject("请输入及格线");
} else {
return Promise.resolve();
}
}, },
}), });
]} }}
> />
<InputNumber </Form.Item>
min={1}
max={100} <Form.Item label="及格线:" required>
value={passRate} <div>
onChange={(value) => { <Form.Item
this.setState( noStyle
{ initialValue={60}
formData: { name="passRate"
...formData, rules={[
passRate: value, ({ getFieldValue }) => ({
}, validator(_, value) {
if (!value) {
return Promise.reject("请输入及格线");
} else {
return Promise.resolve();
}
}, },
() => this.setFormData(selectQuestionList) }),
); ]}
}} >
/> <InputNumber
</Form.Item>{" "} min={1}
% max={100}
<span className="score-info"> value={passRate}
总分({totalScore})*及格线({passRate || 0}%)=及格分数( onChange={(value) => {
{passScore} this.setState(
</span> {
</div> formData: {
</Form.Item> ...formData,
passRate: value,
},
},
() => this.setFormData(selectQuestionList)
);
}}
/>
</Form.Item>{" "}
%
<span className="score-info">
总分({totalScore})*及格线({passRate || 0}%)=及格分数(
{passScore}
</span>
</div>
</Form.Item>
<Button <Button
className="choose-btn" className="choose-btn"
type="primary" type="primary"
icon={<PlusOutlined />} icon={<PlusOutlined />}
onClick={this.chooseQuestion} onClick={this.chooseQuestion}
> >
自选题目 自选题目
</Button> </Button>
{questionCnt > 0 && ( {questionCnt > 0 && (
<div className="paper-info-tip" style={{ margin: "0 auto 12px" }}> <div
总计<span>{totalScore}</span>分,共<span>{questionCnt}</span> className="paper-info-tip"
题。{" "} style={{ margin: "0 auto 12px" }}
{singleChoiceCnt > 0 && >
`单选题${singleChoiceCnt}题,共${singleChoiceScore}分;`} 总计<span>{totalScore}</span>分,共<span>{questionCnt}</span>
{multiChoiceCnt > 0 && 题。{" "}
`多选题${multiChoiceCnt}题,共${multiChoiceScore}分;`} {singleChoiceCnt > 0 &&
{judgeCnt > 0 && `判断题${judgeCnt}题,共${judgeScore}分,`} `单选题${singleChoiceCnt}题,共${singleChoiceScore}分;`}
{gapFillingCnt > 0 && {multiChoiceCnt > 0 &&
`填空题${gapFillingCnt}题,共${gapFillingScore}分,`} `多选题${multiChoiceCnt}题,共${multiChoiceScore}分;`}
{indefiniteChoiceCnt > 0 && {judgeCnt > 0 && `判断题${judgeCnt}题,共${judgeScore}分,`}
`不定项选择题${indefiniteChoiceCnt}题,共${indefiniteChoiceScore}分`} {gapFillingCnt > 0 &&
</div> `填空题${gapFillingCnt}题,共${gapFillingScore}分,`}
)} {indefiniteChoiceCnt > 0 &&
`不定项选择题${indefiniteChoiceCnt}题,共${indefiniteChoiceScore}分`}
</div>
)}
<ConfigProvider renderEmpty={this.customizeRenderEmpty}> <ConfigProvider renderEmpty={this.customizeRenderEmpty}>
<Table <Table
scroll={{ y: 350 }} scroll={{ y: 350 }}
columns={this.parseColumns()} columns={this.parseColumns()}
dataSource={selectQuestionList} dataSource={selectQuestionList}
bordered bordered
pagination={false} pagination={false}
/> />
</ConfigProvider> </ConfigProvider>
</Form> </Form>
</div> </div>
<div className="footer"> <div className="footer">
<Button onClick={this.handleGoBack}>取消</Button> <Button onClick={this.handleGoBack}>取消</Button>
<Button onClick={this.previewPaper}>预览</Button> <Button onClick={this.previewPaper}>预览</Button>
<Button type="primary" onClick={this.savePaper}> <Button type="primary" onClick={this.savePaper}>
保存 保存
</Button> </Button>
</div> </div>
</Spin>
{selectQuestionModal} {selectQuestionModal}
{paperPreviewModal} {paperPreviewModal}
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-08 10:03:45 * @LastEditTime: 2021-04-10 11:03:26
* @Description: 助学工具-题库-试卷列表数据 * @Description: 助学工具-题库-试卷列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -22,7 +22,7 @@ import { ...@@ -22,7 +22,7 @@ import {
} from "antd"; } from "antd";
import { PageControl } from "@/components"; import { PageControl } from "@/components";
import "./PaperList.less"; import "./PaperList.less";
import { Route, withRouter } from 'react-router-dom'; import { Route, withRouter } from "react-router-dom";
import OperatePaper from "@/modules/teach-tool/paper-manage/OperatePaper"; import OperatePaper from "@/modules/teach-tool/paper-manage/OperatePaper";
import User from "@/common/js/user"; import User from "@/common/js/user";
import AidToolService from "@/domains/aid-tool-domain/AidToolService"; import AidToolService from "@/domains/aid-tool-domain/AidToolService";
...@@ -48,23 +48,32 @@ class PaperList extends Component { ...@@ -48,23 +48,32 @@ class PaperList extends Component {
selectedRowKeys: [this.props.paperId], selectedRowKeys: [this.props.paperId],
dataSource: [], dataSource: [],
paperPreviewModal: null, // 试卷预览模态框 paperPreviewModal: null, // 试卷预览模态框
loading: false,
}; };
} }
componentDidMount() { componentDidMount() {
this.queryPaperPageList(); this.queryPaperPageList();
Bus.bind('queryPaperPageList', (selectedCategoryId) => { Bus.bind("queryPaperPageList", (selectedCategoryId, delay) => {
selectedCategoryId = selectedCategoryId === "null" ? null : selectedCategoryId; selectedCategoryId =
this.InitSearch(selectedCategoryId) selectedCategoryId === "null" ? null : selectedCategoryId;
}) this.setState({ loading: true });
if (delay) {
setTimeout(() => {
this.InitSearch(selectedCategoryId);
}, 5000);
} else {
this.InitSearch(selectedCategoryId);
}
});
} }
componentWillUnmount() { componentWillUnmount() {
Bus.unbind('queryPaperPageList', this.queryPaperPageList) Bus.unbind("queryPaperPageList", this.queryPaperPageList);
} }
// 初始化列表查询 // 初始化列表查询
InitSearch = (categoryId) => { InitSearch = (categoryId, delay) => {
const _query = { const _query = {
...this.state.query, ...this.state.query,
categoryId, categoryId,
...@@ -77,11 +86,10 @@ class PaperList extends Component { ...@@ -77,11 +86,10 @@ class PaperList extends Component {
}; };
// 查询试卷列表 // 查询试卷列表
queryPaperPageList = () => { queryPaperPageList = async () => {
AidToolService.queryPaperPageList(this.state.query).then((res) => { const res = await AidToolService.queryPaperPageList(this.state.query);
const { records = [], total = 0 } = res.result; const { records = [], total = 0 } = res.result;
this.setState({ dataSource: records, total }); this.setState({ dataSource: records, total, loading: false });
});
}; };
// 预览试卷 // 预览试卷
...@@ -112,8 +120,6 @@ class PaperList extends Component { ...@@ -112,8 +120,6 @@ class PaperList extends Component {
// 编辑试卷 // 编辑试卷
editPaper = (record) => { editPaper = (record) => {
const { match } = this.props;
if (record.relatedExam === 0) { if (record.relatedExam === 0) {
const { categoryId } = this.state.query; const { categoryId } = this.state.query;
const { match } = this.props; const { match } = this.props;
...@@ -158,7 +164,7 @@ class PaperList extends Component { ...@@ -158,7 +164,7 @@ class PaperList extends Component {
}); });
} }
}); });
} };
// 删除试卷确认 // 删除试卷确认
confirmDeletePaper = (record) => { confirmDeletePaper = (record) => {
...@@ -249,45 +255,49 @@ class PaperList extends Component { ...@@ -249,45 +255,49 @@ class PaperList extends Component {
width: this.props.type !== "modal-select" ? "12%" : "20%", width: this.props.type !== "modal-select" ? "12%" : "20%",
align: "right", align: "right",
render: (val, record) => { render: (val, record) => {
return ( return this.props.type !== "modal-select" ? (
<span>{record.questionCnt}</span>
this.props.type !== "modal-select" ? ) : (
<span> <Tooltip
{record.questionCnt} overlayClassName="tool-list"
</span> : title={
<Tooltip <div>
overlayClassName="tool-list" <div className="item">
title={ 单选题:{record.singleChoiceCnt || 0}
<div>
<div className="item">单选题:{record.singleChoiceCnt || 0}</div>
<div className="item">多选题:{record.multiChoiceCnt || 0}</div>
<div className="item">判断题:{record.judgeCnt || 0}</div>
<div className="item">填空题:{record.gapFillingCnt || 0}</div>
<div className="item">不定项选择题:{record.indefiniteChoiceCnt || 0}</div>
</div> </div>
} <div className="item">
placement="top" 多选题:{record.multiChoiceCnt || 0}
overlayStyle={{ maxWidth: 700 }} </div>
> <div className="item">判断题:{record.judgeCnt || 0}</div>
<span> <div className="item">
{record.questionCnt} 填空题:{record.gapFillingCnt || 0}
</span> </div>
</Tooltip> <div className="item">
不定项选择题:{record.indefiniteChoiceCnt || 0}
</div>
</div>
}
placement="top"
overlayStyle={{ maxWidth: 700 }}
>
<span>{record.questionCnt}</span>
</Tooltip>
); );
}, },
}, },
]; ];
if (this.props.type !== "modal-select") { if (this.props.type !== "modal-select") {
const isPermiss = ["CloudManager", "StoreManager"].includes(User.getUserRole()); const isPermiss = ["CloudManager", "StoreManager"].includes(
User.getUserRole()
);
columns.push({ columns.push({
title: "关联考试数", title: "关联考试数",
key: "relatedExam", key: "relatedExam",
dataIndex: "relatedExam", dataIndex: "relatedExam",
width: this.props.type !== "modal-select" ? "16%" : "24%", width: this.props.type !== "modal-select" ? "16%" : "24%",
align: "right", align: "right",
}) });
columns.push({ columns.push({
title: "操作", title: "操作",
key: "operate", key: "operate",
...@@ -302,17 +312,25 @@ class PaperList extends Component { ...@@ -302,17 +312,25 @@ class PaperList extends Component {
> >
预览 预览
</div> </div>
{isPermiss && <span className="record-operate__item split"> | </span>} {isPermiss && (
{isPermiss && <div <span className="record-operate__item split"> | </span>
className="record-operate__item" )}
onClick={() => this.copyPaper(record)} {isPermiss && (
> <div
复制 className="record-operate__item"
</div>} onClick={() => this.copyPaper(record)}
{isPermiss && <span className="record-operate__item split"> | </span>} >
{isPermiss && <Dropdown overlay={this.initDropMenu(record)}> 复制
<div className="record-operate__item">更多</div> </div>
</Dropdown>} )}
{isPermiss && (
<span className="record-operate__item split"> | </span>
)}
{isPermiss && (
<Dropdown overlay={this.initDropMenu(record)}>
<div className="record-operate__item">更多</div>
</Dropdown>
)}
</div> </div>
); );
}, },
...@@ -359,6 +377,7 @@ class PaperList extends Component { ...@@ -359,6 +377,7 @@ class PaperList extends Component {
query, query,
paperPreviewModal, paperPreviewModal,
selectedRowKeys, selectedRowKeys,
loading,
} = this.state; } = this.state;
const { current, size, categoryId, paperName } = query; const { current, size, categoryId, paperName } = query;
const rowSelection = { const rowSelection = {
...@@ -366,7 +385,9 @@ class PaperList extends Component { ...@@ -366,7 +385,9 @@ class PaperList extends Component {
selectedRowKeys, selectedRowKeys,
onChange: this.onSelectChange, onChange: this.onSelectChange,
}; };
const isPermiss = ["CloudManager", "StoreManager"].includes(User.getUserRole()) const isPermiss = ["CloudManager", "StoreManager"].includes(
User.getUserRole()
);
const { match } = this.props; const { match } = this.props;
return ( return (
<div className={"paper-list " + this.props.type}> <div className={"paper-list " + this.props.type}>
...@@ -397,19 +418,18 @@ class PaperList extends Component { ...@@ -397,19 +418,18 @@ class PaperList extends Component {
</div> </div>
</Row> </Row>
</div> </div>
{this.props.type !== "modal-select" && isPermiss && {this.props.type !== "modal-select" && isPermiss && categoryId && (
categoryId && ( <Button
<Button type="primary"
type="primary" onClick={() => {
onClick={() => { window.RCHistory.push({
window.RCHistory.push({ pathname: `${match.url}/paper-operate-page?type=new&categoryId=${categoryId}`,
pathname: `${match.url}/paper-operate-page?type=new&categoryId=${categoryId}`, });
}); }}
}} >
> 新建试卷
新建试卷 </Button>
</Button> )}
)}
<div className="paper-list-content"> <div className="paper-list-content">
<ConfigProvider renderEmpty={this.customizeRenderEmpty}> <ConfigProvider renderEmpty={this.customizeRenderEmpty}>
...@@ -420,6 +440,7 @@ class PaperList extends Component { ...@@ -420,6 +440,7 @@ class PaperList extends Component {
columns={this.parseColumns()} columns={this.parseColumns()}
pagination={false} pagination={false}
bordered bordered
loading={loading}
onChange={this.handleChangeTable} onChange={this.handleChangeTable}
/> />
) : ( ) : (
...@@ -457,7 +478,10 @@ class PaperList extends Component { ...@@ -457,7 +478,10 @@ class PaperList extends Component {
)} )}
{paperPreviewModal} {paperPreviewModal}
</div> </div>
<Route path={`${match.url}/paper-operate-page`} component={OperatePaper} /> <Route
path={`${match.url}/paper-operate-page`}
component={OperatePaper}
/>
</div> </div>
); );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-04-09 17:21:36 * @LastEditTime: 2021-04-10 09:34:35
* @Description: 助学工具-新建试卷-选择题目列表 * @Description: 助学工具-新建试卷-选择题目列表
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -64,7 +64,7 @@ class SelectQuestionList extends Component { ...@@ -64,7 +64,7 @@ class SelectQuestionList extends Component {
query: { query: {
current: 1, current: 1,
size: 10, size: 10,
order: "ACCURACY_DESC", order: "UPDATED_DESC",
categoryId: null, // 当前题库分类Id categoryId: null, // 当前题库分类Id
questionName: null, // 题目名称 questionName: null, // 题目名称
questionType: null, // 题目类型 questionType: null, // 题目类型
...@@ -95,7 +95,7 @@ class SelectQuestionList extends Component { ...@@ -95,7 +95,7 @@ class SelectQuestionList extends Component {
...this.state.query, ...this.state.query,
categoryId, categoryId,
current: 1, current: 1,
order: "ACCURACY_DESC", // 排序规则 order: "UPDATED_DESC", // 排序规则
questionName: null, // 题目名称 questionName: null, // 题目名称
questionType: null, // 题目类型 questionType: null, // 题目类型
}; };
...@@ -107,7 +107,7 @@ class SelectQuestionList extends Component { ...@@ -107,7 +107,7 @@ class SelectQuestionList extends Component {
// 排序 // 排序
handleChangeTable = (pagination, filters, sorter) => { handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter; const { columnKey, order } = sorter;
let sort = null; let sort = "UPDATED_DESC";
if (order === "ascend") { if (order === "ascend") {
sort = "ACCURACY_ASC"; sort = "ACCURACY_ASC";
} }
...@@ -115,7 +115,7 @@ class SelectQuestionList extends Component { ...@@ -115,7 +115,7 @@ class SelectQuestionList extends Component {
sort = "ACCURACY_DESC"; sort = "ACCURACY_DESC";
} }
const _query = this.state.query; const _query = this.state.query;
_query.order = sort || "ACCURACY_DESC"; _query.order = sort;
_query.current = 1; _query.current = 1;
this.setState({ query: _query }, () => this.queryQuestionModalList()); this.setState({ query: _query }, () => this.queryQuestionModalList());
}; };
...@@ -132,7 +132,7 @@ class SelectQuestionList extends Component { ...@@ -132,7 +132,7 @@ class SelectQuestionList extends Component {
const _query = { const _query = {
...this.state.query, ...this.state.query,
current: 1, current: 1,
order: "ACCURACY_DESC", // 排序规则 order: "UPDATED_DESC", // 排序规则
questionName: null, // 题目名称 questionName: null, // 题目名称
questionType: null, // 题目类型 questionType: null, // 题目类型
}; };
......
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