|
@@ -5,6 +5,9 @@
|
|
|
用户管理
|
|
|
<small>
|
|
|
<button type="button" class="btn btn-primary addUser" data-dismiss="modal">添加用户</button>
|
|
|
+ <button type="button" class="btn btn-warning" data-dismiss="modal" onclick="exportLog('all','')">全部导出</button>
|
|
|
+ <button type="button" class="btn btn-success" data-dismiss="modal" onclick="exportLog('audit','')">审核导出</button>
|
|
|
+ <button type="button" class="btn btn-danger" data-dismiss="modal" onclick="exportLog('repulse','')">打回导出</button>
|
|
|
</small>
|
|
|
</h1>
|
|
|
<ol class="breadcrumb">
|
|
@@ -13,98 +16,149 @@
|
|
|
</ol>
|
|
|
</section>
|
|
|
<section class="content">
|
|
|
- <div class="box">
|
|
|
-
|
|
|
+ <div class="box">
|
|
|
<!-- 模态框(Modal) -->
|
|
|
<div class="modal fade" id="myModal-addUser" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
|
- <div class="modal-dialog">
|
|
|
- <div class="modal-content">
|
|
|
+ <div class="modal-dialog">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
<div class="modal-header">
|
|
|
- <div class="modal-header">
|
|
|
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
- <div class="edit-form">
|
|
|
- <div class="edit-info">
|
|
|
- <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>
|
|
|
- <span class="info">添加用户<span>
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
+ <div class="edit-form">
|
|
|
+ <div class="edit-info">
|
|
|
+ <span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>
|
|
|
+ <span class="info">添加用户<span>
|
|
|
+ </div>
|
|
|
+ <form class="form-horizontal" role="form">
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="username" class="col-sm-2 control-label">用户名:</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="text" class="form-control" id="username" placeholder="请输入用户名">
|
|
|
+ </div>
|
|
|
+ <span class="usernameCheck hide check">用户名不能为空</span>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="relname" class="col-sm-2 control-label">真实姓名:</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="text" class="form-control" id="relname" placeholder="请输入用户名">
|
|
|
+ </div>
|
|
|
+ <span class="relnameCheck hide check">真实姓名不能为空</span>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="password" class="col-sm-2 control-label">密码:</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="text" class="form-control" id="password" placeholder="请输入密码">
|
|
|
+ </div>
|
|
|
+ <span class="passwordCheck hide check">密码不能为空</span>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="email" class="col-sm-2 control-label">邮箱:</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="email" class="form-control" id="email" placeholder="请输入邮箱">
|
|
|
+ </div>
|
|
|
+ <span class="emailCheck hide check">邮箱不能为空</span>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="auth" class="col-sm-2 control-label">权限:</label>
|
|
|
+ <div class="col-sm-10 checkbox-style">
|
|
|
+ <input type="radio" name="auth-box" class="auth" id="kfy" value="开发员">开发员</input>
|
|
|
+ <input type="radio" name="auth-box" class="auth" id="shy" value="审核员">审核员</input>
|
|
|
+ <input type="radio" name="auth-box" class="auth" id="gly" value="管理员">管理员</input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="identity" class="col-sm-2 control-label">身份:</label>
|
|
|
+ <div class="col-sm-10 checkbox-style">
|
|
|
+ <input type="radio" name="identity-box" class="identity" id="nbry" value="1">内部人员</input>
|
|
|
+ <input type="radio" name="identity-box" class="identity" id="wbry" value="0">外包人员</input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="platform" class="col-sm-2 control-label">身份:</label>
|
|
|
+ <div class="col-sm-10 checkbox-style">
|
|
|
+ <input type="radio" name="platform-box" class="identity" id="platform-lua" value="golua平台">golua平台</input>
|
|
|
+ <input type="radio" name="platform-box" class="identity" id="platform-python" value="python">python</input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="comeintime" class="col-sm-2 control-label">注册日期:</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="text" class="form-control" id="comeintime">
|
|
|
</div>
|
|
|
- <form class="form-horizontal" role="form">
|
|
|
- <div class="form-group">
|
|
|
- <label for="username" class="col-sm-2 control-label">用户名:</label>
|
|
|
- <div class="col-sm-10">
|
|
|
- <input type="text" class="form-control" id="username" placeholder="请输入用户名">
|
|
|
- </div>
|
|
|
- <span class="usernameCheck hide check">用户名不能为空</span>
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <label for="relname" class="col-sm-2 control-label">真实姓名:</label>
|
|
|
- <div class="col-sm-10">
|
|
|
- <input type="text" class="form-control" id="relname" placeholder="请输入用户名">
|
|
|
- </div>
|
|
|
- <span class="relnameCheck hide check">真实姓名不能为空</span>
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <label for="password" class="col-sm-2 control-label">密码:</label>
|
|
|
- <div class="col-sm-10">
|
|
|
- <input type="text" class="form-control" id="password" placeholder="请输入密码">
|
|
|
- </div>
|
|
|
- <span class="passwordCheck hide check">密码不能为空</span>
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <label for="email" class="col-sm-2 control-label">邮箱:</label>
|
|
|
- <div class="col-sm-10">
|
|
|
- <input type="email" class="form-control" id="email" placeholder="请输入邮箱">
|
|
|
- </div>
|
|
|
- <span class="emailCheck hide check">邮箱不能为空</span>
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <label for="auth" class="col-sm-2 control-label">权限:</label>
|
|
|
- <div class="col-sm-10 checkbox-style">
|
|
|
- <input type="radio" name="auth-box" class="auth" id="kfy" value="开发员">开发员</input>
|
|
|
- <input type="radio" name="auth-box" class="auth" id="shy" value="审核员">审核员</input>
|
|
|
- <input type="radio" name="auth-box" class="auth" id="gly" value="管理员">管理员</input>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <label for="comeintime" class="col-sm-2 control-label">注册日期:</label>
|
|
|
- <div class="col-sm-10">
|
|
|
- <input type="text" class="form-control" id="comeintime">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="form-group">
|
|
|
- <div class="col-sm-offset-2 col-sm-10 operateStyle">
|
|
|
- <input type="button" disabled="true" onclick="saveNewUser()" class="btn btn-primary saveBtn" value="保存">
|
|
|
- <input type="button" onclick="cancelAdd()" class="btn btn-default" value="取消">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <div class="col-sm-offset-2 col-sm-10 operateStyle">
|
|
|
+ <input type="button" disabled="true" onclick="saveNewUser()" class="btn btn-primary saveBtn" value="保存">
|
|
|
+ <input type="button" data-dismiss="modal" class="btn btn-default" value="取消">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div><!-- /.modal-content -->
|
|
|
- </div><!-- /.modal -->
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="box-body">
|
|
|
- <table id="user" class="table table-bordered table-striped">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div><!-- /.modal-content -->
|
|
|
+ </div><!-- /.modal -->
|
|
|
+ </div>
|
|
|
+ <div class="box-body">
|
|
|
+ <table id="user" class="table table-bordered table-striped">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th><input type="checkbox" id="selrow" onclick="selectrow(this)"/></th>
|
|
|
<th>编号</th>
|
|
|
- <th>姓名</th>
|
|
|
+ <th>用户</th>
|
|
|
<th>真实姓名</th>
|
|
|
+ <th>身份</th>
|
|
|
+ <th>权限</th>
|
|
|
+ <th>平台</th>
|
|
|
<th>密码</th>
|
|
|
- <th>用户id</th>
|
|
|
<th>邮箱</th>
|
|
|
- <th>权限</th>
|
|
|
- <th>注册时间</th>
|
|
|
- <th class="hidden-xs">操作</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- <!-- /.box-body -->
|
|
|
- </div>
|
|
|
+ <th class="hidden-xs">操作</th>
|
|
|
+ <th class="hidden-xs">导出</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <!-- /.box-body -->
|
|
|
+ </div>
|
|
|
</section>
|
|
|
</div>
|
|
|
+<div class="modal fade" id="auditexport" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
|
+ <div class="modal-dialog">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header">
|
|
|
+ <div class="modal-header">
|
|
|
+ <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
+ <div class="edit-form">
|
|
|
+ <div class="edit-info">
|
|
|
+ <span class="glyphicon glyphicon-export" style="margin-left:20px" aria-hidden="true"></span>
|
|
|
+ <span class="info">记录导出<span>
|
|
|
+ </div>
|
|
|
+ <form class="form-horizontal" role="form">
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="starttime" class="col-sm-2 control-label">起始日期:</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="text" class="form-control" id="starttime" placeholder="例:2024-01-01(含当天)">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="endtime" class="col-sm-2 control-label">截止日期:</label>
|
|
|
+ <div class="col-sm-10">
|
|
|
+ <input type="text" class="form-control" id="endtime" placeholder="例:2024-02-01(不含当天)">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <div class="col-sm-offset-2 col-sm-10 operateStyle">
|
|
|
+ <input type="button" onclick="exportRun()" class="btn btn-primary" value="导出">
|
|
|
+ <input type="button" data-dismiss="modal" class="btn btn-default" value="取消">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div><!-- /.modal-content -->
|
|
|
+ </div><!-- /.modal -->
|
|
|
+</div>
|
|
|
<!-- 模态框(Modal) -->
|
|
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
|
<div class="modal-dialog">
|
|
@@ -123,41 +177,47 @@
|
|
|
</div>
|
|
|
<script>
|
|
|
var focusO;
|
|
|
- var focusT;
|
|
|
-
|
|
|
+ var exportNames = [];
|
|
|
+ var exportType = ""
|
|
|
+ var dataid = "";
|
|
|
$(function(){
|
|
|
- var dataid = "";
|
|
|
ttable=$('#user').DataTable({
|
|
|
"language": {
|
|
|
- "url": "/js/dataTables.chinese.lang"
|
|
|
- },
|
|
|
+ "url": "/js/dataTables.chinese.lang"
|
|
|
+ },
|
|
|
"columnDefs": [
|
|
|
- { "orderable": false, "targets": 0 },
|
|
|
- { "orderable": false, "targets": 1 },
|
|
|
- { "orderable": false, "targets": 2 },
|
|
|
- { "orderable": false, "targets": 3 ,"bVisible": false},
|
|
|
- { "orderable": false, "targets": 4 ,"bVisible": false},
|
|
|
- { "orderable": false, "targets": 5 },
|
|
|
- { "orderable": false, "targets": 6 }
|
|
|
- ],
|
|
|
+ { "orderable": false, "targets": [0,1,2,6,7,8,9,10] } //设置列不可排序
|
|
|
+ ],
|
|
|
+ "order": [[3,"asc"]], //默认排序列
|
|
|
+ "iDisplayLength": 100,
|
|
|
"processing":true,
|
|
|
"serverSide": true,
|
|
|
- "searching": false,
|
|
|
- "ordering": false,
|
|
|
- "info": false,
|
|
|
-
|
|
|
+ "searching": true,
|
|
|
+ "ordering": true,
|
|
|
+ "info": true,
|
|
|
+ "paging": true,
|
|
|
+ "autoWidth": true,
|
|
|
"ajax": {
|
|
|
- "url": "/center/user.html",
|
|
|
- "type": "POST"
|
|
|
- },
|
|
|
+ "url": "/center/user.html",
|
|
|
+ "type": "POST"
|
|
|
+ },
|
|
|
"columns": [
|
|
|
- { "data": "num"},
|
|
|
- { "data": "s_name",sWidth:"15%"},
|
|
|
- { "data": "s_fullname"},
|
|
|
- { "data": "s_pass"},
|
|
|
- { "data": "userid"},
|
|
|
- { "data": "s_email",sWidth:"20%"},
|
|
|
- { "data": "i_auth",render:function(val){
|
|
|
+ { "data": "s_name",render:function(val,a,row){
|
|
|
+ if(row.s_platform != "golua平台" || row.i_auth != 1){
|
|
|
+ return "<input type='checkbox' disabled platform='"+row.s_platform+"' auth='"+row.i_auth+"' value='"+val+"'/>"
|
|
|
+ }
|
|
|
+ return "<input type='checkbox' platform='"+row.s_platform+"' auth='"+row.i_auth+"' value='"+val+"'/>"
|
|
|
+ }},
|
|
|
+ { "data": "num"},
|
|
|
+ { "data": "s_name"},
|
|
|
+ { "data": "s_fullname"},
|
|
|
+ { "data": "i_identity",render:function (val) {
|
|
|
+ if (val == 1){
|
|
|
+ return "内部人员";
|
|
|
+ }
|
|
|
+ return "外包人员";
|
|
|
+ }},
|
|
|
+ { "data": "i_auth",render:function(val){
|
|
|
if(val == 1){
|
|
|
val = "开发员";
|
|
|
return val;
|
|
@@ -170,27 +230,176 @@
|
|
|
val = "管理员";
|
|
|
return val;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}},
|
|
|
- { "data": "l_comeintime",sWidth:"15%"},
|
|
|
- { "data": "s_name",render:function(val,a,row){
|
|
|
+ { "data": "s_platform"},
|
|
|
+ { "data": "s_pass"},
|
|
|
+ { "data": "s_email"},
|
|
|
+ { "data": "s_name",render:function(val,a,row){
|
|
|
var div=$("<div><div class=\"btn-group\"></div></div>")
|
|
|
var buttonEdit=$('<a type="button" class="btn btn-sm btn-default">编辑</a>');
|
|
|
var buttonDel=$('<a type="button" class="btn btn-sm btn-default">删除</a>');
|
|
|
buttonDel.attr("onclick","del('"+row['userid']+"')");
|
|
|
- buttonEdit.attr("onclick","editUserInfo('"+row['s_name']+"','"+row['s_pass']+"','"+row['s_email']+"','"+row['i_auth']+"','"+row['userid']+"','"+row['l_comeintime']+"')");
|
|
|
+ buttonEdit.attr("onclick","editUserInfo('"+row['s_name']+"','"+row['s_pass']+"','"+row['s_email']+"','"+row['i_auth']+"','"+row['_id']+"','"+row['l_comeintime']+"','"+row['i_identity']+"','"+row['s_platform']+"')");
|
|
|
div.find(".btn-group").append(buttonEdit);
|
|
|
div.find(".btn-group").append(buttonDel);
|
|
|
return div.html()
|
|
|
- }}
|
|
|
- ]
|
|
|
+ }},
|
|
|
+ { "data": "s_name",render:function(val,a,row){
|
|
|
+ var div=$("<div><div class=\"btn-group\"></div></div>")
|
|
|
+ var allLog=$('<a type="button" class="btn btn-sm btn-warning">全部记录</a>');
|
|
|
+ var auditLog=$('<a type="button" class="btn btn-sm btn-success">审核记录</a>');
|
|
|
+ var repulseLog=$('<a type="button" class="btn btn-sm btn-danger">打回记录</a>');
|
|
|
+ repulseLog.attr("onclick","exportLog('repulse','"+row['s_name']+"')");
|
|
|
+ auditLog.attr("onclick","exportLog('audit','"+row['s_name']+"')");
|
|
|
+ allLog.attr("onclick","exportLog('all','"+row['s_name']+"')");
|
|
|
+ if(row.i_auth == 1 && row.s_platform == "golua平台"){
|
|
|
+ div.find(".btn-group").append(allLog);
|
|
|
+ div.find(".btn-group").append(auditLog);
|
|
|
+ div.find(".btn-group").append(repulseLog);
|
|
|
+ }
|
|
|
+ return div.html()
|
|
|
+ }},
|
|
|
+ ],
|
|
|
+ "fnServerParams": function (e) {
|
|
|
+ var platform = $("#platform").val();
|
|
|
+ var auth = $("#auth").val();
|
|
|
+ var identity = $("#identity").val();
|
|
|
+ if(platform){
|
|
|
+ e.s_platform = platform;
|
|
|
+ }else{
|
|
|
+ e.s_platform="-1";
|
|
|
+ }
|
|
|
+ if(auth){
|
|
|
+ e.i_auth = auth;
|
|
|
+ }else{
|
|
|
+ e.i_auth="-1";
|
|
|
+ }
|
|
|
+ if(identity){
|
|
|
+ e.i_identity = identity;
|
|
|
+ }else{
|
|
|
+ e.i_identity="-1";
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
+ common.setActive("index_yhgl");
|
|
|
+ ttable.on('init.dt', function () {
|
|
|
+ //平台
|
|
|
+ var platform="<div class='form-group'><label for='platform'>平台:</label>"+
|
|
|
+ "<select id='platform' onchange='checkclick(this.value)' class='form-control input-sm'>"+
|
|
|
+ "<option value='-1'>全部</option>"+
|
|
|
+ "<option value='golua平台'>golua平台</option>"+
|
|
|
+ "<option value='python'>python</option>"+
|
|
|
+ "</select></div>"
|
|
|
+ $("#user_filter").prepend(" ");
|
|
|
+ $("#user_filter").prepend(platform);
|
|
|
+ //权限
|
|
|
+ var auth="<div class='form-group'><label for='auth'>权限:</label>"+
|
|
|
+ "<select id='auth' onchange='checkclick(this.value)' class='form-control input-sm'>"+
|
|
|
+ "<option value='-1'>全部</option>"+
|
|
|
+ "<option value='1'>开发员</option>"+
|
|
|
+ "<option value='2'>审核员</option>"+
|
|
|
+ "<option value='3'>管理员</option>"+
|
|
|
+ "</select></div>"
|
|
|
+ $("#user_filter").prepend(" ");
|
|
|
+ $("#user_filter").prepend(auth);
|
|
|
+ //身份
|
|
|
+ var identity="<div class='form-group'><label for='identity'>身份:</label>"+
|
|
|
+ "<select id='identity' onchange='checkclick(this.value)' class='form-control input-sm'>"+
|
|
|
+ "<option value='-1'>全部</option>"+
|
|
|
+ "<option value='1'>内部人员</option>"+
|
|
|
+ "<option value='0'>外包人员</option>"+
|
|
|
+ "</select></div>"
|
|
|
+ $("#user_filter").prepend(" ");
|
|
|
+ $("#user_filter").prepend(identity);
|
|
|
+ });
|
|
|
})
|
|
|
+
|
|
|
+ function checkclick(val){
|
|
|
+ $("#selrow").prop('checked',false);
|
|
|
+ ttable.ajax.reload();
|
|
|
+ }
|
|
|
+ function selectrow(me){
|
|
|
+ var sel=$(me);
|
|
|
+ var isSelected=sel.prop('checked');
|
|
|
+ if(isSelected){
|
|
|
+ $("#user td input[type=checkbox][auth=1][platform='golua平台']").prop("checked",true);
|
|
|
+ }else{
|
|
|
+ $("#user td input[type=checkbox][auth=1][platform='golua平台']").prop("checked",false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //导出
|
|
|
+ function exportLog(t,u) {
|
|
|
+ var names=[];
|
|
|
+ if(u == ""){
|
|
|
+ $("#user td input[type=checkbox][auth=1][platform='golua平台']").each(function(){
|
|
|
+ if($(this).prop("checked")){
|
|
|
+ names.push($(this).val());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (names.length == 0){
|
|
|
+ alert("请选择要导出记录的人员!");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ names.push(u);
|
|
|
+ }
|
|
|
+ exportNames = names;
|
|
|
+ exportType = t;
|
|
|
+ $("#auditexport").modal("show");
|
|
|
+ }
|
|
|
+ //执行导出
|
|
|
+ function exportRun(){
|
|
|
+ var starttime = $("#starttime").val();
|
|
|
+ var endtime = $("#endtime").val();
|
|
|
+ var st = new Date(starttime).getTime();
|
|
|
+ var et = new Date(endtime).getTime();
|
|
|
+ if (et <= st){
|
|
|
+ alert("日期填写错误!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $("#auditexport").modal("hide");
|
|
|
+ $.ajax({
|
|
|
+ type:"post",
|
|
|
+ url:"/center/user/auditexport",
|
|
|
+ data:{"exportnames":exportNames.join(","),"exporttype":exportType,"starttime":starttime,"endtime":endtime},
|
|
|
+ xhrFields: { responseType: 'arraybuffer'},
|
|
|
+ success:function (r){
|
|
|
+ downloadFile(r, "爬虫审核记录")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function downloadFile(res, fileName) { // res为后端传来的文件流,// fileName为文件名称,自己根据实际情况赋值
|
|
|
+ if (!res) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (window.navigator.msSaveBlob) { // IE以及IE内核的浏览器
|
|
|
+ try {
|
|
|
+ window.navigator.msSaveBlob(res, fileName) // res为接口返回数据,这里请求的时候已经处理了,如果没处理需要在此之前自行处理var data = new Blob([res.data]) 注意这里需要是数组形式的,fileName就是下载之后的文件名
|
|
|
+ // window.navigator.msSaveOrOpenBlob(res, fileName); //此方法类似上面的方法,区别可自行百度
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let url = window.URL.createObjectURL(new Blob([res], {
|
|
|
+ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' // 前后端一定要同意utf-8编码,否则会是乱码
|
|
|
+ }));
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ link.setAttribute('download', fileName) // 文件名
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url) // 释放掉blob对象
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function del(data){
|
|
|
dataid = data;
|
|
|
$("#myModal").modal("show");
|
|
|
}
|
|
|
- function editUserInfo(name,password,email,auth,userid,comeintime){
|
|
|
+ function editUserInfo(name,password,email,auth,userid,comeintime,identity,platform){
|
|
|
$(".saveBtnClass").attr("disabled",false);
|
|
|
sessionStorage.setItem("self","n")
|
|
|
sessionStorage.setItem("userid",userid);
|
|
@@ -199,17 +408,21 @@
|
|
|
$(".edit-form #password").attr("readOnly","true");
|
|
|
$(".edit-form #email").val(email);
|
|
|
if(auth == 1){
|
|
|
- $("#shy").prop("checked",false);
|
|
|
- $("#gly").prop("checked",false);
|
|
|
- $("#kfy").prop("checked",true);
|
|
|
+ $("#myModal-edit #kfy").prop("checked",true);
|
|
|
}else if(auth == 2){
|
|
|
- $("#kfy").prop("checked",false);
|
|
|
- $("#gly").prop("checked",false);
|
|
|
- $("#shy").prop("checked",true);
|
|
|
+ $("#myModal-edit #shy").prop("checked",true);
|
|
|
+ }else{
|
|
|
+ $("#myModal-edit #gly").prop("checked",true);
|
|
|
+ }
|
|
|
+ if(identity == 1){
|
|
|
+ $("#myModal-edit #nbry").prop("checked",true);
|
|
|
}else{
|
|
|
- $("#kfy").prop("checked",false);
|
|
|
- $("#shy").prop("checked",false);
|
|
|
- $("#gly").prop("checked",true);
|
|
|
+ $("#myModal-edit #wbry").prop("checked",true);
|
|
|
+ }
|
|
|
+ if(platform == "golua平台"){
|
|
|
+ $("#myModal-edit #platform-lua").prop("checked",true);
|
|
|
+ }else{
|
|
|
+ $("#myModal-edit #platform-python").prop("checked",true);
|
|
|
}
|
|
|
$(".auth").prop("disabled",false);
|
|
|
$(".edit-form #auth").removeAttr("readOnly");
|
|
@@ -333,6 +546,8 @@
|
|
|
$("#myModal-addUser #email").val("");
|
|
|
$("#myModal-addUser .auth").attr("disabled",false);
|
|
|
$("#myModal-addUser #kfy").prop("checked",true);
|
|
|
+ $("#myModal-addUser #nbry").prop("checked",true);
|
|
|
+ $("#myModal-addUser #platform-lua").prop("checked",true);
|
|
|
$("#myModal-addUser #comeintime").val(date);
|
|
|
$("#myModal-addUser #comeintime").attr("readOnly",true);
|
|
|
$("#myModal-addUser").modal("show");
|
|
@@ -341,7 +556,7 @@
|
|
|
$(".relnameCheck").addClass("hide");
|
|
|
$(".emailCheck").addClass("hide");
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
//保存用户信息
|
|
|
function saveNewUser(){
|
|
|
$("#myModal-addUser").modal("hide");
|
|
@@ -350,9 +565,11 @@
|
|
|
var password = $("#myModal-addUser #password").val();
|
|
|
var email = $("#myModal-addUser #email").val();
|
|
|
var auth = $("input:radio[name='auth-box']:checked").val();
|
|
|
+ var identity = $("input:radio[name='identity-box']:checked").val();
|
|
|
+ var platform = $("input:radio[name='platform-box']:checked").val();
|
|
|
$.post(
|
|
|
"/center/user/saveNewUser",
|
|
|
- {"username":username,"relname":relname,"password":password,"email":email,"userAuth":auth},
|
|
|
+ {"username":username,"relname":relname,"password":password,"email":email,"userAuth":auth,"identity":identity,"platform":platform},
|
|
|
function(r){
|
|
|
if(r.status == "y"){
|
|
|
showTip("保存成功",1000);
|
|
@@ -423,10 +640,5 @@
|
|
|
})
|
|
|
return checkflagEmail;
|
|
|
}
|
|
|
-
|
|
|
- function cancelAdd(){
|
|
|
- $("#myModal-addUser").modal("hide");
|
|
|
- }
|
|
|
-
|
|
|
</script>
|
|
|
{{include "bottom.html"}}
|