tb-gate-command-log-list.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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.terminalName"></sa-item>
  25. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  26. </el-form>
  27. <!-- ------------- 快捷按钮 ------------- -->
  28. <el-table class="data-table" ref="data-table" :data="dataList">
  29. <sa-td name="序号" type="index"></sa-td>
  30. <sa-td name="设备名" prop="terminalName"></sa-td>
  31. <sa-td name="设备SN" prop="sn"></sa-td>
  32. <sa-td name="通道" prop="venuesName"></sa-td>
  33. <sa-td name="下发时间" prop="createTime"></sa-td>
  34. <el-table-column label="下发命令">
  35. <template slot-scope="s">
  36. <el-button class="c-btn" @click="showCommand(s.row.command)">查看
  37. </el-button>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="回复内容">
  41. <template slot-scope="s">
  42. <el-button class="c-btn" @click="showCommand(s.row.responseContent)">查看
  43. </el-button>
  44. </template>
  45. </el-table-column>
  46. <sa-td name="下发人员" prop="createBy"></sa-td>
  47. <el-table-column label="操作" fixed="right" width="240px">
  48. <template slot-scope="s">
  49. <el-button v-if="sa.isAuth('tb-gate-command-log-del')" class="c-btn" type="danger"
  50. icon="el-icon-delete" @click="del(s.row)">删除
  51. </el-button>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. <!-- ------------- 分页 ------------- -->
  56. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  57. </sa-item>
  58. </div>
  59. <el-dialog title="查看" :visible.sync="commandVisible" width="500px">
  60. <span>{{commandContent}}</span>
  61. <span slot="footer" class="dialog-footer">
  62. <el-button @click="commandVisible = false">关 闭</el-button>
  63. </span>
  64. </el-dialog>
  65. </div>
  66. <script>
  67. var app = new Vue({
  68. components: {
  69. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  70. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  71. },
  72. el: '.vue-box',
  73. data: {
  74. title:'',
  75. commandVisible:false,
  76. commandContent:'',
  77. p: { // 查询参数
  78. id: '', // 主键
  79. deptId: '', // 单位ID
  80. command: '', // 命令
  81. sn: '', // 设备SN
  82. terminalName: '', // 设备名
  83. venuesName: '', // 通道
  84. createTime: '', // 下发时间
  85. responseContent: '', // 回复内容
  86. createBy: '', // 创建人
  87. pageNo: 1, // 当前页
  88. pageSize: 10, // 页大小
  89. sortType: 0 // 排序方式
  90. },
  91. dataCount: 0,
  92. dataList: [], // 数据集合
  93. },
  94. methods: {
  95. showCommand(content) {
  96. this.commandVisible = true;
  97. this.commandContent = content
  98. },
  99. // 刷新
  100. f5: function() {
  101. sa.ajax('/TbGateCommandLog/getList', sa.removeNull(this.p), function(res) {
  102. this.dataList = res.data; // 数据
  103. this.dataCount = res.dataCount; // 数据总数
  104. sa.f5TableHeight(); // 刷新表格高度
  105. }.bind(this));
  106. },
  107. // 查看
  108. get: function(data) {
  109. sa.showIframe('数据详情', 'tb-gate-command-log-info.html?id=' + data.id, '1050px', '90%');
  110. },
  111. // 查看 - 根据选中的
  112. getBySelect: function(data) {
  113. var selection = this.$refs['data-table'].selection;
  114. if (selection.length == 0) {
  115. return sa.msg('请选择一条数据')
  116. }
  117. this.get(selection[0]);
  118. },
  119. // 修改
  120. update: function(data) {
  121. sa.showIframe('修改数据', 'tb-gate-command-log-add.html?id=' + data.id, '1000px', '90%');
  122. },
  123. // 新增
  124. add: function(data) {
  125. sa.showIframe('新增数据', 'tb-gate-command-log-add.html?id=-1', '1000px', '90%');
  126. },
  127. // 删除
  128. del: function(data) {
  129. sa.confirm('是否删除,此操作不可撤销', function() {
  130. sa.ajax('/TbGateCommandLog/delete?id=' + data.id, function(res) {
  131. sa.arrayDelete(this.dataList, data);
  132. sa.ok('删除成功');
  133. sa.f5TableHeight(); // 刷新表格高度
  134. }.bind(this))
  135. }.bind(this));
  136. },
  137. // 批量删除
  138. deleteByIds: function() {
  139. // 获取选中元素的id列表
  140. let selection = this.$refs['data-table'].selection;
  141. let ids = sa.getArrayField(selection, 'id');
  142. if (selection.length == 0) {
  143. return sa.msg('请至少选择一条数据')
  144. }
  145. // 提交删除
  146. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  147. sa.ajax('/TbGateCommandLog/deleteByIds', {
  148. ids: ids.join(',')
  149. }, function(res) {
  150. sa.arrayDelete(this.dataList, selection);
  151. sa.ok('删除成功');
  152. sa.f5TableHeight(); // 刷新表格高度
  153. }.bind(this))
  154. }.bind(this));
  155. },
  156. },
  157. created: function() {
  158. this.f5();
  159. sa.onInputEnter();
  160. }
  161. })
  162. </script>
  163. </body>
  164. </html>