浏览代码

报告、辅助屏修改

yangjunjing 5 年之前
父节点
当前提交
70f3291745

+ 3 - 3
src/api/model/report.js

@@ -4,9 +4,9 @@ import axios from 'axios'
 const baseUrl = '/modelapi';
 
 // 导出模型问题报告
-export function exportReport(params, success) {
-    httputils.postJson(`${baseUrl}/upload-json-zip/upload`, params, success)
-}
+// export function exportReport(params, success) {
+//     httputils.postJson(`${baseUrl}/report/non-blocking`, params, success)
+// }
 
 // 查询楼层列表
 export function queryFloorList(params, success) {

+ 14 - 0
src/api/scan/request.js

@@ -885,6 +885,20 @@ export function getEquipTableCon(param, success) {
     http.postJson(url, param, success)
 }
 
+//根据模型id查询待删除的设备数量
+export function getToBeDelEquip(param, success) {
+    let url = `${baseUrl}/equip-component/equip-query/equip-del-com`;
+    let data = param.data;
+    http.postJson(url, data, success)
+}
+
+//根据模型id查询待补充的设备数量
+export function getSupplement(param, success) {
+    let url = `${baseUrl}/equip-component/equip-query/equip-supply`;
+    let data = param.data;
+    http.postJson(url, data, success)
+}
+
 //设备清单-查询当前设备下的部件分类
 export function getEquipPartsType(param, success) {
     let url = `${baseUrl}/equip-component/equip-query/components-count`;

+ 6 - 3
src/components/business_space/newTables/eqToSpaceTable.vue

@@ -7,7 +7,7 @@
       </el-tooltip>
     </el-row>
     <div class="table-box">
-      <el-table :data="tableData" style="width: 100%" height="100%" :header-cell-style="headerStyle"  v-loading="loading">
+      <el-table :data="tableData" style="width: 100%" height="100%" :header-cell-style="headerStyle" v-loading="loading">
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
@@ -158,13 +158,16 @@ export default {
       this.$refs.addEqDialog.floor = [this.params.BuildingId, this.params.FloorId];
       this.$refs.addEqDialog.showDialog()
     },
-    changeContentStyle(){
-      this.$route.name == "spaceLedger"?this.hidden = false:this.hidden = true;
+    changeContentStyle() {
+      this.$route.name == "spaceLedger" ? this.hidden = false : this.hidden = true;
     }
   },
   watch: {
     type() {
       this.getTableData()
+    },
+    params() {
+      this.getTableData()
     }
   }
 };

+ 3 - 0
src/components/business_space/newTables/syInSpaceTable.vue

@@ -129,6 +129,9 @@ export default {
   watch: {
     type() {
       this.getTableData()
+    },
+    params() {
+      this.getTableData()
     }
   }
 };

+ 25 - 28
src/views/ledger/report/index.vue

@@ -122,10 +122,10 @@ export default {
       notSyncDataCount: null,// 不能同步到物理世界的关系数据
       postRelationInforCount: null,// 岗位和关联的资产信息点值不一致
       equipCount: null,// 设备总数
-      equipment: [],// 设备数据
+      equipment: null,// 设备数据
       assetsCount: null,// 资产总数
-      assets: [],// 资产数据
-      parts: [],// 部件数据
+      assets: null,// 资产数据
+      parts: null,// 部件数据
       partsCount: null,// 部件总数
       zoneSpaceCount: null,// 业务空间总数
       zoneType: [// 分区类型
@@ -191,19 +191,19 @@ export default {
         }
       ],
       partProtion: [],// 业务空间-各分区占比数据
-      defaultPart: [],// 业务空间-默认分区功能类型占比数据
-      business: [],// 业务空间数据
+      defaultPart: null,// 业务空间-默认分区功能类型占比数据
+      business: null,// 业务空间数据
       systemCount: null,// 系统总数
-      system: [],// 系统数据
+      system: null,// 系统数据
       rentantCount: null,// 租户总数
-      tenant: [],// 租户数据
+      tenant: null,// 租户数据
       shaftCount: null,// 竖井总数
-      shaft: [],// 竖井数据
+      shaft: null,// 竖井数据
       ShaftFunType: null,// 竖井功能类型
-      shaftPartProtion: [],// 竖井-按功能类型占比数据
+      shaftPartProtion: null,// 竖井-按功能类型占比数据
       params: null,
       isLoading: false,
-      color: ["#3485d6", "#a384fc", "#4caf50", "#ff6316", "#fd8bbe", "#03a9f3", "#ea615b"]
+      // color: ["#3485d6", "#a384fc", "#4caf50", "#ff6316", "#fd8bbe", "#03a9f3", "#ea615b"]
     }
   },
   components: {
@@ -262,7 +262,9 @@ export default {
         }
       }
       getDataDictionary(params, res => {
-        this.functionType = JSON.parse(res.Content[0].DataSource)
+        if (res.Content.length) {
+          this.functionType = JSON.parse(res.Content[0].DataSource)
+        }
         this.getZoneSpaceCount();
       })
     },
@@ -362,10 +364,10 @@ export default {
         this.equipment.push({
           title: '未关联资产',
           tips: '设备未关联资产数量',
-          contentValueO: '关联',
-          contentValueT: '关联',
-          needCountO: res.Count,
-          needCountT: this.equipCount - res.Count,
+          contentValueO: '关联',
+          contentValueT: '关联',
+          needCountO: this.equipCount - res.Count,
+          needCountT: res.Count,
           text: `总数${this.equipCount}`
         })
 
@@ -441,11 +443,11 @@ export default {
         this.assets.push({
           title: '未关联资产',
           tips: '资产未关联设备数量',
-          contentValueO: '关联',
-          contentValueT: '关联',
+          contentValueO: '关联',
+          contentValueT: '关联',
           text: `总数${this.assetsCount}`,
-          needCountO: res1.Count,
-          needCountT: this.assetsCount - res1.Count
+          needCountO: this.assetsCount - res1.Count,
+          needCountT: res1.Count
         })
 
         let text = res1.Count / this.assetsCount;
@@ -472,12 +474,6 @@ export default {
           needCountT: this.assetsCount - res2.Count
         })
       })
-
-
-
-      countProperty(pa, res => {
-
-      })
     },
     getPartsCount() {// 获取部件数据
       queryPart(this.params, res => {
@@ -501,6 +497,8 @@ export default {
       })
       Promise.all([promise1, promise2]).then(response => {
         this.business = [];
+        this.partProtion = [];
+        this.defaultPart = [];
         let res1 = response[0]
         let res2 = response[1]
         res1.Content.forEach(item => {
@@ -543,6 +541,7 @@ export default {
         })
       })
       Promise.all([promise]).then(response => {
+        this.tenant = [];
         let res = response[0];
         this.tenant = [];
         let text = res.Count / this.rentantCount;
@@ -564,7 +563,6 @@ export default {
       // 获取竖井总数
       queryCenoteCount(this.params, res => {
         this.shaftCount = res.Count;
-        console.log(this.shaftCount, 1)
       })
 
       let promise1 = new Promise((resolve) => {
@@ -581,6 +579,7 @@ export default {
         this.shaft = [];
         let res = response[0];
         let res1 = response[1];
+        this.shaftPartProtion = [];
         res.Content.forEach(item => {
           this.shaftFunTypeTranstion(item);
           this.shaftPartProtion.push({
@@ -609,8 +608,6 @@ export default {
   },
   watch: {
     projectId(n, o) {
-      console.log(n)
-      console.log(o)
       this.params = {
         ProjectId: this.projectId
       }

+ 157 - 68
src/views/model/report/index.vue

@@ -17,7 +17,7 @@
           <template v-for="(item,index) in tableList">
             <el-tab-pane :name="item.Code" :key="index" :label="item.Name">
               <span slot="label">
-                <i :class="floorIconType?'msg-icon el-icon-error error-color':'msg-icon el-icon-success success-color'" style="font-size:14px;"></i>
+                <i :class="item.flag?'msg-icon el-icon-success success-color':'msg-icon el-icon-error error-color'" style="font-size:14px;"></i>
                 <span>{{ item.Name }}</span>
               </span>
             </el-tab-pane>
@@ -27,10 +27,10 @@
       <div class="content-box">
         <div class="button">
           <el-link :underline="false" @click="del">需从模型中删除的设备</el-link>
-          <el-link href="" @click="supplement" :underline="false" type="info">模型待补充的设备</el-link>
-          <el-link href="" download="" :underline="false" type="info">导出模型问题报告</el-link>
+          <el-link @click="supplement" :underline="false">模型待补充的设备</el-link>
+          <el-link @click='getExportReport' :underline="false">导出模型问题报告</el-link>
         </div>
-        <div class="table" style="width: 100%;height: calc(100% - 47px)">
+        <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'>
             <el-table-column prop="FloorName" label="模型楼层" fixed width="150"></el-table-column>
             <el-table-column prop="functionNo" label="待删除设备数量" fixed width="150">
@@ -39,7 +39,7 @@
                 </el-badge>
               </template>
             </el-table-column>
-            <el-table-column prop="" label="待补充设备数量" fixed width="150">
+            <el-table-column prop="toBeSupplement" label="待补充设备数量" fixed width="150">
               <template slot-scope="scope">
                 <el-badge :value="scope.row.toBeSupplement" class="item" :type='scope.row.toBeSupplement?"danger":"success"'>
                 </el-badge>
@@ -53,8 +53,9 @@
             </el-table-column>
             <el-table-column prop="ElementRangeCheck" label='构件范围检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.ElementRangeCheck" class="item" :type='scope.row.ElementRangeCheck?"danger":"success"'>
+                <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>
               </template>
             </el-table-column>
             <el-table-column prop="FamilyNameCheck" label='设备族编码检查' width="200">
@@ -80,51 +81,56 @@
             </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="ConnectorCheck">
+                <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>
               </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='scope.row.SystemNameCheck?"danger":"success"'>
+                <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>
               </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='scope.row.EquipInSpaceCheck?"danger":"success"'>
+                <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>
               </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='scope.row.PipeCheck?"danger":"success"'>
+                <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>
               </template>
             </el-table-column>
             <el-table-column prop="SystemReferEquipCheck" label='管网及相关设备检查' width="200">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.SystemReferEquipCheck" class="item" :type='scope.row.SystemReferEquipCheck?"danger":"success"'>
+                <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>
               </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="ParameterIntegrityCheck">
+                <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>
               </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="XyzOverlapCheck">
+                <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>
               </template>
             </el-table-column>
             <template slot="empty">
-              <div style="height: 60%;transform: translate(-22%,50%);">
+              <div style="height: 60%;transform: translate(-40%,50%);">
                 <i class="icon-wushuju iconfont"></i>
                 数据暂无
               </div>
@@ -144,6 +150,8 @@ import { mapGetters } from "vuex";
 import dasBoard from "@/views/dasboard/index";
 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'
 export default {
   components: {
     dasBoard
@@ -169,13 +177,7 @@ export default {
         total: 0
       },
       loading: false,
-      lostFloort: {
-        ary: [],
-        Bary: [],
-        Fary: [],
-        regex: /^(B||F)(\d)/
-      },
-      floorIconType: null
+      floorIconType: null,
     }
   },
   mounted() { },
@@ -191,41 +193,49 @@ export default {
   },
   methods: {
     getModelFileCount() {// 获取项目下所有模型文件夹
-      let params = {
-        ProjectId: this.projectId,
-      }
       queryModel(this.params, res => {
         this.ModelFileCount = res.Content.length;
         this.tableList = res.Content;
-        this.tableList.forEach((item, index) => {
-          item.Code = item.Id;
-        })
-        this.activeTab = this.tableList[0].Code;// 默认选中第一个模型文件夹
-        this.getExportReport();
+        if (this.tableList.length) {
+          this.tableList.forEach((item, index) => {
+            item.Code = item.Id;
+          })
+          this.activeTab = this.tableList[0].Code;// 默认选中第一个模型文件夹
+        }
         this.getModelFloor();
       });
     },
     getModelFloorCount() {// 获取楼层模型文件数量,计算出检查出问题的模型文件
-      queryFloorList(this.params, res => {
+      let promise1 = new Promise(resolve => {
+        queryFloorList(this.params, res => {
+          resolve(res);
+        })
+      })
+      Promise.all([promise1]).then(response => {
+        this.problemCount = 0;
+        let res = response[0];
         this.modelFloorCount = res.Total;
-        res.Content.forEach(item => {
+        this.modelFloor = res.Content;
+        this.getModelFileIcon();
+        this.modelFloor.forEach(item => {
           if (!item.DataCheckResult) {
-            this.problemCount += 1;
+            this.problemCount++;
           }
         })
-      });
+      })
     },
-    getExportReport() {
-      let params = {
-        ProjectId: this.projectId,
-        Id: this.activeTab
-      }
-      // exportReport(params,res => {
-      //   console.log(res,3958)
-      // });
+    getModelFileIcon() {// 计算文件夹的图标
+      this.tableList.forEach(item => {
+        this.modelFloor.forEach(it => {
+          if (item.Code === it.FolderId) {
+            if (!item.DataCheckResult) {
+              item.flag = false;
+            }
+          }
+        })
+      })
     },
     getData(tab) {// 切换tab时执行
-      this.getExportReport();
       this.getModelFloor();
     },
     getModelFloor() {// 获取当前楼层下的模型楼层
@@ -237,52 +247,131 @@ export default {
       }
       queryReportList(params, res => {
         this.FloorName = res.Content;
-        this.getLostModelFloor();
+        if (this.FloorName && this.FloorName.length) {
+          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") {
+                i += 1;
+                item.questionItem += 1;
+              }
+            }
+          })
+          this.floorIconType = i;
+          this.getLostModelFloor();
+        }
       })
     },
-    getLostModelFloor() {
-      let param = {
+    getLostModelFloor() {// 获取缺失楼层
+      let params = {
         ProjectId: this.projectId,
         Filters: `FolderId='${this.activeTab}';Status=4`,
         PageNumber: this.page.pageNumber,
         PageSize: this.page.pageSize
       }
-      queryLostReportList(param, res => {
+      queryLostReportList(params, res => {
         let that = this;
         this.LostFloorName = res.Content;
-        // RFM1
-        this.LostFloorName.forEach((item, index) => {
-          if (!item.FolderId) {
-            item.FloorName = `${item.Note + item.FloorName}`
-            this.FloorName.splice(index, 0, item);
-          }
+        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 = [];
+        }
+      })
+    },
+    getToBeCount() {// 根据模型ID获取待删除数量和待补充数量
+      let that = this;
+      let ary = [];
+      this.LostFloorName.forEach((item, index) => {
+        if (item.CurrentModelId) {
+          ary.push({
+            ModelId: item.CurrentModelId
+          })
+        }
+      })
+      let params = {
+        ProjectId: this.projectId,
+        data: ary
+      }
+      getToBeDelEquip(params, res => {// 获取待删除储量
+        res.Content.forEach((item, index) => {
+          this.LostFloorName.forEach(it => {
+            if (item.ModelId === it.CurrentModelId) {
+              it.toBeDel = item.Count;
+            }
+          })
         })
-        let i = 0;
-        this.FloorName.forEach(item => {
-          item.questionItem = 0;
-          item.toBeDel = 10;
-          item.toBeSupplement = 6;
-          for (let key in item) {
-            if (item[key] > 0) {
-              i += 1;
-              item.questionItem += 1;
+      })
+      getSupplement(params, res => {// 获取待补充数量
+        res.Content.forEach((item, index) => {
+          this.LostFloorName.forEach(it => {
+            if (item.ModelId === it.CurrentModelId) {
+              it.toBeSupplement = item.Count;
             }
-          }
+          })
         })
-        this.floorIconType = i;
-        this.tableData = this.FloorName;
       })
     },
-    del() {
-      // 点击需从模型中删除的设备
+    del() {// 点击需从模型中删除的设备  
       let jumpRouter = this.$router.resolve({ path: '/model/report/deleted' })
       window.open(jumpRouter.href, '_blank')
     },
-    supplement() {
-      // 点击模型待补充的设备
+    supplement() {// 点击模型待补充的设备
       let jumpRouter = this.$router.resolve({ path: '/model/report/supplement' })
       window.open(jumpRouter.href, '_blank')
     },
+    getExportReport() {// 导出模型问题报告
+      let that = this;
+      axios({
+        method: 'post',
+        url: `/modelapi/report/non-blocking`,
+        data: {
+          Id: this.activeTab,
+          ProjectId: this.projectId
+        },
+        headers: {
+          ProjectId: this.projectId
+        },
+        responseType: 'blob'
+      }).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'];
+          if (fileName)
+            fileName = fileName.substring(fileName.indexOf('=') + 1);
+          if ('download' in document.createElement('a')) { // 非IE下载
+            const elink = document.createElement('a')
+            elink.download = fileName
+            elink.style.display = 'none'
+            elink.href = URL.createObjectURL(blob)
+            document.body.appendChild(elink)
+            elink.click()
+            URL.revokeObjectURL(elink.href) // 释放URL 对象
+            document.body.removeChild(elink)
+          } else { // IE10+下载
+            navigator.msSaveBlob(blob, fileName)
+          }
+        } else {
+          let reader = new FileReader()
+          reader.onload = e => {
+            if (e.target.readyState === 2) {
+              let res = {}
+              res = JSON.parse(e.target.result)
+              that.$message.error(res.Message);
+            }
+          }
+          reader.readAsText(res.data)
+        }
+      })
+    },
     // 切换每页显示数量
     handleSizeChange(val) {
       this.page.pageSize = val;

+ 1 - 16
src/views/screen/splitscreen/spaceledger/index.vue

@@ -40,20 +40,6 @@
                   <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${item.key}`" alt="空间图片">
                 </div>
               </div>
-              <div class="space-img" v-if="!spaceDetails.Pic">
-                <!-- <div class="img-box">
-                  <img src="https://hbimg.huabanimg.com/2787ad434fc2bc819a5d7deda3855d897a99d528ab4a-e3HRgR_fw658" alt="空间图片">
-                </div>
-                <div class="img-box">
-                  <img src="https://hbimg.huabanimg.com/5e4e3239dc7eca56eb92ca612d49d824f022b13621d5a-Ga7voM_fw658" alt="空间图片">
-                </div>
-                <div class="img-box">
-                  <img src="https://hbimg.huabanimg.com/60e2a25564f6ac13e7e16a19dcc3e194d565776231347-1Cw8dg_fw658" alt="空间图片">
-                </div>
-                <div class="img-box">
-                  <img src="https://hbimg.huabanimg.com/2ea712954c75ff1b1e13329e7e4209f0691b88945c73-JCmkXX_fw658" alt="空间图片">
-                </div> -->
-              </div>
               <div v-show="!spaceDetails.Pic" style="height:100%;transform: translateY(50%);textAlign:center;">
                 <i class="icon-wushuju iconfont"></i>
                 数据暂无
@@ -282,7 +268,7 @@ export default {
             tools.setDataForKey(
               this.spaceDetails,
               this.tableData[index].Path,
-              this.tableData[index].functionNoDynamicData = item.error ? item.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
+              this.$set(this.tableData[index], "functionNoDynamicData", item.error ? item.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据")
             );
           })
         });
@@ -294,7 +280,6 @@ export default {
     "$route"(to, from) {
       if (this.$route.name === "spaceLedger" && this.$route.query.RoomID && this.$route.query.zone) {
         this.getData();
-        this.activeTab = 'staticData';
       }
     }
   }