Browse Source

fix add relation bug and apply rules

haojianlong 5 years ago
parent
commit
20e9eeb807

+ 3 - 1
src/components/point/dynamicdata/applyRulesDialog.vue

@@ -5,7 +5,7 @@
       <el-tab-pane label="人工填写过表号功能号" name="first"></el-tab-pane>
       <el-tab-pane label="人工填写过表号功能号" name="first"></el-tab-pane>
       <!-- <el-tab-pane label="多个标识对应同一个信息点" name="second"></el-tab-pane> -->
       <!-- <el-tab-pane label="多个标识对应同一个信息点" name="second"></el-tab-pane> -->
     </el-tabs>
     </el-tabs>
-    <el-table :data="tableData" style="width: 100%;max-height:400px;" height="calc(100% - 160px)" @expand-change="expandRow" ref="expandTable">
+    <el-table :data="tableData" style="width: 100%;max-height:400px;min-height:200px;" height="calc(100% - 160px)" @expand-change="expandRow" ref="expandTable">
       <el-table-column type="expand" class-name="bgf5">
       <el-table-column type="expand" class-name="bgf5">
         <template slot-scope="scope">
         <template slot-scope="scope">
           <el-row>
           <el-row>
@@ -152,6 +152,8 @@ export default {
     rulesConfirm(){
     rulesConfirm(){
       dynamicExecute('', res => {
       dynamicExecute('', res => {
         this.$message.success('执行成功');
         this.$message.success('执行成功');
+        this.dialogVisible = false;
+        this.tableData = []
       })
       })
     }
     }
   },
   },

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

@@ -1,7 +1,7 @@
 <template>
 <template>
   <div>
   <div>
     <el-cascader placeholder="请选择所在位置" :options="LocationList" v-model="value" filterable size="small" @change="changeCascader" change-on-select
     <el-cascader placeholder="请选择所在位置" :options="LocationList" v-model="value" filterable size="small" @change="changeCascader" change-on-select
-      :props="props"></el-cascader>
+      :props="props" clearable></el-cascader>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>

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

@@ -345,10 +345,10 @@ export default {
         param.FloorLocalName = this.form.locationVal[1];
         param.FloorLocalName = this.form.locationVal[1];
       }
       }
       if (this.form.locationVal.length > 2) {
       if (this.form.locationVal.length > 2) {
-        param.RoomLocalName = this.form.locationVal[2];
+        param.SpaceType = this.form.locationVal[2];
       }
       }
       if (this.form.locationVal.length > 3) {
       if (this.form.locationVal.length > 3) {
-        param.SpaceType = this.form.locationVal[3];
+        param.RoomLocalName = this.form.locationVal[3];
       }
       }
       this.rTableLoading = true;
       this.rTableLoading = true;
       dynamicPendingobjs(param, res => {
       dynamicPendingobjs(param, res => {
@@ -421,18 +421,19 @@ export default {
       //先清空,返回结果后赋值
       //先清空,返回结果后赋值
       this.rightRecoList = [];
       this.rightRecoList = [];
       clearTimeout(this.timer);
       clearTimeout(this.timer);
-      if(this.isSwitch&&n.length){
+      if (this.isSwitch && n.length) {
         this.timer = setTimeout(() => {
         this.timer = setTimeout(() => {
-          let param = [{}]
+          let param = []
-          param[0].Objs = n
+          n.map(item => {
+            param.push({ Points: [item] })
+          })
           dynamicQueryAI(param, res => {
           dynamicQueryAI(param, res => {
             this.rightRecoList = res.Content[0].Objs;
             this.rightRecoList = res.Content[0].Objs;
             this.leftAI = !this.rightRecoList.length
             this.leftAI = !this.rightRecoList.length
-            console.log(this.rightRecoList)
           })
           })
         }, 800)
         }, 800)
-      }else{
+      } else {
-        this,rightRecoList = []
+        this.rightRecoList = []
         this.leftAI = true;
         this.leftAI = true;
       }
       }
     },
     },
@@ -440,16 +441,18 @@ export default {
     rArray(n, o) {
     rArray(n, o) {
       this.leftRecoList = [];
       this.leftRecoList = [];
       clearTimeout(this.timer);
       clearTimeout(this.timer);
-      if(this.isSwitch&&n.length){
+      if (this.isSwitch && n.length) {
         this.timer = setTimeout(() => {
         this.timer = setTimeout(() => {
-          let param = [{}]
+          let param = []
-          param[0].Points = n
+          n.map(item => {
+            param.push({ Objs: [item] })
+          })
           dynamicQueryAI(param, res => {
           dynamicQueryAI(param, res => {
             this.leftRecoList = res.Content[0].Points;
             this.leftRecoList = res.Content[0].Points;
             this.leftAI = !!this.leftRecoList.length
             this.leftAI = !!this.leftRecoList.length
           })
           })
         }, 800)
         }, 800)
-      }else{
+      } else {
         this.leftRecoList = []
         this.leftRecoList = []
         this.leftAI = false
         this.leftAI = false
       }
       }
@@ -466,7 +469,7 @@ export default {
     text-align: right;
     text-align: right;
   }
   }
   /deep/ .table-container {
   /deep/ .table-container {
-    height: calc(100% - 250px);
+    height: calc(100% - 160px);
     & > div {
     & > div {
       width: 49.5%;
       width: 49.5%;
       float: left;
       float: left;