import {getData, postData} from '@/axios/index' export const getHospitalsData = () => { const hospitals = [] as any hospitals.push({ label: '北京朝阳医院', value: '北京朝阳医院' }) hospitals.push({ label: '北京朝阳医院1', value: '北京朝阳医院1' }) hospitals.push({ label: '北京朝阳医院2', value: '北京朝阳医院2' }) return new Promise((resolve, reject) => { getData('/url', {}).then((res: any) => { resolve(hospitals) }).catch((err: any) => { resolve(hospitals) }) }) } export const getPhoneAreasData = () => { return ['中国 +86'] } export const getDeptData = () => { const depts = [] depts.push({ label: '神经外科', value: '神经外科' }) depts.push({ label: '心脏内科', value: '心脏内科' }) return depts } export const getMessageType = () => { const type = [] type.push({ label: '通知', value: '通知' }) type.push({ label: '公告', value: '公告' }) return type } export const getLogType = () => { const type = [] type.push({ label: '正常', value: '正常' }) type.push({ label: '异常', value: '异常' }) type.push({ label: '添加', value: '添加' }) type.push({ label: '删除', value: '删除' }) type.push({ label: '编辑', value: '编辑' }) return type } export const getusers = () => { const user = [] while (user.length < 50) { user.push({ name: '管理员' + user.length, code: 'admin' + user.length }) } return user } // 病人名称数据 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 }