Преглед на файлове

modfiy dynamic add and single delete group delete

haojianlong преди 5 години
родител
ревизия
e5d3ebd2f3

+ 78 - 39
src/components/point/dynamicdata/delRelationDialog.vue

@@ -1,48 +1,59 @@
 <template>
-  <el-dialog
-    title="提示"
-    :visible.sync="dialogVisible"
-    width="60%"
-    @close="handleClose"
-    id="delRelation"
-  >
+  <el-dialog title="提示" :visible.sync="dialogVisible" :width="dialogWidth" @close="handleClose" id="delRelation">
     <span>确定要清除对应关系?</span>
     <div v-loading="loading">
-      <el-row>
-        <el-col :span="18">
-          <el-table
-            :data="tableData"
-            style="width: 100%;max-height:400px;"
-            height="calc(100% - 160px)"
-          >
-            <el-table-column label="设备标识" align="right">
-              <el-table-column label="数据源" prop="name" class-name="bgf5" align="right"></el-table-column>
-              <el-table-column label="位置标签" prop="name" align="right"></el-table-column>
-              <el-table-column label="设备标识" prop="name" align="right"></el-table-column>
-              <el-table-column type="selection"></el-table-column>
-            </el-table-column>
-          </el-table>
-        </el-col>
-        <el-col :span="6">
-          <el-table
-            :data="tableData"
-            style="width: 100%;max-height:400px;"
-            height="calc(100% - 160px)"
-          >
-            <el-table-column label="设备实例">
-              <el-table-column label="设备实例" prop="name" class-name="bgf5"></el-table-column>
-            </el-table-column>
-          </el-table>
-        </el-col>
-      </el-row>
+      <div v-show="0">
+        <el-row>
+          <el-col :span="18">
+            <el-table :data="tableData" style="width: 100%;max-height:400px;" height="calc(100% - 160px)">
+              <el-table-column label="设备标识" align="right">
+                <el-table-column label="数据源" prop="name" class-name="bgf5" align="right"></el-table-column>
+                <el-table-column label="位置标签" prop="name" align="right"></el-table-column>
+                <el-table-column label="设备标识" prop="name" align="right"></el-table-column>
+                <el-table-column type="selection"></el-table-column>
+              </el-table-column>
+            </el-table>
+          </el-col>
+          <el-col :span="6">
+            <el-table :data="tableData" style="width: 100%;max-height:400px;" height="calc(100% - 160px)">
+              <el-table-column label="设备实例">
+                <el-table-column label="设备实例" prop="name" class-name="bgf5"></el-table-column>
+              </el-table-column>
+            </el-table>
+          </el-col>
+        </el-row>
+      </div>
+      <div v-show="0">
+        <el-row>
+          <el-col :span="18">
+            <el-table :data="tableData" style="width: 100%;max-height:400px;" height="calc(100% - 160px)">
+              <el-table-column label="设备标识" align="right">
+                <el-table-column label="数据源" prop="name" class-name="bgf5" align="right"></el-table-column>
+                <el-table-column label="位置标签" prop="name" align="right"></el-table-column>
+                <el-table-column label="设备标识" prop="name" align="right"></el-table-column>
+                <el-table-column type="selection"></el-table-column>
+              </el-table-column>
+            </el-table>
+          </el-col>
+          <el-col :span="6">
+            <el-table :data="tableData" style="width: 100%;max-height:400px;" height="calc(100% - 160px)">
+              <el-table-column label="设备实例">
+                <el-table-column label="设备实例" prop="name" class-name="bgf5"></el-table-column>
+              </el-table-column>
+            </el-table>
+          </el-col>
+        </el-row>
+      </div>
     </div>
     <span slot="footer" class="dialog-footer">
       <el-button size="small">取消</el-button>
-      <el-button size="small" type="primary">使用选择的表号功能号</el-button>
+      <el-button size="small" type="primary" v-show="1" v-loading="loading" @click="handleDelete">确定</el-button>
+      <el-button size="small" type="primary" v-show="0" v-loading="loading">清除已选的对应规则</el-button>
     </span>
   </el-dialog>
 </template>
 <script>
+import { dynamicDeleteRelation } from "@/api/scan/request";
 export default {
   data() {
     return {
@@ -113,17 +124,45 @@ export default {
         }
       ],
       activeName: "first", //当前所在tab页
-      loading: false
+      loading: false,
+      dialogWidth: '20%',
     };
   },
   methods: {
-    showDialog() {
-      //   this.tableData = data;
+    showDialog(row) {
       this.dialogVisible = true;
+      //需先用对象请求接口返回所需对象
+      console.log(row);
+      let param = [];
+      let o1 = {
+        ObjectID:row.ObjectID,
+        TypeName:row.TypeName
+      }
+      let o2 = {
+        EquipmentMark:row.EquipmentMark,
+        TypeName:row.TypeName
+      }
+      let Objs = []
+      let Points = []
+      Objs.push(o1);
+      Points.push(o2);
+      let object = {
+        Objs:Objs,
+        Points:Points,
+      }
+      param.push(object)
+      this.param = param;
+      console.log(param)
     },
     handleClick() {},
     handleClose(done) {},
-    handleDelete(i, t) {}
+    handleDelete(i, t) {
+      console.log(i)
+      console.log(t)
+      dynamicDeleteRelation(this.param, res => {
+        console.log(res);
+        this.$emit('refresh')
+      });}
   },
   mounted() {},
   created() {}

+ 34 - 39
src/components/point/dynamicdata/historyDialog.vue

@@ -1,26 +1,14 @@
 <template>
-  <el-dialog
-    title="本次对应记录"
-    :visible.sync="dialogVisible"
-    width="60%"
-    @close="handleClose"
-    id="historyAction"
-    custom-class="act-history"
-  >
+  <el-dialog title="本次对应记录" :visible.sync="dialogVisible" width="60%" @close="handleClose" id="historyAction" custom-class="act-history">
     <span>提示:可使用Contorl+F 搜索关键字</span>
     <div>
-      <el-table
-        :data="tableData"
-        style="width: 100%;"
-        :show-header="showheader"
-        height="400px"
-      >
+      <el-table :data="tableData" style="width: 100%;" :show-header="showheader" height="400px">
         <el-table-column>
           <el-table-column label="数据源" align="right">
             <template slot-scope="scope">
               <div v-for="t in scope.row.leftList" :key="t.id">
-                <el-tooltip :content="t.address" placement="top">
-                  <span>{{t.address}}</span>
+                <el-tooltip :content="t.Datasource" placement="top">
+                  <span>{{t.Datasource}}</span>
                 </el-tooltip>
               </div>
             </template>
@@ -28,8 +16,8 @@
           <el-table-column label="位置标签" align="right">
             <template slot-scope="scope">
               <div v-for="t in scope.row.leftList" :key="t.id">
-                <el-tooltip :content="t.address" placement="top">
-                  <span>{{t.address}}</span>
+                <el-tooltip :content="t.LocationFlag.toString()" placement="top">
+                  <span>{{t.LocationFlag.toString()}}</span>
                 </el-tooltip>
               </div>
             </template>
@@ -37,8 +25,8 @@
           <el-table-column label="设备标识" width="200px" class-name="bgf5" align="right">
             <template slot-scope="scope">
               <div v-for="t in scope.row.leftList" :key="t.id">
-                <el-tooltip :content="t.address" placement="top">
-                  <span>{{t.address}}</span>
+                <el-tooltip :content="t.EquipmentMark" placement="top">
+                  <span>{{t.EquipmentMark}}</span>
                 </el-tooltip>
               </div>
             </template>
@@ -48,8 +36,8 @@
           <el-table-column label="设备实例名称" width="200px" class-name="bgf5 border-l">
             <template slot-scope="scope">
               <div v-for="t in scope.row.rightList" :key="t.id">
-                <el-tooltip :content="t.address" placement="top">
-                  <span>{{t.address}}</span>
+                <el-tooltip :content="t.EquipLocalName" placement="top">
+                  <span>{{t.EquipLocalName}}</span>
                 </el-tooltip>
               </div>
             </template>
@@ -57,8 +45,8 @@
           <el-table-column label="设备实例编码">
             <template slot-scope="scope">
               <div v-for="t in scope.row.rightList" :key="t.id">
-                <el-tooltip :content="t.address" placement="top">
-                  <span>{{t.address}}</span>
+                <el-tooltip :content="t.ObjectID" placement="top">
+                  <span>{{t.ObjectID}}</span>
                 </el-tooltip>
               </div>
             </template>
@@ -66,8 +54,8 @@
           <el-table-column label="所在建筑楼层">
             <template slot-scope="scope">
               <div v-for="t in scope.row.rightList" :key="t.id">
-                <el-tooltip :content="t.address" placement="top">
-                  <span>{{t.address}}</span>
+                <el-tooltip :content="t.FloorLocalName" placement="top">
+                  <span>{{t.FloorLocalName}}</span>
                 </el-tooltip>
               </div>
             </template>
@@ -75,8 +63,8 @@
           <el-table-column label="所在业务空间">
             <template slot-scope="scope">
               <div v-for="t in scope.row.rightList" :key="t.id">
-                <el-tooltip :content="t.address" placement="top">
-                  <span>{{t.address}}</span>
+                <el-tooltip :content="t.RoomLocalName" placement="top">
+                  <span>{{t.RoomLocalName}}</span>
                 </el-tooltip>
               </div>
             </template>
@@ -84,12 +72,7 @@
         </el-table-column>
         <el-table-column label="操作" width="100px">
           <template slot-scope="scope">
-            <el-button
-              size="mini"
-              @click="handleDelete(scope.$index, scope.row)"
-              type="danger"
-              plain
-            >清除对应</el-button>
+            <el-button size="mini" @click="handleDelete(scope.$index, scope.row)" type="danger" plain>清除对应</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -97,16 +80,13 @@
   </el-dialog>
 </template>
 <script>
+import { dynamicDeleteRelation } from "@/api/scan/request";
 export default {
   data() {
     return {
       dialogVisible: false, //弹窗显示与隐藏
       showheader: false,
       tableData: [], //数据list
-      repeatList: {
-        l: [],
-        r: []
-      }
     };
   },
   methods: {
@@ -115,7 +95,22 @@ export default {
       this.dialogVisible = true;
     },
     handleClose(done) {},
-    handleDelete(i, t) {}
+    //清除关系
+    handleDelete(i, t) {
+      let param = [];
+      let object = {
+        Objs: t.rightList,
+        Points: t.leftList
+      };
+      param.push(object);
+      dynamicDeleteRelation(param, res => {
+        if (res.Result == "success") {
+          this.$message.success("清除关联成功");
+          this.tableData.splice(i, 1);
+          this.$emit("delSuc");
+        }
+      });
+    }
   },
   mounted() {},
   created() {}

+ 166 - 234
src/views/point/dynamicdata/addRelation/index.vue

@@ -28,7 +28,7 @@
         <div class="query-box clearfix">
           <div class="query-item">
             <label>设备标识关键字</label>
-            <el-input placeholder="请输入设备标识关键字" v-model="form.keywords" class="input-with-select">
+            <el-input placeholder="请输入设备标识关键字" v-model="form.EquipmentMark" class="input-with-select">
               <el-button slot="append" icon="el-icon-search"></el-button>
             </el-input>
           </div>
@@ -48,12 +48,13 @@
         <!-- 左侧列表 -->
         <div class="table-box" ref="lTableBody">
           <div class="l-custom-table custom-table" v-loading="lTableLoading">
-            <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 ref="multipleTable1" :data="LtableData" tooltip-effect="dark" style="width: 100%" height="100%" @selection-change="leftSelectionChange">
+              <el-table-column label="数据源" align="right" show-overflow-tooltip>
+                <template slot-scope="scope">{{ scope.row.Datasource }}</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 prop="LocationFlag" label="位置标签" align="right" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="SubTypeName" label="设备类型关键字" align="right" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="EquipmentMark" 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>
@@ -84,7 +85,7 @@
         <div class="query-box clearfix">
           <div class="query-item">
             <label>设备实例关键字</label>
-            <el-input placeholder="请输入设备实例关键字" v-model="form.keywords" class="input-with-select">
+            <el-input placeholder="请输入设备实例关键字" v-model="form.EquipLocalName" class="input-with-select">
               <el-button slot="append" icon="el-icon-search"></el-button>
             </el-input>
           </div>
@@ -96,14 +97,15 @@
         <!-- 右侧列表 -->
         <div class="table-box">
           <div class="r-custom-table custom-table" v-loading="rTableLoading">
-            <el-table ref="multipleTable2" :data="RtableData" tooltip-effect="dark" style="width: 100%" height="100%">
+            <el-table ref="multipleTable2" :data="RtableData" tooltip-effect="dark" style="width: 100%" height="100%" @selection-change="rightSelectionChange">
               <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 label="设备实例名称" width="200" class-name="bgf5" show-overflow-tooltip>
+                <template slot-scope="scope">{{ scope.row.EquipLocalName }}</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-column prop="ObjectID" label="设备实例编码" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="SubTypeName" label="设备类型" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="FloorLocalName" label="所在建筑楼层" show-overflow-tooltip></el-table-column>
+              <el-table-column prop="RoomLocalName" label="所在业务空间" show-overflow-tooltip></el-table-column>
             </el-table>
           </div>
           <!-- 智能推荐 -->
@@ -129,7 +131,7 @@
       </div>
     </div>
     <!-- 历史记录弹窗 -->
-    <history-dialog ref="history"></history-dialog>
+    <history-dialog ref="history" @delSuc="deleteSuc"></history-dialog>
   </div>
 </template>
 <script>
@@ -161,82 +163,13 @@ export default {
       LocFlagList: [], //位置标签
       LocationList: [], //所在位置下拉
       LtableData: [], //列表数据
-      RtableData: [
-        {
-          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 弄"
-        }
-      ], //列表数据
-      page: {
-        pageSize: 50,
-        pageNumber: 1,
-        total: 0
-      }, //分页
+      RtableData: [], //列表数据
       form: {}, //查询条件
       leftRecoList: [], //左推荐
       rightRecoList: [], //右推荐
       leftAI: true, //左右推荐公用-互斥
-      lArray: [], //左侧选中数据索引
-      rArray: [], //右侧选中数据索引
+      lArray: [], //左侧选中数据
+      rArray: [], //右侧选中数据
       hasRequestedFlag: false, //用于标识是否关联过数据,若是则重新请求第一页数据,
       showPlus: false, //+1记录动画
       num: 0, //记录条数
@@ -624,73 +557,50 @@ export default {
       //i 索引 l 左侧AI or 右侧AI
       if (l == "l") {
         this.leftRecoList[i].checked = !this.leftRecoList[i].checked;
-        this.changeCheck(this.leftRecoList[i].id, "l");
-        this.LtableData.map((t, index) => {
-          if (t.id == this.leftRecoList[i].id) {
-            t.checked = true;
-          }
-        });
+        this.lArray = [];
+        this.lArray.push(this.leftRecoList[i]);
       } else {
         this.rightRecoList[i].checked = !this.rightRecoList[i].checked;
-        this.changeCheck(this.rightRecoList[i].id, "r");
-        this.RtableData.map((t, index) => {
-          if (t.id == this.rightRecoList[i].id) {
-            t.checked = true;
-          }
-        });
+        this.rArray = [];
+        this.rArray.push(this.rightRecoList[i]);
       }
     },
     //查看本次历史记录
     showHistory() {
       this.$refs.history.showDialog(this.historyList);
     },
-    //隐藏 动画
-    animate() {
-      //前端真删,但是要将数据存到historyList中,弹窗中使用
-      //两侧
-      let history = { leftList: [], rightList: [] };
-      for (let j = 0; j < this.LtableData.length; j++) {
-        if (this.LtableData[j].checked) {
-          let temp = this.LtableData.splice(j, 1);
-          history.leftList.push(temp[0]);
-          j--;
-        }
-      }
-      for (let i = 0; i < this.RtableData.length; i++) {
-        if (this.RtableData[i].checked) {
-          let temp = this.RtableData.splice(i, 1);
-          history.rightList.push(temp[0]);
-          i--;
-        }
-      }
-      this.historyList.push(history);
-      this.lArray = [];
+    //重新获取数据
+    reGetData() {
+      let history = { leftList: this.lArray, rightList: this.rArray };
+      this.historyList.push(history); //保存本次操作记录
+      this.lArray = []; //清空选中list
       this.rArray = [];
-      this.num++;
+      this.num++; //右上角操作记录
       this.showPlus = true;
       setTimeout(() => {
         this.showPlus = false;
       }, 800);
+      //重新获取数据
+      this.refresh();
     },
-    //表格中的选择事件
-    changeCheck(i, l) {
-      // i ->数据id,l->左侧or右侧
-      let key = l == "l" ? "lArray" : "rArray";
-      if (!this[key].includes(i)) {
-        this[key].push(i);
-      } else {
-        let index = this[key].indexOf(i);
-        this[key].splice(index, 1);
-      }
+    //表格中的选中事件
+    leftSelectionChange(selection) {
+      this.lArray = selection;
     },
-    //获取待关联实例-右侧
+    rightSelectionChange(selection) {
+      this.rArray = selection;
+    },
+    //获取待关联点位-左侧
     getLeftData() {
       let param = {
-        PageNumber: this.rPage.pageNumber,
-        PageSize: this.rPage.pageSize,
+        PageNumber: this.lPage.pageNumber,
+        PageSize: this.lPage.pageSize,
         TypeName: this.curType
       };
       //处理查询条件(目前只是单个查,需后台支持)
+      if (this.form.EquipmentMark && this.form.EquipmentMark.length) {
+        param.EquipmentMark = this.form.EquipmentMark;
+      }
       if (this.form.SubTypeName.length) {
         param.SubTypeName = this.form.SubTypeName.toString();
       }
@@ -700,46 +610,83 @@ export default {
       if (this.form.Datasource.length) {
         param.Datasource = this.form.Datasource.toString();
       }
-      dynamicPendingobjs(param, res => {
-        console.log(res);
+      this.lTableLoading = true;
+      dynamicPendingPoint(param, res => {
+        if (this.lPage.pageNumber == 1) {
+          this.LtableData = res.Content;
+        } else {
+          this.LtableData.push(res.Content);
+        }
+        this.lTableLoading = false;
       });
     },
-    //获取待关联点位-左侧
+    //获取待关联实例-右
     getRightData() {
       let param = {
-        PageNumber: this.lPage.pageNumber,
-        PageSize: this.lPage.pageSize,
+        PageNumber: this.rPage.pageNumber,
+        PageSize: this.rPage.pageSize,
         TypeName: this.curType
       };
       //处理查询条件(目前只是单个查,需后台支持)
+      if (this.form.EquipLocalName && this.form.EquipLocalName.length) {
+        param.EquipLocalName = this.form.EquipLocalName;
+      }
       if (this.form.SubTypeName.length) {
         param.SubTypeName = this.form.SubTypeName.toString();
       }
-      if (this.form.LocationFlag.length) {
-        param.LocationFlag = this.form.LocationFlag.toString();
-      }
-      if (this.form.Datasource.length) {
-        param.Datasource = this.form.Datasource.toString();
-      }
-      dynamicPendingPoint(param, res => {
-        if (this.lPage.pageNumber == 1) {
-          this.LtableData = res.Content;
+      // if (this.LocationList.length == 1) {
+      //   param.BuildLocalName = this.LocationList[0];
+      // } else if (this.LocationList.length == 2) {
+      //   param.FloorLocalName = this.LocationList[1];
+      // } else if (this.LocationList.length == 3) {
+      //   param.RoomLocalName = this.LocationList[2];
+      // } else if (this.LocationList.length == 4) {
+      //   param.SpaceType = this.LocationList[3];
+      // }
+      this.rTableLoading = true;
+      dynamicPendingobjs(param, res => {
+        if (this.rPage.pageNumber == 1) {
+          this.RtableData = res.Content;
         } else {
+          this.RtableData.push(res.Content);
         }
+        this.rTableLoading = false;
       });
+    },
+    //刷新列表
+    refresh() {
+      this.lPage.pageNumber = 1;
+      this.rPage.pageNumber = 1;
+      this.getLeftData();
+      this.getRightData();
+    },
+    //清除对应关系成功
+    deleteSuc(){
+      this.num--;
+      this.refresh();
     }
   },
   watch: {
     projectId(n, o) {
-      console.log(2222222222222);
       this.init();
     },
-    //判断两边是否均有选中值
+    //判断两边是否均有选中值-创建关联
     requestFlag(n, o) {
       if (n) {
         this.rightRecoList = [];
         this.leftRecoList = [];
-        this.animate();
+        let object = {
+          Objs: this.rArray,
+          Points: this.lArray
+        };
+        let param = [];
+        param.push(object);
+        dynamicCreateRelation(param, res => {
+          if (res.Result == "success") {
+            this.$message.success("关联成功");
+            this.reGetData();
+          }
+        });
       }
     },
     //AI辅助-左侧
@@ -750,37 +697,39 @@ export default {
       clearTimeout(this.timer);
       this.timer = setTimeout(() => {
         console.log("函数节流");
-        if (n.length > 0) {
-          this.leftAI = false;
-          this.rightRecoList = [
-            {
-              id: 1,
-              date: "2016-05-03",
-              name: "王小虎",
-              checked: false,
-              name2: "99%",
-              address: "上海市普陀区金沙江路 1518 弄"
-            },
-            {
-              id: 2,
-              date: "2016-05-03",
-              name: "王小虎",
-              checked: false,
-              name2: "99%",
-              address: "上海市普陀区金沙江路 1518 弄"
-            },
-            {
-              id: 3,
-              date: "2016-05-03",
-              name: "王小虎",
-              checked: false,
-              name2: "99%",
-              address: "上海市普陀区金沙江路 1518 弄"
-            }
-          ];
-        } else {
-          this.rightRecoList = [];
-          this.leftAI = true;
+        if (this.isSwitch) {
+          if (n.length > 0) {
+            this.leftAI = false;
+            this.rightRecoList = [
+              {
+                id: 1,
+                date: "2016-05-03",
+                name: "王小虎",
+                checked: false,
+                name2: "99%",
+                address: "上海市普陀区金沙江路 1518 弄"
+              },
+              {
+                id: 2,
+                date: "2016-05-03",
+                name: "王小虎",
+                checked: false,
+                name2: "99%",
+                address: "上海市普陀区金沙江路 1518 弄"
+              },
+              {
+                id: 3,
+                date: "2016-05-03",
+                name: "王小虎",
+                checked: false,
+                name2: "99%",
+                address: "上海市普陀区金沙江路 1518 弄"
+              }
+            ];
+          } else {
+            this.rightRecoList = [];
+            this.leftAI = true;
+          }
         }
       }, 800);
     },
@@ -790,37 +739,39 @@ export default {
       clearTimeout(this.timer);
       this.timer = setTimeout(() => {
         console.log("函数节流");
-        if (n.length > 0) {
-          this.leftAI = true;
-          this.leftRecoList = [
-            {
-              id: 1,
-              date: "2016-05-03",
-              name: "王小虎",
-              checked: false,
-              name2: "99%",
-              address: "上海市普陀区金沙江路 1518 弄"
-            },
-            {
-              id: 2,
-              date: "2016-05-03",
-              name: "王小虎",
-              checked: false,
-              name2: "99%",
-              address: "上海市普陀区金沙江路 1518 弄"
-            },
-            {
-              id: 3,
-              date: "2016-05-03",
-              name: "王小虎",
-              checked: false,
-              name2: "99%",
-              address: "上海市普陀区金沙江路 1518 弄"
-            }
-          ];
-        } else {
-          this.leftRecoList = [];
-          this.leftAI = false;
+        if (this.isSwitch) {
+          if (n.length > 0) {
+            this.leftAI = true;
+            this.leftRecoList = [
+              {
+                id: 1,
+                date: "2016-05-03",
+                name: "王小虎",
+                checked: false,
+                name2: "99%",
+                address: "上海市普陀区金沙江路 1518 弄"
+              },
+              {
+                id: 2,
+                date: "2016-05-03",
+                name: "王小虎",
+                checked: false,
+                name2: "99%",
+                address: "上海市普陀区金沙江路 1518 弄"
+              },
+              {
+                id: 3,
+                date: "2016-05-03",
+                name: "王小虎",
+                checked: false,
+                name2: "99%",
+                address: "上海市普陀区金沙江路 1518 弄"
+              }
+            ];
+          } else {
+            this.leftRecoList = [];
+            this.leftAI = false;
+          }
         }
       }, 800);
     }
@@ -835,7 +786,7 @@ export default {
   .text-right {
     text-align: right;
   }
-  .table-container {
+  /deep/ .table-container {
     height: calc(100% - 250px);
     & > div {
       width: 49.5%;
@@ -935,30 +886,11 @@ export default {
       //列表
       .custom-table {
         height: 100%;
-        table {
-          table-layout: fixed;
-          width: 100%;
-          overflow: hidden;
-        }
-        .custom-table-body {
-          height: calc(100% - 30px);
-          overflow-x: hidden;
-          overflow-y: auto;
-        }
-        tr {
-          line-height: 38px;
-        }
-        td {
-          border-bottom: 1px solid #ebeef5;
-          white-space: nowrap;
-          text-overflow: ellipsis;
-          overflow: hidden;
-        }
         .bgf5 {
           background-color: #f5f7fa;
         }
-        td.special {
-          box-sizing: border-box;
+        thead label.el-checkbox {
+          display: none;
         }
       }
       .l-custom-table {

+ 12 - 44
src/views/point/dynamicdata/index.vue

@@ -57,57 +57,21 @@
     <div class="table-area">
       <el-table :data="tableData" style="width: 100%" height="100%" v-show="1">
         <el-table-column label="点位表中出现的所有设备">
-          <el-table-column prop="EquipmentMark" label="设备标识">
-            <template slot-scope="scope">
-              <el-tooltip :content="scope.row.EquipmentMark" placement="top">
-                <span>{{scope.row.EquipmentMark}}</span>
-              </el-tooltip>
-            </template>
-          </el-table-column>
-          <el-table-column prop="LocationFlag" label="位置标签">
+          <el-table-column prop="EquipmentMark" label="设备标识" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="LocationFlag" label="位置标签" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-tooltip :content="scope.row.LocationFlag.toString()" placement="top">
                 <span>{{scope.row.LocationFlag.toString()}}</span>
               </el-tooltip>
             </template>
           </el-table-column>
-          <el-table-column prop="Datasource" label="数据源">
-            <template slot-scope="scope">
-              <el-tooltip :content="scope.row.Datasource" placement="top">
-                <span>{{scope.row.Datasource}}</span>
-              </el-tooltip>
-            </template>
-          </el-table-column>
-          <el-table-column prop="SubTypeName" label="数字字典设备类型">
-            <template slot-scope="scope">
-              <el-tooltip :content="scope.row.SubTypeName" placement="top">
-                <span>{{scope.row.SubTypeName}}</span>
-              </el-tooltip>
-            </template>
-          </el-table-column>
+          <el-table-column prop="Datasource" label="数据源" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="SubTypeName" label="数字字典设备类型" show-overflow-tooltip></el-table-column>
         </el-table-column>
         <el-table-column label="对应物理世界中的设备实例">
-          <el-table-column prop="ObjectID" label="对应的设备实例">
-            <template slot-scope="scope">
-              <el-tooltip :content="scope.row.ObjectID" placement="top">
-                <span>{{scope.row.ObjectID}}</span>
-              </el-tooltip>
-            </template>
-          </el-table-column>
-          <el-table-column prop="FloorLocalName" label="实例所在建筑楼层">
-            <template slot-scope="scope">
-              <el-tooltip :content="scope.row.FloorLocalName" placement="top">
-                <span>{{scope.row.FloorLocalName}}</span>
-              </el-tooltip>
-            </template>
-          </el-table-column>
-          <el-table-column prop="RoomLocalName" label="实例所在业务空间">
-            <template slot-scope="scope">
-              <el-tooltip :content="scope.row.RoomLocalName" placement="top">
-                <span>{{scope.row.RoomLocalName}}</span>
-              </el-tooltip>
-            </template>
-          </el-table-column>
+          <el-table-column prop="ObjectID" label="对应的设备实例" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="FloorLocalName" label="实例所在建筑楼层" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="RoomLocalName" label="实例所在业务空间" show-overflow-tooltip></el-table-column>
         </el-table-column>
         <el-table-column prop="action" label="操作">
           <template slot-scope="scope">
@@ -122,7 +86,7 @@
     <!-- 应用规则弹窗 -->
     <apply-rules-dialog ref="apply"></apply-rules-dialog>
     <!-- 清除对应关系弹窗 -->
-    <del-relation-dialog ref="del"></del-relation-dialog>
+    <del-relation-dialog ref="del" @refresh="refresh"></del-relation-dialog>
   </div>
 </template>
 <script>
@@ -285,6 +249,10 @@ export default {
           this.page.total = res.Total;
         }
       });
+    },
+    refresh(){
+      this.page.pageNumber = 1;
+      this.getTableData();
     }
   },
   watch: {