Browse Source

模型质量报告-待删除的设备、待补充的设备 按钮修改成没有数据的时候disable

shaun-sheep 4 years ago
parent
commit
b669af58b6

+ 3 - 3
config/dev.env.js

@@ -9,9 +9,9 @@ module.exports = merge(prodEnv, {
     // BASE_URL: '"http://192.168.20.236"', //(新)测试iframe地址
     // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
     // MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址
-    SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
-    BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
-    MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
+    // SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
+    // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
+    // MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址
 })
 
 

+ 3 - 3
config/prod.env.js

@@ -1,11 +1,11 @@
 'use strict'
 module.exports = {
     NODE_ENV: '"production"',
- //   BASE_URL: '"http://172.16.44.215"', //测试iframe地址
-    //SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
+   // BASE_URL: '"http://172.16.44.215"', //测试iframe地址
+   //  SSO_SERVER: '"http://172.16.44.235:8081"', //测试环境
     // BASE_URL: '"http://192.168.20.236"', //(新)测试iframe地址
     // SSO_SERVER: '"http://192.168.20.236:8086"', //(新)测试环境
-    //MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址
+    // MQTT_SERVICE: '"ws://172.16.42.210:61614/stomp/"' //MQ测试环境地址
     BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址
     SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境
      MQTT_SERVICE: '"ws://adm.sagacloud.cn/stomp/"' //MQ正式环境地址

+ 38 - 36
src/components/model/file/addFloorDialog.vue

@@ -7,7 +7,7 @@
       width="900px"
       :before-close="handleClose"
     >
-      <el-form ref="addfloorform" :model="form" label-width="120px">
+      <el-form ref="addfloorform" :model="form" label-width="120px" style="overflow: hidden">
         <el-form-item label="模型文件:">
           <el-upload
             class="upload-demo"
@@ -73,48 +73,50 @@
         <el-form-item label="备注信息:">
           <el-input type="textarea" v-model="form.desc"></el-input>
         </el-form-item>
-        <el-form-item>
-          <el-button type="primary" @click="onSubmit">确认</el-button>
+        <el-form-item style="float: right">
+          <el-button type="primary" @click="onSubmit" >确认</el-button>
           <el-button @click="handleClose">取消</el-button>
         </el-form-item>
       </el-form>
+        <div style="float: right;margin-top: -10px;color:#AAAAAA">目前只可识别标准字典定义的设备、部件</div>
     </el-dialog>
   </div>
 </template>
 <script>
-import request from "@/api/model/file.js";
-import { mapGetters } from "vuex";
-export default {
-  props: {
-    addFloorFileVisible: Boolean,
-    FolderName: String,
-    floorList: Array,
-    FolderId: String
-  },
-  computed: {
-    ...mapGetters("layout", ["projectId", "userInfo","userId", "secret", "uploaderList"])
-  },
-  data() {
-    return {
-      form: {
-        desc: "", //描述
-        revitVersion: "2017", //revit默认版本
-        floorTypeVal: "F", //楼层类型得值
-        interlayerTypeVal: "M1", //夹层类型得值
-        haveInterlayer: false, //是否有夹层
-        file: null, //上传文件
-        floorNum: 1 //楼层
-      },
-      fileList: [], //上传楼层列表
-      revitVersionList: [
-        {
-          value: "2016",
-          label: "2016"
-        },
-        {
-          value: "2017",
-          label: "2017"
+  import request from "@/api/model/file.js";
+  import {mapGetters} from "vuex";
+
+  export default {
+    props: {
+      addFloorFileVisible: Boolean,
+      FolderName: String,
+      floorList: Array,
+      FolderId: String
+    },
+    computed: {
+      ...mapGetters("layout", ["projectId", "userInfo", "userId", "secret", "uploaderList"])
+    },
+    data() {
+      return {
+        form: {
+          desc: "", //描述
+          revitVersion: "2017", //revit默认版本
+          floorTypeVal: "F", //楼层类型得值
+          interlayerTypeVal: "M1", //夹层类型得值
+          haveInterlayer: false, //是否有夹层
+          file: null, //上传文件
+          floorNum: 1 //楼层
         },
+        fileList: [], //上传楼层列表
+        revitVersionList: [
+          {
+            value: "2016",
+            label: "2016"
+          },
+          {
+            value: "2017",
+            label: "2017"
+          },
         {
           value: "2018",
           label: "2018"
@@ -202,7 +204,7 @@ export default {
             this.$emit("finishCreateFloor", {
               modelId: res.ModelId,
               uploadId: res.UploadId,
-              floorId: res.floorId, 
+              floorId: res.floorId,
               file: this.form.file
             });
             this.handleClose();

+ 7 - 7
src/components/model/file/replaceModelDialog.vue

@@ -52,10 +52,11 @@
           </div>
         </el-form-item>
       </el-form>
-      <span slot="footer" class="dialog-footer">
+      <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="onSubmit">确认</el-button>
         <el-button @click="handleClose">取消</el-button>
-      </span>
+      <div style="width:100%;margin-top:5px;color:#AAAAAA">目前只可识别标准字典定义的设备、部件</div>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -139,13 +140,12 @@ export default {
 };
 </script>
 <style lang="less">
-#addFloorDialog {
-  .floorModle {
-    display: flex;
-    justify-content: left;
-  }
+#replaceModel {
   .dialog-footer {
     text-align: right;
   }
+  /deep/ .el-dialog__footer{
+    padding: 10px;
+  }
 }
 </style>

+ 229 - 236
src/views/model/report/index.vue

@@ -26,13 +26,11 @@
       </div>
       <div class="content-box">
         <div class="button">
-          <el-button @click="del" :plain="toBeDelCount?false:true" :disabled="toBeDelCount?false:true"
-                     :title="toBeDelCount ? '':'没有待删除的设备'">需从模型中删除的设备
+          <el-button @click="del"  :disabled="toBeDelCount?false:true" :title="toBeDelCount ? '':'没有待删除的设备'">需从模型中删除的设备
           </el-button>
-          <el-button @click="supplement" :plain="toBeSuppCount?false:true" :disabled="toBeSuppCount?false:true"
-                     :title="toBeSuppCount ? '':'没有待补充的设备'">模型待补充的设备
+          <el-button @click="supplement" :disabled="toBeSuppCount?false:true" :title="toBeSuppCount ? '':'没有待补充的设备'">模型待补充的设备
           </el-button>
-          <el-button type="info" :loading="load" @click='getExportReport'>导出模型问题报告</el-button>
+          <el-button :loading="load" @click='getExportReport'>导出模型问题报告</el-button>
         </div>
         <div class="table"
              :style="tableList&&tableList.length?'width: 100%;height: calc(100% - 47px)':'width: 100%;height: calc(100% - 10px)'">
@@ -163,7 +161,7 @@
             </template>
           </el-table>
           <el-pagination class="right" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.pageNumber"
-            :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="page.total">
+                         :page-sizes="page.pageSizes" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="page.total">
           </el-pagination>
         </div>
       </div>
@@ -208,261 +206,261 @@
         toBeSuppCount: 0,
         toBeDelCount: 0
       }
-  },
-  mounted() { },
-  created() {
-    this.params = {
-      Orders: "Name asc"
-    }
-    this.getModelFileCount();
-    this.getModelFloorCount();
-  },
-  computed: {
-    ...mapGetters('layout', ['projectId'])
-  },
-  methods: {
-    cellStyle({row, column, rowIndex, columnIndex}) {
-      if (column.label !== '模型楼层' && column.label !== '待删除设备数量' && column.label !== '待补充设备数量' && column.label !== '有问题的检查项') {
-        return {
-          background: '#f3f3f3',
-          lineHeight: '30px'
-        }
+    },
+    mounted() { },
+    created() {
+      this.params = {
+        Orders: "Name asc"
       }
+      this.getModelFileCount();
+      this.getModelFloorCount();
     },
-    getModelFloorCount() {// 获取楼层模型文件数量,计算出检查出问题的模型文件
-      let promise1 = new Promise(resolve => {
-        queryFloorList({Filters:"Status=4"}, res => {
-          resolve(res);
-        })
-      })
-      Promise.all([promise1]).then(response => {
-        this.problemCount = 0;
-        let res = response[0];
-        this.modelFloorCount = res.Total;
-        this.modelFloor = res.Content;
-        this.getModelFileIcon();
-        this.modelFloor.forEach(item => {
-          if (!item.DataCheckResult) {
-            this.problemCount++;
+    computed: {
+      ...mapGetters('layout', ['projectId'])
+    },
+    methods: {
+      cellStyle({row, column, rowIndex, columnIndex}) {
+        if (column.label !== '模型楼层' && column.label !== '待删除设备数量' && column.label !== '待补充设备数量' && column.label !== '有问题的检查项') {
+          return {
+            background: '#f3f3f3',
+            lineHeight: '30px'
           }
+        }
+      },
+      getModelFloorCount() {// 获取楼层模型文件数量,计算出检查出问题的模型文件
+        let promise1 = new Promise(resolve => {
+          queryFloorList({Filters:"Status=4"}, res => {
+            resolve(res);
+          })
         })
-      })
-    },
-    getModelFileIcon() {// 计算文件夹的图标
-      this.tableList.forEach(item => {
-        this.modelFloor.forEach(it => {
-          if (item.Code === it.FolderId) {
+        Promise.all([promise1]).then(response => {
+          this.problemCount = 0;
+          let res = response[0];
+          this.modelFloorCount = res.Total;
+          this.modelFloor = res.Content;
+          this.getModelFileIcon();
+          this.modelFloor.forEach(item => {
             if (!item.DataCheckResult) {
-              item.flag = false;
+              this.problemCount++;
             }
-          }
-        })
-      })
-    },
-    getData(tab) {// 切换tab时执行
-      this.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}`,
-        PageNumber: this.page.pageNumber,
-        PageSize: this.page.pageSize
-      }
-      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 !== "FloorName" && key !== "questionItem") {
-                i += 1;
-                item.questionItem += 1;
+        })
+      },
+      getModelFileIcon() {// 计算文件夹的图标
+        this.tableList.forEach(item => {
+          this.modelFloor.forEach(it => {
+            if (item.Code === it.FolderId) {
+              if (!item.DataCheckResult) {
+                item.flag = false;
               }
             }
           })
-          this.floorIconType = i;
-        }
-        this.getLostModelFloor();
-      })
-    },
-    getLostModelFloor() {// 获取缺失楼层
-      let params = {
-        ProjectId: this.projectId,
-        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}`
+        })
+      },
+      getData(tab) {// 切换tab时执行
+        this.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}`,
+          PageNumber: this.page.pageNumber,
+          PageSize: this.page.pageSize
         }
-      })
-      let params = {
-        ProjectId: this.projectId,
-        data: equipComDelList
-      }
-      let promise1 = new Promise(resolve => {
-        getToBeDelEquip(params, res => {
-          resolve(res);
+        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 !== "FloorName" && key !== "questionItem") {
+                  i += 1;
+                  item.questionItem += 1;
+                }
+              }
+            })
+            this.floorIconType = i;
+          }
+          this.getLostModelFloor();
         })
-      })
-      let promise2 = new Promise(resolve => {
-        getSupplement(params, res => {
-          resolve(res);
+      },
+      getLostModelFloor() {// 获取缺失楼层
+        let params = {
+          ProjectId: this.projectId,
+          Filters: `FolderId='${this.activeTab}';Status=4`
+        }
+        queryLostReportList(params, res => {
+          this.LostFloorName = res.Content;
+          this.getToBeCount();
         })
-      })
-      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;
+      },
+      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}`
           }
-          this.LostFloorName.forEach(it => {
-            if (item.ModelId === it.CurrentModelId) {
-              it.toBeDel = item.Count;
-            }
+        })
+        let params = {
+          ProjectId: this.projectId,
+          data: equipComDelList
+        }
+        let promise1 = new Promise(resolve => {
+          getToBeDelEquip(params, res => {
+            resolve(res);
           })
         })
-        res1.Content.forEach(item => {
-          if (item.Count > 0) {
-            this.toBeSuppCount += 1;
-          }
-          this.LostFloorName.forEach(it => {
-            if (item.ModelId === it.CurrentModelId) {
-              it.toBeSupplement = item.Count;
-            }
+        let promise2 = new Promise(resolve => {
+          getSupplement(params, res => {
+            resolve(res);
           })
         })
-        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];
-                }
+        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;
               }
             })
           })
-          this.tableData = this.LostFloorName;
-        } else {
-          this.tableData = [];
-        }
-        this.page.total = this.tableData.length;
-        this.loading = false;
-      })
-    },
-    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 equipComDelList = encodeURIComponent(JSON.stringify(this.equipComDelList));
-      let jumpRouter = this.$router.resolve({ path: '/model/report/supplement', query: { equipComDelList: equipComDelList } })
-      window.open(jumpRouter.href, '_blank')
-    },
-    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;
+          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 = [];
           }
-        } else {
-          let reader = new FileReader()
-          reader.onload = e => {
-            if (e.target.readyState === 2) {
-              let res = {}
+          this.page.total = this.tableData.length;
+          this.loading = false;
+        })
+      },
+      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 equipComDelList = encodeURIComponent(JSON.stringify(this.equipComDelList));
+        let jumpRouter = this.$router.resolve({ path: '/model/report/supplement', query: { equipComDelList: equipComDelList } })
+        window.open(jumpRouter.href, '_blank')
+      },
+      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;
-              res = JSON.parse(e.target.result)
-              that.$message.error(res.Message);
             }
+          } 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)
           }
-          reader.readAsText(res.data)
+        })
+      },
+      tableRowClassName({ row, rowIndex, column }) {// 设置缺失楼层所在行的背景色
+        if (row.flag && row.flag === 'lost') {
+          return 'warning-row';
         }
-      })
-    },
-    tableRowClassName({ row, rowIndex, column }) {// 设置缺失楼层所在行的背景色
-      if (row.flag && row.flag === 'lost') {
-        return 'warning-row';
+      },
+      handleSizeChange(val) {// 切换每页显示数量
+        this.page.pageSize = val;
+        this.getModelFloor();
+      },
+      handleCurrentChange(val) {// 切换页码
+        this.page.pageNumber = val;
+        this.getModelFloor();
       }
     },
-    handleSizeChange(val) {// 切换每页显示数量
-      this.page.pageSize = val;
-      this.getModelFloor();
-    },
-    handleCurrentChange(val) {// 切换页码
-      this.page.pageNumber = val;
-      this.getModelFloor();
-    }
-  },
-  watch: {
-    projectId() {
-      this.getModelFileCount();
-      this.getModelFloorCount();
+    watch: {
+      projectId() {
+        this.getModelFileCount();
+        this.getModelFloorCount();
+      }
     }
   }
-}
 </script>
 
 <style lang="less" scoped>
@@ -504,11 +502,6 @@
     .button {
       padding-left: 10px;
 
-      button {
-        border: 1px solid #dcdfe6;
-        color: #606266;
-        background: white;
-      }
     }
 
     .success-color {