Browse Source

车辆汇总-测试

Shan9312 8 months ago
parent
commit
b5080a3278
2 changed files with 22 additions and 24 deletions
  1. 11 11
      src/router/index.js
  2. 11 13
      src/views/report/vehiclRateTotal/index.vue

+ 11 - 11
src/router/index.js

@@ -79,17 +79,17 @@ export const constantRoutes = [
   //   }]
   // },
 
-  {
-    path: '/vehiclRateTotal',
-    component: Layout,
-    redirect: '/vehiclRateTotal',
-    children: [{
-      path: 'vehiclRateTotal',
-      name: 'VehiclRateTotal',
-      component: () => import('@/views/report/vehiclRateTotal/index.vue'),
-      meta: { title: '车辆运转率总览', icon: '', affix: true }
-    }]
-  }
+  // {
+  //   path: '/vehiclRateTotal',
+  //   component: Layout,
+  //   redirect: '/vehiclRateTotal',
+  //   children: [{
+  //     path: 'vehiclRateTotal',
+  //     name: 'VehiclRateTotal',
+  //     component: () => import('@/views/report/vehiclRateTotal/index.vue'),
+  //     meta: { title: '车辆运转率总览', icon: '', affix: true }
+  //   }]
+  // }
 
 ]
 

+ 11 - 13
src/views/report/vehiclRateTotal/index.vue

@@ -182,12 +182,12 @@ export default {
     this.getWorks()
   },
   methods: {
-    tableRowClassName({row, rowIndex}) {
-        if (row.isFirst == true) {
-          return 'success-row'
-        }
-        return ''
-      },
+    tableRowClassName({ row }) {
+      if (row.ttype == -1) {
+        return 'success-row'
+      }
+      return ''
+    },
     // 给数组分第一个值打标签
     markFirstObjectByName(data) {
       // Step 1: Categorize by name
@@ -213,8 +213,8 @@ export default {
         }
       }
 
-   return result
-},
+      return result
+    },
 
     // 获取工作类别的数据
     async getWorks() {
@@ -249,10 +249,8 @@ export default {
               item.sort = index + 1
               item.runningRate = `${item.runningRate}%`
             })
-        const arr= JSON.parse(JSON.stringify(data.list))
-        this.total = data.total
-        this.tableData = this.markFirstObjectByName(arr);
-        console.log(this.tableData,'this.tableData')
+            this.tableData= JSON.parse(JSON.stringify(data.list))
+            this.total = data.total
       }
       this.loading = false
     },
@@ -297,7 +295,7 @@ export default {
             sheetName: 'SheetJS'
           }
         ]
-        json2excel(elecExcelDatas, '车辆运转率', true, 'xlsx')
+        json2excel(elecExcelDatas, '车辆运转率汇总', true, 'xlsx')
       })
     },