Quellcode durchsuchen

系统未关联业务空间

LXXXY vor 5 Jahren
Ursprung
Commit
909733b547

+ 3 - 3
src/components/ledger/system/dialog/addEquipDialog.vue

@@ -1,13 +1,13 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
     <el-row class="filters">
-      <el-col :span="7" style="width:276px">
+      <el-col :span="7" style="width:268px">
         <el-input placeholder="输入设备名称或设备本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>
       <el-col :span="8.5" style="padding:0 0;">
-        <floor-cascader @change="changeFloor"></floor-cascader>
+        <floor-cascader @change="changeFloor" style="margin-left:5px;"></floor-cascader>
       </el-col>
       <el-col :span="8.5" style="padding-right:0;">
         <myCascader @change="changeDevice" :params="params"></myCascader>
@@ -154,7 +154,7 @@ export default {
       if (this.selections.length) {
         let params = {
           SysId: this.$route.query.SysID,
-          ListEquipId: this.selections.map(item => {
+          EquipIdList: this.selections.map(item => {
             return item.EquipID
           })
         }

+ 61 - 29
src/components/ledger/system/dialog/addSpaceDialog.vue

@@ -1,26 +1,25 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
+  <el-dialog :title="title" :visible.sync="dialogVisible" :before-close="handleClose" width="900px" id="addEqDialog">
     <el-row class="filters" :gutter="20">
-      <el-col :span="8">
-        <el-input placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
+      <el-col :span="7" style="width:268px;padding:0px;">
+        <el-input style="" placeholder="输入业务空间名称、本地编码进行查询" v-model="keycode" clearable @keyup.enter.native="getTableData">
           <i slot="suffix" class="el-input__icon el-icon-search" @click="getTableData"></i>
         </el-input>
       </el-col>
-      <el-col :span="8.5" style="padding:0 0;">
-        <floor-cascader @change="changeFloor"></floor-cascader>
+      <el-col :span="8.5" style="padding:0 0;margin-left:5px">
+        <floor-cascader ref="floorcas" @change="changeFloor"></floor-cascader>
       </el-col>
-       <el-col :span="8.5" style="padding:0 0;">
-         <space-select @change="changeSpace"></space-select>
+      <el-col :span="7.5" style="padding:0 0;">
+        <space-select ref="spacesel" @change="changeSpace"></space-select>
       </el-col>
     </el-row>
     <el-row class="filters" :gutter="20">
-      
-     
+
     </el-row>
     <div class="table-box">
       <el-table :data="tableData" style="width: 100%" height="350" v-loading="loading" :header-cell-style="headerStyle" ref="multipleTable"
         @selection-change="handleSelectionChange">
-        <el-table-column  type="selection" width="55"></el-table-column>
+        <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column :label="`${inSpaceType}本地名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
@@ -29,8 +28,20 @@
           </template>
         </el-table-column>
         <el-table-column prop="RoomLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column prop="" :label="`所属建筑楼层`" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column prop="" :label="`空间类型`" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column prop="" :label="`所属建筑楼层`" show-overflow-tooltip min-width="100">
+           <template slot-scope="scope">
+            <div>
+              {{(floorType[scope.row.BuildingId] || '') + (floorType[scope.row.FloorID] || '') || ''}}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="ObjectType" :label="`空间类型`" show-overflow-tooltip min-width="100">
+          <template slot-scope="scope">
+            <div>
+              {{spaceType[scope.row.ObjectType] || ''}}
+            </div>
+          </template>
+        </el-table-column>
         <el-table-column prop="action" label="操作" min-width="100">
           <template slot-scope="scope">
             <el-button size="mini" @click="toDetail(scope.$index, scope.row)" plain>查看详情</el-button>
@@ -43,14 +54,14 @@
         :total="page.total"></el-pagination>
     </div>
     <span slot="footer" class="dialog-footer">
-      <el-button size="small" @click="dialogVisible = false">取 消</el-button>
+      <el-button size="small" @click="handleClose">取 消</el-button>
       <el-button size="small" type="primary" @click="savaRelation">确 定</el-button>
     </span>
   </el-dialog>
 </template>
 
 <script>
-import { unSysZoneSpace, linkSySh } from "@/api/scan/request";
+import { unSysZoneSpace, linkSySh, queryDictionaryHead } from "@/api/scan/request";
 import floorCascader from "@/components/ledger/lib/floorCascader";
 import dictionaryCas from '@/components/config_point/dictionaryCascader'
 import spaceSelect from '@/components/ledger/lib/spaceSelect'
@@ -69,10 +80,11 @@ export default {
       title: "添加系统所在业务空间",
       keycode: '', //输入查询条件
       inSpaceType: '业务空间',
-      dialogVisible: false,
       Buildfloor: ['all'], // 选中的建筑楼层
       Spacecategory: null,// 选中的业务空间类型
       tableData: [],
+      floorData: {},//楼层
+      spaceData: {},//业务空间分区
       loading: false,
       selections: [], // 选中项
       page: {
@@ -90,16 +102,19 @@ export default {
   },
   props: {
     type: String, //选中的tab页
-    params: Object //查看的竖井关系信息
+    params: Object, //查看的竖井关系信息
+    spaceType: Object,
+    dialogVisible: Boolean,
+    floorType: Object
+  },
+  mounted() {
+
   },
-  created() { },
   methods: {
     // 显示弹窗
     showDialog() {
       this.dialogVisible = true
-      this.page.pageNumber = 1
-      this.tableData = []
-      this.getTableData()
+
     },
     //修改建筑楼层
     changeFloor(value) {
@@ -114,13 +129,13 @@ export default {
     getTableData() {
       let params = {
         data: {
-          Filters:"not LocalId isNull",
-          Orders: "Name desc",
+          Filters: "not RoomID isNull",
+          Orders: "RoomLocalName desc",
           PageNumber: this.page.pageNumber,
           PageSize: this.page.pageSize,
         },
         shaftId: this.params.ShaftID,
-        sysId:this.$route.query.SysID
+        sysId: this.$route.query.SysID
       }
       if (this.Buildfloor[0] == "noKnow") {
         params.data.Filters += `;buildingId isNull`
@@ -132,23 +147,28 @@ export default {
       } else if (this.Buildfloor[1] && this.Buildfloor[1] != "all") {
         params.data.Filters += `;floorId='${this.Buildfloor[1]}'`
       }
-      if(this.Spacecategory){
-         params.data.Filters += `;ObjectType='${this.Spacecategory}'`
+      if (this.Spacecategory) {
+        params.data.Filters += `;ObjectType='${this.Spacecategory}'`
       }
       if (this.keycode != '') {
         params.data.Filters += `;RoomName contain '${this.keycode}' or RoomLocalName contain '${this.keycode}'`
       }
+
       unSysZoneSpace(params, res => {
+        console.log("hh ",this.floorType)
         this.tableData = res.Content
         this.page.total = res.Total
       })
     },
+    handleClose() {
+      this.$emit('update:dialogVisible', false)
+    },
     //选中项修改
     handleSelectionChange(val) {
       this.selections = val;
     },
     savaRelation() {
-      if(this.selections.length){
+      if (this.selections.length) {
         let params = {
           ShaftId: this.params.ShaftID,
           SysIdList: this.selections.map(item => {
@@ -160,7 +180,7 @@ export default {
           this.$message.success('关联成功!')
           this.$emit('refresh')
         })
-      }else {
+      } else {
         this.$message('请选择要关联的设备')
       }
     },
@@ -179,16 +199,28 @@ export default {
       this.$message('开发中')
     }
   },
+  watch: {
+    dialogVisible: {
+      handler() {
+        if (this.dialogVisible) {
+          this.page.pageNumber = 1
+          this.tableData = []
+          this.getTableData()
+        }
+      },
+      immediate: true
+    }
+  }
 };
 </script>
 <style lang="less" scoped>
 #addEqDialog {
   .filters {
-    margin-bottom: 10px; 
+    margin-bottom: 10px;
   }
   .table-box {
     height: 370px;
-    .fr{
+    .fr {
       margin-top: 10px;
     }
   }

+ 6 - 3
src/components/ledger/system/table/spaceTable.vue

@@ -39,7 +39,7 @@
       </el-table>
     </div>
     <!-- 添加空间弹窗 -->
-    <addSpaceDialog ref="addSpaceDialog" @refresh="getTableData" :type="type" :params="params"></addSpaceDialog>
+    <addSpaceDialog :dialogVisible.sync="dialogVisible" ref="addSpaceDialog" @refresh="getTableData" :type="type" :params="params" :spaceType="spaceType" :floorType="floorType"></addSpaceDialog>
   </div>
 </template>
 
@@ -57,6 +57,7 @@ export default {
   data() {
     return {
       inSpaceType: '业务空间',
+      dialogVisible: false,
       headerStyle: {
         backgroundColor: '#e1e4e5',
         color: '#2b2b2b',
@@ -68,7 +69,9 @@ export default {
   },
   props: {
     params: Object,
-    type: String
+    type: String,
+    spaceType: Object,
+    floorType: {}
   },
   created() {
     this.getTableData()
@@ -123,7 +126,7 @@ export default {
     },
     // 添加设备
     add() {
-      this.$refs.addSpaceDialog.showDialog()
+      this.dialogVisible = true
     }
   },
   watch: {

+ 36 - 3
src/views/ledger/system/systemDetail/index.vue

@@ -25,14 +25,14 @@
       <!-- 系统所在竖井 -->
       <cenoteTable v-else-if="activeTab=='cenote'" :params="params" :type="activeTab"></cenoteTable>
       <!-- 系统所在业务空间 -->
-      <spaceTable v-else-if="activeTab=='space'" :params="params" :type="activeTab"></spaceTable>
+      <spaceTable v-else-if="activeTab=='space'" :params="params" :type="activeTab" :spaceType="spaceType" :floorType="floorType"></spaceTable>
     </div>
   </div>
 </template>
 
 <script>
 import { mapGetters } from "vuex"
-import { queryLinkSys, deleteGeneralSys } from '@/api/scan/request'
+import { queryLinkSys, deleteGeneralSys, queryDictionaryHead, buildingQuery } from '@/api/scan/request'
 import cenoteTable from '@/components/ledger/system/table/cenoteTable'
 import deviceTable from '@/components/ledger/system/table/deviceTable'
 import spaceTable from '@/components/ledger/system/table/spaceTable'
@@ -47,7 +47,9 @@ export default {
         { Code: 'space', Name: '系统所在业务空间' },
       ], //tab页
       activeTab: 'detail', //当前选中的tab
-      systemDetails: {}, //系统信息
+      systemDetails: {}, //系统信息,
+      spaceType: {},//空间种类
+      floorType: {}
     }
   },
   computed: {
@@ -61,6 +63,37 @@ export default {
   created() {
     this.params = this.$route.query;
     this.getSystemDetails();
+
+    let pa = {
+      Filters: `parentId='Space'`
+    }
+    queryDictionaryHead(pa, res => {
+      res.Content.map(t => {
+        if (t.Name != "元空间") {
+          this.spaceType[t.Code] = t.Name;
+        }
+      })
+    });
+
+    let param = {
+      Cascade: [
+        { Name: "floor" }
+      ]
+    };
+    buildingQuery(param, res => {
+      res.Content.map(item => {
+        if (item.BuildID && item.BuildLocalName) {
+          this.floorType[item.BuildID] = item.BuildLocalName;
+          if (item.Floor instanceof Array) {
+            item.Floor.map(f => {
+              if (f.FloorID && f.FloorLocalName) {
+                this.floorType[f.FloorID] = f.FloorLocalName;
+              }
+            })
+          }
+        }
+      });
+    });
   },
   mounted() { },
   watch: {