龚焕茏
2024-05-15 9e0295ecdc7398f7997c1f0fab9274b42630bc87
refactor:统计调整
2个文件已修改
51 ■■■■■ 已修改文件
src/views/answer/sheetStatistics.vue 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/user/departmentExamine/list.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/answer/sheetStatistics.vue
@@ -7,7 +7,7 @@
        </el-select>
      </el-form-item>
      <el-form-item label="部门:" v-if="true">
        <el-select v-model="queryParam.departmentId" placeholder="部门" clearable>
        <el-select v-model="queryParam.departmentId" filterable placeholder="部门" clearable>
          <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value" />
        </el-select>
      </el-form-item>
@@ -46,7 +46,7 @@
  </div>
</template>
<script>
import { mapGetters, mapState, mapActions } from 'vuex';
import { mapGetters, mapState } from 'vuex';
import dashboardApi from '@/api/dashboard';
const colorList = ['#3498DB', '#E74C3C', '#F1C40F', '#95A5A6', '#8E44AD', '#F39C12', '#D35400'];
@@ -61,12 +61,14 @@
};
const scoreLabel = {
  'score0To59': '小于60分',
  'score60To79': '60-79分',
  'score80To100': '80-100分'
  'score60To69': '60-69分',
  'score70To79': '70-79分',
  'score80To89': '80-89分',
  'score90To100': '90-100分'
};
const pieLabel = {
  'totalAbsent': '参与考试',
  'totalAttended': '未参与考试'
  'totalAttended': '参与考试',
  'totalAbsent': '未参与考试'
};
let ageChart = null;
let scroeChart = null;
@@ -76,39 +78,25 @@
  data() {
    return {
      examPaperList: [],
      max: '',
      min: '',
      avg: '',
      chartLoading1: false,
      chartLoading2: false,
      chartLoading3: false,
      loading: false,
      examPaperCount: 0,
      questionCount: 0,
      doExamPaperCount: 0,
      doQuestionCount: 0,
      echartsUserAction: null,
      queryParam: {
        examPaperId: '85',
        departmentId: '',
        subjectId: null,
        pageIndex: 1,
        pageSize: 10
      },
      listLoading: false
        examPaperId: '',
        departmentId: ''
      }
    };
  },
  created() {
    dashboardApi.examPaperList().then(res => {
      this.examPaperList = res.response;
    });
  },
  mounted() {
    ageChart = echarts.init(this.$refs.ageChart);
    scroeChart = echarts.init(this.$refs.scoreChart);
    peopleChart = echarts.init(this.$refs.peopleChart);
    dashboardApi.examPaperList().then(res => {
      this.examPaperList = res.response;
      this.queryParam.examPaperId = this.examPaperList[0].id
    this.getChartData();
    this.observe();
    });
  },
  methods: {
    getChartData() {
@@ -119,8 +107,8 @@
        const { age, score, examPeopleNum } = re.response;
        const ageOption = this.barOption('年龄段统计', age, ageLabel);
        const scoreOption = this.barOption('考试成绩统计', score, scoreLabel);
        const peopleOption = this.pieOption('考试情况', examPeopleNum, pieLabel);
        const scoreOption = this.barOption('分数段统计', score, scoreLabel);
        const peopleOption = this.pieOption('考试人数', examPeopleNum, pieLabel);
        ageChart.setOption(ageOption, true);
        scroeChart.setOption(scoreOption, true);
@@ -184,7 +172,7 @@
          text: title,
          x: 'left'
        },
        color: colorList,
        color: ['#E74C3C', '#3498DB',  '#F1C40F', '#95A5A6', '#8E44AD', '#F39C12', '#D35400'],
        tooltip: {
          trigger: 'item'
        },
@@ -210,7 +198,6 @@
    },
    submitForm() {
      this.queryParam.pageIndex = 1;
      this.getChartData();
    },
src/views/user/departmentExamine/list.vue
@@ -17,7 +17,7 @@
      <el-table-column prop="nowDepartmentName" label="原部门名称" />
      <el-table-column prop="result" label="审核结果">
        <template slot-scope="{row}">
          <el-tag :type="row.result === '审核通过' ? 'success' : row.result === '审核失败' ? 'danger' : 'info'">{{row.result}}</el-tag>
          <el-tag :type="row.result === '审核通过' ? 'success' : row.result === '审核驳回' ? 'danger' : 'info'">{{row.result}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="createUserName" label="创建人" />