123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>layui</title>
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
- <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all"/>
- <link rel="stylesheet" href="__CSS__/admin.css" media="all">
- <style type="text/css">
- #tooltip {
- position: absolute;
- border: 1px solid #ccc;
- background: #333;
- padding: 2px;
- display: none;
- color: #fff;
- }
- table{
- width:100px;
- table-layout:fixed;/* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */
- }
- td{
- width:100%;
- word-break:keep-all;/* 不换行 */
- white-space:nowrap;/* 不换行 */
- overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */
- text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用*/
- }
- </style>
- </head>
- <body style="padding:10px;">
- <div class="tplay-body-div">
- <div class="layui-tab">
- <ul class="layui-tab-title">
- <li class="layui-this">URL美化管理</li>
- <li><a href="{:url('admin/urlsconfig/publish')}" class="a_menu">新增美化</a></li>
- </ul>
- </div>
- <table class="layui-table" lay-size="sm">
- <colgroup>
- <col width="50">
- <col width="150">
- <col width="200">
- <col width="200">
- <col width="150">
- <col width="100">
- <col width="100">
- </colgroup>
- <thead>
- <tr>
- <th>ID</th>
- <th>美化前</th>
- <th>美化后</th>
- <th>备注</th>
- <th>创建时间</th>
- <th>状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- {volist name="urlconfig" id="vo"}
- <tr>
- <td>{$vo.id}</td>
- <td>{$vo.url}</td>
- <td>{$vo.aliases}</td>
- <td>{$vo.desc}</td>
- <td>{$vo.create_time}</td>
- <td>{if condition="$vo.status eq 1"}<span class="layui-badge">启用</span>{else /}<span
- class="layui-badge layui-bg-gray">禁用</span>{/if}
- </td>
- <td class="operation-menu">
- <div class="layui-btn-group">
- <a class="layui-btn layui-btn-xs a_menu layui-btn-primary"
- href="{:url('admin/urlsconfig/publish',['id'=>$vo.id])}" style="margin-right: 0;font-size:12px;">
- <i class="layui-icon"></i></a>
- <a class="layui-btn layui-btn-xs layui-btn-primary status"
- {if condition="$vo.status eq 1" }data-id="0" {else/}data-id="1"{/if} id="{$vo.id}"
- style="margin-right: 0;font-size:12px;">
- <i class="fa {if condition=" $vo.status eq 1"}fa-toggle-on{else /}fa-toggle-off{/if}"></i></a>
- <a class="layui-btn layui-btn-xs delete layui-btn-primary" id="{$vo.id}"
- style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
- </div>
- </td>
- </tr>
- {/volist}
- </tbody>
- </table>
- <div style="padding:0 20px;">{$urlconfig->render()}</div>
- {include file="public/foot"}
- <script type="text/javascript">
- $('.delete').click(function () {
- var id = $(this).attr('id');
- layer.confirm('确定要删除?', function (index) {
- $.ajax({
- url: "{:url('admin/urlsconfig/delete')}",
- data: {id: id},
- type: 'post',
- dataType: 'json',
- success: function (res) {
- layer.msg(res.msg);
- if (res.code == 1) {
- setTimeout(function () {
- location.href = res.url;
- }, 1500)
- }
- }
- })
- })
- })
- layui.use('layer', function () {
- var layer = layui.layer;
- $('.status').click(function () {
- var id = $(this).attr('id');
- var status = $(this).attr('data-id');
- layer.confirm('确定要设置?', function (index) {
- $.ajax({
- url: "{:url('admin/urlsconfig/status')}",
- type: 'post',
- dataType: 'json',
- data: {id: id, status: status},
- success: function (res) {
- layer.msg(res.msg);
- if (res.code == 1) {
- setTimeout(function () {
- location.href = res.url;
- }, 1500)
- }
- }
- })
- })
- })
- });
- </script>
- </div>
- </body>
- </html>
|