index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <template>
  2. <view class="ecg-wrap">
  3. <view class="static-indicators form">
  4. <view class="form-item head">
  5. <text>人工SBIF累计评分</text>
  6. </view>
  7. <view class="form-item">112</view>
  8. <view class="form-item head">
  9. <text>SBIF即时评分</text>
  10. </view>
  11. <view class="form-item">100</view>
  12. <view class="form-item head">
  13. <text>自动SBIF累计评分</text>
  14. </view>
  15. <view class="form-item">210</view>
  16. <view class="form-item head">
  17. <text>静态指标</text>
  18. <button class="submit-BT" size="mini" @click="formSubmit('staticIndicatorsForm')">保存数据</button>
  19. </view>
  20. <view class="form-item">
  21. <view class="item-left">运动</view>
  22. <picker class="item-right" @change="movementChange"
  23. :value="movementIndex" :range="movementList">
  24. <view class="uni-input">{{movementList[movementIndex]}}</view>
  25. </picker>
  26. </view>
  27. <view class="form-item">
  28. <view class="item-left">瞳孔对光反射</view>
  29. <picker class="item-right" @change="tongReflectChange" :value="tongReflectIndex" :range="tongReflectList">
  30. <view class="uni-input">{{tongReflectList[tongReflectIndex]}}</view>
  31. </picker>
  32. </view>
  33. <view class="form-item">
  34. <view class="item-left">瞳孔变化</view>
  35. <picker class="item-right"
  36. @change="tongChange"
  37. :value="tongIndex" :range="tongList">
  38. <view class="uni-input">{{tongList[tongIndex]}}</view>
  39. </picker>
  40. </view>
  41. <view class="form-item">
  42. <view class="item-left">血肿体积(ml)</view>
  43. <input class="item-right inp" type="text" v-model="staticIndicatorsForm.indexXz" />
  44. </view>
  45. <view class="form-item">
  46. <view class="item-left">蛛网膜下腔出血</view>
  47. <picker class="item-right" @change="zwmChange" :value="zwmIndex" :range="zwmList">
  48. <view class="uni-input">{{zwmList[zwmIndex]}}</view>
  49. </picker>
  50. </view>
  51. <view class="form-item">
  52. <view class="item-left">脑中线偏移距离(cm)</view>
  53. <input class="item-right inp" type="text" v-model="staticIndicatorsForm.indexNzx" />
  54. </view>
  55. <view class="form-item">
  56. <view class="item-left">环池平均宽度(mm)</view>
  57. <input class="item-right inp" type="text" v-model="staticIndicatorsForm.indexHckd" />
  58. </view>
  59. <view class="form-item">
  60. <view class="item-left">年龄</view>
  61. <input class="item-right inp" type="text" v-model="staticIndicatorsForm.age" />
  62. </view>
  63. <view class="form-item">
  64. <view class="item-left">是否手术:</view>
  65. <view class="item-right">
  66. <radio-group @change="operationStatusChange">
  67. <label class="radio">
  68. <radio style="transform: scale(0.7);" value="1" />
  69. <text>否</text>
  70. </label
  71. <label class="radio">
  72. <radio style="transform: scale(0.7);" value="2" />
  73. <text>是</text>
  74. </label>
  75. </radio-group>
  76. </view>
  77. </view>
  78. <view class="form-item">
  79. <view class="item-left">既往慢性病史</view>
  80. <picker class="item-right" @change="medicalHistoryChange" :value="medicalHistoryIndex" :range="medicalHistoryList">
  81. <view class="uni-input">{{medicalHistoryList[medicalHistoryIndex]}}</view>
  82. </picker>
  83. </view>
  84. </view>
  85. <view class="chart-wrap">
  86. <view class="chart-item">
  87. <view class="head">
  88. <text>心电图:{{form.ecg}}</text>
  89. </view>
  90. <view class="chart-box">
  91. <qiun-data-charts type="line" :animation="false"
  92. :chartData="chartEcgData"
  93. :opts="ecgOpts"
  94. />
  95. </view>
  96. </view>
  97. <view class="chart-item">
  98. <view class="head">
  99. <text>收缩压:{{form.sbp}}</text>
  100. </view>
  101. <view class="chart-box">
  102. <qiun-data-charts type="line" :animation="false"
  103. :chartData="chartSbpData"
  104. :opts="decimalsOpts"
  105. />
  106. </view>
  107. </view>
  108. <view class="chart-item">
  109. <view class="head">
  110. <text>舒张压:{{form.dbp}}</text>
  111. </view>
  112. <view class="chart-box">
  113. <qiun-data-charts type="line" :animation="false":chartData="chartDbpData" :opts="decimalsOpts"/>
  114. </view>
  115. </view>
  116. <view class="chart-item">
  117. <view class="head">
  118. <text>平均动脉压:{{form.abp}}</text>
  119. </view>
  120. <view class="chart-box">
  121. <qiun-data-charts type="line" :animation="false":chartData="chartAbpData" :opts="opts"/>
  122. </view>
  123. </view>
  124. <view class="chart-item">
  125. <view class="head">
  126. <text>颅内压(mmHg):{{form.icp}}</text>
  127. </view>
  128. <view class="chart-box">
  129. <qiun-data-charts type="line" :animation="false":chartData="chartAbpData" :opts="opts"/>
  130. </view>
  131. </view>
  132. <view class="chart-item">
  133. <view class="head">
  134. <text>脑灌注压(mmHg):{{form.cpp}}</text>
  135. </view>
  136. <view class="chart-box">
  137. <qiun-data-charts type="line" :animation="false":chartData="chartCppData" :opts="opts"/>
  138. </view>
  139. </view>
  140. <view class="chart-item">
  141. <view class="head">
  142. <text>血氧饱和度:{{form.oxygenSaturation}}%</text>
  143. </view>
  144. <view class="chart-box">
  145. <qiun-data-charts type="line" :animation="false":chartData="chartOxygenSaturationData" :opts="opts"/>
  146. </view>
  147. </view>
  148. <view class="chart-item">
  149. <view class="head">
  150. <text>血流灌注指数:{{form.pi}}</text>
  151. </view>
  152. <view class="chart-box">
  153. <qiun-data-charts type="line" :animation="false":chartData="chartPiData" :opts="piOpts"/>
  154. </view>
  155. </view>
  156. <view class="chart-item">
  157. <view class="head">
  158. <text>心跳:{{form.heartbeat}}</text>
  159. </view>
  160. <view class="chart-box">
  161. <qiun-data-charts type="line" :animation="false":chartData="chartHeartbeatData" :opts="opts"/>
  162. </view>
  163. </view>
  164. <view class="chart-item">
  165. <view class="head">
  166. <text>呼吸率:{{form.awrr}} ( 次/分钟 )</text>
  167. </view>
  168. <view class="chart-box">
  169. <qiun-data-charts type="line" :animation="false":chartData="chartAwRRData" :opts="opts"/>
  170. </view>
  171. </view>
  172. <view class="chart-item">
  173. <view class="head">
  174. <text>体温:{{form.temperature}}℃</text>
  175. </view>
  176. <view class="chart-box">
  177. <qiun-data-charts type="line" :animation="false":chartData="chartTemperatureData" :opts="temperatureOpts"/>
  178. </view>
  179. </view>
  180. </view>
  181. <view class="form">
  182. <view class="form-item head">
  183. <text>血气数据</text>
  184. <button class="submit-BT" size="mini" @click="formSubmit('nA')">保存数据</button>
  185. </view>
  186. <view class="form-item">
  187. <view class="item-left">钾离子(K)</view>
  188. <input class="item-right inp" type="text" v-model="nA.K" />
  189. </view>
  190. <view class="form-item">
  191. <view class="item-left">钠离子(K)</view>
  192. <input class="item-right inp" type="text" v-model="nA.NA" />
  193. </view>
  194. <view class="form-item">
  195. <view class="item-left">钙离子(ICA)</view>
  196. <input class="item-right inp" type="text" v-model="nA.ICA" />
  197. </view>
  198. <view class="form-item">
  199. <view class="item-left">氯离子(CL)</view>
  200. <input class="item-right inp" type="text" v-model="nA.CL" />
  201. </view>
  202. <view class="form-item">
  203. <view class="item-left">酸碱度(PH)</view>
  204. <input class="item-right inp" type="text" v-model="nA.PH" />
  205. </view>
  206. <view class="form-item">
  207. <view class="item-left">血糖(GLU)</view>
  208. <input class="item-right inp" type="text" v-model="nA.GLU" />
  209. </view>
  210. <view class="form-item">
  211. <view class="item-left">血乳酸(LAC)</view>
  212. <input class="item-right inp" type="text" v-model="nA.LAC" />
  213. </view>
  214. <view class="form-item">
  215. <view class="item-left">血红蛋白(HB)</view>
  216. <input class="item-right inp" type="text" v-model="nA.HB" />
  217. </view>
  218. <view class="form-item">
  219. <view class="item-left">碳酸氢根(HCO3)</view>
  220. <input class="item-right inp" type="text" v-model="nA.HCO3" />
  221. </view>
  222. <view class="form-item">
  223. <view class="item-left">碱剩余(BE)</view>
  224. <input class="item-right inp" type="text" v-model="nA.BE" />
  225. </view>
  226. <view class="form-item">
  227. <view class="item-left">总二氧化碳(TCO2)</view>
  228. <input class="item-right inp" type="text" v-model="nA.TCO2" />
  229. </view>
  230. <view class="form-item">
  231. <view class="item-left">氧分压(PO2)</view>
  232. <input class="item-right inp" type="text" v-model="nA.PO2" />
  233. </view>
  234. <view class="form-item">
  235. <view class="item-left">二氧化碳分压(PCO2)</view>
  236. <input class="item-right inp" type="text" v-model="nA.PCO2" />
  237. </view>
  238. <view class="form-item">
  239. <view class="item-left">尿素氮(BUN)</view>
  240. <input class="item-right inp" type="text" v-model="nA.BUN" />
  241. </view>
  242. <view class="form-item">
  243. <view class="item-left">尿素氮(BUN)</view>
  244. <input class="item-right inp" type="text" v-model="nA.BUN" />
  245. </view>
  246. </view>
  247. </view>
  248. </template>
  249. <script>
  250. import {parseTime,isEmpty} from'@/libs';
  251. import {setChartDefData,setOpts,setChartData} from'./tool';
  252. import {getGraphDataApi,getStaticDataApi,getRatioApi,getPhysiologyDataApi} from '@/api/ecg';
  253. export default {
  254. data() {
  255. return {
  256. timer:null,
  257. decimalsOpts:setOpts(),
  258. opts:setOpts(),
  259. ecgOpts:setOpts(),
  260. piOpts:setOpts([{tofix:1}]),
  261. temperatureOpts:setOpts([{tofix:1}]),
  262. chartEcgData:setChartDefData(),
  263. chartSbpData:setChartDefData(),
  264. chartDbpData:setChartDefData(),
  265. chartAbpData:setChartDefData(),
  266. chartIcpData:setChartDefData(),
  267. chartCppData:setChartDefData(),
  268. chartOxygenSaturationData:setChartDefData(),
  269. chartPiData:setChartDefData(),
  270. chartHeartbeatData:setChartDefData(),
  271. chartAwRRData:setChartDefData(),
  272. chartTemperatureData:setChartDefData(),
  273. form:{
  274. ecg:"",
  275. sbp:"",
  276. dbp:"",
  277. abp:"",
  278. icp:"",
  279. cpp:"",
  280. oxygenSaturation:"",//SaO2
  281. pi:"",
  282. heartbeat:"",
  283. awrr:"",
  284. temperature:""
  285. },
  286. //静态指标
  287. staticIndicatorsForm:{
  288. indexMovement: null,
  289. tongReflect: null,
  290. tongChange: null,
  291. indexXz: null,
  292. indexZwm: null,
  293. indexXt: null,
  294. indexNzx: null,
  295. indexHckd: null,
  296. age: null,
  297. surgery: null,
  298. medicalHistory: null,
  299. },
  300. //血气
  301. nA: {
  302. K: null,
  303. NA: null,
  304. LAC: null,
  305. CL: null,
  306. PH: null,
  307. GLU: null,
  308. ICA: null,
  309. HB: null,
  310. HCO3: null,
  311. BE: null,
  312. TCO2: null,
  313. PO2: null,
  314. PCO2: null,
  315. BUN: null,
  316. CREA: null,
  317. },
  318. movementIndex:0,
  319. tongIndex:0,
  320. zwmIndex:0,
  321. tongReflectIndex:0,
  322. medicalHistoryIndex:0,
  323. movementList:["遵嘱活动",'刺痛定位',"刺痛定位","刺痛屈曲","无反应"],
  324. zwmList:["无","有"],
  325. tongList:["等大等圆","单瞳增大","单瞳增大"],
  326. tongReflectList:["双瞳反应",'单瞳反应',"双瞳无反应"],
  327. medicalHistoryList:["无",'有一个',"有两个","有三个"]
  328. }
  329. },
  330. onReady() {
  331. this.init();
  332. },
  333. destroyed() {
  334. if(this.timer) clearInterval(this.timer);
  335. },
  336. methods: {
  337. init(){
  338. this.restData();
  339. },
  340. restData(){
  341. if(this.timer) clearInterval(this.timer);
  342. this.timer=setInterval(()=>{
  343. this.createData(setChartData('ecg'));////心电图
  344. this.createData(setChartData('sbp'));//收缩压
  345. this.createData(setChartData('dbp'));//舒张压
  346. this.createData(setChartData('abp'));//动脉压
  347. this.createData(setChartData('icp'));//颅内压
  348. this.createData(setChartData('cpp'));//脑灌注压
  349. this.createData(setChartData('SaO2'));//血氧饱和度
  350. this.createData(setChartData('pi'));//血流灌注指数
  351. this.createData(setChartData('heartbeat'));//心跳
  352. this.createData(setChartData('awrr'));//呼吸率
  353. this.createData(setChartData('temperature'));//体温
  354. },600)
  355. },
  356. createData({max,data,name,degree,min}){
  357. degree=degree?degree:0;
  358. let piont=max*Math.random();
  359. if(!isEmpty(min)){
  360. if(piont<min){
  361. this.createData({max,data,name,degree,min});
  362. return;
  363. }
  364. }
  365. piont=piont.toFixed(degree);
  366. if(this[data].categories.length>40){
  367. this[data].categories.shift();
  368. this[data].series[0].data.shift()
  369. }
  370. this[data].categories.push(parseTime(new Date(),'{s}'));
  371. this[data].series[0].data.push(piont);
  372. this.form[name]=piont;
  373. },
  374. //查询心电图的数据
  375. getGraphDataApi(){
  376. getStaticDataApi().then((res)=>{
  377. console.log('----查询心电图的数据------')
  378. console.log(res)
  379. })
  380. },
  381. //查询生理参数的数据
  382. getPhysiologyDataApi(){
  383. getStaticDataApi().then((res)=>{
  384. console.log('----查询生理参数的数据------')
  385. console.log(res)
  386. })
  387. },
  388. //查询静态参数的数据
  389. getStaticDataApi(){
  390. getStaticDataApi().then((res)=>{
  391. console.log('----查询静态参数的数据------')
  392. console.log(res)
  393. })
  394. },
  395. //计算占比
  396. getRatioApi(){
  397. getStaticDataApi().then((res)=>{
  398. console.log('-----计算占比-----')
  399. console.log(res)
  400. })
  401. },
  402. movementChange({detail}){
  403. let index=detail.value;
  404. let indexMovement=this.movementList[index];
  405. this.movementIndex=this.index;
  406. this.staticIndicatorsForm.indexMovement=indexMovement;
  407. },
  408. tongReflectChange({detail}){
  409. let index=detail.value;
  410. let tongReflect=this.tongReflectList[index];
  411. this.tongReflectIndex=index;
  412. this.staticIndicatorsForm.tongReflect=tongReflect;
  413. },
  414. tongChange({detail}){
  415. let index=detail.value;
  416. let tongChange=this.tongList[index];
  417. this.tongIndex=index;
  418. this.staticIndicatorsForm.tongChange=tongChange;
  419. },
  420. zwmChange({detail}){
  421. let index=detail.value;
  422. let indexZwm=this.zwmList[index];
  423. this.zwmIndex=index;
  424. this.staticIndicatorsForm.indexZwm=indexZwm;
  425. },
  426. medicalHistoryChage({detail}){
  427. let index=detail.value;
  428. let medicalHistory=this.medicalHistoryist[index];
  429. this.medicalHistoryIndex=index;
  430. this.staticIndicatorsForm.medicalHistory=medicalHistory;
  431. },
  432. operationStatusChange({detail}) {
  433. let index=detail.value;
  434. this.staticIndicatorsForm.surgery=detail.value;
  435. },
  436. formSubmit(name){
  437. let formData=JSON.stringify(this[name]);
  438. console.log(formData)
  439. }
  440. }
  441. }
  442. </script>
  443. <style lang="scss">
  444. .ecg-wrap{
  445. .form{
  446. background-color: #fff;
  447. // padding: 20upx 40upx;
  448. .form-item{
  449. height: 80rpx;
  450. border-bottom: 1px solid #eaeaea;
  451. display: flex;
  452. justify-content: space-between;
  453. align-items: center;
  454. overflow: hidden;
  455. padding: 0 30upx;
  456. font-size: 28rpx;
  457. background-color: #fff;
  458. .submit-BT{
  459. margin: 0;
  460. background-color: #0081FF;
  461. color: #fff;
  462. }
  463. &.head{
  464. // background-color: #007AFF;
  465. // color: #fff;
  466. background-color: #f5f5f5;
  467. }
  468. .radio:nth-child(2){
  469. // transform: scale(0.7) !important;
  470. margin-left: 10px;
  471. }
  472. .inp{
  473. text-align: right;
  474. height:80rpx;
  475. line-height:80rpx;
  476. font-size: 28rpx;
  477. max-width: 50%;
  478. }
  479. }
  480. }
  481. .chart-wrap{
  482. // margin-top: 40upx;
  483. .chart-item{
  484. background-color: #fff;
  485. .head{
  486. height: 70upx;
  487. line-height: 70upx;
  488. padding-left: 36upx;
  489. box-shadow: 0 0 1upx rgba(0,0,0,0.3);
  490. }
  491. .chart-box{
  492. width:100%;
  493. height: 380upx;
  494. margin: 0 auto;
  495. }
  496. }
  497. }
  498. }
  499. </style>