From 2df906a447195f9786dd468512ea895d6cc18532 Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期四, 15 五月 2025 14:53:54 +0800
Subject: [PATCH] APP3.5开发
---
igds-app/js/admin/device-verb.js | 650 ++++++++++++++++++++++++++++++----------------------------
1 files changed, 332 insertions(+), 318 deletions(-)
diff --git a/igds-app/js/admin/device-verb.js b/igds-app/js/admin/device-verb.js
index 093e821..66ed039 100644
--- a/igds-app/js/admin/device-verb.js
+++ b/igds-app/js/admin/device-verb.js
@@ -18,15 +18,15 @@
"outId": "10402",
"reqDateTime": new Date(),
"tokenAuth": "",
- "data": [],
- // {
- // "deptId": "",
- // "depotId": "",
- // "type": "",
- // "passCode": "",
- // "serId": "",
- // "targetStatus": ""
- // }
+ "data": {
+ "deptId": "",
+ "depotId": "",
+ "type": "",
+ "passCode": "",
+ "serId": "",
+ "targetStatus": "",
+ "batchTag":""
+ }
};
//璁惧鍒楄〃
var data1 = {
@@ -50,15 +50,18 @@
var user = JSON.parse(localStorage.getItem('user'));
var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId'));
- url = user.url + "/api-phone/v35/gateway";
+ url = user.url + "/api/phone/v35/gateway";
data.tokenAuth = user.tokenAuth;
data.data.deptId = user.deptId;
+ data1.data.deptId = user.deptId;
data1.tokenAuth = user.tokenAuth;
deptId = user.deptId;
//鑾峰彇浠庝笂涓�涓〉闈紶閫掔殑鏁版嵁
var self = plus.webview.currentWebview();
data.data.depotId = self.depotId
+ data1.data.depotId = self.depotId
depotId = self.depotId
+ console.log(depotId)
// depotType = self.depotType
// depotName = self.depotName
getDeviceList();
@@ -93,6 +96,10 @@
if (deviceData) {
var deviceList = deviceData.listDevice;
if (deviceList && deviceList.length > 0) {
+ frontList=[];
+ backList=[];
+ leftList=[];
+ rightList=[];
$.each(deviceList, function(index, item) {
if (item.location == '01') {
frontList.push(item)
@@ -104,231 +111,334 @@
rightList.push(item)
}
})
-
if (frontList && frontList.length > 0) { //浠撳簱姝i潰
html += '<div class="m-tf"><div class="g-tittf1">浠撳簱姝i潰</div><ul class="ul-listmana1 ullisttf1">';
$.each(frontList, function(index, item) {
+ targetStatus = item.status
+ if (item.type == '01') { //椋庣獥
+ html += '<li><div class="con myfancy chuangkou" status="' + item.status +
+ '" passCode="' + item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front" type="01">';
+ if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
+ html += '<div class="info in" style="background-image: url(images/e5.png);">'+ item.name +'</div>'
+ }else if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_01_CLOSE.png"></div>'
+ html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
+ }
+ html += '</div></li>'
+ } else if (item.type == '02') { //杞存祦椋庢満
+ html += '<li><div class="con myfancy zhouliu" status="'+ item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front">';
+ if(targetStatus == 'W_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_CLOSE.png"></div>'
+ }else if(targetStatus == 'W_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
+ }else if(targetStatus == 'F_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN.gif"></div>'
+ }else if(targetStatus == 'F_OPEN_F'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN_F.gif"></div>'
+ }else if(targetStatus == 'F_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
+ }
+ html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name +'</div>'
+ html += '</div></li>'
+ } else if (item.type == '04') { //鐜祦椋庢満
+ html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_04_ClOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_04_OPEN.gif"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ } else if (item.type == '0B') { //閫氶鍙�
+ html += '<li><div class="con myfancy chuangkou" status="' + item.status +
+ '" passCode="' +item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front" type="0B">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0B_CLOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
+ }
+ html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
+ html += '</div></li>'
+ } else if (item.type == '0C') { //娣锋祦椋庢満
+ html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
+ if(targetStatus == 'W_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_w_CLOSE.png"></div>'
+ }else if(targetStatus == 'F_OPEN_F'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN_F.gif"></div>'
+ }else if(targetStatus == 'F_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN.gif"></div>'
+ }else if(targetStatus == 'W_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_W_OPEN.png"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ } else if (item.type == '0D') { //鍔犲帇椋庢満
+ html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_CLOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_OPEN.png"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ }
+ })
+ html += '</ul></div>'
+ }
+ if (backList && backList.length > 0) { //浠撳簱鍙嶉潰
+ html += '<div class="m-tf"><div class="g-tittf1">浠撳簱鍙嶉潰</div><ul class="ul-listmana1 ullisttf1">';
+ $.each(frontList, function(index, item) {
+ targetStatus = item.status
+ if (item.type == '01') { //椋庣獥
+ html += '<li><div class="con myfancy chuangkou" status="' + item.status +
+ '" passCode="' + item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front" type="01">';
+ if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
+ html += '<div class="info in" style="background-image: url(images/e5.png);">'+ item.name +'</div>'
+ }else if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_01_CLOSE.png"></div>'
+ html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
+ }
+ html += '</div></li>'
+ } else if (item.type == '02') { //杞存祦椋庢満
+ html += '<li><div class="con myfancy zhouliu" status="'+ item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front">';
+ if(targetStatus == 'W_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_CLOSE.png"></div>'
+ }else if(targetStatus == 'W_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
+ }else if(targetStatus == 'F_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN.gif"></div>'
+ }else if(targetStatus == 'F_OPEN_F'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN_F.gif"></div>'
+ }else if(targetStatus == 'F_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
+ }
+ html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name +'</div>'
+ html += '</div></li>'
+ } else if (item.type == '04') { //鐜祦椋庢満
+ html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_04_ClOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_04_OPEN.gif"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ } else if (item.type == '0B') { //閫氶鍙�
+ html += '<li><div class="con myfancy chuangkou" status="' + item.status +
+ '" passCode="' +item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front" type="0B">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0B_CLOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
+ }
+ html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
+ html += '</div></li>'
+ } else if (item.type == '0C') { //娣锋祦椋庢満
+ html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
+ if(targetStatus == 'W_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_w_CLOSE.png"></div>'
+ }else if(targetStatus == 'F_OPEN_F'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN_F.gif"></div>'
+ }else if(targetStatus == 'F_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN.gif"></div>'
+ }else if(targetStatus == 'W_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_W_OPEN.png"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ } else if (item.type == '0D') { //鍔犲帇椋庢満
+ html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_CLOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_OPEN.png"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ }
+ })
+ html += '</ul></div>'
+ }
+ if (leftList && leftList.length > 0) { //浠撳簱宸︿晶闈�
+ html += '<div class="m-tf"><div class="g-tittf1">浠撳簱宸︿晶闈�</div><ul class="ul-listmana1 ullisttf1">';
+ $.each(frontList, function(index, item) {
+ targetStatus = item.status
+ if (item.type == '01') { //椋庣獥
+ html += '<li><div class="con myfancy chuangkou" status="' + item.status +
+ '" passCode="' + item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front" type="01">';
+ if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
+ html += '<div class="info in" style="background-image: url(images/e5.png);">'+ item.name +'</div>'
+ }else if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_01_CLOSE.png"></div>'
+ html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
+ }
+ html += '</div></li>'
+ } else if (item.type == '02') { //杞存祦椋庢満
+ html += '<li><div class="con myfancy zhouliu" status="'+ item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front">';
+ if(targetStatus == 'W_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_CLOSE.png"></div>'
+ }else if(targetStatus == 'W_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
+ }else if(targetStatus == 'F_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN.gif"></div>'
+ }else if(targetStatus == 'F_OPEN_F'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN_F.gif"></div>'
+ }else if(targetStatus == 'F_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
+ }
+ html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name +'</div>'
+ html += '</div></li>'
+ } else if (item.type == '04') { //鐜祦椋庢満
+ html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_04_ClOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_04_OPEN.gif"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ } else if (item.type == '0B') { //閫氶鍙�
+ html += '<li><div class="con myfancy chuangkou" status="' + item.status +
+ '" passCode="' +item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" location="front" type="0B">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0B_CLOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
+ }
+ html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
+ html += '</div></li>'
+ } else if (item.type == '0C') { //娣锋祦椋庢満
+ html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
+ if(targetStatus == 'W_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_w_CLOSE.png"></div>'
+ }else if(targetStatus == 'F_OPEN_F'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN_F.gif"></div>'
+ }else if(targetStatus == 'F_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN.gif"></div>'
+ }else if(targetStatus == 'W_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_W_OPEN.png"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ } else if (item.type == '0D') { //鍔犲帇椋庢満
+ html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_CLOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_OPEN.png"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
+ html += '</div></li>'
+ }
+ })
+ html += '</ul></div>'
+ }
+ if (rightList && rightList.length > 0) { //浠撳簱鍙充晶闈�
+ html += '<div class="m-tf"><div class="g-tittf1">浠撳簱鍙充晶闈�</div><ul class="ul-listmana1 ullisttf1">';
+ $.each(frontList, function(index, item) {
+ targetStatus = item.status
if (item.type == '01') { //椋庣獥
html += '<li><div class="con myfancy chuangkou" status="' + item.status +
'" passCode="' +
item.passCode + '" serId="' + item.serId + '"name="' + item.name +
'" location="front" type="01">';
- html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
- html += '<div class="info in" style="background-image: url(images/e3.png);">' + item
- .name +
- '</div>'
+ if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
+ html += '<div class="info in" style="background-image: url(images/e5.png);">'+ item.name +'</div>'
+ }else if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_01_CLOSE.png"></div>'
+ html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
+ }
html += '</div></li>'
} else if (item.type == '02') { //杞存祦椋庢満
- html += '<li><div class="con myfancy zhouliu" status="' + item.status + '" passCode="' +
+ html += '<li><div class="con myfancy zhouliu" status="'+ item.status + '" passCode="' +
item.passCode + '" serId="' + item.serId + '"name="' + item.name +
'" location="front">';
- html += '<div class="pic"><img src="images/d8.png"></div>'
- html += '<div class="info in" style="background-image: url(images/e4.png);">' + item
- .name +
- '</div>'
+ if(targetStatus == 'W_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_CLOSE.png"></div>'
+ }else if(targetStatus == 'W_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
+ }else if(targetStatus == 'F_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN.gif"></div>'
+ }else if(targetStatus == 'F_OPEN_F'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_F_OPEN_F.gif"></div>'
+ }else if(targetStatus == 'F_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_02_W_OPEN.png"></div>'
+ }
+ html += '<div class="info in" style="background-image: url(images/e3.png);">' + item.name +'</div>'
html += '</div></li>'
} else if (item.type == '04') { //鐜祦椋庢満
html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
item.passCode + '" serId="' + item.serId + '"name="' + item.name +
'" location="front">';
- html += '<div class="pic"><img src="images/d7.png"></div>'
- html += '<div class="info out" style="background-image: url(images/e5.png);"> ' + item
- .name + '</div>'
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_04_ClOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_04_OPEN.gif"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
html += '</div></li>'
} else if (item.type == '0B') { //閫氶鍙�
html += '<li><div class="con myfancy chuangkou" status="' + item.status +
- '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
+ '" passCode="' +item.passCode + '" serId="' + item.serId + '"name="' + item.name +
'" location="front" type="0B">';
- html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
- html += '<div class="info out" ' + item.name + '</div>'
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0B_CLOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
+ }
+ html += '<div class="info in" style="background-image: url(images/e3.png);">'+ item.name +'</div>'
html += '</div></li>'
} else if (item.type == '0C') { //娣锋祦椋庢満
html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="front">';
- html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
- html += '<div class="info full" style="background-image: url(images/e6.png);">' + item
- .name + '</div>'
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
+ if(targetStatus == 'W_CLOSE'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_w_CLOSE.png"></div>'
+ }else if(targetStatus == 'F_OPEN_F'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN_F.gif"></div>'
+ }else if(targetStatus == 'F_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_F_OPEN.gif"></div>'
+ }else if(targetStatus == 'W_OPEN'){
+ html += '<div class="pic"><img src="images/device-status/STATUS_0C_W_OPEN.png"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
html += '</div></li>'
} else if (item.type == '0D') { //鍔犲帇椋庢満
html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="front">';
- html += '<div class="pic pic1"><img src="images/d9.png"></div>'
- html += '<div class="info full" style="background-image: url(images/e7.png);">' + item
- .name + '</div>'
- html += '</div></li>'
- }
- })
- html += '</ul></div>'
- } else if (backList && backList.length > 0) { //浠撳簱鍙嶉潰
- html += '<div class="m-tf"><div class="g-tittf1">浠撳簱鍙嶉潰</div><ul class="ul-listmana1 ullisttf1">';
- $.each(backList, function(index, item) {
- if (item.type == '01') { //椋庣獥
- html += '<li><div class="con myfancy chuangkou" status="' + item.status +
- '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="back" type="01">';
- html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
- html += '<div class="info in" style="background-image: url(images/e3.png);">' + item
- .name +
- '</div>'
- html += '</div></li>'
- } else if (item.type == '02') { //杞存祦椋庢満
- html += '<li><div class="con myfancy zhouliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="back">';
- html += '<div class="pic"><img src="images/d8.png"></div>'
- html += '<div class="info in" style="background-image: url(images/e4.png);">' + item
- .name +
- '</div>'
- html += '</div></li>'
- } else if (item.type == '04') { //鐜祦椋庢満
- html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="back">';
- html += '<div class="pic"><img src="images/d7.png"></div>'
- html += '<div class="info out" style="background-image: url(images/e5.png);"> ' + item
- .name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0B') { //閫氶鍙�
- html += '<li><div class="con myfancy chuangkou" status="' + item.status +
- '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="back" type="0B">';
- html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
- html += '<div class="info out" ' + item.name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0C') { //娣锋祦椋庢満
- html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="back">';
- html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
- html += '<div class="info full" style="background-image: url(images/e6.png);">' + item
- .name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0D') { //鍔犲帇椋庢満
- html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="back">';
- html += '<div class="pic pic1"><img src="images/d9.png"></div>'
- html += '<div class="info full" style="background-image: url(images/e7.png);">' + item
- .name + '</div>'
- html += '</div></li>'
- }
- })
- html += '</ul></div>'
- } else if (leftList && leftList.length > 0) { //浠撳簱宸︿晶闈�
- html += '<div class="m-tf"><div class="g-tittf1">浠撳簱宸︿晶闈�</div><ul class="ul-listmana1 ullisttf1">';
- $.each(leftList, function(index, item) {
- if (item.type == '01') { //椋庣獥
- html += '<li><div class="con myfancy chuangkou" status="' + item.status +
- '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="left" type="01">';
- html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
- html += '<div class="info in" style="background-image: url(images/e3.png);">' + item
- .name +
- '</div>'
- html += '</div></li>'
- } else if (item.type == '02') { //杞存祦椋庢満
- html += '<li><div class="con myfancy zhouliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="left">';
- html += '<div class="pic"><img src="images/d8.png"></div>'
- html += '<div class="info in" style="background-image: url(images/e4.png);">' + item
- .name +
- '</div>'
- html += '</div></li>'
- } else if (item.type == '04') { //鐜祦椋庢満
- html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="left">';
- html += '<div class="pic"><img src="images/d7.png"></div>'
- html += '<div class="info out" style="background-image: url(images/e5.png);"> ' + item
- .name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0B') { //閫氶鍙�
- html += '<li><div class="con myfancy chuangkou" status="' + item.status +
- '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="left" type="0B">';
- html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
- html += '<div class="info out" ' + item.name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0C') { //娣锋祦椋庢満
- html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="left">';
- html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
- html += '<div class="info full" style="background-image: url(images/e6.png);">' + item
- .name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0D') { //鍔犲帇椋庢満
- html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="left">';
- html += '<div class="pic pic1"><img src="images/d9.png"></div>'
- html += '<div class="info full" style="background-image: url(images/e7.png);">' + item
- .name + '</div>'
- html += '</div></li>'
- }
- })
- html += '</ul></div>'
- } else if (rightList && rightList.length > 0) { //浠撳簱鍙充晶闈�
- html += '<div class="m-tf"><div class="g-tittf1">浠撳簱鍙充晶闈�</div><ul class="ul-listmana1 ullisttf1">';
- $.each(rightList, function(index, item) {
- if (item.type == '01') { //椋庣獥
- html += '<li><div class="con myfancy chuangkou" status="' + item.status +
- '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="right" type="01">';
- html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
- html += '<div class="info in" style="background-image: url(images/e3.png);">' + item
- .name +
- '</div>'
- html += '</div></li>'
- } else if (item.type == '02') { //杞存祦椋庢満
- html += '<li><div class="con myfancy zhouliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="right">';
- html += '<div class="pic"><img src="images/d8.png"></div>'
- html += '<div class="info in" style="background-image: url(images/e4.png);">' + item
- .name +
- '</div>'
- html += '</div></li>'
- } else if (item.type == '04') { //鐜祦椋庢満
- html += '<li><div class="con myfancy huanliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="right">';
- html += '<div class="pic"><img src="images/d7.png"></div>'
- html += '<div class="info out" style="background-image: url(images/e5.png);"> ' + item
- .name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0B') { //閫氶鍙�
- html += '<li><div class="con myfancy chuangkou" status="' + item.status +
- '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="right" type="0B">';
- html += '<div class="pic"><img src="images/device-status/STATUS_0B_OPEN.png"></div>'
- html += '<div class="info out" ' + item.name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0C') { //娣锋祦椋庢満
- html += '<li><div class="con myfancy hunliu" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="right">';
- html += '<div class="pic"><img src="images/device-status/STATUS_01_OPEN.png"></div>'
- html += '<div class="info full" style="background-image: url(images/e6.png);">' + item
- .name + '</div>'
- html += '</div></li>'
- } else if (item.type == '0D') { //鍔犲帇椋庢満
- html += '<li><div class="con myfancy jiaya" status="' + item.status + '" passCode="' +
- item.passCode + '" serId="' + item.serId + '"name="' + item.name +
- '" location="right">';
- html += '<div class="pic pic1"><img src="images/d9.png"></div>'
- html += '<div class="info full" style="background-image: url(images/e7.png);">' + item
- .name + '</div>'
+ item.passCode + '" serId="' + item.serId + '"name="' + item.name +'" location="front">';
+ if(targetStatus == 'CLOSE'){
+ html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_CLOSE.png"></div>'
+ }else if(targetStatus == 'OPEN'){
+ html += '<div class="pic pic1"><img src="images/device-status/STATUS_0D_OPEN.png"></div>'
+ }
+ html += '<div class="info out" style="background-image: url(images/e3.png);"> ' + item.name + '</div>'
html += '</div></li>'
}
})
@@ -336,9 +446,9 @@
}
} else {
- html +=
- '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤鏁版嵁</div></div>';
- }
+ html +=
+ '<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤鏁版嵁</div></div>';
+ }
} else {
html +=
'<div class="m-tf"><div class="g-tittf1" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤鏁版嵁</div></div>';
@@ -349,6 +459,7 @@
//璁惧鎿嶄綔璇锋眰
function toControlDevice() {
+ console.log(JSON.stringify(data))
mui.ajax(url, {
type: "POST",
dataType: "json",
@@ -503,114 +614,17 @@
targetStatus = 'CLOSE';
batchTag = true;
}
+console.log(batchTag);
- //浠撳簱鍓嶉潰
- if (deviceDetail.location == "front") {
- //鍙傛暟娓呯┖
- data.data = [];
- if (batchTag) { //鎵归噺鎿嶄綔
- $.each(frontList, function(index, item) {
- if (deviceDetail.type == item.type) {
- data.data.push({
- "deptId": deptId,
- "depotId": depotId,
- "passCode": item.passCode,
- "serId": item.serId,
- "type": item.type,
- "targetStatus": targetStatus
- })
- }
- })
- } else { //鍗曡澶囨搷浣�
- data.data.push({
- "deptId": deptId,
- "depotId": depotId,
- "passCode": deviceDetail.passCode,
- "serId": deviceDetail.serId,
- "type": deviceDetail.type,
- "targetStatus": targetStatus
- })
- }
- } else if (deviceDetail.location == "back") {
- //鍙傛暟娓呯┖
- data.data = [];
- if (batchTag) { //鎵归噺鎿嶄綔
- $.each(backList, function(index, item) {
- if (deviceDetail.type == item.type) {
- data.data.push({
- "deptId": deptId,
- "depotId": depotId,
- "passCode": item.passCode,
- "serId": item.serId,
- "type": item.type,
- "targetStatus": targetStatus
- })
- }
- })
- } else { //鍗曡澶囨搷浣�
- data.data.push({
- "deptId": deptId,
- "depotId": depotId,
- "passCode": deviceDetail.passCode,
- "serId": deviceDetail.serId,
- "type": deviceDetail.type,
- "targetStatus": targetStatus
- })
- }
- } else if (deviceDetail.location == "left") {
- //鍙傛暟娓呯┖
- data.data = [];
- if (batchTag) { //鎵归噺鎿嶄綔
- $.each(leftList, function(index, item) {
- if (deviceDetail.type == item.type) {
- data.data.push({
- "deptId": deptId,
- "depotId": depotId,
- "passCode": item.passCode,
- "serId": item.serId,
- "type": item.type,
- "targetStatus": targetStatus
- })
- }
- })
- } else { //鍗曡澶囨搷浣�
- data.data.push({
- "deptId": deptId,
- "depotId": depotId,
- "passCode": deviceDetail.passCode,
- "serId": deviceDetail.serId,
- "type": deviceDetail.type,
- "targetStatus": targetStatus
- })
- }
- } else if (deviceDetail.location == "right") {
- //鍙傛暟娓呯┖
- data.data = [];
- if (batchTag) { //鎵归噺鎿嶄綔
- $.each(rightList, function(index, item) {
- if (deviceDetail.type == item.type) {
- data.data.push({
- "deptId": deptId,
- "depotId": depotId,
- "passCode": item.passCode,
- "serId": item.serId,
- "type": item.type,
- "targetStatus": targetStatus
- })
- }
- })
- } else { //鍗曡澶囨搷浣�
- data.data.push({
- "deptId": deptId,
- "depotId": depotId,
- "passCode": deviceDetail.passCode,
- "serId": deviceDetail.serId,
- "type": deviceDetail.type,
- "targetStatus": targetStatus
- })
- }
- }
-
+ // //浠撳簱鍓嶉潰
+ data.data.deptId=deptId;
+ data.data.depotId=depotId;
+ data.data.passCode=deviceDetail.passCode;
+ data.data.serId=deviceDetail.serId;
+ data.data.targetStatus=targetStatus;
+ data.data.type=deviceDetail.type;
+ data.data.batchTag=batchTag;
+ console.log(JSON.stringify(data.data))
//鍙戦�佹搷浣滆姹�
toControlDevice();
--
Gitblit v1.9.3