<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('音乐人标签列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="role-form">
                <div class="select-list">
                    <ul>
                        <li>
                            名称：<input type="text" name="tagName"/>
                        </li>
                        <li>
                            类型：<select name="tagType" th:with="type=${@dict.getType('zhengzai_store_cert_type')}">
                            <option value="">全部</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="#" shiro:hasPermission="goblin:extag:add">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="goblin:extag:rmv">
                <i class="fa fa-remove"></i> 删除
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var dicSelfExtagType = [[${@dict.getType('zhengzai_self_extag_type')}]];
    var rmvFlg = [[${@permission.hasPermi('goblin:extag:rmv')}]];
    var prefix = ctx + "goblin/extag";
    $(function () {
        var options = {
            url: prefix + "/list",
            removeUrl: prefix + "/rmv",
            sortName: "mid desc",
            modalName: "音乐人标签库",
            columns: [{
                checkbox: true
            },
                {
                    field: 'tagPic',
                    title: '头像',
                    formatter: function (value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'tagName',
                    title: '名称'
                },
                {
                    field: 'tagType',
                    title: '类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(dicSelfExtagType, value);
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-danger btn-xs ' + rmvFlg + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.tagId + '\')"><i class="fa fa-trash"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>