<title>友情链接</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>应用</cite></a>
    <a><cite>友情链接</cite></a>
  </div>
</div>


<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">

  <!--选项卡-->
      <div class="layui-card-body">
          <div class="layui-tab layui-tab-brief" lay-filter="J_tabLi">
            <ul class="layui-tab-title">
              <li class="layui-this"><a lay-href="app/advert/index">链接列表</a></li>
              <li><a lay-href="app/advert/type">链接分类</a></li>
            </ul>
          </div>
      </div>
  
    <div class="layui-card-body">
    
      <div style="padding-bottom: 10px;">
        <button class="layui-btn btn_action" data-type="add">添加</button>
        <button class="layui-btn btn_action" data-type="del">删除</button>
      </div>
      
      <table id="J_table_list" lay-filter="J_table_list"></table>
      <script type="text/html" id="J_table_button_tpl">
        {{#
            var strs = new Array(),i = 0;
            strs = d.category.split(",");
            for (i=0;i<strs.length ;i++ ){
        }}
          <button class="layui-btn layui-btn-primary layui-btn-xs">{{strs[i]}}</button>
        {{#  } }}
      </script>
      
      <script type="text/html" id="J_table_img_tpl">
        <img style="display: inline-block; height: 100%;" src="{{d.logo}}"/>
      </script>
      
      <script type="text/html" id="J_table_tool">
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
      </script>
    </div>
  </div>
</div>
  </div>
</div>
<script>
layui.use(['table'], function(){
  var $ = layui.$
  ,table = layui.table;
  
  //执行渲染
table.render({
  elem: '#J_table_list'
  ,url: global.host+'/frlink/index'
  ,cols: [[
      {type: 'checkbox',fixed:'left'}
      ,{field:'id',title:'ID',hide:'true'}
      ,{field:'category',title:'分类',minWidth:100,templet:'#J_table_button_tpl'}
      ,{field:'name',title:'站点名称',width:200}
      ,{field:'link',title:'站点地址',minWidth:300}
      ,{field:'logo',title:'站点logo',width:300,templet:'#J_table_img_tpl'}
      ,{field:'sort',title:'顺序',width:80}
      ,{title:'操作',width:150,align:'center',toolbar:'#J_table_tool'}
  ]]
  ,page: true
    ,limit: 20
    ,height: 'auto'
  ,text: '对不起，加载出现异常！'
});

});
</script>