jason.lu 6 years ago
parent
commit
afea30a62d
3 changed files with 1 additions and 133 deletions
  1. 0 96
      dapingmu.html
  2. 0 36
      js/lazhang-data.js
  3. 1 1
      js/newLazhang.js

+ 0 - 96
dapingmu.html

@@ -241,102 +241,6 @@
                 send_alert("下班操作成功! <a href='denglu.html'> 点击这里返回控制主页 </a>");
             };
             this.bind = function () {
-                $(".confirm-clear-data").click(function(){
-                    FlowRealTime.ClearDataControl.clearDataOfDeviceId($('#handInput').val());
-                });
-                $(".open-clear-panel").click(function () {
-                    FlowRealTime.UI.showClearPanel();
-                })
-                $(".close-schedule").click(function () {
-                    FlowRealTime.Action.confirmStopSchedule();
-                })
-            }
-        })(this);
-
-        var ClearDataControl = new (function (parent) {
-            this.p = parent;
-            this.finished = true;
-            this.executed = false;
-            this.directCount = -1;
-
-            this.clearDataOfDeviceId = function (handId) {
-                this.executed = false;
-                this.directCount = -1;
-                this.finished = true;
-                var hand = handId;
-                var hd = 0;
-                if (hand.length > 0) {
-                    hd = parseInt(hand);
-                }
-                get_data("endpoint/clearBoard?flowId=" + flowId + "&handheldId=" + hd, this.clearSuccess);
-            };
-
-            this.clearSuccess = function (obj, sta) {
-                console.warn("-------  手持设备清空  ----------");
-                console.warn(obj);
-                send_alert("发送清空请求成功, 正在等待采集端进行处理...");
-                this.finished = false;
-                setTimeout(this.resultVerifyTimeout, 8000, this);
-                setTimeout(this.getVerify, 300, this);
-            }
-
-            this.getVerify = function (obj) {
-                if (obj.finished) return;
-                get_data("endpoint/heartbeat?flowId=" + flowId, obj.onVerifyResult);
-                setTimeout(obj.getVerify, 100, obj);
-            };
-
-            this.onVerifyResult = function (obj, sta) {
-                var parsed = {};
-                if (typeof(obj) === "string") {
-                    parsed = JSON.parse(obj);
-                } else {
-                    parsed = obj;
-                }
-
-                if (typeof(parsed) === "object") {
-                    if (parsed.ret === "10000") {
-                        //ok
-                        if (parsed.model == null || parsed.model === undefined) {
-                            executed = true;
-                            finished = true;
-                        } else if (typeof(obj.model) === "object") {
-                            // 没有拿到,继续
-                            if (obj.model.list != null && obj.model.list.length > 0) {
-                                var direct = obj.model.list[0];
-                                if (direct.eventType + "" !== "500") {
-                                    // OK
-                                    executed = true;
-                                    finished = true;
-                                } else if (direct.arg2 + "" !== "" + $("#handInput").val()) {
-                                    // OK
-                                    executed = true;
-                                    finished = true;
-                                } else {
-                                    directCount = direct.counter;
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-
-            this.resultVerifyTimeout = function (obj) {
-                finished = true;
-                if (executed) {
-                    // 执行成功
-                } else {
-                    if (directCount >= 0) {
-                        get_data("endpoint/ack?counter=" + directCount, function () {
-                            console.log("撤销操作成功");
-                            console.log(this);
-                        });
-                        directCount = -1;
-                        send_alert("请求已经超时!请注意,采集端可能没有执行成功。即将撤销您的请求。");
-                    } else {
-                        send_alert("请求已经超时!请注意,采集端可能没有执行成功。");
-                    }
-                }
             }
         })(this);
 

+ 0 - 36
js/lazhang-data.js

@@ -122,47 +122,11 @@ function load_flows_history_realtime_data() {
     // 请注意type必须在结尾
     get_data("fcBiFlowDaily/list?flowId=" + flowId +"&type=1", history_success);
 }
-function get_stop_scheudle1() {
-    var out = confirm("真的要下班吗?");
-    if(out == true){
-        get_stop_scheudle();
-
-    }
-    else{
-
-    }
-}
-
-function show_clear_panel(){
-    $("#clearModal").modal('show');
-}
 
 var executed = false;
 var finished = true;
 var directCount = -1;
 
-function clear_one_data(){
-    executed = false;
-    directCount = -1;
-    finished = true;
-    var hand = $("#handInput").val();
-    var hd = 0;
-    if(hand.length > 0){
-       hd = parseInt(hand);
-    }
-    get_data("endpoint/clearBoard?flowId="+flowId+"&handheldId=" + hd, clearSuccess);
-}
-
-function clearSuccess(obj, sta){
-    console.warn("-------  手持设备清空  ----------");
-    console.warn(this);
-    send_alert("发送清空请求成功, 正在等待采集端进行处理...");
-    finished = false;
-    setTimeout(on_timeout_clear, 8000);
-    setTimeout(recurseget,300);
-    //var output = first_success(this, obj);
-}
-
 function recurseget(){
     if(finished) return;
     get_data("endpoint/heartbeat?flowId=" + flowId, onheart);

+ 1 - 1
js/newLazhang.js

@@ -91,7 +91,7 @@ var FlowRealTime = new (function () {
                     return;
                 }
             }
-            get_data("endpoint/clearBoard?flowId=" + flowId + "&handheldId=" + hd, this.clearSuccess);
+            get_data("endpoint/clearBoard?flowId=" + flowId + "&handheldId=" + hand, this.clearSuccess);
         };
 
         this.clearSuccess = function (obj, sta) {