pyt
4 天以前 be31adc8150e5b21008aa7d6212fc105fc425818
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
  <div class="operationLog">
    <TableCustom :tableData="list" :total="total" :heigth="null"
      @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange">
      <template #table>
        <el-table-column label="序号" type="index" show-overflow-tooltip />
        <el-table-column label="操作时间" prop="operTime" show-overflow-tooltip />
        <el-table-column label="操作人" prop="nickName" show-overflow-tooltip />
        <el-table-column label="操作内容" prop="title" show-overflow-tooltip />
      </template>
    </TableCustom>
  </div>
</template>
 
<script>
import { getList } from './service'
export default {
  name: 'operationLog',
  data() {
    return {
      list: [],
      total: 0,
      listLoading: false,
      queryForm: {
        pageNum: 1,
        pageSize: 10
      }
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    handleSizeChange(val) {
      this.queryForm.pageSize = val
      this.fetchData()
    },
    handleCurrentChange(val) {
      this.queryForm.pageNum = val
      this.fetchData()
    },
    async fetchData() {
      try {
        this.listLoading = true
        getList(this.queryForm).then(res => {
          if (res) {
            this.list = res.records
            this.total = res.total
          } else {
            // this.$message.error('获取数据失败')
          }
        })
      } catch (error) {
        // console.error('获取操作日志列表失败:', error)
        // this.$message.error('获取操作日志列表失败')
      } finally {
        this.listLoading = false
      }
    }
  }
}
</script>
<style scoped lang="less">
.operationLog {
  height: 100%;
}
</style>