refactor(miniClass): 调整学员列表表格列并优化数据获取
- 将学员ID列宽从150调整为100,移除学员身份列 - 将“学员名称”列改为“学员姓名”并更新对应字段为student.name - 新增邮箱列显示student.email字段 - 修改学员数据获取方式,使用getStudents接口替代getCLassInfo - 注释掉分页组件及相关变量,为后续功能做准备
This commit is contained in:
@@ -183,19 +183,15 @@
|
|||||||
<el-table-column
|
<el-table-column
|
||||||
property="student.id"
|
property="student.id"
|
||||||
label="学员id"
|
label="学员id"
|
||||||
width="150"
|
width="100"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
property="student.nickname"
|
property="student.name"
|
||||||
label="学员名称"
|
label="学员姓名"
|
||||||
width="150"
|
width="150"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column
|
|
||||||
property="student.vip"
|
|
||||||
label="学员身份"
|
|
||||||
width="200"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column property="student.tel" label="手机号"></el-table-column>
|
<el-table-column property="student.tel" label="手机号"></el-table-column>
|
||||||
|
<el-table-column property="student.email" label="邮箱"></el-table-column>
|
||||||
<el-table-column property="" label="操作">
|
<el-table-column property="" label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="warning" @click="outClass(scope.row)"
|
<el-button size="mini" type="warning" @click="outClass(scope.row)"
|
||||||
@@ -204,6 +200,16 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<!-- <el-pagination
|
||||||
|
@size-change="sizeChangeHandle"
|
||||||
|
@current-change="currentChangeHandle"
|
||||||
|
:current-page="pageIndexStudent"
|
||||||
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
|
:page-size="pageSizeStudent"
|
||||||
|
:total="totalStudent"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
>
|
||||||
|
</el-pagination> -->
|
||||||
</div>
|
</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="setStudentClose">关 闭</el-button>
|
<el-button @click="setStudentClose">关 闭</el-button>
|
||||||
@@ -275,6 +281,10 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
totalPage: 0,
|
totalPage: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
|
// pageIndexStudent: 1,
|
||||||
|
// pageSizeStudent: 10,
|
||||||
|
// totalStudentPage: 0,
|
||||||
|
// totalStudent: 0,
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
miniClassVisible: false
|
miniClassVisible: false
|
||||||
};
|
};
|
||||||
@@ -346,15 +356,36 @@ export default {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 获取学员列表数据
|
||||||
|
async getStudents(data) {
|
||||||
|
return new Promise(async(resolve, reject) => {
|
||||||
|
await this.$http({
|
||||||
|
url: this.$http.adornUrl("/common/class/getClassUserList"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData(data)
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
resolve(data);
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
reject(e)
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
// 管理学员
|
// 管理学员
|
||||||
async setStudent(data) {
|
async setStudent(data) {
|
||||||
this.miniClass = data;
|
this.miniClass = data;
|
||||||
var _classId = data.id;
|
var _classId = data.id;
|
||||||
this.addForm = {};
|
this.addForm = {};
|
||||||
var jieguo = await this.getCLassInfo(_classId)
|
// var jieguo = await this.getCLassInfo(_classId)
|
||||||
|
var students = await this.getStudents({
|
||||||
|
classId: _classId,
|
||||||
|
// page: this.pageIndexStudent,
|
||||||
|
// limit: this.pageSizeStudent,
|
||||||
|
})
|
||||||
// console.log('jieguo',jieguo.data.code)
|
// console.log('jieguo',jieguo.data.code)
|
||||||
if(jieguo.data.code == 0){
|
if(students.data.code == 0){
|
||||||
this.studentList = jieguo.data.result.students;
|
this.studentList = students.data.result.students;
|
||||||
this.setStudentVisible = true;
|
this.setStudentVisible = true;
|
||||||
}else{
|
}else{
|
||||||
this.$message.error("获取学员列表失败");
|
this.$message.error("获取学员列表失败");
|
||||||
|
|||||||
Reference in New Issue
Block a user