index.vue 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div class="subPage">
  3. <div class="system-table-search">
  4. <div class="flex-h">
  5. <div class="flex-item flex-h">
  6. <el-button size="mini" type="success" @click="redirection('addCase')">新增案场</el-button>
  7. </div>
  8. <tableSearch value="请输入案场名称" @exportSearchKey="searchList"></tableSearch>
  9. </div>
  10. <div class="moreFilter"></div>
  11. </div>
  12. <div class="system-table-box">
  13. <el-table
  14. :data="currentList"
  15. stripe
  16. style="width: 100%">
  17. <el-table-column
  18. prop="CaseName"
  19. label="案场名称">
  20. </el-table-column>
  21. <el-table-column
  22. prop="CaseAddress"
  23. label="地址">
  24. </el-table-column>
  25. <el-table-column
  26. prop="Status"
  27. label="是否开放">
  28. <template slot-scope="scope">
  29. <span>{{scope.row.Status == 0 ? '未开放' : '已开放'}}</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column label="操作" width="200">
  33. <template slot-scope="scope">
  34. <el-button
  35. size="mini"
  36. type="warning"
  37. @click="editItem(scope.$index, scope.row)">编辑</el-button>
  38. <el-button
  39. size="mini"
  40. type="success"
  41. @click="pplConcerned(scope.$index, scope.row)">相关人员</el-button>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. </div>
  46. <el-pagination
  47. @current-change="handleCurrentChange"
  48. :current-page.sync="postData.page"
  49. :page-size="postData.pagesize"
  50. layout="prev, pager, next, jumper"
  51. :total="total">
  52. </el-pagination>
  53. </div>
  54. </template>
  55. <script>
  56. import tableSearch from '@/components/tableSearch/index'
  57. import { mapActions } from 'vuex'
  58. export default {
  59. name: '',
  60. data () {
  61. return {
  62. total: 0,
  63. postData: { // 表格搜索条件
  64. name: '', // 案场名称
  65. page: 1, // 当前页码
  66. pagesize: 10, // 请求数据量
  67. },
  68. currentList: []
  69. }
  70. },
  71. components: {
  72. tableSearch,
  73. },
  74. mounted () {
  75. this.$nextTick(function () {
  76. this.getList()
  77. })
  78. },
  79. methods: {
  80. ...mapActions([
  81. 'updateSystemInfo',
  82. ]),
  83. pplConcerned (index, row) { // 相关人员
  84. this.$router.push({name: 'pplConcerned', query: {id: row.CaseId}})
  85. },
  86. getList () { // 获取列表
  87. this.$ajax(this.$api.caseManager.getCaseList.url, {
  88. method: this.$api.caseManager.getCaseList.method,
  89. queryData: this.postData
  90. }).then(res => {
  91. this.currentList = res.list
  92. this.postData.page = res.page
  93. this.total = res.pagenum
  94. })
  95. },
  96. redirection (pathName) { // 重定向
  97. this.$router.push({ name: pathName })
  98. },
  99. handleCurrentChange (val) { // 跳转到分页
  100. this.getList()
  101. },
  102. editItem (index, row) { // 修改
  103. // console.log(index, row)
  104. this.$router.push({ name: 'editCase', query: { id: row.CaseId } })
  105. },
  106. keyManager (index, row) { // 钥匙管理
  107. console.log(index, row)
  108. },
  109. searchList (key) { // 搜索列表
  110. this.postData.name = key
  111. this.currentList = []
  112. this.postData.page = 1
  113. this.getList()
  114. }
  115. }
  116. }
  117. </script>
  118. <!-- Add "scoped" attribute to limit CSS to this component only -->
  119. <style lang="scss" scoped>
  120. @import "page.scss";
  121. </style>