| | |
| | | ,{field: 'id', title: '序号', sort: true} |
| | | ,{ field: 'name', title: '围栏名称'} |
| | | ,{field: 'pernum', title: '人员上限' } |
| | | ,{field: 'typec2', title: '是否静默'} |
| | | ,{field: 'redius', title: '聚集半径'} |
| | | ,{field: 'shichang', title: '聚集时长'} |
| | | ,{field: 'typec2', title: '是否静默',templet: '#titleTpl'} |
| | | ,{field: 'redius', title: '聚集半径/CM'} |
| | | ,{field: 'shichang', title: '聚集时长/S'} |
| | | ,{field: 'weixianpin', title: '危险品名称'} |
| | | ]] |
| | | ,limits: [10, 20, 30, 40, 50,60,70,80,90,100,100000] |
| | | ,limit: 20, |
| | | }); |
| | | $(document).on('click', '.layui-laypage a', function(){ |
| | | if (sessionStorage.getItem("YuYan") == "English"){ |
| | | setTimeout(function (){ |
| | | translate.execute() |
| | | },10) |
| | | } |
| | | }); |
| | | table.on('toolbar(juji)', function(obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | | console.log(obj) |
| | | var ds = "username="+sessionStorage.getItem("username") |
| | | var add = "Yes"; |
| | | var udelete = "Yes"; |
| | | var uupdate = "Yes"; |
| | | $.ajax({ |
| | | url: "/hxzkuwb/findUserRole", |
| | | type: "GET", |
| | | data:ds, |
| | | dataType: "json", |
| | | async: false, // 设置为同步 |
| | | success: function(data) { |
| | | if (data.uadd == "No") { |
| | | add = "No"; |
| | | } |
| | | if (data.udelete == "No") { |
| | | udelete = "No"; |
| | | } |
| | | if (data.uupdate == "No") { |
| | | uupdate = "No"; |
| | | } |
| | | } |
| | | }); |
| | | switch(obj.event) { |
| | | case 'getUpdate': |
| | | var data = checkStatus.data; |
| | | if(data.length>1){ |
| | | layer.alert("一次只能选中一个进行修改") |
| | | }else if(data.length == 0){ |
| | | layer.alert("请选中一条数据") |
| | | }else{ |
| | | $("#up1").val(data[0].id) |
| | | $("#up2").val(data[0].name) |
| | | $("#up3").val(data[0].pernum) |
| | | $("#up4").val(data[0].typec2) |
| | | $("#up5").val(data[0].redius) |
| | | $("#up6").val(data[0].shichang) |
| | | $("#up7").val(data[0].weixianpin) |
| | | $(".update").show(); |
| | | $(".heimu").show(); |
| | | if (uupdate == "Yes") { |
| | | var data = checkStatus.data; |
| | | if (data.length > 1) { |
| | | layer.alert("一次只能选中一个进行修改") |
| | | } else if (data.length == 0) { |
| | | layer.alert("请选中一条数据") |
| | | } else { |
| | | $("#up1").val(data[0].id) |
| | | $("#up2").val(data[0].name) |
| | | $("#up3").val(data[0].pernum) |
| | | $("#up5").val(data[0].redius) |
| | | $("#up6").val(data[0].shichang) |
| | | $("#up7").val(data[0].weixianpin) |
| | | $(".update").show(); |
| | | $(".heimu").show(); |
| | | } |
| | | } |
| | | break; |
| | | case 'getshuaxin': |