|
@ -27,7 +27,9 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
<rrOperation /> |
|
|
<rrOperation /> |
|
|
</div> |
|
|
</div> |
|
|
<crudOperation show="" :permission="permission" /> |
|
|
|
|
|
|
|
|
<crudOperation show="" :permission="permission"> |
|
|
|
|
|
<el-button slot="right" icon="el-icon-refresh-left" size="mini" :disabled="!crud.selections.length" @click="handlePwdReset(crud.selections)">密码重置</el-button> |
|
|
|
|
|
</crudOperation> |
|
|
</div> |
|
|
</div> |
|
|
<div class="container-right" style="min-height: calc(100vh - 312px);"> |
|
|
<div class="container-right" style="min-height: calc(100vh - 312px);"> |
|
|
<span class="right-top-line" /> |
|
|
<span class="right-top-line" /> |
|
@ -81,8 +83,19 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
<!-- 密码 --> |
|
|
|
|
|
<el-dialog :visible.sync="resetVisible" title="确认密码重置"> |
|
|
|
|
|
<span class="dialog-right-top" /> |
|
|
|
|
|
<span class="dialog-left-bottom" /> |
|
|
|
|
|
<div class="setting-dialog"> |
|
|
|
|
|
<p class="delMsg">确认重置所选{{ crud.selections.length }}个用户的密码(用户默认密码为:123456)?</p> |
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button v-loading="btnLoading" type="primary" @click="pwdReset(crud.selections)">确定</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-dialog> |
|
|
<!--表格渲染--> |
|
|
<!--表格渲染--> |
|
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler"> |
|
|
|
|
|
|
|
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @row-click="clickRowHandler" @selection-change="crud.selectionChangeHandler"> |
|
|
<el-table-column :selectable="checkboxT" type="selection" align="center" width="55" /> |
|
|
<el-table-column :selectable="checkboxT" type="selection" align="center" width="55" /> |
|
|
<el-table-column :show-overflow-tooltip="true" prop="username" label="用户名" /> |
|
|
<el-table-column :show-overflow-tooltip="true" prop="username" label="用户名" /> |
|
|
<el-table-column :show-overflow-tooltip="true" prop="nickName" label="昵称" /> |
|
|
<el-table-column :show-overflow-tooltip="true" prop="nickName" label="昵称" /> |
|
@ -119,7 +132,8 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import crudUser from '@/api/system/user' |
|
|
|
|
|
|
|
|
import { getToken } from '@/utils/auth' |
|
|
|
|
|
import crudUser, { resetpassword } from '@/api/system/user' |
|
|
import { isvalidPhone } from '@/utils/validate' |
|
|
import { isvalidPhone } from '@/utils/validate' |
|
|
import { getDepts, getDeptSuperior } from '@/api/system/dept' |
|
|
import { getDepts, getDeptSuperior } from '@/api/system/dept' |
|
|
import { getAll, getLevel } from '@/api/system/role' |
|
|
import { getAll, getLevel } from '@/api/system/role' |
|
@ -166,6 +180,11 @@ export default { |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
return { |
|
|
return { |
|
|
|
|
|
headers: { |
|
|
|
|
|
Authorization: getToken() |
|
|
|
|
|
}, |
|
|
|
|
|
btnLoading: false, |
|
|
|
|
|
resetVisible: false, |
|
|
height: document.documentElement.clientHeight - 180 + 'px;', |
|
|
height: document.documentElement.clientHeight - 180 + 'px;', |
|
|
deptName: '', depts: [], deptDatas: [], jobs: [], level: 3, roles: [], |
|
|
deptName: '', depts: [], deptDatas: [], jobs: [], level: 3, roles: [], |
|
|
jobDatas: [], roleDatas: [], // 多选时使用 |
|
|
jobDatas: [], roleDatas: [], // 多选时使用 |
|
@ -220,6 +239,30 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
clickRowHandler(row) { |
|
|
|
|
|
// this.$refs.table.toggleRowSelection(row) // 单击选中 |
|
|
|
|
|
}, |
|
|
|
|
|
handlePwdReset() { |
|
|
|
|
|
this.resetVisible = true |
|
|
|
|
|
}, |
|
|
|
|
|
// 重置密码 |
|
|
|
|
|
pwdReset(data) { |
|
|
|
|
|
const params = data.map(item => { return item.username }) |
|
|
|
|
|
this.btnLoading = true |
|
|
|
|
|
resetpassword(params).then(res => { |
|
|
|
|
|
if (res === 'SUCCESS') { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: '重置密码成功', |
|
|
|
|
|
type: 'success' |
|
|
|
|
|
}) |
|
|
|
|
|
this.resetVisible = false |
|
|
|
|
|
this.btnLoading = false |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error('重置密码失败') |
|
|
|
|
|
this.btnLoading = false |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
// 禁止输入空格 |
|
|
// 禁止输入空格 |
|
|
keydown(e) { |
|
|
keydown(e) { |
|
|
if (e.keyCode === 32) { |
|
|
if (e.keyCode === 32) { |
|
|