<#include "/admin/layout/layout.ftl">
<#import "/admin/layout/macro.ftl" as macro>
<#assign css>
<style>
</style>
</#assign>
<#assign js>
<script>
    function del(id) {
        layer.confirm('确定删除吗?', {icon: 3, title: '提示'}, function (index) {
            $.ajax({
                type: "POST",
                dataType: "json",
                url: "${ctx!}/admin/dataDictionary/delete/" + id,
                success: function (res) {
                    layer.msg(res.message, {time: 2000}, function () {
                    	location.reload();
                    });
                }
            });
        });
    }
</script>
</#assign>
<@layout title="数据字典管理" active="dataDictionary">
<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        数据字典列表
        <small>一切从这里开始</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-cog"></i> 系统</a></li>
        <li><a href="#"><i class="fa fa-list-ul"></i> 数据字典管理</a></li>
        <li class="active"><i class="fa fa-table"></i> 数据字典列表</li>
    </ol>
</section>

<!-- Main content -->
<section class="content">
    <!-- Default box -->
    <div class="box box-primary">
        <div class="box-header">
            <a class="btn btn-sm btn-success" href="${ctx!}/admin/dataDictionary/add">新增</a>
        </div>
        <div class="box-body">
            <table class="table table-striped">
                <tr>
                    <th>ID</th>
                    <th>数据类型代码</th>
                    <th>数据键</th>
                    <th>数据值</th>
                    <th>操作</th>
                </tr>
                <#list pageInfo.content as dataDictionaryInfo>
                <tr>
                    <td>${dataDictionaryInfo.id}</td>
                    <td>${dataDictionaryInfo.code}</td>
                    <td>${dataDictionaryInfo.dataKey}</td>
                    <td>${dataDictionaryInfo.dataValue}</td>
                    <td>
                        <a class="btn btn-sm btn-primary" href="${ctx!}/admin/dataDictionary/edit/${dataDictionaryInfo.id?c}">编辑</a>
                        <button class="btn btn-sm btn-danger" onclick="del(${dataDictionaryInfo.id?c})">删除</button>
                    </td>
                </tr>
                </#list>
            </table>
        </div>
        <!-- /.box-body -->
        <div class="box-footer clearfix">
            <@macro.page pageInfo=pageInfo url="${ctx!}/admin/dataDictionary/index?" />
        </div>
    </div>
    <!-- /.box -->
</section>

<!-- /.content -->
</@layout>
