tb-command-log-list.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.js"></script>
  17. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <div class="c-title">检索参数</div>
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <sa-item type="text" name="命令" v-model="p.command"></sa-item>
  25. <sa-item type="text" name="设备名" v-model="p.terminalName"></sa-item>
  26. <sa-item type="text" name="通道" v-model="p.channelName"></sa-item>
  27. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  28. <!-- ------------- 快捷按钮 ------------- -->
  29. <sa-item style="display: inline;" type="fast-btn" show="reset"></sa-item>
  30. </el-form>
  31. <!-- ------------- 数据列表 ------------- -->
  32. <el-table class="data-table" ref="data-table" :data="dataList">
  33. <sa-td name="序号" type="index"></sa-td>
  34. <sa-td name="设备名" prop="terminalName"></sa-td>
  35. <sa-td name="通道" prop="channelName"></sa-td>
  36. <sa-td name="下发时间" prop="createTime"></sa-td>
  37. <sa-td name="回复时间" prop="responseTime"></sa-td>
  38. <sa-td name="回复内容" prop="responseContent"></sa-td>
  39. <sa-td name="下发人" prop="createBy"></sa-td>
  40. <el-table-column label="命令">
  41. <template slot-scope="s">
  42. <el-button class="c-btn" @click="showCommand(s.row)">查看
  43. </el-button>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="操作" fixed="right" width="240px">
  47. <template slot-scope="s">
  48. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  49. </el-button>
  50. <el-button v-if="sa.isAuth('tb-command-log-del')" class="c-btn" type="danger"
  51. icon="el-icon-delete" @click="del(s.row)">删除
  52. </el-button>
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. <!-- ------------- 分页 ------------- -->
  57. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  58. </sa-item>
  59. </div>
  60. <el-dialog
  61. title="命令"
  62. :visible.sync="commandVisible"
  63. width="500px">
  64. <span>{{commandContent}}</span>
  65. <span slot="footer" class="dialog-footer">
  66. <el-button @click="commandVisible = false">关 闭</el-button>
  67. </span>
  68. </el-dialog>
  69. </div>
  70. <script>
  71. var app = new Vue({
  72. components: {
  73. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  74. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  75. },
  76. el: '.vue-box',
  77. data: {
  78. commandVisible:false,
  79. commandContent:'',
  80. p: { // 查询参数
  81. id: '', // 主键
  82. deptId: '', // 单位ID
  83. command: '', // 命令
  84. sn: '', // 设备SN
  85. terminalName: '', // 设备名
  86. channelName: '', // 通道
  87. createTime: '', // 下发时间
  88. responseTime: '', // 回复时间
  89. msgId: '', // 消息ID
  90. responseContent: '', // 回复内容
  91. responseCode: '', // 回复code
  92. pageNo: 1, // 当前页
  93. pageSize: 15, // 页大小
  94. sortType: 0 // 排序方式
  95. },
  96. dataCount: 0,
  97. dataList: [], // 数据集合
  98. },
  99. methods: {
  100. showCommand(data){
  101. this.commandVisible=true;
  102. this.commandContent=data.command
  103. },
  104. // 刷新
  105. f5: function() {
  106. sa.ajax('/TbCommandLog/getList', sa.removeNull(this.p), function(res) {
  107. this.dataList = res.data; // 数据
  108. this.dataCount = res.dataCount; // 数据总数
  109. sa.f5TableHeight(); // 刷新表格高度
  110. }.bind(this));
  111. },
  112. // 查看
  113. get: function(data) {
  114. sa.showIframe('数据详情', 'tb-command-log-info.html?id=' + data.id, '1080px', '70%');
  115. },
  116. // 查看 - 根据选中的
  117. getBySelect: function(data) {
  118. var selection = this.$refs['data-table'].selection;
  119. if (selection.length == 0) {
  120. return sa.msg('请选择一条数据')
  121. }
  122. this.get(selection[0]);
  123. },
  124. // 删除
  125. del: function(data) {
  126. sa.confirm('是否删除,此操作不可撤销', function() {
  127. sa.ajax('/TbCommandLog/delete?id=' + data.id, function(res) {
  128. sa.arrayDelete(this.dataList, data);
  129. sa.ok('删除成功');
  130. sa.f5TableHeight(); // 刷新表格高度
  131. }.bind(this))
  132. }.bind(this));
  133. },
  134. },
  135. created: function() {
  136. this.f5();
  137. sa.onInputEnter();
  138. }
  139. })
  140. </script>
  141. </body>
  142. </html>