|
@@ -1,51 +1,74 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <div class="tw-bg-white tw-p-5 tw-rounded-xl tw-mb-5">
|
|
|
- <template v-if="store.isSuperAdmin">
|
|
|
- <RootOrgSelect v-model:value="rootOrgId" />
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- </template>
|
|
|
- <a-input
|
|
|
- v-model:value="name"
|
|
|
- class="tw-mr-4"
|
|
|
- style="width: 178px"
|
|
|
- placeholder="姓名"
|
|
|
- allowClear
|
|
|
- ></a-input>
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <a-input
|
|
|
- v-model:value="loginName"
|
|
|
- style="width: 178px"
|
|
|
- placeholder="登录名"
|
|
|
- allowClear
|
|
|
- ></a-input>
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <RoleSelect v-model:value="role" :rootOrgId="rootOrgId" />
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <StateSelect v-model:value="enable" />
|
|
|
- <span class="tw-mr-4"></span>
|
|
|
- <a-button class="query-btn" @click="clickSearch">查询</a-button>
|
|
|
+ <div class="part-box">
|
|
|
+ <a-space class="filter-line" :size="12">
|
|
|
+ <RootOrgSelect v-if="store.isSuperAdmin" v-model:value="rootOrgId" />
|
|
|
+ <a-input
|
|
|
+ v-model:value="name"
|
|
|
+ prefix="姓名"
|
|
|
+ placeholder="请输入"
|
|
|
+ allowClear
|
|
|
+ >
|
|
|
+ </a-input>
|
|
|
+ <a-input
|
|
|
+ v-model:value="loginName"
|
|
|
+ prefix="登录名"
|
|
|
+ placeholder="请输入"
|
|
|
+ allowClear
|
|
|
+ ></a-input>
|
|
|
+ <RoleSelect v-model:value="role" :rootOrgId="rootOrgId" />
|
|
|
+ <StateSelect v-model:value="enable" />
|
|
|
+ <a-button type="primary" @click="clickSearch">查询</a-button>
|
|
|
+ </a-space>
|
|
|
</div>
|
|
|
|
|
|
- <div class="tw-flex tw-gap-2 tw-my-4">
|
|
|
- <a-button type="primary" @click="newUser">新增</a-button>
|
|
|
- <a-button @click="importModalVisible = true">批量导入</a-button>
|
|
|
- <a-button @click="handleExport">批量导出</a-button>
|
|
|
- <a-button @click="handleToggleUsers(true, selectIds)">
|
|
|
- 批量启用
|
|
|
- </a-button>
|
|
|
- <a-button @click="handleToggleUsers(false, selectIds)">
|
|
|
- 批量禁用
|
|
|
- </a-button>
|
|
|
- <a-button @click="handleResetUsers(selectIds)">批量重置密码</a-button>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="tw-bg-white tw-p-5 tw-rounded-xl">
|
|
|
+ <div class="part-box">
|
|
|
+ <a-space class="part-action" :size="6">
|
|
|
+ <a-button type="text" @click="newUser">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="add"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 新增</a-button
|
|
|
+ >
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a-button type="text" @click="importModalVisible = true">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="import"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 导入
|
|
|
+ </a-button>
|
|
|
+ <a-button type="text" @click="handleExport">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="export"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 导出
|
|
|
+ </a-button>
|
|
|
+ <a-button type="text" @click="handleToggleUsers(true, selectIds)">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="enable"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 启用
|
|
|
+ </a-button>
|
|
|
+ <a-button type="text" @click="handleToggleUsers(false, selectIds)">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="disable"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 禁用
|
|
|
+ </a-button>
|
|
|
+ <a-button type="text" @click="handleResetUsers(selectIds)">
|
|
|
+ <template #icon>
|
|
|
+ <svg-icon name="password"></svg-icon>
|
|
|
+ </template>
|
|
|
+ 重置密码
|
|
|
+ </a-button>
|
|
|
+ </a-space>
|
|
|
<a-table
|
|
|
+ class="page-table"
|
|
|
rowKey="id"
|
|
|
:columns="columns"
|
|
|
:scroll="{ x: 1200 }"
|
|
|
:data-source="data"
|
|
|
+ size="middle"
|
|
|
:rowSelection="{
|
|
|
selectedRowKeys: selectIds,
|
|
|
onChange: handleRowSelect,
|
|
@@ -55,7 +78,7 @@
|
|
|
current: pageNo,
|
|
|
total: totalElements,
|
|
|
showTotal: () => ``,
|
|
|
- onChange: (pageNoChanged, pageSizeChanged) => {
|
|
|
+ onChange: (pageNoChanged:number, pageSizeChanged:number) => {
|
|
|
selectIds = [];
|
|
|
pageNo = pageNoChanged;
|
|
|
pageSize = pageSizeChanged;
|
|
@@ -75,34 +98,26 @@
|
|
|
<a>{{ $filters.booleanEnableDisableFilter(text) }}</a>
|
|
|
</template>
|
|
|
<template #action="{ record }">
|
|
|
- <span>
|
|
|
- <a-button @click="showModal(record)">编辑</a-button>
|
|
|
- <a-button @click="handleToggleUsers(!record.enable, [record.id])">
|
|
|
+ <div class="action-cell">
|
|
|
+ <a-button type="text" @click="showModal(record)">编辑</a-button>
|
|
|
+ <a-button
|
|
|
+ type="text"
|
|
|
+ :danger="record.enable"
|
|
|
+ @click="handleToggleUsers(!record.enable, [record.id])"
|
|
|
+ >
|
|
|
{{ record.enable ? "禁用" : "启用" }}
|
|
|
</a-button>
|
|
|
- <a-popover placement="bottom">
|
|
|
- <template #content>
|
|
|
- <div class="tw-flex tw-flex-col">
|
|
|
- <a-button
|
|
|
- type="text"
|
|
|
- style="color: white"
|
|
|
- @click="handleResetUsers([record.id])"
|
|
|
- >
|
|
|
- 重置密码
|
|
|
- </a-button>
|
|
|
- <a-button
|
|
|
- v-if="store.isGreaterThanEqualRootOrgAdmin"
|
|
|
- type="text"
|
|
|
- style="color: white"
|
|
|
- @click="handleUserPrivilege(record.id)"
|
|
|
- >
|
|
|
- 权限设置
|
|
|
- </a-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <a-button>更多</a-button>
|
|
|
- </a-popover>
|
|
|
- </span>
|
|
|
+ <a-button type="text" @click="handleResetUsers([record.id])">
|
|
|
+ 重置密码
|
|
|
+ </a-button>
|
|
|
+ <a-button
|
|
|
+ v-if="store.isGreaterThanEqualRootOrgAdmin"
|
|
|
+ type="text"
|
|
|
+ @click="handleUserPrivilege(record.id)"
|
|
|
+ >
|
|
|
+ 权限设置
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</div>
|
|
@@ -112,6 +127,7 @@
|
|
|
title="用户信息页"
|
|
|
okText="确定"
|
|
|
cancelText="取消"
|
|
|
+ :width="438"
|
|
|
@ok="handleOk"
|
|
|
>
|
|
|
<a-form :labelCol="{ span: 4 }">
|
|
@@ -254,14 +270,14 @@ const columns = [
|
|
|
{
|
|
|
title: "学校",
|
|
|
dataIndex: "rootOrgName",
|
|
|
- width: 200,
|
|
|
+ minWidth: 200,
|
|
|
slots: { customRender: "rootOrgName" },
|
|
|
ellipses: true,
|
|
|
},
|
|
|
{
|
|
|
title: "姓名",
|
|
|
dataIndex: "name",
|
|
|
- width: 80,
|
|
|
+ minWidth: 120,
|
|
|
},
|
|
|
{
|
|
|
title: "登录名",
|
|
@@ -287,7 +303,7 @@ const columns = [
|
|
|
{
|
|
|
title: "创建人",
|
|
|
dataIndex: "creator",
|
|
|
- width: 80,
|
|
|
+ minWidth: 80,
|
|
|
},
|
|
|
{
|
|
|
title: "更新时间",
|
|
@@ -297,14 +313,14 @@ const columns = [
|
|
|
{
|
|
|
title: "更新人",
|
|
|
dataIndex: "updater",
|
|
|
- width: 80,
|
|
|
+ minWidth: 80,
|
|
|
},
|
|
|
{
|
|
|
title: "操作",
|
|
|
key: "action",
|
|
|
slots: { customRender: "action" },
|
|
|
fixed: "right",
|
|
|
- width: 270,
|
|
|
+ width: store.isGreaterThanEqualRootOrgAdmin ? 240 : 180,
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -371,7 +387,7 @@ function handleResetUsers(ids: number[]) {
|
|
|
if (checkEmpty(ids)) return;
|
|
|
Modal.confirm({
|
|
|
title: "提示",
|
|
|
- content: "确认重置?",
|
|
|
+ content: "是否重置该用户密码?",
|
|
|
cancelText: "取消",
|
|
|
okText: "确定",
|
|
|
onOk: async () => {
|