Commit 4a65aacb by yuananting

fix:用时转换

parent 080683db
...@@ -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-10 10:59:32 * @LastEditTime: 2021-04-10 15:36:29
* @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], false); Bus.trigger("queryPaperPageList", selectedKeys[0], 0);
} }
}); });
}; };
......
...@@ -2,6 +2,7 @@ import React, { useState, useRef, useEffect } from 'react' ...@@ -2,6 +2,7 @@ import React, { useState, useRef, useEffect } from 'react'
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import { PageControl } from "@/components"; import { PageControl } from "@/components";
import { Input, Select, Tooltip, Table, Button } from 'antd'; import { Input, Select, Tooltip, Table, Button } from 'antd';
import dealTimeDuration from "../utils/dealTimeDuration";
import User from "@/common/js/user"; import User from "@/common/js/user";
import moment from 'moment'; import moment from 'moment';
import './userData.less' import './userData.less'
...@@ -62,7 +63,7 @@ function DataAnalysic(props: any) { ...@@ -62,7 +63,7 @@ function DataAnalysic(props: any) {
ascend: 'CREATED_ASC', ascend: 'CREATED_ASC',
descend: 'ACCURACY_DESC' descend: 'ACCURACY_DESC'
}, },
examDuration: { userDuration: {
ascend: 'PASS_CNT_ASC', ascend: 'PASS_CNT_ASC',
descend: 'CREATED_DESC' descend: 'CREATED_DESC'
}, },
...@@ -144,10 +145,10 @@ function DataAnalysic(props: any) { ...@@ -144,10 +145,10 @@ function DataAnalysic(props: any) {
}, },
{ {
title: "考试用时", title: "考试用时",
dataIndex: "examDuration", dataIndex: "userDuration",
sorter: true, sorter: true,
sortOrder: field === "examDuration" ? order : sortStatus.type, sortOrder: field === "userDuration" ? order : sortStatus.type,
render: (text: any) => <span>{moment(text).format("HH:mm:ss")}</span>, render: (text: any) => <span>{dealTimeDuration(Number(text))}</span>,
}, },
...@@ -210,7 +211,7 @@ function DataAnalysic(props: any) { ...@@ -210,7 +211,7 @@ function DataAnalysic(props: any) {
<div className="subTitle">平均分</div> <div className="subTitle">平均分</div>
</div> </div>
<div className="item"> <div className="item">
<div className="num">{useData.averageDuration || 0}</div> <div className="num">{dealTimeDuration(useData.averageDuration || 0)}</div>
<div className="percent"></div> <div className="percent"></div>
<div className="subTitle">平均用时</div> <div className="subTitle">平均用时</div>
</div> </div>
......
...@@ -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-10 11:04:26 * @LastEditTime: 2021-04-10 15:36:20
* @Description: 助学工具-新建/复制/编辑试卷 * @Description: 助学工具-新建/复制/编辑试卷
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -327,7 +327,7 @@ class OperatePaper extends Component { ...@@ -327,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, true); Bus.trigger("queryPaperPageList", categoryId, selectQuestionList.length);
Bus.trigger("queryCategoryTree", "remain"); Bus.trigger("queryCategoryTree", "remain");
} }
}); });
...@@ -343,7 +343,7 @@ class OperatePaper extends Component { ...@@ -343,7 +343,7 @@ class OperatePaper extends Component {
"categoryId" "categoryId"
)}`, )}`,
}); });
Bus.trigger("queryPaperPageList", categoryId, true); Bus.trigger("queryPaperPageList", categoryId, selectQuestionList.length);
} }
}); });
} }
......
...@@ -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-10 11:03:26 * @LastEditTime: 2021-04-10 15:37:25
* @Description: 助学工具-题库-试卷列表数据 * @Description: 助学工具-题库-试卷列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -54,11 +54,11 @@ class PaperList extends Component { ...@@ -54,11 +54,11 @@ class PaperList extends Component {
componentDidMount() { componentDidMount() {
this.queryPaperPageList(); this.queryPaperPageList();
Bus.bind("queryPaperPageList", (selectedCategoryId, delay) => { Bus.bind("queryPaperPageList", (selectedCategoryId, count) => {
selectedCategoryId = selectedCategoryId =
selectedCategoryId === "null" ? null : selectedCategoryId; selectedCategoryId === "null" ? null : selectedCategoryId;
this.setState({ loading: true }); this.setState({ loading: true });
if (delay) { if (count >= 100) {
setTimeout(() => { setTimeout(() => {
this.InitSearch(selectedCategoryId); this.InitSearch(selectedCategoryId);
}, 5000); }, 5000);
...@@ -73,7 +73,7 @@ class PaperList extends Component { ...@@ -73,7 +73,7 @@ class PaperList extends Component {
} }
// 初始化列表查询 // 初始化列表查询
InitSearch = (categoryId, delay) => { InitSearch = (categoryId) => {
const _query = { const _query = {
...this.state.query, ...this.state.query,
categoryId, categoryId,
......
/*
* @Author: 吴文洁
* @Date: 2020-08-20 14:51:18
* @LastEditors: yuananting
* @LastEditTime: 2021-04-10 15:29:16
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
const dealTimeDuration = (msTime) => {
let time = msTime / 1000;
let hour =
Math.floor(time / 60 / 60) % 24 > 9
? Math.floor(time / 60 / 60) % 24
: "0" + (Math.floor(time / 60 / 60) % 24);
let minute =
Math.floor(time / 60) % 60 > 9
? Math.floor(time / 60) % 60
: "0" + (Math.floor(time / 60) % 60);
let second =
time % 60 > 9 ? Math.round(time % 60) : "0" + Math.round(time % 60);
return `${hour}:${minute}:${second}`;
}
export default dealTimeDuration;
\ No newline at end of file
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