yangjunjing 5 년 전
부모
커밋
24b8fd7292
3개의 변경된 파일132개의 추가작업 그리고 118개의 파일을 삭제
  1. 7 1
      src/components/ledger/report/datafan.vue
  2. 46 46
      src/views/ledger/report/index.vue
  3. 79 71
      src/views/model/report/index.vue

+ 7 - 1
src/components/ledger/report/datafan.vue

@@ -18,11 +18,17 @@ import fanChart from "@/components/echarts/fanChart"
 export default {
   data() {
     return {
-      echartsData: []
+      echartsData: [],
+      color: ["#AB7948", "#CAA679", "#DEC9A8", "#B3CFC4", "#7DAAA7", "#7484A6", "#9DABCB"]
     }
   },
   created() {
     this.echartsData = this.renderData.needCountO;
+    // this.echartsData.forEach((item, index) => {
+    //   item.itemStyle = {
+    //     color: this.color[index]
+    //   }
+    // })
   },
   components: {
     fanChart

+ 46 - 46
src/views/ledger/report/index.vue

@@ -56,7 +56,7 @@
       </div>
       <div class="data business-space" v-if="zoneSpaceCount">
         <span class="contain-title">业务空间<i>{{`(${zoneSpaceCount?zoneSpaceCount:'0'})`}}</i></span>
-        <div class="data-show" v-if="business.length">
+        <div class="data-show" v-if="business&&business.length">
           <div v-for="(item,index) in business" :key="index" class="show-content">
             <datafan :id="'datafan' + index" :renderData="item"></datafan>
           </div>
@@ -122,10 +122,10 @@ export default {
       notSyncDataCount: null,// 不能同步到物理世界的关系数据
       postRelationInforCount: null,// 岗位和关联的资产信息点值不一致
       equipCount: null,// 设备总数
-      equipment: null,// 设备数据
+      equipment: [],// 设备数据
       assetsCount: null,// 资产总数
-      assets: null,// 资产数据
-      parts: null,// 部件数据
+      assets: [],// 资产数据
+      parts: [],// 部件数据
       partsCount: null,// 部件总数
       zoneSpaceCount: null,// 业务空间总数
       zoneType: [// 分区类型
@@ -191,19 +191,18 @@ export default {
         }
       ],
       partProtion: [],// 业务空间-各分区占比数据
-      defaultPart: null,// 业务空间-默认分区功能类型占比数据
-      business: null,// 业务空间数据
+      defaultPart: [],// 业务空间-默认分区功能类型占比数据
+      business: [],// 业务空间数据
       systemCount: null,// 系统总数
-      system: null,// 系统数据
+      system: [],// 系统数据
       rentantCount: null,// 租户总数
-      tenant: null,// 租户数据
+      tenant: [],// 租户数据
       shaftCount: null,// 竖井总数
-      shaft: null,// 竖井数据
+      shaft: [],// 竖井数据
       ShaftFunType: null,// 竖井功能类型
       shaftPartProtion: null,// 竖井-按功能类型占比数据
       params: null,
-      isLoading: false,
-      // color: ["#3485d6", "#a384fc", "#4caf50", "#ff6316", "#fd8bbe", "#03a9f3", "#ea615b"]
+      isLoading: false
     }
   },
   components: {
@@ -243,9 +242,6 @@ export default {
             name: item.Name,
             value: item.Count
           });
-          // this.defaultPart.map((item, index) => {
-          //   item.itemStyle = {color:this.color}
-          // })
         }
         if (it.Content) {
           this.functionTypeTranstion(item, it.Content)
@@ -323,7 +319,6 @@ export default {
       })
     },
     getEquipOtherCount() {// 获取设备数据
-      this.equipment = [];
       // 未关联资产
       let param = {
         ProjectId: this.projectId,
@@ -396,7 +391,6 @@ export default {
       })
     },
     getAssetsCount() {// 获取资产数据
-      this.assets = [];
       countProperty(this.params, res => {
         // 获取资产总数
         this.assetsCount = res.Count;
@@ -501,26 +495,30 @@ export default {
         this.defaultPart = [];
         let res1 = response[0]
         let res2 = response[1]
-        res1.Content.forEach(item => {
-          this.zoneTypeConversion(item);
-          this.partProtion.push({
-            name: item.Name,
-            value: item.Count
+        if (res1.Content.length) {
+          res1.Content.forEach(item => {
+            this.zoneTypeConversion(item);
+            this.partProtion.push({
+              name: item.Name,
+              value: item.Count
+            })
           })
-        })
-        this.business.push({
-          title: '各分区占比',
-          tips: '各类型分区实例数量与实例总数占比',
-          needCountO: this.partProtion,
-        })
-        res2.Content.forEach(item => {
-          this.functionTypeTranstion(item, this.functionType);
-        })
-        this.business.push({
-          title: '默认分区功能类型占比',
-          tips: '默认分区实例的功能区类型占比',
-          needCountO: this.defaultPart,
-        })
+          this.business.push({
+            title: '各分区占比',
+            tips: '各类型分区实例数量与实例总数占比',
+            needCountO: this.partProtion,
+          })
+        }
+        if (res2.Content.length) {
+          res2.Content.forEach(item => {
+            this.functionTypeTranstion(item, this.functionType);
+          })
+          this.business.push({
+            title: '默认分区功能类型占比',
+            tips: '默认分区实例的功能区类型占比',
+            needCountO: this.defaultPart,
+          })
+        }
       })
     },
     getSystemCount() {// 获取系统数据
@@ -580,18 +578,20 @@ export default {
         let res = response[0];
         let res1 = response[1];
         this.shaftPartProtion = [];
-        res.Content.forEach(item => {
-          this.shaftFunTypeTranstion(item);
-          this.shaftPartProtion.push({
-            name: item.Name,
-            value: item.Count
+        if (res.Content.length) {
+          res.Content.forEach(item => {
+            this.shaftFunTypeTranstion(item);
+            this.shaftPartProtion.push({
+              name: item.Name,
+              value: item.Count
+            })
           })
-        })
-        this.shaft.push({
-          title: '按功能类型占比',
-          tips: '竖井实例的竖井功能占比',
-          needCountO: this.shaftPartProtion,
-        })
+          this.shaft.push({
+            title: '按功能类型占比',
+            tips: '竖井实例的竖井功能占比',
+            needCountO: this.shaftPartProtion,
+          })
+        }
 
         let text = this.toPercent(res1.Count / this.shaftCount);
         this.shaft.push({

+ 79 - 71
src/views/model/report/index.vue

@@ -28,7 +28,8 @@
         <div class="button">
           <el-link :underline="false" @click="del">需从模型中删除的设备</el-link>
           <el-link @click="supplement" :underline="false">模型待补充的设备</el-link>
-          <el-link @click='getExportReport' :underline="false">导出模型问题报告</el-link>
+          <el-button type="info" :loading="load" @click='getExportReport' style="border:1px solid #dcdfe6;color:#606266;background:white;">导出模型问题报告
+          </el-button>
         </div>
         <div class="table" :style="tableList&&tableList.length?'width: 100%;height: calc(100% - 47px)':'width: 100%;height: calc(100% - 10px)'">
           <el-table ref="multipleTable" :data="tableData" stripe height="100%" :header-cell-style="headerStyle" v-loading='loading'>
@@ -55,56 +56,56 @@
               <template slot-scope="scope">
                 <el-badge :value="scope.row.ElementRangeCheck" class="item" type='danger' v-if="scope.row.ElementRangeCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.ElementRangeCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.ElementRangeCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="FamilyNameCheck" label='设备族编码检查' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.FamilyNameCheck" class="item" type='danger' v-if="scope.row.FamilyNameCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.FamilyNameCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.FamilyNameCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="EquipPartLocationCheck" label='部件所在位置检查' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.EquipPartLocationCheck" class="item" type='danger' v-if="scope.row.EquipPartLocationCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.EquipPartLocationCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.EquipPartLocationCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="ColumnCheck" label='柱边界检查' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.ColumnCheck" class="item" type='danger' v-if="scope.row.ColumnCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.ColumnCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.ColumnCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="ConnectorCheck" label='连接件检查' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.ConnectorCheck" class="item" type='danger' v-if="scope.row.ConnectorCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.ConnectorCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.ConnectorCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="SystemNameCheck" label='系统类型名称检查' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.SystemNameCheck" class="item" type='danger' v-if="scope.row.SystemNameCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.SystemNameCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.SystemNameCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="EquipInSpaceCheck" label='未在空间中的设备' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.EquipInSpaceCheck" class="item" type='danger' v-if="scope.row.EquipInSpaceCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.EquipInSpaceCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.EquipInSpaceCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="PipeCheck" label='管段检查' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.PipeCheck" class="item" type='danger' v-if="scope.row.PipeCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.PipeCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.PipeCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="SystemReferEquipCheck" label='管网及相关设备检查' width="200">
@@ -112,21 +113,21 @@
                 <el-badge :value="scope.row.SystemReferEquipCheck" class="item" :type='scope.row.SystemReferEquipCheck?"danger":"success"'
                   v-if="scope.row.SystemReferEquipCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.SystemReferEquipCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.SystemReferEquipCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="ParameterIntegrityCheck" label='Revit族参数完整性检查' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.ParameterIntegrityCheck" class="item" type='danger' v-if="scope.row.ParameterIntegrityCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.ParameterIntegrityCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.ParameterIntegrityCheck"></i>
               </template>
             </el-table-column>
             <el-table-column prop="XyzOverlapCheck" label='xyz坐标重叠检查' width="200">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.XyzOverlapCheck" class="item" type='danger' v-if="scope.row.XyzOverlapCheck">
                 </el-badge>
-                <i class="icon el-icon-check" v-if="!scope.row.XyzOverlapCheck"></i>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="!scope.row.XyzOverlapCheck"></i>
               </template>
             </el-table-column>
             <template slot="empty">
@@ -152,6 +153,7 @@ import request from "@/api/model/file.js";
 import { exportReport, queryFloorList, queryModel, queryReportList, queryLostReportList } from "@/api/model/report.js";
 import { getToBeDelEquip, getSupplement } from "@/api/scan/request.js";
 import axios from 'axios'
+import { resolve } from 'q';
 export default {
   components: {
     dasBoard
@@ -177,6 +179,7 @@ export default {
         total: 0
       },
       loading: false,
+      load: false,
       floorIconType: null,
     }
   },
@@ -192,19 +195,6 @@ export default {
     ...mapGetters('layout', ['projectId'])
   },
   methods: {
-    getModelFileCount() {// 获取项目下所有模型文件夹
-      queryModel(this.params, res => {
-        this.ModelFileCount = res.Content.length;
-        this.tableList = res.Content;
-        if (this.tableList.length) {
-          this.tableList.forEach((item, index) => {
-            item.Code = item.Id;
-          })
-          this.activeTab = this.tableList[0].Code;// 默认选中第一个模型文件夹
-        }
-        this.getModelFloor();
-      });
-    },
     getModelFloorCount() {// 获取楼层模型文件数量,计算出检查出问题的模型文件
       let promise1 = new Promise(resolve => {
         queryFloorList(this.params, res => {
@@ -238,7 +228,20 @@ export default {
     getData(tab) {// 切换tab时执行
       this.getModelFloor();
     },
-    getModelFloor() {// 获取当前楼层下的模型楼层
+    getModelFileCount() {// 获取项目下所有模型文件夹
+      queryModel(this.params, res => {
+        this.ModelFileCount = res.Content.length;
+        this.tableList = res.Content;
+        if (this.tableList && this.tableList.length) {
+          this.tableList.forEach((item, index) => {
+            item.Code = item.Id;
+          })
+          this.activeTab = this.tableList[0].Code;// 默认选中第一个模型文件夹
+        }
+        this.getModelFloor();
+      });
+    },
+    getModelFloor() {// 获取当前楼层下的模型楼层和各个检查项的数据
       let params = {
         ProjectId: this.projectId,
         Id: `${this.activeTab}`,
@@ -247,77 +250,91 @@ export default {
       }
       queryReportList(params, res => {
         this.FloorName = res.Content;
+        this.tableData = [];
         if (this.FloorName && this.FloorName.length) {
+          this.loading = true;
           let i = 0;
           this.FloorName.forEach(item => {
             item.questionItem = 0;
             for (let key in item) {
-              if (item[key] > 0 && key !== "toBeDel" && key !== 'toBeSupplement' && key !== "FloorName" && key !== "questionItem") {
+              if (item[key] > 0 && key !== "FloorName" && key !== "questionItem") {
                 i += 1;
                 item.questionItem += 1;
               }
             }
           })
           this.floorIconType = i;
-          this.getLostModelFloor();
         }
+        this.getLostModelFloor();
       })
     },
     getLostModelFloor() {// 获取缺失楼层
       let params = {
         ProjectId: this.projectId,
-        Filters: `FolderId='${this.activeTab}';Status=4`,
-        PageNumber: this.page.pageNumber,
-        PageSize: this.page.pageSize
+        Filters: `FolderId='${this.activeTab}';Status=4`
       }
       queryLostReportList(params, res => {
-        let that = this;
         this.LostFloorName = res.Content;
-        if (this.FloorName && this.LostFloorName) {
-          this.LostFloorName.forEach((item, index) => {
-            if (!item.FolderId) {
-              item.FloorName = `${item.Note + item.FloorName}`
-              that.FloorName.splice(index, 0, item);
-            }
-          })
-          this.getToBeCount();
-          this.tableData = this.FloorName;
-        } else {
-          this.tableData = [];
-        }
+        this.getToBeCount();
       })
     },
     getToBeCount() {// 根据模型ID获取待删除数量和待补充数量
-      let that = this;
-      let ary = [];
-      this.LostFloorName.forEach((item, index) => {
+      let equipComDelList = [];
+      this.LostFloorName.forEach(item => {
         if (item.CurrentModelId) {
-          ary.push({
+          equipComDelList.push({
             ModelId: item.CurrentModelId
-          })
+          });
+        } else {
+          item.FloorName = `${item.Note + item.FloorName}`
         }
       })
       let params = {
         ProjectId: this.projectId,
-        data: ary
+        data: equipComDelList
       }
-      getToBeDelEquip(params, res => {// 获取待删除储量
-        res.Content.forEach((item, index) => {
+      let promise1 = new Promise(resolve => {
+        getToBeDelEquip(params, res => {
+          resolve(res);
+        })
+      })
+      let promise2 = new Promise(resolve => {
+        getSupplement(params, res => {
+          resolve(res);
+        })
+      })
+      Promise.all([promise1, promise2]).then(response => {
+        let res = response[0];
+        let res1 = response[1];
+        res.Content.forEach(item => {
           this.LostFloorName.forEach(it => {
             if (item.ModelId === it.CurrentModelId) {
               it.toBeDel = item.Count;
             }
           })
         })
-      })
-      getSupplement(params, res => {// 获取待补充数量
-        res.Content.forEach((item, index) => {
+        res1.Content.forEach(item => {
           this.LostFloorName.forEach(it => {
             if (item.ModelId === it.CurrentModelId) {
               it.toBeSupplement = item.Count;
             }
           })
         })
+        if (this.LostFloorName && this.LostFloorName.length) {
+          this.LostFloorName.forEach(item => {
+            this.FloorName.forEach(it => {
+              if (item.FloorName === it.FloorName) {
+                for (let key in it) {
+                  item[key] = it[key];
+                }
+              }
+            })
+          })
+          this.tableData = this.LostFloorName;
+        } else {
+          this.tableData = [];
+        }
+        this.loading = false;
       })
     },
     del() {// 点击需从模型中删除的设备  
@@ -330,6 +347,7 @@ export default {
     },
     getExportReport() {// 导出模型问题报告
       let that = this;
+      this.load = true;
       axios({
         method: 'post',
         url: `/modelapi/report/non-blocking`,
@@ -344,7 +362,7 @@ export default {
       }).then(function (res) {
         if (res.data.type == 'application/vnd.ms-excel') {
           let blob = new Blob([res.data], { type: 'application/vnd.ms-excel;charset=utf-8' });
-          let fileName = res.headers['content-disposition'];
+          let fileName = decodeURI(res.headers['content-disposition']);
           if (fileName)
             fileName = fileName.substring(fileName.indexOf('=') + 1);
           if ('download' in document.createElement('a')) { // 非IE下载
@@ -356,14 +374,17 @@ export default {
             elink.click()
             URL.revokeObjectURL(elink.href) // 释放URL 对象
             document.body.removeChild(elink)
+            that.load = false;
           } else { // IE10+下载
             navigator.msSaveBlob(blob, fileName)
+            that.load = false;
           }
         } else {
           let reader = new FileReader()
           reader.onload = e => {
             if (e.target.readyState === 2) {
               let res = {}
+              that.load = false;
               res = JSON.parse(e.target.result)
               that.$message.error(res.Message);
             }
@@ -372,13 +393,11 @@ export default {
         }
       })
     },
-    // 切换每页显示数量
-    handleSizeChange(val) {
+    handleSizeChange(val) {// 切换每页显示数量
       this.page.pageSize = val;
       this.getModelFloor();
     },
-    // 切换页码
-    handleCurrentChange(val) {
+    handleCurrentChange(val) {// 切换页码
       this.page.pageNumber = val;
       this.getModelFloor();
     },
@@ -442,15 +461,4 @@ export default {
 .error-color {
   color: #f56c6c;
 }
-.icon {
-  width: 20px;
-  height: 20px;
-  border-radius: 50%;
-  background: #67c23a;
-  text-align: center;
-  vertical-align: middle;
-  color: white;
-  padding-top: 4px;
-  box-sizing: border-box;
-}
 </style>