jiangping
2025-04-21 561a8559ba10c7af2a6100d5a2700af7a72a3eba
代码初始化
已修改3个文件
102 ■■■■ 文件已修改
admin/src/views/index.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/index.vue
@@ -71,6 +71,17 @@
        <div class="static_wrap">
          <div class="df mb50" >
            <div class="wrap static1">
              <div class="header" style="text-align: center">
                <div class="home_title"  style="text-align: center;width: 100%">各类型工单占比统计</div>
              </div>
              <div class="echart"  style="height: 400px" >
                <div  id="circleChart0"></div>
                <div  id="circleChart1"></div>
              </div>
            </div>
          </div>
          <div class="df mb50" >
            <div class="wrap static1">
              <div class="header">
                <div class="home_title">1.SHE事件上报</div>
              </div>
@@ -202,6 +213,17 @@
    getWorkHead () {
      getIndexData({ }).then(res => {
        this.headerData = res || {}
        var cdata = []
        cdata.push({ name: '跌绊滑事件', value: res.dbhNum || 0 })
        cdata.push({ name: 'DCA事件', value: res.dcaNum || 0 })
        cdata.push({ name: 'SHE事件', value: res.sheNum || 0 })
        this.initEchartCircleDo('circleChart0', '各类型事件工单上报统计', '', cdata)
        var xdata =['SHE事件', '跌绊滑事件','DCA事件']
        var ydata = []
        ydata.push({ name: '已解决', stack: 'cateNum', type: 'bar', unit: '项', color: '#f07e6f', data: [0,res.dbhYesNum || 0,res.dcaYesNum || 0]})
        ydata.push({ name: '未解决', stack: 'cateNum',type: 'bar', unit: '项', color: '#8383ff', data: [res.sheNum || 0,res.dbhNoNum || 0,res.dcaNoNum || 0]})
        ydata.push({ name: '总单量', type: 'bar', unit: '次', color: '#29aeff', data: [res.sheNum || 0,res.dbhNum || 0,res.dcaNum || 0] })
        this.initEchartDataDo('各类型事件状态统计', 'circleChart1', xdata, ydata)
      })
    },
    updateDate () {
@@ -245,7 +267,7 @@
      ydata.push({ name: 'WTS关闭单量', type: 'bar', unit: '单', color: '#29aeff', data: this.staticData21.map(i => i.wtsTotal) })
      ydata.push({ name: 'SHE关闭单量', type: 'bar', unit: '单', color: '#e75314', data: this.staticData21.map(i => i.sheTotal) })
      ydata.push({ name: '未解决单量', type: 'bar', unit: '单', color: '#8383ff', data: this.staticData21.map(i => i.unCloseTotal) })
      ydata.push({ name: '工单总量', type: 'bar', unit: '单', color: '#30d3de', data: this.staticData21.map(i => i.total) })
      ydata.push({ name: '工单总量', type: 'line', unit: '单', color: '#30d3de', data: this.staticData21.map(i => i.total) })
      this.initEchartDataDo('季度统计','echart21', this.staticData21.map(i => i.dateStr), ydata)
    },
    initEchart3 () {
@@ -263,7 +285,7 @@
      ydata.push({ name: 'WTS关闭单量', type: 'bar', unit: '单', color: 'rgba(217,4,34,0.83)', data: this.staticData31.map(i => i.wtsTotal) })
      ydata.push({ name: 'SHE关闭单量', type: 'bar', unit: '单', color: '#e75314', data: this.staticData31.map(i => i.sheTotal) })
      ydata.push({ name: '未解决单量', type: 'bar', unit: '单', color: '#8383ff', data: this.staticData31.map(i => i.unCloseTotal) })
      ydata.push({ name: '工单总量', type: 'bar', unit: '单', color: '#30d3de', data: this.staticData31.map(i => i.total) })
      ydata.push({ name: '工单总量', type: 'line', unit: '单', color: '#30d3de', data: this.staticData31.map(i => i.total) })
      this.initEchartDataDo('季度统计','echart31', this.staticData31.map(i => i.dateStr), ydata)
    },
    initEchartDataDo (title,id, xdata, ydata) {
@@ -275,7 +297,7 @@
            fontSize: 12,
            fontStyle: 'normal',
            fontWeight: 'bold'
          },
          }
        },
        tooltip: {
          trigger: 'axis',
@@ -286,7 +308,7 @@
            fontSize: 10,
            fontStyle: 'normal',
            fontWeight: 'normal'
          },
          }
        },
        legend:{
          orient: 'vertical',
@@ -295,7 +317,7 @@
            fontSize: 10,
            fontStyle: 'normal',
            fontWeight: 'normal'
          },
          }
        },
        xAxis: {
          type: 'category',
@@ -305,6 +327,12 @@
        yAxis: {
          type: 'value',
          name: '',
          min: 0,
          axisLabel: {
            formatter: function (value) {
              return Number.isInteger(value) ? value : ''
            }
          },
          textStyle:{
            fontSize: 10,
            fontStyle: 'normal',
@@ -340,6 +368,7 @@
        array.push({
          data: ydata[i].data,
          name: ydata[i].name,
          stack: ydata[i].stack || '',
          type: ydata[i].type || 'line',
          areaStyle: {
            normal: {
@@ -386,6 +415,62 @@
      }
      return array
    },
    initEchartCircleDo (id, title, subTitle, data) {
      var option = {
        title: {
          text:  '',
          subtext:   '',
          left: 'center',
          bottom: 'bottom',
          textStyle: {
            fontSize: 10,
            fontStyle: 'normal',
            fontWeight: 'bold'
          }
        },
        tooltip: {
          trigger: 'item'
        },
        legend: {
          orient: 'vertical',
          left: 'left',
          textStyle: {
            fontSize: 10,
            fontStyle: 'normal',
            fontWeight: 'normal'
          },
        },
        series: [
          {
            name: title || '',
            type: 'pie',
            radius: '50%',
            data: data,
            label: {
              show: true,
              formatter: '{b}:{d}%',
              textStyle: {
                fontSize: 10,
                fontStyle: 'normal',
                fontWeight: 'normal'
              },
            },
            labelLine: {
              show: true,
            },
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      }
      const myChart = echarts.init(document.getElementById(id))
      myChart.setOption(option)
    }
  }
}
server/src/main/java/com/doumee/service/business/impl/WorkorderServiceImpl.java
@@ -1330,7 +1330,6 @@
    @Override
    public WorkorderIndexNumVO getIndexData(Workorder workorder) {
        WorkorderIndexNumVO model = new WorkorderIndexNumVO();
        List<WorkOrderDataVO> workOrderDataVOList = new ArrayList<>();
        //查询今年所有的数据
        List<Workorder> list = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>()
                        .select("type,count(id) as num")
@@ -1406,9 +1405,5 @@
        }
        return model;
    }
}
server/src/main/resources/application.yml
@@ -9,7 +9,7 @@
spring:
  profiles:
    active: test
    active: dev
  # JSON返回配置
  jackson:
    # 默认时区