diff --git a/.gitignore b/.gitignore index b2b4689..8fabdfc 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ pnpm-debug.log* *.sw? src/views/portrait/test.vue /src/.vs +/.vs diff --git a/src/utils/index.js b/src/utils/index.js index f88511c..dabccf0 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -415,6 +415,26 @@ export function formatDate(date, fmt) { return time_str; } +export function formatTimeWithHours(seconds) { + if (!seconds || seconds <= 0) return "0秒"; + const hours = Math.floor(seconds / 3600); + const minutes = Math.floor((seconds % 3600) / 60); + const sec = seconds % 60; + + // 根据是否有小时动态调整格式 + var ret = ""; + if (hours > 0) { + ret += hours + "小时"; + } + if (minutes > 0) { + ret += minutes + "分钟"; + } + if (sec > 0) { + ret += sec + "秒"; + } + return ret; +} + // 获取日期时间戳 export function getTime(dayNum) { var myDate = new Date(); diff --git a/src/views/basic/askTestQuestion/components/testBzrMulti.vue b/src/views/basic/askTestQuestion/components/testBzrMulti.vue index 9774dc7..20a30fe 100644 --- a/src/views/basic/askTestQuestion/components/testBzrMulti.vue +++ b/src/views/basic/askTestQuestion/components/testBzrMulti.vue @@ -21,7 +21,11 @@ {{ `${scoped.row.answeredNum}/${scoped.row.classPersonNum}` }} - + + + @@ -29,8 +33,8 @@ -
- 返回 +
+ 返回
+ scoped.row["examCount" + item] || + Number(scoped.row["examCount" + item]) === 0 + ? scoped.row["examCount" + item] + : "-" + }} + scoped.row["participationCount" + item] || + Number(scoped.row["participationCount" + item]) === 0 + ? scoped.row["participationCount" + item] + : "-" + }} + scoped.row["score" + item] || + Number(scoped.row["score" + item]) === 0 + ? scoped.row["score" + item] + : "-" + }} @@ -93,7 +97,7 @@ - +
@@ -106,7 +110,7 @@