Examination_system/Examination_system-1/.svn/pristine/21/21c617702d8afe6ff5c39ad615f...

274 lines
7.3 KiB
Plaintext

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html >
<html lang="en">
<head>
<%@include file="../baseset.jsp" %>
<%@include file="../systemset.jsp" %>
</head>
<style>
.center{
text-align :center;
}
.ui-state-focus{
display: none !important;
}
</style>
<body>
<div class="page-content">
<div class="row-fluid">
<div class="col-xs-12">
<form id="baseForm" class="form-inline" method="POST" onsubmit="return false;">
<div class="widget-header widget-header-large" style="padding:10px;">
<div class="widget-main customBtn" >
<!-- <span>字典类型名称:</span> -->
<input id="keyWord" type="text" name="keyWord" placeholder="请输入关键词..." />
<%-- <span>是否启用:</span>
<select name="isActive" id="isActive" style="width:10%;" class="js-example-basic-single form-control">
<option value="">请选择</option>
<c:forEach items="${judges}" var="judge">
<option value="${judge.id}" >${judge.name}</option>
</c:forEach>
</select> --%>
<button class="btn btn-success btn-sm" onclick="getbaseList(1)" id="search" title="查询" type="button">查询</button>
</div>
<div class="widget-toolbar customBtn">
<a title="增加" id="addBtn" onclick="addRole()" class="lrspace3" ><i class='icon-plus-sign color bigger-180'></i></a>
<!-- <a title="批量删除" id="delBatchBtn" onclick="batchDelete()" class="lrspace3" ><i class='icon-trash color-red bigger-180'></i></a> -->
<a title="刷新" id="searchBtn" onclick="getbaseList()" class="lrspace3" ><i class='icon-refresh bigger-180 orange'></i></a>
</div>
</div>
</form>
<table id="baseTable" class="table table-striped table-bordered table-hover" >
<thead>
<tr>
<th style="width:5%" class="center">
选择<!-- <label><input type="checkbox" class="ace" ><span class="lbl"></span></label> -->
</th>
<th style="width:5%" class="center">序号</th>
<th style="width:10%" class="center">名称</th>
<th style="width:10%" class="center">描述</th>
<th style="width:10%" class='center'>创建人</th>
<th style="width:10%" class="center">创建时间</th>
<th style="width:10%" class="center">备注</th>
<th style="width:10%" class="center">操作</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<%@include file="../dialog.jsp" %>
</div>
</div>
</div>
<script type="text/javascript">
/**
* @author 无畏
* @date 2019-05-24
* @function 启动执行
* @returns
*/
$(function () {
$.fn.modal.Constructor.prototype.enforceFocus = function(){};
$(".js-example-basic-single").select2({
"language": "zh-CN"
});
$("#baseForm").keydown(function(e) {
keycode = e.which || e.keyCode;
if (keycode == 13) {
search();
}
});
getbaseList(1);
});
/**
* @author 无畏
* @date 2019-06-25
* @function 图片上传
* @returns
*/
function upLoadImgs(id,flag){
if(flag == "poster"){
toImgsUpLoadPage(id,flag,flag,55);
}else if(flag == "actNotice"){
toImgsUpLoadPage(id,flag,flag,58);
}
}
/**
* @author 无畏
* @date 2019-05-26
* @function 条件查询
* @returns
*/
function search(){
$("#search").trigger("click")
}
/**
* @author 姜山
* @date 2019-08-16
* @function 初始化页面ajax请求 返回html页面
* @returns
*/
function getbaseList(init){
obj = {};
if(!JY.Object.notNull(init)){
init = $("#pageNum").val();
}
var size = $("#pageSize").val();
var data = {pageNum:init,pageSize:size};
data.obj = getObjParam("baseForm");
var idx = layer.msg('正在加载数据,请稍等...', {
icon: 16
,shade: 0.01
,time:'-1'
});
$.ajax({
type:"POST",
url:bonuspath +'/backstage/newRole/findByPage',
data: JSON.stringify(data),
contentType:"application/json",
dataType:"html",
success:function(data){
$("#baseTable tbody").html(data);
layer.close(idx);
}
})
}
/**
* @author 姜山
* @date 2019-08-04
* @function 逻辑删除采购任务
* @returns
*/
function del(id) {
JY.Model.confirm("确认删除吗?", function() {
JY.Ajax.doRequestPlus(null, bonuspath + '/backstage/newRole/del', {
id : id
}, function(data) {
JY.Model.info(data.resMsg, function() {
search();
});
});
});
}
/**
* @author 姜山
* @date 2019-08-16
* @function 新增角色
* @returns
*/
function addRole(){
var index = layer.open({
type: 2,
title: "新增角色",
shade: [0],
btn: ['保存', '取消'], //按钮组
area: ['60%', '55%'],
scrollbar: true,
anim: 2,
yes: function(index,layero){
var obj = $(layero).find("iframe")[0].contentWindow;
var valid = obj.formValid();
if(!valid){
return;
}
var role=obj.getInfo();
console.log(role);
$.ajax({
type:'POST',
url:bonuspath +'/backstage/newRole/add',
data:JSON.stringify(role),
contentType: "application/json",
success:function(data) {
data = JSON.parse(data);
console.log(data);
if(data.res == 1){
layer.msg(data.resMsg,{icon:1,time:1500},function(){
layer.close(index);
search();
});
}else{
layer.msg(data.resMsg,{icon:2,time:1500});
}
},
error:function(data){
layer.msg('请求发送失败',{icon:2,time:2000})
}
});
},
content: [bonuspath +'/backstage/newRole/toAddRole']
});
//layer.full(index);
}
/**
* @author 姜山
* @date 2019-06-26
* @function 修改员工信息
* @returns
*/
function updateRole(id){
var index = layer.open({
type: 2,
title:'修改信息',
shade: [0],
btn: ['保存', '取消'], //按钮组
area: ['40%', '45%'],
scrollbar: true,
anim: 2,
yes: function(index,layero){
var obj = $(layero).find("iframe")[0].contentWindow;
var valid = obj.formValid();
if(!valid){
return;
}
var role=obj.getInfo();
console.log(role);
$.ajax({
type:'POST',
url:bonuspath +'/backstage/newRole/update',
data:JSON.stringify(role),
contentType: "application/json",
success:function(data) {
data = JSON.parse(data);
if(data.res == 1){
layer.msg(data.resMsg,{icon:1,time:1500},function(){
layer.close(index);
search();
});
}else{
layer.msg(data.resMsg,{icon:2,time:1500});
}
},
error:function(data){
layer.msg('请求发送失败',{icon:2,time:2000})
}
});
},
content: [bonuspath +'/backstage/newRole/toRoleInfo?id='+id]
});
//layer.full(index);
}
</script>
</body>
</html>