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