From 8eb2c1e0e23eb0277e8d3712f2cdd93614005600 Mon Sep 17 00:00:00 2001 From: wangjian963 <15215920+aprilry@user.noreply.gitee.com> Date: Fri, 26 Jun 2026 11:42:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=20fix(ui):=20=E4=BF=AE=E5=A4=8D=20TypeScri?= =?UTF-8?q?pt=20strict=20=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=E5=8F=8A?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=97=B6=20Array.join=20=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复 console.error 包装器: String() 包裹 + try-catch 防止浏览器原生格式化崩溃 - 修复 empienhanced/merge 模板中 && → && - 修复 bedAllocation: ChangeBedDialog 组件缺失导致 patchAttr 渲染崩溃 - 修复 inOut 组件: 添加隐式 any 类型注解, 修正 OptionItem 接口定义 - 新增 api.d.ts: api.js 的 TypeScript 类型声明 --- healthlink-his-ui/eslint.config.js | 3 +- healthlink-his-ui/src/main.js | 8 +++-- healthlink-his-ui/src/utils/index.d.ts | 5 +++ .../src/views/empienhanced/merge/index.vue | 7 ++-- .../inpatientNurse/inOut/components/api.d.ts | 19 ++++++++++ .../inOut/components/bedAllocation.vue | 17 ++++----- .../inOut/components/transferInDialog.vue | 26 +++++++------- .../inOut/components/transferOut.vue | 35 +++++++++++-------- 8 files changed, 76 insertions(+), 44 deletions(-) create mode 100644 healthlink-his-ui/src/utils/index.d.ts create mode 100644 healthlink-his-ui/src/views/inpatientNurse/inOut/components/api.d.ts diff --git a/healthlink-his-ui/eslint.config.js b/healthlink-his-ui/eslint.config.js index 760c086f4..6afcbd5b5 100755 --- a/healthlink-his-ui/eslint.config.js +++ b/healthlink-his-ui/eslint.config.js @@ -1,4 +1,3 @@ -/* eslint-env node */ import path from "node:path"; import { fileURLToPath } from "node:url"; import globals from "globals"; @@ -42,7 +41,7 @@ export default [ rules: { // 确保导入的模块实际存在(核心规则,防止构建失败) - "import-x/no-unresolved": "error", + "import-x/no-unresolved": ["error", { ignore: ["^virtual:"] }], // 确保导入的命名导出实际存在 "import-x/named": "error", // 确保默认导出存在 diff --git a/healthlink-his-ui/src/main.js b/healthlink-his-ui/src/main.js index efd636401..2e8b53ec5 100755 --- a/healthlink-his-ui/src/main.js +++ b/healthlink-his-ui/src/main.js @@ -73,13 +73,15 @@ console.error = (...args) => { const all = args.map(a => { if (!a) return ""; if (typeof a === "string") return a; - if (a.stack) return a.stack; - if (a.message) return a.message; + if (a.stack) return String(a.stack); + if (a.message) return String(a.message); try { return JSON.stringify(a); } catch(e) { return ""; } }).join(" "); if (all.includes("form-label") || all.includes("LabelWrap") || all.includes("ElForm") || all.includes("FormItem") || all.includes("deregisterLabel") || all.includes("autoLabel") || all.includes("labelPosition") || all.includes("formContext") || all.includes("label-wrap")) return; } catch(e) {} - _origError.apply(console, args); + try { + _origError.apply(console, args); + } catch(e) {} }; async function bootstrap() { diff --git a/healthlink-his-ui/src/utils/index.d.ts b/healthlink-his-ui/src/utils/index.d.ts new file mode 100644 index 000000000..31016375c --- /dev/null +++ b/healthlink-his-ui/src/utils/index.d.ts @@ -0,0 +1,5 @@ +export function parseTime(time: any, cFormat?: string): string | null; +export function formatDate(cellValue: any): string; +export function formatDateStr(cellValue: any, format?: string): string; +export function formatDateymd(cellValue: any): string; +export function formatTime(time: any, option?: any): string; diff --git a/healthlink-his-ui/src/views/empienhanced/merge/index.vue b/healthlink-his-ui/src/views/empienhanced/merge/index.vue index 61d777b30..637911759 100644 --- a/healthlink-his-ui/src/views/empienhanced/merge/index.vue +++ b/healthlink-his-ui/src/views/empienhanced/merge/index.vue @@ -81,7 +81,7 @@ width="100" > @@ -135,12 +135,11 @@ diff --git a/healthlink-his-ui/src/views/inpatientNurse/inOut/components/api.d.ts b/healthlink-his-ui/src/views/inpatientNurse/inOut/components/api.d.ts new file mode 100644 index 000000000..084f18da4 --- /dev/null +++ b/healthlink-his-ui/src/views/inpatientNurse/inOut/components/api.d.ts @@ -0,0 +1,19 @@ +export function getInit(queryParams?: any): Promise; +export function getPendingInfo(queryParams?: any): Promise; +export function getBedInfo(queryParams?: any): Promise; +export function getPatientInfo(queryParams?: any): Promise; +export function getDoctorInfo(queryParams?: any): Promise; +export function getNurseInfo(queryParams?: any): Promise; +export function bedAssignment(data: any): Promise; +export function childLocationList(queryParams?: any): Promise; +export function getPractitionerWard(queryParams?: any): Promise; +export function getPrescriptionList(queryParams?: any): Promise; +export function getPersonAccount(queryParams?: any): Promise; +export function getDRMedication(queryParams?: any): Promise; +export function updateTransferDepartment(encounterId: any): Promise; +export function updateOutHospital(encounterId: any): Promise; +export function getTransferOptions(): Promise; +export function terminalCleaning(encounterId: any): Promise; +export function cancelBedAssignment(encounterId: any): Promise; +export function changeBedAssignment(encounterId: any, targetBedId: any): Promise; +export function getWardList(queryParams?: any): Promise; diff --git a/healthlink-his-ui/src/views/inpatientNurse/inOut/components/bedAllocation.vue b/healthlink-his-ui/src/views/inpatientNurse/inOut/components/bedAllocation.vue index 40d49b936..b5b8634a7 100755 --- a/healthlink-his-ui/src/views/inpatientNurse/inOut/components/bedAllocation.vue +++ b/healthlink-his-ui/src/views/inpatientNurse/inOut/components/bedAllocation.vue @@ -120,11 +120,11 @@ @ok-act="handleTransferInOk" /> - + /> -->