WXL (wul)
19 小时以前 61f0c5d3a9308d1eaefd8890a46b3c569707e050
src/views/Satisfaction/sfstatistics/components/SatisfactionStatistics.vue
@@ -414,7 +414,7 @@
                  </template>
                </el-table-column>
                <el-table-column
                <!-- <el-table-column
                  label="趋势"
                  prop="trend"
                  align="center"
@@ -446,7 +446,7 @@
                      }}</span>
                    </div>
                  </template>
                </el-table-column>
                </el-table-column> -->
                <el-table-column
                  label="操作"
@@ -790,11 +790,11 @@
      Object.entries(apiData.rows).forEach(([typeName, typeStat]) => {
        const sendCount = typeStat.subidAll || 0;
        const receiveCount = typeStat.fillCountAll || 0;
        const recoveryRate = typeStat.receiveRate || 0;
        const recoveryRate = typeStat.receiveRate.toFixed(2) || 0;
        chartData.push({
          name: typeName,
          value: recoveryRate * 100, // 转换为百分比
          value: (recoveryRate * 100).toFixed(2), // 转换为百分比
          sendCount: sendCount,
          receiveCount: receiveCount,
          averageScore: typeStat.averageScore || 0,
@@ -914,7 +914,9 @@
        const response = await satisfactionGraph(params);
        if (response.code === 200) {
          this.processTypeDetailData(response.data);
          this.processTypeDetailData(response);
          console.log(11);
        } else {
          this.$message.error(response.msg || "获取类型明细数据失败");
          const mockData = await this.generateMockTypeDetail();
@@ -944,7 +946,7 @@
      Object.entries(apiData.rows).forEach(([typeName, typeStat], index) => {
        const sendCount = typeStat.subidAll || 0;
        const receiveCount = typeStat.fillCountAll || 0;
        const recoveryRate = typeStat.receiveRate || 0;
        const recoveryRate = typeStat.receiveRate.toFixed(2) || 0;
        const averageScore = typeStat.averageScore || 0;
        typeDetail.push({
@@ -963,6 +965,8 @@
      });
      this.typeDetailData = typeDetail;
      console.log(this.typeDetailData,'this.typeDetailData');
      this.calculateTypeSummary(typeDetail);
    },
@@ -972,7 +976,7 @@
      if (score >= 4.0) return "良好";
      if (score >= 3.0) return "一般";
      if (score >= 2.0) return "较差";
      return "差";
      return "未知";
    },
    // 获取趋势
@@ -1041,24 +1045,24 @@
    // 渲染图表
    renderChart(chartData) {
      if (!this.barChart) return;
 if (!chartData || chartData.length === 0) {
    const emptyOption = {
      title: {
        text: "暂无数据",
        left: "center",
        top: "center",
        textStyle: {
          color: "#999",
          fontSize: 16,
          fontWeight: "normal"
        }
      },
      xAxis: { show: false },
      yAxis: { show: false }
    };
    this.barChart.setOption(emptyOption);
    return;
  }
      if (!chartData || chartData.length === 0) {
        const emptyOption = {
          title: {
            text: "暂无数据",
            left: "center",
            top: "center",
            textStyle: {
              color: "#999",
              fontSize: 16,
              fontWeight: "normal",
            },
          },
          xAxis: { show: false },
          yAxis: { show: false },
        };
        this.barChart.setOption(emptyOption);
        return;
      }
      const option = {
        title: {
          text: "",
@@ -1079,7 +1083,7 @@
                <span style="display:inline-block;width:10px;height:10px;border-radius:2px;background:${
                  data.color
                };margin-right:5px;"></span>
                填报比例: <strong>${data.value.toFixed(1)}%</strong>
                填报比例: <strong>${data.value}%</strong>
              </div>
              <div style="margin: 2px 0;">
                <span style="display:inline-block;width:10px;height:10px;border-radius:2px;background:#eee;margin-right:5px;"></span>
@@ -1437,12 +1441,12 @@
    // 格式化百分比
    formatPercent(value) {
   if (value === null || value === undefined) return "-";
  const num = parseFloat(value);
  if (isNaN(num)) return "-";
  // 如果值小于1,认为是小数比例,需要乘以100
  const percentValue = num < 1 ? num * 100 : num;
  return `${percentValue.toFixed(2)}%`;
      if (value === null || value === undefined) return "-";
      const num = parseFloat(value);
      if (isNaN(num)) return "-";
      // 如果值小于1,认为是小数比例,需要乘以100
      const percentValue = num < 1 ? num * 100 : num;
      return `${percentValue.toFixed(2)}%`;
    },
    // 获取回收率样式类
@@ -1459,7 +1463,7 @@
        良好: "primary",
        一般: "warning",
        较差: "danger",
        差: "info",
        未知: "info",
      };
      return levelMap[level] || "info";
    },