ZZJ
2022-06-01 f3bf27d9bc7c8c6484be4f37edcc57df5490ecbe
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<template>
  <div class="userList">
    <div class="header">用户列表</div>
    <div class="content">
      <div class="search">
        <div class="label">用户名/手机号</div>
        <el-input v-model="input" placeholder="请输入内容"></el-input>
        <div class="label">注册时间</div>
        <el-date-picker
          v-model="time"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        >
        </el-date-picker>
        <div class="button" @click="getUserList">搜索</div>
      </div>
 
      <div class="table-area">
        <el-table
          id="multipleTable"
          ref="multipleTable"
          :data="dataList"
          tooltip-effect="dark"
          :fit="true"
        >
          <el-table-column label="序号" width="68">
            <template slot-scope="scope">{{
              scope.$index + 1 + (page - 1) * size
            }}</template>
          </el-table-column>
          <el-table-column prop="username" label="用户名"></el-table-column>
 
          <el-table-column prop="phoneNum" label="手机号"></el-table-column>
          <el-table-column prop="userType" label="类型" sortable>
            <template slot-scope="scope">{{
              scope.row.userType == 2 ? "公司" : "个人"
            }}</template>
          </el-table-column>
          <el-table-column
            prop="trueName"
            label="姓名/联系人"
          ></el-table-column>
          <el-table-column
            prop="createTime"
            label="注册时间"
            sortable
          ></el-table-column>
          <el-table-column
            prop="lastLoginTime"
            label="最后登录时间"
            sortable
          ></el-table-column>
 
          <el-table-column label="操作">
            <template slot-scope="scope">
              <div class="control" @click="checkDetail(scope.row)">
                查看详情
              </div>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          @current-change="refrash"
          @size-change="handleSizeChange"
          :current-page="page"
          :page-size="size"
          layout=" prev, pager, next, jumper"
          :total="total"
          background
        ></el-pagination>
      </div>
    </div>
  </div>
</template>
 
<script>
import { findUserList } from "@/api/user";
export default {
  created() {
    this.getUserList();
  },
  data() {
    return {
      input: "",
      time: [],
      page: 1,
      size: 10,
      total: 20,
      dataList: [],
    };
  },
  methods: {
    async getUserList() {
      const res = await findUserList({
        page: this.page,
        size: this.size,
        type: 0,
        startTime: this.time && this.time[0],
        endTime: this.time && this.time[1],
        inputText: this.input,
      });
      if (res && res.success) {
        this.dataList = res.data.list;
        this.total = res.data.total;
      }
    },
    refrash(page) {
      this.page = page;
      this.getUserList();
    },
    handleSizeChange(size) {
      this.size = size;
      this.getUserList();
    },
    checkDetail(row) {
      this.$router.push({
        path: "/Layout/UserDetail",
        query: { type: row.type, username: row.username, userId: row.id },
      });
    },
  },
};
</script>
 
<style lang="scss" scoped>
.userList {
  background-color: rgb(243, 245, 248);
  .header {
    padding: 0 24px;
    height: 50px;
    font-size: 16px;
    color: #666666;
    line-height: 50px;
    background: #ffffff;
    font-weight: 700;
  }
 
  .content {
    margin: 24px;
    padding: 20px;
    background-color: #fff;
 
    .search {
      display: flex;
      align-items: center;
      line-height: 23px;
 
      .label {
        margin-right: 20px;
        height: 20px;
        font-size: 14px;
        color: #3d3d3d;
      }
 
      .el-input ::v-deep {
        margin-right: 30px;
        width: 300px;
        height: 32px;
        .el-input__inner {
          width: 100%;
          height: 32px;
          line-height: 32px;
          color: #3d3d3d;
          border-radius: 0;
          border-color: #c0c5cc;
          &::-webkit-input-placeholder {
            color: #999999;
          }
 
          &:focus {
            border-color: #0065ff;
          }
        }
      }
 
      .el-date-editor ::v-deep {
        box-sizing: border-box;
        height: 32px;
 
        .el-input__icon,
        .el-input__suffix {
          margin-top: -7px;
        }
        .el-range-separator {
          line-height: 27px;
        }
      }
 
      .button {
        margin-left: 36px;
        width: 60px;
        height: 32px;
        text-align: center;
        border-radius: 3px;
        background: #0064ff;
        font-size: 14px;
        line-height: 32px;
        color: #ffffff;
        cursor: pointer;
      }
    }
 
    .control {
      color: #0064ff;
      cursor: pointer;
    }
  }
}
</style>