Merge branch 'master' into lm/fix/databoard

This commit is contained in:
tangweijie 2026-01-22 21:13:02 +08:00
commit 411d566839
11 changed files with 335 additions and 28 deletions

4
.env
View File

@ -21,8 +21,8 @@ VITE_APP_BAIDU_CODE = a1ff8825baa73c3a78eb96aa40325abc
# 默认账户密码
VITE_APP_DEFAULT_LOGIN_TENANT = 芋道源码
VITE_APP_DEFAULT_LOGIN_USERNAME = admin
VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123
# VITE_APP_DEFAULT_LOGIN_USERNAME = admin
# VITE_APP_DEFAULT_LOGIN_PASSWORD = admin123
# API 加解密
VITE_APP_API_ENCRYPT_ENABLE = true

View File

@ -4,7 +4,7 @@ NODE_ENV=production
VITE_DEV=false
# 请求路径
VITE_BASE_URL='http://localhost:48080'
VITE_BASE_URL=''
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server
@ -32,3 +32,8 @@ VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn'
# GoView域名
VITE_GOVIEW_URL='http://127.0.0.1:3000'
VITE_APP_CAPTCHA_ENABLE=true
VITE_APP_DEFAULT_LOGIN_PASSWORD=''
VITE_APP_DEFAULT_LOGIN_USERNAME=''

34
.env.prod.bak Normal file
View File

@ -0,0 +1,34 @@
# 生产环境:只在打包时使用
NODE_ENV=production
VITE_DEV=false
# 请求路径
VITE_BASE_URL=''
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server
# 接口地址
VITE_API_URL=/admin-api
# 是否删除debugger
VITE_DROP_DEBUGGER=true
# 是否删除console.log
VITE_DROP_CONSOLE=true
# 是否sourcemap
VITE_SOURCEMAP=false
# 打包路径
VITE_BASE_PATH=/
# 输出路径
VITE_OUT_DIR=dist-prod
# 商城H5会员端域名
VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn'
# GoView域名
VITE_GOVIEW_URL='http://127.0.0.1:3000'

117
docker/frontend/nginx.conf Normal file
View File

@ -0,0 +1,117 @@
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# 日志格式
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"';
access_log /var/log/nginx/access.log main;
# 性能优化
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
# Gzip 压缩
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
# 缓冲区大小
client_body_buffer_size 16k;
client_max_body_size 100m;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 128k;
# 上游服务器配置
upstream backend {
server backend:48080;
keepalive 32;
}
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# 安全头
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# 前端静态资源缓存
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|map|json)$ {
expires 30d;
add_header Cache-Control "public, immutable";
access_log off;
}
# 前端路由支持
location / {
try_files $uri $uri/ /index.html;
}
# 后端 API 代理
location /prod-api/ {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
# 连接超时
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
# WebSocket 支持
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# 缓冲设置
proxy_buffering on;
proxy_buffer_size 4k;
proxy_buffers 8 4k;
}
# 静态资源目录
location /static/ {
alias /usr/share/nginx/html/static/;
expires 30d;
add_header Cache-Control "public";
}
# 上传文件大小限制
client_max_body_size 100m;
# 错误页面
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

12
pnpm-lock.yaml generated
View File

@ -273,9 +273,6 @@ importers:
postcss-html:
specifier: ^1.6.0
version: 1.7.0
postcss-pxtorem:
specifier: ^6.1.0
version: 6.1.0(postcss@8.4.49)
postcss-scss:
specifier: ^4.0.9
version: 4.0.9(postcss@8.4.49)
@ -4581,11 +4578,6 @@ packages:
resolution: {integrity: sha512-MfcMpSUIaR/nNgeVS8AyvyDugXlADjN9AcV7e5rDfrF1wduIAGSkL4q2+wgrZgA3sHVAHLDO9FuauHhZYW2nBw==}
engines: {node: ^12 || >=14}
postcss-pxtorem@6.1.0:
resolution: {integrity: sha512-ROODSNci9ADal3zUcPHOF/K83TiCgNSPXQFSbwyPHNV8ioHIE4SaC+FPOufd8jsr5jV2uIz29v1Uqy1c4ov42g==}
peerDependencies:
postcss: ^8.0.0
postcss-resolve-nested-selector@0.1.6:
resolution: {integrity: sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==}
@ -10466,10 +10458,6 @@ snapshots:
postcss: 8.4.49
postcss-safe-parser: 6.0.0(postcss@8.4.49)
postcss-pxtorem@6.1.0(postcss@8.4.49):
dependencies:
postcss: 8.4.49
postcss-resolve-nested-selector@0.1.6: {}
postcss-safe-parser@6.0.0(postcss@8.4.49):

View File

@ -172,7 +172,12 @@ export const EvaluationTemplateApi = {
// 导出模板
exportTemplate: async (params: EvaluationTemplatePageParams) => {
return await request.download({ url: '/prison/evaluation-report/template/export-excel', params })
return await request.download({ url: '/prison/evaluation-report/template/export-excel', params, method: 'POST' })
},
// 导出单个模板及其维度信息
exportTemplateWithDimensions: async (id: number) => {
return await request.download({ url: '/prison/evaluation-report/template/export-with-dimensions', params: { id } })
}
}
@ -275,7 +280,7 @@ export const EvaluationReportApi = {
// 导出报告 Excel
exportReportExcel: async (params: EvaluationReportPageParams) => {
return await request.download({ url: '/prison/evaluation-report/report/export-excel', params })
return await request.download({ url: '/prison/evaluation-report/report/export-excel', params, method: 'POST' })
},
// 根据报告ID获取维度数据列表

View File

@ -69,6 +69,11 @@ service.interceptors.request.use(
config.headers['visit-tenant-id'] = visitTenantId
}
}
// 监狱系统:即使 tenantEnable 为 false也尝试获取并设置租户 ID
const tenantId = getTenantId()
if (tenantId) {
config.headers['tenant-id'] = tenantId
}
const method = config.method?.toUpperCase()
// 防止 GET 请求缓存
if (method === 'GET') {

View File

@ -1,6 +1,66 @@
<template>
<div class="dash-entry-container">
<div class="entry-title">AI 心航360°</div>
<!-- 标题和帮助按钮 -->
<div class="entry-header">
<div class="entry-title">AI 心航360°</div>
<el-tooltip
effect="dark"
placement="bottom"
:show-after="200"
>
<template #content>
<div class="help-content">
<div class="help-item">
<strong>数据说明</strong>
<p>本页面展示的统计数据基于监区管理系统的实时数据统计</p>
</div>
<div class="help-item">
<strong>全部人员</strong>
<p>统计系统中所有在押罪犯的总人数</p>
</div>
<div class="help-item">
<strong>高危人员</strong>
<p>风险等级为"极高风险""高风险"的人员数量</p>
</div>
<div class="help-item">
<strong>预警人员</strong>
<p>风险等级为"中风险"且存在预警信息的人员数量</p>
</div>
<div class="help-item">
<strong>普通人员</strong>
<p>风险等级为"低风险""中风险"且无预警信息的人员数量</p>
</div>
<div class="help-item">
<strong>本月新增</strong>
<p>对比上月新增的罪犯数量正数表示增加负数表示减少</p>
</div>
<div class="help-item">
<strong>风险等级分布</strong>
<p>统计各风险等级人员占比数据来源于罪犯风险等级评估结果</p>
</div>
<div class="help-item">
<strong>风险趋势图</strong>
<p>展示近12个月各风险等级人员数量变化趋势</p>
</div>
<div class="help-item">
<strong>重点关注对象</strong>
<p>根据风险等级心理评估结果违纪记录等因素筛选出的需要重点关注的罪犯</p>
</div>
<div class="help-item">
<strong>数据更新频率</strong>
<p>统计数据每小时自动更新一次确保数据实时性</p>
</div>
<div class="help-item">
<strong>全景画像</strong>
<p>点击"全景画像"可查看该罪犯的完整详细信息包括基本信息风险评估消费记录奖惩记录等</p>
</div>
</div>
</template>
<div class="help-icon">
<Icon icon="ep:question-filled" :size="18" />
</div>
</el-tooltip>
</div>
<!-- 顶部四个数据卡片 -->
<div class="stats-cards">
<div v-for="(card, index) in statsCards" :key="index" class="stat-card">
@ -374,6 +434,58 @@ onMounted(() => {
color: #65CFE3;
}
.entry-header {
position: relative;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 10px;
padding: 0 50px;
.help-icon {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
color: #909399;
cursor: pointer;
transition: color 0.3s;
&:hover {
color: #409EFF;
}
}
}
//
:deep(.el-tooltip__popper) {
max-width: 400px !important;
.help-content {
.help-item {
margin-bottom: 12px;
&:last-child {
margin-bottom: 0;
}
strong {
display: block;
margin-bottom: 4px;
color: #303133;
font-size: 14px;
}
p {
margin: 0;
color: #606266;
font-size: 13px;
line-height: 1.6;
}
}
}
}
//
.stats-cards {
display: grid;

View File

@ -200,8 +200,8 @@ const loginData = reactive({
tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE !== 'false',
loginForm: {
tenantName: '芋道源码',
username: 'admin',
password: 'admin123',
username: '',
password: '',
captchaVerification: '',
rememberMe: false
}

View File

@ -196,8 +196,8 @@ const loginData = reactive({
tenantEnable: 'false', //
loginForm: {
tenantName: '1', // ID1
username: import.meta.env.VITE_APP_DEFAULT_LOGIN_USERNAME || '',
password: import.meta.env.VITE_APP_DEFAULT_LOGIN_PASSWORD || '',
username: '',
password: '',
captchaVerification: '',
rememberMe: true //
}
@ -226,6 +226,12 @@ const getTenantId = async () => {
if (loginData.tenantEnable === 'true') {
const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName)
authUtil.setTenantId(res)
} else {
// 使ID
const tenantName = loginData.loginForm.tenantName
if (tenantName) {
authUtil.setTenantId(Number(tenantName))
}
}
}
//

View File

@ -5,9 +5,14 @@
<el-col :span="8">
<ContentWrap title="模板列表" class="!mb-0">
<template #header>
<el-button type="primary" @click="openTemplateForm('create')" v-hasPermi="['prison:evaluation-report:template:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新建模板
</el-button>
<div class="flex justify-between items-center w-full">
<el-button type="primary" @click="openTemplateForm('create')" v-hasPermi="['prison:evaluation-report:template:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新建模板
</el-button>
<el-button type="success" @click="handleExportTemplate" :loading="exportLoading" v-hasPermi="['prison:evaluation-report:template:export']">
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</div>
</template>
<el-input v-model="templateFilter" placeholder="搜索模板" class="!mb-15px" clearable />
<div class="template-list">
@ -37,9 +42,12 @@
<el-button type="primary" link size="small" @click.stop="openTemplateForm('update', template.id)">
编辑
</el-button>
<el-button type="success" link size="small" @click.stop="copyTemplate(template)">
<el-button type="success" link size="small" @click.stop="copyTemplate(template)" v-hasPermi="['prison:evaluation-report:template:copy']">
复制
</el-button>
<el-button type="warning" link size="small" @click.stop="handleExportTemplateWithDimensions(template.id!)" v-hasPermi="['prison:evaluation-report:template:export']">
导出详情
</el-button>
<el-button type="danger" link size="small" @click.stop="handleDeleteTemplate(template.id!)" v-hasPermi="['prison:evaluation-report:template:delete']">
删除
</el-button>
@ -89,7 +97,7 @@
<!-- 维度配置 Tab -->
<el-tab-pane label="维度配置" name="dimension">
<div class="dimension-header mb-15px">
<div class="dimension-header mb-15px flex justify-end">
<el-button type="primary" @click="openDimensionForm(selectedTemplate.id!)" v-hasPermi="['prison:evaluation-report:dimension:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增维度
</el-button>
@ -146,6 +154,7 @@
<script lang="ts" setup>
import { DICT_TYPE, getDictLabel } from '@/utils/dict'
import { EvaluationTemplateApi, EvaluationTemplate, EvaluationDimensionApi } from '@/api/prison/evaluation'
import download from '@/utils/download'
import EvaluationTemplateForm from './EvaluationTemplateForm.vue'
import DimensionForm from './DimensionForm.vue'
@ -242,6 +251,32 @@ const copyTemplate = async (template: EvaluationTemplate) => {
} catch {}
}
const exportLoading = ref(false)
/** 导出模板 */
const handleExportTemplate = async () => {
try {
await message.exportConfirm()
exportLoading.value = true
const data = await EvaluationTemplateApi.exportTemplate({} as any)
download.excel(data, '评估模板.xlsx')
message.success('导出成功')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导出单个模板及其维度信息 */
const handleExportTemplateWithDimensions = async (id: number) => {
try {
await message.exportConfirm()
const data = await EvaluationTemplateApi.exportTemplateWithDimensions(id)
download.excel(data, `评估模板详情_${id}.xlsx`)
message.success('导出成功')
} catch {}
}
/** 删除模板 */
const handleDeleteTemplate = async (id: number) => {
try {