fix(print): 修复处方打印功能并优化路由查询解析

- 使用全局用户存储替代代理访问医院名称
- 更改打印方法为浏览器打印预览方式,无需客户端连接
- 添加打印样式处理和回调函数
- 在主入口文件初始化hiprint并配置本地客户端连接
- 移除重复的路由查询解析逻辑,简化代码结构
This commit is contained in:
2026-03-03 11:17:53 +08:00
parent fc0f5a11be
commit 45fdca65a7
3 changed files with 40 additions and 35 deletions

View File

@@ -96,27 +96,6 @@ function resolvePath(routePath, routeQuery) {
return { path: getNormalPath(props.basePath + '/' + routePath), query: query }
} catch (e) {
// 如果解析失败,将其作为普通字符串处理
console.warn('Failed to parse routeQuery as JSON:', routeQuery, e);
return getNormalPath(props.basePath + '/' + routePath)
}
try {
let query = JSON.parse(routeQuery);
return { path: getNormalPath(props.basePath + '/' + routePath), query: query }
} catch (e) {
console.error('Failed to parse routeQuery:', routeQuery, e);
return getNormalPath(props.basePath + '/' + routePath)
}
try {
// 检查 routeQuery 是否已经是对象
if (typeof routeQuery === 'object') {
return { path: getNormalPath(props.basePath + '/' + routePath), query: routeQuery }
}
// 尝试解析 JSON 字符串
let query = JSON.parse(routeQuery);
return { path: getNormalPath(props.basePath + '/' + routePath), query: query }
} catch (e) {
// 如果解析失败,将其作为普通字符串处理
console.warn('Failed to parse routeQuery as JSON:', routeQuery, e);
return getNormalPath(props.basePath + '/' + routePath)
}
}