haojianlong 5 лет назад
Родитель
Сommit
af0c8d79cd
2 измененных файлов с 44 добавлено и 86 удалено
  1. 6 0
      src/api/scan/request.js
  2. 38 86
      src/views/point/dynamicdata/addRelation/equipRela/index.vue

+ 6 - 0
src/api/scan/request.js

@@ -1056,4 +1056,10 @@ export function dynamicPointTypeList(param, success) {
 export function dynamicQueryPrompt(param, success) {
     let url = `${baseUrl}/pointconfig/dynamic/query-prompt`;
     http.postJson(url, param, success)
+}
+
+//动态数据关联-AI辅助
+export function dynamicQueryAI(param, success) {
+    let url = `${baseUrl}/pointconfig/dynamic/ai`;
+    http.postJson(url, param, success)
 }

+ 38 - 86
src/views/point/dynamicdata/addRelation/equipRela/index.vue

@@ -61,12 +61,11 @@
               <div v-for="(t,i) in leftRecoList" :key="t.id" class="l-ai-recom-item ai-recom-item" @click="selectAI(i,'l')">
                 <p>
                   <el-checkbox v-model="t.checked"></el-checkbox>
-                  <span>{{t.name2}}</span>
+                  <span>{{t.Proximity}}%</span>
                 </p>
-                <p>{{t.name}}</p>
-                <p>{{t.date}}</p>
-                <p>{{t.address}}</p>
-                <p>{{t.address}}</p>
+                <p>{{t.EquipmentMark}}</p>
+                <p>{{t.LocationFlag.toString()}}</p>
+                <!-- <p>{{t.address}}</p> -->
               </div>
             </div>
           </transition>
@@ -112,12 +111,12 @@
               <div v-for="(t,i) in rightRecoList" :key="t.id" class="r-ai-recom-item ai-recom-item" @click="selectAI(i,'r')">
                 <p>
                   <el-checkbox v-model="t.checked"></el-checkbox>
-                  <span>{{t.name2}}</span>
+                  <span>{{t.Proximity}}%</span>
                 </p>
-                <p>{{t.name}}</p>
-                <p>{{t.date}}</p>
-                <p>{{t.address}}</p>
-                <p>{{t.address}}</p>
+                <p>{{t.EquipLocalName}}</p>
+                <p>{{t.BuildLocalName}}-{{t.FloorLocalName}}</p>
+                <p>{{t.RoomLocalName}}</p>
+                <p>{{t.InstallLocation}}</p>
               </div>
             </div>
           </transition>
@@ -141,7 +140,8 @@ import {
   dynamicPendingPoint,
   dynamicCreateRelation,
   dynamicDeleteRelation,
-  dynamicPointTypeList
+  dynamicPointTypeList,
+  dynamicQueryAI
 } from "@/api/scan/request";
 export default {
   components: {
@@ -417,87 +417,39 @@ export default {
     lArray(n, o) {
       //先清空,返回结果后赋值
       this.rightRecoList = [];
-      //上->此赋值操作与 后台返回的值 异步问题
       clearTimeout(this.timer);
-      this.timer = setTimeout(() => {
-        console.log("函数节流");
-        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);
+      if(this.isSwitch&&n.length){
+        this.timer = setTimeout(() => {
+          let param = [{}]
+          param[0].Objs = n
+          dynamicQueryAI(param, res => {
+            this.rightRecoList = res.Content[0].Objs;
+            this.leftAI = !this.rightRecoList.length
+            console.log(this.rightRecoList)
+          })
+        }, 800)
+      }else{
+        this,rightRecoList = []
+        this.leftAI = true;
+      }
     },
     //AI辅助-右侧
     rArray(n, o) {
       this.leftRecoList = [];
       clearTimeout(this.timer);
-      this.timer = setTimeout(() => {
-        console.log("函数节流");
-        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);
+      if(this.isSwitch&&n.length){
+        this.timer = setTimeout(() => {
+          let param = [{}]
+          param[0].Points = n
+          dynamicQueryAI(param, res => {
+            this.leftRecoList = res.Content[0].Points;
+            this.leftAI = !!this.leftRecoList.length
+          })
+        }, 800)
+      }else{
+        this.leftRecoList = []
+        this.leftAI = false
+      }
     }
   }
 };