Browse Source

fix too much request bug and scroll bug

haojianlong 5 years ago
parent
commit
4e04068799

+ 1 - 1
src/components/point/dynamicdata/locationCascader.vue

@@ -63,7 +63,7 @@ export default {
       clearTimeout(this.timer);
       this.timer = setTimeout(() => {
         let tempVal = JSON.parse(JSON.stringify(val));
-        if (tempVal[tempVal.length - 1].indexOf('未明确') > -1) {
+        if (tempVal.length && tempVal[tempVal.length - 1].indexOf('未明确') > -1) {
           tempVal.splice(tempVal.length - 1, 1, '')
         }
         this.$emit("change", tempVal);

+ 13 - 1
src/views/point/dynamicdata/addRelation/equipRela/index.vue

@@ -323,11 +323,17 @@ export default {
     //查询左侧列表
     queryLeftTable() {
       this.lPage.pageNumber = 1;
+      if (this.$refs.lTableBody && this.$refs.lTableBody.bodyWrapper) {
+        this.$refs.lTableBody.bodyWrapper.scrollTop = 0
+      }
       this.getLeftData();
     },
     //查询右侧列表
     queryRightTable() {
       this.rPage.pageNumber = 1;
+      if (this.$refs.rTableBody && this.$refs.rTableBody.bodyWrapper) {
+        this.$refs.rTableBody.bodyWrapper.scrollTop = 0
+      }
       this.getRightData();
     },
     //获取待关联点位-左侧
@@ -368,7 +374,7 @@ export default {
         PageSize: this.rPage.pageSize,
         TypeNameList: [this.typeName]
       };
-      //处理查询条件(目前只是单个查,需后台支持)
+      //处理查询条件
       if (this.form.EquipLocalName && this.form.EquipLocalName.length) {
         param.EquipLocalName = this.form.EquipLocalName;
       }
@@ -387,6 +393,12 @@ export default {
       if (this.form.locationVal.length > 3) {
         param.RoomLocalName = this.form.locationVal[3];
       }
+      if (!this.form.locationVal.length) {
+        delete param.BuildLocalName
+        delete param.FloorLocalName
+        delete param.SpaceType
+        delete param.RoomLocalName
+      }
       this.rTableLoading = true;
       dynamicPendingobjs(param, res => {
         this.rPage.total = res.Total;