ll
liukangdong
2024-12-13 75428aa3f870b62c7ccc7ebc7c0360c5fa4fb3e6
screen/src/views/LogisticsEfficiency.vue
@@ -3,7 +3,7 @@
    <div class="main_app">
      <img src="@/assets/images/energy_ef/bg@2x.png" class="main_bg" alt="" />
      <div class="main_header">
        <img src="@/assets/images/maintitle.gif" class="main_header_bg" alt="" />
        <!-- <img src="@/assets/images/maintitle.gif" class="main_header_bg" alt="" /> -->
        <div class="title">安泰智慧物流园区-调度能效跟踪</div>
        <div class="time_wrap">
          <span class="date">{{ date }}</span>
@@ -151,21 +151,33 @@
            <div class="list">
              <div class="item">
                <img src="@/assets/images/LogisticsCenter/car_zaitu@2x.png" alt="">
                <span>在途:{{ 8 }}</span>
                <span>在途:{{ data7.busyNum }}</span>
              </div>
              <div class="item">
                <img src="@/assets/images/LogisticsCenter/car_kongxian@2x.png" alt="">
                <span>空闲:{{ 8 }}</span>
                <span>空闲:{{ data7.idleNum }}</span>
              </div>
              <div class="item">
                <img src="@/assets/images/LogisticsCenter/car_lixian@2x.png" alt="">
                <span>离线:{{ 8 }}</span>
                <span>离线:{{ data7.offlineNum }}</span>
              </div>
            </div>
            <div class="echart_wrap">
              <div ref="echartMap" class="echart_map" id="echartMap"></div>
            </div>
            <div class="warnning_info">
              <div class="head" @click="isShowCarW = !isShowCarW">
                <img src="../assets/images/FireFighting/fire_right.png" alt="">
                <span>车辆报警</span>
              </div>
              <div v-if="isShowCarW" class="war_list">
                <div class="line" v-for="item in data7.eventList">
                  <div class="id_card">{{ item.carCode }}</div>
                  <div class="title">{{ item.title }}</div>
                  <div v-if="item.time">{{ item.time.slice(11) }}</div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="right_box">
@@ -259,7 +271,7 @@
        </div>
      </div>
      <!--  -->
      <div class="modal" v-if="showModal">
      <div class="modal" v-if="activeCar && activeCar.phone">
        <div class="title_head">
          <img src="@/assets/images/energy_ef/chuku_ic_car@2x.png" alt="">
          <span>皖a222</span>
@@ -314,7 +326,7 @@
          </div>
        </div>
      </div>
      <div class="modal_mask" v-if="showModal" @click="showModal = false"></div>
      <div class="modal_mask" v-if="activeCar && activeCar.phone" @click="activeCar = {}"></div>
    </div>
  </v-scale-screen>
</template>
@@ -336,6 +348,8 @@
  wlstockList,
  wltotalInList,
  wltransportMeasure,
  carsListPost,
  getCarsJobDetails
} from '@/api'
import 'swiper/css/swiper.min.css'
import Swiper from 'swiper'
@@ -351,13 +365,6 @@
  time.value = dayjs().format('HH:mm:ss')
}, 1000)
const showModal = ref(false)
const modalTab = ref(0)
const modalTabClick = (val) => {
  modalTab.value = val
}
const initEnergy = () => {
@@ -381,13 +388,14 @@
      left: '3%',
      right: '4%',
      bottom: '3%',
      top: '18%',
      top: '26%',
      containLabel: true
    },
    tooltip: {
      trigger: 'axis'
    },
    xAxis: [{
    xAxis: [
      {
      nameGap: 5,
      type: 'category',
      axisLine: {
@@ -403,20 +411,39 @@
      axisTick: {
        show: false,
      },
      data: dataList2.value.map(i => i.planDate),
    }],
        data: dataList2.value.map(i => i.planDateStrT),
      }
    ],
    yAxis: [
      {
        nameTextStyle: {
          color: '#869CC9',
        },
        offset: 0,
        name: '万支',
        type: 'value',
        name: '个',
        min: 0,
        axisLabel: {
          show: true,
          color: "#869CC9",
        },
        splitLine: {
          show: true,
          lineStyle: {
            width: 1,
            color: "rgba(49,105,129,0.4)",
            type: 'dashed'
          }
        },
        // interval: 5,
        axisLabel: {
          formatter: '{value}'
        }
      },
      {
        type: 'value',
        name: '万支',
        nameTextStyle: {
          color: '#869CC9',
        },
        offset: 0,
        type: 'value',
        axisLine: {
          show: true,
        },
@@ -428,18 +455,10 @@
            type: 'dashed'
          }
        },
      },
      {
        type: 'value',
        name: '%',
        min: 0,
        max: 100,
        // interval: 5,
        axisLabel: {
          formatter: '{value}%'
        },
        splitLine: false
          formatter: '{value}'
      }
      },
    ],
    series: [
      {
@@ -452,6 +471,7 @@
          position: 'top',
          color: '#fff',
        },
        yAxisIndex: 1,
        itemStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            {
@@ -475,6 +495,7 @@
        name: '任务完成量',
        type: 'bar',
        barWidth: 10,
        yAxisIndex: 1,
        label: {
          show: false,
          position: 'top',
@@ -504,6 +525,7 @@
        type: 'line',
        smooth: false,
        showAllSymbol: true,
        yAxisIndex: 0,
        symbol: 'none',
        lineStyle: {
          color: "#1a43bc"
@@ -555,26 +577,24 @@
const initMap = () => {
  var myChart = echarts.init(echartMap.value)
  echarts.registerMap('js', ahJSON)
  var scatterData = [
    {
      name: '幼儿园',
      num: 15,
      color: ['#1984ff', '#184b8d'],
      img: icKongxian,
      data: [
        { name: '', value: [117.25, 31.49] },
      ],
    },
    {
      name: '小学',
      num: 11,
      color: ['#f16c08', '#7f3710'],
      img: icLixian,
      data: [
        { name: '', value: [118.5, 31.08] },
      ],
  const scatterData = data7.value.carsList.map(item => {
    return {
      name: item.terminalId,
      img: item.status == 0 ? icLixian : item.status == 1 || item.status == 2 ? icZaitu : icKongxian,
      data: [{code: item.plateNum, value: [item.longitude,item.latitude]}]
    }
  ]
  })
  // var scatterData = [
  //   {
  //     name: '幼儿园',
  //     num: 15,
  //     // color: ['#1984ff', '#184b8d'],
  //     img: icKongxian,
  //     data: [
  //       { name: 'asdasdas ', value: [117.25, 31.49] },
  //     ],
  //   },
  // ]
  let serData = []
  scatterData.forEach((item) => {
    serData.push({
@@ -609,30 +629,11 @@
      },
      symbolSize: [32, 40],
      hoverAnimation: true,
      zlevel: 99,
      data: item.data,
    })
  }
  )
  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 },
@@ -659,16 +660,6 @@
      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: {
@@ -712,7 +703,7 @@
        symbolSize: 14,
        label: {
          normal: {
            show: true,
            show: false,
            formatter: function (params) {
              return '{fline|地点:' + params.data.city + '}\n{tline|' + (params.data.info || '发生xx集件') + '}'
            },
@@ -751,10 +742,7 @@
        label: {
          show: true,
          color: '#ffffff',
          emphasis: {
            color: 'white',
            show: false
          }
        },
        itemStyle: {
          normal: {
@@ -763,9 +751,15 @@
            areaColor: '#1d3b60'
          },
          emphasis: {
            areaColor: '#FA8C16',
            borderWidth: 1,
            color: '#428598'
            disabled: true,
            // areaColor: '#FA8C16',
            // borderWidth: 1,
            // color: '#428598',
            label: {
              show: true, // 始终显示文字
              color: '#fff' // 设置文字颜色
            },
            areaColor: null
          }
        },
        data: data
@@ -775,10 +769,22 @@
  }
  myChart.setOption(option)
  myChart.on('click', function (params) {
    const item = params.data
    getCarsJobDetails({carCode: item.code}).then(res => {
      activeCar.value = res.data
    })
  })
  window.addEventListener('resize', function () {//执行
    myChart.resize()
  })
}
const activeCar = ref({})
const modalTab = ref(0)
const modalTabClick = (val) => {
  modalTab.value = val
}
const data1 = ref({})
const activeTab1 = ref(0)
@@ -798,11 +804,17 @@
const dataList2 = ref([])
const activeTab2 = ref(0)
const tabClick2 = (val) => { activeTab2.value = val }
const tabClick2 = (val) => {
  activeTab2.value = val
  getData2()
}
const getData2 = () => {
  wltransportMeasure({ queryType: activeTab2.value }).then(res => {
    const result = res.data
    const result = res.data || []
    dataList2.value = result
    dataList2.value.forEach(item => {
      item.planDateStrT = activeTab2.value == 2 ? dayjs(item.planDateStr).format('M') : dayjs(item.planDateStr).format('M.D')
    })
    initEnergy()
  })
}
@@ -831,7 +843,10 @@
}
const data4 = ref({})
const activeTab4 = ref(0)
const tabClick4 = (val) => { activeTab4.value = val }
const tabClick4 = (val) => {
  activeTab4.value = val
  getData4()
}
const getData4 = () => {
  wljobData({ queryType: activeTab4.value }).then(res => {
    const result = res.data
@@ -861,6 +876,16 @@
  wlstockList().then(res => {
    const result = res.data
    dataList6.value = result
  })
}
const isShowCarW = ref(false)
const data7 = ref({})
const getData7 = () => {
  carsListPost().then(res => {
    const result = res.data || {}
    data7.value = result
    initMap()
  })
}
@@ -896,8 +921,7 @@
  getData4()
  getData5()
  getData6()
  initMap()
  getData7()
  setTimeout(() => {
    loopFn1()
@@ -1212,7 +1236,7 @@
      }
      .echart_wrap {
        width: 100%;
        width: 86%;
        height: 100%;
        .echart_map {
@@ -1221,6 +1245,52 @@
          /* transform: rotate(60deg); */
        }
      }
      .warnning_info {
        position: absolute;
        right: 0;
        bottom: 0;
        border-top: 1px solid #5ecbce;
        border-bottom: 1px solid #5ecbce;
        .head {
          display: flex;
          width: 280px;
          height: 57px;
          background: rgba(0, 30, 63, 0.4);
          backdrop-filter: blur(5px);
          display: flex;
          align-items: center;
          padding-left: 10px;
          font-weight: bold;
          font-size: 16px;
          cursor: pointer;
          img {
            width: 14px;
            margin-right: 10px;
          }
        }
        .war_list {
          max-height: 300px;
          overflow: auto;
          .line {
            font-size: 13px;
            color: #D2E0FF;
            display: flex;
            align-items: center;
            height: 30px;
            div{
              flex: 3;
            }
            .id_card{
              color: #00F2F3;
            }
            .title{
              flex: 4;
            }
          }
        }
      }
    }
  }