123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <!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="btn-group-sm" id="toolbar" role="group">
- <a class="btn btn-success" onclick="generate()" shiro:hasPermission="users:robot:generate">
- <i class="fa fa-audio-description"></i> 生成机器人
- </a>
- </div>
- <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
- <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
- </div>
- </div>
- </div>
- <th:block th:include="include :: footer" />
- <script th:inline="javascript">
- var isUseFlag = [[${@permission.hasPermi('users:robot:use')}]];
- var sexs = [[${@dict.getType('sys_user_sex')}]];
- var isUse = [[${@dict.getType('use_type')}]];
- var prefix = ctx + "users/robot";
- $(function() {
- var options = {
- url: prefix + "/list",
- modalName: "机器人列表",
- height: $(window).height()-120,
- columns: [
- {
- field: 'nick',
- title: '昵称',
- align : 'center'
- },
- {
- field: 'avatar',
- title: '头像',
- align : 'center',
- formatter:function (value,row,index) {
- return "<img src='" + value + "' width='70' height='60'>";
- }
- },
- {
- field: 'gender',
- title: '性别',
- align : 'center',
- formatter: function(value, row, index) {
- return $.table.selectDictLabel(sexs, value);
- }
- },
- {
- field: 'isUsed',
- title: '是否使用',
- align : 'center',
- formatter: function(value, row, index) {
- return $.table.selectDictLabel(isUse, value);
- }
- },
- {
- title: '操作',
- align: 'center',
- formatter: function(value, row, index) {
- var actions = [];
- actions.push('<a class="btn btn-success btn-xs ' + isUseFlag + '" href="javascript:void(0)" onclick="settings(\'' + row.nick + '\',\'' + row.isUsed + '\')"><i class="fa fa-gears"></i> 设置</a> ');
- return actions.join('');
- }
- }]
- };
- $.table.init(options);
- });
- /**
- * 设置
- */
- function settings(nick,isUsed) {
- if(isUsed == 0){
- $.modal.confirm("确认要设置使用该记录吗?", function() {
- $.operate.post(prefix + "/isUse?nick=" + nick);
- });
- }else{
- $.modal.confirm("确认要设置不使用该记录吗?", function() {
- $.operate.post(prefix + "/isUse?nick=" + nick);
- });
- }
- }
- /**
- * 生成机器人
- */
- function generate(){
- $.modal.confirm("确认要生成机器人吗?", function() {
- $.operate.post(prefix + "/generate");
- });
- }
- </script>
- </body>
- </html>
|