zhangjie vor 4 Tagen
Ursprung
Commit
d3807bf92e

+ 2 - 6
src/components/shared/ImageListPreview.vue

@@ -324,15 +324,11 @@ watch(
     .image-container {
       flex: 1;
       overflow: auto;
-      display: flex;
-      align-items: center;
-      justify-content: center;
       background-color: #f5f5f5;
 
       .current-img {
-        max-width: 100%;
-        max-height: 100%;
-        object-fit: contain;
+        width: 100%;
+        height: auto;
       }
 
       .no-image {

+ 1 - 59
src/components/shared/ScoringPanel.vue

@@ -38,9 +38,7 @@
       </template>
     </div>
     <template #footer>
-      <el-button type="primary" class="full-w" :disabled="buttonDisabled" @click="onEnter(0)">{{
-        buttonText
-      }}</el-button>
+      <el-button type="primary" class="full-w" :disabled="!allowSubmit" @click="onEnter(0)">确定</el-button>
     </template>
   </scoring-panel-container>
 </template>
@@ -56,15 +54,7 @@ import useVW from '@/hooks/useVW'
 import useFetch from '@/hooks/useFetch'
 import { sessionStorage } from '@/plugins/storage'
 import bus from '@/utils/bus'
-import useMarkStore from '@/store/mark'
 
-interface MarkDelayItem {
-  startScore: number
-  endScore: number
-  minMarkTime: number
-}
-
-const markStore = useMarkStore()
 const props = withDefaults(
   defineProps<{
     /** 弹窗模式? */
@@ -170,27 +160,10 @@ const questionList = computed(() => {
   }
   const { mainNumber, mainTitle, questionList = [] } = questionStruct.value
 
-  // 更新分数端评卷时间
-  const markDelay = questionStruct.value.markDelay
-    ? (JSON.parse(questionStruct.value.markDelay) as MarkDelayItem[])
-    : []
-
-  const getMarkLevelSpeedLimit = (score: number): number => {
-    if (markDelay.length) {
-      const speedLimit = markDelay.find((limit) => {
-        return limit.endScore >= score && limit.startScore <= score
-      })
-      return speedLimit?.minMarkTime || 0
-    } else {
-      return 0
-    }
-  }
-
   return questionList.map((q) => ({
     ...q,
     mainNumber,
     mainTitle,
-    markSpeedLimit: getMarkLevelSpeedLimit(q.totalScore),
   }))
 })
 
@@ -200,32 +173,6 @@ const allowSubmit = computed(() => {
   return filterArr.length === questionList.value?.length
 })
 
-// 倒计时相关计算属性
-const isCountingDown = computed(() => markStore.isCountingDown)
-const buttonText = computed(() => markStore.buttonText)
-const buttonDisabled = computed(() => {
-  return isCountingDown.value || !allowSubmit.value
-})
-
-// 启动倒计时
-const startCountdown = () => {
-  const markSpeedLimit = questionList.value[activeIndex.value ?? 0]?.markSpeedLimit ?? 0
-  markStore.startCountdown(markSpeedLimit)
-}
-
-const currentQuestion = computed(() => {
-  return questionList.value[activeIndex.value ?? 0] ?? {}
-})
-
-// 监听questionList变化,启动倒计时
-watch(
-  () => currentQuestion.value,
-  () => {
-    startCountdown()
-  },
-  { immediate: true, deep: true }
-)
-
 const getClass = (val: string, callback?: string) => {
   return dialogMode.value ? val : callback || ''
 }
@@ -294,11 +241,6 @@ bus.on('openScoreDialogByMouseRight', () => {
     onToggleClick()
   }
 })
-
-// 组件卸载时清除倒计时
-onUnmounted(() => {
-  markStore.clearCountdown()
-})
 </script>
 
 <style scoped lang="scss">

+ 2 - 10
src/components/shared/ScoringPanelItem.vue

@@ -44,12 +44,12 @@
           </div>
           <el-button
             v-if="!!props.showConfirmBtn"
-            :disabled="buttonDisabled"
+            :disabled="!props.allowSubmit"
             size="small"
             type="primary"
             style="min-width: 44px; margin-left: 5px; margin-bottom: 8px"
             @click="confirmWithBtn"
-            >{{ buttonText }}</el-button
+            >确定</el-button
           >
           <el-button
             v-if="!!props.showAllPaperBtn"
@@ -190,14 +190,6 @@ const focused = ref<boolean>(false)
 const refInput1 = ref<HTMLInputElement>()
 const refInput2 = ref<HTMLInputElement>()
 
-// 使用store中的倒计时功能
-const isCountingDown = computed(() => markStore.isCountingDown)
-const buttonText = computed(() => markStore.buttonText)
-
-const buttonDisabled = computed(() => {
-  return isCountingDown.value || !props.allowSubmit
-})
-
 watch(
   () => props.active,
   () => {

+ 46 - 3
src/components/shared/ScoringPanelWithConfirm.vue

@@ -27,12 +27,12 @@
       <div class="flex items-center justify-between">
         <el-button
           ref="confirmButtonRef"
-          :disabled="!modelScore.length"
+          :disabled="buttonDisabled"
           class="confirm-button"
           type="primary"
           @click="onConfirmSubmit"
         >
-          是(Y)
+          {{ buttonText }}
         </el-button>
         <el-button ref="cancelButtonRef" class="confirm-button" plain @click="onCancelSubmit">否(N)</el-button>
       </div>
@@ -46,7 +46,7 @@
 </template>
 
 <script setup lang="ts" name="ScoringPanelWithConfirm">
-import { computed, ref, useAttrs, watch, nextTick, onMounted, onBeforeUnmount, unref } from 'vue'
+import { computed, ref, useAttrs, watch, nextTick, onMounted, onBeforeUnmount, unref, onUnmounted } from 'vue'
 import { add } from '@/utils/common'
 import { ElButton } from 'element-plus'
 import ScoringPanel from '@/components/shared/ScoringPanel.vue'
@@ -58,8 +58,16 @@ import { cloneDeep } from 'lodash-es'
 import bus from '@/utils/bus'
 import { useRoute } from 'vue-router'
 import type { ExtractApiResponse } from '@/api/api'
+import useMarkStore from '@/store/mark'
+
 const route = useRoute()
 
+interface MarkDelayItem {
+  startScore: number
+  endScore: number
+  minMarkTime: number
+}
+
 const props = defineProps<{
   /** 显示隐藏 */
   visible?: boolean
@@ -74,6 +82,8 @@ const props = defineProps<{
   loading?: any
   imageList?: string[]
   showAllPaperBtn?: boolean
+  // 是否显示分数段倒计时
+  showLimitTime?: boolean
 }>()
 
 const attrs = useAttrs()
@@ -84,6 +94,8 @@ const emit = defineEmits<{
   (e: 'update:score', scores: number[]): void
 }>()
 
+const markStore = useMarkStore()
+
 /** 给分面板显示隐藏 */
 const modalVisible = useVModel(props, 'visible')
 
@@ -137,13 +149,38 @@ const totalScore = computed(() => {
 
 const questionInfo = ref<ExtractApiResponse<'getQuestionStruct'>>()
 
+// 倒计时相关计算属性
+const buttonText = computed(() => (markStore.countdownTime > 0 ? `${markStore.countdownTime}s` : '是(Y)'))
+const buttonDisabled = computed(() => {
+  return markStore.countdownTime > 0 || !modelScore.value.length
+})
+
 /** 提交 */
 const onSubmit = (data: ExtractApiResponse<'getQuestionStruct'>) => {
   questionInfo.value = data
+
   modalVisible.value = false
   nextTick(() => {
     setTimeout(() => {
       submitModalVisible.value = true
+      if (!props.showLimitTime) return
+
+      // 更新分数端评卷时间
+      const markDelay = questionInfo.value.markDelay
+        ? (JSON.parse(questionInfo.value.markDelay) as MarkDelayItem[])
+        : []
+      const getMarkLevelSpeedLimit = (score: number): number => {
+        if (markDelay.length) {
+          const speedLimit = markDelay.find((limit) => {
+            return limit.endScore >= score && limit.startScore <= score
+          })
+          return speedLimit?.minMarkTime || 0
+        } else {
+          return 0
+        }
+      }
+
+      markStore.startCountdown(getMarkLevelSpeedLimit(totalScore.value))
     }, 10)
   })
 }
@@ -152,6 +189,7 @@ const onSubmit = (data: ExtractApiResponse<'getQuestionStruct'>) => {
 const onCancelSubmit = () => {
   modalVisible.value = true
   submitModalVisible.value = false
+  markStore.clearCountdown()
 }
 
 /** 确认提交 */
@@ -169,6 +207,11 @@ const previewModalVisible = ref<boolean>(false)
 const onViewPapers = () => {
   previewModalVisible.value = true
 }
+
+onUnmounted(() => {
+  if (!props.showLimitTime) return
+  markStore.clearCountdown()
+})
 </script>
 
 <style scoped lang="scss">

+ 5 - 4
src/directives/customDialogResizeImg.ts

@@ -73,12 +73,13 @@ export const customDialogResizeImg = {
         dragDom.style.top =
           (winHeight / 2 - (img.clientHeight + 44) / 2 < 0 ? 0 : winHeight / 2 - (img.clientHeight + 44) / 2) + 'px'
       }
+      dragDom.style.height = 'auto'
     }
     img.onerror = function () {
-      dragDom.style.width = minWidth + 'px'
-      dragDom.style.height = minWidth + 'px'
-      dragDom.style.left = winWidth / 2 - minWidth / 2 + 'px'
-      dragDom.style.top = winHeight / 2 - minHeight / 2 + 'px'
+      // dragDom.style.width = minWidth + 'px'
+      dragDom.style.height = minHeight + 'px'
+      // dragDom.style.left = winWidth / 2 - minWidth / 2 + 'px'
+      // dragDom.style.top = winHeight / 2 - minHeight / 2 + 'px'
       imgError = true
       resizeEl.style.display = 'none'
     }

+ 18 - 7
src/modules/analysis/personnel-statistics/components/StatisticsGroup.vue

@@ -45,7 +45,7 @@
                 />
               </el-button>
             </el-tooltip>
-            <span>全</span>
+            <span>全</span>
           </template>
           <template v-else>
             <el-tooltip effect="dark" content="双击展开本组" placement="top">
@@ -83,6 +83,7 @@
 <script setup lang="tsx" name="StatisticsGroup">
 /** 人员数据统计-按小组 */
 import { watch, computed, ref } from 'vue'
+import { useRouter } from 'vue-router'
 import { Plus, Minus } from '@element-plus/icons-vue'
 import BaseTable from '@/components/element/BaseTable.vue'
 import VueECharts from 'vue-echarts'
@@ -108,6 +109,7 @@ const rowClassName = (obj: any) => {
     return 'fixed-row'
   }
 }
+const { push } = useRouter()
 
 const columns = computed(() => {
   return [
@@ -127,11 +129,7 @@ const columns = computed(() => {
       width: 60,
       fixed: 'left',
       formatter(row: any) {
-        return row.markingGroupNumber === 0
-          ? '全部'
-          : row.isGroupTotalRow
-          ? `第${row.markingGroupNumber}组`
-          : `${row.markingGroupNumber}`
+        return row.markingGroupNumber === 0 ? '全部' : `第${row.markingGroupNumber}组`
       },
     },
     {
@@ -150,7 +148,7 @@ const columns = computed(() => {
       minWidth: 80,
       formatter(row: any) {
         let compareTarget = tableData.value.find((item: any) => item.markingGroupNumber == 0)
-        if (compareTarget) {
+        if (!row.isGroupTotalRow && compareTarget) {
           return row.xyRelate < compareTarget.xyRelate ? <span style="color:red">{row.xyRelate}</span> : row.xyRelate
         } else {
           return row.xyRelate
@@ -316,6 +314,19 @@ const onExpendRow = (row: any) => {
 const onRowDblHandle = (row: any) => {
   if (row.markerDetails) {
     onExpendRow(row)
+  } else {
+    if (row && !!row.markingGroupNumber && !!row.markerId) {
+      push({
+        name: 'AnalysisPersonnelStatisticsMarker',
+        query: {
+          markerId: row.markerId,
+          markerName: row.markerName,
+          source: '人员数据统计',
+          subjectCode: props.params?.subjectCode,
+          questionMainNumber: props.params?.questionMainNumber,
+        },
+      })
+    }
   }
 }
 

+ 11 - 1
src/modules/marking/mark/index.vue

@@ -66,6 +66,7 @@
           :subject-code="mainStore.myUserInfo?.subjectCode"
           :large="true"
           :loading="mergeLoading"
+          show-limit-time
           @submit="onSubmit"
         ></scoring-panel-with-confirm>
       </div>
@@ -591,6 +592,11 @@ const operationHandles: Partial<Record<OperationType, (...args: any) => void>> =
 
 const onOperationClick: OperationClick = ({ type, value }) => {
   operationHandles[type]?.(value)
+  if (type === 'center') {
+    nextTick(() => {
+      updateImgScoreLeft()
+    })
+  }
 }
 
 const imgOption = computed<SetImgBgOption>(() => {
@@ -674,10 +680,14 @@ const imgScoreStyle = computed(() => {
     left: imgScoreLeft.value + 'px',
   }
 })
+function updateImgScoreLeft() {
+  if (!paperImg.value) return
+  imgScoreLeft.value = paperImg.value.offsetLeft + paperImg.value.offsetWidth - 80
+}
 const imgLoaded = (e: Event) => {
   // previewLeft.value = paperImg.value.width - 40 + 'px'
   showPreviewBtn.value = true
-  imgScoreLeft.value = (e.target as HTMLElement).offsetWidth - 80
+  updateImgScoreLeft()
 }
 
 const handleTaskPool = () => {

+ 5 - 4
src/utils/common.ts

@@ -340,8 +340,9 @@ export const getTaskImageUrl = (filePath: string) => {
   }
   // /file/slice/1/1/10101/1/013/1/101011221201303-1.jpg
   const [fbasename, fext] = filePath.split('.')
-  const fbname = fbasename || ''
-  const fpath = fbname.substring(0, fbname.length - 2)
-  if (!fpath) return []
-  return [`${fpath}-1.${fext}`, `${fpath}-2.${fext}`]
+  if (!fbasename) return []
+  const ffs = fbasename.split('/')
+  const fpath = ffs.slice(0, -1).join('/')
+  const fname = ffs[ffs.length - 1].substring(0, ffs[ffs.length - 1].length - 2)
+  return [`${fpath}/1/${fname}-1.${fext}`, `${fpath}/2/${fname}-2.${fext}`]
 }