Browse Source

git-svn-id: https://192.168.57.71/svn/jsgkj@738 931142cf-59ea-a443-aa0e-51397b428577

ld_zhoutl 8 years ago
parent
commit
05eaa71cf8

+ 17 - 3
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/ctl/UserCtl.java

@@ -49,11 +49,25 @@ public class UserCtl extends BaseCtl {
 
     @RequestMapping("add")
     @ResponseBody
-    public WebJsonResult add() {
+    public WebJsonResult add(UserVo vo) {
         UserModel user = new UserModel();
-        user.setLoginName("test2");
-        user.setRealName("²âÊÔ");
+        user.setLoginName(vo.getLoginName());
+        user.setRealName(vo.getRealName());
         userService.add(user);
         return success();
     }
+
+    @RequestMapping("del")
+    @ResponseBody
+    public WebJsonResult del(String id) {
+        userService.deleteByID(id);
+        return success();
+    }
+
+    @RequestMapping("initEdit")
+    @ResponseBody
+    public UserModel initEdit(String id) {
+    	UserModel model = userService.findById(id);
+        return model;
+    }
 }

+ 73 - 1
gkaqv2/trunk/modules/web/src/main/java/com/xt/js/gkaq/web/vo/UserVo.java

@@ -3,5 +3,77 @@ package com.xt.js.gkaq.web.vo;
 import com.xt.js.gkaq.common.BaseVo;
 
 public class UserVo extends BaseVo{
-	
+
+	/** 用户真实姓名 */
+	private String realName;
+	/** 登录账号 */
+	private String loginName;
+	/** 登录密码 */
+	private String loginPassword;
+	/** 所在部门 */
+	private String orgid;
+	/** 性别 */
+	private String sex;
+	/** 联系电话 */
+	private String phone;
+	/** 电子邮件地址 */
+	private String email;
+	/** 人员类型(行政人员 1、经营人2、船代3等) */
+	private String rylx;
+	/** 账号失效时间 */
+	private String sxsj;
+	public String getRealName() {
+		return realName;
+	}
+	public void setRealName(String realName) {
+		this.realName = realName;
+	}
+	public String getLoginName() {
+		return loginName;
+	}
+	public void setLoginName(String loginName) {
+		this.loginName = loginName;
+	}
+	public String getLoginPassword() {
+		return loginPassword;
+	}
+	public void setLoginPassword(String loginPassword) {
+		this.loginPassword = loginPassword;
+	}
+	public String getOrgid() {
+		return orgid;
+	}
+	public void setOrgid(String orgid) {
+		this.orgid = orgid;
+	}
+	public String getSex() {
+		return sex;
+	}
+	public void setSex(String sex) {
+		this.sex = sex;
+	}
+	public String getPhone() {
+		return phone;
+	}
+	public void setPhone(String phone) {
+		this.phone = phone;
+	}
+	public String getEmail() {
+		return email;
+	}
+	public void setEmail(String email) {
+		this.email = email;
+	}
+	public String getRylx() {
+		return rylx;
+	}
+	public void setRylx(String rylx) {
+		this.rylx = rylx;
+	}
+	public String getSxsj() {
+		return sxsj;
+	}
+	public void setSxsj(String sxsj) {
+		this.sxsj = sxsj;
+	}
 }

+ 4 - 0
gkaqv2/trunk/modules/web/src/main/webapp/WEB-INF/view/layouts/header.jsp

@@ -15,9 +15,13 @@
 
 <link rel="shortcut icon" href="<%=request.getContextPath()%>/static/images/system.ico" />
 
+<link rel="stylesheet" href="<%=request.getContextPath()%>/static/bootstrap-3.3.0/dist/css/bootstrap.min.css">
+<link rel="stylesheet" href="<%=request.getContextPath()%>/static/bootstrap-3.3.0/dist/css/bootstrap-theme.min.css">
+
 <link rel="stylesheet" href="<%=request.getContextPath()%>/static/js/common/jqgrid/ui.jqgrid.css" />
 <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/common/basic.css" />
 
+
 <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/common/main.css" />
 
 <%@ include file="scripts.jsp"%>

+ 2 - 1
gkaqv2/trunk/modules/web/src/main/webapp/WEB-INF/view/layouts/scripts.jsp

@@ -6,11 +6,12 @@
     var basePath = '<%=request.getContextPath()%>';
     var _rowNum = 10;
     var _rowList = [ 10, 20, 50 ];
+    var currentLayerIndex = -1;
 </script>
 <script type="text/javascript" src="<%=request.getContextPath()%>/static/js/jquery-1.11.3.js"></script>
 
 <script type="text/javascript" src="<%=request.getContextPath()%>/static/js/common/layer/layer.js"></script>
-
+<script src="<%=request.getContextPath()%>/static/bootstrap-3.3.0/dist/js/bootstrap.min.js"></script>
 
 <script src="<%=request.getContextPath()%>/static/js/common/jqgrid/jquery.jqGrid.src.js"></script>
 <script src="<%=request.getContextPath()%>/static/js/common/jqgrid/i18n/grid.locale-cn.js"></script>

+ 50 - 87
gkaqv2/trunk/modules/web/src/main/webapp/WEB-INF/view/user/index.jsp

@@ -17,20 +17,24 @@
 		</div>
 		<div class="p_buttondiv">
 			<div class="p_buttonbg">
-				<img class="p_buttonimg" src="<%=base%>/static/images/list/add.png" title="新增"/>
+				<img class="p_buttonimg" src="<%=base%>/static/images/list/add.png" 
+					onclick="addInfo()" title="新增"/>
 			</div>
 			<div class="p_buttonbg">
-				<img class="p_buttonimg" src="<%=base%>/static/images/list/delete.png" title="删除"/>
+				<img class="p_buttonimg" src="<%=base%>/static/images/list/delete.png" 
+					onclick="delInfo()" title="删除"/>
 			</div>
 			<div class="p_buttonbg">
-				<img class="p_buttonimg" src="<%=base%>/static/images/list/edit.png" title="修改"/>
+				<img class="p_buttonimg" src="<%=base%>/static/images/list/edit.png" 
+					onclick="editInfo()" title="修改"/>
 			</div>
 			<div class="p_buttonbg">
 				<img class="p_buttonimg" src="<%=base%>/static/images/list/search.png" 
 					onclick="showSearch()" title="查询"/>
 			</div>
 			<div class="p_buttonbg">
-				<img class="p_buttonimg" src="<%=base%>/static/images/list/print.png" title="打印"/>
+				<img class="p_buttonimg" src="<%=base%>/static/images/list/print.png" 
+					onclick="printInfo()" title="打印"/>
 			</div>
 		</div>
 		<div class="p_searchdiv">
@@ -49,7 +53,8 @@
 						<input type="text" id="username2" name="username2" 
 							class="p_txt" value=""></td>
 					<td class="tdname">
-						<img class="p_searchbtn" src="<%=base%>/static/images/list/btn_query.png" title="查询"/>
+						<img class="p_searchbtn" src="<%=base%>/static/images/list/btn_query.png" title="查询"
+							onclick="searchRecord()"/>
 					</td>
 				</tr>
 			</table>
@@ -63,89 +68,47 @@
 	</div>
 	
 	<!--弹出新增界面-->
-	<!-- <div id="modal-table" class="modal fade" tabindex="-1">
-			<div class="modal-dialog" style="width: 700px; height: 500px;">
-				<div class="modal-content">
-					<div class="modal-header no-padding">
-						<div class="table-header">
-							<button type="button" class="close" data-dismiss="modal"
-								aria-hidden="true">
-								<span class="white">&times;</span>
-							</button>
-							<label class="modal-title" id="myModalLabel"></label>
-						</div>
-					</div>
-					<div class="modal-body no-padding">
-						<form class="form-horizontal" id="form" method="post"
-							onsubmit="return false;">
-							<input type="hidden" id="id" name="id">
-							<div class="form-group">
-								<label for="name" class="col-sm-2 control-label">任务名称</label>
-								<div class="col-sm-3">
-									<div id="nameError"></div>
-									<input type="text" class="form-control limited {required:true}"
-										id="name" name="name" maxlength="100">
-								</div>
-								<div class="col-sm-1">
-									<span id="nameImageTip" class="sp_yes"
-										style="display: none"></span>
-								</div>
-								<label for="code" class="col-sm-2 control-label">任务编码</label>
-								<div class="col-sm-3">
-									<div id="codeError"></div>
-									<input type="text" class="form-control limited {required:true}"
-										id="code" name="code" maxlength="100"
-										placeholder="">
-								</div>
-								<div class="col-sm-1">
-									<span id="codeImageTip" class="sp_yes"
-										style="display: none"></span>
-								</div>
-							</div>
-							<div class="form-group">
-								<label for="jobCode" class="col-sm-2 control-label">所在工作</label>
-								<div class="col-sm-3">
-                                    <select class="form-control" id="jobCode" name="jobCode">
-                                    </select>
-								</div>
-								<div class="col-sm-1"></div>
-								<label for="type" class="col-sm-2 control-label">任务类型</label>
-								<div class="col-sm-3">
-                                    <select class="form-control" id="type" name="type">
-	                                    <option selected value='1'>sql同步任务</option>
-                                    </select>
-								</div>
-							</div>
-							<div class="form-group">
-								<label for="cacheUse" class="col-sm-2 control-label">是否存在缓存</label>
-								<div class="col-sm-3">
-                                    <select class="form-control" id="cacheUse" name="cacheUse">
-	                                    <option selected value='1'>是</option>
-	                                    <option selected value='0'>否</option>
-                                    </select>
-								</div>
-							</div>
-							<div class="form-group">
-								<label for="cacheFolder" class="col-sm-2 control-label">缓存目录</label>
-								<div class="col-sm-9">
-									<input type="text" class="form-control limited" id="cacheFolder"
-										name="cacheFolder" maxlength="200" placeholder="">
-								</div>
-							</div>
-					
-					<div class="modal-footer no-margin-top center modal-foot-border">
-						<button id="btnSave" class="btn btn-success btn-round btn-sm">
-							<i class="ace-icon fa fa-save"></i> 保存
-						</button>
-						<button type="button" class="btn btn-grey btn-round btn-sm"
-							onclick="closeWin()">
-							<i class="ace-icon fa fa-remove"></i> 关闭
-						</button>
-					</div>
-					</form>
+	<div id="modal-table" style="display: none;">
+		<form class="form-horizontal" id="form" method="post"
+			onsubmit="return false;">
+			<input type="hidden" id="id" name="id">
+			<div class="form-group">
+				<label class="col-sm-2 control-label" for="ds_host">真实姓名</label>
+				<div class="col-sm-4">
+					<input class="form-control" id="realName" name="realName" type="text"
+						placeholder="" />
+				</div>
+				<label class="col-sm-2 control-label" for="ds_name">登录账号</label>
+				<div class="col-sm-4">
+					<input class="form-control" id="loginName" name="loginName" type="text"
+						placeholder="" />
 				</div>
 			</div>
-		</div>
-	</div> -->
+			<div class="form-group">
+				<label class="col-sm-2 control-label" for="ds_username">xxx</label>
+				<div class="col-sm-4">
+					<input class="form-control" id="ds_username" type="text"
+						placeholder="root" />
+				</div>
+				<label class="col-sm-2 control-label" for="ds_password">yyy</label>
+				<div class="col-sm-4">
+					<input class="form-control" id="ds_password" type="password"
+						placeholder="123456" />
+				</div>
+			</div>
+			<div class="form-group">
+		        <div class="col-sm-offset-4 col-sm-4">
+					<button id="btnSave" class="btn btn-success btn-round btn-sm"
+						onclick="save('save')">
+						<i class="fa fa-save"></i> 保存
+					</button>
+					<button type="button" class="btn btn-grey btn-round btn-sm"
+						onclick="closeWin()">
+						<i class="fa fa-remove"></i> 关闭
+					</button>
+	      		</div>
+			</div>
+		</form>
+	</div>
 </body>
 </html>

+ 1 - 1
gkaqv2/trunk/modules/web/src/main/webapp/static/css/common/basic.css

@@ -14886,7 +14886,7 @@ img.editable-click:hover {
   overflow: visible;
 }
 .ui-jqgrid .ui-pager-control {
-  height: 50px;
+  height: 40px;
   position: relative;
   padding-left: 9px;
   padding-right: 9px;

+ 14 - 0
gkaqv2/trunk/modules/web/src/main/webapp/static/css/common/main.css

@@ -230,3 +230,17 @@
 	margin-right: 20px;
 }
 
+body .demo-class {border: 0px solid #B9BDC2;border-radius:5px}
+body .demo-class .layui-layer-title{background:#46B5EA; color:#fff; border-top-left-radius:5px;border-top-right-radius:5px}
+body .demo-class iframe{border-bottom-left-radius:0px;border-bottom-right-radius:0px}
+
+/**
+bootstrap ÐÞ¸Ä
+*/
+.form-horizontal .form-group {
+	margin-right: 0px;
+  	margin-left: 0px;
+}
+.form-group {
+	margin-bottom: 8px;
+}

File diff suppressed because it is too large
+ 0 - 1
gkaqv2/trunk/modules/web/src/main/webapp/static/js/common/layer/layer.js


BIN
gkaqv2/trunk/modules/web/src/main/webapp/static/js/common/layer/skin/default/icon.png


File diff suppressed because it is too large
+ 0 - 0
gkaqv2/trunk/modules/web/src/main/webapp/static/js/common/layer/skin/layer.css


+ 101 - 26
gkaqv2/trunk/modules/web/src/main/webapp/static/js/user/index.js

@@ -78,8 +78,8 @@ function initGrid() {
              order : "sord"
         },
 		postData :{
-			wldwCode : function(){ return ""; },//问题内容
-			wldwName : function(){ return ""; }//服务类型
+			condition1 : function(){ return ""; },//查询条件1
+			condition2 : function(){ return ""; }//查询条件2
 		},
 		jsonReader : {
 			root : "list", // json中代表实际模型数据的入口
@@ -100,46 +100,121 @@ function initGrid() {
 };
 
 /**
+ * 查询事件
+ */
+function searchRecord() {
+	 jQuery(grid_selector).trigger("reloadGrid", [{ page: 1 }]);
+};
+
+
+/**
+ * 弹窗显示
+ * @param 
+ */
+function save(operate) {
+	$.ajax({
+		type : "post",
+		url : basePath + '/user/add',
+		dataType:'json',
+		data : $('#form').serialize()
+		, //表单序列化,获取数据
+		success : function(data) {
+			// 成功删除后刷新页面
+			if (data && data.success == true) {
+				layer.alert("数据已成功保存!");
+				closeWin();
+				searchRecord();
+			} else {
+				layer.alert("数据保存失败!");
+			}
+		}, //操作成功后的操作!data是后台传过来的值 
+		error: function (XMLHttpRequest, textStatus, errorThrown) {
+			layer.alert("error:" + errorThrown);
+        }
+	});
+}
+
+/**
  * 增加信息
  */
 function addInfo() {
-	comClearFormData("form");
-	// 隐藏校验图标
-	hideValidateTip();
-	$("#id").val("");
-	$("#btnSave").show();
-	// 启用元素
-	comEnableElements("modal-table");
-	$("#cacheUse").val("0");
-	$("#modal-table #myModalLabel").text("新增任务");
-	$('#modal-table').modal('show');
+    var width = 600;
+    var height = 380;
+    //iframe窗 右下角弹出
+    currentLayerIndex = layer.open({
+        skin: 'demo-class',
+        type: 1,
+        title: "新增",
+        shadeClose: false,
+        area: [width + "px", height + "px"],
+        content: $("#modal-table").html()
+    });
 };
 /**
  * 删除信息
  */
 function delInfo() {
-	var idsStr = getMultiData();
-	if(idsStr.length >=1 ){
-		showMsgConfimDialog("确定删除吗?",function(){
+	// 获取单行
+	var id=$(grid_selector).jqGrid('getGridParam','selrow');
+	if(null != id) {
+		layer.confirm('确定删除吗?', {icon: 3, title:'提示'}, function(index){
 			$.ajax({
-				async : false,
 				type : 'POST',
 				dataType : "json",
-				data : {"ids":idsStr, opt:'QY'},
-				url : basePath + '/task/delTask',//请求的路径				
+				data : {"id":id},
+				url : basePath + '/user/del',//请求的路径				
 				success : function(data) {
-					// 成功后刷新页面
-					if (data == "SUCCESS") {
-						showMsgDialog("数据已删除!");
-					}
-					jQuery(grid_selector).trigger("reloadGrid");
+					layer.close(index);
+//					layer.alert("数据已删除!");
+					searchRecord();
 				},
 				error: function (XMLHttpRequest, textStatus, errorThrown) {
-		            showMsgDialog("error:" + errorThrown);
+					layer.close(index);
 		        }
 			});
 		});
 	} else {
-		showMsgDialog("请至少选择一条记录");
+		layer.alert("请选择记录");
 	}
-};
+};
+
+/**
+ * 编辑信息
+ */
+function editInfo() {
+    var width = 600;
+    var height = 380;
+    //iframe窗 右下角弹出
+    currentLayerIndex = layer.open({
+        skin: 'demo-class',
+        type: 1,
+        title: "编辑",
+        shadeClose: false,
+        area: [width + "px", height + "px"],
+        content: $("#modal-table").html()
+    });
+	// 获取单行
+	var id=$(grid_selector).jqGrid('getGridParam','selrow');
+    $.ajax({
+		type : 'POST',
+		dataType : "json",
+		data : {"id":id},
+		url : basePath + '/user/initEdit',//请求的路径				
+		success : function(data) {
+			console.info(data.realName);
+			$("#realName").val(data.realName);
+			$("#loginName").val(data.loginName);
+			console.info(data);
+		},
+		error: function (XMLHttpRequest, textStatus, errorThrown) {
+			layer.close(index);
+        }
+	});
+};
+
+/**
+ * 关闭当前窗口
+ */
+function closeWin() {
+    layer.close(currentLayerIndex);
+}

Some files were not shown because too many files changed in this diff