Bläddra i källkod

业务空间台账-辅助屏

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

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

@@ -1,6 +1,6 @@
 <template>
   <div id="eqInSp">
-    <el-row v-show="hidden">
+    <el-row v-if="hidden">
       <el-button type="primary" @click="add">添加{{inSpaceType}}</el-button>
       <el-tooltip class="item" effect="dark" :content="`可前往“全部关系总览”中,按坐标计算${typeToTips[type]}`" placement="right">
         <el-button>按空间计算</el-button>
@@ -157,8 +157,8 @@ export default {
       this.$refs.addEqDialog.showDialog()
     },
     changeContentStyle(){
+      this.$route.name == "spaceLedger"?this.hidden = false:this.hidden = true;
       // 在辅助屏不显示添加按钮,动态设置高度
-      this.$route.name == "spaceLedger"?this.hidden = true:this.hidden = false;
       this.heightData = "height:750px";
     }
   },

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

@@ -121,7 +121,7 @@ export default {
     },
     changeContentStyle(){
       // 在辅助屏不显示添加按钮,动态设置高度
-      this.$route.name == "spaceLedger"?this.hidden = true:this.hidden = false;
+      this.$route.name == "spaceLedger"?this.hidden = false:this.hidden = true;
       this.heightData = "height:750px";
     }
   },

+ 87 - 51
src/views/screen/splitscreen/spaceledger/index.vue

@@ -36,15 +36,34 @@
           <el-tabs v-model="activeTab" type='card'>
             <template v-for="(item,index) in tabsList">
               <el-tab-pane :name="item.Code" :key="index" :label="item.Name">
-                <div v-if="activeTab === 'staticData'" style="width:100%;textAlign:left;">
+                <div v-show="activeTab === 'staticData'" style="width:100%;textAlign:left;">
                   <iframe height="100%" width="100%" :src="iframeSrc" id="staticData"></iframe>
                 </div>
-                <!-- 动态数据 -->
-                <div v-if="activeTab === 'dynamicData'" style="width:100%;textAlign:left;">
-                  <handsontable-main ref="handsontable" :zoneCode="spaceDetails.ObjectType" :id="`handsontable${spaceDetails.ObjectType}`">
-                  </handsontable-main>
+                <div v-show="activeTab === 'dynamicData'" style="width:100%;textAlign:left;">
+                  <div class="main" style="height: 750px;">
+                    <el-table ref="multipleTable" :data="tableData" v-loading='loading' stripe height="100%" :header-cell-style="headerStyle">
+                      <el-table-column prop="InfoPointName" label="信息点名称">
+                        <template slot-scope="scope">
+                          <div>
+                            <span>{{ scope.row.InfoPointName}}</span>
+                            <span class="unit">{{scope.row.Unit?`${"("+scope.row.Unit+")"}`:""}}</span>
+                          </div>
+                        </template>
+                      </el-table-column>
+                      <el-table-column prop="functionNo" label="表号功能号"></el-table-column>
+                      <el-table-column prop="functionNoDynamicData" label="动态数据"></el-table-column>
+                      <!-- 数据采集时间后台暂未提供,先写上固定的时间 -->
+                      <el-table-column prop="dataCollectionTime" label="数据采集时间"></el-table-column>
+                      <template slot="empty">
+                        <div style="height: 60%;transform: translateY(50%);">
+                          <i class="icon-wushuju iconfont"></i>
+                          数据暂无
+                        </div>
+                      </template>
+                    </el-table>
+                  </div>
                 </div>
-                <div v-if="activeTab === 'objectRelationship'" class="objectRelationship">
+                <div v-show="activeTab === 'objectRelationship'" class="objectRelationship">
                   <div class="objectRelationship-left">
                     <h5>空间内设备:</h5>
                     <eqToSpaceTable :params="params" type="Equipment"></eqToSpaceTable>
@@ -68,12 +87,12 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import { queryZone, getAllbusiness, getDataDictionary, floorQuery, buildingQuery } from '@/api/scan/request'
+import { mapGetters } from "vuex";
+import { queryZone, getAllbusiness, getDataDictionary, floorQuery, buildingQuery, BeatchQueryParam } from '@/api/scan/request'
 import eqToSpaceTable from '@/components/business_space/newTables/eqToSpaceTable'
 import syInSpaceTable from '@/components/business_space/newTables/syInSpaceTable'
-import handsontableMain from "@/components/business_space/business/handsontable";
 import { DivideFloorScene, SpaceItem, ZoneItem, FloorView } from "@saga-web/cad-engine/lib";
+import tools from "@/utils/scan/tools";
 
 export default {
   data() {
@@ -87,35 +106,42 @@ export default {
       checked: true,
       spaceDetails: {},
       iframeSrc: '',
-      projectId: '',
+      proId: '',
       params: {},
       view: null,
       scene: null,
       canvasWidth: 410,
       canvasHeight: 400,
+      page: {
+        pageSize: 50,
+        pageSizes: [10, 20, 50, 100],
+        pageNumber: 1,
+        total: 0
+      },
+      tableData: [],
+      loading: false,
+      headerStyle: {// 列表样式
+        backgroundColor: '#e1e4e5',
+        color: '#2b2b2b',
+        lineHeight: '30px'
+      }
     }
   },
   components: {
     eqToSpaceTable,
-    syInSpaceTable,
-    handsontableMain
+    syInSpaceTable
   },
   created() {
     if (this.$route.query.RoomID && this.$route.query.zone && !this.$route.query.isMyTab) {
       this.getData();
-      // this.setFrame();
+      this.setFrame();
       this.params = this.$route.query;
     }
+    this.getInFormationPoitnName();
   },
-  updated() {
-    if (this.activeTab === "dynamicData") {
-      this.$nextTick(() => {
-        this.initMessage();
-      })
-    }
-  },
+  updated() { },
   computed: {
-    ...mapGetters('layout', ['userInfo', 'projects', 'userId', 'secret'])
+    ...mapGetters('layout', ['userInfo', 'projects', 'userId', 'secret', 'projectId'])
   },
   methods: {
     getData() {
@@ -127,7 +153,6 @@ export default {
         zone: this.$route.query.zone
       }
       queryZone(params, res => {
-        console.log(res, 111)
         this.spaceDetails = res.Content[0];
         if (this.spaceDetails.Outline && this.spaceDetails.Outline.length) {
           this.getSpaceFloor();
@@ -136,8 +161,8 @@ export default {
     },
     setFrame() {
       // 设置静态数据tab的iframe地址
-      this.projectId = localStorage.getItem('projectId');
-      this.iframeSrc = `${process.env.BASE_URL}:8889/#/details?perjectId=${this.projectId}&secret=${this.secret}&FmId=${this.$route.query.RoomID}&type=0&code=${this.$route.query.zone}`
+      this.proId = localStorage.getItem('projectId');
+      this.iframeSrc = `${process.env.BASE_URL}:8889/#/details?perjectId=${this.proId}&secret=${this.secret}&FmId=${this.$route.query.RoomID}&type=0&code=${this.$route.query.zone}`
     },
     getSpaceFloor() {
       // 获取业务空间楼层
@@ -145,8 +170,8 @@ export default {
         Filters: `FloorID='${this.spaceDetails.FloorId}'`
       }
       floorQuery(params, res => {
-        console.log(res, 23222)
-        this.FloorMap = res.Content[0].StructureInfo.FloorMap;
+        this.buildFloorSelectd = res.Content[0];
+        res.Content[0].StructureInfo && res.Content[0].StructureInfo.FloorMap ? this.FloorMap = res.Content[0].StructureInfo.FloorMap : this.FloorMap = "";
         this.getGraphy();
       })
     },
@@ -171,9 +196,6 @@ export default {
           Color: "#a384fc",
         }
         that.scene.addZoneList([tempArr]);
-        // that.scene.zoneList[0].selected = true;
-        // that.view.fitSelectedToView();
-        // this.scene.isZoneSelectable = false;
         this.scene.isSpaceSelectable = true;
       })
     },
@@ -184,38 +206,52 @@ export default {
       }
       this.view = new FloorView('floorCanvas')
     },
-    initMessage() {
+    getInFormationPoitnName() {// 获取动态数据
       let params = {
         data: {
+          Filters: 'InputMode in ["L1","L2","L","M"]',
           Orders: "sort asc",
           PageNumber: 1,
           PageSize: 500
         },
-        type: this.spaceDetails.ObjectType
+        type: this.$route.query.zone
       }
-      getDataDictionary(params, res => {
-        console.log(res, 888)
-        this.buildFloorSelectd = [this.spaceDetails.BuildingId, this.spaceDetails.FloorId];
-        this.$refs.handsontable[0].getHeader(res.Content, this.buildFloorSelectd);
-      })
-    },
-    //获取表格主体内容
-    getMain() {
-      if (!!this.hot) {
-        this.hot.destroy();
-        this.hot = null;
+      let param = {
+        secret: this.secret,
+        ProjId: this.projectId,
+        data: {
+          criterias: []
+        }
       }
-      this.$nextTick(() => {
-        this.initHot();
-      });
-    },
+      getDataDictionary(params, res => {// 获取表号功能号
+        this.tableData = res.Content;
+        this.tableData.map(item => {
+          let cur = tools.dataForKey(this.spaceDetails, item.Path);
+          item.functionNo = cur;
+          item.dataCollectionTime = new Date().toLocaleDateString();
+          param.data.criterias.push({
+            id: this.spaceDetails.RoomID,
+            code: item.InfoPointCode
+          });
+        })
+        BeatchQueryParam(param, res => {// 获取动态数据
+          res.Content.map((item, index) => {
+            tools.setDataForKey(
+              this.spaceDetails,
+              this.tableData[index].Path,
+              this.tableData[index].functionNoDynamicData = item.error ? item.value ? "表号功能号格式错误" : "表号功能号不存在" : "暂未采集到实时数据"
+            );
+          })
+        });
+      })
+    }
   },
   watch: {
     // 监听路由地址,并判断有RoomID和zone,重新请求空间数据
-    "$route"() {
+    "$route"(to,from) {
       if (this.$route.query.RoomID && this.$route.query.zone) {
         this.getData();
-        // window.location.reload();
+        window.location.reload();
       }
     }
   }
@@ -282,13 +318,13 @@ export default {
     height: 100%;
   }
 }
-.el-tabs__content {
-  height: 750px;
-}
 #pane-staticData {
   height: 750px;
   div {
     height: 100%;
   }
 }
+.unit {
+  color: rgb(167, 167, 167);
+}
 </style>