|
@@ -1,15 +1,17 @@
|
|
|
<template>
|
|
|
- <div class="p-small radius-base fill-blank">
|
|
|
+ <div class="p-small radius-base fill-blank statistics-group">
|
|
|
<base-table
|
|
|
ref="tableRef"
|
|
|
border
|
|
|
stripe
|
|
|
size="small"
|
|
|
:columns="columns"
|
|
|
- :data="tableData"
|
|
|
+ :data="sortTableData"
|
|
|
:height="tableHeight"
|
|
|
+ :row-class-name="rowClassName"
|
|
|
highlight-current-row
|
|
|
@current-change="onCurrentChange"
|
|
|
+ @sort-change="sortChange"
|
|
|
>
|
|
|
</base-table>
|
|
|
</div>
|
|
@@ -26,7 +28,7 @@
|
|
|
|
|
|
<script setup lang="ts" name="StatisticsGroup">
|
|
|
/** 人员数据统计-按小组 */
|
|
|
-import { watch, computed } from 'vue'
|
|
|
+import { watch, computed, ref } from 'vue'
|
|
|
import BaseTable from '@/components/element/BaseTable.vue'
|
|
|
import VueECharts from 'vue-echarts'
|
|
|
import useVW, { usePX } from '@/hooks/useVW'
|
|
@@ -41,6 +43,11 @@ const props = defineProps<{
|
|
|
data: ExtractApiResponse<'getStatisticsByGroup'>
|
|
|
params: ExtractApiParams<'getStatisticsByGroup'> & { expand: boolean }
|
|
|
}>()
|
|
|
+const rowClassName = (obj: any) => {
|
|
|
+ if (obj.row.markingGroupNumber === 0) {
|
|
|
+ return 'fixed-row'
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatisticsByGroup'>>>[] = [
|
|
|
{
|
|
@@ -58,10 +65,16 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
|
|
|
minWidth: 84,
|
|
|
slotName: 'marker',
|
|
|
formatter(row: any) {
|
|
|
- return row.markingGroupNumber === 0 ? '题组' : `第${row.markingGroupNumber}组`
|
|
|
+ return row.markingGroupNumber === 0 ? '全体' : `第${row.markingGroupNumber}组`
|
|
|
},
|
|
|
},
|
|
|
{ align: 'center', label: '评卷份数', prop: 'markingPaperCount', width: 92 },
|
|
|
+ { align: 'center', label: '平均分', prop: 'avg', width: 80 },
|
|
|
+ { align: 'center', label: '相关系数', prop: 'xyRelate', width: 90 },
|
|
|
+ { align: 'center', label: '标准差', prop: 'std', width: 80 },
|
|
|
+ { align: 'center', label: '综合系数', prop: 'integration', width: 90 },
|
|
|
+
|
|
|
+ // { align: 'center', label: '评卷份数', prop: 'markingPaperCount', width: 92 },
|
|
|
{ align: 'center', label: '当日可阅', prop: 'markDayCount', width: 92 },
|
|
|
{ align: 'center', label: '剩余可阅', prop: 'todoMarkDayCount', width: 92 },
|
|
|
{ align: 'center', label: '客观题0分量', prop: 'objectiveZero', width: 120 },
|
|
@@ -78,9 +91,9 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
|
|
|
},
|
|
|
{ align: 'center', label: '抽查量', prop: 'checkCount', width: 90 },
|
|
|
{ align: 'center', label: '抽查改正量', prop: 'checkCorrectCount', width: 110 },
|
|
|
- { align: 'center', label: '相关系数', prop: 'xyRelate', width: 90 },
|
|
|
- { align: 'center', label: '平均分', prop: 'avg', width: 80 },
|
|
|
- { align: 'center', label: '标准差', prop: 'std', width: 80 },
|
|
|
+ // { align: 'center', label: '相关系数', prop: 'xyRelate', width: 90 },
|
|
|
+ // { align: 'center', label: '平均分', prop: 'avg', width: 80 },
|
|
|
+ // { align: 'center', label: '标准差', prop: 'std', width: 80 },
|
|
|
{ align: 'center', label: '近5分钟最高分', prop: 'scoreTop', width: 124 },
|
|
|
{ align: 'center', label: '近5分钟最低分', prop: 'scoreLow', width: 124 },
|
|
|
{ align: 'center', label: '近5分钟客主比', prop: 'objSubRate', width: 124 },
|
|
@@ -88,9 +101,9 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
|
|
|
{ align: 'center', label: '在线', prop: 'online', width: 72 },
|
|
|
{ align: 'center', label: '状态', prop: 'markingStatus', width: 100 },
|
|
|
{ align: 'center', label: '速度', prop: 'markingRate', width: 66 },
|
|
|
- { align: 'center', label: '综合系数', prop: 'integration', width: 90 },
|
|
|
+ // { align: 'center', label: '综合系数', prop: 'integration', width: 90 },
|
|
|
].map((col: any) => {
|
|
|
- if (!['小组'].includes(col.label)) col.sortable = true
|
|
|
+ if (!['小组', '重评/待确认'].includes(col.label)) col.sortable = 'custom'
|
|
|
return col
|
|
|
})
|
|
|
|
|
@@ -105,6 +118,67 @@ const data = computed(() => {
|
|
|
})
|
|
|
|
|
|
const { tableRef, tableData, current, onCurrentChange, elTableRef } = useTableCheck(data, false)
|
|
|
+const sortTableData = ref<any[]>([])
|
|
|
+const originalTableData = ref<any[]>([])
|
|
|
+watch(tableData, () => {
|
|
|
+ if (tableData.value) {
|
|
|
+ let data: any[] = tableData.value || []
|
|
|
+ if (data.length && data[data.length - 1].markingGroupNumber === 0) {
|
|
|
+ let last = data.splice(data.length - 1, 1)[0]
|
|
|
+ data.unshift(last)
|
|
|
+ }
|
|
|
+ sortTableData.value = JSON.parse(JSON.stringify(data))
|
|
|
+ originalTableData.value = JSON.parse(JSON.stringify(data))
|
|
|
+ }
|
|
|
+})
|
|
|
+const sortChange = (params: any) => {
|
|
|
+ const { column, prop, order } = params
|
|
|
+ console.log('order:', order)
|
|
|
+ console.log('prop:', prop)
|
|
|
+ if (order === 'ascending') {
|
|
|
+ sortTableData.value.sort((a: any, b: any) => {
|
|
|
+ if (a.markingGroupNumber == 0) {
|
|
|
+ return -1
|
|
|
+ } else if (b.markingGroupNumber == 0) {
|
|
|
+ return 1
|
|
|
+ } else {
|
|
|
+ if (typeof a[prop] === 'string') {
|
|
|
+ let aa = a[prop] || '',
|
|
|
+ bb = b[prop] || ''
|
|
|
+ return aa.localeCompare(bb)
|
|
|
+ } else {
|
|
|
+ return a[prop] - b[prop]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (order === 'descending') {
|
|
|
+ sortTableData.value.sort((a: any, b: any) => {
|
|
|
+ if (a.markingGroupNumber == 0) {
|
|
|
+ return -1
|
|
|
+ } else if (b.markingGroupNumber == 0) {
|
|
|
+ return 1
|
|
|
+ } else {
|
|
|
+ if (typeof a[prop] === 'string') {
|
|
|
+ let aa = a[prop] || '',
|
|
|
+ bb = b[prop] || ''
|
|
|
+ return bb.localeCompare(aa)
|
|
|
+ } else {
|
|
|
+ return b[prop] - a[prop]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (order == null) {
|
|
|
+ sortTableData.value = JSON.parse(JSON.stringify(originalTableData.value))
|
|
|
+ }
|
|
|
+}
|
|
|
+// const sortTableData = computed(() => {
|
|
|
+// let data: any[] = tableData.value || []
|
|
|
+// if (data.length && data[data.length - 1].markingGroupNumber === 0) {
|
|
|
+// let last = data.splice(data.length - 1, 1)[0]
|
|
|
+// data.unshift(last)
|
|
|
+// }
|
|
|
+// return data
|
|
|
+// })
|
|
|
|
|
|
const {
|
|
|
fetch: getStatisticObjectiveByGroup,
|
|
@@ -267,6 +341,18 @@ const groupObjectiveChartsOption = computed<EChartsOption>(() => {
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+.statistics-group {
|
|
|
+ :deep(.el-table) {
|
|
|
+ .fixed-row {
|
|
|
+ display: table-row;
|
|
|
+ position: sticky;
|
|
|
+ position: '-webkit-sticky';
|
|
|
+ top: 0;
|
|
|
+ width: 100%;
|
|
|
+ z-index: 3;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
.chart-box {
|
|
|
height: 293px;
|
|
|
}
|