ll
liukangdong
2024-11-15 522877ae5bddcb27699b893c27f149d6a3c7e408
screen/src/views/LogisticsEfficiency.vue
@@ -89,14 +89,20 @@
                  <span class="item addr">收货单位</span>
                  <span class="item time">任务开始时间</span>
                </div>
                <div class="line" v-for="item in dataList3">
                  <span class="item flag"><span :class="{ flag_bg: item.type == 1 || item.type == 3 }">{{ item.type == 1
                    || item.type == 3 ? '出' : '入' }}</span></span>
                  <span class="item order">{{ item.billCode || item.contractNum }}</span>
                  <span class="item id_card">{{ item.carCodeFront }}</span>
                  <span class="item status">{{ statusMap[item.status].label }}</span>
                  <span class="item addr">{{ item.repertotyAddress }}</span>
                  <span class="item time" v-if="item.confirmTaskDate">{{ item.confirmTaskDate.slice(5, 16) }}</span>
                <div class="one-swiper list_temp">
                  <div class="swiper-wrapper">
                    <div class="line swiper-slide one-swiper-slide" @click="showModal = true" v-for="item in dataList3">
                      <span class="item flag"><span :class="{ flag_bg: item.type == 1 || item.type == 3 }">{{ item.type
                        == 1
                        || item.type == 3 ? '出' : '入' }}</span></span>
                      <span class="item order">{{ item.billCode || item.contractNum }}</span>
                      <span class="item id_card">{{ item.carCodeFront }}</span>
                      <span class="item status">{{ statusMap[item.status].label }}</span>
                      <span class="item addr">{{ item.repertotyAddress }}</span>
                      <span class="item time">{{ item.confirmTaskDate ? item.confirmTaskDate.slice(5, 16) : '-'
                        }}</span>
                    </div>
                  </div>
                </div>
              </div>
            </div>
@@ -142,7 +148,24 @@
            </div>
          </div>
          <div class="center_box_two">
            <div ref="echartMap" class="echart_map" id="echartMap"></div>
            <div class="list">
              <div class="item">
                <img src="@/assets/images/LogisticsCenter/car_zaitu@2x.png" alt="">
                <span>在途:{{ 8 }}</span>
              </div>
              <div class="item">
                <img src="@/assets/images/LogisticsCenter/car_kongxian@2x.png" alt="">
                <span>空闲:{{ 8 }}</span>
              </div>
              <div class="item">
                <img src="@/assets/images/LogisticsCenter/car_lixian@2x.png" alt="">
                <span>离线:{{ 8 }}</span>
              </div>
            </div>
            <div class="echart_wrap">
              <div ref="echartMap" class="echart_map" id="echartMap"></div>
            </div>
          </div>
        </div>
        <div class="right_box">
@@ -223,10 +246,12 @@
                <Percent v-if="data1.stockTotal && data1.stockMax"
                  :rate="((data1.stockTotal / data1.stockMax) * 100).toFixed(0)" />
              </div>
              <div class="list">
                <div class="item" v-for="item in dataList6">
                  <div class="la">{{ item.name }}</div>
                  <div class="val">{{ item.num }}万支</div>
              <div class="list two-swiper">
                <div class="swiper-wrapper">
                  <div class="item two-swiper-slide swiper-slide" v-for="item in dataList6">
                    <div class="la">{{ item.name }}</div>
                    <div class="val">{{ item.num }}万支</div>
                  </div>
                </div>
              </div>
            </div>
@@ -289,6 +314,7 @@
          </div>
        </div>
      </div>
      <div class="modal_mask" v-if="showModal" @click="showModal = false"></div>
    </div>
  </v-scale-screen>
</template>
@@ -300,6 +326,9 @@
import dayjs from 'dayjs'
import * as echarts from 'echarts'
import ahJSON from '@/assets/anhui.json'
import icKongxian from '@/assets/images/LogisticsCenter/map_car_kongxian@2x.png'
import icLixian from '@/assets/images/LogisticsCenter/map_car_lixian@2x.png'
import icZaitu from '@/assets/images/LogisticsCenter/map_car_zaitu@2x.png'
import {
  wlcenterData,
  wljobData,
@@ -308,6 +337,8 @@
  wltotalInList,
  wltransportMeasure,
} from '@/api'
import 'swiper/css/swiper.min.css'
import Swiper from 'swiper'
const colors = ['#FEAF01', '#01ABFE', '#51F9E4']
const weekMap = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六',]
@@ -524,6 +555,66 @@
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] },
      ],
    }
  ]
  let serData = []
  scatterData.forEach((item) => {
    serData.push({
      name: `${item.name}`,
      type: 'effectScatter',
      coordinateSystem: 'geo',
      effectType: 'ripple',
      showEffectOn: 'render',
      // 散点样式
      rippleEffect: {
        period: 1,
        scale: 1,
        brushType: 'fill'
      },
      // 散点大小 自定义散点图片
      // symbol: `image://${item.img}`,
      symbol: `image://${item.img}`,
      label: {
        show: true,
        formatter: '{b|{b}}',
        position: 'top',
        distance: -1,
        rich: {
          b: {
            color: "#fff",
            fontSize: 14,
            height: 30,
            // width: 200,
            padding: 5,
          },
        }
      },
      symbolSize: [32, 40],
      hoverAnimation: true,
      zlevel: 99,
      data: item.data,
    })
  }
  )
  var center = {
    '合肥市': [117.25, 31.83],
    '滁州市': [118.32, 32.3],
@@ -547,12 +638,12 @@
    { name: "滁州市", value: 0 },
    { name: "芜湖市", value: 1 },
    { name: "阜阳市", value: 0 },
    { name: "蚌埠市", value: 0 },
    { name: "蚌埠市", value: 4 },
    { name: "淮南市", value: 0 },
    { name: "马鞍山市", value: 0 },
    { name: "安庆市", value: 0 },
    { name: "马鞍山市", value: 6 },
    { name: "安庆市", value: 2 },
    { name: "黄山市", value: 0 },
    { name: "铜陵市", value: 0 },
    { name: "铜陵市", value: 40 },
    { name: "宿州市", value: 0 },
    { name: "淮北市", value: 0 },
    { name: "六安市", value: 0 },
@@ -570,7 +661,6 @@
        color: '#ffffff'
      }
    },
    tooltip: {
      trigger: 'item',
      formatter: function (params) {
@@ -592,7 +682,7 @@
    geo: [{
      map: 'js',
      roam: false, //是否允许缩放
      zoom: 1.1, //默认显示级别
      zoom: 1.2, //默认显示级别
      scaleLimit: {
        min: 0,
        max: 3
@@ -657,7 +747,7 @@
        type: 'map',
        mapType: 'js',
        geoIndex: -1,
        zoom: 1.1, //默认显示级别
        zoom: 1.2, //默认显示级别
        label: {
          show: true,
          color: '#ffffff',
@@ -668,18 +758,19 @@
        },
        itemStyle: {
          normal: {
            borderColor: '#2980b9',
            borderColor: '#428598',
            borderWidth: 1,
            areaColor: '#1d3b60'
          },
          emphasis: {
            areaColor: '#FA8C16',
            borderWidth: 0,
            color: 'green'
            borderWidth: 1,
            color: '#428598'
          }
        },
        data: data
      }
      },
      ...serData,
    ]
  }
@@ -736,6 +827,7 @@
  wlplatformJobList().then(res => {
    const result = res.data
    dataList3.value = result
    loopFn1()
  })
}
const data4 = ref({})
@@ -770,6 +862,33 @@
  wlstockList().then(res => {
    const result = res.data
    dataList6.value = result
    loopFn2()
  })
}
const autoplayFlag = (list = [], leng = 4, time = 2000) => {
  if (list.length > leng) {
    return { delay: time, disableOnInteraction: false }
  } else {
    return false
  }
}
const loopFn1 = () => {
  var newSwiper1 = new Swiper('.one-swiper', {
    initialSlide: 0,
    direction: 'vertical', //竖直方向
    slidesPerView: 7,
    autoplay: autoplayFlag(dataList3.value, 7, 2000),
    observer: true, //修改swiper自己或子元素时,自动初始化swiperiper
  })
}
const loopFn2 = () => {
  var newSwiper1 = new Swiper('.two-swiper', {
    initialSlide: 0,
    direction: 'vertical', //竖直方向
    slidesPerView: 7,
    autoplay: autoplayFlag(dataList6.value, 7, 2000),
    observer: true, //修改swiper自己或子元素时,自动初始化swiperiper
  })
}
onMounted(() => {
@@ -789,6 +908,10 @@
<style lang="scss" scoped>
div {
  box-sizing: border-box;
}
.swiper-wrapper {
  display: block !important;
}
.main_content {
@@ -901,10 +1024,15 @@
      .list_wrap {
        padding: 10px 0;
        .list_temp {
          height: 210px !important;
          overflow: hidden;
        }
        .list {
          .line {
            display: flex;
            height: 30px;
            height: 30px !important;
            align-items: center;
            padding: 0 10px;
            font-size: 12px;
@@ -951,7 +1079,8 @@
            }
            .time {
              flex: 8;
              flex: 6;
              margin-left: 6px;
            }
          }
        }
@@ -1057,10 +1186,37 @@
    .center_box_two {
      flex: 1;
      width: 100%;
      position: relative;
      .echart_map {
      .list {
        position: absolute;
        top: 10px;
        left: 20px;
        .item {
          display: flex;
          align-items: center;
          font-weight: 500;
          font-size: 20px;
          margin-bottom: 18px;
          img {
            width: 36px;
            height: 36px;
            margin-right: 15px;
          }
        }
      }
      .echart_wrap {
        width: 100%;
        height: 100%;
        .echart_map {
          width: 100%;
          height: 100%;
          /* transform: rotate(60deg); */
        }
      }
    }
  }
@@ -1219,12 +1375,12 @@
        .list {
          margin-top: 22px;
          height: 240px;
          overflow: auto;
          overflow: hidden;
          scrollbar-width: none;
          .item {
            width: 100%;
            height: 36px;
            height: 36px !important;
            display: flex;
            align-items: center;
@@ -1385,7 +1541,7 @@
  top: 20%;
  left: 50%;
  transform: translate(-50%, 0);
  z-index: 99;
  z-index: 999;
  padding: 24px;
  .title_head {
@@ -1526,34 +1682,41 @@
        color: #D2E0FF;
        padding: 10px;
        margin-bottom: 10px;
        .head {
          display: flex;
          justify-content: space-between;
          align-items: center;
          height: 36px;
          line-height: 36px;
          border-bottom: 1px solid rgba(255,255,255,0.16);
          border-bottom: 1px solid rgba(255, 255, 255, 0.16);
          margin-bottom: 10px;
          .code {
            font-weight: 500;
            font-size: 14px;
            color: #00F2F3;
          }
        }
        .line{
        .line {
          display: flex;
          align-items: center;
          margin-bottom: 8px;
          &:nth-last-child(1){
          &:nth-last-child(1) {
            margin-bottom: 0;
          }
          .name{
          .name {
            flex: 4;
          }
          .num{
          .num {
            flex: 3;
          }
          .val{
          .val {
            color: #fff;
          }
        }
@@ -1562,6 +1725,17 @@
  }
}
.modal_mask {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 99;
  background-color: rgba(0, 0, 0, 0.1);
  /* background-color: red; */
}
.bg {
  position: absolute;
  left: 0;