first commit

This commit is contained in:
2026-01-16 14:13:44 +08:00
commit 903ff8d495
34603 changed files with 8585054 additions and 0 deletions

View File

@ -0,0 +1,83 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/saveCompany.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
});
} else {
top.$.messager.alert('提示', "保存失败", 'info');
}
});
}
}
$(function() {
$('#pname').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
</div>
<div class="easyui-panel" title="新增公司" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</td>
</tr>
<tr>
<th>简称</th>
<td colspan="3">
<input name="sname" class="easyui-textbox" value="" />
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="address" class="easyui-textbox" style="width:400px" value="" />
</td>
</tr>
<tr>
<th>顺序</th>
<td>
<input name="morder" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="0" />
</td>
<th>启用</th>
<td>
<select name="active" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto'">
<option value="启用">启用</option>
<option value="禁用">禁用</option>
</select>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,104 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/updateCompany.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
});
} else {
top.$.messager.alert('提示', "保存失败", 'info');
}
});
}
}
function dodel() {
top.$.messager.confirm('提示', '确定删除此公司?', function(r) {
if (r) {
$.post(ext.contextPath + "/user/deleteCompany.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "删除成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/user/showCompanyAdd.do?pid="+$("#pid").val());
});
} else {
top.$.messager.alert('提示', "删除失败", 'info');
}
});
}
});
}
$(function() {
$('#pname').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
</div>
<div class="easyui-panel" title="编辑公司" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${company.id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${company.name }" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${company.pid}"/>
</td>
</tr>
<tr>
<th>简称</th>
<td colspan="3">
<input name="sname" class="easyui-textbox" value="${company.sname }" />
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="address" class="easyui-textbox" style="width:400px" value="${company.address }" />
</td>
</tr>
<tr>
<th>顺序</th>
<td>
<input name="morder" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${company.morder }" />
</td>
<th>启用</th>
<td>
<select name="active" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto',value:'${company.active}'" >
<option value="启用">启用</option>
<option value="禁用">禁用</option>
</select>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,76 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/saveDept.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
});
} else {
top.$.messager.alert('提示', "保存失败", 'info');
}
});
}
}
$(function() {
$('#pname').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
</div>
<div class="easyui-panel" title="新增部门" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</td>
</tr>
<tr>
<th>简称</th>
<td colspan="3">
<input name="sname" class="easyui-textbox" value="" />
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3">
<input name="office" class="easyui-textbox" style="width:400px" value="" />
</td>
</tr>
<tr>
<th>顺序</th>
<td colspan="3">
<input name="morder" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="0" />
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,97 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/updateDept.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
});
} else {
top.$.messager.alert('提示', "保存失败", 'info');
}
});
}
}
function dodel() {
top.$.messager.confirm('提示', '确定删除此部门?', function(r) {
if (r) {
$.post(ext.contextPath + "/user/deleteDept.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "删除成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/user/showDeptAdd.do?pid="+$("#pid").val());
});
} else {
top.$.messager.alert('提示', "删除失败", 'info');
}
});
}
});
}
$(function() {
$('#pname').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
</div>
<div class="easyui-panel" title="编辑部门" style="padding:10px;"
data-options="fit:true,tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${dept.id}"/>
<table class="table">
<tr>
<th>名称</th>
<td>
<input name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${dept.name }" />
</td>
<th>上级</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${dept.pid}"/>
</td>
</tr>
<tr>
<th>简称</th>
<td colspan="3">
<input name="sname" class="easyui-textbox" value="${dept.sname }" />
</td>
</tr>
<tr>
<th>办公室</th>
<td colspan="3">
<input name="office" class="easyui-textbox" style="width:400px" value="${dept.office }" />
</td>
</tr>
<tr>
<th>顺序</th>
<td colspan="3">
<input name="morder" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${dept.morder }" />
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,103 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="com.sipai.entity.user.ExtSystem"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<% request.setAttribute("RequestMode", ExtSystem.RequestMode); %>
<% request.setAttribute("SystemType", ExtSystem.SystemType); %>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave(dialog,grid) {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/extsystem/save.do", $(".form").serialize(), function(data) {
if (data.res == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
grid.datagrid('reload');
dialog.dialog('destroy');
});
}else if(data.res == 0){
top.$.messager.alert('提示', "保存失败", 'info');
}else{
top.$.messager.alert('提示', data.res, 'info');
}
},'json');
}
}
$(function() {
$("#workshopid").combobox({
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
valueField : 'id',
textField : 'name',
method:'get',
panelHeight:'auto'
});
});
</script>
</head>
<body>
<form method="post" class="form">
<table class="table">
<tr>
<th>名称</th>
<td><input name="name" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="" />
</td>
</tr>
<tr>
<th>请求链接</th>
<td ><input name="url" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" style="width:400px;" value="" />
</td>
</tr>
<tr>
<th>请求方式</th>
<td >
<select id="mode" class="easyui-combobox" name="mode" style="width:204px;">
<c:forEach var="item" items="${RequestMode}" >
<option value='${item}'>${item}</option>
</c:forEach>
</select>
</td>
</tr>
<tr>
<th>系统类型</th>
<td>
<select id="type" name="type" class="easyui-combobox" style="width:204px;">
<c:forEach var="item" items="${SystemType}" >
<option value='${item}'>${item}</option>
</c:forEach>
</select>
</td>
</tr>
<tr>
<th>所属车间</th>
<td><input id="workshopid" name="workshopid" class="easyui-combobox"
data-options="required:false,validType:'isBlank'" value="" />
</td>
</tr>
<tr>
<th>命名空间</th>
<td>
<input id="namespace" name="namespace" class="easyui-textbox"/>
</td>
</tr>
<tr>
<th>启用状态</th>
<td>
<input id="status" name="status" class="easyui-switchbutton" data-options="onText:'启用',offText:'停用'"
checked />
</td>
</tr>
</table>
</form>
</body>
</html>

View File

@ -0,0 +1,114 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="com.sipai.entity.user.ExtSystem"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<% request.setAttribute("RequestMode", ExtSystem.RequestMode); %>
<% request.setAttribute("SystemType", ExtSystem.SystemType); %>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function doupdate(dialog,grid) {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/extsystem/update.do", $(".form").serialize(), function(data) {
if (data.res == 1) {
top.$.messager.alert('提示', "更新成功", 'info', function() {
grid.datagrid('reload');
dialog.dialog('destroy');
});
}else if(data.res == 0){
top.$.messager.alert('提示', "更新失败", 'info');
}else{
top.$.messager.alert('提示', data.res, 'info');
}
},'json');
}
}
$(function() {
$("#workshopid").combobox({
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
valueField : 'id',
textField : 'name',
method:'get',
panelHeight:'auto',
onLoadSuccess:function(){
var value ="${extSystem.workshopid}";
if(value!=null && value!=""){
$("#workshopid").combobox('setValue',value);
}
}
});
if(${extSystem.status}){
$('#status').switchbutton("check");
}else{
$('#status').switchbutton("uncheck");
}
});
</script>
</head>
<body>
<form method="post" class="form">
<input name="id" type="hidden" value="${extSystem.id}"/>
<table class="table">
<tr>
<th>名称</th>
<td><input name="name" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="${extSystem.name}" />
</td>
</tr>
<tr>
<th>请求链接</th>
<td ><input name="url" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" style="width:400px;" value="${extSystem.url}" />
</td>
</tr>
<tr>
<th>请求方式</th>
<td >
<select id="mode" class="easyui-combobox" name="mode" style="width:204px;">
<c:forEach var="item" items="${RequestMode}" >
<option value='${item}' <c:if test='${item == extSystem.mode}'> selected</c:if> >${item}</option>
</c:forEach>
</select>
</td>
</tr>
<tr>
<th>系统类型</th>
<td>
<select id="type" name="type" class="easyui-combobox" style="width:204px;">
<c:forEach var="item" items="${SystemType}" >
<option value='${item}' <c:if test='${item == extSystem.type}'> selected</c:if> >${item}</option>
</c:forEach>
</select>
</td>
</tr>
<tr>
<th>所属车间</th>
<td><input id="workshopid" name="workshopid" class="easyui-combobox"
data-options="required:false,validType:'isBlank'" value="" />
</td>
</tr>
<tr>
<th>命名空间</th>
<td>
<input id="namespace" name="namespace" class="easyui-textbox" value="${extSystem.namespace}"/>
</td>
</tr>
<tr>
<th>启用状态</th>
<td>
<input id="status" name="status" class="easyui-switchbutton" data-options="onText:'启用',offText:'停用'"
checked />
</td>
</tr>
</table>
</form>
</body>
</html>

View File

@ -0,0 +1,207 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.sipai.tools.SessionManager"%>
<%
SessionManager sessionManager = new SessionManager();
%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var grid;
var addFun = function() {
var dialog = parent.ext.modalDialog({
iframeId:'iframeadd',
title : '添加系统',
url : ext.contextPath + '/user/extsystem/add.do?iframeId=iframeadd',
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
}
} ]
});
};
var editFun = function(id) {
var dialog = parent.ext.modalDialog({
iframeId:'iframeedit',
title : '编辑系统',
url : ext.contextPath + '/user/extsystem/edit.do?iframeId=iframeedit&id=' + id,
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.doupdate(dialog, grid);
}
} ]
});
};
/* var viewFun = function(id) {
var dialog = parent.ext.modalDialog({
title : '查看用户信息',
url : ext.contextPath + '/work/group/view.do?id=' + id
});
}; */
var deleteFun = function(id) {
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/user/extsystem/delete.do', {id : id}, function(data) {
if(data==1){
parent.$.messager.alert('提示','删除成功','info',function(){
grid.datagrid('reload');
});
}else{
parent.$.messager.alert('提示','删除失败','info');
}
});
}
});
};
var deletesFun = function() {
var checkedItems = $('#grid').datagrid('getChecked');
var datas="";
$.each(checkedItems, function(index, item){
datas+=item.id+",";
});
//alert(datas);
if(datas==""){
top.$.messager.alert('提示', '请先选择要删除的记录','info');
}else{
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/user/extsystem/deletes.do', {ids:datas} , function(data) {
if(data>0){
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
grid.datagrid('reload');
grid.datagrid('clearChecked');
});
}else{
parent.$.messager.alert('提示','删除失败','info');
}
});
}
});
}
};
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/user/extsystem/getlist.do',
striped : true,
rownumbers : true,
pagination : true,
singleSelect: false,
ctrlSelect:true,
nowrap:false,
selectOnCheck: false,
checkOnSelect: false,
idField : 'id',
pageSize : 50,
pageList : [ 20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '100', title : '系统名称', field : 'name', sortable : true, halign:'center'},
{width : '180', title : '所属车间', field : 'workshopid', halign:'center', formatter : function(value, row) {
if(row.workShop!=null){
return row.workShop.name;
}else{
return "所有车间";
}
}},
{width : '100', title : '通讯方式', field : 'mode', sortable : true, halign:'center'},
{width : '100', title : '系统类型', field : 'type', sortable : true, halign:'center'},
{width : '280', title : '通讯链接', field : 'url', sortable : true, halign:'center'},
{width : '80', title : '状态', field : 'status', sortable : true, halign:'center', formatter : function(value, row) {
if(value){
return '启用';
}else{
return '停用';
}
}},
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
var str = '';
<%if (sessionManager.havePermission(session,"user/extsystem/edit.do")) {%>
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
<%}%>
<%if (sessionManager.havePermission(session,"user/extsystem/delete.do")) {%>
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
<%}%>
return str;
}
}
] ],
toolbar : '#toolbar',
onLoadSuccess : function(data) {
$('.iconImg').attr('src', ext.pixel_0);
}
});
$('#search_pid').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
width:200,
onBeforeSelect:function(node){
if(node.id=="-1"){
$("#search_pid").tree("search_pid");
}
},
editable:false
});
});
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<table>
<tr>
<%if (sessionManager.havePermission(session,"work/group/add.do")) {%>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
onclick="addFun();">添加</a>
</td>
<%}%>
<%if (sessionManager.havePermission(session,"work/group/delete.do")) {%>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
onclick="deletesFun();">删除</a>
</td>
<%}%>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<form id="searchForm">
<table class="tooltable">
<tr>
<td>系统名称</td>
<td><input name="search_name" class="easyui-textbox" /></td>
<td>所属车间</td>
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,112 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.sipai.tools.SessionManager"%>
<%
SessionManager sessionManager = new SessionManager();
%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
function selectFun() {
var checkedItems = $('#grid1').datagrid('getChecked');
var datas="";
$.each(checkedItems, function(index, item){
datas += '{"userid":"'+item.userid +'","usertype":"'+item.usertype +'","username":"'+item.username +'"},';
});
return $.parseJSON('{"result":['+datas.replace(/,$/g,"")+']}');
}
var grid;
$(function() {
grid = $('#grid').datagrid({
title : '班组选择',
url : ext.contextPath + '/work/group/getlist.do?querytype=select',
striped : true,
rownumbers : true,
pagination : true,
singleSelect: true,
idField : 'id',
height:300,
pageSize : 20,
pageList : [ 20, 50, 100],
columns : [ [
{width : '100', title : '班组名称', field : 'name', sortable : true, halign:'center'},
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'}
] ],
toolbar : '#toolbar',
onSelect:function(index,row){
loadMembers(row.id);
}
});
$('#search_pid').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
width:200,
editable:false
});
});
function loadMembers(groupid){
$('#grid1').datagrid({
title : '人员选择',
url : ext.contextPath + '/work/group/getMemberListByGroupId.do?groupid='+groupid,
height:400,
striped : true,
pagination : true,
singleSelect: false,
ctrlSelect:true,
selectOnCheck: false,
checkOnSelect: false,
idField : 'id',
pageSize : 20,
pageList : [ 20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '100', title : '人员类型', field : 'usertype', sortable : false, halign:'center',formatter:function(value){
if(value=='leader'){
return "组长";
}else{
return "组员";
}
}},
{width : '180', title : '人员名称', field : 'username', sortable : false, halign:'center'}
] ]
});
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false" style="padding:5px;">
<table id="toolbar" style="display: none;width:100%">
<tr>
<td>
<form id="searchForm">
<table class="tooltable">
<tr>
<td>班组名称</td>
<td><input name="search_name" class="easyui-textbox" /></td>
<td>所属车间</td>
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<table id="grid"></table>
<div style="height:10px"></div>
<table id="grid1"></table>
</body>
</html>

View File

@ -0,0 +1,78 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>导入人员</title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script>
var uploader,state;
$(function() {
var $ = jQuery,
$list = $('#thelist'),
state = 'pending';
uploader = WebUploader.create({
// swf文件路径
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
// 文件接收服务端。
server: ext.contextPath+'/user/importUsers.do',
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id: '#picker',
multiple: false
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
accept: {
title: 'Excel',
extensions: 'xls,xlsx',
mimeTypes: 'excel/*'
}
});
//当有文件被添加进队列的时候
uploader.on( 'fileQueued', function( file ) {
$list.append( '<div id="' + file.id + '" class="item">' +
'<h4 class="info">' + file.name + '</h4>' +
'<p class="state">等待上传...</p>' +
'</div>' );
});
});
var doimport = function(dialog, grid){
//执行上传功能
if ( state === 'uploading' ) {
alert("文件正在上传中,请稍等");
} else {
uploader.upload();
}
uploader.on( 'uploadError', function( file ) {
$( '#'+file.id ).find('p.state').text('上传出错');
});
uploader.on( 'uploadSuccess', function( file,response ) {
$( '#'+file.id ).find('p.state').text('已上传');
if(response.feedback!=null&&response.feedback!=""){
alert(response.feedback);
grid.datagrid('reload');
dialog.dialog('destroy');
}else{
alert("导入未完成!");
dialog.dialog('destroy');
}
});
}
</script>
</head>
<body>
<div id="uploader" class="wu-example">
<div class="btns">
<div id="picker">选择文件</div>
</div>
<!--用来存放文件信息-->
<div id="thelist" class="uploader-list"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,78 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>导入人员</title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script>
var uploader,state;
$(function() {
var $ = jQuery,
$list = $('#thelist'),
state = 'pending';
uploader = WebUploader.create({
// swf文件路径
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
// 文件接收服务端。
server: ext.contextPath+'/user/importUsers2.do',
// 选择文件的按钮。可选。
// 内部根据当前运行是创建可能是input元素也可能是flash.
pick: {
id: '#picker',
multiple: false
},
// 不压缩image, 默认如果是jpeg文件上传前会压缩一把再上传
resize: false,
accept: {
title: 'Excel',
extensions: 'xls,xlsx',
mimeTypes: 'excel/*'
}
});
//当有文件被添加进队列的时候
uploader.on( 'fileQueued', function( file ) {
$list.append( '<div id="' + file.id + '" class="item">' +
'<h4 class="info">' + file.name + '</h4>' +
'<p class="state">等待上传...</p>' +
'</div>' );
});
});
var doimport = function(dialog, grid){
//执行上传功能
if ( state === 'uploading' ) {
alert("文件正在上传中,请稍等");
} else {
uploader.upload();
}
uploader.on( 'uploadError', function( file ) {
$( '#'+file.id ).find('p.state').text('上传出错');
});
uploader.on( 'uploadSuccess', function( file,response ) {
$( '#'+file.id ).find('p.state').text('已上传');
if(response.feedback!=null&&response.feedback!=""){
alert(response.feedback);
grid.datagrid('reload');
dialog.dialog('destroy');
}else{
alert("导入未完成!");
dialog.dialog('destroy');
}
});
}
</script>
</head>
<body>
<div id="uploader" class="wu-example">
<div class="btns">
<div id="picker">选择文件</div>
</div>
<!--用来存放文件信息-->
<div id="thelist" class="uploader-list"></div>
</div>
</body>
</html>

View File

@ -0,0 +1,188 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var grid;
var editIndex = undefined;//当前编辑行索引
function endEditing(){//清除editor
if (editIndex == undefined){return true;}
if ($('#grid').datagrid('validateRow', editIndex)){
$('#grid').datagrid('endEdit', editIndex);
editIndex = undefined;
return true;
} else {
return false;
}
}
//新增行
var addFun = function() {
if(!endEditing()){
return false;
}
editIndex = 0;//设置当前编辑行
if($('#grid').datagrid('getRows')[editIndex]['id']!=undefined){//判断是否已经存在未保存的新增行
$('#grid').datagrid('insertRow', {index: editIndex,row: {}});
}
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'name'});
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
};
//编辑行
var editFun = function (index, field){
if(!endEditing()){
return false;
}
editIndex = index;
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:field});
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
};
//保存行
var saveFun = function() {
if($('#grid').datagrid('getSelected')==null){
top.$.messager.alert('提示','请先选择要保存的记录','info');
}else{
var id = $('#grid').datagrid('getSelected').id;
var url;
if(id==undefined){//新增
editIndex = $('#grid').datagrid('getRowIndex');
url = ext.contextPath + '/user/saveJob.do';
}else{//编辑
editIndex = $('#grid').datagrid('getRowIndex',id);
url = ext.contextPath + '/user/updateJob.do';
}
//alert(editIndex);
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var name_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'name'});
var name = $(name_ed.target).textbox('getValue');
var pri_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'pri'});
var pri = $(pri_ed.target).textbox('getValue');
var opt=$('#grid').datagrid('selectRow', editIndex).datagrid('options');
var morder = (opt.pageNumber-1) * opt.pageSize + editIndex + 1;
$.post(url,{id:id,name:name,pri:pri,morder:morder},function(data){
if(data.res == '1'){
top.$.messager.alert('提示','保存成功','info',function (){
$('#grid').datagrid('getRows')[editIndex]['id'] = data.id;//设置行id
$('#grid').datagrid('acceptChanges');
$('#grid').datagrid('unselectAll');
});
}else{
top.$.messager.alert('提示','保存失败','info');
}
},'json');
}
};
//删除行
var deleteFun = function() {
if($('#grid').datagrid('getSelected')==null){
top.$.messager.alert('提示','请先选择要删除的记录','info');
}else{
var id = $('#grid').datagrid('getSelected').id;
if(id==undefined){//未经保存的数据
top.$.messager.confirm('提示', '确定删除此记录?', function(r) {
if (r) {
editIndex = $('#grid').datagrid('getRowIndex');
$('#grid').datagrid('cancelEdit', editIndex).datagrid('deleteRow', editIndex);
}
});
}else{
top.$.messager.confirm('提示', '确定删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/user/deleteJob.do', {id : id}, function(data) {
if(data==1){
top.$.messager.alert('提示','删除成功','info',function(){
$('#grid').datagrid('cancelEdit', editIndex).datagrid('deleteRow', editIndex);
});
}else{
top.$.messager.alert('提示','删除失败','info');
}
});
}
});
}
}
};
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/user/getListJob.do',
striped : true,
rownumbers : true,
pagination : true,
singleSelect : true,
onClickCell: editFun,
idField : 'id',
pageSize : 20,
pageList : [20, 50, 100],
columns : [ [
{width : '150', title : '名称', field : 'name', sortable : true, editor:'textbox',halign:'center'},
{width : '280', title : '优先级', field : 'pri', sortable : true, editor:'textbox',halign:'center'}
] ],
toolbar : '#toolbar'
});
});
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<table>
<tr>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
onclick="addFun();">添加</a>
</td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
onclick="deleteFun();">删除</a>
</td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
onclick="saveFun();">保存</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<form id="searchForm">
<table>
<tr>
<td>名称</td>
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,85 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/saveMenu.do", $(".form").serialize(), function(result) {
if (result.res == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/user/showMenuEdit.do?id="+result.id);
});
} else {
top.$.messager.alert('提示', "保存失败", 'info');
}
},'json');
}
}
$(function() {
$('#pname').combotree({
url : ext.contextPath + '/user/getMenusJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
});
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
</div>
<div class="easyui-panel" title="新增菜单" style="padding:10px;"
data-options="tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="type" value="menu"/>
<table class="table">
<tr>
<th>名称</th>
<td><input name="name" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="" /></td>
<th>上级菜单</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3"><input id="location" name="location" class="easyui-textbox"
style="width:500px" value="" /></td>
</tr>
<tr>
<th>跨域地址</th>
<td ><input id="action" name="action" class="easyui-textbox"
value="" /></td>
<th>图标</th>
<td ><input id="image" name="image" class="easyui-textbox"
value="" /></td>
</tr>
<tr>
<th>顺序</th>
<td><input name="morder" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="0" /></td>
<th>启用</th>
<td>
<select name="active" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,required:true,validType:'isBlank'">
<option value="启用">启用</option>
<option value="禁用">禁用</option>
</select>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,324 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave() {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/updateMenu.do", $(".form").serialize(), function(result) {
if (result == 1) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
//刷新树
parent.reloadTree();
});
} else {
top.$.messager.alert('提示', "保存失败", 'info');
}
});
}
}
function saveDefault() {
if($("#location").val()==''){
top.$.messager.alert('提示','请先填写菜单地址','info');
}else{
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/saveDefaultFunc.do", $(".form").serialize(), function(result) {
if (result > 0) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
$('#grid').datagrid('reload');
});
} else {
top.$.messager.alert('提示', "保存失败", 'info');
}
});
}
}
}
function dodel() {
top.$.messager.confirm('提示', '确定删除此菜单?', function(r) {
if (r) {
$.post(ext.contextPath + "/user/deleteMenu.do", $(".form").serialize(), function(result) {
if (result.res > 0) {
top.$.messager.alert('提示', "删除成功", 'info', function() {
//刷新树
parent.reloadTree();
parent.$("#mainFrame").attr("src",ext.contextPath+"/user/showMenuAdd.do?pid="+$("#pid").val());
});
} else {
top.$.messager.alert('提示', result.msg, 'info');
}
},'json');
}
});
}
$(function() {
$('#pname').combotree({
url : ext.contextPath + "/user/getMenusJson.do?random=" + Math.random(),
parentField : 'pid',
method:'get',
required:true,
onClick : function(node) {
$("#pid").val(node.id);
}
});
});
</script>
<script type="text/javascript">
var grid;
var editIndex = undefined;//当前编辑行索引
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/user/getFuncJson.do?id=${menu.id}',
striped : true,
rownumbers : true,
singleSelect : true,
onClickCell: editFun,
idField : 'id',
pageSize : 20,
pageList : [20, 50, 100],
columns : [ [
{width : '100', title : '名称', field : 'name', sortable : true, editor:'textbox',halign:'center',align:'center'},
{width : '280', title : '路径', field : 'location', sortable : true, editor:'textbox',halign:'center'} ,
{width : '280', title : '所属菜单', field : 'pid', sortable : true, halign:'center',align:'center',
formatter: function(value,row,index){
return row._pname;
},
editor:{
type:'combotree',
options:{
required:true,
parentField : 'pid',
valueField:'id',
textField:'text',
method:'get',
url: ext.contextPath + "/user/getMenusJson.do?random=" + Math.random()
}
}} ,
{width : '100', title : '启用', field : 'active', sortable : true, halign:'center',align:'center',
editor: {
type: 'combobox',
options: {
required: true,
panelHeight:'auto',
valueField:'value',
textField:'text',
data:[{value:"启用",text:"启用"},{value:"禁用",text:"禁用"}]
}
}}
] ],
toolbar : '#toolbar'
});
});
function endEditing(){//清除editor
if (editIndex == undefined){return true;}
if ($('#grid').datagrid('validateRow', editIndex)){
$('#grid').datagrid('endEdit', editIndex);
editIndex = undefined;
return true;
} else {
return false;
}
}
//新增行
var addFun = function() {
if(!endEditing()){
return false;
}
editIndex = 0;//设置当前编辑行
if($('#grid').datagrid('getRows')[editIndex]==undefined){//如果一行都不存在
$('#grid').datagrid('insertRow', {index: editIndex,row: {pid:'${menu.id}',active:'启用'}});
}else{
if($('#grid').datagrid('getRows')[editIndex]['id']!=undefined){//判断是否已经存在未保存的新增行
$('#grid').datagrid('insertRow', {index: editIndex,row: {pid:'${menu.id}',active:'启用'}});
}
}
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'name'});
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
};
//编辑行
var editFun = function (index, field){
if(!endEditing()){
return false;
}
editIndex = index;
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:field});
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
};
//保存行
var saveFun = function() {
if($('#grid').datagrid('getSelected')==null){
top.$.messager.alert('提示','请先选择要保存的记录','info');
}else{
var id = $('#grid').datagrid('getSelected').id;
var url;
if(id==undefined){//新增
editIndex = $('#grid').datagrid('getRowIndex');
url = ext.contextPath + '/user/saveFunc.do';
}else{//编辑
editIndex = $('#grid').datagrid('getRowIndex',id);
url = ext.contextPath + '/user/updateFunc.do';
}
//判断必输项
if(!$('#grid').datagrid('validateRow', editIndex)){
top.$.messager.alert('提示','请输入必输项','info');
return false;
}
//获取数据
var name_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'name'});
var name = $(name_ed.target).textbox('getValue');
var location_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'location'});
var location = $(location_ed.target).textbox('getValue');
var active_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'active'});
var active = $(active_ed.target).textbox('getValue');
var pid_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'pid'});
var pid = $(pid_ed.target).textbox('getValue');
var opt=$('#grid').datagrid('selectRow', editIndex).datagrid('options');
var morder = (opt.pageNumber-1) * opt.pageSize + editIndex;
$.post(url,{id:id,name:name,location:location,morder:morder,pid:pid,active:active},function(data){
if(data.res == 1){
top.$.messager.alert('提示','保存成功','info',function (){
$('#grid').datagrid('reload');
});
}else{
top.$.messager.alert('提示','保存失败','info');
}
},'json');
}
};
//删除行
var deleteFun = function() {
if($('#grid').datagrid('getSelected')==null){
top.$.messager.alert('提示','请先选择要删除的记录','info');
}else{
var id = $('#grid').datagrid('getSelected').id;
if(id==undefined){//未经保存的数据
top.$.messager.confirm('提示', '确定删除此记录?', function(r) {
if (r) {
editIndex = $('#grid').datagrid('getRowIndex');
$('#grid').datagrid('cancelEdit', editIndex).datagrid('deleteRow', editIndex);
}
});
}else{
top.$.messager.confirm('提示', '确定删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/user/deleteMenu.do', {id : id}, function(data) {
if(data.res==1){
top.$.messager.alert('提示','删除成功','info',function(){
$('#grid').datagrid('cancelEdit', editIndex).datagrid('deleteRow', editIndex);
});
}else{
top.$.messager.alert('提示','删除失败','info');
}
},'json');
}
});
}
}
};
</script>
</head>
<body>
<div id="tt">
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
</div>
<div class="easyui-panel" title="编辑菜单" style="padding:10px;"
data-options="tools:'#tt'">
<form method="post" class="form">
<input type="hidden" name="id" value="${menu.id}"/>
<input type="hidden" name="type" value="menu"/>
<table class="table">
<tr>
<th>名称</th>
<td><input name="name" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="${menu.name}" /></td>
<th>上级菜单</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${menu._pname}" />
<input id="pid" name="pid" type="hidden" value="${menu.pid}"/>
</td>
</tr>
<tr>
<th>地址</th>
<td colspan="3"><input id="location" name="location" class="easyui-textbox"
style="width:500px" value="${menu.location}" /></td>
</tr>
<tr>
<th>跨域地址</th>
<td ><input id="action" name="action" class="easyui-textbox"
value="${menu.action}" /></td>
<th>图标</th>
<td ><input id="image" name="image" class="easyui-textbox"
value="${menu.image}" /></td>
</tr>
<tr>
<th>顺序</th>
<td><input name="morder" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="${menu.morder}"/></td>
<th>启用</th>
<td>
<select name="active" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${menu.active}'">
<option value="启用">启用</option>
<option value="禁用">禁用</option>
</select>
</td>
</tr>
</table>
</form>
</div>
<br/>
<div class="easyui-panel" title="功能设置">
<div id="toolbar">
<table>
<tr>
<td>
<table>
<tr>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
onclick="addFun();">添加</a>
</td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
onclick="deleteFun();">删除</a>
</td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
onclick="saveFun();">保存</a>
</td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
onclick="saveDefault();">默认权限</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div data-options="border:false">
<table id="grid" data-options="border:false"></table>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,58 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
$(function() {
$('#mainMenu').tree({
url : ext.contextPath + '/user/getMenusJson.do?random=' + Math.random(),
parentField : 'pid',
onClick : function(node) {
if(node.pid==''){
doadd();
}else{
$("#mainFrame").attr("src",ext.contextPath+"/user/showMenuEdit.do?id="+node.id);
}
}
});
doadd();
});
function reloadTree(){
$('#mainMenu').tree('options').url = ext.contextPath+ '/user/getMenusJson.do?random=' + Math.random();
$('#mainMenu').tree('reload');
}
function getSelectedPid(){
var t = $('#mainMenu').tree('getSelected');
var pid="";
if(t!=null){
pid=t.id;
}
return pid;
}
function doadd() {
$("#mainFrame").attr("src",ext.contextPath+"/user/showMenuAdd.do?pid="+getSelectedPid());
}
</script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
<div id="leftdiv" data-options="region:'west',split:true" style="width:250px;position:relative">
<div style="padding:2px;background-color:#eeeeee">
<a class="easyui-linkbutton" href="#" data-options="iconCls:'icon-add',plain:true" onclick="doadd()">新增</a>
</div>
<ul id="mainMenu" class="easyui-tree" data-options="method:'get',animate:true"></ul>
</div>
<div id="rightdiv" data-options="region:'center'" style="overflow: hidden;">
<iframe id="mainFrame" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;" frameBorder="0" scrolling="auto"></iframe>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,95 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var grid;
function selectOK() {
var rolenames="";
var roleids="";
var checkedItems = $('#grid').datagrid('getChecked');
$.each(checkedItems, function(index, item){
roleids+=item.id+",";
rolenames+=item.name+",";
});
if(roleids.length>1){
roleids = roleids.substring(0, roleids.length-1);
}
if(rolenames.length>1){
rolenames = rolenames.substring(0, rolenames.length-1);
}
var retn= roleids+")"+rolenames;
return retn;
}
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/user/getRolesForSelect.do',
striped : true,
rownumbers : true,
pagination : true,
singleSelect: false,
selectOnCheck: true,
checkOnSelect: true,
idField : 'id',
pageSize : 50,
pageList : [ 20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '100', title : '名称', field : 'name', sortable : true, editor:'textbox',halign:'center'},
{width : '280', title : '描述', field : 'description', sortable : true, editor:'textbox',halign:'center'}
] ],
toolbar : '#toolbar',
onLoadSuccess:function(data){
if(data){
$.each(data.rows, function(index, item){
//$.each(eval('${json}'), function(index1, item1){
if('${roleids}'!=null){
var roleidstr='${roleids}';
var roleidarr=roleidstr.split(",");
for(var i=0;i<roleidarr.length;i++){
if(item.id==roleidarr[i]){
$('#grid').datagrid('checkRow', index);
}
}
}
//});
});
}
}
});
});
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<form id="searchForm">
<table>
<tr>
<td>权限名称</td>
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,65 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave(dialog,parent) {
var checkedItems = $('#grid').datagrid('getChecked');
var datas="";
$.each(checkedItems, function(index, item){
datas+=item.id+",";
});
//alert(datas);
$.post(ext.contextPath + '/user/updateFuncByRoleMenu.do', {funcstr:datas,roleid:"${param.roleid}",menuid:"${param.menuid}"} , function(data) {
if(data >= 0){
top.$.messager.alert('提示','保存成功','info', function() {
parent.reloadTree();
dialog.dialog('destroy');
});
}else{
top.$.messager.alert('提示','保存失败','info');
}
});
}
$(function() {
$('#grid').datagrid({
title : '',
url : ext.contextPath + '/user/getFuncByMenuid.do?menuid=${param.menuid}',
striped : true,
rownumbers : true,
singleSelect: false,
selectOnCheck: true,
checkOnSelect: true,
idField : 'id',
columns : [ [
{checkbox:true , field : 'ck'},
{width : '100', title : '功能', field : 'name', sortable : true, halign:'center'},
{width : '200', title : '地址', field : 'location', sortable : true, halign:'center'}
] ],
toolbar : '#toolbar',
onLoadSuccess:function(data){
if(data){
$.each(data.rows, function(index, item){
$.each(eval('${json}'), function(index1, item1){
if(item.id==item1.menuid){
$('#grid').datagrid('checkRow', index);
}
});
});
}
}
});
});
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,228 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var grid;
var editIndex = undefined;//当前编辑行索引
function endEditing(){//清除editor
if (editIndex == undefined){return true;}
if ($('#grid').datagrid('validateRow', editIndex)){
$('#grid').datagrid('endEdit', editIndex);
editIndex = undefined;
return true;
} else {
return false;
}
}
//新增行
var addFun = function() {
if(!endEditing()){
return false;
}
editIndex = 0;//设置当前编辑行
if($('#grid').datagrid('getRows')[editIndex]==undefined){//如果一行都不存在
$('#grid').datagrid('insertRow', {index: editIndex,row: {}});
}else{
if($('#grid').datagrid('getRows')[editIndex]['id']!=undefined){//判断是否已经存在未保存的新增行
$('#grid').datagrid('insertRow', {index: editIndex,row: {}});
}
}
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'name'});
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
};
//编辑行
var editFun = function (index, field){
if(!endEditing()){
return false;
}
editIndex = index;
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:field});
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
};
//保存行
var saveFun = function() {
if($('#grid').datagrid('getSelected')==null){
top.$.messager.alert('提示','请先选择要保存的记录','info');
}else{
var id = $('#grid').datagrid('getSelected').id;
var url;
if(id==undefined){//新增
editIndex = $('#grid').datagrid('getRowIndex');
url = ext.contextPath + '/user/saveRole.do';
}else{//编辑
editIndex = $('#grid').datagrid('getRowIndex',id);
url = ext.contextPath + '/user/updateRole.do';
}
//alert(editIndex);
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
var name_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'name'});
var name = $(name_ed.target).textbox('getValue');
var serial_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'serial'});
var serial = $(serial_ed.target).textbox('getValue');
var description_ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'description'});
var description = $(description_ed.target).textbox('getValue');
var opt=$('#grid').datagrid('selectRow', editIndex).datagrid('options');
var morder = (opt.pageNumber-1) * opt.pageSize + editIndex + 1;
$.post(url,{id:id,name:name,serial:serial,description:description,morder:morder},function(data){
if(data.res == '1'){
top.$.messager.alert('提示','保存成功','info',function (){
$('#grid').datagrid('getRows')[editIndex]['id'] = data.id;//设置行id
$('#grid').datagrid('acceptChanges');
$('#grid').datagrid('unselectAll');
});
}else if(data.res == '0'){
top.$.messager.alert('提示', "保存失败", 'info');
}else{
top.$.messager.alert('提示', data.res, 'info');
}
},'json');
}
};
//删除行
var deleteFun = function() {
if($('#grid').datagrid('getSelected')==null){
top.$.messager.alert('提示','请先选择要删除的记录','info');
}else{
var id = $('#grid').datagrid('getSelected').id;
if(id==undefined){//未经保存的数据
top.$.messager.confirm('提示', '确定删除此记录?', function(r) {
if (r) {
editIndex = $('#grid').datagrid('getRowIndex');
$('#grid').datagrid('cancelEdit', editIndex).datagrid('deleteRow', editIndex);
}
});
}else{
top.$.messager.confirm('提示', '确定删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/user/deleteRole.do', {id : id}, function(data) {
if(data==1){
top.$.messager.alert('提示','删除成功','info',function(){
$('#grid').datagrid('cancelEdit', editIndex).datagrid('deleteRow', editIndex);
});
}else{
top.$.messager.alert('提示','删除失败','info');
}
});
}
});
}
}
};
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/user/getListRole.do',
striped : true,
rownumbers : true,
pagination : true,
singleSelect : true,
onClickCell: editFun,
idField : 'id',
pageSize : 20,
pageList : [20, 50, 100],
columns : [ [
{width : '100', title : '名称', field : 'name', sortable : true, editor:'textbox',halign:'center'},
{width : '150', title : '编码', field : 'serial', sortable : true, editor:'textbox',halign:'center'} ,
{width : '280', title : '描述', field : 'description', sortable : true, editor:'textbox',halign:'center'} ,
{width : '90', title : '操作', field : 'action', halign:'center', align:'center', formatter : function(value, row, index) {
var str = '';
str += '<img class="iconImg" src="../CSS/ext_icons/table/table_edit.png" title="菜单配置" onclick="setMenu(\''+row.id+'\');"/> ';
str += '<img class="iconImg" src="../CSS/ext_icons/user/user_edit.png" title="人员配置" onclick="setUser(\''+row.id+'\');"/> ';
return str;
}
}
] ],
toolbar : '#toolbar'
});
});
function setMenu(id){
var dialog = parent.ext.modalDialog({
title : '菜单配置',
url : ext.contextPath + '/user/showRoleMenu.do?roleid=' + id,
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
}
} ]
});
}
function setUser(id){
var dialog = parent.ext.modalDialog({
title : '用户配置',
url : ext.contextPath + '/user/showRoleUser.do?roleid=' + id,
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
}
} ]
});
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<table>
<tr>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
onclick="addFun();">添加</a>
</td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
onclick="deleteFun();">删除</a>
</td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
onclick="saveFun();">保存</a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<form id="searchForm">
<table>
<tr>
<td>名称</td>
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,66 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave(dialog,grid) {
var checkedtree = $('#mainMenu').tree('getChecked');
var datas="";
$.each(checkedtree,function(index,item){
datas+=item.id+",";
});
$.post(ext.contextPath + "/user/updateRoleMenu.do", {menustr:datas,roleid:"${roleid}"}, function(result) {
if (result >= 0) {
top.$.messager.alert('提示', "保存成功", 'info', function() {
dialog.dialog('destroy');
});
}else{
top.$.messager.alert('提示', "保存失败", 'info');
}
});
}
var tree;
$(function(){
tree=$('#mainMenu').tree({
url : ext.contextPath + '/user/getMenusJsonWithFuncByRoleID.do?roleid=${roleid}&random=' + Math.random(),
parentField : 'pid',
checkbox:true,
animate:true,
onLoadSuccess:function(){
$.each(eval('${json}'),function(index,item){
var node = $('#mainMenu').tree('find',item.menuid);
$('#mainMenu').tree('check',node.target);
});
},
onClick:function(node,data){
var dialog = parent.ext.modalDialog({
width:600,
height:400,
title : '功能权限配置',
url : ext.contextPath + '/user/roleFuncForSelect.do?menuid='+node.id+'&roleid=${roleid}',
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog,window);
}
} ]
});
}
});
});
function reloadTree(){
tree.tree('options').url = ext.contextPath + '/user/getMenusJsonWithFuncByRoleID.do?roleid=${roleid}&random=' + Math.random();
tree.tree('reload');
}
</script>
</head>
<body>
<ul id="mainMenu" class="easyui-tree" data-options="method:'get',animate:true"></ul>
</body>
</html>

View File

@ -0,0 +1,108 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var grid;
function dosave(dialog,grid) {
var checkedItems = $('#grid').datagrid('getChecked');
var datas="";
$.each(checkedItems, function(index, item){
datas+=item.id+",";
});
//alert(datas);
$.post(ext.contextPath + '/user/updateUserRole.do', {userstr:datas,roleid:"${roleid}"} , function(data) {
if(data >= 0){
top.$.messager.alert('提示','保存成功','info', function() {
dialog.dialog('destroy');
});
}else{
top.$.messager.alert('提示','保存失败','info');
}
});
};
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/user/getUsers.do',
striped : true,
rownumbers : true,
pagination : true,
singleSelect: false,
ctrlSelect:true,
selectOnCheck: false,
checkOnSelect: false,
idField : 'id',
pageSize : 50,
pageList : [ 20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '100', title : '登录名', field : 'name', sortable : true, halign:'center'},
{width : '80', title : '姓名', field : 'caption', sortable : true, halign:'center'},
{width : '180', title : '部门', field : '_pname', sortable : true, halign:'center'},
{width : '50', title : '性别', field : 'sex', sortable : true, halign:'center', align:'center', formatter : function(value, row, index) {
switch (value) {
case '0':
return '女';
case '1':
return '男';
}
}
}
] ],
toolbar : '#toolbar',
onLoadSuccess:function(data){
if(data){
$.each(data.rows, function(index, item){
$.each(eval('${json}'), function(index1, item1){
if(item.id==item1.empid){
$('#grid').datagrid('checkRow', index);
}
});
});
}
}
});
});
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<form id="searchForm">
<table>
<tr>
<td>登录名</td>
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
<td>姓名</td>
<td><input name="search_caption" class="easyui-textbox" style="width: 180px;" /></td>
<td>性别</td>
<td><select name="search_sex" class="easyui-combobox" style="width:100px;" data-options="panelHeight:'auto',editable:false">
<option value="">请选择</option>
<option value="1">男</option>
<option value="0">女</option></select>
</td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,100 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
$(function() {
$('#unitTree').tree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
dnd:true,
onClick : function(node) {
if(node.pid != ''){
if(node.attributes.type=='C'){
$("#mainFrame").attr("src",ext.contextPath+"/user/showCompanyEdit.do?id="+node.id);
}else{
$("#mainFrame").attr("src",ext.contextPath+"/user/showDeptEdit.do?id="+node.id);
}
}
},
onDrop:function(target,source,point){
var next = $('#unitTree').tree('getNode',target);
/* var parentNode;
if(point=='append'){
parentNode = next;
}else{
parentNode = $('#unitTree').tree('getParent',next.target);
}
var childrenNodes= $('#unitTree').tree('getChildren',parentNode.target);
alert(childrenNodes.length);
var datas = {};
for(var i=0;i<childrenNodes.length;i++) {
datas["children["+i+"].id"]=childrenNodes[i].id;
datas["children["+i+"].name"]=childrenNodes[i].text;
datas["children["+i+"].pid"]=childrenNodes[i].pid;
} */
$.ajax({
url : ext.contextPath + '/user/saveUnitOrder.do',
type: 'post',
data : {
target:next.id,
source:source.id,
point:point
},
dataType : 'json',
success : function(r){
if(r>0){
top.$.messager.alert('提示','顺序保存成功','info');
}else{
top.$.messager.alert('提示','顺序保存失败','info');
}
}
});
}
});
});
function reloadTree(){
$('#unitTree').tree('options').url = ext.contextPath+ '/user/getUnitsJson.do?random=' + Math.random();
$('#unitTree').tree('reload');
}
function getSelectedPid(){
var t = $('#unitTree').tree('getSelected');
var pid="";
if(t!=null){
pid=t.id;
}
return pid;
}
function addComp(){
$("#mainFrame").attr("src",ext.contextPath+"/user/showCompanyAdd.do?pid="+getSelectedPid());
}
function addDept(){
$("#mainFrame").attr("src",ext.contextPath+"/user/showDeptAdd.do?pid="+getSelectedPid());
}
</script>
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
<div id="leftdiv" data-options="region:'west',split:true" style="width:250px;position:relative">
<div style="padding:2px;background-color:#eeeeee">
<a class="easyui-linkbutton" href="#" data-options="iconCls:'icon-add',plain:true" onclick="addComp()">公司</a>
<a class="easyui-linkbutton" href="#" data-options="iconCls:'icon-add',plain:true" onclick="addDept()">部门</a>
</div>
<ul id="unitTree" class="easyui-tree" data-options="method:'get',animate:true"></ul>
</div>
<div id="rightdiv" data-options="region:'center'" style="overflow: hidden;">
<iframe id="mainFrame" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;" frameBorder="0" scrolling="auto"></iframe>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,153 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave(dialog,grid) {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/saveUser.do", $(".form").serialize(), function(data) {
if (data.res == 1) {
var resmsg="";
//保存职位
var jobval = String($('#_jobs').combobox('getValues'));
$.post(ext.contextPath + "/user/updateJobByUserid.do",{jobstr:jobval,userid:data.id,unitid:$('#pid').val()},function(data1){
if(data1<0){
resmsg="职位保存失败 ";
}
});
//保存权限
var val = String($('#_roles').combobox('getValues'));
$.post(ext.contextPath + "/user/updateRoleUser.do",{rolestr:val,userid:data.id},function(data1){
if(data1<0){
resmsg+="权限保存失败";
}
});
if(resmsg.indexOf("失败")>0){
top.$.messager.alert('提示', resmsg, 'info');
}else{
top.$.messager.alert('提示', "保存成功", 'info',function(){
grid.datagrid('reload');
dialog.dialog('destroy');
});
}
}else if(data.res == 0){
top.$.messager.alert('提示', "保存失败", 'info');
}else{
top.$.messager.alert('提示', data.res, 'info');
}
},'json');
}
}
$(function() {
$('#pname').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
onBeforeSelect:function(node){
if(node.id=="-1"){
$("#pname").tree("unselect");
}
},
onClick : function(node) {
$("#pid").val(node.id);
}
});
$('#_jobs').combobox({
url:ext.contextPath + '/user/getJsonJob.do',
valueField:'id',
textField:'name',
multiple:true,
editable:false
});
$('#_roles').combobox({
url:ext.contextPath + '/user/getJsonRole.do',
valueField:'id',
textField:'name',
required:true,
multiple:true,
editable:false
});
});
</script>
</head>
<body>
<form method="post" class="form">
<table class="table">
<tr>
<th>登录名</th>
<td><input name="name" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="" /></td>
</tr>
<tr>
<th>姓名</th>
<td><input name="caption" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value=""/></td>
</tr>
<tr>
<th>工号</th>
<td><input name="serial" class="easyui-textbox" value="" /></td>
</tr>
<tr>
<th>卡号</th>
<td><input name="cardid" class="easyui-textbox" value="" /></td>
</tr>
<tr>
<th>性别</th>
<td>
<select name="sex" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
<option value="">请选择</option>
<option value="1">男</option>
<option value="0">女</option>
</select>
</td>
</tr>
<tr>
<th>部门</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="" />
<input id="pid" name="pid" type="hidden" value=""/>
</td>
</tr>
<tr>
<th>职位</th>
<td>
<input id="_jobs" name="_jobs" class="easyui-combobox" value="" />
</td>
</tr>
<tr>
<th>手机</th>
<td><input name="mobile" class="easyui-textbox" value="" /></td>
</tr>
<tr>
<th>权限</th>
<td>
<input id="_roles" name="_roles" class="easyui-combobox" style="width:300px" value=""/>
</td>
</tr>
<tr>
<th>用户状态</th>
<td>
<select name="active" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
<option value="1">启用</option>
<option value="0">禁用</option>
<option value="3">离职</option>
<option value="2">退休</option>
</select>
</td>
</tr>
<tr>
<th>顺序</th>
<td><input name="morder" class="easyui-textbox" value="0" /></td>
</tr>
</table>
</form>
</body>
</html>

View File

@ -0,0 +1,180 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function dosave(dialog,grid) {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/user/updateUser.do", $(".form").serialize(), function(data) {
if (data.res == 1) {
var resmsg="";
//保存职位
var jobval = String($('#_jobs').combobox('getValues'));
$.post(ext.contextPath + "/user/updateJobByUserid.do",{jobstr:jobval,userid:data.id,unitid:$('#pid').val()},function(data1){
if(data1<0){
resmsg="职位保存失败 ";
}
});
//保存权限
var val = String($('#_roles').combobox('getValues'));
$.post(ext.contextPath + "/user/updateRoleUser.do",{rolestr:val,userid:data.id},function(data1){
if(data1<0){
resmsg+="权限保存失败";
}
});
if(resmsg.indexOf("失败")>0){
top.$.messager.alert('提示', resmsg, 'info');
}else{
top.$.messager.alert('提示', "保存成功", 'info',function(){
grid.datagrid('reload');
dialog.dialog('destroy');
});
}
}else if(data.res == 0){
top.$.messager.alert('提示', "保存失败", 'info');
}else{
top.$.messager.alert('提示', data.res, 'info');
}
},'json');
}
}
function initroles(){
var roleids = "";
<c:forEach var="role" items="${user.roles}">
roleids+="${role.id},";
</c:forEach>
$('#_roles').combobox('setValues',roleids.replace(/,$/g,""));
}
function initjobs(){
var jobids = "";
<c:forEach var="job" items="${user.jobs}">
if("${job.id}"!=""){
jobids+="${job.id},";
}
</c:forEach>
if(jobids!=""){
$('#_jobs').combobox('setValues',jobids.replace(/,$/g,""));
}
}
$(function() {
$('#pname').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
onBeforeSelect:function(node){
if(node.id=="-1"){
$("#pname").tree("unselect");
}
},
onClick : function(node) {
$("#pid").val(node.id);
}
});
$('#_jobs').combobox({
url:ext.contextPath + '/user/getJsonJob.do',
valueField:'id',
textField:'name',
multiple:true,
editable:false,
onLoadSuccess:function(){
initjobs();
}
});
$('#_roles').combobox({
url:ext.contextPath + '/user/getJsonRole.do',
valueField:'id',
textField:'name',
required:true,
multiple:true,
editable:false,
onLoadSuccess:function(){
initroles();
}
});
});
</script>
</head>
<body>
<form method="post" class="form">
<input type="hidden" name="id" value="${user.id }"/>
<table class="table">
<tr>
<th>名称</th>
<td><input name="name" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="${user.name}" /></td>
</tr>
<tr>
<th>姓名</th>
<td><input name="caption" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="${user.caption}" /></td>
</tr>
<tr>
<th>工号</th>
<td><input name="serial" class="easyui-textbox" value="${user.serial}" /></td>
</tr>
<tr>
<th>卡号</th>
<td><input name="cardid" class="easyui-textbox" value="${user.cardid}" /></td>
</tr>
<tr>
<th>性别</th>
<td>
<select name="sex" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
<option value="">请选择</option>
<option value="1" <c:if test="${user.sex=='1'}">selected</c:if>>男</option>
<option value="0" <c:if test="${user.sex=='0'}">selected</c:if>>女</option>
</select>
</td>
</tr>
<tr>
<th>部门</th>
<td>
<input id="pname" name="pname" class="easyui-combotree" value="${user._pname}" />
<input id="pid" name="pid" type="hidden" value="${user.pid}"/>
</td>
</tr>
<tr>
<th>职位</th>
<td>
<input id="_jobs" name="_jobs" class="easyui-combobox" value="" />
</td>
</tr>
<tr>
<th>手机</th>
<td><input name="mobile" class="easyui-textbox" value="${user.mobile}" /></td>
</tr>
<tr>
<th>权限</th>
<td>
<input id="_roles" name="_roles" class="easyui-combobox" style="width:300px" value=""/>
</td>
</tr>
<tr>
<th>用户状态</th>
<td>
<select name="active" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
<option value="1">启用</option>
<option value="0" <c:if test="${user.sex=='0'}">selected</c:if>>禁用</option>
<option value="3" <c:if test="${user.sex=='3'}">selected</c:if>>离职</option>
<option value="2" <c:if test="${user.sex=='2'}">selected</c:if>>退休</option>
</select>
</td>
</tr>
<tr>
<th>顺序</th>
<td><input name="morder" class="easyui-textbox" value="${user.morder}" /></td>
</tr>
</table>
</form>
</body>
</html>

View File

@ -0,0 +1,164 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
function doSearch(orgids,type){
document.getElementById("prompt").style.visibility="hidden";
$.getJSON(ext.contextPath +"/user/queryUsers.do?orgid="+orgids+"&type="+type+"",callback);
}
function callback(data){
$("#a_Users").empty();
if(data.rows.length > 0)
{
for(var i = 0;i<data.rows.length;i++){
var userid = data.rows[i].id;
var username = data.rows[i].caption;
$("#a_Users").append("<option value='"+userid+"'>"+username+"</option>");
}
}else{
document.getElementById("prompt").style.visibility="visible";//显示
}
}
function addToSelect(){
var selectid=$("#a_Users option:selected").val();
var selecttext=$("#a_Users option:selected").text()
for (var i = 0; i < $("#a_selectUsers option").length; i++) {
if($("#a_selectUsers").get(0).options[i].value==selectid){
return;
}
}
if(selectid=='undefined' ||selectid==null ||selectid==""){
return;
}
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
}
function removeFromSelect(){
var selOpt = $("#a_selectUsers option:selected");
selOpt.remove();
}
function removeFromSelectAll(){
top.$.messager.confirm("提示","是否清除全部已选人员?",function(res){
if(res){
$("#a_selectUsers").empty();
}
});
}
function addToSelectAll(){
for(var i=0;i<$("#a_Users option").length;i++){
var flag=0;
var selectid=$("#a_Users").get(0).options[i].value;
var selecttext=$("#a_Users").get(0).options[i].text;
for (var j = 0; j < $("#a_selectUsers option").length; j++) {
if($("#a_selectUsers").get(0).options[j].value==selectid){
flag=1;
}
}
if(flag==0) {
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
}
}
}
function addToSelectMulti(){
for(var i=0;i<$("#a_Users option").length;i++){
if($("#a_Users").get(0).options[i].selected){
var flag=0;
var selectid=$("#a_Users").get(0).options[i].value;
var selecttext=$("#a_Users").get(0).options[i].text;
for (var j = 0; j < $("#a_selectUsers option").length; j++) {
if($("#a_selectUsers").get(0).options[j].value==selectid){
flag=1;
}
}
if(flag==0) {
$("#a_selectUsers").append("<option value='"+selectid+"'>"+selecttext+"</option>");
}
}
}
}
function getUser(){
document.getElementById("prompt").style.visibility="hidden";
var username = $('#queryusername').val();
$.getJSON(ext.contextPath +"/user/queryUsers.do?queryusername="+encodeURI(encodeURI(username)), callback );
}
function selectOK() {
var useridname="";
for(var i=0;i<$("#a_selectUsers option").length;i++){
useridname+=$("#a_selectUsers").get(0).options[i].value+","+$("#a_selectUsers").get(0).options[i].text+";";
}
var retn=useridname;
return retn;
}
$(function() {
$('#unitTree').tree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
onClick : function(node) {
if(node.pid != ''){
doSearch(node.id,node.attributes.type);
}
}
});
var recvid=parent.$('#'+'${param.iframeId}')[0].contentWindow.$("#"+'${param.recvid}').val();
$.getJSON(ext.contextPath +"/user/getRecvusersJson.do?recvid="+recvid, function(data){
$("#a_selectUsers").empty();
for(var i = 0;i<data.rows.length;i++){
var userid = data.rows[i].id;
var username = data.rows[i].caption;
$("#a_selectUsers").append("<option value='"+userid+"'>"+username+"</option>");
}
});
});
</script>
</head>
<body style="margin:0px">
<input id="recvid" name="recvid" type="hidden" />
<div style="background-color:#f4f4f4;padding-top:2px;padding-bottom:2px;border-bottom:1px solid #e4e4e4;font-size:12px;">
<span style="padding:2px 5px 2px 5px">姓名</span>
<input id="queryusername" name="queryusername" class="easyui-searchbox" style="width: 180px;"
data-options="prompt:'请输入关键字',searcher:getUser" />
<span id="prompt" name="prompt" style="color:red;visibility:hidden;padding:2px 5px 2px 5px">无用户</span>
</div>
<table cellspacing="2" cellpadding="0" style="font-size:12px;">
<tr>
<td valign="top" style="border:1px solid #e4e4e4">
<div style="width: 250px;height: 370px;overflow:auto">
<ul id="unitTree" class="easyui-tree" data-options="method:'get',animate:true"></ul>
</div>
</td>
<td valign="top" style="border:1px solid #e4e4e4">
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
人员 (双击选择)
</div>
<select name="a_Users" id="a_Users" ondblclick="addToSelect()"
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
</td>
<td valign="top" style="border:1px solid #e4e4e4">
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
已选 (双击移除)
</div>
<select name="a_selectUsers" id="a_selectUsers" ondblclick="removeFromSelect();"
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,170 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
function doSearch(orgids,type){
document.getElementById("prompt").style.visibility="hidden";
$.getJSON(ext.contextPath +"/user/queryUsers.do?orgid="+orgids+"&type="+type+"",callback);
}
function callback(data){
$("#a_Users").empty();
// if(data.resultcode=='SUCCESS'){
if(data.rows.length > 0)
{
for(var i = 0;i<data.rows.length;i++){
//alert(data.object[i].usercode);
var userid = data.rows[i].id;
//var username = data.object[i].username+"("+data.object[i].usercode+")";
var username = data.rows[i].name;
$("#a_Users").append("<option value='"+userid+"'>"+username+"</option>");
}
}else{
document.getElementById("prompt").style.visibility="visible";//显示
}
//}else{
// document.getElementById("prompt").style.visibility="visible";//显示
//}
}
function addToSelect(){
// getAllselect('a_Users');
//removeFromSelect();
$("#a_selectUsers").append("<option value='"+$("#a_Users option:selected").val()+"'>"+$("#a_Users option:selected").text()+"</option>");
}
function removeFromSelect(){
var selOpt = $("#a_selectUsers option:selected");
selOpt.remove();
}
function removeFromSelectAll(){
$("#a_selectUsers").empty();
}
function addToSelectAll(){
//$("#a_selectUsers").empty();
for(var i=0;i<$("#a_Users option").length;i++){
$("#a_selectUsers").append("<option value='"+$("#a_Users").get(0).options[i].value+"'>"+$("#a_Users").get(0).options[i].text+"</option>");
}
}
function addToSelectMulti(){
for(var i=0;i<$("#a_Users option").length;i++){
if($("#a_Users").get(0).options[i].selected){
$("#a_selectUsers").append("<option value='"+$("#a_Users").get(0).options[i].value+"'>"+$("#a_Users").get(0).options[i].text+"</option>");
}
}
}
function getUser(){
document.getElementById("prompt").style.visibility="hidden";
var username = $('#queryusername').val();
$.getJSON(ext.contextPath +"/user/queryUsers.do?queryusername="+encodeURI(encodeURI(username)), callback );
}
function selectOK() {
var username="",userid="";
for(var i=0;i<$("#a_selectUsers option").length;i++){
userid+=$("#a_selectUsers").get(0).options[i].value+",";
username+=$("#a_selectUsers").get(0).options[i].text+",";
}
var retn= userid+")"+username;
//alert(retn);
return retn;
}
/* function selectCancel() {
alert('提示', "取消操作", 'info');
} */
$(function() {
$('#unitTree').tree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
onClick : function(node) {
if(node.pid != ''){
// if(node.attributes.type=='D'){
doSearch(node.id,node.attributes.type);
// }else{
// doSearch(node.id);
// }
}
}
});
$.each(eval('${json}'), function(index, item){
$("#a_selectUsers").append("<option value='"+item.id+"'>"+item.caption+"</option>");
});
});
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="divadd" style="display:block;">
<div>
<div >
<table width="100%" class="easyui-datagrid" toolbar="#tb" border="0">
</table>
<div id="tb" >
<span style="font-size:12px">&nbsp;&nbsp;姓名查询</span>
<input class="easyui-searchbox" type="text" style=" width: 180px;" data-options="prompt:'请输入关键字',searcher:getUser" id="queryusername"
name="queryusername" />
<!-- <a class="easyui-linkbutton" data-options="iconCls:'icon-search'" href="#" onclick="getUser();" -->
<!-- style="width:80px;height:24px">查询</a> -->
<span id="prompt" name="prompt" style="color: red;visibility:hidden">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;无用户</span>
</div>
<table width="100%" cellspacing="0">
<tr>
<th width="40%">
<div
style="width: 100%; height: 340px;overflow: auto; overflow-x:hidden; text-align: left;font-Weight:normal">
<div region="west" style="padding: 4px;width: 200px;"
border="false" >
<%-- <fsdp:tree id="tt"
url="${ctx}/jsp/user/unitTree"
onclick="clickTree"></fsdp:tree> --%>
<ul id="unitTree" class="easyui-tree" data-options="method:'get',animate:true"></ul>
</div>
</div>
</th>
<td id="usertd1" style="width:170px;"><span style="font-size:12px">人员(双击选择) </span><br /> <select
name="a_Users" id="a_Users" style="width:170px; height:340px;margin:-2px"
ondblclick="addToSelect()" multiple="multiple" border="1px solid #FFF;"></select>
</td>
<td id="usertd2" style="width:160px;"><span style="font-size:12px">已选(双击移除) </span><br/>
<select name="a_selectUsers" id="a_selectUsers"
ondblclick="removeFromSelect();"
style="width:160px; height:340px;margin:-2px" multiple="multiple" border="1px solid #FFF;"></select>
</td>
</tr>
<!-- <tr style="height: 10px;"></tr> -->
<!-- <tr>
<td class="nobg" colspan="3" align="center"
style="text-align:center;">
<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)"
onclick="addToSelect();" style="width:80px">添加</a>
<a class="easyui-linkbutton" data-options="iconCls:'icon-no'"
href="javascript:void(0)" onclick="removeFromSelect();"
style="width:80px">移出</a>
<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="addToSelectAll();"style="width:80px">全部添加</a>
<a class="easyui-linkbutton" data-options="iconCls:'icon-reload'" href="javascript:void(0)" onclick="removeFromSelectAll();" style="width:80px">全部移出</a>
<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
href="javascript:void(0)" onclick="selectOK();"
style="width:80px">确定</a>
</td>
</tr> -->
</table>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,96 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
returnstr="";
function doSearch(orgids,type){
document.getElementById("prompt").style.visibility="hidden";
$.getJSON(ext.contextPath +"/user/queryUsers.do?orgid="+orgids+"&type="+type+"",callback);
}
function callback(data){
$("#a_Users").empty();
if(data.rows.length > 0)
{
for(var i = 0;i<data.rows.length;i++){
var userid = data.rows[i].id;
var username = data.rows[i].caption;
$("#a_Users").append("<option value='"+userid+"'>"+username+"</option>");
}
}else{
document.getElementById("prompt").style.visibility="visible";//显示
}
}
function addToSelect(){
var selectid=$("#a_Users option:selected").val();
var selecttext=$("#a_Users option:selected").text();
returnstr=selectid+","+selecttext;
}
function getUser(){
document.getElementById("prompt").style.visibility="hidden";
var username = $('#queryusername').val();
$.getJSON(ext.contextPath +"/user/queryUsers.do?queryusername="+encodeURI(encodeURI(username)), callback );
}
function selectOK() {
addToSelect();
return returnstr;
}
$(function() {
$('#unitTree').tree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
onClick : function(node) {
if(node.pid != ''){
doSearch(node.id,node.attributes.type);
}
}
});
var recvid=parent.$('#'+'${param.iframeId}')[0].contentWindow.$("#"+'${param.recvid}').val();
$.getJSON(ext.contextPath +"/user/getRecvusersJson.do?recvid="+recvid, function(data){
$("#a_selectUsers").empty();
for(var i = 0;i<data.rows.length;i++){
var userid = data.rows[i].id;
var username = data.rows[i].caption;
$("#a_selectUsers").append("<option value='"+userid+"'>"+username+"</option>");
}
});
});
</script>
</head>
<body style="margin:0px">
<input id="recvid" name="recvid" type="hidden" />
<div style="background-color:#f4f4f4;padding-top:2px;padding-bottom:2px;border-bottom:1px solid #e4e4e4;font-size:12px;">
<span style="padding:2px 5px 2px 5px">姓名</span>
<input id="queryusername" name="queryusername" class="easyui-searchbox" style="width: 180px;"
data-options="prompt:'请输入关键字',searcher:getUser" />
<span id="prompt" name="prompt" style="color:red;visibility:hidden;padding:2px 5px 2px 5px">无用户</span>
</div>
<table cellspacing="2" cellpadding="0" style="font-size:12px;">
<tr>
<td valign="top" style="border:1px solid #e4e4e4">
<div style="width: 250px;height: 370px;overflow:auto">
<ul id="unitTree" class="easyui-tree" data-options="method:'get',animate:true"></ul>
</div>
</td>
<td valign="top" style="border:1px solid #e4e4e4">
<div style="background-color:#f4f4f4;padding:2px 5px 2px 5px;border-bottom:1px solid #e4e4e4">
人员 (单击选择)
</div>
<select name="a_Users" id="a_Users" onclick="addToSelect()"
style="width:160px; height:350px;border:0px;padding:2px;" multiple="multiple"></select>
</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,312 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.sipai.tools.SessionManager"%>
<%
SessionManager sessionManager = new SessionManager();
%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<script type="text/javascript">
var grid;
var addFun = function() {
var dialog = parent.ext.modalDialog({
title : '添加用户信息',
url : ext.contextPath + '/user/addUser.do',
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
}
} ]
});
};
var viewFun = function(id) {
var dialog = parent.ext.modalDialog({
title : '查看用户信息',
url : ext.contextPath + '/user/viewUser.do?id=' + id
});
};
var editFun = function(id) {
var dialog = parent.ext.modalDialog({
title : '编辑用户信息',
url : ext.contextPath + '/user/editUser.do?id=' + id,
buttons : [ {
text : '保存',
handler : function() {
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
}
} ]
});
};
var pwdFun = function(id) {
parent.$.messager.confirm('提示', '您确定要重置密码?', function(r) {
if (r) {
$.post(ext.contextPath + '/user/resetPwd.do', {id : id}, function(data) {
if(data.res==1){
parent.$.messager.alert('提示','重置成功','info');
grid.datagrid('reload');
}else{
parent.$.messager.alert('提示','重置失败','info');
}
},'json');
}
});
};
var deleteFun = function(id) {
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/user/deleteUser.do', {id : id}, function(data) {
if(data==1){
parent.$.messager.alert('提示','删除成功','info');
grid.datagrid('reload');
}else{
parent.$.messager.alert('提示','删除失败','info');
}
});
}
});
};
var deletesFun = function() {
var checkedItems = $('#grid').datagrid('getChecked');
var datas="";
$.each(checkedItems, function(index, item){
datas+=item.id+",";
});
//alert(datas);
if(datas==""){
top.$.messager.alert('提示', '请先选择要删除的记录','info');
}else{
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
if (r) {
$.post(ext.contextPath + '/user/deleteUsers.do', {ids:datas} , function(data) {
if(data>0){
parent.$.messager.alert('提示','成功删除'+data+'条记录','info');
grid.datagrid('reload');
grid.datagrid('clearChecked');
}else{
parent.$.messager.alert('提示','删除失败','info');
}
});
}
});
}
};
var downFun = function() {
searchForm.action = ext.contextPath + '/user/downtemplate.do';
searchForm.submit();
};
var importFun = function() {
var dialog = parent.ext.modalDialog({
title : '选择文件',
width: 600,
height:300,
closeOnEscape:true,
url : ext.contextPath + '/user/doimport.do',
buttons : [ {
text : '导入数据',
handler : function() {
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
}
} ]
});
};
var importFun2 = function() {
var dialog = parent.ext.modalDialog({
title : '选择文件',
width: 600,
height:300,
closeOnEscape:true,
url : ext.contextPath + '/user/doimport2.do',
buttons : [ {
text : '导入数据',
handler : function() {
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
}
} ]
});
};
var exportFun = function() {
//通过response导出用户自己选择路径
searchForm.action = ext.contextPath + '/user/exportUsersByResponse.do';
searchForm.submit();
var win = $.messager.progress({
title:'提示',
msg:'文件正在导出,请稍后...'
});
setTimeout(function(){
$.messager.progress('close');
},3000);
/* //后台输出
$.post(ext.contextPath + '/user/exportUsers.do',function(data) {
$.messager.progress('close');
if(data!=''){
$.messager.alert('提示',data,'info');
}else{
$.messager.alert('提示','导出失败','info');
}
}); */
};
$(function() {
grid = $('#grid').datagrid({
title : '',
url : ext.contextPath + '/user/getUsers.do',
striped : true,
rownumbers : true,
pagination : true,
singleSelect: false,
ctrlSelect:true,
selectOnCheck: false,
checkOnSelect: false,
idField : 'id',
pageSize : 50,
pageList : [ 20, 50, 100],
columns : [ [
{checkbox:true , field : 'ck'},
{width : '100', title : '登录名', field : 'name', sortable : true, halign:'center'},
{width : '80', title : '姓名', field : 'caption', sortable : true, halign:'center'},
{width : '180', title : '部门', field : '_pname', halign:'center'},
{width : '100', title : '职位', field : 'jobs', halign:'center',formatter : function(value, row, index) {
var res="";
for(var i=0;i<value.length;i++){
res+=value[i].name+", ";
}
return res.replace(/, $/g,"");
}
},
{width : '50', title : '性别', field : 'sex', sortable : true, halign:'center', align:'center', formatter : function(value, row, index) {
switch (value) {
case '0':
return '女';
case '1':
return '男';
}
}
},
{width : '100', title : '在线小时', field : 'totaltime', sortable : true, halign:'center',formatter : function(value, row, index) {
return value.toFixed(2);
}
},
{width : '150', title : '角色权限', field : 'roles', halign:'center', formatter : function(value, row, index) {
var res="";
for(var i=0;i<value.length;i++){
res+="<a class='linkbutton' href='javascript:void(0)' onclick='showMenu(\""+value[i].id+"\",\""+value[i].name+"\")'>"+value[i].name+"</a>"+", ";
}
return res.replace(/, $/g,"");
}
},
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
var str = '';
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/>';
<%if (sessionManager.havePermission(session,"user/editUser.do")) {%>
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
<%}%>
<%if (sessionManager.havePermission(session,"user/deleteUser.do")) {%>
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
<%}%>
<%if (sessionManager.havePermission(session,"user/resetPwd.do")) {%>
str += '<img class="iconImg ext-icon-table_key" title="重置密码" onclick="pwdFun(\''+row.id+'\');"/>';
<%}%>
return str;
}
}
] ],
toolbar : '#toolbar',
onLoadSuccess : function(data) {
$('.iconImg').attr('src', ext.pixel_0);
}
});
$('#search_pid').combotree({
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
parentField : 'pid',
method:'get',
panelHeight:'auto',
width:200,
onBeforeSelect:function(node){
if(node.id=="-1"){
$("#search_pid").tree("search_pid");
}
},
editable:false
});
});
function showMenu(id,name){
parent.ext.modalDialog({
title : name,
url : ext.contextPath + '/user/showRoleMenu.do?roleid=' + id
});
}
</script>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">
<div id="toolbar" style="display: none;">
<table>
<tr>
<td>
<table>
<tr>
<%if (sessionManager.havePermission(session,"user/addUser.do")) {%>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
onclick="addFun();">添加</a>
</td>
<%}%>
<%if (sessionManager.havePermission(session,"user/deleteUser.do")) {%>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
onclick="deletesFun();">删除</a>
</td>
<%}%>
<td><div class="datagrid-btn-separator"></div></td>
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_save',plain:true" onclick="downFun();">模版下载</a></td>
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="importFun();">导入</a></td>
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="importFun2();">ERP人员导入</a></td>
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="exportFun();">导出</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<form id="searchForm">
<table class="tooltable">
<tr>
<td>登录名</td>
<td><input name="search_name" class="easyui-textbox" /></td>
<td>姓名</td>
<td><input name="search_caption" class="easyui-textbox" /></td>
<td>部门</td>
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
<td>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
<div data-options="region:'center',fit:true,border:false">
<table id="grid" data-options="fit:true,border:false"></table>
</div>
</body>
</html>

View File

@ -0,0 +1,97 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
function initcombobox(){
var roleids = "";
<c:forEach var="role" items="${user.roles}">
roleids+="${role.name},";
</c:forEach>
if(roleids != ""){
roleids=roleids.substring(0,roleids.length-1);
}
$('#role').text(roleids);
var jobids = "";
<c:forEach var="job" items="${user.jobs}">
jobids+="${job.name},";
</c:forEach>
if(jobids != ""){
jobids=jobids.substring(0,jobids.length-1);
}
$('#job').text(jobids);
}
$(function() {
initcombobox();
});
</script>
</head>
<body>
<form method="post" class="form">
<input type="hidden" name="id" value="${user.id }"/>
<table class="table">
<tr>
<th>名称</th>
<td>${user.name}</td>
</tr>
<tr>
<th>姓名</th>
<td>${user.caption}</td>
</tr>
<tr>
<th>工号</th>
<td>${user.serial}</td>
</tr>
<tr>
<th>卡号</th>
<td>${user.cardid}</td>
</tr>
<tr>
<th>性别</th>
<td>
<c:if test="${user.sex=='1'}">男</c:if>
<c:if test="${user.sex=='0'}">女</c:if>
</td>
</tr>
<tr>
<th>部门</th>
<td>
${user._pname}
</td>
</tr>
<tr>
<th>职位</th>
<td>
<span id="job"></span>
</td>
</tr>
<tr>
<th>权限</th>
<td>
<span id="role"></span>
</td>
</tr>
<tr>
<th>用户状态</th>
<td>
<c:if test="${user.sex=='1'}">启用</c:if>
<c:if test="${user.sex=='0'}">禁用</c:if>
<c:if test="${user.sex=='3'}">离职</c:if>
<c:if test="${user.sex=='2'}">退休</c:if>
</td>
</tr>
<tr>
<th>顺序</th>
<td>${user.morder}</td>
</tr>
</table>
</form>
</body>
</html>