Commit a240c246 by zhujian

'fix'

parent 080683db
...@@ -33,7 +33,7 @@ if (!Number.prototype.toFixedCorrect) { ...@@ -33,7 +33,7 @@ if (!Number.prototype.toFixedCorrect) {
window.processMonthCourseDate = courseList => { window.processMonthCourseDate = courseList => {
if (Array.isArray(courseList) && courseList.length > 0) { if (Array.isArray(courseList) && courseList.length > 0) {
// 因为所购买的时间不可能有重叠,先排序 // 因为所购买的时间不可能有重叠,先排序
courseList = courseList.sort(function(now, next) { courseList = courseList.sort(function (now, next) {
return parseInt(now.startDate) - parseInt(next.startDate) return parseInt(now.startDate) - parseInt(next.startDate)
}) })
...@@ -41,7 +41,7 @@ window.processMonthCourseDate = courseList => { ...@@ -41,7 +41,7 @@ window.processMonthCourseDate = courseList => {
let sumDays = 0, let sumDays = 0,
finishDays = 0, finishDays = 0,
givingDays = 0 givingDays = 0
courseList.forEach(function(item) { courseList.forEach(function (item) {
if (item.endDate != item.purchaseEndDate) { if (item.endDate != item.purchaseEndDate) {
givingDays += moment(parseInt(item.endDate)).diff( givingDays += moment(parseInt(item.endDate)).diff(
parseInt(item.purchaseEndDate), parseInt(item.purchaseEndDate),
...@@ -327,7 +327,7 @@ window.getRequest = () => { ...@@ -327,7 +327,7 @@ window.getRequest = () => {
return theRequest return theRequest
} }
window.getParameterByName = function(name) { window.getParameterByName = function (name) {
name = name.replace(/[\\[]/, '\\[').replace(/[\]]/, '\\]') name = name.replace(/[\\[]/, '\\[').replace(/[\]]/, '\\]')
const regex = new RegExp('[\\?&]' + name + '=([^&#]*)') const regex = new RegExp('[\\?&]' + name + '=([^&#]*)')
const results = regex.exec(window.location.href) const results = regex.exec(window.location.href)
...@@ -344,7 +344,7 @@ window.getUrlParam = function () { ...@@ -344,7 +344,7 @@ window.getUrlParam = function () {
return isNaN(param) ? '' : str; return isNaN(param) ? '' : str;
} }
window.getStringParamete = function(string, name) { window.getStringParamete = function (string, name) {
const theRequest = {} const theRequest = {}
if (string.indexOf('?') != -1) { if (string.indexOf('?') != -1) {
const str = string.substr(1) const str = string.substr(1)
...@@ -530,6 +530,14 @@ window.getMonthLastDate = timestamp => { ...@@ -530,6 +530,14 @@ window.getMonthLastDate = timestamp => {
return time return time
} }
window.formatHourTime = (timestr) => {
const h = Math.floor(timestr / 1000 / 60 / 60);
const m = Math.floor((timestr - h * 1000 * 60 * 60) / 1000 / 60);
const s = Math.floor((timestr - h * 1000 * 60 * 60 - m * 1000 * 60) / 1000);
return `${h > 9 ? h : ('0' + h)}:${m > 9 ? m : ('0' + m)}:${s > 9 ? s : ('0' + s)}`
}
/* /*
获取日期相差多少天 获取日期相差多少天
* */ * */
...@@ -832,7 +840,7 @@ window.getNumberInput = (str, ret = 1) => { ...@@ -832,7 +840,7 @@ window.getNumberInput = (str, ret = 1) => {
return str * ret return str * ret
} }
window.removeNull = function(param) { window.removeNull = function (param) {
if (!param) { if (!param) {
return return
} }
...@@ -853,7 +861,7 @@ window.removeNull = function(param) { ...@@ -853,7 +861,7 @@ window.removeNull = function(param) {
} }
} }
window.convertBase64ToBlob = function(base64) { window.convertBase64ToBlob = function (base64) {
var base64Arr = base64.split(',') var base64Arr = base64.split(',')
var imgtype = '' var imgtype = ''
var base64String = '' var base64String = ''
...@@ -881,7 +889,7 @@ window.convertBase64ToBlob = function(base64) { ...@@ -881,7 +889,7 @@ window.convertBase64ToBlob = function(base64) {
return new Blob([bytesCode], { type: imgtype }) return new Blob([bytesCode], { type: imgtype })
} }
window.formatMsgCreateTime = function(createTime) { window.formatMsgCreateTime = function (createTime) {
const newTime = const newTime =
moment().year() > moment(parseInt(createTime)).year() moment().year() > moment(parseInt(createTime)).year()
? formatDate('YYYY-MM-DD H:i', parseInt(createTime)) ? formatDate('YYYY-MM-DD H:i', parseInt(createTime))
...@@ -1070,7 +1078,7 @@ window.getMoneyFormatYuan = (price) => { ...@@ -1070,7 +1078,7 @@ window.getMoneyFormatYuan = (price) => {
// 处理定价标准 仅订单详情,打印收据预览可用 // 处理定价标准 仅订单详情,打印收据预览可用
window.formatPriceStandard = (info) => { window.formatPriceStandard = (info) => {
let { quantityUnit, specName, commoditySpecs, purchaseItemType, unitPriceAfterDiscount,specCurrentPrice } = info let { quantityUnit, specName, commoditySpecs, purchaseItemType, unitPriceAfterDiscount, specCurrentPrice } = info
let newCommoditySpecs = JSON.parse(commoditySpecs || '[]') || {} let newCommoditySpecs = JSON.parse(commoditySpecs || '[]') || {}
let { containQuantity, unitPrice, measurementUnits } = newCommoditySpecs let { containQuantity, unitPrice, measurementUnits } = newCommoditySpecs
let content = '' let content = ''
...@@ -1145,9 +1153,9 @@ window.convertBase64UrlToBlob = (urlData) => { ...@@ -1145,9 +1153,9 @@ window.convertBase64UrlToBlob = (urlData) => {
} }
// 小麦秀 new 标签显示 // 小麦秀 new 标签显示
window.XMShowClassName = (date,itemName) => { window.XMShowClassName = (date, itemName) => {
// 超过时间不显示 // 超过时间不显示
if (new Date().getTime() > date ) { if (new Date().getTime() > date) {
return ''; return '';
} }
// 用户点击相应区域后不显示 // 用户点击相应区域后不显示
......
...@@ -82,7 +82,7 @@ function AddExam(props: any) { ...@@ -82,7 +82,7 @@ function AddExam(props: any) {
setPassRate(result.passRate * 100) setPassRate(result.passRate * 100)
setNeedPhone(result.needPhone) setNeedPhone(result.needPhone)
setExamDesc(result.examDesc) setExamDesc(result.examDesc)
setExamDuration(result.examDuration) setExamDuration(result.examDuration / 60 / 1000 as any)
setAnswerAnalysis(result.answerAnalysis) setAnswerAnalysis(result.answerAnalysis)
setNeedOptionDisorder(result.needOptionDisorder) setNeedOptionDisorder(result.needOptionDisorder)
setPassScore(result.passScore) setPassScore(result.passScore)
...@@ -113,7 +113,7 @@ function AddExam(props: any) { ...@@ -113,7 +113,7 @@ function AddExam(props: any) {
resultContent, resultContent,
answerAnalysis, answerAnalysis,
resultShow, resultShow,
examDuration, examDuration: (examDuration || 0) * 60 * 1000,
passScore, passScore,
tenantId: User.getStoreId(), tenantId: User.getStoreId(),
userId: User.getStoreUserId(), userId: User.getStoreUserId(),
......
...@@ -87,7 +87,7 @@ function ExaminationManager(props: any) { ...@@ -87,7 +87,7 @@ function ExaminationManager(props: any) {
{ {
title: "考试时长", title: "考试时长",
dataIndex: "examDuration", dataIndex: "examDuration",
render: (text: any) => <span>{text || 0}分钟</span>, render: (text: any) => <span>{(text || 0)/60/1000}分钟</span>,
}, },
{ {
title: "及格分/总分", title: "及格分/总分",
......
...@@ -7,6 +7,7 @@ import moment from 'moment'; ...@@ -7,6 +7,7 @@ import moment from 'moment';
import './userData.less' import './userData.less'
const { Search } = Input; const { Search } = Input;
const { Option } = Select; const { Option } = Select;
declare var window: any;
interface sortType { interface sortType {
type: "ascend" | "descend" | null | undefined type: "ascend" | "descend" | null | undefined
...@@ -147,7 +148,7 @@ function DataAnalysic(props: any) { ...@@ -147,7 +148,7 @@ function DataAnalysic(props: any) {
dataIndex: "examDuration", dataIndex: "examDuration",
sorter: true, sorter: true,
sortOrder: field === "examDuration" ? order : sortStatus.type, sortOrder: field === "examDuration" ? order : sortStatus.type,
render: (text: any) => <span>{moment(text).format("HH:mm:ss")}</span>, render: (text: any) => <span>{window.formatHourTime(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"> {window.formatHourTime(useData.averageDuration || 0)} </div>
<div className="percent"></div> <div className="percent"></div>
<div className="subTitle">平均用时</div> <div className="subTitle">平均用时</div>
</div> </div>
......
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