刘洋 преди 1 година
родител
ревизия
3755cfe624

+ 21 - 1
src/App.vue

@@ -6,16 +6,36 @@ import useMainLayoutStore from '@/store/layout'
 import LockScreen from '@/layout/LockScreen.vue'
 import LoadingFlag from '@/components/common/LoadingFlag.vue'
 import RowNextBottomDialog from '@/components/common/RowNextBottomDialog.vue'
-import { onMounted } from 'vue'
+import { onMounted, watch } from 'vue'
 import { useRoute } from 'vue-router'
+import useFetch from './hooks/useFetch'
+import { useIntervalFn } from '@vueuse/core'
 const route = useRoute()
 const mainStore = useMainStore()
 const mainLayoutStore = useMainLayoutStore()
 
+const onlineCheckInterval = () => {
+  useFetch('onlineCheck').fetch()
+}
+const { pause, isActive, resume } = useIntervalFn(onlineCheckInterval, 5000, { immediate: false })
+watch(
+  () => mainStore.loginInfo,
+  (val) => {
+    if (val) {
+      resume()
+    } else {
+      pause()
+    }
+  }
+)
+
 if (mainStore.loginInfo) {
   // mainStore.getMyUserInfo()
   mainStore.getUserMarkConfig()
   mainLayoutStore.getRenderMenuList()
+  if (!isActive.value) {
+    resume()
+  }
 }
 window.addEventListener('online', () => {
   mainStore.setOnline(true)

+ 2 - 1
src/api/api-types/marking.d.ts

@@ -200,7 +200,8 @@ export namespace Marking {
   type GetMarkScoreHistoryListWithTask = BaseDefine<{ taskId: number | string }, MarkScoreHistory[]>
 
   type RejectMarkHistory = BaseDefine<{ description?: string; id: number; reason?: string }>
-  type RejectCustomQueryTask = BaseDefine<{ description?: string; reason?: string; taskId: number }>
+  // type RejectCustomQueryTask = BaseDefine<{ description?: string; reason?: string; taskId: number }>
+  type RejectCustomQueryTask = BaseDefine<{ description?: string; reason?: string; taskIds: any }>
 
   interface ArbitrationListItem {
     chiefName: string

+ 2 - 0
src/api/api-types/user.d.ts

@@ -233,6 +233,7 @@ export namespace User {
 
   type ImportUsersTemplate = BaseDefine<any, any>
   type ImportUsersFile = BaseDefine<any, any>
+  type OnlineCheck = BaseDefine<any, any>
 
   type UnlockScreen = BaseDefine<{ password: string }, any>
 
@@ -263,5 +264,6 @@ export namespace User {
     unLockScreen: UnlockScreen
     importUsersTemplate: ImportUsersTemplate
     importUsersFile: ImportUsersFile
+    onlineCheck: OnlineCheck
   }
 }

+ 7 - 1
src/api/marking.ts

@@ -48,7 +48,13 @@ const MarkingApi: DefineApiModule<Marking.ApiMap> = {
   getMarkScoreHistoryListWithTask: '/api/mark/history/task',
   /** 打回 */
   rejectMarkHistory: '/api/problem/history/reject',
-  rejectCustomQueryTask: '/api/custom/query/reject',
+  // rejectCustomQueryTask: '/api/custom/query/reject',
+  rejectCustomQueryTask: {
+    url: '/api/custom/query/reject',
+    headers: {
+      'Content-Type': 'application/json',
+    },
+  },
   /** 仲裁卷 */
   getArbitrationList: '/api/arbitration/page',
   /** 仲裁卷打分 */

+ 1 - 0
src/api/user.ts

@@ -61,6 +61,7 @@ const UserApi: DefineApiModule<User.ApiMap> = {
     },
     timeout: 0,
   },
+  onlineCheck: '/api/user/online/signal',
 }
 
 export default UserApi

+ 2 - 1
src/components/shared/SendBackMark.vue

@@ -121,7 +121,8 @@ const onSendBack = async () => {
     // if (valid) {
     // await ApiMap[props.type]({ description: model.description, reason: model.reason, id: props.id })
     if (props.type === 'custom-check') {
-      await rejectCustomCheckData({ description: model.description, reason: model.reason, taskId: props.id })
+      // await rejectCustomCheckData({ description: model.description, reason: model.reason, taskId: props.id })
+      await rejectCustomCheckData({ description: model.description, reason: model.reason, taskIds: props.id })
     } else {
       await ApiMap[props.type]({ description: model.description, reason: model.reason, id: props.id })
     }

+ 2 - 4
src/hooks/useOptions.ts

@@ -152,8 +152,7 @@ const useOptions = (
   const groupListWithAll = computed(() => {
     return groupList.value?.length &&
       (isAdmin.value || isChief.value || isExpert.value || isLeader.value) &&
-      showAllLabel &&
-      !multGroup
+      showAllLabel
       ? [{ label: '全部', value: void 0 } as unknown as Group].concat(groupList.value)
       : groupList.value
   })
@@ -210,8 +209,7 @@ const useOptions = (
         changeModelValue('group')(
           multGroup && showAllLabel
             ? groupList.value?.length && (isAdmin.value || isChief.value || isExpert.value || isLeader.value)
-              ? // ? [void 0]
-                []
+              ? [void 0]
               : []
             : void 0
         )

+ 13 - 5
src/hooks/useTableCheck.ts

@@ -29,8 +29,12 @@ const useTableCheck = <T extends TableDataType<InputDataType>>(
   data: T,
   auto = true,
   queryPosition: any = null,
-  apiNotByPage = false
+  apiNotByPage = false,
+  isMult: any = null
 ) => {
+  // watch(isMult, () => {
+  //   alert(isMult?.value)
+  // })
   const tableRef = ref<InstanceTable>()
 
   const elTableRef = computed(() => {
@@ -124,14 +128,18 @@ const useTableCheck = <T extends TableDataType<InputDataType>>(
   /** 表格选中 */
   // const onCurrentChange = (row: RowType<T>) => {
   const onCurrentChange = (row: any) => {
-    current.value = row
+    if (!isMult?.value) {
+      current.value = row
+    }
   }
 
   /** 表格行双击 */
   // const onDbClick = (row: RowType<T>) => {
-  const onDbClick = (row: any) => {
-    currentView.value = row
-    visibleHistory.value = true
+  const onDbClick = (row: any, column: any, e: any) => {
+    if (e && !(e.target.className || '').includes('el-checkbox__inner')) {
+      currentView.value = row
+      visibleHistory.value = true
+    }
   }
 
   /** 下一份 */

+ 10 - 10
src/modules/admin-data/task-setting/index.vue

@@ -123,16 +123,16 @@ const customGroupChange = (v: any) => {
   }
 }
 const transGroupOptions = computed(() => {
-  // return (taskSettingModel.markingGroupNumbers || []).includes(undefined)
-  //   ? (groupListWithAll.value || []).map((item: any) => {
-  //       item.value != undefined && (item.disabled = true)
-  //       return item
-  //     })
-  //   : groupListWithAll.value.map((item: any) => {
-  //       item.disabled = false
-  //       return item
-  //     })
-  return groupListWithAll.value || []
+  return (taskSettingModel.markingGroupNumbers || []).includes(undefined)
+    ? (groupListWithAll.value || []).map((item: any) => {
+        item.value != undefined && (item.disabled = true)
+        return item
+      })
+    : groupListWithAll.value.map((item: any) => {
+        item.disabled = false
+        return item
+      })
+  // return groupListWithAll.value || []
 })
 
 const items = computed<EpFormItem[]>(() => [

+ 10 - 10
src/modules/analysis/group-monitoring/hooks/useFormFilter.ts

@@ -81,16 +81,16 @@ const useFormFilter = () => {
     }
   }
   const transGroupOptions = computed(() => {
-    // return (model.markingGroupNumbers || []).includes(undefined)
-    //   ? (groupListWithAll.value || []).map((item: any) => {
-    //       item.value != undefined && (item.disabled = true)
-    //       return item
-    //     })
-    //   : groupListWithAll.value.map((item: any) => {
-    //       item.disabled = false
-    //       return item
-    //     })
-    return groupListWithAll.value || []
+    return (model.markingGroupNumbers || []).includes(undefined)
+      ? (groupListWithAll.value || []).map((item: any) => {
+          item.value != undefined && (item.disabled = true)
+          return item
+        })
+      : groupListWithAll.value.map((item: any) => {
+          item.disabled = false
+          return item
+        })
+    // return groupListWithAll.value || []
   })
   const items = computed<EpFormItem[]>(() => [
     OneRowSpan5({

+ 1 - 1
src/modules/analysis/marker-statistics/index.vue

@@ -11,7 +11,7 @@
           <lock-entry />
         </div>
         <div class="icon-item">
-          <message></message>
+          <message :paper-path="current?.filePath" :secret-number="current?.secretNumber"></message>
         </div>
       </div>
     </div>

+ 10 - 10
src/modules/analysis/personnel-compare/hooks/useCompareFilter.ts

@@ -66,16 +66,16 @@ const useCompareFilter = () => {
     }
   }
   const transGroupOptions = computed(() => {
-    // return (model.markingGroupNumber || []).includes(undefined)
-    //   ? (groupListWithAll.value || []).map((item: any) => {
-    //       item.value != undefined && (item.disabled = true)
-    //       return item
-    //     })
-    //   : groupListWithAll.value.map((item: any) => {
-    //       item.disabled = false
-    //       return item
-    //     })
-    return groupListWithAll.value || []
+    return (model.markingGroupNumber || []).includes(undefined)
+      ? (groupListWithAll.value || []).map((item: any) => {
+          item.value != undefined && (item.disabled = true)
+          return item
+        })
+      : groupListWithAll.value.map((item: any) => {
+          item.disabled = false
+          return item
+        })
+    // return groupListWithAll.value || []
   })
 
   const items = computed(() => [

+ 2 - 2
src/modules/analysis/personnel-statistics/components/StatisticsPersonnel.vue

@@ -309,8 +309,8 @@ const data = computed(() => {
 })
 
 const { tableRef, tableData, current, onCurrentChange, onDbClick, currentView, elTableRef } = useTableCheck(data, false)
-const myDbClick = (row: any) => {
-  onDbClick(row)
+const myDbClick = (row: any, column: any, e: any) => {
+  onDbClick(row, column, e)
   if (currentView.value && !!currentView.value.markingGroupNumber && !!currentView.value.markerId) {
     push({
       name: 'AnalysisPersonnelStatisticsMarker',

+ 10 - 10
src/modules/analysis/personnel-statistics/hooks/useStatisticsFilter.ts

@@ -144,16 +144,16 @@ const useStatisticsFilter = () => {
     }
   }
   const transGroupOptions = computed(() => {
-    // return (model.markingGroupNumber || []).includes(undefined)
-    //   ? (groupListWithAll.value || []).map((item: any) => {
-    //       item.value != undefined && (item.disabled = true)
-    //       return item
-    //     })
-    //   : groupListWithAll.value.map((item: any) => {
-    //       item.disabled = false
-    //       return item
-    //     })
-    return groupListWithAll.value || []
+    return (model.markingGroupNumber || []).includes(undefined)
+      ? (groupListWithAll.value || []).map((item: any) => {
+          item.value != undefined && (item.disabled = true)
+          return item
+        })
+      : groupListWithAll.value.map((item: any) => {
+          item.disabled = false
+          return item
+        })
+    // return groupListWithAll.value || []
   })
 
   const items = computed<EpFormItem[]>(() => [

+ 66 - 34
src/modules/marking/inquiry-result/index.vue

@@ -9,9 +9,12 @@
       <!-- <el-button :disabled="!current?.taskId" class="m-l-base" size="small" type="primary" @click="onEditScore"
         >修改给分</el-button
       > -->
-      <el-button :disabled="!current?.taskId" class="m-l-base m-r-auto" size="small" type="primary" @click="onSendBack"
+      <el-button :disabled="!current?.taskId" class="m-l-base" size="small" type="primary" @click="onSendBack"
         >打回</el-button
       >
+      <el-button custom-1 class="m-l-base m-r-auto" size="small" type="success" @click="multToggle">{{
+        isMult ? '取消多选' : '多选'
+      }}</el-button>
     </mark-header>
     <div class="flex flex-1 overflow-hidden p-base mark-container">
       <splitpanes class="default-theme" style="height: 100%" @resize="setPaneSize">
@@ -83,13 +86,14 @@
               size="small"
               height="100%"
               v-bind="pagination"
-              highlight-current-row
+              :highlight-current-row="!isMult"
               :data="tableData"
               :columns="columns"
               :cell-style="{ padding: '6px 0' }"
               :memory-column="true"
               @current-change="onCurrentChange"
               @row-dblclick="onDbClick"
+              @selection-change="handleSelectionChange"
             ></base-table>
           </div>
         </pane>
@@ -102,12 +106,7 @@
     v-model="visibleHistory"
     :task="currentViewHistory"
   ></mark-history-list>
-  <send-back-mark
-    :id="current?.taskId"
-    v-model="sendBackVisible"
-    type="custom-check"
-    @rejected="onRejected"
-  ></send-back-mark>
+  <send-back-mark :id="rejectIds" v-model="sendBackVisible" type="custom-check" @rejected="onRejected"></send-back-mark>
 
   <base-dialog v-model="setExpertPaperVisible" title="设置专家卷" :footer="false" :width="540">
     <base-form size="small" :model="setExpertModel" :items="items" :label-width="'130px'">
@@ -142,7 +141,7 @@
 
 <script setup lang="tsx" name="MarkingInquiryResult">
 /** 自定义查询结果 */
-import { ref, computed, watch, reactive } from 'vue'
+import { ref, computed, watch, reactive, nextTick } from 'vue'
 import { useRoute } from 'vue-router'
 import { ElButton, ElPagination, ElMessage } from 'element-plus'
 import { add } from '@/utils/common'
@@ -171,6 +170,11 @@ import { Splitpanes, Pane } from 'splitpanes'
 import { setPaneSize } from '@/utils/common'
 import useMainStore from '@/store/main'
 import BtnPagination from '@/components/common/BtnPagination.vue'
+const isMult = ref(false)
+const multipleSelection = ref<any>([])
+const handleSelectionChange = (val: any) => {
+  multipleSelection.value = val
+}
 const mainStore = useMainStore()
 const paneSize = computed(() => {
   return mainStore.paneSizeConfig[location.pathname] || 60
@@ -191,6 +195,7 @@ const onSendBack = () => {
 const onRejected = () => {
   // onRefresh()
   ElMessage.success('打回成功')
+  fetchTable()
 }
 
 /** 给分板 */
@@ -260,31 +265,40 @@ const onOperationClick: OperationClick = ({ type, value }) => {
   operationHandles[type]?.(value)
 }
 
-const columns: EpTableColumn<RowType>[] = [
-  {
-    label: '密号',
-    prop: 'secretNumber',
-    minWidth: 110,
-    fixed: 'left',
-    formatter(row: any) {
-      return (
-        <SecNumberStatus
-          secretNumber={row.secretNumber}
-          checked={row.checked}
-          corrected={row.corrected}
-        ></SecNumberStatus>
-      )
+const columns: any = computed(() => {
+  let cols: any = [
+    {
+      label: '密号',
+      prop: 'secretNumber',
+      minWidth: 110,
+      fixed: 'left',
+      formatter(row: any) {
+        return (
+          <SecNumberStatus
+            secretNumber={row.secretNumber}
+            checked={row.checked}
+            corrected={row.corrected}
+          ></SecNumberStatus>
+        )
+      },
     },
-  },
-  { label: '评卷员', prop: 'markerName', minWidth: 90 },
-  { label: '评卷员给分', prop: 'markerScore', minWidth: 108, sortable: true },
-  { label: '组长给分', prop: 'headerScore', minWidth: 94, sortable: true },
-  { label: '客观分', prop: 'objectiveScore', minWidth: 90, sortable: true },
-  { label: '客主比', prop: 'ratio', minWidth: 90, sortable: true },
-  { label: '成绩', prop: 'markScore', minWidth: 90, sortable: true },
-  { label: '评卷时间', prop: 'markTime', minWidth: 130 },
-  { label: '抽查次数', prop: 'customCheckNumber', minWidth: 94, sortable: true },
-]
+    { label: '评卷员', prop: 'markerName', minWidth: 90 },
+    { label: '评卷员给分', prop: 'markerScore', minWidth: 108, sortable: true },
+    { label: '组长给分', prop: 'headerScore', minWidth: 94, sortable: true },
+    { label: '客观分', prop: 'objectiveScore', minWidth: 90, sortable: true },
+    { label: '客主比', prop: 'ratio', minWidth: 90, sortable: true },
+    { label: '成绩', prop: 'markScore', minWidth: 90, sortable: true },
+    { label: '评卷时间', prop: 'markTime', minWidth: 130 },
+    { label: '抽查次数', prop: 'customCheckNumber', minWidth: 94, sortable: true },
+  ]
+  if (isMult.value) {
+    cols.unshift({
+      type: 'selection',
+      width: 55,
+    })
+  }
+  return cols
+})
 
 const transTime = (str: any) => {
   if (str.indexOf('-') > -1) {
@@ -328,7 +342,8 @@ const {
   onDbClick,
   onCurrentChange,
   nextRow,
-} = useTableCheck(data)
+  elTableRef,
+} = useTableCheck(data, true, null, false, isMult)
 
 watch(current, () => {
   if (current.value) {
@@ -486,6 +501,23 @@ const imgOption = computed<SetImgBgOption>(() => {
 const { drawing, dataUrl } = useSetImgBg(imgOption, frontColor, setFrontColor)
 
 onRefresh()
+
+const multToggle = () => {
+  isMult.value = !isMult.value
+  editScoreVisible.value = !isMult.value
+  if (!isMult.value && tableData.value?.length && current.value) {
+    nextTick(() => {
+      let index = tableData.value.findIndex((task: any) => task.taskId == current.value?.taskId)
+      elTableRef?.value?.setCurrentRow(tableData.value[index == -1 ? 0 : index])
+    })
+  }
+  if (isMult.value) {
+    elTableRef?.value?.clearSelection()
+  }
+}
+const rejectIds = computed(() => {
+  return isMult.value ? multipleSelection.value.map((item: any) => item.taskId) : [current.value?.taskId]
+})
 </script>
 
 <style scoped lang="scss">

+ 10 - 10
src/modules/marking/inquiry/index.vue

@@ -282,16 +282,16 @@ const customGroupChange = (v: any) => {
   }
 }
 const transGroupOptions = computed(() => {
-  // return (model.markingGroupNumbers || []).includes(undefined)
-  //   ? (groupListWithAll.value || []).map((item: any) => {
-  //       item.value != undefined && (item.disabled = true)
-  //       return item
-  //     })
-  //   : groupListWithAll.value.map((item: any) => {
-  //       item.disabled = false
-  //       return item
-  //     })
-  return groupListWithAll.value || []
+  return (model.markingGroupNumbers || []).includes(undefined)
+    ? (groupListWithAll.value || []).map((item: any) => {
+        item.value != undefined && (item.disabled = true)
+        return item
+      })
+    : groupListWithAll.value.map((item: any) => {
+        item.disabled = false
+        return item
+      })
+  // return groupListWithAll.value || []
 })
 
 const items = computed<EpFormItem[]>(() => [

+ 10 - 10
src/modules/monitor/training-monitoring/hooks/useFormFilter.ts

@@ -134,16 +134,16 @@ const useFormFilter = () => {
     }
   }
   const transGroupOptions = computed(() => {
-    // return (model.markingGroupNumbers || []).includes(undefined)
-    //   ? (groupListWithAll.value || []).map((item: any) => {
-    //       item.value != undefined && (item.disabled = true)
-    //       return item
-    //     })
-    //   : groupListWithAll.value.map((item: any) => {
-    //       item.disabled = false
-    //       return item
-    //     })
-    return groupListWithAll.value || []
+    return (model.markingGroupNumbers || []).includes(undefined)
+      ? (groupListWithAll.value || []).map((item: any) => {
+          item.value != undefined && (item.disabled = true)
+          return item
+        })
+      : groupListWithAll.value.map((item: any) => {
+          item.disabled = false
+          return item
+        })
+    // return groupListWithAll.value || []
   })
 
   const items = computed<EpFormItem[]>(() => {

+ 10 - 10
src/modules/quality/self-check/index.vue

@@ -108,16 +108,16 @@ const customGroupChange = (v: any) => {
   }
 }
 const transGroupOptions = computed(() => {
-  // return (model.markingGroupNumbers || []).includes(undefined)
-  //   ? (groupListWithAll.value || []).map((item: any) => {
-  //       item.value != undefined && (item.disabled = true)
-  //       return item
-  //     })
-  //   : groupListWithAll.value.map((item: any) => {
-  //       item.disabled = false
-  //       return item
-  //     })
-  return groupListWithAll.value || []
+  return (model.markingGroupNumbers || []).includes(undefined)
+    ? (groupListWithAll.value || []).map((item: any) => {
+        item.value != undefined && (item.disabled = true)
+        return item
+      })
+    : groupListWithAll.value.map((item: any) => {
+        item.disabled = false
+        return item
+      })
+  // return groupListWithAll.value || []
 })
 
 const items = computed<EpFormItem[]>(() => {