Преглед изворни кода

Merge branch 'dev' of http://39.106.8.246:3003/web/ibms into dev

yangjunjing пре 4 година
родитељ
комит
be82fdaf3d

+ 1 - 1
.editorconfig

@@ -3,7 +3,7 @@ root = true
 [*]
 charset = utf-8
 indent_style = space
-indent_size = 4
+indent_size = 2
 end_of_line = lf
 insert_final_newline = true
 trim_trailing_whitespace = true

+ 1 - 1
README.md

@@ -22,7 +22,7 @@ npm run build --report
 #### 目录结构
 
 ```
-│  .editorconfig                        # 格式化配置,修改缩进为4
+│  .editorconfig                        # 格式化配置,修改缩进为2
 │  index.html                           # 修改页面title
 │  package.json                         # 包
 │  README.md                            # 说明文档

+ 12 - 9
src/api/scan/request.js

@@ -1458,20 +1458,13 @@ export function buildingQueryAndCount(param, success) {
   http.postJson(url, param, success)
 }
 
-//创建分区信息
+// 创建分区信息
 export function createZone(param, success) {
     let data = param.data
-    let url = `${baseUrl}/datacenter/${zone[param.zone]}/create`;
+    let url = `${baseUrl}/datacenter/${zone[param.zone]}/create-bd-fl`;
     http.postJson(url, data, success)
 }
 
-//创建分区信息
-// export function createZone(param, success) {
-//     let data = param.data
-//     let url = `${baseUrl}/datacenter/${zone[param.zone]}/create-bd-fl`;
-//     http.postJson(url, data, success)
-// }
-
 //删除分区信息
 export function deleteZone(param, success) {
   let data = param.data
@@ -1726,6 +1719,16 @@ export function getIspNotInSpace(param, success) {
   let url = `${baseUrl}/equip-component/space/unspace-ispace?objectType=${param.objectType}`;
   http.postJson(url, param.data, success)
 }
+//关系-----统计 属于多建筑楼层的空间数据
+export function getSpaceBdFlCount(param, success) {
+	let url = `${baseUrl}/equip-component/space/space-bd-fl`;
+	http.postJson(url, param, success)
+}
+//关系-----统计 属于多建筑楼层的空间数据
+export function getSpaceBdFlData(param, success) {
+	let url = `${baseUrl}/equip-component/space/space-bd-fl-data`;
+	http.postJson(url, param, success)
+}
 //关系-----业务空间内的元空间,业务空间一对多,累计添加会覆盖以前记录
 export function createRelateInZoneAndISp(param, success) {
   let url = `${baseUrl}/datacenter/si-in-sp-base/link-sp?type=${param.type}`;

+ 7 - 0
src/components/business_space/business/handsontable.vue

@@ -10,6 +10,9 @@
       <el-button v-show="!onlyRead" @click="addSp">添加</el-button>
       <el-button @click="reset">刷新</el-button>
       <el-button v-show="!onlyRead" @click="undo">撤销</el-button>
+      <el-input v-model="zoneItemID" placeholder="请输入业务空间id" @keyup.enter.native="getData" style="display:inline-block;width:500px;margin-left:20px;">
+        <i slot="suffix" class="el-input__icon el-icon-search" @click="getData"></i>
+      </el-input>
     </el-row>
     <div v-show="main &&main.length" :id="id"></div>
     <div class="center" v-show="!main || !main.length" style="height: 400px;padding-top:140px;box-sizing:border-box;">
@@ -98,6 +101,7 @@ export default {
       filtersArr: [], //表格数据被过滤后的下标
       copyMain: [], //深拷贝数组
       buildFloorData: [], //楼层数据
+      zoneItemID: ''
     };
   },
   created() {
@@ -141,6 +145,9 @@ export default {
           params.data.Filters += `;floorId='${this.buildFloorSelectd[1]}'`
         }
       }
+      if (this.zoneItemID) {
+        params.data.Filters += `;RoomID='${this.zoneItemID}'`
+      }
       if (!params.data.Filters) {
         delete params.data.Filters
       }

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

@@ -2,7 +2,7 @@
     firm 厂商
 -->
 <template>
-  <el-dialog title="选择型号" :visible.sync="dialog.firm" width="900px">
+  <el-dialog title="选择生产厂家/品牌/型号" :visible.sync="dialog.firm" width="900px">
     <div>
       <div id="firm">
         <div class="title-search query-form" style="padding: 10px;margin-bottom: 10px;">
@@ -60,7 +60,7 @@ import myPagination from "@/components/common/myPagination";
 import paramDetails from "@/components/business_space/dialogs/list/paramDetails"
 import { getSpecList, getBrandList, getManufacturerList } from "@/api/scan/request"
 
-    export default {
+export default {
   components: {
     myPagination,
     paramDetails

+ 64 - 39
src/components/business_space/newAddDialogs/roomInFloorDialog.vue

@@ -1,19 +1,39 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="800px" id="addSyDialog">
     <div class="table-box">
-      <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable">
+      <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable" border>
         <el-table-column label="业务空间名称" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
-              {{scope.row.SysLocalName||scope.row.SysName||''}}
+              {{scope.row.RoomLocalName||scope.row.RoomName||''}}
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="SysLocalID" label="所属建筑" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column prop="SysLocalID" label="所属楼层" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column prop="action" label="操作" min-width="100">
+        <el-table-column label="所属建筑" show-overflow-tooltip min-width="100" class-name="mutiCol">
           <template slot-scope="scope">
-            <el-button size="mini" @click="toDetail(scope.$index, scope.row)" type="primary" plain>查看详情</el-button>
+            <div>
+              <div v-for="(t,i) in scope.row.FloorList" :key="i" class="muti">
+                {{t.Building.BuildLocalName||t.Building.BuildName}}
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="SysLocalID" label="所属楼层" show-overflow-tooltip min-width="100" class-name="mutiCol">
+          <template slot-scope="scope">
+            <div>
+              <div v-for="t in scope.row.FloorList" :key="t.FloorID" class="muti">
+                {{t.FloorLocalName||t.FloorName}}
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="action" label="操作" min-width="50" align='center' class-name="mutiCol">
+          <template slot-scope="scope">
+            <div>
+              <div v-for="t in scope.row.FloorList" :key="t.FloorID" class="muti">
+                <el-radio v-model="scope.row.selected" :label="t">{{''}}</el-radio>
+              </div>
+            </div>
           </template>
         </el-table-column>
       </el-table>
@@ -24,12 +44,10 @@
     </span>
   </el-dialog>
 </template>
-
-
 <script>
 import {
-  notSyInSpaceQuery, //没有和当前空间绑定的系统
-  syInSpaceCreate, //系统所在业务空间--创建关系
+  getSpaceBdFlData, // 属于多建筑楼层的空间数据
+  updateRelateInSpAndBuild, //保存业务空间与建筑楼层关系
 } from "@/api/scan/request";
 export default {
   data() {
@@ -59,45 +77,39 @@ export default {
       this.tableData = [];
       this.getTableData();
     },
-    // 选中项修改
-    handleSelectionChange(val) {
-      this.selections = val;
-    },
     // 确认
     savaRelation() {
-      let pa = {
-        data: {
-          SpaceId: this.spaceId,
-          SysIdList: []
-        },
-        type: this.zone
-      }
-      this.selections.map(t => {
-        pa.data.SysIdList.push(t.SysID)
-      })
-      syInSpaceCreate(pa, res => {
-        this.$message.success('关联成功');
-        this.$emit('refresh');
-        this.dialogVisible = false;
+      let arr = [];
+      this.tableData.forEach(t => {
+        if (t.selected) {
+          arr.push({
+            spaceId: t.RoomID,
+            id: t.selected.FloorID,
+            type: t.ObjectType
+          })
+        }
       })
+      if (arr.length) {
+        updateRelateInSpAndBuild(arr, res => {
+          this.$emit('relaSuc');
+          this.$message.success('关联成功');
+          this.dialogVisible = false;
+        })
+      } else {
+        this.$message.warning('请选择关联建筑楼层');
+      }
     },
     // 获取表格数据
     getTableData() {
       let pa = {
-        data: {
-          PageSize: 200,
-          Orders: 'SysID asc'
-        },
-        type: this.zone,
-        spaceId: this.spaceId
+        Cascade: [
+          { Name: "floorlList", Cascade: [{ Name: 'building' }] }
+        ],
+        PageSize: 1000
       }
-      notSyInSpaceQuery(pa, res => {
+      getSpaceBdFlData(pa, res => {
         this.tableData = res.Content;
       })
-    },
-    // 查看详情
-    toDetail() {
-      this.$message('开发中')
     }
   }
 }
@@ -106,6 +118,19 @@ export default {
 #addSyDialog {
   .table-box {
     height: 350px;
+    /deep/ .mutiCol {
+      padding: 0;
+      & > div {
+        padding: 0;
+      }
+    }
+    .muti {
+      line-height: 32px;
+      padding: 0 10px;
+      & + .muti {
+        border-top: 1px solid #ebeef5;
+      }
+    }
   }
 }
 </style>

+ 1 - 0
src/components/business_space/newGraphy/graphy.vue

@@ -364,6 +364,7 @@ export default {
           this.curZoneItem = item;
           this.scene.clearZoneSelection();
           item.selected = true;
+          this.$emit('copyID', this.curZoneItem.data.RoomID)
         }
       }
     },

+ 26 - 46
src/components/dialogs/changeRea.vue

@@ -6,12 +6,13 @@
     <div>
       <div id="changeRea">
         <div class="title-search" style="margin-bottom: 10px;">
-          <el-input placeholder="输入名称或编码查询" v-model="search" size="small" style="width:300px;" clearable></el-input>
+          <floor-cascader @change="changeFloor"></floor-cascader>
+          <el-input placeholder="输入本地名称或本地编码查询" v-model="search" size="small" style="width:250px;marginLeft:30px;" clearable></el-input>
           <el-button @click="getPropertyData" size="small">查找</el-button>
         </div>
-        <div>
+        <!-- <div>
           <floor-cascader @change="changeFloor"></floor-cascader>
-        </div>
+        </div> -->
         <el-radio-group v-model="radio" style="width:100%;">
           <el-table :data="tableData" style="width: 100%" height="300px">
             <el-table-column label="资产名称">
@@ -25,10 +26,14 @@
               <template slot-scope="scope">{{scope.row.EquipLocalID || scope.row.EquipID}}</template>
             </el-table-column>
             <el-table-column prop="name" label="所在楼层">
-              <template slot-scope="scope">{{getFloor(scope.row.FloorId)}}</template>
+              <template slot-scope="scope">
+                {{ scope.row.Building?scope.row.Building.BuildLocalName?scope.row.Building.BuildLocalName:'':'' }}-{{ scope.row.Floor?scope.row.Floor.FloorLocalName?scope.row.Floor.FloorLocalName:'':'' }}
+              </template>
             </el-table-column>
             <el-table-column label="设备族">
-              <span>{{this.category.assetName}}</span>
+              <template slot-scope="scope">
+                {{scope.row.EquipFamilyList[0].FamilyName}}
+              </template>
             </el-table-column>
             <el-table-column label="安装位置">
               <template slot-scope="scope">
@@ -48,7 +53,7 @@
 <script>
 import myPagination from "@/components/ledger/lib/myPagination";
 import paramDetails from "@/components/dialogs/list/paramDetails"
-import { getSpaceFloor, queryProperty } from "@/api/scan/request"
+import { queryProperty } from "@/api/scan/request"
 import floorCascader from "@/components/ledger/lib/floorCascader";
 import { mapGetters, mapActions } from "vuex"
 export default {
@@ -86,36 +91,13 @@ export default {
       },
       mess: {},
       codeListCode: [],
-      floorList: []
     };
   },
-  created() {
-    this.getFloorList();
-  },
   computed: {
     ...mapGetters("layout", ["projectId", "secret", "userId"])
   },
   mounted() { },
   methods: {
-    //根据楼层id对应楼层
-    getFloor(relation) {
-      let floor = !!relation ? relation.floor || "" : ""
-      if (!!floor) {
-        let floorName = ""
-        this.floorList.map(item => {
-          if (!!item.floors && item.floors.length) {
-            item.floors.map(child => {
-              if (child.id == floor) {
-                floorName = child.infos.FloorLocalName || child.infos.FloorName
-              }
-            })
-          }
-        })
-        return floorName
-      } else {
-        return "--"
-      }
-    },
     //确认选择
     clickTrue() {
       if (this.radio) {
@@ -125,22 +107,6 @@ export default {
         this.$message("请先选择资产")
       }
     },
-    //查询条件-所在建筑楼层
-    getFloorList() {
-      let param = {
-        secret: this.secret,
-        ProjId: this.projectId
-      }
-      getSpaceFloor(param).then(res => {
-        if (res.data.Result == "success") {
-          this.floorList = res.data.Content
-        } else {
-          this.$message.error("请求错误:" + res.data.ResultMsg)
-        }
-      }).catch(_ => {
-        this.$message.error("请求错误")
-      })
-    },
     //所在建筑楼层修改
     changeFloor(val) {
       this.mess = {
@@ -166,6 +132,20 @@ export default {
     //查询表数据
     getPropertyData() {
       let param = { 
+        Cascade: [
+          {
+            Name: "equipFamilyList",
+            Projection: [ "Family", "FamilyName" ]
+          },
+          {
+            Name: "building",
+            Projection: ["BuildLocalName", "BuildName", "BuildID"]
+          },
+          {
+            Name: "floor",
+            Projection: ["FloorLocalName", "FloorName", "FloorID"]
+          }
+        ],
         Filters: `EquipmentId isNull;Family="${this.category.assetType}"`,
         PageNumber: this.page.currentPage,
         PageSize: this.page.size
@@ -184,7 +164,7 @@ export default {
       }
       //名称和编码
       if (this.search) {
-        param.Filters += `;floorId='${this.mess.floorId}'`
+        param.Filters += `;EquipLocalName contain '${this.search}' || EquipLocalID contain '${this.search}'`
       }
       queryProperty(param, res => {
         this.tableData = res.Content

+ 16 - 10
src/components/ledger/handsontables/device.vue

@@ -15,8 +15,8 @@
       </el-select>
       <!-- <el-button size="small" style='width: 80px;' @click="download" icon="iconfont icon-xiazai">下载</el-button> -->
       <el-button size="small" style='width: 80px;' @click="addDevice">添加设备</el-button>
-        <el-button size="small" @click="Batch" :disabled="batchDate">批量维护信息点</el-button>
-        <el-button size="small" style='width: 80px;' @click="reset">刷新</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">刷新</el-button>
       <el-button size="small" style='width: 80px;' v-show="!onlyRead" @click="undo">撤销</el-button>
     </div>
     <!-- 二维码弹窗 -->
@@ -206,10 +206,10 @@ export default {
                 [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}] :
                 [{value: "partInfo", label: '隐藏信息点'}, {value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}]
         },
-        batchDate() {
-            // return !(!this.onlyRead && this.copyMain)
-            return !(!this.onlyRead && this.page.total > 1)
-        },
+        // batchDate() {
+        //     // return !(!this.onlyRead && this.copyMain)
+        //     return !(!this.onlyRead && this.page.total > 1)
+        // },
         batchDialogShow() {
             return this.$refs.batchDialogs.batchDialog
         }
@@ -715,7 +715,7 @@ export default {
         },
         // 更新
         handleUpdataTable(changeData, source) {
-            if (!this.onlyRead) {
+            if (!this.onlyRead && source != 'ObserveChanges.change') {
                 if (changeData) {
                     let trimmedArr = this.trimmedRows();
                     let param = handsonUtils.getParam(changeData, source, this.hot, trimmedArr);
@@ -1138,13 +1138,19 @@ export default {
                 }
                 this.firmName = firm //批量维护dialog显示对象的字段
             } else {  //如果是表格操作
-                tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)
-                tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brand)
+                tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
+                tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
+                tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
+                tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Manufacturer", data.venderName)
+                tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Brand", data.brandName)
                 tools.setDataForKey(this.tableData[this.row], "LedgerParam.EquipManufactor.Specification", data.name)
                 this.handleUpdataTable(
                     [
                         [this.row, "DPManufacturerID", null, data.venderId],
-                        [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand],
+                        [this.row, "DPBrandID", null, data.brandId],
+                        [this.row, "DPSpecificationID", null, data.specificationId],
+                        [this.row, "LedgerParam.EquipManufactor.Manufacturer", null, data.venderName],
+                        [this.row, "LedgerParam.EquipManufactor.Brand", null, data.brandName],
                         [this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]
                     ],
                     "edit"

+ 2 - 1
src/components/relation/overview/CardList.vue

@@ -255,7 +255,8 @@
       },
       openComputed(result) {
         this.$emit('openComputed', result)
-      }
+      },
+
     },
     components: {RelationMaintain}
   }

+ 2 - 2
src/utils/handsontable/notShow.js

@@ -1052,7 +1052,7 @@ const showTools = {
             return {
                 data: item.Path,
                 type: "date",
-                dateFormat: "YYYY-MM-DD",
+                dateFormat: "YYYYMMDDHHmmss",
                 readOnly: onlyRead,
                 correctFormat: true
             };
@@ -1161,7 +1161,7 @@ const showTools = {
             return {
                 data: item.Path,
                 type: "date",
-                dateFormat: "YYYY-MM-DD",
+                dateFormat: "YYYYMMDDHHmmss",
                 readOnly: !item.Editable,
                 correctFormat: true
             };

+ 83 - 23
src/views/business_space/dataUtil/index2.vue

@@ -1,7 +1,15 @@
 <template>
   <div class="main-box">
     <div class="saga-build-mess">
-      <el-button @click="queryZone">导入业务空间BIMLocation</el-button>
+      <h4>接口基于数据中心,数据更改基于已创建业务空间本身数据计算而得,有轮廓线即可写入BIMLocation,处理单位是毫米的高度为米</h4>
+      <el-checkbox-group v-model="checkTypeList">
+        <el-checkbox v-for="item in tabsList" :label="item.Code" :key="item.Rel_type">{{item.Name}}</el-checkbox>
+      </el-checkbox-group>
+      <el-checkbox-group v-model="checkDataList">
+        <el-checkbox label="BIMLocation">根据业务空间轮廓线计算得</el-checkbox>
+        <el-checkbox label="Height">根据<b>业务空间或元空间</b>本身高度超过100,则/1000(如果本身没有高度或小于100不会处理)</el-checkbox>
+      </el-checkbox-group>
+      <el-button @click="queryZone">导入业务空间选中的数据</el-button>
     </div>
   </div>
 </template>
@@ -77,8 +85,32 @@ export default {
           "Name": '功能分区',
           'Rel_type': '11',
           "Code": 'FunctionZone'
-        }
+        },
+        {
+          "Name": '元空间',
+          "Code": 'Ispace',
+          "Rel_type": '--'
+        },
       ],
+      checkDataList: ['BIMLocation'],
+      checkTypeList: ['GeneralZone', 'PowerSupplyZone', 'LightingZone', 'NetworkZone', 'AirConditioningZone', 'HeatingZone', 'CleanZone', 'DomesticWaterSupplyZone', 'FireZone', 'SecurityZone', 'TenantZone', 'FunctionZone'],
+      codeToName: {
+        GeneralZone: '默认分区',
+        PowerSupplyZone: '供电分区',
+        LightingZone: '照明分区',
+        NetworkZone: '网络分区',
+        AirConditioningZone: '空调分区',
+        HeatingZone: '采暖分区',
+        CleanZone: '洁净分区',
+        DomesticWaterSupplyZone: '生活给水分区',
+        FireZone: '防火分区',
+        SecurityZone: '安防分区',
+        TenantZone: '租户分区',
+        FunctionZone: '功能分区',
+        Ispace: '元空间',
+      },
+      checkAll: false,
+      isIndeterminate: true
     }
   },
   computed: {
@@ -88,8 +120,8 @@ export default {
     init() { },
     // 查询该项目下所有的业务空间
     queryZone() {
-      this.tabsList.map(t => {
-        this.getZone(t.Code, 1, t.Name);
+      this.checkTypeList.map(t => {
+        this.getZone(t, 1, this.codeToName[t]);
       })
     },
     getZone(Code, PageNumber, Name) {
@@ -107,30 +139,58 @@ export default {
           console.log(num)
           this.getZone(Code, num, Name)
         }
-        let params = {
-          data: {
-            Content: [],
-            Projection: ["BIMLocation"]
-          },
-          zone: Code
-        }
-        res.Content.map(t => {
-          if (t.Outline && t.Outline[0]) {
-            t.BIMLocation = this.getAverageVal(t.Outline);
-            let obj = {
-              RoomID: t.RoomID,
-              BIMLocation: t.BIMLocation
+        // 更新BIMLocation
+        if (this.checkDataList.indexOf("BIMLocation") > -1) {
+          let params = {
+            data: {
+              Content: [],
+              Projection: ["BIMLocation"]
+            },
+            zone: Code
+          }
+          res.Content.map(t => {
+            if (t.Outline && t.Outline[0]) {
+              t.BIMLocation = this.getAverageVal(t.Outline);
+              let obj = {
+                RoomID: t.RoomID,
+                BIMLocation: t.BIMLocation
+              }
+              params.data.Content.push(obj);
             }
-            params.data.Content.push(obj);
+          });
+          this.updateZoneData(params, Name)
+        }
+
+        // 更新业务空间Height
+        if (this.checkDataList.indexOf("Height") > -1) {
+          let params2 = {
+            data: {
+              Content: [],
+              Projection: ["Height"]
+            },
+            zone: Code
           }
-        });
-        if (params.data.Content.length) {
-          updateZone(params, res => {
-            console.log(`${this.projectId},${Name},${params.data.Content.length}条更新完成`);
-          })
+          res.Content.map(t => {
+            if (t.Height && t.Height > 100) {
+              t.Height = (t.Height / 1000).toFixed(2);
+              let obj = {
+                RoomID: t.RoomID,
+                Height: t.Height
+              }
+              params2.data.Content.push(obj);
+            }
+          });
+          this.updateZoneData(params2, Name)
         }
       })
     },
+    updateZoneData(param, Name) {
+      if (param.data.Content.length) {
+        updateZone(param, res => {
+          console.log(`${this.projectId},${Name},${param.data.Projection.toString()},${param.data.Content.length}条更新完成`);
+        })
+      }
+    },
     getAverageVal(Outline) {
       let X = 0, Y = 0, Z = 0, len = 0;
       Outline.map(t => {

+ 303 - 0
src/views/ledger/report/indexExport.vue

@@ -0,0 +1,303 @@
+<template>
+  <div>
+    <el-row style="margin-top: 30px;">
+      <span>请选择要导出的数据:</span>
+      <el-select v-model="value" placeholder="请选择">
+        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
+      </el-select>
+      <el-button @click="handleClickDownload" type="primary" :loading="loading" style="margin-left: 15px;">导出Excel</el-button>
+    </el-row>
+    <div style="text-align:center;font-size:25px;margin-top:20%;">当前页面中的为临时功能,完整版正在设计中……</div>
+  </div>
+</template>
+
+<script>
+import jsontoExcel from "@/utils/JOSNToExcel"
+import { State, Family } from "@/data/mapTable"
+import { queryEquip, queryProperty } from "@/api/scan/request"
+import { mapGetters, mapActions } from "vuex"
+
+export default {
+  data() {
+    return {
+      loading: false,
+      value: '',
+      dataList: [],
+      options: [{
+        value: 'header1',
+        label: '已建立关联的设备资产'
+      }, {
+        value: 'header2',
+        label: '未关联资产的设备'
+      }, {
+        value: 'header3',
+        label: '未关联设备的资产'
+      }],
+      header1: [{
+        fieldName: "Building.BuildLocalName",
+        headerName: "建筑"
+      }, {
+        fieldName: "Floor.FloorLocalName",
+        headerName: "楼层"
+      }, {
+        fieldName: "EquipCategory.EquipName",
+        headerName: "设备类"
+      }, {
+        fieldName: "EquipLocalName",
+        headerName: "设备本地名称"
+      }, {
+        fieldName: "EquipLocalID",
+        headerName: "设备本地编码"
+      }, {
+        fieldName: "EquipID",
+        headerName: "设备id"
+      }, {
+        fieldName: "BIMID",
+        headerName: "设备BIMID"
+      }, {
+        fieldName: "Property.EquipFamilyList.0.FamilyName",
+        headerName: "资产设备族"
+      }, {
+        fieldName: "Property.EquipLocalName",
+        headerName: "资产本地名称"
+      }, {
+        fieldName: "Property.EquipLocalID",
+        headerName: "资产本地编码"
+      }, {
+        fieldName: "Property.EquipID",
+        headerName: "资产id"
+      }, {
+        fieldName: "Property.CreateTime",
+        headerName: "资产创建时间"
+      }, {
+        fieldName: "Property.CodeType",
+        headerName: "资产现场验证状态"
+      }, {
+        fieldName: "LedgerParam.Siteinstall.InstallLocation",
+        headerName: "安装位置"
+      }],
+      header2: [{
+        fieldName: "Building.BuildLocalName",
+        headerName: "建筑"
+      }, {
+        fieldName: "Floor.FloorLocalName",
+        headerName: "楼层"
+      }, {
+        fieldName: "EquipCategory.EquipName",
+        headerName: "设备类"
+      }, {
+        fieldName: "EquipLocalName",
+        headerName: "设备本地名称"
+      }, {
+        fieldName: "EquipLocalID",
+        headerName: "设备本地编码"
+      }, {
+        fieldName: "EquipID",
+        headerName: "设备id"
+      }, {
+        fieldName: "BIMID",
+        headerName: "设备BIMID"
+      }, {
+        fieldName: "Property.EquipFamilyList.0.FamilyName",
+        headerName: "资产设备族"
+      }, {
+        fieldName: "Property.EquipLocalName",
+        headerName: "资产本地名称"
+      }, {
+        fieldName: "Property.EquipLocalID",
+        headerName: "资产本地编码"
+      }, {
+        fieldName: "Property.EquipID",
+        headerName: "资产id"
+      }, {
+        fieldName: "Property.CreateTime",
+        headerName: "资产创建时间"
+      }, {
+        fieldName: "Property.CodeType",
+        headerName: "资产现场验证状态"
+      }, {
+        fieldName: "LedgerParam.Siteinstall.InstallLocation",
+        headerName: "安装位置"
+      }],
+      header3: [{
+        fieldName: "Building.BuildLocalName",
+        headerName: "建筑"
+      }, {
+        fieldName: "Floor.FloorLocalName",
+        headerName: "楼层"
+      }, {
+        fieldName: "Equipment.EquipCategory.EquipName",
+        headerName: "设备类"
+      }, {
+        fieldName: "Equipment.EquipLocalName",
+        headerName: "设备本地名称"
+      }, {
+        fieldName: "Equipment.EquipLocalID",
+        headerName: "设备本地编码"
+      }, {
+        fieldName: "Equipment.EquipID",
+        headerName: "设备id"
+      }, {
+        fieldName: "Equipment.BIMID",
+        headerName: "设备BIMID"
+      }, {
+        fieldName: "EquipFamilyList.0.FamilyName",
+        headerName: "资产设备族"
+      }, {
+        fieldName: "EquipLocalName",
+        headerName: "资产本地名称"
+      }, {
+        fieldName: "EquipLocalID",
+        headerName: "资产本地编码"
+      }, {
+        fieldName: "EquipID",
+        headerName: "资产id"
+      }, {
+        fieldName: "CreateTime",
+        headerName: "资产创建时间"
+      }, {
+        fieldName: "CodeType",
+        headerName: "资产现场验证状态"
+      }, {
+        fieldName: "LedgerParam.Siteinstall.InstallLocation",
+        headerName: "安装位置"
+      }]
+    }
+  },
+  methods: {
+    handleClickDownload() {
+      this.loading = true
+      this.dataList = []
+      if (this.value == 'header1') {
+        this.getheader1Data()
+      } else if (this.value == 'header2') {
+        this.getheader2Data()
+      } else if (this.value == 'header3') {
+        this.getheader3Data()
+      }
+    },
+    getheader1Data(pageNum) {
+      pageNum = pageNum ? pageNum : 1
+      let params = {
+        Cascade: [
+          {
+            Name: "equipCategory",
+            Projection: ["EquipCode", "EquipName"]
+          },
+          {
+            Name: "property",
+            Cascade: [
+              {
+                Name: "equipFamilyList",
+                Projection: [ "Family", "FamilyName" ]
+              }
+            ],
+            Projection: ["Family", "EquipLocalName", "EquipLocalID", "EquipID", "CodeType", "CreateTime"]
+          },
+          {
+            Name: "building",
+            Projection: ["BuildLocalName", "BuildName", "BuildID"]
+          },
+          {
+            Name: "floor",
+            Projection: ["FloorLocalName", "FloorName", "FloorID"]
+          }
+        ],
+        Filters: " not propertyId isnull ",
+        Orders: "CreateTime desc, EquipID asc",
+        PageNumber: pageNum,
+        PageSize: 1000,
+        Projection: ["CreateTime", "BuildingId", "FloorId", "Category", "EquipLocalName", "EquipLocalID", "EquipID", "BIMID", "LedgerParam"]
+      }
+      queryEquip(params, res => {
+        this.dataList = this.dataList.concat(res.Content.map((item) => {
+          item.Property.CodeType = State[item.Property.CodeType]
+          // item.Property.Family = Family[item.Property.Family]
+          return item
+        }))
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.getheader1Data(res.PageNumber + 1)
+        } else {
+          let time = +new Date()
+          this.loading = false
+          jsontoExcel.downloadExl(this.header1, this.dataList, `已建立关联的资产设备-${time}`)
+        }
+      })
+    },
+    getheader2Data(pageNum) {
+      pageNum = pageNum ? pageNum : 1
+      let params = {
+        Cascade: [
+          {
+            Name: "equipCategory",
+            Projection: ["EquipCode", "EquipName"]
+          },
+          {
+            Name: "building",
+            Projection: ["BuildLocalName", "BuildName", "BuildID"]
+          },
+          {
+            Name: "floor",
+            Projection: ["FloorLocalName", "FloorName", "FloorID"]
+          }
+        ],
+        Filters: " propertyId isnull ",
+        Orders: "CreateTime desc, EquipID asc",
+        PageNumber: pageNum,
+        PageSize: 1000,
+        Projection: ["CreateTime", "BuildingId", "FloorId", "Category", "EquipLocalName", "EquipLocalID", "EquipID", "BIMID", "LedgerParam"]
+      }
+      queryEquip(params, res => {
+        this.dataList = this.dataList.concat(res.Content)
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.getheader2Data(res.PageNumber + 1)
+        } else {
+          let time = +new Date()
+          this.loading = false
+          jsontoExcel.downloadExl(this.header2, this.dataList, `未关联资产的设备-${time}`)
+        }
+      })
+    },
+    getheader3Data(pageNum) {
+      pageNum = pageNum ? pageNum : 1
+      let params = {
+        Cascade: [
+          {
+            Name: "equipFamilyList",
+            Projection: [ "Family", "FamilyName" ]
+          },
+          {
+            Name: "building",
+            Projection: [ "BuildLocalName", "BuildName", "BuildID" ]
+          },
+          {
+            Name: "floor",
+            Projection: [ "FloorLocalName", "FloorName", "FloorID" ]
+          }
+        ],
+        Filters: " EquipmentId isnull ",
+        Orders: "CreateTime desc, EquipID asc",
+        PageNumber: pageNum,
+        PageSize: 1000,
+        Projection: [ "BuildingId", "FloorId", "Family", "EquipLocalName", "EquipLocalID", "EquipID", "CreateTime", "CodeType", "LedgerParam"]
+      }
+      queryProperty(params, res => {
+        this.dataList = this.dataList.concat(res.Content.map((item) => {
+          item.CodeType = State[item.CodeType]
+          return item
+        }))
+        if (res.Total / (res.PageSize * res.PageNumber) > 1) {
+          this.getheader3Data(res.PageNumber + 1)
+        } else {
+          let time = +new Date()
+          this.loading = false
+          jsontoExcel.downloadExl(this.header3, this.dataList, `未关联设备的资产-${time}`)
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+</style>

+ 24 - 4
src/views/ledger/spacelist/index.vue

@@ -4,11 +4,12 @@
 <template>
   <div id="businessSpace">
     <!-- 空间属于多个建筑楼层 -->
-    <!-- <roomInFloorDialog ref="roomInFloorDialog"></roomInFloorDialog> -->
+    <roomInFloorDialog ref="roomInFloorDialog" @relaSuc="relaSuc"></roomInFloorDialog>
     <!--------- 页面头部   -------------->
     <div class="saga-title" v-show="!needCalculate">
       <div class="saga-build-mess">
         <floorCascader @change="changeCascader" ref="floorCascader"></floorCascader>
+        <input type="hidden" v-model="zoneItemID">
       </div>
       <div class="saga-build-tab">
         <el-radio-group v-model="isMyTab" @change="changeRadio" style="width: 136px;">
@@ -16,7 +17,7 @@
           <el-radio-button label="2" class="space-own-radio" style="width: 68px;">列表</el-radio-button>
         </el-radio-group>
       </div>
-      <!-- <div class="saga-build-tips" v-if="1" @click="getTips">有25个空间同时属于多个建筑楼层,点击处理</div> -->
+      <div class="saga-build-tips" v-if="mutiCount>0" @click="getTips">有{{mutiCount}}个空间同时属于多个建筑楼层,点击处理</div>
     </div>
     <div class="saga-business-sapce-main" v-show="!needCalculate">
       <el-row class="spaceTypes">
@@ -29,7 +30,7 @@
         </div>
       </el-row>
       <div v-show="isMyTab == 1" style="width:100%;height:100%">
-        <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails" ref="graphy"></graphy>
+        <graphy @getSp="checkSpace" @dimension="checkSpace" @businessDetails="getBuinessDetails" ref="graphy" @copyID="copyID"></graphy>
       </div>
       <div v-show="isMyTab == 2">
         <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="activeName" :id="`handsontable${activeName}`"></handsontable-main>
@@ -61,6 +62,7 @@ import {
   buildingQuery, //数据中心-建筑查询
   queryDictionaryHead, //数据中心-字典头部信息查询接口
   getrelationTypeProject, //数据中心-当该项目中的"建筑体下的业务空间"“楼层下的业务空间”关系的状态为需更新时,业务空间台账功能不可用
+  getSpaceBdFlCount, // 属于多建筑楼层的空间数据统计
 } from "@/api/scan/request";
 import tools from '@/utils/scan/tools'
 import floorCascader from "@/components/ledger/lib/floorCascader";
@@ -112,10 +114,12 @@ export default {
         children: "Floor"
       },
       floorToMap: {}, //楼层及其对应的模型图
-      FloorMap: {}, //当前选中的楼层对象
+      FloorMap: "", //当前选中的楼层对象
+      zoneItemID: '',
       buildFloorSelectd: [''], //当前所选的建筑楼层
       childBackParam: {},
       needCalculate: false, // 关系是否需要计算
+      mutiCount: 0
     };
   },
   created() {
@@ -129,6 +133,7 @@ export default {
     init() {
       this.getTypes()
       this.getBuilding()
+      this.getMutiCount()
     },
     // 获取项目下建筑
     getBuilding() {
@@ -183,6 +188,15 @@ export default {
         }
       })
     },
+    // 获取多建筑楼层统计
+    getMutiCount() {
+      getSpaceBdFlCount({}, res => {
+        this.mutiCount = res.Count;
+        if (this.mutiCount > 0) {
+          this.getTips();
+        }
+      })
+    },
     // 获取关系是否需要计算
     getRelations() {
       let pa = {
@@ -287,6 +301,9 @@ export default {
       this.floor.facility = true
       this.$refs.facility.getData(infos, this.buildMess)
     },
+    copyID(val){
+      this.$refs.handsontable.zoneItemID = val;
+    },
     // 空间属于多个建筑楼层
     getTips() {
       this.$refs.roomInFloorDialog.showDialog();
@@ -294,6 +311,9 @@ export default {
     // 跳转至关系总览
     jumpToAllRelation() {
       this.$router.push({ name: 'overView' })
+    },
+    relaSuc() {
+      this.init();
     }
   },
   watch: {

+ 0 - 1
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -170,4 +170,3 @@ export default {
   color: #000;
 }
 </style>
-

+ 2 - 0
src/views/relation/overview/index.vue

@@ -174,6 +174,7 @@
               type: 'error'
             })
           }
+          this.init()
         })
       },
       templateDown() { //下载模板
@@ -232,6 +233,7 @@
           SystemName: this.currentRelationTypeName
         }
         sysDirection(param, res => {
+          this.init()
         })
       }