更新用户列表 列顺序。

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 && chown -R nginx:nginx /var/cache/nginx
# 复制 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 COPY --from=builder /app/dist /usr/share/nginx/html

View File

@ -1,41 +1,64 @@
server { # 移除 user 指令,因为我们以非 root 用户运行
listen 80; worker_processes auto;
server_name localhost; 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;
# 设置客户端最大body大小
client_max_body_size 20M;
root /usr/share/nginx/html; events {
index index.html; worker_connections 1024;
}
# 支持 history 路由模式 http {
location / { include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html; default_type application/octet-stream;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# 缓存静态资源 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
location /assets { '$status $body_bytes_sent "$http_referer" '
expires 1y; '"$http_user_agent" "$http_x_forwarded_for"';
add_header Cache-Control "public, no-transform";
access_log off;
}
# 禁止访问 . 文件 access_log /var/log/nginx/access.log main;
location ~ /\. { error_log /var/log/nginx/error.log warn;
deny all;
access_log off;
log_not_found off;
}
# 错误页面配置 sendfile on;
error_page 404 /index.html; keepalive_timeout 65;
error_page 500 502 503 504 /50x.html; gzip on;
location = /50x.html {
root /usr/share/nginx/html; server {
listen 80;
server_name localhost;
# 添加 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>
<template v-if="column.key === 'community_name'"> <template v-if="column.key === 'community_name'">
<a-space> <a-space>
<span>{{ record.community_name || '-' }}</span> <template v-if="record.community_name">
<a-button type="link" @click="handleEditCommunity(record)"> <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-button>
</a-space> </a-space>
</template> </template>
@ -147,21 +152,27 @@
<!-- 添加小区选择模态框 --> <!-- 添加小区选择模态框 -->
<a-modal <a-modal
v-model:visible="communityModalVisible" v-model:visible="communityModalVisible"
title="修改所属小区" :title="selectedCommunityId ? '修改所属小区' : '设置所属小区'"
:confirm-loading="communitySaving"
@ok="handleCommunitySave" @ok="handleCommunitySave"
@cancel="handleCommunityCancel" @cancel="handleCommunityCancel"
:confirmLoading="communitySaving"
> >
<a-form layout="vertical"> <a-form layout="vertical">
<a-form-item label="所属小区"> <a-form-item
label="选择小区"
:validate-status="selectedCommunityId === undefined ? 'error' : ''"
:help="selectedCommunityId === undefined ? '请选择小区' : ''"
>
<a-select <a-select
v-model:value="selectedCommunityId" v-model:value="selectedCommunityId"
style="width: 100%"
placeholder="请选择小区" placeholder="请选择小区"
allowClear
:options="communityOptions"
:loading="communityLoading" :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-item>
</a-form> </a-form>
@ -198,13 +209,13 @@ export default defineComponent({
const columns = [ const columns = [
{ {
title: '用户ID', title: 'ID',
dataIndex: 'userid', dataIndex: 'userid',
key: 'userid', key: 'userid',
width: 80, width: 80,
}, },
{ {
title: '用户名', title: '昵称',
dataIndex: 'nickname', dataIndex: 'nickname',
key: 'nickname', key: 'nickname',
width: 120, width: 120,
@ -216,13 +227,7 @@ export default defineComponent({
width: 120, width: 120,
}, },
{ {
title: '角色', title: '邀请码',
dataIndex: 'roles',
key: 'roles',
width: 200,
},
{
title: '用户编号',
dataIndex: 'user_code', dataIndex: 'user_code',
key: 'user_code', key: 'user_code',
width: 120, width: 120,
@ -234,18 +239,24 @@ export default defineComponent({
width: 80, width: 80,
align: 'right', align: 'right',
}, },
{
title: '角色',
dataIndex: 'roles',
key: 'roles',
width: 200,
},
{
title: '归属小区',
dataIndex: 'community_name',
key: 'community_name',
width: 250,
},
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'create_time', dataIndex: 'create_time',
key: 'create_time', key: 'create_time',
width: 180, width: 180,
}, },
{
title: '所属小区',
dataIndex: 'community_name',
key: 'community_name',
width: 200
},
{ {
title: '操作', title: '操作',
key: 'action', key: 'action',
@ -603,21 +614,20 @@ export default defineComponent({
} }
:deep(.ant-tag) { :deep(.ant-tag) {
margin: 2px; min-width: 80px;
text-align: center;
margin-right: 0;
} }
:deep(.ant-checkbox-group) { :deep(.ant-space) {
display: flex; display: flex;
flex-direction: column; align-items: center;
gap: 8px;
} }
:deep(.ant-checkbox-wrapper) { :deep(.ant-btn-link) {
margin-left: 0 !important; padding: 0 4px;
} height: 24px;
line-height: 24px;
:deep(.ant-checkbox-wrapper + .ant-checkbox-wrapper) {
margin-left: 0 !important;
} }
.table-filter { .table-filter {