From 4079d7cb73c84c1b080e2fbeb8a4d98da1129e06 Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期二, 23 十月 2018 13:42:35 +0800 Subject: [PATCH] 添加自己的告警框和提示框 --- gx_tieta/WebRoot/elegroup.jsp | 86 +++++++++++++++++++++++-------------------- 1 files changed, 46 insertions(+), 40 deletions(-) diff --git a/gx_tieta/WebRoot/elegroup.jsp b/gx_tieta/WebRoot/elegroup.jsp index c4a864c..0fc33d0 100644 --- a/gx_tieta/WebRoot/elegroup.jsp +++ b/gx_tieta/WebRoot/elegroup.jsp @@ -566,9 +566,9 @@ //console.info(data); var model=eval("("+data.result+")"); if(model.code==1){ - alert(model.msg); + layer.msg(model.msg); }else{ - alert(model.msg); + layer.msg(model.msg); } $('#lbottom .li-con ul').remove(); searchAllbaojiGroup(); @@ -577,10 +577,10 @@ $('#allShade').hide(); }); }else{ - alert('<s:text name="The_baoji_group_name_already_exists,Please_enter_a_different_set_of_names"/>!'); /* 璇ュ寘鏈虹粍鍚嶅凡缁忓瓨鍦�,璇疯緭鍏ュ叾浠栫粍鍚� */ + layer.msg('<s:text name="The_baoji_group_name_already_exists,Please_enter_a_different_set_of_names"/>!'); /* 璇ュ寘鏈虹粍鍚嶅凡缁忓瓨鍦�,璇疯緭鍏ュ叾浠栫粍鍚� */ } }else{ - alert('<s:text name="Can_not_be_empty"/>锛侊紒锛�'); /* 涓嶈兘涓虹┖ */ + layer.msg('<s:text name="Can_not_be_empty"/>锛侊紒锛�'); /* 涓嶈兘涓虹┖ */ } }); //鐐瑰嚮缂栬緫鎸夐挳缁欏綋鍓嶈娣诲姞class @@ -617,7 +617,7 @@ if(flag){ $.post('User_battgroup_baojigroupAction!update','us.baoji_group_id='+id+'&us.baoji_group_name='+txtVal,function(data){ var model=eval("("+data.result+")"); - alert(model.msg); + layer.msg(model.msg); $('#lbottom .li-con ul').remove(); searchAllbaojiGroup(); //闅愯棌閲嶅懡鍚嶇獥鍙� @@ -625,31 +625,32 @@ $('#allShade').hide(); }); }else{ - alert('<s:text name="The_baoji_group_name_already_exists,Please_enter_a_different_set_of_names"/>!'); /* 璇ュ寘鏈虹粍鍚嶅凡缁忓瓨鍦�,璇疯緭鍏ュ叾浠栫粍鍚� */ + layer.msg('<s:text name="The_baoji_group_name_already_exists,Please_enter_a_different_set_of_names"/>!'); /* 璇ュ寘鏈虹粍鍚嶅凡缁忓瓨鍦�,璇疯緭鍏ュ叾浠栫粍鍚� */ } }else{ - alert('<s:text name="Can_not_be_empty"/>锛侊紒锛�'); /* 涓嶈兘涓虹┖ */ + layer.msg('<s:text name="Can_not_be_empty"/>锛侊紒锛�'); /* 涓嶈兘涓虹┖ */ } }); //鐐瑰嚮鍒犻櫎鎸夐挳 $('#right-menu .del-group').live('click',function(){ var oLi=$('#lbottom .li-con li').eq(LiIndex); - if(confirm("<s:text name='Confirm_del'/>'"+oLi.text()+"'锛�")){ /* 纭鍒犻櫎鍖呮満缁� */ + // 鍙栦汉鍒犻櫎鍖呮満缁� + layer.confirm("<s:text name='Confirm_del'/>'"+oLi.text()+"'锛�", {icon:3, title: '绯荤粺鎻愮ず'}, function() { var baojigroupid=oLi.attr('value'); loading.showLoading(); $.post('User_battgroup_baojigroupAction!delete','us.baoji_group_id='+baojigroupid+"&us.baoji_group_name="+oLi.text(),function(data){ loading.hideLoading(); var model=eval("("+data.result+")"); if(model.code==1){ - alert(model.msg); + layer.msg(model.msg); }else{ - alert(model.msg); + layer.msg(model.msg); } $('#lbottom .li-con ul').remove(); searchAllbaojiGroup(); }); - } + }); }); }); @@ -770,19 +771,23 @@ $('#right-menu').on('click','.del-user',function(){ var ouserLi=$('#rbottom .li-con li').eq(LiIndex); var obaoLi=$('#lbottom .li-con li.b8cfe5'); - if(confirm('<s:text name="Determine"/><s:text name="From"/>:'+obaoLi.text()+'<s:text name="Delete"/>:'+ouserLi.text()+"?")){ //纭畾浠庡寘鏈虹粍 鍚�? - var num=ouserLi.attr('num'); - var temp = {num:num,uname:ouserLi.text(),baoji_group_name:obaoLi.text()}; - loading.showLoading(); - $.post('User_battgroup_baojigroup_usrAction!delete',"json="+JSON.stringify(temp),function(data){ - loading.hideLoading(); - var model=eval("("+data.result+")"); - alert(model.msg); - searchBaojiZuUser(obaoLi.attr('value')); + // 鎻愮ず鏄惁鍒犻櫎鍖呮満鐢ㄦ埛 + layer.confirm( + '<s:text name="Determine"/><s:text name="From"/>'+obaoLi.text()+'<s:text name="Delete"/>'+ouserLi.text()+"?", + {icon:3,title:'绯荤粺鎻愮ず'}, + function() { + var num=ouserLi.attr('num'); + var temp = {num:num,uname:ouserLi.text(),baoji_group_name:obaoLi.text()}; + loading.showLoading(); + $.post('User_battgroup_baojigroup_usrAction!delete',"json="+JSON.stringify(temp),function(data){ + loading.hideLoading(); + var model=eval("("+data.result+")"); + layer.msg(model.msg); + searchBaojiZuUser(obaoLi.attr('value')); + }); + //鍒犻櫎閫変腑鐨勮 + $('#rbottom .li-con li').eq(LiIndex).remove(); }); - //鍒犻櫎閫変腑鐨勮 - $('#rbottom .li-con li').eq(LiIndex).remove(); - } }); $('#right-menu').on('click','.apply',function(data){ @@ -806,14 +811,14 @@ //console.info(json); $.post('User_battgroup_baojigroup_usrAction!add',"json="+json,function(data){ var model=eval("("+data.result+")"); - alert(model.msg); + layer.msg(model.msg); var baojizuid=$('#lbottom .li-con li.b8cfe5').attr('value'); searchBaojiZuUser(baojizuid); // 闅愯棌绛夊緟妗� loading.hideLoading(); }); }else{ - alert('<s:text name="There_is_nothing_to_be_done"/>'); /* 娌℃湁浠�涔堝彲浠ュ仛鐨� */ + layer.msg('<s:text name="There_is_nothing_to_be_done"/>'); /* 娌℃湁浠�涔堝彲浠ュ仛鐨� */ } }); //鐐瑰嚮鏌ョ湅鍖呮満缁勬晥鏋� @@ -1412,7 +1417,7 @@ } }); }else{ - alert('璇烽�夋嫨鐪�!'); //璇峰厛閫夋嫨鐪� + layer.msg('璇烽�夋嫨鐪�!'); //璇峰厛閫夋嫨鐪� } }); @@ -1454,7 +1459,7 @@ } }); }else{ - alert('璇烽�夋嫨甯�!'); //璇峰厛閫夋嫨甯� + layer.msg('璇烽�夋嫨甯�!'); //璇峰厛閫夋嫨甯� } }); @@ -1490,7 +1495,7 @@ } }); }else{ - alert('<s:text name="Please_choose_a_group_of_battery_pack!"/>'); + layer.msg('<s:text name="Please_choose_a_group_of_battery_pack!"/>'); } }); //娣诲姞鏁翠釜鏈烘埧鐨勭數姹犵粍 @@ -1530,13 +1535,14 @@ } }); }else{ - alert('<s:text name="Please_select_a_set_of_Computer_room"/>!'); //璇峰厛閫夋嫨涓�缁勬満鎴� + layer.msg('<s:text name="Please_select_a_set_of_Computer_room"/>!'); //璇峰厛閫夋嫨涓�缁勬満鎴� } }); //鍒犻櫎褰撳墠鐨勮鐢垫睜缁� $('#tb-right-menu .del').click(function(){ var baojiLi=$('#lbottom .li-con li.b8cfe5'); - if(confirm('<s:text name="Confirm_that_the_selected_battery_pack_is_removed_from_the_package"/>锛�')){ + // 鏄惁纭鍒犻櫎鐢垫睜缁� + layer.confirm('<s:text name="Confirm_that_the_selected_battery_pack_is_removed_from_the_package"/>锛�',{icon:3, title: '绯荤粺鎻愮ず'},function() { var removeArray=new Array(); var redTr=$('#tbroom table .red'); //闇�瑕佸垽鏂槸鍚﹀惈鏈夋柊娣诲姞鐨勭數姹犵粍 @@ -1555,7 +1561,7 @@ $.post('User_battgroup_baojigroup_battgroupAction!delete','result='+json,function(data){ loading.hideLoading(); var model=eval("("+data.result+")"); - alert(model.msg); + layer.msg(model.msg); searchAllBattstation(baojiLi.attr('value')); }); bigEleGroupTxt=new Array(); @@ -1592,8 +1598,8 @@ removeLeftli(removeLi[i]); } getbattStationlength(); - } - } + } + }); }); //绉婚櫎宸﹁竟鍒楄〃涓璿alue='stationid'鐨刲i @@ -1633,13 +1639,13 @@ $.post('User_battgroup_baojigroup_battgroupAction!add','result='+json,function(data){ loading.hideLoading(); var model=eval("("+data.result+")"); - alert(model.msg); + layer.msg(model.msg); searchAllBattstation(baojiLi.attr('value')); bigEleGroupTxt=new Array(); bigEleGroupVal=new Array(); }); }else{ - alert('<s:text name="There_is_nothing_to_be_done"/>'); /* 娌℃湁浠�涔堝彲浠ュ仛鐨� */ + layer.msg('<s:text name="There_is_nothing_to_be_done"/>'); /* 娌℃湁浠�涔堝彲浠ュ仛鐨� */ } }); @@ -1714,7 +1720,7 @@ // 鏈烘埧鍒楄〃婊氬姩鍒伴《閮� scrollBottom($('#ltop .li-con'), $('#ltop .li-con ul')); }else { - alert('娣诲姞鐨勫唴瀹瑰凡瀛樺湪锛�'); + layer.msg('娣诲姞鐨勫唴瀹瑰凡瀛樺湪锛�'); } } @@ -1837,7 +1843,7 @@ $('#toolBtnAdd').click(function() { var baoji = $('#lbottom .li-con li.b8cfe5').text(); if(baoji.length == 0) { - alert('璇烽�夋嫨宸︿笅鏂圭殑鍖呮満缁勶紒锛侊紒'); + layer.msg('璇烽�夋嫨宸︿笅鏂圭殑鍖呮満缁勶紒锛侊紒'); }else { var addType = $('#addType').val(); addBattGroup(addType); @@ -1848,7 +1854,7 @@ $('#toolBtnApply').click(function() { var baoji = $('#lbottom .li-con li.b8cfe5').text(); if(baoji.length == 0) { - alert('璇烽�夋嫨宸︿笅鏂圭殑鍖呮満缁勶紒锛侊紒'); + layer.msg('璇烽�夋嫨宸︿笅鏂圭殑鍖呮満缁勶紒锛侊紒'); }else { $('#tb-right-menu .apply').click(); } @@ -1858,7 +1864,7 @@ $('#toolBtnAll').click(function() { var baoji = $('#lbottom .li-con li.b8cfe5').text(); if(baoji.length == 0) { - alert('璇烽�夋嫨宸︿笅鏂圭殑鍖呮満缁勶紒锛侊紒'); + layer.msg('璇烽�夋嫨宸︿笅鏂圭殑鍖呮満缁勶紒锛侊紒'); }else { $('#tb-right-menu .all-pitch').click(); } @@ -1868,7 +1874,7 @@ $('#toolBtnDel').click(function() { var baoji = $('#lbottom .li-con li.b8cfe5').text(); if(baoji.length == 0) { - alert('璇烽�夋嫨宸︿笅鏂圭殑鍖呮満缁勶紒锛侊紒'); + layer.msg('璇烽�夋嫨宸︿笅鏂圭殑鍖呮満缁勶紒锛侊紒'); }else { $('#tb-right-menu .del').click(); } -- Gitblit v1.9.1