|
@@ -1,21 +1,23 @@
|
|
|
<template>
|
|
<template>
|
|
|
<a-card class="account-page-card">
|
|
<a-card class="account-page-card">
|
|
|
- <Action :btn_text="'新建账号'" @searchClick="searchClick" @resetClick="resetClick" @createClick="createClick"
|
|
|
|
|
- @sizeChange="tableSizeChange" @refreshClick="refreshClick"></Action>
|
|
|
|
|
|
|
+ <Action :btn_text="'新建用户'" :btn_permission="'system:user:add'" @searchClick="searchClick" @resetClick="resetClick"
|
|
|
|
|
+ @createClick="createClick" @sizeChange="tableSizeChange" @refreshClick="refreshClick"></Action>
|
|
|
<DataTable :data="table_data" :columns="table_columns" row-key="userId" :size="table_size" :loading="table_loading"
|
|
<DataTable :data="table_data" :columns="table_columns" row-key="userId" :size="table_size" :loading="table_loading"
|
|
|
:pagination="pagination_props" @pageChange="handlePageChange">
|
|
:pagination="pagination_props" @pageChange="handlePageChange">
|
|
|
<template #status="{ record }">
|
|
<template #status="{ record }">
|
|
|
<a-switch v-model="record.status" @change="statusChange(record)" checked-value="1" unchecked-value="0" />
|
|
<a-switch v-model="record.status" @change="statusChange(record)" checked-value="1" unchecked-value="0" />
|
|
|
</template>
|
|
</template>
|
|
|
<template #operationSlot="{ record }">
|
|
<template #operationSlot="{ record }">
|
|
|
- <a-popconfirm content="确定重置该账号密码吗?" @ok="handleResetPassword(record)">
|
|
|
|
|
- <a-button type="text">重制密码</a-button>
|
|
|
|
|
|
|
+ <a-popconfirm content="确定重置该用户密码吗?" @ok="handleResetPassword(record)">
|
|
|
|
|
+ <a-button v-hasPermi="'system:role:resetPassword'" type="text">重制密码</a-button>
|
|
|
</a-popconfirm>
|
|
</a-popconfirm>
|
|
|
- <a-button type="text" @click="handleEdit(record, true)">编辑</a-button>
|
|
|
|
|
- <a-button type="text" @click="handleView(record, true)">查看权限</a-button>
|
|
|
|
|
- <a-button type="text" @click="handleDeptConfig(record, true)">部门配置</a-button>
|
|
|
|
|
|
|
+ <a-button v-hasPermi="'system:user:edit'" type="text" @click="handleEdit(record, true)">编辑</a-button>
|
|
|
|
|
+ <a-button v-hasPermi="'system:user:viewPermission'" type="text"
|
|
|
|
|
+ @click="handleView(record, true)">查看权限</a-button>
|
|
|
|
|
+ <a-button v-hasPermi="'system:user:deptEdit'" type="text"
|
|
|
|
|
+ @click="handleDeptConfig(record, true)">部门配置</a-button>
|
|
|
<a-popconfirm content="确定删除该条数据吗?" type="warning" @ok="handleDelete(record.userId)">
|
|
<a-popconfirm content="确定删除该条数据吗?" type="warning" @ok="handleDelete(record.userId)">
|
|
|
- <a-button type="text" status="warning">删除</a-button>
|
|
|
|
|
|
|
+ <a-button v-hasPermi="'system:user:delete'" type="text" status="warning">删除</a-button>
|
|
|
</a-popconfirm>
|
|
</a-popconfirm>
|
|
|
</template>
|
|
</template>
|
|
|
</DataTable>
|
|
</DataTable>
|
|
@@ -45,7 +47,7 @@ import Modal from '../Modal.vue';
|
|
|
import AccountForm from './AccountForm.vue';
|
|
import AccountForm from './AccountForm.vue';
|
|
|
import ViewPermission from './ViewPermission.vue';
|
|
import ViewPermission from './ViewPermission.vue';
|
|
|
import DeptConfigModal from './DeptConfigModal.vue';
|
|
import DeptConfigModal from './DeptConfigModal.vue';
|
|
|
-
|
|
|
|
|
|
|
+import { hasPermission } from '../../../utils/permission';
|
|
|
import {
|
|
import {
|
|
|
QueryUserList, QueryUserDeptDetail, UpdateUserDept, AddUser,
|
|
QueryUserList, QueryUserDeptDetail, UpdateUserDept, AddUser,
|
|
|
UpdateUser, QueryUserPermission, UserStatusSwitch, ResetPassword, DeleteUser
|
|
UpdateUser, QueryUserPermission, UserStatusSwitch, ResetPassword, DeleteUser
|
|
@@ -295,7 +297,7 @@ const modalSave = async () => {
|
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
|
const action = is_edit_mode.value ? '编辑' : '新增';
|
|
const action = is_edit_mode.value ? '编辑' : '新增';
|
|
|
Message.success({
|
|
Message.success({
|
|
|
- title: `${action}账号`,
|
|
|
|
|
|
|
+ title: `${action}用户`,
|
|
|
content: `${action}成功`,
|
|
content: `${action}成功`,
|
|
|
});
|
|
});
|
|
|
getUserList();
|
|
getUserList();
|
|
@@ -327,8 +329,11 @@ const getDeptTree = async () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getUserList()
|
|
|
|
|
- getDeptTree()
|
|
|
|
|
|
|
+ if (hasPermission('system:user:list')) {
|
|
|
|
|
+ getUserList()
|
|
|
|
|
+ getDeptTree()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|