1. 在授权规则添加页面 通过js 给予用户输入提醒

pull/26/head
yumaojun 9 years ago
parent f863f4b7ae
commit a88ee0725d

@ -118,6 +118,37 @@
{% endblock %} {% endblock %}
{% block self_footer_js %} {% block self_footer_js %}
<script> <script>
$('#ruleForm').submit(function() {
var result = {}
var data = $(this).serializeArray();
$.each(data, function(i, field){
result[field.name] = field.value;
});
if (result['user'] || result['usergroup'] || result['asset'] || result['assetgroup'] || result['rulename'] || result['role']) {
if (result['rulename'] === '') {
alert("请添加授权名称")
return false
}
if (! result['user'] && ! result['usergroup']) {
alert("用户和用户组必选1个")
return false
}
if (! result['asset'] && ! result['assetgroup']) {
alert("资产和资产组必选1个")
return false
}
if (! result['role']) {
alert("请填写角色")
return false
}
return true
} else {
alert("请填必选项")
return false;
}
});
$(document).ready(function(){ $(document).ready(function(){
$("input.role").click(function(){ $("input.role").click(function(){
if($("input.role[value=GA]").is( ":checked" )){ if($("input.role[value=GA]").is( ":checked" )){

Loading…
Cancel
Save