<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('艺人操作记录')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <!-- 头部信息 -->
        <div class="col-sm-12" style="margin-bottom: 15px;">
            <div class="alert alert-info" style="margin-bottom: 0;">
                <strong>艺人ID：</strong><span th:text="${artistId}">10001</span>
                <strong style="margin-left: 30px;">艺人名称：</strong><span th:text="${artistName}">摩登天空</span>
            </div>
        </div>

        <div class="col-sm-12 select-table table-bordered">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var artistId = [[${artistId}]];
    var prefix = ctx + "kylin/artist";

    $(function () {
        var options = {
            url: prefix + "/operationLogList",
            queryParams: function(params) {
                return {
                    pageNum: params.offset / params.limit + 1,
                    pageSize: params.limit,
                    artistId: artistId
                };
            },
            columns: [
                {
                    field: 'operationType',
                    title: '操作类型',
                    width: '10%',
                    formatter: function(value, row, index) {
                        var typeClass = '';
                        var typeName = row.operationTypeName || '未知';
                        if (value == 1) {
                            typeClass = 'label-success';
                        } else if (value == 2) {
                            typeClass = 'label-warning';
                        } else if (value == 3) {
                            typeClass = 'label-danger';
                        }
                        return '<span class="label ' + typeClass + '">' + typeName + '</span>';
                    }
                },
                {
                    field: 'createdAt',
                    title: '操作时间',
                    width: '20%'
                },
                {
                    field: 'operationContent',
                    title: '修改内容',
                    width: '50%'
                },
                {
                    field: 'operatorName',
                    title: '操作人',
                    width: '20%',
                    formatter: function(value, row, index) {
                        return value || '系统';
                    }
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
