|
@@ -1,6 +1,6 @@
|
|
|
$(function () {
|
|
|
- let url = ``;
|
|
|
- // let url = `http://8.135.106.227:8004/`;
|
|
|
+ // let url = ``;
|
|
|
+ let url = `http://192.168.0.135:8004`;
|
|
|
|
|
|
let gName = "Gridtable";
|
|
|
let grtable = document.querySelector("#gridtb");
|
|
@@ -8,6 +8,7 @@ $(function () {
|
|
|
gridManagerName: gName,
|
|
|
height: "300px",
|
|
|
ajaxData: function (setting) {
|
|
|
+ console.log(setting.pageData,setting.sortData);
|
|
|
// 传入分页及排序的配置项
|
|
|
return getList(Object.assign({}, setting.pageData, setting.sortData));
|
|
|
},
|
|
@@ -15,6 +16,7 @@ $(function () {
|
|
|
supportCheckbox: false,
|
|
|
supportAjaxPage: true,
|
|
|
useNoTotalsMode: true,
|
|
|
+ pageSize:10,
|
|
|
columnData: [
|
|
|
{
|
|
|
key: "code",
|
|
@@ -70,18 +72,27 @@ $(function () {
|
|
|
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",
|
|
|
},
|
|
|
dataType: "json",
|
|
|
contentType: "application/json",
|
|
|
- url: url + "/api/device/list",
|
|
|
+ url: url + "/api/device/listPage",
|
|
|
+
|
|
|
success: function (data) {
|
|
|
- if (data.code === 0) {
|
|
|
+ if (data.code == 0) {
|
|
|
resolve({
|
|
|
- ...data,
|
|
|
- totals: data.data.length,
|
|
|
+ data:data.data.records,
|
|
|
+ totals: data.data.total,
|
|
|
});
|
|
|
} else {
|
|
|
reject(data);
|
|
@@ -93,25 +104,25 @@ $(function () {
|
|
|
|
|
|
window.changeDeviceStatus = function (item) {
|
|
|
console.log(item);
|
|
|
- // $.ajax({
|
|
|
-
|
|
|
- // method: "GET",
|
|
|
- // headers: {
|
|
|
- // "Content-Type": "application/json",
|
|
|
- // },
|
|
|
- // dataType: "json",
|
|
|
- // contentType: "application/json",
|
|
|
- // url: url + "/api/device/list",
|
|
|
- // success: function (data) {
|
|
|
- // if (data.code === 0) {
|
|
|
- // resolve({
|
|
|
- // ...data,
|
|
|
- // totals: data.data.length,
|
|
|
- // });
|
|
|
- // } else {
|
|
|
- // reject(data);
|
|
|
- // }
|
|
|
- // },
|
|
|
- // });
|
|
|
+ let tmp = item.infoAttribute.hardware
|
|
|
+ $.ajax({
|
|
|
+ method: "GET",
|
|
|
+ headers: {
|
|
|
+ "Content-Type": "application/json",
|
|
|
+ },
|
|
|
+ dataType: "json",
|
|
|
+ contentType: "application/json",
|
|
|
+ url: url + `/api/device/control/${tmp.id}/${tmp.deviceCode}/${paramValue}/03`,
|
|
|
+ success: function (data) {
|
|
|
+ if (data.code === 0) {
|
|
|
+ resolve({
|
|
|
+ ...data,
|
|
|
+ totals: data.data.length,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ reject(data);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
});
|