index.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div class="flex direction-column full group-monitoring-view">
  3. <div class="p-l-base p-r-base p-t-medium-base fill-blank">
  4. <base-form size="small" :label-width="useVW(60)" :disabled="loading" :model="model" :items="items">
  5. <template #form-item-button-group>
  6. <el-button :loading="loading" type="primary" @click="onSearch">刷新</el-button>
  7. </template>
  8. </base-form>
  9. </div>
  10. <div class="flex-1 p-base">
  11. <div class="radius-base p-l-base p-r-base p-t-mini fill-blank">
  12. <base-table size="small" :columns="columns" :data="result"></base-table>
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script setup lang="tsx" name="GroupMonitoring">
  18. /** 小组监控 */
  19. import { useRouter } from 'vue-router'
  20. import { ElButton } from 'element-plus'
  21. import BaseForm from '@/components/element/BaseForm.vue'
  22. import BaseTable from '@/components/element/BaseTable.vue'
  23. import useFetch from '@/hooks/useFetch'
  24. import useVW from '@/hooks/useVW'
  25. import useFormFilter from './hooks/useFormFilter'
  26. import type { EpTableColumn } from 'global-type'
  27. import type { ExtractApiResponse } from '@/api/api'
  28. const { push } = useRouter()
  29. const { model, formModel, items, onOptionInit } = useFormFilter()
  30. const { loading, fetch: getGroupMonitor, result } = useFetch('getGroupMonitor')
  31. const columns: EpTableColumn<ExtractArrayValue<ExtractApiResponse<'getGroupMonitor'>>>[] = [
  32. { label: '组长', prop: 'markingGroupLeader' },
  33. { label: '已浏览系统抽查卷数', prop: 'sysCheckCount' },
  34. { label: '已给分系统抽查卷数', prop: 'sysCheckReScoreCount' },
  35. { label: '已浏览问题卷数', prop: 'problemCount' },
  36. { label: '已给分问题卷数', prop: 'problemReScoreCount' },
  37. { label: '已浏览自定义抽查卷数', prop: 'customCheckCount' },
  38. { label: '已给分自定义抽查卷数', prop: 'customCheckReScoreCount' },
  39. {
  40. label: '已浏览试卷总数',
  41. prop: 'totalCount',
  42. formatter(row) {
  43. return (
  44. <ElButton type="primary" link onClick={() => viewMonitoringDetail(row, 'VIEW')}>
  45. {row.totalCount}
  46. </ElButton>
  47. )
  48. },
  49. },
  50. {
  51. label: '已给分试卷总数',
  52. prop: 'totalReScoreCount',
  53. formatter(row) {
  54. return (
  55. <ElButton type="primary" link onClick={() => viewMonitoringDetail(row, 'MARK')}>
  56. {row.totalReScoreCount}
  57. </ElButton>
  58. )
  59. },
  60. },
  61. ]
  62. /** 刷新按钮 */
  63. function onSearch() {
  64. getGroupMonitor(formModel.value)
  65. }
  66. /** 查看抽查详情 */
  67. function viewMonitoringDetail(
  68. row: ExtractArrayValue<ExtractApiResponse<'getGroupMonitor'>>,
  69. operateType: 'VIEW' | 'MARK'
  70. ) {
  71. push({
  72. name: 'AnalysisGroupDetail',
  73. query: {
  74. operateType,
  75. headerId: row.markingGroupLeaderId,
  76. },
  77. })
  78. }
  79. onOptionInit(onSearch)
  80. </script>
  81. <style scoped lang="scss"></style>