2023-11-21 15:14:59 +08:00

121 lines
5.1 KiB
HTML

<div class="row-content am-cf">
<div class="row">
<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
<div class="widget am-cf">
<div class="widget-head am-cf">
<div class="widget-title am-cf">友情链接</div>
</div>
<div class="widget-body am-fr">
<div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
<div class="am-form-group">
<div class="am-btn-toolbar">
<div class="am-btn-group am-btn-group-sm">
<a href="javascript:void(0);" class="hema-add am-btn am-btn-primary am-radius">
<span class="am-icon-plus"></span> 添加
</a>
</div>
</div>
</div>
</div>
<div class="am-u-sm-12">
<table width="100%" class="am-table am-table-hover tpl-table-black">
<thead>
<tr>
<th>编号</th>
<th>名称</th>
<th>地址</th>
<th>排序</th>
<th>时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{if !empty($list)}
{foreach $list as $item}
<tr>
<td class="am-text-middle">{$item['link_id']}</td>
<td class="am-text-middle">
<p>{$item['name']}</p>
</td>
<td class="am-text-middle">{$item['url']}</td>
<td class="am-text-middle">{$item['sort']}</td>
<td class="am-text-middle">{$item['create_time']}</td>
<td class="am-text-middle">
<div class="tpl-table-black-operation">
<a href="javascript:;" class="hema-edit" data-id="{$item['link_id']}">
<i class="am-icon-pencil"></i> 编辑
</a>
<a href="javascript:;" class="hema-del tpl-table-black-operation-del"
data-id="{$item['link_id']}">
<i class="am-icon-trash"></i> 删除
</a>
</div>
</td>
</tr>
{/foreach}
{else /}
<tr>
<td colspan="6" class="am-text-center">暂无记录</td>
</tr>
{/if}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
{include file="setting/link/add" /}
{include file="setting/link/edit" /}
<script>
$(function () {
//添加
$('.hema-add').on('click', function () {
$.showAction({
title: '添加',
area: '750px',
content: template('tpl-add', {}),
uCheck: true,
success: function ($content) {
$('#my-form').formPost({
url: "{:url('setting.link/add')}"
});
},
btn2: function ($content) {
return true;
}
});
});
//编辑
$('.hema-edit').on('click', function () {
var data = $(this).data();
$.get("{:url('setting.link/edit')}?id=" + data.id, function (result) {
if(result.code == 0){
$.show_error(result.msg);
return false;
}
$.showAction({
title: '编辑',
area: '750px',
content: template('tpl-edit', {model:result.data.model}),
uCheck: true,
success: function ($content) {
$('#my-form').formPost({
url: "{:url('setting.link/edit')}?id=" + data.id
});
},
btn2: function ($content) {
return true;
}
});
});
});
// 删除元素
var url = "{:url('setting.link/delete')}";
$('.hema-del').del('id', url);
});
</script>