|
|
@@ -1,157 +1,163 @@
|
|
|
<template>
|
|
|
- <div class="user-page">
|
|
|
- <SearchForm
|
|
|
- ref="searchFormRef"
|
|
|
- :departmentList="departmentList"
|
|
|
- :roleData="roleData"
|
|
|
- @get-table-data="onSearchCommit"
|
|
|
- @reset-form="onResetForm"
|
|
|
- />
|
|
|
- <el-card>
|
|
|
- <template #header>
|
|
|
- <el-space align="center">
|
|
|
- <el-button type="primary" @click="openAddSingleDrawer" v-permission="PERM_USER.ACCOUNT_MANAGE">
|
|
|
- <template #icon>
|
|
|
- <el-icon>
|
|
|
- <Plus />
|
|
|
- </el-icon>
|
|
|
+ <VerticalFlexLayout>
|
|
|
+ <template #static>
|
|
|
+ <Breadcrumb />
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <div class="user-page">
|
|
|
+ <SearchForm
|
|
|
+ ref="searchFormRef"
|
|
|
+ :departmentList="departmentList"
|
|
|
+ :roleData="roleData"
|
|
|
+ @get-table-data="onSearchCommit"
|
|
|
+ @reset-form="onResetForm"
|
|
|
+ />
|
|
|
+ <el-card shadow="never">
|
|
|
+ <template #header>
|
|
|
+ <el-space align="center">
|
|
|
+ <el-button type="primary" @click="openAddSingleDrawer" v-permission="PERM_USER.ACCOUNT_MANAGE">
|
|
|
+ <template #icon>
|
|
|
+ <el-icon>
|
|
|
+ <Plus />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ 添加用户
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ color="#1890FF"
|
|
|
+ @click="openAddMultipleDrawer"
|
|
|
+ style="margin-left: 18px"
|
|
|
+ plain
|
|
|
+ v-permission="PERM_USER.ACCOUNT_MANAGE"
|
|
|
+ >
|
|
|
+ <template #icon>
|
|
|
+ <el-icon>
|
|
|
+ <DocumentAdd />
|
|
|
+ </el-icon>
|
|
|
+ </template>
|
|
|
+ 批量导入
|
|
|
+ </el-button>
|
|
|
+ </el-space>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <el-table :data="userList" row-key="id">
|
|
|
+ <el-table-column label="工号" prop="staffNo">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>
|
|
|
+ <span style="margin-left: 10px">{{ scope.row.staffNo }}</span>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- 添加用户
|
|
|
- </el-button>
|
|
|
-
|
|
|
- <el-button
|
|
|
- color="#1890FF"
|
|
|
- @click="openAddMultipleDrawer"
|
|
|
- style="margin-left: 18px"
|
|
|
- plain
|
|
|
- v-permission="PERM_USER.ACCOUNT_MANAGE"
|
|
|
- >
|
|
|
- <template #icon>
|
|
|
- <el-icon>
|
|
|
- <DocumentAdd />
|
|
|
- </el-icon>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="登录账号" prop="username" width="150">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="account">
|
|
|
+ {{ scope.row.username }}
|
|
|
+ <el-tooltip
|
|
|
+ class="box-item"
|
|
|
+ effect="dark"
|
|
|
+ content="租户管理员账号,自动拥有全部相机查看权限及功能权限"
|
|
|
+ placement="top-start"
|
|
|
+ v-if="scope.row.roleType === RoleTypeEnum.TENANT_ADMIN"
|
|
|
+ >
|
|
|
+ <el-icon color="#409efc">
|
|
|
+ <Stamp />
|
|
|
+ </el-icon>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
- 批量导入
|
|
|
- </el-button>
|
|
|
- </el-space>
|
|
|
- </template>
|
|
|
-
|
|
|
- <el-table height="calc(100vh - 340px)" :data="userList" row-key="id">
|
|
|
- <el-table-column label="工号" prop="staffNo">
|
|
|
- <template #default="scope">
|
|
|
- <div>
|
|
|
- <span style="margin-left: 10px">{{ scope.row.staffNo }}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="登录账号" prop="username" width="150">
|
|
|
- <template #default="scope">
|
|
|
- <div class="account">
|
|
|
- {{ scope.row.username }}
|
|
|
- <el-tooltip
|
|
|
- class="box-item"
|
|
|
- effect="dark"
|
|
|
- content="租户管理员账号,自动拥有全部相机查看权限及功能权限"
|
|
|
- placement="top-start"
|
|
|
- v-if="scope.row.roleType === RoleTypeEnum.TENANT_ADMIN"
|
|
|
- >
|
|
|
- <el-icon color="#409efc">
|
|
|
- <Stamp />
|
|
|
- </el-icon>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="姓名" prop="realname" />
|
|
|
- <el-table-column label="手机" prop="mobile" />
|
|
|
- <el-table-column label="状态" prop="isDisabled">
|
|
|
- <template #default="scope">
|
|
|
- <div>
|
|
|
- <el-tag :type="!scope.row.isDisabled ? 'success' : 'danger'">
|
|
|
- {{ !scope.row.isDisabled ? '正常' : '锁定' }}</el-tag
|
|
|
- >
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="角色" prop="roleList">
|
|
|
- <template #default="scope">
|
|
|
- <div>
|
|
|
- {{ tranformRoleList(scope.row.roleList) }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="组织" prop="deptList">
|
|
|
- <template #default="scope">
|
|
|
- <div>
|
|
|
- {{ tranformDeptList(scope.row.deptList) }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="认证方式" prop="certify" />
|
|
|
- <el-table-column label="创建时间" prop="createdAt" />
|
|
|
- <el-table-column label="操作" width="200">
|
|
|
- <template #default="scope">
|
|
|
- <el-space v-if="scope.row.roleType !== RoleTypeEnum.SUPER_ADMIN">
|
|
|
- <div class="el-space el-space--horizontal">
|
|
|
- <!-- <div
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="姓名" prop="realname" />
|
|
|
+ <el-table-column label="手机" prop="mobile" />
|
|
|
+ <el-table-column label="状态" prop="isDisabled">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>
|
|
|
+ <el-tag :type="!scope.row.isDisabled ? 'success' : 'danger'">
|
|
|
+ {{ !scope.row.isDisabled ? '正常' : '锁定' }}</el-tag
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="角色" prop="roleList">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>
|
|
|
+ {{ tranformRoleList(scope.row.roleList) }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="组织" prop="deptList">
|
|
|
+ <template #default="scope">
|
|
|
+ <div>
|
|
|
+ {{ tranformDeptList(scope.row.deptList) }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="认证方式" prop="certify" />
|
|
|
+ <el-table-column label="创建时间" prop="createdAt" />
|
|
|
+ <el-table-column label="操作" width="200">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-space v-if="scope.row.roleType !== RoleTypeEnum.SUPER_ADMIN">
|
|
|
+ <div class="el-space el-space--horizontal">
|
|
|
+ <!-- <div
|
|
|
class="el-space__item"
|
|
|
@click="handleEdit(scope.row)"
|
|
|
v-permission="{ action: [PERM_USER.ACCOUNT_EDIT] }"
|
|
|
> -->
|
|
|
- <div class="el-space__item" @click="handleEdit(scope.row)" v-permission="PERM_USER.ACCOUNT_MANAGE">
|
|
|
- <div><img :src="editIcon" class="el-tooltip__trigger" /></div>
|
|
|
- </div>
|
|
|
- <!-- <div
|
|
|
+ <div class="el-space__item" @click="handleEdit(scope.row)" v-permission="PERM_USER.ACCOUNT_MANAGE">
|
|
|
+ <div><img :src="editIcon" class="el-tooltip__trigger" /></div>
|
|
|
+ </div>
|
|
|
+ <!-- <div
|
|
|
class="el-space__item"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-permission="{ action: [PERM_USER.ACCOUNT_DELETE] }"
|
|
|
> -->
|
|
|
- <div class="el-space__item" @click="handleDelete(scope.row)" v-permission="PERM_USER.ACCOUNT_MANAGE">
|
|
|
- <div><img :src="deleteIcon" class="el-tooltip__trigger" /></div>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="el-space__item"
|
|
|
- v-if="visibleRestPassBtn(scope.row.roleType) && hasResetPasswordPermission()"
|
|
|
- @click="handleResetCode(scope.row)"
|
|
|
- >
|
|
|
- <div class="tooltip__password">重置密码</div>
|
|
|
+ <div class="el-space__item" @click="handleDelete(scope.row)" v-permission="PERM_USER.ACCOUNT_MANAGE">
|
|
|
+ <div><img :src="deleteIcon" class="el-tooltip__trigger" /></div>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="el-space__item"
|
|
|
+ v-if="visibleRestPassBtn(scope.row.roleType) && hasResetPasswordPermission()"
|
|
|
+ @click="handleResetCode(scope.row)"
|
|
|
+ >
|
|
|
+ <div class="tooltip__password">重置密码</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </el-space>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <section class="mt-4 flex justify-end">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout="total, sizes, prev, pager, next"
|
|
|
- :page-sizes="[10, 30, 50]"
|
|
|
- :total="total"
|
|
|
- v-model:page-size="params.pageSize"
|
|
|
- v-model:current-page="params.pageNumber"
|
|
|
- @change="loadPageData"
|
|
|
- />
|
|
|
- </section>
|
|
|
- </el-card>
|
|
|
- <CreateDrawer
|
|
|
- ref="createDrawerRef"
|
|
|
- :title="drawerTitle"
|
|
|
- @change="reloadTable"
|
|
|
- :departmentList="departmentList"
|
|
|
- :roleData="roleData"
|
|
|
- :width="450"
|
|
|
- />
|
|
|
- <ResetCodeDrawer ref="ResetCodeDrawerRef" :title="drawerTitle" @change="reloadTable" />
|
|
|
-
|
|
|
- <AddUser
|
|
|
- v-if="showAddPopover"
|
|
|
- :colseAddUser="setShowAddPopoverFalse"
|
|
|
- v-model="showAddPopover"
|
|
|
- class="add-popover"
|
|
|
- @change="reloadTable"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ </el-space>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <section class="paginationPosition">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="total, sizes, prev, pager, next"
|
|
|
+ :page-sizes="[10, 30, 50]"
|
|
|
+ :total="total"
|
|
|
+ v-model:page-size="params.pageSize"
|
|
|
+ v-model:current-page="params.pageNumber"
|
|
|
+ @change="loadPageData"
|
|
|
+ />
|
|
|
+ </section>
|
|
|
+ </el-card>
|
|
|
+ <CreateDrawer
|
|
|
+ ref="createDrawerRef"
|
|
|
+ :title="drawerTitle"
|
|
|
+ @change="reloadTable"
|
|
|
+ :departmentList="departmentList"
|
|
|
+ :roleData="roleData"
|
|
|
+ :width="450"
|
|
|
+ />
|
|
|
+ <ResetCodeDrawer ref="ResetCodeDrawerRef" :title="drawerTitle" @change="reloadTable" />
|
|
|
+
|
|
|
+ <AddUser
|
|
|
+ v-if="showAddPopover"
|
|
|
+ :colseAddUser="setShowAddPopoverFalse"
|
|
|
+ v-model="showAddPopover"
|
|
|
+ class="add-popover"
|
|
|
+ @change="reloadTable"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </VerticalFlexLayout>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
@@ -178,6 +184,8 @@
|
|
|
import { PERM_USER } from '@/types/permission/constants';
|
|
|
import { calculateTreeData } from '@/utils';
|
|
|
import { DeptTreeItem } from '@/types/dept/type';
|
|
|
+ import VerticalFlexLayout from '@/components/VerticalFlexLayout.vue';
|
|
|
+ import Breadcrumb from '@/components/Breadcrumb.vue';
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
const { getUserInfo } = storeToRefs(userStore);
|