更新用户列表 列顺序。

This commit is contained in:
aaron 2025-01-21 16:28:19 +08:00
parent c7f312ba12
commit d342f1f0c4
3 changed files with 103 additions and 70 deletions

View File

@ -39,7 +39,7 @@ RUN mkdir -p /var/cache/nginx/client_temp \
&& chown -R nginx:nginx /var/cache/nginx
# 复制 nginx 配置
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/nginx.conf
# 从构建阶段复制构建结果
COPY --from=builder /app/dist /usr/share/nginx/html

View File

@ -1,41 +1,64 @@
server {
listen 80;
server_name localhost;
# 移除 user 指令,因为我们以非 root 用户运行
worker_processes auto;
pid /var/run/nginx.pid;
# 添加 gzip 压缩
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
events {
worker_connections 1024;
}
# 设置客户端最大body大小
client_max_body_size 20M;
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
root /usr/share/nginx/html;
index index.html;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# 支持 history 路由模式
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log warn;
# 缓存静态资源
location /assets {
expires 1y;
add_header Cache-Control "public, no-transform";
access_log off;
}
sendfile on;
keepalive_timeout 65;
gzip on;
# 禁止访问 . 文件
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
server {
listen 80;
server_name localhost;
# 错误页面配置
error_page 404 /index.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
# 添加 gzip 压缩
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# 设置客户端最大body大小
client_max_body_size 20M;
root /usr/share/nginx/html;
index index.html;
# 支持 history 路由模式
location / {
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# 缓存静态资源
location /assets {
expires 1y;
add_header Cache-Control "public, no-transform";
access_log off;
}
# 禁止访问 . 文件
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# 错误页面配置
error_page 404 /index.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

View File

@ -87,9 +87,14 @@
</template>
<template v-if="column.key === 'community_name'">
<a-space>
<span>{{ record.community_name || '-' }}</span>
<a-button type="link" @click="handleEditCommunity(record)">
修改
<template v-if="record.community_name">
<a-tag color="green">{{ record.community_name }}</a-tag>
</template>
<template v-else>
<a-tag color="default">未设置</a-tag>
</template>
<a-button type="link" size="small" @click="handleEditCommunity(record)">
{{ record.community_name ? '修改' : '设置' }}
</a-button>
</a-space>
</template>
@ -147,21 +152,27 @@
<!-- 添加小区选择模态框 -->
<a-modal
v-model:visible="communityModalVisible"
title="修改所属小区"
:title="selectedCommunityId ? '修改所属小区' : '设置所属小区'"
:confirm-loading="communitySaving"
@ok="handleCommunitySave"
@cancel="handleCommunityCancel"
:confirmLoading="communitySaving"
>
<a-form layout="vertical">
<a-form-item label="所属小区">
<a-form-item
label="选择小区"
:validate-status="selectedCommunityId === undefined ? 'error' : ''"
:help="selectedCommunityId === undefined ? '请选择小区' : ''"
>
<a-select
v-model:value="selectedCommunityId"
style="width: 100%"
placeholder="请选择小区"
allowClear
:options="communityOptions"
:loading="communityLoading"
:fieldNames="{ label: 'name', value: 'id' }"
:options="communityOptions.map(item => ({
value: item.id,
label: item.name
}))"
style="width: 100%"
allowClear
/>
</a-form-item>
</a-form>
@ -198,13 +209,13 @@ export default defineComponent({
const columns = [
{
title: '用户ID',
title: 'ID',
dataIndex: 'userid',
key: 'userid',
width: 80,
},
{
title: '用户名',
title: '昵称',
dataIndex: 'nickname',
key: 'nickname',
width: 120,
@ -216,13 +227,7 @@ export default defineComponent({
width: 120,
},
{
title: '角色',
dataIndex: 'roles',
key: 'roles',
width: 200,
},
{
title: '用户编号',
title: '邀请码',
dataIndex: 'user_code',
key: 'user_code',
width: 120,
@ -234,18 +239,24 @@ export default defineComponent({
width: 80,
align: 'right',
},
{
title: '角色',
dataIndex: 'roles',
key: 'roles',
width: 200,
},
{
title: '归属小区',
dataIndex: 'community_name',
key: 'community_name',
width: 250,
},
{
title: '创建时间',
dataIndex: 'create_time',
key: 'create_time',
width: 180,
},
{
title: '所属小区',
dataIndex: 'community_name',
key: 'community_name',
width: 200
},
{
title: '操作',
key: 'action',
@ -603,21 +614,20 @@ export default defineComponent({
}
:deep(.ant-tag) {
margin: 2px;
min-width: 80px;
text-align: center;
margin-right: 0;
}
:deep(.ant-checkbox-group) {
:deep(.ant-space) {
display: flex;
flex-direction: column;
gap: 8px;
align-items: center;
}
:deep(.ant-checkbox-wrapper) {
margin-left: 0 !important;
}
:deep(.ant-checkbox-wrapper + .ant-checkbox-wrapper) {
margin-left: 0 !important;
:deep(.ant-btn-link) {
padding: 0 4px;
height: 24px;
line-height: 24px;
}
.table-filter {