<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="参数列表" libs=["table"]/>
<div class="container-div" id="_app">
	<div class="row">
	<div class="col-sm-12 search-collapse">
	<@f.form id="config-form">
		<div class="select-list">
			<ul>
				<li>
					参数名称：<input type="text" class="form-control" name="paramName"/>
				</li>
				<li>
					参数键名：<input type="text" class="form-control" name="paramKey"/>
				</li>
				<li>
					<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&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:config: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:config:edit">
			<a class="btn btn-primary single disabled" onclick="opt.operate.edit()"><i class="fa fa-edit"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
		 </@shiro.hasPermission>
		 <@shiro.hasPermission name="sys:config:del">
			<a class="btn btn-danger multiple disabled" onclick="opt.operate.delAll()"><i class="fa fa-remove"></i>&nbsp;<@ctx.i18n text = "删除"/></a>
		 </@shiro.hasPermission>
		<@shiro.hasPermission name="sys:config:clear">
			<a class="btn btn-danger" onclick="clearRedis()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "清除缓存"/></a>
		</@shiro.hasPermission>
	</@table>
	</div>
</div>
<@footer>
<script>
    var editFlag = "${permission.hasPermi('sys:config:edit')}";
    var removeFlag = "${permission.hasPermi('sys:config:del')}";
	var datas = ${dict.getDictListJson('sys_yes_no')};
    var prefix = baseURL + "sys/config";

    $(function() {
        var options = {
            url: prefix + "/list",
            addUrl: prefix + "/add",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del",
            sortName: "createTime",
      		/* sortOrder: "desc", */
            modalName: "参数",
            columns: [
	 		/* {checkbox: true}, */
					{field: 'id', title: "<@ctx.i18n text = "参数主键"/>"},
					{field: 'paramName', title: "<@ctx.i18n text = "参数名称"/>", formatter: function(value, row, index) {
				                	return $.table.tooltip(value,10);}
				                },
					{field: 'paramKey', title: "<@ctx.i18n text = "参数键名"/>"/*, formatter: function(value, row, index) {
				                	return $.table.tooltip(value,10);
				                	}*/
				    },
					{field: 'paramValue', title: "<@ctx.i18n text = "参数键值"/>", formatter: function(value, row, index) {
						return $.table.tooltip(value,20);
						}
					},
					{field: 'configType', title: "<@ctx.i18n text = "系统内置"/>", formatter: function(value, row, index) {
							return $.table.selectDictLabel(datas, value);
						}
					},
					{field: 'remark', title: "<@ctx.i18n text = "备注"/>", align: 'center', formatter: function(value, row, index) {
							return $.table.tooltip(value,5);
						}
				                },
					{field: 'createTime', title: "<@ctx.i18n text = "创建时间"/>"},
					{title: "<@ctx.i18n text = "操作"/>", align: 'center', formatter: function(value, row, index) {
				                    var actions = [];
				                    actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="opt.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i><@ctx.i18n text = "修改"/></a> ');
				                    actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-remove"></i><@ctx.i18n text = "删除"/></a>');
				                    return actions.join('');}
				            	}]
				     };
        			$.table.init(options);
    });

    function clearRedis() {
		opt.operate.get(prefix + "/clearConfig");
	}
</script>
</@footer>
</@pageTheme>