websocketEnum.25a5c533.js 975 B

1
  1. import{u as r,l as i,eg as u}from"./index.ae52ebae.js";const{websocketUrl:T}=r(),t=i(),l=`?Authorization=${t.getToken}&LoginType=${t.getLoginType}`,s={server:`${T+l}`,sendValue:"",record:{}},{status:o,data:N,send:O}=u(s.server,{autoReconnect:{delay:5e3,onFailed:()=>{}},onMessage:e=>{},heartbeat:{interval:1e3*10},autoClose:!1});function f(e,n){const a={id:e.id,type:e.isSub?"sub":"unsub",params:e.params||[],tenantId:n||t.getUserInfo.tenantId||"1"};s.sendValue=JSON.stringify(a),o.value==="OPEN"&&O(s.sendValue)}function g(){return{status:o,data:N}}function _(e){if(e!=="pong"&&e!==null)return JSON.parse(e)}var c=(e=>(e.PATIENT_MONITOR="patient-monitor",e.MONITOR_STATE_COUNT="monitor-state-count",e.MONITOR_TIME_COUNT="monitor-time-count",e.PATIENT_UPDATE="patient-update",e.DEVICE_REPEAT="device-repeat",e.DEVICE_NONE="device-none",e.MONITOR_TOTAL_COUNT="monitor-total-count",e.FINISHED_CLINICID="finished-clinicId",e.ALL="all",e))(c||{});export{c as W,_ as f,g,f as s};