Commit ada89979 authored by liyadong's avatar liyadong

update

parent 785a0098
This diff is collapsed.
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
.pa(); .pa();
left: .2rem; left: .2rem;
top: 0; top: 0;
.fs(.12rem, #74624e) .fs(.24rem, #74624e)
} }
em { em {
...@@ -296,7 +296,7 @@ ...@@ -296,7 +296,7 @@
text-align: center; text-align: center;
em{ em{
display: block; display: block;
.fs(.12rem,#74624e); .fs(.24rem,#74624e);
transform: scale(.7); transform: scale(.7);
margin-bottom: .02rem; margin-bottom: .02rem;
} }
...@@ -332,7 +332,7 @@ ...@@ -332,7 +332,7 @@
overflow: hidden; overflow: hidden;
span { span {
margin: 3.6rem auto; margin: 3.6rem 0 0 3.5rem;
display: block; display: block;
width: 1.79rem; width: 1.79rem;
height: .83rem; height: .83rem;
...@@ -522,7 +522,7 @@ ...@@ -522,7 +522,7 @@
padding-top: 2.8rem; padding-top: 2.8rem;
li { li {
padding: 0 .4rem .18rem 0; padding: 0 .4rem .19rem 0;
select { select {
height: .8rem; height: .8rem;
...@@ -536,7 +536,7 @@ ...@@ -536,7 +536,7 @@
-webkit-appearance:none; -webkit-appearance:none;
background: url("../images/arrow.png") no-repeat scroll right center transparent; background: url("../images/arrow.png") no-repeat scroll right center transparent;
background-size: .22rem; background-size: .22rem;
padding-right: .3rem; padding-right: .2rem;
option { option {
.fs(.42rem, #613937); .fs(.42rem, #613937);
......
...@@ -71,7 +71,8 @@ card.handleGetRoleList = function (params){ ...@@ -71,7 +71,8 @@ card.handleGetRoleList = function (params){
} }
html='<option value="-1">请选择</option>' html='<option value="-1">请选择</option>'
$(sArr).each(function (index,item){ $(sArr).each(function (index,item){
html+='<option value="'+item.id+'">'+item.name+'</option>'; var name = item.name.replace('硬核-','');
html+='<option value="'+item.id+'">'+name+'</option>';
}) })
$('.server-select').html(html); $('.server-select').html(html);
$('.loading').hide(); $('.loading').hide();
......
var card={relationRole:{},clickFlag:!0,bindInfo:{},bindFlag:!0};card.ajax=function(e,r){e.data._token=$('meta[name="token"]').attr("value"),$.ajax({type:e.type?e.type:"GET",url:location.origin+e.url,dataType:"json",data:e.data,error:function(e){try{var r=e.responseText;alert(r.message)}catch(e){alert("系统开小差~~")}},success:function(e){return 1019==e.error?(location.href="/login",!1):4003==e.error?(location.href="/bind/ald/code",!1):void r(e)}}),setTimeout(function(){card.clickFlag=!0},1e3)},card.handleGetServer=function(e){$(".loading").show(),this.ajax({url:"/ald_bind_info",type:"get",data:{}},function(e){card.bindInfo=e.data;var r={serverId:e.data.serverId,userId:e.data.userId};card.handleGetRoleList(r)})},card.handleGetRoleList=function(e){this.ajax({url:"/get_role_list",type:"POST",data:e},function(e){if(80001==e.error)return alert(e.message),!1;var r=e.data,t="",a=[];card.relationRole=r;for(var o in r)a.push({id:o,name:r[o].name});t='<option value="-1">请选择</option>',$(a).each(function(e,r){t+='<option value="'+r.id+'">'+r.name+"</option>"}),$(".server-select").html(t),$(".loading").hide(),$(".dialog-server").fadeIn()})},card.bindRole=function(e){card.bindFlag=!1,this.ajax({url:"/bind/ald/role",type:"POST",data:e},function(r){0===r.error?($(".dialog").hide(),location.href="/card/html?roleId="+e.roleId+"&serverId="+e.serverId):alert(r.msg)})};var initRoleList=function(e){var r=card.relationRole[e].list,t='<option value="-1">请选择</option>';$(r).each(function(e,r){t+='<option value="'+r.roleId+'">'+r.roleName+"</option>"}),$(".role-select").html(t)};$(function(){$(".btn-card-bind-role").click(function(){var e=$(".server-select option:selected").val(),r=$(".server-select option:selected").text(),t=$(".role-select option:selected").val();if(roleName=$(".role-select option:selected").text(),!e||"-1"==e)return alert("请选择服务器"),!1;if(!t||"-1"==t)return alert("请选择角色"),!1;var a={roleId:t,serverId:e,serverName:r,roleName:roleName};card.bindFlag&&(setTimeout(function(){card.bindFlag=!0},3e3),card.bindRole(a))}),$(".server-select").change(function(){var e=$(this).val();if(-1==e)return $(".role-select").html(""),!1;initRoleList(e)})}); var card={relationRole:{},clickFlag:!0,bindInfo:{},bindFlag:!0};card.ajax=function(e,r){e.data._token=$('meta[name="token"]').attr("value"),$.ajax({type:e.type?e.type:"GET",url:location.origin+e.url,dataType:"json",data:e.data,error:function(e){try{var r=e.responseText;alert(r.message)}catch(e){alert("系统开小差~~")}},success:function(e){return 1019==e.error?(location.href="/login",!1):4003==e.error?(location.href="/bind/ald/code",!1):void r(e)}}),setTimeout(function(){card.clickFlag=!0},1e3)},card.handleGetServer=function(e){$(".loading").show(),this.ajax({url:"/ald_bind_info",type:"get",data:{}},function(e){card.bindInfo=e.data;var r={serverId:e.data.serverId,userId:e.data.userId};card.handleGetRoleList(r)})},card.handleGetRoleList=function(e){this.ajax({url:"/get_role_list",type:"POST",data:e},function(e){if(80001==e.error)return alert(e.message),!1;var r=e.data,a="",t=[];card.relationRole=r;for(var o in r)t.push({id:o,name:r[o].name});a='<option value="-1">请选择</option>',$(t).each(function(e,r){var t=r.name.replace("硬核-","");a+='<option value="'+r.id+'">'+t+"</option>"}),$(".server-select").html(a),$(".loading").hide(),$(".dialog-server").fadeIn()})},card.bindRole=function(e){card.bindFlag=!1,this.ajax({url:"/bind/ald/role",type:"POST",data:e},function(r){0===r.error?($(".dialog").hide(),location.href="/card/html?roleId="+e.roleId+"&serverId="+e.serverId):alert(r.msg)})};var initRoleList=function(e){var r=card.relationRole[e].list,a='<option value="-1">请选择</option>';$(r).each(function(e,r){a+='<option value="'+r.roleId+'">'+r.roleName+"</option>"}),$(".role-select").html(a)};$(function(){$(".btn-card-bind-role").click(function(){var e=$(".server-select option:selected").val(),r=$(".server-select option:selected").text(),a=$(".role-select option:selected").val();if(roleName=$(".role-select option:selected").text(),!e||"-1"==e)return alert("请选择服务器"),!1;if(!a||"-1"==a)return alert("请选择角色"),!1;var t={roleId:a,serverId:e,serverName:r,roleName:roleName};card.bindFlag&&(setTimeout(function(){card.bindFlag=!0},3e3),card.bindRole(t))}),$(".server-select").change(function(){var e=$(this).val();if(-1==e)return $(".role-select").html(""),!1;initRoleList(e)})});
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment