ll
liukangdong
2024-10-28 19f0eca493f7e17ab7b67d28cf77d80de364576c
screen/src/views/LogisticsEfficiency.vue
@@ -131,7 +131,9 @@
              </div>
            </div>
          </div>
          <div class="center_box_two"></div>
          <div class="center_box_two">
            <div ref="echartMap" class="echart_map" id="echartMap"></div>
          </div>
        </div>
        <div class="right_box">
          <div class="right_box_one">
@@ -244,8 +246,9 @@
import VScaleScreen from 'v-scale-screen'
import Percent from '@/components/percent.vue'
import dayjs from 'dayjs'
import * as echarts from 'echarts'
import ahJSON from '@/assets/anhui.json'
const colors = ['#FEAF01', '#01ABFE', '#51F9E4']
const weekMap = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六',]
const date = ref(dayjs().format('YYYY.MM.DD'))
@@ -262,59 +265,161 @@
const initEnergy = () => {
  var myChart = echarts.init(document.querySelector('.energyRef'))
  // 绘制图表
  const arr = ['#68e2e3', '#50afd3', '#377cdb', '#d5ae3a']
  myChart.setOption({
    legend: {
      itemGap: 12,
      // icon: 'circle',
      right: '12px',
      top: '0',
      data: ['总库存', '当前库存', '库存利用率'],
      itemWidth: 20,
      itemHeight: 10,
      textStyle: {
        color: '#fff',
        borderColor: '#fff'
      },
    },
    grid: {
      top: '20%',
      left: '2%',
      right: '2%',
      bottom: '4%',
      left: '3%',
      right: '4%',
      bottom: '3%',
      top: '16%',
      containLabel: true
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'line'
      },
      trigger: 'axis'
    },
    xAxis: {
    xAxis: [{
      nameGap: 5,
      type: 'category',
      data: [1, 2, 3, 4, 4, 5]
    },
    yAxis: {
      type: 'value',
      name: 'kw·h',
      nameTextStyle: {
        padding: [0, 0, 4, -30]    // 四个数字分别为上右下左与原位置距离
      },
      splitLine: {
      axisLine: {
        show: true,
        lineStyle: {
          //这里输入线条的样式
          color: 'rgba(255,255,255,0.14)',
        }
          color: '#999'
        },
      },
      axisLabel: {
        color: '#869CC9'
        // fontSize: 24,
      },
      axisTick: {
        show: false,
      },
      data: ['7.1', '7.1', '7.1', '7.1', '7.1'],
    }],
    yAxis: [
      {
        nameTextStyle: {
          color: '#869CC9',
        },
        offset: 0,
        name: '万支',
        type: 'value',
        axisLabel: {
          show: true,
          color: "#869CC9",
        },
        axisLine: {
          show: true,
        },
        splitLine: {
          show: true,
          lineStyle: {
            width: 1,
            color: "rgba(49,105,129,0.4)",
            type: 'dashed'
          }
        },
      },
      {
        type: 'value',
        name: '%',
        min: 0,
        max: 100,
        // interval: 5,
        axisLabel: {
          formatter: '{value}%'
        },
        splitLine: false
      }
    },
    ],
    series: [
      {
        data: [1, 2, 3, 4, 5],
        name: '计划完成数量',
        type: 'bar',
        barWidth: 10,
        barGap: '60%',
        label: {
          show: false,
          position: 'top',
          color: '#fff',
        },
        itemStyle: {
          normal: {
            color: new echarts.graphic.LinearGradient(
              0, 0, 0, 1,
              [
                { offset: 0, color: arr[1] },
                { offset: 1, color: '#080807' }
              ]
            ),
            barBorderRadius: [10, 10, 0, 0]
          }
        }
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: '#5bc7d5'
            },
            {
              offset: 1,
              color: '#1a3f55'
            }
          ], false),
          lineStyle: {
            width: 1,
            type: 'solid'
          },
          barBorderRadius: [3, 3, 0, 0],
        },
        data: [900, 438, 485, 631, 689]
      },
      {
        name: '任务完成量',
        type: 'bar',
        barWidth: 10,
        label: {
          show: false,
          position: 'top',
          color: '#fff',
        },
        itemStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
              offset: 0,
              color: '#edaf3d'
            },
            {
              offset: 1,
              color: '#323522'
            }
          ], false),
          lineStyle: {
            width: 1,
            type: 'solid'
          },
          barBorderRadius: [3, 3, 0, 0],
        },
        data: [438, 485, 631, 689, 900]
      },
      {
        name: '计划任务数',
        type: 'line',
        smooth: false,
        showAllSymbol: true,
        symbol: 'none',
        lineStyle: {
          color: "#1a43bc"
        },
        label: {
          show: false,
          position: 'top',
          color: '#fff',
        },
        data: [485, 631, 389, 224, 287]
      }
    ]
  })
  window.addEventListener('resize', function () {//执行
    myChart.resize()
  })
@@ -352,9 +457,179 @@
  })
}
const echartMap = ref()
const initMap = () => {
  var myChart = echarts.init(echartMap.value)
  echarts.registerMap('js', ahJSON)
  var center = {
    '合肥市': [117.25, 31.83],
    '滁州市': [118.32, 32.3],
    '芜湖市': [118.43, 31.35],
    '阜阳市': [115.38, 32.89],
    '蚌埠市': [117.39, 32.92],
    '淮南市': [116.99, 32.63],
    '马鞍山市': [118.5, 31.71],
    '安庆市': [117.05, 30.52],
    '黄山市': [118.33, 29.71],
    '铜陵市': [117.81, 30.94],
    '宿州市': [116.98, 33.64],
    '淮北市': [116.8, 33.9],
    '六安市': [116.51, 31.75],
    '池州市': [117.49, 30.66],
    '宣城市': [118.76, 30.94],
    '亳州市': [115.78, 33.84],
  }
  var data = [
    { name: "合肥市", value: 3 },
    { name: "滁州市", value: 0 },
    { name: "芜湖市", value: 1 },
    { name: "阜阳市", value: 0 },
    { name: "蚌埠市", value: 0 },
    { name: "淮南市", value: 0 },
    { name: "马鞍山市", value: 0 },
    { name: "安庆市", value: 0 },
    { name: "黄山市", value: 0 },
    { name: "铜陵市", value: 0 },
    { name: "宿州市", value: 0 },
    { name: "淮北市", value: 0 },
    { name: "六安市", value: 0 },
    { name: "池州市", value: 1 },
    { name: "宣城市", value: 0 },
    { name: "亳州市", value: 0 },
  ]
  const option = {
    title: {
      top: 20,
      text: '',
      subtext: '',
      x: 'center',
      textStyle: {
        color: '#ffffff'
      }
    },
    tooltip: {
      trigger: 'item',
      formatter: function (params) {
        if (typeof (params.value)[2] == "undefined") {
          return params.name + ' : ' + params.value
        } else {
          return params.name + ' : ' + params.value[2]
        }
      }
    },
    visualMap: {
      show: false,
      max: 100,
      seriesIndex: [3],
      inRange: {
        color: ['#A5DCF4', '#006edd']
      }
    },
    geo: [{
      map: 'js',
      roam: false, //是否允许缩放
      zoom: 1.1, //默认显示级别
      scaleLimit: {
        min: 0,
        max: 3
      }, //缩放级别
      itemStyle: {
        normal: {
          areaColor: 'transparent',
          borderColor: '#3fdaff',
          borderWidth: 2,
          shadowColor: 'rgba(63, 218, 255, 0.5)',
          shadowBlur: 30
        },
        emphasis: {
          areaColor: '#2B91B7',
        }
      },
      tooltip: {
        show: false
      }
    }],
    series: [
      {
        type: 'effectScatter',
        coordinateSystem: 'geo',
        z: 5,
        data,
        symbolSize: 14,
        label: {
          normal: {
            show: true,
            formatter: function (params) {
              return '{fline|地点:' + params.data.city + '}\n{tline|' + (params.data.info || '发生xx集件') + '}'
            },
            position: 'top',
            backgroundColor: 'rgba(233,63,66,.9)',
            padding: [0, 0],
            borderRadius: 3,
            lineHeight: 32,
            color: '#ffffff',
            rich: {
              fline: {
                padding: [0, 10, 10, 10],
                color: '#ffffff'
              },
              tline: {
                padding: [10, 10, 0, 10],
                color: '#ffffff'
              }
            }
          },
          emphasis: {
            show: true
          }
        },
        itemStyle: {
          color: '#e93f42',
        }
      },
      //地图
      {
        type: 'map',
        mapType: 'js',
        geoIndex: -1,
        zoom: 1.1, //默认显示级别
        label: {
          show: true,
          color: '#ffffff',
          emphasis: {
            color: 'white',
            show: false
          }
        },
        itemStyle: {
          normal: {
            borderColor: '#2980b9',
            borderWidth: 1,
            areaColor: '#1d3b60'
          },
          emphasis: {
            areaColor: '#FA8C16',
            borderWidth: 0,
            color: 'green'
          }
        },
        data: data
      }
    ]
  }
  myChart.setOption(option)
  window.addEventListener('resize', function () {//执行
    myChart.resize()
  })
}
onMounted(() => {
  initEnergy()
  initEchart1()
  initMap()
})
@@ -536,8 +811,12 @@
  .center_box {
    flex: 1;
    padding: 16px 60px;
    display: flex;
    flex-direction: column;
    .center_box_one {
      height: 190px;
      .tabs {
        display: flex;
        align-items: center;
@@ -623,8 +902,14 @@
    }
    .center_box_two {
      flex: 1;
      width: 100%;
      border: 1px solid;
      .echart_map {
        width: 100%;
        height: 100%;
        border: 1px solid;
      }
    }
  }
@@ -772,27 +1057,33 @@
          font-size: 14px;
          color: #D2E0FF;
          margin-bottom: 11px;
          .num {
            font-weight: 500;
            font-size: 16px;
            color: #FFFFFF;
          }
        }
        .list{
        .list {
          margin-top: 22px;
          .item{
          .item {
            width: 100%;
            height: 36px;
            display: flex;
            align-items: center;
            &:nth-of-type(2n+1){
              background: rgba(0,152,255,0.13);
            &:nth-of-type(2n+1) {
              background: rgba(0, 152, 255, 0.13);
            }
            .la{
            .la {
              flex: 5;
              padding-left: 20px;
            }
            .val{
            .val {
              flex: 2;
            }
          }
@@ -915,6 +1206,7 @@
  position: relative;
  z-index: -2;
  font-size: 14px;
  .main_bg {
    position: absolute;
    left: 0;