123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- {extend name="public/layout" /}
- {block name="title"}权限组管理{/block}
- {block name="body"}
- <style>
- html,body {
- background-color: #fff;
- }
- .layui-table thead tr,
- .layui-table-header {
- background-color: #D8E6F1 !important;
- }
- .layui-fluid {
- padding: 15px 30px;
- }
- .layui-card-body {
- padding: 0px;
- }
- </style>
- <body>
- <div class="layui-fluid">
- <div class="layui-card">
- <!-- <div class="layui-form layui-card-header layuiadmin-card-header-auto">
- <div class="layui-form-item">
- <div class="layui-inline">
- <label class="layui-form-label">素材线索数据</label>
- </div>
- </div>
- </div> -->
- <div class="layui-card-body">
- <div style="padding-bottom: 10px;">
- </div>
- <table id="LAY-material-list" lay-filter="LAY-material-list"></table>
- </div>
- </div>
- </div>
- {/block}
- {block name="js"}
- <script type="text/html" id="headimgTpl">
- <span><img src="{{d.headimgurl}}" alt="" width="30" height="30" style="border-radius: 50%"/></span>
- </script>
- <script type="text/html" id="stateTpl">
- {{# if(d.state == 1){ }}
- <span><i class="layui-icon layui-icon-circle-dot" style="color:#98c306"></i> 已建档</span>
- {{# } }}
- {{# if(d.state == 2){ }}
- <span>无效线索</span>
- {{# } }}
- {{# if(d.state == 0){ }}
- <span>未处理</span>
- {{# } }}
- </script>
- <script type="text/html" id="phoneTpl">
- {{# if(d.phone){ }}
- <span>{{d.phone}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script>
- layui.config({
- base: '__LAYUI__/' //静态资源所在路径
- ,
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'table', 'form'], function () {
- var table = layui.table,
- $ = layui.jquery,
- form = layui.form;
- var clueUrl = '{:url("data/cluedata",["type"=>$type,"id"=>$id])}';
- table.render({
- elem : '#LAY-material-list',
- url : clueUrl,
- height: 'full-50',
- cols : [
- [{
- type : 'numbers',
- width: 80,
- title: '序号',
- sort : true
- }, {
- field : 'headimgurl',
- title : '头像',
- templet: '#headimgTpl'
- }, {
- field : 'nickname',
- title : '名称',
- },
- {
- field : 'phone',
- title : '电话',
- templet: '#phoneTpl'
- },
- {
- field : 'state',
- title : '状态',
- templet: '#stateTpl',
- }, {
- field : 'addtime',
- title : '浏览时间',
- }, {
- field : 'visit_due_time',
- title : '浏览时长(秒)',
- }]
- ],
- page : true,
- limit : 10,
- limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
- text : '对不起,加载出现异常!'
- });
- //事件
- var active = {
- // add: function() {
- // location.href = '{:url("grant/add")}';
- // }
- }
- $('.layui-btn.layuiadmin-btn-admin').on('click', function() {
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- //////
- table.on('tool(LAY-grant-list)', function(obj) {
- var data = obj.data;
- console.log(data.id);
- if(obj.event === 'edit') {
- // location.href = '{:url("grant/edit")}?grant_id='+data.id;
- }
- });
- });
- </script>
- </body>
- {/block}
|