yusheng 3 недель назад
Родитель
Сommit
92b71085c2
2 измененных файлов с 69 добавлено и 40 удалено
  1. 11 0
      src/api/equipment/index.js
  2. 58 40
      src/views/bpm/vis-page/index2.vue

+ 11 - 0
src/api/equipment/index.js

@@ -21,6 +21,17 @@ export async function statisticsDeviceStatus(params) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+// 大屏数据统计
+export async function getProductionDeviceCategoryStats(params) {
+  const res = await request.get('/eam/workorder/getProductionDeviceCategoryStats', {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 大屏数据统计 new
 export async function screenSubstanceGroupQuery(params) {
   const res = await request.get('/eam/workorder/screenSubstanceGroupQuery', {

+ 58 - 40
src/views/bpm/vis-page/index2.vue

@@ -55,15 +55,16 @@
           </div>
         </div>
         <div class="echartsList">
-          <div>
+          <div v-for="(item, index) in deviceList">
+            <div class="space" v-if="index % 2 === 1"></div>
             <div class="echarts_title"
-              >混合料设备总台数<span> {{ totalData.mixedDeviceNum }} </span
-              >台</div
+              >{{ item.categoryName
+              }}<span> {{ item.totalCount }} </span>台</div
             >
-            <div class="echarts_box" ref="pie3d_3"></div>
-            <div class="space"></div>
+            <div class="echarts_box" :ref="'pie3d_' + index"></div>
+            <div class="space" v-if="index % 2 === 0"></div>
           </div>
-          <div>
+          <!-- <div>
             <div class="space"></div>
             <div class="echarts_title"
               >成型设备总台数<span> {{ totalData.moldingDeviceNum }} </span
@@ -94,7 +95,7 @@
               >台</div
             >
             <div class="echarts_box" ref="pie3d_2"></div>
-          </div>
+          </div> -->
         </div>
       </div>
       <div class="table_bar">
@@ -120,7 +121,11 @@
   import dvBorderContent from './dv-border-content.vue';
   import * as echarts from 'echarts';
   import { component } from 'vue-fullscreen';
-  import { getRepairWorkList, statisticsDeviceStatus } from '@/api/equipment';
+  import {
+    getRepairWorkList,
+    statisticsDeviceStatus,
+    getProductionDeviceCategoryStats
+  } from '@/api/equipment';
   export default {
     name: 'index',
     components: {
@@ -174,7 +179,7 @@
               this.initData(true);
               // statisticsDeviceStatus().then((data) => {
               //   console.log(data);
-              //   this.totalData = data;
+              // this.totalData = data;
               //   this.initCircle(
               //     this.$refs.pie3d_1,
               //     data.deepAddingDeviceNum,
@@ -296,6 +301,7 @@
     },
     data() {
       return {
+        deviceList: [],
         timer: null,
         totalData: {
           repairNum: ''
@@ -393,39 +399,51 @@
       initData(isLoad) {
         // 改变图表台数
         statisticsDeviceStatus().then((data) => {
-          console.log(this.totalData.repairNum);
-          console.log(data.repairNum);
+          // console.log(this.totalData.repairNum);
+          // console.log(data.repairNum);
           this.totalData = data;
-          this.initCircle(
-            this.$refs.pie3d_1,
-            data.deepAddingDeviceNum,
-            data.deepAddingDeviceNum1
-          );
-          this.initCircle(
-            this.$refs.pie3d_2,
-            data.inspectionDeviceNum,
-            data.inspectionDeviceNum1
-          );
-          this.initCircle(
-            this.$refs.pie3d_3,
-            data.mixedDeviceNum,
-            data.mixedDeviceNum1
-          );
-          this.initCircle(
-            this.$refs.pie3d_4,
-            data.moldingDeviceNum,
-            data.moldingDeviceNum1
-          );
-          this.initCircle(
-            this.$refs.pie3d_5,
-            data.sinteringDeviceNum,
-            data.sinteringDeviceNum1
-          );
-          // 改变滚动列表数据
+          // this.initCircle(
+          //   this.$refs.pie3d_1,
+          //   data.deepAddingDeviceNum,
+          //   data.deepAddingDeviceNum1
+          // );
+          // this.initCircle(
+          //   this.$refs.pie3d_2,
+          //   data.inspectionDeviceNum,
+          //   data.inspectionDeviceNum1
+          // );
+          // this.initCircle(
+          //   this.$refs.pie3d_3,
+          //   data.mixedDeviceNum,
+          //   data.mixedDeviceNum1
+          // );
+          // this.initCircle(
+          //   this.$refs.pie3d_4,
+          //   data.moldingDeviceNum,
+          //   data.moldingDeviceNum1
+          // );
+          // this.initCircle(
+          //   this.$refs.pie3d_5,
+          //   data.sinteringDeviceNum,
+          //   data.sinteringDeviceNum1
+          // );
+          // // 改变滚动列表数据
           this.getSalesFinishList();
         });
+        getProductionDeviceCategoryStats().then((res) => {
+          this.deviceList = res;
+          this.$nextTick(() => {
+            this.deviceList.forEach((item, index) => {
+              this.initCircle(
+                this.$refs['pie3d_' + index][0],
+                item.totalCount,
+                item.repairCount
+              );
+            });
+          });
+        });
       },
-      initCircle(ref, total, repairNum) {
+      initCircle(ref, total, repairCount) {
         let rightChart2 = echarts.init(ref);
         let option = {
           legend: {
@@ -491,11 +509,11 @@
               },
               data: [
                 {
-                  value: total - repairNum,
+                  value: total - repairCount,
                   name: '运行数量'
                 },
                 {
-                  value: repairNum,
+                  value: repairCount,
                   name: '维修数量'
                 }
               ],