From 180ccde18b9a6f1e362faf894757c14fd4d9ebdb Mon Sep 17 00:00:00 2001 From: green <2624612302@qq.com> Date: Wed, 26 Nov 2025 14:23:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-druid.yml | 2 +- sql/添加综合评估菜单.sql | 190 ++++++ xinli-ui/src/router/index.js | 11 + .../src/views/psychology/permission/index.vue | 1 - .../views/psychology/report/comprehensive.vue | 599 ++++++++++++++++++ 5 files changed, 801 insertions(+), 2 deletions(-) create mode 100644 sql/添加综合评估菜单.sql create mode 100644 xinli-ui/src/views/psychology/report/comprehensive.vue diff --git a/ry-xinli-admin/src/main/resources/application-druid.yml b/ry-xinli-admin/src/main/resources/application-druid.yml index 2127354c..6f7ff468 100644 --- a/ry-xinli-admin/src/main/resources/application-druid.yml +++ b/ry-xinli-admin/src/main/resources/application-druid.yml @@ -6,7 +6,7 @@ spring: druid: # 主库数据源 master: - url: jdbc:mysql://127.0.0.1:3306/ry_xinli?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true + url: jdbc:mysql://1.15.149.240:3306/ry_xinli?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true username: ry_xinli password: ZLZBcfGtsWJe5r4z # 从库数据源 diff --git a/sql/添加综合评估菜单.sql b/sql/添加综合评估菜单.sql new file mode 100644 index 00000000..8b10b2b7 --- /dev/null +++ b/sql/添加综合评估菜单.sql @@ -0,0 +1,190 @@ +-- 添加综合评估菜单 +-- 菜单类型:C(菜单) +-- 父菜单ID:2009(心理测评管理) +-- 排序:在报告管理之后,设置为14(在主观题评分order_num=13之后) + +-- 设置字符集(确保中文正确显示) +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8mb4 */; + +-- 添加综合评估菜单(菜单项) +INSERT INTO `sys_menu` ( + `menu_name`, + `parent_id`, + `order_num`, + `path`, + `component`, + `query`, + `route_name`, + `is_frame`, + `is_cache`, + `menu_type`, + `visible`, + `status`, + `perms`, + `icon`, + `create_by`, + `create_time`, + `remark` +) VALUES ( + '综合评估', -- 菜单名称 + 2009, -- 父菜单ID(心理测评管理) + 14, -- 显示顺序(在主观题评分order_num=13之后) + 'report/comprehensive', -- 路由地址 + 'psychology/report/comprehensive', -- 组件路径 + NULL, -- 路由参数 + 'ComprehensiveAssessment', -- 路由名称 + 1, -- 是否为外链(1否) + 0, -- 是否缓存(0缓存) + 'C', -- 菜单类型(C菜单) + '0', -- 菜单状态(0显示) + '0', -- 菜单状态(0正常) + 'psychology:report:comprehensive', -- 权限标识 + 'chart', -- 菜单图标 + 'admin', -- 创建者 + NOW(), -- 创建时间 + '综合评估菜单' -- 备注 +); + +-- 添加综合评估的按钮权限 +-- 综合评估查询 +INSERT INTO `sys_menu` ( + `menu_name`, + `parent_id`, + `order_num`, + `path`, + `component`, + `query`, + `route_name`, + `is_frame`, + `is_cache`, + `menu_type`, + `visible`, + `status`, + `perms`, + `icon`, + `create_by`, + `create_time`, + `remark` +) +SELECT + '综合评估查询', + menu_id, + 1, + '', + '', + NULL, + '', + 1, + 0, + 'F', + '0', + '0', + 'psychology:report:comprehensive:query', + '#', + 'admin', + NOW(), + '' +FROM sys_menu +WHERE menu_name = '综合评估' AND parent_id = 2009 +LIMIT 1; + +-- 综合评估生成 +INSERT INTO `sys_menu` ( + `menu_name`, + `parent_id`, + `order_num`, + `path`, + `component`, + `query`, + `route_name`, + `is_frame`, + `is_cache`, + `menu_type`, + `visible`, + `status`, + `perms`, + `icon`, + `create_by`, + `create_time`, + `remark` +) +SELECT + '综合评估生成', + menu_id, + 2, + '', + '', + NULL, + '', + 1, + 0, + 'F', + '0', + '0', + 'psychology:report:comprehensive:generate', + '#', + 'admin', + NOW(), + '' +FROM sys_menu +WHERE menu_name = '综合评估' AND parent_id = 2009 +LIMIT 1; + +-- 综合评估导出 +INSERT INTO `sys_menu` ( + `menu_name`, + `parent_id`, + `order_num`, + `path`, + `component`, + `query`, + `route_name`, + `is_frame`, + `is_cache`, + `menu_type`, + `visible`, + `status`, + `perms`, + `icon`, + `create_by`, + `create_time`, + `remark` +) +SELECT + '综合评估导出', + menu_id, + 3, + '', + '', + NULL, + '', + 1, + 0, + 'F', + '0', + '0', + 'psychology:report:comprehensive:export', + '#', + 'admin', + NOW(), + '' +FROM sys_menu +WHERE menu_name = '综合评估' AND parent_id = 2009 +LIMIT 1; + +-- 为管理员角色(role_id=1)添加菜单权限 +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) +SELECT 1, menu_id FROM sys_menu WHERE menu_name = '综合评估' AND parent_id = 2009 +ON DUPLICATE KEY UPDATE role_id = role_id; + +-- 为管理员角色添加按钮权限 +INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) +SELECT 1, m2.menu_id +FROM sys_menu m1 +INNER JOIN sys_menu m2 ON m2.parent_id = m1.menu_id +WHERE m1.menu_name = '综合评估' AND m1.parent_id = 2009 +ON DUPLICATE KEY UPDATE role_id = role_id; + diff --git a/xinli-ui/src/router/index.js b/xinli-ui/src/router/index.js index a2e750c2..c30c853c 100644 --- a/xinli-ui/src/router/index.js +++ b/xinli-ui/src/router/index.js @@ -347,6 +347,17 @@ export const dynamicRoutes = [ roles: ['admin'] } }, + // 综合评估 + { + path: 'report/comprehensive', + name: 'ComprehensiveAssessment', + component: () => import('@/views/psychology/report/comprehensive'), + meta: { + title: '综合评估', + icon: 'chart', + roles: ['admin'] + } + }, // 量表权限管理 { path: 'permission', diff --git a/xinli-ui/src/views/psychology/permission/index.vue b/xinli-ui/src/views/psychology/permission/index.vue index 2fa2e2fb..13dc458e 100644 --- a/xinli-ui/src/views/psychology/permission/index.vue +++ b/xinli-ui/src/views/psychology/permission/index.vue @@ -521,7 +521,6 @@ export default { // 如果获取角色列表失败,尝试使用默认值101 resolve(101); }); ->>>>>>> 13bbd8b9e742b8b2a020195d81f66187af7d4066 }); }, // 取消按钮 diff --git a/xinli-ui/src/views/psychology/report/comprehensive.vue b/xinli-ui/src/views/psychology/report/comprehensive.vue new file mode 100644 index 00000000..f0c89d5a --- /dev/null +++ b/xinli-ui/src/views/psychology/report/comprehensive.vue @@ -0,0 +1,599 @@ + + + + + + + + + {{ item.nickName || item.userName }} + {{ item.deptName || '未分配单位' }} + + + + + + + 载入 + + 重置 + + + + + + + {{ userProfile.userName || '-' }} + {{ calculateAge(userProfile.birthday) || '-' }} + {{ userProfile.infoNumber || '-' }} + {{ userProfile.crimeName || '-' }} + {{ userProfile.sentenceTerm || '-' }} + {{ formatDate(userProfile.sentenceStartDate) || '-' }} + {{ formatDate(userProfile.sentenceEndDate) || '-' }} + {{ userProfile.educationLevel || '-' }} + {{ userProfile.nation || '-' }} + + + + + + 量表列表(请勾选需要分析的量表) + + + AI生成综合报告 + + + + + + + + + + {{ formatDateTime(scope.row.submitTime) }} + + + + + {{ scope.row.totalScore != null ? scope.row.totalScore : '-' }} + + + + + + + + + + 报告生成中,请稍候... + + + 导出报告 + + + + + + + + +