|
|
@@ -2,6 +2,14 @@
|
|
|
<div class="list-view">
|
|
|
<div class="filters-container">
|
|
|
<el-input placeholder="输入关键字" v-model="search" clearable class="filter-item"></el-input>
|
|
|
+ <el-select v-model="companyId" filterable placeholder="请选择" value-key="id" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="item in companys"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.companyName"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
<el-button @click="(page = 1), getData()" type="primary" icon="el-icon-search" class="filter-btn"
|
|
|
>搜索
|
|
|
</el-button>
|
|
|
@@ -28,17 +36,17 @@
|
|
|
cell-class-name="table-cell"
|
|
|
v-loading="tableLoading"
|
|
|
>
|
|
|
- <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
|
|
|
+ <el-table-column v-if="multipleMode" align="center" type="selection" width="50"></el-table-column>
|
|
|
<el-table-column prop="id" label="ID" width="100">
|
|
|
<template v-slot="{ row }">
|
|
|
<span @click="clickId(row)">{{ row.id }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="username" label="用户名"> </el-table-column>
|
|
|
- <el-table-column prop="nickname" label="昵称"> </el-table-column>
|
|
|
- <el-table-column prop="realName" label="姓名"> </el-table-column>
|
|
|
- <el-table-column prop="idNo" label="身份证"> </el-table-column>
|
|
|
- <el-table-column prop="phone" label="手机" min-width="120"> </el-table-column>
|
|
|
+ <el-table-column prop="username" label="用户名"></el-table-column>
|
|
|
+ <el-table-column prop="nickname" label="昵称"></el-table-column>
|
|
|
+ <el-table-column prop="realName" label="姓名"></el-table-column>
|
|
|
+ <el-table-column prop="idNo" label="身份证"></el-table-column>
|
|
|
+ <el-table-column prop="phone" label="手机" min-width="120"></el-table-column>
|
|
|
<el-table-column label="头像" min-width="60">
|
|
|
<template v-slot="{ row }">
|
|
|
<el-image
|
|
|
@@ -52,8 +60,8 @@
|
|
|
<el-table-column label="操作" align="center" fixed="right" v-if="canEdit">
|
|
|
<template v-slot="{ row }">
|
|
|
<el-button @click="editRow(row)" type="primary" size="mini" class="filter-btn" plain
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
+ >编辑
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -77,16 +85,32 @@
|
|
|
import { mapState } from 'vuex';
|
|
|
import ClipboardJS from 'clipboard';
|
|
|
import pageableTable from '@/mixins/pageableTable';
|
|
|
+
|
|
|
const clickData = {};
|
|
|
export default {
|
|
|
name: 'UserList',
|
|
|
mixins: [pageableTable],
|
|
|
+ created() {
|
|
|
+ this.$http
|
|
|
+ .get('/company/all', {
|
|
|
+ page: 0,
|
|
|
+ size: 1000
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.companys = res.content;
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
multipleMode: false,
|
|
|
search: '',
|
|
|
url: '/user/all',
|
|
|
- downloading: false
|
|
|
+ companyId: null,
|
|
|
+ downloading: false,
|
|
|
+ companys: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -123,9 +147,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
beforeGetData() {
|
|
|
+ let data = {
|
|
|
+ query: {}
|
|
|
+ };
|
|
|
+
|
|
|
if (this.search) {
|
|
|
- return { search: this.search };
|
|
|
+ data.search = this.search;
|
|
|
+ }
|
|
|
+ if (this.companyId) {
|
|
|
+ data.query.companyId = this.companyId;
|
|
|
}
|
|
|
+ return data;
|
|
|
},
|
|
|
toggleMultipleMode(multipleMode) {
|
|
|
this.multipleMode = multipleMode;
|