Browse Source

Merge branch 'dev'

zhangyu 5 years ago
parent
commit
82a0d03a51
33 changed files with 1311 additions and 410 deletions
  1. 102 15
      src/components/business_space/business/handsontable.vue
  2. 1 1
      src/components/business_space/dialogs/list/firm.vue
  3. 69 64
      src/components/business_space/lib/uploadFiles.vue
  4. 3 0
      src/components/dialogs/list/batchDialog.vue
  5. 1 1
      src/components/dialogs/list/firm.vue
  6. 25 17
      src/components/dialogs/list/systemType.vue
  7. 1 1
      src/components/ledger/cenote/elevationMap.vue
  8. 32 13
      src/components/ledger/details/detail/exhibitionEnergy.vue
  9. 12 7
      src/components/ledger/details/detail/exhibitionEnergyT.vue
  10. 296 16
      src/components/ledger/handsontables/assets.vue
  11. 25 71
      src/components/ledger/handsontables/device.vue
  12. 13 7
      src/components/ledger/handsontables/system.vue
  13. 35 18
      src/components/ledger/lib/spaceSelect.vue
  14. 6 6
      src/components/point/report/objectInstance.vue
  15. 13 6
      src/router/system.js
  16. 1 0
      src/utils/authutils.js
  17. 7 47
      src/utils/handsontable/fillterField.js
  18. 6 1
      src/utils/handsontable/notShow.js
  19. 3 3
      src/views/ledger/cenotelist/cenoteadd/index.vue
  20. 29 11
      src/views/ledger/cenotelist/index.vue
  21. 22 13
      src/views/ledger/cenotelist/relatedSpace.vue
  22. 4 3
      src/views/ledger/facility/addfacility.vue
  23. 12 36
      src/views/ledger/facility/details/index.vue
  24. 5 3
      src/views/ledger/facility/parts/index.vue
  25. 4 3
      src/views/ledger/facility/partsmanage/addparts/index.vue
  26. 66 3
      src/views/ledger/facility/partsmanage/index.vue
  27. 4 3
      src/views/ledger/property/addproperty.vue
  28. 23 8
      src/views/ledger/rentlist/index.vue
  29. 3 3
      src/views/ledger/rentlist/rentadd/index.vue
  30. 2 2
      src/views/ledger/spacelist/index.vue
  31. 52 24
      src/views/ledger/spacelist/spaceDetail/index.vue
  32. 430 0
      src/views/ledger/spacelist/spaceadd/index.vue
  33. 4 4
      src/views/ledger/system/addsystem.vue

+ 102 - 15
src/components/business_space/business/handsontable.vue

@@ -41,6 +41,31 @@
     <!--      上传图片-->
     <upload-img-dialog :read="onlyRead" @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog" />
     <dialogZone ref="zone" @createSuccess="getOtherType" />
+    <!-- 不支持的输入方式 -->
+    <el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
+      <el-row>
+        该信息点未定义对应组件,现在维护数据不确定后续是否可用。如确实需要维护,请点击
+        <el-link @click="updateInputShow = true" type="primary" :underline="false">继续维护</el-link>
+        。
+      </el-row>
+      <el-row style="margin-top:20px;" v-show="updateInputShow">
+        <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请输入内容"
+                  v-model="updateInput"></el-input>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="myDialog.update = false">取 消</el-button>
+        <el-button type="primary" @click="handleClickUpdate">确 认</el-button>
+      </span>
+    </el-dialog>
+    <!-- 新增业务空间 -->
+    <el-dialog title="确定新增业务空间的分区类型" :visible.sync="myDialog.addSpace" width="670px">
+      <el-row>
+        <space-cascader ref="cascader" @change="changeAddType"></space-cascader>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="toAddSpace">下 一 步</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -55,6 +80,7 @@ import showTools from "@/utils/handsontable/notShow"
 import handsonUtils from "@/utils/hasontableUtils"
 import Handsontable from "handsontable-pro"
 import buildFloor from '@/utils/handsontable/buildFloorData'
+import spaceCascader from '@/components/ledger/lib/spaceSelect'
 import 'handsontable-pro/dist/handsontable.full.css'
 import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
 import qrcode from "@/components/ledger/lib/qrcode";
@@ -81,7 +107,7 @@ export default {
     addBusiness,
     uploadImgDialog,
     dialogZone,
-
+    spaceCascader,
   },
   computed: {
     ...mapGetters("layout", ["projectId", "secret", "userId"]),
@@ -127,12 +153,27 @@ export default {
       copyMain: [], //深拷贝数组
       buildFloorData: [], //楼层数据
       zoneItemID: '',
+      inputMap: {
+        flowBuild: {
+          InputMode: 'D1',
+          Editable:true,
+          InfoPointCode:"flowBuild",
+          InfoPointName:"建筑楼层",
+          Path:"flowBuild"
+        }
+      }, //信息点和输入方式映射表
+      updateInputShow: false, //是否显示临时维护输入框
+      updateInfoPoint: '',//临时维护信息点
+      updateInput: '', //临时维护信息点值
       myDialog: {
         uploadImgs: false, //上传图片弹窗
+        update: false,//临时维护信息点
+        addSpace: false, //批量添加业务空间
       },
       imgsArr: [], //空间图片
       OtherList: [],//其他分区筛选框
       OtherValue: '',
+      addData: {}, 
     };
   },
   created() {
@@ -150,6 +191,11 @@ export default {
     //获取表格数据
     getHeader(headers, buildFloorSelectd) {
       this.headers = headers
+      this.headers.forEach(item => {
+        if (item.Path && item.InputMode) {
+          this.inputMap[item.Path] = item
+        }
+      })
       this.buildFloorSelectd = buildFloorSelectd
       this.page.pageNumber = 1
       this.getData()
@@ -160,7 +206,7 @@ export default {
         ZoneType: this.zoneCode,
         PageNumber: this.page.pageNumber,
         PageSize: this.page.pageSize,
-        Orders: "createTime desc, RoomID asc"
+        Orders: "createTime desc, RoomLocalName desc, RoomLocalID desc, RoomID asc"
       }
       if (this.buildFloorSelectd.length === 1) {
         switch (this.buildFloorSelectd[0]) {
@@ -377,6 +423,7 @@ export default {
     getInfors(infos, row) {
       let val = this.hot.colToProp(row.col);
       this.row = row.row;
+      let inputData = this.inputMap[val];
       lStorage.set('screen_data', { path: this.$route.path, data: { RoomID: infos.RoomID, zone: this.zoneCode } })
       if (val == "point") {
         let query = {
@@ -394,7 +441,7 @@ export default {
         if (!!this.qrcodeUrl) {
           this.dialog.qrcode = true;
         } else {
-          this.$message("此设备没有设备二维码")
+          this.$message("此空间没有二维码")
         }
       } else if (val == "Pic") {
         let Picdata = tools.dataForKey(this.main[row.row], val);
@@ -402,10 +449,32 @@ export default {
         if (!this.onlyRead || this.imgsArr.length) {
           this.myDialog.uploadImgs = true;
         }
-      } else {
+      }
+      if (!this.onlyRead && !inputData.Editable) {
+        this.$message("该信息点的值为自动生成,不可人工维护!");
+        return false;
+      }
+      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
+        this.updateInfoPoint = val;
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+        this.myDialog.update = true;
         return false;
       }
     },
+    //关闭临时维护弹窗回调
+    handleCloseUpdate() {
+        this.updateInputShow = false
+        this.updateInfoPoint = ''
+        this.updateInput = ''
+    },
+    //更新临时维护信息点
+    handleClickUpdate() {
+        tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
+        this.tdChange([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
+        this.updateInputShow = false
+        this.myDialog.update = false
+        this.updateInput = ''
+    },
     //表格发生更改
     tdChange(changeData, source) {
       if (!this.onlyRead) {
@@ -750,20 +819,38 @@ export default {
     },
     /**  页面中的按钮事件--------------------------- */
     addSp() {
-      if (this.main && this.main.length && this.main[0].RoomID) {
-        this.hot.destroy()
-        this.hot = null
-        this.main.unshift({})
-        this.getMain()
+      this.myDialog.addSpace = true
+      // if (this.main && this.main.length && this.main[0].RoomID) {
+      //   this.hot.destroy()
+      //   this.hot = null
+      //   this.main.unshift({})
+      //   this.getMain()
+      // } else {
+      //   if (this.main && this.main.length) {
+      //     this.$message("请添加完成后继续添加")
+      //   } else {
+      //     this.main.unshift({})
+      //     this.getMain()
+      //   }
+      // }
+    },
+    //下一步
+    toAddSpace() {
+      if (this.addData.spaceType) {
+        this.$router.push({
+          path: "/ledger/spaceadd",
+          query: this.addData
+        });
       } else {
-        if (this.main && this.main.length) {
-          this.$message("请添加完成后继续添加")
-        } else {
-          this.main.unshift({})
-          this.getMain()
-        }
+        this.$message("请选择要添加的业务空间类型!")
       }
     },
+    //选择业务空间类型-添加业务空间
+    changeAddType(val, item) {
+      this.addData.spaceType = val;
+      this.addData.spaceName = item.Name;
+      this.addData.showType = this.showType;
+    },
     //刷新
     reset() {
       this.getData()

+ 1 - 1
src/components/business_space/dialogs/list/firm.vue

@@ -40,7 +40,7 @@
                 找不到想要的型号? 赶快去
                 <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
             </p>
-            <my-pagination :page="page" @change="changed" style="margin-top:10px;"></my-pagination>
+            <my-pagination :page="page" @change="changed" style="margin-top:40px;"></my-pagination>
         </div>
 
       </div>

+ 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;
     }

+ 1 - 1
src/components/dialogs/list/firm.vue

@@ -39,7 +39,7 @@
                 找不到想要的型号? 赶快去
                 <i style="color:#46B0FF;cursor: pointer;">厂家库</i>维护吧
             </p>
-            <my-pagination :page="page" @change="changed" style="margin-top:10px;"></my-pagination>
+            <my-pagination :page="page" @change="changed" style="margin-top:40px;"></my-pagination>
         </div>
 
       </div>

+ 25 - 17
src/components/dialogs/list/systemType.vue

@@ -20,7 +20,7 @@
             </el-col>
           </el-row>
         </div>
-        <el-table class='data-table' border :data="tableData" @selection-change="handleSelectionChange" style="width: 100%" ref="multipleTable">
+        <el-table class='data-table' border :data="type == 'read'?linkSystemData:tableData" @selection-change="handleSelectionChange" style="width: 100%" ref="multipleTable">
           <el-table-column v-if="type != 'read' " type="selection" :reserve-selection="true" :disabled="true" width="55"></el-table-column>
           <el-table-column label="系统名称" header-align='center'>
             <template slot-scope="scope">{{scope.row.SysLocalName || scope.row.SysName}}</template>
@@ -37,7 +37,7 @@
         </el-table>
       </div>
     </div>
-    <span slot="footer" class="dialog-footer">
+    <span slot="footer" class="dialog-footer" v-if="type != 'read' ">
       <el-button type="primary" @click="getChange">确 定</el-button>
     </span>
     <el-dialog title="系统详情" :visible.sync="iframeShow" v-if="iframeShow" width="500px" append-to-body>
@@ -85,7 +85,7 @@ export default {
       search: "", //搜索文案
       tableData: [],
       systemList: [],
-      allData: [],
+      linkSystemData: [],
       multipleSelection: [],
       iframeSrc: "",
       iframeShow: false,
@@ -172,24 +172,25 @@ export default {
     },
     //点击详情
     lookDeatils(infos) {
-      this.iframeSrc =
-        process.env.BASE_URL +
-        ":8889/#/details?perjectId=" +
-        this.projectId +
-        "&secret=" +
-        this.secret +
-        "&FmId=" +
-        infos.id +
-        "&type=1&code=" +
-        infos.category.substring(2, 4);
-      this.iframeShow = true;
+      this.$message("开发中...")
+      // this.iframeSrc =
+      //   process.env.BASE_URL +
+      //   ":8889/#/details?perjectId=" +
+      //   this.projectId +
+      //   "&secret=" +
+      //   this.secret +
+      //   "&FmId=" +
+      //   infos.id +
+      //   "&type=1&code=" +
+      //   infos.category.substring(2, 4);
+      // this.iframeShow = true;
     },
     //根据设备类型-查询系统关联专业
     getTableData() {
       let param = {
         Filters: `category="${this.device.deviceId.substring(0, 2)}"`,
         PageNumber: 1,
-        PageSize: 100
+        PageSize: 1000
       }
       //建筑id
       if (this.buildId == "noKnow") {
@@ -202,11 +203,14 @@ export default {
         param.Filters += `;SysLocalName contain "${this.search}" or SysLocalID contain "${this.search}"`
       }
       queryLinkSys(param, res => {
-        this.allData = res.Content
         this.tableData = res.Content
         this.toggleSelection(res.Content)
       })
     },
+    //获取关联的系统
+    getLinkSystemData() {
+       this.linkSystemData = this.list?JSON.parse(JSON.stringify(this.list)):[]
+    },
     //添加设备关联系统关系
     createRelatSys() {
       if (this.curDevice) {//有即为编辑
@@ -229,7 +233,11 @@ export default {
       handler () {
         if (this.dialog.systemType) {
           this.getData()
-          this.getTableData()
+          if (this.type == 'read') {
+            this.getLinkSystemData()
+          } else {
+            this.getTableData()
+          }
         }
       }
     },

+ 1 - 1
src/components/ledger/cenote/elevationMap.vue

@@ -65,7 +65,7 @@
       this.load = true;
       // 查询竖井关联的空间垂直交通关系
       shaftVerticalSpace(this.params, (res) => {
-        let data = res.Content;
+        let data = res.Content?res.Content:[];
         let max = 0, idMap = {}, groupMap = {}, copyData = JSON.parse(JSON.stringify(data));
         this.groupWidth = {};
         copyData.reverse().forEach(floor => {

+ 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>

+ 296 - 16
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: '只读模式'
@@ -243,7 +282,13 @@
         },
         dieNum: 0, // 查询设备部件数量
         inputMap: {
-          flowBuild: 'D1'
+          flowBuild: {
+            InputMode: 'D1',
+            Editable:true,
+            InfoPointCode:"flowBuild",
+            InfoPointName:"建筑楼层",
+            Path:"flowBuild"
+          }
         }, //信息点和输入方式映射表
         updateInputShow: false, //是否显示临时维护输入框
         updateInfoPoint: '',//临时维护信息点
@@ -258,9 +303,9 @@
         if (this.mess.deviceId) {
           let params = {
             data: {
-              Orders: "sort asc",
+              Orders: "sort asc, InfoPointName desc",
               PageNumber: 1,
-              PageSize: 500
+              PageSize: 1000
             },
             type: this.mess.deviceId
           };
@@ -272,6 +317,9 @@
               }
             })
             this.getTableData()
+            this.getTableData()
+            //  信息维护
+            this.newEnclosure = res.Content.filter(i=>i.InputMode =='F2')
           });
         }
       },
@@ -282,7 +330,7 @@
         if (!!this.mess.deviceId) {
           let param = {
             PageSize: this.page.size,
-            Orders: "createTime desc, EquipID desc",
+            Orders: "createTime desc, EquipLocalName desc, EquipLocalID desc, EquipID desc",
             PageNumber: this.page.currentPage,
             Filters: `Family='${this.mess.deviceId}'`
           }
@@ -310,14 +358,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 = {
@@ -465,6 +563,7 @@
         if (val.code && val.facility) {
           this.addData.Family = val.code
           this.addData.name = val.facility
+          this.addData.showType = this.showType
           this.numParams.Family = val.code
         }
       },
@@ -744,7 +843,7 @@
       //获取到了正确的信息
       getInfors(infos, row, el) {
         let val = this.hot.colToProp(row.col);
-        let inputMode = this.inputMap[val];
+        let inputData = this.inputMap[val];
         this.row = row.row;
         this.messKey = val;
         switch (val) {
@@ -859,6 +958,7 @@
           case 'LedgerParam.EquipManufactor.TestReport': //检测报告
           case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
           case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
+          case 'LedgerParam.SupplyPurchase.SupplierContract': //供应合同
           case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
           case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
             let IPSdata = tools.dataForKey(this.tableData[row.row], val);
@@ -892,10 +992,15 @@
           default:
             break;
         }
+        if (!this.onlyRead && !inputData.Editable) {
+          this.$message("该信息点的值为自动生成,不可人工维护!");
+          return false;
+        }
         if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
-          this.updateInfoPoint = val
-          this.updateInput = tools.dataForKey(this.tableData[row.row], val)
-          this.myDialog.update = true
+          this.updateInfoPoint = val;
+          this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+          this.myDialog.update = true;
+          return false;
         }
       },
       //关闭临时维护弹窗回调
@@ -1061,6 +1166,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() {

+ 25 - 71
src/components/ledger/handsontables/device.vue

@@ -285,7 +285,13 @@
         addData: {}, //
         showParts: false,
         inputMap: {
-          flowBuild: 'D1'
+          flowBuild: {
+            InputMode: 'D1',
+            Editable:true,
+            InfoPointCode:"flowBuild",
+            InfoPointName:"建筑楼层",
+            Path:"flowBuild"
+          }
         }, //信息点和输入方式映射表
         updateInputShow: false, //是否显示临时维护输入框
         updateInfoPoint: '',//临时维护信息点
@@ -367,7 +373,7 @@
         if (this.mess.deviceId) {
           let params = {
             data: {
-              Orders: "sort asc",
+              Orders: "sort asc, InfoPointName desc",
               PageNumber: 1,
               PageSize: 1000
             },
@@ -377,7 +383,7 @@
             this.tableHeader = res.Content;
             this.tableHeader.forEach(item => {
               if (item.Path && item.InputMode) {
-                this.inputMap[item.Path] = item.InputMode
+                this.inputMap[item.Path] = item
               }
             })
             this.getTableData()
@@ -394,7 +400,7 @@
         if (!!this.mess.deviceId) {
           let param = {
             PageSize: this.page.size,
-            Orders: "createTime desc, EquipID desc",
+            Orders: "createTime desc, EquipLocalName desc, EquipLocalID desc, EquipID desc",
             PageNumber: this.page.currentPage,
             Filters: `category='${this.mess.deviceId}'`
           }
@@ -595,6 +601,7 @@
       changeAddType(val) {
         this.addData.deviceId = val.code;
         this.addData.name = val.facility;
+        this.addData.showType = this.showType;
       },
       //下载
       download() {
@@ -1015,66 +1022,9 @@
             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];
+          let inputData = this.inputMap[val];
           this.row = row.row;
           this.messKey = val;
           this.firmDataType = 'row'
@@ -1111,11 +1061,9 @@
                   return false
               //关联系统
               case 'LinkSystem':
-                  if (!this.onlyRead) {
-                      this.curDevice = infos.EquipID;
-                      this.systemList = this.tableData[row.row].LinkSystem || [];
-                      this.myDialog.systemType = true;
-                  }
+                  this.curDevice = infos.EquipID;
+                  this.systemList = this.tableData[row.row].LinkSystem || [];
+                  this.myDialog.systemType = true;
                   return false
               //关联资产
               case 'LinkEquipLocalName':
@@ -1191,6 +1139,7 @@
               case 'LedgerParam.EquipManufactor.TestReport': //检测报告
               case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
               case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
+              case 'LedgerParam.SupplyPurchase.SupplierContract': //供应合同
               case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
               case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
                   let IPSdata = tools.dataForKey(this.tableData[row.row], val);
@@ -1229,10 +1178,15 @@
               default:
                   break;
           }
-          if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
-              this.updateInfoPoint = val
-              this.updateInput = tools.dataForKey(this.tableData[row.row], val)
-              this.myDialog.update = true
+          if (!this.onlyRead && !inputData.Editable) {
+            this.$message("该信息点的值为自动生成,不可人工维护!");
+            return false;
+          }
+          if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
+            this.updateInfoPoint = val;
+            this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+            this.myDialog.update = true;
+            return false;
           }
       },
       //关闭临时维护弹窗回调

+ 13 - 7
src/components/ledger/handsontables/system.vue

@@ -175,9 +175,9 @@ export default {
       if (this.mess.deviceId) {
         let params = {
           data: {
-            Orders: "sort asc",
+            Orders: "sort asc, InfoPointName desc",
             PageNumber: 1,
-            PageSize: 500
+            PageSize: 1000
           },
           type: this.mess.deviceId
         }
@@ -204,7 +204,7 @@ export default {
         let param = {
           data: {
             PageSize: this.page.size,
-            Orders: "createTime desc, SysID desc",
+            Orders: "createTime desc, SysLocalName desc, SysLocalID desc, SysID desc",
             PageNumber: this.page.currentPage,
             Filters: `category='${this.mess.deviceId}'`
           }
@@ -270,6 +270,7 @@ export default {
     changeAddType(val) {
       this.addData.Category = val.Category;
       this.addData.CategoryName = val.CategoryName;
+      this.addData.showType = this.showType;
     },
     //格式化表头
     formatHeaderData(list) {
@@ -527,7 +528,7 @@ export default {
     getInfors(infos, row) {
       //其他的开始判断
       let val = this.hot.colToProp(row.col);
-      let inputMode = this.inputMap[val];
+      let inputData = this.inputMap[val];
       this.systemId = infos.SysID
       this.row = row.row
       this.messKey = val
@@ -564,10 +565,15 @@ export default {
         default:
           break;
       }
+      if (!this.onlyRead && !inputData.Editable) {
+        this.$message("该信息点的值为自动生成,不可人工维护!");
+        return false;
+      }
       if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
-        this.updateInfoPoint = val
-        this.updateInput = tools.dataForKey(this.tableData[row.row], val)
-        this.myDialog.update = true
+        this.updateInfoPoint = val;
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+        this.myDialog.update = true;
+        return false;
       }
     },
     //关闭临时维护弹窗回调

+ 35 - 18
src/components/ledger/lib/spaceSelect.vue

@@ -1,15 +1,25 @@
 <template>
   <div id="spaceSelect">
-    <span class="buildFloor" style="padding-right:12px">业务空间</span>
-    <el-select v-model="value" placeholder="请选择" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small" @change="changeVal">
-      <el-option v-for="(item, key) in options" :key="key" :label="item.Name" :value="item.Code"></el-option>
-    </el-select>
+    <span class="buildFloor" style="padding-right:12px">空间类型</span>
+    <el-cascader
+      v-model="value"
+      placeholder="请选择空间类型"
+      clearable
+      :style="isWidth ? '' : 'width:160px;'" size="small" 
+      :props="{value:'Code',label:'Name',children:'ZoneType'}"
+      :options="options" 
+      @change="changeVal">
+    </el-cascader>
   </div>
 </template>
 
 <script>
-import { queryDictionaryHead } from '@/api/scan/request';
+import { queryDictionaryHead, queryAllZoneType } from '@/api/scan/request';
+import { mapGetters } from 'vuex'
 export default {
+  computed: {
+    ...mapGetters("layout", ["projectId"])
+  },
   props: {
     isWidth: {
       type: Boolean,
@@ -18,7 +28,7 @@ export default {
   },
   data() {
     return {
-      value:null,
+      value:[null],
       spaceVal: null,//值
       options: [],
       props: {
@@ -29,22 +39,29 @@ export default {
   methods: {
     //获取下拉框数据
     getOptionData() {
-      let pa = {
-        Filters: `parentId = 'Space'`
-      }
-      queryDictionaryHead(pa, res => {
-        this.options = res.Content.map(t => {
-          if (t.Name == "元空间") {
-            return undefined;
-          }
-          return t;
-        }).filter(item => item);
-        this.options.unshift({Code:null, CreateTime:null, LastUpdate:null, Name:'全部', ObjectType: null, ParentId: null, Statistics: {}});
+      let params1 = {Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }]}
+      queryAllZoneType(params1, res => {
+        this.options = res.Content;
       })
     },
     //改变空间
     changeVal(value) {
-      this.$emit('change', value)
+      let val = value[value.length - 1];
+      let space = {};
+      this.options.forEach(item => {
+        if (item.ZoneType) {
+          item.ZoneType.forEach(other => {
+            if (other.Code == val) {
+              space = other
+            }
+          })
+        } else {
+          if (item.Code == val) {
+            space = item
+          }
+        }
+      })
+      this.$emit('change', val, space)
     }
   },
   created() {

+ 6 - 6
src/components/point/report/objectInstance.vue

@@ -94,8 +94,8 @@ export default {
                     /** Y坐标 */
                     Y: -equipMsg.Content[0].LocationJson.Y
                   }
-                  that.forms[key].ObjectLocalName = res.Content[0].EquipLocalName
-                  that.forms[key].ObjectLocalCode = res.Content[0].EquipLocalID
+                  that.forms[key].ObjectLocalName = equipMsg.Content[0].EquipLocalName
+                  that.forms[key].ObjectLocalCode = equipMsg.Content[0].EquipLocalID
                   this.loadDataToInstanceByFloorID(equipMsg.Content[0].FloorId, key, item.TypeCode, canvasOption);
                 }
               })
@@ -111,8 +111,8 @@ export default {
                     RoomID: zoneMsg.Content[0].RoomID,
                     Color: '#F9C3C3'
                   }
-                  that.forms[key].ObjectLocalName = res.Content[0].RoomLocalName
-                  that.forms[key].ObjectLocalCode = res.Content[0].RoomLocalID
+                  that.forms[key].ObjectLocalName = zoneMsg.Content[0].RoomLocalName
+                  that.forms[key].ObjectLocalCode = zoneMsg.Content[0].RoomLocalID
                   this.loadDataToInstanceByFloorID(zoneMsg.Content[0].FloorId, key, item.TypeCode, canvasOption);
                 }
               });
@@ -131,8 +131,8 @@ export default {
                     /** Y坐标 */
                     Y: -equipMsg.Content[0].LocationJson.Y
                   }
-                  that.forms[key].ObjectLocalName = res.Content[0].EquipLocalName
-                  that.forms[key].ObjectLocalCode = res.Content[0].EquipLocalID
+                  that.forms[key].ObjectLocalName = equipMsg.Content[0].EquipLocalName
+                  that.forms[key].ObjectLocalCode = equipMsg.Content[0].EquipLocalID
                   this.loadDataToInstanceByFloorID(equipMsg.Content[0].FloorId, key, item.TypeCode, canvasOption);
                 }
               })

+ 13 - 6
src/router/system.js

@@ -60,6 +60,7 @@ import addPropertys from '@/views/ledger/property/addpropertys' //根据未关
 import batchlinkAssets from '@/views/ledger/facility/batchlink' //批量关联资产
 import cenotelist from '@/views/ledger/cenotelist' //竖井清单
 import cenoteadd from '@/views/ledger/cenotelist/cenoteadd' //添加竖井
+import spaceadd from '@/views/ledger/spacelist/spaceadd' //添加业务空间
 import cenoteDetail from '@/views/ledger/cenotelist/cenoteDetail' //竖井关系详情
 import rentlist from '@/views/ledger/rentlist' //租户清单
 import manageTenantZone from '@/views/ledger/rentlist/manageTenantZone' //租户清单
@@ -351,12 +352,12 @@ export default [{
             name: 'deviceDetails',
             component: deviceDetails,
             meta: {
-							keepAlive: false,
-							breadcrumbs: [
-								{label: '台账管理', path: '/ledger/facility'},
-								{label: '设备台账', path: '/ledger/facility'},
-								{label: '台账详情'}
-							]
+                keepAlive: false,
+                breadcrumbs: [
+                    {label: '台账管理', path: '/ledger/facility'},
+                    {label: '设备台账', path: '/ledger/facility'},
+                    {label: '台账详情'}
+                ]
             }
           },
           {
@@ -467,6 +468,12 @@ export default [{
                 meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '业务空间台账', path: '/ledger/spacelist' }, { label: '业务空间详情' }] }
             },
             {
+                path: 'spaceadd',
+                name: 'spaceadd',
+                component: spaceadd,
+                meta: { keepAlive: false, breadcrumbs: [{ label: '台账管理', path: '/ledger/facility' }, { label: '业务空间台账', path: '/ledger/spacelist' }, { label: '添加业务空间' }] }
+            },
+            {
                 path: 'cenotelist',
                 name: 'cenotelist',
                 component: cenotelist,

+ 1 - 0
src/utils/authutils.js

@@ -58,6 +58,7 @@ export default {
                     (from.path == "/ledger/rentadd" && session.get("rentAddData") && session.get("rentAddData").length) ||
                     (from.path == "/ledger/cenoteadd" && session.get("cenoteAddData") && session.get("cenoteAddData").length) ||
                     (from.path == "/ledger/deviceadd" && session.get("deviceAddData") && session.get("deviceAddData").length) ||
+                    (from.path == "/ledger/spaceadd" && session.get("spaceAddData") && session.get("spaceAddData").length) ||
                     (from.path == "/ledger/propertyadd" && session.get("propertyAddData") && session.get("propertyAddData").length) ||
                     (from.path == "/ledger/partsadd" && session.get("partsAddData") && session.get("partsAddData").length) ||
                     (from.path == "/ledger/systemadd" && session.get("systemAddData") && session.get("systemAddData").length)

+ 7 - 47
src/utils/handsontable/fillterField.js

@@ -1,73 +1,33 @@
 const data = {
   equipment: { //设备
     onlyRead: [],
-    edit: [
-      "EquipID",
-      "EquipName",
-      "EquipQRCode",
-      "BIMID",
-      "BIMLocation"
-    ]
+    edit: []
   },
   tenant: { //租户
     onlyRead: [],
-    edit: [
-      "TenantID",
-      "TenantName",
-      "BIMID",
-      "BIMLocation"
-    ]
+    edit: []
   },
   shaft: { //竖井
     onlyRead: [],
-    edit: [
-      "ShaftID",
-      "ShaftName",
-      "BIMID",
-      "BIMLocation"
-    ]
+    edit: []
   },
   parts: { //部件
     onlyRead: [],
-    edit: [
-      "EquipID",
-      "EquipName",
-      "EquipQRCode",
-      "BIMID",
-      "BIMLocation"
-    ]
+    edit: []
   },
   property:{ //资产
     onlyRead: [],
-    edit: [
-      "EquipID",
-      "EquipName",
-      "EquipQRCode",
-      "BIMID",
-      "BIMLocation"
-    ]
+    edit: []
   },
   system:{ //系统
     onlyRead: [],
-    edit: [
-      "SysID",
-      "SysName",
-      "EquipQRCode",
-      "BIMID",
-      "BIMLocation"
-    ]
+    edit: []
   },
   space:{//业务空间
     onlyRead: [
       "Outline"
     ],
-    edit: [
-      "RoomID",
-      "RoomName",
-      "BIMID",
-      "BIMLocation",
-      "Outline"
-    ]
+    edit: []
   }
 }
 

+ 6 - 1
src/utils/handsontable/notShow.js

@@ -488,6 +488,7 @@ const showTools = {
                         item.InfoPointCode == "TestReport" ||
                         item.InfoPointCode == "ProductCertification" ||
                         item.InfoPointCode == "InstallInstruction" ||
+                        item.InfoPointCode == "SupplierContract" ||
                         item.InfoPointCode == "Drawing" ||
                         item.InfoPointCode == "InstallDrawing"
 
@@ -671,6 +672,7 @@ const showTools = {
                         item.InfoPointCode == "TestReport" ||
                         item.InfoPointCode == "ProductCertification" ||
                         item.InfoPointCode == "InstallInstruction" ||
+                        item.InfoPointCode == "SupplierContract" ||
                         item.InfoPointCode == "Drawing" ||
                         item.InfoPointCode == "InstallDrawing"
                     ) {
@@ -839,6 +841,7 @@ const showTools = {
                         item.InfoPointCode == "TestReport" ||
                         item.InfoPointCode == "ProductCertification" ||
                         item.InfoPointCode == "InstallInstruction" ||
+                        item.InfoPointCode == "SupplierContract" ||
                         item.InfoPointCode == "Drawing" ||
                         item.InfoPointCode == "InstallDrawing"
                     ) {
@@ -1044,6 +1047,7 @@ const showTools = {
             item.InfoPointCode == "TestReport" ||
             item.InfoPointCode == "ProductCertification" ||
             item.InfoPointCode == "InstallInstruction" ||
+            item.InfoPointCode == "SupplierContract" ||
             item.InfoPointCode == "Drawing" ||
             item.InfoPointCode == "InstallDrawing"
         ) {
@@ -1148,6 +1152,7 @@ const showTools = {
             item.InfoPointCode == "TestReport" ||
             item.InfoPointCode == "ProductCertification" ||
             item.InfoPointCode == "InstallInstruction" ||
+            item.InfoPointCode == "SupplierContract" ||
             item.InfoPointCode == "Drawing" ||
             item.InfoPointCode == "InstallDrawing"
         ) {
@@ -1225,7 +1230,7 @@ const showTools = {
         } else { //(未支持的输入方式)暂不支持编辑
             return {
                 data: item.Path,
-                readOnly: onlyRead
+                readOnly: !item.Editable
             }
         }
     },

+ 3 - 3
src/views/ledger/cenotelist/cenoteadd/index.vue

@@ -48,7 +48,7 @@ export default {
       relationids: "",
       onlyRead: false,
       showTypes: [{ value: "Visible", label: '只看采集信息' }, { value: "all", label: '全部' }],
-      showType: "Visible",
+      showType: this.$route.query.showType,
       tableHeader: [],
       tableData: session.get("cenoteAddData")? session.get("cenoteAddData").length? session.get("cenoteAddData"): [{}]: [{}],
       copyTableData: []
@@ -68,9 +68,9 @@ export default {
     async getTableHeader() {
       let param = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500,
+          PageSize: 1000,
         },
         type: 'Shaft'
       }

+ 29 - 11
src/views/ledger/cenotelist/index.vue

@@ -87,7 +87,15 @@ export default {
       myDialog: {
         update: false,//临时维护信息点
       },
-      inputMap: {}, //信息点和输入方式映射表
+      inputMap: {
+        flowBuild: {
+          InputMode: 'D1',
+          Editable:true,
+          InfoPointCode:"flowBuild",
+          InfoPointName:"建筑楼层",
+          Path:"flowBuild"
+        }
+      }, //信息点和输入方式映射表
       updateInputShow: false, //是否显示临时维护输入框
       updateInfoPoint: '',//临时维护信息点
       updateInput: '', //临时维护信息点值
@@ -126,9 +134,9 @@ export default {
     async getTableHeader() {
       let param = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: 'Shaft'
       }
@@ -136,7 +144,7 @@ export default {
         this.tableHeader = res.Content;
         this.tableHeader.forEach(item => {
           if (item.Path && item.InputMode) {
-            this.inputMap[item.Path] = item.InputMode
+            this.inputMap[item.Path] = item
           }
         })
         this.getTableData()
@@ -146,7 +154,7 @@ export default {
       let params = {
         Cascade: [{ Name: 'spaceList' }],
         Filters: this.cenoteId ? `ProjectId='${this.projectId}';structureInfo.ShaftFuncType='${this.cenoteId}'` : `ProjectId='${this.projectId}'`,
-        Orders: "createTime desc, ShaftID asc",
+        Orders: "createTime desc, ShaftLocalName desc, ShaftLocalID desc, ShaftID asc",
         PageNumber: this.page.pageNumber,
         PageSize: this.page.pageSize
       }
@@ -217,7 +225,12 @@ export default {
     },
     // 添加竖井
     handleCreateTableData() {
-      this.$router.push({ name: 'cenoteadd' })
+      this.$router.push({
+        path: '/ledger/cenoteadd',
+        query: {
+          showType: this.showType
+        }
+      })
     },
     // 删除表格行
     handleDeleteTableRow() {
@@ -340,7 +353,7 @@ export default {
     getInfors(infos, row) {
       //其他的开始判断
       let val = this.tableExample.colToProp(row.col)
-      let inputMode = this.inputMap[val]
+      let inputData = this.inputMap[val]
       let name = infos.ShaftLocalName ? infos.ShaftLocalName : infos.ShaftName
       this.shaftId = infos.ShaftID //要操作的数据id
       //点击关联的元空间
@@ -360,10 +373,15 @@ export default {
         })
         return false
       }
-      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
-        this.updateInfoPoint = val
-        this.updateInput = tools.dataForKey(this.tableData[row.row], val)
-        this.myDialog.update = true
+      if (!this.onlyRead && !inputData.Editable) {
+        this.$message("该信息点的值为自动生成,不可人工维护!");
+        return false;
+      }
+      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
+        this.updateInfoPoint = val;
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+        this.myDialog.update = true;
+        return false;
       }
     },
     //关闭临时维护弹窗回调

+ 22 - 13
src/views/ledger/cenotelist/relatedSpace.vue

@@ -136,30 +136,39 @@ export default {
           });
           this.showDefaultSpace();
         });
-      }
-      else {
-        let pa = {
-          Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }]
-        }
-        queryAllZoneType(pa, res => {
-          this.spaceList = res.Content.map(t => {
+      } else {
+        let params1 = {Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }]},
+            params2 = {shaftId: this.$route.query.ShaftId};
+        let promise1 = new Promise((resolve, reject) => {
+            queryAllZoneType(params1, res => {
+                resolve(res)
+            })
+        })
+        let promise2 = new Promise((resolve, reject) => {
+            shaftSpaceTypeQuery(params2, res => {
+                resolve(res)
+            })
+        })
+        Promise.all([promise1, promise2]).then(values => {
+          let val1 = values[0], val2 = values[1]
+          this.spaceList = val1.Content.map(t => {
             if (t.Name != "元空间") {
               this.spaceType[t.Code] = t.Name;
             }
             return t;
           });
-          this.showDefaultSpace();
-        });
+          this.space = [val2.Content[0].ObjectType];
+          this.ObjectType = this.space[0];
+          //加载楼层信息
+          this.loadBuildingData();
+        })
       }
     },
     //默认显示默认分区,无默认分区显示第一个分区
     showDefaultSpace() {
-      if (this.spaceList.length) {
+      if (this.spaceList.length && this.cenoteObj.onlyRead) {
         this.space = this.spaceList.find((item) => { return item.Code == "GeneralZone" }) ? ["GeneralZone"] : [this.spaceList[0].Code];
         this.ObjectType = this.space[0];
-        // if (this.spaceList.length > 1 && this.cenoteObj.onlyRead) {
-        //   this.showSpaceDot = true;
-        // }
       }
       //处理空间类型
       this.spaceList.map(item => {

+ 4 - 3
src/views/ledger/facility/addfacility.vue

@@ -128,7 +128,7 @@ export default {
       systemId: null,
       graphyId: null,
       id: 0,
-      showType: 'partInfo',
+      showType: this.$route.query.showType,
       EquipmentList: [],
       firmId: "", //品牌型号所需字段--族id三位编码(传设备类id或部件类id)
       buildFloorData: [],
@@ -205,9 +205,9 @@ export default {
     async getTableHeader() {
       let params = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: this.category.deviceId
       };
@@ -616,6 +616,7 @@ export default {
         case 'LedgerParam.EquipManufactor.TestReport': //检测报告
         case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
         case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
+        case 'LedgerParam.SupplyPurchase.SupplierContract': //供应合同
         case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
         case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
           let IPSdata = tools.dataForKey(this.tableData[row.row], 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':

+ 5 - 3
src/views/ledger/facility/parts/index.vue

@@ -161,9 +161,9 @@ export default {
     async getTableHeader() {
       let params = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: this.tabVal
       };
@@ -177,6 +177,7 @@ export default {
       let params = {
         PageNumber: this.page.pageNumber,
         PageSize: this.page.PageSize,
+        Orders: "createTime desc, EquipLocalName desc, EquipLocalID desc, EquipID desc",
         Filters: `category='${this.tabVal}';parentId='${this.deviceId}'`
       };
       await getEquipPartsCon(params, res => {
@@ -369,7 +370,8 @@ export default {
         val == "LedgerParam.EquipManufactor.OriginalCertificate" || //原厂证明
         val == "LedgerParam.EquipManufactor.TestReport" || //检测报告
         val == "LedgerParam.PhotoDoc.ProductCertification" || //产品合格证
-        val == "LedgerParam.Siteinstall.InstallInstruction" || //安装说明书
+        val == "LedgerParam.Siteinstall.InstallInstruction" || //
+        val == 'LedgerParam.SupplyPurchase.SupplierContract' || //供应合同
         val == "LedgerParam.PhotoDoc.Drawing" || //设备图纸
         val == "LedgerParam.Siteinstall.InstallDrawing" //安装图纸
       ) {

+ 4 - 3
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -102,7 +102,7 @@ export default {
         { value: "all", label: '全部' },
         { value: "Visible", label: '只看采集信息' }
       ],
-      showType: "partInfo",
+      showType: this.$route.query.showType,
       copyTableData: [],
       category: "", //当前设备类
       myDialog: {
@@ -160,9 +160,9 @@ export default {
     async getTableHeader() {
       let params = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: this.category.Code
         // Filters: `type='Equipment' or type='${this.category.Code}'`
@@ -515,6 +515,7 @@ export default {
         val == "LedgerParam.EquipManufactor.TestReport" || //检测报告
         val == "LedgerParam.PhotoDoc.ProductCertification" || //产品合格证
         val == "LedgerParam.Siteinstall.InstallInstruction" || //安装说明书
+        val == 'LedgerParam.SupplyPurchase.SupplierContract' || //供应合同
         val == "LedgerParam.PhotoDoc.Drawing" || //设备图纸
         val == "LedgerParam.Siteinstall.InstallDrawing" //安装图纸
       ) {

+ 66 - 3
src/views/ledger/facility/partsmanage/index.vue

@@ -57,6 +57,22 @@
     <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
     <!-- 关联资产 -->
     <change-rea @changeProperty="changeProperty" :dialog="myDialog" :category="deviceType"></change-rea>
+    <!-- 不支持的输入方式 -->
+    <el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
+      <el-row>
+        该信息点未定义对应组件,现在维护数据不确定后续是否可用。如确实需要维护,请点击
+        <el-link @click="updateInputShow = true" type="primary" :underline="false">继续维护</el-link>
+        。
+      </el-row>
+      <el-row style="margin-top:20px;" v-show="updateInputShow">
+        <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请输入内容"
+                  v-model="updateInput"></el-input>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="myDialog.update = false">取 消</el-button>
+        <el-button type="primary" @click="handleClickUpdate">确 认</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -123,6 +139,18 @@ export default {
       },
       tableData: [],
       copyTableData: [],
+      inputMap: {
+        flowBuild: {
+          InputMode: 'D1',
+          Editable:true,
+          InfoPointCode:"flowBuild",
+          InfoPointName:"建筑楼层",
+          Path:"flowBuild"
+        }
+      }, //信息点和输入方式映射表
+      updateInputShow: false, //是否显示临时维护输入框
+      updateInfoPoint: '',//临时维护信息点
+      updateInput: '', //临时维护信息点值
       tableExample: null,
       tabVal: "",
       activeTab: {}, //当前tab页index
@@ -143,6 +171,7 @@ export default {
         details: false, //详情页
         lookPic: false, //图片查看
         changeRea: false, //关联的资产
+        update: false,//临时维护信息点
       },
       qrcodeUrl: "", //二维码图片地址
       filesArr: [], //保存临时的文件key
@@ -208,14 +237,19 @@ export default {
     async getTableHeader() {
       let params = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: this.tabVal
       };
       await getDataDictionary(params, res => {
         this.tableHeader = res.Content;
+        this.tableHeader.forEach(item => {
+          if (item.Path && item.InputMode) {
+            this.inputMap[item.Path] = item
+          }
+        })
         this.getTableData();
       });
     },
@@ -224,6 +258,7 @@ export default {
       let params = {
         PageNumber: this.page.pageNumber,
         PageSize: this.page.pageSize,
+        Orders: "createTime desc, EquipLocalName desc, EquipLocalID desc, EquipID desc",
         Filters: `category='${this.tabVal}';parentId='${this.deviceId}'`
       };
       await getEquipPartsCon(params, res => {
@@ -306,7 +341,8 @@ export default {
         query: {
           ...this.activeTab,
           pageNo: this.queryParam.pageNo,
-          pageSize: this.queryParam.pageSize
+          pageSize: this.queryParam.pageSize,
+          showType: this.showType
         }
       });
     },
@@ -581,6 +617,7 @@ export default {
     getInfors(infos, row) {
       this.row = row.row;
       let val = this.tableExample.colToProp(row.col);
+      let inputData = this.inputMap[val];
       this.messKey = val;
       switch (val) {
         //操作
@@ -679,6 +716,7 @@ export default {
         case 'LedgerParam.EquipManufactor.TestReport': //检测报告
         case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
         case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
+        case 'LedgerParam.SupplyPurchase.SupplierContract': //供应合同
         case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
         case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
           let IPSdata = tools.dataForKey(this.tableData[row.row], val);
@@ -709,6 +747,31 @@ export default {
         default:
           break;
       }
+      if (!this.onlyRead && !inputData.Editable) {
+        this.$message("该信息点的值为自动生成,不可人工维护!");
+        return false;
+      }
+      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
+        this.updateInfoPoint = val;
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+        this.myDialog.update = true;
+        return false;
+      }
+    },
+    //关闭临时维护弹窗回调
+    handleCloseUpdate() {
+      this.updateInputShow = false
+      this.updateInfoPoint = ''
+      this.updateInput = ''
+    },
+    //更新临时维护信息点
+    handleClickUpdate() {
+      // this.$message("更新成功");
+      tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
+      this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
+      this.updateInputShow = false
+      this.myDialog.update = false
+      this.updateInput = ''
     },
     utilToKey(key, name, data, messName) {
       if (key == name) {

+ 4 - 3
src/views/ledger/property/addproperty.vue

@@ -109,7 +109,7 @@ export default {
       systemId: null,
       graphyId: null,
       id: 0,
-      showType: 'partInfo',
+      showType: this.$route.query.showType,
       EquipmentList: []
     };
   },
@@ -126,9 +126,9 @@ export default {
     async getTableHeader() {
       let params = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: this.category.Family
       };
@@ -449,6 +449,7 @@ export default {
         case 'LedgerParam.EquipManufactor.TestReport': //检测报告
         case 'LedgerParam.PhotoDoc.ProductCertification': //产品合格证
         case 'LedgerParam.Siteinstall.InstallInstruction': //安装说明书
+        case 'LedgerParam.SupplyPurchase.SupplierContract': //供应合同
         case 'LedgerParam.PhotoDoc.Drawing': //设备图纸
         case 'LedgerParam.Siteinstall.InstallDrawing': //安装图纸
           let IPSdata = tools.dataForKey(this.tableData[row.row], val);

+ 23 - 8
src/views/ledger/rentlist/index.vue

@@ -100,7 +100,13 @@ export default {
         update: false,//临时维护信息点
       },
       inputMap: {
-        FloorId: 'B1'
+        FloorId: {
+          InputMode: 'B1',
+          Editable:true,
+          InfoPointCode:"FloorId",
+          InfoPointName:"所属楼层",
+          Path:"FloorId"
+        }
       }, //信息点和输入方式映射表
       updateInputShow: false, //是否显示临时维护输入框
       updateInfoPoint: '',//临时维护信息点
@@ -140,9 +146,9 @@ export default {
     async getTableHeader() {
       let param = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: 'Tenant'
       }
@@ -150,7 +156,7 @@ export default {
         this.tableHeader = res.Content;
         this.tableHeader.forEach(item => {
           if (item.Path && item.InputMode) {
-            this.inputMap[item.Path] = item.InputMode
+            this.inputMap[item.Path] = item
           }
         })
         this.getTableData()
@@ -162,7 +168,7 @@ export default {
           { Name: 'zoneTenantList', Cascade: [{ Name: 'building' }, { Name: 'floor' }] },
           { Name: 'zoneGeneraltList', Cascade: [{ Name: 'building' }, { Name: 'floor' }] }
         ],
-        Orders: "createTime desc, TenantID asc",
+        Orders: "createTime desc, TenantLocalName desc, TenantLocalID desc, TenantID asc",
         PageNumber: this.page.pageNumber,
         PageSize: this.page.pageSize
       }
@@ -233,7 +239,12 @@ export default {
     },
     // 添加租户数据
     handleCreateTableData() {
-      this.$router.push({ name: 'rentadd' })
+      this.$router.push({
+        path: '/ledger/rentadd',
+        query: {
+          showType: this.showType
+        }
+      })
     },
     // 删除表格行
     handleDeleteTableRow() {
@@ -374,7 +385,7 @@ export default {
     getInfors(infos, row) {
       //其他的开始判断
       let val = this.tableExample.colToProp(row.col)
-      let inputMode = this.inputMap[val]
+      let inputData = this.inputMap[val]
       this.row = row.row //要操作的列号
       this.messKey = val //要操作的列类型
       this.tenantID = infos.TenantID //要操作的数据id
@@ -395,7 +406,11 @@ export default {
         this.$refs.roomCountDrawer.showDrawer(infos)
         return false
       }
-      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputMode) == '-1') {
+      if (!this.onlyRead && !inputData.Editable) {
+        this.$message("该信息点的值为自动生成,不可人工维护!");
+        return false;
+      }
+      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
         this.updateInfoPoint = val
         this.updateInput = tools.dataForKey(this.tableData[row.row], val)
         this.myDialog.update = true

+ 3 - 3
src/views/ledger/rentlist/rentadd/index.vue

@@ -51,7 +51,7 @@ export default {
         { value: "all", label: '全部' }, 
         { value: "Visible", label: '只看采集信息' }
       ],
-      showType: "Visible",
+      showType: this.$route.query.showType,
       tableHeader: [],
       tableData: session.get("rentAddData")? session.get("rentAddData").length? session.get("rentAddData"): [{}]: [{}],
       copyTableData: []
@@ -71,9 +71,9 @@ export default {
     async getTableHeader() {
       let param = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500,
+          PageSize: 1000,
         },
         type: 'Tenant'
       }

+ 2 - 2
src/views/ledger/spacelist/index.vue

@@ -298,9 +298,9 @@ export default {
     initMessage() {
       let params = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: this.activeName
       }

+ 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() {

+ 430 - 0
src/views/ledger/spacelist/spaceadd/index.vue

@@ -0,0 +1,430 @@
+<template>
+  <div id="deviceList">
+    <el-row class="right">
+      <span style="float:left;">当前选择的分区类型:{{space.spaceName}}</span>
+      <el-select v-model="showType" @change="initTable" style="width:125px;margin-right:10px;vertical-align:bottom;">
+        <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
+      </el-select>
+      <span>增加</span>
+      <el-input v-model="addNum" style="width:50px;" size="small"></el-input>
+      <span>个{{space.spaceName}}</span>
+      <el-button @click="handleAddTableRow">增加</el-button>
+    </el-row>
+    <div class="tableBox">
+      <div class="center middle_sty" style="flex:2;" v-show="tableData && !tableData.length">
+        <p>
+          <i class="icon-wushuju iconfont"></i>
+          暂无数据
+        </p>
+      </div>
+      <div class="tableLeft" v-show="tableData && tableData.length">
+        <handson-table ref="table"></handson-table>
+      </div>
+    </div>
+    <el-row class="center">
+      <el-button type="primary" size="medium" @click="handleCreateTableData" class="create_button">创建业务空间</el-button>
+    </el-row>
+
+    <!--二维码弹窗 -->
+    <qrcode :dialog="myDialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
+    <!--上传图片-->
+    <upload-img-dialog :read="false" @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog" />
+    <!-- 不支持的输入方式 -->
+    <el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
+      <el-row>
+        该信息点未定义对应组件,现在维护数据不确定后续是否可用。如确实需要维护,请点击
+        <el-link @click="updateInputShow = true" type="primary" :underline="false">继续维护</el-link>
+        。
+      </el-row>
+      <el-row style="margin-top:20px;" v-show="updateInputShow">
+        <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请输入内容"
+                  v-model="updateInput"></el-input>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="myDialog.update = false">取 消</el-button>
+        <el-button type="primary" @click="handleClickUpdate">确 认</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import tools from "@/utils/scan/tools";
+import handsonUtils from "@/utils/hasontableUtils";
+import showTools from "@/utils/handsontable/notShow";
+import text from "@/utils/handsontable/mainText";
+import session from "@/framework/utils/storage";
+import buildFloor from '@/utils/handsontable/buildFloorData'
+
+import handsonTable from "@/components/common/handsontable";
+import { getDataDictionary, zoneCreate } from "@/api/scan/request";
+import { mapGetters, mapActions } from "vuex";
+
+import qrcode from "@/components/ledger/lib/qrcode";
+import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
+export default {
+  components: {
+    qrcode, //二维码页面
+    uploadImgDialog,
+    handsonTable
+  },
+  data() {
+    return {
+      addNum: 1,
+      onlyRead: false,
+      showTypes: [{ value: "partInfo", label: '隐藏信息点' }, { value: "all", label: '全部' }, { value: "Visible", label: '只看采集信息' }],
+      tableHeader: [],
+      tableData: session.get("spaceAddData")
+        ? session.get("spaceAddData").length
+          ? session.get("spaceAddData")
+          : [{}]
+        : [{}],
+      copyTableData: [],
+      category: {}, //路由参数
+      myDialog: {
+        qrcode: false, //二维码弹窗
+        uploadImgs: false, //上传单个图片
+        update: false,//临时维护信息点
+      },
+      inputMap: {
+        flowBuild: {
+          InputMode: 'D1',
+          Editable:true,
+          InfoPointCode:"flowBuild",
+          InfoPointName:"建筑楼层",
+          Path:"flowBuild"
+        }
+      }, //信息点和输入方式映射表
+      updateInputShow: false, //是否显示临时维护输入框
+      updateInfoPoint: '',//临时维护信息点
+      updateInput: '', //临时维护信息点值
+      qrcodeUrl: "", //二维码图片地址
+      imgsArr: [], //临时保存的图片key数组
+      showType: this.$route.query.showType,
+      buildFloorData: [],
+    };
+  },
+  computed: {
+    ...mapGetters("layout", ["projectId", "secret", "userId"])
+  },
+  created() {
+    this.space = this.$route.query;
+    buildFloor.getData(this.buildFloorData)
+    this.getTableHeader();
+  },
+  methods: {
+    // 获取表头数据(初始化表格)
+    async getTableHeader() {
+      let params = {
+        data: {
+          Orders: "sort asc, InfoPointName desc",
+          PageNumber: 1,
+          PageSize: 1000
+        },
+        type: this.space.spaceType
+      };
+      await getDataDictionary(params, res => {
+        this.tableHeader = res.Content;
+        this.tableHeader.forEach(item => {
+          if (item.Path && item.InputMode) {
+            this.inputMap[item.Path] = item
+          }
+        })
+        this.initTable();
+      });
+    },
+    // 创建业务空间数据
+    async handleCreateTableData() {
+      let newData = this.tableData.filter(item => {
+        let keys = Object.keys(item);
+        keys.map(key => {
+          //将值为空字符串的属性删除
+          if (item[key] == "") {
+            delete item[key];
+          }
+        });
+        let newK = Object.keys(item)
+        if (newK.length) {
+          return item;
+        }
+      });
+      if (!newData.length) {
+        this.$message("创建信息为空,请录入信息后再创建!");
+        return;
+      }
+      let flag = false;
+      newData.map(item => {
+        if (!item.RoomLocalName) {
+          flag = true;
+        }
+        // 处理建筑-楼层
+        if (item.flowBuild) {
+          let bid = item.flowBuild.split("-");
+          item.BuildingId = item.flowBuild.split("-")[0]
+          if (bid[1]) {
+            item.FloorId = item.flowBuild.split("-")[1]
+          }
+        }
+        item.ObjectType = this.space.spaceType;
+      })
+      if (flag) {
+        this.$message.info("存在业务空间的本地名称为空,请检查")
+        return;
+      }
+      //待接口修改为关联创建即可修改
+      let param = {
+        Content: newData
+      }
+      zoneCreate(param, res => {
+        this.$message.success('创建成功')
+        session.remove("spaceAddData")
+        this.$router.push({
+          name: "spacelist",
+          params: {
+            zone: this.space.spaceType,
+            buildFloorSelectd: ['all'],
+            isMyTab: '2'
+          }
+        });
+      })
+    },
+    // 删除表格行
+    handleDeleteTableRow() {
+      this.$message.success("删除成功");
+      this.formaTableData();
+    },
+    // 添加行
+    handleAddTableRow() {
+      let addRowLength = this.addNum;
+      for (let i = 0; i < addRowLength; i++) {
+        this.tableData.push({ Checked: 1 });
+      }
+      this.initTable();
+      this.formaTableData();
+    },
+    //修改
+    handleUpdataTable(changeData, source) {
+      if (!this.onlyRead && source != 'ObserveChanges.change') {
+        this.formaTableData();
+      }
+    },
+    //保存去掉空字段的新增数据
+    formaTableData() {
+      let newData = this.tableData.filter(item => {
+        let keys = Object.keys(item);
+        keys.map(key => {
+          //将值为空字符串的属性删除
+          if (item[key] == "") {
+            delete item[key];
+          }
+        });
+        if (keys.length && Object.keys(item).length) {
+          return item;
+        }
+      });
+      session.set("spaceAddData", newData);
+    },
+    //格式化表头显示的数据
+    formatHeaderData(list) {
+      let arr = tools.copyArr(list);
+      let data = showTools.headerTextFilter(arr, 'space', this.onlyRead, this.showType, true);
+      data.unshift("所属建筑楼层");
+      return data;
+    },
+    formatHeaderType(list) {
+      //格式化表头头映射的数据
+      let arr = tools.copyArr(list);
+      let data = showTools.headerTypeFilter(arr, 'space', this.onlyRead, this.showType, true);
+      data.unshift({
+        data: "flowBuild",
+        renderer: tools.customDropdownRenderer,
+        editor: "chosen",
+        chosenOptions: {
+          data: this.buildFloorData
+        }
+      });
+      return data;
+    },
+    initTable() {
+      //实例化表格
+      let settings = {
+        data: this.tableData,
+        colHeaders: this.formatHeaderData(this.tableHeader),
+        columns: this.formatHeaderType(this.tableHeader),
+        rowHeights: 30,
+        maxRows: this.tableData.length,
+        contextMenu: this.onlyRead ? false :{
+          items: {
+            remove_row: {
+              name: "删除业务空间"
+            }
+          }
+        },
+        // 事件
+        afterChange: this.handleUpdataTable, //修改后
+        afterFilter: this.trimmedRows, //排序前
+        afterRemoveRow: this.handleDeleteTableRow, //右键删除
+        afterOnCellMouseDown: this.handleTdClick //鼠标点击
+      };
+      this.$nextTick(() => {
+        this.tableExample = this.$refs.table.init(settings);
+      });
+    },
+    //去除数组中相同的元素
+    array_diff(a, b) {
+      for (var i = 0; i < b.length; i++) {
+        for (var j = 0; j < a.length; j++) {
+          if (a[j] == b[i]) {
+            a.splice(j, 1);
+            j = j - 1;
+          }
+        }
+      }
+      return a;
+    },
+    //表格点击事件
+    handleTdClick(el, rowArr) {
+      //点击的是表头
+      if (rowArr.row < 0) {
+        return;
+      }
+      //被筛选过后的数组
+      let trimmedArr = this.trimmedRows();
+      //是否启用了排序
+      let isSort = this.tableExample.getPlugin("columnSorting").isSorted();
+      if (trimmedArr.length && isSort) {
+        let sortArr = this.myHotArr.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
+        let infos = this.tableData[trimmedArr[sortArr[rowArr.row]]];
+        this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
+      } else if (isSort) {
+        //排序后的数组
+        let sortArr = this.tableExample.getPlugin("columnSorting").rowsMapper
+          .__arrayMap;
+        let infos = this.tableData[sortArr[rowArr.row]];
+        this.getInfors(infos, { row: sortArr[rowArr.row], col: rowArr.col });
+      } else if (trimmedArr.length) {
+        let infos = this.tableData[trimmedArr[rowArr.row]];
+        this.getInfors(infos, { row: trimmedArr[rowArr.row], col: rowArr.col });
+      } else {
+        let infos = this.tableData[rowArr.row];
+        this.getInfors(infos, rowArr);
+      }
+    },
+    //获取被筛选掉的行号
+    trimmedRows() {
+      var plugin = this.tableExample.getPlugin("trimRows").trimmedRows;
+      let dataLength = this.tableData.length;
+      let dataArr = new Array();
+      for (let i = 0; i < dataLength; i++) {
+        dataArr.push(i);
+      }
+      if (plugin.length <= 0) {
+        dataArr = undefined;
+      } else {
+        dataArr = this.array_diff(dataArr, plugin);
+      }
+      return dataArr || [];
+    },
+    getInfors(infos, row) {
+      let val = this.tableExample.colToProp(row.col);
+      this.row = row.row;
+      this.messKey = val;
+      let inputData = this.inputMap[val];
+      switch (val) {
+        //空间二维码图片
+        case 'RoomQRCode':
+          this.qrcodeUrl = this.tableData[row.row].RoomQRCode;
+          if (!!this.qrcodeUrl) {
+            this.myDialog.qrcode = true;
+          } else {
+            this.$message("此空间没有二维码");
+          }
+          break;
+        case 'Pic':
+          let Pdata = tools.dataForKey(this.tableData[row.row], val);
+          this.imgsArr = Pdata ? Pdata : [];
+          this.myDialog.uploadImgs = true;
+          break;
+        default:
+          break;
+      }
+      if (!this.onlyRead && !inputData.Editable) {
+        this.$message("该信息点的值为自动生成,不可人工维护!");
+        return false;
+      }
+      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
+        this.updateInfoPoint = val;
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+        this.myDialog.update = true;
+        return false;
+      }
+    },
+    //关闭临时维护弹窗回调
+    handleCloseUpdate() {
+      this.updateInputShow = false
+      this.updateInfoPoint = ''
+      this.updateInput = ''
+    },
+    //更新临时维护信息点
+    handleClickUpdate() {
+      tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
+      this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
+      this.updateInputShow = false
+      this.myDialog.update = false
+      this.updateInput = ''
+    },
+    utilToKey(key, name, data, messName) {
+      if (key == name) {
+        this.setDataToMain(data[key], messName, this.row);
+      }
+    },
+    //上传图片弹窗触发事件
+    imgChange(keys) {
+      this.setDataToMain(keys, 'Pic', this.row);
+    },
+    //判断是否有值,有值赋值
+    setDataToMain(data, key, row) {
+      if (!!data && data != "--") {
+        if (!!this.tableData[row]) {
+          //铭牌照片特殊处理
+          tools.setDataForKey(this.tableData[row], key, data)
+          // this.tableData[row][key] = data;
+        } else {
+          this.tableData[row] = {};
+          tools.setDataForKey(this.tableData[row], key, data)
+        }
+      } else {
+        tools.setDataForKey(this.tableData[row], key, "")
+      }
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+#deviceList {
+  overflow: hidden;
+  height: 100%;
+  background-color: #fff;
+  padding: 10px;
+  position: relative;
+  .right {
+    background: #fff;
+  }
+  .search-header {
+    overflow: hidden;
+    padding: 0 10px 10px 10px;
+    border-bottom: 1px solid #bcbcbc;
+  }
+  .tableBox {
+    display: flex;
+    height: calc(100% - 100px);
+    margin-top: 10px;
+    .tableLeft {
+      flex: 1;
+    }
+  }
+  .create_button {
+    margin-top: 10px;
+  }
+}
+</style>

+ 4 - 4
src/views/ledger/system/addsystem.vue

@@ -95,7 +95,7 @@ export default {
       systemId: null,
       graphyId: null,
       id: 0,
-      showType: 'Visible',
+      showType: this.$route.query.showType,
       EquipmentList: [],
     };
   },
@@ -131,7 +131,7 @@ export default {
     getBuildData() {
       let param = {
         PageNumber: 1,
-        PageSize: 500,
+        PageSize: 1000,
         Projection: [
           "BuildID",
           "BuildLocalName"
@@ -152,9 +152,9 @@ export default {
     async getTableHeader() {
       let params = {
         data: {
-          Orders: "sort asc",
+          Orders: "sort asc, InfoPointName desc",
           PageNumber: 1,
-          PageSize: 500
+          PageSize: 1000
         },
         type: this.category.Category
       };