tb-channel-config-list.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. </head>
  17. <body>
  18. <div class="vue-box" style="display: none;" :style="'display: block;'">
  19. <div class="c-panel">
  20. <!-- ------------- 检索参数 ------------- -->
  21. <!-- ------------- 快捷按钮 ------------- -->
  22. <sa-item type="fast-btn" show="add"></sa-item>
  23. <!-- ------------- 数据列表 ------------- -->
  24. <el-table class="data-table" ref="data-table" :data="dataList" >
  25. <sa-td type="index" name="序号"></sa-td>
  26. <sa-td name="通道名称" prop="channelName" ></sa-td>
  27. <sa-td name="匹配名称" prop="matchChannelName" ></sa-td>
  28. <sa-td name="创建时间" prop="createTime" ></sa-td>
  29. <el-table-column label="操作" fixed="right" width="240px">
  30. <template slot-scope="s">
  31. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  32. <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  33. <el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  34. </template>
  35. </el-table-column>
  36. </el-table>
  37. <!-- ------------- 分页 ------------- -->
  38. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  39. </div>
  40. </div>
  41. <script>
  42. var app = new Vue({
  43. components: {
  44. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  45. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  46. },
  47. el: '.vue-box',
  48. data: {
  49. p: { // 查询参数
  50. id: '', //
  51. channelName: '', // 通道名称
  52. matchChannelName: '', // 匹配名称
  53. createTime: '', //
  54. pageNo: 1, // 当前页
  55. pageSize: 10, // 页大小
  56. sortType: 0 // 排序方式
  57. },
  58. dataCount: 0,
  59. dataList: [], // 数据集合
  60. },
  61. methods: {
  62. // 刷新
  63. f5: function() {
  64. sa.ajax('/TbChannelConfig/getList', sa.removeNull(this.p), function(res) {
  65. this.dataList = res.data; // 数据
  66. this.dataCount = res.dataCount; // 数据总数
  67. sa.f5TableHeight(); // 刷新表格高度
  68. }.bind(this));
  69. },
  70. // 查看
  71. get: function(data) {
  72. sa.showIframe('数据详情', 'tb-channel-config-info.html?id=' + data.id, '500px', '300px');
  73. },
  74. // 查看 - 根据选中的
  75. getBySelect: function(data) {
  76. var selection = this.$refs['data-table'].selection;
  77. if(selection.length == 0) {
  78. return sa.msg('请选择一条数据')
  79. }
  80. this.get(selection[0]);
  81. },
  82. // 修改
  83. update: function(data) {
  84. sa.showIframe('修改数据', 'tb-channel-config-add.html?id=' + data.id, '500px', '300px');
  85. },
  86. // 新增
  87. add: function(data) {
  88. sa.showIframe('新增数据', 'tb-channel-config-add.html?id=-1', '500px', '300px');
  89. },
  90. // 删除
  91. del: function(data) {
  92. sa.confirm('是否删除,此操作不可撤销', function() {
  93. sa.ajax('/TbChannelConfig/delete?id=' + data.id, function(res) {
  94. sa.arrayDelete(this.dataList, data);
  95. sa.ok('删除成功');
  96. sa.f5TableHeight(); // 刷新表格高度
  97. }.bind(this))
  98. }.bind(this));
  99. },
  100. // 批量删除
  101. deleteByIds: function() {
  102. // 获取选中元素的id列表
  103. let selection = this.$refs['data-table'].selection;
  104. let ids = sa.getArrayField(selection, 'id');
  105. if(selection.length == 0) {
  106. return sa.msg('请至少选择一条数据')
  107. }
  108. // 提交删除
  109. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  110. sa.ajax('/TbChannelConfig/deleteByIds', {ids: ids.join(',')}, function(res) {
  111. sa.arrayDelete(this.dataList, selection);
  112. sa.ok('删除成功');
  113. sa.f5TableHeight(); // 刷新表格高度
  114. }.bind(this))
  115. }.bind(this));
  116. },
  117. },
  118. created: function() {
  119. this.f5();
  120. sa.onInputEnter();
  121. }
  122. })
  123. </script>
  124. </body>
  125. </html>