|
@@ -6,28 +6,28 @@
|
|
|
width='60%'>
|
|
|
<el-row>
|
|
|
<el-col :span='14'>
|
|
|
- <div class='handle-box'>
|
|
|
- <el-form :inline='true'>
|
|
|
- <el-form-item>
|
|
|
- <el-input
|
|
|
- v-model='searchForm.usernameShow'
|
|
|
- placeholder='用户名称'
|
|
|
- clearable>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-input
|
|
|
- v-model='searchForm.phone'
|
|
|
- placeholder='手机号'
|
|
|
- clearable>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
+ <!-- <div class='handle-box'>
|
|
|
+ <el-form :inline='true'>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model='searchForm.usernameShow'
|
|
|
+ placeholder='用户名称'
|
|
|
+ clearable>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model='searchForm.phone'
|
|
|
+ placeholder='手机号'
|
|
|
+ clearable>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item>
|
|
|
- <el-button @click='loadData'>搜索</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click='loadData'>搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>-->
|
|
|
<el-table
|
|
|
ref='userTable'
|
|
|
:data='tableData'
|
|
@@ -56,9 +56,9 @@
|
|
|
@current-change='handleCurrentChange'
|
|
|
layout='total, sizes, prev, pager, next, jumper'
|
|
|
:page-sizes='[5, 10, 15, 20]'
|
|
|
- :current-page='current'
|
|
|
- :page-size='size'
|
|
|
- :total='total'>
|
|
|
+ :current-page='paging.current'
|
|
|
+ :page-size='paging.size'
|
|
|
+ :total='paging.total'>
|
|
|
</el-pagination>
|
|
|
</el-col>
|
|
|
<el-col :span='9' style='border-left: 1px solid #DCDFE6;margin-left: 8px;'>
|
|
@@ -97,9 +97,11 @@ export default {
|
|
|
//监听dialogVisible,关闭dialog时清空数据
|
|
|
dialogVisible: function(newValue, oldValue) {
|
|
|
if (!newValue) {
|
|
|
- this.current = 1;
|
|
|
- this.size = 5;
|
|
|
- this.total = 0;
|
|
|
+ this.paging = {
|
|
|
+ size: 5,
|
|
|
+ total: 0,
|
|
|
+ current: 1
|
|
|
+ };
|
|
|
this.groupUserList = [];
|
|
|
this.searchForm = {
|
|
|
usernameShow: '',
|
|
@@ -119,12 +121,19 @@ export default {
|
|
|
},
|
|
|
groupData: {},
|
|
|
tableData: [],
|
|
|
- total: 0,
|
|
|
- size: 5,
|
|
|
- current: 1,
|
|
|
+ tableDataAll: [],
|
|
|
groupUserList: [],
|
|
|
tagType: ['success', 'info', 'warning', 'danger', ''],
|
|
|
- removeGroupUserTemp: []
|
|
|
+ removeGroupUserTemp: [],
|
|
|
+ page: {
|
|
|
+ cursor: '',//上次查询返回的游标,下次查询会查询本次查询后续的数据
|
|
|
+ limit: 100//请求数据的大小
|
|
|
+ },
|
|
|
+ paging: {
|
|
|
+ size: 5,
|
|
|
+ total: 0,
|
|
|
+ current: 1
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -132,9 +141,9 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
show(data) {
|
|
|
+ this.groupData = data;
|
|
|
//不使用全局的加载loading组件,等到群组详情查询完成了再关闭
|
|
|
loading = Loading.service(options);
|
|
|
- this.groupData = data;
|
|
|
//回显群聊人员
|
|
|
axios.get('/api/easemob/queryGroupUser?groupId=' + this.groupData.id).then(res => {
|
|
|
axios.post('/api/easemob/getUpUserAttributeBath', {
|
|
@@ -157,7 +166,9 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
loadData() {
|
|
|
- axios.post('/api/easemob/queryUserPage', { params: { limit: 100, cursor: '' } }).then(res => {
|
|
|
+ //不使用全局的加载loading组件,等到群组详情查询完成了再关闭
|
|
|
+ loading = Loading.service(options);
|
|
|
+ axios.post('/api/easemob/queryUserPage', { params: this.page }).then(res => {
|
|
|
this.loadDataDetails(res.data.data.entities.map(t => {
|
|
|
return t.username;
|
|
|
}).filter(t => {
|
|
@@ -166,25 +177,31 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
loadDataDetails(usernameList) {
|
|
|
+ let _this = this;
|
|
|
axios.post('/api/easemob/getUpUserAttributeBath', {
|
|
|
targets: usernameList,
|
|
|
properties: ['phone', 'nickname']
|
|
|
}).then(res => {
|
|
|
let data = res.data.data.data;
|
|
|
+ this.tableDataAll = [];
|
|
|
for (let key in data) {
|
|
|
- this.tableData.push({ phone: data[key].phone, nickname: data[key].nickname, username: key });
|
|
|
+ this.tableDataAll.push({ phone: data[key].phone, nickname: data[key].nickname, username: key });
|
|
|
}
|
|
|
+ //设置真正的表格数据
|
|
|
+ _this.tableData = _this.tableDataAll.slice((_this.paging.current - 1) * _this.paging.size, _this.paging.current * _this.paging.size);
|
|
|
+ //回写数据条数
|
|
|
+ _this.paging.total = _this.tableDataAll.length;
|
|
|
this.dialogVisible = true;
|
|
|
//关闭转loading
|
|
|
loading.close();
|
|
|
});
|
|
|
},
|
|
|
handleSizeChange(val) {
|
|
|
- this.size = val;
|
|
|
+ this.paging.size = val;
|
|
|
this.loadData();
|
|
|
},
|
|
|
handleCurrentChange(val) {
|
|
|
- this.current = val;
|
|
|
+ this.paging.current = val;
|
|
|
this.loadData();
|
|
|
},
|
|
|
addUser(data) {
|