Browse Source

系统未关联设备,竖井,业务空间接口,关联设备,删除设备接口调试

LXXXY 5 years ago
parent
commit
8c7c6c3261

+ 33 - 0
src/api/scan/request.js

@@ -1323,6 +1323,24 @@ export function shthroughshUnlink(param, success) {
     let url = `${baseUrl}/datacenter/sh-through-sh/unlink`;
     http.postJson(url, param, success)
 }
+//查询没有和当前系统关联的设备
+export function unSysEq(param, success) {
+    let data = param.data
+    let url = `${baseUrl}/datacenter/general—system/un-sys-equip?sysId=${param.sysId}`;
+    http.postJson(url, data, success)
+}
+//查询没有和当前系统关联的竖井
+export function unSysShaft(param, success) {
+    let data = param.data
+    let url = `${baseUrl}/datacenter/general—system/un-sys-shaft?sysId=${param.sysId}`;
+    http.postJson(url, data, success)
+}
+//查询没有和当前系统关联的业务空间
+export function unSysZoneSpace(param, success) {
+    let data = param.data
+    let url = `${baseUrl}/datacenter/general—system/un-sys-zoneSpaceBaseTable?sysId=${param.sysId}`;
+    http.postJson(url, data, success)
+}
 //查询没有和当前竖井绑定的设备
 export function unshaftInEq(param, success) {
     let data = param.data
@@ -1346,6 +1364,11 @@ export function linkEqSh(param, success) {
     let url = `${baseUrl}/datacenter/eq-in-sh/link-eq-sh`;
     http.postJson(url, param, success)
 }
+//创建系统下的设备关系
+export function linkSysEq(param, success) {
+    let url = `${baseUrl}/datacenter/general—system/link-equip`;
+    http.postJson(url, param, success)
+}
 //竖井的贯通,竖井一对多,此方法不会覆盖以前的记录
 export function linkShaft(param, success) {
     let url = `${baseUrl}/datacenter/sh-through-sh/link-shaft`;
@@ -1356,6 +1379,16 @@ export function linkSySh(param, success) {
     let url = `${baseUrl}/datacenter/sy-in-sh/link-sy-sh`;
     http.postJson(url, param, success)
 }
+//系统所在竖井,系统一对多,此方法会覆盖以前的记录
+export function linkSh(param, success) {
+    let url = `${baseUrl}/datacenter/sy-in-sh/link-sh`;
+    http.postJson(url, param, success)
+}
+//根据对象删除系统和设备的关系,只针对一个对象
+export function eqInSysUnlink(param, success) {
+    let url = `${baseUrl}/datacenter/sy-in-eq/unlink`;
+    http.postJson(url, param, success)
+}
 
 //关系-----设备所在业务空间--删除关系
 export function eqInSpaceDelete(param, success) {

+ 7 - 6
src/components/ledger/system/dialog/addCenoteDialog.vue

@@ -42,7 +42,7 @@
 </template>
 
 <script>
-import { unshaftThroughShaft, queryShaftType, linkShaft } from "@/api/scan/request";
+import { unSysShaft, queryShaftType, linkSh } from "@/api/scan/request";
 import cenoteType from "@/components/ledger/lib/cenoteType";
 import { mapGetters } from "vuex";
 export default {
@@ -108,12 +108,13 @@ export default {
           PageNumber: this.page.pageNumber,
           PageSize: this.page.pageSize,
         },
-        shaftId: this.params.ShaftID
+        shaftId: this.params.ShaftID,
+        sysId:this.$route.query.SysID
       }
       if (this.keycode != '') {
         params.data.Filters += `;ShaftName contain '${this.keycode}' or ShaftLocalName contain '${this.keycode}' or ShaftLocalID contain '${this.keycode}'`
       }
-      unshaftThroughShaft(params, res => {
+      unSysShaft(params, res => {
         this.tableData = res.Content
         this.tableData.forEach(item => {
           if (item.StructureInfo && item.StructureInfo.ShaftFuncType) {
@@ -130,12 +131,12 @@ export default {
     savaRelation() {
       if (this.selections.length) {
         let params = {
-          ShaftId: this.params.ShaftID,
-          ShaftOtherIdList: this.selections.map(item => {
+          SysId: this.$route.query.SysID,
+          ShaftIdList: this.selections.map(item => {
             return item.ShaftID
           })
         }
-        linkShaft(params, res => {
+        linkSh(params, res => {
           this.dialogVisible = false
           this.$message.success('关联成功!')
           this.$emit('refresh')

+ 9 - 8
src/components/ledger/system/dialog/addEquipDialog.vue

@@ -1,7 +1,7 @@
 <template>
   <el-dialog :title="title" :visible.sync="dialogVisible" width="900px" id="addEqDialog">
     <el-row class="filters">
-      <el-col :span="7.5" style="width:276px">
+      <el-col :span="7" style="width:276px">
         <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>
@@ -46,7 +46,7 @@
 </template>
 
 <script>
-import { unshaftInEq, linkEqSh } from "@/api/scan/request";
+import { sysLinkEquip, unSysEq} from "@/api/scan/request";
 import floorCascader from "@/components/ledger/lib/floorCascader";
 import myCascader from "@/components/ledger/system/lib/equipType";
 import { mapGetters } from "vuex";
@@ -106,15 +106,16 @@ export default {
       this.getTableData()
     },
     getTableData() {
+      
       let params = {
         data: {
-          Cascade: [{ Name: 'equipCategory' }, { Name: 'shaftList' }],
           Filters: `not EquipID isNull`,
           Orders: "createTime desc, EquipID desc",
           PageNumber: this.page.pageNumber,
           PageSize: this.page.pageSize,
         },
-        shaftId: this.params.ShaftID
+        shaftId: this.params.ShaftID,
+        sysId:this.$route.query.SysID
       }
       if (this.Buildfloor[0] == "noKnow") {
         params.data.Filters += `;buildingId isNull`
@@ -132,7 +133,7 @@ export default {
       if (this.Equipcategory) {
         params.data.Filters += `;category='${this.Equipcategory}'`
       }
-      unshaftInEq(params, res => {
+      unSysEq(params, res => {
         res.Content.forEach(item => {
           item.ShaftListName = ""
           if (item.ShaftList && item.ShaftList.length) {
@@ -152,12 +153,12 @@ export default {
     savaRelation() {
       if (this.selections.length) {
         let params = {
-          ShaftId: this.params.ShaftID,
-          EquipIdList: this.selections.map(item => {
+          SysId: this.$route.query.SysID,
+          ListEquipId: this.selections.map(item => {
             return item.EquipID
           })
         }
-        linkEqSh(params, res => {
+        sysLinkEquip(params, res => {
           this.dialogVisible = false
           this.$message.success('关联成功!')
           this.$emit('refresh')

+ 25 - 8
src/components/ledger/system/dialog/addSpaceDialog.vue

@@ -24,11 +24,11 @@
         <el-table-column :label="`${inSpaceType}本地名称`" 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="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></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="action" label="操作" min-width="100">
@@ -50,7 +50,7 @@
 </template>
 
 <script>
-import { unshaftInSys, linkSySh } from "@/api/scan/request";
+import { unSysZoneSpace, linkSySh } 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'
@@ -108,20 +108,37 @@ export default {
     },
     //修改空间类型
     changeSpace(value) {
-      this.Spacecategory = value.code
+      this.Spacecategory = value
       this.getTableData()
     },
     getTableData() {
       let params = {
         data: {
-          Cascade: [{ Name: 'categoryNames' }],
-          Orders: "createTime desc, SysID desc",
+          Filters:"not LocalId isNull",
+          Orders: "Name desc",
           PageNumber: this.page.pageNumber,
           PageSize: this.page.pageSize,
         },
-        shaftId: this.params.ShaftID
+        shaftId: this.params.ShaftID,
+        sysId:this.$route.query.SysID
       }
-      unshaftInSys(params, res => {
+      if (this.Buildfloor[0] == "noKnow") {
+        params.data.Filters += `;buildingId isNull`
+      } else if (this.Buildfloor[0] && this.Buildfloor[0] != "all") {
+        params.data.Filters += `;buildingId='${this.Buildfloor[0]}'`
+      }
+      if (this.Buildfloor[1] == "noKnow") {
+        params.data.Filters += `;floorId isNull`
+      } 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.keycode != '') {
+        params.data.Filters += `;RoomName contain '${this.keycode}' or RoomLocalName contain '${this.keycode}'`
+      }
+      unSysZoneSpace(params, res => {
         this.tableData = res.Content
         this.page.total = res.Total
       })

+ 0 - 3
src/components/ledger/system/lib/equipType.vue

@@ -83,15 +83,12 @@ export default {
           let tempArr = res.Content.filter(t => {
             return t.ParentId == `${this.params.SysType}`
           })
-          console.log(tempArr)
           resolve(tempArr)
         })
       })
       Promise.all([promise1, promise2]).then((res) => {
         let allData = res[0], data = res[1]
-        console.log(allData)
         this.options = this.formatOptions(allData)
-        console.log(this.options)
         if (this.value) {
           this.changeVal(this.value)
         }

+ 1 - 2
src/components/ledger/system/table/cenoteTable.vue

@@ -87,12 +87,11 @@ export default {
         Cascade: [
           {
             Name: 'shaftList',
-
           }
         ]
       }
       queryLinkSys(params, res => {
-        this.tableData = res.Content[0].ShaftThroughList || []
+        this.tableData = res.Content[0].Shaft || []
         this.tableData.forEach(item => {
           if (item.StructureInfo && item.StructureInfo.ShaftFuncType) {
             item.StructureInfo.ShaftFuncType = this.shaftType[item.StructureInfo.ShaftFuncType]

+ 4 - 3
src/components/ledger/system/table/deviceTable.vue

@@ -42,7 +42,7 @@
 </template>
 
 <script>
-import { queryLinkSys, eqinshUnlink } from "@/api/scan/request";
+import { queryLinkSys, eqInSysUnlink } from "@/api/scan/request";
 import { mapGetters } from "vuex";
 import addEquipDialog from "@/components/ledger/system/dialog/addEquipDialog"
 export default {
@@ -89,6 +89,7 @@ export default {
     },
     // 删除关系
     handleDelete(index, row) {
+      let sysId = this.$route.query.SysID
       this.$confirm("确认删除该关系?", "提示", {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -96,7 +97,7 @@ export default {
       }).then(() => {
         let params = {
           EquipId: row.EquipID,
-          ShaftId: this.params.ShaftID
+          SysId: sysId
         }
         this.deleteEqInSh(params);
       }).catch(() => {
@@ -105,7 +106,7 @@ export default {
     },
     // 删除设备所在竖井关系
     deleteEqInSh(params) {
-      eqinshUnlink(params, res => {
+      eqInSysUnlink(params, res => {
         this.$message.success('删除成功')
         this.getTableData()
       })