此文章是基于 EasyUI+Knockout实现经典表单的查看、编辑 一. 准备工作 1. 点击此下载相关文件,并把文件放到 ims 工程对应的文件夹下 二. 相关文件介绍 1. user.jsp:用户管理界面<!DOCTYPE html PUBLIC & ...
此文章是基于
EasyUI+Knockout实现经典表单的查看、编辑
一. 准备工作
1. 点击此下载相关文件,并把文件放到 ims 工程对应的文件夹下
二. 相关文件介绍
1. user.jsp:用户管理界面
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>用户管理</title> <%@ include file="/common/head.jsp"%> <style type="text/css"> div#navigation{background:white} div#wrapper{float:right;width:100%;margin-left:-185px} div#content{margin-left:185px} div#navigation{float:left;width:180px} .datagrid-cell a{color:black;} .datagrid-cell a:hover{color:red;} </style> </head> <body> <div id="container"> <div id="wrapper"> <div id="content"> <div class="toolbar"> <a href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh" title="刷新" data-bind="click:refreshClick">刷新</a> <a href="#" plain="true" class="easyui-linkbutton" icon="icon-add" title="新增" data-bind="click:addClick">新增</a> <a href="#" plain="true" class="easyui-linkbutton" icon="icon-edit" data-bind="click:editClick" title="编辑">编辑</a> <a href="#" plain="true" class="easyui-linkbutton" icon="icon-cross" title="删除" data-bind="click:deleteClick">删除</a> <a href="#" plain="true" class="easyui-linkbutton" icon="icon-save" data-bind="click:saveClick" title="保存">保存</a> <a href="#" plain="true" class="easyui-linkbutton" icon="icon-key" data-bind="click:passwordClick" title="重置密码">重置密码</a> </div> <table id="gridlist" data-bind="datagrid:grid"> <thead> <tr> <th field="id" hidden="true"></th> <th field="userCode" sortable="true" align="left" width="70" editor="{type:'validatebox',options:{required:true}}" >用户编码 </th> <th field="userName" sortable="true" align="left" width="80" editor="{type:'validatebox',options:{required:true}}" >用户名称 </th> <th field="emailAddr" sortable="true" align="left" width="80" editor="{type:'validatebox',options:{required:true}}" >邮箱地址 </th> <th field="phoneNum" sortable="true" align="left" width="80" editor="{type:'validatebox',options:{required:true}}" >联系号码 </th> <th field="description" sortable="true" align="left" width="180" editor="text" >描述说明 </th> <th field="isEnable" sortable="true" align="center" width="70" formatter="com.formatCheckbox" editor="{type:'checkbox',options:{on:1,off:0}}">是否启用 </th> <th field="loginCount" sortable="true" align="right" width="60" >登陆次数 </th> <th field="lastLoginDate" sortable="true" align="center" width="120" formatter="com.formatTime" >最后登陆时间 </th> <th field="permit" align="center" width="270" formatter="formatterButton"> 操作 </th> </tr> </thead> </table> </div> </div> <div id="navigation"> <div title="组织机构" style="width: 180px;" class="easyui-panel" data-options="title: '组织机构', iconCls: 'icon-org', height: $(window).height() - 4 "> <ul data-bind="easyuiTree:tree"></ul> </div> </div> </div> <script type="text/html" id="setorganize-template"> <div style="margin:5px;"> <div style="border-bottom:1px solid #CCC; margin-bottom:5px;"> <span id="role_name" class="icon32 icon-user-edit32" style="padding-left:48px;font-weight:bold; font-size:14px;color:#666;" data-bind="text:userName">刘会胜</span> </div> <div> 所属机构:</div> <div class="listview" style="height:315px;overflow:auto;"></div> </div> <div style="text-align:center;"> <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" data-bind="click:confirmClick" href="javascript:void(0)" >确定</a> <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" data-bind="click:cancelClick" href="javascript:void(0)">取消</a> </div> </script> <script type="text/html" id="setrole-template"> <style type="text/css"> .listview{ margin:0 !important;} .listview li{width:100px !important;background-color:skyblue !important;float:left;margin:3px;} </style> <div style="margin:5px;height:370px;overflow:auto;" > <div style="border-bottom:1px solid #CCC; margin-bottom:5px;"> <span class="icon32 icon-user-edit32" style="padding-left:48px;font-weight:bold; font-size:14px;color:#666;" data-bind="text:userName">刘会胜</span> </div> <div> 拥有角色(请点击勾选):</div> <div class="metrouicss"> <ul class="listview"></ul> </div> </div> <div style="text-align:center;"> <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" data-bind="click:confirmClick" href="javascript:void(0)" >确定</a> <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" data-bind="click:cancelClick" href="javascript:void(0)">取消</a> </div> </script> <%@ include file="/common/foot.jsp"%> <script src='/images/loading.gif' data-original="viewModel/sys/user.js"></script> <script src='/images/loading.gif' data-original="viewModel/sys/organizeTreeGraph.js"></script> <script type="text/javascript"> using(['validatebox','messager','dialog']); ko.bindingViewModel(new viewModel()); var formatterButton = function (value, row) { var dataStr = JSON.stringify({id:row.id,userName:row.userName,_isnew:row._isnew}); var html = '<a href="javascript:;" onclick=\'setOrganize(' + dataStr + ')\'><span > </span>[设置机构]</a>'; html += '<a href="javascript:;" onclick=\'setRole(' + dataStr + ')\' ><span > </span>[设置角色]</a>'; return html; }; </script> </body></html>
原标题:基于easyUI实现权限管理系统(四)——用户管理
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。