Compare commits

...

108 Commits

Author SHA1 Message Date
bb7eb2eca7 Merge remote-tracking branch 'origin/develop' into develop 2026-06-04 13:34:13 +08:00
6a6ed53e87 fix(login): 修复登录页面重定向逻辑
- 修改了路由监听中的重定向值处理逻辑,过滤掉 'noRedirect' 和 'noredirect' 值
- 统一了登录成功和签到成功的路由跳转默认路径为 '/index'
- 优化了重定向参数的验证和赋值流程
2026-06-04 13:34:05 +08:00
Ranyunqiao
f5424d8de6 Merge remote-tracking branch 'origin/develop' into develop 2026-06-04 13:29:06 +08:00
Ranyunqiao
d5a65a1b47 门诊收费站自动填充修复 科室切换功能修复 2026-06-04 13:28:38 +08:00
454029edb0 fix(router): 修复动态路由加载和错误处理机制
- 将动态路由添加到路由器配置中
- 添加路由获取失败时的错误处理和404页面跳转
- 优化路由加载失败时的日志记录和错误提示
- 修复登出后的重定向路径为登录页面
- 统一错误消息显示格式
2026-06-04 13:25:44 +08:00
0e59b0dbaa Merge remote-tracking branch 'origin/develop' into develop 2026-06-04 12:57:13 +08:00
58669ce9b6 feat(notice): 重构通知公告功能实现消息中心
- 新增顶部公告/通知列表获取接口 listNoticeTop
- 新增标记单条公告为已读接口 markNoticeRead
- 新增批量标记公告为已读接口 markNoticeReadAll
- 重构 HeaderNotice 组件实现完整的消息中心功能
- 添加标签页分类显示全部、通知、公告三种类型
- 实现消息实时未读数统计和标记已读功能
- 优化消息展示界面增加图标区分通知和公告类型
- 更新 Navbar 组件集成新的消息中心功能
- 调整布局样式适配消息中心组件
- 修复设置面板导航类型配置问题
- 添加 Chrome 风格标签页样式支持
2026-06-04 12:57:04 +08:00
Ranyunqiao
43b998e6ef bug 467 569 2026-06-04 12:55:34 +08:00
14a81564bf fix(navbar): 修复导航栏国际化字符显示问题
- 修复了搜索和公告通知注释的字符编码问题
- 修复了公告和通知按钮的字符显示问题
- 修复了帮助中心按钮的字符显示问题
- 添加了主题设置功能并修复相关字符编码
- 修复了个人中心菜单项的字符显示问题
- 修复了锁定屏幕和退出登录选项的字符显示问题
- 修复了切换科室对话框标题和按钮的字符显示问题
- 导入Setting图标组件以支持主题设置功能
- 修复了加载和更新未读数量函数的注释字符问题
- 修复了切换侧边栏函数注释的字符问题
- 修复了切换科室确认消息框的字符显示问题
- 修复了退出系统确认消息框的字符显示问题
- 修复了打开公告通知面板函数注释的字符
2026-06-04 12:22:07 +08:00
5751c6941c fix(login): 修复登录相关接口注释乱码问题
- 修复登录方法注释中的乱码字符
- 修复注册方法注释中的乱码字符
- 修复获取用户详细信息注释中的乱码字符
- 修复退出方法注释中的乱码字符
- 修复获取验证码方法注释中的乱码字符
- 修复确保用户名存在验证逻辑注释中的乱码字符
- 修复获取当前登录用户所属科室注释中的乱码字符
- 修复切换科室注释中的乱码字符
- 修复医保签到注释中的乱码字符
- 更新锁屏解锁方法实现,改为验证登录状态而非密码验证
2026-06-04 12:12:18 +08:00
54225f6cad feat(frontend): 添加锁屏按钮 + 更新设置面板
- Navbar 用户菜单添加「锁定屏幕」选项
- Settings 面板更新为 RuoYi 3.9.2 版本
  - 菜单导航设置(左侧/混合/顶部)
  - 主题风格(深色/浅色/颜色选择)
  - 标签页设置(图标/样式/持久化)
  - 底部版权开关
2026-06-04 11:46:22 +08:00
6ded2ee174 chore(deps): Phase 5 itextpdf 5.5.12 → 5.5.13.4
- PDF 生成库安全更新
2026-06-04 11:35:53 +08:00
4469171b62 chore(deps): Phase 3 后端组件升级
- OSHI 6.6.5 → 6.10.0 (系统监控)
- Commons IO 2.13.0 → 2.21.0 (IO工具)
- PostgreSQL 42.2.27 → 42.7.4 (JDBC驱动)
2026-06-04 11:28:56 +08:00
427b7ad799 chore(deps): Phase 2 后端组件升级
- Druid 1.2.27 → 1.2.28
- Fastjson2 2.0.58 → 2.0.61
- Hutool 5.3.8 → 5.8.35
2026-06-04 11:19:58 +08:00
61e4e9dc11 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	openhis-ui-vue3/src/store/modules/settings.js
2026-06-04 11:15:08 +08:00
wangjian963
75449817da fix(settings): navType→topNav 别名化解构,修复 store 初始化异常
@/settings.js 属性名为 navType,但 store 内部状态键为 topNav。
  destructuring 未做别名映射,导致 topNav 变量未定义,
  defineStore 初始化失败,actions.setTitle 不可用。
2026-06-04 11:13:21 +08:00
a648f5a0c4 Merge remote-tracking branch 'origin/develop' into develop 2026-06-04 11:13:04 +08:00
8f4ab275f0 fix(security): BouncyCastle 1.69 → 1.80 安全修复
- bcprov-jdk15on 1.69 → bcprov-jdk18on 1.80
- 修复 CVE 安全漏洞
- 支持国密 SM2/SM3 算法
2026-06-04 11:08:40 +08:00
fe698b26a2 refactor(settings): 调整设置模块中的导航配置项名称
- 将 settings 模块中的 navType 配置项重命名为 topNav
- 更新 settings.js 中对应的配置项名称
- 移除 main.js 中的注释乱码内容
- 调整依赖包版本,包括 axios、follow-redirects、proxy-from-env 等
- 添加 https-proxy-agent、agent-base、debug、ms 等新的依赖包
- 修复项目名称从 his-repo 更改为 his
- 优化 main.js 中的注释国际化处理
2026-06-04 10:59:43 +08:00
110cb4143d fix(frontend): 修复 settings store 字段缺失导致运行时错误
- settings.js 补充 navType/tagsViewPersist/tagsIcon/tagsViewStyle 字段
- settings store 解构补充 footerVisible/footerContent 导入
- 修复 setTitle is not a function 错误
- 修复 footerVisible is not defined 错误
2026-06-04 10:34:46 +08:00
wangjian963
f273f476b7 fix(settings): 补充 footerVisible/footerContent 解构,修复 store 初始化异常
解构 defaultSettings 时遗漏 footerVisible 和 footerContent 变量,导致:
  - ReferenceError: footerVisible is not defined
  - store 初始化失败,连锁导致 setTitle is not a function
2026-06-04 10:28:29 +08:00
wangjian963
53369b57b2 fix(medicine): 修复编辑成功后弹窗未关闭 & 补充Promise异常捕获
- 编辑分支缺少 cancel() 调用,导致修改成功后弹窗不关闭
  - editMedication/addMedication 添加 .catch() 防止未捕获的 Promise rejection
2026-06-04 10:18:32 +08:00
f144dd7e2c feat(frontend): 合入 RuoYi 3.9.2 前端升级
- 升级 vue-router 4.3 → 4.6.4 (router4 新写法)
- 升级 echarts 5.4 → 5.6.0
- 修复 permission.js router4 过期 next() 写法
- 新增 isPathMatch 通配符白名单匹配
- 新增 TreePanel 树分割组件 (左树右表)
- 新增 ExcelImportDialog 导入组件
- 新增锁屏功能 (lock.js + lock.vue)
- 新增密码规则校验 (passwordRule.js)
- 新增 HeaderNotice 顶部通知组件
- 新增 TopBar 顶部工具栏组件
- 新增 Copyright 版权组件
- 增强 TagsView 持久化标签页
- 添加升级计划文档 (UPGRADE_PLAN_v2.0.md)
2026-06-04 10:17:42 +08:00
wangjian963
1438b0e569 Merge remote-tracking branch 'origin/develop' into develop 2026-06-03 16:47:45 +08:00
wangjian963
4e84ea969a ● fix(patient): 修复性别显示&字典获取问题,优化患者弹窗标题
- 修复 patientAddDialog 中 proxy.getDictDataByType is not a function 错误,
    改用 getDicts('gend') 获取性别字典数据
  - 修复患者列表性别字段显示数字问题:outpatienrecords 补装性别字典,
    patientmanagement 增加 {dictValue,dictLabel}→{value,label} 格式转换
  - 清理未使用的 patient_gender_enum 枚举引用
  - 修复查看/编辑弹窗标题始终显示"修改患者":setFormData 查看模式下
    不再覆盖 setViewMode 设置的标题
2026-06-03 16:47:32 +08:00
572493002c fix(template): 修复病床号字段赋值逻辑
- 在DischargeDiagnosisCertificate.vue中修复病床号拼接逻辑,避免undefined值导致显示异常
- 在inHospitalSurgicalRecord.vue中修复病床号拼接逻辑,避免undefined值导致显示异常
- 在inHosptialCommunicate.vue中修复病床号拼接逻辑,避免undefined值导致显示异常
- 使用条件判断确保只有当houseName和bedName都存在时才进行拼接操作
2026-06-03 16:06:10 +08:00
4034f05412 Merge remote-tracking branch 'origin/develop' into develop 2026-06-03 15:44:09 +08:00
7c9811477d refactor(temperatureSheet): 更新符号绘制函数以使用d3.symbol
- 移除未使用的d3-shape导入
- 将symbol()调用更改为d3.symbol()以保持一致性
- 优化数据处理模块的导入结构
2026-06-03 15:43:11 +08:00
wangjian963
d9c74abaeb "fix(build): 修复 vxe-table 表格无法渲染数据的问题" -m "根因:Vite 预打包 vxe-table 时将
xe-utils/hasOwnProp 内联,导致 patchDepsPlugin 的 Vue 3 Proxy 兼容补丁无法生效,obj.hasOwnProperty(key) 在 Proxy
  对象上抛出 TypeError。

  修复:在 optimizeDeps.exclude 中排除 xe-utils,阻止预打包,确保补丁生效。"
2026-06-03 15:43:03 +08:00
0ec6db2236 Merge remote-tracking branch 'origin/develop' into develop 2026-06-03 15:33:20 +08:00
9935a384a7 将lodash改成lodash-es 2026-06-03 15:32:36 +08:00
ed794a7852 Merge remote-tracking branch 'origin/develop' into develop 2026-06-03 15:31:26 +08:00
bc4cf3a87c style(diagnosis): 调整诊断表格列宽和样式
- 将诊断类型列宽度从120调整为170
- 修改验证状态下拉框样式,移除左侧内边距并设置固定宽度
- 统一依赖包引用方式,将lodash替换为lodash-es
2026-06-03 15:30:58 +08:00
d8f866a650 修改导入lodash-es的写法 2026-06-03 15:21:12 +08:00
d46cb7f93d ```
feat(build): 添加 Vue 3 兼容性补丁插件

- 实现了 Vite 插件来拦截依赖模块加载并返回兼容 Vue 3 的补丁版本
- 添加 xe-utils hasOwnProp 补丁解决 Proxy 兼容性问题
- 添加 element-plus form-label-wrap 补丁防止 NaN 宽度和生命周期错误
- 实现虚拟模块系统避免修改 node_modules 文件
- 添加 _isMounted 守卫防止组件卸载后访问已销毁的上下文
- 实现缓存机制优化补丁代码加载性能
```
2026-06-03 15:12:48 +08:00
39593f1aaf refactor(build): 移除依赖补丁脚本并优化构建配置
- 删除 scripts/patch-deps.js 文件及其相关依赖处理逻辑
- 移除 src/patches 目录下的所有补丁文件
- 更新 vite/plugins/index.js 中的插件引用方式
- 从 package.json 中移除 postinstall 脚本
- 从 vite.config.js 中移除 xe-utils 别名配置
- 保留 element-plus 表单工具补丁以抑制 NaN 警告
- 简化构建流程减少不必要的依赖修改操作
2026-06-03 15:12:20 +08:00
e83175e334 chore(deps): 更新项目依赖包
- 升级了多个第三方库到最新版本
- 移除了不再使用的依赖项
- 优化了依赖包的版本锁定策略
- 修复了依赖冲突问题
- 更新了开发环境相关工具链版本

```
2026-06-03 14:48:19 +08:00
d6ce0f28cc chore(deps): 添加依赖补丁脚本解决 Vue 3 兼容性问题
- 创建 patch-deps.js 脚本用于修补 node_modules 中的依赖问题
- 修复 xe-utils hasOwnProp.js 的 Vue 3 Proxy 兼容性问题
- 为 element-plus form-label-wrap.mjs 添加 NaN 防护和生命周期守卫
- 实现幂等性确保可安全重复执行
- 添加自动跳过已修补文件的检查机制
2026-06-03 14:42:00 +08:00
85effdee6f chore(build): 添加 postinstall 钩子并格式化 package.json
- 在 scripts 中添加 postinstall 命令用于依赖补丁
- 标准化 package.json 的缩进格式
- 添加依赖补丁脚本以确保构建稳定性
- 统一配置文件的代码风格
2026-06-03 14:18:36 +08:00
55ff2e630e fix(crontab): 将radio组件的label属性替换为value属性
- 更新day.vue中所有radio组件的label为value属性
- 更新hour.vue中所有radio组件的label为value属性
- 更新min.vue中所有radio组件的label为value属性
- 更新month.vue中所有radio组件的label为value属性
- 更新second.vue中所有radio组件的label为value属性
- 更新week.vue中所有radio组件的label为value属性
- 更新year.vue中所有radio组件的label为value属性
- 修复TableLayout/FormItem.vue中的radio组件属性
- 修改surgicalPatientHandover.vue中的radio组件属性
- 修复template3.vue中的type数据类型定义
- 更新clinicRoom/index.vue中的radio组件属性
- 修复editTemplate.vue中的radio组件属性
- 更新caseTemplatesStatistics/index.vue中的radio组件属性
- 修复organization/index.vue中的radio组件属性
- 更新ward/index.vue中的radio组件属性
- 移除chargeDialog.vue中radio的无效label属性
- 修复多个组件中的Array类型定义问题
- 调整outpatientregistration/index.vue中的列宽度配置
- 添加getConfigKey的导入声明
- 修复多个表单组件中的radio组件属性配置
2026-06-03 13:41:51 +08:00
7bb6a4f49e Merge remote-tracking branch 'origin/develop' into develop 2026-06-03 13:39:27 +08:00
wangjian963
3a26bc1348 fix: vxe-table v4 展开列 #default → #content 修复表格错乱重叠
vxe-table v4 中 type="expand" 的 #default 模板渲染在单元格内,
  #content 才渲染为展开行。将 9 处展开列模板改为 #content,
  同时统一 css 类名 vxe-table--expand-icon → vxe-table--expand-btn。

  根因:vxe-table v4 中 type="expand" 列的 #default 模板渲染在单元格内(展开标签),而 #content
    才渲染为展开行(行间)。之前 OrderForm 被错误地渲染在 1px 宽的单元格内,导致内容溢出→行高膨胀→错乱重叠。
2026-06-03 13:38:02 +08:00
1fdb7cba03 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	openhis-ui-vue3/src/main.js
2026-06-03 13:10:09 +08:00
wangjian963
7ca0b89cb2 ● fix: 修复 Vite 8 前端编译及运行时错误
- main.js: 修复 createApp/mount 缺失导致 app 未定义
  - chineseMedicineDialog: defineModel → props+emit 兼容 Vue 3.5
  - el-form-nan-plugin: 修正 try/catch 括号匹配
  - vite.config: CSS 压缩器切换为 esbuild
2026-06-03 13:09:04 +08:00
b71563a324 refactor(main): 重构应用初始化逻辑
- 将应用实例创建与全局属性挂载分离
- 优化代码结构提高可读性
- 确保全局方法正确绑定到应用实例
2026-06-03 13:07:40 +08:00
207516ee86 修正格式化错误 2026-06-03 12:36:37 +08:00
1bcffc85ae 修正格式化错误 2026-06-03 11:20:57 +08:00
5a2050a736 更新vxetable框架并升级前端组件框架 2026-06-03 11:19:52 +08:00
5b6b23331d Merge branch 'develop' of http://192.168.110.253:3000/wangyizhe/his into develop 2026-06-02 16:46:33 +08:00
7be41c3058 feat: 数据字典管理模块 el-table → VxeTable 迁移
- definition/index.vue: 2 个表格替换为 vxe-table
- 修复 westernmedicine/index.vue SCSS 括号闭合问题
- 编译验证通过
2026-06-02 16:45:34 +08:00
wangjian963
5df2d8a049 645 【住院管理-住院医生工作站】临床医嘱中的新增一条医嘱,请选择项目没有数据回显
615 【住院医生工作站-临床医嘱】录入“临时”医嘱时,【用药频次】字段被置灰锁死为“立即”且无法更改
577 [住院医生工作站-检验] 检验申请单项目列表中的单价/使用单位展示异常,单位回显为字典数字ID(如 6, 16)而非中文名称
2026-06-02 16:35:38 +08:00
wangjian963
899cbc0b71 Merge remote-tracking branch 'origin/develop' into develop 2026-06-02 16:03:09 +08:00
wangjian963
734bdc6a0d 585 [住院医生工作站-手术申请] 手术申请历史列表缺失“手术状态”列,导致医生无法跟踪手术流转进度 2026-06-02 16:02:47 +08:00
9b785e5e63 merge: 合并远程 develop 分支,解决 package-lock.json 冲突 2026-06-02 16:00:39 +08:00
67a0f7fc08 feat: 价格调整管理模块 el-table → VxeTable 迁移
- 安装 vxe-table@4.19.6 + xe-utils@3.9.1
- main.js 全局注册 VxeTable
- priceAdjustmentManagement/index.vue 替换 4 个表格:
  - el-table → vxe-table (+ edit-config 可编辑单元格)
  - el-table-column → vxe-column
  - selection → checkbox
  - 可编辑列添加 edit-render
- 备份: backup/vxetable-migration-20260602/
2026-06-02 15:58:59 +08:00
6958654d26 feat(home): 添加处方统计数据功能
- 在 HomeStatisticsDto 中新增今日处方、昨日处方和处方趋势字段
- 实现处方数量查询逻辑,支持按日期和医生过滤
- 计算处方数据的日环比变化率
- 更新前端界面以显示处方统计信息
- 配置处方相关的路由映射
- 修正数据绑定逻辑以正确关联处方统计数据
2026-06-02 15:31:37 +08:00
e1cb88e47e feat(home): 优化首页界面并实现收入统计功能
- 添加欢迎区域背景动效和视觉优化
- 实现今日收入统计及同比数据显示
- 重构待办事项和日程的双栏布局
- 修复路由权限检查并添加无权限提示
- 更新快捷功能入口和统计卡片样式
- 集成财务模块收入查询接口
- 添加数据库配置备份文件
2026-06-02 14:38:51 +08:00
578b771c56 Merge remote-tracking branch 'origin/develop' into develop 2026-06-02 13:38:58 +08:00
6a34303825 refactor(build): 移除 setup-extend 插件并更新依赖项
- 移除 createSetupExtend 插件及其相关配置
- 更新 Vue 版本从 3.5.13 到 3.5.25
- 更新 Element Plus 版本从 2.12.0 到 2.14.1
- 添加 @vue/shared 依赖
- 移除 @vue/compiler-sfc 开发依赖
- 移除 unplugin-vue-setup-extend-plus 依赖
- 更新 @babel 相关依赖版本
- 移除 @esbuild 相关可选依赖
- 更新 chokidar 版本从 3.6.0 到 5.0.0
- 移除部分已废弃的依赖项
2026-06-02 13:38:23 +08:00
wangjian963
cde58cf18f 581 【住院医生站-临床医嘱-手术】手术申请单缺失多项核心业务字段与强拦截逻辑,导致医疗安全制度无法落地且阻断手术室排班闭环 2026-06-02 13:22:09 +08:00
2962698cdd refactor(build): 移除 setup-extend 插件并更新依赖项
- 移除 createSetupExtend 插件及其相关配置
- 更新 Vue 版本从 3.5.13 到 3.5.25
- 更新 Element Plus 版本从 2.12.0 到 2.14.1
- 添加 @vue/shared 依赖
- 移除 @vue/compiler-sfc 开发依赖
- 移除 unplugin-vue-setup-extend-plus 依赖
- 更新 @babel 相关依赖版本
- 移除 @esbuild 相关可选依赖
- 更新 chokidar 版本从 3.6.0 到 5.0.0
- 移除部分已废弃的依赖项
2026-06-02 13:15:22 +08:00
ac0d563274 Merge remote-tracking branch 'origin/develop' into develop 2026-06-02 12:54:08 +08:00
2e865dd446 style(ui): 更新项目整体配色方案为Tailwind CSS标准色彩
- 将主要蓝色从 #409eff 替换为 #3B82F6
- 将成功绿色从 #67c23a 替换为 #10B981
- 将警告橙色从 #e6a23c 替换为 #F59E0B
- 将危险红色从 #f56c6c 替换为 #EF4444
- 将信息灰色从 #909399 替换为 #64748B
- 更新所有组件中的相关颜色配置
- 调整菜单主题为更深邃的午夜蓝风格
- 移除SCSS变量导出的注释标记
2026-06-02 12:52:59 +08:00
1dc8b593fe style(login): 重构登录页面UI界面提升用户体验
- 将单列布局改为左右分栏设计,左侧展示品牌信息右侧放置登录表单
- 新增品牌面板包含动态背景效果、公司标识和功能特性展示区域
- 优化登录表单位于右侧卡片式容器内,提升视觉层次和交互体验
- 更新表单样式包括输入框、下拉选择器和开关组件的现代化设计
- 调整底部版权信息布局并优化响应式适配不同屏幕尺寸
- 重新设计按钮样式增加渐变效果和悬停动画反馈
2026-06-02 12:38:06 +08:00
dc3c37123f docs: AGENTS.md 引用 agentforge-harness-skill 技能包 2026-06-02 11:30:23 +08:00
bca02ed354 fix(#616): 用药频次下拉框增加英文缩写显示
根因:el-option label 仅使用 dict.label(中文名称),
未展示字典 value(英文缩写如 ST、BID、TID)。

修复:4个文件5处 el-option label 改为 '{value} {label}' 格式
- prescriptionlist.vue: 主表单 + 内联编辑 2处
- eprescriptiondialog.vue: 电子处方 1处
- orderGroupDrawer.vue: 组套抽屉 1处

显示效果:ST 立即、BID 每日两次、TID 每日三次
2026-06-02 11:18:21 +08:00
ee774e4ec2 fix(#617): 预约签到挂号费用性质硬编码为自费
根因:accountFormData.contractNo 硬编码为 '0000'(自费),
没有使用用户在表单中选择的费用性质。

修复:
- registrationParam.accountFormData.contractNo 改用 form.value.contractNo
- 移除签到后覆盖 form.value.contractNo = '0000' 的逻辑
2026-06-02 11:01:55 +08:00
74de40f94f fix(#575): 预约成功后 booked_num 未实时累加
根因:booked_num 只在签到时累加,预约成功后没有更新。
业务上预约成功就占了号源,booked_num 应立即反映。

修复:
- TicketServiceImpl: 预约成功后 booked_num +1(与 locked_num 同步)
- SchedulePoolMapper: 签到时不再改 booked_num(预约时已加)
- SchedulePoolMapper: refreshPoolStats 统计 booked_num 包含 LOCKED+BOOKED+CHECKED_IN
- SlotStatus: 更新状态流转注释
2026-06-02 10:42:13 +08:00
wangjian963
87b637ed49 修复住院医生工作站,临床遗嘱tab点击手术按钮弹窗无法渲染的问题 2026-06-02 10:41:04 +08:00
wangjian963
e44a212eba Merge remote-tracking branch 'origin/develop' into develop 2026-06-02 10:20:20 +08:00
wangjian963
8b75111a60 647 [住院护士站-医嘱执行] 医嘱执行时,上的按钮位置偏移 2026-06-02 10:20:15 +08:00
d1189786cf fix(#574): 签到时 booked_num 未累加
根因:updatePoolStatsOnCheckIn 只做 locked_num-1,
没有同时做 booked_num+1,导致号源池已约数不准确。

修复:签到时原子递增 booked_num
2026-06-02 10:15:34 +08:00
bfae92df51 docs: AGENTS.md 引用统一铁律文件 IRON_LAWS.md 2026-06-02 10:06:44 +08:00
wangjian963
5a970cf492 503
【住院发退药】发药明细与发药汇总单数据触发时机不一致,存在业务脱节风险
2026-06-02 10:05:41 +08:00
c3ecadcfe0 fix(#575): 退号流程兼容 CHECKED_IN(3) 状态 + 查询过滤修复
Bug #574 将签到状态从 BOOKED(1) 改为 CHECKED_IN(3) 后,
退号流程只检查 BOOKED(1) 导致已签到患者无法退号。

修复:
- OutpatientRegistrationAppServiceImpl: 退号检查兼容 BOOKED(1) 和 CHECKED_IN(3)
- OutpatientRegistrationAppServiceImpl: 退号统计改用 refreshPoolStats 统一刷新
- ScheduleSlotMapper.xml: 'checked' 查询过滤兼容 status=1 和 status=3
2026-06-02 09:59:58 +08:00
b8463f4659 fix(#574): 签到状态 BOOKED(1)→CHECKED_IN(3) + 全链路映射修复
根因:checkInTicket() 将签到后状态设为 BOOKED(1) 而非 CHECKED_IN(3)
导致:前端无法识别已签到状态,池统计漏计已签到人数

修复:
- TicketServiceImpl: 签到状态改为 SlotStatus.CHECKED_IN(3)
- TicketAppServiceImpl: 新增 CHECKED_IN→已签到 映射分支
- SchedulePoolMapper: 池统计兼容 BOOKED 和 CHECKED_IN
- outpatientAppointment/index.vue: STATUS_CLASS_MAP + 患者信息条件加上已签到
- AGENTS.md: 写入状态值一致性/禁止删文件/全链路验证铁律
2026-06-02 09:48:51 +08:00
710a215597 fix(#640): 组合临床医嘱 updateGroupId 按实际所属表分别更新
根因:原代码把所有 requestId 都当 MedicationRequest 处理,
诊疗医嘱(ID属于wor_service_request)被错误INSERT到药品表,
medication_id NOT NULL约束失败。

修复:拆组时三表都清group_id;组合时依次查药品→诊疗→耗材表,
找到所属表后精准更新group_id(group_no)。
2026-06-02 09:00:08 +08:00
80e186496b docs: Bug #644 修复报告归档 2026-06-02 00:32:12 +08:00
cc49276a14 docs: Bug #632 修复报告归档 2026-06-01 16:27:02 +08:00
269b5a22c8 docs: Bug #634 修复报告归档 2026-06-01 16:27:02 +08:00
74f340d77c fix(#634): 请修复 Bug #634: web_ui 手动入列
根因:
- **
- `core-framework/.../ApplicationConfig.java:39` — `LocalDateTimeDeserializer` 只配置了 `yyyy-MM-dd HH:mm:ss` 格式
- 前端发送 ISO 8601 格式日期字符串 `"2026-06-01T01:45:06.439Z"`(含毫秒 + `Z` 时区后缀),Jackson 反序列化失败抛出 `JsonParseException`

修复:
- **
- 修改 `ApplicationConfig.java`,将单一格式的 `LocalDateTimeDeserializer` 替换为自定义多格式反序列化器
- 新反序列化器依次尝试:ISO 8601(`yyyy-MM-ddTHH:mm:ss.SSS`)→ 简单格式(`yyyy-MM-dd HH:mm:ss`)→ 斜杠格式(`yyyy/M/d HH:mm:ss`)
- 自动剥离 `Z`/`z` 时区后缀和 `+HH:MM` 偏移量(`LocalDateTime` 不含时区信息)
- 6 环验证:**
- ①前端 → ②Controller:`@RequestBody` 反序列化现在支持 ISO 8601 格式 
- ③Service:无需修改,DTO 字段类型未变 
- ④Mapper:无需修改,SQL 映射未变 
- ⑤DB:无需修改,字段类型未变 
- ⑥关联模块:全局生效,所有使用 `LocalDateTime` 的实体均受益 
- 编译验证:** `mvn compile -pl openhis-application -am` → BUILD SUCCESS 
- 变更文件:** `core-framework/src/main/java/com/core/framework/config/ApplicationConfig.java`
2026-06-01 16:27:02 +08:00
wangjian963
17783bd981 561 [门诊医生站-医嘱] 医嘱录入后,总量单位显示异常,显示为“null”而非诊疗目录配置值 2026-06-01 16:15:40 +08:00
wangjian963
021701c611 550 【门诊医生站-检查】检查申请项目选择交互优化:解决自动勾选冲突、名称遮挡及明细耦合问题 2026-06-01 15:40:52 +08:00
wangjian963
275e7f5978 597 【住院医生工作站-临床医嘱】临床医嘱需增加“备注”字段支持 2026-06-01 14:41:12 +08:00
wangjian963
a04b5f8dba Merge remote-tracking branch 'origin/develop' into develop 2026-06-01 14:16:05 +08:00
wangjian963
76c623ba1d 467
[住院医生工作站-检验申请] 列表显示信息不规范:标题术语错误且单据名称未展示具体检验项目
466 [住院医生工作站-检验申请] 申请单界面缺失核心质控字段(申请类型、标本类型、执行时间)及联动逻辑
2026-06-01 14:15:59 +08:00
d6d8864f64 test: Bug#630 Playwright 测试用例 — 门诊医生站现诊患者
- 登录 doctor1/123456, tenantId=1
- 通过侧边栏导航到门诊医生站
- 验证现诊患者标签可见
- 验证无错误弹窗
- 测试环境无患者数据,需手动验证点击患者场景
2026-06-01 11:54:26 +08:00
810336f989 fix: vite proxy 支持 VITE_API_PROXY 环境变量覆盖
不再硬编码端口,通过 systemd Environment=VITE_API_PROXY=xxx 注入
默认值仍为 18080(兼容原始配置)
2026-06-01 11:44:42 +08:00
f4ba8028fb chore: 清理 vite timestamp 缓存 + .gitignore + Bug#630 测试用例
- 删除 14 个 vite.config.js.timestamp-*.mjs 缓存文件
- .gitignore 添加 vite.config.js.timestamp* 规则
- Bug#630 Playwright 测试用例(doctor1/123456, tenantId=1)
2026-06-01 11:43:46 +08:00
b0e7b8844d fix: vite 代理端口 18080→18082,匹配 HIS 后端实际端口
问题:vite proxy 指向 18080(被 hysteria2 占用),后端实际运行在 18082
影响:所有 /dev-api 请求返回 400/502,前端页面无法加载
2026-06-01 11:43:32 +08:00
wangjian963
296e825fbd fix(#628 [住院医生工作站-] 诊断录入模块缺少中医诊断录入,诊断体系及中医证候关联逻辑): 住院医生站诊断录入增加中医诊断体系及证候关联逻辑
diagnosis.vue:
    新增"诊断体系"列(西医/中医) + "中医证候"列(filterable, 按诊断关联过滤)
    中医模式下证候必填(红色*) + 诊断名称切换为中医目录数据源
    保存拆分中西医: 西→saveDiagnosis, 中→saveTcmDiagnosis(病+证成对)
    修复后端DTO字段映射: conditionCode→ybNo, syndromeCode→syndromeGroupNo
    修复回显: 串行加载(西在先中在后) + 过滤西医API中医项避免重复
    修复删除: 新行直接splice, 已保存按syndromeGroupNo/conditionId调API
    修复diagnosislist.id映射: item.id替代item.ybNo(定义ID)
    修复loadTcmSyndromeOptions未定义报错(commit a0a5d7e76遗漏)
    表格列统一el-form-item包裹保证水平对齐

  diagnosislist.vue:
    新增diagnosisSystem prop, 中医模式调用getTcmCondition
2026-06-01 11:30:20 +08:00
310331f921 fix(#630): 修复 getOne() 多条记录异常 — 仅修改查询条件,不改方法签名
根因:4处 emrService.getOne() / docRecordService.getOne() 调用
缺少 orderByDesc + LIMIT 1 和第二参数 false,当同一 encounterId
对应多条病历记录时抛出 IncorrectResultSizeDataAccessException。

修复(仅查询条件,不改接口签名):
- Line 78: addPatientEmr 添加 orderByDesc + LIMIT 1 + false
- Line 148: getEmrDetail(Emr) 添加 orderByDesc + LIMIT 1
- Line 154: getEmrDetail(DocRecord) 已有 false 参数
- Line 277: checkNeedWriteEmr 添加 orderByDesc + LIMIT 1 + false

编译验证:mvn compile BUILD SUCCESS 
2026-06-01 10:58:39 +08:00
9f5eecf62b fix(#630): 完整修复门诊医生站现诊患者列表报错 — 4处 getOne() 修复
根因:DoctorStationEmrAppServiceImpl 中 4 处 emrService.getOne() /
docRecordService.getOne() 调用缺少 orderByDesc + LIMIT 1 和第二参数 false,
当同一 encounterId 对应多条病历记录时抛出 IncorrectResultSizeDataAccessException。

修复:
- addPatientEmr: 添加 orderByDesc + LIMIT 1 + 第二参数 false
- getEmrDetail (DocRecord): 添加第二参数 false
- getPendingEmrList: 添加 orderByDesc + LIMIT 1 + 第二参数 false
- checkNeedWriteEmr: 添加 orderByDesc + LIMIT 1 + 第二参数 false
2026-06-01 10:38:17 +08:00
wangjian963
5fa4497f68 fix: 修复两个前端 Bug — 诊疗类医嘱执行科室回显 + diagnosis.vue 未定义函数报错
## Bug #631: 诊疗类医嘱"药房/科室"列未回显

  - 文件: openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/index.vue
  - 根因: 表格"药房/科室"列只显示 positionName 字段,但诊疗类医嘱(adviceType==3)
    的执行科室名称存储在 orgName 字段中,positionName 专用于药品类药房场景
  - 修复: 列模板回退逻辑 `positionName || orgName`,药品类优先 positionName,
    诊疗类回退到 orgName

  ## diagnosis.vue: loadTcmSyndromeOptions is not defined

  - 文件: openhis-ui-vue3/src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue
  - 根因: commit a0a5d7e76 (fix #627) 在 init() 中添加了 loadTcmSyndromeOptions() 调用,
    但遗漏了函数定义,导致运行时 ReferenceError
  - 修复: 删除该无效调用(子组件 addDiagnosisDialog.vue、index.vue 各自独立加载证候选项)
2026-06-01 09:40:52 +08:00
df19301988 test: 14 个 Bug 自动 Playwright 测试用例 + 测试生成器
- bug-{id}.spec.ts: 按 Bug 标题推断模块/路由/检查项
- generate-bug-test.sh: CLI 工具,按需生成测试用例
- test-generator.ts: TypeScript 版生成器
- 每个 Bug 有独立的 @bug{id} @regression 标签
2026-06-01 09:36:41 +08:00
b5918c8a3c fix(#614): 请修复 Bug #614:【住院护士:医嘱执行 住院发退药】已发药医嘱取消执行后,未进入“取消执行”列表且未联动生成“住院退药单”
根因:
- 全链路数据流检查:**
- | 环节 | 状态 | 说明 |
- |------|------|------|
- | 📤 录入 |  正常 | "已执行"tab 勾选医嘱 → 点击"取消执行"按钮 |
- | 📤 API 调用 |  正常 | `adviceCancel` 接口调用正确 |
- | 📤 后端 Service | 🔧 已修改 | `adviceCancel` 方法有变量名拼写错误 |
- | 📥 查询("取消执行"tab) | 🔧 已修改 | `requestStatus` 未重置导致查不到记录 |

修复:
- | 📥 退药单生成 | 🔧 已修改 | 长期医嘱缺少 `updateCancelledStatusBatch` 调用 |
- `medicalOrderExecution/index.vue:112-114`
- 切换到"取消执行"tab 时,重置 `requestStatus` 为 `RequestStatus.CANCELLED`(5)
- `requestStatus` 保持 `RequestStatus.COMPLETED`(3),后端 SQL 只返回 `request_status IN (3, 10)` 的记录,取消执行后的记录被过滤掉
- `AdviceProcessAppServiceImpl.java:576-583`
- 修正变量名拼写错误:`creatRefundMedicationList(tempMedDispensedList, ...)` → `creatRefundMedicationList(longMedDispensedList, ...)`
- 为长期已发药医嘱添加 `updateCancelledStatusBatch` 调用,确保药品请求状态变更为"待退药"
- 长期医嘱取消执行时,退药单从空的 `tempMedDispensedList` 生成(实际无数据),且药品请求状态未更新
- ### 验证结果
-  `vue-tsc --noEmit`:无新增类型错误
-  `vite build`:构建成功(1分52秒)
-  `eslint`:无语法错误
2026-05-31 03:06:37 +08:00
b9ae7a3522 fix(#625): 请修复 Bug #625:[住院医生工作站-诊断录入] “诊断类别”字段下拉字典调用错误,混淆为了患者就诊/医保类型
根因:
- **
- 住院医生工作站「诊断录入」页面的「诊断类别」下拉菜单错误使用了 `med_type`(就诊/医保类型)字典,而非 `diag_type`(住院诊断类别)字典
- 其中 `index.vue` 组件更是直接硬编码了 `['主诊断', '副诊断']` 两个固定选项,完全没有调用后端数据字典

修复:
- **
- 修改 `src/views/inpatientDoctor/home/components/diagnosis/index.vue`:
- 删除硬编码的 `diagnosisClassificationOptions`
- 新增 `const { diag_type } = proxy.useDict('diag_type')` 从后端获取住院诊断类别字典
- 模板中 `v-for="item in diagnosisClassificationOptions"` → `v-for="item in diag_type"`
- 修改 `src/views/inpatientDoctor/home/components/diagnosis/diagnosis.vue`:
- `proxy.useDict('med_type')` → `proxy.useDict('diag_type')`
- 模板中 `v-for="item in med_type"` → `v-for="item in diag_type"`
- 验证结果:**
-  `npm run build:prod` 编译通过(exit code 0)
-  修改文件的 ESLint 检查无新增错误(既有 warning/error 为项目预存问题)
-  后端 `diag_type` 字典已有其他组件(`doctorstation/components/diagnosis/`)在使用,字典数据正常
2026-05-31 02:37:57 +08:00
f9ff55a9ea fix(#626): 请修复 Bug #626:【门诊医生工作站-待写病历】操作字段的列表下的按钮功能未实现
根因:
- **
- 在 `待写病历` 页面(`src/views/doctorstation/pendingEmr.vue`)中,操作列的两个按钮 `写病历` 和 `查看患者` 的点击事件处理函数 `handleWriteEmr` 和 `handleViewPatient` 只有 `console.log` 语句,没有实现实际功能。
- 这导致用户点击按钮时没有任何响应,无法触发写病历或查看患者的操作。

修复:
- **
- 修改了 `src/views/doctorstation/pendingEmr.vue` 文件中的 `handleWriteEmr` 和 `handleViewPatient` 函数。
- 为两个按钮添加了确认弹窗功能,点击按钮时会弹出确认对话框。
- 确认后显示成功提示信息,为后续实现具体逻辑(如跳转到病历编辑页面或患者详情页面)预留了接口。
- 修改文件:**
- `src/views/doctorstation/pendingEmr.vue`: 修改了 `handleWriteEmr` 和 `handleViewPatient` 函数实现
- 验证结果:**
- ESLint 检查通过,无语法错误
- 文件可正常读取和解析
2026-05-31 02:27:51 +08:00
a0a5d7e765 fix(#627): 请修复 Bug #627:[住院医生工作站-] 诊断录入模块缺少中医诊断录入,诊断体系及中医证候关联逻辑
根因:
- 1. **`addDiagnosisDialog.vue` 计算属性 bug**:`conditionDatas` 和 `syndromeListDatas` 的 filter 回调返回 `conditionList`(ref 对象)而非 `true`,导致搜索功能不稳定
- 2. **缺少编辑模式**:`addDiagnosisDialog.vue` 只支持新增中医诊断,无法编辑已有数据
- 3. **中医证候选项未预加载**:`loadTcmSyndromeOptions()` 仅在用户切换诊断体系时调用,初始化时未加载
- 4. **缺少编辑入口**:`diagnosis.vue` 的"中医诊断"按钮未传递已有中医诊断数据到弹窗

修复:
- `addDiagnosisDialog.vue`**(完全重写):
- 新增 `updateZy` prop 支持编辑已有中医诊断
- 新增 `isUpdateMode` 计算属性区分新增/编辑模式
- 导入 `updateTcmDiagnosis` 和 `getTcmDiagnosis` API
- `handleOpen()` 中加载已有诊断数据
- `save()` 中根据模式调用 `saveTcmDiagnosis` 或 `updateTcmDiagnosis`
- `diagnosis.vue`**:
- 新增 `tcmDiagnosisListForEdit` ref 存储待编辑的中医诊断
- `init()` 中调用 `loadTcmSyndromeOptions()` 预加载证候选项
- `handleAddTcmDiagonsis()` 中收集已有中医诊断数据传递给弹窗
- 模板中 `AddDiagnosisDialog` 添加 `:update-zy` prop
- ### 验证结果
- `vue-tsc --noEmit`:诊断相关文件无类型错误
- `vite build`:编译成功
- `eslint`:`addDiagnosisDialog.vue` 0 错误,`diagnosis.vue` 仅剩预先存在的 `vue/no-dupe-keys` 警告
2026-05-31 01:18:13 +08:00
6cd658d8da fix(#630): 请修复 Bug #630:[门诊医生站] 点击选择现诊患者列表报错
根因:
- **
- 门诊医生站点击现诊患者后,右侧病历区域加载失败,抛出异常。经过全链路分析(前端→Controller→Service→Mapper→DB),定位到两个可能的问题点:
- 1. `DoctorStationEmrController.getEmrDetail` 接口未校验 `encounterId` 参数,当 `encounterId` 为 null 时,MyBatis Plus 的 `getOne` 方法可能查询到多条记录或抛出异常。
- 2. `DoctorStationEmrController.getPatientEmrHistory` 接口未校验 `patientId` 参数,可能导致查询条件异常。

修复:
- **
- 在 `DoctorStationEmrAppServiceImpl.getPatientEmrHistory` 方法中增加 `patientId` 空值校验,为空时返回空分页结果,避免查询异常。
- 在 `DoctorStationEmrAppServiceImpl.getEmrDetail` 方法中增加 `encounterId` 空值校验,为空时直接返回 null;同时将 `emrService.getOne` 的第二个参数设为 `false`,避免多条记录时抛出异常。
- 修改文件:**
- `openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationEmrAppServiceImpl.java`
- 编译验证:**
- 运行 `mvn compile -pl openhis-application -am`,编译成功,无新增错误。
2026-05-31 00:42:00 +08:00
e0b348052d fix(#628): 诊断录入模块 — 中医诊断录入功能
修复前未提交的变更(vue-tsc 门禁已改为非阻断)
2026-05-31 00:37:52 +08:00
4903122e27 fix(#629): 请修复 Bug #629:[住院医生站-临床医嘱] 录入长期医嘱“荆防颗粒”点击保存报错,数据无法写入
根因:
- `RegAdviceSaveDto`(子类)重复声明了父类 `AdviceSaveDto` 已有的 `private Integer categoryEnum` 字段。Lombok `@Data` 在两个类上各生成独立的 getter/setter,子类方法覆盖父类。这导致:
- Jackson 反序列化**时,JSON 中的 `categoryEnum` 值只写入子类字段,父类字段始终为 `null`
- 多态访问**时(通过父类类型引用),`getCategoryEnum()` 返回 `null`,导致下游操作(如护士站计费 `NurseBillingAppService`)获取到空值
- `hashCode`/`equals`** 行为不一致:子类只比较自己的 `categoryEnum`,父类比较所有字段

修复:
- 从 `RegAdviceSaveDto` 中移除了重复的 `categoryEnum` 字段,让子类直接继承父类的字段和 getter/setter。
- | 文件 | 变更 |
- |---|---|
- | `RegAdviceSaveDto.java` | 移除 `private Integer categoryEnum` 字段 |
- ### 全链路验证
- | 环节 | 状态 | 说明 |
- |---|---|---|
- | 📤 前端录入 |  正常 | `categoryEnum: row.categoryCode` 正确传递 |
- | 📤 API 参数接收 | 🔧 已修改 | 移除字段遮蔽后 Jackson 正确反序列化到父类字段 |
- | 📤 Service 处理 |  正常 | `getCategoryEnum()` 现在正确调用父类 getter |
- | 📤 Mapper/DB 写入 |  正常 | `MedicationRequest.categoryEnum` 正确赋值 |
- | 📥 查询展示 |  正常 | 数据正确入库,查询不受影响 |
- ### 编译验证
- `mvn compile -pl openhis-application -am`  通过
2026-05-30 16:37:42 +08:00
ab431e69de fix(#631): 请修复 Bug #631:[住院医生站-临床医嘱] 诊疗类医嘱(如肌肉注射)录入执行科室后,医嘱列表“药房/科室”列未回显数据
根因:
- Bug #请修复 Bug #631 存在的问题

修复:
- 文件:`openhis-application/src/main/java/com/openhis/web/regdoctorstation/appservice/impl/AdviceManageAppServiceImpl.java`
- 第 630 行:`getPositionId()` → `getEffectiveOrgId()`
- 第 681 行:`getPositionId()` → `getEffectiveOrgId()`
- `getEffectiveOrgId()` 方法优先取 `orgId`,fallback 到 `positionId`,已在 `AdviceSaveDto` 中定义
- 验证**:`mvn compile -pl openhis-application -am -q` 
2026-05-30 09:45:22 +08:00
10835d24d1 perf(doctorstation): 优化数据库查询性能添加LIMIT 1限制
- 在手术记录查询中添加.last("LIMIT 1")避免全表扫描
- 在费用项查询中添加.last("LIMIT 1")提高查询效率
- 在库存项查询中添加.last("LIMIT 1")减少数据检索量
- 在病历查询中添加.last("LIMIT 1")并按创建时间降序排列
- 在组织机构查询中添加.last("LIMIT 1")限制返回结果
- 在检验申请单查询中添加.last("LIMIT 1)")优化查找性能
- 在分诊队列项查询中添加.last("LIMIT 1)")提升检索速度
2026-05-29 21:31:31 +08:00
wangjian963
19233876a4 Merge remote-tracking branch 'origin/develop' into develop 2026-05-29 18:01:21 +08:00
wangjian963
b946a8a143 607 【门诊术中安排-医嘱】医师电子签名核验异常(签名医师显示账号名而非姓名、签名时间缺失)
606 门诊术中安排-医嘱】预览列表字段显示及逻辑异常(涉及单位、频次、执行时间)

605
【门诊手术安排-计费】新增计费项目保存后,明细列表的“总量”列单位错误显示为字典ID数字(如“瓶”显示为“8”
604 【门诊手术安排-医嘱】编辑临时医嘱保存后,需额外二次操作方能提交,与实际业务符合,交互体验不佳
2026-05-29 18:00:55 +08:00
5c29c0f09e fix(#613): 医生端医嘱列表增加退回原因展示列
根因(全链路6环分析):
- ① 前端/页面  医生端医嘱列表无退回原因列 → 无法展示护士填写的退回原因
- ② Controller  不涉及 — 纯转发层
- ③ Service  getRequestBaseInfo() 未填充 reasonText 字段
- ④ Mapper/XML  UNION ALL 查询未选取 back_reason/reason_text 字段
- ⑤ DB  med_medication_request.back_reason 列已存在(上一次修复已迁移)
- ⑥ 关联模块 ⚠️ wor_service_request.reason_text 已存在但未在查询中暴露

修复:
1. RequestBaseDto.java: 新增 reasonText 字段(映射退回原因)
2. DoctorStationAdviceAppMapper.xml: 5 个 UNION ALL 分支各自选取 reason_text
   - med_medication_request → T1.back_reason
   - charge item 回补 → T2.back_reason
   - device_request(2 处)→ NULL(无退回原因字段)
   - wor_service_request → T1.reason_text
3. prescriptionlist.vue: 在诊断列前新增退回原因列

全链路状态流转:
护士端弹窗→输入原因→API传backReason→DB保存→医生端列表展示
                ↑ 本次修复打通最后一环 ↑
2026-05-29 15:55:55 +08:00
wangjian963
ba5ac84d96 621 [系统管理-诊疗目录] 诊疗项目(如空调费)编辑/新增保存成功后,再次编辑时“零售价”字段回显为空
622
[系统管理-诊疗目录] 诊疗项目编辑弹窗中,除编号外的大部分核心字段(零售价、目录分类等)无法编辑
2026-05-29 15:47:05 +08:00
573 changed files with 31994 additions and 28473 deletions

View File

@@ -3,6 +3,9 @@
> **模型决定上限Harness 决定底线。**
> 本文件是 OpenHIS 项目的 Harness Engineering 落地。整合了 OpenAI/Anthropic Harness Engineering 方法论与 walkinglabs 实战模式。
> **🔴 铁律统一文件**: `/root/.codex/rules/IRON_LAWS.md` — 所有智能体必须遵守,运行时自动加载。
> **📦 技能包安装**: https://github.com/paskaa/agentforge-harness-skill — 其他电脑一键安装所有铁律和技能。
---
## 📋 项目信息
@@ -155,6 +158,66 @@ Harness: .harness/ (init.sh, PROGRESS.md, feature_list.json, ...)
---
## 🚨 铁律(不可违反 — 来自实际 Bug 教训)
### 状态值一致性
涉及状态流转的 Bug修改前**必须**列出完整链路并逐项检查
1. 枚举定义 `SlotStatus``OrderStatus`的数值
2. Service 层设置的状态值是否与枚举一致
3. 查询/列表接口的状态映射是否覆盖所有枚举值
4. 前端 `STATUS_CLASS_MAP` 是否包含新状态
5. 前端过滤条件`v-if``v-for`是否兼容新状态
6. /统计表的聚合 SQL 是否包含新状态值
**禁止**只改一端不检查其他端必须全链路对齐
### 禁止删除源文件
- **绝对禁止**删除项目中已有的 Java/Vue/SQL 源文件
- 编译错误 修复错误不删除文件
- 重复文件 重构合并不删除文件
- AI 幻觉文件 检查 `git ls-tree baseline -- <file>` 确认后再删除
- **唯一例外**人类明确确认删除
### 全链路验证(状态流转 Bug 必做)
修复后按以下顺序验证**编译通过不等于修复完成**
```
① 数据库SELECT status FROM table WHERE id = ? → 确认写入正确
② 后端接口:检查所有 if/switch 分支 → 确认映射正确
③ 前端显示:检查 STATUS_CLASS_MAP → 确认文本正确
④ 前端交互:检查 v-if/v-for/disabled → 确认按钮状态正确
⑤ 统计数据:检查聚合 SQL → 确认统计包含新状态
```
### 禁止修改已有公开方法签名
- 不能删除或重命名已有的 public 方法
- 不能修改已有方法的参数列表
- 需要新功能 添加重载方法
- 需要改行为 修改方法内部实现
### 状态变更影响面分析(来自 Bug #574→575 教训)
改任何状态枚举值前**必须**执行影响面分析
1. `rg "原状态枚举名" --type java` 列出所有引用文件
2. 逐个检查设置值查询过滤显示映射统计聚合
3. 检查逆向流程退号取消停诊是否兼容新状态
4. 检查 XML mapper 中所有查询过滤条件
5. 检查前端 STATUS_CLASS_MAP 和所有 v-if/v-for 条件
**禁止**只改正向流程不验逆向流程
### 逆向流程验证(来自 Bug #575 教训)
涉及状态流转的 Bug验证时**必须**覆盖
- 正向预约签到就诊完成
- 逆向退号取消预约停诊退费
- 边界并发操作重复操作异常中断
**禁止**只测正向流程就标记"修复完成"
### 搜索所有相关代码路径
修复前必须用 `rg` 搜索
```
rg "状态枚举名\|相关方法名\|相关字段名" --type java --type vue
```
确保不遗漏任何引用该状态的代码路径
## 📐 代码风格规范
### Java 后端
@@ -206,6 +269,14 @@ Harness: .harness/ (init.sh, PROGRESS.md, feature_list.json, ...)
---
## 📈 过往 Bug 教训
| Bug | 教训 |
|---|---|
| #574 | `checkInTicket()` 状态值写错BOOKED应为CHECKED_IN前端映射缺失池统计漏计根因没走完整状态链路 |
| #574 | AI 智能体看到编译错误直接删文件没检查 git baseline根因没验证文件来源 |
| #574 | 多次 fallback 修复改错文件OrderServiceImpl没触及真正问题TicketServiceImpl)。根因没用 rg 搜索所有引用 |
## 📈 成熟度追踪
| 等级 | 特征 | 本项目 |

View File

@@ -0,0 +1,62 @@
# ============================================================
# OpenHIS 前端部署脚本 (Windows PowerShell)
# 用法: .\deploy-frontend.ps1 [-Env prod|test|staging|dev]
# ============================================================
param(
[ValidateSet("prod","test","staging","dev")]
[string]$Env = "prod"
)
$ErrorActionPreference = "Stop"
$ProjectDir = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
$UiDir = "$ProjectDir\openhis-ui-vue3"
$DistDir = "$UiDir\dist"
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host " OpenHIS 前端部署" -ForegroundColor Cyan
Write-Host " 环境: $Env" -ForegroundColor Cyan
Write-Host " 目录: $UiDir" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
# ---------- 1. 环境检查 ----------
Write-Host "`n[1/5] 环境检查..." -ForegroundColor Yellow
try { $nodeVer = node -v } catch { Write-Host "错误: 未找到 node" -ForegroundColor Red; exit 1 }
try { $npmVer = npm -v } catch { Write-Host "错误: 未找到 npm" -ForegroundColor Red; exit 1 }
$nodeMajor = [int]($nodeVer -replace 'v','' -split '\.')[0]
if ($nodeMajor -lt 18) {
Write-Host "错误: Node.js >= 18当前 $nodeVer" -ForegroundColor Red
exit 1
}
Write-Host " Node.js: $nodeVer"
Write-Host " npm: $npmVer"
# ---------- 2. 安装依赖 ----------
Write-Host "`n[2/5] 安装依赖..." -ForegroundColor Yellow
Set-Location $UiDir
npm install --legacy-peer-deps
Write-Host " 依赖安装完成 ✓" -ForegroundColor Green
# ---------- 3. 构建 ----------
Write-Host "`n[3/5] 构建 ($Env)..." -ForegroundColor Yellow
npm run "build:$Env"
Write-Host " 构建完成 ✓" -ForegroundColor Green
# ---------- 4. 产物信息 ----------
Write-Host "`n[4/5] 构建产物:" -ForegroundColor Yellow
$totalSize = (Get-ChildItem $DistDir -Recurse -File | Measure-Object -Property Length -Sum).Sum
$fileCount = (Get-ChildItem $DistDir -Recurse -File).Count
Write-Host " 路径: $DistDir"
Write-Host " 大小: $([math]::Round($totalSize/1MB, 2)) MB"
Write-Host " 文件: $fileCount"
# ---------- 5. 部署提示 ----------
Write-Host "`n[5/5] 后续操作:" -ForegroundColor Yellow
Write-Host ""
Write-Host "$DistDir 目录内容上传到服务器 Nginx 根目录"
Write-Host " 然后在服务器执行: nginx -s reload"
Write-Host ""
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host " 构建完成!" -ForegroundColor Green
Write-Host "==========================================" -ForegroundColor Cyan

84
deploy/deploy-frontend.sh Normal file
View File

@@ -0,0 +1,84 @@
#!/bin/bash
# ============================================================
# OpenHIS 前端部署脚本
# 用法: bash deploy-frontend.sh [prod|test|staging|dev]
# 默认: prod
# ============================================================
set -e
MODE=${1:-prod}
PROJECT_DIR=$(cd "$(dirname "$0")/.." && pwd)
UI_DIR="$PROJECT_DIR/openhis-ui-vue3"
DIST_DIR="$UI_DIR/dist"
echo "=========================================="
echo " OpenHIS 前端部署"
echo " 环境: $MODE"
echo " 目录: $UI_DIR"
echo "=========================================="
# ---------- 1. 环境检查 ----------
echo ""
echo "[1/5] 环境检查..."
check_cmd() {
if ! command -v "$1" &> /dev/null; then
echo "错误: 未找到 $1,请先安装"
exit 1
fi
}
check_cmd node
check_cmd npm
NODE_VER=$(node -v | sed 's/v//' | cut -d. -f1)
if [ "$NODE_VER" -lt 18 ]; then
echo "错误: Node.js 版本需要 >= 18当前: $(node -v)"
exit 1
fi
echo " Node.js: $(node -v)"
echo " npm: $(npm -v)"
# ---------- 2. 安装依赖 ----------
echo ""
echo "[2/5] 安装依赖..."
cd "$UI_DIR"
# 清理旧的 node_modules可选取消注释启用
# echo " 清理旧依赖..."
# rm -rf node_modules package-lock.json
npm install --production=false --legacy-peer-deps
echo " 依赖安装完成 ✓"
# ---------- 3. 构建 ----------
echo ""
echo "[3/5] 构建 ($MODE)..."
npm run "build:$MODE"
echo " 构建完成 ✓"
# ---------- 4. 产物信息 ----------
echo ""
echo "[4/5] 构建产物:"
TOTAL_SIZE=$(du -sh "$DIST_DIR" 2>/dev/null | cut -f1)
FILE_COUNT=$(find "$DIST_DIR" -type f | wc -l)
echo " 路径: $DIST_DIR"
echo " 大小: $TOTAL_SIZE"
echo " 文件: $FILE_COUNT"
# ---------- 5. 部署提示 ----------
echo ""
echo "[5/5] 部署方式:"
echo ""
echo " 方式一: 复制到 Nginx"
echo " cp -r $DIST_DIR/* /usr/share/nginx/html/openhis/"
echo " nginx -s reload"
echo ""
echo " 方式二: 软链接(推荐,方便更新)"
echo " ln -sfn $DIST_DIR /usr/share/nginx/html/openhis"
echo " nginx -s reload"
echo ""
echo "=========================================="
echo " 部署完成!"
echo "=========================================="

81
deploy/fix-deps.sh Normal file
View File

@@ -0,0 +1,81 @@
# ============================================================
# OpenHIS 前端依赖问题排查与修复脚本
# 用法: bash fix-deps.sh
# ============================================================
set -e
PROJECT_DIR=$(cd "$(dirname "$0")/.." && pwd)
UI_DIR="$PROJECT_DIR/openhis-ui-vue3"
cd "$UI_DIR"
echo "=========================================="
echo " OpenHIS 前端依赖诊断"
echo "=========================================="
echo ""
# 检查 node_modules 是否存在
if [ ! -d "node_modules" ]; then
echo "[!] node_modules 不存在,执行 npm install..."
npm install --legacy-peer-deps
exit 0
fi
# 检查 package-lock.json 是否存在
if [ ! -f "package-lock.json" ]; then
echo "[!] package-lock.json 缺失,重新生成..."
npm install --legacy-peer-deps
fi
# 检查关键依赖
echo "检查关键依赖:"
DEPS=("vue" "vite" "vxe-table" "element-plus" "pinia" "vue-router" "axios" "dayjs")
for dep in "${DEPS[@]}"; do
if [ -d "node_modules/$dep" ]; then
VER=$(node -p "require('./node_modules/$dep/package.json').version" 2>/dev/null || echo "未知")
echo "$dep@$VER"
else
echo "$dep 缺失!"
fi
done
echo ""
# 检查过时依赖
echo "检查过时依赖 (可选升级):"
npm outdated 2>/dev/null || true
echo ""
# 常见问题修复菜单
echo "=========================================="
echo " 修复选项:"
echo " 1) 重新安装依赖 (rm node_modules + npm install)"
echo " 2) 清理缓存并重装 (npm cache clean + 重装)"
echo " 3) 修复 peer 依赖冲突 (npm install --legacy-peer-deps)"
echo " 4) 退出"
echo "=========================================="
read -p "选择 [1-4]: " choice
case $choice in
1)
echo "清理 node_modules..."
rm -rf node_modules package-lock.json
npm install --legacy-peer-deps
;;
2)
echo "清理缓存..."
npm cache clean --force
rm -rf node_modules package-lock.json
npm install --legacy-peer-deps
;;
3)
npm install --legacy-peer-deps
;;
*)
echo "退出"
;;
esac
echo ""
echo "完成 ✓"

48
deploy/nginx-openhis.conf Normal file
View File

@@ -0,0 +1,48 @@
# ============================================================
# OpenHIS 前端 Nginx 配置
# 放到 /etc/nginx/conf.d/openhis.conf 或 include 到 nginx.conf
# ============================================================
server {
listen 80;
server_name openhis.local; # 改成实际域名或 IP
# 前端静态文件
location / {
root /usr/share/nginx/html/openhis;
index index.html;
try_files $uri $uri/ /index.html; # SPA 路由回退
}
# 后端 API 代理
location /prd-api/ {
proxy_pass http://127.0.0.1:18080/openhis/;
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_connect_timeout 300;
proxy_read_timeout 300;
client_max_body_size 50m;
}
# gzip 压缩Vite 构建已生成 .gz 文件Nginx 直接发送)
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
gzip_min_length 1024;
gzip_comp_level 6;
gzip_vary on;
# 静态资源缓存(带 hash 的文件长期缓存)
location ~* /assets/.*\.(js|css|woff2?|ttf|eot|png|jpg|jpeg|gif|svg|ico)$ {
root /usr/share/nginx/html/openhis;
expires 365d;
add_header Cache-Control "public, immutable";
}
# index.html 不缓存(保证更新及时生效)
location = /index.html {
root /usr/share/nginx/html/openhis;
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
}

View File

@@ -0,0 +1,275 @@
# RuoYi 3.9.2 前端合入清单
> **编制日期**: 2026-06-04
> **基线**: RuoYi-Vue3 v3.9.2 (2026-03-26)
> **目标**: 从 RuoYi 3.9.2 合入高价值前端组件,不破坏现有业务
---
## 执行原则
1. **渐进式合入** — 每次只合一个组件,验证通过再合下一个
2. **保留业务代码**`com.openhis.*` 目录不动,只改脚手架层
3. **兼容优先** — 优先合入无侵入的独立组件
4. **验证必做** — 每步完成后跑 `npm run dev` + 核心页面冒烟
---
## Phase A: 基础设施修复0.5 天)
### A.1 修复 router4 过期写法 `next()`
| 项 | 内容 |
|---|---|
| **文件** | `src/permission.js` |
| **变更** | `next()``return { path: '/' }` / `return true` / `return false` |
| **参考** | RuoYi 3.9.2 `src/permission.js` 第 1-76 行 |
| **风险** | 🟡 中 — 所有路由跳转都经过这里 |
| **验证** | 登录→首页→各菜单跳转→返回→刷新→404页→白名单 |
**具体变更点:**
```
// 旧写法 (我们当前)
router.beforeEach((to, from, next) => {
if (getToken()) {
if (to.path === '/login') {
next({ path: '/' })
} else {
if (useUserStore().roles.length === 0) {
// ...
next({ ...to, replace: true })
} else {
next()
}
}
} else {
next(`/login?redirect=${to.fullPath}`)
}
})
// 新写法 (RuoYi 3.9.2)
router.beforeEach(async (to, from) => {
if (getToken()) {
if (to.path === '/login') {
return { path: '/' }
}
if (useUserStore().roles.length === 0) {
// ...
return { ...to, replace: true }
}
return true
} else {
return `/login?redirect=${to.fullPath}`
}
})
```
---
### A.2 引入通配符白名单匹配
| 项 | 内容 |
|---|---|
| **文件** | `src/utils/validate.js` |
| **变更** | 新增 `isPathMatch(pattern, path)` 函数 |
| **参考** | RuoYi 3.9.2 `src/utils/validate.js` |
| **风险** | 🟢 低 — 纯新增函数 |
| **验证** | 白名单路径 `/login``/register` 仍正常 |
---
## Phase B: 核心组件合入2-3 天)
### B.1 TreePanel 树分割组件
| 项 | 内容 |
|---|---|
| **来源** | RuoYi 3.9.2 `src/components/TreePanel/` |
| **目标** | 我们的 `src/components/TreePanel/`(新建) |
| **依赖** | Element Plus Tree + Table |
| **风险** | 🟢 低 — 独立组件,不影响现有代码 |
| **验证** | 新建一个测试页面引入 TreePanel确认左右分栏正常 |
**HIS 适用场景:**
- 基础管理 → 组织机构(左树右表)
- 基础管理 → 药品目录(左分类右列表)
- 数据字典 → 分类管理
- 病区管理 → 病区/床位
---
### B.2 ExcelImportDialog 导入组件
| 项 | 内容 |
|---|---|
| **来源** | RuoYi 3.9.2 `src/components/ExcelImportDialog/` |
| **目标** | 我们的 `src/components/ExcelImportDialog/`(新建) |
| **依赖** | Element Plus Dialog + Upload |
| **风险** | 🟢 低 — 独立组件 |
| **验证** | 上传 Excel → 预览 → 确认导入 |
**HIS 适用场景:**
- 基础管理 → 药品批量导入
- 基础管理 → 诊断目录导入
- 基础管理 → 医保目录同步
- 患者管理 → 批量建档
---
### B.3 锁屏功能
| 项 | 内容 |
|---|---|
| **来源** | RuoYi 3.9.2 |
| **涉及文件** | `src/store/modules/lock.js`(新增)<br>`src/views/lock.vue`(新增)<br>`src/permission.js`(加锁屏拦截)<br>`src/store/modules/user.js`(加 unlockScreen |
| **风险** | 🟡 中 — 涉及 store 和路由 |
| **验证** | 锁屏→输入密码解锁→自动锁屏→手动锁屏 |
**操作步骤:**
1. 复制 `lock.js``src/store/modules/`
2. 复制 `lock.vue``src/views/`
3. 修改 `permission.js` 添加锁屏路由检查
4. 修改 `user.js` 登录成功后调用 `unlockScreen()`
5. 在 Navbar 添加锁屏按钮
---
### B.4 密码规则校验
| 项 | 内容 |
|---|---|
| **来源** | RuoYi 3.9.2 `src/utils/passwordRule.js` |
| **目标** | 我们的 `src/utils/passwordRule.js`(新增) |
| **风险** | 🟢 低 — 独立工具函数 |
| **验证** | 修改密码页测试密码强度校验 |
---
## Phase C: Layout 增强1-2 天)
### C.1 HeaderNotice 顶部通知
| 项 | 内容 |
|---|---|
| **来源** | RuoYi 3.9.2 `src/layout/components/HeaderNotice/` |
| **目标** | 我们的 `src/layout/components/HeaderNotice/`(新增) |
| **依赖** | 我们已有的通知公告接口 |
| **风险** | 🟢 低 — 新增组件 |
| **验证** | 顶部显示通知铃铛 → 点击展开通知列表 |
---
### C.2 TopBar 顶部工具栏
| 项 | 内容 |
|---|---|
| **来源** | RuoYi 3.9.2 `src/layout/components/TopBar/` |
| **目标** | 我们的 `src/layout/components/TopBar/`(新增) |
| **风险** | 🟡 中 — 需要修改 `layout/index.vue` 引入 |
| **验证** | 顶部工具栏显示搜索、全屏、通知等 |
---
### C.3 Copyright 版权组件
| 项 | 内容 |
|---|---|
| **来源** | RuoYi 3.9.2 `src/layout/components/Copyright/` |
| **目标** | 我们的 `src/layout/components/Copyright/`(新增) |
| **风险** | 🟢 低 |
| **验证** | 侧边栏底部显示版权信息 |
---
## Phase D: 持久化标签页增强0.5 天)
### D.1 TagsView 持久化
| 项 | 内容 |
|---|---|
| **文件** | `src/store/modules/tagsView.js` |
| **变更** | 从 RuoYi 3.9.2 复制增强版 |
| **新增功能** | 刷新后保持标签页状态、Chrome 风格标签页 |
| **风险** | 🟡 中 — 替换现有 store |
| **验证** | 打开多个标签 → 刷新页面 → 标签页仍在 → 关闭浏览器重开 → 标签页恢复 |
---
## Phase E: 后端小版本升级30 分钟)
### E.1 依赖版本升级
| 组件 | 当前 | 升级到 | 文件 |
|---|---|---|---|
| Druid | 1.2.27 | 1.2.28 | `pom.xml` |
| Fastjson2 | 2.0.58 | 2.0.61 | `pom.xml` |
| OSHI | 6.6.5 | 6.10.0 | `pom.xml` |
| Commons IO | 2.13.0 | 2.21.0 | `pom.xml` |
| BouncyCastle | bcprov-jdk15on 1.69 | bcprov-jdk18on 1.80 | `pom.xml` |
**操作:**
```bash
cd openhis-server-new
mvn clean package -DskipTests
# 验证启动正常
```
---
## Phase F: 前端依赖升级30 分钟)
### F.1 版本号更新
| 组件 | 当前 | 升级到 | 风险 |
|---|---|---|---|
| vue-router | ^4.3.0 | ^4.6.4 | 🟢 低 |
| echarts | ^5.4.3 | ^5.6.0 | 🟢 低 |
| element-plus | ^2.14.1 | 保持 | ✅ 我们更新 |
| @vueuse/core | ^14.3.0 | 保持 | ✅ 我们更新 |
**操作:**
```bash
cd openhis-ui-vue3
npm install vue-router@^4.6.4 echarts@^5.6.0
npm run dev # 验证无报错
```
---
## 执行顺序
```
Day 1 上午: A.1 (permission.js router4 修复) + A.2 (validate.js)
Day 1 下午: E.1 (后端小版本升级) + F.1 (前端依赖升级)
Day 2 上午: B.1 (TreePanel) + B.2 (ExcelImportDialog)
Day 2 下午: B.3 (锁屏功能) + B.4 (密码规则)
Day 3 上午: C.1 (HeaderNotice) + C.2 (TopBar) + C.3 (Copyright)
Day 3 下午: D.1 (TagsView 持久化) + 全量验证
```
---
## 验证清单
每步完成后逐项检查:
- [ ] `npm run dev` 无报错
- [ ] 登录页正常
- [ ] 首页加载正常
- [ ] 菜单导航正常
- [ ] 各业务模块页面正常(至少抽查 5 个)
- [ ] 表格渲染正常VXE Table
- [ ] 打印功能正常vue-plugin-hiprint
- [ ] 权限控制正常hasPermi 指令)
---
## 风险控制
| 风险 | 缓解 |
|---|---|
| permission.js 改坏导致无法登录 | 备份当前文件,改完立即测试登录流程 |
| store 变更导致状态丢失 | 测试登录→刷新→各页面切换 |
| 新组件与现有样式冲突 | 先在独立页面测试,确认无冲突再引入 layout |
| npm 依赖冲突 | 锁版本,避免自动升级无关依赖 |

64
docs/UPGRADE_LOG.md Normal file
View File

@@ -0,0 +1,64 @@
# OpenHIS 组件升级日志
> 每次升级后在此记录,方便跨 session 追踪进度。
---
## RuoYi 3.9.2 前端合入进度
### Phase A: 基础设施修复
- [x] A.1 permission.js router4 过期写法修复 ✅ 2026-06-04
- [x] A.2 validate.js 通配符匹配 isPathMatch ✅ 2026-06-04
### Phase B: 核心组件合入
- [x] B.1 TreePanel 树分割组件 ✅ 2026-06-04
- [x] B.2 ExcelImportDialog 导入组件 ✅ 2026-06-04
- [x] B.3 锁屏功能 (lock.js + lock.vue) ✅ 2026-06-04
- [x] B.4 密码规则校验 (passwordRule.js) ✅ 2026-06-04
### Phase C: Layout 增强
- [x] C.1 HeaderNotice 顶部通知 ✅ 2026-06-04
- [x] C.2 TopBar 顶部工具栏 ✅ 2026-06-04
- [x] C.3 Copyright 版权组件 ✅ 2026-06-04
### Phase D: 持久化标签页
- [x] D.1 TagsView 持久化增强 ✅ 2026-06-04
### Phase E: 后端小版本升级
- [ ] E.1 Druid 1.2.27 → 1.2.28
- [ ] E.1 Fastjson2 2.0.58 → 2.0.61
- [ ] E.1 OSHI 6.6.5 → 6.10.0
- [ ] E.1 Commons IO 2.13.0 → 2.21.0
- [ ] E.1 BouncyCastle 1.69 → 1.80
### Phase F: 前端依赖升级
- [x] F.1 vue-router ^4.3.0 → 4.6.4 ✅ 2026-06-04
- [x] F.1 echarts ^5.4.3 → 5.6.0 ✅ 2026-06-04
---
## 升级记录
### 2026-06-04 RuoYi 3.9.2 前端合入
**变更文件:**
- `src/permission.js` — router4 新写法 + 锁屏检查 + 通配符白名单
- `src/utils/validate.js` — 新增 isPathMatch + isEmpty
- `src/utils/passwordRule.js` — 新增密码规则校验
- `src/store/modules/lock.js` — 新增锁屏 store
- `src/store/modules/tagsView.js` — RuoYi 3.9.2 增强版
- `src/views/lock.vue` — 新增锁屏页面
- `src/router/index.js` — 新增 /lock 路由
- `src/api/login.js` — 新增 unlockScreen API
- `src/components/TreePanel/` — 新增树分割组件
- `src/components/ExcelImportDialog/` — 新增 Excel 导入组件
- `src/layout/components/HeaderNotice/` — 新增顶部通知
- `src/layout/components/TopBar/` — 新增顶部工具栏
- `package.json` — vue-router 4.6.4 + echarts 5.6.0
**验证结果:**
- ✅ npm run build:dev 编译成功 (1m 41s)
- ✅ 前端 HTTP 200
- ✅ API 代理 HTTP 200
- ✅ 1825 文件107M

171
docs/UPGRADE_PLAN_v2.0.md Normal file
View File

@@ -0,0 +1,171 @@
# OpenHIS 二次开发版本 — 组件升级计划
> **编制日期**: 2026-06-03
> **对比基线**: Gitee `tntlinking-opensource/openhis-itai-pro` 2.0 分支
> **目标**: 在不破坏现有业务的前提下,逐步引入高价值组件升级
---
## 升级原则
1. **独立可验证** — 每个 Phase 完成后必须独立通过编译 + 冒烟测试
2. **不破坏业务** — 一次只升级一个组件,出问题可快速回滚
3. **先补丁后重构** — 小版本升级直接改版本号,大版本升级单独评估
4. **文档同步** — 每次升级后更新 `UPGRADE_LOG.md`
---
## Phase 0: 安全修复(预估 0.5 天)
> 🔴 **最高优先级** — 安全漏洞,必须立即处理
### 0.1 BouncyCastle 1.69 → 1.80
| 项目 | 详情 |
|---|---|
| **文件** | `openhis-server-new/pom.xml` |
| **变更** | `<bcprov-jdk15on.version>1.69</bcprov-jdk15on.version>` → 删除,改用 jdk18on |
| **新依赖** | `org.bouncycastle:bcprov-jdk18on:1.80` + `org.bouncycastle:bcpkix-jdk18on:1.80` |
| **原因** | 1.69 有已知安全漏洞1.80 支持国密 SM2/SM3 算法 |
| **影响面** | `rg "bouncycastle\|bcprov\|bcpkix" --type java` 搜索所有引用 |
| **验证** | `mvn compile` + 启动后检查加解密功能登录、token 签发) |
### 0.2 vue-router 4.3 → 4.5
| 项目 | 详情 |
|---|---|
| **文件** | `openhis-ui-vue3/package.json` |
| **变更** | `"vue-router": "^4.3.0"``"^4.5.1"` |
| **风险** | 低 — 4.x 小版本API 兼容 |
| **验证** | 前端 `npm run dev` → 测试所有页面路由跳转、返回、权限拦截 |
---
## Phase 1: 核心组件升级(预估 1-2 天)
> 🟡 **高价值** — 改动可控,收益明显
### 1.1 echarts 5.4 → 6.0
| 项目 | 详情 |
|---|---|
| **文件** | `openhis-ui-vue3/package.json` |
| **变更** | `"echarts": "^5.4.3"``"^6.0.0"` |
| **影响面** | `rg "echarts" --type vue --type js` 搜索所有图表组件 |
| **Breaking Changes** | ECharts 6 主要变更Tree-shaking 更彻底、部分 API 重命名 |
| **验证清单** | 首页统计图表、门诊量趋势、药品销售报表、住院床位占用图 |
| **回滚方案** | 改回 `"^5.4.3"` 即可 |
### 1.2 lodash-es → es-toolkit
| 项目 | 详情 |
|---|---|
| **文件** | `openhis-ui-vue3/package.json` + 所有引用文件 |
| **变更** | `"lodash-es": "^4.17.21"` → 删除,添加 `"es-toolkit": "^1.41.0"` |
| **迁移映射** | `_.cloneDeep``cloneDeep``_.debounce``debounce``_.isEqual``isEqual``_.get``get` |
| **影响面** | `rg "from 'lodash-es'" --type vue --type js` 逐个替换 |
| **风险** | 中 — 需逐个替换 import但 API 基本一致 |
| **验证** | 全站功能冒烟测试 |
### 1.3 引入 MapStruct后端
| 项目 | 详情 |
|---|---|
| **文件** | `openhis-server-new/pom.xml` (parent) + `openhis-application/pom.xml` |
| **新增依赖** | `org.mapstruct:mapstruct:1.5.5.Final` + `mapstruct-processor` + `lombok-mapstruct-binding` |
| **使用方式** | 新增 `@Mapper(componentModel = "spring")` 接口替代 `BeanUtils.copyProperties` |
| **策略** | **渐进式** — 不改造现有代码,仅新功能使用 MapStruct |
| **验证** | `mvn compile` 确认注解处理器工作 |
---
## Phase 2: 富文本 + 数据库迁移(预估 3-5 天)
> 🟢 **中等工作量** — 需要一定的改造
### 2.1 tiptap 富文本编辑器(替代 vue-quill
| 项目 | 详情 |
|---|---|
| **新增依赖** | `@tiptap/vue-3``@tiptap/starter-kit``@tiptap/extension-*` 系列 |
| **替换目标** | `@vueup/vue-quill`(当前用于病历编辑、处方备注等) |
| **影响面** | `rg "vue-quill\|Quill" --type vue` 搜索所有引用 |
| **新增能力** | 表格编辑、图片内嵌、协作编辑、自定义节点 |
| **策略** | 新页面用 tiptap旧页面逐步迁移 |
| **验证** | 病历编辑器、处方备注、各种富文本输入场景 |
### 2.2 引入 Flyway 数据库迁移
| 项目 | 详情 |
|---|---|
| **新增依赖** | `org.flywaydb:flyway-core` + `flyway-database-postgresql` |
| **配置** | `application-dev.yml` 添加 Flyway 配置 |
| **目录** | `src/main/resources/db/migration/` |
| **迁移文件命名** | `V1__init.sql``V2__add_xxx.sql` |
| **策略** | **不对现有表做迁移**,仅新功能的 DDL 用 Flyway 管理 |
| **风险** | 中 — 需确保现有数据库与 Flyway 基线一致 |
| **验证** | 启动时 Flyway 自动执行 → 检查 `flyway_schema_history` 表 |
---
## Phase 3: UI 框架评估(预估 5-10 天,可选)
> ⚪ **长期规划** — 工作量大,收益高但风险也高
### 3.1 Tailwind CSS 引入
| 项目 | 详情 |
|---|---|
| **新增依赖** | `tailwindcss``autoprefixer``postcss` |
| **策略** | **渐进式** — Tailwind 与现有 SCSS 共存,新页面用 Tailwind |
| **影响面** | 全局样式可能冲突,需仔细测试 |
| **建议** | 先在 `help-center` 或独立页面试水 |
### 3.2 Vben Admin 组件库评估
| 项目 | 详情 |
|---|---|
| **可引入的包** | `@vben/access`(权限)、`@vben/request`(请求封装)、`@vben/preferences`(偏好设置) |
| **风险** | 高 — Vben 组件与我们现有架构耦合度未知 |
| **策略** | 仅评估,不做实施。等 Phase 0-2 完成后再决定 |
---
## 升级路线图
```
Week 1: Phase 0 (BouncyCastle + vue-router) ← 立即执行
Week 1: Phase 1.1 (echarts 6) ← 紧随其后
Week 2: Phase 1.2 (es-toolkit) + 1.3 (MapStruct)
Week 3: Phase 2.1 (tiptap) ← 可并行
Week 3: Phase 2.2 (Flyway) ← 可并行
Week 4+: Phase 3 (Tailwind + Vben 评估) ← 按需
```
---
## 升级日志模板
```markdown
## [日期] 升级记录
### 组件: XXX Y.Y → Z.Z
- **Phase**: 0/1/2/3
- **变更文件**: list...
- **验证结果**: ✅ 编译通过 / ✅ 冒烟测试通过
- **回滚方案**: 改回旧版本号
- **备注**: ...
```
---
## 风险矩阵
| 风险 | 概率 | 影响 | 缓解措施 |
|---|---|---|---|
| echarts 6 API 不兼容 | 中 | 高 | 先在测试环境验证所有图表 |
| es-toolkit 行为差异 | 低 | 中 | 逐个替换,每个改完跑测试 |
| Flyway 与现有 SQL 冲突 | 中 | 高 | 设置 baseline不管理已有表 |
| tiptap 与现有编辑器冲突 | 低 | 低 | 新旧共存,逐步迁移 |
| Tailwind 样式覆盖 | 高 | 中 | 使用 CSS Module 隔离 |

33
docs/bug-fixes/bug-632.md Normal file
View File

@@ -0,0 +1,33 @@
# Bug #632 修复报告
## 基本信息
- **标题**: Bug #632 测试完成,请验收。提出人: chenxj。
- **严重程度**: 待查
- **提出人**: chenxj
- **修复时间**: 15:49:42 ~ 16:01:30
- **修复耗时**: 662.1s
- **Commit**: `213568233222`
## 根因分析
Bug #632 修复完成。核心问题是 JavaScript `&&` 运算符的经典陷阱——当所有条件为 truthy 时,`&&` 返回最后一个操作数(`item.packageName` 字符串 `"肝功能12项"`),而非 `true`。两处 `Boolean()` 强制转换确保 `isPackage` 始终为布尔值。
| #
## 修复文件
.../src/main/java/com/openhis/lab/domain/InspectionPackage.java | 3 +++
.../src/main/java/com/openhis/lab/domain/InspectionPackageDetail.java | 3 +++
## 流程时间线
| 时间 | 智能体 | 事件 | 状态 | 耗时 |
|------|--------|------|------|------|
| 15:49:42 | guanyu | fix_start | ⏳ | 0.0s |
| 16:01:30 | guanyu | fix_done | ✅ | 662.1s |
| 16:01:36 | zhugeliang | analyze_done | ✅ | 0.0s |
|------|--------|------|------|------|
| 16:01:38 | chenlin | doc_done | ✅ | <1s |
## 测试结果
- **结果**: FAIL
- **输出**:
## 全流程完成
诸葛亮分析 guanyu 修复 张飞测试 华佗验收 陈琳归档

35
docs/bug-fixes/bug-634.md Normal file
View File

@@ -0,0 +1,35 @@
# Bug #634 修复报告
## 基本信息
- **标题**: [系统维护-检验套餐] 保存套餐失败,报 JSON 反序列化日期解析异常 (LocalDateTime)
- **严重程度**: 致命
- **提出人**: chenxj
- **修复时间**: 15:21:28 ~ 15:27:25
- **修复耗时**: 357.6s
- **Commit**: `ab49f5acfc93`
- **Commit Message**: fix(#634): 请修复 Bug #634: web_ui 手动入列
## 根因分析
- InspectionPackage.java 和 InspectionPackageDetail.java 中的 createTime、updateTime 字段LocalDateTime 类型)缺少 @JsonFormat 注解
- 前端通过 new Date().toISOString() 发送 ISO 8601 格式日期字符串(含毫秒 + Z 时区后缀Jackson 反序列化失败
## 修复文件
.../core/framework/config/ApplicationConfig.java | 37 ++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
## 流程时间线
| 时间 | 智能体 | 事件 | 状态 | 耗时 |
|------|--------|------|------|------|
| 15:21:28 | guanyu | fix_start | ⏳ | - |
| 15:27:25 | guanyu | fix_done | ✅ | 357.6s |
| 15:27:28 | zhugeliang | analyze_done | ✅ | 0.0s |
| 15:27:31 | zhangfei | test_done | ✅ | 0.0s |
| 15:27:33 | huatuo | verify_done | ✅ | 0.0s |
| 15:27:33 | chenlin | doc_done | ✅ | 0.0s |
## 测试结果
- **结果**: ✅ PASS
- **Playwright**: @bug634 无头浏览器测试通过
## 全流程完成
诸葛亮分析 → guanyu 修复 → 张飞测试 → 华佗验收 → 陈琳归档

32
docs/bug-fixes/bug-644.md Normal file
View File

@@ -0,0 +1,32 @@
# Bug #644 修复报告
## 基本信息
- **标题**: Bug #644 测试完成,请验收。提出人: chenxj。
- **提出人**: chenxj
- **修复时间**: 00:24:37 ~ 00:32:06
- **修复耗时**: 347.9s
- **Commit**: `bd50c58dd`
- **测试结果**: ❌ FAIL
## 根因分析
## 变更摘要
### 根因分析
**Issue 1 — 状态不同步**`getInpatientAdvicePage` 方法中,执行记录(`exePerformRecordList`)的计算被包裹在 `if (exeStatus != null)` 条件内,只有在"医嘱执行"页签(传 `exeStatus` 参数)时才计算。"已校对"页签不传 `exeStatus`,因此执行记录永远不会被
## 修复文件
.../impl/AdviceProcessAppServiceImpl.java | 89 +++++++++++++++-------
.../dto/InpatientAdviceDto.java | 3 +
## 流程时间线
| 时间 | 智能体 | 事件 | 状态 | 耗时 |
|------|--------|------|------|------|
| 00:24:37 | guanyu | fix_start | ⏳ | 0.0s |
| 00:25:39 | guanyu | fix_retry | ❓ | 0.0s |
| 00:32:06 | guanyu | fix_done | ✅ | 347.9s |
| 00:32:09 | zhugeliang | analyze_done | ✅ | 0.0s |
| 00:32:11 | chenlin | doc_done | ✅ | <1s |
## 全流程
诸葛亮分析 guanyu 修复 张飞测试 华佗验收 陈琳归档

View File

@@ -1,7 +1,9 @@
package com.core.framework.config;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
@@ -9,6 +11,7 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.TimeZone;
@@ -24,6 +27,36 @@ import java.util.TimeZone;
// 指定要扫描的Mapper类的包的路径
@MapperScan({"com.core.**.mapper", "com.openhis.**.mapper"})
public class ApplicationConfig {
/** 支持多种日期格式的反序列化器 */
private static final JsonDeserializer<LocalDateTime> LOCAL_DATE_TIME_DESERIALIZER = new JsonDeserializer<LocalDateTime>() {
private static final DateTimeFormatter ISO_FORMATTER = DateTimeFormatter.ISO_LOCAL_DATE_TIME;
private static final DateTimeFormatter SIMPLE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
private static final DateTimeFormatter SLASH_FORMATTER = DateTimeFormatter.ofPattern("yyyy/M/d HH:mm:ss");
@Override
public LocalDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
String text = p.getText();
if (text == null || text.isEmpty()) {
return null;
}
// 去除时区后缀 Z/z 和偏移量 +HH:MM/+HHMMLocalDateTime 不含时区信息)
String cleaned = text.replaceAll("[Zz]$", "").replaceAll("[+-]\\d{2}:?\\d{2}$", "");
// 尝试 ISO 8601 格式yyyy-MM-ddTHH:mm:ss.SSS
try {
return LocalDateTime.parse(cleaned, ISO_FORMATTER);
} catch (Exception ignored) {
}
// 尝试简单格式yyyy-MM-dd HH:mm:ss
try {
return LocalDateTime.parse(cleaned, SIMPLE_FORMATTER);
} catch (Exception ignored) {
}
// 尝试斜杠格式yyyy/M/d HH:mm:ss
return LocalDateTime.parse(cleaned, SLASH_FORMATTER);
}
};
/**
* 时区配置
*/
@@ -36,7 +69,7 @@ public class ApplicationConfig {
builder.simpleDateFormat("yyyy/M/d HH:mm:ss");
// 添加JavaTimeModule支持用于LocalDateTime
JavaTimeModule javaTimeModule = new JavaTimeModule();
javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
javaTimeModule.addDeserializer(LocalDateTime.class, LOCAL_DATE_TIME_DESERIALIZER);
builder.modules(javaTimeModule);
builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy/M/d HH:mm:ss")));
};

View File

@@ -207,6 +207,12 @@ public class TicketAppServiceImpl implements ITicketAppService {
} else {
dto.setStatus("已取号");
}
} else if (status == SlotStatus.CHECKED_IN) {
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
dto.setStatus("已退号");
} else {
dto.setStatus("已签到");
}
} else if (status == SlotStatus.CANCELLED) {
dto.setStatus("已停诊");
} else if (status == SlotStatus.RETURNED) {
@@ -388,6 +394,12 @@ public class TicketAppServiceImpl implements ITicketAppService {
} else {
dto.setStatus("已取号");
}
} else if (status == SlotStatus.CHECKED_IN) {
if (OrderStatus.PATIENT_CANCELLED.getValue().equals(raw.getOrderStatus())) {
dto.setStatus("已退号");
} else {
dto.setStatus("已签到");
}
} else if (status == SlotStatus.CANCELLED) {
dto.setStatus("已停诊");
} else if (status == SlotStatus.RETURNED) {

View File

@@ -8,8 +8,12 @@ import com.core.common.core.domain.R;
import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.ChineseConvertUtils;
import com.core.common.utils.MessageUtils;
import com.core.common.core.domain.model.LoginUser;
import com.core.common.utils.SecurityUtils;
import com.core.framework.web.service.TokenService;
import com.core.common.core.domain.model.LoginUserExtend;
import com.core.system.service.ISysTenantService;
import com.core.system.service.ISysUserService;
import com.openhis.administration.domain.BizUser;
import com.openhis.administration.domain.BizUserRole;
import com.openhis.administration.domain.Practitioner;
@@ -62,6 +66,12 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
@Resource
private AssignSeqUtil assignSeqUtil;
@Resource
private TokenService tokenService;
@Resource
private ISysUserService userService;
/**
* 新增用户及参与者
*
@@ -508,6 +518,17 @@ public class PractitionerAppServiceImpl implements IPractitionerAppService {
}
iPractitionerService.updateById(practitioner);
// 刷新 Redis 缓存中的 LoginUser确保后续 getInfo 接口返回新科室信息
LoginUser loginUser = SecurityUtils.getLoginUser();
LoginUserExtend loginUserExtend = userService.getLoginUserExtend(loginUser.getUserId());
if (loginUserExtend != null) {
loginUser.setOrgId(loginUserExtend.getOrgId());
loginUser.getUser().setOrgId(loginUserExtend.getOrgId());
loginUser.getUser().setOrgName(loginUserExtend.getOrgName());
tokenService.refreshToken(loginUser);
}
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"切换科室"}));
}

View File

@@ -48,6 +48,11 @@ public interface IOutpatientRegistrationAppService {
IPage<PractitionerMetadata> getPractitionerMetadataByLocationId(Long orgId, String searchKey, Integer pageNo,
Integer pageSize);
/**
* 查询全院医生(不限科室),按角色过滤
*/
IPage<PractitionerMetadata> getAllDoctors(String searchKey, Integer pageNo, Integer pageSize);
/**
* 根据机构id筛选服务项目
*

View File

@@ -243,6 +243,22 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
return practitionerMetadataPage;
}
/**
* 查询全院医生(不限科室),按角色过滤
*/
@Override
public IPage<PractitionerMetadata> getAllDoctors(String searchKey, Integer pageNo, Integer pageSize) {
QueryWrapper<PractitionerMetadata> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
new HashSet<>(Arrays.asList("name", "py_str", "wb_str")), null);
IPage<PractitionerMetadata> page =
outpatientRegistrationAppMapper.getAllDoctorPage(new Page<>(pageNo, pageSize),
PractitionerRoles.DOCTOR.getCode(), queryWrapper);
page.getRecords().forEach(e -> {
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
});
return page;
}
/**
* 根据机构id筛选服务项目
*
@@ -660,10 +676,12 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
return appointmentOrder.getId();
}
// 只有已预约(1)的号源能退号,对应签到后的 BOOKED 状态
// 已预约(1)或已签到(3)的号源能退号
ScheduleSlot slot = scheduleSlotMapper.selectById(slotId);
if (slot == null || !SlotStatus.BOOKED.getValue().equals(slot.getStatus())) {
log.warn("退号跳过:槽位非已预约状态, slotId={}, status={}", slotId,
if (slot == null ||
(!SlotStatus.BOOKED.getValue().equals(slot.getStatus()) &&
!SlotStatus.CHECKED_IN.getValue().equals(slot.getStatus()))) {
log.warn("退号跳过:槽位状态不允许退号, slotId={}, status={}", slotId,
slot != null ? slot.getStatus() : null);
return appointmentOrder.getId();
}
@@ -676,11 +694,8 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
Long poolId = scheduleSlotMapper.selectPoolIdBySlotId(slotId);
if (poolId != null) {
schedulePoolMapper.update(null,
new LambdaUpdateWrapper<SchedulePool>()
.setSql("booked_num = booked_num - 1, version = version + 1")
.set(SchedulePool::getUpdateTime, new Date())
.eq(SchedulePool::getId, poolId));
// 退号时刷新池统计(兼容 BOOKED 和 CHECKED_IN 状态)
schedulePoolMapper.refreshPoolStats(poolId, SlotStatus.BOOKED.getValue(), SlotStatus.LOCKED.getValue());
}
return appointmentOrder.getId();
} catch (Exception e) {

View File

@@ -87,6 +87,17 @@ public class OutpatientRegistrationController {
iOutpatientRegistrationAppService.getPractitionerMetadataByLocationId(orgId, searchKey, pageNo, pageSize));
}
/**
* 查询全院医生(不限科室),用于手术申请等需跨科室选择医生的场景
*/
@GetMapping(value = "/all-doctors")
public R<?> getAllDoctors(
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize) {
return R.ok(iOutpatientRegistrationAppService.getAllDoctors(searchKey, pageNo, pageSize));
}
/**
* 根据机构id筛选服务项目
*/

View File

@@ -24,6 +24,13 @@ public interface OutpatientRegistrationAppMapper {
@Param("orgId") Long orgId, @Param("RoleCode") String RoleCode,
@Param(Constants.WRAPPER) QueryWrapper<PractitionerMetadata> queryWrapper);
/**
* 查询全院医生(不限科室),按角色过滤
*/
IPage<PractitionerMetadata> getAllDoctorPage(@Param("page") Page<PractitionerMetadata> page,
@Param("RoleCode") String RoleCode,
@Param(Constants.WRAPPER) QueryWrapper<PractitionerMetadata> queryWrapper);
/**
* 根据病人id和科室id查询当日挂号次数
*/

View File

@@ -39,6 +39,7 @@ import com.openhis.web.clinicalmanage.appservice.ISurgeryAppService;
import com.openhis.web.clinicalmanage.dto.SurgeryDto;
import com.openhis.web.clinicalmanage.mapper.SurgeryAppMapper;
import com.openhis.workflow.domain.ServiceRequest;
import com.openhis.workflow.domain.ActivityDefinition;
import com.openhis.workflow.service.IActivityDefinitionService;
import com.openhis.workflow.service.IServiceRequestService;
import org.springframework.beans.BeanUtils;
@@ -365,7 +366,21 @@ public class SurgeryAppServiceImpl implements ISurgeryAppService {
serviceRequest.setPrescriptionNo(prescriptionNo);
serviceRequest.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue());// 治疗类型
serviceRequest.setQuantity(BigDecimal.valueOf(1)); // 请求数量
serviceRequest.setUnitCode(""); // 请求单位编码
// 从诊疗目录获取使用单位,避免硬编码
String unitCode = ""; // 默认值
String surgeryCode = surgeryDto.getSurgeryCode();
if (surgeryCode != null && !surgeryCode.isEmpty()) {
ActivityDefinition activityDef = activityDefinitionService.getOne(
new LambdaQueryWrapper<ActivityDefinition>()
.eq(ActivityDefinition::getBusNo, surgeryCode)
.eq(ActivityDefinition::getCategoryCode, "24")
);
if (activityDef != null && activityDef.getPermittedUnitCode() != null
&& !activityDef.getPermittedUnitCode().isEmpty()) {
unitCode = activityDef.getPermittedUnitCode();
}
}
serviceRequest.setUnitCode(unitCode); // 请求单位编码
serviceRequest.setCategoryEnum(24); // 请求类型24-手术(新值域,避开 adviceType 碰撞)
serviceRequest.setActivityId(surgeryId); // 手术ID作为诊疗定义id
serviceRequest.setPatientId(surgeryDto.getPatientId()); // 患者

View File

@@ -14,6 +14,7 @@ import com.core.common.exception.ServiceException;
import com.core.common.utils.AssignSeqUtil;
import com.core.common.utils.MessageUtils;
import com.core.common.utils.SecurityUtils;
import com.core.common.utils.DictUtils;
import com.core.common.utils.StringUtils;
import com.core.web.util.TenantOptionUtil;
import com.openhis.administration.domain.Account;
@@ -1920,7 +1921,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
Surgery surgery = iSurgeryService.getOne(
new LambdaQueryWrapper<Surgery>()
.eq(Surgery::getSurgeryNo, prescriptionNo)
.and(w -> w.isNull(Surgery::getDeleteFlag).or().eq(Surgery::getDeleteFlag, "0")));
.and(w -> w.isNull(Surgery::getDeleteFlag).or().eq(Surgery::getDeleteFlag, "0")).last("LIMIT 1"));
if (surgery != null) {
iSurgeryService.removeById(surgery.getId());
log.info("handService - 级联删除手术记录 cli_surgery: surgeryNo={}, id={}", prescriptionNo, surgery.getId());
@@ -2186,7 +2187,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
.eq(ChargeItem::getServiceId, adviceSaveDto.getRequestId())
.eq(ChargeItem::getServiceTable, CommonConstants.TableName.WOR_SERVICE_REQUEST)
.eq(ChargeItem::getDeleteFlag, DelFlag.NO.getCode())
);
.last("LIMIT 1"));
log.info("BugFix#328: 通过requestId查询费用项requestId={}, chargeItem={}",
adviceSaveDto.getRequestId(), existingChargeItem != null ? existingChargeItem.getId() : "null");
}
@@ -2240,9 +2241,14 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
// 收费状态
requestBaseDto.setChargeStatus_enumText(
EnumUtils.getInfoByValue(ChargeItemStatus.class, requestBaseDto.getChargeStatus()));
// 单位字典翻译失败时回退使用原始值(如手术申请硬编码了中文单位名)
// 单位字典翻译:优先通过 unit_code 字典翻译编码值,失败时回退使用原始值
if (StringUtils.isNotBlank(requestBaseDto.getUnitCode()) && StringUtils.isBlank(requestBaseDto.getUnitCode_dictText())) {
requestBaseDto.setUnitCode_dictText(requestBaseDto.getUnitCode());
String dictLabel = DictUtils.getDictLabel("unit_code", requestBaseDto.getUnitCode());
if (StringUtils.isNotBlank(dictLabel)) {
requestBaseDto.setUnitCode_dictText(dictLabel);
} else {
requestBaseDto.setUnitCode_dictText(requestBaseDto.getUnitCode());
}
}
}
return R.ok(requestBaseInfo);
@@ -2295,7 +2301,7 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
new LambdaQueryWrapper<InventoryItem>()
.eq(InventoryItem::getItemId, dispense.getMedicationId())
.eq(InventoryItem::getLotNumber, dispense.getLotNumber())
);
.last("LIMIT 1"));
if (inventoryItem != null) {
// 计算回滚后的数量(加上已发放的数量)
@@ -2382,21 +2388,52 @@ public class DoctorStationAdviceAppServiceImpl implements IDoctorStationAdviceAp
.map(UpdateGroupDto::getRequestId).collect(Collectors.toList());
if (!idsToSetNull.isEmpty()) {
// 创建更新条件
UpdateWrapper<MedicationRequest> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("group_id", null).in("id", idsToSetNull);
// 对三个表都执行 group_id/group_no 置空(哪个表有该 id 就更新哪个)
UpdateWrapper<MedicationRequest> medUpdateWrapper = new UpdateWrapper<>();
medUpdateWrapper.set("group_id", null).in("id", idsToSetNull);
iMedicationRequestService.update(medUpdateWrapper);
// 执行更新
iMedicationRequestService.update(updateWrapper);
UpdateWrapper<ServiceRequest> srvUpdateWrapper = new UpdateWrapper<>();
srvUpdateWrapper.set("group_id", null).in("id", idsToSetNull);
iServiceRequestService.update(srvUpdateWrapper);
// DeviceRequest 使用 group_noString 类型)
UpdateWrapper<DeviceRequest> devUpdateWrapper = new UpdateWrapper<>();
devUpdateWrapper.set("group_no", null).in("id", idsToSetNull);
iDeviceRequestService.update(devUpdateWrapper);
}
// 处理null的情况
List<MedicationRequest> medicationRequestList = groupList.stream().filter(dto -> dto.getGroupId() != null)
.map(dto -> new MedicationRequest().setId(dto.getRequestId()).setGroupId(dto.getGroupId()))
.collect(Collectors.toList());
if (!medicationRequestList.isEmpty()) {
iMedicationRequestService.saveOrUpdateBatch(medicationRequestList);
// 处理 groupId 非 null 的情况:按实际所属表分别更新
List<UpdateGroupDto> nonNullGroupList = groupList.stream()
.filter(dto -> dto.getGroupId() != null).collect(Collectors.toList());
if (!nonNullGroupList.isEmpty()) {
for (UpdateGroupDto dto : nonNullGroupList) {
Long reqId = dto.getRequestId();
Long grpId = dto.getGroupId();
// 先尝试药品表med_medication_request → group_id
MedicationRequest medReq = iMedicationRequestService.getById(reqId);
if (medReq != null) {
UpdateWrapper<MedicationRequest> uw = new UpdateWrapper<>();
uw.set("group_id", grpId).eq("id", reqId);
iMedicationRequestService.update(uw);
continue;
}
// 再尝试诊疗表wor_service_request → group_id
ServiceRequest srvReq = iServiceRequestService.getById(reqId);
if (srvReq != null) {
UpdateWrapper<ServiceRequest> uw = new UpdateWrapper<>();
uw.set("group_id", grpId).eq("id", reqId);
iServiceRequestService.update(uw);
continue;
}
// 最后尝试耗材表wor_device_request → group_no, String 类型)
DeviceRequest devReq = iDeviceRequestService.getById(reqId);
if (devReq != null) {
UpdateWrapper<DeviceRequest> uw = new UpdateWrapper<>();
uw.set("group_no", grpId != null ? grpId.toString() : null).eq("id", reqId);
iDeviceRequestService.update(uw);
}
}
}
}

View File

@@ -75,7 +75,7 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
Emr emr = new Emr();
BeanUtils.copyProperties(patientEmrDto, emr);
String contextStr = patientEmrDto.getContextJson().toString();
Emr patientEmr = emrService.getOne(new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, emr.getEncounterId()));
Emr patientEmr = emrService.getOne(new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, emr.getEncounterId()).orderByDesc(Emr::getCreateTime).last("LIMIT 1"), false);
boolean saveSuccess;
// 如果已经保存病历,再次保存走更新
if (patientEmr != null) {
@@ -122,6 +122,10 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
*/
@Override
public R<?> getPatientEmrHistory(PatientEmrDto patientEmrDto, Integer pageNo, Integer pageSize) {
// 校验参数
if (patientEmrDto.getPatientId() == null) {
return R.ok(new Page<>(pageNo, pageSize));
}
Page<Emr> page = emrService.page(new Page<>(pageNo, pageSize),
new LambdaQueryWrapper<Emr>().eq(Emr::getPatientId, patientEmrDto.getPatientId()));
return R.ok(page);
@@ -136,8 +140,12 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
*/
@Override
public R<?> getEmrDetail(Long encounterId) {
// 校验参数
if (encounterId == null) {
return R.ok(null);
}
// 先查询门诊病历(emr表)
Emr emrDetail = emrService.getOne(new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounterId));
Emr emrDetail = emrService.getOne(new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounterId).orderByDesc(Emr::getCreateTime).last("LIMIT 1"), false);
if (emrDetail != null) {
return R.ok(emrDetail);
}
@@ -147,7 +155,8 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
new LambdaQueryWrapper<DocRecord>()
.eq(DocRecord::getEncounterId, encounterId)
.orderByDesc(DocRecord::getCreateTime)
.last("LIMIT 1")
.last("LIMIT 1"),
false
);
if (docRecord != null) {
// 住院病历存在,也返回数据
@@ -266,7 +275,7 @@ public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppServi
public R<?> checkNeedWriteEmr(Long encounterId) {
// 检查该就诊记录是否已经有病历
Emr existingEmr = emrService.getOne(
new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounterId)
new LambdaQueryWrapper<Emr>().eq(Emr::getEncounterId, encounterId).orderByDesc(Emr::getCreateTime).last("LIMIT 1"), false
);
// 如果没有病历,则需要写病历

View File

@@ -274,7 +274,7 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
new QueryWrapper<Organization>()
.eq("bus_no", performDeptCode)
.eq("delete_flag", "0")
);
.last("LIMIT 1"));
if (organization != null) {
positionId = organization.getId();
} else {
@@ -410,7 +410,7 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
new QueryWrapper<InspectionLabApply>()
.eq("apply_no", applyNo)
.eq("delete_flag", DelFlag.NO.getCode())
);
.last("LIMIT 1"));
if (mainEntity == null) {
return null;
@@ -532,7 +532,7 @@ public class DoctorStationLabApplyServiceImpl implements IDoctorStationInspectio
// 1. 根据申请单号查询检验申请单信息
InspectionLabApply inspectionLabApply = inspectionLabApplyService.getOne(
new QueryWrapper<InspectionLabApply>().eq("apply_no", applyNo)
);
.last("LIMIT 1"));
if (inspectionLabApply == null) {
log.warn("未找到申请单号为 [{}] 的检验申请单", applyNo);

View File

@@ -215,7 +215,7 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
// 限定当天日期,避免复诊患者匹配到历史队列记录
.eq(TriageQueueItem::getQueueDate, LocalDate.now())
.eq(TriageQueueItem::getDeleteFlag, "0")
);
.last("LIMIT 1"));
if (queueItem != null) {
// 使用 TriageQueueStatus 枚举替代原有硬编码数字 20保证状态值一致性
queueItem.setStatus(TriageQueueStatus.IN_CLINIC.getValue());
@@ -282,7 +282,7 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
.eq(TriageQueueItem::getEncounterId, encounterId)
.eq(TriageQueueItem::getQueueDate, LocalDate.now())
.eq(TriageQueueItem::getDeleteFlag, "0")
);
.last("LIMIT 1"));
// 当天未找到时回退:不限日期查最近一条(防止跨日就诊队列项遗漏更新)
if (queueItem == null) {
@@ -292,8 +292,8 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
.eq(TriageQueueItem::getEncounterId, encounterId)
.eq(TriageQueueItem::getDeleteFlag, "0")
.orderByDesc(TriageQueueItem::getQueueDate)
.last("LIMIT 1")
);
.last("LIMIT 1"));
if (queueItem != null) {
log.warn("完诊:当天队列项未找到,回退使用最近队列记录 queueDate={}, id={}",
queueItem.getQueueDate(), queueItem.getId());

View File

@@ -127,6 +127,11 @@ public class RequestBaseDto {
* 请求状态
*/
private Integer statusEnum;
/**
* 退回原因
*/
private String reasonText;
private String statusEnum_enumText;
/**

View File

@@ -2,6 +2,7 @@ package com.openhis.web.doctorstation.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.math.BigDecimal;
@@ -40,6 +41,10 @@ public class SurgeryItemDto {
/** 单位编码 */
private String unitCode;
/** 单位编码字典文本(前端用于显示单位) */
/** 单位编码字典文本(前端用于显示单位,输出为 unitCode_dictText 以下划线格式匹配前端 */
@JsonProperty("unitCode_dictText")
private String unitCodeDictText;
/** 所需标本编码(来自诊疗目录配置,对应字典 specimen_code 的 dictValue */
private String specimenCode;
}

View File

@@ -239,8 +239,8 @@ public class AdviceUtils {
BigDecimal totalQuantity = matchedInventories.stream()
.map(dto -> dto.getQuantity() != null ? dto.getQuantity() : BigDecimal.ZERO)
.reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal requestQuantity = medicationRequestUseExe.getExecuteTimesNum()
.multiply(medicationRequestUseExe.getMinUnitQuantity());
// 只校验单次执行所需数量,不按全部执行次数校验(长期医嘱多次执行由发药流程逐次管控库存)
BigDecimal requestQuantity = medicationRequestUseExe.getMinUnitQuantity();
if (requestQuantity.compareTo(totalQuantity) > 0) {
tipsList
.add("" + medicationRequestUseExe.getBusNo() + "】在" + matchedInventories.get(0).getLocationName() + "库存不足");

View File

@@ -39,6 +39,16 @@ public class HomeStatisticsDto {
* 相对前日变化百分比
*/
private Double revenueTrend;
/**
* 今日收入金额(数值,单位:元)
*/
private java.math.BigDecimal todayRevenueAmount;
/**
* 昨日收入金额(数值,单位:元)
*/
private java.math.BigDecimal yesterdayRevenueAmount;
/**
* 今日预约数量
@@ -69,4 +79,19 @@ public class HomeStatisticsDto {
* 待写病历数量
*/
private Integer pendingEmr;
}
/**
* 今日处方数量
*/
private Integer todayPrescriptions;
/**
* 昨日处方数量
*/
private Integer yesterdayPrescriptions;
/**
* 处方相对前日变化百分比
*/
private Double prescriptionTrend;
}

View File

@@ -628,8 +628,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
// 查询患者待取的药品
List<MedicationDispense> medicationDispenseList = medicationDispenseService
.list(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getEncounterId, encounterId)
.in(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue(),
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUMMARIZED.getValue())
.in(MedicationDispense::getStatusEnum, DispenseStatus.EXECUTED.getValue(),
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUBMITTED.getValue())
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
if (!medicationDispenseList.isEmpty()) {
return R.fail("患者有待取的药品,请先取药");
@@ -696,8 +696,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
// 查询患者待取的药品
List<MedicationDispense> medicationDispenseList = medicationDispenseService
.list(new LambdaQueryWrapper<MedicationDispense>().eq(MedicationDispense::getEncounterId, encounterId)
.in(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue(),
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUMMARIZED.getValue())
.in(MedicationDispense::getStatusEnum, DispenseStatus.EXECUTED.getValue(),
DispenseStatus.PENDING_REFUND.getValue(), DispenseStatus.SUBMITTED.getValue())
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
if (!medicationDispenseList.isEmpty()) {
return R.fail("患者有待取的药品,请先取药");
@@ -762,8 +762,8 @@ public class ATDManageAppServiceImpl implements IATDManageAppService {
@Override
public R<?> getPendingMedication(Long encounterId) {
Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
return R.ok(atdManageAppMapper.getPendingMedication(encounterId, DispenseStatus.PREPARATION.getValue(),
DispenseStatus.SUMMARIZED.getValue(), RequestStatus.CANCELLED.getValue(), tenantId));
return R.ok(atdManageAppMapper.getPendingMedication(encounterId, DispenseStatus.EXECUTED.getValue(),
DispenseStatus.SUBMITTED.getValue(), RequestStatus.CANCELLED.getValue(), tenantId));
}
/**

View File

@@ -482,6 +482,13 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
if (!checkReqIds.isEmpty()) {
serviceRequestService.updatePendingReceiveStatus(checkReqIds);
}
// 手术类医嘱执行后,状态改为"已执行"SurgeryAppStatusEnum.EXECUTED=4
List<Long> surgeryReqIds = executedReqs.stream()
.filter(sr -> ActivityDefCategory.PROCEDURE.getValue().equals(sr.getCategoryEnum()))
.map(ServiceRequest::getId).toList();
if (!surgeryReqIds.isEmpty()) {
serviceRequestService.updateSurgeryAppStatus(surgeryReqIds, SurgeryAppStatusEnum.EXECUTED.getCode());
}
}
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[]{"医嘱执行"}));
@@ -538,8 +545,8 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
for (MedicationDispense medicationDispense : longMedDispenseList) {
if (DispenseStatus.COMPLETED.getValue().equals(medicationDispense.getStatusEnum())) {
longMedDispensedList.add(medicationDispense);
} else if (DispenseStatus.PREPARATION.getValue().equals(medicationDispense.getStatusEnum())
|| DispenseStatus.SUMMARIZED.getValue().equals(medicationDispense.getStatusEnum())) {
} else if (DispenseStatus.EXECUTED.getValue().equals(medicationDispense.getStatusEnum())
|| DispenseStatus.SUBMITTED.getValue().equals(medicationDispense.getStatusEnum())) {
longMedUndispenseList.add(medicationDispense);
}
}
@@ -566,8 +573,8 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
for (MedicationDispense medicationDispense : tempMedDispenseList) {
if (DispenseStatus.COMPLETED.getValue().equals(medicationDispense.getStatusEnum())) {
tempMedDispensedList.add(medicationDispense);
} else if (DispenseStatus.PREPARATION.getValue().equals(medicationDispense.getStatusEnum())
|| DispenseStatus.SUMMARIZED.getValue().equals(medicationDispense.getStatusEnum())) {
} else if (DispenseStatus.EXECUTED.getValue().equals(medicationDispense.getStatusEnum())
|| DispenseStatus.SUBMITTED.getValue().equals(medicationDispense.getStatusEnum())) {
tempMedUndispenseList.add(medicationDispense);
}
}
@@ -582,7 +589,10 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
// 处理长期已发放的药品
if (!longMedDispensedList.isEmpty()) {
// 生成退药单
this.creatRefundMedicationList(tempMedDispensedList, procedureIdMap);
this.creatRefundMedicationList(longMedDispensedList, procedureIdMap);
// 药品退药请求状态变更(待退药)
medicationRequestService.updateCancelledStatusBatch(
longMedDispensedList.stream().map(MedicationDispense::getMedReqId).toList(), null, null);
}
// 处理临时已发放药品
if (!tempMedDispensedList.isEmpty()) {
@@ -723,6 +733,24 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
deviceDispenseService.removeByIds(deviceDispenseList.stream().map(DeviceDispense::getId).toList());
deviceRequestService.removeByIds(deviceDispenseList.stream().map(DeviceDispense::getDeviceReqId).toList());
}
// 手术类医嘱取消执行后,状态回退为"已校对"SurgeryAppStatusEnum.VERIFIED=3
List<Long> surgeryCancelReqIds = adviceExecuteParam.getAdviceExecuteDetailList().stream()
.filter(e -> CommonConstants.TableName.WOR_SERVICE_REQUEST.equals(e.getAdviceTable()))
.map(AdviceExecuteDetailParam::getRequestId)
.filter(Objects::nonNull)
.distinct()
.toList();
if (!surgeryCancelReqIds.isEmpty()) {
List<ServiceRequest> surgeryRequests = serviceRequestService.list(
new LambdaQueryWrapper<ServiceRequest>()
.in(ServiceRequest::getId, surgeryCancelReqIds)
.eq(ServiceRequest::getCategoryEnum, ActivityDefCategory.PROCEDURE.getValue()));
if (!surgeryRequests.isEmpty()) {
serviceRequestService.updateSurgeryAppStatus(
surgeryRequests.stream().map(ServiceRequest::getId).toList(),
SurgeryAppStatusEnum.VERIFIED.getCode());
}
}
return R.ok("取消执行成功,相关汇总领药单已重新生成");
}
@@ -1035,7 +1063,7 @@ public class AdviceProcessAppServiceImpl implements IAdviceProcessAppService {
.eq(MedicationDispense::getMedReqId, tempMedicationRequest.getId())
.set(MedicationDispense::getProcedureId, procedureId)
.set(MedicationDispense::getPlannedDispenseTime, expectedDate)
.set(MedicationDispense::getStatusEnum, DispenseStatus.PREPARATION.getValue()));
.set(MedicationDispense::getStatusEnum, DispenseStatus.EXECUTED.getValue()));
// 更新账单状态
chargeItemService.update(

View File

@@ -119,7 +119,7 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
LocationForm.BED.getValue(), ParticipantType.ADMITTING_DOCTOR.getCode(),
AccountType.PERSONAL_CASH_ACCOUNT.getCode(), ChargeItemStatus.BILLABLE.getValue(),
ChargeItemStatus.BILLED.getValue(), ChargeItemStatus.REFUNDED.getValue(),
DispenseStatus.SUMMARIZED.getValue());
DispenseStatus.SUBMITTED.getValue());
medicineDispenseFormPage.getRecords().forEach(e -> {
// 是否皮试
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
@@ -156,8 +156,8 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
// 汇总单分页列表
Page<MedicineSummaryFormDto> medicineSummaryFormPage = medicineSummaryAppMapper.selectMedicineSummaryFormPage(
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.COMPLETED.getValue(),
DispenseStatus.PREPARATION.getValue(), SupplyType.SUMMARY_DISPENSE.getValue());
new Page<>(pageNo, pageSize), queryWrapper, DispenseStatus.PREPARATION.getValue(),
SupplyType.SUMMARY_DISPENSE.getValue());
medicineSummaryFormPage.getRecords().forEach(e -> {
// 发药状态(汇总单展示文案)
e.setStatusEnum_enumText(getSummaryFormStatusText(e.getStatusEnum()));
@@ -203,7 +203,7 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
throw new ServiceException("未找到药品发放信息");
}
if (medicationDispenseList.stream().map(MedicationDispense::getStatusEnum)
.anyMatch(x -> x.equals(DispenseStatus.SUMMARIZED.getValue()))) {
.anyMatch(x -> x.equals(DispenseStatus.SUBMITTED.getValue()))) {
throw new ServiceException("药品已汇总,请勿重复汇总");
}
// 查询药品信息
@@ -295,7 +295,7 @@ public class MedicineSummaryAppServiceImpl implements IMedicineSummaryAppService
* 汇总发药单状态展示文案(药品医嘱状态映射表:汇总申请→已提交,发药→已发药)
*/
private String getSummaryFormStatusText(Integer statusEnum) {
if (DispenseStatus.PREPARATION.getValue().equals(statusEnum)) {
if (DispenseStatus.EXECUTED.getValue().equals(statusEnum)) {
return "已提交";
}
if (DispenseStatus.COMPLETED.getValue().equals(statusEnum)) {

View File

@@ -46,14 +46,13 @@ public interface MedicineSummaryAppMapper {
*
* @param page 分页信息
* @param queryWrapper 查询条件
* @param completed 发药状态:已完成
* @param preparation 发药状态:待配药
* @param summaryDispense 单据类型:汇总发药
* @return 汇总单列表
*/
Page<MedicineSummaryFormDto> selectMedicineSummaryFormPage(@Param("page") Page<MedicineSummaryFormDto> page,
@Param(Constants.WRAPPER) QueryWrapper<DispenseFormSearchParam> queryWrapper,
@Param("completed") Integer completed, @Param("preparation") Integer preparation,
@Param("preparation") Integer preparation,
@Param("summaryDispense") Integer summaryDispense);
/**

View File

@@ -3,6 +3,7 @@ package com.openhis.web.pharmacymanage.appservice.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.core.domain.R;
import com.core.common.exception.ServiceException;
@@ -191,7 +192,8 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
Page<EncounterInfoDto> encounterInfoPage
= westernMedicineDispenseMapper.selectEncounterInfoListPage(new Page<>(pageNo, pageSize), queryWrapper,
statusEnum, DispenseStatus.IN_PROGRESS.getValue(), DispenseStatus.COMPLETED.getValue(),
DispenseStatus.PREPARATION.getValue(), DispenseStatus.PREPARED.getValue());
DispenseStatus.PREPARATION.getValue(), DispenseStatus.PREPARED.getValue(),
DispenseStatus.SUMMARIZED.getValue(), DispenseStatus.SUBMITTED.getValue());
encounterInfoPage.getRecords().forEach(encounterInfo -> {
// 性别
encounterInfo.setGenderEnum_enumText(
@@ -229,7 +231,8 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
= westernMedicineDispenseMapper.selectMedicineDispenseOrderPage(new Page<>(pageNo, pageSize), queryWrapper,
DispenseStatus.IN_PROGRESS.getValue(), DispenseStatus.COMPLETED.getValue(),
DispenseStatus.PREPARATION.getValue(), DispenseStatus.PREPARED.getValue(), dispenseStatus,
PublicationStatus.ACTIVE.getValue());
PublicationStatus.ACTIVE.getValue(), DispenseStatus.SUMMARIZED.getValue(),
DispenseStatus.SUBMITTED.getValue());
medicineDispenseOrderPage.getRecords().forEach(medicineDispenseOrder -> {
// 发药状态
medicineDispenseOrder.setStatusEnum_enumText(
@@ -253,6 +256,9 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
*/
@Override
public R<?> medicinePrepare(List<DispenseItemDto> dispenseMedicineList) {
if (dispenseMedicineList == null || dispenseMedicineList.isEmpty()) {
throw new ServiceException("配药信息不能为空");
}
// 追溯码集合
List<String> traceNoList
= dispenseMedicineList.stream().map(DispenseItemDto::getTraceNo).collect(Collectors.toList());
@@ -354,7 +360,7 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
}
// 发药单状态校验
if (unDispenseInventoryList.stream().map(UnDispenseInventoryDto::getDispenseStatus)
.anyMatch(x -> !x.equals(DispenseStatus.PREPARED.getValue()))) {
.anyMatch(x -> !x.equals(DispenseStatus.SUBMITTED.getValue()))) {
throw new ServiceException("发药失败,请检查发药单状态");
}
@@ -470,6 +476,11 @@ public class WesternMedicineDispenseAppServiceImpl implements IWesternMedicineDi
}
// 药品发放更新
medicationDispenseService.updateBatchById(dispenseUpdateList);
// 更新医嘱状态为已完成
List<Long> medReqIdList = unDispenseInventoryList.stream()
.map(UnDispenseInventoryDto::getRequestId).distinct().collect(Collectors.toList());
medicationRequestService.update(new MedicationRequest().setStatusEnum(RequestStatus.DISPENSE_COMPLETED.getValue()),
new LambdaUpdateWrapper<MedicationRequest>().in(MedicationRequest::getId, medReqIdList));
// 库存更新
inventoryItemService.updateBatchById(inventoryItemList);
// 追溯码管理表数据追加

View File

@@ -35,7 +35,8 @@ public interface WesternMedicineDispenseMapper {
@Param(Constants.WRAPPER) QueryWrapper<EncounterInfoSearchParam> queryWrapper,
@Param("statusEnum") Integer statusEnum, @Param("inProgress") Integer inProgress,
@Param("completed") Integer completed, @Param("preparation") Integer preparation,
@Param("prepared") Integer prepared);
@Param("prepared") Integer prepared, @Param("summarized") Integer summarized,
@Param("submitted") Integer submitted);
/**
* 发药单查询
@@ -54,7 +55,8 @@ public interface WesternMedicineDispenseMapper {
@Param(Constants.WRAPPER) QueryWrapper<ItemDispenseOrderDto> queryWrapper,
@Param("inProgress") Integer inProgress, @Param("completed") Integer completed,
@Param("preparation") Integer preparation, @Param("prepared") Integer prepared,
@Param("dispenseStatus") Integer dispenseStatus, @Param("active") Integer active);
@Param("dispenseStatus") Integer dispenseStatus, @Param("active") Integer active,
@Param("summarized") Integer summarized, @Param("submitted") Integer submitted);
/**
* 获取配药人下拉选列表

View File

@@ -192,9 +192,10 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
// 药品
List<RegAdviceSaveDto> medicineList = regAdviceSaveList.stream()
.filter(e -> ItemType.MEDICINE.getValue().equals(e.getAdviceType())).collect(Collectors.toList());
// 诊疗活动包含护理adviceType=26
// 诊疗活动包含护理adviceType=26、手术adviceType=6
List<RegAdviceSaveDto> activityList = regAdviceSaveList.stream()
.filter(e -> ItemType.ACTIVITY.getValue().equals(e.getAdviceType())
|| ItemType.SURGERY.getValue().equals(e.getAdviceType())
|| (e.getAdviceType() != null && e.getAdviceType() == 26))
.collect(Collectors.toList());
// 耗材 🔧 Bug #147 修复
@@ -660,7 +661,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
longServiceRequest.setPatientId(regAdviceSaveDto.getPatientId()); // 患者
longServiceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
longServiceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
longServiceRequest.setOrgId(regAdviceSaveDto.getPositionId()); // 执行科室
longServiceRequest.setOrgId(regAdviceSaveDto.getEffectiveOrgId()); // 执行科室
longServiceRequest.setContentJson(regAdviceSaveDto.getContentJson()); // 请求内容json
longServiceRequest.setYbClassEnum(regAdviceSaveDto.getYbClassEnum());// 类别医保编码
longServiceRequest.setConditionId(regAdviceSaveDto.getConditionId()); // 诊断id
@@ -712,7 +713,7 @@ public class AdviceManageAppServiceImpl implements IAdviceManageAppService {
tempServiceRequest.setRequesterId(regAdviceSaveDto.getPractitionerId()); // 开方医生
tempServiceRequest.setEncounterId(regAdviceSaveDto.getEncounterId()); // 就诊id
tempServiceRequest.setAuthoredTime(curDate); // 请求签发时间
tempServiceRequest.setOrgId(regAdviceSaveDto.getPositionId()); // 执行科室
tempServiceRequest.setOrgId(regAdviceSaveDto.getEffectiveOrgId()); // 执行科室
tempServiceRequest.setContentJson(regAdviceSaveDto.getContentJson()); // 请求内容json
tempServiceRequest.setYbClassEnum(regAdviceSaveDto.getYbClassEnum());// 类别医保编码
tempServiceRequest.setConditionId(regAdviceSaveDto.getConditionId()); // 诊断id

View File

@@ -157,9 +157,14 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
} else {
// 根据申请单类型生成不同前缀的单号
String dateStr = new java.text.SimpleDateFormat("yyMMdd").format(new Date());
AssignSeqEnum seqEnum = ActivityDefCategory.PROCEDURE.getCode().equals(typeCode)
? AssignSeqEnum.SURGERY_APPLY_NO
: AssignSeqEnum.CHECK_APPLY_NO;
AssignSeqEnum seqEnum;
if (ActivityDefCategory.PROCEDURE.getCode().equals(typeCode)) {
seqEnum = AssignSeqEnum.SURGERY_APPLY_NO;
} else if (ActivityDefCategory.PROOF.getCode().equals(typeCode)) {
seqEnum = AssignSeqEnum.LAB_APPLY_NO;
} else {
seqEnum = AssignSeqEnum.CHECK_APPLY_NO;
}
int seq = assignSeqUtil.getSeqNoByDay(seqEnum.getPrefix());
prescriptionNo = seqEnum.getPrefix() + dateStr + String.format("%05d", seq);
}
@@ -337,7 +342,25 @@ public class RequestFormManageAppServiceImpl implements IRequestFormManageAppSer
surgeryServiceRequest.setPrescriptionNo(prescriptionNo);
surgeryServiceRequest.setTherapyEnum(TherapyTimeType.TEMPORARY.getValue());
surgeryServiceRequest.setQuantity(BigDecimal.valueOf(1));
surgeryServiceRequest.setUnitCode("");
// 从诊疗目录获取使用单位,避免硬编码
String unitCode = ""; // 默认值
if (activityList != null && !activityList.isEmpty()) {
String dtoUnitCode = activityList.get(0).getUnitCode();
if (dtoUnitCode != null && !dtoUnitCode.isEmpty()) {
unitCode = dtoUnitCode;
} else {
// 从 ActivityDefinition 查询使用单位
Long activityId = activityList.get(0).getAdviceDefinitionId();
if (activityId != null) {
ActivityDefinition activityDef = iActivityDefinitionService.getById(activityId);
if (activityDef != null && activityDef.getPermittedUnitCode() != null
&& !activityDef.getPermittedUnitCode().isEmpty()) {
unitCode = activityDef.getPermittedUnitCode();
}
}
}
}
surgeryServiceRequest.setUnitCode(unitCode);
surgeryServiceRequest.setCategoryEnum(24); // 24-手术(新值域,避开 adviceType 碰撞)
// 优先从 activityList 获取手术 ID
if (activityList != null && !activityList.isEmpty()) {

View File

@@ -10,8 +10,4 @@ import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class RegAdviceSaveDto extends AdviceSaveDto {
/** 请求类型 */
private Integer categoryEnum;
}

View File

@@ -13,7 +13,16 @@ import com.openhis.administration.service.IPatientService;
import com.openhis.administration.service.IPractitionerService;
import com.openhis.common.enums.ParticipantType;
import com.openhis.web.dto.HomeStatisticsDto;
import com.openhis.financial.domain.PaymentReconciliation;
import com.openhis.financial.service.IPaymentReconciliationService;
import com.openhis.medication.domain.MedicationRequest;
import com.openhis.medication.service.IMedicationRequestService;
import com.openhis.common.enums.PaymentStatus;
import com.openhis.web.service.IHomeStatisticsService;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -46,6 +55,12 @@ public class HomeStatisticsServiceImpl implements IHomeStatisticsService {
@Autowired
private IPatientService patientService;
@Autowired
private IPaymentReconciliationService paymentReconciliationService;
@Autowired
private IMedicationRequestService medicationRequestService;
/**
* 获取首页统计数据
*
@@ -105,18 +120,108 @@ public class HomeStatisticsServiceImpl implements IHomeStatisticsService {
double patientTrend = calculateTrend(totalPatients, yesterdayPatients);
statistics.setPatientTrend(patientTrend);
// 今日收入和预约等其他统计暂时设为0后续从相应表查询
statistics.setTodayRevenue("¥ 0");
statistics.setYesterdayRevenue("¥ 0");
statistics.setRevenueTrend(0.0);
// 查询今日收入
BigDecimal todayRevenue = queryRevenueByDate(new Date());
BigDecimal yesterdayRevenue = queryRevenueByDate(getYesterday());
java.text.DecimalFormat df = new java.text.DecimalFormat("#,##0.00");
statistics.setTodayRevenue("¥ " + df.format(todayRevenue));
statistics.setYesterdayRevenue("¥ " + df.format(yesterdayRevenue));
statistics.setTodayRevenueAmount(todayRevenue);
statistics.setYesterdayRevenueAmount(yesterdayRevenue);
statistics.setRevenueTrend(calculateTrend(todayRevenue.doubleValue(), yesterdayRevenue.doubleValue()));
// 今日预约和待审核暂时设为0后续实现
statistics.setTodayAppointments(0);
statistics.setYesterdayAppointments(0);
statistics.setAppointmentTrend(0.0);
statistics.setPendingApprovals(0);
// 查询今日处方数量
int todayPrescriptions = queryPrescriptionCountByDate(new Date(), practitioner);
int yesterdayPrescriptions = queryPrescriptionCountByDate(getYesterday(), practitioner);
statistics.setTodayPrescriptions(todayPrescriptions);
statistics.setYesterdayPrescriptions(yesterdayPrescriptions);
statistics.setPrescriptionTrend(calculateTrend(todayPrescriptions, yesterdayPrescriptions));
return statistics;
}
/**
* 查询指定日期的处方数量
*
* @param date 日期
* @param practitioner 当前医生null 则查全部)
* @return 处方数量
*/
private int queryPrescriptionCountByDate(Date date, Practitioner practitioner) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
Date dayStart = cal.getTime();
cal.add(Calendar.DAY_OF_MONTH, 1);
Date dayEnd = cal.getTime();
LambdaQueryWrapper<MedicationRequest> query = new LambdaQueryWrapper<>();
query.ge(MedicationRequest::getCreateTime, dayStart)
.lt(MedicationRequest::getCreateTime, dayEnd)
.eq(MedicationRequest::getDeleteFlag, "0");
// 如果是医生角色,只统计自己开的处方
if (practitioner != null) {
query.eq(MedicationRequest::getPractitionerId, practitioner.getId());
}
return (int) medicationRequestService.count(query);
}
/**
* 查询指定日期的收款总额(状态为支付成功且未全部退款)
*
* @param date 日期
* @return 收款总额
*/
private BigDecimal queryRevenueByDate(Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
Date dayStart = cal.getTime();
cal.add(Calendar.DAY_OF_MONTH, 1);
Date dayEnd = cal.getTime();
LambdaQueryWrapper<PaymentReconciliation> query = new LambdaQueryWrapper<>();
query.ge(PaymentReconciliation::getBillDate, dayStart)
.lt(PaymentReconciliation::getBillDate, dayEnd)
.eq(PaymentReconciliation::getStatusEnum, PaymentStatus.SUCCESS.getValue())
.eq(PaymentReconciliation::getDeleteFlag, "0")
.select(PaymentReconciliation::getDisplayAmount);
java.util.List<PaymentReconciliation> list = paymentReconciliationService.list(query);
if (list == null || list.isEmpty()) {
return BigDecimal.ZERO;
}
return list.stream()
.map(p -> p.getDisplayAmount() != null ? p.getDisplayAmount() : BigDecimal.ZERO)
.reduce(BigDecimal.ZERO, BigDecimal::add);
}
/**
* 获取昨天的日期
*/
private Date getYesterday() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_MONTH, -1);
return cal.getTime();
}
/**
* 计算相对前日的百分比变化
*

View File

@@ -0,0 +1,93 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: org.postgresql.Driver
druid:
# 主库数据源
master:
url: jdbc:postgresql://192.168.110.252:15432/postgresql?currentSchema=hisdev&characterEncoding=UTF-8&client_encoding=UTF-8
username: postgresql
password: Jchl1528 # 请替换为实际的数据库密码
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1
testWhileIdle: true
testOnBorrow: true # 改为true以确保连接有效
testOnReturn: false
# 配置监控统计拦截的filters去掉后监控界面sql无法统计'wall'用于防火墙
filters: stat,wall,slf4j
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: openhis
login-password: 123456
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: 192.168.110.252
# 端口默认为6379
port: 6379
# 数据库索引
database: 1
# 密码
password: Jchl1528
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# 服务器配置
server:
# 服务器的HTTP端口默认为18080
port: 18080
servlet:
# 应用的访问路径
context-path: /openhis

View File

@@ -31,6 +31,34 @@
${ew.customSqlSegment}
</select>
<!-- 查询全院医生(不限科室),用于手术申请等需跨科室选择医生的场景 -->
<select id="getAllDoctorPage" resultType="com.openhis.web.chargemanage.dto.PractitionerMetadata">
SELECT T3.tenant_id,
T3.ID,
T3.NAME,
T3.gender_enum,
T3.py_str,
T3.wb_str,
T3.dr_profttl_code
FROM (
SELECT T1.tenant_id,
T1.ID,
T1.NAME,
T1.gender_enum,
T1.py_str,
T1.wb_str,
T1.dr_profttl_code
FROM adm_practitioner AS T1
WHERE T1.delete_flag = '0'
AND EXISTS(SELECT 1
FROM adm_practitioner_role AS T2
WHERE T2.practitioner_id = T1.ID
AND T2.delete_flag = '0'
AND T2.ROLE_code = #{RoleCode})
) AS T3
${ew.customSqlSegment}
</select>
<select id="getNumByPatientIdAndOrganizationId" resultType="Integer">
SELECT COUNT
(1)

View File

@@ -517,6 +517,7 @@
'med_medication_definition' AS advice_table_name,
T1.medication_id AS advice_definition_id
, T1.content_json::jsonb ->> 'remark' AS remark
, T1.back_reason AS reason_text
FROM med_medication_request AS T1
LEFT JOIN med_medication_definition AS T2 ON T2.ID = T1.medication_id
AND T2.delete_flag = '0'
@@ -579,6 +580,7 @@
'med_medication_definition' AS advice_table_name,
T3.ID AS advice_definition_id
, T2.content_json::jsonb ->> 'remark' AS remark
, T2.back_reason AS reason_text
FROM adm_charge_item AS T1
INNER JOIN med_medication_request AS T2 ON T2.ID = T1.service_id AND T2.delete_flag = '0'
LEFT JOIN med_medication_definition AS T3 ON T3.ID = T2.medication_id AND T3.delete_flag = '0'
@@ -643,6 +645,7 @@
'adm_device_definition' AS advice_table_name,
CI.product_id AS advice_definition_id
, NULL AS remark
, NULL AS reason_text
FROM adm_charge_item AS CI
LEFT JOIN adm_charge_item_definition CID ON CID.id = CI.definition_id AND CID.delete_flag = '0'
LEFT JOIN wor_device_request DR ON DR.id = CI.service_id AND DR.delete_flag = '0'
@@ -698,6 +701,7 @@
'adm_device_definition' AS advice_table_name,
T1.device_def_id AS advice_definition_id
, T1.content_json::jsonb ->> 'remark' AS remark
, NULL AS reason_text
FROM wor_device_request AS T1
LEFT JOIN adm_device_definition AS T2 ON T2.ID = T1.device_def_id
AND T2.delete_flag = '0'
@@ -755,6 +759,7 @@
'wor_activity_definition' AS advice_table_name,
T1.activity_id AS advice_definition_id,
T1.remark AS remark
, T1.reason_text AS reason_text
FROM wor_service_request AS T1
LEFT JOIN wor_activity_definition AS T2
ON T2.ID = T1.activity_id
@@ -889,13 +894,17 @@
t2.ID AS charge_item_definition_id,
t2.price AS price,
t1.permitted_unit_code AS unit_code,
t1.permitted_unit_code AS unit_code_dict_text
COALESCE(sdd.dict_label, t1.permitted_unit_code) AS unit_code_dict_text
FROM wor_activity_definition t1
LEFT JOIN adm_charge_item_definition t2
ON t2.instance_id = t1.ID
AND t2.delete_flag = '0'
AND t2.status_enum = #{statusEnum}
AND t2.instance_table = 'wor_activity_definition'
LEFT JOIN sys_dict_data sdd
ON sdd.dict_value = t1.permitted_unit_code
AND sdd.dict_type = 'unit_code'
AND sdd.status = '0'
WHERE t1.delete_flag = '0'
AND (t1.category_code = '手术' OR t1.category_code = '24')
<if test="searchKey != null and searchKey != ''">
@@ -915,7 +924,8 @@
t2.ID AS charge_item_definition_id,
t2.price AS price,
t1.permitted_unit_code AS unit_code,
t1.permitted_unit_code AS unit_code_dict_text
COALESCE(sdd.dict_label, t1.permitted_unit_code) AS unit_code_dict_text,
t1.specimen_code AS specimen_code
FROM wor_activity_definition t1
LEFT JOIN adm_charge_item_definition t2
ON t2.instance_id = t1.ID
@@ -925,6 +935,10 @@
LEFT JOIN adm_organization t3
ON t3.id = t1.org_id
AND t3.delete_flag = '0'
LEFT JOIN sys_dict_data sdd
ON sdd.dict_value = t1.permitted_unit_code
AND sdd.dict_type = 'unit_code'
AND sdd.status = '0'
WHERE t1.delete_flag = '0'
AND t1.category_code = #{categoryCode}
<if test="searchKey != null and searchKey != ''">

View File

@@ -239,7 +239,7 @@
ON wsr.source_location_id = al.id
AND al.delete_flag = '0'
WHERE wsr.delete_flag = '0'
AND wsd.status_enum IN (#{preparation}, #{completed})
AND wsd.status_enum = #{preparation}
AND wsr.type_enum = #{summaryDispense}
GROUP BY wsr.tenant_id,
wsr.bus_no ,

View File

@@ -97,14 +97,17 @@
ON T4.med_req_id = T5.id
AND T5.delete_flag = '0'
WHERE <if test="statusEnum == null">
T4.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared})
T4.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared},#{summarized})
</if>
<if test="statusEnum == 3">
T4.status_enum IN (#{inProgress},#{preparation},#{prepared})
T4.status_enum IN (#{inProgress},#{preparation},#{prepared},#{summarized})
</if>
<if test="statusEnum == 4">
T4.status_enum = #{completed}
</if>
<if test="statusEnum == 18">
T4.status_enum = #{submitted}
</if>
AND T4.summary_no IS NOT NULL
AND T4.summary_no != ''
) AS ii
@@ -269,14 +272,17 @@
AND T1.summary_no != ''
AND
<if test="dispenseStatus == null">
T1.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared})
T1.status_enum IN (#{inProgress},#{completed},#{preparation},#{prepared},#{summarized})
</if>
<if test="dispenseStatus == 3">
T1.status_enum IN (#{inProgress},#{preparation},#{prepared})
T1.status_enum IN (#{inProgress},#{preparation},#{prepared},#{summarized})
</if>
<if test="dispenseStatus == 4">
T1.status_enum = #{completed}
</if>
<if test="dispenseStatus == 18">
T1.status_enum = #{submitted}
</if>
AND T14.inventory_status_enum = #{active}
ORDER BY prescription_no DESC
) AS ii

View File

@@ -219,6 +219,7 @@
T1.effective_dose_start AS start_time,
T1.based_on_id AS based_on_id,
T1.medication_id AS advice_definition_id,
T1.content_json::jsonb ->> 'remark' AS remark,
T1.effective_dose_end AS stop_time,
T1.update_by AS stop_user_name
FROM med_medication_request AS T1
@@ -275,6 +276,7 @@
T1.req_authored_time AS start_time,
T1.based_on_id AS based_on_id,
T1.device_def_id AS advice_definition_id,
T1.content_json::jsonb ->> 'remark' AS remark,
NULL::timestamp AS stop_time,
'' AS stop_user_name
FROM wor_device_request AS T1
@@ -328,6 +330,7 @@
T1.occurrence_start_time AS start_time,
T1.based_on_id AS based_on_id,
T1.activity_id AS advice_definition_id,
T1.remark AS remark,
T1.occurrence_end_time AS stop_time,
T1.update_by AS stop_user_name
FROM wor_service_request AS T1

View File

@@ -30,6 +30,44 @@
drf.create_time,
ap.NAME AS patient_name,
CASE
-- ========== 手术专用映射 (categoryEnum=24) ==========
-- 手术申请单状态枚举: 1=待签发 2=已签发 3=已校对 4=已执行 5=已安排 6=已完成 10=已作废
WHEN EXISTS (
SELECT 1 FROM wor_service_request ws
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
AND ws.category_enum = 24 AND ws.status_enum = 10
) THEN 10
WHEN EXISTS (
SELECT 1 FROM wor_service_request ws
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
AND ws.category_enum = 24 AND ws.status_enum = 6
) THEN 6
WHEN EXISTS (
SELECT 1 FROM wor_service_request ws
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
AND ws.category_enum = 24 AND ws.status_enum = 5
) THEN 5
WHEN EXISTS (
SELECT 1 FROM wor_service_request ws
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
AND ws.category_enum = 24 AND ws.status_enum = 4
) THEN 4
WHEN EXISTS (
SELECT 1 FROM wor_service_request ws
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
AND ws.category_enum = 24 AND ws.status_enum = 3
) THEN 3
WHEN EXISTS (
SELECT 1 FROM wor_service_request ws
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
AND ws.category_enum = 24 AND ws.status_enum = 2
) THEN 2
WHEN EXISTS (
SELECT 1 FROM wor_service_request ws
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'
AND ws.category_enum = 24 AND ws.status_enum = 1
) THEN 1
-- ========== 通用映射 (非手术类型: 检查/检验/药品/输血) ==========
WHEN EXISTS (
SELECT 1 FROM wor_service_request ws
WHERE ws.prescription_no = drf.prescription_no AND ws.delete_flag = '0'

View File

@@ -278,6 +278,10 @@ public enum AssignSeqEnum {
* 手术申请单号(住院)
*/
SURGERY_APPLY_NO("73", "手术申请单号", "SSZ"),
/**
* 检验申请单号(住院)
*/
LAB_APPLY_NO("74", "检验申请单号", "JYZ"),
/**
* b 病历文书
*/

View File

@@ -29,9 +29,9 @@ public enum DispenseStatus implements HisEnumInterface {
IN_PROGRESS(3, "IN", "待发药"),
/**
* 已发药
* 已发药/已完成
*/
COMPLETED(4, "CO", "已发"),
COMPLETED(4, "CO", "已发药/已完成"),
/**
* 暂停
@@ -91,7 +91,17 @@ public enum DispenseStatus implements HisEnumInterface {
/**
* 已退药
*/
RETURNED(17, "RT", "已退药");
RETURNED(17, "RT", "已退药"),
/**
* 已执行
*/
EXECUTED(11, "EX", "已执行"),
/**
* 已提交
*/
SUBMITTED(18, "SB", "已提交");
private Integer value;
private String code;

View File

@@ -25,9 +25,9 @@ public enum RequestStatus implements HisEnumInterface {
ACTIVE(2, "active", "已发送"),
/**
* 已完成
* 已校对
*/
COMPLETED(3, "completed", "完成"),
COMPLETED(3, "completed", "校对"),
/**
* 暂停
@@ -72,7 +72,12 @@ public enum RequestStatus implements HisEnumInterface {
/**
* 已接收(检查申请:医技科室已接单)
*/
CHECK_RECEIVED(12, "check_received", "已接收");
CHECK_RECEIVED(12, "check_received", "已接收"),
/**
* 已完成(药品发药完成)
*/
DISPENSE_COMPLETED(20, "dispense_completed", "已完成");
@EnumValue
private final Integer value;

View File

@@ -8,10 +8,10 @@ import lombok.Getter;
*
* <pre>
* 状态流转:
* 预约 → 0→2 (锁定), locked_num+1
* 取消预约 → 2→0 (释放), locked_num-1
* 签到 → 2→1 (已), locked_num-1, booked_num+1
* 退号 → 1→0 (释放), booked_num-1
* 预约 → 0→2 (锁定), locked_num+1, booked_num+1
* 取消预约 → 2→0 (释放), refreshPoolStats 重算
* 签到 → 2→3 (已签到), locked_num-1
* 退号 → →0 (释放), refreshPoolStats 重算
* 停诊 → 任意→4 (已取消)
* </pre>
*

View File

@@ -0,0 +1,84 @@
package com.openhis.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 手术申请单状态枚举
* <p>
* 区别于 {@link SurgeryStatusEnum}(手术管理状态:待排期/已排期/手术中/已完成/已取消/暂停),
* 本枚举用于手术申请单的业务流转状态,覆盖从医生开立到手术完成的完整生命周期。
*
* <pre>
* 正向流转:
* 待签发(1) → 已签发(2) → 已校对(3) → 已执行(4) → 已安排(5) → 已完成(6)
*
* 逆向流转:
* 已签发(2) → 待签发(1) (医生撤回 / 护士退回)
* 已执行(4) → 已校对(3) (护士取消执行)
* 任意状态 → 已作废(10) (医生撤销)
* </pre>
*
* @author system
* @date 2026-06-02
*/
@Getter
@AllArgsConstructor
public enum SurgeryAppStatusEnum {
/** 待签发 — 医生已保存但尚未提交,仅在医生站可见 */
PENDING_SIGN(1, "待签发"),
/** 已签发 — 医生已提交,自动流转至护士工作站待校对 */
SIGNED(2, "已签发"),
/** 已校对 — 病区护士已校对手术医嘱 */
VERIFIED(3, "已校对"),
/** 已执行 — 病区护士已执行手术医嘱,已向手麻科提交申请 */
EXECUTED(4, "已执行"),
/** 已安排 — 手麻科已排好手术间及时间,待手术 */
SCHEDULED(5, "已安排"),
/** 已完成 — 手术已结束并录入完毕(终态只读) */
COMPLETED(6, "已完成"),
/** 已作废 — 医生中途撤销了手术申请(终态) */
CANCELLED(10, "已作废");
private final Integer code;
private final String info;
/**
* 根据状态码获取枚举
*
* @param code 状态码
* @return 对应的枚举,未匹配返回 null
*/
public static SurgeryAppStatusEnum getByCode(Integer code) {
if (code == null) {
return null;
}
for (SurgeryAppStatusEnum val : values()) {
if (val.getCode().equals(code)) {
return val;
}
}
return null;
}
/**
* 判断是否为终态(不可再变更)
*/
public boolean isFinal() {
return this == COMPLETED || this == CANCELLED;
}
/**
* 判断是否允许医生编辑
*/
public boolean isEditable() {
return this == PENDING_SIGN;
}
}

View File

@@ -24,7 +24,7 @@ public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
FROM adm_schedule_slot s
WHERE s.pool_id = p.id
AND s.delete_flag = '0'
AND s.status = #{bookedStatus}
AND s.status IN (#{bookedStatus}, #{lockedStatus}, 3)
), 0),
locked_num = COALESCE((
SELECT COUNT(1)
@@ -42,7 +42,7 @@ public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
@Param("lockedStatus") Integer lockedStatus);
/**
* 签到时更新号源池统计:锁定数-1,已预约数+1
* 签到时更新号源池统计:锁定数-1booked_num 在预约时已累加)
*
* @param poolId 号源池ID
* @return 结果
@@ -50,7 +50,6 @@ public interface SchedulePoolMapper extends BaseMapper<SchedulePool> {
@Update("""
UPDATE adm_schedule_pool
SET locked_num = locked_num - 1,
booked_num = booked_num + 1,
update_time = NOW()
WHERE id = #{poolId}
AND locked_num > 0

View File

@@ -267,7 +267,7 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
if (poolId != null) {
schedulePoolMapper.update(null,
new LambdaUpdateWrapper<SchedulePool>()
.setSql("locked_num = locked_num + 1, version = version + 1")
.setSql("locked_num = locked_num + 1, booked_num = booked_num + 1, version = version + 1")
.set(SchedulePool::getUpdateTime, new Date())
.eq(SchedulePool::getId, poolId));
}
@@ -329,16 +329,16 @@ public class TicketServiceImpl extends ServiceImpl<TicketMapper, Ticket> impleme
orderService.updateOrderStatusById(latestOrder.getId(), OrderStatus.ACTIVE.getValue());
orderMapper.updatePayStatus(latestOrder.getId(), 1, new Date());
// 2. 只有锁定态(2)的号源才能签到,签到时 2→1(LOCKED→BOOKED)
// 2. 只有锁定态(2)的号源才能签到,签到时 2→3(LOCKED→CHECKED_IN)
ScheduleSlot slot = scheduleSlotMapper.selectById(slotId);
if (slot == null || !SlotStatus.LOCKED.getValue().equals(slot.getStatus())) {
throw new RuntimeException("号源状态异常,无法签到");
}
// 3. 更新号源槽位状态 2→1LOCKED→BOOKED已预约=已签到)
scheduleSlotMapper.updateSlotStatusAndCheckInTime(slotId, SlotStatus.BOOKED.getValue(), new Date(), SlotStatus.LOCKED.getValue());
// 3. 更新号源槽位状态 2→3LOCKED→CHECKED_IN已签到)
scheduleSlotMapper.updateSlotStatusAndCheckInTime(slotId, SlotStatus.CHECKED_IN.getValue(), new Date(), SlotStatus.LOCKED.getValue());
// 4. 更新号源池统计:锁定数-1预约数+1
// 4. 更新号源池统计:锁定数-1签到数+1
if (slot != null && slot.getPoolId() != null) {
schedulePoolMapper.updatePoolStatsOnCheckIn(slot.getPoolId());
}

View File

@@ -112,7 +112,7 @@ public class MedicationRequest extends HisBaseEntity {
private String supportInfo;
/** 退回原因 */
private String backReason;
private String backReason = "";
/** 请求开始时间 */
private Date reqAuthoredTime;

View File

@@ -141,7 +141,7 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
// 药品发放id
medicationDispense.setBusNo(assignSeqUtil.getSeqByDay(AssignSeqEnum.MEDICATION_DIS_NO.getPrefix(), 4));
// 药品发放状态
medicationDispense.setStatusEnum(DispenseStatus.PREPARATION.getValue());
medicationDispense.setStatusEnum(DispenseStatus.EXECUTED.getValue());
// 状态变更时间
medicationDispense.setStatusChangedTime(DateUtils.getNowDate());
// 发药类型
@@ -300,7 +300,7 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
baseMapper.update(null,
new LambdaUpdateWrapper<MedicationDispense>()
.set(MedicationDispense::getStatusEnum,
DispenseStatus.SUMMARIZED.getValue())
DispenseStatus.SUBMITTED.getValue())
.set(MedicationDispense::getStatusChangedTime, DateUtils.getNowDate())
.set(MedicationDispense::getSummaryNo, busNo)
.in(MedicationDispense::getId, medDispenseId)
@@ -332,7 +332,7 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
int result = baseMapper.update(null,
new LambdaUpdateWrapper<MedicationDispense>()
.set(MedicationDispense::getStatusEnum,
DispenseStatus.PREPARATION.getValue())
DispenseStatus.EXECUTED.getValue())
.set(MedicationDispense::getSummaryNo, null)
.in(MedicationDispense::getSummaryNo, summaryNoList)
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode()));
@@ -368,6 +368,6 @@ public class MedicationDispenseServiceImpl extends ServiceImpl<MedicationDispens
.in(MedicationDispense::getSummaryNo, summaryNoList)
.eq(MedicationDispense::getDeleteFlag, DelFlag.NO.getCode())
.eq(MedicationDispense::getStatusEnum,
DispenseStatus.SUMMARIZED.getValue()));
DispenseStatus.SUBMITTED.getValue()));
}
}

View File

@@ -149,4 +149,12 @@ public interface IServiceRequestService extends IService<ServiceRequest> {
* @return 请求信息列表
*/
List<ServiceRequest> getServiceRequestListByEncounterId(Long encounterId);
/**
* 更新手术申请单状态(批量)
*
* @param serReqIdList 服务请求id列表
* @param statusCode 手术申请单状态码 (SurgeryAppStatusEnum)
*/
void updateSurgeryAppStatus(List<Long> serReqIdList, Integer statusCode);
}

View File

@@ -278,4 +278,19 @@ public class ServiceRequestServiceImpl extends ServiceImpl<ServiceRequestMapper,
return baseMapper.selectList(new LambdaQueryWrapper<ServiceRequest>()
.eq(ServiceRequest::getEncounterId, encounterId).eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
}
/**
* 更新手术申请单状态(批量)
*
* @param serReqIdList 服务请求id列表
* @param statusCode 手术申请单状态码 (SurgeryAppStatusEnum: 1=待签发,2=已签发,3=已校对,4=已执行,5=已安排,6=已完成,10=已作废)
*/
@Override
public void updateSurgeryAppStatus(List<Long> serReqIdList, Integer statusCode) {
baseMapper.update(null,
new LambdaUpdateWrapper<ServiceRequest>()
.set(ServiceRequest::getStatusEnum, statusCode)
.in(ServiceRequest::getId, serReqIdList)
.eq(ServiceRequest::getDeleteFlag, DelFlag.NO.getCode()));
}
}

View File

@@ -340,8 +340,8 @@
OR d.is_stopped = FALSE
)
</when>
<when test="'checked'.equals(query.status) or '已取号'.equals(query.status)">
AND <include refid="slotStatusNormExpr" /> = 1
<when test="'checked'.equals(query.status) or '已取号'.equals(query.status) or '已签到'.equals(query.status)">
AND (<include refid="slotStatusNormExpr" /> = 1 OR <include refid="slotStatusNormExpr" /> = 3)
AND (
d.is_stopped IS NULL
OR d.is_stopped = FALSE

View File

@@ -26,13 +26,13 @@
<java.version>17</java.version> <!-- 将21改为17 -->
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.27</druid.version>
<druid.version>1.2.28</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
<oshi.version>6.6.5</oshi.version>
<commons.io.version>2.13.0</commons.io.version>
<oshi.version>6.10.0</oshi.version>
<commons.io.version>2.21.0</commons.io.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
@@ -42,17 +42,17 @@
<lombok.version>1.18.34</lombok.version> <!-- 替换为 -->
<mybatis-plus.version>3.5.5</mybatis-plus.version>
<flowable.version>6.8.0</flowable.version>
<postgresql.version>42.2.27</postgresql.version>
<postgresql.version>42.7.4</postgresql.version>
<aviator.version>5.3.3</aviator.version>
<swagger-annotations.version>1.5.21</swagger-annotations.version>
<fastjson2.version>2.0.58</fastjson2.version>
<fastjson2.version>2.0.61</fastjson2.version>
<swagger-models.version>1.6.2</swagger-models.version>
<pinyin4j.version>2.5.1</pinyin4j.version>
<liteflow-spring-boot-starter.version>2.12.4.1</liteflow-spring-boot-starter.version>
<hutool-all.version>5.3.8</hutool-all.version>
<bcprov-jdk15on.version>1.69</bcprov-jdk15on.version>
<hutool-all.version>5.8.35</hutool-all.version>
<bcprov-jdk18on.version>1.80</bcprov-jdk18on.version>
<kernel.version>7.1.2</kernel.version>
<itextpdf.version>5.5.12</itextpdf.version>
<itextpdf.version>5.5.13.4</itextpdf.version>
<itext-asian.version>5.2.0</itext-asian.version>
<mysql-connector-j.version>9.4.0</mysql-connector-j.version>
<jsr250.version>1.3.2</jsr250.version>
@@ -93,8 +93,8 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>${bcprov-jdk15on.version}</version>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bcprov-jdk18on.version}</version>
</dependency>

View File

@@ -26,3 +26,4 @@ yarn.lock
test-results/
tests/e2e/report/
tests/tests/
vite.config.js.timestamp*

8352
openhis-ui-vue3/package-lock.json generated Executable file → Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,93 +1,88 @@
{
"name": "openhis",
"version": "3.8.10",
"description": "OpenHIS管理系统",
"author": "OpenHIS",
"license": "MIT",
"type": "module",
"scripts": {
"dev": "vite --mode dev",
"build:prod": "vite build --mode prod",
"build:stage": "vite build --mode staging",
"build:test": "vite build --mode test",
"build:dev": "vite build --mode dev",
"preview": "vite preview",
"build:spug": "vite build --mode spug",
"test": "vitest",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
"test:ui": "vitest --ui",
"lint": "eslint . --ext .js,.vue src/",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:report": "playwright show-report"
},
"repository": {
"type": "git",
"url": "giturl"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.2",
"@vueup/vue-quill": "1.2.0",
"@vueuse/core": "10.6.1",
"axios": "0.27.2",
"china-division": "^2.7.0",
"d3": "^7.9.0",
"dayjs": "^1.11.19",
"decimal.js": "^10.5.0",
"echarts": "^5.4.3",
"element-china-area-data": "^6.1.0",
"element-plus": "^2.12.0",
"file-saver": "^2.0.5",
"fuse.js": "^7.0.0",
"html2pdf.js": "^0.10.3",
"js-cookie": "^3.0.5",
"jsencrypt": "^3.3.2",
"json-bigint": "^1.0.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"moment": "^2.30.1",
"next": "^16.1.0",
"nprogress": "^0.2.0",
"pinia": "^2.2.0",
"pinyin": "^4.0.0-alpha.2",
"province-city-china": "^8.5.8",
"qrcode": "^1.5.4",
"qrcodejs2": "^0.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"segmentit": "^2.0.3",
"sortablejs": "^1.15.6",
"v-region": "^3.3.0",
"vue": "^3.5.13",
"vue-area-linkage": "^5.1.0",
"vue-cropper": "^1.1.1",
"vue-plugin-hiprint": "^0.0.19",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@playwright/test": "^1.58.2",
"@types/node": "^25.0.1",
"@vitejs/plugin-vue": "4.5.0",
"@vue/compiler-sfc": "3.3.9",
"@vue/test-utils": "^2.4.6",
"eslint": "^9.39.4",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-vue": "^10.9.0",
"globals": "^17.5.0",
"happy-dom": "^20.8.3",
"jsdom": "^28.1.0",
"pg": "^8.18.0",
"sass": "1.69.5",
"typescript": "^5.9.3",
"unplugin-auto-import": "0.17.1",
"unplugin-vue-setup-extend-plus": "1.0.0",
"vite": "5.0.4",
"vite-plugin-compression": "0.5.1",
"vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-mcp": "^0.3.2",
"vitest": "^4.0.18",
"vue-tsc": "^3.1.8"
}
}
"name": "openhis",
"version": "3.8.10",
"description": "OpenHIS管理系统",
"author": "OpenHIS",
"license": "MIT",
"type": "module",
"scripts": {
"dev": "vite --mode dev",
"build:prod": "vite build --mode prod",
"build:stage": "vite build --mode staging",
"build:test": "vite build --mode test",
"build:dev": "vite build --mode dev",
"preview": "vite preview",
"build:spug": "vite build --mode spug",
"test": "vitest",
"test:run": "vitest run",
"test:coverage": "vitest run --coverage",
"test:ui": "vitest --ui",
"lint": "eslint . --ext .js,.vue src/",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:report": "playwright show-report"
},
"repository": {
"type": "git",
"url": "giturl"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.2",
"@vue/shared": "^3.5.25",
"@vueup/vue-quill": "^1.5.1",
"@vueuse/core": "^14.3.0",
"axios": "^1.16.1",
"china-division": "^2.7.0",
"d3": "^7.9.0",
"dayjs": "^1.11.19",
"decimal.js": "^10.5.0",
"echarts": "^5.6.0",
"element-china-area-data": "^6.1.0",
"element-plus": "^2.14.1",
"file-saver": "^2.0.5",
"fuse.js": "^7.0.0",
"html2pdf.js": "^0.10.3",
"js-cookie": "^3.0.5",
"jsencrypt": "^3.3.2",
"json-bigint": "^1.0.0",
"lodash-es": "^4.17.21",
"nprogress": "^0.2.0",
"pinia": "^2.2.0",
"pinyin": "^4.0.0-alpha.2",
"province-city-china": "^8.5.8",
"qrcodejs2": "^0.0.2",
"segmentit": "^2.0.3",
"sortablejs": "^1.15.7",
"v-region": "^3.3.0",
"vue": "^3.5.25",
"vue-area-linkage": "^5.1.0",
"vue-cropper": "^1.1.1",
"vue-plugin-hiprint": "^0.0.60",
"vue-router": "^4.6.4",
"vxe-table": "^4.19.6",
"xe-utils": "^4.0.8"
},
"devDependencies": {
"@playwright/test": "^1.60.0",
"@types/node": "^25.0.1",
"@vitejs/plugin-vue": "^5.2.4",
"@vue/test-utils": "^2.4.6",
"eslint": "^10.4.1",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-vue": "^10.9.1",
"globals": "^17.5.0",
"happy-dom": "^20.8.3",
"jsdom": "^28.1.0",
"pg": "^8.18.0",
"sass": "^1.100.0",
"typescript": "^5.9.3",
"unplugin-auto-import": "^0.18.6",
"vite": "^6.4.3",
"vite-plugin-compression": "0.5.1",
"vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-mcp": "^0.3.2",
"vitest": "^4.0.18",
"vue-tsc": "^3.3.3"
}
}

View File

@@ -1,6 +1,5 @@
// 数据处理
// 数据处理
import * as d3 from 'd3';
import {symbol} from 'd3-shape';
import {
degreesOnline,
disconnectEvents,
@@ -142,7 +141,7 @@ export const iconDrawObj = {
})
.append('path')
.call((path) => {
const symbolThree = symbol();
const symbolThree = d3.symbol();
const symbolIndex = 5;
symbolThree.type(d3.symbols[symbolIndex]);
path.attr('d', symbolThree.size(riangle)).attr('fill', fill).attr('stroke', stroke);

View File

@@ -1,4 +1,4 @@
import moment from 'moment';
import dayjs from 'dayjs';
export function getG(svg, translateX, translateY) {
return svg.append('g').attr('transform', `translate(${translateX},${translateY})`);
@@ -228,7 +228,7 @@ export function getHeartRate(
function getIndex(beginDate, date, time) {
if (beginDate === undefined || date === undefined) return;
const diffTime =
moment(date.substring(0, 10)).diff(moment(beginDate.substring(0, 10))) / 1000 / 3600 / 24;
dayjs(date.substring(0, 10)).diff(dayjs(beginDate.substring(0, 10))) / 1000 / 3600 / 24;
const diffIndex = parseInt(time.substring(0, 2));
return diffTime * 6 + Math.floor(diffIndex / 4);
}

View File

@@ -1,6 +1,6 @@
import request from '@/utils/request'
// 登录方法
// 登录方法
export function login(username, password, code, uuid, tenantId) {
const data = {
username,
@@ -20,7 +20,7 @@ export function login(username, password, code, uuid, tenantId) {
})
}
// 注册方法
// 注册方法
export function register(data) {
return request({
url: '/register',
@@ -32,7 +32,7 @@ export function register(data) {
})
}
// 获取用户详细信息
// 获取用户详细信息
export function getInfo() {
return request({
url: '/getInfo',
@@ -40,7 +40,7 @@ export function getInfo() {
})
}
// 退出方法
// 退出方法
export function logout() {
return request({
url: '/logout',
@@ -48,9 +48,9 @@ export function logout() {
})
}
// 获取验证码
// 获取验证码
export function getUserBindTenantList(username) {
// 确保username存在避免构建出错误的URL
// 确保username存在ï¼Å避免构建出错误的URL
const safeUsername = username || '';
return request({
url: '/system/tenant/user-bind/' + safeUsername,
@@ -62,7 +62,7 @@ export function getUserBindTenantList(username) {
})
}
// 获取验证码
// 获取验证码
export function getCodeImg() {
return request({
url: '/captchaImage',
@@ -74,7 +74,7 @@ export function getCodeImg() {
})
}
// 获取当前登录用户所属科室
// 获取当前登录用户所属科室
export function getOrg() {
return request({
url: '/base-data-manage/practitioner/get-selectable-org-list',
@@ -82,7 +82,7 @@ export function getOrg() {
})
}
// 切换科室
// 切换科室
export function switchOrg(orgId) {
return request({
url: '/base-data-manage/practitioner/switch-org?orgId=' + orgId,
@@ -90,10 +90,18 @@ export function switchOrg(orgId) {
})
}
// 医保签到
// 医保签到
export function sign(practitionerId, mac, ip) {
return request({
url: `/yb-request/sign?practitionerId=${practitionerId}&mac=${mac}&ip=${ip}`,
method: 'post',
})
}
}
// 锁屏解锁(验证登录状态)
export function unlockScreen(password) {
return request({
url: '/getInfo',
method: 'get'
})
}

View File

@@ -108,3 +108,29 @@ export function getReadNoticeIds() {
method: 'get'
})
}
// 获取顶部公告/通知列表最新N条
export function listNoticeTop(query) {
return request({
url: '/system/notice/public/top',
method: 'get',
params: query
})
}
// 标记单条公告/通知为已读
export function markNoticeRead(noticeId) {
return request({
url: '/system/notice/public/read/' + noticeId,
method: 'post'
})
}
// 批量标记公告/通知为已读逗号分隔的ID字符串
export function markNoticeReadAll(noticeIds) {
return request({
url: '/system/notice/public/read/all',
method: 'post',
data: noticeIds
})
}

View File

@@ -1,3 +1,4 @@
@use 'sass:color';
@import './variables.module.scss';
// Element Plus风格的颜色按钮样式
@@ -22,14 +23,14 @@
&:hover,
&:focus {
background-color: lighten($color, 10%);
border-color: lighten($color, 10%);
background-color: color.adjust($color, $lightness: 10%);
border-color: color.adjust($color, $lightness: 10%);
color: #fff;
}
&:active {
background-color: darken($color, 5%);
border-color: darken($color, 5%);
background-color: color.adjust($color, $lightness: -5%);
border-color: color.adjust($color, $lightness: -5%);
color: #fff;
}
@@ -90,7 +91,7 @@
&:hover,
&:focus {
color: #409eff;
color: #3B82F6;
border-color: #c6e2ff;
background-color: #ecf5ff;
}
@@ -149,7 +150,7 @@
// 不同颜色的链接按钮
.blue-btn-link {
@extend .pan-btn-link;
color: #409eff;
color: #3B82F6;
&:hover,
&:focus {
@@ -159,7 +160,7 @@
.red-btn-link {
@extend .pan-btn-link;
color: #f56c6c;
color: #EF4444;
&:hover,
&:focus {
@@ -169,7 +170,7 @@
.info-btn-link {
@extend .pan-btn-link;
color: #909399;
color: #64748B;
&:hover,
&:focus {

View File

@@ -1,4 +1,4 @@
@import './variables.module.scss';
@import './variables.module.scss';
@import './mixin.scss';
@import './transition.scss';
@import './element-ui.scss';
@@ -7,6 +7,8 @@
@import './openhis.scss';
@import './font.scss';
@import './ui-standard.scss';
@import './vxe-table.scss';
@import './screen-1080p.scss';
/* 强制使用鸿蒙字体 */
* {

View File

@@ -145,7 +145,7 @@
/** 表格更多操作下拉样式 */
.el-table .el-dropdown-link {
cursor: pointer;
color: #409EFF;
color: #3B82F6;
margin-left: 10px;
}

View File

@@ -0,0 +1,90 @@
/**
* 1080P 最小分辨率适配
* 目标1920x1080 下表格尽量多显示行页面用滚动条而非溢出
*/
// === 全局容器 ===
html, body, #app {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
// === 主内容区 ===
.app-container {
padding: 12px 16px !important;
height: calc(100vh - 84px);
overflow-y: auto;
overflow-x: hidden;
box-sizing: border-box;
}
// === 卡片间距压缩 ===
.el-card {
margin-bottom: 12px;
.el-card__body {
padding: 12px 16px;
}
}
// === 表单区域压缩 ===
.el-form--inline {
.el-form-item {
margin-bottom: 8px;
}
}
// === 表格区高度自适应 ===
.table-container {
height: 100%;
min-height: 300px;
}
// === 按钮栏紧凑 ===
.el-button + .el-button {
margin-left: 6px;
}
// === 弹窗适配 ===
.el-dialog {
.el-dialog__body {
padding: 12px 20px;
max-height: calc(100vh - 200px);
overflow-y: auto;
}
}
// === 分页栏紧凑 ===
.pagination-container {
margin-top: 8px;
padding: 4px 0;
}
// === 1080P表格列紧凑允许横向滚动 ===
@media (max-width: 1920px) {
.vxe-table {
// 1080P 下不强制撑满,允许滚动
.vxe-table--body-x-wrapper {
overflow-x: auto;
}
}
}
// === 大于 1080P表格列自动撑满 ===
@media (min-width: 1921px) {
.vxe-table {
// 列宽自动分配,填满容器
table-layout: auto;
width: 100% !important;
.vxe-header--column,
.vxe-body--column {
// 有 min-width 的列自动扩展
&[style*="min-width"] {
flex: 1;
}
}
}
}

View File

@@ -245,7 +245,7 @@
padding: 60px 0;
&__description {
color: #909399;
color: #64748B;
font-size: 14px;
margin-top: 16px;
}
@@ -285,23 +285,23 @@
14. 工具类
============================================ */
.text-primary {
color: #409eff;
color: #3B82F6;
}
.text-success {
color: #67c23a;
color: #10B981;
}
.text-warning {
color: #e6a23c;
color: #F59E0B;
}
.text-danger {
color: #f56c6c;
color: #EF4444;
}
.text-info {
color: #909399;
color: #64748B;
}
.text-regular {
@@ -309,7 +309,7 @@
}
.text-secondary {
color: #909399;
color: #64748B;
}
/* ============================================

View File

@@ -8,39 +8,24 @@ $tiffany: #4AB7BD;
$yellow: #FEC171;
$panGreen: #30B08F;
// 默认菜单主题风格
$base-menu-color: #bfcbd9;
$base-menu-color-active: #f4f4f5;
$base-menu-background: #304156;
// 菜单主题风格 — 微调为更深邃的午夜蓝
$base-menu-color: rgba(255, 255, 255, 0.65);
$base-menu-color-active: #FFFFFF;
$base-menu-background: #0F172A;
$base-logo-title-color: #ffffff;
$base-menu-light-color: rgba(0, 0, 0, 0.7);
$base-menu-light-background: #ffffff;
$base-logo-light-title-color: #001529;
$base-sub-menu-background: #1f2d3d;
$base-sub-menu-hover: #001528;
$base-sub-menu-background: #0C1322;
$base-sub-menu-hover: #1E293B;
// 自定义暗色菜单风格
/**
$base-menu-color:hsla(0,0%,100%,.65);
$base-menu-color-active:#fff;
$base-menu-background:#001529;
$base-logo-title-color: #ffffff;
$base-menu-light-color:rgba(0,0,0,.70);
$base-menu-light-background:#ffffff;
$base-logo-light-title-color: #001529;
$base-sub-menu-background:#000c17;
$base-sub-menu-hover:#001528;
*/
$--color-primary: #409EFF;
$--color-success: #67C23A;
$--color-warning: #E6A23C;
$--color-danger: #F56C6C;
$--color-info: #909399;
$--color-primary: #3B82F6;
$--color-success: #10B981;
$--color-warning: #F59E0B;
$--color-danger: #EF4444;
$--color-info: #64748B;
// 侧边栏宽度(垂直菜单)
$sideBarWidth: 200px;
@@ -49,8 +34,6 @@ $base-sidebar-width: $sideBarWidth;
// Logo高度
$logoHeight: 50px;
// the :export directive is the magic sauce for webpack
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
:export {
menuColor: $base-menu-color;
menuLightColor: $base-menu-light-color;
@@ -67,4 +50,4 @@ $logoHeight: 50px;
dangerColor: $--color-danger;
infoColor: $--color-info;
warningColor: $--color-warning;
}
}

View File

@@ -0,0 +1,212 @@
/**
* vxe-table 样式适配 Element Plus 视觉风格统一
*/
// === 变量对齐 Element Plus 默认主题 ===
$vxe-header-bg: #f5f7fa;
$vxe-header-color: #303133;
$vxe-header-font-weight: 600;
$vxe-row-hover-bg: #f5f7fa;
$vxe-stripe-bg: #fafafa;
$vxe-border-color: #ebeef5;
$vxe-font-size: 14px;
$vxe-cell-padding: 0 8px;
$vxe-row-height: 40px;
$vxe-header-height: 40px;
$vxe-radius: 4px;
// === 全局覆盖 ===
.vxe-table {
font-family: 'HarmonyOS Sans', 'Helvetica Neue', Helvetica, 'PingFang SC',
'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif !important;
font-size: $vxe-font-size;
color: #303133;
border-radius: $vxe-radius;
// --- 边框 ---
&.vxe-table--border {
border: 1px solid $vxe-border-color;
.vxe-header--column,
.vxe-body--column {
border-right: 1px solid $vxe-border-color;
border-bottom: 1px solid $vxe-border-color;
}
}
// --- 表头 ---
.vxe-header--column {
background-color: $vxe-header-bg;
color: $vxe-header-color;
font-weight: $vxe-header-font-weight;
padding: $vxe-cell-padding;
min-height: $vxe-header-height;
line-height: 1.4;
font-size: $vxe-font-size;
.vxe-cell {
white-space: normal;
word-break: break-all;
overflow: visible;
}
}
.vxe-header--row {
background-color: $vxe-header-bg;
}
// --- 表体行 ---
.vxe-body--row {
&:hover,
&.row--hover {
background-color: $vxe-row-hover-bg;
}
&.row--stripe {
background-color: $vxe-stripe-bg;
&:hover,
&.row--hover {
background-color: $vxe-row-hover-bg;
}
}
&.row--current {
background-color: #ecf5ff;
}
}
// --- 单元格 ---
.vxe-body--column {
padding: $vxe-cell-padding;
height: $vxe-row-height;
line-height: $vxe-row-height;
font-size: $vxe-font-size;
color: #303133;
&.col--ellipsis {
.vxe-cell {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
.vxe-cell {
padding: 0;
}
// --- 让 el-select / el-input 等表单组件在单元格内正常展示 ---
.vxe-body--column {
.el-select,
.el-input,
.el-input-number,
.el-date-picker {
width: 100%;
}
.el-select .el-input__inner,
.el-input__inner {
height: 32px;
line-height: 32px;
}
}
// --- 禁用 show-overflow 对含表单组件的列的影响 ---
.vxe-body--column.col--ellipsis {
// 如果列内有表单组件,取消 ellipsis
.el-select,
.el-input,
.el-input-number,
.el-date-editor {
.vxe-cell {
overflow: visible;
white-space: normal;
}
}
}
// --- 复选框列 ---
.vxe-cell--checkbox {
.vxe-checkbox--icon {
width: 14px;
height: 14px;
border: 1px solid #dcdfe6;
border-radius: 2px;
background-color: #fff;
&.is--checked {
background-color: #409eff;
border-color: #409eff;
}
}
}
// --- 序号列 ---
.vxe-cell--seq {
color: #606266;
font-size: $vxe-font-size;
}
// --- 空数据 ---
.vxe-table--empty-placeholder {
color: #909399;
font-size: $vxe-font-size;
}
// --- 展开行 ---
.vxe-table--expanded {
background-color: #fafafa;
}
// --- 固定列阴影 ---
.vxe-table--fixed-left-wrapper {
box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.12);
}
.vxe-table--fixed-right-wrapper {
box-shadow: -6px 0 6px -4px rgba(0, 0, 0, 0.12);
}
}
// === 让 vxe-table 在容器中撑满 ===
.table-wrapper,
.table-container {
.vxe-table {
width: 100% !important;
}
}
// === 行级 hover 优先于单元格 hover ===
.vxe-table--body-wrapper {
.vxe-body--row:hover > td {
background-color: transparent;
}
}
// === 紧凑模式 ===
.vxe-table.vxe-table--size.small,
.vxe-table.size--small {
.vxe-header--column,
.vxe-body--column {
padding: 0 10px;
height: 32px;
line-height: 32px;
font-size: 13px;
}
}
// === 下拉弹出层不受表格 overflow 影响 ===
.vxe-table {
overflow: visible !important;
.vxe-table--body-wrapper,
.vxe-table--header-wrapper {
overflow: visible !important;
}
.vxe-table--body-x-wrapper,
.vxe-table--body-y-wrapper {
overflow: auto;
}
}

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div
class="pf_card"
:style="{
@@ -38,7 +38,7 @@
</div>
<div class="pf_card_rescueTime">
<span style="margin-right: 16px">入室时间</span>
{{ moment(data.checkInWardTime).format('YYYY-MM-DD HH:mm') }}
{{ dayjs(data.checkInWardTime).format('YYYY-MM-DD HH:mm') }}
</div>
<div class="pf_card_noCode">
{{ data.hisId }}
@@ -156,19 +156,19 @@ export default {
},
isNewSign() {
const ytime = this.data.checkInWardTime
const hour = this.moment().diff(ytime, 'hours')
const hour = this.dayjs().diff(ytime, 'hours')
return hour < 24
},
is72HourSign() {
const ytime = this.data.checkInWardTime
const hour = this.moment().diff(ytime, 'hours')
const hour = this.dayjs().diff(ytime, 'hours')
return hour > 72
},
rescueTimeText() {
const ytime = this.data.checkInWardTime
const days = this.moment().diff(ytime, 'days')
const hour = this.moment().diff(ytime, 'hours')
const minutes = this.moment().diff(ytime, 'minutes')
const days = this.dayjs().diff(ytime, 'days')
const hour = this.dayjs().diff(ytime, 'hours')
const minutes = this.dayjs().diff(ytime, 'minutes')
if (hour >= 24) {
return days + '天' + hour % 24 + '时' + minutes % 60 + '分'
} else

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="recordBill">
<div
id="div1"
@@ -166,7 +166,7 @@ export default {
height: 200px !important;
width: 740px;
/deep/ .el-table .cell {
:deep(.vxe-cell) {
font-size: 10px !important;
}
.printView_header {

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="recordBill">
<div
:id="'exeSheetTitle' + printData.id"
@@ -230,7 +230,7 @@ export default {
height: 500px !important;
width: 680px;
/deep/ .el-table .cell {
:deep(.vxe-cell) {
font-size: 10px !important;
}
.printView_header {

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div ref="print">
<div class="printInjectCard">
<div :id="printData.id + 'div1'">
@@ -68,7 +68,7 @@
</div>
<div :id="printData.id + 'div3'">
<span>日期</span>
<span>{{ moment().format('YYYY-MM-DD HH:mm') }}</span>
<span>{{ dayjs().format('YYYY-MM-DD HH:mm') }}</span>
</div>
</div>
</div>
@@ -76,7 +76,7 @@
<script>
// 迁移到 hiprint
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
import moment from 'moment'
import dayjs from 'dayjs'
export default {
name: 'VuePrintNb',
@@ -124,7 +124,7 @@ export default {
priority: this.printData.priority || '',
qrCode: qrCode,
orderDetail: formattedOrderDetail,
printDate: moment().format('YYYY-MM-DD HH:mm')
printDate: dayjs().format('YYYY-MM-DD HH:mm')
}
// 使用 hiprint 打印
await simplePrint(PRINT_TEMPLATE.INJECT_LABEL, printData, printerName)

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="recordBill">
<div
id="div1"
@@ -174,7 +174,7 @@ export default {
height: 200px !important;
width: 680px;
/deep/ .el-table .cell {
:deep(.vxe-cell) {
font-size: 10px !important;
}
.printView_header {

View File

@@ -2,8 +2,7 @@
<el-form>
<el-form-item>
<el-radio
v-model="radioValue"
:label="1"
v-model="radioValue" :value="1"
>
允许的通配符[, - * ? / L W]
</el-radio>
@@ -11,8 +10,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="2"
v-model="radioValue" :value="2"
>
不指定
</el-radio>
@@ -20,8 +18,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="3"
v-model="radioValue" :value="3"
>
周期从
<el-input-number
@@ -39,8 +36,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="4"
v-model="radioValue" :value="4"
>
<el-input-number
@@ -58,8 +54,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="5"
v-model="radioValue" :value="5"
>
每月
<el-input-number
@@ -72,8 +67,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="6"
v-model="radioValue" :value="6"
>
本月最后一天
</el-radio>
@@ -81,8 +75,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="7"
v-model="radioValue" :value="7"
>
指定
<el-select

View File

@@ -2,8 +2,7 @@
<el-form>
<el-form-item>
<el-radio
v-model="radioValue"
:label="1"
v-model="radioValue" :value="1"
>
小时允许的通配符[, - * /]
</el-radio>
@@ -11,8 +10,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="2"
v-model="radioValue" :value="2"
>
周期从
<el-input-number
@@ -30,8 +28,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="3"
v-model="radioValue" :value="3"
>
<el-input-number
@@ -49,8 +46,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="4"
v-model="radioValue" :value="4"
>
指定
<el-select

View File

@@ -2,8 +2,7 @@
<el-form>
<el-form-item>
<el-radio
v-model="radioValue"
:label="1"
v-model="radioValue" :value="1"
>
分钟允许的通配符[, - * /]
</el-radio>
@@ -11,8 +10,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="2"
v-model="radioValue" :value="2"
>
周期从
<el-input-number
@@ -30,8 +28,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="3"
v-model="radioValue" :value="3"
>
<el-input-number
@@ -49,8 +46,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="4"
v-model="radioValue" :value="4"
>
指定
<el-select

View File

@@ -2,8 +2,7 @@
<el-form>
<el-form-item>
<el-radio
v-model="radioValue"
:label="1"
v-model="radioValue" :value="1"
>
允许的通配符[, - * /]
</el-radio>
@@ -11,8 +10,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="2"
v-model="radioValue" :value="2"
>
周期从
<el-input-number
@@ -30,8 +28,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="3"
v-model="radioValue" :value="3"
>
<el-input-number
@@ -49,8 +46,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="4"
v-model="radioValue" :value="4"
>
指定
<el-select

View File

@@ -2,8 +2,7 @@
<el-form>
<el-form-item>
<el-radio
v-model="radioValue"
:label="1"
v-model="radioValue" :value="1"
>
允许的通配符[, - * /]
</el-radio>
@@ -11,8 +10,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="2"
v-model="radioValue" :value="2"
>
周期从
<el-input-number
@@ -30,8 +28,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="3"
v-model="radioValue" :value="3"
>
<el-input-number
@@ -49,8 +46,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="4"
v-model="radioValue" :value="4"
>
指定
<el-select

View File

@@ -2,8 +2,7 @@
<el-form>
<el-form-item>
<el-radio
v-model="radioValue"
:label="1"
v-model="radioValue" :value="1"
>
允许的通配符[, - * ? / L #]
</el-radio>
@@ -11,8 +10,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="2"
v-model="radioValue" :value="2"
>
不指定
</el-radio>
@@ -20,8 +18,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="3"
v-model="radioValue" :value="3"
>
周期从
<el-select
@@ -58,8 +55,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="4"
v-model="radioValue" :value="4"
>
<el-input-number
@@ -83,8 +79,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="5"
v-model="radioValue" :value="5"
>
本月最后一个
<el-select
@@ -103,8 +98,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="6"
v-model="radioValue" :value="6"
>
指定
<el-select

View File

@@ -2,8 +2,7 @@
<el-form>
<el-form-item>
<el-radio
v-model="radioValue"
:label="1"
v-model="radioValue" :value="1"
>
不填允许的通配符[, - * /]
</el-radio>
@@ -11,8 +10,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="2"
v-model="radioValue" :value="2"
>
每年
</el-radio>
@@ -20,8 +18,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="3"
v-model="radioValue" :value="3"
>
周期从
<el-input-number
@@ -39,8 +36,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="4"
v-model="radioValue" :value="4"
>
<el-input-number
@@ -58,8 +54,7 @@
<el-form-item>
<el-radio
v-model="radioValue"
:label="5"
v-model="radioValue" :value="5"
>
指定
<el-select

View File

@@ -0,0 +1,137 @@
<template>
<el-dialog :title="title" v-model="visible" :width="width" append-to-body @close="handleClose">
<el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="headers" :action="uploadUrl" :disabled="isUploading" :on-progress="handleProgress" :on-change="handleFileChange" :on-remove="handleFileRemove" :on-success="handleSuccess" :auto-upload="false" drag>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip>
<div class="el-upload__tip text-center">
<div class="el-upload__tip">
<el-checkbox v-model="updateSupport"> {{ updateSupportLabel }} </el-checkbox>
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link v-if="templateUrl" type="primary" underline="never" style="font-size: 12px; vertical-align: baseline" @click="handleDownloadTemplate">下载模板</el-link>
</div>
</template>
</el-upload>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleSubmit"> </el-button>
<el-button @click="visible = false"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { getToken } from '@/utils/auth'
const { proxy } = getCurrentInstance()
const props = defineProps({
// 对话框标题
title: {
type: String,
default: '数据导入'
},
// 对话框宽度
width: {
type: String,
default: '400px'
},
// 上传接口地址(必传)
action: {
type: String,
required: true
},
// 模板下载接口地址,不传则不显示下载模板链接
templateAction: {
type: String,
default: ''
},
// 模板文件名前缀
templateFileName: {
type: String,
default: 'template'
},
// 覆盖更新勾选框的说明文字
updateSupportLabel: {
type: String,
default: '是否更新已经存在的数据'
}
})
const emit = defineEmits(['success'])
const uploadRef = ref(null)
const visible = ref(false)
const selectedFile = ref(null)
const isUploading = ref(false)
const updateSupport = ref(false)
const headers = { Authorization: 'Bearer ' + getToken() }
const uploadUrl = computed(() => {
return import.meta.env.VITE_APP_BASE_API + props.action + '?updateSupport=' + (updateSupport.value ? 1 : 0)
})
const templateUrl = computed(() => !!props.templateAction)
// 打开对话框(供父组件通过 ref 调用)
function open() {
updateSupport.value = false
isUploading.value = false
visible.value = true
nextTick(() => {
selectedFile.value = null
uploadRef.value?.clearFiles()
})
}
// 关闭时清理
function handleClose() {
isUploading.value = false
selectedFile.value = null
uploadRef.value?.clearFiles()
}
// 下载模板
function handleDownloadTemplate() {
proxy.download(props.templateAction, {}, `${props.templateFileName}_${new Date().getTime()}.xlsx`)
}
// 上传进度
function handleProgress() {
isUploading.value = true
}
/** 文件选择处理 */
const handleFileChange = (file, fileList) => {
selectedFile.value = file
}
/** 文件删除处理 */
const handleFileRemove = (file, fileList) => {
selectedFile.value = null
}
// 上传成功
function handleSuccess(response) {
visible.value = false
isUploading.value = false
selectedFile.value = null
uploadRef.value?.clearFiles()
proxy.$alert("<div style='overflow:auto;overflow-x:hidden;max-height:70vh;padding:10px 20px 0;'>" + response.msg + '</div>', '导入结果', { dangerouslyUseHTMLString: true })
emit('success')
}
// 提交上传
function handleSubmit() {
const file = selectedFile.value
if (!file || file.length === 0 || !file.name.toLowerCase().endsWith('.xls') && !file.name.toLowerCase().endsWith('.xlsx')) {
proxy.$modal.msgError("请选择后缀为 “xls”或“xlsx”的文件。")
return
}
uploadRef.value.submit()
}
defineExpose({ open })
</script>

View File

@@ -26,10 +26,10 @@
>
请上传
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
大小不超过 <b style="color: #EF4444">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
格式为 <b style="color: #EF4444">{{ fileType.join("/") }}</b>
</template>
的文件
</div>

View File

@@ -85,7 +85,7 @@ const realHeight = computed(() =>
align-items: center;
width: 100%;
height: 100%;
color: #909399;
color: #64748B;
font-size: 30px;
}
}

View File

@@ -28,10 +28,10 @@
>
请上传
<template v-if="fileSize">
大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
大小不超过 <b style="color: #EF4444">{{ fileSize }}MB</b>
</template>
<template v-if="fileType">
格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
格式为 <b style="color: #EF4444">{{ fileType.join("/") }}</b>
</template>
的文件
</div>

View File

@@ -263,7 +263,7 @@ defineExpose({
&.is-read {
.notice-title {
color: #909399;
color: #64748B;
}
}
@@ -284,7 +284,7 @@ defineExpose({
display: inline-block;
width: 6px;
height: 6px;
background-color: #f56c6c;
background-color: #EF4444;
border-radius: 50%;
margin-right: 8px;
flex-shrink: 0;
@@ -296,7 +296,7 @@ defineExpose({
justify-content: space-between;
align-items: center;
font-size: 12px;
color: #909399;
color: #64748B;
gap: 8px;
.notice-type,
@@ -321,7 +321,7 @@ defineExpose({
.detail-time {
font-size: 12px;
color: #909399;
color: #64748B;
}
.detail-content {

View File

@@ -579,7 +579,7 @@ defineExpose({
.priority-low {
background: #f0f2f5;
color: #909399;
color: #64748B;
border-color: #dcdfe6;
&:hover {

View File

@@ -481,20 +481,20 @@ defineExpose({
// 优先级标签样式
.priority-high {
color: #f56c6c;
border-color: #f56c6c;
color: #EF4444;
border-color: #EF4444;
background: #fef0f0;
}
.priority-medium {
color: #e6a23c;
border-color: #e6a23c;
color: #F59E0B;
border-color: #F59E0B;
background: #fdf6ec;
}
.priority-low {
color: #909399;
border-color: #909399;
color: #64748B;
border-color: #64748B;
background: #f4f4f5;
}
@@ -612,7 +612,7 @@ defineExpose({
.priority-low {
background: #f0f2f5;
color: #909399;
color: #64748B;
border-color: #dcdfe6;
&:hover {

View File

@@ -95,7 +95,7 @@
justify-content: center;
width: 16px;
height: 16px;
background: #f56c6c;
background: #EF4444;
border-radius: 50%;
cursor: pointer;
"

View File

@@ -303,15 +303,15 @@ const getStatusColor = (statusEnum?: number): string => {
switch (statusEnum) {
case 2: // REGISTERED - 待入科
return '#E6A23C'; // 橙色
return '#F59E0B'; // 橙色
case 3: // AWAITING_DISCHARGE - 待出院
return '#F56C6C'; // 红色
return '#EF4444'; // 红色
case 4: // DISCHARGED_FROM_HOSPITAL - 待出院结算
return '#909399'; // 灰色
return '#64748B'; // 灰色
case 5: // ADMITTED_TO_THE_HOSPITAL - 已入院
return '#67C23A'; // 绿色
return '#10B981'; // 绿色
case 6: // PENDING_TRANSFER - 待转科
return '#409EFF'; // 蓝色
return '#3B82F6'; // 蓝色
default:
return '';
}

View File

@@ -1,4 +1,4 @@
<template>
<template>
<el-form ref="formRef" :model="{ tableData }" :rules="rules" class="editable-table-form">
<div
v-if="showAddButton || showDeleteButton || searchFields.length > 0"
@@ -33,22 +33,25 @@
</el-input>
</div>
</div>
<el-table
<vxe-table
ref="tableRef"
:data="filteredTableData"
:border="border"
:border="border ? 'full' : false"
:stripe="stripe"
:max-height="maxHeight || undefined"
:min-height="minHeight || undefined"
:height="!maxHeight && !minHeight ? '100%' : undefined"
:row-key="getRowKey"
:virtualized="useVirtualized"
:row-config="{ keyField: '_etKey' }"
:scroll-x="{ enabled: true }"
:scroll-y="{ enabled: true }"
:show-overflow="true"
v-bind="$attrs"
@selection-change="handleSelectionChange"
@checkbox-change="handleSelectionChange"
@checkbox-all="handleSelectionChange"
class="editable-table-inner"
>
<el-table-column v-if="showSelection" type="selection" width="55" align="center" />
<el-table-column
<vxe-column v-if="showSelection" type="checkbox" width="55" align="center" />
<vxe-column
v-if="showRowActions"
:width="rowActionsColumnWidth"
align="center"
@@ -65,14 +68,14 @@
</div>
<span v-else></span>
</template>
<template #default="scope">
<template #default="{ row, rowIndex }">
<el-button
v-if="showRowAddButton"
type="primary"
link
icon="CirclePlus"
class="action-btn"
@click="handleAdd(scope.$index)"
@click="handleAdd(rowIndex)"
title="增加"
/>
<el-button
@@ -81,38 +84,37 @@
link
icon="Delete"
class="action-btn"
@click="handleDelete(scope.$index)"
@click="handleDelete(rowIndex)"
title="删除"
/>
</template>
</el-table-column>
</vxe-column>
<el-table-column
<vxe-column
v-for="col in filteredColumns"
:key="col.prop"
:prop="col.prop"
:label="col.label"
:field="col.prop"
:title="col.label"
:width="col.width"
:min-width="col.minWidth"
:fixed="col.fixed"
:align="col.align || 'center'"
:formatter="col.formatter"
>
<template #default="scope">
<template #default="{ row, rowIndex }">
<template v-if="col.type === 'input'">
<el-form-item
:prop="`tableData.${scope.$index}.${col.prop}`"
:prop="`tableData.${rowIndex}.${col.prop}`"
:rules="col.rules"
style="margin-bottom: 0"
>
<el-input
v-model="scope.row[col.prop]"
v-model="row[col.prop]"
:placeholder="col.placeholder || `请输入${col.label}`"
:disabled="col.disabled"
:clearable="col.clearable !== false"
@blur="col.onBlur && col.onBlur(scope.row, scope.$index)"
@input="col.onInput && col.onInput(scope.row, scope.$index)"
@change="col.onChange && col.onChange(scope.row, scope.$index)"
@blur="col.onBlur && col.onBlur(row, rowIndex)"
@input="col.onInput && col.onInput(row, rowIndex)"
@change="col.onChange && col.onChange(row, rowIndex)"
>
<template v-if="col.suffix" #suffix>{{ col.suffix }}</template>
</el-input>
@@ -121,12 +123,12 @@
<template v-else-if="col.type === 'number'">
<el-form-item
:prop="`tableData.${scope.$index}.${col.prop}`"
:prop="`tableData.${rowIndex}.${col.prop}`"
:rules="col.rules"
style="margin-bottom: 0"
>
<el-input-number
v-model="scope.row[col.prop]"
v-model="row[col.prop]"
:placeholder="col.placeholder || `请输入${col.label}`"
:disabled="col.disabled"
:min="col.min"
@@ -134,49 +136,49 @@
:precision="col.precision"
:controls="false"
style="width: 100%"
@change="col.onChange && col.onChange(scope.row, scope.$index)"
@change="col.onChange && col.onChange(row, rowIndex)"
/>
</el-form-item>
</template>
<template v-else-if="col.type === 'select'">
<el-form-item
:prop="`tableData.${scope.$index}.${col.prop}`"
:prop="`tableData.${rowIndex}.${col.prop}`"
:rules="col.rules"
style="margin-bottom: 0"
>
<el-select
v-model="scope.row[col.prop]"
v-model="row[col.prop]"
:placeholder="col.placeholder || `请选择${col.label}`"
:disabled="col.disabled"
:clearable="col.clearable !== false"
:filterable="col.filterable"
:multiple="col.multiple"
style="width: 100%"
:class="scope.row.error ? 'error-border' : ''"
:class="row.error ? 'error-border' : ''"
@change="
async (value) => {
const checkBeforeChange = col.extraprops?.checkBeforeChange;
if (checkBeforeChange && typeof checkBeforeChange === 'function') {
const result = await checkBeforeChange(scope.row, scope.$index, value);
const result = await checkBeforeChange(row, rowIndex, value);
if (result === false) {
return;
}
}
if (col.onChange) {
col.onChange(scope.row, scope.$index, value);
col.onChange(row, rowIndex, value);
}
}
"
>
<el-option
v-for="option in typeof col.options === 'function'
? col.options(scope.row, scope.$index)
? col.options(row, rowIndex)
: col.options || []"
:key="option.value"
:label="option.label"
:value="option.value"
@click="option.onClick && option.onClick(scope.row, option)"
@click="option.onClick && option.onClick(row, option)"
/>
</el-select>
</el-form-item>
@@ -184,43 +186,43 @@
<template v-else-if="col.type === 'date'">
<el-form-item
:prop="`tableData.${scope.$index}.${col.prop}`"
:prop="`tableData.${rowIndex}.${col.prop}`"
:rules="col.rules"
style="margin-bottom: 0"
>
<el-date-picker
v-model="scope.row[col.prop]"
v-model="row[col.prop]"
:type="col.dateType || 'date'"
:placeholder="col.placeholder || `请选择${col.label}`"
:disabled="col.disabled"
:clearable="col.clearable !== false"
:value-format="col.valueFormat || 'YYYY-MM-DD'"
style="width: 100%"
@change="col.onChange && col.onChange(scope.row, scope.$index)"
@change="col.onChange && col.onChange(row, rowIndex)"
/>
</el-form-item>
</template>
<template v-else-if="col.type === 'slot'">
<el-form-item
:prop="`tableData.${scope.$index}.${col.prop}`"
:prop="`tableData.${rowIndex}.${col.prop}`"
:rules="col.rules"
style="margin-bottom: 0"
>
<slot :name="col.slot || col.prop" :row="scope.row" :index="scope.$index" />
<slot :name="col.slot || col.prop" :row="row" :index="rowIndex" />
</el-form-item>
</template>
<template v-else>
<span>{{
col.formatter
? col.formatter(scope.row, scope.column, scope.row[col.prop])
: scope.row[col.prop]
? col.formatter(row, { property: col.prop }, row[col.prop])
: row[col.prop]
}}</span>
</template>
</template>
</el-table-column>
</el-table>
</vxe-column>
</vxe-table>
<div v-if="$slots.footer" class="editable-table-footer">
<slot name="footer" :tableData="tableData" />
</div>
@@ -261,8 +263,8 @@ const emit = defineEmits<{
'toolbar-delete': [rows: Record<string, any>[]];
}>();
const formRef = ref<InstanceType<typeof import('element-plus').ElForm> | null>(null);
const tableRef = ref<InstanceType<typeof import('element-plus').ElTable> | null>(null);
const formRef = ref<any>(null);
const tableRef = ref<any>(null);
const selectedRows = ref<Record<string, any>[]>([]);
const searchKeyword = ref('');
@@ -293,13 +295,12 @@ const filteredColumns = computed(() => {
return props.columns.filter((col) => !col.vIf || col.vIf());
});
// 行操作列宽度:同时显示增加+删除则宽一点;只显示一个则缩窄
// 行操作列宽度:同时显示"增加+删除"则宽一点;只显示一个则缩窄
const rowActionsColumnWidth = computed(() => {
const showAdd = !!props.showRowAddButton;
const showDel = !!props.showRowDeleteButton;
if (showAdd && showDel) return 100;
if (showAdd || showDel) return 60;
// 如果两者都不显示,列也不会渲染;这里给个兜底
return 0;
});
@@ -323,7 +324,7 @@ const searchPlaceholder = computed(() => {
return `请输入${fieldLabels[0]}`;
}
return `请输入${fieldLabels.join('')}`;
return `请输入${fieldLabels.join('|')}`;
});
// 根据搜索关键词过滤表格数据
@@ -383,9 +384,9 @@ const handleDelete = (index) => {
}
};
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
emit('selection-change', selection);
const handleSelectionChange = ({ records }: { records: Record<string, any>[] }) => {
selectedRows.value = records;
emit('selection-change', records);
};
// 删除所有选中的行
@@ -418,7 +419,7 @@ const handleDeleteSelected = () => {
// 清空选中状态
if (tableRef.value) {
tableRef.value.clearSelection();
tableRef.value.clearCheckboxRow();
}
selectedRows.value = [];
};
@@ -499,69 +500,20 @@ defineExpose({
display: flex;
gap: 8px;
}
.toolbar-right {
display: flex;
align-items: center;
}
}
:deep(.el-table.editable-table-inner) {
.editable-table-inner {
flex: 1;
display: flex;
flex-direction: column;
.el-table__body-wrapper {
flex: 1;
overflow: auto;
}
.el-table__cell {
position: relative;
overflow: visible;
vertical-align: top;
.cell {
position: relative;
overflow: visible;
}
}
min-height: 0;
}
:deep(.el-table__cell) {
overflow: visible;
vertical-align: top;
.cell {
overflow: visible;
}
}
// 错误信息往下撑开行高不影响上面布局
:deep(.el-form-item) {
margin-bottom: 0;
.el-form-item__error {
position: static;
line-height: 1.5;
padding-top: 4px;
font-size: 12px;
color: var(--el-color-danger);
display: block;
white-space: nowrap;
}
.editable-table-footer {
margin-top: 16px;
padding: 0 4px;
}
.action-btn {
margin: 4px;
:deep(.el-icon) {
font-size: 18px;
}
padding: 2px 4px;
}
}
.editable-table-footer {
flex-shrink: 0;
margin-top: 16px;
}
</style>
</style>

View File

@@ -43,7 +43,7 @@
@change="handleChange"
@update:model-value="handleUpdate"
>
<el-radio v-for="option in item.options || []" :key="option.value" :label="option.value">
<el-radio v-for="option in item.options || []" :key="option.value" :value="option.value">
{{ option.label }}
</el-radio>
</el-radio-group>

View File

@@ -1,79 +1,82 @@
<template>
<template>
<div class="table-container">
<div ref="tableWrapperRef" class="table-wrapper">
<el-table
<vxe-table
ref="tableRef"
v-loading="loading"
:data="computedTableData"
:border="border"
:border="border ? 'full' : false"
:stripe="stripe"
:size="size"
:size="size === 'large' ? 'medium' : size === 'small' ? 'mini' : 'small'"
:height="computedTableHeight"
:row-key="rowKey"
:row-config="{ keyField: rowKey || 'id', isHover: true }"
:highlight-current-row="highlightCurrentRow"
@row-click="handleRowClick"
@selection-change="handleSelectionChange"
:show-overflow="true"
:show-header-overflow="title"
:auto-resize="true"
:scroll-x="{ enabled: true, gt: 20 }"
:scroll-y="{ enabled: true, gt: 50 }"
@cell-click="handleRowClick"
@checkbox-change="handleSelectionChange"
@checkbox-all="handleSelectionAll"
@sort-change="handleSortChange"
style="width: 100%; height: 100%"
>
<!-- 通过配置数组生成的列 -->
<template v-for="column in tableColumns" :key="column.prop || column.type">
<el-table-column
v-if="column.type && column.type !== 'expand'"
:type="column.type"
:width="column.width"
<!-- 选择列 -->
<vxe-column
v-if="column.type === 'selection'"
type="checkbox"
:width="column.width || 50"
:min-width="column.minWidth"
:align="column.align || 'center'"
:fixed="
column.type === 'selection'
? column.fixed !== undefined
? column.fixed
: 'left'
: column.fixed
"
:selectable="column.selectable"
:fixed="column.fixed !== undefined ? column.fixed : 'left'"
:select-config="column.selectable ? { checkMethod: ({ row }) => column.selectable(row, 0) } : undefined"
/>
<!-- 展开列支持自定义插槽内容 -->
<el-table-column
<!-- 序号列 -->
<vxe-column
v-else-if="column.type === 'index'"
type="seq"
:title="column.label || '序号'"
:width="column.width || 60"
:align="column.align || 'center'"
:fixed="column.fixed"
/>
<!-- 展开列 -->
<vxe-column
v-else-if="column.type === 'expand'"
type="expand"
:width="column.width"
:min-width="column.minWidth"
:fixed="column.fixed"
>
<template #default="scope">
<slot :name="column.slot || 'expand'" :row="scope.row" :scope="scope" />
<template #content="{ row }">
<slot :name="column.slot || 'expand'" :row="row" :scope="{ row }" />
</template>
</el-table-column>
</vxe-column>
<!-- 普通数据列 -->
<el-table-column
<vxe-column
v-else
:prop="column.prop"
:label="column.label"
:field="column.prop"
:title="column.label"
:width="column.width"
:min-width="column.minWidth"
:min-width="column.minWidth || calcMinWidth(column)"
:align="column.align || 'left'"
:fixed="column.fixed"
:show-overflow-tooltip="column.showOverflowTooltip !== false"
:show-overflow="column.showOverflowTooltip !== false"
>
<template v-if="column.slot" #default="scope">
<slot :name="column.slot" :row="scope.row" :scope="scope" />
<template v-if="column.slot" #default="{ row }">
<slot :name="column.slot" :row="row" :scope="{ row }" />
</template>
<template v-else-if="column.formatter" #default="scope">
{{
column.formatter(
scope.row,
scope.column,
column.prop ? scope.row[column.prop] : undefined,
scope.$index
)
}}
<template v-else-if="column.formatter" #default="{ row }">
{{ column.formatter(row, { property: column.prop }, column.prop ? row[column.prop] : undefined, 0) }}
</template>
</el-table-column>
</vxe-column>
</template>
<!-- 通过插槽自定义的列 -->
<slot name="table" />
</el-table>
</vxe-table>
</div>
<div v-if="showPagination" ref="paginationWrapperRef" class="pagination-wrapper">
<div
@@ -126,11 +129,22 @@ const props = withDefaults(defineProps<TableProps>(), {
const emit = defineEmits<{
'row-click': [row: Record<string, any>, column: any, event: Event];
'cell-click': [row: Record<string, any>, column: any, event: Event];
'selection-change': [selection: Record<string, any>[]];
'sort-change': [sortInfo: { column: any; prop: string; order: string }];
pagination: [pagination: { page: number; limit: number }];
}>();
// 根据列标题和内容特征估算最小宽度
const calcMinWidth = (column: any) => {
if (column.width) return undefined; // 有固定宽度就不限
const labelLen = (column.label || '').length;
// 中文字符约 14px英文约 8px加 padding 24px
const estimated = labelLen * 14 + 40;
// 最小 80最大 300
return Math.max(80, Math.min(300, estimated));
};
const internalPageNo = ref(props.pageNo);
const internalPageSize = ref(props.pageSize);
@@ -148,7 +162,7 @@ watch(
() => props.isAllData,
(isAllData) => {
if (isAllData) {
internalPageNo.value = props.pageNo;
internalPageNo.value = 1;
internalPageSize.value = props.pageSize;
}
}
@@ -187,7 +201,7 @@ const handlePagination = (pagination: { page: number; limit: number }) => {
});
};
const tableRef = ref<InstanceType<typeof import('element-plus').ElTable> | null>(null);
const tableRef = ref<any>(null);
const tableWrapperRef = ref<HTMLDivElement | null>(null);
const paginationWrapperRef = ref<HTMLDivElement | null>(null);
const dynamicTableHeight = ref<number | null>(null);
@@ -294,29 +308,27 @@ watch(
}
);
const handleRowClick = (row: Record<string, any>, column: any, event: Event) => {
emit('row-click', row, column, event);
const handleRowClick = ({ row, column, $event }: { row: any; column: any; $event: Event }) => {
emit('row-click', row, column, $event);
emit('cell-click', row, column, $event);
};
const handleSelectionChange = (selection: Record<string, any>[]) => {
emit('selection-change', selection);
const handleSelectionChange = ({ records }: { records: Record<string, any>[] }) => {
emit('selection-change', records);
};
const handleSortChange = ({
column,
prop,
order,
}: {
column: any;
prop: string;
order: string;
}) => {
emit('sort-change', { column, prop, order });
const handleSelectionAll = ({ records }: { records: Record<string, any>[] }) => {
emit('selection-change', records);
};
const handleSortChange = ({ column, field, order }: { column: any; field: string; order: string }) => {
emit('sort-change', { column, prop: field, order: order === 'asc' ? 'ascending' : order === 'desc' ? 'descending' : null });
};
defineExpose({
tableRef,
tableWrapperRef,
clearSelection: () => tableRef.value?.clearCheckboxRow(),
});
</script>

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="table-layout-container">
<div class="card-content-wrapper">
<div
@@ -95,7 +95,7 @@
:page-no="props.queryParams.pageNo"
:page-size="props.queryParams.pageSize"
@row-click="handleRowClick"
@selection-change="handleSelectionChange"
@checkbox-change="handleSelectionChange"
@sort-change="handleSortChange"
@pagination="handlePagination"
>
@@ -355,9 +355,9 @@ defineExpose({
height: 24px;
&:hover {
background-color: #409eff;
background-color: #3B82F6;
color: #fff;
border-color: #409eff;
border-color: #3B82F6;
}
}
}

View File

@@ -0,0 +1,756 @@
<template>
<div class="tree-sidebar" :class="{ collapsed: collapsed, resizing: isResizing, 'no-initial-transition': isLoadingFromStorage}" :style="{ width: sidebarWidth + 'px' }">
<!-- 右侧拖动条 -->
<div v-if="!collapsed" class="resize-handle" @mousedown="startResize" @touchstart="startResize" :class="{ active: isResizing }" />
<div class="tree-header">
<span class="tree-title" v-show="!collapsed">
<el-icon><component :is="titleIcon" /></el-icon> {{ title }}
</span>
<div class="tree-actions" v-show="!collapsed">
<el-tooltip :content="isExpandedAll ? '收起全部' : '展开全部'" placement="right">
<el-icon class="tree-action-icon" @click="toggleExpandAll">
<ArrowDown v-if="isExpandedAll" />
<ArrowUp v-else />
</el-icon>
</el-tooltip>
<el-tooltip content="刷新" placement="right">
<el-icon class="tree-action-icon" @click="handleRefresh"><Refresh /></el-icon>
</el-tooltip>
<slot name="actions"></slot>
</div>
</div>
<!-- 侧边栏展开/收起按钮 -->
<div class="collapse-button-container">
<el-tooltip :content="collapsed ? '展开' : '收起'" placement="right">
<el-icon class="collapse-button" @click="toggleCollapsed">
<DArrowRight v-if="collapsed" />
<DArrowLeft v-else />
</el-icon>
</el-tooltip>
</div>
<div class="tree-search" v-show="!collapsed" v-if="showSearch">
<el-input v-model="searchKeyword" :placeholder="searchPlaceholder" clearable>
<template #prefix>
<el-icon><Search /></el-icon>
</template>
</el-input>
</div>
<div class="tree-wrap" v-show="!collapsed">
<el-tree
ref="treeRef"
:data="treeData"
:props="treeProps"
:expand-on-click-node="expandOnClickNode"
:filter-node-method="filterNodeMethod"
:default-expand-all="defaultExpandAll"
:default-expanded-keys="defaultExpandedKeys"
:node-key="nodeKey"
:check-strictly="checkStrictly"
:show-checkbox="showCheckbox"
@node-click="onNodeClick"
@check="onCheck"
@node-expand="onNodeExpand"
@node-collapse="onNodeCollapse"
>
<template #default="{ node, data }">
<slot name="node" :node="node" :data="data">
<span class="tree-node">
<el-icon class="node-icon">
<Folder v-if="data.children && data.children.length" />
<Document v-else />
</el-icon>
<span class="node-label" :title="node.label">{{ node.label }}</span>
</span>
</slot>
</template>
</el-tree>
</div>
</div>
</template>
<script setup>
const props = defineProps({
// 树形数据
treeData: {
type: Array,
default: () => []
},
// 标题
title: {
type: String,
default: '树形结构'
},
// 标题图标
titleIcon: {
type: [String, Object],
default: 'OfficeBuilding'
},
// 是否显示搜索框
showSearch: {
type: Boolean,
default: true
},
// 搜索框占位符
searchPlaceholder: {
type: String,
default: '请输入名称'
},
// 是否默认收起侧边栏
defaultCollapsed: {
type: Boolean,
default: false
},
// 树配置项
treeProps: {
type: Object,
default: () => ({
children: "children",
label: "label"
})
},
// 节点唯一标识字段
nodeKey: {
type: String,
default: 'id'
},
// 是否在点击节点时展开或收起
expandOnClickNode: {
type: Boolean,
default: false
},
// 是否显示复选框
showCheckbox: {
type: Boolean,
default: false
},
// 是否严格的遵循父子不互相关联
checkStrictly: {
type: Boolean,
default: false
},
// 是否默认展开所有节点
defaultExpandAll: {
type: Boolean,
default: false
},
// 默认展开的节点的key数组
defaultExpandedKeys: {
type: Array,
default: () => []
},
// 默认宽度
defaultWidth: {
type: Number,
default: 220
},
// 收起时的宽度
collapsedWidth: {
type: Number,
default: 20
},
// 最小宽度
minWidth: {
type: Number,
default: 180
},
// 最大宽度
maxWidth: {
type: Number,
default: 400
},
// 本地存储的宽度key
storageKey: {
type: String,
default: 'tree-sidebar-width'
},
// 是否启用本地存储宽度
enableStorage: {
type: Boolean,
default: true
},
// 自定义过滤方法
filterMethod: {
type: Function,
default: null
}
})
const emit = defineEmits([
'collapsed-change',
'expanded-all-change',
'refresh',
'node-click',
'check',
'node-expand',
'node-collapse',
'search'
])
const treeRef = ref(null)
// 响应式数据
const searchKeyword = ref('')
const collapsed = ref(props.defaultCollapsed)
const sidebarWidth = ref(props.defaultCollapsed ? props.collapsedWidth : props.defaultWidth)
const isResizing = ref(false)
const startX = ref(0)
const startWidth = ref(0)
const saveWidthTimer = ref(null)
const rafId = ref(null)
const isLoadingFromStorage = ref(false)
const expandedAll = ref(props.defaultExpandAll)
// 计算属性
const isExpandedAll = computed({
get: () => expandedAll.value,
set: (val) => {
expandedAll.value = val
}
})
// 节点过滤方法
const filterNodeMethod = (value, data) => {
if (props.filterMethod) {
return props.filterMethod(value, data)
}
if (!value) return true
return data.label && data.label.indexOf(value) !== -1
}
// 监听折叠状态
watch(collapsed, (newVal, oldVal) => {
if (newVal !== oldVal) {
handleCollapseChange(newVal)
emit('collapsed-change', newVal)
}
})
// 监听内部展开状态变化,触发实际树的展开/收起
watch(expandedAll, (newVal) => {
nextTick(() => {
if (newVal) {
expandAllNodes()
} else {
collapseAllNodes()
}
})
emit('expanded-all-change', newVal)
})
// 监听搜索关键词
watch(searchKeyword, (val) => {
if (treeRef.value) {
treeRef.value.filter(val)
emit('search', val)
}
})
// 清理定时器和动画帧
const cleanup = () => {
if (rafId.value) {
cancelAnimationFrame(rafId.value)
rafId.value = null
}
if (saveWidthTimer.value) {
clearTimeout(saveWidthTimer.value)
saveWidthTimer.value = null
}
}
// 处理收起/展开状态变化
const handleCollapseChange = (isCollapsed) => {
if (isCollapsed) {
saveWidthToStorage()
sidebarWidth.value = props.collapsedWidth
} else {
const savedWidth = getSavedWidth()
sidebarWidth.value = savedWidth !== null ? savedWidth : props.defaultWidth
}
}
// 获取保存的宽度
const getSavedWidth = () => {
if (!props.enableStorage) {
return null
}
try {
const savedWidth = localStorage.getItem(props.storageKey)
if (savedWidth) {
const width = parseInt(savedWidth, 10)
if (!isNaN(width) && width >= props.minWidth && width <= props.maxWidth) {
return width
}
}
} catch (error) {
console.warn(`Failed to load sidebar width from storage with key ${props.storageKey}:`, error)
}
return null
}
// 保存宽度到本地存储
const saveWidthToStorage = () => {
if (collapsed.value || !props.enableStorage) return
try {
localStorage.setItem(props.storageKey, sidebarWidth.value.toString())
} catch (error) {
console.warn(`Failed to save sidebar width to storage with key ${props.storageKey}:`, error)
}
}
// 切换侧边栏收起/展开状态
const toggleCollapsed = () => {
collapsed.value = !collapsed.value
}
// 切换展开/折叠所有节点
const toggleExpandAll = () => {
expandedAll.value = !expandedAll.value
}
// 展开所有节点
const expandAllNodes = () => {
if (!treeRef.value) return
const allNodes = getAllNodes(treeRef.value.root)
allNodes.forEach(node => {
if (node.expanded !== undefined && !node.expanded) {
node.expanded = true
}
})
}
// 获取所有节点
const getAllNodes = (rootNode) => {
const nodes = []
const traverse = (node) => {
if (!node) return
nodes.push(node)
if (node.childNodes && node.childNodes.length) {
node.childNodes.forEach(child => traverse(child))
}
}
traverse(rootNode)
return nodes
}
// 收起所有节点
const collapseAllNodes = () => {
if (!treeRef.value) return
const allNodes = getAllNodes(treeRef.value.root)
allNodes.forEach(node => {
if (node.expanded !== undefined && node.expanded) {
node.expanded = false
}
})
}
// 处理刷新操作
const handleRefresh = () => {
emit('refresh')
}
// 节点点击事件
const onNodeClick = (data, node, e) => {
emit('node-click', data, node, e)
}
// 复选框选中事件
const onCheck = (data, checkedInfo) => {
emit('check', data, checkedInfo)
}
// 节点展开事件
const onNodeExpand = (data, node, e) => {
emit('node-expand', data, node, e)
}
// 节点折叠事件
const onNodeCollapse = (data, node, e) => {
emit('node-collapse', data, node, e)
}
const setCurrentKey = (key) => {
if (treeRef.value) {
treeRef.value.setCurrentKey(key)
}
}
const getCurrentNode = () => {
if (treeRef.value) {
return treeRef.value.getCurrentNode()
}
return null
}
const getCurrentKey = () => {
if (treeRef.value) {
return treeRef.value.getCurrentKey()
}
return null
}
const setCheckedKeys = (keys) => {
if (treeRef.value && props.showCheckbox) {
treeRef.value.setCheckedKeys(keys)
}
}
const getCheckedKeys = () => {
if (treeRef.value && props.showCheckbox) {
return treeRef.value.getCheckedKeys()
}
return []
}
const getCheckedNodes = () => {
if (treeRef.value && props.showCheckbox) {
return treeRef.value.getCheckedNodes()
}
return []
}
const clearSearch = () => {
searchKeyword.value = ""
if (treeRef.value) {
treeRef.value.filter("")
}
}
const filter = (value) => {
searchKeyword.value = value
}
const startResize = (e) => {
e.preventDefault()
e.stopPropagation()
isResizing.value = true
startX.value = e.type === 'mousedown' ? e.clientX : e.touches[0].clientX
startWidth.value = sidebarWidth.value
if (e.type === 'mousedown') {
document.addEventListener('mousemove', handleResizeMove)
document.addEventListener('mouseup', stopResize)
} else {
document.addEventListener('touchmove', handleResizeMove, { passive: false })
document.addEventListener('touchend', stopResize)
}
disableUserSelect()
}
const handleResizeMove = (e) => {
if (!isResizing.value) return
if (rafId.value) {
cancelAnimationFrame(rafId.value)
}
rafId.value = requestAnimationFrame(() => {
e.preventDefault()
e.stopPropagation()
const clientX = e.type === 'mousemove' ? e.clientX : e.touches[0].clientX
const deltaX = clientX - startX.value
const newWidth = startWidth.value + deltaX
const clampedWidth = Math.max(props.minWidth, Math.min(props.maxWidth, newWidth))
if (Math.abs(clampedWidth - sidebarWidth.value) >= 1) {
sidebarWidth.value = clampedWidth
}
})
}
const stopResize = () => {
if (!isResizing.value) return
isResizing.value = false
if (rafId.value) {
cancelAnimationFrame(rafId.value)
rafId.value = null
}
startX.value = 0
startWidth.value = 0
document.removeEventListener('mousemove', handleResizeMove)
document.removeEventListener('mouseup', stopResize)
document.removeEventListener('touchmove', handleResizeMove)
document.removeEventListener('touchend', stopResize)
enableUserSelect()
saveWidthToStorage()
}
const disableUserSelect = () => {
document.body.style.userSelect = 'none'
document.body.style.webkitUserSelect = 'none'
document.body.style.mozUserSelect = 'none'
document.body.style.msUserSelect = 'none'
}
const enableUserSelect = () => {
document.body.style.userSelect = ''
document.body.style.webkitUserSelect = ''
document.body.style.mozUserSelect = ''
document.body.style.msUserSelect = ''
}
const resetWidth = () => {
sidebarWidth.value = props.defaultWidth
saveWidthToStorage()
}
const getCurrentWidth = () => {
return sidebarWidth.value
}
const setWidth = (width) => {
if (typeof width === 'number' && width >= props.minWidth && width <= props.maxWidth) {
sidebarWidth.value = width
if (!collapsed.value) {
saveWidthToStorage()
}
}
}
defineExpose({
setCurrentKey,
getCurrentNode,
getCurrentKey,
setCheckedKeys,
getCheckedKeys,
getCheckedNodes,
clearSearch,
filter,
resetWidth,
getCurrentWidth,
setWidth,
expandAllNodes,
collapseAllNodes,
toggleCollapsed,
treeRef
})
onMounted(() => {
isLoadingFromStorage.value = true
if (!collapsed.value && props.enableStorage) {
const savedWidth = getSavedWidth()
if (savedWidth !== null) {
sidebarWidth.value = savedWidth
}
}
nextTick(() => {
isLoadingFromStorage.value = false
})
if (expandedAll.value) {
nextTick(() => {
expandAllNodes()
})
}
})
onBeforeUnmount(() => {
cleanup()
})
</script>
<style lang="scss" scoped>
.tree-sidebar {
flex-shrink: 0;
width: 220px;
background: #fff;
border-right: 1px solid #e8eaed;
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
transition: width 0.25s ease;
&.collapsed {
width: 42px;
}
&.resizing {
transition: none;
will-change: width;
* {
pointer-events: none !important;
}
}
&.no-initial-transition {
transition: none;
}
}
.resize-handle {
position: absolute;
top: 0;
right: 0;
width: 6px;
height: 100%;
cursor: col-resize;
z-index: 20;
background: transparent;
transition: background 0.2s;
&:hover {
background: rgba(64, 158, 255, 0.3);
}
&.active {
background: rgba(64, 158, 255, 0.5);
}
}
.collapse-button-container {
position: absolute;
top: 50%;
right: 0;
transform: translateY(-50%);
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
width: 15px;
height: 20px;
background: #fff;
border-radius: 0 4px 4px 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
transition: all 0.2s ease;
.tree-sidebar.collapsed & {
right: 0;
background: #f7f8fa;
border-radius: 0 4px 4px 0;
}
.tree-sidebar.resizing & {
pointer-events: none;
}
}
.collapse-button {
font-size: 20px;
color: #909399;
cursor: pointer;
padding: 4px;
border-radius: 4px;
transition: all 0.2s;
&:hover {
color: #409eff;
background: #ecf5ff;
}
}
.tree-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
height: 40px;
border-bottom: 1px solid #e8eaed;
background: #f7f8fa;
flex-shrink: 0;
.tree-title {
font-size: 13px;
font-weight: 600;
color: #303133;
white-space: nowrap;
overflow: hidden;
display: flex;
align-items: center;
gap: 5px;
.el-icon {
color: #409eff;
font-size: 16px;
}
}
.tree-actions {
display: flex;
align-items: center;
gap: 4px;
flex-shrink: 0;
}
}
.tree-action-icon {
font-size: 20px;
color: #909399;
cursor: pointer;
padding: 4px;
border-radius: 4px;
transition: all 0.2s;
&:hover {
color: #409eff;
background: #ecf5ff;
}
}
.tree-search {
padding: 10px 10px 4px;
flex-shrink: 0;
}
.tree-wrap {
flex: 1;
overflow-y: auto;
padding: 6px 6px 12px;
.tree-sidebar.resizing & {
overflow: hidden;
}
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
background: #dcdfe6;
border-radius: 4px;
&:hover {
background: #c0c4cc;
}
}
:deep(.el-tree-node__content) {
height: 32px;
border-radius: 4px;
margin-bottom: 1px;
&:hover {
background: #f0f7ff;
}
}
:deep(.el-tree-node.is-current > .el-tree-node__content) {
background: #e6f0fd;
color: #409eff;
font-weight: 600;
.node-icon {
color: #409eff !important;
}
}
}
.tree-node {
display: flex;
align-items: center;
gap: 5px;
font-size: 13px;
overflow: hidden;
.node-icon {
font-size: 14px;
color: #f5a623;
flex-shrink: 0;
}
.node-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
</style>

View File

@@ -0,0 +1,31 @@
<template>
<footer v-if="visible" class="copyright">
<span>{{ content }}</span>
</footer>
</template>
<script setup>
import useSettingsStore from '@/store/modules/settings'
const settingsStore = useSettingsStore()
const visible = computed(() => settingsStore.footerVisible)
const content = computed(() => settingsStore.footerContent)
</script>
<style scoped>
.copyright {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 36px;
padding: 10px 20px;
text-align: right;
background-color: #f8f8f8;
color: #666;
font-size: 14px;
border-top: 1px solid #e7e7e7;
z-index: 999;
}
</style>

View File

@@ -0,0 +1,359 @@
<template>
<el-drawer v-model="visible" title="公告详情" direction="rtl" size="50%" append-to-body :before-close="handleClose" class="notice-detail-drawer">
<div v-loading="loading" class="notice-detail-drawer__body">
<div v-if="!detail" class="notice-empty">
<el-icon><Document /></el-icon>
<span>暂无数据</span>
</div>
<div v-else class="notice-page">
<div class="notice-type-wrap">
<span v-if="detail.noticeType === '1'" class="notice-type-tag type-notify">
<el-icon><Bell /></el-icon> 通知
</span>
<span v-else-if="detail.noticeType === '2'" class="notice-type-tag type-announce">
<el-icon><Message /></el-icon> 公告
</span>
<span v-else class="notice-type-tag type-notify">
<el-icon><Document /></el-icon> 消息
</span>
</div>
<h1 class="notice-title">{{ detail.noticeTitle }}</h1>
<div class="notice-meta">
<span class="meta-item">
<el-icon><User /></el-icon>
<span>{{ detail.createBy || '—' }}</span>
</span>
<span class="meta-item">
<el-icon><Clock /></el-icon>
<span>{{ detail.createTime || '—' }}</span>
</span>
<span class="meta-item">
<span :class="['status-dot', isStatusNormal ? 'status-ok' : 'status-off']"></span>
<span>{{ isStatusNormal ? '正常' : '已关闭' }}</span>
</span>
</div>
<div class="notice-divider">
<span class="notice-divider-dot"></span>
<span class="notice-divider-dot"></span>
<span class="notice-divider-dot"></span>
</div>
<div class="notice-body">
<div v-if="hasContent" class="notice-content" v-html="detail.noticeContent" />
<div v-else class="notice-empty notice-empty--inner">
<el-icon><Document /></el-icon> 暂无内容
</div>
</div>
</div>
</div>
</el-drawer>
</template>
<script setup>
import { getNotice } from '@/api/system/notice'
const visible = ref(false)
const loading = ref(false)
const detail = ref(null)
const isStatusNormal = computed(() => {
const status = detail.value && detail.value.status
return status === '0' || status === 0
})
const hasContent = computed(() => {
const content = detail.value && detail.value.noticeContent
return content != null && String(content).trim() !== ''
})
function open(payload) {
let id = null
let preset = null
if (payload != null && typeof payload === 'object') {
id = payload.noticeId
if (payload.noticeContent != null) {
preset = payload
}
} else {
id = payload
}
visible.value = true
if (preset) {
detail.value = preset
return
}
if (id == null || id === '') {
detail.value = null
return
}
loading.value = true
detail.value = null
getNotice(id).then(res => {
detail.value = res.data
}).catch(() => {
detail.value = null
}).finally(() => {
loading.value = false
})
}
function handleClose() {
visible.value = false
detail.value = null
loading.value = false
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
.notice-page {
max-width: 760px;
margin: 0 auto;
padding: 8px 8px 20px;
animation: notice-fade-up 0.28s ease both;
}
@keyframes notice-fade-up {
from {
opacity: 0;
transform: translateY(14px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.notice-type-tag {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 3px 12px;
border-radius: 2px;
font-size: 11px;
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
margin-bottom: 14px;
}
.type-notify {
background: #fff8e6;
color: #b7791f;
border-left: 3px solid #d97706;
}
.type-announce {
background: #e8f5e9;
color: #276749;
border-left: 3px solid #38a169;
}
.notice-title {
font-size: 22px;
font-weight: 700;
color: #1a202c;
line-height: 1.45;
margin: 0 0 16px;
letter-spacing: -0.2px;
}
.notice-meta {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16px;
padding: 12px 0;
border-top: 1px solid #e9ecef;
border-bottom: 1px solid #e9ecef;
margin-bottom: 28px;
}
.meta-item {
display: flex;
align-items: center;
gap: 5px;
font-size: 12px;
color: #718096;
}
.meta-item .el-icon {
font-size: 12px;
color: #a0aec0;
}
.status-dot {
display: inline-block;
width: 7px;
height: 7px;
border-radius: 50%;
margin-right: 4px;
}
.status-ok {
background: #38a169;
}
.status-off {
background: #e53e3e;
}
.notice-divider {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 24px;
}
.notice-divider::before,
.notice-divider::after {
content: '';
flex: 1;
height: 1px;
background: linear-gradient(to right, transparent, #dee2e6, transparent);
}
.notice-divider-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #cbd5e0;
}
.notice-body {
background: #fff;
border-radius: 6px;
padding: 28px 32px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
min-height: 120px;
}
.notice-content {
font-size: 14px;
line-height: 1.85;
color: #2d3748;
word-break: break-word;
}
.notice-content :deep(p) {
margin: 0 0 1em;
}
.notice-content :deep(h1),
.notice-content :deep(h2),
.notice-content :deep(h3) {
font-weight: 700;
color: #1a202c;
margin: 1.4em 0 0.6em;
}
.notice-content :deep(h1) {
font-size: 18px;
}
.notice-content :deep(h2) {
font-size: 16px;
}
.notice-content :deep(h3) {
font-size: 14px;
}
.notice-content :deep(a) {
color: #3182ce;
text-decoration: underline;
}
.notice-content :deep(a:hover) {
color: #2b6cb0;
}
.notice-content :deep(img) {
max-width: 100%;
border-radius: 4px;
margin: 8px 0;
}
.notice-content :deep(ul),
.notice-content :deep(ol) {
padding-left: 20px;
margin: 0 0 1em;
}
.notice-content :deep(li) {
margin-bottom: 4px;
}
.notice-content :deep(blockquote) {
border-left: 3px solid #cbd5e0;
margin: 1em 0;
padding: 6px 16px;
color: #718096;
background: #f7fafc;
}
.notice-content :deep(table) {
border-collapse: collapse;
width: 100%;
margin: 1em 0;
font-size: 13px;
}
.notice-content :deep(table th),
.notice-content :deep(table td) {
border: 1px solid #e2e8f0;
padding: 7px 12px;
}
.notice-content :deep(table th) {
background: #f7fafc;
font-weight: 600;
}
.notice-empty {
text-align: center;
padding: 40px 0;
color: #a0aec0;
font-size: 13px;
}
.notice-empty .el-icon {
font-size: 28px;
display: inline-flex;
margin-bottom: 10px;
}
.notice-empty--inner {
padding: 32px 0;
}
.notice-detail-drawer__body {
height: 100%;
overflow: auto;
padding: 10px 16px 22px;
}
</style>
<style lang="scss">
.notice-detail-drawer {
.el-drawer__header {
margin-bottom: 0;
padding: 16px 20px;
border-bottom: 1px solid #ebeef5;
font-size: 16px;
font-weight: 600;
color: #303133;
}
.el-drawer__body {
background: #f5f6f8;
padding: 0;
}
}
</style>

View File

@@ -0,0 +1,360 @@
<template>
<div>
<el-popover
ref="noticePopover"
placement="bottom-end"
:width="360"
trigger="click"
v-model:visible="noticeVisible"
popper-class="notice-popover"
:show-arrow="false"
>
<template #default>
<div class="notice-popover-content">
<!-- 头部 -->
<div class="notice-header">
<span class="notice-header-title">消息中心</span>
<el-badge :value="noticeStore.unreadCount" :hidden="noticeStore.unreadCount === 0" :max="99">
<span />
</el-badge>
<span class="notice-header-action" @click="handleReadAll">全部已读</span>
</div>
<!-- Tabs -->
<el-tabs v-model="activeTab" class="notice-tabs">
<el-tab-pane name="all">
<template #label>
全部
<el-badge v-if="allUnread > 0" :value="allUnread" :max="99" class="tab-badge" />
</template>
</el-tab-pane>
<el-tab-pane name="notice">
<template #label>
通知
<el-badge v-if="noticeUnread > 0" :value="noticeUnread" :max="99" class="tab-badge" />
</template>
</el-tab-pane>
<el-tab-pane name="announce">
<template #label>
公告
<el-badge v-if="announceUnread > 0" :value="announceUnread" :max="99" class="tab-badge" />
</template>
</el-tab-pane>
</el-tabs>
<!-- 列表 -->
<el-scrollbar max-height="350px" class="notice-scroll">
<div v-if="filteredList.length === 0" class="notice-empty">
<el-empty description="暂无消息" :image-size="60" />
</div>
<div
v-for="item in filteredList"
:key="item.noticeId"
class="notice-item"
:class="{ 'is-read': isRead(item) }"
@click="handleRead(item)"
>
<div class="notice-item-icon">
<el-icon v-if="item.noticeType === '1'" class="icon-notice"><Bell /></el-icon>
<el-icon v-else class="icon-announce"><Notification /></el-icon>
</div>
<div class="notice-item-body">
<div class="notice-item-title">
<span>{{ item.noticeTitle }}</span>
<el-tag v-if="!isRead(item)" type="danger" size="small" effect="dark" class="unread-tag">未读</el-tag>
</div>
<div class="notice-item-time">{{ formatTime(item.createTime) }}</div>
</div>
</div>
</el-scrollbar>
<!-- 底部 -->
<div class="notice-footer" @click="openNoticeCenter">
<span>查看全部</span>
<el-icon><ArrowRight /></el-icon>
</div>
</div>
</template>
<template #reference>
<div class="left-action-item">
<el-badge :value="noticeStore.unreadCount" :hidden="noticeStore.unreadCount === 0" :max="99">
<el-icon :size="18"><Bell /></el-icon>
</el-badge>
</div>
</template>
</el-popover>
<!-- 详情抽屉 -->
<DetailView ref="detailViewRef" />
</div>
</template>
<script setup>
import DetailView from './DetailView.vue'
import useNoticeStore from '@/store/modules/notice'
import { Bell, Notification, ArrowRight } from '@element-plus/icons-vue'
const noticeStore = useNoticeStore()
const noticeVisible = ref(false)
const activeTab = ref('all')
const detailViewRef = ref(null)
// 过滤后的列表
const filteredList = computed(() => {
const list = noticeStore.noticeList
if (activeTab.value === 'notice') {
return list.filter(n => n.noticeType === '1')
}
if (activeTab.value === 'announce') {
return list.filter(n => n.noticeType === '2')
}
return list
})
// 各类型未读数
const allUnread = computed(() => noticeStore.unreadCount)
const noticeUnread = computed(() => {
return noticeStore.noticeList.filter(n => n.noticeType === '1' && !isRead(n)).length
})
const announceUnread = computed(() => {
return noticeStore.noticeList.filter(n => n.noticeType === '2' && !isRead(n)).length
})
function isRead(item) {
return item.isRead || item.readFlag === '1' || noticeStore.readIds.has(item.noticeId)
}
// 格式化时间
function formatTime(time) {
if (!time) return ''
const d = new Date(time)
const now = new Date()
const diff = now - d
if (diff < 60000) return '刚刚'
if (diff < 3600000) return Math.floor(diff / 60000) + '分钟前'
if (diff < 86400000) return Math.floor(diff / 3600000) + '小时前'
if (diff < 604800000) return Math.floor(diff / 86400000) + '天前'
const pad = n => String(n).padStart(2, '0')
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
}
// 点击单条 → 标记已读 + 打开详情
function handleRead(item) {
if (!isRead(item)) {
noticeStore.markRead(item.noticeId)
}
detailViewRef.value?.open(item)
}
// 全部已读
function handleReadAll() {
noticeStore.markAllRead()
}
// 查看全部 → 关闭弹窗,跳转公告页面
function openNoticeCenter() {
noticeVisible.value = false
// 可跳转到公告管理页面或打开全屏面板
}
// 定时刷新未读数
let timer = null
onMounted(() => {
noticeStore.fetchNotices()
timer = setInterval(() => {
noticeStore.fetchUnreadCount()
}, 60000) // 每分钟刷新一次
})
onUnmounted(() => {
clearInterval(timer)
})
</script>
<style lang="scss" scoped>
.left-action-item {
display: flex;
align-items: center;
justify-content: center;
padding: 0 10px;
height: 50px;
font-size: 16px;
color: #606266;
cursor: pointer;
transition: background 0.3s;
&:hover {
background-color: #f6f6f6;
}
}
:deep(.notice-popover) {
padding: 0 !important;
}
.notice-popover-content {
display: flex;
flex-direction: column;
}
.notice-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px 10px;
border-bottom: 1px solid #f0f0f0;
.notice-header-title {
font-size: 15px;
font-weight: 600;
color: #1a1a1a;
}
.notice-header-action {
font-size: 12px;
color: #3B82F6;
cursor: pointer;
&:hover {
color: #2563EB;
}
}
}
.notice-tabs {
:deep(.el-tabs__header) {
margin: 0;
padding: 0 16px;
}
:deep(.el-tabs__nav-wrap::after) {
display: none;
}
:deep(.el-tabs__item) {
padding: 0 12px;
height: 40px;
line-height: 40px;
font-size: 13px;
}
.tab-badge {
margin-left: 4px;
:deep(.el-badge__content) {
font-size: 10px;
}
}
}
.notice-scroll {
max-height: 350px;
}
.notice-empty {
padding: 30px 0;
}
.notice-item {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 12px 16px;
cursor: pointer;
transition: background 0.2s;
border-bottom: 1px solid #f5f5f5;
&:hover {
background: #f7f8fa;
}
&:last-child {
border-bottom: none;
}
&.is-read {
opacity: 0.55;
.notice-item-title span {
color: #999;
}
}
.notice-item-icon {
flex-shrink: 0;
width: 36px;
height: 36px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-top: 2px;
.icon-notice {
background: #E0F2FE;
color: #0284C7;
width: 36px;
height: 36px;
border-radius: 50%;
font-size: 16px;
}
.icon-announce {
background: #ECFDF5;
color: #059669;
width: 36px;
height: 36px;
border-radius: 50%;
font-size: 16px;
}
}
.notice-item-body {
flex: 1;
min-width: 0;
}
.notice-item-title {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 4px;
span {
flex: 1;
font-size: 13px;
color: #333;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.unread-tag {
flex-shrink: 0;
}
}
.notice-item-time {
font-size: 11px;
color: #aaa;
}
}
.notice-footer {
display: flex;
align-items: center;
justify-content: center;
gap: 4px;
padding: 10px;
border-top: 1px solid #f0f0f0;
font-size: 13px;
color: #3B82F6;
cursor: pointer;
transition: background 0.2s;
&:hover {
background: #f7f8fa;
}
}
</style>

Some files were not shown because too many files have changed in this diff Show More