123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- {include file='common/head'}
- <div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 1rem;">
- <blockquote class="layui-elem-quote layui-text">
- <div class="demoTable layui-form">
- <button class="layui-btn addInfo" style="margin:0;"><i class="layui-icon"></i> 添加</button>
- </div>
- </blockquote>
- <div class="demoTable">
- <table class="layui-table" lay-data="{height: 'full-100', url:'{:url('Admin/ApiGetAdminList')}', page:true, id:'testReload',loading:true}" lay-filter="demo">
- <thead>
- <tr>
- <th lay-data="{field:'role_name',width:100, fixed: 'left'}">角色名称</th>
- <th lay-data="{field:'hread_img',width:100, fixed: 'left'}">头像</th>
- <th lay-data="{field:'admin_name',width:100, fixed: true}">管理员名称</th>
- <th lay-data="{field:'admin_number'}">工号</th>
- <th lay-data="{field:'login_number'}">登录账号</th>
- <th lay-data="{field:'mobile'}">电话</th>
- <th lay-data="{field:'position'}">职位</th>
- <th lay-data="{field:'note'}">备注信息</th>
- <th lay-data="{field:'status', templet: '#status'}">状态</th>
- <th lay-data="{fixed: 'is_hot', width:140,fixed: 'right', align:'center', toolbar: '#barDemo'}"></th>
- </thead>
- </table>
- <script type="text/html" id="barDemo">
- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
- <a class="layui-btn layui-btn-xs" lay-event="pay_key">秘钥设置</a>
- </script>
- <script type="text/html" id="imgTpl">
- <img src="{{ d.header_img }}" style="height: 20px;" lay-event="detail_content">
- </script>
- <script type="text/html" id="status">
- {{# if(d.status == 1){ }}
- <span style="color: #5FB878">正常</span>
- {{# } else if( d.status ==2) { }}
- <span style="color: #FF5722">禁用</span>
- {{# } }}
- </script>
- </div>
- {include file='common/footer'}
- <script>
- layui.use('table', function(){
- var table = layui.table
- ,form = layui.form;
- var $ = layui.$, active = {
- reload: function(){
- var select = $('#parent_id');
- //执行重载
- table.reload('testReload', {
- where: {
- type_id:select.val(),
- }
- });
- }
- };
- //监听工具条
- table.on('tool(demo)', function(obj){
- var data = obj.data;
- if(obj.event === 'edit'){
- layer.open({
- type: 2,
- title: '管理员信息更新',
- shadeClose: true,
- shade: false,
- maxmin: true, //开启最大化最小化按钮
- area: ['100%', '100%'],
- content: '{:url("Admin/saveAdminInfo")}?admin_id='+data.admin_id,
- end: function () {
- table.reload('testReload');
- },
- });
- }else if(obj.event === 'pay_key'){
- layer.open({
- type: 2,
- title: '管理员秘钥设置',
- shadeClose: true,
- shade: false,
- maxmin: true, //开启最大化最小化按钮
- area: ['100%', '100%'],
- content: '{:url("Admin/saveAdminPayKey")}?admin_id='+data.admin_id,
- end: function () {
- table.reload('testReload');
- },
- });
- }
- });
- layui.use('carousel', function(){
- var carousel = layui.carousel;
- //建造实例
- carousel.render({
- elem: '#test1'
- ,width: '100%' //设置容器宽度
- ,arrow: 'always' //始终显示箭头
- //,anim: 'updown' //切换动画方式
- });
- });
- $('.demoTable .layui-btn').on('click', function(){
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- $('.addInfo').on('click', function() {
- layer.open({
- type: 2,
- title: '添加内容信息',
- shadeClose: true,
- shade: false,
- maxmin: true, //开启最大化最小化按钮
- area: ['100%', '100%'],
- content: '{:url("Admin/saveAdminInfo")}',
- end: function () {
- table.reload('testReload');
- },
- });
- });
- });
- </script>
- </body>
- </html>
|