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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<template>
  <!--
        作者:
        时间:2025-11-18
        描述:插件中心-VIP专区-等级管理-升级日志
      -->
  <div class="common-level">
    <div class="table-search">
      <el-form :inline="true" size="small" :model="formInline" class="demo-form-inline">
        <el-form-item label="用户信息">
          <el-input v-model="formInline.search" placeholder="用户昵称/手机号"></el-input>
        </el-form-item>
        <el-form-item label="变更类型">
          <el-select v-model="formInline.change_type" placeholder="请选择">
            <el-option label="全部" value=""></el-option>
            <el-option label="后台管理员设置" value="10"></el-option>
            <el-option label="自动升级" value="20"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="table-wrap">
      <el-table :data="tableData" style="width: 100%" v-loading="loading">
        <el-table-column prop="log_id" label="ID" width="80"></el-table-column>
        <el-table-column prop="vipUser.nickName" label="用户信息">
          <template slot-scope="scope">
            <div class="d-s-c">
              <div class="head-img mr10">
                <img :src="scope.row.vipUser.avatarUrl" alt="" />
              </div>
              <div>
                <p>{{ scope.row.vipUser.nickName }}</p>
                <p class="gray9">ID: {{ scope.row.user_id }}</p>
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="oldGrade.name" label="变更前等级">
          <template slot-scope="scope">
            <span v-if="scope.row.oldGrade">{{ scope.row.oldGrade.name }}</span>
            <span v-else class="gray9">无</span>
          </template>
        </el-table-column>
        <el-table-column prop="grade.name" label="变更后等级">
          <template slot-scope="scope">
            <span v-if="scope.row.grade">{{ scope.row.grade.name }}</span>
            <span v-else class="gray9">无</span>
          </template>
        </el-table-column>
        <el-table-column prop="change_type" label="变更类型">
          <template slot-scope="scope">
            <el-tag :type="scope.row.change_type == 10 ? 'success' : 'warning'">
              {{ scope.row.change_type == 10 ? '后台管理员设置' : '自动升级' }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column prop="remark" label="备注">
          <template slot-scope="scope">
            <span>{{ scope.row.remark || '无' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="create_time" label="创建时间">
          <template slot-scope="scope">
            <span>{{ scope.row.create_time }}</span>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination-wrap">
        <el-pagination
          background
          layout="total, prev, pager, next"
          :total="totalDataNumber"
          :page-size="formInline.page_size"
          :current-page="formInline.page"
          @current-change="handleCurrentChange"
        ></el-pagination>
      </div>
    </div>
  </div>
</template>
 
<script>
import vipApi from '@/api/plus/vip.js';
export default {
  data() {
    return {
      /*是否加载完成*/
      loading: true,
      /*列表数据*/
      tableData: [],
      /*一页多少条*/
      formInline: {
        page: 1,
        page_size: 20,
        search: '',
        change_type: ''
      },
      /*数据总数*/
      totalDataNumber: 0
    };
  },
  created() {
    /*获取列表数据*/
    this.getData();
  },
  methods: {
    /*获取列表数据*/
    getData() {
      let self = this;
      self.loading = true;
      vipApi.gradelog(self.formInline, true).then(data => {
        self.loading = false;
        self.tableData = data.data.list.data;
        self.totalDataNumber = data.data.list.total;
      });
    },
 
    /*选择第几页*/
    handleCurrentChange(val) {
      this.formInline.page = val;
      this.getData();
    },
 
    /*查询*/
    onSubmit() {
      this.formInline.page = 1;
      this.getData();
    }
  }
};
</script>
 
<style></style>