Commit c12ac9cf authored by 张伯涛's avatar 张伯涛

重置按钮

parent e5bd749f
......@@ -8,3 +8,11 @@ export function updateUserPwd(data) {
params: data
})
}
// 重置
export function resetUser(user, data) {
return request({
url: 'http://117.122.212.101:8090/sysuser/resetPwd/' + user,
method: 'put',
params: data
})
}
......@@ -22,7 +22,7 @@
<el-table-column label="序号" type="index" width="55" />
<el-table-column label="姓名" prop="USER_NAME" show-overflow-tooltip />
<el-table-column label="工号" prop="USER_ID" show-overflow-tooltip />
<el-table-column label="所在部门" prop="SNAME" show-overflow-tooltip/>
<el-table-column label="所在部门" prop="SNAME" show-overflow-tooltip />
<el-table-column label="部门编码" prop="DEPT_CODE" show-overflow-tooltip />
<el-table-column width="180px" label="操作">
<template slot-scope="{ row }">
......@@ -45,10 +45,13 @@
</template>
<script>
import { resetUser } from '@/api/user.js'
export default {
name: 'UserInfo',
data() {
return {
user: 'admin',
pwdTypeMap: {
text: true,
password: false
......@@ -58,11 +61,6 @@ export default {
userId: '',
userName: ''
},
resetPwdDiaLog: false,
ruleForm: {
newPassword: '',
row: undefined
},
personData: [],
total: 0,
page: 1,
......@@ -77,9 +75,33 @@ export default {
},
methods: {
handleResetPwd(row) {
this.ruleForm.newPassword = ''
this.ruleForm.row = row.userId
this.resetPwdDiaLog = true
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const params = {
userIds: row.USER_ID
}
resetUser(this.user, params).then(res => {
if (res.code === '200') {
this.$message({
type: 'success',
message: '重置成功'
})
} else {
this.$message({
type: 'warning',
message: res.data.message
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消重置'
})
})
},
currentPageChange(page) {
this.page = page
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment