Browse Source

feat:添加附加数据功能

xiebeibei 3 years ago
parent
commit
443e401d3f

+ 1 - 0
debug.log

@@ -0,0 +1 @@
+[0124/113958.357:ERROR:directory_reader_win.cc(43)] FindFirstFile: 系统找不到指定的路径。 (0x3)

+ 22 - 0
src/api/equipmentList.js

@@ -86,3 +86,25 @@ export function downloadExcel({ getParams }) {
 export function previewExecl({ getParams }) {
     return httputils.preview(`/data/file/downloadExcel`, getParams)
 }
+
+
+// 设备设施附加数据-查看数据是否填写完整
+export function addDataCheckComplete({ data }) {
+    return httputils.fetchJson(`/data/addData/checkComplete`, data)
+}
+// 设备设施附加数据-消防系统数据预览/数据回显
+export function addDataPreviewFireControl({ data }) {
+    return httputils.fetchJson(`/data/addData/previewFireControl`, data)
+}
+// 设备设施附加数据-弱电系统数据预览/回显
+export function addDataPreviewWeakCurrent({ data, postParams }) {
+    return httputils.fetchJson(`/data/addData/previewWeakCurrent`, data, postParams)
+}
+// 设备设施附加数据-消防系统编辑完保存
+export function addDataSaveFireControl({ data, postParams }) {
+    return httputils.fetchJson(`/data/addData/saveFireControl`, data, postParams)
+}
+// 设备设施附加数据-弱电系统编辑完保存
+export function addDataSaveWeakCurrent({ data, postParams }) {
+    return httputils.fetchJson(`/data/addData/saveWeakCurrent`, data, postParams)
+}

File diff suppressed because it is too large
+ 1053 - 0
src/views/equipment/addDataDialog.vue


+ 241 - 0
src/views/equipment/addDataTable.vue

@@ -0,0 +1,241 @@
+<template>
+    <div>
+        <el-table  v-if="systemName=='弱电系统'"
+                   :data="tableData"
+                   border
+                   :show-summary="!examplesBoo"  max-height="450"
+                   style="width: 100%" :header-cell-style="()=>{
+                                return {
+                                  background:'#E5EEF6'
+                                }
+                              }"   :span-method="objectSpanMethod">
+            <el-table-column
+                    prop="fireZone"
+                    label="分区">
+            </el-table-column>
+            <el-table-column
+                    prop="system"
+                    label="系统">
+            </el-table-column>
+            <el-table-column
+                    prop="monitorCount"
+                    label="数量">
+                <template slot-scope="scope">
+                    <span type="text" v-if="scope.row.system=='监控系统'">{{scope.row.monitorCount}}</span>
+                    <span type="text" v-if="scope.row.system=='BA系统'">{{scope.row.baCount}}</span>
+                    <span type="text" v-if="scope.row.system=='DDC'">{{scope.row.ddcCount}}</span>
+                    <span type="text" v-if="scope.row.system=='门禁系统'">{{scope.row.accessCount}}</span>
+                </template>
+            </el-table-column>
+        </el-table>
+        <el-table  v-if="systemName=='消防系统'"
+                   :data="tableData"
+                   border   max-height="450"
+                   :show-summary="!examplesBoo"
+                   style="width: 100%;" :header-cell-style="()=>{return { background:'#E5EEF6'  } }" :cell-style="({row, column, rowIndex, columnIndex})=>{
+                        return { background:examplesBoo&&rowIndex==2&&columnIndex==1?'#EFF0F1':'#fff'  }
+                     }"   :span-method="objectSpanMethod">
+            <el-table-column
+                    prop="fireZone"
+                    label="防火分区"
+            >
+            </el-table-column>
+            <el-table-column
+                    prop="hostNum"
+                    label="主机编号">
+                <template slot-scope="scope">
+                    <div v-if="scope.row.isFm==0">{{scope.row.manageScope}}</div>
+                    <span v-if="scope.row.isFm==1">{{scope.row.hostNum}}</span>
+                </template>
+            </el-table-column>
+            <el-table-column
+                    prop="loopNum"
+                    label="回路编号">
+            </el-table-column>
+            <el-table-column
+                    prop="smokeCount"
+                    label="烟感数量"> 
+            </el-table-column>
+            <el-table-column
+                    prop="warmCount"
+                    label="温感数量">
+            </el-table-column>
+            <el-table-column
+                    prop="handNewCount"
+                    label="手报数量">
+            </el-table-column>
+            <el-table-column
+                    prop="fireHydrantCount"
+                    label="消火栓数量" width="85">
+            </el-table-column>
+            <el-table-column
+                    prop="moduleCount"
+                    label="模块数量">
+            </el-table-column>
+        </el-table>
+    </div>
+</template>
+
+<script>
+    export default {
+        name: "addDataTable",
+        props:{
+            systemName:String,
+            examplesBoo:Boolean,
+            tableData:{
+                type: Array,
+                default: ()=>{
+                    return [ {
+                        fireZone: '',
+                        system: '监控系统',
+                        monitorCount: '',
+                    },
+                        {
+                            fireZone: '',
+                            system: 'BA系统',
+                            baCount: '',
+                        },
+                        {
+                            fireZone: '',
+                            system: 'DDC',
+                            ddcCount: '',
+                        },
+                        {
+                            fireZone: '',
+                            system: '门禁系统',
+                            accessCount: '',
+                        },]
+                }
+            },
+            tableData2:{
+                type:Array,
+                default:()=>{
+                    return  [
+                        {
+                            fireZone: '',
+                            isFm: '1',
+                            hostNum: '',
+                            loopNum: '',
+                            smokeCount: '',
+                            warmCount: '',
+                            handNewCount: '',
+                            fireHydrantCount: '',
+                            moduleCount: '',
+                        }
+                    ]
+                }
+            },
+            totalCount:{
+                type:Object,
+                default:()=>{
+                    return {
+                        "monitorTotalCount":"",   //监控系统总数量
+                        "baTotalCount":"",        //BA系统总数量
+                        "ddcTotalCount":"",       //DDC总数量
+                        "accessTotalCount":""    //门禁系统总数量
+                    }
+
+                }
+            }
+        },
+        data(){
+            return {
+            }
+        },
+        methods:{
+            objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+                if(this.systemName=='弱电系统'){
+                    if (columnIndex === 0) {
+                        if (rowIndex % 4 === 0) {
+                            return {
+                                rowspan: 4,
+                                colspan: 1
+                            };
+                        } else {
+                            return {
+                                rowspan: 0,
+                                colspan: 0
+                            };
+                        }
+                    }
+                }
+                if(this.systemName=='消防系统'){
+                    console.log(row, column, rowIndex, columnIndex);
+                    if (row.isFm == 0) {
+                        if (columnIndex === 1) {
+                            return {
+                                rowspan: 1,
+                                colspan: 7
+                            };
+                        }
+                    }
+                }
+                this.$nextTick(() => {
+                    if(this.systemName=='弱电系统'){
+                        var lastLine = document.getElementsByClassName("el-table__footer")[0]
+                            .children[1];
+                        lastLine.innerHTML = ''
+                        for(let i=0;i<4;i++){
+                            var newnode = document.createElement("tr");
+                            if(i==0){
+                                newnode.innerHTML = "<td class='cell' style='font-size: 12px!important;background: #E5EEF6!important;'>合计</td>" +
+                                    "<td class='cell cellbg'>监控系统</td>" + `<td class='cell'>${this.totalCount.monitorTotalCount}</td>`;
+                            }
+                            if(i==1){
+                                newnode.innerHTML =
+                                    "<td  class='cell cellbg'>BA系统</td>" +
+                                    `<td  class='cell'>${this.totalCount.baTotalCount}</td>`;
+                            }
+                            if(i==2){
+                                newnode.innerHTML =
+                                    "<td class='cell cellbg'>DDC</td>" +
+                                    `<td  class='cell'>${this.totalCount.ddcTotalCount}</td>`;
+                            }
+                            if(i==3){
+                                newnode.innerHTML =
+                                    "<td  class='cell cellbg'>门禁系统</td>" +
+                                    `<td class='cell'>${this.totalCount.accessTotalCount}</td>`;
+                            }
+
+                            lastLine.appendChild(newnode);
+                        }
+                        let tds = document.querySelectorAll(".el-table__footer-wrapper tr>td");
+                        tds[0].rowSpan = 4;
+                    }
+                    if(this.systemName=='消防系统'){
+                        let tds = document.querySelectorAll(".el-table__footer-wrapper tr>td");
+                        tds[0].colSpan = 3;
+                        tds[1].style.display = "none";
+                        tds[2].style.display = "none";
+                    }
+                });
+            },
+        }
+    }
+</script>
+
+<style scoped lang="less">
+    /deep/ .el-table{
+        .cell{
+            color: #000000!important;
+            text-align: center!important;
+        }
+        .el-table__footer-wrapper{
+            td{
+                background: #ffffff!important;
+            }
+            tr:first-child{
+                td:first-child{
+                    background: #E5EEF6!important;
+                }
+
+            }
+            .cellbg{
+                background: #ffffff!important;
+            }
+        }
+       .el-table__body tr:hover > td {
+            background-color: unset;
+        }
+    }
+</style>

+ 264 - 41
src/views/equipment/index.vue

@@ -74,16 +74,26 @@
                 ref="additionalBox"
                 v-if="fqPic.length > 0 && (smsxt == '1003' || smsxt == '1004')"
               >
-                <div
-                  class="additional2"
-                  @click="additionalColl"
-                  v-if="showView === 3"
-                >
-                  <img src="../../assets/imgs/bg2.png" alt />
-                </div>
-                <div class="additional" @click="additionalColl" v-else>
-                  <img src="../../assets/imgs/bg.png" alt />
-                </div>
+
+                  <el-badge :is-dot="visibleTooltip" class="item" >
+                    <a-tooltip  v-if="showView === 3" placement="bottomRight" :defaultVisible="visibleTooltip" overlayClassName="additional-box-tooltip" :visible="visibleTooltip">
+                      <template slot="title">
+                        <span>数据填写不完整,请检查并完善</span>
+                      </template>
+                    <div
+                            class="additional2"
+                            @click="additionalColl"
+                            >
+                      <img src="../../assets/imgs/bg2.png" alt />
+                    </div>
+                </a-tooltip>
+                    <div class="additional" @click="additionalColl" v-else>
+                      <img src="../../assets/imgs/bg.png" alt />
+                    </div>
+                  </el-badge>
+
+
+
                 <el-collapse-transition>
                   <div
                     v-show="showView === 3"
@@ -95,8 +105,13 @@
                       <img :src="fqPic[0].url" alt />
                     </div> -->
                     <!--  -->
-                    <div>
-                       该div内为谢贝贝开发区域
+                    <div class="add-data-box">
+<!--                       该div内为谢贝贝开发区域-->
+                      <div class="add-data-table" style="max-height: 500px">
+<!--                        <addDataTable :system-name="systemName" :tableData2="tableData" :tableData="tableData" :totalCount="totalCount" :examplesBoo="false"></addDataTable>-->
+                        <addDataTable :system-name="systemName" :tableData="tableData" :totalCount="totalCount" :examplesBoo="false"></addDataTable>
+                      </div>
+                      <el-button type="primary" class="add-data-editbtn" @click="addDataVisible=!addDataVisible">编辑</el-button>
                     </div>
                   </div>
                 </el-collapse-transition>
@@ -115,6 +130,8 @@
       @emitCount="emitCount"
       @closeModal="closeModal"
     ></eq-dialog>
+<!--编辑点击弹窗-->
+      <addDataDialog v-if="addDataVisible" :systemName="systemName" @handelCancel="handelCancel" :tableData="tableData"></addDataDialog>
   </div>
 </template>
 
@@ -122,6 +139,8 @@
 import floorList from "@/components/floorList.vue";
 import floorMap from "@/components/floorMap/index.vue";
 import eqDialog from "./eqDialog";
+import addDataDialog from "./addDataDialog";
+import addDataTable from "./addDataTable";
 import { system } from "@/utils/plugins/components.js";
 import { queryPic, getPvUv } from "@/api/public.js";
 import {
@@ -129,6 +148,9 @@ import {
   downloadExcel,
   previewExecl,
   uploadExcelTemplate,
+    addDataCheckComplete,
+    addDataPreviewFireControl,
+    addDataPreviewWeakCurrent,
 } from "@/api/equipmentList.js";
 import { mapGetters } from "vuex";
 import store from "../../store";
@@ -136,31 +158,36 @@ import XLSX from "xlsx";
 import { Alert } from "ant-design-vue";
 export default {
   data() {
-    return {
-      system,
-      everySystem: [],
-      systemId: 1,
-      categoryId: "GDXT",
-      systemName: "供电系统",
-      floorInfo: {},
-      smsxt: "1001",
-      dialogInfo: {},
-      brand: [], //品牌
-      manufacturer: [],
-      fqPic: [],
-      loadName: "",
-      type: "",
-      objCount: [],
-      bottomOffset: 0,
-      keyFL: "keyFL" + new Date().getTime(),
-      keyLd: "keyLd_" + new Date().getTime(),
-      ShowDialog: false, //是否显示弹窗
-      showLookPic: false,
-      showExeclTooltip: false, // 是否展示execl提示信息,
-      showXFXTToltip: false, //是否展示消防系统tooltip
-    };
+      return {
+          system,
+          everySystem: [],
+          systemId: 1,
+          categoryId: "GDXT",
+          systemName: "供电系统",
+          floorInfo: {},
+          smsxt: "1001",
+          dialogInfo: {},
+          brand: [], //品牌
+          manufacturer: [],
+          fqPic: [],
+          loadName: "",
+          type: "",
+          objCount: [],
+          bottomOffset: 0,
+          keyFL: "keyFL" + new Date().getTime(),
+          keyLd: "keyLd_" + new Date().getTime(),
+          ShowDialog: false, //是否显示弹窗
+          showLookPic: false,
+          showExeclTooltip: false, // 是否展示execl提示信息,
+          showXFXTToltip: false, //是否展示消防系统tooltip
+
+          addDataVisible: false,//附加数据弹窗
+          visibleTooltip:false, //是否展示附加数据有无数据提示信息
+          tableData:[],
+          totalCount:{},
+      };
   },
-  components: { floorList, eqDialog, floorMap },
+  components: { floorList, eqDialog, floorMap,addDataDialog ,addDataTable},
   watch: {
     // 监听currentFloor变化,重新渲染楼层组件,解决 数据与视图不照应的问题
     /* '$store.state.currentFloor': {
@@ -173,6 +200,10 @@ export default {
         } */
   },
   methods: {
+      //附加数据弹窗取消
+      handelCancel(data){
+          this.addDataVisible = data;
+      },
     showToolTip() {
       this.showExeclTooltip = true;
       if (this.smsxt == 1003) {
@@ -333,6 +364,8 @@ export default {
       // 目前消防和弱电下面有特殊的数据表格
       if (this.smsxt == "1003" || this.smsxt == "1004") {
         this.queryTable(this.smsxt);
+          //检测消防和弱电下是否表格有数据
+          this.addDataCheckCompleteFun();
       }
     },
     //判断有没有原理图,如果没有则不出现系统原理图列表li
@@ -385,7 +418,8 @@ export default {
     },
     //附加数据图片查看 showView为3展示状态
     additionalColl() {
-      // // 走预览接口
+        console.log('this.floorInfo',this.floorInfo);
+        // // 走预览接口
       // this.previewExl();
       // 调整样式
       if (this.showView != 3) {
@@ -395,7 +429,7 @@ export default {
           let d = this.$refs.addImgContainer.offsetHeight;
           let bottomOffset = p + 44 - d;
           if (bottomOffset >= 0) {
-            this.bottomOffset = 0;
+            this.bottomOffset = this.visibleTooltip?0:-100;
           } else {
             this.bottomOffset = bottomOffset;
           }
@@ -403,6 +437,14 @@ export default {
       } else {
         this.$store.commit("SETSHOWVIEW", 0);
       }
+        if(this.systemName =='消防系统'){
+            this.addDataPreviewFireControlFun();
+        }
+        if(this.systemName =='弱电系统'){
+            this.addDataPreviewWeakCurrentFun();
+        }
+
+
     },
     // 查询附加数据图片
     queryTable(system) {
@@ -457,6 +499,160 @@ export default {
         this.$cookie.set("categoryId", "SCPZ");
       }
     },
+    //  查看数据是否填写完整
+      addDataCheckCompleteFun() {
+          let params = {
+              projectId: this.plazaId,
+              systemCode: this.smsxt,
+              floor: this.floorInfo.gname,
+          }
+          addDataCheckComplete({params}).then(res=>{
+          // let res = {
+          //     "result": "success",                       //状态信息 success:调用成功  fail:调用失败
+          //     "data": {
+          //         "isComplate": false,                       //是否完整, true: 完整  false :不完整
+          //         "desc": "数据填写不完整,请检查并完善"         // 描述信息
+          //     }
+          // }
+          if (res.result == 'success') {
+              if (!res.data.isComplate) {
+                  this.visibleTooltip = false;
+              } else {
+                  this.visibleTooltip = true;
+              }
+          }else{
+              this.$message({
+                  message: res.message,
+                  type: 'error'
+              })
+          }
+          console.log(res);
+          })
+    },
+      // 消防系统数据预览/数据回显
+    addDataPreviewFireControlFun(){
+        let params = {
+            projectId: this.plazaId,
+            systemCode: this.smsxt,
+            floor: this.floorInfo.gname,
+            getTotal:'0'
+        }
+        // addDataPreviewFireControl({params}).then(res=>{
+        let res = {
+            "result": "success",                       //状态信息 success:调用成功  fail:调用失败
+            "data":{
+                "infoList":[{
+                    "fireZone":"C1-C1-C1-C1-9",      //防火分区
+                    "isFm": "1",            //是否属于工程物业管理范围,0:否,1:是
+                    "hostNum":"2",          //主机编号
+                       //烟感数量
+                    "warmCount":"999999",       //温感数量
+                    "handNewCount":"13",    //手报数量
+
+                    "moduleCount":"999999"       //模块数量
+                },{
+                    "fireZone":"C1-10",      //防火分区
+                    "isFm": "0",            //是否属于工程物业管理范围,0:否,1:是
+                    "manageScope":"合作方管理范围"   //管理范围
+                } ],
+                "totalCount":{          //总数量,当传入的参数getTotal的值为1时有该数据
+                    "smokeTotalCount":"20",      //烟感总数量
+                    "warmTotalCount":"12",       //温感总数量
+                    "handNewTotalCount":"13",    //手报总数量
+                    "fireHydrantTotalCount":"15",  //消火栓总数量
+                    "moduleTotalCount":"33"       //模块总数量
+                }
+            }
+        };
+          if(res.result=='success'){
+              this.tableData = res.data.infoList;
+          }else{
+              this.$message({
+                  message: res.message,
+                  type: 'error'
+              })
+          }
+
+        // })
+      },
+      //弱电系统数据预览/回显
+      addDataPreviewWeakCurrentFun(){
+          let params = {
+              projectId: this.plazaId,
+              systemCode: this.smsxt,
+              floor: this.floorInfo.gname,
+              getTotal:'1'
+          }
+          // addDataPreviewWeakCurrent({params}).then(res=>{
+         let res =  {
+              "result": "success",                       //状态信息 success:调用成功  fail:调用失败
+              "data":{
+              "infoList":[{
+                  "fireZone":"C区",      //分区
+                  "monitorCount":"2",   //监控系统数量
+                  "baCount":"3",        //BA系统数量
+                  "ddcCount":"4",       //DDC数量
+                  "accessCount":"20"    //门禁系统数量
+              },{
+                  "fireZone":"C区",      //分区
+                  "monitorCount":"2",   //监控系统数量
+                  "baCount":"5",        //BA系统数量
+                  "ddcCount":"4",       //DDC数量
+                  "accessCount":"20"    //门禁系统数量
+              } ],
+                  "totalCount":{            //总数量,当传入的参数getTotal的值为1时有该数据
+                  "monitorTotalCount":"2",   //监控系统总数量
+                      "baTotalCount":"3",        //BA系统总数量
+                      "ddcTotalCount":"4",       //DDC总数量
+                      "accessTotalCount":"20"    //门禁系统总数量
+              }
+          }
+          }
+          this.tableData =[];
+          if(res.result=='success'){
+
+              res.data.infoList.length && res.data.infoList.map(item=>{
+                  let arr =   [
+                      {
+                          fireZone: '',
+                          system: '监控系统',
+                          monitorCount: '',
+                      },
+                      {
+                          fireZone: '',
+                          system: 'BA系统',
+                          baCount: '',
+                      },
+                      {
+                          fireZone: '',
+                          system: 'DDC',
+                          ddcCount: '',
+                      },
+                      {
+                          fireZone: '',
+                          system: '门禁系统',
+                          accessCount: '',
+                      },
+                  ];
+                   arr[0].fireZone = item.fireZone;
+                   arr[0].monitorCount = item.monitorCount;
+                   arr[1].baCount = item.baCount;
+                   arr[2].ddcCount = item.ddcCount;
+                   arr[3].accessCount = item.accessCount;
+                  this.tableData.push(...arr);
+              })
+              console.log(this.tableData);
+              this.totalCount = res.data.totalCount
+
+          }else{
+              this.$message({
+                  message: res.message,
+                  type: 'error'
+              })
+          }
+
+          // })
+      },
   },
   created() {
     /**
@@ -648,6 +844,11 @@ export default {
             z-index: 9;
             right: 32px;
             top: 142px;
+            /deep/ .el-badge__content.is-dot{
+              width: 12px;
+              height: 12px;
+              background: #F54E45;
+            }
           }
           .additional-box {
             position: relative;
@@ -679,7 +880,7 @@ export default {
               box-shadow: 0px 2px 15px 0px rgba(31, 36, 41, 0.08);
             }
             .add-img-container {
-              width: 450px;
+              /*width: 450px;*/
               max-height: 674px;
               overflow-y: auto;
               background: #ffffff;
@@ -733,11 +934,25 @@ export default {
                 }
               }
             }
+
           }
         }
       }
     }
   }
+
+   .add-data-box {
+      display: flex;
+     flex-direction: column;
+     .add-data-table{
+         flex: 1;
+     }
+     .add-data-editbtn{
+       width: 65px;
+      margin-left: auto;
+       margin-top: 20px;
+     }
+   }
 }
 @media screen and (max-width: 1600px) {
   /*当屏幕尺寸小于1366px时,应用下面的CSS样式*/
@@ -751,12 +966,20 @@ export default {
     .eq-content
     .additional-box
     .add-img-container {
-    width: 360px;
-    max-height: 480px;
+    /*width: 360px;*/
+    /*max-height: 480px;*/
   }
 }
 </style>
 <style lang="less">
+  .additional-box-tooltip{
+    /deep/ .ant-tooltip-inner{
+      background: linear-gradient(180deg, #369CF7 0%, #025BAA 100%)!important;
+    }
+    .ant-tooltip-arrow::before{
+      background: #3398F2!important;
+    }
+  }
 .el-table {
   th {
     background: rgba(248, 249, 250, 1);