From abc14c4f8a402e4c41b0645bfa0e1c797f0210a1 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 05 十一月 2024 19:07:49 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 screen/src/views/TaskEfficiency.vue |  572 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 527 insertions(+), 45 deletions(-)

diff --git a/screen/src/views/TaskEfficiency.vue b/screen/src/views/TaskEfficiency.vue
index 4bd5515..27e6ece 100644
--- a/screen/src/views/TaskEfficiency.vue
+++ b/screen/src/views/TaskEfficiency.vue
@@ -24,20 +24,20 @@
             <div class="car_static">
               <div class="echart_wrap">
                 <div class="pie_text">
-                  <div class="fs30"><strong>300</strong></div>
+                  <div class="fs30"><strong>{{ data1 }}</strong></div>
                   <div>瀹屾垚閲�</div>
                 </div>
                 <div class="echart1" id="echart1"></div>
               </div>
               <div class="list">
-                <div class="item">
+                <div class="item" v-for="item, i in dataList1" :key="i">
                   <div class="line">
-                    <div :style="{ background: colors[0] }" class="icon"></div>
-                    <div class="text">瀹夋嘲鐗╂祦瑁呰揣鏈堝彴缁�</div>
+                    <div :style="{ background: colors[i] }" class="icon"></div>
+                    <div class="text">{{ item.name }}</div>
                   </div>
-                  <div :style="{ color: colors[0] }" class="num">100涓囨敮</div>
+                  <div :style="{ color: colors[i] }" class="num">{{ item.value }}涓囨敮</div>
                 </div>
-                <div class="item">
+                <!-- <div class="item">
                   <div class="line">
                     <div :style="{ background: colors[1] }" class="icon"></div>
                     <div class="text">瀹夋嘲鐗╂祦鍗歌揣鏈堝彴缁�</div>
@@ -50,7 +50,7 @@
                     <div class="text">甯傚叕鍙稿嵏璐ф湀鍙扮粍</div>
                   </div>
                   <div :style="{ color: colors[2] }" class="num">100涓囨敮</div>
-                </div>
+                </div> -->
               </div>
             </div>
           </div>
@@ -63,13 +63,13 @@
               <img src="@/assets/images/title@2x.png" class="bg" alt="" />
             </div>
             <div class="list">
-              <div class="line" v-for="item, i in 5">
+              <div class="line" v-for="item, i in dataList2" :key="i">
                 <div class="top"><span v-if="i < 3">top</span>{{ i }}</div>
-                <div class="id_card">鐨朅12313</div>
+                <div class="id_card">{{ item.platformName }}</div>
                 <div class="wrap">
-                  <ChargeRate :rate="15" :color />
+                  <ChargeRate :rate="item.rate" />
                 </div>
-                <div class="num">6灏忔椂34鍒嗛挓</div>
+                <div class="num">{{ item.workTotalTimeT }}</div>
               </div>
             </div>
           </div>
@@ -80,9 +80,9 @@
                 <div>瀹炴椂浣滀笟鏁堢巼</div>
               </div>
               <div class="tabs">
-                <div class="tab active">鍑哄簱</div>
+                <div class="tab" :class="{ active: activeTab3 == 1 }" @click="tabClick3(1)">鍑哄簱</div>
                 <div class="separate"></div>
-                <div class="tab">鍏ュ簱</div>
+                <div class="tab" :class="{ active: activeTab3 == 0 }" @click="tabClick3(0)">鍏ュ簱</div>
               </div>
               <img src="@/assets/images/title@2x.png" class="bg" alt="" />
             </div>
@@ -96,32 +96,32 @@
             <div class="static_wrap">
               <div class="item">
                 <div class="name">鏈堝彴鏁伴噺</div>
-                <div class="nums">
-                  <div class="num" v-for="i in '010'">{{ i }}</div>
+                <div v-if="data4.platformTotal" class="nums">
+                  <div class="num" v-for="n, i in data4.platformTotal + ''" :key="i">{{ n }}</div>
                 </div>
               </div>
               <div class="item">
                 <div class="name">绌洪棽鏈堝彴</div>
-                <div class="nums">
-                  <div class="num" v-for="i in '010'">{{ i }}</div>
+                <div v-if="data4.freePlatform" class="nums">
+                  <div class="num" v-for="n, i in data4.freePlatform + ''" :key="i">{{ n }}</div>
                 </div>
               </div>
               <div class="item">
                 <div class="name">棰勭害杞﹁締</div>
-                <div class="nums">
-                  <div class="num" v-for="i in '010'">{{ i }}</div>
+                <div v-if="data4.reservationCar" class="nums">
+                  <div class="num" v-for="n, i in data4.reservationCar + ''" :key="i">{{ n }}</div>
                 </div>
               </div>
               <div class="item">
                 <div class="name">浣滀笟杞﹁締</div>
-                <div class="nums">
-                  <div class="num" v-for="i in '010'">{{ i }}</div>
+                <div v-if="data4.workingCar" class="nums">
+                  <div class="num" v-for="n, i in data4.workingCar + ''" :key="i">{{ n }}</div>
                 </div>
               </div>
               <div class="item">
                 <div class="name">鎺掗槦杞﹁締</div>
-                <div class="nums">
-                  <div class="num" v-for="i in '010'">{{ i }}</div>
+                <div class="nums" v-if="data4.lineUpCar">
+                  <div class="num" v-for="n, i in data4.lineUpCar + ''" :key="i">{{ n }}</div>
                 </div>
               </div>
             </div>
@@ -139,13 +139,15 @@
                 <div>棰勮瀹屾垚鏃堕棿</div>
                 <div>鏈堝彴鐘舵��</div>
               </div>
-              <div class="line" v-for="i in 6">
-                <div>鏈堝彴鍚嶇О</div>
-                <div>浣滀笟杞﹁締</div>
-                <div>浣滀笟閲�</div>
-                <div>浣滀笟鏃堕暱</div>
-                <div>棰勮瀹屾垚鏃堕棿</div>
-                <div>鏈堝彴鐘舵��</div>
+              <div class="line" v-for="item, i in dataList5" :key="i">
+                <div>{{ item.platformName }}</div>
+                <div>{{ item.carNo || '-' }}</div>
+                <div>{{ item.workNum }}{{ item.workNum ? '涓囨敮' : '-' }}</div>
+                <div>{{ item.workTime || '-' }}</div>
+                <div>{{ item.finishTime || '-' }}</div>
+                <div :style="{
+                  color: item.status == 1 ? '#869CC9' : item.status == 2 ? '#FE5501' : '#D2E0FF'
+                }">{{ item.statusTemp }}</div>
               </div>
             </div>
           </div>
@@ -162,19 +164,34 @@
             <div class="static_wrap">
               <div class="item">
                 <div class="name">绛惧埌鏁�</div>
-                <div class="num">1</div>
+                <div class="num">{{ data6.inNum || 0 }}</div>
               </div>
               <div class="item">
                 <div class="name">宸插彨鍙�</div>
-                <div class="num">1</div>
+                <div class="num">{{ data6.callNum || 0 }}</div>
               </div>
               <div class="item">
                 <div class="name">宸蹭綔涓�</div>
-                <div class="num">1</div>
+                <div class="num">{{ data6.workingNum || 0 }}</div>
               </div>
               <div class="item">
                 <div class="name">宸插畬鎴�</div>
-                <div class="num">1</div>
+                <div class="num">{{ data6.finishNum || 0 }}</div>
+              </div>
+            </div>
+            <div class="echart_wrap">
+              <div class="echart3" id="echart3"></div>
+            </div>
+            <div class="list">
+              <div class="line" v-for="item, i in data6.platformLogList">
+                <div class="time_wrap">
+                  <div class="time" v-if="item.createDate">{{ item.createDate.slice(11, 16) }}</div>
+                  <div class="sp"></div>
+                  <div class="dian"></div>
+                </div>
+                <div class="id_card">{{ item.carCodeFront }}</div>
+                <div class="status">寮�濮嬩綔涓�</div>
+                <div class="desc">{{ item.content }}</div>
               </div>
             </div>
           </div>
@@ -226,8 +243,17 @@
 import Percent from '@/components/percent.vue'
 import dayjs from 'dayjs'
 import ChargeRate from '@/components/ChargeRate.vue'
-
 import * as echarts from 'echarts'
+import {
+  cnplatformGroupFinish,
+  cnplatformDuration,
+  cnplatformWorkData,
+  cncenterData,
+  cncarWorkSituation,
+  cnworkEfficiency,
+} from '@/api'
+
+
 const weekMap = ['鏄熸湡鏃�', '鏄熸湡涓�', '鏄熸湡浜�', '鏄熸湡涓�', '鏄熸湡鍥�', '鏄熸湡浜�', '鏄熸湡鍏�',]
 const date = ref(dayjs().format('YYYY.MM.DD'))
 const week = ref(weekMap[new Date().getDay()])
@@ -259,11 +285,7 @@
         labelLine: {
           show: false
         },
-        data: [
-          { value: 1048, name: 'Search Engine' },
-          { value: 735, name: 'Direct' },
-          { value: 580, name: 'Email' }
-        ]
+        data: dataList1.value
       }
     ]
   }
@@ -272,12 +294,396 @@
     myChart.resize()
   })
 }
+const initEchart2 = () => {
+  const myChart = echarts.init(document.getElementById('echart2'))
+  const option = {
+    grid: {
+      top: '32%',
+      left: '0%',
+      right: '7%',
+      bottom: '0%',
+      containLabel: true,
+    },
+    legend: {
+      itemGap: 24,
+      data: ['鍒嗘椂浣滀笟閲�', '绱浣滀笟閲�'],
+      icon: 'circle',
+      itemWidth: 10,
+      itemHeight: 10,
+      top: '6%',
+      textStyle: {
+        color: '#fff',
+        borderColor: '#fff'
+      },
+    },
+    tooltip: {
+      trigger: "axis",
+      axisPointer: {
+        type: "line",
+      },
+      backgroundColor: "rgba(9, 24, 48, 0.5)",
+      borderColor: "rgba(75, 253, 238, 0.4)",
+      textStyle: {
+        color: "#FFF",
+      },
+    },
+    xAxis: [{
+      nameGap: 5,
+      type: 'category',
+      axisLine: {
+        show: true,
+        lineStyle: {
+          color: '#999'
+        },
+      },
+      axisLabel: {
+        color: '#9eaaba',
+      },
+      axisTick: {
+        show: false,
+      },
+      data: dataList3.value.map(i => i.workTime),
+    }],
+    yAxis: [
+      {
+        nameTextStyle: {
+          color: '#9eaaba',
+        },
+        offset: 0,
+        name: '涓囨敮',
+        type: 'value',
+        axisLabel: {
+          show: true,
+          color: "#9eaaba",
+        },
+        axisLine: {
+          show: true,
+        },
+        splitLine: {
+          show: true,
+          lineStyle: {
+            width: 1,
+            color: "rgba(49,105,129,0.4)",
+            type: 'dashed'
+          }
+        },
+      },
+      // {
+      //   nameTextStyle: {
+      //     color: '#9eaaba',
+      //   },
+      //   offset: 0,
+      //   name: '涓囨敮',
+      //   type: 'value',
+      //   axisLabel: {
+      //     show: true,
+      //     color: "#9eaaba",
+      //   },
+      //   axisLine: {
+      //     show: true,
+      //   },
+      //   splitLine: {
+      //     show: true,
+      //     lineStyle: {
+      //       width: 1,
+      //       color: "rgba(49,105,129,0.4)",
+      //       type: 'dashed'
+      //     }
+      //   },
+      // }
+    ],
+    series: [
+      {
+        name: '鍒嗘椂浣滀笟閲�',
+        type: 'line',
+        smooth: true,
+        showAllSymbol: true,
+        symbol: 'circle',
+        symbolSize: 0,
+        lineStyle: {
+          color: '#2355f5',
+          borderColor: '#2355f5'
+        },
+        label: {
+          show: false,
+          position: 'top',
+          color: '#fff',
+        },
+        itemStyle: {
+          color: "#2355f5",
+          lineStyle: {
+            width: 0,
+            type: 'solid'
+          }
+        },
+        areaStyle: {
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+            {
+              offset: 0,
+              color: '#2355f5'
+            },
+            {
+              offset: 1,
+              color: 'rgba(14, 31, 65,0.1)'
+            }
+          ], false),
+          shadowColor: 'rgba(124,248,255, 0)',
+          shadowBlur: 20
+        },
+        data: dataList3.value.map(i => i.workNum)
+      },
+      {
+        name: '绱浣滀笟閲�',
+        type: 'bar',
+        barWidth: 6,
+        label: {
+          show: false,
+          position: 'top',
+          color: '#fff',
+        },
+        itemStyle: {
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+            {
+              offset: 0,
+              color: '#63d6fa'
+            },
+            {
+              offset: 1,
+              color: '#32718d'
+            }
+          ], false),
+          lineStyle: {
+            width: 1,
+            type: 'solid'
+          },
+          barBorderRadius: [30, 30, 0, 0],
+        },
+        data: dataList3.value.map(i => i.totalWorkNum)
+      },
+    ]
+  }
+  myChart.setOption(option)
+  window.addEventListener('resize', function () { // 鎵ц
+    myChart.resize()
+  })
+}
+const initEchart3 = () => {
+  const myChart = echarts.init(document.getElementById('echart3'))
+  var colors = [
+    new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
+      offset: 0,
+      color: '#7fe3fc'
+    },
+    {
+      offset: 1,
+      color: '#9ce9fc'
+    }]),
+    new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
+      offset: 0,
+      color: '#64d7fa'
+    }, {
+      offset: 1,
+      color: '#7de3fc'
+    }]),
+    new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
+      offset: 0,
+      color: '#4679f6'
+    }, {
+      offset: 1,
+      color: '#4674f6'
+    }]),
+    new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
+      offset: 0,
+      color: '#4370f2'
+    }, {
+      offset: 1,
+      color: '#61d3f9'
+    }])]
+  const temp = []
+  temp.push({ name: '棰勭害鏁�', value: data6.value.reservationNum || 0 })
+  temp.push({ name: '宸茶繘鍦�', value: data6.value.inNum || 0 })
+  temp.push({ name: '宸蹭綔涓�', value: data6.value.workingNum || 0 })
+  temp.push({ name: '宸茬鍦�', value: data6.value.leaveNum || 0 })
+  console.log('temp', temp);
+  
+  const option = {
+    color: colors,
+    tooltip: {
+      show: false
+    },
+    legend: {
+      show: false
+    },
+    series: [
+      {
+        type: 'funnel',
+        left: '15%',
+        right: '45%',
+        top: '10%',
+        bottom: '10%',
+        minSize: '20%',
+        maxSize: '80%',
+        gap: 4,
+        label: {
+          show: false
+        },
 
+        itemStyle: {  //鍘绘帀榛樿鐧借壊杈规绾�
+          borderWidth: 0,
+          borderColor: '#fff'
+        },
+        data: temp
+      },
+      {
+        type: 'funnel',
+        left: '15%',
+        right: '45%',
+        top: '10%',
+        bottom: '10%',
+        minSize: '80%',
+        maxSize: '80%',
+        gap: 4,
+        z: 1,
+        label: {
+          show: true,
+          position: 'outside',
+          formatter: '{a|{b}}  {a|{c}%}',
+          rich: {
+            a: {
+              color: '#869CC9',
+              fontSize: 13
+            },
+          }
+        },
+        labelLine: {
+          show: true,
+          normal: {
+            length: 80,
+            position: 'right',
+            lineStyle: {
+              width: 1,
+              type: 'dashed',
+              color: 'rgba(102, 160, 239,.5)'
+            }
+          },
+        },
+        itemStyle: {  //鍘绘帀榛樿鐧借壊杈规绾�
+          borderWidth: 0,
+          borderColor: '#fff'
+        },
+        itemStyle: {
+          normal: {
+            color: 'transparent',
+            borderWidth: 0,
+            opacity: 1
+          }
+        },
+        data: temp
+      },
+    ]
+  }
+  myChart.setOption(option)
+  window.addEventListener('resize', function () { // 鎵ц
+    myChart.resize()
+  })
+}
+
+const dataList1 = ref([])
+const data1 = ref(0)
+const getData1 = () => {
+  cnplatformGroupFinish().then(res => {
+    const result = res.data || []
+    let count = 0
+    dataList1.value = result.map(i => {
+      count += i.finishData
+      return {
+        value: i.finishData,
+        name: i.platformGroupName
+      }
+    })
+    data1.value = count
+    initEchart1()
+  })
+}
+const dataList2 = ref([])
+const getData2 = () => {
+  cnplatformDuration().then(res => {
+    const result = res.data || []
+    dataList2.value = result.map(item => {
+      if (item.workTotalTime) {
+        if (item.workTotalTime > 60) {
+          item.workTotalTimeT = (item.workTotalTime / 60).toFixed(0) + '灏忔椂' + item.workTotalTime % 60 + '鍒嗛挓'
+        } else {
+          item.workTotalTimeT = item.workTotalTime
+        }
+      }
+      item.rate = ((item.workTotalTime / item.openTotalTime) * 30).toFixed(0)
+      return item
+    })
+  })
+}
+
+const dataList3 = ref([])
+const activeTab3 = ref(1)
+const tabClick3 = (val) => {
+  activeTab3.value = val
+  getData3()
+}
+const getData3 = () => {
+  cnworkEfficiency({ type: activeTab3.value }).then(res => {
+    const result = res.data
+    dataList3.value = result
+    initEchart2()
+  })
+}
+const data4 = ref({})
+const getData4 = () => {
+  cncenterData().then(res => {
+    const result = res.data
+    data4.value = result
+  })
+}
+const dataList5 = ref([])
+const getData5 = () => {
+  cnplatformWorkData().then(res => {
+    const result = res.data || []
+    dataList5.value = result.map(i => {
+      i.statusTemp = i.status == 0 ? '浣滀笟涓�' : i.status == 1 ? '绌洪棽涓�' : '浣滀笟瓒呮椂'
+      if (i.workTime) {
+        if (item.workTime > 60) {
+          item.workTime = (item.workTime / 60).toFixed(0) + 'h' + item.workTime % 60 + 'm'
+        } else {
+          item.workTime = item.workTime
+        }
+      }
+      i.finishTime = dayjs(i.finishTime).format('HH:mm')
+      return i
+    })
+  })
+}
+
+const data6 = ref({})
+const getData6 = () => {
+  cncarWorkSituation().then(res => {
+    const result = res.data
+    data6.value = result
+    initEchart3()
+  })
+}
 
 
 onMounted(() => {
   // initEnergy()
-  initEchart1()
+  getData1()
+  getData2()
+  getData3()
+  getData4()
+  getData5()
+  getData6()
+
+  // initEchart1()
+  // initEchart2()
+  // initEchart3()
 })
 
 
@@ -299,7 +705,6 @@
     .left_box_one {
       width: 100%;
       margin-bottom: 20px;
-      border: 1px solid;
 
       .car_static {
         display: flex;
@@ -378,7 +783,6 @@
       .list {
         padding: 20px 24px 4px;
         height: 227px;
-        border: 1px solid;
 
         .line {
           display: flex;
@@ -401,15 +805,21 @@
           .id_card {
             color: #DBEAEA;
             font-weight: 500;
-            margin-right: 14px;
+            margin-right: 2px;
             font-size: 14px;
+            width: 80px;
+            overflow: hidden;
+            white-space: nowrap;
+            text-overflow: ellipsis;
           }
 
           .num {
             font-weight: 500;
+            width: 82px;
+            text-align: right;
             font-size: 13px;
             color: #DBEAEA;
-            margin-left: 15px;
+            margin-left: 2px;
           }
 
           .wrap {
@@ -561,6 +971,73 @@
           }
         }
       }
+
+      .echart_wrap {
+        width: 100%;
+
+        .echart3 {
+          width: 100%;
+          height: 160px;
+        }
+      }
+
+      .list {
+        margin: 0 20px 0;
+        width: 100%;
+        height: 222px;
+
+        .line {
+          display: flex;
+          align-items: center;
+          font-size: 12px;
+          height: 33px;
+          color: #D2E0FF;
+          width: 100%;
+
+          .time_wrap {
+            display: flex;
+            align-items: center;
+            width: 52px;
+            color: #FFFFFF;
+
+            .time {
+              width: 40px;
+              height: 18px;
+              line-height: 18px;
+              text-align: center;
+              background: #00A68E;
+              border-radius: 2px;
+            }
+
+            .sp {
+              width: 10px;
+              height: 1px;
+              background: #00A68E;
+            }
+
+            .dian {
+              width: 4px;
+              height: 4px;
+              border-radius: 50%;
+              background: #00A68E;
+            }
+          }
+
+          .id_card {
+            flex: 6;
+            margin-left: 12px;
+          }
+
+          .status {
+            flex: 5;
+          }
+
+          .desc {
+            flex: 9;
+          }
+        }
+      }
+
     }
 
     .right_box_two {
@@ -647,6 +1124,7 @@
                   margin-bottom: 4px;
                   display: flex;
                   align-items: center;
+
                   .xf {
                     width: 14px;
                     height: 14px;
@@ -779,6 +1257,10 @@
       margin: 0 6px;
     }
 
+    .tab {
+      cursor: pointer;
+    }
+
     .active {
       color: #0094eb;
     }

--
Gitblit v1.9.3