Compare commits
108 Commits
fix/BUG#61
...
bb7eb2eca7
| Author | SHA1 | Date | |
|---|---|---|---|
| bb7eb2eca7 | |||
| 6a6ed53e87 | |||
|
|
f5424d8de6 | ||
|
|
d5a65a1b47 | ||
| 454029edb0 | |||
| 0e59b0dbaa | |||
| 58669ce9b6 | |||
|
|
43b998e6ef | ||
| 14a81564bf | |||
| 5751c6941c | |||
| 54225f6cad | |||
| 6ded2ee174 | |||
| 4469171b62 | |||
| 427b7ad799 | |||
| 61e4e9dc11 | |||
|
|
75449817da | ||
| a648f5a0c4 | |||
| 8f4ab275f0 | |||
| fe698b26a2 | |||
| 110cb4143d | |||
|
|
f273f476b7 | ||
|
|
53369b57b2 | ||
| f144dd7e2c | |||
|
|
1438b0e569 | ||
|
|
4e84ea969a | ||
| 572493002c | |||
| 4034f05412 | |||
| 7c9811477d | |||
|
|
d9c74abaeb | ||
| 0ec6db2236 | |||
| 9935a384a7 | |||
| ed794a7852 | |||
| bc4cf3a87c | |||
| d8f866a650 | |||
| d46cb7f93d | |||
| 39593f1aaf | |||
| e83175e334 | |||
| d6ce0f28cc | |||
| 85effdee6f | |||
| 55ff2e630e | |||
| 7bb6a4f49e | |||
|
|
3a26bc1348 | ||
| 1fdb7cba03 | |||
|
|
7ca0b89cb2 | ||
| b71563a324 | |||
| 207516ee86 | |||
| 1bcffc85ae | |||
| 5a2050a736 | |||
| 5b6b23331d | |||
| 7be41c3058 | |||
|
|
5df2d8a049 | ||
|
|
899cbc0b71 | ||
|
|
734bdc6a0d | ||
| 9b785e5e63 | |||
| 67a0f7fc08 | |||
| 6958654d26 | |||
| e1cb88e47e | |||
| 578b771c56 | |||
| 6a34303825 | |||
|
|
cde58cf18f | ||
| 2962698cdd | |||
| ac0d563274 | |||
| 2e865dd446 | |||
| 1dc8b593fe | |||
| dc3c37123f | |||
| bca02ed354 | |||
| ee774e4ec2 | |||
| 74de40f94f | |||
|
|
87b637ed49 | ||
|
|
e44a212eba | ||
|
|
8b75111a60 | ||
| d1189786cf | |||
| bfae92df51 | |||
|
|
5a970cf492 | ||
| c3ecadcfe0 | |||
| b8463f4659 | |||
| 710a215597 | |||
| 80e186496b | |||
| cc49276a14 | |||
| 269b5a22c8 | |||
| 74f340d77c | |||
|
|
17783bd981 | ||
|
|
021701c611 | ||
|
|
275e7f5978 | ||
|
|
a04b5f8dba | ||
|
|
76c623ba1d | ||
| d6d8864f64 | |||
| 810336f989 | |||
| f4ba8028fb | |||
| b0e7b8844d | |||
|
|
296e825fbd | ||
| 310331f921 | |||
| 9f5eecf62b | |||
|
|
5fa4497f68 | ||
| df19301988 | |||
| b5918c8a3c | |||
| b9ae7a3522 | |||
| f9ff55a9ea | |||
| a0a5d7e765 | |||
| 6cd658d8da | |||
| e0b348052d | |||
| 4903122e27 | |||
| ab431e69de | |||
| 10835d24d1 | |||
|
|
19233876a4 | ||
|
|
b946a8a143 | ||
| 5c29c0f09e | |||
|
|
ba5ac84d96 |
71
AGENTS.md
71
AGENTS.md
@@ -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 搜索所有引用 |
|
||||
|
||||
## 📈 成熟度追踪
|
||||
|
||||
| 等级 | 特征 | 本项目 |
|
||||
|
||||
62
deploy/deploy-frontend.ps1
Normal file
62
deploy/deploy-frontend.ps1
Normal 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
84
deploy/deploy-frontend.sh
Normal 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
81
deploy/fix-deps.sh
Normal 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
48
deploy/nginx-openhis.conf
Normal 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";
|
||||
}
|
||||
}
|
||||
275
docs/RUOYI_392_UPGRADE_CHECKLIST.md
Normal file
275
docs/RUOYI_392_UPGRADE_CHECKLIST.md
Normal 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
64
docs/UPGRADE_LOG.md
Normal 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
171
docs/UPGRADE_PLAN_v2.0.md
Normal 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
33
docs/bug-fixes/bug-632.md
Normal 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
35
docs/bug-fixes/bug-634.md
Normal 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
32
docs/bug-fixes/bug-644.md
Normal 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 修复 → 张飞测试 → 华佗验收 → 陈琳归档
|
||||
@@ -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/+HHMM(LocalDateTime 不含时区信息)
|
||||
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")));
|
||||
};
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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[] {"切换科室"}));
|
||||
}
|
||||
|
||||
|
||||
@@ -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筛选服务项目
|
||||
*
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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筛选服务项目
|
||||
*/
|
||||
|
||||
@@ -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查询当日挂号次数
|
||||
*/
|
||||
|
||||
@@ -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()); // 患者
|
||||
|
||||
@@ -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_no(String 类型)
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
);
|
||||
|
||||
// 如果没有病历,则需要写病历
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -127,6 +127,11 @@ public class RequestBaseDto {
|
||||
* 请求状态
|
||||
*/
|
||||
private Integer statusEnum;
|
||||
|
||||
/**
|
||||
* 退回原因
|
||||
*/
|
||||
private String reasonText;
|
||||
private String statusEnum_enumText;
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() + "库存不足");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
// 追溯码管理表数据追加
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
* 获取配药人下拉选列表
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -10,8 +10,4 @@ import lombok.experimental.Accessors;
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RegAdviceSaveDto extends AdviceSaveDto {
|
||||
|
||||
/** 请求类型 */
|
||||
private Integer categoryEnum;
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算相对前日的百分比变化
|
||||
*
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
|
||||
@@ -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 != ''">
|
||||
|
||||
@@ -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 ,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -278,6 +278,10 @@ public enum AssignSeqEnum {
|
||||
* 手术申请单号(住院)
|
||||
*/
|
||||
SURGERY_APPLY_NO("73", "手术申请单号", "SSZ"),
|
||||
/**
|
||||
* 检验申请单号(住院)
|
||||
*/
|
||||
LAB_APPLY_NO("74", "检验申请单号", "JYZ"),
|
||||
/**
|
||||
* b 病历文书
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
* 签到时更新号源池统计:锁定数-1(booked_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
|
||||
|
||||
@@ -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→1(LOCKED→BOOKED,已预约=已签到)
|
||||
scheduleSlotMapper.updateSlotStatusAndCheckInTime(slotId, SlotStatus.BOOKED.getValue(), new Date(), SlotStatus.LOCKED.getValue());
|
||||
// 3. 更新号源槽位状态 2→3(LOCKED→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());
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class MedicationRequest extends HisBaseEntity {
|
||||
private String supportInfo;
|
||||
|
||||
/** 退回原因 */
|
||||
private String backReason;
|
||||
private String backReason = "";
|
||||
|
||||
/** 请求开始时间 */
|
||||
private Date reqAuthoredTime;
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
1
openhis-ui-vue3/.gitignore
vendored
1
openhis-ui-vue3/.gitignore
vendored
@@ -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
8352
openhis-ui-vue3/package-lock.json
generated
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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';
|
||||
|
||||
/* 强制使用鸿蒙字体 */
|
||||
* {
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
/** 表格更多操作下拉样式 */
|
||||
.el-table .el-dropdown-link {
|
||||
cursor: pointer;
|
||||
color: #409EFF;
|
||||
color: #3B82F6;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
90
openhis-ui-vue3/src/assets/styles/screen-1080p.scss
Normal file
90
openhis-ui-vue3/src/assets/styles/screen-1080p.scss
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/* ============================================
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
212
openhis-ui-vue3/src/assets/styles/vxe-table.scss
Normal file
212
openhis-ui-vue3/src/assets/styles/vxe-table.scss
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
137
openhis-ui-vue3/src/components/ExcelImportDialog/index.vue
Normal file
137
openhis-ui-vue3/src/components/ExcelImportDialog/index.vue
Normal 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>仅允许导入xls、xlsx格式文件。</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>
|
||||
@@ -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>
|
||||
|
||||
@@ -85,7 +85,7 @@ const realHeight = computed(() =>
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #909399;
|
||||
color: #64748B;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -579,7 +579,7 @@ defineExpose({
|
||||
|
||||
.priority-low {
|
||||
background: #f0f2f5;
|
||||
color: #909399;
|
||||
color: #64748B;
|
||||
border-color: #dcdfe6;
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: #f56c6c;
|
||||
background: #EF4444;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
"
|
||||
|
||||
@@ -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 '';
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
756
openhis-ui-vue3/src/components/TreePanel/index.vue
Normal file
756
openhis-ui-vue3/src/components/TreePanel/index.vue
Normal 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>
|
||||
31
openhis-ui-vue3/src/layout/components/Copyright/index.vue
Normal file
31
openhis-ui-vue3/src/layout/components/Copyright/index.vue
Normal 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>
|
||||
@@ -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>
|
||||
360
openhis-ui-vue3/src/layout/components/HeaderNotice/index.vue
Normal file
360
openhis-ui-vue3/src/layout/components/HeaderNotice/index.vue
Normal 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
Reference in New Issue
Block a user