Browse Source

Merge branch 'device' into dktest

haojianlong 5 years ago
parent
commit
454fddefcb

+ 14 - 2
src/api/scan/request.js

@@ -1185,12 +1185,24 @@ export function floorQuery(param, success) {
     http.postJson(url, param, success)
 }
 
+//查询楼层信息+sign
+export function floorQueryAndSign(param, success) {
+    let url = `${baseUrl}/equip-component/floor/query`;
+    http.postJson(url, param, success)
+}
+
 //查询建筑信息
 export function buildingQuery(param, success) {
     let url = `${baseUrl}/datacenter/building/query`;
     http.postJson(url, param, success)
 }
 
+//查询建筑信息+count
+export function buildingQueryAndCount(param, success) {
+    let url = `${baseUrl}/equip-component/building/query`;
+    http.postJson(url, param, success)
+}
+
 //创建分区信息
 export function createZone(param, success) {
     let data = param.data
@@ -1393,8 +1405,8 @@ export function getIspNotInSpace(param, success) {
     let url = `${baseUrl}/equip-component/space/unspace-ispace?objectType=${param.objectType}`;
     http.postJson(url, param.data, success)
 }
-//关系-----业务空间内的元空间,业务空间一对多,累计添加会覆盖以前记录
+//关系-----业务空间内的元空间,业务空间一对多,累计添加会覆盖以前记录
 export function createRelateInZoneAndISp(param, success) {
-    let url = `${baseUrl}/datacenter/si-in-sp-base/link-si-sp?type=${param.type}`;
+    let url = `${baseUrl}/datacenter/si-in-sp-base/link-sp?type=${param.type}`;
     http.postJson(url, param.data, success)
 }

+ 1 - 0
src/components/business_space/newAddDialogs/addEquipDialog.vue

@@ -128,6 +128,7 @@ export default {
     // 显示弹窗
     showDialog() {
       this.dialogVisible = true;
+      this.tableData = [];
       this.getTableData();
     },
     // 获取列表数据

+ 1 - 0
src/components/business_space/newAddDialogs/addSystemDialog.vue

@@ -57,6 +57,7 @@ export default {
     // 显示
     showDialog() {
       this.dialogVisible = true;
+      this.tableData = [];
       this.getTableData();
     },
     // 选中项修改

+ 1 - 0
src/components/ledger/cenote/dialog/addCenoteDialog.vue

@@ -97,6 +97,7 @@ export default {
     showDialog() {
       this.dialogVisible = true
       this.page.pageNumber = 1
+      this.tableData = []
       this.getTableData()
     },
     getTableData() {

+ 1 - 0
src/components/ledger/cenote/dialog/addEquipDialog.vue

@@ -91,6 +91,7 @@ export default {
     showDialog() {
       this.dialogVisible = true
       this.page.pageNumber = 1
+      this.tableData = []
       this.getTableData()
     },
     getTableData() {

+ 1 - 0
src/components/ledger/cenote/dialog/addSystemDialog.vue

@@ -73,6 +73,7 @@ export default {
     showDialog() {
       this.dialogVisible = true
       this.page.pageNumber = 1
+      this.tableData = []
       this.getTableData()
     },
     getTableData() {

+ 1 - 1
src/components/point/dynamicdata/equipRules.vue

@@ -247,7 +247,7 @@ export default {
   }
   /deep/ .table-area {
     width: 100%;
-    height: calc(100% - 125px);
+    height: calc(100% - 71px);
     margin-bottom: 10px;
     td div {
       white-space: nowrap;

+ 1 - 1
src/components/point/dynamicdata/partsRules.vue

@@ -248,7 +248,7 @@ export default {
   }
   /deep/ .table-area {
     width: 100%;
-    height: calc(100% - 125px);
+    height: calc(100% - 71px);
     margin-bottom: 10px;
     td div {
       white-space: nowrap;

+ 1 - 1
src/components/point/dynamicdata/spaceRules.vue

@@ -248,7 +248,7 @@ export default {
   }
   /deep/ .table-area {
     width: 100%;
-    height: calc(100% - 125px);
+    height: calc(100% - 71px);
     margin-bottom: 10px;
     td div {
       white-space: nowrap;

+ 1 - 1
src/components/point/dynamicdata/systemRules.vue

@@ -248,7 +248,7 @@ export default {
   }
   /deep/ .table-area {
     width: 100%;
-    height: calc(100% - 125px);
+    height: calc(100% - 71px);
     margin-bottom: 10px;
     td div {
       white-space: nowrap;

+ 3 - 3
src/views/data_admin/buildAssets/index.vue

@@ -145,9 +145,9 @@ export default {
         background:#fff;
         margin-bottom: 10px;
     }
+    /deep/ .el-tabs__nav{
+        margin-left: 10px;
+    }
 }
 </style>
-<style>
-.box .el-tabs__nav {margin-left: 10px;}
-</style>
 

+ 38 - 25
src/views/ledger/facility/batchlink.vue

@@ -16,10 +16,12 @@
           <el-table-column prop="EquipLocalID" label="设备本地编码" show-overflow-tooltip max-width="150">
             <!-- <template slot-scope="scope">{{ scope.row.EquipLocalID?scope.row.EquipLocalID:scope.row.EquipID }}</template> -->
           </el-table-column>
-          <el-table-column prop="Category" label="设备类" show-overflow-tooltip width="100"></el-table-column>
+          <el-table-column prop="EquipCategory.EquipName" label="设备类" show-overflow-tooltip width="100"></el-table-column>
           <el-table-column prop="CADID" label="设计图纸中编码" show-overflow-tooltip max-width="150"></el-table-column>
           <el-table-column label="所属建筑楼层">
-            <template slot-scope="scope">{{ scope.row.BuildingId }}-{{ scope.row.FloorId }}</template>
+            <template slot-scope="scope">
+              {{ scope.row.Building?scope.row.Building.BuildLocalName:'' }}-{{ scope.row.Floor?scope.row.Floor.FloorLocalName:'' }}
+            </template>
           </el-table-column>
           <el-table-column prop="PropertyItem.EquipLocalName" label="资产本地名称" show-overflow-tooltip max-width="150">
             <!-- <template slot-scope="scope">{{ scope.row.AssetsLocalName }}</template> -->
@@ -27,10 +29,12 @@
           <el-table-column prop="PropertyItem.EquipLocalID" label="资产本地编码" show-overflow-tooltip max-width="150">
             <!-- <template slot-scope="scope">{{ scope.row.AssetsLocalId }}</template> -->
           </el-table-column>
-          <el-table-column prop="PropertyItem.Family" label="设备族" show-overflow-tooltip width="100"></el-table-column>
+          <el-table-column prop="PropertyItem.FamilyName.Name" label="设备族" show-overflow-tooltip width="100"></el-table-column>
           <el-table-column prop="PropertyItem.CADID" label="设计图纸中编码" show-overflow-tooltip max-width="150"></el-table-column>
           <el-table-column label="所属建筑楼层" show-overflow-tooltip width="200">
-            <template slot-scope="scope">{{ scope.row.PropertyItem.BuildingId }}-{{ scope.row.PropertyItem.FloorId }}</template>
+            <template slot-scope="scope">
+              {{ scope.row.PropertyItem.Building?scope.row.PropertyItem.Building.BuildLocalName:'' }}-{{ scope.row.PropertyItem.Floor?scope.row.PropertyItem.Floor.FloorLocalName:'' }}
+            </template>
           </el-table-column>
           <el-table-column prop="address" label="操作" width="100">
             <template slot-scope="scope">
@@ -85,6 +89,7 @@ export default {
       //   total: 0
       // },
       radio: {},
+      contentData: [],
       tableData: [],
       mergeCol: [],
       headerStyle: {
@@ -96,33 +101,38 @@ export default {
   },
   methods: {
     //获取表格数据
-    getTableData() {
+    getTableData(pageNum) {
       this.loading = true
-      this.tableData = []
-      let param = this.formatFilter()
+      let param = this.formatFilter(pageNum)
       equipCategoryProperty(param, res => {
         this.unlinkNumber = res.Total
-        this.linkNumber = res.Content.length
+        this.linkNumber += res.Content.length
         // this.page.total = res.Total
-        res.Content.forEach(item =>{
-          if(item.PropertyList && item.PropertyList.length){
-            item.PropertyList.forEach((Assets, index) => {
-              let obj = JSON.parse(JSON.stringify(Object.assign(item, {PropertyItem: Assets, disabled: false})))
-              delete obj.PropertyList
-              this.tableData.push(obj)
-              if(index == 0){
-                this.mergeCol.push(item.PropertyList.length)
-              } else {
-                this.mergeCol.push(false)
-              }
-            })
-          }
-        })
-        this.loading = false
+        this.contentData = this.contentData.concat(res.Content)
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.getTableData(res.PageNumber + 1)
+        } else {
+          this.contentData.forEach(item =>{
+            if(item.PropertyList && item.PropertyList.length){
+              item.PropertyList.forEach((Assets, index) => {
+                let obj = JSON.parse(JSON.stringify(Object.assign(item, {PropertyItem: Assets, disabled: false})))
+                delete obj.PropertyList
+                this.tableData.push(obj)
+                if(index == 0){
+                  this.mergeCol.push(item.PropertyList.length)
+                } else {
+                  this.mergeCol.push(false)
+                }
+              })
+            }
+          })
+          this.loading = false
+        }
       })
     },
     //格式化条件
-    formatFilter() {
+    formatFilter(pageNum) {
+      pageNum = pageNum ? pageNum : 1
       let param = {
           data: {
           //   Cascade: [
@@ -140,7 +150,7 @@ export default {
           //   }
           // ],
           Orders: "createTime desc, EquipID asc",
-          PageNumber: 1,
+          PageNumber: pageNum,
           PageSize: 1000
         },
         category: this.params.deviceType
@@ -218,6 +228,9 @@ export default {
         }
         equipRproperty(params, res => {
           this.radio = {}
+          this.linkNumber = 0
+          this.contentData = []
+          this.tableData = []
           this.getTableData()
           this.$message.success('关联成功!')
         })

+ 1 - 1
src/views/point/dynamicdata/index.vue

@@ -26,7 +26,7 @@
         </el-tooltip>
       </div>
     </el-row>
-    <div v-show="typeList.length" style="height: 100%;">
+    <div v-show="typeList.length" style="height: calc(100% - 54px);">
       <!-- 设备 -->
       <equipRules v-if="curType=='设备'" ref="equip" :typeName="curType" @refresh="refreshTabs" :isPending="isPending"></equipRules>
       <!-- 部件 -->

+ 9 - 9
src/views/ready/buildfloor/index.vue

@@ -14,7 +14,7 @@
           <div v-for="(item,index) in buildList" :key="item.BuildID" :class="{'floor-item':true,active:item.active}" @click="changeBuild(index)">
             <span>
               {{item.BuildLocalName || item.BuildName}}
-              <el-badge class="mark" :is-dot="false" />
+              <el-badge v-if="item.Count>0" class="mark" :value="item.Count" />
             </span>
           </div>
         </div>
@@ -38,15 +38,15 @@
             </el-table-column>
             <el-table-column prop="Datasource" label="平面图">
               <template slot-scope="scope">
-                <p v-if="scope.row.ModelId" @click="checkDrawImg(scope.row,1)">
-                  <i class="iconfont icon-floorplan"></i>
-                  查看平面图
-                </p>
-                <p v-else-if="scope.row.type==2" @click="checkDrawImg(scope.row,2)">
+                <p v-if="scope.row.Sign>0" @click="checkDrawImg(scope.row,2)">
                   <el-badge is-dot>
                     <i class="iconfont icon-floorplan"></i>
                   </el-badge>平面图重复
                 </p>
+                <p v-else-if="scope.row.ModelId" @click="checkDrawImg(scope.row,1)">
+                  <i class="iconfont icon-floorplan"></i>
+                  查看平面图
+                </p>
                 <p v-else @click="checkDrawImg(scope.row,3)">
                   <i class="iconfont icon-nopicture"></i>
                   暂无平面图
@@ -93,7 +93,7 @@ import addBuild from "@/components/ready/buildfloor/addBuild";
 import { mapGetters, mapActions } from "vuex";
 import addConnectivity from "@/components/ready/buildfloor/addConnectivity";
 import checkGraphy from "./drawGraphy/checkGraphy"; //查看图片
-import { buildingQuery, floorQuery, manageDeleteFloor } from "@/api/scan/request";
+import { buildingQueryAndCount, floorQueryAndSign, manageDeleteFloor } from "@/api/scan/request";
 export default {
   components: {
     addFloor,
@@ -140,7 +140,7 @@ export default {
         PageNumber: 1,
         PageSize: 500
       };
-      buildingQuery(bdParam, res => {
+      buildingQueryAndCount(bdParam, res => {
         this.buildList = res.Content;
         if (this.buildList.length) {
           this.changeBuild(0);
@@ -197,7 +197,7 @@ export default {
         PageSize: this.page.pageSize,
         Filters: `BuildID='${this.curBuildId}'`
       };
-      floorQuery(floorParam, res => {
+      floorQueryAndSign(floorParam, res => {
         this.tableData = res.Content;
         this.page.total = res.Total;
       });

+ 4 - 4
src/views/ready/buildfloor/repetitionGraphy.vue

@@ -49,18 +49,18 @@ export default {
     },
     // 确认保存
     confirm() {
-      let grabitem = this.$refs.drawFloor.drawMainScene.grabItem;
-      if (!grabitem || grabitem.outLine.length < 3) {
+      let sceneMark = this.$refs.drawFloor.drawMainScene.sceneMark;
+      if (!sceneMark || sceneMark.outLine.length < 3) {
         this.$message.warning('请添加轮廓线');
         return;
       }
-      if (!grabitem.closeFlag) {
+      if (!sceneMark.closeFlag) {
         this.$message.warning('请按回车闭合轮廓线');
         this.$refs.drawFloor.focus();
         return;
       }
       let pa = {
-        Content: [{ FloorID: this.FloorID, Outline: this.$refs.drawFloor.drawMainScene.grabItem.outLine }],
+        Content: [{ FloorID: this.FloorID, Outline: this.$refs.drawFloor.drawMainScene.sceneMark.outLine }],
         Projection: ['Outline']
       }
       floorUpdate(pa, res => {