fix: 风险评估模块字典类型修复

- dict.ts: 新增 PRISON_WARNING_* 预警模块字典类型
- dict.ts: 新增 PRISON_RISK_* 风险评估模块字典类型
- riskassessment/index.vue: 修复 PRISON_ASSESSMENT_TYPE 引用
- riskassessment/RiskAssessmentForm.vue: 修复 PRISON_ASSESSMENT_TYPE 引用
- risk/index.vue: 修复 PRISON_ASSESSMENT_TYPE 引用

确保字典类型与数据库中的 system_dict_type 一致

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
tangweijie 2026-01-20 19:05:49 +08:00
parent 79cfcf9c6d
commit 695d39d117
15 changed files with 119 additions and 216 deletions

2
.env
View File

@ -1,5 +1,5 @@
# 标题
VITE_APP_TITLE=芋道管理系统
VITE_APP_TITLE=AI心航360°
# 项目本地运行端口号
VITE_PORT=80

View File

@ -108,12 +108,17 @@ export interface EvaluationReport {
/** 快捷评语 */
export interface ReportComment {
id: number
commentType: number // 评语类型1-入监评估 2-定期考核 3-出监评估 4-减刑假释 5-专项评估
dimensionId?: number // 维度ID
dimensionName?: string // 维度名称
content: string // 评语内容
type: number // 评语类型1-入监评估 2-定期考核 3-出监评估 4-减刑假释 5-专项评估
dimension?: string // 适用维度
usageCount?: number // 使用次数
level?: number // 评级等级1-优秀 2-良好 3-一般 4-较差 5-危险
tags?: string // 标签(逗号分隔)
useCount?: number // 使用次数
isBuiltin?: boolean // 是否内置
sort?: number // 排序
status: number // 状态0-停用 1-启用
remark?: string // 备注
creator?: string
createTime?: string
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -72,7 +72,7 @@ export default defineComponent({
//
<ElTag
style={dict?.cssClass ? 'color: #fff' : ''}
type={dict?.colorType || null}
type={dict?.colorType && dict?.colorType !== 'default' && dict?.colorType !== 'primary' ? dict?.colorType : undefined}
color={dict?.cssClass && isHexColor(dict?.cssClass) ? dict?.cssClass : ''}
disableTransitions={true}
>

View File

@ -171,7 +171,7 @@
/>
<div class="flex flex-col">
<el-text>手机扫码预览</el-text>
<Qrcode :text="previewUrl" logo="/logo.gif" />
<Qrcode :text="previewUrl" logo="/logo.png" />
</div>
</div>
</Dialog>

View File

@ -759,158 +759,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
}
]
},
// 监管看板路由(开发测试用,上线后由后端菜单动态生成)
{
path: '/prison',
component: Layout,
name: 'Prison',
meta: {
hidden: true
},
children: [
{
path: 'prisoner/dashboard',
component: () => import('@/views/Dashboard/Index.vue'),
name: 'PrisonerDashboardInPrison',
meta: {
title: '个人中心',
icon: 'ep:user',
permission: 'prison:prisoner:dashboard',
noCache: false,
hidden: true,
canTo: true
}
},
{
path: 'situation-platform',
component: () => import('@/views/prison/situation/index.vue'),
name: 'PrisonSituationPlatform',
meta: {
title: '狱情收集',
icon: 'ep:warning',
permission: 'prison:situation:query',
noCache: false,
hidden: true,
canTo: true
}
},
{
path: 'report/edit',
component: () => import('@/views/prison/evaluation-mgmt/report/ReportForm.vue'),
name: 'PrisonReportEdit',
meta: {
title: '评估报告编辑',
icon: 'ep:document-checked',
permission: 'prison:report:update',
noCache: true,
hidden: true,
canTo: true
}
}
]
},
// 评估报告管理路由(开发测试用)
{
path: '/prison/evaluation-mgmt',
component: Layout,
redirect: '/prison/evaluation-mgmt/template',
name: 'PrisonEvaluationMgmt',
meta: {
title: '评估报告管理',
icon: 'documentation',
hidden: true
},
children: [
{
path: 'template',
component: () => import('@/views/prison/evaluation-mgmt/template/index.vue'),
name: 'EvaluationTemplate',
meta: {
title: '模板管理',
icon: 'component',
permission: 'prison:evaluation-report:template:query',
noCache: false,
hidden: false,
canTo: true
}
},
{
path: 'report',
component: () => import('@/views/prison/evaluation-mgmt/report/index.vue'),
name: 'EvaluationReport',
meta: {
title: '报告管理',
icon: 'documentation',
permission: 'prison:evaluation-report:report:query',
noCache: false,
hidden: false,
canTo: true
}
},
{
path: 'report/edit',
component: () => import('@/views/prison/evaluation-mgmt/report/ReportForm.vue'),
name: 'EvaluationReportEdit',
meta: {
title: '评估报告编辑',
icon: 'document-checked',
permission: 'prison:evaluation-report:report:update',
noCache: true,
hidden: true,
canTo: true
}
},
{
path: 'comment',
component: () => import('@/views/prison/evaluation-mgmt/comment/index.vue'),
name: 'EvaluationComment',
meta: {
title: '评语管理',
icon: 'chat-dot-round',
permission: 'prison:evaluation-report:comment:query',
noCache: false,
hidden: false,
canTo: true
}
},
{
path: 'report-template',
redirect: '/prison/evaluation-mgmt/template',
name: 'ReportTemplateRedirect',
meta: {
title: '报告模板',
hidden: true
}
}
]
},
// 服刑人员评估报告管理(新版)
{
path: '/prison/evaluation-mgmt',
component: Layout,
redirect: '/prison/evaluation-mgmt/prisoner-manage',
name: 'PrisonEvaluationMgmt',
meta: {
title: '评估报告管理',
icon: 'documentation',
hidden: false
},
children: [
{
path: 'prisoner-manage',
component: () => import('@/views/prison/evaluation-report/prisoner/ReportManage.vue'),
name: 'PrisonerReportManage',
meta: {
title: '服刑人员报告管理',
icon: 'user',
permission: 'prison:evaluation-report:prisoner:query',
noCache: false,
hidden: false,
canTo: true
}
}
]
}
]
export default remainingRouter

View File

@ -72,34 +72,34 @@ export const useAppStore = defineStore('app', {
isDark: wsCache.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式
currentSize: wsCache.get('default') || 'default', // 组件尺寸
theme: wsCache.get(CACHE_KEY.THEME) || {
// 主题色
elColorPrimary: '#409eff',
// 左侧菜单边框颜色
leftMenuBorderColor: 'inherit',
// 左侧菜单背景颜色
leftMenuBgColor: '#001529',
// 左侧菜单浅色背景颜色
leftMenuBgLightColor: '#0f2438',
// 左侧菜单选中背景颜色
leftMenuBgActiveColor: 'var(--el-color-primary)',
// 左侧菜单收起选中背景颜色
leftMenuCollapseBgActiveColor: 'var(--el-color-primary)',
// 左侧菜单字体颜色
leftMenuTextColor: '#bfcbd9',
// 左侧菜单选中字体颜色
leftMenuTextActiveColor: '#fff',
// logo字体颜色
logoTitleTextColor: '#fff',
// logo边框颜色
logoBorderColor: 'inherit',
// 头部背景颜色
topHeaderBgColor: '#fff',
// 头部字体颜色
topHeaderTextColor: 'inherit',
// 头部悬停颜色
topHeaderHoverColor: '#f6f6f6',
// 头部边框颜色
topToolBorderColor: '#eee'
// 主题色
elColorPrimary: '#536dfe',
// 左侧菜单边框颜色
leftMenuBorderColor: '#eee',
// 左侧菜单背景颜色
leftMenuBgColor: '#fff',
// 左侧菜单浅色背景颜色
leftMenuBgLightColor: '#fff',
// 左侧菜单选中背景颜色
leftMenuBgActiveColor: 'RGBA(83,109,254,0.1)',
// 左侧菜单收起选中背景颜色
leftMenuCollapseBgActiveColor: 'RGBA(83,109,254,0.1)',
// 左侧菜单字体颜色
leftMenuTextColor: '#333',
// 左侧菜单选中字体颜色
leftMenuTextActiveColor: 'var(--el-color-primary)',
// logo字体颜色
logoTitleTextColor: 'inherit',
// logo边框颜色
logoBorderColor: '#eee',
// 头部背景颜色
topHeaderBgColor: '#fff',
// 头部字体颜色
topHeaderTextColor: 'inherit',
// 头部悬停颜色
topHeaderHoverColor: '#f6f6f6',
// 头部边框颜色
topToolBorderColor: '#eee'
}
}
},

View File

@ -270,6 +270,10 @@ export enum DICT_TYPE {
PRISON_RECORD_PASS_STATUS = 'prison_record_pass_status', // 问卷答题是否及格
PRISON_RECORD_STATUS = 'prison_record_status', // 问卷答题记录状态
PRISON_QUESTION_AUTO_FILL_SOURCE = 'prison_question_auto_fill_source', // 问卷问题自动填充来源
PRISON_SITUATION_CATEGORY = 'prison_situation_category', // 狱情分类
PRISON_SITUATION_LEVEL = 'prison_situation_level', // 狱情等级
PRISON_SITUATION_SOURCE = 'prison_situation_source', // 狱情来源
PRISON_SITUATION_STATUS = 'prison_situation_status', // 狱情状态
PRISON_AREA_LEVEL = 'prison_area_level', // 监区级别1-监区(大队) 2-分监区(中队)
PRISON_RELEASE_TYPE = 'prison_release_type', // 释放类型1-刑满释放 2-假释 3-暂予监外执行 4-减刑 5-法院裁定释放 6-死亡 7-其他
PRISON_AREA_CHANGE_TYPE = 'prison_area_change_type', // 变动类型1-入监分配 2-调监 3-出监 4-移交转入 5-移交转出
@ -281,6 +285,17 @@ export enum DICT_TYPE {
PRISON_ASSESSMENT_PASS_STATUS = 'prison_assessment_pass_status', // 测评及格状态1-及格 2-不及格 3-待评分
PRISON_ASSESSMENT_ANSWER_STATUS = 'prison_assessment_answer_status', // 测评答题状态1-待评分 2-已评分
// ========== 预警模块 ==========
PRISON_WARNING_TYPE = 'prison_warning_type', // 预警类型
PRISON_WARNING_LEVEL = 'prison_warning_level', // 预警等级
PRISON_WARNING_SOURCE = 'prison_warning_source', // 预警来源
PRISON_WARNING_STATUS = 'prison_warning_status', // 预警状态
// ========== 风险评估模块 ==========
PRISON_RISK_ASSESSMENT_TYPE = 'prison_risk_assessment_type', // 风险评估类型1-入监评估 2-定期评估 3-专项评估 4-出监评估
PRISON_RISK_ASSESS_METHOD = 'prison_risk_assess_method', // 评估方式1-问卷评估 2-量表评估 3-综合评估
PRISON_RISK_MENTAL_STATE = 'prison_risk_mental_state', // 精神状态1-正常 2-异常
// ========== 评估报告模块 ==========
PRISON_REPORT_STATUS = 'prison_report_status', // 报告状态1-草稿 2-待审核 3-已通过 4-已退回 5-已归档
PRISON_REPORT_TEMPLATE_TYPE = 'prison_report_template_type', // 报告模板类型1-心理评估 2-危险性评估 3-改造表现评估 4-综合评估

View File

@ -2,15 +2,15 @@
<el-dialog v-model="dialogVisible" :title="isCreate ? '新增快捷评语' : '编辑快捷评语'" width="600px" :close-on-click-modal="false">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="100px">
<el-form-item label="评语内容" prop="content">
<el-input v-model="formData.content" type="textarea" rows="4" placeholder="请输入评语内容" />
<el-input v-model="formData.content" type="textarea" :rows="4" placeholder="请输入评语内容" />
</el-form-item>
<el-form-item label="评语类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择评语类型" class="!w-full">
<el-form-item label="评语类型" prop="commentType">
<el-select v-model="formData.commentType" placeholder="请选择评语类型" class="!w-full">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.PRISON_REPORT_COMMENT_TYPE)" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="适用维度" prop="dimension">
<el-input v-model="formData.dimension" placeholder="请输入适用维度,如:服刑表现、心理状态" />
<el-form-item label="维度名称" prop="dimensionName">
<el-input v-model="formData.dimensionName" placeholder="请输入维度名称,如:服刑表现、心理状态" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
@ -31,6 +31,8 @@ import { ReportCommentApi, ReportComment } from '@/api/prison/evaluation'
defineOptions({ name: 'CommentForm' })
const message = useMessage()
const emit = defineEmits(['success'])
const dialogVisible = ref(false)
@ -40,15 +42,20 @@ const formRef = ref()
const formData = reactive({
id: undefined,
commentType: undefined as number | undefined,
dimensionId: undefined as number | undefined,
dimensionName: '',
content: '',
type: undefined as number | undefined,
dimension: '',
status: 1
level: undefined as number | undefined,
tags: '',
sort: 0,
status: 1,
remark: ''
})
const rules = {
content: [{ required: true, message: '评语内容不能为空', trigger: 'blur' }],
type: [{ required: true, message: '评语类型不能为空', trigger: 'change' }],
commentType: [{ required: true, message: '评语类型不能为空', trigger: 'change' }],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
}
@ -63,20 +70,30 @@ const open = (type: string, id?: number) => {
const resetForm = () => {
formData.id = undefined
formData.commentType = undefined
formData.dimensionId = undefined
formData.dimensionName = ''
formData.content = ''
formData.type = undefined
formData.dimension = ''
formData.level = undefined
formData.tags = ''
formData.sort = 0
formData.status = 1
formData.remark = ''
}
const loadData = async (id: number) => {
const data = await ReportCommentApi.getComment(id)
if (data) {
formData.id = data.id
formData.commentType = data.commentType
formData.dimensionId = data.dimensionId
formData.dimensionName = data.dimensionName || ''
formData.content = data.content
formData.type = data.type
formData.dimension = data.dimension || ''
formData.level = data.level
formData.tags = data.tags || ''
formData.sort = data.sort || 0
formData.status = data.status
formData.remark = data.remark || ''
}
}

View File

@ -8,9 +8,9 @@
:inline="true"
label-width="90px"
>
<el-form-item label="评语类型" prop="type">
<el-form-item label="评语类型" prop="commentType">
<el-select
v-model="queryParams.type"
v-model="queryParams.commentType"
placeholder="请选择"
clearable
class="!w-140px"
@ -23,8 +23,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="适用维度" prop="dimension">
<el-input v-model="queryParams.dimension" placeholder="请输入维度" clearable class="!w-140px" />
<el-form-item label="适用维度" prop="dimensionName">
<el-input v-model="queryParams.dimensionName" placeholder="请输入维度" clearable class="!w-140px" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择" clearable class="!w-100px">
@ -56,13 +56,13 @@
<el-table v-loading="loading" :data="list" :stripe="true" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="评语内容" prop="content" min-width="300" show-overflow-tooltip />
<el-table-column label="评语类型" prop="type" width="120">
<el-table-column label="评语类型" prop="commentType" width="120">
<template #default="{ row }">
<dict-tag :type="DICT_TYPE.PRISON_REPORT_COMMENT_TYPE" :value="row.type" />
<dict-tag :type="DICT_TYPE.PRISON_REPORT_COMMENT_TYPE" :value="row.commentType ?? ''" />
</template>
</el-table-column>
<el-table-column label="适用维度" prop="dimension" width="120" />
<el-table-column label="使用次数" prop="usageCount" width="100" align="center" />
<el-table-column label="适用维度" prop="dimensionName" width="120" />
<el-table-column label="使用次数" prop="useCount" width="100" align="center" />
<el-table-column label="是否内置" prop="isBuiltin" width="100" align="center">
<template #default="{ row }">
<el-tag v-if="row.isBuiltin" type="info" size="small"></el-tag>
@ -71,7 +71,7 @@
</el-table-column>
<el-table-column label="状态" prop="status" width="100" align="center">
<template #default="{ row }">
<dict-tag :type="DICT_TYPE.PRISON_COMMON_STATUS" :value="row.status" />
<dict-tag :type="DICT_TYPE.PRISON_COMMON_STATUS" :value="row.status ?? ''" />
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right" align="center">
@ -123,8 +123,8 @@ const ids = ref<number[]>([])
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
type: undefined,
dimension: undefined,
commentType: undefined,
dimensionName: undefined,
status: undefined
})
const queryFormRef = ref()

View File

@ -0,0 +1,11 @@
<template>
<div>
<ContentWrap title="服刑人员报告管理">
<ReportManage />
</ContentWrap>
</div>
</template>
<script setup lang="ts">
import ReportManage from '@/views/prison/evaluation-report/prisoner/ReportManage.vue'
</script>

View File

@ -21,7 +21,7 @@
</el-select>
</el-form-item>
<el-form-item label="问卷说明" prop="description">
<Editor v-model="formData.description" height="150px" />
<Editor v-model="formData.description" height="350px" />
</el-form-item>
<el-form-item label="封面图片" prop="coverImage">
<UploadImgs v-model="formData.coverImage" :limit="1" />
@ -104,7 +104,12 @@ const open = async (type: string, id?: number) => {
if (id) {
formLoading.value = true
try {
formData.value = await QuestionnaireApi.getQuestionnaire(id)
const data = await QuestionnaireApi.getQuestionnaire(id)
// coverImage null
if (data.coverImage === null) {
data.coverImage = []
}
formData.value = data
} finally {
formLoading.value = false
}

View File

@ -204,7 +204,7 @@ const queryParams = reactive<RiskPageReqVO>({
const queryFormRef = ref()
//
const assessmentTypeOptions = getIntDictOptions(DICT_TYPE.PRISON_ASSESSMENT_TYPE)
const assessmentTypeOptions = getIntDictOptions(DICT_TYPE.PRISON_RISK_ASSESSMENT_TYPE)
const riskLevelOptions = getIntDictOptions(DICT_TYPE.PRISON_RISK_LEVEL)
/** 根据得分返回样式类名 */

View File

@ -29,7 +29,7 @@
<el-form-item label="评估类型" prop="assessmentType">
<el-select v-model="formData.assessmentType" placeholder="请选择评估类型">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.PRISON_ASSESSMENT_TYPE)"
v-for="dict in getIntDictOptions(DICT_TYPE.PRISON_RISK_ASSESSMENT_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"

View File

@ -117,7 +117,7 @@
<el-table-column label="罪犯姓名" align="center" prop="prisonerName" width="100" />
<el-table-column label="评估类型" align="center" prop="assessmentType" width="100">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PRISON_ASSESSMENT_TYPE" :value="scope.row.assessmentType" />
<dict-tag :type="DICT_TYPE.PRISON_RISK_ASSESSMENT_TYPE" :value="scope.row.assessmentType" />
</template>
</el-table-column>
<el-table-column label="评估日期" align="center" prop="assessmentDate" width="120">
@ -207,7 +207,7 @@ const queryFormRef = ref()
const exportLoading = ref(false)
// 使
const assessmentTypeOptions = getIntDictOptions(DICT_TYPE.PRISON_ASSESSMENT_TYPE)
const assessmentTypeOptions = getIntDictOptions(DICT_TYPE.PRISON_RISK_ASSESSMENT_TYPE)
const riskLevelOptions = getIntDictOptions(DICT_TYPE.PRISON_RISK_LEVEL)
const statusOptions = getIntDictOptions(DICT_TYPE.PRISON_SCORE_STATUS)