fix(print): 修复处方打印功能并优化路由查询解析
- 使用全局用户存储替代代理访问医院名称 - 更改打印方法为浏览器打印预览方式,无需客户端连接 - 添加打印样式处理和回调函数 - 在主入口文件初始化hiprint并配置本地客户端连接 - 移除重复的路由查询解析逻辑,简化代码结构
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user