index.html 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  7. <title>SBIF评分系统</title>
  8. <link rel="stylesheet" href="./static/common/layui/css/layui.css" />
  9. <style>
  10. body {
  11. background: #23282B;
  12. color: #FFF;
  13. font-size: 14px;
  14. }
  15. .content {
  16. overflow: hidden;
  17. }
  18. .content-title {
  19. height: 40px;
  20. line-height: 40px;
  21. padding: 0 15px;
  22. display: flex;
  23. justify-content: space-between;
  24. }
  25. .content-body {
  26. background: #283637;
  27. }
  28. .content-body .data-item-group {
  29. display: flex;
  30. }
  31. .content-body .data-item-group .data-item-l, .content-body .data-item-group .data-item-r {
  32. border: 1px solid #21292B;
  33. padding: 0 10px;
  34. height: 40px;
  35. line-height: 40px;
  36. flex: 1;
  37. padding: 0 15px;
  38. display: flex;
  39. text-align: left;
  40. white-space: nowrap;
  41. text-overflow: ellipsis;
  42. overflow: hidden;
  43. }
  44. .content-body .data-item {
  45. padding: 0 10px;
  46. height: 40px;
  47. line-height: 40px;
  48. }
  49. .red {
  50. color: red;
  51. }
  52. .orangered {
  53. color: orangered;
  54. }
  55. .yellow {
  56. color: yellow;
  57. }
  58. .olive {
  59. color: olive;
  60. }
  61. .green {
  62. color: green;
  63. }
  64. .color-block {
  65. position: absolute;
  66. right: 0;
  67. top: 0;
  68. }
  69. .color-block ul, .color-block li {
  70. margin: 0;
  71. padding: 0;
  72. }
  73. .color-block li {
  74. padding: 5px 10px;
  75. color: #111;
  76. }
  77. .color-block li.red-block {
  78. background-color: red;
  79. }
  80. .color-block li.orangered-block {
  81. background-color: orangered;
  82. }
  83. .color-block li.yellow-block {
  84. background-color: yellow;
  85. }
  86. .color-block li.olive-block {
  87. background-color: olive;
  88. }
  89. .color-block li.green-block {
  90. background-color: green;
  91. }
  92. #page-content {
  93. display: none;
  94. }
  95. .dialog {
  96. position: fixed;
  97. z-index: 9999;
  98. top: 15%;
  99. background: #FFF;
  100. width: 90%;
  101. margin: 0 2.5%;
  102. color: #333;
  103. border-radius: 2px;
  104. padding: 2.5%;
  105. }
  106. .dialog-title {
  107. height: 30px;
  108. line-height: 30px;
  109. display: flex;
  110. justify-content: space-between;
  111. border-bottom: 1px solid #eee;
  112. }
  113. .dialog-title .layui-icon {
  114. color: #333;
  115. font-weight: bold;
  116. }
  117. .static-data .data-item-l {
  118. display: flex;
  119. }
  120. .layui-item {
  121. flex: 1;
  122. background: none;
  123. border: none;
  124. color: #FFF;
  125. }
  126. .radio-label {
  127. margin: 0 5px;
  128. padding: 5px 20px;
  129. }
  130. .radio-label input, .radio-label select {
  131. margin-right: 10px;
  132. position: relative;
  133. top: 1px;
  134. }
  135. .layui-item {
  136. background: #283637;
  137. }
  138. .toast {
  139. position: fixed;
  140. top: 20%;
  141. z-index: 999;
  142. text-align: center;
  143. width: 100%;
  144. }
  145. .toast-info {
  146. background: #FFF;
  147. color: #333;
  148. display: inline-block;
  149. padding: 10px 20px;
  150. border-radius: 3px;
  151. font-size: 14px;
  152. }
  153. </style>
  154. </head>
  155. <body>
  156. <div class="container" id="app">
  157. <div id="page-content">
  158. <div class="color-block">
  159. <ul>
  160. <li class="red-block">五级</li>
  161. <li class="orangered-block">四级</li>
  162. <li class="yellow-block">三级</li>
  163. <li class="olive-block">二级</li>
  164. <li class="green-block">一级</li>
  165. </ul>
  166. </div>
  167. <div class="content">
  168. <div class="content-title">
  169. <div>
  170. 人工SBIF累计评分
  171. </div>
  172. </div>
  173. <div class="content-body">
  174. <div class="data-item-group">
  175. <div class="data-item-l">
  176. {{jifaScore ? jifaScore : ''}}
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. <div class="content">
  182. <div class="content-title">
  183. <div>
  184. SBIF即时评分
  185. </div>
  186. <div>
  187. <button type="button" class="layui-btn" style="margin-right: 40px" @click="openImmediateScore('ISBIF即时评分')">
  188. <i class="layui-icon layui-icon-chart-screen"></i>
  189. </button>
  190. </div>
  191. </div>
  192. <div class="content-body">
  193. <div class="data-item-group">
  194. <div class="data-item-l">
  195. {{jiangeScore ? jiangeScore : ''}}
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. <div class="content">
  201. <div class="content-title">
  202. <div>
  203. 自动SBIF累计评分
  204. </div>
  205. <button type="button" class="layui-btn" @click="openAutoScore('自动ISBIF累计评分')">
  206. <i class="layui-icon layui-icon-chart-screen"></i>
  207. </button>
  208. </div>
  209. <div class="content-body">
  210. <div class="data-item-group">
  211. <div class="data-item-l">
  212. {{dingsdianScore ? dingsdianScore : ''}}
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. <div class="content">
  218. <div class="content-title">
  219. <div>
  220. 静态指标
  221. </div>
  222. <div>
  223. <button type="button" class="layui-btn" @click="saveStaticData">
  224. 保存静态数据
  225. </button>
  226. </div>
  227. </div>
  228. <div class="content-body static-data">
  229. <div class="data-item-group">
  230. <div class="data-item-l">
  231. <div>
  232. <span :class="$options.filters._indexMovement(staticIndex)">运动</span>:
  233. </div>
  234. <!-- <input type="text" v-model="staticIndex.indexMovement" class="layui-item">-->
  235. <select v-model="staticIndex.indexMovement" class="layui-item">
  236. <option value="遵嘱活动">遵嘱活动</option>
  237. <option value="刺痛定位">刺痛定位</option>
  238. <option value="刺痛躲避">刺痛躲避</option>
  239. <option value="刺痛屈曲">刺痛屈曲</option>
  240. <option value="无反应">无反应</option>
  241. </select>
  242. </div>
  243. </div>
  244. <div class="data-item-group">
  245. <div class="data-item-l">
  246. <div @click="showAbnormalInfo(2,$options.filters._tongReflect(staticIndex))">
  247. <span :class="$options.filters._tongReflect(staticIndex)">瞳孔对光反射</span>:
  248. </div>
  249. <!-- <input type="text" v-model="staticIndex.tongReflect" class="layui-item">-->
  250. <select v-model="staticIndex.tongReflect" class="layui-item">
  251. <option value="双瞳反应">双瞳反应</option>
  252. <option value="单瞳反应">单瞳反应</option>
  253. <option value="双瞳无反应">双瞳无反应</option>
  254. </select>
  255. </div>
  256. </div>
  257. <div class="data-item-group">
  258. <div class="data-item-l">
  259. <div @click="showAbnormalInfo(2,$options.filters._tongChange(staticIndex))">
  260. <span :class="$options.filters._tongChange(staticIndex)">瞳孔变化</span>:
  261. </div>
  262. <!-- <input type="text" v-model="staticIndex.tongChange" class="layui-item">-->
  263. <select v-model="staticIndex.tongChange" class="layui-item">
  264. <option value="等大等圆">等大等圆</option>
  265. <option value="单瞳增大">单瞳增大</option>
  266. <option value="双瞳增大">双瞳增大</option>
  267. </select>
  268. </div>
  269. </div>
  270. <div class="data-item-group">
  271. <div class="data-item-l">
  272. <div @click="showAbnormalInfo(2,$options.filters._indexXz(staticIndex))">
  273. <span :class="$options.filters._indexXz(staticIndex)">血肿体积(ml)</span>:
  274. </div>
  275. <input type="nubmer" v-model="staticIndex.indexXz" class="layui-item">
  276. </div>
  277. </div>
  278. <div class="data-item-group">
  279. <div class="data-item-l">
  280. <div>
  281. <span :class="$options.filters._indexZwm(staticIndex)">蛛网膜下腔出血</span>:
  282. </div>
  283. <!-- <input type="text" v-model="staticIndex.indexZwm" class="layui-item">-->
  284. <select v-model="staticIndex.indexZwm" class="layui-item">
  285. <option value="无">无</option>
  286. <option value="有">有</option>
  287. </select>
  288. </div>
  289. </div>
  290. <!-- <div class="data-item-group">-->
  291. <!-- <div class="data-item-l">-->
  292. <!-- 血糖(mmol/l):<input type="text" v-model="staticIndex.indexXt" class="layui-item">-->
  293. <!-- </div>-->
  294. <!-- </div>-->
  295. <div class="data-item-group">
  296. <div class="data-item-l">
  297. <div @click="showAbnormalInfo(2,$options.filters._indexNzx(staticIndex))">
  298. <span :class="$options.filters._indexNzx(staticIndex)">脑中线偏移距离(cm)</span>:
  299. </div>
  300. <input type="nubmer" v-model="staticIndex.indexNzx" class="layui-item">
  301. </div>
  302. </div>
  303. <div class="data-item-group">
  304. <div class="data-item-l">
  305. <div @click="showAbnormalInfo(2,staticIndex.indexHckd<1)">
  306. 环池平均宽度(mm):
  307. </div>
  308. <input type="nubmer" v-model="staticIndex.indexHckd" class="layui-item">
  309. </div>
  310. </div>
  311. <div class="data-item-group">
  312. <div class="data-item-l">
  313. <div>
  314. 年龄:
  315. </div>
  316. <input type="text" v-model="staticIndex.age" class="layui-item">
  317. </div>
  318. </div>
  319. <div class="data-item-group">
  320. <div class="data-item-l">
  321. <div>
  322. <span :class="$options.filters._surgery(staticIndex)">是否手术</span>:
  323. </div>
  324. <label class="radio-label" for="is_surgery_code1"><input id="is_surgery_code1" v-model="staticIndex.surgery"
  325. type="radio" name="isSurgery" value="1" title="否" checked />否</label>
  326. <label class="radio-label" for="is_surgery_code2"><input id="is_surgery_code2" type="radio" v-model="staticIndex.surgery"
  327. name="isSurgery" value="2" title="是" />是</label>
  328. </div>
  329. </div>
  330. <div class="data-item-group">
  331. <div class="data-item-l">
  332. <div>
  333. <span :class="$options.filters._medicalHistory(staticIndex)">既往慢性病史</span>:
  334. </div>
  335. <!-- <input type="text" v-model="staticIndex.medicalHistory" class="layui-item">-->
  336. <select v-model="staticIndex.medicalHistory" class="layui-item">
  337. <option value="无">无</option>
  338. <option value="有一个">有一个</option>
  339. <option value="有两个">有两个</option>
  340. <option value="有三个">有三个</option>
  341. </select>
  342. </div>
  343. </div>
  344. </div>
  345. <div id="myChart" style="height: 400px;width: 100%;"></div>
  346. </div>
  347. <div class="content">
  348. <div class="content-title">
  349. 动态指标
  350. </div>
  351. <div class="content-body">
  352. <div class="data-item-group">
  353. <div class="data-item-l" @click="showAbnormalInfo(3,$options.filters._systValue(systValue))">
  354. <span :class="$options.filters._systValue(systValue)">收缩压</span>:{{systValue ?
  355. systValue.systValue : ''}}
  356. </div>
  357. </div>
  358. <div class="data-item-group">
  359. <div class="data-item-l">
  360. 舒张压:{{systValue ? systValue.diasValue : ''}}
  361. </div>
  362. </div>
  363. <div class="data-item-group">
  364. <!--<div class="data-item-l">-->
  365. <!--平均压:{{systValue ? systValue.mapValue : ''}}-->
  366. <!--</div>-->
  367. <div class="data-item-l">
  368. <span :class="$options.filters._avgValue(systValue)">平均动脉压</span>(mmHg):{{systValue ?
  369. systValue.avgValue : ''}}
  370. </div>
  371. </div>
  372. <div class="data-item-group">
  373. <div class="data-item-l" @click="showAbnormalInfo(1,$options.filters._icpValue(systValue))">
  374. <span :class="$options.filters._icpValue(systValue)">颅内压</span>(mmHg):{{systValue ?
  375. systValue.icpValue
  376. : ''}}
  377. </div>
  378. </div>
  379. <div class="data-item-group">
  380. <div class="data-item-l" @click="showAbnormalInfo(4,$options.filters._ngzyValue(systValue))">
  381. <span :class="$options.filters._ngzyValue(systValue)">脑灌注压</span>(mmHg):{{systValue ?
  382. systValue.ngzyValue : ''}}
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. <div class="content">
  388. <div class="content-title">
  389. &nbsp;
  390. </div>
  391. <div class="content-body">
  392. <div class="data-item-group">
  393. <div class="data-item-l" @click="showAbnormalInfo(5,$options.filters._spo2Grade(spo2Value))">
  394. <span :class="$options.filters._spo2Grade(spo2Value)">血氧饱和度</span>(%):{{ spo2Value ?
  395. spo2Value.spo2Value : ""}}
  396. </div>
  397. </div>
  398. <!-- <div class="data-item-group">-->
  399. <!-- <div class="data-item-l">-->
  400. <!-- 血氧脉搏值:{{ spo2Value ? spo2Value.rateValue : ""}}-->
  401. <!-- </div>-->
  402. <!-- </div>-->
  403. <div class="data-item-group">
  404. <div class="data-item-l">
  405. 血流灌注指数:{{ spo2Value ? spo2Value.perfValue : ""}}
  406. </div>
  407. </div>
  408. </div>
  409. </div>
  410. <div class="content">
  411. <div class="content-title">
  412. &nbsp;
  413. </div>
  414. <div class="content-body">
  415. <div class="data-item-group">
  416. <div class="data-item-l" @click="showAbnormalInfo(7,$options.filters._heartValue(heartValue))">
  417. <span :class="$options.filters._heartValue(heartValue)">心跳</span>(bpm):{{ heartValue ?
  418. heartValue.heartValue : ""}}
  419. </div>
  420. </div>
  421. <!-- <div class="data-item-group">-->
  422. <!-- <div class="data-item-l">-->
  423. <!-- 心室收缩次数:{{ heartValue ? heartValue.vpcValue : ""}}-->
  424. <!-- </div>-->
  425. <!-- </div>-->
  426. <!-- <div class="data-item-group">-->
  427. <!-- <div class="data-item-l">-->
  428. <!-- 心脏停搏:{{ heartValue ? heartValue.pauseValue : ""}}-->
  429. <!-- </div>-->
  430. <!-- </div>-->
  431. <!-- <div class="data-item-group">-->
  432. <!-- <div class="data-item-l">-->
  433. <!-- 成对早搏:{{ heartValue ? heartValue.coupletsValue : ""}}-->
  434. <!-- </div>-->
  435. <!-- </div>-->
  436. <!-- <div class="data-item-group">-->
  437. <!-- <div class="data-item-l">-->
  438. <!-- 漏搏:{{ heartValue ? heartValue.beatsValue : ""}}-->
  439. <!-- </div>-->
  440. <!-- </div>-->
  441. <!-- <div class="data-item-group">-->
  442. <!-- <div class="data-item-l">-->
  443. <!-- RonTs融合:{{ heartValue ? heartValue.rontsValue : ""}}-->
  444. <!-- </div>-->
  445. <!-- </div>-->
  446. <!-- <div class="data-item-group">-->
  447. <!-- <div class="data-item-l">-->
  448. <!-- 室性过早搏动:{{ heartValue ? heartValue.vpbValue : ""}}-->
  449. <!-- </div>-->
  450. <!-- </div>-->
  451. <div class="data-item-group">
  452. <div class="data-item-l">
  453. <span :class="$options.filters._respValue(heartValue)">呼吸率</span>(bpm): {{ heartValue ?
  454. heartValue.respValue : ""}}
  455. </div>
  456. </div>
  457. </div>
  458. </div>
  459. <div class="content">
  460. <div class="content-title">
  461. &nbsp;
  462. </div>
  463. <div class="content-body">
  464. <div class="data-item-group">
  465. <div class="data-item-l" @click="showAbnormalInfo(6,$options.filters._tempValue(tempValue))">
  466. <span :class="$options.filters._tempValue(tempValue)">体温</span>(℃):{{ tempValue ?
  467. tempValue.tempValue : ""}}
  468. </div>
  469. </div>
  470. </div>
  471. </div>
  472. <div class="content">
  473. <div class="content-title">
  474. <div>
  475. </div>
  476. <div>
  477. <button type="button" class="layui-btn" @click="saveBloodGasData">
  478. 保存血气数据
  479. </button>
  480. </div>
  481. </div>
  482. <div class="content-body">
  483. <div class="data-item-group">
  484. <div class="data-item-l" >
  485. <span :class="$options.filters._K(nA)" @click="showAbnormalInfo(9,$options.filters._K(nA))">钾离子(K)</span>:
  486. <!-- {{ nA ? nA.K : ""}}-->
  487. <input type="nubmer" v-model="nA.K" class="layui-item">
  488. </div>
  489. </div>
  490. <div class="data-item-group">
  491. <div class="data-item-l" >
  492. <div >
  493. <span :class="nA.NA>145?'red':(nA.NA<135?'green':'')" @click="showAbnormalInfo(nA.NA>145?14:(nA.NA<135&&nA.NA>=130?15:(nA.NA<130?16:'')),nA.NA>145||nA.NA<135)">钠离子(NA):</span>
  494. </div>
  495. <!-- {{ nA ? nA.NA : ""}}-->
  496. <input type="nubmer" v-model="nA.NA" class="layui-item">
  497. </div>
  498. </div>
  499. <div class="data-item-group">
  500. <div class="data-item-l">
  501. <div>
  502. <span :class="$options.filters._ICA(nA)">钙离子(ICA)</span>:
  503. </div>
  504. <!-- {{ nA ? nA.LAC : ""}}-->
  505. <input type="nubmer" v-model="nA.ICA" class="layui-item">
  506. </div>
  507. </div>
  508. <div class="data-item-group">
  509. <div class="data-item-l">
  510. <span :class="$options.filters._CL(nA)">氯离子(CL)</span>:
  511. <!-- {{ nA ? nA.CL : ""}}-->
  512. <input type="nubmer" v-model="nA.CL" class="layui-item">
  513. </div>
  514. </div>
  515. <div class="data-item-group">
  516. <div class="data-item-l" >
  517. <span :class="$options.filters._ph(nA)" @click="showAbnormalInfo(10,$options.filters._ph(nA))">酸碱度(PH)</span>:
  518. <!-- {{ nA ? nA.PH : ""}}-->
  519. <input type="nubmer" v-model="nA.PH" class="layui-item">
  520. </div>
  521. </div>
  522. <div class="data-item-group">
  523. <div class="data-item-l">
  524. <span :class="$options.filters._GLU(nA)" @click="showAbnormalInfo(12,$options.filters._GLU(nA))">血糖(GLU)</span>:
  525. <!-- {{ nA ? nA.GLU : ""}}-->
  526. <input type="nubmer" v-model="nA.GLU" class="layui-item">
  527. </div>
  528. </div>
  529. <div class="data-item-group">
  530. <div class="data-item-l">
  531. <span :class="$options.filters._LAC(nA)">血乳酸(LAC)</span>:
  532. <!-- {{ nA ? nA.LAC : ""}}-->
  533. <input type="nubmer" v-model="nA.LAC" class="layui-item">
  534. </div>
  535. </div>
  536. <div class="data-item-group">
  537. <div class="data-item-l" >
  538. <span :class="$options.filters._HB(nA)" >血红蛋白(HB)</span>:
  539. <!-- {{ nA ? nA.HB : ""}}-->
  540. <input type="nubmer" v-model="nA.HB" class="layui-item">
  541. </div>
  542. </div>
  543. <div class="data-item-group">
  544. <div class="data-item-l">
  545. <!-- @click="showAbnormalInfo(17,$options.filters._HCO3(nA))" -->
  546. <div><span :class="$options.filters._HCO3(nA)" >碳酸氢根(HCO3)</span>:</div>
  547. <!-- {{ nA ? nA.HCO3 : ""}}-->
  548. <input type="nubmer" v-model="nA.HCO3" class="layui-item">
  549. </div>
  550. </div>
  551. <div class="data-item-group">
  552. <div class="data-item-l" >
  553. <span :class="$options.filters._BE(nA)">碱剩余(BE)</span>:
  554. <!-- {{ nA ? nA.BE : ""}}-->
  555. <input type="nubmer" v-model="nA.BE" class="layui-item">
  556. </div>
  557. </div>
  558. <div class="data-item-group">
  559. <div class="data-item-l" >
  560. <span :class="$options.filters._TCO2(nA)">总二氧化碳(TCO2)</span>:
  561. <!-- {{ nA ? nA.TCO2 : ""}}-->
  562. <input type="nubmer" v-model="nA.TCO2" class="layui-item">
  563. </div>
  564. </div>
  565. <div class="data-item-group">
  566. <div class="data-item-l">
  567. <span :class="$options.filters._PO2(nA)" @click="showAbnormalInfo(5,$options.filters._PO2(nA))">氧分压(PO2)</span>:
  568. <!-- {{ nA ? nA.PO2 : ""}}-->
  569. <input type="nubmer" v-model="nA.PO2" class="layui-item">
  570. </div>
  571. </div>
  572. <div class="data-item-group">
  573. <div class="data-item-l" >
  574. <span :class="$options.filters._PCO2(nA)" @click="showAbnormalInfo(18,$options.filters._PCO2(nA))">二氧化碳分压(PCO2)</span>:
  575. <!-- {{ nA ? nA.PCO2 : ""}}-->
  576. <input type="nubmer" v-model="nA.PCO2" class="layui-item">
  577. </div>
  578. </div>
  579. <div class="data-item-group">
  580. <div class="data-item-l" >
  581. <!-- @click="showAbnormalInfo(11,$options.filters._BUN(nA))" -->
  582. <span :class="$options.filters._BUN(nA)">尿素氮(BUN)</span>:
  583. <!-- {{ nA ? nA.BUN : ""}}-->
  584. <input type="nubmer" v-model="nA.BUN" class="layui-item">
  585. </div>
  586. </div>
  587. <div class="data-item-group">
  588. <div class="data-item-l">
  589. <span :class="$options.filters._CREA(nA)" @click="showAbnormalInfo(11,$options.filters._CREA(nA))">血清肌酐(CREA)</span>:
  590. <!-- {{ nA ? nA.CREA : ""}}-->
  591. <input type="nubmer" v-model="nA.CREA" class="layui-item">
  592. </div>
  593. </div>
  594. <!-- <div class="data-item-group">-->
  595. <!-- <div class="data-item-l">-->
  596. <!-- 尿素:{{ nA ? nA.UREA : ""}}-->
  597. <!-- </div>-->
  598. <!-- </div>-->
  599. <!-- <div class="data-item-group">-->
  600. <!-- <div class="data-item-l">-->
  601. <!-- <span :class="$options.filters._ANGAP(nA)">阴离子间隙</span>:{{ nA ? nA.ANGAP : ""}}-->
  602. <!-- </div>-->
  603. <!-- </div>-->
  604. <!-- <div class="data-item-group">-->
  605. <!-- <div class="data-item-l">-->
  606. <!-- <span :class="$options.filters._SO2(nA)">氧饱和度</span>:{{ nA ? nA.SO2 : ""}}-->
  607. <!-- </div>-->
  608. <!-- </div>-->
  609. </div>
  610. </div>
  611. <div class="dialog" v-if="autoScoreDialog">
  612. <div class="dialog-title">
  613. <p>{{autoScoreTile}}</p>
  614. <p @click="autoScoreDialog = false"><i class="layui-icon layui-icon-close"></i></p>
  615. </div>
  616. <div class="dialog-content">
  617. <div id="auto_score" style="width: 100%;height: 300px"></div>
  618. </div>
  619. </div>
  620. <div class="dialog" v-if="immediateScoreDialog">
  621. <div class="dialog-title">
  622. <p>{{immediateScoreTile}}</p>
  623. <p @click="immediateScoreDialog = false"><i class="layui-icon layui-icon-close"></i></p>
  624. </div>
  625. <div class="dialog-content">
  626. <div id="immediate_score" style="width: 100%;height: 300px"></div>
  627. </div>
  628. </div>
  629. <div class="toast" v-if="toastFlag">
  630. <div class="toast-info">
  631. {{toastText}}
  632. </div>
  633. </div>
  634. </div>
  635. </div>
  636. </body>
  637. <script type="text/javascript" src="./static/common/plugins/jquery/jquery-3.2.1.min.js"></script>
  638. <script type="text/javascript" src="./static/common/plugins/ECharts/echarts.js"></script>
  639. <script type="text/javascript" src="./static/common/vuejs/vue.js"></script>
  640. <script src="./static/common/js/abnormalInfo.js"></script>
  641. <!-- <script type="text/javascript" src="./static/common/layui/lay/modules/layer.js"></script> -->
  642. <script type="text/javascript" src="./static/common/layui/layui.js"></script>
  643. <script>
  644. console.log({abnormalInfo})
  645. var getUrlParam = function(name) {
  646. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  647. var r = window.location.search.substr(1).match(reg);
  648. if (r != null) {
  649. return decodeURI(r[2]);
  650. } else {
  651. return null;
  652. }
  653. };
  654. var myChart;
  655. var heartCheck, websocket;
  656. var staticData = [];
  657. function setMessageInnerHTML(datas) {
  658. console.log(datas);
  659. }
  660. var randomData = function(val) {
  661. now = new Date(+now + oneDay);
  662. value = val ? val : 128;
  663. return {
  664. name: now.toString(),
  665. value: [
  666. [now.getFullYear(), now.getMonth() + 1, now.getDate()].join('/'),
  667. // time,
  668. // Math.round(value)
  669. value
  670. ]
  671. }
  672. }
  673. var chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
  674. 'v', 'w', 'x', 'y', 'z',
  675. 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
  676. 'X', 'Y', 'Z'
  677. ];
  678. function generateMixed(n) {
  679. var res = "";
  680. for (var i = 0; i < n; i++) {
  681. var id = Math.ceil(Math.random() * 51);
  682. res += chars[id];
  683. }
  684. return res;
  685. }
  686. var data = [];
  687. var now = +new Date(1997, 9, 3);
  688. var oneDay = 24 * 3600 * 1000;
  689. var value = Math.random() * 1000;
  690. for (var i = 0; i < 1000; i++) {
  691. data.push(randomData());
  692. }
  693. var baseUrl = 'http://180.76.164.148:8898/';
  694. // var baseUrl = 'http://192.168.3.171:8898/';
  695. var wsUrl = 'ws://180.76.164.148:9002?userId=ZDYY'
  696. // var wsUrl = 'ws://192.168.3.171:9002?userId=ZDYY'
  697. var app = new Vue({
  698. el: "#app",
  699. data: function() {
  700. return {
  701. userId: '',
  702. token: "",
  703. staticIndex: {
  704. indexMovement: null,
  705. tongReflect: null,
  706. tongChange: null,
  707. indexXz: null,
  708. indexZwm: null,
  709. indexXt: null,
  710. indexNzx: null,
  711. indexHckd: null,
  712. age: null,
  713. surgery: null,
  714. medicalHistory: null,
  715. }, // 静态指标
  716. nA: {
  717. K: null,
  718. NA: null,
  719. LAC: null,
  720. CL: null,
  721. PH: null,
  722. GLU: null,
  723. ICA: null,
  724. HB: null,
  725. HCO3: null,
  726. BE: null,
  727. TCO2: null,
  728. PO2: null,
  729. PCO2: null,
  730. BUN: null,
  731. CREA: null,
  732. }, // '血糖'
  733. heartValue: null, // '心电指标'
  734. spo2Value: null, // '指脉氧饱和度指标
  735. systValue: null, // '无创血压'
  736. score: null, // '脑损害评分'
  737. potlI: null, // '心电图形参数'
  738. tempValue: null, // 体温
  739. jifaScore: null,
  740. dingsdianScore: null,
  741. jiangeScore: null,
  742. // 自动评分
  743. autoScoreDialog: false,
  744. autoScoreStatistics: [],
  745. autoScoreTile: '', // 统计标题
  746. staticData: [],
  747. // 即时评分
  748. immediateScoreDialog: false,
  749. immediateScoreTile: '',
  750. immediateScoreStatistics: [],
  751. websocket: null,
  752. toastFlag: false,
  753. toastText: '',
  754. }
  755. },
  756. filters: {
  757. _indexMovement(data) {
  758. var result = "";
  759. if (data == null) {
  760. return result;
  761. }
  762. var indexMovement = data.indexMovement;
  763. if (indexMovement != null && indexMovement !== '') { //运动
  764. var value = indexMovement;
  765. if ("无反应" === value) {
  766. result = "orangered";
  767. } else if ("刺痛屈曲" === value) {
  768. result = "yellow";
  769. } else if ("刺痛躲避" === value) {
  770. result = "olive";
  771. } else if ("刺痛定位" === value) {
  772. result = "green";
  773. }
  774. }
  775. return result;
  776. },
  777. _tongChange(data) {
  778. var result = "";
  779. if (data == null) {
  780. return result;
  781. }
  782. var tongChange = data.tongChange;
  783. if (tongChange != null && tongChange !== '') { //瞳孔变化
  784. var value = tongChange;
  785. if ("双瞳增大" === value) {
  786. result = "orangered";
  787. } else if ("单瞳增大" === value) {
  788. result = "olive";
  789. }
  790. }
  791. return result;
  792. },
  793. _tongReflect(data) {
  794. var result = "";
  795. if (data == null) {
  796. return result;
  797. }
  798. var tongReflect = data.tongReflect;
  799. if (tongReflect != null && tongReflect !== '') { //瞳孔反射
  800. var value = tongReflect;
  801. if ("双瞳无反应" === value) {
  802. result = "yellow";
  803. } else if ("单瞳反应" === value) {
  804. result = "green";
  805. }
  806. }
  807. return result;
  808. },
  809. _indexXz(data) {
  810. var result = "";
  811. if (data == null) {
  812. return result;
  813. }
  814. var indexXz = data.indexXz;
  815. if (indexXz != null && indexXz !== '') { //
  816. var value = indexXz;
  817. if (parseFloat(value) > 120) {
  818. result = "orangered";
  819. } else if (parseFloat(value) > 90) {
  820. result = "yellow";
  821. } else if (parseFloat(value) > 60) {
  822. result = "olive";
  823. } else if (parseFloat(value) > 30) {
  824. result = "green";
  825. }
  826. }
  827. return result;
  828. },
  829. _indexXz(data) {
  830. var result = "";
  831. if (data == null) {
  832. return result;
  833. }
  834. var indexXz = data.indexXz;
  835. if (indexXz != null && indexXz !== '') { //
  836. var value = indexXz;
  837. if (parseFloat(value) > 120) {
  838. result = "orangered";
  839. } else if (parseFloat(value) > 90) {
  840. result = "yellow";
  841. } else if (parseFloat(value) > 60) {
  842. result = "olive";
  843. } else if (parseFloat(value) > 30) {
  844. result = "green";
  845. }
  846. }
  847. return result;
  848. },
  849. _indexNzx(data) {
  850. var result = "";
  851. if (data == null) {
  852. return result;
  853. }
  854. var indexNzx = data.indexNzx;
  855. if (indexNzx != null && indexNzx !== '') { //
  856. var value = indexNzx;
  857. if (parseFloat(value) > 2) {
  858. result = "orangered";
  859. } else if (parseFloat(value) > 1.5) {
  860. result = "yellow";
  861. } else if (parseFloat(value) > 1) {
  862. result = "olive";
  863. } else if (parseFloat(value) > 0.5) {
  864. result = "green";
  865. }
  866. }
  867. return result;
  868. },
  869. _indexZwm(data) {
  870. var result = "";
  871. if (data == null) {
  872. return result;
  873. }
  874. var indexZwm = data.indexZwm;
  875. if (indexZwm != null && indexZwm !== '') { //
  876. var value = indexZwm;
  877. if ("有" == indexZwm) {
  878. result = "green";
  879. }
  880. }
  881. return result;
  882. },
  883. _surgery(data) {
  884. var result = "";
  885. if (data == null) {
  886. return result;
  887. }
  888. var surgery = data.surgery;
  889. if (surgery != null && surgery !== '') { //
  890. var value = surgery;
  891. if ("2" == surgery) {
  892. result = "olive";
  893. }
  894. }
  895. return result;
  896. },
  897. _medicalHistory(data) {
  898. var result = "";
  899. if (data == null) {
  900. return result;
  901. }
  902. var medicalHistory = data.medicalHistory;
  903. if (medicalHistory != null && medicalHistory !== '') { //
  904. var value = medicalHistory;
  905. if ("有两个" === medicalHistory || "有三个" === medicalHistory) {
  906. result = "olive";
  907. }
  908. }
  909. return result;
  910. },
  911. _tempValue(data) {
  912. var result = "";
  913. if (data == null) {
  914. return result;
  915. }
  916. if (data.tempValue !== undefined && data.tempValue !== null) {
  917. var value = data.tempValue;
  918. if (value >= 40.5) {
  919. result = "red";
  920. } else if (value >= 40) {
  921. result = "orangered";
  922. } else if (value >= 39.5) {
  923. result = "yellow";
  924. } else if (value >= 38.5) {
  925. result = "olive";
  926. } else if (value >= 37.5) {
  927. result = "green";
  928. }
  929. }
  930. return result;
  931. },
  932. _ph(data) {
  933. var result = "";
  934. if (data == null) {
  935. return result;
  936. }
  937. if (data.PH !== undefined && data.PH !== null) {
  938. var value = data.PH;
  939. if (value >= 7.7 || value <= 7.1) {
  940. result = "red";
  941. } else if (value >= 7.65 || value <= 7.15) {
  942. result = "orangered";
  943. } else if (value >= 7.6 || value <= 7.2) {
  944. result = "yellow";
  945. } else if (value >= 7.55 || value <= 7.25) {
  946. result = "olive";
  947. } else if (value >= 7.5 || value <= 7.3) {
  948. result = "green";
  949. }
  950. }
  951. return result;
  952. },
  953. _K(data) {
  954. var result = "";
  955. if (data == null) {
  956. return result;
  957. }
  958. if (data.K !== undefined && data.K !== null) {
  959. var value = data.K;
  960. if (value >= 6.1 || value <= 2.5) {
  961. result = "red";
  962. } else if (value >= 5.8 || value <= 2.6) {
  963. result = "orangered";
  964. } else if (value >= 5.6 || value <= 2.8) {
  965. result = "yellow";
  966. } else if (value >= 5.3 || value <= 3) {
  967. result = "olive";
  968. } else if (value >= 5 || value <= 3.2) {
  969. result = "green";
  970. }
  971. }
  972. return result;
  973. },
  974. _GLU(data) {
  975. var result = "";
  976. if (data == null) {
  977. return result;
  978. }
  979. if (data.GLU !== undefined && data.GLU !== null) {
  980. var value = data.GLU;
  981. if (value >= 25 || value <= 1) {
  982. result = "red";
  983. } else if (value >= 13 || value <= 1.5) {
  984. result = "orangered";
  985. } else if (value >= 9 || value <= 2) {
  986. result = "yellow";
  987. } else if (value >= 7 || value <= 2.2) {
  988. result = "olive";
  989. } else if (value >= 6 || value <= 3) {
  990. result = "green";
  991. }
  992. }
  993. return result;
  994. },
  995. _LAC(data) {
  996. var result = "";
  997. if (data == null) {
  998. return result;
  999. }
  1000. if (data.LAC !== undefined && data.LAC !== null) {
  1001. var value = data.LAC;
  1002. if (value >= 5.5 || value <= 0.05) {
  1003. result = "red";
  1004. } else if (value >= 5 || value <= 0.1) {
  1005. result = "orangered";
  1006. } else if (value >= 4.5 || value <= 0.2) {
  1007. result = "yellow";
  1008. } else if (value >= 4 || value <= 0.3) {
  1009. result = "olive";
  1010. } else if (value >= 3.5 || value <= 0.4) {
  1011. result = "green";
  1012. }
  1013. }
  1014. return result;
  1015. },
  1016. _CL(data) {
  1017. var result = "";
  1018. if (data == null) {
  1019. return result;
  1020. }
  1021. if (data.CL !== undefined && data.CL !== null) {
  1022. var value = data.CL;
  1023. if (value >= 130 || value <= 73) {
  1024. result = "red";
  1025. } else if (value >= 125 || value <= 78) {
  1026. result = "orangered";
  1027. } else if (value >= 120 || value <= 83) {
  1028. result = "yellow";
  1029. } else if (value >= 115 || value <= 88) {
  1030. result = "olive";
  1031. } else if (value >= 110 || value <= 93) {
  1032. result = "green";
  1033. }
  1034. }
  1035. return result;
  1036. },
  1037. _HCO3(data) {
  1038. var result = "";
  1039. if (data == null) {
  1040. return result;
  1041. }
  1042. if (data.HCO3 !== undefined && data.HCO3 !== null) {
  1043. var value = data.HCO3;
  1044. if (value >= 50 || value <= 6) {
  1045. result = "red";
  1046. } else if (value >= 48 || value <= 8) {
  1047. result = "orangered";
  1048. } else if (value >= 43 || value <= 10) {
  1049. result = "yellow";
  1050. } else if (value >= 38 || value <= 12) {
  1051. result = "olive";
  1052. } else if (value >= 33 || value <= 17) {
  1053. result = "green";
  1054. }
  1055. }
  1056. return result;
  1057. },
  1058. _HB(data) {
  1059. var result = "";
  1060. if (data == null) {
  1061. return result;
  1062. }
  1063. if (data.HB !== undefined && data.HB !== null) {
  1064. var value = data.HB;
  1065. if (value >= 25 || value <= 3) {
  1066. result = "red";
  1067. } else if (value >= 20 || value <= 5) {
  1068. result = "orangered";
  1069. } else if (value >= 19 || value <= 7) {
  1070. result = "yellow";
  1071. } else if (value >= 18.5 || value <= 9) {
  1072. result = "olive";
  1073. } else if (value >= 18 || value <= 11) {
  1074. result = "green";
  1075. }
  1076. }
  1077. return result;
  1078. },
  1079. _SO2(data) {
  1080. var result = "";
  1081. if (data == null) {
  1082. return result;
  1083. }
  1084. if (data.SO2 !== undefined && data.SO2 !== null) {
  1085. var value = data.SO2;
  1086. if (value >= 105 || value <= 60) {
  1087. result = "red";
  1088. } else if (value >= 104 || value <= 70) {
  1089. result = "orangered";
  1090. } else if (value >= 103 || value <= 80) {
  1091. result = "yellow";
  1092. } else if (value >= 102 || value <= 85) {
  1093. result = "olive";
  1094. } else if (value >= 101 || value <= 90) {
  1095. result = "green";
  1096. }
  1097. }
  1098. return result;
  1099. },
  1100. _BE(data) {
  1101. var result = "";
  1102. if (data == null) {
  1103. return result;
  1104. }
  1105. if (data.BE !== undefined && data.BE !== null) {
  1106. var value = data.BE;
  1107. if (value >= 8 || value <= -8) {
  1108. result = "red";
  1109. } else if (value >= 7 || value <= -7) {
  1110. result = "orangered";
  1111. } else if (value >= 6 || value <= -6) {
  1112. result = "yellow";
  1113. } else if (value >= 5 || value <= -5) {
  1114. result = "olive";
  1115. } else if (value >= 4 || value <= -4) {
  1116. result = "green";
  1117. }
  1118. }
  1119. return result;
  1120. },
  1121. _TCO2(data) {
  1122. var result = "";
  1123. if (data == null) {
  1124. return result;
  1125. }
  1126. if (data.TCO2 !== undefined && data.TCO2 !== null) {
  1127. var value = data.TCO2;
  1128. if (value >= 53 || value <= 8) {
  1129. result = "red";
  1130. } else if (value >= 48 || value <= 10) {
  1131. result = "orangered";
  1132. } else if (value >= 43 || value <= 13) {
  1133. result = "yellow";
  1134. } else if (value >= 38 || value <= 16) {
  1135. result = "olive";
  1136. } else if (value >= 33 || value <= 19) {
  1137. result = "green";
  1138. }
  1139. }
  1140. return result;
  1141. },
  1142. _PO2(data) {
  1143. var result = "";
  1144. if (data == null) {
  1145. return result;
  1146. }
  1147. if (data.PO2 !== undefined && data.PO2 !== null) {
  1148. var value = data.PO2;
  1149. if (value <= 40) {
  1150. result = "red";
  1151. } else if (value <= 50) {
  1152. result = "orangered";
  1153. } else if (value <= 60) {
  1154. result = "yellow";
  1155. } else if (value <= 70) {
  1156. result = "olive";
  1157. } else if (value <= 80) {
  1158. result = "green";
  1159. }
  1160. }
  1161. return result;
  1162. },
  1163. _ANGAP(data) {
  1164. var result = "";
  1165. if (data == null) {
  1166. return result;
  1167. }
  1168. if (data.ANGAP !== undefined && data.ANGAP !== null) {
  1169. var value = data.ANGAP;
  1170. if (value >= 28 || value <= 3) {
  1171. result = "red";
  1172. } else if (value >= 26 || value <= 3.5) {
  1173. result = "orangered";
  1174. } else if (value >= 24 || value <= 4) {
  1175. result = "yellow";
  1176. } else if (value >= 22 || value <= 5) {
  1177. result = "olive";
  1178. } else if (value >= 20 || value <= 6) {
  1179. result = "green";
  1180. }
  1181. }
  1182. return result;
  1183. },
  1184. _avgValue(data) {
  1185. var result = "";
  1186. if (data == null) {
  1187. return result;
  1188. }
  1189. if (data.avgValue !== undefined && data.avgValue !== null) {
  1190. var value = data.avgValue;
  1191. if (value >= 200 || value <= 25) {
  1192. result = "red";
  1193. } else if (value >= 190 || value <= 40) {
  1194. result = "yellow"
  1195. } else if (value >= 180 || value <= 55) {
  1196. result = "olive";
  1197. } else if (value >= 160 || value <= 70) {
  1198. result = "green";
  1199. }
  1200. }
  1201. return result;
  1202. },
  1203. _systValue(data) {
  1204. var result = "";
  1205. if (data == null) {
  1206. return result;
  1207. }
  1208. if (data.systValue !== undefined && data.systValue !== null) {
  1209. var value = data.systValue;
  1210. if (value >= 200 || value <= 50) {
  1211. result = "red";
  1212. } else if (value >= 180 || value <= 60) {
  1213. result = "orangered"
  1214. } else if (value >= 160 || value <= 70) {
  1215. result = "yellow";
  1216. } else if (value >= 150 || value <= 80) {
  1217. result = "olive";
  1218. } else if (value >= 140 || value <= 90) {
  1219. result = "green";
  1220. }
  1221. }
  1222. return result;
  1223. },
  1224. _icpValue(data) {
  1225. var result = "";
  1226. if (data == null) {
  1227. return result;
  1228. }
  1229. if (data.icpValue !== undefined && data.icpValue !== null) {
  1230. var value = data.icpValue;
  1231. if (value >= 35) {
  1232. result = "red";
  1233. } else if (value >= 30) {
  1234. result = "orangered";
  1235. } else if (value >= 25) {
  1236. result = "yellow";
  1237. } else if (value >= 22) {
  1238. result = "olive";
  1239. } else if (value >= 18) {
  1240. result = "green";
  1241. }
  1242. }
  1243. return result;
  1244. },
  1245. _ngzyValue(data) {
  1246. var result = "";
  1247. if (data == null) {
  1248. return result;
  1249. }
  1250. if (data.ngzyValue !== undefined && data.ngzyValue !== null) {
  1251. var value = data.ngzyValue;
  1252. if (value <= 20) {
  1253. result = "red";
  1254. } else if (value <= 25) {
  1255. result = "orangered";
  1256. } else if (value <= 30) {
  1257. result = "yellow";
  1258. } else if (value <= 40) {
  1259. result = "olive";
  1260. } else if (value <= 60) {
  1261. result = "green";
  1262. }
  1263. }
  1264. return result;
  1265. },
  1266. _heartValue(data) {
  1267. var result = "";
  1268. if (data == null) {
  1269. return result;
  1270. }
  1271. if (data.heartValue !== undefined && data.heartValue !== null) {
  1272. var value = data.heartValue;
  1273. if (value >= 180 || value <= 40) {
  1274. result = "red";
  1275. } else if (value >= 160 || value <= 45) {
  1276. result = "orangered";
  1277. } else if (value >= 150 || value <= 50) {
  1278. result = "yellow";
  1279. } else if (value >= 140 || value <= 60) {
  1280. result = "olive";
  1281. } else if (value >= 110 || value <= 70) {
  1282. result = "green";
  1283. }
  1284. }
  1285. return result;
  1286. },
  1287. _respValue(data) {
  1288. var result = "";
  1289. if (data == null) {
  1290. return result;
  1291. }
  1292. if (data.respValue !== undefined && data.respValue !== null) {
  1293. var value = data.respValue;
  1294. if (value >= 45 || value <= 2) {
  1295. result = "red";
  1296. } else if (value >= 40 || value <= 4) {
  1297. result = "orangered";
  1298. } else if (value >= 30 || value <= 6) {
  1299. result = "yellow";
  1300. } else if (value >= 25 || value <= 8) {
  1301. result = "olive";
  1302. } else if (value >= 20 || value <= 11) {
  1303. result = "green";
  1304. }
  1305. }
  1306. return result;
  1307. },
  1308. _spo2Grade(data) {
  1309. var result = "";
  1310. if (data == null) {
  1311. return result;
  1312. }
  1313. if (data.spo2Value !== undefined && data.spo2Value !== null) {
  1314. var value = data.spo2Value;
  1315. if (value <= 65) {
  1316. result = "red";
  1317. } else if (value <= 70) {
  1318. result = "orangered";
  1319. } else if (value <= 75) {
  1320. result = "yellow";
  1321. } else if (value <= 80) {
  1322. result = "olive";
  1323. } else if (value <= 85) {
  1324. result = "green";
  1325. }
  1326. }
  1327. return result;
  1328. },
  1329. _CREA(data) {
  1330. var result = "";
  1331. if (data == null) {
  1332. return result;
  1333. }
  1334. if (data.CREA !== undefined && data.CREA !== null && data.CREA !== ''){
  1335. var value = data.CREA;
  1336. if (value >= 400 || value <= 40){
  1337. result = "red";
  1338. }else if(value >= 300 || value <= 50){
  1339. result = "orangered";
  1340. }else if(value >= 250 || value <= 60){
  1341. result = "yellow";
  1342. }else if(value >= 200 || value <= 70){
  1343. result = "olive";
  1344. }else if(value >= 180 || value <= 80){
  1345. result = "green";
  1346. }
  1347. }
  1348. return result;
  1349. },
  1350. _BUN(data) {
  1351. var result = "";
  1352. if (data == null) {
  1353. return result;
  1354. }
  1355. if (data.BUN !== undefined && data.BUN !== null && data.BUN !== ''){
  1356. var value = data.BUN;
  1357. if (value >= 20 || value <= 1){
  1358. result = "red";
  1359. }else if(value >= 15 || value <= 2){
  1360. result = "orangered";
  1361. }else if(value >= 12 || value <= 2.5){
  1362. result = "yellow";
  1363. }else if(value >= 9 || value <= 2.7){
  1364. result = "olive";
  1365. }else if(value >= 8 || value <= 3){
  1366. result = "green";
  1367. }
  1368. }
  1369. return result;
  1370. },
  1371. _ICA(data) {
  1372. var result = "";
  1373. if (data == null) {
  1374. return result;
  1375. }
  1376. if (data.ICA !== undefined && data.ICA !== null && data.ICA !== ''){
  1377. var value = data.ICA;
  1378. if (value >= 1.61 || value <= 0.96){
  1379. result = "red";
  1380. }else if(value >= 1.58 || value <= 0.98){
  1381. result = "orangered";
  1382. }else if(value >= 1.5 || value <= 1){
  1383. result = "yellow";
  1384. }else if(value >= 1.45 || value <= 1.05){
  1385. result = "olive";
  1386. }else if(value >= 1.4 || value <= 1.1){
  1387. result = "green";
  1388. }
  1389. }
  1390. return result;
  1391. },
  1392. _PCO2(data) {
  1393. var result = "";
  1394. if (data == null) {
  1395. return result;
  1396. }
  1397. if (data.PCO2 !== undefined && data.PCO2 !== null && data.PCO2 !== ''){
  1398. var value = data.PCO2;
  1399. if (value >= 65 || value <= 20){
  1400. result = "red";
  1401. }else if(value >= 60 || value <= 22){
  1402. result = "orangered";
  1403. }else if(value >= 55 || value <= 26){
  1404. result = "yellow";
  1405. }else if(value >= 50 || value <= 30){
  1406. result = "olive";
  1407. }else if(value >= 47 || value <= 33){
  1408. result = "green";
  1409. }
  1410. }
  1411. return result;
  1412. },
  1413. },
  1414. created() {
  1415. $('#page-content').show();
  1416. setTimeout(function() {
  1417. location.reload()
  1418. }, 60 * 11 * 1000)
  1419. },
  1420. mounted() {
  1421. this.token = getUrlParam("token");
  1422. this.userId = getUrlParam("userId");
  1423. // this.token = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxMTYyMzEzMDM0MTc0ODEyMTYyIiwiZXhwIjoxNTk0NjMwODE0LCJpYXQiOjE1OTQwMjYwMTR9.QWo0WHf6inZKCQM3QgOysmOgloIfoSSV5ORyE2PprMpXSfn7b7JW2lQ_Pyxi3OipUgi3Wl_-4werjsVx_Ufr3A";
  1424. // this.userId = "1161282290756624386";
  1425. // this.userId = "1283971705852772353";
  1426. // this.userId = "1284048364360626177"; // 测试病人3
  1427. // this.userId = "1284050925901770753"; // 测试病人4
  1428. // this.userId = "1284115834836541442"; // 测试病人11
  1429. // this.userId = "1285135004961292289"; // 测试病人1
  1430. // this.userId = "1285477346842959873"; // 测试病人2
  1431. // this.userId = "1286153076564209666"; // 林全茂
  1432. // this.userId = "1288016557307490306"; // 李宁
  1433. // this.userId = "1284108001442324481"; // 本地测试地址
  1434. // this.userId = "1300952143651549186"; // 本地测试地址
  1435. myChart = echarts.init(document.getElementById('myChart'));
  1436. if (this.userId) {
  1437. this.getStaticData();
  1438. this.initSocket();
  1439. this.getDefaultData();
  1440. }
  1441. // this.getAutoScoreStatistics();
  1442. },
  1443. methods: {
  1444. // 保存血气数据
  1445. saveBloodGasData() {
  1446. var _this = this;
  1447. var reg = /^(-?\d+)(\.\d+)?$/;
  1448. if (this.nA.K && !reg.test(this.nA.K)) {
  1449. _this.toastFlag = true;
  1450. _this.toastText = "钾离子只能是数字";
  1451. setTimeout(function() {
  1452. _this.toastFlag = false;
  1453. _this.toastText = "";
  1454. }, 3000)
  1455. return false;
  1456. }
  1457. if (this.nA.NA && !reg.test(this.nA.NA)) {
  1458. _this.toastFlag = true;
  1459. _this.toastText = "钠离子只能是数字";
  1460. setTimeout(function() {
  1461. _this.toastFlag = false;
  1462. _this.toastText = "";
  1463. }, 3000)
  1464. return false;
  1465. }
  1466. if (this.nA.ICA && !reg.test(this.nA.ICA)) {
  1467. _this.toastFlag = true;
  1468. _this.toastText = "钙离子只能是数字";
  1469. setTimeout(function() {
  1470. _this.toastFlag = false;
  1471. _this.toastText = "";
  1472. }, 3000)
  1473. return false;
  1474. }
  1475. if (this.nA.CL && !reg.test(this.nA.CL)) {
  1476. _this.toastFlag = true;
  1477. _this.toastText = "氯离子只能是数字";
  1478. setTimeout(function() {
  1479. _this.toastFlag = false;
  1480. _this.toastText = "";
  1481. }, 3000)
  1482. return false;
  1483. }
  1484. if (this.nA.PH && !reg.test(this.nA.PH)) {
  1485. _this.toastFlag = true;
  1486. _this.toastText = "酸碱度只能是数字";
  1487. setTimeout(function() {
  1488. _this.toastFlag = false;
  1489. _this.toastText = "";
  1490. }, 3000)
  1491. return false;
  1492. }
  1493. if (this.nA.GLU && !reg.test(this.nA.GLU)) {
  1494. _this.toastFlag = true;
  1495. _this.toastText = "血糖只能是数字";
  1496. setTimeout(function() {
  1497. _this.toastFlag = false;
  1498. _this.toastText = "";
  1499. }, 3000)
  1500. return false;
  1501. }
  1502. if (this.nA.LAC && !reg.test(this.nA.LAC)) {
  1503. _this.toastFlag = true;
  1504. _this.toastText = "血乳酸只能是数字";
  1505. setTimeout(function() {
  1506. _this.toastFlag = false;
  1507. _this.toastText = "";
  1508. }, 3000)
  1509. return false;
  1510. }
  1511. if (this.nA.HB && !reg.test(this.nA.HB)) {
  1512. _this.toastFlag = true;
  1513. _this.toastText = "血红蛋白只能是数字";
  1514. setTimeout(function() {
  1515. _this.toastFlag = false;
  1516. _this.toastText = "";
  1517. }, 3000)
  1518. return false;
  1519. }
  1520. if (this.nA.HCO3 && !reg.test(this.nA.HCO3)) {
  1521. _this.toastFlag = true;
  1522. _this.toastText = "碳酸氢根只能是数字";
  1523. setTimeout(function() {
  1524. _this.toastFlag = false;
  1525. _this.toastText = "";
  1526. }, 3000)
  1527. return false;
  1528. }
  1529. if (this.nA.BE && !reg.test(this.nA.BE)) {
  1530. _this.toastFlag = true;
  1531. _this.toastText = "碱剩余只能是数字";
  1532. setTimeout(function() {
  1533. _this.toastFlag = false;
  1534. _this.toastText = "";
  1535. }, 3000)
  1536. return false;
  1537. }
  1538. if (this.nA.TCO2 && !reg.test(this.nA.TCO2)) {
  1539. _this.toastFlag = true;
  1540. _this.toastText = "总二氧化碳只能是数字";
  1541. setTimeout(function() {
  1542. _this.toastFlag = false;
  1543. _this.toastText = "";
  1544. }, 3000)
  1545. return false;
  1546. }
  1547. if (this.nA.PO2 && !reg.test(this.nA.PO2)) {
  1548. _this.toastFlag = true;
  1549. _this.toastText = "氧分压只能是数字";
  1550. setTimeout(function() {
  1551. _this.toastFlag = false;
  1552. _this.toastText = "";
  1553. }, 3000)
  1554. return false;
  1555. }
  1556. if (this.nA.PCO2 && !reg.test(this.nA.PCO2)) {
  1557. _this.toastFlag = true;
  1558. _this.toastText = "二氧化碳分压只能是数字";
  1559. setTimeout(function() {
  1560. _this.toastFlag = false;
  1561. _this.toastText = "";
  1562. }, 3000)
  1563. return false;
  1564. }
  1565. if (this.nA.BUN && !reg.test(this.nA.BUN)) {
  1566. _this.toastFlag = true;
  1567. _this.toastText = "尿素氮分压只能是数字";
  1568. setTimeout(function() {
  1569. _this.toastFlag = false;
  1570. _this.toastText = "";
  1571. }, 3000)
  1572. return false;
  1573. }
  1574. if (this.nA.CREA && !reg.test(this.nA.CREA)) {
  1575. _this.toastFlag = true;
  1576. _this.toastText = "血清肌酐只能是数字";
  1577. setTimeout(function() {
  1578. _this.toastFlag = false;
  1579. _this.toastText = "";
  1580. }, 3000)
  1581. return false;
  1582. }
  1583. $.ajax({
  1584. type: "POST",
  1585. url: baseUrl + "gunsApi/addStat",
  1586. data: {
  1587. userId: _this.userId,
  1588. K: this.nA.K,
  1589. NA: this.nA.NA,
  1590. LAC: this.nA.LAC,
  1591. CL: this.nA.CL,
  1592. PH: this.nA.PH,
  1593. GLU: this.nA.GLU,
  1594. ICA: this.nA.ICA,
  1595. HB: this.nA.HB,
  1596. HCO3: this.nA.HCO3,
  1597. BE: this.nA.BE,
  1598. TCO2: this.nA.TCO2,
  1599. PO2: this.nA.PO2,
  1600. PCO2: this.nA.PCO2,
  1601. BUN: this.nA.BUN,
  1602. CREA: this.nA.CREA,
  1603. },
  1604. headers: {
  1605. "Authorization": this.token
  1606. },
  1607. success: function(resp) {
  1608. console.log(resp)
  1609. var {
  1610. code,
  1611. data,
  1612. message
  1613. } = resp;
  1614. // if (code === 0) {
  1615. // _this.autoScoreStatistics = data;
  1616. // }
  1617. _this.toastFlag = true;
  1618. _this.toastText = message;
  1619. setTimeout(function() {
  1620. _this.toastFlag = false;
  1621. _this.toastText = "";
  1622. }, 3000)
  1623. }
  1624. });
  1625. },
  1626. // 保存静态数据
  1627. saveStaticData() {
  1628. var _this = this;
  1629. // var reg = /^[0-9]*$/;
  1630. var reg = /^(-?\d+)(\.\d+)?$/;
  1631. if (this.staticIndex.indexNzx && !reg.test(this.staticIndex.indexNzx)) {
  1632. _this.toastFlag = true;
  1633. _this.toastText = "脑中线偏移距离只能是数字";
  1634. setTimeout(function() {
  1635. _this.toastFlag = false;
  1636. _this.toastText = "";
  1637. }, 3000)
  1638. return false;
  1639. }
  1640. if (this.staticIndex.indexNzx && !reg.test(this.staticIndex.indexNzx)) {
  1641. _this.toastFlag = true;
  1642. _this.toastText = "脑中线偏移距离只能是数字";
  1643. setTimeout(function() {
  1644. _this.toastFlag = false;
  1645. _this.toastText = "";
  1646. }, 3000)
  1647. return false;
  1648. }
  1649. if (this.staticIndex.indexNzx && !reg.test(this.staticIndex.indexNzx)) {
  1650. _this.toastFlag = true;
  1651. _this.toastText = "脑中线偏移距离只能是数字";
  1652. setTimeout(function() {
  1653. _this.toastFlag = false;
  1654. _this.toastText = "";
  1655. }, 3000)
  1656. return false;
  1657. }
  1658. $.ajax({
  1659. type: "POST",
  1660. url: baseUrl + "gunsApi/addIndex",
  1661. data: {
  1662. hisId: _this.userId,
  1663. indexMovement: _this.staticIndex.indexMovement,
  1664. tongReflect: _this.staticIndex.tongReflect,
  1665. tongChange: _this.staticIndex.tongChange,
  1666. indexXz: _this.staticIndex.indexXz,
  1667. indexZwm: _this.staticIndex.indexZwm,
  1668. indexXt: _this.staticIndex.indexXt,
  1669. indexNzx: _this.staticIndex.indexNzx,
  1670. indexHckd: _this.staticIndex.indexHckd,
  1671. age: _this.staticIndex.age,
  1672. surgery: _this.staticIndex.surgery,
  1673. medicalHistory: _this.staticIndex.medicalHistory,
  1674. },
  1675. headers: {
  1676. "Authorization": this.token
  1677. },
  1678. success: function(resp) {
  1679. console.log(resp)
  1680. var {
  1681. code,
  1682. data,
  1683. message
  1684. } = resp;
  1685. // if (code === 0) {
  1686. // _this.autoScoreStatistics = data;
  1687. // }
  1688. _this.toastFlag = true;
  1689. _this.toastText = message;
  1690. setTimeout(function() {
  1691. _this.toastFlag = false;
  1692. _this.toastText = "";
  1693. }, 3000)
  1694. }
  1695. });
  1696. },
  1697. // 获取静态数据
  1698. getAutoScoreStatistics() {
  1699. var _this = this;
  1700. $.ajax({
  1701. type: "GET",
  1702. url: baseUrl + "gunsApi/getRatio",
  1703. data: {
  1704. id: this.userId
  1705. },
  1706. headers: {
  1707. "Authorization": this.token
  1708. },
  1709. success: function(resp) {
  1710. console.log(resp)
  1711. var {
  1712. code,
  1713. data
  1714. } = resp;
  1715. if (code === 0) {
  1716. _this.autoScoreStatistics = data;
  1717. }
  1718. }
  1719. });
  1720. },
  1721. // 即时评分
  1722. openImmediateScore(title) {
  1723. this.immediateScoreDialog = true;
  1724. this.immediateScoreTile = title;
  1725. this.$nextTick(function() {
  1726. var immediateScore = echarts.init(document.getElementById("immediate_score"));
  1727. var keys = [],
  1728. values = [];
  1729. // console.log(this.scoreStatistics.keys())
  1730. if (this.immediateScoreStatistics && this.immediateScoreStatistics.length <= 0) {
  1731. return false;
  1732. }
  1733. for (var i = 1; i < 7; i++) {
  1734. for (var key in this.immediateScoreStatistics[i]) {
  1735. keys.push(key);
  1736. if (this.jiangeScore) {
  1737. values.push(((this.immediateScoreStatistics[i][key] / this.jiangeScore) * 100).toFixed(2));
  1738. } else {
  1739. values.push(this.immediateScoreStatistics[i][key]);
  1740. }
  1741. }
  1742. }
  1743. option = {
  1744. color: ['#3398DB'],
  1745. tooltip: {
  1746. trigger: 'axis',
  1747. formatter: '{b}: <br/> {c}%',
  1748. axisPointer: {
  1749. type: 'shadow'
  1750. }
  1751. },
  1752. grid: {
  1753. left: '3%',
  1754. right: '4%',
  1755. bottom: '3%',
  1756. containLabel: true
  1757. },
  1758. xAxis: [{
  1759. type: 'category',
  1760. data: keys,
  1761. axisLabel: {
  1762. show: true,
  1763. rotate: 60
  1764. },
  1765. }],
  1766. yAxis: [{
  1767. type: 'value'
  1768. }],
  1769. series: [{
  1770. type: 'bar',
  1771. label: {
  1772. show: true,
  1773. formatter: '{c}%',
  1774. },
  1775. data: values,
  1776. }]
  1777. };
  1778. immediateScore.setOption(option);
  1779. })
  1780. },
  1781. // 自动评分(人工和自动一样)
  1782. openAutoScore(title) {
  1783. this.autoScoreDialog = true;
  1784. this.autoScoreTile = title;
  1785. this.$nextTick(function() {
  1786. var autuScore = echarts.init(document.getElementById("auto_score"));
  1787. var keys = [],
  1788. values = [];
  1789. // console.log(this.scoreStatistics.keys())
  1790. if (this.autoScoreStatistics && this.autoScoreStatistics.length <= 0) {
  1791. return false;
  1792. }
  1793. for (var i = 1; i < 7; i++) {
  1794. for (var key in this.autoScoreStatistics[i]) {
  1795. keys.push(key);
  1796. if (this.dingsdianScore) {
  1797. values.push(((this.autoScoreStatistics[i][key] / this.dingsdianScore) * 100).toFixed(2));
  1798. } else {
  1799. values.push(this.autoScoreStatistics[i][key]);
  1800. }
  1801. }
  1802. }
  1803. option = {
  1804. color: ['#3398DB'],
  1805. tooltip: {
  1806. trigger: 'axis',
  1807. formatter: '{b}: <br/> {c}%',
  1808. axisPointer: {
  1809. type: 'shadow'
  1810. }
  1811. },
  1812. grid: {
  1813. left: '3%',
  1814. right: '4%',
  1815. bottom: '3%',
  1816. containLabel: true
  1817. },
  1818. xAxis: [{
  1819. type: 'category',
  1820. data: keys,
  1821. axisLabel: {
  1822. show: true,
  1823. rotate: 60
  1824. },
  1825. }],
  1826. yAxis: [{
  1827. type: 'value'
  1828. }],
  1829. series: [{
  1830. type: 'bar',
  1831. // barWidth: '60%',
  1832. label: {
  1833. show: true,
  1834. formatter: '{c}%',
  1835. },
  1836. data: values
  1837. }]
  1838. };
  1839. autuScore.setOption(option);
  1840. })
  1841. },
  1842. initSocket() {
  1843. let _this = this;
  1844. websocket = null;
  1845. heartCheck = {
  1846. timeout: 1000,
  1847. timeoutObj: null,
  1848. timing: 0, // 计时
  1849. maxTiming: 5,
  1850. count: 0,
  1851. reset: function() {
  1852. clearInterval(heartCheck.timeoutObj);
  1853. heartCheck.start();
  1854. heartCheck.timing = 0;
  1855. },
  1856. start: function() {
  1857. heartCheck.timeoutObj = setInterval(function() {
  1858. websocket.send('hbreqmsg');
  1859. heartCheck.timing++;
  1860. if (heartCheck.timing > heartCheck.maxTiming) {
  1861. heartCheck.count++;
  1862. if(heartCheck.count < 5){
  1863. heartCheck.error();
  1864. }else{
  1865. _this.toastFlag = true;
  1866. _this.toastText = "网络错误,请退出重新登录";
  1867. setTimeout(function() {
  1868. _this.toastFlag = false;
  1869. _this.toastText = "";
  1870. }, 5000)
  1871. clearInterval(heartCheck.timeoutObj);
  1872. return false;
  1873. }
  1874. }
  1875. // console.log("心跳发送:hbreqmsg")
  1876. // console.log("无响应时间:",heartCheck.timing)
  1877. }, this.timeout);
  1878. },
  1879. error: function() {
  1880. websocket.close();
  1881. heartCheck.reset();
  1882. clearInterval(heartCheck.timeoutObj);
  1883. _this.loadWS();
  1884. // websocket = new WebSocket("ws://192.168.3.171:9002?userId=ZDYY" + _this.userId);
  1885. console.log("服务器无应答进行重新连接")
  1886. }
  1887. };
  1888. this.loadWS();
  1889. option = {
  1890. title: {
  1891. text: '心电图数据',
  1892. textStyle: {
  1893. color: "#fff",
  1894. },
  1895. left: '38%'
  1896. },
  1897. tooltip: {
  1898. trigger: 'axis',
  1899. formatter: function(params) {
  1900. params = params[0];
  1901. var date = new Date(params.name);
  1902. return date.getDate() + '/' + (date.getMonth() + 1) + '/' + date.getFullYear() + ' : ' + params.value[1];
  1903. },
  1904. axisPointer: {
  1905. animation: false
  1906. }
  1907. },
  1908. xAxis: {
  1909. type: 'time',
  1910. splitLine: {
  1911. show: false,
  1912. },
  1913. axisLine: {
  1914. lineStyle: {
  1915. color: "#FFF"
  1916. }
  1917. },
  1918. axisLabel: {
  1919. show: false,
  1920. lineStyle: {
  1921. color: "#FFF"
  1922. }
  1923. },
  1924. },
  1925. yAxis: {
  1926. type: 'value',
  1927. boundaryGap: [0, '100%'],
  1928. splitLine: {
  1929. show: false
  1930. },
  1931. // max: 12000,
  1932. // max: 7000,
  1933. axisLine: {
  1934. lineStyle: {
  1935. color: "#FFF"
  1936. }
  1937. },
  1938. axisLabel: {
  1939. lineStyle: {
  1940. color: "#FFF"
  1941. }
  1942. }
  1943. },
  1944. series: [{
  1945. name: '模拟数据',
  1946. type: 'line',
  1947. showSymbol: false,
  1948. hoverAnimation: false,
  1949. data: data
  1950. }]
  1951. };
  1952. var timedS = 1000;
  1953. var time = setTimeout(opa, timedS);
  1954. function opa() {
  1955. if (staticData.length > 0) {
  1956. for (var i = 0; i < staticData.length; i++) {
  1957. data.shift();
  1958. data.push(randomData(staticData[i]));
  1959. staticData.shift()
  1960. // for(var j=0;j<1;j++){
  1961. // staticData.shift()
  1962. // }
  1963. }
  1964. }
  1965. // console.log(staticData)
  1966. // myChart.dispose()
  1967. // myChart = echarts.init(document.getElementById('myChart'))
  1968. // myChart.setOption({
  1969. // // series: [{
  1970. // // data: data
  1971. // // }]
  1972. // title: {
  1973. // text: '心电图数据',
  1974. // textStyle: {
  1975. // color: "#fff",
  1976. // },
  1977. // left: '38%'
  1978. // },
  1979. // tooltip: {
  1980. // trigger: 'axis',
  1981. // formatter: function (params) {
  1982. // params = params[0];
  1983. // var date = new Date(params.name);
  1984. // return date.getDate() + '/' + (date.getMonth() + 1) + '/' + date.getFullYear() + ' : ' + params.value[1];
  1985. // },
  1986. // axisPointer: {
  1987. // animation: false
  1988. // }
  1989. // },
  1990. // xAxis: {
  1991. // type: 'time',
  1992. // splitLine: {
  1993. // show: false,
  1994. // },
  1995. // axisLine: {
  1996. // lineStyle: {
  1997. // color: "#FFF"
  1998. // }
  1999. // },
  2000. // axisLabel: {
  2001. // show: false,
  2002. // lineStyle: {
  2003. // color: "#FFF"
  2004. // }
  2005. // }
  2006. // },
  2007. // yAxis: {
  2008. // type: 'value',
  2009. // boundaryGap: [0, '100%'],
  2010. // splitLine: {
  2011. // show: false
  2012. // },
  2013. // // max: 2000,
  2014. // axisLine: {
  2015. // lineStyle: {
  2016. // color: "#FFF"
  2017. // }
  2018. // },
  2019. // axisLabel: {
  2020. // lineStyle: {
  2021. // color: "#FFF"
  2022. // }
  2023. // }
  2024. // },
  2025. // series: [{
  2026. // name: '模拟数据',
  2027. // type: 'line',
  2028. // showSymbol: false,
  2029. // hoverAnimation: false,
  2030. // data: data
  2031. // }]
  2032. // }, true, true);
  2033. myChart.setOption({
  2034. series: [{
  2035. data: data
  2036. }]
  2037. });
  2038. clearTimeout(time); //清除上一次的定时器,否则会无限开多个
  2039. setTimeout(opa, timedS); //方法中调用定时器实现循环
  2040. }
  2041. // 使用刚指定的配置项和数据显示图表。
  2042. myChart.setOption(option);
  2043. },
  2044. loadWS() {
  2045. var _this = this;
  2046. //判断当前浏览器是否支持WebSocket
  2047. if ('WebSocket' in window) {
  2048. websocket = new WebSocket(wsUrl + _this.userId + "_" + generateMixed(7));
  2049. // websocket = new WebSocket("ws://192.168.3.171:9002?userId=ZDYY" + _this.userId);
  2050. //websocket = new WebSocket("ws://127.0.0.1:9002?userId=" + result.id);
  2051. //websocket = new WebSocket("wss://zcpg.xazhcx.com/getStaticDatawss/?userId="+result.id);
  2052. //websocket默认是传输字符串的,需要改为arraybuffer二进制传输类型
  2053. //webOrTcpsocket.binaryType = "arraybuffer";
  2054. } else {
  2055. alert('当前浏览器 Not support websocket')
  2056. }
  2057. //连接发生错误的回调方法
  2058. websocket.onerror = function() {
  2059. setMessageInnerHTML("WebSocket连接发生错误");
  2060. websocket.close();
  2061. _this.toastFlag = true;
  2062. _this.toastText = "网络错误,请退出重新登录";
  2063. setTimeout(function() {
  2064. _this.toastFlag = false;
  2065. _this.toastText = "";
  2066. }, 5000)
  2067. // websocket = new WebSocket(wsUrl + _this.userId + "_" + generateMixed(7));
  2068. };
  2069. //连接成功建立的回调方法
  2070. websocket.onopen = function() {
  2071. setMessageInnerHTML("连接成功");
  2072. heartCheck.start();
  2073. };
  2074. _this.staticData = [];
  2075. //接收到消息的回调方法
  2076. websocket.onmessage = function(event) {
  2077. // console.log(event.data)
  2078. if (event.data === 'hbreqmsg') {
  2079. heartCheck.reset();
  2080. return false;
  2081. }
  2082. // console.log(event)
  2083. if (event && event.data !== '连接成功') {
  2084. // if (event.data.indexOf("_d") !== -1) {
  2085. // var df = event.data.substring(0, event.data.indexOf("_"));
  2086. // // $('#df').html(df);
  2087. // //$('#jf').html(df);
  2088. // console.log(df)
  2089. // } else if (event.data.indexOf("=") !== -1) {
  2090. // var df = event.data.substring(0, event.data.indexOf("="));
  2091. // console.log(df)
  2092. //
  2093. // } else if (event.data.indexOf("_z") !== -1) {
  2094. // var data = event.data;
  2095. // console.log(data)
  2096. // }
  2097. if (event.data.indexOf("_s") !== -1) { // 手动
  2098. _this.jifaScore = event.data.split("_")[0];
  2099. } else if (event.data.indexOf("_d") !== -1) { // 自动
  2100. _this.dingsdianScore = event.data.split("_")[0];
  2101. // _this.getAutoScoreStatistics();
  2102. } else if (event.data.indexOf("_m") !== -1) { // 自动
  2103. var tempStr = event.data.split("_")[0];
  2104. var data = JSON.parse(tempStr);
  2105. _this.autoScoreStatistics = data;
  2106. } else if (event.data.indexOf("_j") !== -1) { // 即时
  2107. _this.jiangeScore = event.data.split("_")[0];
  2108. } else if (event.data.indexOf("_z") !== -1) { // 即时柱状图数据
  2109. var tempStr = event.data.split("_")[0];
  2110. var data = JSON.parse(tempStr);
  2111. _this.immediateScoreStatistics = data;
  2112. // console.log(_this.immediateScoreStatistics)
  2113. } else if (event.data.indexOf("_x") !== -1) { // 血糖
  2114. var tempStr = event.data.split("_")[0];
  2115. var data = JSON.parse(tempStr);
  2116. _this.nA = data;
  2117. } else {
  2118. var data = JSON.parse(event.data);
  2119. // console.log(data)
  2120. //console.log(data.spo2Value);
  2121. // 血糖
  2122. // if (data.NA !== null && data.NA !== undefined) {
  2123. // _this.nA = data;
  2124. // }
  2125. if (data.tempValue) { // 体温
  2126. _this.tempValue = data;
  2127. // console.log(_this.tempValue)
  2128. }
  2129. if (data.icpValue) { // 颅内压
  2130. if (!_this.systValue) {
  2131. _this.systValue = {};
  2132. }
  2133. _this.systValue.icpValue = data.icpValue;
  2134. // console.log(_this.systValue)
  2135. }
  2136. if (data.ecg !== null || data.press !== null || data.spo2 !== null || data.stat !== null || data.gradeValue !==
  2137. null) {
  2138. // console.log(data);
  2139. if (data.stat) { // 血糖
  2140. _this.nA = data.stat;
  2141. }
  2142. if (data.spo2) { // 指脉氧饱和度指标
  2143. _this.spo2Value = data.spo2;
  2144. }
  2145. if (data.press) {
  2146. var press = data.press;
  2147. var dias = press.diasValue;
  2148. var syst = press.systValue;
  2149. var icp = press.icpValue;
  2150. // var avgValue = Math.round((dias - syst) / 3 + dias);
  2151. // var ngzyValue = avgValue - icp;
  2152. press.avgValue = press.mapValue;
  2153. press.ngzyValue = press.ngzValue;
  2154. _this.systValue = press;
  2155. }
  2156. if (data.ecg) { // 心电指标
  2157. _this.heartValue = data.ecg;
  2158. }
  2159. if (data.gradeValue) { // 评分
  2160. _this.jifaScore = data.gradeValue;
  2161. _this.dingsdianScore = data.gradeValue;
  2162. // _this.getAutoScoreStatistics();
  2163. }
  2164. }
  2165. if (data.systValue !== null && data.systValue !== undefined) {
  2166. // var dias = data.diasValue;
  2167. // var syst = data.systValue;
  2168. // var icp = data.icpValue;
  2169. // var avgValue = Math.round((dias - syst) / 3 + dias);
  2170. // var ngzyValue = avgValue - icp;
  2171. data.avgValue = data.mapValue;
  2172. data.ngzyValue = data.ngzValue;
  2173. _this.systValue = data;
  2174. }
  2175. // if(!_this.systValue){
  2176. // _this.systValue = {};
  2177. // }
  2178. //
  2179. if (data.icpValue) { // 颅内压
  2180. _this.systValue.icpValue = data.icpValue;
  2181. }
  2182. if (data.mapValue) { // 平均动脉压
  2183. _this.systValue.avgValue = data.mapValue;
  2184. }
  2185. if (data.ngzValue) { // 脑灌注压
  2186. _this.systValue.ngzyValue = data.ngzValue;
  2187. }
  2188. if (data.diasValue) { // 舒张压
  2189. _this.systValue.diasValue = data.diasValue;
  2190. }
  2191. if (data.systValue) { // 收缩压
  2192. _this.systValue.systValue = data.systValue;
  2193. }
  2194. // 静态指标
  2195. if (data.tongReflect !== null && data.tongReflect !== undefined) {
  2196. _this.staticIndex = data;
  2197. }
  2198. // 心电指标
  2199. if (data.heartValue !== null && data.heartValue !== undefined) {
  2200. _this.heartValue = data;
  2201. }
  2202. // 指脉氧饱和度指标
  2203. if (data.spo2Value !== null && data.spo2Value !== undefined) {
  2204. _this.spo2Value = data;
  2205. }
  2206. // 心电图形数据
  2207. // if (data.potlI !== null && data.potlI !== undefined) {
  2208. // var potlIs = data.potlI.split('^');
  2209. // for (var i = 0; i < potlIs.length; i++) {
  2210. // staticData.push(~potlIs[i]);
  2211. // }
  2212. // var potlIis = data.potlIi.split('^');
  2213. // for (var i = 0; i < potlIis.length; i++) {
  2214. // staticData.push(~potlIis[i]);
  2215. // }
  2216. // var potlIiis = data.potlIii.split('^');
  2217. // for (var i = 0; i < potlIiis.length; i++) {
  2218. // staticData.push(~potlIiis[i]);
  2219. // }
  2220. // var potlAvrs = data.potlAvr.split('^');
  2221. // for (var i = 0; i < potlAvrs.length; i++) {
  2222. // staticData.push(~potlAvrs[i]);
  2223. // }
  2224. // var potlAvls = data.potlAvl.split('^');
  2225. // for (var i = 0; i < potlAvls.length; i++) {
  2226. // staticData.push(~potlAvls[i]);
  2227. // }
  2228. // var potlAvfs = data.potlAvf.split('^');
  2229. // for (var i = 0; i < potlAvfs.length; i++) {
  2230. // staticData.push(~potlAvfs[i]);
  2231. // }
  2232. // var potlVs = data.potlV.split('^');
  2233. // for (var i = 0; i < potlVs.length; i++) {
  2234. // staticData.push(~potlVs[i]);
  2235. // }
  2236. // }
  2237. if (data.potlI !== null && data.potlI !== undefined) {
  2238. var potlIs = data.potlI.split('^');
  2239. for (var i = 0; i < potlIs.length; i++) {
  2240. staticData.push(potlIs[i]);
  2241. }
  2242. }
  2243. if (data.potlIi !== null && data.potlIi !== undefined) {
  2244. var potlIis = data.potlIi.split('^');
  2245. for (var i = 0; i < potlIis.length; i++) {
  2246. staticData.push(potlIis[i]);
  2247. }
  2248. }
  2249. if (data.potlIii !== null && data.potlIii !== undefined) {
  2250. var potlIiis = data.potlIii.split('^');
  2251. for (var i = 0; i < potlIiis.length; i++) {
  2252. staticData.push(potlIiis[i]);
  2253. }
  2254. }
  2255. if (data.potlAvr !== null && data.potlAvr !== undefined) {
  2256. var potlAvrs = data.potlAvr.split('^');
  2257. for (var i = 0; i < potlAvrs.length; i++) {
  2258. staticData.push(potlAvrs[i]);
  2259. }
  2260. }
  2261. if (data.potlAvl !== null && data.potlAvl !== undefined) {
  2262. var potlAvls = data.potlAvl.split('^');
  2263. for (var i = 0; i < potlAvls.length; i++) {
  2264. staticData.push(potlAvls[i]);
  2265. }
  2266. }
  2267. if (data.potlAvf !== null && data.potlAvf !== undefined) {
  2268. var potlAvfs = data.potlAvf.split('^');
  2269. for (var i = 0; i < potlAvfs.length; i++) {
  2270. staticData.push(potlAvfs[i]);
  2271. }
  2272. }
  2273. if (data.potlV !== null && data.potlV !== undefined) {
  2274. var potlVs = data.potlV.split('^');
  2275. for (var i = 0; i < potlVs.length; i++) {
  2276. staticData.push(potlVs[i]);
  2277. }
  2278. }
  2279. }
  2280. }
  2281. };
  2282. //连接关闭的回调方法
  2283. websocket.onclose = function() {
  2284. websocket.close();
  2285. heartCheck.reset();
  2286. clearInterval(heartCheck.timeoutObj);
  2287. if(heartCheck.count < 5) {
  2288. _this.loadWS();
  2289. }
  2290. setMessageInnerHTML("WebSocket连接关闭");
  2291. };
  2292. //监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
  2293. window.onbeforeunload = function() {
  2294. websocket.close();
  2295. };
  2296. },
  2297. // 获取默认数据
  2298. getDefaultData() {
  2299. var _this = this;
  2300. $.ajax({
  2301. type: "POST",
  2302. url: baseUrl + "gunsApi/getDataOne",
  2303. data: {
  2304. userId: this.userId
  2305. },
  2306. headers: {
  2307. "Authorization": this.token
  2308. },
  2309. success: function(resp) {
  2310. console.log(resp)
  2311. var {code,data} = resp;
  2312. if (code === 200) {
  2313. // // console.log(resp.data)
  2314. // // _this.staticIndex = resp.data;
  2315. if (data.ecg !== null || data.press !== null || data.spo2 !== null || data.stat !== null || data.gradeValue !==
  2316. null) {
  2317. // console.log(data);
  2318. if (data.stat) { // 血糖
  2319. _this.nA = data.stat;
  2320. }
  2321. if (data.spo2) { // 指脉氧饱和度指标
  2322. _this.spo2Value = data.spo2;
  2323. }
  2324. if (data.press) {
  2325. var press = data.press;
  2326. var dias = press.diasValue;
  2327. var syst = press.systValue;
  2328. var icp = press.icpValue;
  2329. // var avgValue = Math.round((dias - syst) / 3 + dias);
  2330. // var ngzyValue = avgValue - icp;
  2331. press.avgValue = press.mapValue;
  2332. press.ngzyValue = press.ngzValue;
  2333. _this.systValue = press;
  2334. }
  2335. if (data.ecg) { // 心电指标
  2336. _this.heartValue = data.ecg;
  2337. }
  2338. if (data.gradeValue) { // 评分
  2339. _this.jifaScore = data.gradeValue;
  2340. _this.dingsdianScore = data.gradeValue;
  2341. // _this.getAutoScoreStatistics();
  2342. }
  2343. }
  2344. }
  2345. }
  2346. });
  2347. },
  2348. // 获取静态数据
  2349. getStaticData() {
  2350. var _this = this;
  2351. $.ajax({
  2352. type: "GET",
  2353. url: baseUrl + "gunsApi/getStaticData",
  2354. data: {
  2355. id: this.userId
  2356. },
  2357. headers: {
  2358. "Authorization": this.token
  2359. },
  2360. success: function(resp) {
  2361. if (resp.data != '' && resp.data != null) {
  2362. // console.log(resp.data)
  2363. _this.staticIndex = resp.data;
  2364. }
  2365. }
  2366. });
  2367. },
  2368. showAbnormalInfo(code,type){
  2369. if(!type) return
  2370. var content=abnormalInfo[code].content;
  2371. var title=abnormalInfo[code].typeName;
  2372. layui.use('layer', function(){
  2373. var layer = layui.layer;
  2374. layer.open({
  2375. title,
  2376. type: 1,
  2377. skin: 'layui-layer-rim', //加上边框
  2378. area:["90%",'90%'],
  2379. offset: '20px',
  2380. // anim: 4 ,
  2381. content
  2382. });
  2383. });
  2384. }
  2385. }
  2386. });
  2387. </script>
  2388. </html>
  2389. <style>
  2390. .layui-layer-content{
  2391. padding:0 20px;
  2392. box-sizing: border-box;
  2393. color: #333;
  2394. font-family: 'Calibri','宋体';
  2395. }
  2396. .layui-layer-content h3,.layui-layer-content b{
  2397. font-weight: 600;
  2398. padding: 10px 0;
  2399. font-size: 16px;
  2400. }
  2401. .layui-layer-title h3{
  2402. font-weight: 600;
  2403. font-size: 16px;
  2404. max-width: 120%;
  2405. overflow: hidden;
  2406. text-overflow: ellipsis;
  2407. display: inline-block;
  2408. }
  2409. .layui-layer-content p{
  2410. padding-left: 35px;
  2411. line-height: 1.8;
  2412. font-size: 12px;
  2413. position: relative;
  2414. text-align: justify;
  2415. }
  2416. .layui-layer-content p::after{
  2417. width: 6px;
  2418. height: 6px;
  2419. border-radius: 50%;
  2420. background-color: #000;
  2421. display: block;
  2422. content: '';
  2423. position: absolute;
  2424. left: 20px;
  2425. top: 7px;
  2426. }
  2427. </style>