selectInterface.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('选择接口应用')" />
  5. </head>
  6. <body>
  7. <div class="main-content">
  8. <form id="form-user-add" class="form-horizontal">
  9. <div class="row">
  10. <div class="col-sm-12">
  11. <div class="col-sm-12 select-table table-striped">
  12. <table id="bootstrap-table"></table>
  13. </div>
  14. </div>
  15. </div>
  16. </form>
  17. </div>
  18. <th:block th:include="include :: footer" />
  19. <script th:inline="javascript">
  20. let prefix = ctx + "system/interfaceinfo";
  21. let list = [[${list}]];
  22. let shareType_datas = [[${@dict.getType('share_type')}]];
  23. let interfaceType_datas = [[${@dict.getType('interface_type')}]];
  24. let shareType = [[${shareType}]];
  25. $(function() {
  26. let options = {
  27. data: list,
  28. sidePagination: "client",
  29. sortName: "roleSort",
  30. showSearch: false,
  31. showRefresh: false,
  32. showToggle: false,
  33. showColumns: false,
  34. clickToSelect: true,
  35. maintainSelected: true,
  36. columns: [{
  37. checkbox: true,
  38. formatter:function (value, row, index) {
  39. if($.common.isEmpty(value)) {
  40. return { checked: row.flag };
  41. } else {
  42. return { checked: value }
  43. }
  44. }
  45. },
  46. {
  47. field: 'id',
  48. title: '主键ID',
  49. visible: false
  50. },
  51. {
  52. field: 'rownum',
  53. title: '序号',
  54. formatter: function (value, item, index) {
  55. return index + 1;
  56. },
  57. },
  58. {
  59. field: 'remark',
  60. title: '注释',
  61. visible: false
  62. },
  63. {
  64. field: 'code',
  65. title: '接口码',
  66. visible: false
  67. },
  68. {
  69. field: 'interfaceName',
  70. title: '接口名称'
  71. },
  72. {
  73. field: 'infoItem',
  74. title: '信息项',
  75. visible: false
  76. },
  77. {
  78. field: 'usageScenarios',
  79. title: '使用场景描述'
  80. },
  81. {
  82. field: 'shareType',
  83. title: '接口方式',
  84. formatter: function (value, item, index) {
  85. return $.table.selectDictLabel(shareType_datas, item.shareType);
  86. }
  87. },
  88. {
  89. field: 'interfaceType',
  90. title: '请求方式',
  91. formatter: function (value, item, index) {
  92. return $.table.selectDictLabel(interfaceType_datas, item.interfaceType);
  93. }
  94. },
  95. {
  96. field: 'env',
  97. title: '环境',
  98. visible: false
  99. },
  100. {
  101. field: 'signServeraddress',
  102. title: '签名服务地址',
  103. visible: false
  104. },
  105. {
  106. field: 'interfaceAddress',
  107. title: '接口地址',
  108. visible: false
  109. },
  110. {
  111. title: '接口状态',
  112. align: 'center',
  113. formatter: function (value, row, index) {
  114. return statusTools(row);
  115. },
  116. visible: false
  117. },
  118. {
  119. field: 'typeIam',
  120. title: 'IAM方式',
  121. visible: false
  122. },
  123. {
  124. field: 'typeAksk',
  125. title: 'AK/SK方式',
  126. visible: false
  127. }]
  128. };
  129. $.table.init(options);
  130. });
  131. /* 状态显示 */
  132. function statusTools(row) {
  133. if (row.status === '1') {
  134. return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')"></i> ';
  135. } else {
  136. return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
  137. }
  138. }
  139. /* 提交 */
  140. function submitHandler(index, layero){
  141. let rows = $.table.selectFirstColumns();
  142. parent.interfaceCallback("123");
  143. closeItem();
  144. }
  145. </script>
  146. </body>
  147. </html>