index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!-- -->
  2. <template>
  3. <div>
  4. <main-top :crumb="crumbData"></main-top>
  5. <div class="table-interface">
  6. <div class="top-body">
  7. <div class="info-top">
  8. <div class="info-left">
  9. <!-- <span>按用户操作查看:</span> -->
  10. <!-- <el-select style="width:100px;" v-model="region" placeholder="请选择">
  11. <el-option label="全部" value="all"></el-option>
  12. <el-option label="发布" value="fb"></el-option>
  13. <el-option label="编辑" value="bj"></el-option>
  14. <el-option label="删除" value="sc"></el-option>
  15. <el-option label="排序" value="px"></el-option>
  16. </el-select> -->
  17. <span style="margin-left:20px;">按操作模块查看:</span>
  18. <el-select style="width:120px;" v-model="params.type" placeholder="请选择">
  19. <el-option label="全部" value=""></el-option>
  20. <el-option label="展览管理" value="展览管理"></el-option>
  21. <el-option label="文物库" value="文物库"></el-option>
  22. <el-option label="日志管理" value="日志管理"></el-option>
  23. <el-option label="用户管理" value="用户管理"></el-option>
  24. </el-select>
  25. <el-input style="width:220px;margin:0 20px;" v-model="params.description" placeholder="请输入操作事件内容"></el-input>
  26. <el-button type="primary" @click="handleSearchBtnClick">查找</el-button>
  27. <el-button>重置</el-button>
  28. </div>
  29. </div>
  30. <el-table :data="tableData" style="width: 100%">
  31. <el-table-column
  32. v-for="(item, idx) in data"
  33. :key="idx"
  34. :prop="item.prop"
  35. :label="item.label"
  36. >
  37. <template slot-scope="scope">
  38. <span>{{scope.row[item.prop]}}</span>
  39. </template>
  40. </el-table-column>
  41. </el-table>
  42. <div class="e-pagination">
  43. <el-pagination @current-change="handleCurrentChange" :current-page.sync="params.pageNum" :page-size="params.pageSize" layout="prev, pager, next, jumper" :total="total">
  44. </el-pagination>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  52. // 例如:import 《组件名称》 from '《组件路径》';
  53. import MainTop from '@/components/main-top'
  54. import SearchBar from '@/components/search-bar'
  55. const crumbData = [
  56. {
  57. name: '工作日志',
  58. id: 7
  59. }
  60. ]
  61. export default {
  62. // import引入的组件需要注入到对象中才能使用
  63. components: {
  64. MainTop,
  65. SearchBar
  66. },
  67. data () {
  68. // 这里存放数据
  69. let data = [
  70. {
  71. prop: 'id',
  72. label: '序号'
  73. },
  74. {
  75. prop: 'userName',
  76. label: '账号'
  77. },
  78. {
  79. prop: 'type',
  80. label: '操作模块'
  81. },
  82. {
  83. prop: 'description',
  84. label: '操作事件'
  85. },
  86. {
  87. prop: 'createTime',
  88. label: '操作时间'
  89. }
  90. ]
  91. return {
  92. crumbData,
  93. data,
  94. region: 'all',
  95. region1: 'all',
  96. infoName: '',
  97. tableData: [],
  98. params: {
  99. pageNum: 1,
  100. description: '',
  101. pageSize: 20,
  102. type: ''
  103. },
  104. total: 0
  105. }
  106. },
  107. mounted () {
  108. this.getModuleList()
  109. this.getLogs()
  110. },
  111. methods: {
  112. getModuleList () {
  113. this.$http.post('/resource/find').then(res => {
  114. console.log(res, '/resource/find')
  115. })
  116. },
  117. getLogs () {
  118. this.$http.post('/log/list', this.params).then(res => {
  119. console.log(res)
  120. this.tableData = res.data.list
  121. this.total = res.data.total
  122. })
  123. },
  124. handleCurrentChange () {
  125. this.getLogs()
  126. },
  127. handleSearchBtnClick () {
  128. this.params.pageNum = 1
  129. this.getLogs()
  130. }
  131. }
  132. }
  133. </script>
  134. <style scoped>
  135. /* 引入公共css类 */
  136. @import url(./style);
  137. </style>