|
@@ -1,22 +1,23 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div>
|
|
|
|
|
|
|
+ <div class="p-8">
|
|
|
<!-- 头部工具栏 -->
|
|
<!-- 头部工具栏 -->
|
|
|
- <a-card>
|
|
|
|
|
- <a-space>
|
|
|
|
|
|
|
+ <a-card class="mb-6 bg-gray-50 rounded-lg shadow-sm !border-0">
|
|
|
|
|
+ <a-space size="large">
|
|
|
<a-input-search
|
|
<a-input-search
|
|
|
v-model:value="searchKeyword"
|
|
v-model:value="searchKeyword"
|
|
|
- placeholder="搜索用户名或姓名"
|
|
|
|
|
- style="width: 300px"
|
|
|
|
|
|
|
+ placeholder="搜索用户名或姓名..."
|
|
|
|
|
+ class="w-80"
|
|
|
@search="loadUsers"
|
|
@search="loadUsers"
|
|
|
/>
|
|
/>
|
|
|
- <a-button type="primary" @click="showCreateModal">
|
|
|
|
|
|
|
+ <a-button type="primary" @click="showCreateModal" class="shadow-sm hover:shadow-md transition-shadow">
|
|
|
|
|
+ <PlusOutlined class="mr-2" />
|
|
|
创建用户
|
|
创建用户
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</a-space>
|
|
</a-space>
|
|
|
</a-card>
|
|
</a-card>
|
|
|
|
|
|
|
|
<!-- 用户列表表格 -->
|
|
<!-- 用户列表表格 -->
|
|
|
- <a-card class="mt-4">
|
|
|
|
|
|
|
+ <a-card class="rounded-xl shadow-md !border-0">
|
|
|
<a-table
|
|
<a-table
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:dataSource="users"
|
|
:dataSource="users"
|
|
@@ -27,14 +28,14 @@
|
|
|
>
|
|
>
|
|
|
<!-- 状态列 -->
|
|
<!-- 状态列 -->
|
|
|
<template #status="{ record }">
|
|
<template #status="{ record }">
|
|
|
- <a-tag :color="record.status === 1 ? 'green' : 'red'">
|
|
|
|
|
|
|
+ <a-tag :color="record.status === 1 ? 'green' : 'red'" class="!rounded-full">
|
|
|
{{ record.status === 1 ? '正常' : '禁用' }}
|
|
{{ record.status === 1 ? '正常' : '禁用' }}
|
|
|
</a-tag>
|
|
</a-tag>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<!-- 必须修改密码列 -->
|
|
<!-- 必须修改密码列 -->
|
|
|
<template #must_change_password="{ record }">
|
|
<template #must_change_password="{ record }">
|
|
|
- <a-tag :color="record.must_change_password ? 'orange' : 'blue'">
|
|
|
|
|
|
|
+ <a-tag :color="record.must_change_password ? 'orange' : 'blue'" class="!rounded-full">
|
|
|
{{ record.must_change_password ? '需要修改' : '已修改' }}
|
|
{{ record.must_change_password ? '需要修改' : '已修改' }}
|
|
|
</a-tag>
|
|
</a-tag>
|
|
|
</template>
|
|
</template>
|
|
@@ -42,10 +43,12 @@
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template #action="{ record }">
|
|
<template #action="{ record }">
|
|
|
<a-space>
|
|
<a-space>
|
|
|
- <a-button size="small" @click="showEditModal(record)">
|
|
|
|
|
|
|
+ <a-button size="small" @click="showEditModal(record)" class="hover:shadow-sm transition-shadow">
|
|
|
|
|
+ <EditOutlined class="mr-1" />
|
|
|
编辑
|
|
编辑
|
|
|
</a-button>
|
|
</a-button>
|
|
|
- <a-button size="small" @click="showResetPasswordModal(record)">
|
|
|
|
|
|
|
+ <a-button size="small" @click="showResetPasswordModal(record)" class="hover:shadow-sm transition-shadow">
|
|
|
|
|
+ <KeyOutlined class="mr-1" />
|
|
|
重置密码
|
|
重置密码
|
|
|
</a-button>
|
|
</a-button>
|
|
|
<a-popconfirm
|
|
<a-popconfirm
|
|
@@ -54,7 +57,8 @@
|
|
|
cancel-text="取消"
|
|
cancel-text="取消"
|
|
|
@confirm="deleteUser(record.id)"
|
|
@confirm="deleteUser(record.id)"
|
|
|
>
|
|
>
|
|
|
- <a-button size="small" danger>
|
|
|
|
|
|
|
+ <a-button size="small" danger class="hover:shadow-sm transition-shadow">
|
|
|
|
|
+ <DeleteOutlined class="mr-1" />
|
|
|
删除
|
|
删除
|
|
|
</a-button>
|
|
</a-button>
|
|
|
</a-popconfirm>
|
|
</a-popconfirm>
|
|
@@ -71,6 +75,7 @@
|
|
|
@cancel="resetForm"
|
|
@cancel="resetForm"
|
|
|
:confirmLoading="submitting"
|
|
:confirmLoading="submitting"
|
|
|
width="600px"
|
|
width="600px"
|
|
|
|
|
+ class="!rounded-xl"
|
|
|
>
|
|
>
|
|
|
<a-form
|
|
<a-form
|
|
|
ref="formRef"
|
|
ref="formRef"
|
|
@@ -82,6 +87,7 @@
|
|
|
<a-input
|
|
<a-input
|
|
|
v-model:value="formState.username"
|
|
v-model:value="formState.username"
|
|
|
placeholder="请输入用户名(2-32位)"
|
|
placeholder="请输入用户名(2-32位)"
|
|
|
|
|
+ size="large"
|
|
|
/>
|
|
/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
|
|
@@ -89,6 +95,7 @@
|
|
|
<a-input
|
|
<a-input
|
|
|
v-model:value="formState.name"
|
|
v-model:value="formState.name"
|
|
|
placeholder="请输入姓名"
|
|
placeholder="请输入姓名"
|
|
|
|
|
+ size="large"
|
|
|
/>
|
|
/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
|
|
@@ -96,6 +103,7 @@
|
|
|
<a-input
|
|
<a-input
|
|
|
v-model:value="formState.phone"
|
|
v-model:value="formState.phone"
|
|
|
placeholder="请输入手机号"
|
|
placeholder="请输入手机号"
|
|
|
|
|
+ size="large"
|
|
|
/>
|
|
/>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
|
|
@@ -103,6 +111,7 @@
|
|
|
<a-input-password
|
|
<a-input-password
|
|
|
v-model:value="formState.password"
|
|
v-model:value="formState.password"
|
|
|
placeholder="请输入密码(至少8位,包含大小写字母、数字、特殊字符中3类)"
|
|
placeholder="请输入密码(至少8位,包含大小写字母、数字、特殊字符中3类)"
|
|
|
|
|
+ size="large"
|
|
|
/>
|
|
/>
|
|
|
<div class="text-xs text-gray-500 mt-2">
|
|
<div class="text-xs text-gray-500 mt-2">
|
|
|
密码强度要求:至少8位,包含大小写字母、数字、特殊字符中3类
|
|
密码强度要求:至少8位,包含大小写字母、数字、特殊字符中3类
|
|
@@ -125,6 +134,7 @@
|
|
|
@ok="handleResetPassword"
|
|
@ok="handleResetPassword"
|
|
|
@cancel="resetPasswordForm"
|
|
@cancel="resetPasswordForm"
|
|
|
:confirmLoading="resettingPassword"
|
|
:confirmLoading="resettingPassword"
|
|
|
|
|
+ class="!rounded-xl"
|
|
|
>
|
|
>
|
|
|
<a-form
|
|
<a-form
|
|
|
ref="resetPasswordFormRef"
|
|
ref="resetPasswordFormRef"
|
|
@@ -136,6 +146,7 @@
|
|
|
<a-input-password
|
|
<a-input-password
|
|
|
v-model:value="resetPasswordState.password"
|
|
v-model:value="resetPasswordState.password"
|
|
|
placeholder="请输入新密码"
|
|
placeholder="请输入新密码"
|
|
|
|
|
+ size="large"
|
|
|
/>
|
|
/>
|
|
|
<div class="text-xs text-gray-500 mt-2">
|
|
<div class="text-xs text-gray-500 mt-2">
|
|
|
密码强度要求:至少8位,包含大小写字母、数字、特殊字符中3类
|
|
密码强度要求:至少8位,包含大小写字母、数字、特殊字符中3类
|
|
@@ -149,6 +160,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
|
import { message } from 'ant-design-vue';
|
|
import { message } from 'ant-design-vue';
|
|
|
|
|
+import { PlusOutlined, EditOutlined, KeyOutlined, DeleteOutlined } from '@ant-design/icons-vue';
|
|
|
import { UserApi, createApiClient } from '@smartcut/api-client';
|
|
import { UserApi, createApiClient } from '@smartcut/api-client';
|
|
|
import { STORAGE_KEYS, validatePasswordStrength } from '@smartcut/shared-utils';
|
|
import { STORAGE_KEYS, validatePasswordStrength } from '@smartcut/shared-utils';
|
|
|
import { getApiBaseUrl } from '@/apiConfig';
|
|
import { getApiBaseUrl } from '@/apiConfig';
|