123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <title>列表页面</title>
- <!--#include file="common/_header.html"-->
- <style>
- .table .center{
- text-align:center;
- }
- </style>
- </head>
- <body>
- <nav class="breadcrumb">
- <i class="Hui-iconfont"></i> 首页 <span class="c-gray en">></span> 列表
- <a class="btn btn-success radius r"
- style="line-height: 1.6em; margin-top: 3px"
- href="javascript:location.replace(location.href);" title="刷新">
- <i class="Hui-iconfont"></i></a>
- </nav>
- <div class="page-container">
- <form>
- <div class="text-c mb-10" style="text-align:left;">
- <input type="text" class="input-text" style="width: 200px" id="userName" name="userName" placeholder="用户名">
- <input type="text" class="input-text" style="width: 200px" id="realName" name="realName" placeholder="真实姓名">
- <input type="text" class="input-text" style="width: 200px" id="roleName" name="roleName" placeholder="角色类别">
- <input type="text" class="input-text" style="width: 200px" id="orgName" name="orgName" placeholder="所属单位">
-
- <select class="select-box" style="width: 200px;" name="isDel" id="isDel">
- <option class="select" value="0">未删除</option>
- <option value="1">已删除</option>
- </select>
- <button type="submit" class="btn btn-success" id="btnSearch">
- <i class="Hui-iconfont"></i> 查询
- </button>
- <button type="reset" class="btn btn-default" id="btnReset" >
- <i class="Hui-iconfont"></i> 重置
- </button>
- </div>
- </form>
- <div class="cl pd-5 bg-1 bk-gray">
- <span class="l">
- <a href="javascript:batch_del();" class="btn btn-danger radius"><i class="Hui-iconfont"></i>批量删除</a>
- <a href="javascript:item_add();" class="btn btn-primary radius"><i class="Hui-iconfont"></i>添加</a>
- </span>
- </div>
- <div class="mt-20">
- <table id="grid1" class="table table-border table-bordered table-bg">
- <thead>
- <tr class="text-c">
- <th width="25"><input id="checkAll" type="checkbox" value="">选择</th>
- <th width="100">角色类别</th>
- <th width="100">用户名</th>
- <th width="100">真实姓名</th>
- <th width="100">密码</th>
- <th width="50">性别</th>
- <th width="100">所属单位</th>
- <th width="100">所属部门</th>
- <th width="100">所属科室</th>
- <th width="100">职务</th>
- <th width="100">联系电话</th>
- <th width="50">是否删除</th>
- <th width="150">操作</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- <!--_footer 作为公共模版分离出去-->
- <!--#include file="common/_footer.html"-->
- <!--/_footer 作为公共模版分离出去-->
- <!--请在下方写此页面业务相关的脚本-->
- <script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
- <script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
- <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
-
- <script id="rowTmpl" type="text/template">
- <a href="javascript:item_edit('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i>编辑</a>
- {{if !delFlag}}
- <a href="javascript:item_del('{{id}}','{{name}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i>删除</a>
- {{else}}
- <a href="javascript:recovery_del('{{id}}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i>恢复</a>
- {{/if}}
- </script>
- <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
- <script type="text/javascript" src="scripts/global.js"></script>
- <script type="text/javascript">
- var path = global_backend_url;
- var filePath = file_upload_url;
-
- $(document).ready(function(){
- $('#grid1').dataTable({
- ajax: {
- url: path + "/jpAdmin/list",
- type: 'post',
- dataFilter: function(responseText){
- var jsonData = JSON.parse(responseText);
- // 处理返回json
- if(jsonData.result){
- return JSON.stringify(jsonData.data);
- }
- else{
- processError(jsonData);
- return null;
- }
- },
- data: function(searchParams){
- // 查询json
- searchParams["userName"] = $("#userName").val();
- searchParams["realName"] = $("#realName").val();
- searchParams["roleName"] = $("#roleName").val();
- searchParams["orgName"] = $("#orgName").val();
- searchParams["isDel"] = $('#isDel option:selected').val();
- }
- },
- serverSide: true,
- searching : false,
- ordering: false,
- columns: [
- {data:'id'},
- {"title":"角色类别","render":function(data, type, row, meta){
- var json = row.adminRoleList;
- var result = "";
- $.each(json,function(index,obj){
- if(json.length-1 == index){
- result = result + obj.roleDescription;
- }
- else{
- result = result + obj.roleDescription+",";
- }
-
-
- })
- return result;
- }},
- {data:'userName'},
- {data:'realName'},
- {data:'pwd'},
- {
- "title": "性别", "render": function (data, type, row, meta) {
- var result = "";
- if (row.gender == "1") {
- result = "女";
- }
- else {
- result = "男";
- }
- return result;
- }
- },
- {data:'org.orgName'},
- {data:'department'},
- {data:'office'},
- {data:'post'},
- {data:'tel'},
- {
- "title": "是否删除", "render": function (data, type, row, meta) {
- var result = "";
- if (row.delFlag) {
- result = "是";
- }
- else {
- result = "否";
- }
- return result;
- }
- },
- {"data":null}
- ],
- columnDefs: [
- {
- targets:0,
- sClass:'center',
- bSortable:false,
- render: function (data, type, row) {
- return '<input type="checkbox" name="checkItems" value="'+ data + '">';
- }
- },
- /* {
- targets:5,
- sClass:'center',
- bSortable:false,
- render: function (data, type, row) {
- var url = "";
- if(row.pictureUrl==""||row.pictureUrl==null){
- url = row.pictureUrlN;
-
- }
- else{
- url = filePath + row.pictureUrl;
-
- }
- return '<img src="' + url + '?x-oss-process=image/resize,m_lfit,h_70,w_50">';
-
-
-
- }
- }, */
- {
- targets:12,
- sClass:'center',
- bSortable:false,
- render: function (data, type, row) {
- return template("rowTmpl",{
- id: row.id,
- delFlag: row.delFlag
- });
- }
- }
- ]
- });
-
- $("#checkAll").change(function(){
- var checked = $(this).is(':checked');
-
- $("input[name='checkItems']").each(function(){
- $(this).attr("checked",checked);
- });
- });
-
- $("#btnSearch").click(function(){
- event.preventDefault();
-
- var table = $('#grid1').DataTable();
- table.ajax.reload();
- });
- });
-
- function item_add(){
- layer_show("添加","jpAdmin-detail.html",550,600);
- }
-
- function item_edit(id){
- layer_show("编辑","jpAdmin-detail.html?id=" + id,550,600);
- }
-
- function item_del(id){
- layer.confirm("是否删除?",{
- btns:["是","否"]
- },function(){
- $.post(path + "/jpAdmin/delete/" + id,null,function(json){
- if(json.result){
- layer.msg("删除成功!",{icon:1,time:2000});
- reloadList();
- }
- else{
- layer.msg("删除失败!" + json.message);
- }
- });
- });
- }
-
-
- function recovery_del(id){
- layer.confirm("是否恢复删除用户?",{
- btns:["是","否"]
- },function(){
- $.post(path + "/jpAdmin/recoveryDel/" + id,null,function(json){
- if(json.result){
- layer.msg("恢复删除用户成功!",{icon:1,time:2000});
- reloadList();
- }
- else{
- layer.msg("恢复删除用户失败!" + json.message);
- }
- });
- });
- }
-
- function reloadList(){
- $('#grid1').DataTable().ajax.reload(null,false);
- }
-
- function batch_del(){
- var arr = $("input[name='checkItems']:checked").map(function(){
- return $(this).val();
- }).get();
-
- if(arr.length>0){
- layer.confirm("是否删除选中项?",{
- btns:["是","否"]
- },function(){
- $.post(path + "/jpAdmin/batchDelete",{
- ids:arr.join(",")
- },function(json){
- if(json.result){
- layer.msg("删除成功!",{icon:1,time:2000});
- reloadList();
- }
- else{
- layer.msg("删除失败!" + json.message);
- }
- });
- })
- }
- else{
- layer.msg("请先选择一条记录!");
- }
- }
-
-
- function addUser(name) {
- var tag = name;
- $('#tags').addTag(tag);
- }
-
- </script>
- </body>
- </html>
|