mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
95 lines
4.1 KiB
HTML
95 lines
4.1 KiB
HTML
<extend name="Public/base" />
|
||
<block name="main">
|
||
<fieldset class="layui-elem-field">
|
||
<legend>应用管理 - 应用列表</legend>
|
||
<div class="layui-field-box">
|
||
<span class="layui-btn layui-btn-normal api-add"><i class="layui-icon"></i> 新增</span>
|
||
<table class="layui-table" lay-even>
|
||
<thead>
|
||
<tr>
|
||
<th>#</th>
|
||
<th>应用名称</th>
|
||
<th>AppId</th>
|
||
<th>AppSecret</th>
|
||
<th>应用说明</th>
|
||
<th>应用状态</th>
|
||
<th>操作</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<volist name="list" id="vo">
|
||
<tr>
|
||
<td>{$i}</td>
|
||
<td>{$vo['app_name']}</td>
|
||
<td>{$vo['app_id']}</td>
|
||
<td>{$vo['app_secret']}</td>
|
||
<td>{$vo['app_info']}</td>
|
||
<td>
|
||
<if condition="$vo['app_status']">
|
||
<span style="border-radius: 2px;background-color: #5FB878;padding:5px 10px;color: #ffffff">生效</span>
|
||
<else />
|
||
<span style="border-radius: 2px;background-color: #FF5722;padding:5px 10px;color: #ffffff">禁用</span>
|
||
</if>
|
||
</td>
|
||
<td>
|
||
<if condition="$vo['app_status']">
|
||
<span class="layui-btn layui-btn-danger confirm" data-info="你确定禁用当前APP么?" data-id="{$vo['id']}" data-url="{:U('close')}">禁用</span>
|
||
<else />
|
||
<span class="layui-btn confirm" data-info="你确定启用当前APP么?" data-id="{$vo['id']}" data-url="{:U('open')}">启用</span>
|
||
</if>
|
||
<span data-url="{:U('edit', array('id' => $vo['id']))}" class="layui-btn edit layui-btn-normal">编辑</span>
|
||
<span class="layui-btn layui-btn-danger confirm" data-id="{$vo['id']}" data-info="你确定删除当前APP么?" data-url="{:U('del')}">删除</span>
|
||
</td>
|
||
</tr>
|
||
</volist>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</fieldset>
|
||
</block>
|
||
<block name="myScript">
|
||
<script>
|
||
layui.use(['layer'], function() {
|
||
$('.api-add').on('click', function () {
|
||
layer.open({
|
||
type: 2,
|
||
area: ['80%', '80%'],
|
||
maxmin: true,
|
||
content: '{:U("add")}'
|
||
});
|
||
});
|
||
$('.edit').on('click', function () {
|
||
var ownObj = $(this);
|
||
layer.open({
|
||
type: 2,
|
||
area: ['80%', '80%'],
|
||
maxmin: true,
|
||
content: ownObj.attr('data-url')
|
||
});
|
||
});
|
||
$('.confirm').on('click', function () {
|
||
var ownObj = $(this);
|
||
layer.confirm(ownObj.attr('data-info'), {
|
||
btn: ['确定','取消'] //按钮
|
||
}, function(){
|
||
$.ajax({
|
||
type: "POST",
|
||
url: ownObj.attr('data-url'),
|
||
data: {id:ownObj.attr('data-id')},
|
||
success: function(msg){
|
||
if( msg.code == 1 ){
|
||
location.reload();
|
||
}else{
|
||
layer.msg(msg.msg, {
|
||
icon: 5,
|
||
shade: [0.6, '#393D49'],
|
||
time:1500
|
||
});
|
||
}
|
||
}
|
||
});
|
||
});
|
||
});
|
||
});
|
||
</script>
|
||
</block> |