fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
  <filter-dialog ref="table" :show.sync="showDialog" :title="title" :tableData="tableData"
                 :total="total" @page-info-change="handPageInfoChange" :loading="loading">
    <template slot="columns">
      <el-table-column label="操作时间" prop="updateTime"></el-table-column>
      <el-table-column label="操作人" prop="updatorName"></el-table-column>
      <el-table-column label="操作内容" prop="operationContent">
        <template>
          <span>更新分单策略</span>
        </template>
      </el-table-column>
    </template>
  </filter-dialog>
</template>
 
<script>
import SubmenuTacticsApi from '@/api/submenuTactics'
import filterDialog from '@/components/filterDialog/filterDialog.vue'
export default {
  name: 'operateInfo',
  components: { filterDialog },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: '操作记录'
    },
  },
  data() {
    return {
      showDialog: false,
      tableData: [],
      total: 0,
      loading: false,
    }
  },
  watch: {
    /**
     * 监控外部显示变量变化
     * 传递到dialog组件
     */
    visible: function (newShow, oldShow) {
      this.showDialog = this.visible
    },
    /**
     * 监控内部显示属性变化
     * 传递到外部调用变量
     */
    showDialog: function (newDialogShow, oldDialogShow) {
      this.$emit('update:visible', newDialogShow)
    },
  },
  methods: {
    /**
   * 分页信息改变时,列表查询
   */
    handPageInfoChange(pageInfo) {
      this.queryList(pageInfo)
    },
    /**
       * 查询列表
       */
    queryList(pageInfo) {
      this.loading = true
      SubmenuTacticsApi.historyStartegyInfo({ ...pageInfo }, false).then(res => {
        if (res.data) {
          let { total, list } = res.data;
          this.total = total;
          this.tableData = list;
        } else {
          this.total = 0;
          this.tableData = [];
        }
        this.loading = false
      }).catch(() => {
        this.loading = false
      })
    },
  }
}
</script>
 
<style lang="scss">
</style>