From 6093145de266b53fa3ff9cdd3b8ae6a7376eab1e Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期一, 19 六月 2023 20:08:55 +0800
Subject: [PATCH] 定位
---
igds-app/js/admin/device-verb.js | 569 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 554 insertions(+), 15 deletions(-)
diff --git a/igds-app/js/admin/device-verb.js b/igds-app/js/admin/device-verb.js
index 1e1b484..093e821 100644
--- a/igds-app/js/admin/device-verb.js
+++ b/igds-app/js/admin/device-verb.js
@@ -1,23 +1,34 @@
var deviceData;
-var deviceList;
-var deptId;
-var depotId;
+var deptId; //搴撳尯缂栫爜
+var depotId; //浠撳簱缂栫爜
+var frontList = []; //浠撳簱姝i潰璁惧鍒楄〃
+var backList = []; //浠撳簱鍙嶉潰璁惧鍒楄〃
+var leftList = []; //浠撳簱宸︿晶闈㈣澶囧垪琛�
+var rightList = []; //浠撳簱鍙充晶闈㈣澶囧垪琛�
+var deviceDetail = {
+ "passCode": "",
+ "serId": "",
+ "location": "",
+ "type": "",
+ "status": ""
+}
+//璁惧鎺у埗
var data = {
- "interfaceId": "5403",
- "outId": "10403",
+ "interfaceId": "5402",
+ "outId": "10402",
"reqDateTime": new Date(),
"tokenAuth": "",
"data": [],
// {
// "deptId": "",
// "depotId": "",
- // "type": "01",
+ // "type": "",
// "passCode": "",
// "serId": "",
// "targetStatus": ""
// }
};
-
+//璁惧鍒楄〃
var data1 = {
"interfaceId": "5401",
"outId": "10401",
@@ -26,7 +37,7 @@
"data": {
"deptId": "",
"depotId": "",
- "type": "01", //椋庣獥
+ "type": "01", //椋庣獥
"type1": "02", //杞存祦椋庣獥
"type2": "04", //鐜祦椋庢満
"type3": "0B", //閫氶鍙�
@@ -50,12 +61,314 @@
depotId = self.depotId
// depotType = self.depotType
// depotName = self.depotName
+ getDeviceList();
}
-var slider = mui(".mui-slider");
-slider.slider({
- interval: 3000
-});
+//鑾峰彇璁惧鍒楄〃锛堥�氶锛�
+function getDeviceList() {
+ mui.ajax(url, {
+ type: "POST",
+ dataType: "json",
+ crossDomain: true,
+ contentType: "application/json;charset=utf-8",
+ data: JSON.stringify(data1),
+ success: function(result) {
+ if (result.code == "0000") {
+ deviceData = result.data;
+ renderDevice();
+ } else {
+ mui.toast(result.msg);
+ renderDevice();
+ }
+ },
+ error: function() {
+ mui.alert("绯荤粺绻佸繖,璇烽噸璇曪紒", "鎻愮ず", ["纭畾"], function() {}, "div")
+ }
+ })
+}
+
+//娓叉煋椤甸潰
+function renderDevice() {
+ var html = '';
+ if (deviceData) {
+ var deviceList = deviceData.listDevice;
+ if (deviceList && deviceList.length > 0) {
+ $.each(deviceList, function(index, item) {
+ if (item.location == '01') {
+ frontList.push(item)
+ } else if (item.location == '02') {
+ backList.push(item)
+ } else if (item.location == '03') {
+ leftList.push(item)
+ } else if (item.location == '04') {
+ 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) {
+ 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>'
+ 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">';
+ 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="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>'
+ 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">';
+ 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="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>'
+ 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>'
+ html += '</div></li>'
+ }
+ })
+ html += '</ul></div>'
+ }
+
+ } else {
+ 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>';
+ }
+ $("#recordList").html(html);
+
+}
+
+//璁惧鎿嶄綔璇锋眰
+function toControlDevice() {
+ mui.ajax(url, {
+ type: "POST",
+ dataType: "json",
+ crossDomain: true,
+ contentType: "application/json;charset=utf-8",
+ data: JSON.stringify(data),
+ success: function(result) {
+ if (result.code == "0000") {
+ window.setTimeout(function() {
+ renderDevice();
+ }, 200)
+ } else {
+ mui.alert(result.msg, "鎻愮ず", ["纭畾"], function() {}, "div")
+ }
+ },
+ error: function() {
+ mui.alert("绯荤粺绻佸繖,璇烽噸璇曪紒", "鎻愮ず", ["纭畾"], function() {}, "div")
+ }
+ })
+}
mui('.mui-scroll-wrapper').scroll({
indicators: false, //鏄惁鏄剧ず婊氬姩鏉�
@@ -63,22 +376,243 @@
bounce: false, //鏄惁鍚敤鍥炲脊
deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006
});
-
-//绌鸿皟鎿嶄綔
+//椋庣獥鍜岄�氶鍙e脊绐�
+mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .chuangkou", function() {
+ deviceDetail.passCode = this.getAttribute("passCode");
+ deviceDetail.serId = this.getAttribute("serId");
+ deviceDetail.location = this.getAttribute("location");
+ deviceDetail.type = this.getAttribute("type")
+ deviceDetail.status = this.getAttribute("status")
+ var name = this.getAttribute("name");
+ document.getElementById("Fname").innerText = name
+ $('#win_chuangkou').css('display', 'flex');
+});
+//鐜祦寮圭獥
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .huanliu", function() {
+ deviceDetail.passCode = this.getAttribute("passCode");
+ deviceDetail.serId = this.getAttribute("serId");
+ deviceDetail.location = this.getAttribute("location");
+ deviceDetail.status = this.getAttribute("status")
+ deviceDetail.type = '04'
+ var name = this.getAttribute("name");
+ document.getElementById("huanliuName").innerText = name
$('#win_huanliu').css('display', 'flex');
});
+//娣锋祦寮圭獥
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .hunliu", function() {
+ deviceDetail.passCode = this.getAttribute("passCode");
+ deviceDetail.serId = this.getAttribute("serId");
+ deviceDetail.location = this.getAttribute("location");
+ deviceDetail.status = this.getAttribute("status")
+ deviceDetail.type = "0C"
+ var name = this.getAttribute("name");
+ document.getElementById("hunliuName").innerText = name
$('#win_hunliu').css('display', 'flex');
});
+//杞存祦寮圭獥
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .zhouliu", function() {
+ deviceDetail.passCode = this.getAttribute("passCode");
+ deviceDetail.serId = this.getAttribute("serId");
+ deviceDetail.location = this.getAttribute("location");
+ deviceDetail.status = this.getAttribute("status")
+ deviceDetail.type = "02"
+ var name = this.getAttribute("name");
+ document.getElementById("zhouliuName").innerText = name
$('#win_zhouliu').css('display', 'flex');
});
+//鍔犲帇椋庢満寮圭獥
mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .jiaya", function() {
+ deviceDetail.passCode = this.getAttribute("passCode");
+ deviceDetail.serId = this.getAttribute("serId");
+ deviceDetail.location = this.getAttribute("location");
+ deviceDetail.status = this.getAttribute("status");
+ deviceDetail.type = "0D"
+ var name = this.getAttribute("name");
+ document.getElementById("zhouliuName").innerText = name
$('#win_jiaya').css('display', 'flex');
});
+//璁惧鎿嶄綔
mui(".m-pop").on("tap", ".inner a", function() {
- var id = this.getAttribute("id");
+ //鎵�杩涜鐨勬搷浣�
+ var targetStatus = this.getAttribute("targetStatus");
+
+ //濡傛灉鏄酱娴侀鏈猴紝鍏堟牴鎹鏈虹姸鎬佸垽鏂鏈烘搷浣滄槸鍚﹀彲浠ユ墽琛�
+ if (deviceDetail.type == '02') {
+ //椋庢満鐘舵�佷负椋庢満寮�椋庣獥寮�锛屽嵆F_OPEN鎴栬�匜_OPEN_F鏃讹紝涓嶈兘鎵ц鍏抽绐楁搷浣�
+ if ((deviceDetail.status == 'F_OPEN' || deviceDetail.status == 'F_OPEN_F') && targetStatus == 'CLOSE') {
+ mui.alert("姝ら鏈烘鍦ㄨ繍琛岋紝涓嶈兘鎵ц鍏抽棴椋庣獥鎿嶄綔锛�", "鎻愮ず", ["纭畾"], function() {}, "div")
+ return;
+ }
+ //椋庢満鐘舵�佷负椋庢満寮�椋庣獥寮�锛屽嵆F_OPEN鎴栬�匜_OPEN_F鏃讹紝涓嶈兘鎵ц椋庣獥鍏ㄥ叧鎿嶄綔
+ if ((deviceDetail.status == 'F_OPEN' || deviceDetail.status == 'F_OPEN_F') && targetStatus ==
+ 'W_CLOSE_ALL') {
+ mui.alert("姝ら鏈烘鍦ㄨ繍琛岋紝涓嶈兘鎵ц椋庣獥鍏ㄥ叧鎿嶄綔锛�", "鎻愮ず", ["纭畾"], function() {}, "div")
+ return;
+ }
+ //椋庢満鐘舵�佷负椋庢満鍏抽绐楀叧锛屽嵆W_CLOSE鏃讹紝涓嶈兘鎵ц寮�椋庢満鎿嶄綔
+ if (deviceDetail.status == 'W_CLOSE' && (targetStatus == 'F_CLOSE' || targetStatus == 'F_OPEN')) {
+ mui.alert("姝ら鏈虹殑椋庣獥鍏抽棴涓紝涓嶈兘鎵ц椋庢満鎿嶄綔锛�", "鎻愮ず", ["纭畾"], function() {}, "div")
+ return;
+ }
+ }
+ //濡傛灉鏄贩娴侀鏈猴紝鍏堝垽鏂鏈烘搷浣滄槸鍚﹀彲浠ユ墽琛�
+ if (deviceDetail.type == '0C') {
+ //椋庢満鐘舵�佷负椋庢満寮�椋庡彛寮�锛屽嵆F_OPEN鏃讹紝涓嶈兘鎵ц鍏抽鍙f搷浣�
+ if ((deviceDetail.status == 'F_OPEN_F' || deviceDetail.status == 'F_OPEN') && targetStatus == 'CLOSE') {
+ mui.alert("姝ら鏈烘鍦ㄨ繍琛岋紝涓嶈兘鎵ц鍏抽棴椋庡彛鎿嶄綔锛�", "鎻愮ず", ["纭畾"], function() {}, "div")
+ return;
+ }
+ //椋庢満鐘舵�佷负椋庢満寮�椋庣獥寮�锛屽嵆F_OPEN鏃讹紝涓嶈兘鎵ц椋庣獥鍏ㄥ叧鎿嶄綔
+ if ((deviceDetail.status == 'F_OPEN_F' || deviceDetail.status == 'F_OPEN') && targetStatus ==
+ 'W_CLOSE_ALL') {
+ mui.alert("姝ら鏈烘鍦ㄨ繍琛岋紝涓嶈兘鎵ц椋庡彛鍏ㄥ叧鎿嶄綔锛�", "鎻愮ず", ["纭畾"], function() {}, "div")
+ return;
+ }
+ //椋庢満鐘舵�佷负椋庢満鍏抽绐楀叧锛屽嵆W_CLOSE鏃讹紝涓嶈兘鎵ц寮�椋庣獥鎿嶄綔
+ if (deviceDetail.status == 'W_CLOSE' && (targetStatus == 'F_CLOSE' || targetStatus == 'F_OPEN' ||
+ targetStatus == 'F_OPEN_F')) {
+ mui.alert("姝ら鏈虹殑椋庡彛鍏抽棴涓紝涓嶈兘鎵ц椋庢満鎿嶄綔锛�", "鎻愮ず", ["纭畾"], function() {}, "div")
+ return;
+ }
+ //椋庢満鐘舵�佷负椋庢満寮�椋庣獥寮�锛屽嵆F_OPEN鏃讹紝涓嶈兘鎵ц鍙嶈浆鎿嶄綔
+ if (deviceDetail.status == 'F_OPEN' && targetStatus == 'F_OPEN_F') {
+ mui.alert("姝ら鏈烘杞姸鎬侊紝涓嶈兘鎵ц鍙嶈浆鎿嶄綔锛�", "鎻愮ず", ["纭畾"], function() {}, "div")
+ return;
+ }
+ //椋庢満鐘舵�佷负椋庢満寮�椋庣獥寮�锛屽嵆F_OPEN_F鏃讹紝涓嶈兘鎵ц姝h浆鎿嶄綔
+ if (deviceDetail.status == 'F_OPEN_F' && targetStatus == 'F_OPEN') {
+ mui.alert("姝ら鏈哄弽杞姸鎬侊紝涓嶈兘鎵ц姝h浆鎿嶄綔锛�", "鎻愮ず", ["纭畾"], function() {}, "div")
+ return;
+ }
+ }
+ //鍒ゆ柇鏄惁鏄壒閲�
+ var batchTag = false;
+ if (targetStatus == 'W_OPEN_ALL') {
+ targetStatus = 'OPEN';
+ batchTag = true;
+ }
+ if (targetStatus == 'W_CLOSE_ALL') {
+ targetStatus = 'CLOSE';
+ batchTag = true;
+ }
+ if (targetStatus == 'OPEN_ALL') {
+ targetStatus = 'OPEN';
+ batchTag = true;
+ }
+ if (targetStatus == 'CLOSE_ALL') {
+ targetStatus = 'CLOSE';
+ batchTag = true;
+ }
+
+ //浠撳簱鍓嶉潰
+ 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
+ })
+ }
+ }
+
+ //鍙戦�佹搷浣滆姹�
+ toControlDevice();
closePop();
});
@@ -89,4 +623,9 @@
$('.pop-bg,.m-pop .close').click(function(e) {
e.stopPropagation();
$('.m-pop').fadeOut();
+});
+
+var slider = mui(".mui-slider");
+slider.slider({
+ interval: 3000
});
\ No newline at end of file
--
Gitblit v1.9.3