company.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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="formId">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. <p>公司名称:</p>
  15. <input type="text" name="companyName"/>
  16. </li>
  17. <li>
  18. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  19. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  20. </li>
  21. </ul>
  22. </div>
  23. </form>
  24. </div>
  25. <div class="btn-group-sm" id="toolbar" role="group">
  26. <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:company:add">
  27. <i class="fa fa-plus"></i> 添加
  28. </a>
  29. <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:company:edit">
  30. <i class="fa fa-edit"></i> 修改
  31. </a>
  32. <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:company:remove">
  33. <i class="fa fa-remove"></i> 删除
  34. </a>
  35. <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:company:export">
  36. <i class="fa fa-download"></i> 导出
  37. </a>-->
  38. </div>
  39. <div class="col-sm-12 select-table table-striped">
  40. <table id="bootstrap-table"></table>
  41. </div>
  42. </div>
  43. </div>
  44. <th:block th:include="include :: footer" />
  45. <script th:inline="javascript">
  46. var editFlag = [[${@permission.hasPermi('system:company:edit')}]];
  47. var prefix = ctx + "company";
  48. $(function() {
  49. var options = {
  50. url: prefix + "/list",
  51. updateUrl: prefix + "/info/{id}",
  52. modalName: "公司表",
  53. columns: [{
  54. checkbox: true
  55. },
  56. {
  57. field : 'id',
  58. title : '公司编号',
  59. visible: false
  60. },
  61. {
  62. field : 'companyName',
  63. title : '公司名称'
  64. },
  65. {
  66. field : 'primaryBusiness',
  67. title : '主营业务'
  68. },
  69. {
  70. field : 'contactNumber',
  71. title : '联系电话'
  72. },
  73. {
  74. field : 'defaultImgUrl',
  75. title : '企业图片',
  76. formatter: function(value, row, index) {
  77. // 图片预览(注意:如存储在本地直接获取数据库路径,如有配置context-path需要使用ctx+路径)
  78. // 如:/profile/upload/2019/08/08/3b7a839aced67397bac694d77611ce72.png
  79. return $.table.imageView(value,250,250);
  80. }
  81. },
  82. {
  83. visible: editFlag == 'hidden' ? false : true,
  84. title: '公司状态',
  85. align: 'center',
  86. formatter: function (value, row, index) {
  87. return statusTools(row);
  88. }
  89. },
  90. {
  91. field : 'createTime',
  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. return actions.join('');
  102. }
  103. }]
  104. };
  105. $.table.init(options);
  106. });
  107. /* 公司状态显示 */
  108. function statusTools(row) {
  109. if (row.status == 1) {
  110. return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')"></i> ';
  111. } else {
  112. return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
  113. }
  114. }
  115. </script>
  116. </body>
  117. </html>