no message

This commit is contained in:
2026-04-01 07:43:05 +08:00
parent f2387876f9
commit 1e3ac65d34
371 changed files with 49827 additions and 0 deletions

View File

@@ -0,0 +1,397 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta charset="UTF-8">
<title>班级列表</title>
<link rel="stylesheet" type="text/css" href="static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="static/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="static/easyui/css/demo.css">
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/js/validateExtends.js"></script>
<script type="text/javascript">
$(function() {
//datagrid初始化
$('#dataList').datagrid({
title:'班级列表',
iconCls:'icon-more',//图标
border: true,
collapsible: false,//是否可折叠的
fit: true,//自动大小
method: "post",
url:"ClazzServlet?method=getClazzList&t="+new Date().getTime(),
idField:'id',
singleSelect: false,//是否单选
pagination: true,//分页控件
rownumbers: true,//行号
sortName: 'id',
sortOrder: 'DESC',
remoteSort: false,
columns: [[
{field:'chk',checkbox: true,width:50},
{field:'id',title:'ID',width:50, sortable: true},
{field:'clazzName',title:'班级名称',width:200},
{field:'clazzs',title:'学级',width:100, },
{field:'clazzAds',title:'学届',width:100, },
{field:'userId',title:'责任人',width:100,
formatter: function(value,row,index){
if (row.userId){
var userList = $("#userList").combobox("getData");
for(var i=0;i<userList.length;i++ ){
if(row.userId == userList[i].id)return userList[i].name;
}
return row.userId;
} else {
return 'not found';
}
}
}
]],
toolbar: "#toolbar",
onBeforeLoad : function(){
try{
$("#userList").combobox("getData")
}catch(err){
preLoadUser();
}
}
});
function preLoadUser(){
$("#userList").combobox({
width: "150",
height: "25",
valueField: "id",
textField: "name",
multiple: false, //可多选
editable: false, //不可编辑
method: "post",
url: "UserServlet?method=GetUserForClazz",
onChange: function(newValue, oldValue){
}
});
}
//设置分页控件
var p = $('#dataList').datagrid('getPager');
$(p).pagination({
pageSize: 10,//每页显示的记录条数默认为10
pageList: [10,20,30,50,100],//可以设置每页记录条数的列表
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
//设置工具类按钮
$("#add").click(function(){
$("#addDialog").dialog("open");
});
//删除
$("#delete").click(function(){
var selectRows = $("#dataList").datagrid("getSelections");
var selectLength = selectRows.length;
if(selectLength == 0){
$.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
} else{
var clazzIds = [];
$(selectRows).each(function(i, row){
clazzIds[i] = row.id;
});
$.messager.confirm("消息提醒", "将删除班级信息(如果班级下存在学生则不能删除),确认继续?", function(r){
if(r){
$.ajax({
type: "post",
url: "ClazzServlet?method=DeleteClazz",
data: {clazzIds: clazzIds},
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","删除成功!","info");
//刷新表格
$("#dataList").datagrid("reload");
} else if(msg == "isHaveStudent"){
$.messager.alert("消息提醒","所选班级下存在学生,删除失败!","info");
return;
} else {
$.messager.alert("消息提醒","删除失败!","warning");
return;
}
}
});
}
});
}
});
//下拉框通用属性
$("#add_userList, #edit_userList").combobox({
width: "200",
height: "30",
valueField: "id",
textField: "name",
multiple: false, //可多选
editable: false, //不可编辑
method: "post",
});
$("#add_userList").combobox({
url: "UserServlet?method=GetUserForClazz",
onLoadSuccess: function(){
//默认选择第一条数据
var data = $(this).combobox("getData");;
$(this).combobox("setValue", data[0].id);
}
});
$("#edit_userList").combobox({
url: "UserServlet?method=GetUserForClazz",
onLoadSuccess: function(){
//默认选择第一条数据
var data = $(this).combobox("getData");
$(this).combobox("setValue", data[0].id);
}
});
//设置添加班级窗口
$("#addDialog").dialog({
title: "添加班级",
width: 650,
height: 400,
iconCls: "icon-add",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'添加',
plain: true,
iconCls:'icon-add',
handler:function(){
var validate = $("#addForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "ClazzServlet?method=AddClazz",
data: $("#addForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","添加成功!","info");
//关闭窗口
$("#addDialog").dialog("close");
//清空原表格数据
$("#add_userList").textbox('setValue', "");
$("#add_name").textbox('setValue', "");
$("#add_code").textbox('setValue', "");
$("#add_clazzs").textbox('setValue', "");
$("#add_clazzAds").textbox('setValue', "");
//刷新列表
$('#dataList').datagrid("reload");
} else {
$.messager.alert("消息提醒","添加失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-reload',
handler:function(){
$("#add_userList").textbox('setValue', "");
$("#add_name").textbox('setValue', "");
$("#add_code").textbox('setValue', "");
$("#add_clazzs").textbox('setValue', "");
$("#add_clazzAds").textbox('setValue', "");
}
},
]
});
//搜索按钮监听事件
$("#search-btn").click(function(){
$('#dataList').datagrid('load',{
clazzName: $('#clazzName').val(),
userId: $("#userList").combobox('getValue') == '' ? 0 : $("#userList").combobox('getValue')
});
});
//修改按钮监听事件
$("#edit-btn").click(function(){
var selectRow = $("#dataList").datagrid("getSelected");
//console.log(selectRow);
if(selectRow == null){
$.messager.alert("消息提醒", "请选择数据进行修改!", "warning");
return;
}
$("#editDialog").dialog("open");
});
//设置编辑班级窗口
$("#editDialog").dialog({
title: "编辑班级",
width: 650,
height: 400,
iconCls: "icon-add",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'确定修改',
plain: true,
iconCls:'icon-add',
handler:function(){
var validate = $("#editForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "ClazzServlet?method=EditClazz",
data: $("#editForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","修改成功!","info");
//关闭窗口
$("#editDialog").dialog("close");
//清空原表格数据
$("#edit_userList").textbox('setValue', "");
$("#edit_name").textbox('setValue', "");
$("#edit_code").textbox('setValue', "");
$("#edit_clazzs").textbox('setValue', "");
$("#edit_clazzAds").textbox('setValue', "");
//重新刷新页面数据
$('#dataList').datagrid("reload");
} else{
$.messager.alert("消息提醒","修改失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-reload',
handler:function(){
$("#edit_userList").textbox('setValue', "");
$("#edit_name").textbox('setValue', "");
$("#edit_code").textbox('setValue', "");
$("#edit_clazzs").textbox('setValue', "");
$("#edit_clazzAds").textbox('setValue', "");
}
},
],
onBeforeOpen: function(){
var selectRow = $("#dataList").datagrid("getSelected");
//设置值
$("#edit-id").val(selectRow.id);
$("#edit_name").textbox('setValue', selectRow.clazzName);
$("#edit_code").textbox('setValue', selectRow.clazzCode);
$("#edit_clazzs").textbox('setValue', selectRow.clazzs);
$("#edit_clazzAds").textbox('setValue', selectRow.clazzAds);
var userId = selectRow.userId;
setTimeout(function(){
$("#edit_userList").combobox('setValue', userId);
}, 100);
}
});
//清空搜索条件
$("#clear-btn").click(function(){
$('#dataList').datagrid("reload",{});
$("#userList").combobox('clear');
$("#clazzName").textbox('setValue', "");
});
});
</script>
</head>
<body>
<!-- 数据列表 -->
<table id="dataList" cellspacing="0" cellpadding="0">
</table>
<!-- 工具栏 -->
<div id="toolbar">
<c:if test="${roleCode == 'admin'}">
<div style="float: left;"><a id="add" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a></div>
<div style="float: left; margin-right: 10px;"><a id="edit-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a></div>
<div style="float: left; margin-right: 10px;"><a id="delete" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-some-delete',plain:true">删除</a></div>
</c:if>
<div style="float: left;margin-top:4px;" class="datagrid-btn-separator" >
&nbsp;&nbsp;班级名称:<input id="clazzName" class="easyui-textbox" name="clazzName" />
责任人:<input id="userList" class="easyui-textbox" name="userId" />
</div>
<div style="margin-top: 3px;">
<a id="search-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索</a>
<a id="clear-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">清空搜索</a>
</div>
</div>
<!-- 添加窗口 -->
<div id="addDialog" style="padding: 10px">
<form id="addForm" method="post">
<table cellpadding="8" >
<tr>
<td>责任人:</td>
<td><input id="add_userList" style="width: 200px; height: 30px;" class="easyui-textbox" name="userId" data-options="required:true, missingMessage:'请选择责任人'" /></td>
<td>班级名称:</td>
<td><input id="add_name" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="clazzName" data-options="required:true, missingMessage:'不能为空'" /></td>
</tr>
<tr>
<td>班级编码:</td>
<td><input id="add_code" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="clazzCode" data-options="required:true, missingMessage:'不能为空'" /></td>
<td>学级:</td>
<td><input id="add_clazzs" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="clazzs" data-options="required:true, missingMessage:'不能为空'" /></td>
</tr>
<tr>
<td>学届:</td>
<td><input id="add_clazzAds" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="clazzAds" data-options="required:true, missingMessage:'不能为空'" /></td>
</tr>
</table>
</form>
</div>
<!-- 编辑窗口 -->
<div id="editDialog" style="padding: 10px">
<form id="editForm" method="post">
<input type="hidden" id="edit-id" name="id">
<table cellpadding="8" >
<tr>
<td>责任人:</td>
<td><input id="edit_userList" style="width: 200px; height: 30px;" class="easyui-textbox" name="userId" data-options="required:true, missingMessage:'请选择责任人'" /></td>
<td>班级名称:</td>
<td><input id="edit_name" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="clazzName" data-options="required:true, missingMessage:'不能为空'" /></td>
</tr>
<tr>
<td>班级编码:</td>
<td><input id="edit_code" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="clazzCode" data-options="required:true, missingMessage:'不能为空'" /></td>
<td>学级:</td>
<td><input id="edit_clazzs" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="clazzs" data-options="required:true, missingMessage:'不能为空'" /></td>
</tr>
<tr>
<td>学届:</td>
<td><input id="edit_clazzAds" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="clazzAds" data-options="required:true, missingMessage:'不能为空'" /></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,290 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta charset="UTF-8">
<title>学分记录列表</title>
<link rel="stylesheet" type="text/css" href="static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="static/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="static/easyui/css/demo.css">
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/js/validateExtends.js"></script>
<script type="text/javascript">
$(function() {
//datagrid初始化
$('#dataList').datagrid({
title:'学分列表',
iconCls:'icon-more',//图标
border: true,
collapsible: false,//是否可折叠的
fit: true,//自动大小
method: "post",
url:"CreditRecordsServlet?method=CreditRecordsList&t="+new Date().getTime(),
idField:'id',
singleSelect: false,//是否单选
pagination: true,//分页控件
rownumbers: true,//行号
sortName:'id',
sortOrder:'DESC',
remoteSort: false,
columns: [[
{field:'chk',checkbox: true,width:50},
{field:'id',title:'ID',width:50, sortable: true},
{field:'number',title:'学号',width:120},
{field:'studentName',title:'学生',width:80},
{field:'userName',title:'操作人',width:80},
{field:'clazzName',title:'班级名称',width:80},
{field:'credit',title:'学分',width:80},
{field:'creditType',title:'增减范围',width:80,
formatter: function(value,row,index){
switch(row.creditType){
case '1':{
return '本周学分';
}
case '2':{
return '本科学分';
}
}
}
},
{field:'remark',title:'批注',width:300},
{field:'createTime',title:'操作时间',width:150,
formatter: function(value,row,index){
var date = row.createTime;
if (date){
return date.year + '-' + date.monthValue + '-' + date.dayOfMonth + ' ' + date.hour + ':' + date.minute;
} else {
return date;
}
}
}
]],
toolbar: "#toolbar"
});
//设置分页控件
var p = $('#dataList').datagrid('getPager');
$(p).pagination({
pageSize: 10,//每页显示的记录条数默认为10
pageList: [10,20,30,50,100],//可以设置每页记录条数的列表
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
//搜索按钮监听事件
$("#search-btn").click(function(){
$('#dataList').datagrid('load',{
studentName: $("#search_student_name").val(),
number: $("#search_number").val(),
clazzName: $("#search_clazz_name").val(),
creditType: $("#search_credit_type").combobox('getValue'),
startTime: $("#startTime").combobox('getValue'),
endTime: $("#endTime").combobox('getValue')
});
});
//清空搜索条件
$("#clear-btn").click(function(){
$('#dataList').datagrid("reload",{});
$("#search_student_name").textbox('setValue', "");
$("#search_number").textbox('setValue', "");
$("#search_clazz_name").textbox('setValue', "");
$("#search_credit_type").combobox('clear');
$("#startTime").textbox('setValue', "");
$("#endTime").textbox('setValue', "");
});
//设置工具类按钮
$("#add").click(function(){
$("#addDialog").dialog("open");
});
//设置添加窗口
$("#addDialog").dialog({
title: "学分增减变动",
width: 650,
height: 450,
iconCls: "icon-add",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'提交',
plain: true,
iconCls:'icon-book-add',
handler:function(){
var validate = $("#addForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "CreditRecordsServlet?method=AddCreditRecords",
data: $("#addForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","变动成功!","info");
//关闭窗口
$("#addDialog").dialog("close");
//刷新
$('#dataList').datagrid("reload");
} else{
$.messager.alert("消息提醒","变动失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-book-reset',
handler:function(){
$("#add_studentList").textbox('setValue', "");
$("#add_creditType").textbox('setValue', "");
$("#add_mathType").textbox('setValue', "");
$("#add_credit").textbox('setValue', "");
$("#add_remark").textbox('setValue', "");
}
},
]
});
//添加信息学生选择框
$("#add_studentList").combobox({
url: "StudentServlet?method=StudentList&t="+new Date().getTime()+"&from=combox",
onLoadSuccess: function(){
//默认选择第一条数据
var data = $(this).combobox("getData");
$(this).combobox("setValue", data[0].id);
}
});
//下拉框通用属性
$("#add_studentList").combobox({
width: "200",
height: "30",
valueField: "studentId",
textField: "name",
multiple: false, //不可多选
editable: true, //可编辑
method: "post",
limitToList: "true" //模糊搜索
});
//datebox开始时间限制结束时间datebox截止日期要比起始日期大
$("#startTime").datebox({
onSelect : function(beginDate){
$('#endTime').datebox().datebox('calendar').calendar({
validator: function(date){
return beginDate<date;
}
});
}
});
//导出按钮监听事件
$("#export").click(function(){
studentName = $("#search_student_name").val(),
number = $("#search_number").val(),
clazzName = $("#search_clazz_name").val(),
creditType = $("#search_credit_type").combobox('getValue'),
startTime = $("#startTime").combobox('getValue'),
endTime = $("#endTime").combobox('getValue')
url = 'CreditRecordsServlet?method=ExportCreditRecordsList&studentName='+studentName+"&number="+number+"&clazzName="+clazzName+"&creditType="+creditType+"&startTime="+startTime+"&endTime="+endTime;
window.location.href = url;
});
});
</script>
<script type="text/javascript">
function myformatter(date){
var y = date.getFullYear();
var m = date.getMonth()+1;
var d = date.getDate();
return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
}
function myparser(s){
if (!s) return new Date();
var ss = (s.split('-'));
var y = parseInt(ss[0],10);
var m = parseInt(ss[1],10);
var d = parseInt(ss[2],10);
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
return new Date(y,m-1,d);
} else {
return new Date();
}
}
</script>
</head>
<body>
<!-- 数据列表 -->
<table id="dataList" cellspacing="0" cellpadding="0"></table>
<!-- 工具栏 -->
<div id="toolbar">
<div style="float: left;"><a id="add" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<div style="margin-top: 3px;">
学生:<input id="search_student_name" class="easyui-textbox" name="studentName" />
学号:<input id="search_number" class="easyui-textbox" name="number" />
班级:<input id="search_clazz_name" class="easyui-textbox" name="clazzName" />
增减范围:
<select id="search_credit_type" class="easyui-combobox" name="creditType" style="width: 200px;">
<option value=""></option>
<option value="2">本科学分</option>
<option value="1">本周学分</option>
</select>
</div>
<br>
<div style="float: left;"><a id="export" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">导出</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<div>
日期:<input id="startTime" name="startTime" class="easyui-datebox" format="yyyy-MM-dd HH:mm:ss" timeFormat="HH:mm:ss" showTime="true" showOkButton="true" showClearButton="false" data-options="formatter:myformatter,parser:myparser"/>
<span style="width: 3% ; text-align: center">-</span>
<input id="endTime" name="endTime" class="easyui-datebox" format="yyyy-MM-dd HH:mm:ss" timeFormat="HH:mm:ss" showTime="true" showOkButton="true" showClearButton="false" data-options="formatter:myformatter,parser:myparser"/>
<a id="search-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索</a>
<a id="clear-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">清空搜索</a>
</div>
</div>
<!-- 添加学生窗口 -->
<div id="addDialog" style="padding: 10px">
<form id="addForm" method="post">
<table cellpadding="8" >
<tr>
<td>学生:</td>
<td><input style="width: 200px; height: 30px;" id="add_studentList" class="easyui-textbox" name="studentId" data-options="required:true, missingMessage:'请选择学生'" /></td>
<td>范围:</td>
<td>
<select style="width: 200px; height: 30px;" id="add_creditType" class="easyui-combobox" name="creditType" data-options="required:true, missingMessage:'请选择范围'" >
<option value="2">本科学分</option>
<option value="1">本周学分</option>
</select>
</td>
</tr>
<tr>
<td>增减:</td>
<td>
<select style="width: 200px; height: 30px;" id="add_mathType" class="easyui-combobox" name="mathType" data-options="required:true, missingMessage:'请选择增减'" >
<option value="1">减学分</option>
<option value="2">加学分</option>
</select>
</td>
<td>学分:</td>
<td><input id="add_credit" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="credit" validType="number" data-options="required:true, missingMessage:'请输入学分'" /></td>
</tr>
<tr>
<td>批复:</td>
<td colspan="2">
<textarea id="add_remark" name="remark" style="width: 300px; height: 160px;" class="easyui-textbox" data-options="multiline:true,required:true, missingMessage:'批复不能为空'" ></textarea>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,409 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta charset="UTF-8">
<title>请假列表</title>
<link rel="stylesheet" type="text/css" href="static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="static/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="static/easyui/css/demo.css">
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/js/validateExtends.js"></script>
<script type="text/javascript">
$(function() {
//datagrid初始化
$('#dataList').datagrid({
title:'请假列表',
iconCls:'icon-more',//图标
border: true,
collapsible: false,//是否可折叠的
fit: true,//自动大小
method: "post",
url:"LeaveServlet?method=LeaveList&t="+new Date().getTime(),
idField:'id',
singleSelect: false,//是否单选
pagination: true,//分页控件
rownumbers: true,//行号
sortName:'id',
sortOrder:'DESC',
remoteSort: false,
columns: [[
{field:'chk',checkbox: true,width:50},
{field:'id',title:'ID',width:50, sortable: true},
{field:'studentId',title:'学生',width:80,
formatter: function(value,row,index){
if (row.studentId){
var studentList = $("#studentList").combobox("getData");
for(var i=0;i<studentList.length;i++ ){
if(row.studentId == studentList[i].studentId)return studentList[i].name;
}
return row.studentId;
} else {
return 'not found';
}
}
},
{field:'info',title:'请假原因',width:300},
{field:'teacherId',title:'审批人',width:80,
formatter: function(value,row,index){
if (row.teacherId){
var teacherList = $("#teacherList").combobox("getData");
for(var i=0;i<teacherList.length;i++ ){
if(row.teacherId == teacherList[i].teacherId)return teacherList[i].name;
}
return row.teacherId;
} else {
return 'not found';
}
}
},
{field:'status',title:'状态',width:60,
formatter: function(value,row,index){
switch(row.status){
case '0':{
return '等待审核';
}
case '1':{
return '审核通过';
}
case '2':{
return '审核不通过';
}
}
}
},
{field:'remark',title:'批复内容',width:300},
{field:'applyTime',title:'申请时间',width:80,
formatter: function(value,row,index){
if (row.applyTime){
return row.applyTime.year + '-' + row.applyTime.monthValue + '-' + row.applyTime.dayOfMonth + ' ' + row.applyTime.hour + ':' + row.applyTime.minute;
} else {
return row.applyTime;
}
}
},
{field:'approveTime',title:'审批时间',width:80,
formatter: function(value,row,index){
if (row.approveTime){
return row.approveTime.year + '-' + row.approveTime.monthValue + '-' + row.approveTime.dayOfMonth + ' ' + row.approveTime.hour + ':' + row.approveTime.minute;
} else {
return row.approveTime;
}
}
}
]],
toolbar: "#toolbar",
onBeforeLoad : function(){
try{
$("#studentList").combobox("getData");
$("#teacherList").combobox("getData")
}catch(err){
preLoadStudent();
preLoadTeacher();
}
}
});
//提前加载学生信息
function preLoadStudent(){
$("#studentList").combobox({
width: "150",
height: "25",
valueField: "studentId",
textField: "name",
multiple: false, //不可多选
editable: true, //可编辑
method: "post",
limitToList: "true", //模糊搜索
url: "StudentServlet?method=StudentList&t="+new Date().getTime()+"&from=combox",
onChange: function(newValue, oldValue){
}
});
}
//提前加载教师信息
function preLoadTeacher(){
$("#teacherList").combobox({
width: "150",
height: "25",
valueField: "teacherId",
textField: "name",
multiple: false, //可多选
editable: false, //不可编辑
method: "post",
url: "LeaveServlet?method=ApproveTeacher&t="+new Date().getTime(),
onChange: function(newValue, oldValue){
}
});
}
//设置分页控件
var p = $('#dataList').datagrid('getPager');
$(p).pagination({
pageSize: 10,//每页显示的记录条数默认为10
pageList: [10,20,30,50,100],//可以设置每页记录条数的列表
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
//设置工具类按钮
$("#add").click(function(){
$("#addDialog").dialog("open");
});
//设置审核按钮
$("#check").click(function(){
var selectRows = $("#dataList").datagrid("getSelections");
if(selectRows.length != 1){
$.messager.alert("消息提醒", "请选择一条数据进行操作!", "warning");
} else{
if(selectRows[0].status != 0){
$.messager.alert("消息提醒", "该请假信息已被审核,请勿重复审核!", "warning");
return;
}
$("#checkDialog").dialog("open");
}
});
//审核请假信息
$("#checkDialog").dialog({
title: "审核请假信息",
width: 450,
height: 350,
iconCls: "icon-edit",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'提交',
plain: true,
iconCls:'icon-add',
handler:function(){
var validate = $("#checkForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "LeaveServlet?method=CheckLeave",
data: $("#editForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","审核成功!","info");
//关闭窗口
$("#checkDialog").dialog("close");
//清空原表格数据
$("#check_remark").textbox('setValue',"");
//重新刷新页面数据
$('#dataList').datagrid("reload");
$('#dataList').datagrid("uncheckAll");
} else{
$.messager.alert("消息提醒","审核失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-reload',
handler:function(){
$("#check_remark").textbox('setValue', "");
$("#check_statusList").textbox('setValue', "");
}
},
],
onBeforeOpen: function(){
var selectRow = $("#dataList").datagrid("getSelected");
$("#edit-id").val(selectRow.id);
$("#edit-studentId").val(selectRow.studentId);
},
onClose: function(){
$("#check_remark").val("");
}
});
//设置添加窗口
$("#addDialog").dialog({
title: "添加请假单",
width: 450,
height: 350,
iconCls: "icon-add",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'添加',
plain: true,
iconCls:'icon-book-add',
handler:function(){
var validate = $("#addForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "LeaveServlet?method=AddLeave",
data: $("#addForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","添加成功!","info");
//关闭窗口
$("#addDialog").dialog("close");
//清空原表格数据
//$("#add_name").textbox('setValue', "");
//刷新
$('#dataList').datagrid("reload");
} else{
$.messager.alert("消息提醒","添加失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-book-reset',
handler:function(){
$("#info").textbox('setValue', "");
}
},
]
});
//下拉框通用属性
$("#studentList").combobox({
width: "200",
height: "30",
valueField: "studentId",
textField: "name",
multiple: false, //不可多选
editable: true, //可编辑
method: "post",
limitToList: "true", //模糊搜索
});
$("#teacherList").combobox({
width: "200",
height: "30",
valueField: "teacherId",
textField: "name",
multiple: false, //不可多选
editable: false, //不可编辑
method: "post",
});
//搜索按钮监听事件
$("#search-btn").click(function(){
$('#dataList').datagrid('load',{
studentId: $("#studentList").combobox('getValue') == '' ? 0 : $("#studentList").combobox('getValue'),
teacherId: $("#teacherList").combobox('getValue') == '' ? 0 : $("#teacherList").combobox('getValue'),
status: $("#status").combobox('getValue')
});
});
//导出按钮监听事件
$("#export").click(function(){
studentId = $("#studentList").combobox('getValue') == '' ? 0 : $("#studentList").combobox('getValue'),
teacherId = $("#teacherList").combobox('getValue') == '' ? 0 : $("#teacherList").combobox('getValue'),
status = $("#status").combobox('getValue')
url = 'LeaveServlet?method=ExportLeaveList&studentId='+studentId+"&teacherId="+teacherId+"&status="+status;
window.location.href = url;
});
//清空搜索条件
$("#clear-btn").click(function(){
$('#dataList').datagrid("reload",{});
$("#studentList").combobox('clear');
$("#teacherList").combobox('clear');
$("#status").combobox('clear');
});
});
</script>
</head>
<body>
<!-- 数据列表 -->
<table id="dataList" cellspacing="0" cellpadding="0"></table>
<!-- 工具栏 -->
<div id="toolbar">
<c:if test="${roleCode == 'student'}">
<div style="float: left;"><a id="add" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
</c:if>
<c:if test="${roleCode == 'teacher' && isCounselor == 'y'}">
<div style="float: left;"><a id="check" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">审核</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
</c:if>
<div style="float: left;"><a id="export" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">导出</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<div style="margin-top: 3px;">
学生:<input id="studentList" class="easyui-textbox" name="studentId" />
审批人:<input id="teacherList" class="easyui-textbox" name="teacherId" />
审批状态:
<select id="status" class="easyui-combobox" name="status" style="width: 200px; height: 30px;">
<option value=""></option>
<option value="0">等待审核</option>
<option value="1">审核通过</option>
<option value="2">审核不通过</option>
</select>
<a id="search-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索</a>
<a id="clear-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">清空搜索</a>
</div>
</div>
<!-- 添加数据窗口 -->
<div id="addDialog" style="padding: 10px">
<form id="addForm" method="post">
<table cellpadding="8" >
<tr>
<td>请假原因:</td>
<td>
<textarea id="info" name="info" style="width: 300px; height: 160px;" class="easyui-textbox" data-options="multiline:true,required:true, missingMessage:'请假原因不能为空'" ></textarea>
</td>
</tr>
</table>
</form>
</div>
<!-- 审核数据窗口 -->
<div id="checkDialog" style="padding: 10px">
<form id="editForm" method="post">
<input type="hidden" id="edit-id" name="id">
<input type="hidden" id="edit-studentId" name="studentId">
<table cellpadding="8" >
<tr>
<td style="width:60px">审核:</td>
<td colspan="3">
<select id="check_statusList" style="width: 300px; height: 30px;" class="easyui-combobox" name="status" data-options="required:true, missingMessage:'请选择状态'" >
<option value="1">审核通过</option>
<option value="2">审核不通过</option>
</select>
</td>
</tr>
<tr>
<td>批复内容:</td>
<td>
<textarea id="check_remark" name="remark" style="width: 300px; height: 160px;" class="easyui-textbox" data-options="multiline:true" ></textarea>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,63 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>学生信息管理系统</title>
<link rel="stylesheet" href="static/css/login.css">
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="static/h-ui/lib/icheck/jquery.icheck.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
$(function(){
$("#submitBtn").click(function(){
var data = $("#loginForm").serialize();
$.ajax({
type: "post",
url: "LoginServlet?method=Login",
data: data,
dataType: "text", //返回数据类型
success: function(msg){
if("loginError" == msg){
alert("用户名或密码错误!");
} else if("loginSuccess" == msg){
window.location.href = "SystemServlet?method=toAdminView";
} else{
alert(msg);
}
}
});
});
})
</script>
</head>
<body>
<div class="login-container">
<h1 class="login-title">学生信息管理系统</h1>
<div style="color: #e74c3c; font-size: 18px; margin-top: 5px; ont-family: 'Microsoft YaHei', sans-serif;">
<%=request.getAttribute("msg") == null ? "" : request.getAttribute("msg")%>
</div>
<form id="loginForm" method="post">
<div class="form-group">
<label for="username">用户名</label>
<input type="text" id="username" name="username" placeholder="请输入用户名">
<div id="usernameError" class="error-message"></div>
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" id="password" name="password" placeholder="请输入密码">
<div id="passwordError" class="error-message"></div>
</div>
<div class="remember-me">
<input type="checkbox" id="remember" name="remember">
<label for="remember">记住我</label>
</div>
<button id="submitBtn" type="button" class="login-btn">登录</button>
</form>
</div>
<script src="static/js/login.js"></script>
</body>
</html>

View File

@@ -0,0 +1,147 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta charset="UTF-8">
<title>个人信息</title>
<link rel="stylesheet" type="text/css" href="static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="static/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="static/easyui/css/demo.css">
<style type="text/css">
.table th{font-weight:bold}
.table th,.table td{padding:8px;line-height:20px}
.table td{text-align:left}
.table-border{border-top:1px solid #ddd}
.table-border th,.table-border td{border-bottom:1px solid #ddd}
.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0}
.table-bordered th,.table-bordered td{border-left:1px solid #ddd}
.table-border.table-bordered{border-bottom:0}
.table-striped tbody > tr:nth-child(odd) > td,.table-striped tbody > tr:nth-child(odd) > th{background-color:#f9f9f9}
</style>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/js/validateExtends.js"></script>
<script type="text/javascript">
$(function() {
//修改密码窗口
$("#passwordDialog").dialog({
title: "修改密码",
width: 500,
height: 300,
iconCls: "icon-add",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'提交',
iconCls:'icon-user_add',
handler:function(){
var validate = $("#editPassword").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "SystemServlet?method=EditPasswod&t="+new Date().getTime(),
data: $("#editPassword").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","修改成功,将重新登录","info")
setTimeout(function(){
top.location.href = "LoginServlet?method=logout";
}, 1000);
}else{
$.messager.alert("消息提醒",msg,"error")
}
}
});
}
}
},
{
text:'重置',
iconCls:'icon-reload',
handler:function(){
//清空表单
$("#old_password").textbox('setValue', "");
$("#new_password").textbox('setValue', "");
$("#re_password").textbox('setValue', "");
}
}
],
})
//设置编辑学生窗口
$("#editDialog").dialog({
title: "修改密码",
width: 500,
height: 400,
fit: true,
modal: false,
noheader: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: false,
toolbar: [
{
text:'修改密码',
plain: true,
iconCls:'icon-password',
handler:function(){
$("#passwordDialog").dialog("open");
}
}
],
});
setTimeout(function(){
$("#passwordDialog").dialog("open");
},1000);
})
</script>
</head>
<body>
<div id="editDialog" style="padding: 20px;">
</div>
<!-- 修改密码窗口 -->
<div id="passwordDialog" style="padding: 20px">
<form id="editPassword">
<table cellpadding="8" >
<tr>
<td>原密码:</td>
<td>
<input id="old_password" name="password" style ="width: 200px; height: 30px;" class="easyui-textbox" type="password" data-options="required:true, missingMessage:'请输入原密码'" />
</td>
</tr>
<tr>
<td>新密码:</td>
<td>
<input id="new_password" style="width: 200px; height: 30px;" class="easyui-textbox" type="password" validType="password" name="newpassword" data-options="required:true, missingMessage:'请输入新密码'" />
</td>
</tr>
<tr>
<td>确认密码:</td>
<td><input id="re_password" style="width: 200px; height: 30px;" class="easyui-textbox" type="password" validType="equals['#new_password']" data-options="required:true, missingMessage:'再次输入密码'" /></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,557 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta charset="UTF-8">
<title>学生列表</title>
<link rel="stylesheet" type="text/css" href="static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="static/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="static/easyui/css/demo.css">
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/js/validateExtends.js"></script>
<script type="text/javascript">
$(function() {
//datagrid初始化
$('#dataList').datagrid({
title:'学生列表',
iconCls:'icon-more',//图标
border: true,
collapsible:false,//是否可折叠的
fit: true,//自动大小
method: "post",
url:"StudentServlet?method=StudentList&t="+new Date().getTime(),
idField:'studentId',
singleSelect:false,//是否单选
pagination:true,//分页控件
rownumbers:true,//行号
sortName:'studentId',
sortOrder:'DESC',
remoteSort: false,
columns: [[
{field:'chk',checkbox: true,width:50},
{field:'studentId',title:'ID',width:50, sortable: true},
{field:'number',title:'学号',width:150, sortable: true},
{field:'name',title:'姓名',width:80},
{field:'sex',title:'性别',width:50,
formatter: function(value,row,index){
if (row.sex == '0') {
return '男';
}
return '女';
}
},
{field:'phone',title:'联系方式',width:120},
{field:'birthday',title:'生日',width:130},
{field:'major',title:'专业',width:100},
{field:'honor',title:'荣誉',width:150},
{field:'scoreNow',title:'本周学分',width:80},
{field:'clazzId',title:'班级',width:130,
formatter: function(value,row,index){
if (row.clazzId){
var clazzList = $("#clazzList").combobox("getData");
for(var i=0;i<clazzList.length;i++ ){
if(row.clazzId == clazzList[i].id)return clazzList[i].clazzName;
}
return row.clazzId;
} else {
return 'not found';
}
}
},
]],
toolbar: "#toolbar",
onBeforeLoad : function(){
try{
$("#clazzList").combobox("getData")
}catch(err){
preLoadClazz();
}
}
});
//设置分页控件
var p = $('#dataList').datagrid('getPager');
$(p).pagination({
pageSize: 10,//每页显示的记录条数默认为10
pageList: [10,20,30,50,100],//可以设置每页记录条数的列表
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
//设置工具类按钮
$("#add").click(function(){
$("#addDialog").dialog("open");
});
//修改
$("#edit").click(function(){
var selectRows = $("#dataList").datagrid("getSelections");
if(selectRows.length != 1){
$.messager.alert("消息提醒", "请选择一条数据进行操作!", "warning");
} else{
$("#editDialog").dialog("open");
}
});
//删除
$("#delete").click(function(){
var selectRows = $("#dataList").datagrid("getSelections");
var selectLength = selectRows.length;
if(selectLength == 0){
$.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
} else{
var numbers = [];
$(selectRows).each(function(i, row){
numbers[i] = row.sn;
});
var studentIds = [];
$(selectRows).each(function(i, row){
studentIds[i] = row.studentId;
});
var userIds = [];
$(selectRows).each(function(i, row){
userIds[i] = row.userId;
});
$.messager.confirm("消息提醒", "将删除与学生相关的所有数据(包括成绩),确认继续?", function(r){
if(r){
$.ajax({
type: "post",
url: "StudentServlet?method=DeleteStudent",
data: {userIds: userIds, studentIds: studentIds},
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","删除成功!","info");
//刷新表格
$("#dataList").datagrid("reload");
$("#dataList").datagrid("uncheckAll");
} else{
$.messager.alert("消息提醒","删除失败!","warning");
return;
}
}
});
}
});
}
});
function preLoadClazz(){
$("#clazzList").combobox({
width: "150",
height: "25",
valueField: "id",
textField: "clazzName",
multiple: false, //可多选
editable: false, //不可编辑
method: "post",
url: "ClazzServlet?method=getClazzList&t="+new Date().getTime()+"&from=combox",
onChange: function(newValue, oldValue){
}
});
}
//下拉框通用属性
$("#add_clazzList, #edit_clazzList").combobox({
width: "200",
height: "30",
valueField: "id",
textField: "clazzName",
multiple: false, //可多选
editable: false, //不可编辑
method: "post",
});
$("#add_clazzList").combobox({
url: "ClazzServlet?method=getClazzList&t="+new Date().getTime()+"&from=combox",
onLoadSuccess: function(){
//默认选择第一条数据
var data = $(this).combobox("getData");;
$(this).combobox("setValue", data[0].id);
}
});
$("#edit_clazzList").combobox({
url: "ClazzServlet?method=getClazzList&t="+new Date().getTime()+"&from=combox",
onLoadSuccess: function(){
//默认选择第一条数据
var data = $(this).combobox("getData");
$(this).combobox("setValue", data[0].id);
}
});
//设置添加学生窗口
$("#addDialog").dialog({
title: "添加学生",
width: 650,
height: 460,
iconCls: "icon-add",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'添加',
plain: true,
iconCls:'icon-user_add',
handler:function(){
var validate = $("#addForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
var clazzid = $("#add_clazzList").combobox("getValue");
$.ajax({
type: "post",
url: "StudentServlet?method=AddStudent",
data: $("#addForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","添加成功!","info");
//关闭窗口
$("#addDialog").dialog("close");
//清空原表格数据
$("#add_name").textbox('setValue', "");
$("#add_sex").textbox('setValue', "男");
$("#add_userName").textbox('setValue', "");
$("#add_number").textbox('setValue', "");
$("#add_phone").textbox('setValue', "");
$("#add_clazzList").textbox('setValue', "");
$("#add_major").textbox('setValue', "");
$("#add_honor").textbox('setValue', "");
$("#add_birthday").textbox('setValue', "");
$("#add_scoreNow").textbox('setValue', "");
//重新刷新页面数据
$('#dataList').datagrid("options").queryParams = {clazzid: clazzid};
$('#dataList').datagrid("reload");
} else{
$.messager.alert("消息提醒","添加失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-reload',
handler:function(){
$("#add_name").textbox('setValue', "");
$("#add_sex").textbox('setValue', "男");
$("#add_userName").textbox('setValue', "");
$("#add_number").textbox('setValue', "");
$("#add_phone").textbox('setValue', "");
$("#add_clazzList").textbox('setValue', "");
$("#add_major").textbox('setValue', "");
$("#add_honor").textbox('setValue', "");
$("#add_birthday").textbox('setValue', "");
$("#add_scoreNow").textbox('setValue', "");
//重新加载班级
$("#add_gradeList").combobox("clear");
$("#add_gradeList").combobox("reload");
}
},
]
});
//设置编辑学生窗口
$("#editDialog").dialog({
title: "修改学生信息",
width: 650,
height: 460,
iconCls: "icon-edit",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'提交',
plain: true,
iconCls:'icon-user_add',
handler:function(){
var validate = $("#editForm").form("validate");
var clazzid = $("#edit_clazzList").combobox("getValue");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "StudentServlet?method=EditStudent&t="+new Date().getTime(),
data: $("#editForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","更新成功!","info");
//关闭窗口
$("#editDialog").dialog("close");
//刷新表格
$('#dataList').datagrid("options").queryParams = {clazzid: clazzid};
$("#dataList").datagrid("reload");
$("#dataList").datagrid("uncheckAll");
} else{
$.messager.alert("消息提醒","更新失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-reload',
handler:function(){
$("#edit_name").textbox('setValue', "");
$("#edit_sex").textbox('setValue', "男");
$("#edit_userName").textbox('setValue', "");
$("#edit_number").textbox('setValue', "");
$("#edit_phone").textbox('setValue', "");
$("#edit_clazzList").textbox('setValue', "");
$("#edit_honor").textbox('setValue', "");
$("#edit_scoreNow").textbox('setValue', "");
//重新加载班级
$("#edit_gradeList").combobox("clear");
$("#edit_gradeList").combobox("reload");
}
}
],
onBeforeOpen: function(){
var selectRow = $("#dataList").datagrid("getSelected");
//设置值
$("#edit_name").textbox('setValue', selectRow.name);
$("#edit_userName").textbox('setValue', selectRow.userName);
$("#edit_phone").textbox('setValue', selectRow.phone);
$("#edit-studentId").val(selectRow.studentId);
$("#edit-userId").val(selectRow.userId);
$("#edit_number").textbox('setValue', selectRow.number);
$("#edit_scoreNow").textbox('setValue', selectRow.scoreNow);
$("#edit_honor").textbox('setValue', selectRow.honor);
var clazzid = selectRow.clazzId;
var sex = selectRow.sex;
setTimeout(function(){
$("#edit_clazzList").combobox('setValue', clazzid);
$("#edit_sex").combobox('setValue', sex);
}, 100);
}
});
//搜索按钮监听事件
$("#search-btn").click(function(){
$('#dataList').datagrid('load',{
studentName: $('#search_student_name').val(),
clazzId: $("#clazzList").combobox('getValue') == '' ? 0 : $("#clazzList").combobox('getValue')
});
});
//设置导入工具类按钮
$("#import").click(function(){
$("#importDialog").dialog("open");
});
//设置导入窗口
$("#importDialog").dialog({
title: "导入学生信息",
width: 450,
height: 150,
iconCls: "icon-add",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'确认导入',
plain: true,
iconCls:'icon-book-add',
handler:function(){
var validate = $("#importForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请选择文件!","warning");
return;
} else{
importStudent();
$("#importDialog").dialog("close");
}
}
}
]
});
function importStudent(){
$("#importForm").submit();
$.messager.progress({text:'正在上传导入中...'});
var interval = setInterval(function(){
var message = $(window.frames["import_target"].document).find("#message").text();
if(message != null && message != ''){
$.messager.progress('close');
$.messager.alert("消息提醒",message,"info");
$('#dataList').datagrid("reload");
clearInterval(interval);
}
}, 1000)
}
//清空搜索条件
$("#clear-btn").click(function(){
$('#dataList').datagrid("reload",{});
$("#clazzList").combobox('clear');
$("#search_student_name").textbox('setValue', "");
});
});
</script>
<script type="text/javascript">
function myformatter(date){
var y = date.getFullYear();
var m = date.getMonth()+1;
var d = date.getDate();
return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
}
function myparser(s){
if (!s) return new Date();
var ss = (s.split('-'));
var y = parseInt(ss[0],10);
var m = parseInt(ss[1],10);
var d = parseInt(ss[2],10);
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
return new Date(y,m-1,d);
} else {
return new Date();
}
}
</script>
</head>
<body>
<!-- 学生列表 -->
<table id="dataList" cellspacing="0" cellpadding="0">
</table>
<!-- 工具栏 -->
<div id="toolbar">
<c:if test="${roleCode == 'admin' || roleCode == 'teacher'}">
<div style="float: left;"><a id="add" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<div style="float: left;"><a id="edit" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<div style="float: left;"><a id="delete" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-some-delete',plain:true">删除</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<div style="float: left;"><a id="download" href="StudentServlet?method=DownLoad" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">导入模板</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<div style="float: left;"><a id="import" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">导入</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<div style="float: left;margin-top:4px;">&nbsp;&nbsp;姓名:<input id="search_student_name" class="easyui-textbox" name="search_student_name" /></div>
</c:if>
<div style="margin-left: 10px;margin-top:4px;" >&nbsp;&nbsp;班级:<input id="clazzList" class="easyui-textbox" name="clazz" />
<a id="search-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索</a>
<a id="clear-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">清空搜索</a>
</div>
</div>
<!-- 添加学生窗口 -->
<div id="addDialog" style="padding: 10px">
<form id="addForm" method="post">
<table cellpadding="8" >
<tr>
<td>姓名:</td>
<td><input id="add_name" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="name" data-options="required:true, missingMessage:'请填写姓名'" /></td>
<td>性别:</td>
<td><select id="add_sex" class="easyui-combobox" data-options="required:true, missingMessage:'请选择性别',editable: false, panelHeight: 50, width: 60, height: 30" name="sex"><option value="0">男</option><option value="1">女</option></select></td>
</tr>
<tr>
<td>用户名:</td>
<td>
<input id="add_userName" class="easyui-textbox" style="width: 200px; height: 30px;" type="text" name="userName" data-options="required:true, missingMessage:'请输入用户名'" />
</td>
<td>联系方式:</td>
<td><input id="add_phone" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="phone" validType="mobile" /></td>
</tr>
<tr>
<td>学号:</td>
<td><input id="add_number" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="number" validType="number" data-options="required:true, missingMessage:'请输入学号'" /></td>
<td>班级:</td>
<td><input id="add_clazzList" style="width: 200px; height: 30px;" class="easyui-textbox" name="clazzId" data-options="required:true, missingMessage:'请选择班级'" /></td>
</tr>
<tr>
<td>专业:</td>
<td>
<input id="add_major" class="easyui-textbox" style="width: 200px; height: 30px;" type="text" name="major" data-options="required:true, missingMessage:'请输入专业'" />
</td>
<td>个人荣誉:</td>
<td><input id="add_honor" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="honor" /></td>
</tr>
<tr>
<td>生日:</td>
<td>
<input id="add_birthday" data-options="formatter:myformatter,parser:myparser" class="easyui-datebox" name="birthday" />
</td>
<td>本周学分:</td>
<td><input id="add_scoreNow" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="scoreNow" validType="number" data-options="required:true, missingMessage:'请输入本周学分'" /></td>
</tr>
</table>
</form>
</div>
<!-- 修改学生窗口 -->
<div id="editDialog" style="padding: 10px">
<form id="editForm" method="post">
<input type="hidden" name="userId" id="edit-userId">
<input type="hidden" name="studentId" id="edit-studentId">
<table cellpadding="8" >
<tr>
<td>姓名:</td>
<td><input id="edit_name" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="name" data-options="required:true, missingMessage:'请填写姓名'" /></td>
<td>性别:</td>
<td><select id="edit_sex" class="easyui-combobox" data-options="required:true, missingMessage:'请选择性别',editable: false, panelHeight: 50, width: 60, height: 30" name="sex"><option value="0">男</option><option value="1">女</option></select></td>
</tr>
<tr>
<td>用户名:</td>
<td>
<input id="edit_userName" class="easyui-textbox" style="width: 200px; height: 30px;" type="text" name="userName" data-options="required:true, missingMessage:'请输入用户名'" />
</td>
<td>联系方式:</td>
<td><input id="edit_phone" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="phone" validType="mobile" /></td>
</tr>
<tr>
<td>学号:</td>
<td><input id="edit_number" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="number" validType="number" data-options="required:true, missingMessage:'请输入学号'" /></td>
<td>班级:</td>
<td><input id="edit_clazzList" style="width: 200px; height: 30px;" class="easyui-textbox" name="clazzId" data-options="required:true, missingMessage:'请选择班级'" /></td>
</tr>
<tr>
<c:if test="${roleCode == 'admin' || roleCode == 'teacher'}">
<td>本周学分:</td>
<td><input id="edit_scoreNow" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="scoreNow" validType="number" data-options="required:true, missingMessage:'请输入本周学分'" /></td>
</c:if>
<td>个人荣誉:</td>
<td><input id="edit_honor" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="honor" /></td>
</tr>
</table>
</form>
</div>
<!-- 导入数据窗口 -->
<div id="importDialog" style="padding: 10px">
<form id="importForm" method="post" enctype="multipart/form-data" action="StudentServlet?method=ImportStudent" target="import_target">
<table cellpadding="8" >
<tr>
<td>请选择文件:</td>
<td>
<input class="easyui-filebox" name="importStudent" data-options="required:true,min:0,precision:2, missingMessage:'请选择文件',prompt:'选择文件'" style="width:200px;">
</td>
</tr>
</table>
</form>
</div>
<!-- 提交表单处理iframe框架 -->
<iframe id="import_target" name="import_target"></iframe>
</body>
</html>

View File

@@ -0,0 +1,79 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>学生管理系统 管理员后台</title>
<link rel="shortcut icon" href="favicon.ico"/>
<link rel="bookmark" href="favicon.ico"/>
<link rel="stylesheet" type="text/css" href="static/easyui/css/default.css"/>
<link rel="stylesheet" type="text/css" href="static/easyui/themes/default/easyui.css"/>
<link rel="stylesheet" type="text/css" href="static/easyui/themes/icon.css"/>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src='static/easyui/js/outlook2.js'> </script>
<script type="text/javascript">
var _menus = {"menus":[
{"menuid":"1","icon":"","menuname":"学生信息管理",
"menus":[
{"menuid":"1_1","menuname":"学生列表","icon":"icon-user-student","url":"StudentServlet?method=toStudentListView"},
{"menuid":"1_2","menuname":"请假列表","icon":"icon-book-open","url":"LeaveServlet?method=toLeaveServletListView"},
<c:if test="${roleCode == 'admin' || roleCode == 'teacher'}">
{"menuid":"1_3","menuname":"学分列表","icon":"icon-book-open","url":"CreditRecordsServlet?method=toCreditRecordsServletListView"},
</c:if>
]
},
<c:if test="${roleCode == 'admin' || roleCode == 'teacher'}">
{"menuid":"2","icon":"","menuname":"班级信息管理",
"menus":[
{"menuid":"2_1","menuname":"班级列表","icon":"icon-house","url":"ClazzServlet?method=toClazzListView"}
]
},
</c:if>
<c:if test="${roleCode == 'admin' || roleCode == 'teacher'}">
{"menuid":"3","icon":"","menuname":"教师信息管理",
"menus":[
{"menuid":"3_1","menuname":"教师列表","icon":"icon-user-teacher","url":"TeacherServlet?method=toTeacherListView"},
]
},
</c:if>
{"menuid":"4","icon":"","menuname":"系统管理",
"menus":[
{"menuid":"4_1","menuname":"修改密码","icon":"icon-set","url":"SystemServlet?method=toPersonalView"},
]
}
]};
</script>
</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
<noscript>
<div style=" position:absolute; z-index:100000; height:2046px;top:0px;left:0px; width:100%; background:white; text-align:center;">
<img src="images/noscript.gif" alt='抱歉,请开启脚本支持!' />
</div>
</noscript>
<div region="north" split="true" border="false" style="overflow: hidden; height: 30px;
background: #7f99be repeat-x center 50%;
line-height: 20px;color: #fff; font-family: Verdana, 微软雅黑,黑体">
<span style="float:right; padding-right:20px;" class="head"><span style="color:red; font-weight:bold;">${user.name}&nbsp;</span>您好&nbsp;&nbsp;&nbsp;<a href="LoginServlet?method=logout" id="loginOut">安全退出</a></span>
<span style="padding-left:10px; font-size: 16px; ">学生信息管理系统</span>
</div>
<div region="south" split="true" style="height: 30px; background: #D2E0F2; ">
<div class="footer">Copyright &copy; By 【中软国际】</div>
</div>
<div region="west" hide="true" split="true" title="导航菜单" style="width:180px;" id="west">
<div id="nav" class="easyui-accordion" fit="true" border="false">
<!-- 导航内容 -->
</div>
</div>
<div id="mainPanle" region="center" style="background: #eee; overflow-y:hidden">
<div id="tabs" class="easyui-tabs" fit="true" border="false" >
<jsp:include page="welcome.jsp" />
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,486 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta charset="UTF-8">
<title>教师列表</title>
<link rel="stylesheet" type="text/css" href="static/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="static/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="static/easyui/css/demo.css">
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/js/validateExtends.js"></script>
<script type="text/javascript">
$(function() {
var table;
//datagrid初始化
$('#dataList').datagrid({
title:'教师列表',
iconCls:'icon-more',//图标
border: true,
collapsible:false,//是否可折叠的
fit: true,//自动大小
method: "post",
url:"TeacherServlet?method=TeacherList&t="+new Date().getTime(),
idField:'userId',
singleSelect:false,//是否单选
pagination:true,//分页控件
rownumbers:true,//行号
sortName:'userId',
sortOrder:'DESC',
remoteSort: false,
columns: [[
{field:'chk',checkbox: true,width:50},
{field:'userId',title:'ID',width:50, sortable: true},
{field:'name',title:'姓名',width:150, sortable: true},
{field:'sex',title:'性别',width:150,
formatter: function(value,row,index){
if (row.sex == '0') {
return '男';
}
return '女';
}
},
{field:'userName',title:'用户名',width:100},
{field:'phone',title:'联系方式',width:150},
{field:'isCounselor',title:'辅导员',width:150,
formatter: function(value,row,index){
if (row.isCounselor == 'y') {
return '是';
}
return '否';
}
}
]],
toolbar: "#toolbar",
onBeforeLoad : function(){
try{
$("#clazzList").combobox("getData")
}catch(err){
preLoadClazz();
}
}
});
//设置分页控件
var p = $('#dataList').datagrid('getPager');
$(p).pagination({
pageSize: 10,//每页显示的记录条数默认为10
pageList: [10,20,30,50,100],//可以设置每页记录条数的列表
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
//设置工具类按钮
$("#add").click(function(){
table = $("#addTable");
$("#addDialog").dialog("open");
});
//修改
$("#edit").click(function(){
table = $("#editTable");
var selectRows = $("#dataList").datagrid("getSelections");
if(selectRows.length != 1){
$.messager.alert("消息提醒", "请选择一条数据进行操作!", "warning");
} else{
$("#editDialog").dialog("open");
}
});
//删除
$("#delete").click(function(){
var selectRows = $("#dataList").datagrid("getSelections");
var selectLength = selectRows.length;
if(selectLength == 0){
$.messager.alert("消息提醒", "请选择数据进行删除!", "warning");
} else{
var teacherIds = [];
$(selectRows).each(function(i, row){
teacherIds[i] = row.teacherId;
});
var userIds = [];
$(selectRows).each(function(i, row){
userIds[i] = row.userId;
});
$.messager.confirm("消息提醒", "将删除与教师相关的所有数据,确认继续?", function(r){
if(r){
$.ajax({
type: "post",
url: "TeacherServlet?method=DeleteTeacher",
data: {userIds: userIds, teacherIds: teacherIds},
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","删除成功!","info");
//刷新表格
$("#dataList").datagrid("reload");
$("#dataList").datagrid("uncheckAll");
} else if(msg == "isHaveClazz"){
$.messager.alert("消息提醒","所选教师目前仍是班级负责人,删除失败!","info");
return;
} else if(msg == "isHaveLeave"){
$.messager.alert("消息提醒","所选教师目前仍有未完成的请假审核,删除失败!","info");
return;
} else{
$.messager.alert("消息提醒","删除失败!","warning");
return;
}
}
});
}
});
}
});
function preLoadClazz(){
$("#clazzList").combobox({
width: "150",
height: "25",
valueField: "id",
textField: "clazzName",
multiple: false, //可多选
editable: false, //不可编辑
method: "post",
url: "ClazzServlet?method=getClazzList&t="+new Date().getTime()+"&from=combox",
onChange: function(newValue, oldValue){
}
});
}
//设置添加窗口
$("#addDialog").dialog({
title: "添加教师",
width: 650,
height: 350,
iconCls: "icon-add",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'添加',
plain: true,
iconCls:'icon-user_add',
handler:function(){
var validate = $("#addForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "TeacherServlet?method=AddTeacher",
data: $("#addForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","添加成功!","info");
//关闭窗口
$("#addDialog").dialog("close");
//清空原表格数据
$("#add_name").textbox('setValue', "");
$("#add_sex").textbox('setValue', "");
$("#add_userName").textbox('setValue', "");
$("#add_number").textbox('setValue', "");
$("#add_phone").textbox('setValue', "");
$("#add_clazzList").textbox('setValue', "");
$("#add_isCounselor").textbox('setValue', "");
$(table).find(".chooseTr").remove();
//重新刷新页面数据
$('#dataList').datagrid("reload");
} else{
$.messager.alert("消息提醒","添加失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-reload',
handler:function(){
$("#add_name").textbox('setValue', "");
$("#add_sex").textbox('setValue', "");
$("#add_userName").textbox('setValue', "");
$("#add_number").textbox('setValue', "");
$("#add_phone").textbox('setValue', "");
$("#add_clazzList").textbox('setValue', "");
$("#add_isCounselor").textbox('setValue', "");
$(table).find(".chooseTr").remove();
//重新加载班级
$("#add_gradeList").combobox("clear");
$("#add_gradeList").combobox("reload");
}
},
],
onClose: function(){
$("#add_name").textbox('setValue', "");
$("#add_sex").textbox('setValue', "");
$("#add_userName").textbox('setValue', "");
$("#add_number").textbox('setValue', "");
$("#add_phone").textbox('setValue', "");
$("#add_clazzList").textbox('setValue', "");
$("#add_isCounselor").textbox('setValue', "");
$(table).find(".chooseTr").remove();
//重新加载班级
$("#add_gradeList").combobox("clear");
$("#add_gradeList").combobox("reload");
}
});
//下拉框通用属性
$("#edit_clazzList, #add_clazzList").combobox({
width: "200",
height: "30",
valueField: "id",
textField: "clazzName",
multiple: true, //可多选
editable: false, //不可编辑
method: "post",
});
$("#add_clazzList").combobox({
url: "ClazzServlet?method=getClazzList&t="+new Date().getTime()+"&from=combox",
onLoadSuccess: function(){
//默认选择第一条数据
var data = $(this).combobox("getData");
$(this).combobox("setValue", data[0].id);
}
});
//编辑教师信息班级下拉框
$("#edit_clazzList").combobox({
url: "ClazzServlet?method=getClazzList&t="+new Date().getTime()+"&from=combox",
onLoadSuccess: function(){
//默认选择第一条数据
var data = $(this).combobox("getData");
$(this).combobox("setValue", data[0].id);
}
});
//编辑教师信息
$("#editDialog").dialog({
title: "修改教师信息",
width: 650,
height: 350,
iconCls: "icon-edit",
modal: true,
collapsible: false,
minimizable: false,
maximizable: false,
draggable: true,
closed: true,
buttons: [
{
text:'提交',
plain: true,
iconCls:'icon-user_add',
handler:function(){
var validate = $("#editForm").form("validate");
if(!validate){
$.messager.alert("消息提醒","请检查你输入的数据!","warning");
return;
} else{
$.ajax({
type: "post",
url: "TeacherServlet?method=EditTeacher",
data: $("#editForm").serialize(),
success: function(msg){
if(msg == "success"){
$.messager.alert("消息提醒","修改成功!","info");
//关闭窗口
$("#editDialog").dialog("close");
//清空原表格数据
$("#edit_name").textbox('setValue', "");
$("#edit_sex").textbox('setValue', "");
$("#edit_userName").textbox('setValue', "");
$("#edit_number").textbox('setValue', "");
$("#edit_phone").textbox('setValue', "");
$("#edit_clazzList").textbox('setValue', "");
$("#edit_isCounselor").textbox('setValue', "");
//重新刷新页面数据
$('#dataList').datagrid("reload");
$('#dataList').datagrid("uncheckAll");
} else{
$.messager.alert("消息提醒","修改失败!","warning");
return;
}
}
});
}
}
},
{
text:'重置',
plain: true,
iconCls:'icon-reload',
handler:function(){
$("#edit_name").textbox('setValue', "");
$("#edit_sex").textbox('setValue', "");
$("#edit_userName").textbox('setValue', "");
$("#edit_number").textbox('setValue', "");
$("#edit_phone").textbox('setValue', "");
$("#edit_clazzList").textbox('setValue', "");
$("#edit_isCounselor").textbox('setValue', "");
$(table).find(".chooseTr").remove();
}
},
],
onBeforeOpen: function(){
var selectRow = $("#dataList").datagrid("getSelected");
var teacherId = selectRow.teacherId;
$("#edit_name").textbox('setValue', selectRow.name);
$("#edit_userName").textbox('setValue', selectRow.userName);
$("#edit_phone").textbox('setValue', selectRow.phone);
$("#edit-teacherId").val(teacherId);
$("#edit-userId").val(selectRow.userId);
var clazzId;
$.ajax({
type: "post",
url: "TeacherServlet?method=GetTeacherClazz",
data: {teacherId: teacherId},
success: function(data){
clazzId = data.split(",")
}
});
$("#edit_isCounselor").combobox('setValue', selectRow.isCounselor);
var sex = selectRow.sex;
setTimeout(function(){
$("#edit_clazzList").combobox('setValues', clazzId);
$("#edit_sex").combobox('setValue', sex);
}, 100);
},
onClose: function(){
$("#edit_name").textbox('setValue', "");
$("#edit_sex").textbox('setValue', "");
$("#edit_userName").textbox('setValue', "");
$("#edit_number").textbox('setValue', "");
$("#edit_phone").textbox('setValue', "");
$("#edit_clazzList").textbox('setValue', "");
$("#edit_isCounselor").textbox('setValue', "");
}
});
//搜索按钮监听事件
$("#search-btn").click(function(){
$('#dataList').datagrid('load',{
name: $('#search_teacher_name').val(),
clazzId: $("#clazzList").combobox('getValue') == '' ? 0 : $("#clazzList").combobox('getValue')
});
});
//清空搜索条件
$("#clear-btn").click(function(){
$('#dataList').datagrid("reload",{});
$("#clazzList").combobox('clear');
$("#search_teacher_name").textbox('setValue', "");
});
});
</script>
</head>
<body>
<!-- 数据列表 -->
<table id="dataList" cellspacing="0" cellpadding="0">
</table>
<!-- 工具栏 -->
<div id="toolbar">
<c:if test="${roleCode == 'admin'}">
<div style="float: left;"><a id="add" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
</c:if>
<div style="float: left;"><a id="edit" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a></div>
<div style="float: left;" class="datagrid-btn-separator"></div>
<c:if test="${roleCode == 'admin'}">
<div style="float: left;"><a id="delete" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-some-delete',plain:true">删除</a></div>
</c:if>
<div style="float: left;margin-top:4px;" class="datagrid-btn-separator" >
&nbsp;&nbsp;姓名:<input id="search_teacher_name" class="easyui-textbox" name="name" />
</div>
<div style="margin-left: 10px;margin-top:4px;" >
班级:<input id="clazzList" class="easyui-textbox" name="clazzId" />
<a id="search-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索</a>
<a id="clear-btn" href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">清空搜索</a>
</div>
</div>
<!-- 添加窗口 -->
<div id="addDialog" style="padding: 10px;">
<form id="addForm" method="post">
<table id="addTable" cellpadding="6" >
<tr>
<td>姓名:</td>
<td><input id="add_name" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="name" data-options="required:true, missingMessage:'请填写姓名'" /></td>
<td>性别:</td>
<td><select id="add_sex" class="easyui-combobox" data-options="required:true, missingMessage:'请选择性别',editable: false, panelHeight: 50, width: 60, height: 30" name="sex"><option value="0">男</option><option value="1">女</option></select></td>
</tr>
<tr>
<td>用户名:</td>
<td>
<input id="add_userName" class="easyui-textbox" style="width: 200px; height: 30px;" type="text" name="userName" data-options="required:true, missingMessage:'请输入用户名'" />
</td>
<td>联系方式:</td>
<td><input id="add_phone" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="phone" validType="mobile" /></td>
</tr>
<tr>
<td>是否是导员:</td>
<td><select id="add_isCounselor" class="easyui-combobox" data-options="required:true, missingMessage:'请选择是否是导员',editable: false, panelHeight: 50, width: 60, height: 30" name="isCounselor"><option value="n">否</option><option value="y">是</option></select></td>
<td>班级:</td>
<td><input id="add_clazzList" style="width: 200px; height: 30px;" class="easyui-textbox" name="clazzIds" data-options="required:true, missingMessage:'请选择班级'" /></td>
</tr>
</table>
</form>
</div>
<!-- 修改窗口 -->
<div id="editDialog" style="padding: 10px">
<form id="editForm" method="post">
<input type="hidden" name="userId" id="edit-userId">
<input type="hidden" name="teacherId" id="edit-teacherId">
<table id="editTable" cellpadding="8" >
<tr>
<td>姓名:</td>
<td><input id="edit_name" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="name" data-options="required:true, missingMessage:'请填写姓名'" /></td>
<td>性别:</td>
<td><select id="edit_sex" class="easyui-combobox" data-options="required:true, missingMessage:'请选择性别',editable: false, panelHeight: 50, width: 60, height: 30" name="sex"><option value="0">男</option><option value="1">女</option></select></td>
</tr>
<tr>
<td>用户名:</td>
<td>
<input id="edit_userName" class="easyui-textbox" style="width: 200px; height: 30px;" type="text" name="userName" data-options="required:true, missingMessage:'请输入用户名'" />
</td>
<td>联系方式:</td>
<td><input id="edit_phone" style="width: 200px; height: 30px;" class="easyui-textbox" type="text" name="phone" validType="mobile" /></td>
</tr>
<tr>
<td>是否是导员:</td>
<td><select id="edit_isCounselor" class="easyui-combobox" data-options="required:true, missingMessage:'请选择是否是导员',editable: false, panelHeight: 50, width: 60, height: 30" name="isCounselor"><option value="n">否</option><option value="y">是</option></select></td>
<td>班级:</td>
<td><input id="edit_clazzList" style="width: 200px; height: 30px;" class="easyui-textbox" name="clazzIds" data-options="required:true, missingMessage:'请选择班级'" /></td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,24 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div title="欢迎使用" style="padding:20px;overflow:hidden; color:red; " >
<p style="font-size: 25px; line-height: 30px; height: 30px;">欢迎使用学生成绩管理系统</p>
<p>开发人员:李月恒</p>
<p>开发周期2025/05/06 --- 2025/05/16共计10天</p>
<hr />
<h2>系统环境</h2>
<p>系统环境Windows</p>
<p>开发工具Eclipse</p>
<p>Java版本JDK 1.8</p>
<p>服务器tomcat 9.0</p>
<p>数据库MySQL 8.1</p>
<p>系统采用技术: Servlet+Jsp+Jdbc+dbutils+EasyUI+jQuery+Ajax+面向接口编程</p>
</div>
</body>
</html>