import apiClient from '../../../utils/axios' // 设置设备温度 export const setAllTemperature = async (data: any) => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setIncubateBoxTemperature?val=${data}`, ) await apiClient.post( `/api/v1/app/DeviceSetting/setPlateBoxTemperature?val=${data}`, ) return res.data } catch (error) { console.log('修改温度出错', error) } } export const setIncubateBoxTemperature = async (data: any) => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setIncubateBoxTemperature?val=${data}`, ) return res.data } catch (error) { console.log('修改温度出错', error) } } export const setPlateBoxTemperature = async (data: any) => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setPlateBoxTemperature?val=${data}`, ) return res.data } catch (error) { console.log('修改温度出错', error) } } // 设置语言 export const setLanguage = async (language: 'zh_CN' | 'en_US') => { console.log('修改语言', language) try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setLanguage?val=${language}`, ) return res.data } catch (error) { console.log('修改语言出错', error) } } export const setDHCP = async (enable: boolean) => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setDHCCP?val=${enable}`, ) return res.data } catch (error) { console.log('修改DHCP出错', error) } } // data : number[] export const getTemperatureRange = async () => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/getTemperatureAvailableRange`, ) return res.data } catch (error) { console.log('修改DHCP出错', error) } } export const setLocalIP = async (ip: string) => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setLocalIp?val=${ip}`, ) return res.data } catch (error) { console.log('修改localIP出错', error) } } // 设置自动打印报告 export const setAutoPrint = async (data: any) => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setAutoPrint?val=${data}`, ) return res.data } catch (error) { console.log('设置自动打印出错', error) } } // 设置自动登出 export const setAutoLogout = async (data: boolean) => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setAutoLogout?val=${data}`, ) return res.data } catch (error) { console.log('设置自动登出出错', error) } } export const setAutoLogoutTime = async (data: number) => { try { const res = await apiClient.post( `/api/v1/app/DeviceSetting/setAutoLogoutTimeout?val=${data}`, ) return res.data } catch (error) { console.log('设置自动登出出错', error) } } //获取系统设置 export const getSystemSettings = async () => { try { const res = await apiClient.post('/api/v1/app/DeviceSetting/getSetting') return res.data } catch (error) { console.log('获取系统设置出错', error) } } // LIS 相关 export type LISType = 'SINGLE_TRACK' | 'DOUBLE_TRACK' export const LISTypeMap = { SINGLE_TRACK: '单向', DOUBLE_TRACK: '双向', } // 设置LIS类型 export const setLISType = async (data: LISType) => { try { const res = await apiClient.post( `/api/v1/app/LISSetting/setLISType?val=${data}`, ) return res.data } catch (error) { console.log('设置LIS类型出错', error) } } export type LISSerialBaudrate = 'B9600' | 'B12800' | 'B19200' | 'B115200' export const LISSerialBaudrateMap = { B9600: '9,600bps', B12800: '12,800bps', B19200: '19,200bps', B115200: '115,200bps', } // 设置LIS串口波特率 export const setLISSerialBaudrate = async (data: LISSerialBaudrate) => { try { const res = await apiClient.post( `/api/v1/app/LISSetting/setLISSerialBaudrate?val=${data}`, data, ) return res.data } catch (error) { console.log('设置LIS串口波特率出错', error) } } export type LISProtocol = 'Boditech' | 'Simens' // 设置LIS协议 export const setLISProtocol = async (data: LISProtocol) => { try { const res = await apiClient.post( `/api/v1/app/LISSetting/setLISProtocol?val=${data}`, ) return res.data } catch (error) { console.log('设置LIS协议出错', error) } } // 设置LIS端口 export const setLISNetPort = async (data: number | string) => { try { const res = await apiClient.post( `/api/v1/app/LISSetting/setLISNetPort?val=${data}`, ) return res.data } catch (error) { console.log('设置LIS端口出错', error) } } // 设置LIS IP export const setLISNetIp = async (data: string) => { try { const res = await apiClient.post( `/api/v1/app/LISSetting/setLISNetIp?val=${data}`, ) return res.data } catch (error) { console.log('设置LIS IP出错', error) } } // 设置LIS是否自动上传报告 export const setLISAutoExport = async (data: boolean) => { try { const res = await apiClient.post( `/api/v1/app/LISSetting/setLISAutoExport?val=${data}`, ) return res.data } catch (error) { console.log('设置LIS自动上传出错', error) } } export type LISInterface = 'SERIAL' | 'NETWORK' export const LISInterfaceMap = { SERIAL: 'Serial', NETWORK: 'TCP/IP', } // 设置LIS接口 export const setLISInterface = async (data: LISInterface) => { try { const res = await apiClient.post( `/api/v1/app/LISSetting/setLIFIf?val=${data}`, ) return res.data } catch (error) { console.log('设置LIS接口出错', error) } } export type LISSettings = { LISType: LISType LISProtocol: LISProtocol LIFIf: LISInterface LISAutoExport: boolean LISSerialBaudrate: LISSerialBaudrate LISNetIp: string LISNetPort: number } export const getLISSetting = async () => { try { const res = await apiClient.post(`/api/v1/app/LISSetting/getSetting`) return res.data } catch (error) { console.log('设置LIS配置出错', error) } }