haojianlong il y a 5 ans
Parent
commit
4a7bd31c19

+ 119 - 102
src/views/point/dynamicdata/addRelation/index.vue

@@ -66,46 +66,30 @@
           </div>
         </div>
         <!-- 左侧列表 -->
-        <div class="table-box">
+        <div class="table-box" ref="lTableBody">
           <div class="l-custom-table custom-table" v-loading="lTableLoading">
-            <div>
-              <table>
-                <thead>
-                  <tr>
-                    <td style="width:20%;">数据源</td>
-                    <td style="width:30%;">位置标签</td>
-                    <td class="bgf5" style="width:200px;min-width:200px;">设备标识</td>
-                    <td class="bgf5 special" style="width:30px;min-width:30px;"></td>
-                  </tr>
-                </thead>
-              </table>
-            </div>
-            <div ref="lTableBody" class="custom-table-body">
-              <table>
-                <tbody is="transition-group" name="el-zoom-in-top">
-                  <tr v-for="t in LtableData" :key="t.id">
-                    <td style="width:20%;">
-                      <el-tooltip :content="t.address" placement="top">
-                        <span>{{t.address}}</span>
-                      </el-tooltip>
-                    </td>
-                    <td style="width:30%;">
-                      <el-tooltip :content="t.address" placement="top">
-                        <span>{{t.address}}</span>
-                      </el-tooltip>
-                    </td>
-                    <td class="bgf5" style="width:200px;min-width:200px;">
-                      <el-tooltip :content="t.address" placement="top">
-                        <span>{{t.address}}</span>
-                      </el-tooltip>
-                    </td>
-                    <td class="bgf5 special" style="width:30px;min-width:30px;">
-                      <el-checkbox v-model="t.checked" @change="changeCheck(t.id,'l')"></el-checkbox>
-                    </td>
-                  </tr>
-                </tbody>
-              </table>
-            </div>
+            <el-table
+              ref="multipleTable1"
+              :data="LtableData"
+              tooltip-effect="dark"
+              style="width: 100%"
+              height="100%"
+              :row-class-name="'transition-box'"
+            >
+              <el-table-column label="数据源" align="right">
+                <template slot-scope="scope">{{ scope.row.date }}</template>
+              </el-table-column>
+              <el-table-column prop="name" label="位置标签" align="right"></el-table-column>
+              <el-table-column
+                prop="address"
+                label="设备标识"
+                show-overflow-tooltip
+                align="right"
+                width="200"
+                class-name="bgf5"
+              ></el-table-column>
+              <el-table-column type="selection" width="35" class-name="bgf5"></el-table-column>
+            </el-table>
           </div>
           <!-- 智能推荐 -->
           <transition name="el-zoom-in-top">
@@ -151,50 +135,21 @@
         <!-- 右侧列表 -->
         <div class="table-box">
           <div class="r-custom-table custom-table" v-loading="rTableLoading">
-            <div>
-              <table>
-                <thead>
-                  <tr>
-                    <td class="bgf5 special" style="width:30px;min-width:30px;"></td>
-                    <td class="bgf5" style="width:200px;min-width:200px;">设备实例名称</td>
-                    <td style="width:20%;">设备实例编码</td>
-                    <td style="width:20%;">所在业务空间</td>
-                    <td style="width:30%;">所在建筑楼层</td>
-                  </tr>
-                </thead>
-              </table>
-            </div>
-            <div ref="rTableBody" class="custom-table-body">
-              <table>
-                <tbody is="transition-group" name="el-zoom-in-top">
-                  <tr v-for="t in RtableData" :key="t.id" :data-id="t.id">
-                    <td class="bgf5 special" style="width:30px;min-width:30px;">
-                      <el-checkbox v-model="t.checked" @change="changeCheck(t.id,'r')"></el-checkbox>
-                    </td>
-                    <td class="bgf5" style="width:200px;min-width:200px;">
-                      <el-tooltip :content="t.date" placement="top">
-                        <span>{{t.date}}</span>
-                      </el-tooltip>
-                    </td>
-                    <td style="width:20%;">
-                      <el-tooltip :content="t.address" placement="top">
-                        <span>{{t.address}}</span>
-                      </el-tooltip>
-                    </td>
-                    <td style="width:20%;">
-                      <el-tooltip :content="t.address" placement="top">
-                        <span>{{t.address}}</span>
-                      </el-tooltip>
-                    </td>
-                    <td style="width:30%;">
-                      <el-tooltip :content="t.address" placement="top">
-                        <span>{{t.address}}</span>
-                      </el-tooltip>
-                    </td>
-                  </tr>
-                </tbody>
-              </table>
-            </div>
+            <el-table
+              ref="multipleTable2"
+              :data="RtableData"
+              tooltip-effect="dark"
+              style="width: 100%"
+              height="100%"
+            >
+              <el-table-column type="selection" width="35" class-name="bgf5"></el-table-column>
+              <el-table-column label="设备实例名称" width="200" class-name="bgf5">
+                <template slot-scope="scope">{{ scope.row.date }}</template>
+              </el-table-column>
+              <el-table-column prop="name" label="设备实例编码"></el-table-column>
+              <el-table-column prop="name" label="所在业务空间"></el-table-column>
+              <el-table-column prop="address" label="所在建筑楼层" show-overflow-tooltip></el-table-column>
+            </el-table>
           </div>
           <!-- 智能推荐 -->
           <transition name="el-zoom-in-top">
@@ -337,6 +292,68 @@ export default {
           name: "王小虎",
           checked: false,
           address: "上海市普陀区金沙江路 1518 弄"
+        }, {
+          id: 1,
+          date: "2016-05-02",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
+        },
+        {
+          id: 2,
+          date: "2016-05-04",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
+        },
+        {
+          id: 3,
+          date: "2016-05-01",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
+        },
+        {
+          id: 4,
+          date: "2016-05-02",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
+        },
+        {
+          id: 5,
+          date: "2016-05-04",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
+        },
+        {
+          id: 6,
+          date: "2016-05-01",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
+        },
+        {
+          id: 7,
+          date: "2016-05-08",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
+        },
+        {
+          id: 8,
+          date: "2016-05-06",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
+        },
+        {
+          id: 9,
+          date: "2016-05-07",
+          name: "王小虎",
+          checked: false,
+          address: "上海市普陀区金沙江路 1518 弄"
         }
       ], //列表数据
       RtableData: [
@@ -448,25 +465,25 @@ export default {
       }
     });
     let rTableBody = this.$refs.rTableBody;
-    rTableBody.addEventListener("scroll", () => {
-      let scrollTop = rTableBody.scrollTop;
-      let scrollHeight = rTableBody.scrollHeight;
-      let offsetHeight = rTableBody.offsetHeight;
-      if (scrollTop + offsetHeight >= scrollHeight) {
-        console.log("request");
-        this.rTableLoading = true;
-        setTimeout(() => {
-          this.rTableLoading = false;
-          this.RtableData.push({
-            date: "2016-05-02",
-            name: "王小虎",
-            id: new Date().getTime(),
-            checked: false,
-            address: "上海市普陀区金沙江路 1518 弄"
-          });
-        }, 1000);
-      }
-    });
+    // rTableBody.addEventListener("scroll", () => {
+    //   let scrollTop = rTableBody.scrollTop;
+    //   let scrollHeight = rTableBody.scrollHeight;
+    //   let offsetHeight = rTableBody.offsetHeight;
+    //   if (scrollTop + offsetHeight >= scrollHeight) {
+    //     console.log("request");
+    //     this.rTableLoading = true;
+    //     setTimeout(() => {
+    //       this.rTableLoading = false;
+    //       this.RtableData.push({
+    //         date: "2016-05-02",
+    //         name: "王小虎",
+    //         id: new Date().getTime(),
+    //         checked: false,
+    //         address: "上海市普陀区金沙江路 1518 弄"
+    //       });
+    //     }, 1000);
+    //   }
+    // });
   },
   computed: {
     requestFlag() {

+ 8 - 5
src/views/point/dynamicdata/index.vue

@@ -3,8 +3,8 @@
     <!-- 按钮及提示 -->
     <div class="text-right">
       <span>最后一次执行时间:{{lastUpdateTime}}</span>
-      <el-button size="medium" @click="apply">执行对应结果</el-button>
-      <el-button size="medium" type="primary" @click="toAddRelation">处理未对应实例标识</el-button>
+      <el-button size="medium" @click="apply">按对应规则自动设定动态参数信息点</el-button>
+      <el-button size="medium" type="primary" @click="toAddRelation">填充对应规则</el-button>
     </div>
     <!-- tab分页 -->
     <el-tabs v-model="curType">
@@ -89,13 +89,13 @@
     <!-- 列表区域 -->
     <div class="table-area">
       <el-table :data="tableData" style="width: 100%" height="100%" v-show="curType==1">
-        <el-table-column label="设备标识">
+        <el-table-column label="点位表中出现的所有设备">
           <el-table-column prop="province" label="设备标识"></el-table-column>
           <el-table-column prop="city" label="位置标签"></el-table-column>
           <el-table-column prop="address" label="数据源"></el-table-column>
+          <el-table-column prop="address" label="数字字典设备类型"></el-table-column>
         </el-table-column>
-        <el-table-column label="设备实例">
-          <el-table-column prop="province" label="数字字典设备类型"></el-table-column>
+        <el-table-column label="对应物理世界中的设备实例">
           <el-table-column prop="city" label="对应的设备实例"></el-table-column>
           <el-table-column prop="address" label="实例所在建筑楼层"></el-table-column>
           <el-table-column prop="address" label="实例所在业务空间"></el-table-column>
@@ -135,6 +135,9 @@ import tools from "@/utils/tools";
 import { mapGetters, mapActions } from "vuex";
 import applyRulesDialog from "@/components/point/dynamicdata/applyRulesDialog"
 import delRelationDialog from "@/components/point/dynamicdata/delRelationDialog"
+import {
+  getDataSource
+} from "@/api/scan/request";
 export default {
   computed: {
     ...mapGetters("layout", ["projectId"])