ding_talks.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('钉钉机器人配置管理')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="role-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 类型:<select name="type" th:with="type=${@dict.getType('ding_talks_type')}">
  15. <option value="">所有</option>
  16. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
  17. </select>
  18. </li>
  19. <li>
  20. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  21. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  22. </li>
  23. </ul>
  24. </div>
  25. </form>
  26. </div>
  27. <div class="btn-group-sm" id="toolbar" role="group">
  28. <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:ding:talks:add">
  29. <i class="fa fa-plus"></i> 新增
  30. </a>
  31. </div>
  32. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  33. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  34. </div>
  35. </div>
  36. </div>
  37. <th:block th:include="include :: footer" />
  38. <script th:inline="javascript">
  39. var editFlag = [[${@permission.hasPermi('system:ding:talks:edit')}]];
  40. var removeFlag = [[${@permission.hasPermi('system:ding:talks:del')}]];
  41. var dingTalksType = [[${@dict.getType('ding_talks_type')}]];
  42. var isUseType = [[${@dict.getType('is_use_type')}]];
  43. var prefix = ctx + "system/dingTalks";
  44. $(function() {
  45. var options = {
  46. url: prefix + "/list",
  47. createUrl: prefix + "/add",
  48. updateUrl: prefix + "/edit/{id}",
  49. removeUrl: prefix + "/remove",
  50. modalName: "钉钉机器人配置",
  51. height: $(window).height()-120,
  52. columns: [
  53. {
  54. field: 'id',
  55. title: 'ID'
  56. },
  57. {
  58. field: 'type',
  59. title: '类型',
  60. align: 'center',
  61. formatter: function(value, row, index) {
  62. return $.table.selectDictLabel(dingTalksType, value);
  63. }
  64. },
  65. {
  66. field: 'url',
  67. title: 'WebHook'
  68. },
  69. {
  70. field: 'mobiles',
  71. title: '联系人',
  72. align : 'center'
  73. },
  74. {
  75. field: 'atAll',
  76. title: '是否@所有人',
  77. align : 'center',
  78. formatter: function(value, row, index) {
  79. return $.table.selectDictLabel(isUseType, value);
  80. }
  81. },
  82. {
  83. field: 'isDef',
  84. title: '是否默认',
  85. align: 'center',
  86. formatter: function(value, row, index) {
  87. return $.table.selectDictLabel(isUseType, value);
  88. }
  89. },
  90. {
  91. field: 'createDate',
  92. title: '创建时间',
  93. align : 'center'
  94. },
  95. {
  96. title: '操作',
  97. align: 'center',
  98. formatter: function(value, row, index) {
  99. var actions = [];
  100. actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
  101. if(row.isDef == 0){
  102. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i> 删除</a>');
  103. }
  104. return actions.join('');
  105. }
  106. }]
  107. };
  108. $.table.init(options);
  109. });
  110. </script>
  111. </body>
  112. </html>