fix
pyt
4 小时以前 aed913cfb01791b25a6fb1bda3df1f2088915990
fix
1个文件已修改
79 ■■■■ 已修改文件
management/src/pages/statistics/index.jsx 79 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
management/src/pages/statistics/index.jsx
@@ -146,35 +146,15 @@
  const typeRankOption = {
    tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
    grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
    dataZoom: [
      {
        type: 'slider',
        show: true,
        startValue: 0,
        endValue: 4,
        bottom: 0,
        showDetail: false,
        showDataShadow: false,
        height: '100%',
        width: 10,
        fillerColor: '#dbdee5',
        borderColor: 'transparent',
        zoomLock: true,
        orient: 'vertical',
        brushSelect: false,
        handleStyle: {
          opacity: 0
    xAxis: {
      type: 'value',
      boundaryGap: [0, 0.01],
      axisLabel: {
        formatter: function(value) {
          return value + '单';
        }
      },
      {
        type: "inside",
        zoomOnMouseWheel: false,
        moveOnMouseMove: true,
        moveOnMouseWheel: true,
        orient: 'vertical'
      },
    ],
    xAxis: { type: 'value', boundaryGap: [0, 0.01] },
      }
    },
    yAxis: { type: 'category', data: allTypeData.map(item => item.name) },
    series: [
      {
@@ -191,17 +171,25 @@
  // 问题评价占比图表配置
  const pieOption = {
    tooltip: { trigger: 'item', formatter: '{b}: {c} ({d}%)' },
    legend: { orient: 'vertical', left: 'right', data: pieData.map(i => i.name) },
    color: ['#4a90e2', '#6dd400', '#f5a623', '#f44336'],
    legend: { show: false },
    color: ['rgb(80,135,236)', 'rgb(104,187,196)', 'rgb(88,165,92)', 'rgb(242,189,66)'],
    series: [
      {
        name: '评价占比',
        type: 'pie',
        radius: ['50%', '70%'],
        radius: ['40%', '70%'],
        center: ['50%', '50%'],
        avoidLabelOverlap: false,
        label: { show: false, position: 'center' },
        label: {
          show: true,
          formatter: '{b} {d}%'
        },
        labelLine: {
          show: true,
          length: 20,
          length2: 30,
        },
        emphasis: { label: { show: true, fontSize: 18, fontWeight: 'bold' } },
        labelLine: { show: false },
        data: pieData,
      },
    ],
@@ -254,10 +242,10 @@
      })));
      const fourVo = res.data.analyticStatisticsFourVo || {};
      setPieData([
        { value: fourVo.greatSatisfactionRate, name: '非常满意' },
        { value: fourVo.satisfactionRate, name: '满意' },
        { value: fourVo.generalSatisfactionRate, name: '一般' },
        { value: fourVo.dissatisfactionRate, name: '不满意' },
        { value: fourVo.greatSatisfactionNum, name: '非常满意', percent: fourVo.greatSatisfactionRate },
        { value: fourVo.satisfactionRateNum, name: '满意', percent: fourVo.satisfactionRate },
        { value: fourVo.generalSatisfactionNum, name: '一般', percent: fourVo.generalSatisfactionRate },
        { value: fourVo.dissatisfactionNum, name: '不满意', percent: fourVo.dissatisfactionRate },
      ]);
    } catch (e) {
      // 错误处理
@@ -322,7 +310,7 @@
          options={communityOptions} 
          placeholder="请选择社区" 
          fieldNames={{ label: 'name', value: 'communityId' }}
          disabled={!form.getFieldValue('streetId')}
          disabled={adminLevel <= 1 && !form.getFieldValue('districtId')}
        />,
      },
    ];
@@ -337,7 +325,7 @@
          placeholder="请选择街道" 
          fieldNames={{ label: 'name', value: 'streetId' }}
          onChange={handleStreetChange}
          disabled={!form.getFieldValue('districtId')}
          disabled={adminLevel <= 2 && !form.getFieldValue('districtId')}
        />,
      });
    }
@@ -548,7 +536,18 @@
          <div style={{ fontWeight: 600, fontSize: 16, marginBottom: 16, borderLeft: '4px solid #3b7cff', paddingLeft: 8 }}>
            问题评价占比
          </div>
          <ReactECharts option={pieOption} style={{ height: 300 }} />
          <div style={{ width: '100%', display: 'flex', justifyContent: 'center' }}>
            <div style={{ display: 'flex', alignItems: 'center' }}>
              <ReactECharts option={pieOption} style={{ height: 300, width: 520 }} />
              <div style={{ marginLeft: 48 }}>
                {pieData.map((item, idx) => (
                  <div key={item.name} style={{ color: pieOption.color[idx], fontSize: 16, marginBottom: 12 }}>
                    {item.name}:{item.value}({item.percent}%)
                  </div>
                ))}
              </div>
            </div>
          </div>
        </div>
      </PageContainer>
    </div>