|
@@ -1,6 +1,15 @@
|
|
|
<template>
|
|
|
<div class="p-small radius-base fill-blank">
|
|
|
- <base-table size="small" :columns="columns" :data="data" :height="useVW(300)" highlight-current-row> </base-table>
|
|
|
+ <base-table
|
|
|
+ ref="tableRef"
|
|
|
+ size="small"
|
|
|
+ :columns="columns"
|
|
|
+ :data="tableData"
|
|
|
+ :height="useVW(300)"
|
|
|
+ highlight-current-row
|
|
|
+ @current-change="onCurrentChange"
|
|
|
+ >
|
|
|
+ </base-table>
|
|
|
</div>
|
|
|
<div class="flex justify-between m-t-base">
|
|
|
<div class="flex-1 p-base radius-base fill-blank m-r-base chart-box">
|
|
@@ -14,15 +23,21 @@
|
|
|
|
|
|
<script setup lang="ts" name="StatisticsGroup">
|
|
|
/** 人员数据统计-按小组 */
|
|
|
+import { watch, computed } from 'vue'
|
|
|
import BaseTable from '@/components/element/BaseTable.vue'
|
|
|
import VueECharts from 'vue-echarts'
|
|
|
import useVW, { usePX } from '@/hooks/useVW'
|
|
|
import useFetch from '@/hooks/useFetch'
|
|
|
+import useTableCheck from '@/hooks/useTableCheck'
|
|
|
|
|
|
-import type { ExtractApiResponse } from 'api-type'
|
|
|
+import type { EChartsOption } from 'echarts'
|
|
|
+import type { ExtractApiResponse, ExtractApiParams } from 'api-type'
|
|
|
import type { EpTableColumn } from 'global-type'
|
|
|
|
|
|
-defineProps<{ data: ExtractApiResponse<'getStatisticsByGroup'> }>()
|
|
|
+const props = defineProps<{
|
|
|
+ data: ExtractApiResponse<'getStatisticsByGroup'>
|
|
|
+ params: ExtractApiParams<'getStatisticsByGroup'> & { expand: boolean }
|
|
|
+}>()
|
|
|
|
|
|
const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatisticsByGroup'>>>[] = [
|
|
|
{
|
|
@@ -62,8 +77,101 @@ const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getStatistics
|
|
|
{ align: 'center', label: '综合系数', prop: 'integration', width: usePX(64) },
|
|
|
]
|
|
|
|
|
|
+const data = computed(() => {
|
|
|
+ return props.data || []
|
|
|
+})
|
|
|
+
|
|
|
+const { tableRef, tableData, current, onCurrentChange } = useTableCheck(data)
|
|
|
+
|
|
|
const { fetch: getStatisticObjectiveByGroup, result: objectiveByGroup } = useFetch('getStatisticObjectiveByGroup')
|
|
|
const { fetch: getStatisticSubjectiveByGroup, result: subjectiveByGroup } = useFetch('getStatisticSubjectiveByGroup')
|
|
|
+
|
|
|
+watch(
|
|
|
+ [() => props.params, current],
|
|
|
+ () => {
|
|
|
+ const { subjectCode, questionMainNumber, startTime = '', endTime = '' } = props.params || {}
|
|
|
+ if (subjectCode && questionMainNumber && current.value?.markingGroupNumber) {
|
|
|
+ getStatisticObjectiveByGroup({
|
|
|
+ subjectCode,
|
|
|
+ questionMainNumber,
|
|
|
+ markingGroupNumber: current.value.markingGroupNumber,
|
|
|
+ startTime,
|
|
|
+ endTime,
|
|
|
+ })
|
|
|
+ getStatisticSubjectiveByGroup({
|
|
|
+ subjectCode,
|
|
|
+ questionMainNumber,
|
|
|
+ markingGroupNumber: current.value.markingGroupNumber,
|
|
|
+ startTime,
|
|
|
+ endTime,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { immediate: true, deep: true }
|
|
|
+)
|
|
|
+
|
|
|
+// const groupChartsOption = computed<EChartsOption>(() => {
|
|
|
+// return {
|
|
|
+// legend: {
|
|
|
+// right: 0,
|
|
|
+// itemWidth: 14,
|
|
|
+// data: ['完成总量', '当日已完成', '完成比'],
|
|
|
+// },
|
|
|
+// xAxis: {
|
|
|
+// axisLine: { show: false },
|
|
|
+// axisTick: { show: false },
|
|
|
+// splitLine: { show: false },
|
|
|
+// axisLabel: {
|
|
|
+// align: 'right',
|
|
|
+// },
|
|
|
+// data: getXAxisData('markingGroupNumber', groupProgressResult?.value),
|
|
|
+// },
|
|
|
+// yAxis: [
|
|
|
+// {
|
|
|
+// type: 'value',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// type: 'value',
|
|
|
+// axisLabel: {
|
|
|
+// formatter: `{value}%`,
|
|
|
+// },
|
|
|
+// splitLine: { show: false },
|
|
|
+// },
|
|
|
+// ],
|
|
|
+// series: [
|
|
|
+// {
|
|
|
+// name: '完成总量',
|
|
|
+// type: 'bar',
|
|
|
+// barWidth: 20,
|
|
|
+// itemStyle: {
|
|
|
+// color: '#3AD500',
|
|
|
+// },
|
|
|
+// data: getXAxisData('finishCount', groupProgressResult?.value),
|
|
|
+// },
|
|
|
+// {
|
|
|
+// name: '当日已完成',
|
|
|
+// type: 'bar',
|
|
|
+// barWidth: 20,
|
|
|
+// itemStyle: {
|
|
|
+// color: '#0064FF',
|
|
|
+// },
|
|
|
+// data: getXAxisData('dayFinishCount', groupProgressResult?.value),
|
|
|
+// },
|
|
|
+// {
|
|
|
+// name: '完成比',
|
|
|
+// type: 'bar',
|
|
|
+// barWidth: 80,
|
|
|
+// showBackground: true,
|
|
|
+// barGap: '-200%',
|
|
|
+// yAxisIndex: 1,
|
|
|
+// itemStyle: {
|
|
|
+// color: 'rgba(0, 186, 151,0.3)',
|
|
|
+// },
|
|
|
+// data: getXAxisData('finishRate', groupProgressResult?.value),
|
|
|
+// },
|
|
|
+// ],
|
|
|
+// }
|
|
|
+// })
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|