Browse Source

Merge branch 'master' of http://192.168.0.115:3000/chenzhiguang/scene_wisdom

xzw 4 years ago
parent
commit
52b021b5a6
2 changed files with 31 additions and 24 deletions
  1. 29 22
      js/selectHardware.js
  2. 2 2
      js/showHardware.js

+ 29 - 22
js/selectHardware.js

@@ -85,29 +85,36 @@ $(function () {
     event.stopPropagation();
   })
 
-let getList = function(params) {
-		return new Promise((resolve, reject) => {
+  let getList = function (params) {
+    return new Promise((resolve, reject) => {
       $.ajax({
-        method: 'GET',
+        method: "POST",
+        data : JSON.stringify({
+          "devTypeId": "",
+          "name": "",
+          "pageNum": params.cPage,
+          "pageSize": params.pSize,
+          "searchKey": "",
+          "userId": ""
+        }),
         headers: {
-            'Content-Type': 'application/json'
+          "Content-Type": "application/json",
         },
-        dataType: 'json',
-        contentType: 'application/json',
-        url: url + 'api/device/list',
-        success: function(data) {
-          console.log(data);
-            if (data.code === 0) {
-					    resolve({
-                ...data,
-                totals:data.data.length
-              });
-            }
-            else {
-              reject(data);
-            }
-        }
-      })
-    })
-	};
+        dataType: "json",
+        contentType: "application/json",
+        url: url + "/api/device/listPage",
+
+        success: function (data) {
+          if (data.code == 0) {
+            resolve({
+              data:data.data.records,
+              totals: data.data.total,
+            });
+          } else {
+            reject(data);
+          }
+        },
+      });
+    });
+  };
 })

+ 2 - 2
js/showHardware.js

@@ -1,6 +1,6 @@
 $(function () {
-  // let url = ``;
-  let url = `http://192.168.0.135:8004`;
+  let url = ``;
+  // let url = `http://192.168.0.135:8004`;
 
   let gName = "Gridtable";
   let grtable = document.querySelector("#gridtb");