diff --git a/src/static-data/core.ts b/src/static-data/core.ts index 950a733..9068a5b 100644 --- a/src/static-data/core.ts +++ b/src/static-data/core.ts @@ -15,4 +15,60 @@ export const getDeptData = () => { depts.push({ label: '神经外科', value: '神经外科' }) depts.push({ label: '心脏内科', value: '心脏内科' }) return depts +} + +export const getPatients = () => { + const patients = [] + while (patients.length < 10000) { + patients.push({ name: '张' + patients.length, code: 'BH' + patients.length }) + } + return patients +} +export const getNarcotismWay = () => { + const narcotismWay = [] + while (narcotismWay.length < 10) { + const str: string = '麻醉方式' + (narcotismWay.length + 1) + narcotismWay.push({label: str, value: str}) + } + return narcotismWay +} +export const getFormTypes = () => { + const types = [ + {name: '生命体征表单'}, + {name: 'AI给药记录'}, + {name: '医生给药记录'}, + {name: '给药命令反馈'}, + {name: '输药泵定时间反馈'}, + {name: '术后信息表单'}, + {name: '1生命体征表单'}, + {name: '1AI给药记录'}, + {name: '1医生给药记录'}, + {name: '1给药命令反馈'}, + {name: '1输药泵定时间反馈'}, + {name: '1术后信息表单'}, + {name: '2生命体征表单'}, + {name: '2AI给药记录'}, + {name: '2医生给药记录'}, + {name: '2给药命令反馈'}, + {name: '2输药泵定时间反馈'}, + {name: '2术后信息表单'}, + ] + return types +} +export const getDataAlarmState = (value: number, key: string) => { + const alarms: any = { + BIS: { min: 40, max: 60 }, + HR: { min: 50, max: 80 }, + SBP: { min: 90, max: 120 }, + DBP: { min: 60, max: 90 }, + ST: { min: -0.2, max: 0.2 }, + EtCO2: { min: 30, max: 45 } + } + const obj = alarms[key] + let res: 'min' | 'max' | '' = '' + if(obj) { + if(value < obj.min) res = 'min' + else if(value > obj.max) res = 'max' + } + return res } \ No newline at end of file diff --git a/src/utils/table-util.ts b/src/utils/table-util.ts index b2613c2..1d5595b 100644 --- a/src/utils/table-util.ts +++ b/src/utils/table-util.ts @@ -1,5 +1,6 @@ import * as XLSX from "xlsx" import { ElMessage, ElMessageBox } from 'element-plus' +import { dateFormater } from '@/utils/date-util' export const tableRemoveRow = (params: any, callback: (res: boolean) => void) => { if (!params.data) params.data = [] @@ -41,10 +42,31 @@ export const tableRemoveRow = (params: any, callback: (res: boolean) => void) => } export const exportData = (fileName: string, data: Array) => { + if(data.length < 1) return const wb = XLSX.utils.book_new(); XLSX.utils.book_append_sheet( wb, XLSX.utils.json_to_sheet(data) - ); + ) + XLSX.writeFile(wb, fileName + '.xls'); // 导出Excel +} + +/** + * + * @param fileName + * @param data + * @param sheetNameKey data中的键名 对应表页名称 + * @param sheetDataKey data中的键名 对应表数据 + */ +export const exportMultiData = (fileName: string, data: Array, sheetNameKey: string, sheetDataKey: string) => { + if(data.length < 1) return + const wb = XLSX.utils.book_new(); + data.forEach(item => { + XLSX.utils.book_append_sheet( + wb, + XLSX.utils.json_to_sheet(item[sheetDataKey]), + item[sheetNameKey] instanceof Date ? dateFormater('yyyy-MM-dd HH:mm:ss', item[sheetNameKey]) : item[sheetNameKey] + ) + }) XLSX.writeFile(wb, fileName + '.xls'); // 导出Excel } \ No newline at end of file diff --git a/src/views/patients-manage/patients-manage.vue b/src/views/patients-manage/patients-manage.vue index a574edc..911df16 100644 --- a/src/views/patients-manage/patients-manage.vue +++ b/src/views/patients-manage/patients-manage.vue @@ -57,12 +57,16 @@ + \ No newline at end of file diff --git a/src/views/remote-manage/part/remote-dialog.vue b/src/views/remote-manage/part/remote-dialog.vue index 95d2c42..fa6b7f4 100644 --- a/src/views/remote-manage/part/remote-dialog.vue +++ b/src/views/remote-manage/part/remote-dialog.vue @@ -16,7 +16,7 @@
确定连接 - 返回 + 返回
@@ -116,7 +116,7 @@ const breakRemote = () => { } .btn-box { display: flex; - justify-content: space-between; + justify-content: center; align-items: center; margin-top: 50px; .el-button {