Browse Source

修改动态参数展示问题,检查所有上传组件统一修改限制,等bug

shaun-sheep 4 years ago
parent
commit
0ffb2135a0

+ 69 - 64
src/components/business_space/lib/uploadFiles.vue

@@ -27,7 +27,7 @@
             slot="tip"
             class="el-upload__tip"
             v-if="!readOnly"
-          >请上传文件</div>
+          >请上传文件,且不大于50M</div>
         </span>
 
       </el-upload>
@@ -132,73 +132,78 @@
 
         let file = item.file;
         // try sending
-        let reader = new FileReader();
-
-        let vm = this;
-
-        let fileType = file.name.split(".");
-        let type = fileType[fileType.length - 1];
-        let key = "&key=" + fileType[0] + file.uid + "." + type
-        let CreateTime = tools.formatDate(new Date(file.lastModified))
-        reader.onloadstart = function () {
-          // 这个事件在读取开始时触发
-        };
-        reader.onprogress = function (p) {
-          // 这个事件在读取进行中定时触发
-
-        };
-        reader.onUploadProgress = function (progressEvent) {
-          let percent = (progressEvent.loaded / progressEvent.total * 100) | 0
-          //调用onProgress方法来显示进度条,需要传递个对象 percent为进度值
-          uploader.onProgress({percent: percent})
+        let size = item.file.size;
+        if( size > 50*1024*1024 ) { //文件大于50M
+          this.$message.error('文件不可大于50M,请重新上传')
+          return false
         }
-        reader.onload = function () {
-          // 这个事件在读取成功结束后触发
-        };
-        reader.onloadend = function () {
-          // 这个事件在读取结束后,无论成功或者失败都会触发
-          if (reader.error) {
-          } else {
-            // document.getElementById("bytesRead").textContent = file.size;
-            // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
-            var xhr = new XMLHttpRequest();
-            xhr.open(
-              /* method */
-              "POST",
-              /* target url */
-              "/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
-              /*, async, default to true */
-            );
-            //xhr.overrideMimeType("application/octet-stream");
-            xhr.send(reader.result);
-            xhr.onreadystatechange = function () {
-              if (xhr.readyState == 4) {
-                console.log(xhr)
-                if (xhr.status == 200) {
-                  let fileObject = {
-                    Key: key.split("=")[1],
-                    Type: type,
-                    Name: file.name,
-                    CreateTime,
-                    SystemId: 'dataPlatform'
-                  }
-                  vm.filesArr.push(fileObject);
-
-                  if(vm.isShow === 1) {
-                    let oFile = {}
-                    oFile[vm.contextKey] = vm.filesArr
-                    vm.$emit("change", oFile, vm.defined);
+        else {
+          let reader = new FileReader();
+          let vm = this;
+          let fileType = file.name.split(".");
+          let type = fileType[fileType.length - 1];
+          let key = "&key=" + fileType[0] + file.uid + "." + type
+          let CreateTime = tools.formatDate(new Date(file.lastModified))
+          reader.onloadstart = function () {
+            // 这个事件在读取开始时触发
+          };
+          reader.onprogress = function (p) {
+            // 这个事件在读取进行中定时触发
+
+          };
+          reader.onUploadProgress = function (progressEvent) {
+            let percent = (progressEvent.loaded / progressEvent.total * 100) | 0
+            //调用onProgress方法来显示进度条,需要传递个对象 percent为进度值
+            uploader.onProgress({percent: percent})
+          }
+          reader.onload = function () {
+            // 这个事件在读取成功结束后触发
+          };
+          reader.onloadend = function () {
+            // 这个事件在读取结束后,无论成功或者失败都会触发
+            if (reader.error) {
+            } else {
+              // document.getElementById("bytesRead").textContent = file.size;
+              // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
+              var xhr = new XMLHttpRequest();
+              xhr.open(
+                /* method */
+                "POST",
+                /* target url */
+                "/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
+                /*, async, default to true */
+              );
+              //xhr.overrideMimeType("application/octet-stream");
+              xhr.send(reader.result);
+              xhr.onreadystatechange = function () {
+                if (xhr.readyState == 4) {
+                  console.log(xhr)
+                  if (xhr.status == 200) {
+                    let fileObject = {
+                      Key: key.split("=")[1],
+                      Type: type,
+                      Name: file.name,
+                      CreateTime,
+                      SystemId: 'dataPlatform'
+                    }
+                    vm.filesArr.push(fileObject);
+
+                    if(vm.isShow === 1) {
+                      let oFile = {}
+                      oFile[vm.contextKey] = vm.filesArr
+                      vm.$emit("change", oFile, vm.defined);
+                    } else {
+                      vm.$emit("change", vm.filesArr, vm.defined);
+                    }
                   } else {
-                    vm.$emit("change", vm.filesArr, vm.defined);
+                    this.$message.error(res.data.ResultMsg)
                   }
-                } else {
-                  this.$message.error(res.data.ResultMsg)
                 }
-              }
-            };
-          }
-        };
-        reader.readAsArrayBuffer(file);
+              };
+            }
+          };
+          reader.readAsArrayBuffer(file);
+        }
       }
     },
     watch: {

+ 3 - 0
src/components/dialogs/list/batchDialog.vue

@@ -453,6 +453,9 @@
 
 <style scoped lang="less">
   .batchContainer {
+    /deep/ .el-table-column--selection .cell {
+      padding: 0;
+    }
     /deep/ .el-step__description {
       margin: 2% 0;
     }

+ 32 - 13
src/components/ledger/details/detail/exhibitionEnergy.vue

@@ -1,19 +1,29 @@
 <template>
   <div class="exhibition-energy">
     <div class="title">
-      <section>
-        <h4 class="base" v-show="exhibitionEnergy.firstName">{{exhibitionEnergy.firstName}}</h4>
-        <div v-if="exhibitionEnergy.dynamic.length">
-          <div v-for="(item,index) in exhibitionEnergy.dynamic" :key="index" class="table-dynamic">
-            <div class="table-title">{{item.InfoPointName}}:</div>
-            <div>
-              <p>表号功能号 {{item.value}}</p>
-              <p>{{item.data ? item.data :item.error}} {{item.Unit}}</p>
-              <p>{{formatDate(item.receivetime)}}</p>
+      <section v-for="(val,key,i) in exhibitionEnergy.list">
+        <h4 class="base">{{key}}</h4>
+        <div class="table-dynamic" v-for="(value,keys,index) in val.paths">
+            <div class="table-title"> {{value.InfoPointName}}:</div>
+          <p :style="{'color':value.value? '' :'#F56C6C'}">{{value.value? `表号功能号:${value.value} `:'未维护'}}</p>
+          <p v-if="value.data">{{value.data}}{{value.Unit}}</p>
+<!--          <p v-else-if="value.error">{{value.error}}</p>-->
+          <el-popover
+            v-else-if="value.error"
+            placement="right"
+            width="160"
+            trigger="hover">
+            <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">错误原因</p>
+            <p>{{value.error}}</p>
+            <div style="text-align: center; margin: 0">
+              <el-button type="text" size="mini" @click="handleCopy(value.error)">复制</el-button>
             </div>
-          </div>
+            <el-button slot="reference" type="text" style="color:#F56C6C">error</el-button>
+          </el-popover>
+          <p v-else>--</p>
+
+          <p>{{value.receivetime ? formatDate(value.receivetime):'--'}}</p>
         </div>
-         <div v-else style="text-align: center;margin-top: 200px">暂无数据</div>
       </section>
     </div>
   </div>
@@ -26,7 +36,16 @@
     methods:{
       formatDate(str) {
         return str ? str.substr(0,4)+"-"+str.substr(4,2)+"-"+str.substr(6,2)+" "+str.substr(8,2) + ":" +str.substr(10,2) + ":"+str.substr(12,2) :'--'
-      }
+      },
+      handleCopy(data) {
+        let oInput = document.createElement('input')
+        oInput.value = data
+        document.body.appendChild(oInput)
+        oInput.select()
+        document.execCommand('Copy')
+        this.$message.success('复制成功')
+        oInput.remove()
+      },
     }
   }
 </script>
@@ -41,7 +60,7 @@
     }
 
     .table-dynamic {
-      height: 85px;
+      /*height: 85px;*/
       width: 100%;
       margin: 5px 0;
       padding-left: 20px;

+ 12 - 7
src/components/ledger/details/detail/exhibitionEnergyT.vue

@@ -1,14 +1,19 @@
 <template>
   <div class="exhibition-energy">
     <div class="title">
-      <section v-for="(val,key,i) in exhibitionEnergy.list">
-        <h4 class="base">{{key}}</h4>
-        <div class="table-dynamic" v-for="(value,keys,index) in val.paths">
-            <div class="table-title"> {{value.InfoPointName}}:</div>
-          <p :style="{'color':value.value? '' :'#F56C6C'}">{{value.value? `表号功能号:${value.value} `:'未维护'}}</p>
-          <p>{{value.data ? value.data :value.error}} {{value.Unit}}</p>
-          <p>{{value.receivetime ? formatDate(value.receivetime):'--'}}</p>
+      <section>
+        <h4 class="base" v-show="exhibitionEnergy.firstName">{{exhibitionEnergy.firstName}}</h4>
+        <div v-if="exhibitionEnergy.dynamic.length">
+          <div v-for="(item,index) in exhibitionEnergy.dynamic" :key="index" class="table-dynamic">
+            <div class="table-title">{{item.InfoPointName}}:</div>
+            <div>
+              <p>表号功能号 {{item.value}}</p>
+              <p>{{item.data ? item.data :item.error}} {{item.Unit}}</p>
+              <p>{{formatDate(item.receivetime)}}</p>
+            </div>
+          </div>
         </div>
+         <div v-else style="text-align: center;margin-top: 200px">暂无数据</div>
       </section>
     </div>
   </div>

+ 275 - 8
src/components/ledger/handsontables/assets.vue

@@ -15,14 +15,16 @@
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
       <el-button size="small" style="width: 80px;" @click="addDevice" icon="iconfont icon-tianjia">添加资产</el-button>
+<!--      <el-button size="small" @click="Batch" v-show="!onlyRead" :disabled="!(tableData && tableData.length)">批量维护信息点-->
+<!--      </el-button>-->
       <el-button size="small" style="width: 80px;" @click="reset" icon="iconfont icon-shuaxin">刷新</el-button>
       <el-button v-show="!onlyRead" size="small" style="width: 80px;" @click="undo" icon="iconfont icon-undo">撤销
       </el-button>
     </div>
     <qrcode :qrcodeUrl="qrcodeUrl" :dialog="myDialog" :addBody="true" ref="qrcode"/>
-    <firm ref="firm" :mess="mess" @changeFirm="firmChange" :dialog="myDialog"/>
+    <firm   :firmDataType="firmDataType" ref="firm" :mess="mess" @changeFirm="firmChange" :dialog="myDialog"/>
     <supply-dialog @change="supplyChange" ref="supply" :id="id" :dialog="myDialog"/>
-    <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"/>
+    <supplier-dialog   :firmDataType="firmDataType" ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"/>
     <guarantee-dialog @change="guaranteeChange" :id="id" ref="guarantee" :dialog="myDialog"/>
     <upload-files-dialog
         :read="onlyRead ? true : false"
@@ -30,24 +32,34 @@
         @changeFile="fileChange"
         :keysArr="filesArr"
         :dialog="myDialog"
+        :firmDataType="firmDataType"
     />
     <upload-img-dialog
         :read="onlyRead ? true : false"
         @changeFile="imgChange"
         :keysArr="imgsArr"
         :dialog="myDialog"
+        :firmDataType="firmDataType"
     />
     <maintainer-dialog
         @changeMaintainer="changeMaintainer"
         ref="maintainer"
         :dialog="myDialog"
+        :firmDataType="firmDataType"
     />
     <insurer-dialog
         @changeInsurer="changeInsurer"
         ref="insurer"
         :dialog="myDialog"
+        :firmDataType="firmDataType"
+    />
+    <pic-dialog
+      :read="onlyRead ? true : false"
+      :dialog="myDialog"
+      :keysArr="picsArr"
+      @change="changePics"
+      :firmDataType="firmDataType"
     />
-    <pic-dialog :read="onlyRead ? true : false" :dialog="myDialog" :keysArr="picsArr" @change="changePics"/>
     <div class="center middle_sty" style="height: 91%" v-show="!mess.deviceId && (!tableData || !tableData.length)">
       <p>
         <i class="icon-wushuju iconfont"></i>
@@ -105,6 +117,18 @@
         <el-button v-show="showAddByDie" type="primary" :disabled="dieNum == 0" @click="createByDie">批量创建</el-button>
       </span>
     </el-dialog>
+    <!--      维护信息弹窗-->
+    <batchDialog
+      ref="batchDialogs"
+      @code="fourVendors"
+      :firmName="firmName"
+      :allObject="allObject"
+      :page="batchPage"
+      :newEnclosure="newEnclosure"
+      @getAllData="getAllData"
+      @multiples="multiples"
+      @upDataDevice="upDataDevice"
+    />
   </div>
 </template>
 <script>
@@ -115,7 +139,10 @@
     deleteProperty,
     getDataDictionary,
     propertyLinkEq,
-    updateProperty
+    updateProperty,
+    queryEquip, //替换掉
+    queryUpdate,//替换掉
+    updateEquip//替换掉
   } from "@/api/scan/request";
 
   import tools from "@/utils/scan/tools"
@@ -143,6 +170,7 @@
   import lookPic from "@/components/ledger/lib/lookImages"
   import Handsontable from "handsontable-pro"
   import 'handsontable-pro/dist/handsontable.full.css'
+  import batchDialog from "../../dialogs/list/batchDialog";
   //下拉插件
   // import "@/assets/js/chosen.jquery.min";
   // import "@/assets/js/handsontable-chosen-editor";
@@ -165,7 +193,8 @@
       floorCascader,
       dieCascader,
       // detailsDialog,
-      lookPic
+      lookPic,
+      batchDialog
     },
     created() {
       buildFloor.getData(this.buildFloorData)
@@ -180,6 +209,16 @@
     },
     data() {
       return {
+        batchPage: {
+          size: 50,
+          sizes: [10, 30, 50, 100, 150, 200],
+          total: 0,
+          currentPage: 1
+        },
+        newEnclosure:[],
+        firmName: '',//维护信息显示厂家名称
+        firmDataType: 'row',
+        allObject: [],
         options: [{
           value: true,
           label: '只读模式'
@@ -272,6 +311,9 @@
               }
             })
             this.getTableData()
+            this.getTableData()
+            //  信息维护
+            this.newEnclosure = res.Content.filter(i=>i.InputMode =='F2')
           });
         }
       },
@@ -310,14 +352,64 @@
             this.copyMain = tools.deepCopy(this.tableData)
             this.page.total = res.Total
             if (this.tableData && this.tableData.length) {
-              // if (this.onlyRead) {
-              //   this.getBatch(this.tableData)
-              // }
+              if (this.onlyRead) {
+                this.getBatch(this.tableData)
+              }
               this.initTable()
             }
           })
         }
       },
+      //获取所以主体数据---用于维护信息
+      getAllData() {
+        if (!!this.mess.deviceId) {
+          //   查询step2
+          let params = {
+            "Cascade": [
+              {
+                "Name": "property",
+                "Projection": [
+                  "Family", "EquipLocalName", "EquipLocalID", "EquipID", "CodeType"
+                ]
+              },
+              {
+                "Name": "building",
+                "Projection": [
+                  "BuildLocalName", "BuildName", "BuildID"
+                ]
+              },
+              {
+                "Name": "floor",
+                "Projection": [
+                  "FloorLocalName", "FloorName", "FloorID"
+                ]
+              }
+            ],
+            Filters: `category='${this.mess.deviceId}'`,
+            PageSize: this.batchPage.size,
+            Orders: "createTime desc, EquipID desc",
+            PageNumber: this.batchPage.currentPage,
+            "Projection": [
+              "BuildingId", "FloorId", "Category", "EquipLocalName", "EquipLocalID", "EquipID", "BIMID"
+            ]
+          };
+          if (this.mess.buildId == "noKnow") {
+            params.Filters += `;buildingId isNull`
+          } else if (this.mess.buildId && this.mess.buildId != "all") {
+            params.Filters += `;buildingId='${this.mess.buildId}'`
+          }
+
+          if (this.mess.floorId == "noKnow") {
+            params.Filters += `;floorId isNull`
+          } else if (this.mess.floorId && this.mess.floorId != "all") {
+            params.Filters += `;floorId='${this.mess.floorId}'`
+          }
+          queryEquip(params, res => {
+            this.allObject = res.Content
+            this.batchPage.total = res.Total
+          })
+        }
+      },
       //获取动态参数
       getBatch(data) {
         let param = {
@@ -1061,6 +1153,181 @@
         this.graphyId = graphyId
         this.assetGroupList = assetGroupList
       },
+      //    批量信息维护
+      Batch() {
+        this.firmDataType = 'dialog'
+        this.$refs.batchDialogs.batchDialog = true
+      },
+      //  接受维护信息传来的code,显示弹窗
+      fourVendors(code) {
+        this.firmDataType = 'dialog'
+        switch (code) {
+          //品牌型号弹窗
+          case 'DPManufacturerID':
+            // this.dataFirmType = 'dia'
+            this.myDialog.firm = true;
+            break;
+          //供应商信息弹窗
+          case 'DPSupplierID':
+            this.myDialog.supplier = true;
+            break;
+          //维修商信息弹窗
+          case 'DPMaintainerID':
+            this.myDialog.maintainer = true;
+            break;
+          //保险公司信息
+          case 'DPInsurerID':
+            this.myDialog.insurer = true;
+            break;
+        }
+      },
+      forValue(arr, val) {
+        let enclosure = []
+        arr && arr.length && arr.map(i => {
+          if (i.Path == val) {
+            enclosure = i.value
+          }
+        })
+        return enclosure
+      },
+      multiples(val) {
+        this.firmDataType = 'dialog'
+        switch (val) {
+          case 'LedgerParam.InsuranceDoc.InsuranceFile': //保险文件
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.PhotoDoc.Archive': //设备文档
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.Siteinstall.CheckReport': //安装质检报告
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.OperationMainte.MaintainManual': //维修保养手册
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.SupplyPurchase.ApproachingAcceptance': //进场验收单
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.SupplyPurchase.AcceptanceReport': //验收报告
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.PhotoDoc.OperationManual': //操作说明书
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.EquipManufactor.OriginalCertificate': //原厂证明
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.EquipManufactor.TestReport': //检测报告
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.SupplyPurchase.SupplierContract': //供应合同
+            this.filesArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val;
+            this.myDialog.uploadFiles = true;
+            break;
+          case 'LedgerParam.Siteinstall.InstallPic':
+            this.imgsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val
+            this.myDialog.uploadImgs = true;
+            break;
+          case 'LedgerParam.PhotoDoc.Nameplate':
+            this.imgsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val
+            this.myDialog.uploadImgs = true;
+            break;
+          //设备照片
+          case 'LedgerParam.PhotoDoc.Pic':
+            this.picsArr = this.forValue(this.newEnclosure, val) ? this.forValue(this.newEnclosure, val) : [];
+            this.infoType = val
+            this.myDialog.pic = true;
+            break;
+        }
+      },
+      upDataDevice(type, data1, data2) {
+        let param = {Content: data1}
+        let param1 = {Content: data2}
+        if (type === 1) { //增量
+          //LedgerParam
+          let filterParam = this.filterCheck(param, 'sole')
+          let filterParam1 = this.filterCheck(param1, 'multiple')
+          if (filterParam) {
+            updateEquip(param, res => {
+            });
+          }
+          if (filterParam1) {
+            setTimeout(() => {
+              queryUpdate(param1, res => {
+              })
+            })
+
+          }
+        }
+        if (type === 2) {//覆盖
+          let filterParams = this.filterCheck(param, 'sole')
+          if (filterParams) {
+            updateEquip(param, res => {
+            });
+          }
+        }
+        setTimeout(() => {
+          this.getTableData()
+          this.getAllData()
+        }, 10)
+      },
+      filterCheck(arr, type) {
+        if (type === 'sole') {
+          for (let i of arr.Content) {
+            return Object.keys(i.LedgerParam).length
+          }
+        } else if (type === 'multiple') {
+          let  nArr = [];
+          arr.Content.forEach(i => {
+            let {EquipID, ...value} = i
+            nArr.push({LedgerParam: value})
+          })
+          for (let j of nArr) {
+            return Object.keys(j.LedgerParam).length
+          }
+        }
+      }
     },
     watch: {
       projectId() {

+ 0 - 57
src/components/ledger/handsontables/device.vue

@@ -1015,63 +1015,6 @@
             break;
         }
       },
-      // multiple(val) {
-      //   this.firmDataType = 'dialog'
-      //   switch (val) {
-      //     //设备文档--安装质检报告--保险文件
-      //     case 'archive':
-      //       let adata = this.information.archive.Archive;
-      //       this.filesArr = adata ? adata : [];
-      //       this.infoType = 'archive';
-      //       this.myDialog.uploadFiles = true;
-      //       break;
-      //     case 'checkReport':
-      //       let cdata = this.information.checkReport.CheckReport;
-      //       this.filesArr = cdata ? cdata : [];
-      //       this.infoType = 'checkReport'
-      //       this.myDialog.uploadFiles = true;
-      //       break;
-      //     case 'insuranceFile':
-      //       let idata = this.information.insuranceFile.InsuranceFile;
-      //       this.filesArr = idata ? idata : [];
-      //       this.infoType = 'insuranceFile';
-      //       this.myDialog.uploadFiles = true;
-      //       break;
-      //     //安装照片--安装图纸--设备铭牌照片--设备图纸
-      //     case 'installPic':
-      //       let insData = this.information.installPic.InstallPic;
-      //       this.imgsArr = insData ? insData : [];
-      //       this.infoType = 'installPic';
-      //       this.myDialog.uploadImgs = true;
-      //       break;
-      //     case 'installDrawing':
-      //       let drawData = this.information.installDrawing.InstallDrawing;
-      //       this.imgsArr = drawData ? drawData : [];
-      //       this.infoType = 'installDrawing';
-      //       this.myDialog.uploadImgs = true;
-      //       break;
-      //     case 'nameplate':
-      //       let nDate = this.information.nameplate.Nameplate;
-      //       this.imgsArr = nDate ? nDate : [];
-      //       this.infoType = 'nameplate';
-      //       this.myDialog.uploadImgs = true;
-      //       break;
-      //     case 'drawing':
-      //       let dDate = this.information.drawing.Drawing;
-      //       this.imgsArr = dDate ? dDate : [];
-      //       this.infoType = 'drawing';
-      //       this.myDialog.uploadImgs = true;
-      //       break;
-      //     //设备照片
-      //     case 'pic':
-      //       let picData = this.information.pic.Pic;
-      //       this.picsArr = picData ? picData : [];
-      //       this.infoType = 'pic';
-      //       this.myDialog.pic = true;
-      //       break;
-      //   }
-      // },
-      //获取到了正确的信息
       getInfors(infos, row, el) {
           let val = this.hot.colToProp(row.col);
           let inputMode = this.inputMap[val];

+ 12 - 36
src/views/ledger/facility/details/index.vue

@@ -231,48 +231,28 @@
               criterias: this.criterias
             }
           }
-          let arr = []
           if (this.criterias.length) {
             BeatchQueryParam(params, res => {
               this.criteriasArray = res.Content;
-              arr = res.Content
-              arr && arr.length && arr.forEach(child => {
+              res.Content.length && res.Content.map(child => {
                 this.pointData.map(head => {
                   if (head.InfoPointCode == child.code) {
-                    head.svalue = child.value;
-                    head.data = child.data || '--';
-                    head.receivetime = child.receivetime || '';
-                    head.error = child.error || ''
+                    this.$set(head, 'svalue', child.value)
+                    this.$set(head, 'data', child.data)
+                    this.$set(head, 'receivetime', child.receivetime)
+                    this.$set(head, 'error', child.error)
                   }
                   return head
                 })
               })
-              /****************************delete****************************/
-              arr && arr.length && arr.map(child => {
-                this.pointData.forEach(head => {
-                  if (head.InfoPointCode == child.code) {
-                    // console.log(head.FirstName,child,'==')
-                    this.exhibitionEnergy.firstName = head.FirstName;
-                    this.exhibitionEnergy.dynamic.push({
-                      FirstName: head.FirstName,
-                      InfoPointCode: head.InfoPointCode,
-                      InfoPointName: head.InfoPointName,
-                      Path: head.Path,
-                      value: child.value,
-                      data: child.data || '--',
-                      receivetime: child.receivetime || '',
-                      error: child.error || '',
-                      Unit: head.Unit || ''
-                    })
-                  }
-                })
-              })
-            /****************************delete****************************/
+              this.handleRadios(this.currentRadio);
+              this.handleEnclosure() //处理图片视频文件信息
             })
-
+          } else {
+            this.handleRadios(this.currentRadio);
+            this.handleEnclosure() //处理图片视频文件信息
           }
-          this.handleRadios(this.currentRadio);
-          this.handleEnclosure() //处理图片视频文件信息
+
         })
       },
       handleEnclosure() {
@@ -341,11 +321,11 @@
               case 'LedgerParam.Siteinstall.InstallDrawing':
               case 'LedgerParam.PhotoDoc.Nameplate':
               case 'LedgerParam.PhotoDoc.Pic':
+              case 'Pic' :
                 if (this.instance.hasOwnProperty(i.Path)) {
                   i.PicList = this.instance[i.Path]
                 }
                 if (picObject[i.InfoPointName]) {
-
                 } else {
                   picObject[i.InfoPointName] = []
                 }
@@ -353,7 +333,6 @@
                   ...i,
                 })
                 break;
-
             }
           }
 
@@ -372,9 +351,7 @@
           }
         }
         this.exhibitionImage.arr = isArray
-
         let video = isArray.filter(i => i.Type != 'image' &&i.type != 'image' )
-        console.log(video,'video')
         this.exhibitionVideo.list = video
           //判断是否显示图片组件
           this.isShowImage = isArray.length ? true : false
@@ -387,7 +364,6 @@
         //处理数据格式
         arr.map(i => {
           if (i.InputMode == 'F2') {
-
             switch (i.Path) {
               case 'LedgerParam.InsuranceDoc.InsuranceFile':
               case 'LedgerParam.PhotoDoc.Archive':

+ 52 - 24
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -62,7 +62,7 @@
 <script>
   import {mapGetters} from "vuex";
   import tools from "@/utils/scan/tools";
-  import {getDataDictionary, zoneDelete, zoneQuery} from '@/api/scan/request';
+  import {getDataDictionary, zoneDelete, zoneQuery,BeatchQueryParam} from '@/api/scan/request';
 
   import eqToSpaceTable from '@/components/business_space/newTables/eqToSpaceTable';
   import syInSpaceTable from '@/components/business_space/newTables/syInSpaceTable';
@@ -118,6 +118,7 @@
           title: '能耗信息',
           firstName:'',
           dynamic: [],
+          list: {}
         },
         exhibitionMaintain: {
           title: '维修/维保记录'
@@ -214,8 +215,6 @@
 
         obj = tools.flattenKeys(obj);
         this.instance = obj;
-        this.handleRadios(this.currentRadio)
-        this.handleEnclosure() //处理图片视频文件信息
         this.pointData.forEach(item => {
           if (item.InputMode == "L" || item.InputMode == "L1" || item.InputMode == "L2" || item.InputMode == "M") {
             let cur = tools.dataForKey(this.exampleData, item.Path);
@@ -236,24 +235,24 @@
         }
         if (this.criterias.length) {
           BeatchQueryParam(params, res => {
-            res.Content.map(child => {
-              this.pointData.forEach(head => {
+            // this.criteriasArray = res.Content;
+            res.Content.length && res.Content.map(child => {
+              this.pointData.map(head => {
                 if (head.InfoPointCode == child.code) {
-                  this.exhibitionEnergy.firstName = head.FirstName;
-                  this.exhibitionEnergy.dynamic.push({
-                    InfoPointCode: head.InfoPointCode,
-                    InfoPointName: head.InfoPointName,
-                    Path: head.Path,
-                    value: child.value,
-                    data: child.data || '--',
-                    receivetime: child.receivetime || '',
-                    error: child.error || '',
-                    Unit: head.Unit || ''
-                  })
+                  this.$set(head, 'svalue', child.value)
+                  this.$set(head, 'data', child.data)
+                  this.$set(head, 'receivetime', child.receivetime)
+                  this.$set(head, 'error', child.error)
                 }
+                return head
               })
-            });
+            })
+            this.handleRadios(this.currentRadio);
+            this.handleEnclosure() //处理图片视频文件信息
           })
+        } else {
+          this.handleRadios(this.currentRadio);
+          this.handleEnclosure() //处理图片视频文件信息
         }
       })
     },
@@ -315,20 +314,17 @@
       //处理数据格式
       arr.map(i => {
         if (i.InputMode == 'F2') {
-          console.log(i.Path)
           switch (i.Path) {
             case 'LedgerParam.PhotoDoc.Drawing':
             case 'LedgerParam.Siteinstall.InstallPic':
             case 'LedgerParam.Siteinstall.InstallDrawing':
             case 'LedgerParam.PhotoDoc.Nameplate':
+            case 'LedgerParam.PhotoDoc.Pic':
             case 'Pic' :
-
               if (this.instance &&this.instance.hasOwnProperty(i.Path)) {
                 i.PicList = this.instance[i.Path]
-
               }
               if (picObject[i.InfoPointName]) {
-
               } else {
                 picObject[i.InfoPointName] = []
               }
@@ -336,7 +332,6 @@
                 ...i,
               })
               break;
-
           }
         }
 
@@ -423,6 +418,7 @@
     },
     displayData(arr) {//对数据进行处理传给组件展示
       const result = {}
+      const resultEnergy = {};
       arr.forEach(i => {
         if (this.instance && this.instance.hasOwnProperty(i.Path) && this.currentRadio != 2) {
           i.value = this.instance[i.Path]
@@ -462,6 +458,39 @@
           case "L1":
           case "L2":
           case "M":
+            if (resultEnergy[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {
+              resultEnergy[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`].paths.push({
+                Path: i.Path,
+                InfoPointName: i.InfoPointName,
+                InfoPointCode: i.InfoPointCode,
+                value: i.svalue,
+                Visible: i.Visible,
+                KeyWord: i.KeyWord,
+                InputMode: i.InputMode,
+                data: i.data,
+                receivetime: i.receivetime,
+                error: i.error,
+                Unit: i.Unit,
+                FirstName: i.FirstName,
+              })
+            } else {
+              resultEnergy[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`] = {
+                paths: [{
+                  Path: i.Path,
+                  InfoPointName: i.InfoPointName,
+                  InfoPointCode: i.InfoPointCode,
+                  value: i.svalue,
+                  Visible: i.Visible,
+                  KeyWord: i.KeyWord,
+                  InputMode: i.InputMode,
+                  data: i.data,
+                  receivetime: i.receivetime,
+                  error: i.error,
+                  Unit: i.Unit,
+                  FirstName: i.FirstName,
+                }]
+              }
+            }
             break;
           default:
             if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {
@@ -489,11 +518,10 @@
             }
 
         }
-
-
       })
       this.exhibitionBaseInformation.information = result
       this.exhibitionCrux.allMessage = result
+      this.exhibitionEnergy.list = resultEnergy;
     },
     // 设置iframe
     setFrame() {