ZhangXianQiang
2024-04-26 6c400ee3d20b3d8dfce64647b238d758523ab631
Merge branch 'dev-threejs'
1个文件已修改
74 ■■■■ 已修改文件
src/views/system/result/detail/index1.vue 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/result/detail/index1.vue
@@ -63,8 +63,9 @@
    </div>
    <div style="text-align: right; margin-top: 10px">
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage4"
        :page-sizes="[5, 10, 20]" :page-size="5" layout="total, sizes, prev, pager, next, jumper" :total="4">
      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
        :current-page="queryParams.pageNum" :page-sizes="[5, 10, 20]" :page-size="5"
        layout="total, sizes, prev, pager, next, jumper" :total="4">
      </el-pagination>
    </div>
@@ -88,33 +89,13 @@
      areaList: [],
      date: '',
      dateRange: '',
      company: '',
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deptId: null,
      },
      dataList: [
        {
          name: '全部',
          complete: {
            '4.5': 95.5, '4.6': 95.3, '4.7': 96.0, '4.8': 97.2, '4.9': 96.5,
            '4.10': 95.5, '4.11': 95.3, '4.12': 96.0, '4.13': 97.2, '4.14': 96.5,
            '4.15': 95.5, '4.16': 95.3, '4.17': 96.0, '4.18': 97.2, '4.19': 96.5,
            '4.20': 95.5, '4.21': 95.3, '4.22': 96.0, '4.23': 97.2, '4.24': 96.5,
            '4.25': 95.5, '4.26': 95.3, '4.27': 96.0, '4.28': 97.2, '4.29': 96.5
          },
          waiting: {
            '4.5': 94.8, '4.6': 91.3, '4.7': 95.3, '4.8': 92.3, '4.9': 93.3,
            '4.10': 94.8, '4.11': 91.3, '4.12': 95.3, '4.13': 92.3, '4.14': 93.3
          },
          pending: {
            '4.5': 91.6, '4.6': 92.6, '4.7': 93.7, '4.8': 94.0, '4.9': 95.9
            , '4.10': 91.6, '4.11': 92.6, '4.12': 93.7, '4.13': 94.0, '4.14': 95.9
          }
        }
      ],
      tableData: [],
      loading: false,
      searchForm: {
        time: null,
      }
@@ -130,13 +111,11 @@
    const year = date.getFullYear();
    const month = (date.getMonth() + 1) >= 10 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1);
    this.date = year + '-' + month;
    console.log(this.date);
    this.queryParams.date = this.date;
    this.getList(this.$route.query.index);
    this.areaSelect();
  },
  computed: {
    ...mapState('dict', ['dict'])
  },
  methods: {
    // 区域下拉数据
@@ -157,10 +136,10 @@
    /** 查询考核模板列表 */
    getList(deptId) {
      this.loading = true;
      lineChart.showLoading();
      listScore(this.queryParams).then(response => {
        this.tableData = response.data[deptId];
        this.loading = false;
        this.initChart(response.data[deptId]);
      });
    },
@@ -204,7 +183,7 @@
        series: [
          {
            name: '车辆考核',
            data: this.filterData(dataList,0),
            data: this.filterData(dataList, 0),
            type: 'line',
            itemStyle: {
              color: 'rgba(62, 144, 247, 1)'
@@ -212,7 +191,7 @@
          },
          {
            name: '人脸考核',
            data: this.filterData(dataList,1),
            data: this.filterData(dataList, 1),
            type: 'line',
            itemStyle: {
              color: 'rgba(85, 192, 191, 1)'
@@ -220,7 +199,7 @@
          },
          {
            name: '视频考核',
            data: this.filterData(dataList,2),
            data: this.filterData(dataList, 2),
            type: 'line',
            itemStyle: {
              color: 'rgba(255, 165, 0, 1)'
@@ -229,30 +208,47 @@
        ]
      };
      lineChart.setOption(option, true);
      lineChart.hideLoading();
    },
    groupByData(data) {
      if(!data) return [];
      if (!data) return this.getAllDay().map((item) => [item, []]);
      const tempGroup = {};
      data.forEach((item) => {
        const { createTime } = item;
        let { createTime } = item;
        let tempTime = createTime.split('-');
        createTime = tempTime[1] + '-' + tempTime[2];
        if (!tempGroup[createTime]) {
          tempGroup[createTime] = [];
        }
        tempGroup[createTime].push(item);
      })
      const tempArray = Object.entries(tempGroup).sort(([keyA], [keyB]) => new Date([keyA]) - new Date([keyB]));
      return tempArray;
    },
    filterData(data,tag) {
      if(!data) return [0];
    filterData(data, tag) {
      const scoreList = data.map((item) => {
        let temp = item[1].find((exam) => exam.examineCategory === tag);
        return temp.score;
        if (temp) {
          return temp.score;
        } else {
          return;
        }
      });
      console.log(scoreList);
      return scoreList;
    },
    getAllDay() {
      const currentDate = this.date.split('-');
      const currentYear = currentDate[0];
      const currentMonth = currentDate[1];
      const daysInMonth = new Date(currentYear, currentMonth, 0).getDate();
      const datesOfMonth = [];
      for (var day = 1; day <= daysInMonth; day++) {
        const formattedDate = currentMonth + '-' + (day.toString().padStart(2, '0'));
        datesOfMonth.push(formattedDate);
      }
      return datesOfMonth;
    },
    // 监听变化
@@ -279,10 +275,8 @@
  },
  mounted() {
    this.acitveData = this.dataList[0];
    this.company = this.acitveData.name;
    lineChart = echarts.init(this.$refs.chartContent);
    this.initChart();
    this.getList(this.$route.query.index);
    this.observe();
  },
  beforeDestroy() {