| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParam" ref="queryForm" :inline="true"> |
| | | <el-form-item label="用户名:"> |
| | | <el-input v-model="queryParam.userName"></el-input> |
| | | <el-form-item label="真实姓名:"> |
| | | <el-input v-model="queryParam.realName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="submitForm">查询</el-button> |
| | |
| | | </el-form> |
| | | |
| | | <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%"> |
| | | <el-table-column prop="id" label="Id" /> |
| | | <el-table-column prop="userName" label="用户名"/> |
| | | <el-table-column prop="realName" label="真实姓名" /> |
| | | <el-table-column prop="sex" label="性别" width="60px;" :formatter="sexFormatter"/> |
| | | <el-table-column label="班级"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="Array.isArray(scope.row.className) && scope.row.className.length > 0"> |
| | | {{ scope.row.className.join(', ') }} |
| | | </span> |
| | | <span v-else>-</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="phone" label="手机号"/> |
| | | <el-table-column prop="createTime" label="创建时间" width="160px"/> |
| | | <el-table-column label="状态" prop="status" width="70px"> |
| | |
| | | <el-button size="mini">编辑</el-button> |
| | | </router-link> |
| | | <el-button size="mini" type="danger" @click="deleteUser(row)" class="link-left">删除</el-button> |
| | | <el-button size="mini" @click="resetPassword(row)" type="success" class="link-left">重置密码</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | data () { |
| | | return { |
| | | queryParam: { |
| | | userName: '', |
| | | realName: '', |
| | | role: 3, |
| | | pageIndex: 1, |
| | | pageSize: 10 |
| | |
| | | search () { |
| | | this.listLoading = true |
| | | userApi.getUserPageList(this.queryParam).then(data => { |
| | | const re = data.response |
| | | const re = data.data |
| | | this.tableData = re.list |
| | | this.total = re.total |
| | | this.queryParam.pageIndex = re.pageNum |
| | |
| | | let _this = this |
| | | userApi.changeStatus(row.id).then(re => { |
| | | if (re.code === 1) { |
| | | row.status = re.response |
| | | row.status = re.data |
| | | _this.$message.success(re.message) |
| | | } else { |
| | | _this.$message.error(re.message) |
| | |
| | | }, |
| | | statusBtnFormatter (status) { |
| | | return this.enumFormat(this.statusBtn, status) |
| | | } |
| | | }, |
| | | resetPassword(row) { |
| | | this.$confirm('此操作将重置该成员的密码, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | userApi.resetUserPassword(row.id).then(re => { |
| | | if (re.code === 1) { |
| | | this.$message.success(re.message) |
| | | } else { |
| | | this.$message.error(re.message) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters('enumItem', [ |