|
|
|
@ -9,8 +9,7 @@
|
|
|
|
|
@select="handleClick"
|
|
|
|
|
:defaultExpandAll="true"
|
|
|
|
|
:defaultExpandedKeys="defaultExpandedKeys"
|
|
|
|
|
:replaceFields="replaceFields"
|
|
|
|
|
/>
|
|
|
|
|
:replaceFields="replaceFields" />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<a-empty :image="simpleImage" />
|
|
|
|
@ -31,8 +30,7 @@
|
|
|
|
|
<a-form-item label="状态">
|
|
|
|
|
<a-select v-model="queryParam.searchStatus" allow-clear placeholder="请选择状态" default-value="0">
|
|
|
|
|
<a-select-option v-for="(item, index) in statusDictTypeDropDown" :key="index" :value="item.code">
|
|
|
|
|
{{ item.value }}</a-select-option
|
|
|
|
|
>
|
|
|
|
|
{{ item.value }}</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
</a-col>
|
|
|
|
@ -52,23 +50,16 @@
|
|
|
|
|
:alert="true"
|
|
|
|
|
:pageSizeOptions="['10', '20', '50', '100']"
|
|
|
|
|
:rowKey="record => record.id"
|
|
|
|
|
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
|
|
>
|
|
|
|
|
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }">
|
|
|
|
|
<template slot="operator">
|
|
|
|
|
<a-button
|
|
|
|
|
type="primary"
|
|
|
|
|
v-if="hasPerm('sysUser:add')"
|
|
|
|
|
icon="plus"
|
|
|
|
|
@click="$refs.addForm.add()"
|
|
|
|
|
>新增用户
|
|
|
|
|
<a-button type="primary" v-if="hasPerm('sysUser:add')" icon="plus" @click="$refs.addForm.add()">新增用户
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-upload
|
|
|
|
|
:customRequest="customRequest"
|
|
|
|
|
:multiple="true"
|
|
|
|
|
:showUploadList="false"
|
|
|
|
|
name="file"
|
|
|
|
|
v-if="hasPerm('sysUser:import')"
|
|
|
|
|
>
|
|
|
|
|
v-if="hasPerm('sysUser:import')">
|
|
|
|
|
<a-button icon="up-circle">导入</a-button>
|
|
|
|
|
</a-upload>
|
|
|
|
|
<a-button v-if="hasPerm('sysUser:export')" icon="down-circle" @click="sysUserExport()">导出 </a-button>
|
|
|
|
@ -85,8 +76,7 @@
|
|
|
|
|
<a-popconfirm
|
|
|
|
|
placement="top"
|
|
|
|
|
:title="text === 0 ? '确定停用该用户?' : '确定启用该用户?'"
|
|
|
|
|
@confirm="() => editUserStatus(text, record)"
|
|
|
|
|
>
|
|
|
|
|
@confirm="() => editUserStatus(text, record)">
|
|
|
|
|
<a>{{ statusFilter(text) }}</a>
|
|
|
|
|
</a-popconfirm>
|
|
|
|
|
</span>
|
|
|
|
@ -97,13 +87,11 @@
|
|
|
|
|
<a v-if="hasPerm('sysUser:edit')" @click="$refs.editForm.edit(record)">编辑</a>
|
|
|
|
|
<a-divider type="vertical" v-if="hasPerm('sysUser:edit')" />
|
|
|
|
|
<a-dropdown
|
|
|
|
|
v-if="
|
|
|
|
|
hasPerm('sysUser:resetPwd') ||
|
|
|
|
|
v-if="hasPerm('sysUser:resetPwd') ||
|
|
|
|
|
hasPerm('sysUser:grantRole') ||
|
|
|
|
|
hasPerm('sysUser:grantData') ||
|
|
|
|
|
hasPerm('sysUser:delete')
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
">
|
|
|
|
|
<a class="ant-dropdown-link">
|
|
|
|
|
更多
|
|
|
|
|
<a-icon type="down" />
|
|
|
|
@ -133,6 +121,16 @@
|
|
|
|
|
<edit-form ref="editForm" @ok="handleOk" />
|
|
|
|
|
<user-role-form ref="userRoleForm" @ok="handleOk" />
|
|
|
|
|
<user-org-form ref="userOrgForm" @ok="handleOk" />
|
|
|
|
|
<a-modal title="重置密码" :width="600" :visible="resetPwdFlag" @ok="handleSubmitReset" @cancel="resetPwdFlag = false">
|
|
|
|
|
<a-form-model ref="resetForm" :rules="rules" :model="resetForm" :label-col="labelCol" :wrapper-col="wrapperCol">
|
|
|
|
|
<a-form-model-item label="新密码" prop="newPassword">
|
|
|
|
|
<a-input v-model="resetForm.newPassword" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="确认" prop="confirm">
|
|
|
|
|
<a-input v-model="resetForm.confirm" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-form-model>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</a-card>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
@ -220,9 +218,20 @@ export default {
|
|
|
|
|
sexDictTypeDropDown: [],
|
|
|
|
|
statusDictTypeDropDown: [],
|
|
|
|
|
treeLoading: true,
|
|
|
|
|
labelCol: { span: 4 },
|
|
|
|
|
wrapperCol: { span: 14 },
|
|
|
|
|
resetPwdFlag: false,
|
|
|
|
|
resetForm: {
|
|
|
|
|
confirm: '',
|
|
|
|
|
newPassword: ''
|
|
|
|
|
},
|
|
|
|
|
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
|
|
|
replaceFields: {
|
|
|
|
|
key: 'id'
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
newPassword: [{ required: true, trigger: 'blur', min: 5, message: '请输入至少五个字符的账号!' }],
|
|
|
|
|
confirm: [{ required: true, message: '请输入', trigger: 'blur' }]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -323,20 +332,34 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 重置密码
|
|
|
|
|
*/
|
|
|
|
|
resetPwd(record) {
|
|
|
|
|
handleSubmitReset() {
|
|
|
|
|
this.$refs.resetForm.validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.resetForm.newPassword !== this.resetForm.confirm) {
|
|
|
|
|
this.$message.warning('两次输入的密码不一致')
|
|
|
|
|
} else {
|
|
|
|
|
sysUserResetPwd({
|
|
|
|
|
id: record.id
|
|
|
|
|
id: this.resetPwdFId,
|
|
|
|
|
...this.resetForm
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.success) {
|
|
|
|
|
this.$message.success('重置成功')
|
|
|
|
|
// this.$refs.table.refresh()
|
|
|
|
|
this.resetPwdFlag = false
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('重置失败:' + res.message)
|
|
|
|
|
this.$message.error('重置失败:' + res.message.newPassword[0])
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 重置密码
|
|
|
|
|
*/
|
|
|
|
|
resetPwd(record) {
|
|
|
|
|
this.resetPwdFlag = true
|
|
|
|
|
this.resetPwdFId = record.id
|
|
|
|
|
this.resetForm = {}
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 删除用户
|
|
|
|
|