<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="岗位信息列表" libs=["table"]/>
<div class="container-div">
	<div class="row">
	<div class="col-sm-12 search-collapse">
	<@f.form id="post-form">
    <div class="select-list">
    <ul>
        <li>
            <@ctx.i18n text = "岗位编码"/>：
            <input type="text" class="form-control" name="postCode"/>
        </li>
        <li>
            <@ctx.i18n text = "岗位名称"/>：
            <input type="text" class="form-control" name="postName"/>
        </li>
        <li>
            <@ctx.i18n text = "岗位分类"/>：
            <@f.select name="postType" blankValue="" blankLabel="所有" dictType="sys_post_type" />
        </li>
        <li>
            <@ctx.i18n text = "状态"/>：
            <@f.select name="status" blankValue="" blankLabel="所有" dictType="sys_status" />
        </li>
        <li>
            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;&nbsp;<@ctx.i18n text = "查询"/></a>
            <a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>
        </li>
    </ul>
    </div>
    </@f.form>
    </div>
    <@table id="bootstrap-table">
        <@shiro.hasPermission name="sys:post:add">
                        <a class="btn btn-success" onclick="opt.operate.add()"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="sys:post:edit">
            <a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="sys:post:del">
            <a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()">
                <i class="fa fa-remove"></i> <@ctx.i18n text = "删除"/>
            </a>
        </@shiro.hasPermission>
    </@table>
    </div>
</div>
<@footer>
<script>
    var editFlag = "${permission.hasPermi("sys:post:edit")}";
    var listFlag = "${permission.hasPermi("sys:post:add")}";
    var delFlag = "${permission.hasPermi("sys:post:del")}";
    var visible = ${permission.isPermitteds("sys:post:edit,
    sys:post:del,sys:post:add")?string('true', 'false')};
                                            var postTypeDatas = ${dict.getDictListJson('sys_post_type')};
                var statusDatas = ${dict.getDictListJson('sys_status')};
                                                    var prefix = baseURL + "sys/post";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            modalName: "岗位信息",
            uniqueId:    'id'                     , /* 唯一ID */
            columns: [{
                title: $.i18n.prop("序号"), width: 5, align: "center", formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }
            }
                ,{
                    field : 'id'
                    ,title : '<@ctx.i18n text = "岗位ID"/>'
                    ,visible: false
                }
                                                                                                                                                                                                                                                                                            ,{
                    field : 'postCode'
                    ,title : '<@ctx.i18n text = "岗位编码"/>'
                }
                                                                                                                                                                                                                                                                                                                ,{
                    field : 'postName'
                    ,title : '<@ctx.i18n text = "岗位名称"/>'
                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ,{
                    field : 'postType'
                    ,title : '<@ctx.i18n text = "岗位分类"/>'
                    ,formatter: function(value, row, index) {
                       return $.table.selectDictLabel(postTypeDatas, value);
                    }
                }
                                                                                                                                                                                                                                                                                                                ,{
                    field : 'status'
                    ,title : '<@ctx.i18n text = "状态"/>'
                    ,formatter: function(value, row, index) {
                       return $.table.selectDictLabel(statusDatas, value);
                    }
                }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ,{
                    title:"<@ctx.i18n text = "操作"/>"
                    ,visible:visible
                    ,class:'action'
                    ,formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="' + editFlag + '" href="javascript:void(0)" title="<@ctx.i18n text = "编辑"/>" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i></a> ');
                        actions.push('<a class="' + delFlag + '" href="javascript:void(0)" title="<@ctx.i18n text = "删除"/>" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-trash-o"></i></a> ');
                        return actions.join('');
                    }
                }
                ]
            };
            $.table.init(options);
        });

</script>
</@footer>
</@pageTheme>