JutarryWu hai 1 semana
pai
achega
63a8288eaf

+ 34 - 30
src/views/tester/components/RehabilitationEvaluation/CognitiveAbilityTask/CognitiveAbilityTaskDrawClock/index.vue

@@ -260,7 +260,7 @@ const startDrawing = (event: MouseEvent) => {
     ctx.moveTo(lastX, lastY)
 
     // 当前绘图表面状态
-    const preData = ctx.getImageData(0, 0, 600, 420)
+    const preData = ctx.getImageData(0, 0, 600, 490)
     // 当前绘图表面进栈
     preDrawAry.value.push(preData)
   }
@@ -270,20 +270,22 @@ const startDrawing = (event: MouseEvent) => {
  * 触摸开始事件
  * @param e
  */
-function touchStartDrawing(e: MouseEvent | TouchEvent) {
-  isPainting = true
-  ;[lastX, lastY] = [
-    'touches' in e
-      ? [(e as TouchEvent).touches[0].clientX, (e as TouchEvent).touches[0].clientY]
-      : [(e as MouseEvent).clientX - 360, (e as MouseEvent).clientY - 140]
-  ]
-  ctx.beginPath()
-  ctx.moveTo(lastX, lastY)
-
-  // 当前绘图表面状态
-  const preData = ctx.getImageData(0, 0, 600, 420)
-  // 当前绘图表面进栈
-  preDrawAry.value.push(preData)
+const touchStartDrawing = (e: MouseEvent | TouchEvent) => {
+  if (!isPainting && ctx) {
+    isPainting = true
+    ;[lastX, lastY] = [
+      'touches' in e
+        ? [(e as TouchEvent).touches[0].clientX, (e as TouchEvent).touches[0].clientY]
+        : [(e as MouseEvent).clientX - 360, (e as MouseEvent).clientY - 140]
+    ]
+    ctx.beginPath()
+    ctx.moveTo(lastX, lastY)
+
+    // 当前绘图表面状态
+    const preData = ctx.getImageData(0, 0, 600, 490)
+    // 当前绘图表面进栈
+    preDrawAry.value.push(preData)
+  }
 }
 
 /**
@@ -307,27 +309,29 @@ function touchDraw(e: MouseEvent | TouchEvent) {
   if (!isPainting) return // 防止在未按下鼠标或触摸时绘制
   e.preventDefault()
 
-  let x: number, y: number
-  if ('touches' in e) {
-    x = (e as TouchEvent).touches[0].clientX - 360
-    y = (e as TouchEvent).touches[0].clientY - 140
-  } else {
-    x = (e as MouseEvent).clientX
-    y = (e as MouseEvent).clientY
-  }
+  if (isPainting && ctx) {
+    let x: number, y: number
+    if ('touches' in e) {
+      x = (e as TouchEvent).touches[0].clientX - 360
+      y = (e as TouchEvent).touches[0].clientY - 140
+    } else {
+      x = (e as MouseEvent).clientX
+      y = (e as MouseEvent).clientY
+    }
 
-  ctx.moveTo(lastX, lastY)
-  ctx.lineTo(x, y)
-  ctx.stroke()
-  ;[lastX, lastY] = [x, y]
-  canvasToBase64ToStorage(0)
+    ctx.moveTo(lastX, lastY)
+    ctx.lineTo(x, y)
+    ctx.stroke()
+    ;[lastX, lastY] = [x, y]
+    canvasToBase64ToStorage(0)
+  }
 }
 
 /**
  * 鼠标抬起事件
  */
 const stopDrawing = () => {
-  const preData = ctx?.getImageData(0, 0, 600, 420)
+  const preData = ctx?.getImageData(0, 0, 600, 490)
   if (!nextDrawAry.value.length) {
     // 当前绘图表面进栈
     middleAry.value.push(preData!)
@@ -345,7 +349,7 @@ const stopDrawing = () => {
  * 触摸抬起事件
  */
 function touchStopDrawing() {
-  const preData = ctx?.getImageData(0, 0, 600, 420)
+  const preData = ctx?.getImageData(0, 0, 600, 490)
   if (!nextDrawAry.value.length) {
     // 当前绘图表面进栈
     middleAry.value.push(preData!)

+ 11 - 5
src/views/tester/components/RehabilitationTraining/RehabilitationTrainingAchievement/components/RehabilitationTrainingDetailAnalysis/index.vue

@@ -1,9 +1,9 @@
 <template>
   <section v-if="showResult" class="detail-analysis-container">
-<!--    <div class="text-[18px] font-600">-->
-<!--      <span>{{ data.name }}</span>-->
-<!--      <span class="ml-4">{{ dayjs(data.time).format('YYYY-MM-DD HH:mm:ss') }}</span>-->
-<!--    </div>-->
+    <!--    <div class="text-[18px] font-600">-->
+    <!--      <span>{{ data.name }}</span>-->
+    <!--      <span class="ml-4">{{ dayjs(data.time).format('YYYY-MM-DD HH:mm:ss') }}</span>-->
+    <!--    </div>-->
     <el-row :gutter="0" class="mt-[20px]">
       <el-col :span="24">训练分析</el-col>
       <el-col :span="12">属性</el-col>
@@ -30,6 +30,7 @@
  */
 import { AchievementVO } from '@/api/tester/rehabilitation/training/achievement'
 import AchievementParamAPI, { AchievementParamVO } from '@/api/tester/rehabilitation/training/achievement/param'
+import { formatSeconds } from '@/utils'
 const showResult = ref(false)
 const pageData = ref<AchievementParamVO[]>([])
 const targetItem = ref<AchievementVO>()
@@ -41,7 +42,12 @@ function handleQuery(row: AchievementVO) {
     recordId: row.id
   })
     .then((res) => {
-      pageData.value = res
+      pageData.value = res.map((item) => {
+        if (item.code === 'gameTotalTime') {
+          // item.value = formatSeconds(Number(item.value))
+        }
+        return item
+      })
     })
     .finally(() => {})
 }

+ 11 - 6
src/views/tester/components/RehabilitationTraining/RehabilitationTrainingAchievement/index.vue

@@ -27,9 +27,16 @@
           </el-table-column>
         </el-table>
 
-        <pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.pageNum"
-          v-model:limit="queryParams.pageSize" :background="paginationBackground" class="!h-[60px] overflow-hidden"
-          :layout="paginationLayout" @pagination="handleQuery" />
+        <pagination
+          v-if="total > 0"
+          v-model:total="total"
+          v-model:page="queryParams.pageNum"
+          v-model:limit="queryParams.pageSize"
+          :background="paginationBackground"
+          class="!h-[60px] overflow-hidden"
+          :layout="paginationLayout"
+          @pagination="handleQuery"
+        />
       </div>
 
       <div class="content w-[33%] ml-[1%] h-full overflow-hidden">
@@ -50,7 +57,6 @@
  * 编写者: JutarryWu
  */
 import AchievementAPI, { AchievementQuery, AchievementVO } from '@/api/tester/rehabilitation/training/achievement'
-import { log } from 'console';
 const props = defineProps({
   planId: {
     type: String,
@@ -82,8 +88,7 @@ function handleQuery() {
   loading.value = true
   AchievementAPI.getPage(queryParams)
     .then((data) => {
-      console.log(data,data.records[0].gameName, 90);
-      gameNames.value = data.records[0].gameName
+      gameNames.value = data.records![0].gameName!
       pageData.value = data.records
       total.value = data.total
     })