137 lines
4.3 KiB
HTML
137 lines
4.3 KiB
HTML
{extend name="common@list" /}
|
|
{block name="topnav"}
|
|
<nav class="breadcrumb">
|
|
<i class="Hui-iconfont"></i> 首页
|
|
<span class="c-gray en">></span> 管理员管理
|
|
<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>
|
|
{/block}
|
|
{block name="bouttons"}
|
|
<div class="cl pd-5 bg-1 bk-gray mt-20">
|
|
<span class="l">
|
|
<!-- 删除按钮 -->
|
|
<a href="javascript:;" onclick="dels('/admin/m')" class="btn btn-danger radius">
|
|
<i class="Hui-iconfont"></i>
|
|
批量删除
|
|
</a>
|
|
<!-- 添加按钮 -->
|
|
<a href="javascript:;" onclick=addfull('添加管理员',"/admin/create") class="btn btn-primary radius">
|
|
<i class="Hui-iconfont"></i>
|
|
添加管理员
|
|
</a>
|
|
</span>
|
|
<span class="r">
|
|
共有数据:<strong>{$list.count}</strong> 条
|
|
</span>
|
|
</div>
|
|
{/block}
|
|
{block name="tables"}
|
|
<table id="table1" class="display" cellspacing="0" width="100%">
|
|
<thead>
|
|
<tr>
|
|
<th><input type="checkbox" name="" value=""></th>
|
|
<th>姓名</th>
|
|
<th>性别</th>
|
|
<th>出生日期</th>
|
|
<th>帐号</th>
|
|
<th>手机号码</th>
|
|
<th>角色</th>
|
|
<th>登录次数</th>
|
|
<th>创建时间</th>
|
|
<th>状态</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
{/block}
|
|
{block name="myjs"}
|
|
<script type="text/javascript">
|
|
|
|
// 定义DTajax参数
|
|
var myajax = {
|
|
url: "{:url('ajaxdata')}",
|
|
type: "get",
|
|
data: {},
|
|
};
|
|
|
|
// 定义列参数
|
|
var mycolumns = [
|
|
{ "data": "id" },
|
|
{ "data": "xingming" },
|
|
{ "data": "sex" },
|
|
{ "data": "shengri" },
|
|
{ "data": "username" },
|
|
{ "data": "phone" },
|
|
{ "data": "groupnames" },
|
|
{ "data": "denglucishu" },
|
|
{ "data": "create_time" },
|
|
{ "data": "status" },
|
|
{ "data": "id" },
|
|
];
|
|
|
|
// 定义修改列参数
|
|
var mycolumnDefs =[
|
|
// 对象格式
|
|
{
|
|
"targets": 0,
|
|
"render": function(data, type, row, meta) {
|
|
return '<input type="checkbox" name="test" value="' + row.id + '" />'
|
|
}
|
|
},
|
|
{
|
|
"targets": -1,
|
|
"className":'.td-manage',
|
|
"render": function(data, type, row, meta) {
|
|
// 初始化密码
|
|
resetpwbut = '<a class="ml-5" style="text-decoration:none" onClick="resetpw(this,'+ row.id +')" href="javascript:;" title="重置密码"><i class="Hui-iconfont"></i></a>';
|
|
// 停用按钮
|
|
stopbut = '<a class="ml-5" style="text-decoration:none" onClick="stop(this,'+ row.id +')" href="javascript:;" title="停用"><i class="Hui-iconfont"></i></a>';
|
|
// 启用按钮
|
|
startbut = '<a class="ml-5" style="text-decoration:none" onClick="start(this,'+ row.id +')" href="javascript:;" title="启用"><i class="Hui-iconfont"></i></a>';
|
|
// 详细信息按钮
|
|
readbut = '<a title="详细信息" data-href="admin/'+ row.id +'" data-title="' + row.xingming + ' 信息" onClick="Hui_admin_tab(this)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>';
|
|
// 编辑按钮
|
|
editbut = '<a title="编辑" href="javascript:void(0);" onclick=addfull("编辑","/admin/'+row.id+'/edit") class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>';
|
|
delbut = '<a title="删除" href="javascript:void(0);" onclick=del(this,"/admin/'+row.id+'") class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>';
|
|
buts = startbut + readbut + editbut + delbut;
|
|
if(row.status == '已停用')
|
|
{
|
|
buts = resetpwbut + buts;
|
|
}else{
|
|
buts = resetpwbut + buts;
|
|
}
|
|
|
|
return buts;
|
|
}
|
|
},
|
|
{
|
|
"targets": -2,
|
|
"className":'.td-status',
|
|
"render": function(data, type, row, meta) {
|
|
if(row.status == '已停用')
|
|
{
|
|
d = "<span class='label label-error radius'>" + row.status + "</span>";
|
|
}else{
|
|
d = "<span class='label label-success radius'>" + row.status + "</span>";
|
|
}
|
|
|
|
return d;
|
|
},
|
|
},
|
|
{
|
|
"orderable": false,
|
|
"targets": [0,-1]
|
|
},
|
|
];
|
|
</script>
|
|
{/block} |