瀏覽代碼

Merge branch 'report' into dev

yangjunjing 5 年之前
父節點
當前提交
2e31f9549c

+ 136 - 137
config/index.js

@@ -5,151 +5,150 @@
 const path = require('path')
 
 module.exports = {
-  dev: {
-    // Paths
-    assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
-    proxyTable: {
-      '/admin': {
-        target: 'http://192.168.20.236:8080',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/admin": "/"
-        }
-      },
-      '/api': {
-        target: 'http://192.168.20.236:8080',
-        // target: 'http://192.168.20.234:8080',
-        changeOrigin: true,
-        pathRewrite: {
-          "^/api": "/"
-        }
-      },
-      '/data-platform-3': {
-        // 目标 API 地址
-        target: 'http://192.168.20.225:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/business-space': {
-        // 目标 API 地址
-        target: 'http://192.168.20.225:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/pointconfig': {
-        // 目标 API 地址
-        target: 'http://192.168.20.236:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/venders-dp': {
-        // 目标 API 地址
-        target: 'http://192.168.20.225:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/venders': {
-        // 目标 API 地址
-        target: 'http://192.168.20.225:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/ScanBuilding': {
-        // 目标 API 地址
-        target: 'http://192.168.20.236:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/image-service': {
-        // 目标 API 地址
-        target: 'http://192.168.20.225:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/godhand': {
-        // 目标 API 地址
-        target: 'http://192.168.20.225:8080/',
-        // 如果要代理 websockets
-        ws: true,
-        // 将主机标头的原点更改为目标URL
-        changeOrigin: false
-      },
-      '/modelapi': {
-        target: 'http://192.168.20.225:8082',
-        // target: 'http://192.168.20.218:8082',//景灏
-        changeOrigin: true,
-        pathRewrite: {
-          "^/modelapi": "/"
-        }
-      },
-    },
+    dev: {
+        // Paths
+        assetsSubDirectory: 'static',
+        assetsPublicPath: '/',
+        proxyTable: {
+            '/admin': {
+                target: 'http://192.168.20.236:8080',
+                changeOrigin: true,
+                pathRewrite: {
+                    "^/admin": "/"
+                }
+            },
+            '/api': {
+                target: 'http://192.168.20.236:8080',
+                changeOrigin: true,
+                pathRewrite: {
+                    "^/api": "/"
+                }
+            },
+            '/data-platform-3': {
+                // 目标 API 地址
+                target: 'http://192.168.20.225:8080/',
+                // 如果要代理 websockets
+                ws: true,
+                // 将主机标头的原点更改为目标URL
+                changeOrigin: false
+            },
+            '/business-space': {
+                // 目标 API 地址
+                target: 'http://192.168.20.225:8080/',
+                // 如果要代理 websockets
+                ws: true,
+                // 将主机标头的原点更改为目标URL
+                changeOrigin: false
+            },
+            '/pointconfig': {
+                // 目标 API 地址
+                target: 'http://192.168.20.236:8080/',
+                // 如果要代理 websockets
+                ws: true,
+                // 将主机标头的原点更改为目标URL
+                changeOrigin: false
+            },
+            '/venders-dp': {
+                // 目标 API 地址
+                target: 'http://192.168.20.225:8080/',
+                // 如果要代理 websockets
+                ws: true,
+                // 将主机标头的原点更改为目标URL
+                changeOrigin: false
+            },
+            '/venders': {
+                // 目标 API 地址
+                target: 'http://192.168.20.225:8080/',
+                // 如果要代理 websockets
+                ws: true,
+                // 将主机标头的原点更改为目标URL
+                changeOrigin: false
+            },
+            '/ScanBuilding': {
+                // 目标 API 地址
+                target: 'http://192.168.20.236:8080/',
+                // 如果要代理 websockets
+                ws: true,
+                // 将主机标头的原点更改为目标URL
+                changeOrigin: false
+            },
+            '/image-service': {
+                // 目标 API 地址
+                target: 'http://192.168.20.225:8080/',
+                // 如果要代理 websockets
+                ws: true,
+                // 将主机标头的原点更改为目标URL
+                changeOrigin: false
+            },
+            '/godhand': {
+                // 目标 API 地址
+                target: 'http://192.168.20.225:8080/',
+                // 如果要代理 websockets
+                ws: true,
+                // 将主机标头的原点更改为目标URL
+                changeOrigin: false
+            },
+            '/modelapi': {
+                target: 'http://192.168.20.225:8082',
+                // target: 'http://192.168.20.218:8082',//景灏
+                changeOrigin: true,
+                pathRewrite: {
+                    "^/modelapi": "/"
+                }
+            },
+        },
 
-    // Various Dev Server settings
-    host: '0.0.0.0', // can be overwritten by process.env.HOST
-    port: 28080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
-    autoOpenBrowser: false,
-    errorOverlay: true,
-    notifyOnErrors: true,
-    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
+        // Various Dev Server settings
+        host: '0.0.0.0', // can be overwritten by process.env.HOST
+        port: 28080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+        autoOpenBrowser: false,
+        errorOverlay: true,
+        notifyOnErrors: true,
+        poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
 
-    /**
-     * Source Maps
-     */
+        /**
+         * Source Maps
+         */
 
-    // https://webpack.js.org/configuration/devtool/#development
-    devtool: 'cheap-module-eval-source-map',
+        // https://webpack.js.org/configuration/devtool/#development
+        devtool: 'cheap-module-eval-source-map',
 
-    // If you have problems debugging vue-files in devtools,
-    // set this to false - it *may* help
-    // https://vue-loader.vuejs.org/en/options.html#cachebusting
-    cacheBusting: true,
+        // If you have problems debugging vue-files in devtools,
+        // set this to false - it *may* help
+        // https://vue-loader.vuejs.org/en/options.html#cachebusting
+        cacheBusting: true,
 
-    cssSourceMap: true
-  },
+        cssSourceMap: true
+    },
 
-  build: {
-    // Template for index.html
-    index: path.resolve(__dirname, '../dist/index.html'),
+    build: {
+        // Template for index.html
+        index: path.resolve(__dirname, '../dist/index.html'),
 
-    // Paths
-    assetsRoot: path.resolve(__dirname, '../dist'),
-    assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
+        // Paths
+        assetsRoot: path.resolve(__dirname, '../dist'),
+        assetsSubDirectory: 'static',
+        assetsPublicPath: '/',
 
-    /**
-     * Source Maps
-     */
+        /**
+         * Source Maps
+         */
 
-    productionSourceMap: true,
-    // https://webpack.js.org/configuration/devtool/#production
-    devtool: '#source-map',
+        productionSourceMap: true,
+        // https://webpack.js.org/configuration/devtool/#production
+        devtool: '#source-map',
 
-    // Gzip off by default as many popular static hosts such as
-    // Surge or Netlify already gzip all static assets for you.
-    // Before setting to `true`, make sure to:
-    // npm install --save-dev compression-webpack-plugin
-    productionGzip: false,
-    productionGzipExtensions: ['js', 'css'],
+        // Gzip off by default as many popular static hosts such as
+        // Surge or Netlify already gzip all static assets for you.
+        // Before setting to `true`, make sure to:
+        // npm install --save-dev compression-webpack-plugin
+        productionGzip: false,
+        productionGzipExtensions: ['js', 'css'],
 
-    // Run the build command with an extra argument to
-    // View the bundle analyzer report after build finishes:
-    // `npm run build --report`
-    // Set to `true` or `false` to always turn it on or off
-    bundleAnalyzerReport: process.env.npm_config_report
-  }
-}
+        // Run the build command with an extra argument to
+        // View the bundle analyzer report after build finishes:
+        // `npm run build --report`
+        // Set to `true` or `false` to always turn it on or off
+        bundleAnalyzerReport: process.env.npm_config_report
+    }
+}

+ 5 - 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) {
@@ -18,10 +18,12 @@ export function queryModel(params, success) {
     return httputils.postJson(`${baseUrl}/model-folder/query`, params, success)
 }
 
+// 查询文件夹下的所有楼层
 export function queryReportList(params, success) {
     return httputils.postJson(`${baseUrl}/report/list/non-blocking`, params, success)
 }
 
+// 查询文件夹下的所有楼层(包含缺失楼层)
 export function queryLostReportList(params, success) {
     return httputils.postJson(`${baseUrl}/model-floor/query-list-missing`, params, success)
 }

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

@@ -1001,6 +1001,32 @@ 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 toBeDelEquipPage(params, success) {
+    let url = `${baseUrl}/equip-component/equip-query/equip-comm-del`;
+    http.postJson(url, params, success)
+}
+
+// 模型质量报告 待补充的设备
+export function toBeSupplementEquip(params, success) {
+    let url = `${baseUrl}/equip-component/equip-query/property-equip-supp`;
+    http.postJson(url, params, success)
+}
+
 //设备清单-查询当前设备下的部件分类
 export function getEquipPartsType(param, success) {
   let url = `${baseUrl}/equip-component/equip-query/components-count`;

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

@@ -6,11 +6,8 @@
       </el-tooltip>
     </div>
     <div class="doughnut-view">
-      <fan-chart v-if="renderData.needCountO" type="type" width="200" height="200" :name="renderData.title" :renderData="echartsData" :id="id"></fan-chart>
-      <div v-else class="center">
-        <i class="icon-wushuju iconfont"></i>
-        暂无数据
-      </div>
+      <fan-chart v-if="renderData.needCountO" type="type" width="200" height="200" :name="renderData.title" :renderData="echartsData" :id="id">
+      </fan-chart>
     </div>
     <slot></slot>
   </div>
@@ -21,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
@@ -68,7 +71,7 @@ export default {
 }
 .saga-fill {
   width: 345px;
-  height: 220px;
+  // height: 220px;
   .doughnut-view {
     height: 165px;
     width: 100%;

+ 2 - 6
src/components/ledger/report/dataorigin.vue

@@ -6,13 +6,9 @@
       </el-tooltip>
     </div>
     <div class="doughnut-view">
-      <report-doughnut v-if="renderData.needCountO && renderData.needCountT" type="type" width="200" height="200" :sum="renderData.sum"
+      <report-doughnut v-if="renderData.needCountO || renderData.needCountT" type="type" width="200" height="200" :sum="renderData.sum"
         :name="renderData.title" :renderData="echartsData" :id="id" :text="renderData.text">
       </report-doughnut>
-      <div v-else class="center">
-        <i class="icon-wushuju iconfont"></i>
-        暂无数据
-      </div>
     </div>
     <slot></slot>
   </div>
@@ -94,7 +90,7 @@ export default {
 }
 .saga-fill {
   width: 345px;
-  height: 220px;
+  // height: 220px;
   .doughnut-view {
     height: 165px;
     width: 100%;

+ 198 - 149
src/views/ledger/report/index.vue

@@ -34,7 +34,7 @@
     </div>
     <div class="progress">
       <p class="basic-statistics">基本统计</p>
-      <div class="data equipment">
+      <div class="data equipment" v-if="equipCount">
         <!-- 设备:本期只做前三个 -->
         <span class="contain-title">设备<i>{{`(${equipCount?equipCount:"0"})`}}</i></span>
         <div class="data-show" v-loading="isLoading" v-if="equipment.length">
@@ -42,63 +42,39 @@
             <data-origin :id="'origin' + index" :renderData="item"></data-origin>
           </div>
         </div>
-        <div v-if="!equipment.length" class="center" style="height: 60%;transform: translateY(30%);">
-          <i class="icon-wushuju iconfont"></i>
-          暂无数据
-        </div>
       </div>
-      <div class="data assets">
+      <div class="data assets" v-if="assetsCount">
         <span class="contain-title">资产<i>{{`(${assetsCount?assetsCount:"0"})`}}</i></span>
         <div class="data-show" v-loading="isLoading" v-if="assets.length">
           <div class="show-content" v-for="(item,index) in assets" :key="index">
             <data-origin :id="'origin' + index" :renderData="item"></data-origin>
           </div>
         </div>
-        <div v-if="!assets.length" class="center" style="height: 60%;transform: translateY(30%);">
-          <i class="icon-wushuju iconfont"></i>
-          暂无数据
-        </div>
       </div>
-      <div class="data parts">
+      <div class="data parts" v-if="partsCount">
         <span class="contain-title">部件<i>{{`(${partsCount?partsCount:'0'})`}}</i></span>
-        <div v-if="!parts.length" class="center" style="height: 60%;transform: translateY(30%);">
-          <i class="icon-wushuju iconfont"></i>
-          暂无数据
-        </div>
       </div>
-      <div class="data business-space">
+      <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 v-for="(item,index) in business" :key="index" class="show-content">
             <datafan :id="'datafan' + index" :renderData="item"></datafan>
           </div>
         </div>
-        <div v-if="!business.length" class="center" style="height: 60%;transform: translateY(30%);">
-          <i class="icon-wushuju iconfont"></i>
-          暂无数据
-        </div>
       </div>
-      <div class="data system">
+      <div class="data system" v-if="systemCount">
         <!-- 系统:本期只查询总数 -->
         <span class="contain-title">系统<i>{{`(${systemCount?systemCount:'0'})`}}</i></span>
-        <div v-if="!system.length" class="center" style="height: 60%;transform: translateY(30%);">
-          <i class="icon-wushuju iconfont"></i>
-          暂无数据
-        </div>
       </div>
-      <div class="data tenant">
+      <div class="data tenant" v-if="rentantCount">
         <span class="contain-title">租户<i>{{`(${rentantCount?rentantCount:'0'})`}}</i></span>
         <div class="data-show" v-loading="isLoading" v-if="tenant.length">
           <div class="show-content" v-for="(item,index) in tenant" :key="index">
             <data-origin :id="'origin' + item + index" :renderData="item"></data-origin>
           </div>
         </div>
-        <div v-if="!tenant.length" class="center" style="height: 60%;transform: translateY(30%);">
-          <i class="icon-wushuju iconfont"></i>
-          暂无数据
-        </div>
       </div>
-      <div class="data shaft">
+      <div class="data shaft" v-if="shaftCount">
         <span class="contain-title">竖井<i>{{`(${shaftCount?shaftCount:'0'})`}}</i></span>
         <div class="data-show" v-loading="isLoading" v-if="shaft.length">
           <div class="show-content" v-for="(item,index) in shaft" :key="index">
@@ -106,10 +82,6 @@
             <data-origin :id="'origin' + item + index" :renderData="item" v-else></data-origin>
           </div>
         </div>
-        <div v-if="!shaft.length" class="center" style="height: 60%;transform: translateY(30%);">
-          <i class="icon-wushuju iconfont"></i>
-          暂无数据
-        </div>
       </div>
     </div>
   </div>
@@ -140,6 +112,7 @@ import {
 import dataOrigin from "@/components/ledger/report/dataorigin";
 import datafan from "@/components/ledger/report/datafan";
 import { queryDataSourceCount, synchronizeProj } from "@/fetch/point_http";
+import { resolve } from 'q';
 
 export default {
   data() {
@@ -227,10 +200,9 @@ export default {
       shaftCount: null,// 竖井总数
       shaft: [],// 竖井数据
       ShaftFunType: null,// 竖井功能类型
-      shaftPartProtion: [],// 竖井-按功能类型占比数据
+      shaftPartProtion: null,// 竖井-按功能类型占比数据
       params: null,
-      isLoading: false,
-      color: ["#3485d6", "#a384fc", "#4caf50", "#ff6316", "#fd8bbe", "#03a9f3", "#ea615b"]
+      isLoading: false
     }
   },
   components: {
@@ -256,23 +228,20 @@ export default {
   },
   methods: {
     zoneTypeConversion(item) {// 分区类型转换
-      this.zoneType.map(it => {
+      this.zoneType.forEach(it => {
         if (item.Name === it.Code) {
           item.Name = it.Name;
         }
       })
     },
     functionTypeTranstion(item, type) {// 默认分区功能类型转换
-      type.map(it => {
+      type.forEach(it => {
         if (item.Name === it.Code) {
           item.Name = it.Name;
           this.defaultPart.push({
             name: item.Name,
             value: item.Count
           });
-          // this.defaultPart.map((item, index) => {
-          //   item.itemStyle = {color:this.color}
-          // })
         }
         if (it.Content) {
           this.functionTypeTranstion(item, it.Content)
@@ -289,13 +258,15 @@ 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();
       })
     },
     toPercent(point) {// 小数转换成百分比
       if (point == 0) {
-        return 0;
+        return `0%`;
       }
       var str = Number(point * 100).toFixed(2);
       str += "%";
@@ -308,7 +279,7 @@ export default {
       })
     },
     shaftFunTypeTranstion(item) {// 竖井功能类型转换
-      this.ShaftFunType.map((it, index) => {
+      this.ShaftFunType.forEach((it, index) => {
         if (item.Name === it.Id) {
           item.Name = it.Name;
         }
@@ -341,9 +312,6 @@ export default {
         this.postRelationInforCount = res.Count;
       })
     },
-    getNotSyncObject() {
-
-    },
     getEquipCount() {// 获取设备总数
       countEquip(this.params, res => {
         this.equipCount = res.Count;
@@ -356,16 +324,9 @@ export default {
         ProjectId: this.projectId,
         Filters: "PropertyId isNull"
       }
-      countEquip(param, res => {
-        this.equipment.push({
-          title: '未关联资产',
-          tips: '设备未关联资产数量',
-          contentValueO: '未关联',
-          contentValueT: '已关联',
-          text: '',
-          needCountO: res.Count,
-          needCountT: this.equipCount - res.Count,
-          text: `总数${this.equipCount}`
+      let promise1 = new Promise(resolve => {
+        countEquip(param, res => {
+          resolve(res);
         })
       })
 
@@ -374,37 +335,57 @@ export default {
         ProjectId: this.projectId,
         Filters: "taskState = 0 or taskState = 1"
       }
-      countEquip(par, res => {
-        let text = this.toPercent(res.Count / this.equipCount)
+      let promise2 = new Promise(resolve => {
+        countEquip(par, res => {
+          resolve(res);
+        })
+      })
+
+      let pa = {
+        ProjectId: this.projectId,
+        Filters: "not BimID isNull"
+      }
+      let promise3 = new Promise(resolve => {
+        countEquip(pa, res => {
+          resolve(res);
+        })
+      })
+
+      Promise.all([promise1, promise2, promise3]).then(response => {
+        this.equipment = [];
+        let res = response[0];
+        let res1 = response[1];
+        let res2 = response[2];
+        this.equipment.push({
+          title: '未关联资产',
+          tips: '设备未关联资产数量',
+          contentValueO: '已关联',
+          contentValueT: '未关联',
+          needCountO: this.equipCount - res.Count,
+          needCountT: res.Count,
+          text: `总数${this.equipCount}`
+        })
+
+        let text = this.toPercent(res1.Count / this.equipCount)
         this.equipment.push({
           title: '现场验证状态占比',
           tips: '设备状态为未找到、已找到的数量与设备总数占比',
           contentValueO: '已验证',
           contentValueT: '未验证',
-          text: '',
-          needCountO: res.Count,
-          needCountT: this.equipCount - res.Count,
+          needCountO: res1.Count,
+          needCountT: this.equipCount - res1.Count,
           text: text
         })
-        this.getEquipBIMIDCount();
-      })
-    },
-    getEquipBIMIDCount() {// 设备-与模型对应占比
-      let pa = {
-        ProjectId: this.projectId,
-        Filters: "not BimID isNull"
-      }
-      countEquip(pa, res => {
-        let text = this.toPercent(res.Count / this.equipCount)
+
+        let text1 = this.toPercent(res2.Count / this.equipCount)
         this.equipment.push({
           title: '与模型对应占比',
           tips: '"BIM模型中编码"有值的设备数量与设备总数占比',
           contentValueO: '有BIMID',
           contentValueT: '无BIMID',
-          text: '',
-          needCountO: res.Count,
-          needCountT: this.equipCount - res.Count,
-          text: text
+          needCountO: res2.Count,
+          needCountT: this.equipCount - res2.Count,
+          text: text1
         })
         this.isLoading = false;
       })
@@ -420,15 +401,9 @@ export default {
         ProjectId: this.projectId,
         Filters: " EquipmentId isnull"
       }
-      countProperty(param, res => {
-        this.assets.push({
-          title: '未关联资产',
-          tips: '资产未关联设备数量',
-          contentValueO: '未关联',
-          contentValueT: '已关联',
-          text: `总数${this.assetsCount}`,
-          needCountO: res.Count,
-          needCountT: this.assetsCount - res.Count
+      let promise1 = new Promise((resolve) => {
+        countProperty(param, res => {
+          resolve(res)
         })
       })
 
@@ -437,17 +412,9 @@ export default {
         ProjectId: this.projectId,
         Filters: " taskState = 0 or taskState = 1"
       }
-      countProperty(par, res => {
-        let text = res.Count / this.assetsCount;
-        text = this.toPercent(text);
-        this.assets.push({
-          title: '现场验证状态占比',
-          tips: '资产状态为未找到、已找到的数量与资产总数占比',
-          contentValueO: '已验证',
-          contentValueT: '未验证',
-          text: text,
-          needCountO: res.Count,
-          needCountT: this.assetsCount - res.Count
+      let promise2 = new Promise((resolve) => {
+        countProperty(par, res => {
+          resolve(res);
         })
       })
 
@@ -456,17 +423,49 @@ export default {
         ProjectId: this.projectId,
         Filters: " not BIMLocation isnull"
       }
-      countProperty(pa, res => {
-        let text = res.Count / this.assetsCount;
+      let promise3 = new Promise((resolve) => {
+        countProperty(pa, res => {
+          resolve(res);
+        })
+      })
+
+      Promise.all([promise1, promise2, promise3]).then(response => {
+        this.assets = [];
+        let res0 = response[0];
+        let res1 = response[1];
+        let res2 = response[2];
+        this.assets.push({
+          title: '未关联资产',
+          tips: '资产未关联设备数量',
+          contentValueO: '已关联',
+          contentValueT: '未关联',
+          text: `总数${this.assetsCount}`,
+          needCountO: this.assetsCount - res1.Count,
+          needCountT: res1.Count
+        })
+
+        let text = res1.Count / this.assetsCount;
         text = this.toPercent(text);
         this.assets.push({
+          title: '现场验证状态占比',
+          tips: '资产状态为未找到、已找到的数量与资产总数占比',
+          contentValueO: '已验证',
+          contentValueT: '未验证',
+          text: text,
+          needCountO: res1.Count,
+          needCountT: this.assetsCount - res1.Count
+        })
+
+        let text1 = res2.Count / this.assetsCount;
+        text1 = this.toPercent(text1);
+        this.assets.push({
           title: '有无坐标占比',
           tips: '有坐标的资产数量百分比',
           contentValueO: '有坐标',
           contentValueT: '无坐标',
-          text: text,
-          needCountO: res.Count,
-          needCountT: this.assetsCount - res.Count
+          text: text1,
+          needCountO: res2.Count,
+          needCountT: this.assetsCount - res2.Count
         })
       })
     },
@@ -476,39 +475,51 @@ export default {
       })
     },
     getZoneSpaceCount() {// 获取业务空间数据
-
       // 获取业务空间总数
       queryZoneCount(this.params, res => {
         this.zoneSpaceCount = res.Count;
       })
-
-      // 获取业务空间的各分区占比
-      queryPartitionRatio(this.params, res => {
-        res.Content.map(item => {
-          this.zoneTypeConversion(item);
-          this.partProtion.push({
-            name: item.Name,
-            value: item.Count
-          })
-        })
-        this.business.push({
-          title: '各分区占比',
-          tips: '各类型分区实例数量与实例总数占比',
-          needCountO: this.partProtion,
+      let promise1 = new Promise((resolve) => {
+        queryPartitionRatio(this.params, res => {
+          resolve(res)
         })
       })
-
-      // 获取业务空间默认分区功能类型占比
-      queryDefaultFunTypes(this.params, res => {
-        res.Content.map(item => {
-          this.functionTypeTranstion(item, this.functionType);
-        })
-        this.business.push({
-          title: '默认分区功能类型占比',
-          tips: '默认分区实例的功能区类型占比',
-          needCountO: this.defaultPart,
+      let promise2 = new Promise((resolve) => {
+        queryDefaultFunTypes(this.params, res => {
+          resolve(res)
         })
       })
+      Promise.all([promise1, promise2]).then(response => {
+        this.business = [];
+        this.partProtion = [];
+        this.defaultPart = [];
+        let res1 = response[0]
+        let res2 = response[1]
+        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,
+          })
+        }
+        if (res2.Content.length) {
+          res2.Content.forEach(item => {
+            this.functionTypeTranstion(item, this.functionType);
+          })
+          this.business.push({
+            title: '默认分区功能类型占比',
+            tips: '默认分区实例的功能区类型占比',
+            needCountO: this.defaultPart,
+          })
+        }
+      })
     },
     getSystemCount() {// 获取系统数据
       countGeneralSys(this.params, res => {
@@ -516,14 +527,21 @@ export default {
       })
     },
     getTenantCount() {// 获取租户数据
-
       // 获取租户总数
       queryRentCount(this.params, res => {
         this.rentantCount = res.Count;
       })
 
       // 租户-关联业务空间完成度
-      queryTenantCompletion(this.params, res => {
+      let promise = new Promise((resolve) => {
+        queryTenantCompletion(this.params, res => {
+          resolve(res);
+        })
+      })
+      Promise.all([promise]).then(response => {
+        this.tenant = [];
+        let res = response[0];
+        this.tenant = [];
         let text = res.Count / this.rentantCount;
         text = this.toPercent(text);
         this.tenant.push({
@@ -531,51 +549,78 @@ export default {
           tips: '已关联业务空间的租户数量百分比',
           contentValueO: '已关联',
           contentValueT: '未关联',
-          text: '',
           needCountO: res.Count,
           needCountT: this.rentantCount - res.Count,
           text: text
         })
       })
+
     },
     getShaftCount() {// 获取竖井数据
-
+      this.shaft = [];
       // 获取竖井总数
       queryCenoteCount(this.params, res => {
         this.shaftCount = res.Count;
       })
 
-      // 获取竖井按功能类型占比
-      queryShaftFunctionType(this.params, res => {
-        res.Content.map(item => {
-          this.shaftFunTypeTranstion(item);
-          this.shaftPartProtion.push({
-            name: item.Name,
-            value: item.Count
-          })
+      let promise1 = new Promise((resolve) => {
+        queryShaftFunctionType(this.params, res => {
+          resolve(res);
         })
-        this.shaft.push({
-          title: '按功能类型占比',
-          tips: '竖井实例的竖井功能占比',
-          needCountO: this.shaftPartProtion,
+      })
+      let promise2 = new Promise((resolve) => {
+        ShaftRelationBusinessSpace(this.params, res => {
+          resolve(res);
         })
       })
+      Promise.all([promise1, promise2]).then(response => {
+        this.shaft = [];
+        let res = response[0];
+        let res1 = response[1];
+        this.shaftPartProtion = [];
+        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,
+          })
+        }
 
-      // 获取竖井关联业务空间完成度
-      ShaftRelationBusinessSpace(this.params, res => {
-        let text = this.toPercent(res.Count / this.shaftCount);
+        let text = this.toPercent(res1.Count / this.shaftCount);
         this.shaft.push({
           title: '关联业务空间完成度',
           tips: '已关联业务空间的竖井数量百分比',
           contentValueO: '已关联',
           contentValueT: '未关联',
-          needCountO: res.Count,
-          needCountT: this.shaftCount - res.Count,
+          needCountO: res1.Count,
+          needCountT: this.shaftCount - res1.Count,
           text: text
         })
       })
     }
   },
+  watch: {
+    projectId(n, o) {
+      this.params = {
+        ProjectId: this.projectId
+      }
+      this.getFunctionType();
+      this.getStatisticsCount();
+      this.getEquipCount();
+      this.getAssetsCount();
+      this.getPartsCount();
+      this.getSystemCount();
+      this.getTenantCount();
+      this.getShaftFunType();
+    }
+  }
 }
 </script>
 
@@ -647,4 +692,8 @@ export default {
     border-radius: 5px;
   }
 }
+.system,
+.parts {
+  height: 50px !important;
+}
 </style>

文件差異過大導致無法顯示
+ 188 - 80
src/views/model/report/deleted.vue


+ 244 - 167
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>
@@ -26,12 +26,14 @@
       </div>
       <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 :underline="false" @click="del" v-if="toBeDelCount">需从模型中删除的设备</el-link>
+          <el-link @click="supplement" :underline="false" v-if="toBeSuppCount">模型待补充的设备</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="width: 100%;height: calc(100% - 47px)">
-          <el-table ref="multipleTable" :data="tableData" stripe height="100%" :header-cell-style="headerStyle" v-loading='loading'>
+        <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'
+            :row-class-name="tableRowClassName">
             <el-table-column prop="FloorName" label="模型楼层" fixed width="150"></el-table-column>
             <el-table-column prop="functionNo" label="待删除设备数量" fixed width="150">
               <template slot-scope="scope">
@@ -39,86 +41,98 @@
                 </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>
               </template>
             </el-table-column>
-            <el-table-column prop="itemsProblemsCheck" label="有问题的检查项" fixed width="150">
+            <el-table-column prop="questionItem" label="有问题的检查项" fixed width="150">
               <template slot-scope="scope">
-                <el-badge :value="scope.row.itemsProblemsCheck" class="item" :type='scope.row.itemsProblemsCheck?"warning":"success"'>
+                <el-badge :value="scope.row.questionItem" class="item" :type='scope.row.questionItem?"warning":"success"'>
                 </el-badge>
               </template>
             </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="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.ElementRangeCheck<=0"></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='scope.row.FamilyNameCheck?"danger":"success"'>
+                <el-badge :value="scope.row.FamilyNameCheck" class="item" type='danger' v-if="scope.row.FamilyNameCheck">
                 </el-badge>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.FamilyNameCheck<=0"></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='scope.row.EquipPartLocationCheck?"danger":"success"'>
+                <el-badge :value="scope.row.EquipPartLocationCheck" class="item" type='danger' v-if="scope.row.EquipPartLocationCheck">
                 </el-badge>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.EquipPartLocationCheck<=0"></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='scope.row.ColumnCheck?"danger":"success"'>
+                <el-badge :value="scope.row.ColumnCheck" class="item" type='danger' v-if="scope.row.ColumnCheck">
                 </el-badge>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.ColumnCheck<=0"></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='scope.row.ConnectorCheck?"danger":"success"'>
+                <el-badge :value="scope.row.ConnectorCheck" class="item" type='danger' v-if="scope.row.ConnectorCheck">
                 </el-badge>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.ConnectorCheck<=0"></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="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.SystemNameCheck<=0"></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="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.EquipInSpaceCheck<=0"></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="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.PipeCheck<=0"></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="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.SystemReferEquipCheck<=0"></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='scope.row.ParameterIntegrityCheck?"danger":"success"'>
+                <el-badge :value="scope.row.ParameterIntegrityCheck" class="item" type='danger' v-if="scope.row.ParameterIntegrityCheck">
                 </el-badge>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.ParameterIntegrityCheck<=0"></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='scope.row.XyzOverlapCheck?"danger":"success"'>
+                <el-badge :value="scope.row.XyzOverlapCheck" class="item" type='danger' v-if="scope.row.XyzOverlapCheck">
                 </el-badge>
+                <i class="msg-icon el-icon-success success-color" style="font-size:20px;" v-if="scope.row.XyzOverlapCheck<=0"></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>
@@ -138,6 +152,9 @@ 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'
+import { resolve } from 'q';
 export default {
   components: {
     dasBoard
@@ -163,13 +180,10 @@ export default {
         total: 0
       },
       loading: false,
-      lostFloort: {
-        ary: [],
-        Bary: [],
-        Fary: [],
-        regex: /^(B||F)(\d)/
-      },
-      floorIconType: null
+      load: false,
+      floorIconType: null,
+      toBeSuppCount: 0,
+      toBeDelCount: 0
     }
   },
   mounted() { },
@@ -184,77 +198,53 @@ export default {
     ...mapGetters('layout', ['projectId'])
   },
   methods: {
-    getlostFloors(ary, eng, FloorName) {// 获取缺失楼层
-      let newAry = ary[0];
-      if (newAry.FloorName !== '1') {
-        ary.unshift({ FloorName: `${1}` })
-      }
-      for (let i = 0; i < ary.length; i++) {
-        if (i === ary.length - 1) {
-          break;
-        }
-        let x = ary[i].FloorName;
-        let y = ary[i + 1].FloorName;
-        let z = { FloorName: `${Number(x) + 1}` };
-        if (Number(x) + 1 !== Number(y)) {
-          ary.splice(i + 1, 0, z)
-          i++;
-        }
-      }
-      for (let i = 0; i < ary.length; i++) {
-        ary[i].FloorName = `${eng + ary[i].FloorName}`;
-      }
-      for (let i = 0; i < ary.length; i++) {
-        for (let j = 0; j < FloorName.length; j++) {
-          if (ary[i].FloorName === FloorName[j].FloorName) {
-            break;
-          } else {
-            if (j === FloorName.length - 1) {
-              ary[i].FloorName = `${'丢失' + ary[i].FloorName}`
-            }
-          }
-        }
-      }
-    },
-    getModelFileCount() {// 获取项目下所有模型文件夹
-      let params = {
-        ProjectId: this.projectId,
-      }
-      queryModel(this.params, res => {
-        this.ModelFileCount = res.Content.length;
-        this.tableList = res.Content;
-        this.tableList.map((item, index) => {
-          item.Code = item.Id;
-        })
-        this.activeTab = this.tableList[0].Code;// 默认选中第一个模型文件夹
-        this.getExportReport();
-        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.map(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() {// 获取当前楼层下的模型楼层
+    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}`,
@@ -262,106 +252,186 @@ export default {
         PageSize: this.page.pageSize
       }
       queryReportList(params, res => {
-        if (res.Content) {
-          let that = this;
-          this.FloorName = res.Content;
-          this.lostFloort.ary = [];
-          this.lostFloort.Bary = [];
-          this.lostFloort.Fary = [];
-          for (let i = 0; i < this.FloorName.length; i++) {
-            let it = this.FloorName[i];
-            if (this.lostFloort.regex.test(it.FloorName)) {
-              it.FloorName.replace(/^(B||F)(\d)/g, function (a, b, c) {
-                if (b === "B") {
-                  it.FloorName = c;
-                  that.lostFloort.Bary.push(it);
-                } else if (b === "F") {
-                  it.FloorName = c;
-                  that.lostFloort.Fary.push(it);
-                }
-              })
-            } else {
-              this.lostFloort.ary.push(it)
-            }
-          }
-          if (this.lostFloort.Bary.length > 0) {
-            this.getlostFloors(this.lostFloort.Bary, "B", this.FloorName)
-          }
-          if (this.lostFloort.Fary.length > 0) {
-            this.getlostFloors(this.lostFloort.Fary, "F", this.FloorName)
-          }
-          if (this.lostFloort.Bary.length < 0 && this.lostFloort.Fary.length < 0) {
-            this.tableData = res.Content;
-          } else {
-            this.tableData = [...this.lostFloort.ary, ...this.lostFloort.Bary, ...this.lostFloort.Fary]
-          }
-          let i;
-          let j = 0;
-          this.tableData.map(item => {
-            i = 0;
+        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) {
+              if (item[key] > 0 && key !== "FloorName" && key !== "questionItem") {
                 i += 1;
+                item.questionItem += 1;
               }
             }
-            if (item.ColumnCheck !== undefined) {
-              item.itemsProblemsCheck = i;
-              item.toBeDel = 10;
-              item.toBeSupplement = 6;
-            }
-            if (item.itemsProblemsCheck) {
-              j += 1;
-              this.floorIconType = j;
-            }
           })
-        } else {
-          this.tableData = [];
+          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
+        Filters: `FolderId='${this.activeTab}';Status=4`
+      }
+      queryLostReportList(params, res => {
+        this.LostFloorName = res.Content;
+        this.getToBeCount();
+      })
+    },
+    getToBeCount() {// 根据模型ID获取待删除数量和待补充数量
+      let equipComDelList = [];
+      this.equipComDelList = [];
+      this.LostFloorName.forEach(item => {
+        if (item.CurrentModelId) {
+          equipComDelList.push({
+            ModelId: item.CurrentModelId
+          });
+          this.equipComDelList.push(item.CurrentModelId)
+        } else {
+          item.flag = 'lost';
+          item.FloorName = `${item.Note + item.FloorName}`
+        }
+      })
+      let params = {
+        ProjectId: this.projectId,
+        data: equipComDelList
       }
-      // queryLostReportList(param, res => {
-      //   console.log(res, 'lost');
-      //   this.LostFloorName = res.Content;
-      //   for (let i = 0; i < this.LostFloorName.length; i++) {
-      //     for (let j = 0; j < this.FloorName.length; j++) {
-      //       if (this.LostFloorName[i].FloorName == this.FloorName.FloorName) {
-      //         continue;
-      //       } else {
-      //         this.FloorName.splice(i, 0, this.LostFloorName[i])
-      //       }
-      //     }
-      //   }
-      //   this.tableData = this.FloorName;
-      // })
+      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];
+        this.toBeDelCount = 0;
+        this.toBeSuppCount = 0;
+        res.Content.forEach(item => {
+          if (item.Count > 0) {
+            this.toBeDelCount += 1;
+          }
+          this.LostFloorName.forEach(it => {
+            if (item.ModelId === it.CurrentModelId) {
+              it.toBeDel = item.Count;
+            }
+          })
+        })
+        res1.Content.forEach(item => {
+          if (item.Count > 0) {
+            this.toBeSuppCount += 1;
+          }
+          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.page.total = this.tableData.length;
+        this.loading = false;
+      })
     },
-    del() {
-      // 点击需从模型中删除的设备
-      let jumpRouter = this.$router.resolve({ path: '/model/report/deleted' })
+    del() {// 点击需从模型中删除的设备  
+      let equipComDelList = encodeURIComponent(JSON.stringify(this.equipComDelList));
+      let jumpRouter = this.$router.resolve({ path: '/model/report/deleted', query: { equipComDelList: equipComDelList } })
       window.open(jumpRouter.href, '_blank')
     },
-    supplement() {
-      // 点击模型待补充的设备
-      let jumpRouter = this.$router.resolve({ path: '/model/report/supplement' })
+    supplement() {// 点击模型待补充的设备
+      let equipComDelList = encodeURIComponent(JSON.stringify(this.equipComDelList));
+      let jumpRouter = this.$router.resolve({ path: '/model/report/supplement', query: { equipComDelList: equipComDelList } })
       window.open(jumpRouter.href, '_blank')
     },
-    // 切换每页显示数量
-    handleSizeChange(val) {
+    getExportReport() {// 导出模型问题报告
+      let that = this;
+      this.load = true;
+      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 = decodeURI(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)
+            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);
+            }
+          }
+          reader.readAsText(res.data)
+        }
+      })
+    },
+    tableRowClassName({ row, rowIndex }) {// 设置缺失楼层所在行的背景色
+      if (row.flag && row.flag === 'lost') {
+        return 'warning-row';
+      }
+    },
+    handleSizeChange(val) {// 切换每页显示数量
       this.page.pageSize = val;
       this.getModelFloor();
     },
-    // 切换页码
-    handleCurrentChange(val) {
+    handleCurrentChange(val) {// 切换页码
       this.page.pageNumber = val;
       this.getModelFloor();
     },
+  },
+  watch: {
+    projectId() {
+      this.params = {
+        ProjectId: this.projectId
+      }
+      this.getModelFileCount();
+      this.getModelFloorCount();
+    }
   }
 }
 </script>
@@ -413,4 +483,11 @@ export default {
 .error-color {
   color: #f56c6c;
 }
+</style>
+<style lang="less">
+.el-table__row.warning-row {
+  td {
+    background: #f3f3f3 !important;
+  }
+}
 </style>

+ 170 - 50
src/views/model/report/supplement.vue

@@ -1,65 +1,45 @@
 <template>
   <!-- 待补充页面 -->
   <div class="box">
-    <ul class="infinite-list" v-infinite-scroll="load" style="overflow:auto">
-      <!-- <li v-for="i in count" class="infinite-list-item"> -->
+    <ul class="infinite-list" style="overflow:auto">
       <li class="infinite-list-item">
-        <div class="content-box">
+        <div class="content-box" v-for="(item,index) in pageData" :key="index">
           <div class="content-top">
             <div class="details">
-              <h4>{{'四位序列号'}}<el-badge value="待补充" class="item"></el-badge>
+              <h4>{{index |numTransformation(4)}}<el-badge value="待补充" class="item" type="success"></el-badge>
               </h4>
-              <h4>{{"XXXX建筑模型夹"}}-{{"XXX层"}}-{{"待删除设备名称XXXXXXXXXXXXX"}}</h4>
-              <b>标记码:<span @dblclick="copyContent" id="copy">{{'12d13fs13f1sd313'}}</span></b><span class="copy" @click="clickCopy">点击复制</span>
+              <h4>{{`${item.BuildingName}建筑模型`}}-{{`${item.FloorName}层`}}-{{`${item.EquipLocalName?item.EquipLocalName:item.EquipName}`}}</h4>
+              <b>标记码:<span @dblclick="copyContent" id="copy">{{item.EquipID}}</span></b><span class="copy" @click="clickCopy">点击复制</span>
               <input id="copyContent" type="text" @dblclick="copyContent" style="border:none;opacity:0;position:absolute;top:0;left:0;">
-              <p style="margin-top:30px;">建议使用的Revit族:{{'XXXXXXX'}}</p>
-              <p>设计图纸中编码:{{'XXXXXXX'}}</p>
-              <p><span>设备类型:{{'XXXXXXX'}}</span><span>设备ID:{{'XXXXXXX'}}</span></p>
-              <p><span>资产族:{{'XXXXXXX'}}</span><span>资产ID:{{'XXXXXXX'}}</span></p>
-              <p>现场发现人:{{'XXXXXXX'}}</p>
+              <p style="margin-top:30px;">建议使用的Revit族:{{item.Res}}</p>
+              <p>设计图纸中编码:{{item.CADID}}</p>
+              <!-- <p><span>设备类型:{{'XXXXXXX'}}</span><span>设备ID:{{'XXXXXXX'}}</span></p> -->
+              <p><span>资产族:{{item.FamilyName.Name}}</span></p>
+              <p><span style="width:500px;">资产ID:{{item.EquipID}}</span></p>
+              <p>现场发现人:{{item.FindPeople}}</p>
             </div>
             <div class="plan">
-              <p>平面图上的位置:<span>{{`${'('+'X:'+'329'+','+'Y:'+'398'+')'}`}}</span></p>
+              <p>平面图上的位置:<span>{{item.local | localTransformation}}</span></p>
               <div class="img-box">
-                <img src="https://hbimg.huabanimg.com/f761a5fd8164882f9bad2dc46da4f5682cfd7c6eabc2-ArjdOX_fw658" alt="">
+                <canvas :id="'canvas'+index" :width="canvasWidth" :height="canvasHeight" ref="canvas" tabindex="0" :data-modelid="item.ModelId"
+                  :data-EquipID='item.EquipID' :data-x="item.local.X" :data-y="item.local.Y"></canvas>
               </div>
             </div>
           </div>
           <div class="content-bottom">
-            <div class="photo">
-              <p>铭牌图片:<span>拍摄时间:{{`${'2019'+'年'+'12'+'月'+'56'+'时'+'5'+'分'}`}}</span></p>
+            <div class="photo" v-for="(it,ind) in item.LedgerParam.PhotoDoc.Nameplate" :key="ind">
+              <p>{{it.name}}<span>拍摄时间:{{it.createTime | timeTransformation}}</span></p>
               <div class="img-box">
-                <img src="https://hbimg.huabanimg.com/f761a5fd8164882f9bad2dc46da4f5682cfd7c6eabc2-ArjdOX_fw658" alt="">
+                <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${it.key}`" alt="铭牌图片">
               </div>
             </div>
-            <div class="photo">
-              <p>设备图片:<span>拍摄时间:{{`${'2019'+'年'+'12'+'月'+'56'+'时'+'5'+'分'}`}}</span></p>
-              <div class="img-box">
-                <img src="https://hbimg.huabanimg.com/f761a5fd8164882f9bad2dc46da4f5682cfd7c6eabc2-ArjdOX_fw658" alt="">
-              </div>
-            </div>
-            <div class="photo">
-              <p>设备图片:<span>拍摄时间:{{`${'2019'+'年'+'12'+'月'+'56'+'时'+'5'+'分'}`}}</span></p>
-              <div class="img-box">
-                <img src="https://hbimg.huabanimg.com/f761a5fd8164882f9bad2dc46da4f5682cfd7c6eabc2-ArjdOX_fw658" alt="">
-              </div>
-            </div>
-            <div class="photo">
-              <p>设备图片:<span>拍摄时间:{{`${'2019'+'年'+'12'+'月'+'56'+'时'+'5'+'分'}`}}</span></p>
-              <div class="img-box">
-                <img src="https://hbimg.huabanimg.com/f761a5fd8164882f9bad2dc46da4f5682cfd7c6eabc2-ArjdOX_fw658" alt="">
-              </div>
-            </div>
-            <div class="photo">
-              <p>设备图片:<span>拍摄时间:{{`${'2019'+'年'+'12'+'月'+'56'+'时'+'5'+'分'}`}}</span></p>
-              <div class="img-box">
-                <img src="https://hbimg.huabanimg.com/f761a5fd8164882f9bad2dc46da4f5682cfd7c6eabc2-ArjdOX_fw658" alt="">
-              </div>
-            </div>
-            <div class="photo">
-              <p>设备图片:<span>拍摄时间:{{`${'2019'+'年'+'12'+'月'+'56'+'时'+'5'+'分'}`}}</span></p>
-              <div class="img-box">
-                <img src="https://hbimg.huabanimg.com/f761a5fd8164882f9bad2dc46da4f5682cfd7c6eabc2-ArjdOX_fw658" alt="">
+            <div class="photo" v-for="(photo,num) in item.LedgerParam.PhotoDoc.Pic" :key="num+photo">
+              <p v-if="item.LedgerParam.PhotoDoc.Pic">{{photo.name}}<span>拍摄时间:{{photo.createTime | timeTransformation}}</span></p>
+              <div class="img-box" v-if="item.LedgerParam.PhotoDoc.Pic">
+                <img :src="`/image-service/common/image_get?systemId=dataPlatform&key=${photo.key}`" alt="设备图片" v-if="photo.type !=='video'">
+                <video :src="'/image-service/common/image_get?systemId=dataPlatform&key='+photo.key" controls
+                  :poster="'/image-service/common/image_get?systemId=dataPlatform&key='+ photo.key" v-if="photo.type === 'video'" width="400px"
+                  height="300px"></video>
               </div>
             </div>
           </div>
@@ -70,23 +50,73 @@
 </template>
 
 <script>
+import { mapGetters } from "vuex";
+import { toBeSupplementEquip } from "@/api/scan/request.js";
+import { LocationPointScene, FloorView } from "@saga-web/cad-engine/lib";
+
 export default {
   components: {
 
   },
   data() {
     return {
-      count: 0
+      pageData: [],
+      count: 0,
+      equipComDelList: null,
+      page: {
+        pageSize: 50,
+        pageSizes: [10, 20, 50, 100],
+        pageNumber: 1,
+        total: 0
+      },
+      canvasWidth: 400,
+      canvasHeight: 280,
+      scene: '',
+      view: '',
+      i: 0
+    }
+  },
+  filters: {
+    numTransformation(num, length) {// 序列号转换为4位
+      num = Number(num + 1)
+      return (Array(length).join('0') + num).slice(-length);
+    },
+    localTransformation(local) {// 坐标转换
+      let str = "";
+      for (let key in local) {
+        if (key !== "Z") {
+          str += key + ':' + local[key] + ',';
+        } else {
+          str += key + ':' + local[key];
+        }
+      }
+      return str;
+    },
+    timeTransformation(time) {// 时间转换
+      time = time.replace(/(\d+)\-(\d+)\-(\d+)\ (\d+)\:(\d+)\:(\d+)/, function () {
+        let str = '';
+        let ary = ['年', '月', '日', '时', '分'];
+        let time = Array.prototype.concat.apply([], arguments);
+        time = time.splice(1, 5);
+        time.forEach((item, index) => {
+          str += item + ary[index];
+        })
+        return str;
+      })
+      return time;
     }
   },
-  mounted() { },
+  mounted() {
+    // this.getGraphy();
+    this.getToBeSuppement();
+  },
   created() {
-
+    this.equipComDelList = decodeURIComponent(this.$route.query.equipComDelList);
+  },
+  computed: {
+    ...mapGetters('layout', ['projectId'])
   },
   methods: {
-    load() {
-      this.count += 2
-    },
     copyContent(element) {
       // 双击复制
       let content = element.target.innerText;
@@ -113,6 +143,96 @@ export default {
         type: 'success',
         duration: 1000
       });
+    },
+    getToBeSuppement() {
+      let params = {
+        ProjectId: this.projectId,
+        Cascade: [
+          {
+            "Name": "equipFamily"
+          },
+          {
+            "Name": "familyName"
+          }
+        ],
+        Filters: `ModelId in ${this.equipComDelList}`,
+        PageNumber: this.page.pageNumber,
+        PageSize: this.page.pageSize
+      }
+      toBeSupplementEquip(params, res => {
+        this.pageData = res.Content;
+        this.pageData.forEach(item => {
+          if (item.BIMLocation) {
+            let local = {};
+            let ary = item.BIMLocation.split(',');
+            let localAry = ['X', 'Y', 'Z'];
+            ary.forEach((item, index) => {
+              local[localAry[index]] = ary[index];
+            })
+            item.local = local;
+          }
+          if (item.ScanTaskBase && item.ScanTaskBase.length > 1) {
+            item.ScanTaskBase = item.ScanTaskBase.shift();
+          }
+          if (item.EquipFamily && item.EquipFamily.length) {
+            item.Res = '';
+            item.EquipFamily.forEach((it, index) => {
+              if (index !== item.EquipFamily.length - 1) {
+                item.Res += `${it.EquipCode + it.EquipName + ","}`;
+              } else {
+                item.Res += `${it.EquipCode + it.EquipName}`;
+              }
+            })
+          }
+        });
+        this.$nextTick(() => {
+          this.getGraphy();
+        })
+      })
+    },
+    getGraphy() {// 绘制空间位置图片
+      let can = this.$refs.canvas;
+      let that = this;
+      that.clearGraphy(this.i)
+      that.scene = new LocationPointScene();
+      this.canvasLoading = true;
+      that.scene.getFloorData('/modelapi/base-graph/query', { ModelId: can[this.i].dataset.modelid }).then(res => {
+        that.canvasLoading = false;
+        if (res == 'error') {
+          this.FloorMap = '';
+          this.$message.warning('数据解析异常');
+          return;
+        }
+        let modelID = can[this.i].dataset.modelid
+        let EquipID = can[this.i].dataset.equipid;
+        let X = Number(can[this.i].dataset.x);
+        let Y = can[this.i].dataset.y * -1;
+        // console.log(X, Y)
+        that.view.scene = that.scene;
+        this.scene.addMarker({
+          Id: EquipID,
+          X: X,
+          Y: Y
+        })
+        that.view.fitSceneToView();
+        this.scene.isSpaceSelectable = false;
+        this.i++;
+      })
+    },
+    clearGraphy(i) {
+      // if (this.view && this.view.scene) {
+      //   this.view.scene = null;
+      //   return
+      // }
+      this.view = new FloorView(`canvas${i}`)
+    }
+  },
+  watch: {
+    i() {
+      if (this.i >= this.pageData.length) {
+        return;
+      }
+      this.getGraphy();
     }
   }
 }

+ 0 - 14
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>
                 数据暂无