feat(evaluation): 新增模板详情导出及界面优化
- 新增导出单个模板及其维度信息的 API 和按钮 - 优化导出接口使用 POST 方法 - 仪表盘添加帮助说明提示功能 - 优化模板管理界面布局
This commit is contained in:
parent
f2764b3961
commit
883c5fdb63
12
pnpm-lock.yaml
generated
12
pnpm-lock.yaml
generated
@ -273,9 +273,6 @@ importers:
|
|||||||
postcss-html:
|
postcss-html:
|
||||||
specifier: ^1.6.0
|
specifier: ^1.6.0
|
||||||
version: 1.7.0
|
version: 1.7.0
|
||||||
postcss-pxtorem:
|
|
||||||
specifier: ^6.1.0
|
|
||||||
version: 6.1.0(postcss@8.4.49)
|
|
||||||
postcss-scss:
|
postcss-scss:
|
||||||
specifier: ^4.0.9
|
specifier: ^4.0.9
|
||||||
version: 4.0.9(postcss@8.4.49)
|
version: 4.0.9(postcss@8.4.49)
|
||||||
@ -4581,11 +4578,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-MfcMpSUIaR/nNgeVS8AyvyDugXlADjN9AcV7e5rDfrF1wduIAGSkL4q2+wgrZgA3sHVAHLDO9FuauHhZYW2nBw==}
|
resolution: {integrity: sha512-MfcMpSUIaR/nNgeVS8AyvyDugXlADjN9AcV7e5rDfrF1wduIAGSkL4q2+wgrZgA3sHVAHLDO9FuauHhZYW2nBw==}
|
||||||
engines: {node: ^12 || >=14}
|
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:
|
postcss-resolve-nested-selector@0.1.6:
|
||||||
resolution: {integrity: sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==}
|
resolution: {integrity: sha512-0sglIs9Wmkzbr8lQwEyIzlDOOC9bGmfVKcJTaxv3vMmd3uo4o4DerC3En0bnmgceeql9BfC8hRkp7cg0fjdVqw==}
|
||||||
|
|
||||||
@ -10466,10 +10458,6 @@ snapshots:
|
|||||||
postcss: 8.4.49
|
postcss: 8.4.49
|
||||||
postcss-safe-parser: 6.0.0(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-resolve-nested-selector@0.1.6: {}
|
||||||
|
|
||||||
postcss-safe-parser@6.0.0(postcss@8.4.49):
|
postcss-safe-parser@6.0.0(postcss@8.4.49):
|
||||||
|
|||||||
@ -172,7 +172,12 @@ export const EvaluationTemplateApi = {
|
|||||||
|
|
||||||
// 导出模板
|
// 导出模板
|
||||||
exportTemplate: async (params: EvaluationTemplatePageParams) => {
|
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
|
// 导出报告 Excel
|
||||||
exportReportExcel: async (params: EvaluationReportPageParams) => {
|
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获取维度数据列表
|
// 根据报告ID获取维度数据列表
|
||||||
|
|||||||
@ -1,6 +1,66 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dash-entry-container">
|
<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 class="stats-cards">
|
||||||
<div v-for="(card, index) in statsCards" :key="index" class="stat-card">
|
<div v-for="(card, index) in statsCards" :key="index" class="stat-card">
|
||||||
@ -374,6 +434,58 @@ onMounted(() => {
|
|||||||
color: #65CFE3;
|
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 {
|
.stats-cards {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|||||||
@ -5,9 +5,14 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<ContentWrap title="模板列表" class="!mb-0">
|
<ContentWrap title="模板列表" class="!mb-0">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-button type="primary" @click="openTemplateForm('create')" v-hasPermi="['prison:evaluation-report:template:create']">
|
<div class="flex justify-between items-center w-full">
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新建模板
|
<el-button type="primary" @click="openTemplateForm('create')" v-hasPermi="['prison:evaluation-report:template:create']">
|
||||||
</el-button>
|
<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>
|
</template>
|
||||||
<el-input v-model="templateFilter" placeholder="搜索模板" class="!mb-15px" clearable />
|
<el-input v-model="templateFilter" placeholder="搜索模板" class="!mb-15px" clearable />
|
||||||
<div class="template-list">
|
<div class="template-list">
|
||||||
@ -37,9 +42,12 @@
|
|||||||
<el-button type="primary" link size="small" @click.stop="openTemplateForm('update', template.id)">
|
<el-button type="primary" link size="small" @click.stop="openTemplateForm('update', template.id)">
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</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>
|
||||||
|
<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 type="danger" link size="small" @click.stop="handleDeleteTemplate(template.id!)" v-hasPermi="['prison:evaluation-report:template:delete']">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -89,7 +97,7 @@
|
|||||||
|
|
||||||
<!-- 维度配置 Tab -->
|
<!-- 维度配置 Tab -->
|
||||||
<el-tab-pane label="维度配置" name="dimension">
|
<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']">
|
<el-button type="primary" @click="openDimensionForm(selectedTemplate.id!)" v-hasPermi="['prison:evaluation-report:dimension:create']">
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新增维度
|
<Icon icon="ep:plus" class="mr-5px" /> 新增维度
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -146,6 +154,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { DICT_TYPE, getDictLabel } from '@/utils/dict'
|
import { DICT_TYPE, getDictLabel } from '@/utils/dict'
|
||||||
import { EvaluationTemplateApi, EvaluationTemplate, EvaluationDimensionApi } from '@/api/prison/evaluation'
|
import { EvaluationTemplateApi, EvaluationTemplate, EvaluationDimensionApi } from '@/api/prison/evaluation'
|
||||||
|
import download from '@/utils/download'
|
||||||
import EvaluationTemplateForm from './EvaluationTemplateForm.vue'
|
import EvaluationTemplateForm from './EvaluationTemplateForm.vue'
|
||||||
import DimensionForm from './DimensionForm.vue'
|
import DimensionForm from './DimensionForm.vue'
|
||||||
|
|
||||||
@ -242,6 +251,32 @@ const copyTemplate = async (template: EvaluationTemplate) => {
|
|||||||
} catch {}
|
} 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) => {
|
const handleDeleteTemplate = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user