Prechádzať zdrojové kódy

20250401 模拟器直连 里面的【重置】按钮

贾小兵 3 týždňov pred
rodič
commit
9dc282208a

+ 3 - 2
application/admin/view/simulator/index.html

@@ -52,8 +52,9 @@
                 <div class="form-group col-sm-4">
                     <div class="col-xs-12 col-sm-12">
                         <button type="button" class="btn btn-info btn-issued-fault">下发故障</button>
-                        <button type="button" class="btn btn-info btn-clear-fault" style="margin-left: 50px;">清除当前设备</button>
-                        <button type="button" class="btn btn-info btn-clearall-fault" style="margin-left: 50px;">清除所有设备</button>
+                        <button type="button" class="btn btn-info btn-clear-fault" style="margin-left: 30px;">清除当前设备</button>
+                        <button type="button" class="btn btn-info btn-clearall-fault" style="margin-left: 30px;">清除所有设备</button>
+                        <button type="button" class="btn btn-primary btn-reset-fault" style="margin-left: 30px;">重置</button>
                     </div>
                 </div>
                 <div class="form-group col-sm-8">

+ 22 - 0
public/assets/js/backend/simulator.js

@@ -115,6 +115,28 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart
                 });
             });
 
+            //重置功能,只需要请求地址即可
+            $(document).on("click", ".btn-reset-fault", function () {
+                var index =  Layer.load(2, {
+                    shade: [0.5,'#393D49'],
+                    content: '正在重置所有故障,请稍后...', // 这里是加载的文字
+                });
+                $.ajax({
+                    url: Config.url_type+"/sim/debug/debugResetAnything/",
+                    type: 'get',
+                    success: function (data) {
+                        console.log(data);
+                        if(data.code==200){
+                            $(".content").val(data.msg);
+                            Layer.close(index);
+                        }else{
+                            $(".content").val(data.msg);
+                            Layer.close(index);
+                        }
+                    }
+                });
+            });
+
             //只允许选择三个故障
             var rel_Ids = [];
             $(document).on('click', "input[type='checkbox']", function () {