yangjunjing 5 år sedan
förälder
incheckning
f19d7ef304

+ 6 - 3
src/components/business_space/newTables/eqToSpaceTable.vue

@@ -6,8 +6,8 @@
         <el-button>按空间计算</el-button>
       </el-tooltip>
     </el-row>
-    <div class="table-box" :style="heightData">
-      <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
+    <div class="table-box">
+      <el-table :data="tableData" style="width: 100%" height="100%" :header-cell-style="headerStyle"  v-loading="loading">
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
             <div>
@@ -73,7 +73,7 @@ export default {
         EquipmentFor: '服务于空间的设备',
       },
       hidden: true,
-      heightData: "height:calc(100% - 50px)"
+      loading: false
     };
   },
   props: {
@@ -131,6 +131,7 @@ export default {
     },
     // 获取列表数据
     getTableData() {
+      this.loading = true;
       let pa = {
         data: {
           Filters: `RoomID='${this.params.RoomID}'`,
@@ -144,6 +145,7 @@ export default {
         zone: this.params.zone
       }
       queryZone(pa, res => {
+        this.loading = false;
         this.tableData = res.Content[0][this.type] || []
         this.tableData.map(t => {
           t.SpaceId = res.Content[0].RoomID
@@ -172,6 +174,7 @@ export default {
   height: 100%;
   .table-box {
     margin-top: 10px;
+    height: calc(100% - 50px);
   }
 }
 </style>

+ 8 - 6
src/components/business_space/newTables/syInSpaceTable.vue

@@ -6,7 +6,7 @@
         <el-button>按空间计算</el-button>
       </el-tooltip>
     </el-row>
-    <div class="table-box" :style="heightData">
+    <div class="table-box">
       <el-table :data="tableData" style="width: 100%" height="100%" v-loading="loading" :header-cell-style="headerStyle">
         <el-table-column :label="`${inSpaceType}名称`" show-overflow-tooltip min-width="100">
           <template slot-scope="scope">
@@ -63,7 +63,7 @@ export default {
         generalSystem: '空间内的系统',
       },
       hidden: true,
-      heightData: "height:calc(100% - 50px)"
+      loading: false
     };
   },
   props: {
@@ -72,7 +72,7 @@ export default {
   },
   created() {
     this.getTableData();
-     this.changeContentStyle();
+    this.changeContentStyle();
   },
   methods: {
     // 删除关系
@@ -92,7 +92,7 @@ export default {
       })
     },
     // 删除关系
-    deleteSyInSpace(pa){
+    deleteSyInSpace(pa) {
       syInSpaceDelete(pa, res => {
         this.$message.success('删除成功');
         this.getTableData();
@@ -100,6 +100,7 @@ export default {
     },
     // 获取列表数据
     getTableData() {
+      this.loading = true;
       let pa = {
         data: {
           Cascade: [{ Name: "generalSystem" }],
@@ -108,6 +109,7 @@ export default {
         zone: this.params.zone
       }
       queryZone(pa, res => {
+        this.loading = false;
         this.tableData = res.Content[0].GeneralSystem || [];
         this.tableData.map(t => {
           t.SpaceId = res.Content[0].RoomID;
@@ -119,9 +121,9 @@ export default {
     add() {
       this.$refs.addSyDialog.showDialog()
     },
-    changeContentStyle(){
+    changeContentStyle() {
       // 在辅助屏不显示添加按钮,动态设置高度
-      this.$route.name == "spaceLedger"?this.hidden = false:this.hidden = true;
+      this.$route.name == "spaceLedger" ? this.hidden = false : this.hidden = true;
     }
   },
   watch: {