|
@@ -2,18 +2,16 @@
|
|
|
import DepartWrap from './components/DepartWrap.vue'
|
|
|
import { Search, Plus } from '@element-plus/icons-vue'
|
|
|
import { apiSystemUser, apiSystemRole } from '@/api/system'
|
|
|
-import EditUser from './components/EditUser.vue'
|
|
|
-import ResetPwd from './components/ResetPwd.vue'
|
|
|
-import MoveUserDepart from './components/MoveUserDepart.vue'
|
|
|
|
|
|
// 获取角色
|
|
|
const roleId = ref('')
|
|
|
const roleArr = ref([])
|
|
|
async function getRoleList() {
|
|
|
- const res = await apiSystemRole.roleAllList()
|
|
|
+ /* const res = await apiSystemRole.roleAllList()
|
|
|
if (res.Ret !== 200) return
|
|
|
const list = res.Data.List || []
|
|
|
- roleArr.value = list
|
|
|
+ roleArr.value = list */
|
|
|
+ roleArr.value = []
|
|
|
}
|
|
|
getRoleList()
|
|
|
|
|
@@ -27,13 +25,17 @@ const tableColOpt = [
|
|
|
key: 'SysRealName'
|
|
|
},
|
|
|
{
|
|
|
- label: '用户名',
|
|
|
+ label: '工号',
|
|
|
key: 'SysUserName'
|
|
|
},
|
|
|
{
|
|
|
label: '手机号',
|
|
|
key: 'Phone'
|
|
|
},
|
|
|
+ {
|
|
|
+ label: '邮箱',
|
|
|
+ key: 'Email'
|
|
|
+ },
|
|
|
{
|
|
|
label: '角色',
|
|
|
key: 'SysRoleName'
|
|
@@ -43,8 +45,8 @@ const tableColOpt = [
|
|
|
key: 'SysDepartmentName'
|
|
|
},
|
|
|
{
|
|
|
- label: '状态',
|
|
|
- key: 'IsEnabled'
|
|
|
+ label: '在职状态',
|
|
|
+ key: 'IsEnabled1'
|
|
|
},
|
|
|
]
|
|
|
const userList = ref([])
|
|
@@ -54,18 +56,28 @@ const tableLoading = ref(false)
|
|
|
const totals = ref(0)
|
|
|
async function getUserList() {
|
|
|
tableLoading.value = true
|
|
|
- const res = await apiSystemUser.userList({
|
|
|
+ /* const res = await apiSystemUser.userList({
|
|
|
PageSize: pageSize.value,
|
|
|
CurrentIndex: page.value,
|
|
|
RoleId: roleId.value,
|
|
|
KeyWord: keyword.value,
|
|
|
DepartmentId: departId.value
|
|
|
- })
|
|
|
+ }) */
|
|
|
tableLoading.value = false
|
|
|
- if (res.Ret === 200) {
|
|
|
+ userList.value = [
|
|
|
+ {
|
|
|
+ SysRealName:'aaa',
|
|
|
+ SysUserName:'026530',
|
|
|
+ Phone:'123456',
|
|
|
+ Email:'aaa@qq.com',
|
|
|
+ SysDepartmentName:'FICC研究部/aaa/bbb',
|
|
|
+ IsEnabled1:'在职'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ /* if (res.Ret === 200) {
|
|
|
userList.value = res.Data.List || []
|
|
|
totals.value = res.Data.Paging.Totals
|
|
|
- }
|
|
|
+ } */
|
|
|
}
|
|
|
getUserList()
|
|
|
function handlePageChange(e) {
|
|
@@ -77,39 +89,7 @@ function refreshUserList() {
|
|
|
getUserList()
|
|
|
}
|
|
|
|
|
|
-// 编辑用户
|
|
|
-const showEditUser = ref(false)
|
|
|
-let userData = ref(null)
|
|
|
-function handleAddUser(e) {
|
|
|
- userData.value = e
|
|
|
- showEditUser.value = true
|
|
|
-}
|
|
|
-
|
|
|
-// 重置密码
|
|
|
-const showResetPwd = ref(false)
|
|
|
-function openResetPassDialog(e) {
|
|
|
- userData.value = e
|
|
|
- showResetPwd.value = true
|
|
|
-}
|
|
|
-
|
|
|
-// 移动分组
|
|
|
-const showMoveUserDepart = ref(false)
|
|
|
-function openMoveDepartDialog(e) {
|
|
|
- userData.value = e
|
|
|
- showMoveUserDepart.value = true
|
|
|
-}
|
|
|
-
|
|
|
-// 启用\禁用用户
|
|
|
-async function changeStatus(e) {
|
|
|
- const res = await apiSystemUser.setUserEnableStatus({
|
|
|
- sysUserId: e.SysUserId,
|
|
|
- IsEnabled: e.IsEnabled ? false : true
|
|
|
- })
|
|
|
- if (res.Ret !== 200) return
|
|
|
- ElMessage.success('设置成功')
|
|
|
- getUserList()
|
|
|
-}
|
|
|
-
|
|
|
+function changeUserAuth(data){}
|
|
|
|
|
|
</script>
|
|
|
|
|
@@ -119,15 +99,8 @@ async function changeStatus(e) {
|
|
|
<DepartWrap v-model:departActive="departId" @change="refreshUserList" />
|
|
|
<div class="user-wrap">
|
|
|
<div class="user-top-box">
|
|
|
- <el-button
|
|
|
- v-permission="'sysUser:add'"
|
|
|
- type="primary"
|
|
|
- :icon="Plus"
|
|
|
- @click="handleAddUser(null)"
|
|
|
- >添加用户</el-button
|
|
|
- >
|
|
|
<el-input
|
|
|
- placeholder="姓名/账号/手机号搜索"
|
|
|
+ placeholder="工号/手机号/邮箱搜索"
|
|
|
v-model="keyword"
|
|
|
:prefix-icon="Search"
|
|
|
clearable
|
|
@@ -135,21 +108,6 @@ async function changeStatus(e) {
|
|
|
style="max-width: 359px; float: right"
|
|
|
>
|
|
|
</el-input>
|
|
|
- <el-select
|
|
|
- v-model="roleId"
|
|
|
- placeholder="请选择角色"
|
|
|
- clearable
|
|
|
- style="float: right; width: 150px; margin-right: 20px"
|
|
|
- @change="refreshUserList"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in roleArr"
|
|
|
- :key="item.SysRoleId"
|
|
|
- :label="item.SysRoleName"
|
|
|
- :value="item.SysRoleId"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
</div>
|
|
|
<div class="table-wrap">
|
|
|
<el-table
|
|
@@ -179,12 +137,11 @@ async function changeStatus(e) {
|
|
|
<template #default="{ row }">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
- v-permission="'sysUser:edit'"
|
|
|
link
|
|
|
- @click.stop="handleAddUser(row)"
|
|
|
- >编辑</el-button
|
|
|
+ @click.stop="changeUserAuth(row)"
|
|
|
+ >配置角色</el-button
|
|
|
>
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
v-permission="'sysUser:resetPassword'"
|
|
|
type="primary"
|
|
|
link
|
|
@@ -205,8 +162,7 @@ async function changeStatus(e) {
|
|
|
link
|
|
|
@click.stop="changeStatus(row)"
|
|
|
>{{ row.IsEnabled ? "禁用" : "启用" }}</el-button
|
|
|
- >
|
|
|
- <!-- </div> -->
|
|
|
+ > -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -222,20 +178,6 @@ async function changeStatus(e) {
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 新增\编辑用户 -->
|
|
|
- <EditUser
|
|
|
- v-model:show="showEditUser"
|
|
|
- :data="userData"
|
|
|
- @success="getUserList"
|
|
|
- />
|
|
|
- <!-- 重置密码 -->
|
|
|
- <ResetPwd v-model:show="showResetPwd" :data="userData" />
|
|
|
- <!-- 移动分组 -->
|
|
|
- <MoveUserDepart
|
|
|
- v-model:show="showMoveUserDepart"
|
|
|
- :data="userData"
|
|
|
- @success="getUserList"
|
|
|
- />
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -244,6 +186,10 @@ async function changeStatus(e) {
|
|
|
.user-wrap {
|
|
|
flex: 1;
|
|
|
}
|
|
|
+ .user-top-box{
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ }
|
|
|
.table-wrap {
|
|
|
margin-top: 20px;
|
|
|
}
|