Bladeren bron

空间内的设备服务空间的设备

haojianlong 4 jaren geleden
bovenliggende
commit
c53646a2ec

+ 4 - 4
src/api/scan/request.js

@@ -1967,25 +1967,25 @@ export function spaceInSysUnlink(param, success) {
 
 //关系-----设备所在业务空间--删除关系
 export function eqInSpaceDelete(param, success) {
-  let url = `${baseUrl}${dataCenter}/eq-in-sp-base/unlink-list?type=${param.type}`;
+  let url = `${baseUrl}${rel}/eq-in-sp-base/unlink-list?type=${param.type}`;
   http.postJson(url, param.data, success)
 }
 
 //关系-----设备所在业务空间--创建关系
 export function eqInSpaceCreate(param, success) {
-  let url = `${baseUrl}${dataCenter}/eq-in-sp-base/link-eq-sp?type=${param.type}`;
+  let url = `${baseUrl}${rel}/eq-in-sp-base/link-eq-sp?type=${param.type}`;
   http.postJson(url, param.data, success)
 }
 
 //关系-----设备服务业务空间--删除关系
 export function eqForSpaceDelete(param, success) {
-  let url = `${baseUrl}${dataCenter}/eq-for-sp-base/unlink-list?type=${param.type}`;
+  let url = `${baseUrl}${rel}/eq-for-sp-base/unlink-list?type=${param.type}`;
   http.postJson(url, param.data, success)
 }
 
 //关系-----设备服务业务空间--创建关系
 export function eqForSpaceCreate(param, success) {
-  let url = `${baseUrl}${dataCenter}/eq-for-sp-base/link-eq-sp?type=${param.type}`;
+  let url = `${baseUrl}${rel}/eq-for-sp-base/link-eq-sp?type=${param.type}`;
   http.postJson(url, param.data, success)
 }
 

+ 32 - 35
src/components/business_space/newAddDialogs/addEquipDialog.vue

@@ -19,12 +19,12 @@
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
-              {{scope.row.EquipLocalName||scope.row.EquipName||''}}
+              {{scope.row.localName||scope.row.name||''}}
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="EquipLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
-        <el-table-column prop="EquipCategory.EquipName" :label="`${inSpaceType}类`" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column prop="localId" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column prop="equipCategory.name" :label="`${inSpaceType}类`" show-overflow-tooltip min-width="100"></el-table-column>
         <el-table-column prop="linkOtherSpace" label="已关联其他业务空间" show-overflow-tooltip min-width="100"></el-table-column>
         <el-table-column prop="action" label="操作" min-width="100">
           <template slot-scope="scope">
@@ -88,9 +88,9 @@ export default {
         total: 0
       },
       props: { //自定义字段
-        value: "BuildID",
-        label: "BuildLocalName",
-        children: "Floor"
+        value: "id",
+        label: "localName",
+        children: "floor"
       },
     };
   },
@@ -113,17 +113,15 @@ export default {
         this.options = res.content.map(t => {
           if (t.floor) {
             t.floor = t.floor.map(item => {
-              item.BuildID = item.id;
-              item.BuildLocalName = item.localName;
               return item;
             })
           } else {
             t.Floor = []
           }
-          t.floor.unshift({ BuildID: 'all', BuildLocalName: '全部' }, { BuildID: 'isNull', BuildLocalName: '未明确楼层' })
+          t.floor.unshift({ id: 'all', localName: '全部' }, { id: 'isNull', localName: '未明确楼层' })
           return t;
         })
-        this.options.unshift({ BuildID: 'all', BuildLocalName: '全部' }, { BuildID: 'isNull', BuildLocalName: '未明确楼层' })
+        this.options.unshift({ id: 'all', localName: '全部' }, { id: 'isNull', localName: '未明确楼层' })
       })
     },
     // 显示弹窗
@@ -137,45 +135,44 @@ export default {
       this.loading = true
       let pa = {
         data: {
-          Cascade: [{ Name: "equipCategory" }],
-          Filters: '',
-          PageNumber: this.page.pageNumber,
-          PageSize: this.page.pageSize,
-          Orders: 'EquipID asc'
+          cascade: [{ name: "equipCategory" }],
+          filters: '',
+          pageNumber: this.page.pageNumber,
+          pageSize: this.page.pageSize,
+          orders: 'id asc'
         },
         type: this.zone,
         spaceId: this.spaceId
       }
       if (this.floor[0] == 'isNull') {
-        pa.data.Filters += `BuildingId isNull`
+        pa.data.filters += `buildingId isNull`
       } else if (this.floor[0] && this.floor[0] != 'all') {
-        pa.data.Filters += `BuildingId='${this.floor[0]}'`
+        pa.data.filters += `buildingId='${this.floor[0]}'`
       }
       if (this.floor[1] == 'isNull') {
-        pa.data.Filters += `;FloorId isNull`
+        pa.data.filters += `;floorId isNull`
       } else if (this.floor[1] && this.floor[1] != 'all') {
-        pa.data.Filters += `;FloorId='${this.floor[1]}'`
+        pa.data.filters += `;floorId='${this.floor[1]}'`
       }
       if (this.keycode != '') {
-        pa.data.Filters += `;EquipName contain "${this.keycode}" or EquipLocalName contain "${this.keycode}" or EquipLocalID contain "${this.keycode}"`
+        pa.data.filters += `;name contain "${this.keycode}" or localName contain "${this.keycode}" or localId contain "${this.keycode}"`
       }
       // 删除首尾分号
-      pa.data.Filters = pa.data.Filters.replace(/(^;)|(;$)/g, '');
-      if (pa.data.Filters == '') {
-        delete pa.data.Filters
+      pa.data.filters = pa.data.filters.replace(/(^;)|(;$)/g, '');
+      if (pa.data.filters == '') {
+        delete pa.data.filters
       }
-      console.log(this.showType)
       if (this.showType) {
         if (this.type == "Equipment") {
           // pa.data.Cascade.push({ Name: "zoneSpaceInBase" })
-          pa.data.Cascade = [{ Name: "equipCategory" }];
+          pa.data.cascade = [{ Name: "equipCategory" }];
           getEqNotInSpace(pa, res => {
             this.loading = false
             this.getDataSuc(res, 'ZoneSpaceBaseIn')
           })
         } else {
           // pa.data.Cascade.push({ Name: "zoneSpaceForBase" })
-          pa.data.Cascade = [{ Name: "equipCategory" }];
+          pa.data.cascade = [{ Name: "equipCategory" }];
           getEqNotForSpace(pa, res => {
             this.loading = false
             this.getDataSuc(res, 'ZoneSpaceBaseFor')
@@ -183,13 +180,13 @@ export default {
         }
       } else {
         if (this.type == "Equipment") {
-          pa.data.Cascade.push({ Name: "zoneSpaceInBase" })
+          pa.data.cascade.push({ Name: "zoneSpaceInBase" })
           notEqInSpaceQuery(pa, res => {
             this.loading = false
             this.getDataSuc(res, 'ZoneSpaceBaseIn')
           })
         } else {
-          pa.data.Cascade.push({ Name: "zoneSpaceForBase" })
+          pa.data.cascade.push({ Name: "zoneSpaceForBase" })
           notEqForSpaceQuery(pa, res => {
             this.loading = false
             this.getDataSuc(res, 'ZoneSpaceBaseFor')
@@ -199,18 +196,18 @@ export default {
     },
     // 获取列表成功回调
     getDataSuc(res, zonespacebase) {
-      let response = res.Content.map(t => {
+      let response = res.content.map(t => {
         let otherSpace = [];
         if (t[zonespacebase] && t[zonespacebase].length) {
           t[zonespacebase].map(item => {
-            otherSpace.push(item.RoomLocalName || item.RoomName)
+            otherSpace.push(item.localName || item.name)
           })
         }
         t.linkOtherSpace = otherSpace.join(',');
         return t;
       })
-      this.tableData = res.Content;
-      this.page.total = res.Total;
+      this.tableData = res.content;
+      this.page.total = res.total;
     },
     //选中项修改
     handleSelectionChange(val) {
@@ -220,13 +217,13 @@ export default {
     savaRelation() {
       let pa = {
         data: {
-          SpaceId: this.spaceId,
-          EquipIdList: []
+          spaceId: this.spaceId,
+          equipIdList: []
         },
         type: this.zone
       }
       this.selections.map(t => {
-        pa.data.EquipIdList.push(t.EquipID)
+        pa.data.equipIdList.push(t.id)
       })
       if (this.type == "Equipment") {
         eqInSpaceCreate(pa, res => {

+ 18 - 12
src/components/business_space/newTables/eqToSpaceTable.vue

@@ -11,15 +11,15 @@
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
-              {{scope.row.EquipLocalName||scope.row.EquipName||''}}
+              {{scope.row.localName||scope.row.name||''}}
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="EquipLocalID" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
+        <el-table-column prop="localId" :label="`${inSpaceType}本地编码`" show-overflow-tooltip min-width="100"></el-table-column>
         <el-table-column :label="`${inSpaceType}类`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
-              {{scope.row.EquipCategory?scope.row.EquipCategory.EquipName:''}}
+              {{scope.row.equipCategory?scope.row.equipCategory.name:''}}
             </div>
           </template>
         </el-table-column>
@@ -92,10 +92,13 @@ export default {
         type: 'warning'
       }).then(() => {
         let pa = {
-          data: [row],
+          data: [{
+            equipId: row.id,
+            spaceId: row.spaceId
+          }],
           type: this.params.zone
         }
-        if (this.type == 'Equipment') {
+        if (this.type == 'equipment') {
           this.deleteEqInSpace(pa);
         } else {
           this.deleteEqForSpace(pa);
@@ -132,20 +135,23 @@ export default {
     getTableData() {
       this.loading = true;
       let pa = {
-        Filters: `id='${this.params.RoomID}'`,
-        Cascade: [
+        filters: `id='${this.params.RoomID}'`,
+        cascade: [
           {
-            Name: this.type.replace(this.type[0], this.type[0].toLowerCase()),
-            Cascade: [{ Name: 'equipCategory' }]
+            name: this.type.replace(this.type[0], this.type[0].toLowerCase()),
+            cascade: [{ name: 'equipCategory' }]
           }
         ],
-        ZoneType: this.params.zone
+        zoneType: this.params.zone
       }
       zoneQuery(pa, res => {
         this.loading = false;
-        this.tableData = res.Content[0][this.type] || []
+        console.log(88888888888);
+        console.log(res);
+        console.log(this.type);
+        this.tableData = res.content[0][this.type] || []
         this.tableData.map(t => {
-          t.SpaceId = res.Content[0].RoomID
+          t.spaceId = res.content[0].id
           return t;
         })
       })

+ 2 - 2
src/components/business_space/newTables/syInSpaceTable.vue

@@ -108,9 +108,9 @@ export default {
       }
       zoneQuery(pa, res => {
         this.loading = false;
-        this.tableData = res.Content[0].GeneralSystem || [];
+        this.tableData = res.content[0].generalSystem || [];
         this.tableData.map(t => {
-          t.SpaceId = res.Content[0].RoomID;
+          t.SpaceId = res.content[0].id;
           return t;
         })
       })

+ 3 - 3
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -51,7 +51,7 @@
         </el-scrollbar>
       </div>
       <!-- 空间内设备列表--服务于空间的设备 -->
-      <eqToSpaceTable v-else-if="activeTab=='Equipment' || activeTab=='EquipmentFor'" :params="params"
+      <eqToSpaceTable v-else-if="activeTab=='equipment' || activeTab=='equipmentFor'" :params="params"
                       :type="activeTab"></eqToSpaceTable>
       <!-- 空间内系统 -->
       <syInSpaceTable v-else-if="activeTab=='generalSystem'" :params="params" :type="activeTab"></syInSpaceTable>
@@ -84,8 +84,8 @@ export default {
       params: {}, //参数-包含空间id 分区类型 进入方式(1-平面图 2-列表)
       tabsList: [
         { Code: 'detail', Name: '空间详情' },
-        { Code: 'Equipment', Name: '空间内设备' },
-        { Code: 'EquipmentFor', Name: '服务于空间的设备' },
+        { Code: 'equipment', Name: '空间内设备' },
+        { Code: 'equipmentFor', Name: '服务于空间的设备' },
         { Code: 'generalSystem', Name: '空间内系统' },
       ], //tab页
       activeTab: 'detail', //当前选中的tab