graphics.vue 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254
  1. <template>
  2. <div class="table_wrap">
  3. <div
  4. :key="'comKey' + comKey"
  5. class="container"
  6. :style="{
  7. marginTop: containerStyle.marginTop,
  8. left: containerStyle.left
  9. }"
  10. >
  11. <svg width="100%" height="100%"></svg>
  12. </div>
  13. <table class="temperatureChart">
  14. <caption>
  15. <p style="font-size: 20px; font-weight: bold">
  16. {{ env.VITE_HOSPITAL_NAME }}
  17. </p>
  18. <p style="font-size: 20px; font-weight: bold">体温单</p>
  19. <p style="position: relative; text-align: left">
  20. <span class="tbale-label">&nbsp;&nbsp;姓名:</span
  21. ><span style="display: inline-block; width: 75px; text-align: left">{{
  22. info.name
  23. }}</span>
  24. <span class="tbale-label">年龄:</span>
  25. <span style="display: inline-block; width: 50px; text-align: left">{{
  26. info.age + "岁"
  27. }}</span>
  28. <span class="tbale-label">性别:</span>
  29. <span style="display: inline-block; width: 50px; text-align: left">{{
  30. info.sexName
  31. }}</span>
  32. <span class="tbale-label">入院日期:</span>
  33. <span style="display: inline-block; width: 100px; text-align: left">{{
  34. info.admissDate
  35. }}</span>
  36. <span class="tbale-label">科室:</span>
  37. <span style="display: inline-block; width: 100px; text-align: left">{{
  38. info.admissWardName
  39. }}</span>
  40. <span class="tbale-label">床号:</span>
  41. <span style="display: inline-block; width: 60px; text-align: left">{{
  42. info.bedNo
  43. }}</span>
  44. <span class="tbale-label">住院号:</span>
  45. <span style="display: inline-block; width: 80px; text-align: left">{{
  46. info.inpatientNo
  47. }}</span>
  48. <span style="display: inline-block; width: 40px; text-align: left">&nbsp;</span>
  49. </p>
  50. </caption>
  51. <thead></thead>
  52. <tbody>
  53. <tr>
  54. <td
  55. ref="topTd"
  56. :colspan="index === 0 ? 8 : 6"
  57. :class="[index && 'redLineTd', !index && 'table-just']"
  58. v-for="(item, index) in inHospitalTime"
  59. :key="index + '|indays'"
  60. >
  61. {{
  62. index === 0
  63. ? "日&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;期"
  64. : item
  65. }}
  66. </td>
  67. </tr>
  68. <tr>
  69. <td
  70. :colspan="index === 0 ? 8 : 6"
  71. :class="[index && 'redLineTd', !index && 'table-just']"
  72. v-for="(item, index) in inHospitalDays"
  73. :key="index + '|inHospitalDays'"
  74. >
  75. {{ index === 0 ? "住院天数" : item }}
  76. </td>
  77. </tr>
  78. <tr>
  79. <td
  80. :colspan="index === 0 ? 8 : 6"
  81. :class="[index && 'redLineTd', !index && 'table-just']"
  82. :style="index !== 0 ? { color: 'red' } : {}"
  83. v-for="(item, index) in surgeryDays"
  84. :key="index + '|surgeryDays'"
  85. >
  86. {{ index === 0 ? "手术后天数" : (item ? item : (info.oprtStatus && (info.oprtStatus ==='有手术') ? 0 : '')) }}
  87. </td>
  88. </tr>
  89. <tr>
  90. <td class="table-just" rowspan="2" colspan="8">
  91. 时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间
  92. </td>
  93. </tr>
  94. <!-- 已屏蔽,保留以备后用 - 旧的时间显示代码 -->
  95. <tr>
  96. <!-- <td class="focusText">3</td>
  97. <td>7</td>
  98. <td>11</td>
  99. <td>15</td>
  100. <td class="focusText">19</td>
  101. <td class="focusText redLineTd">23</td>
  102. <td class="focusText">3</td>
  103. <td>7</td>
  104. <td>11</td>
  105. <td>15</td>
  106. <td class="focusText">19</td>
  107. <td class="focusText redLineTd">23</td>
  108. <td class="focusText">3</td>
  109. <td>7</td>
  110. <td>11</td>
  111. <td>15</td>
  112. <td class="focusText">19</td>
  113. <td class="focusText redLineTd">23</td>
  114. <td class="focusText">3</td>
  115. <td>7</td>
  116. <td>11</td>
  117. <td>15</td>
  118. <td class="focusText">19</td>
  119. <td class="focusText redLineTd">23</td>
  120. <td class="focusText">3</td>
  121. <td>7</td>
  122. <td>11</td>
  123. <td>15</td>
  124. <td class="focusText">19</td>
  125. <td class="focusText redLineTd">23</td>
  126. <td class="focusText">3</td>
  127. <td>7</td>
  128. <td>11</td>
  129. <td>15</td>
  130. <td class="focusText">19</td>
  131. <td class="focusText redLineTd">23</td>
  132. <td class="focusText">3</td>
  133. <td>7</td>
  134. <td>11</td>
  135. <td>15</td>
  136. <td class="focusText">19</td>
  137. <td class="focusText">23</td> -->
  138. <td class="focusText">2</td>
  139. <td>6</td>
  140. <td>10</td>
  141. <td>14</td>
  142. <td class="focusText">18</td>
  143. <td class="focusText redLineTd">22</td>
  144. <td class="focusText">2</td>
  145. <td>6</td>
  146. <td>10</td>
  147. <td>14</td>
  148. <td class="focusText">18</td>
  149. <td class="focusText redLineTd">22</td>
  150. <td class="focusText">2</td>
  151. <td>6</td>
  152. <td>10</td>
  153. <td>14</td>
  154. <td class="focusText">18</td>
  155. <td class="focusText redLineTd">22</td>
  156. <td class="focusText">2</td>
  157. <td>6</td>
  158. <td>10</td>
  159. <td>14</td>
  160. <td class="focusText">18</td>
  161. <td class="focusText redLineTd">22</td>
  162. <td class="focusText">2</td>
  163. <td>6</td>
  164. <td>10</td>
  165. <td>14</td>
  166. <td class="focusText">18</td>
  167. <td class="focusText redLineTd">22</td>
  168. <td class="focusText">2</td>
  169. <td>6</td>
  170. <td>10</td>
  171. <td>14</td>
  172. <td class="focusText">18</td>
  173. <td class="focusText redLineTd">22</td>
  174. <td class="focusText">2</td>
  175. <td>6</td>
  176. <td>10</td>
  177. <td>14</td>
  178. <td class="focusText">18</td>
  179. <td class="focusText">22</td>
  180. </tr>
  181. <!-- <record></record> -->
  182. <tr class="recorde temperature_mark">
  183. <td colspan="2" rowspan="45" style="border-right: 1px solid white">
  184. <div :style="{ marginTop: legendStyle.marginTop, height: '31px' }">
  185. <p style="width: 35px">
  186. <span>口表•</span>
  187. <span style="color: blue">腋表x</span>
  188. <span>肛表o</span>
  189. <span style="color: red">脉搏•</span>
  190. <span style="color: red">心率o</span>
  191. </p>
  192. <p></p>
  193. </div>
  194. </td>
  195. <td colspan="3" rowspan="45">
  196. <div style="color: red" class="num_wrapper">
  197. <p :style="{ marginTop: pulseScaleStyle.titleMarginTop, textAlign: 'right' }">脉搏次/分</p>
  198. <p :style="{ marginTop: pulseScaleStyle.firstRowMarginTop }">180</p>
  199. <p :style="{ marginTop: pulseScaleStyle.normalRowMarginTop }">160</p>
  200. <p :style="{ marginTop: pulseScaleStyle.normalRowMarginTop }">140</p>
  201. <p :style="{ marginTop: pulseScaleStyle.normalRowMarginTop }">120</p>
  202. <p :style="{ marginTop: pulseScaleStyle.normalRowMarginTop }">100</p>
  203. <p :style="{ marginTop: pulseScaleStyle.normalRowMarginTop }">80</p>
  204. <p :style="{ marginTop: pulseScaleStyle.lastRowMarginTop }">60</p>
  205. <p :style="{ marginTop: pulseScaleStyle.lastRowMarginTop }">40</p>
  206. </div>
  207. </td>
  208. <td colspan="3" rowspan="45">
  209. <div style="color: blue" class="num_wrapper">
  210. <p :style="{ marginTop: temperatureScaleStyle.titleMarginTop }">体温<br />x</p>
  211. <p :style="{ marginTop: temperatureScaleStyle.firstRowMarginTop }">41</p>
  212. <p :style="{ marginTop: temperatureScaleStyle.normalRowMarginTop }">40</p>
  213. <p :style="{ marginTop: temperatureScaleStyle.normalRowMarginTop }">39</p>
  214. <p :style="{ marginTop: temperatureScaleStyle.normalRowMarginTop }">38</p>
  215. <p :style="{ marginTop: temperatureScaleStyle.normalRowMarginTop }">37</p>
  216. <p :style="{ marginTop: temperatureScaleStyle.normalRowMarginTop }">36</p>
  217. <p :style="{ marginTop: temperatureScaleStyle.lastRowMarginTop }">35</p>
  218. <p :style="{ marginTop: temperatureScaleStyle.lastRowMarginTop }">34</p>
  219. </div>
  220. </td>
  221. <td
  222. v-for="(item, y) in tdList"
  223. :key="y + 'td0'"
  224. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  225. >
  226. <div class="recorde-text" :style="recordeTextStyle">{{ getSymbolTextArr(y) }}</div>
  227. </td>
  228. </tr>
  229. <tr
  230. class="recorde"
  231. v-for="(tr, index) in [0, 0, 0]"
  232. :key="index + 'tr1'"
  233. >
  234. <td
  235. v-for="(item, y) in tdList"
  236. :key="y + 'td1'"
  237. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  238. ></td>
  239. </tr>
  240. <tr class="recorde">
  241. <template v-for="(item, index) of tdList">
  242. <td
  243. :key="index + 'td2'"
  244. v-if="index % 6 === 5 && index != tdList.length"
  245. style="
  246. border-right: 1px solid #ff6e71;
  247. border-bottom: 1px solid #7e7eff;
  248. "
  249. ></td>
  250. <td
  251. :key="index + 'td2'"
  252. v-else
  253. style="border-bottom: 1px solid #7e7eff"
  254. ></td>
  255. </template>
  256. </tr>
  257. <tr
  258. class="recorde"
  259. v-for="(tr, index) in [0, 0, 0, 0]"
  260. :key="index + 'tr2'"
  261. >
  262. <td
  263. v-for="(item, y) in tdList"
  264. :key="y + 'td3'"
  265. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  266. ></td>
  267. </tr>
  268. <tr class="recorde">
  269. <template v-for="(item, index) of tdList">
  270. <td
  271. :key="index + 'td4'"
  272. v-if="index % 6 === 5 && index != tdList.length"
  273. style="
  274. border-right: 1px solid #ff6e71;
  275. border-bottom: 1px solid #7e7eff;
  276. "
  277. ></td>
  278. <td
  279. :key="index + 'td4'"
  280. v-else
  281. style="border-bottom: 1px solid #7e7eff"
  282. ></td>
  283. </template>
  284. </tr>
  285. <tr
  286. class="recorde"
  287. v-for="(tr, index) in [0, 0, 0, 0]"
  288. :key="index + 'tr3'"
  289. >
  290. <td
  291. v-for="(item, y) in tdList"
  292. :key="y + 'td5'"
  293. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  294. ></td>
  295. </tr>
  296. <tr class="recorde">
  297. <template v-for="(item, index) of tdList">
  298. <td
  299. :key="index + 'td6'"
  300. v-if="index % 6 === 5 && index != tdList.length"
  301. style="
  302. border-right: 1px solid #ff6e71;
  303. border-bottom: 1px solid #7e7eff;
  304. "
  305. ></td>
  306. <td
  307. :key="index + 'td6'"
  308. v-else
  309. style="border-bottom: 1px solid #7e7eff"
  310. ></td>
  311. </template>
  312. </tr>
  313. <tr
  314. class="recorde"
  315. v-for="(tr, index) in [0, 0, 0, 0]"
  316. :key="index + 'tr4'"
  317. >
  318. <td
  319. v-for="(item, y) in tdList"
  320. :key="y + 'td7'"
  321. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  322. ></td>
  323. </tr>
  324. <tr class="recorde">
  325. <template v-for="(item, index) of tdList">
  326. <td
  327. :key="index + 'td8'"
  328. v-if="index % 6 === 5 && index != tdList.length"
  329. style="
  330. border-right: 1px solid #ff6e71;
  331. border-bottom: 1px solid #7e7eff;
  332. "
  333. ></td>
  334. <td
  335. :key="index + 'td8'"
  336. v-else
  337. style="border-bottom: 1px solid #7e7eff"
  338. ></td>
  339. </template>
  340. </tr>
  341. <tr
  342. class="recorde"
  343. v-for="(tr, index) in [0, 0, 0, 0]"
  344. :key="index + 'tr5'"
  345. >
  346. <td
  347. v-for="(item, y) in tdList"
  348. :key="y + 'td9'"
  349. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  350. ></td>
  351. </tr>
  352. <tr class="recorde">
  353. <template v-for="(item, index) of tdList">
  354. <td
  355. :key="index + 'td10'"
  356. v-if="index % 6 === 5 && index != tdList.length"
  357. style="
  358. border-right: 1px solid #ff6e71;
  359. border-bottom: 1px solid #ff0000;
  360. "
  361. ></td>
  362. <td
  363. :key="index + 'td10'"
  364. v-else
  365. style="border-bottom: 1px solid #ff0000"
  366. ></td>
  367. </template>
  368. </tr>
  369. <tr
  370. class="recorde"
  371. v-for="(tr, index) in [0, 0, 0, 0]"
  372. :key="index + 'tr6'"
  373. >
  374. <td
  375. v-for="(item, y) in tdList"
  376. :key="y + 'td11'"
  377. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  378. ></td>
  379. </tr>
  380. <tr class="recorde">
  381. <template v-for="(item, index) of tdList">
  382. <td
  383. :key="index + 'td11'"
  384. v-if="index % 6 === 5 && index != tdList.length"
  385. style="
  386. border-right: 1px solid #ff6e71;
  387. border-bottom: 1px solid #7e7eff;
  388. "
  389. ></td>
  390. <td
  391. :key="index + 'td11'"
  392. v-else
  393. style="border-bottom: 1px solid #7e7eff"
  394. ></td>
  395. </template>
  396. </tr>
  397. <tr
  398. class="recorde"
  399. v-for="(tr, index) in [0, 0, 0, 0]"
  400. :key="index + 'tr7'"
  401. >
  402. <td
  403. v-for="(item, y) in tdList"
  404. :key="y"
  405. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  406. ></td>
  407. </tr>
  408. <tr class="recorde">
  409. <template v-for="(item, index) of tdList">
  410. <td
  411. :key="index + 'td12'"
  412. v-if="index % 6 === 5 && index != tdList.length"
  413. style="
  414. border-right: 1px solid #ff6e71;
  415. border-bottom: 1px solid #7e7eff;
  416. "
  417. ></td>
  418. <td
  419. :key="index + 'td12'"
  420. v-else
  421. style="border-bottom: 1px solid #7e7eff"
  422. ></td>
  423. </template>
  424. </tr>
  425. <tr
  426. class="recorde"
  427. v-for="(tr, index) in [0, 0, 0, 0]"
  428. :key="index + 'tr8'"
  429. >
  430. <td
  431. v-for="(item, y) in tdList"
  432. :key="y + 'td13'"
  433. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  434. ></td>
  435. </tr>
  436. <tr class="recorde">
  437. <template v-for="(item, index) of tdList">
  438. <td
  439. :key="index + 'td14'"
  440. v-if="index % 6 === 5 && index != tdList.length"
  441. style="
  442. border-right: 1px solid #ff6e71;
  443. border-bottom: 1px solid #7e7eff;
  444. "
  445. ></td>
  446. <td
  447. :key="index + 'td14'"
  448. v-else
  449. style="border-bottom: 1px solid #7e7eff"
  450. ></td>
  451. </template>
  452. </tr>
  453. <tr
  454. class="recorde"
  455. v-for="(tr, index) in [0, 0, 0, 0, 0]"
  456. :key="index + 'tr9'"
  457. >
  458. <td
  459. v-for="(item, y) in tdList"
  460. :key="y + 'td15'"
  461. :class="[y % 6 === 5 && y != tdList.length && 'redLineTd']"
  462. ></td>
  463. </tr>
  464. <tr></tr>
  465. <tr>
  466. <td
  467. :colspan="index === 0 ? 8 : 1"
  468. v-for="(item, index) in array42"
  469. :class="[index && 'redLineTd']"
  470. :key="index + '|098'"
  471. >
  472. {{
  473. index === 0
  474. ? "呼吸(次/分)"
  475. : typesViewData["098"] && typesViewData["098"][index - 1]
  476. }}
  477. </td>
  478. </tr>
  479. <tr>
  480. <td
  481. :colspan="index === 0 ? 8 : 1"
  482. v-for="(item, index) in array42"
  483. :class="[index && 'redLineTd']"
  484. :key="index + '|099'"
  485. >
  486. {{
  487. index === 0
  488. ? "疼痛强度"
  489. : typesViewData["099"] && typesViewData["099"][index - 1]
  490. }}
  491. </td>
  492. </tr>
  493. <tr>
  494. <td
  495. :colspan="index === 0 ? 8 : 6"
  496. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  497. :class="[index && 'redLineTd']"
  498. :key="index + '|005'"
  499. >
  500. {{
  501. index === 0
  502. ? "大便(次/日)"
  503. : typesViewData["005"] && typesViewData["005"][index - 1]
  504. }}
  505. </td>
  506. </tr>
  507. <tr>
  508. <td
  509. :colspan="index === 0 ? 8 : 6"
  510. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  511. :class="[index && 'redLineTd']"
  512. :key="index + '|004'"
  513. >
  514. {{
  515. index === 0
  516. ? "小便(ml)"
  517. : typesViewData["004"] && typesViewData["004"][index - 1]
  518. }}
  519. </td>
  520. </tr>
  521. <tr>
  522. <td
  523. :colspan="index === 0 ? 8 : 6"
  524. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  525. :class="[index && 'redLineTd']"
  526. :key="index + '|008'"
  527. >
  528. {{
  529. index === 0
  530. ? "血压(mmHg)"
  531. : typesViewData["008"] && typesViewData["008"][index - 1]
  532. }}
  533. </td>
  534. </tr>
  535. <tr>
  536. <td
  537. :colspan="index === 0 ? 8 : 6"
  538. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  539. :class="[index && 'redLineTd']"
  540. :key="index + '|030'"
  541. >
  542. {{
  543. index === 0
  544. ? "身高(cm)"
  545. : typesViewData["030"] && typesViewData["030"][index - 1]
  546. }}
  547. </td>
  548. </tr>
  549. <tr>
  550. <td
  551. :colspan="index === 0 ? 8 : 6"
  552. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  553. :class="[index && 'redLineTd']"
  554. :key="index + '|009'"
  555. >
  556. {{
  557. index === 0
  558. ? "体重(kg)"
  559. : typesViewData["009"] && typesViewData["009"][index - 1]
  560. }}
  561. </td>
  562. </tr>
  563. <tr>
  564. <td
  565. :colspan="index === 0 ? 8 : 6"
  566. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  567. :class="[index && 'redLineTd']"
  568. :key="index + '|006'"
  569. >
  570. {{
  571. index === 0
  572. ? "入量"
  573. : typesViewData["006"] && typesViewData["006"][index - 1]
  574. }}
  575. </td>
  576. </tr>
  577. <tr>
  578. <td
  579. :colspan="index === 0 ? 8 : 6"
  580. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  581. :class="[index && 'redLineTd']"
  582. :key="index + '|011'"
  583. >
  584. {{
  585. index === 0
  586. ? "出量"
  587. : typesViewData["011"] && typesViewData["011"][index - 1]
  588. }}
  589. </td>
  590. </tr>
  591. <tr>
  592. <td
  593. :colspan="index === 0 ? 8 : 6"
  594. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  595. :class="[index && 'redLineTd']"
  596. :key="index + '|010'"
  597. >
  598. {{
  599. index === 0
  600. ? "过敏药物"
  601. : typesViewData["010"] && typesViewData["010"][index - 1]
  602. }}
  603. </td>
  604. </tr>
  605. <!-- 皮试结果第一行 -->
  606. <tr>
  607. <td
  608. :colspan="index === 0 ? 8 : 6"
  609. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  610. :class="[index && 'redLineTd']"
  611. :key="index + '|031'"
  612. >
  613. {{
  614. index === 0
  615. ? "皮试结果1"
  616. : typesViewData["031"] && typesViewData["031"][index - 1]
  617. }}
  618. </td>
  619. </tr>
  620. <!-- 皮试结果第二行 -->
  621. <tr>
  622. <td
  623. :colspan="index === 0 ? 8 : 6"
  624. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  625. :class="[index && 'redLineTd']"
  626. :key="index + '|032'"
  627. >
  628. {{
  629. index === 0
  630. ? "皮试结果2"
  631. : typesViewData["032"] && typesViewData["032"][index - 1]
  632. }}
  633. </td>
  634. </tr>
  635. <!-- 皮试结果第三行 -->
  636. <tr>
  637. <td
  638. :colspan="index === 0 ? 8 : 6"
  639. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  640. :class="[index && 'redLineTd']"
  641. :key="index + '|033'"
  642. >
  643. {{
  644. index === 0
  645. ? "皮试结果3"
  646. : typesViewData["033"] && typesViewData["033"][index - 1]
  647. }}
  648. </td>
  649. </tr>
  650. <!-- 皮试结果第四行 -->
  651. <tr>
  652. <td
  653. :colspan="index === 0 ? 8 : 6"
  654. v-for="(item, index) in [0, 1, 2, 3, 4, 5, 6, 7]"
  655. :class="[index && 'redLineTd']"
  656. :key="index + '|034'"
  657. >
  658. {{
  659. index === 0
  660. ? "皮试结果4"
  661. : typesViewData["034"] && typesViewData["034"][index - 1]
  662. }}
  663. </td>
  664. </tr>
  665. </tbody>
  666. </table>
  667. <div style="text-align: center">
  668. <div style="font-size: 20px; font-weight: bold">
  669. {{ `第${info.pageNo}页` }}
  670. </div>
  671. </div>
  672. </div>
  673. </template>
  674. <script>
  675. import * as d3 from "d3";
  676. import dayjs from "dayjs";
  677. import { getKeyMap, SectionToChinese } from "./utils";
  678. import {
  679. getChartData,
  680. getAllPatintInfo,
  681. } from "@/api/medical-advice/nursing-manage";
  682. import { getFormatDatetime } from "@/utils/date";
  683. import env from "../../../utils/setting";
  684. export default {
  685. props: {
  686. patientInfo: Object,
  687. queryParam: Object,
  688. },
  689. data() {
  690. return {
  691. marginTop: 0,
  692. keyMap: getKeyMap(),
  693. info: {
  694. age: 0,
  695. beginDate: "",
  696. inpatientNo: "",
  697. hospDate: 0,
  698. admissDate: "",
  699. bedNo: "",
  700. inDate: 0,
  701. inDiagName: null,
  702. name: "",
  703. admissWardName: "",
  704. sexName: "",
  705. pageNo: "1",
  706. operaDays: [],
  707. admissDateTime: null, // 完整的入院时间
  708. },
  709. xyList: [],
  710. typesInfo: [],
  711. coolingMarkers: [],
  712. typesViewData: {},
  713. breathData: [],
  714. tdList: new Array(42).fill(0),
  715. comKey: 1,
  716. symbolTextArr: [],
  717. array42: [],
  718. // 动态样式
  719. recordeTextStyle: {
  720. width: '12px',
  721. height: '10px',
  722. color: '#ff0000',
  723. fontSize: '8px',
  724. position: 'relative',
  725. top: '-1px',
  726. lineHeight: '14px'
  727. },
  728. // 动态刻度样式
  729. pulseScaleStyle: {
  730. titleMarginTop: '0px',
  731. firstRowMarginTop: '32px',
  732. normalRowMarginTop: '55px',
  733. lastRowMarginTop: '56px'
  734. },
  735. temperatureScaleStyle: {
  736. titleMarginTop: '0px',
  737. firstRowMarginTop: '32px',
  738. normalRowMarginTop: '55px',
  739. lastRowMarginTop: '56px'
  740. },
  741. legendStyle: {
  742. marginTop: '476px'
  743. },
  744. containerStyle: {
  745. marginTop: '-12px',
  746. left: '28px'
  747. },
  748. chromeMatch:''
  749. };
  750. },
  751. computed: {
  752. env() {
  753. return env;
  754. },
  755. // 日期
  756. inHospitalTime() {
  757. const initday = dayjs(this.info.beginDate);
  758. return [
  759. null, // 文案天
  760. initday.format("YYYY-MM-DD"),
  761. initday.add(1, "day").format("MM-DD"),
  762. initday.add(2, "day").format("MM-DD"),
  763. initday.add(3, "day").format("MM-DD"),
  764. initday.add(4, "day").format("MM-DD"),
  765. initday.add(5, "day").format("MM-DD"),
  766. initday.add(6, "day").format("MM-DD"),
  767. ];
  768. },
  769. // 住院天数
  770. inHospitalDays() {
  771. const initday = this.info.hospDays || 0;
  772. return [
  773. null, // 文案天
  774. initday + 1,
  775. initday + 2,
  776. initday + 3,
  777. initday + 4,
  778. initday + 5,
  779. initday + 6,
  780. initday + 7,
  781. ];
  782. },
  783. // 手术天数
  784. surgeryDays() {
  785. const initday = this.info.operaDays;
  786. if (initday.length <= 0) {
  787. return new Array(8).fill(null);
  788. } else {
  789. return initday;
  790. }
  791. },
  792. },
  793. mounted() {
  794. for (let i = 0; i < 43; i++) {
  795. this.array42.push(i);
  796. }
  797. this.initData();
  798. // 计算默认marginTop
  799. const topTdHeight = this.$refs.topTd[0].getBoundingClientRect().height;
  800. const defaultMarginTop = (Math.round(topTdHeight) - 18) * 10 + 28;
  801. this.marginTop = defaultMarginTop;
  802. console.log('=== mounted调试信息 ===');
  803. console.log('topTd元素高度:', topTdHeight);
  804. console.log('计算过程:', `(${Math.round(topTdHeight)} - 18) * 10 + 28 = ${defaultMarginTop}`);
  805. console.log('最终marginTop:', this.marginTop);
  806. console.log('========================');
  807. // 根据分辨率设置样式
  808. this.setStyleByResolution();
  809. // setTimeout(() => {
  810. // this.$emit('done')
  811. // })
  812. },
  813. methods: {
  814. SectionToChinese,
  815. // 将时间转换为中文格式
  816. convertTimeToChinese(hour, minute) {
  817. // 参考 Java 版本的 numberToChinese 方法,创建专门的时间转换函数
  818. const numberToChinese = (number) => {
  819. if (number === 0) return "零";
  820. if (number === 1) return "一";
  821. if (number === 2) return "二";
  822. if (number === 3) return "三";
  823. if (number === 4) return "四";
  824. if (number === 5) return "五";
  825. if (number === 6) return "六";
  826. if (number === 7) return "七";
  827. if (number === 8) return "八";
  828. if (number === 9) return "九";
  829. if (number === 10) return "十";
  830. if (number === 11) return "十一";
  831. if (number === 12) return "十二";
  832. if (number === 13) return "十三";
  833. if (number === 14) return "十四";
  834. if (number === 15) return "十五";
  835. if (number === 16) return "十六";
  836. if (number === 17) return "十七";
  837. if (number === 18) return "十八";
  838. if (number === 19) return "十九";
  839. if (number === 20) return "二十";
  840. if (number === 21) return "二十一";
  841. if (number === 22) return "二十二";
  842. if (number === 23) return "二十三";
  843. if (number === 24) return "二十四";
  844. if (number === 25) return "二十五";
  845. if (number === 26) return "二十六";
  846. if (number === 27) return "二十七";
  847. if (number === 28) return "二十八";
  848. if (number === 29) return "二十九";
  849. if (number === 30) return "三十";
  850. if (number === 31) return "三十一";
  851. if (number === 32) return "三十二";
  852. if (number === 33) return "三十三";
  853. if (number === 34) return "三十四";
  854. if (number === 35) return "三十五";
  855. if (number === 36) return "三十六";
  856. if (number === 37) return "三十七";
  857. if (number === 38) return "三十八";
  858. if (number === 39) return "三十九";
  859. if (number === 40) return "四十";
  860. if (number === 41) return "四十一";
  861. if (number === 42) return "四十二";
  862. if (number === 43) return "四十三";
  863. if (number === 44) return "四十四";
  864. if (number === 45) return "四十五";
  865. if (number === 46) return "四十六";
  866. if (number === 47) return "四十七";
  867. if (number === 48) return "四十八";
  868. if (number === 49) return "四十九";
  869. if (number === 50) return "五十";
  870. if (number === 51) return "五十一";
  871. if (number === 52) return "五十二";
  872. if (number === 53) return "五十三";
  873. if (number === 54) return "五十四";
  874. if (number === 55) return "五十五";
  875. if (number === 56) return "五十六";
  876. if (number === 57) return "五十七";
  877. if (number === 58) return "五十八";
  878. if (number === 59) return "五十九";
  879. // 对于其他数字,使用通用的转换逻辑
  880. if (number < 10) {
  881. return numberToChinese(number);
  882. } else if (number < 20) {
  883. return "十" + (number === 10 ? "" : numberToChinese(number - 10));
  884. } else if (number < 60) {
  885. const tens = Math.floor(number / 10);
  886. const ones = number % 10;
  887. let tensStr = "";
  888. switch (tens) {
  889. case 2: tensStr = "二十"; break;
  890. case 3: tensStr = "三十"; break;
  891. case 4: tensStr = "四十"; break;
  892. case 5: tensStr = "五十"; break;
  893. }
  894. return tensStr + (ones === 0 ? "" : numberToChinese(ones));
  895. }
  896. return String(number);
  897. };
  898. const hourStr = numberToChinese(hour);
  899. const minuteStr = numberToChinese(minute);
  900. // 处理分钟为0的情况
  901. if (minute === 0) {
  902. return `${hourStr}时`;
  903. }
  904. // 处理分钟小于10的情况,需要加"零"
  905. if (minute < 10) {
  906. return `${hourStr}时零${minuteStr}分`;
  907. }
  908. return `${hourStr}时${minuteStr}分`;
  909. },
  910. // 生成入院标识文字
  911. generateAdmissionText(admissionDateTime) {
  912. if (!admissionDateTime) return "";
  913. const date = new Date(admissionDateTime);
  914. const hour = date.getHours();
  915. const minute = date.getMinutes();
  916. return `入院${this.convertTimeToChinese(hour, minute)}`;
  917. },
  918. // 获取入院时间应该显示的时间段索引
  919. getAdmissionTimeSlot(admissionDateTime) {
  920. if (!admissionDateTime) return -1;
  921. const date = new Date(admissionDateTime);
  922. const hour = date.getHours();
  923. const minute = date.getMinutes();
  924. const second = date.getSeconds();
  925. // 将时间转换为分钟数,便于精确计算
  926. const totalMinutes = hour * 60 + minute + second / 60;
  927. // 标准时间点:02:00, 06:00, 10:00, 14:00, 18:00, 22:00
  928. const standardMinutes = [2 * 60, 6 * 60, 10 * 60, 14 * 60, 18 * 60, 22 * 60];
  929. // 计算到每个标准时间点的距离,选择最近的
  930. let minDistance = Infinity;
  931. let closestIndex = -1;
  932. for (let i = 0; i < standardMinutes.length; i++) {
  933. const standardMinute = standardMinutes[i];
  934. let distance;
  935. // 计算距离,考虑跨天的情况
  936. if (Math.abs(totalMinutes - standardMinute) <= 12 * 60) {
  937. // 同一天内或相邻天的情况
  938. distance = Math.abs(totalMinutes - standardMinute);
  939. } else {
  940. // 跨天的情况,需要计算最短距离
  941. if (totalMinutes > standardMinute) {
  942. // 例如:23点到02点
  943. distance = Math.min(totalMinutes - standardMinute, (24 * 60 - totalMinutes) + standardMinute);
  944. } else {
  945. // 例如:1点到22点
  946. distance = Math.min(standardMinute - totalMinutes, (24 * 60 - standardMinute) + totalMinutes);
  947. }
  948. }
  949. // 更新最小距离和对应的索引
  950. if (distance < minDistance) {
  951. minDistance = distance;
  952. closestIndex = i;
  953. }
  954. }
  955. return closestIndex;
  956. },
  957. getSymbolTextArr(index) {
  958. // 检查是否是入院时间对应的位置
  959. if (this.info.admissDateTime) {
  960. // 计算入院时间对应的日期索引
  961. const admissionDate = new Date(this.info.admissDateTime);
  962. const currentDate = dayjs(this.info.beginDate).add(Math.floor(index / 6), 'day');
  963. // 判断是否是入院当天
  964. if (dayjs(admissionDate).format('YYYY-MM-DD') === currentDate.format('YYYY-MM-DD')) {
  965. // 判断是否是入院时间段
  966. const admissionSlot = this.getAdmissionTimeSlot(this.info.admissDateTime);
  967. if (admissionSlot === (index % 6)) {
  968. return this.generateAdmissionText(this.info.admissDateTime);
  969. }
  970. }
  971. }
  972. // 原有的特殊标注文字逻辑
  973. const current = this.symbolTextArr.find(i => i.x === index);
  974. if (current) {
  975. return current.y;
  976. } else {
  977. return "";
  978. }
  979. },
  980. temperatureConverter(c) {
  981. const value = (c * 9) / 5 + 32;
  982. return value.toFixed(1);
  983. },
  984. initData() {
  985. // this.info = dataModel.grParamBOS
  986. this.info.pageNo = this.queryParam.week;
  987. this.info.beginDate = this.queryParam.startRecTime;
  988. this.info.hospDays = (Number(this.queryParam.week) - 1) * 7;
  989. // this.rowsInfo = dataModel.rows || []
  990. // this.typesInfo = dataModel.types || []
  991. let param = {
  992. inpatientNo: this.patientInfo.inpatientNo,
  993. admissTimes: this.patientInfo.admissTimes,
  994. week: this.queryParam.week,
  995. startRecTime: this.queryParam.startRecTime,
  996. endRecTime: this.queryParam.endRecTime,
  997. mbFlag: this.queryParam.checkBoxFlag.mbFlag,
  998. hxFlag: this.queryParam.checkBoxFlag.hxFlag,
  999. xyFlag: this.queryParam.checkBoxFlag.xyFlag,
  1000. wcyRqFlag: this.queryParam.checkBoxFlag.wcyRqFlag,
  1001. };
  1002. getAllPatintInfo({
  1003. inpatientNo: this.patientInfo.inpatientNo,
  1004. admissTimes: this.patientInfo.admissTimes,
  1005. }).then(res => {
  1006. this.info.name = res.name;
  1007. this.info.age = res.age || "";
  1008. this.info.sexName = res.sexName;
  1009. this.info.bedNo = res.bedNo;
  1010. this.info.inpatientNo = res.inpatientNo;
  1011. this.info.admissWardName = res.admissWardName;
  1012. this.info.admissDate = getFormatDatetime(res.admissDate, "YYYY-MM-DD");
  1013. // 保存完整的入院时间用于生成入院标识
  1014. this.info.admissDateTime = res.admissDate;
  1015. // 从外层页面获取手术状态
  1016. this.info.oprtStatus = this.patientInfo.oprtStatus;
  1017. });
  1018. getChartData(param).then(res => {
  1019. this.rowsInfo = res.rows;
  1020. this.typesInfo = res.types;
  1021. this.coolingMarkers = res.coolingMarkers || [];
  1022. this.info.operaDays = res.operaDays;
  1023. this.init();
  1024. });
  1025. },
  1026. init() {
  1027. //800 758
  1028. var width = 690;
  1029. var height = 682;
  1030. // SVG画布边缘与图表内容的距离
  1031. var padding = { top: 50, right: 0, bottom: 50, left: 50 };
  1032. // 创建一个分组用来组合要画的图表元素
  1033. var main = d3
  1034. .select(".container svg")
  1035. .append("g")
  1036. .classed("main", true)
  1037. .attr("transform", "translate(" + 80 + "," + 80 + ")");
  1038. // 模拟数据 体温
  1039. var dataset = getTypeData("003", this.rowsInfo);
  1040. var datasetAnus = getTypeData("015", this.rowsInfo);
  1041. var datasetHeartrate = getTypeData("014", this.rowsInfo);
  1042. var datasetPulse = getTypeData("002", this.rowsInfo);
  1043. var symbolTextArr = getTypeData("012", this.rowsInfo, false);
  1044. this.symbolTextArr = symbolTextArr;
  1045. // 口表【黑实圆】
  1046. var datasetPain = getTypeData("001", this.rowsInfo);
  1047. this.breathData = datasetPain;
  1048. // const circleNode = document.createElement('circle')
  1049. // circleNode.setAttribute('cx', '179.2439024390244')
  1050. // circleNode.setAttribute('cy', '582')
  1051. // circleNode.setAttribute('r', '4')
  1052. // circleNode.setAttribute('stroke', '#000000')
  1053. // circleNode.setAttribute('stroke-width', '1')
  1054. // circleNode.setAttribute('fill', '#FFFFFF')
  1055. // document.querySelector('.main').appendChild(circleNode)
  1056. // 创建x轴的比例尺(线性比例尺)
  1057. var xScale = d3
  1058. .scaleLinear()
  1059. .domain([0, 41])
  1060. .range([9, width - padding.left - padding.right + 75]);
  1061. // 创建y轴的比例尺(线性比例尺)
  1062. /* var yScale = d3.scale.linear()
  1063. .domain([0, d3.max(dataset,function(d) {
  1064. return d.y;
  1065. })])
  1066. .range([height - padding.top - padding.bottom, 0]); */
  1067. // 体温
  1068. var yScale = d3
  1069. .scaleLinear()
  1070. .domain([33, 42])
  1071. .range([height - padding.top - padding.bottom, -56]);
  1072. // 脉搏
  1073. var yScale1 = d3
  1074. .scaleLinear()
  1075. .domain([20, 200])
  1076. .range([height - padding.top - padding.bottom, -55]);
  1077. // 呼吸
  1078. var yScale2 = d3
  1079. .scaleLinear()
  1080. .domain([0, 40])
  1081. .range([height - padding.top + 22, -55]);
  1082. // 创建x轴
  1083. var xAxis = d3.axisBottom().scale(xScale);
  1084. // 创建y轴
  1085. var yAxis = d3.axisLeft().scale(yScale);
  1086. var yAxis1 = d3.axisLeft().scale(yScale1);
  1087. var yAxis2 = d3.axisLeft().scale(yScale2);
  1088. // 添加SVG元素并与x轴进行“绑定”
  1089. main
  1090. .append("g")
  1091. .attr("class", "axis")
  1092. .attr(
  1093. "transform",
  1094. "translate(0," + (height - padding.top - padding.bottom) + ")"
  1095. )
  1096. .call(xAxis);
  1097. // 添加SVG元素并与y轴进行“绑定”
  1098. main.append("g").attr("class", "axis").call(yAxis);
  1099. main.append("g").attr("class", "axis").call(yAxis1);
  1100. main.append("g").attr("class", "axis").call(yAxis2);
  1101. // 添加折线
  1102. var line = d3
  1103. .line()
  1104. .x(function (d) {
  1105. return xScale(d.x);
  1106. })
  1107. .y(function (d) {
  1108. return yScale(d.y);
  1109. });
  1110. var line1 = d3
  1111. .line()
  1112. .x(function (d) {
  1113. return xScale(d.x);
  1114. })
  1115. .y(function (d) {
  1116. return yScale1(d.y);
  1117. });
  1118. var line2 = d3
  1119. .line()
  1120. .x(function (d) {
  1121. return xScale(d.x);
  1122. })
  1123. .y(function (d) {
  1124. return yScale(d.y);
  1125. });
  1126. // .interpolate('linear')
  1127. // 选择线条的类型
  1128. // 添加path元素,并通过line()计算出值来赋值
  1129. main
  1130. .append("path")
  1131. .attr("class", "line tiwenline")
  1132. .attr("d", line(dataset));
  1133. main.append("path").attr("class", "line").attr("d", line(datasetAnus));
  1134. main.append("path").attr("class", "line").attr("d", line2(datasetPain));
  1135. main
  1136. .append("path")
  1137. .attr("class", "line redColor")
  1138. .attr("d", line1(datasetHeartrate));
  1139. main
  1140. .append("path")
  1141. .attr("class", "line redColor")
  1142. .attr("d", line1(datasetPulse));
  1143. // main.append('path').attr('class', 'line').attr('d', line3(dataset))
  1144. // 添加点
  1145. /* 黑实圆--start */
  1146. // main
  1147. // .selectAll('rect')
  1148. // .data(dataset_mouth)
  1149. // .enter()
  1150. // .append('circle')
  1151. // .attr('cx', function (d) {
  1152. // return xScale(d.x)
  1153. // })
  1154. // .attr('cy', function (d) {
  1155. // return yScale(d.y)
  1156. // })
  1157. // .attr('r', 4)
  1158. // .attr('fill', function (d, i) {
  1159. // return 'black'
  1160. // })
  1161. /* 黑实圆--end */
  1162. /* 黑空圆--start */
  1163. main
  1164. .selectAll("rect")
  1165. .data(datasetAnus)
  1166. .enter()
  1167. .append("circle")
  1168. .attr("cx", function (d) {
  1169. return xScale(d.x);
  1170. })
  1171. .attr("cy", function (d) {
  1172. return yScale(d.y);
  1173. })
  1174. .attr("r", 4)
  1175. .attr("stroke", "#000000")
  1176. .attr("stroke-width", 1)
  1177. .attr("fill", "#FFFFFF");
  1178. /* 黑空圆--end */
  1179. /* 红空圆--start */
  1180. main
  1181. .selectAll("rect")
  1182. .data(datasetHeartrate)
  1183. .enter()
  1184. .append("circle")
  1185. .attr("cx", function (d) {
  1186. return xScale(d.x);
  1187. })
  1188. .attr("cy", function (d) {
  1189. return yScale1(d.y);
  1190. })
  1191. .attr("r", 4)
  1192. .attr("stroke", "#EE0000")
  1193. .attr("stroke-width", 1)
  1194. .attr("fill", "#FFFFFF");
  1195. /* 红空圆--end */
  1196. /* 红实圆--start */
  1197. main
  1198. .selectAll("rect")
  1199. .data(datasetPulse)
  1200. .enter()
  1201. .append("circle")
  1202. .attr("cx", function (d) {
  1203. return xScale(d.x);
  1204. })
  1205. .attr("cy", function (d) {
  1206. return yScale1(d.y);
  1207. })
  1208. .attr("r", 4)
  1209. .attr("fill", "#EE0000");
  1210. // .on('mouseover', function (d) {
  1211. // // (1)取得提示显示的位置
  1212. // var xPosition = parseFloat(d3.select(this).attr('cx')) + 698
  1213. // var yPosition = parseFloat(d3.select(this).attr('cy')) + 24
  1214. //
  1215. // // (2)创建提示条SVG
  1216. // d3.select('.container svg')
  1217. // .append('text')
  1218. // .attr('id', 'tooltip') // 设置id便于移除提示
  1219. // .attr('x', xPosition)
  1220. // .attr('y', yPosition)
  1221. // .attr('text-anchor', 'middle')
  1222. // .attr('font-family', 'sans-setif')
  1223. // .attr('font-size', '11px')
  1224. // .attr('font-weight', 'bold')
  1225. // .attr('fill', 'white')
  1226. // .text(d.value)
  1227. // })
  1228. // (3)移除提示条SVG
  1229. /* 红实圆--end */
  1230. /* 黑实圆--start */
  1231. main
  1232. .selectAll("rect")
  1233. .data(datasetPain)
  1234. .enter()
  1235. .append("circle")
  1236. .attr("cx", function (d) {
  1237. return xScale(d.x);
  1238. })
  1239. .attr("cy", function (d) {
  1240. return yScale(d.y);
  1241. })
  1242. .attr("r", 4)
  1243. .attr("stroke", "#000000")
  1244. .attr("fill", "#000000");
  1245. /* 黑实圆--end */
  1246. this.drawx(main, dataset, xScale, yScale);
  1247. this.drawCoolingMarkers(main, xScale, yScale);
  1248. this.initTypes();
  1249. // this.hoverEvent(main)
  1250. },
  1251. drawCoolingMarkers(main, xScale, yScale) {
  1252. if (!this.coolingMarkers || this.coolingMarkers.length === 0) return;
  1253. const group = {};
  1254. this.coolingMarkers.forEach(m => {
  1255. if (!m) return;
  1256. const idx = Number(m.index);
  1257. const before = m.before != null ? Number(m.before) : null;
  1258. const after = m.after != null ? Number(m.after) : null;
  1259. if (!Number.isFinite(idx) || before === null || after === null) return;
  1260. if (!group[idx]) group[idx] = [];
  1261. group[idx].push({ before, after });
  1262. });
  1263. const step = 2; // 同格多标记时的水平偏移像素
  1264. Object.keys(group).forEach(k => {
  1265. const idx = Number(k);
  1266. const arr = group[k];
  1267. const n = arr.length;
  1268. const start = -Math.floor((n - 1) / 2) * step;
  1269. arr.forEach((m, i) => {
  1270. const x = xScale(idx) + (n > 1 ? start + i * step : 0);
  1271. const yTop = yScale(Number(m.before));
  1272. const yBottom = yScale(Number(m.after));
  1273. if (!Number.isFinite(yTop) || !Number.isFinite(yBottom)) return;
  1274. // 竖向红色虚线
  1275. main
  1276. .append("line")
  1277. .attr("x1", x)
  1278. .attr("y1", yTop)
  1279. .attr("x2", x)
  1280. .attr("y2", yBottom)
  1281. .attr("stroke", "#ff0000")
  1282. .attr("stroke-width", 1)
  1283. .attr("stroke-dasharray", "5 5");
  1284. // 底部小圆圈
  1285. main
  1286. .append("circle")
  1287. .attr("cx", x)
  1288. .attr("cy", yBottom)
  1289. .attr("r", 3)
  1290. .attr("stroke", "#ff0000")
  1291. .attr("stroke-width", 1)
  1292. .attr("fill", "none");
  1293. });
  1294. });
  1295. },
  1296. drawx(main, dataset, xScale, yScale) {
  1297. /* 【叉形】--start */
  1298. main
  1299. .selectAll("rect")
  1300. .data(dataset)
  1301. .enter()
  1302. .append("line")
  1303. .attr("x1", function (d) {
  1304. return xScale(d.x) - 4;
  1305. })
  1306. .attr("y1", function (d) {
  1307. return yScale(d.y) - 4;
  1308. })
  1309. .attr("x2", function (d) {
  1310. return xScale(d.x) + 4;
  1311. })
  1312. .attr("y2", function (d) {
  1313. return yScale(d.y) + 4;
  1314. })
  1315. .attr("stroke", function (d, i) {
  1316. return "blue";
  1317. });
  1318. main
  1319. .selectAll("rect")
  1320. .data(dataset)
  1321. .enter()
  1322. .append("line")
  1323. .attr("x1", function (d) {
  1324. return xScale(d.x) + 4;
  1325. })
  1326. .attr("y1", function (d) {
  1327. return yScale(d.y) - 4;
  1328. })
  1329. .attr("x2", function (d) {
  1330. return xScale(d.x) - 4;
  1331. })
  1332. .attr("y2", function (d) {
  1333. return yScale(d.y) + 4;
  1334. })
  1335. .attr("stroke", function (d, i) {
  1336. return "blue";
  1337. });
  1338. /* 体温【叉形】--end */
  1339. },
  1340. hoverEvent(main) {
  1341. ///* 鼠标悬停直线--start
  1342. // var dataset_line = [{x: 0,y: 0}]
  1343. // main.selectAll('rect')
  1344. // .data(dataset_line)
  1345. // .enter()
  1346. // .append('line')
  1347. // .attr({
  1348. // 'x1':100,'y1':-56,
  1349. // 'x2':100,'y2':582
  1350. // })
  1351. // .attr('stroke', function(d, i) {
  1352. // return 'black';
  1353. // });
  1354. // 鼠标悬停直线--end */
  1355. document.querySelector(".lineColor").style.stroke = "red";
  1356. const recordeNode = document.createElement("div");
  1357. recordeNode.setAttribute("class", "recorde-text");
  1358. document.querySelector(".recorde td").append(recordeNode);
  1359. const allTrtd = document.querySelectorAll(".temperatureChart tr td");
  1360. [...allTrtd].map(ele => {
  1361. ele.setAttribute("title", ele.innerText);
  1362. });
  1363. /* 鼠标悬停提示框 */
  1364. var tooltip = d3
  1365. .select("body")
  1366. .append("div")
  1367. .attr("class", "tooltip")
  1368. .style("opacity", 0.0);
  1369. main
  1370. .on("mouseover", function (d) {
  1371. /*
  1372. 鼠标移入时,
  1373. (1)通过 selection.html() 来更改提示框的文字
  1374. (2)通过更改样式 left 和 top 来设定提示框的位置
  1375. (3)设定提示框的透明度为1.0(完全不透明)
  1376. */
  1377. tooltip
  1378. .html("呼吸:19次/分<br/>录入信息:2017-11-02<br/>姓名:张三")
  1379. .style("left", d3.event.pageX + "px")
  1380. .style("top", d3.event.pageY + 20 + "px")
  1381. .style("opacity", 1.0);
  1382. })
  1383. .on("mousemove", function (d) {
  1384. /* 鼠标移动时,更改样式 left 和 top 来改变提示框的位置 */
  1385. tooltip
  1386. .style("left", d3.event.pageX + "px")
  1387. .style("top", d3.event.pageY + 20 + "px");
  1388. })
  1389. .on("mouseout", function (d) {
  1390. /* 鼠标移出时,将透明度设定为0.0(完全透明) */
  1391. tooltip.style("opacity", 0.0);
  1392. });
  1393. },
  1394. initTypes() {
  1395. const keyMap = {};
  1396. this.typesInfo.map(item => {
  1397. const key = item.typeCode;
  1398. if (keyMap[key]) {
  1399. keyMap[key].push(item.typeValue);
  1400. } else {
  1401. keyMap[key] = [item.typeValue];
  1402. }
  1403. });
  1404. this.typesViewData = keyMap;
  1405. },
  1406. // 根据分辨率设置样式
  1407. setStyleByResolution() {
  1408. const screenWidth = window.screen.width;
  1409. const screenHeight = window.screen.height;
  1410. console.log('=== 调试信息 ===');
  1411. console.log('屏幕分辨率:', screenWidth + 'x' + screenHeight);
  1412. console.log('浏览器缩放比例:', window.devicePixelRatio);
  1413. console.log('实际窗口尺寸:', window.innerWidth + 'x' + window.innerHeight);
  1414. console.log('计算的marginTop:', this.marginTop);
  1415. console.log('topTd元素高度:', this.$refs.topTd ? this.$refs.topTd[0].getBoundingClientRect().height : '未获取到');
  1416. console.log('================');
  1417. console.log('屏幕总分辨率:', screen.width + 'x' + screen.height);
  1418. console.log('浏览器窗口尺寸:', window.innerWidth + 'x' + window.innerHeight);
  1419. console.log('可用屏幕空间:', screen.availWidth + 'x' + screen.availHeight);
  1420. console.log('文档尺寸:', document.documentElement.clientWidth + 'x' + document.documentElement.clientHeight);
  1421. // 计算被占用的空间
  1422. const taskbarWidth = screen.width - screen.availWidth;
  1423. const taskbarHeight = screen.height - screen.availHeight;
  1424. console.log('被占用的空间:', taskbarWidth + 'x' + taskbarHeight);
  1425. // 滚动条信息
  1426. const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
  1427. const scrollbarHeight = window.innerHeight - document.documentElement.clientHeight;
  1428. console.log('滚动条尺寸:', scrollbarWidth + 'x' + scrollbarHeight);
  1429. // 窗口外部尺寸
  1430. console.log('浏览器窗口外部尺寸:', window.outerWidth + 'x' + window.outerHeight);
  1431. console.log('窗口位置:', window.screenX + 'x' + window.screenY);
  1432. // 浏览器信息
  1433. console.log('用户代理:', navigator.userAgent);
  1434. console.log('平台:', navigator.platform);
  1435. console.log('语言:', navigator.language);
  1436. console.log('浏览器供应商:', navigator.vendor);
  1437. const ua = navigator.userAgent;
  1438. const chromeMatch = ua.match(/Chrome\/[\d.]+/);
  1439. this.chromeMatch = chromeMatch[0];
  1440. console.log('Chrome版本:', chromeMatch ? chromeMatch[0] : '未找到');
  1441. // 媒体查询检测
  1442. const isHighDPI = window.matchMedia('(-webkit-min-device-pixel-ratio: 2)').matches;
  1443. console.log('是否高DPI显示器:', isHighDPI);
  1444. console.log('================');
  1445. // DPI相关调试信息
  1446. console.log('=== DPI调试信息 ===');
  1447. console.log('devicePixelRatio (设备像素比):', window.devicePixelRatio);
  1448. console.log('CSS像素与物理像素比例:', 1 / window.devicePixelRatio);
  1449. console.log('屏幕物理尺寸 (英寸):', {
  1450. width: screenWidth / (96 * window.devicePixelRatio),
  1451. height: screenHeight / (96 * window.devicePixelRatio)
  1452. });
  1453. console.log('估算DPI:', {
  1454. horizontal: Math.round(screenWidth / (screenWidth / (96 * window.devicePixelRatio))),
  1455. vertical: Math.round(screenHeight / (screenHeight / (96 * window.devicePixelRatio)))
  1456. });
  1457. console.log('================');
  1458. // 默认样式(当前分辨率)
  1459. let style = {
  1460. width: '12px',
  1461. height: '10px',
  1462. color: '#ff0000',
  1463. fontSize: '8px',
  1464. position: 'relative',
  1465. top: '-1px',
  1466. lineHeight: '14px'
  1467. };
  1468. // 可以根据不同分辨率设置不同样式
  1469. // 例如:1920x1080
  1470. if (screenWidth === 1920 && screenHeight === 1080) {
  1471. style = {
  1472. width: '12px',
  1473. height: '10px',
  1474. color: '#ff0000',
  1475. fontSize: '8px',
  1476. position: 'relative',
  1477. top: '-1px',
  1478. lineHeight: '14px'
  1479. };
  1480. }
  1481. // 例如:1366x768
  1482. else if (screenWidth === 1366 && screenHeight === 768) {
  1483. style = {
  1484. width: '12px',
  1485. height: '10px',
  1486. color: '#ff0000',
  1487. fontSize: '8px',
  1488. position: 'relative',
  1489. top: '-1px',
  1490. lineHeight: '14px'
  1491. };
  1492. }
  1493. // 例如:1536x864
  1494. else if (screenWidth === 1536 && screenHeight === 864) {
  1495. style = {
  1496. width: '12px',
  1497. height: '10px',
  1498. color: '#ff0000',
  1499. fontSize: '8px',
  1500. position: 'relative',
  1501. top: '-1px',
  1502. lineHeight: '14px'
  1503. };
  1504. }
  1505. // 例如:1360x768
  1506. else if (screenWidth === 1360 && screenHeight === 768) {
  1507. style = {
  1508. width: '12px',
  1509. height: '10px',
  1510. color: '#ff0000',
  1511. fontSize: '8px',
  1512. position: 'relative',
  1513. top: '-1px',
  1514. lineHeight: '14px'
  1515. };
  1516. }
  1517. // // 例如:1440x900
  1518. // else if (screenWidth === 1440 && screenHeight === 900) {
  1519. // style = {
  1520. // width: '12px',
  1521. // height: '10px',
  1522. // color: '#ff0000',
  1523. // fontSize: '8px',
  1524. // position: 'relative',
  1525. // top: '-1px',
  1526. // lineHeight: '14px'
  1527. // };
  1528. // }
  1529. // 其他分辨率使用默认样式
  1530. else {
  1531. style = {
  1532. width: '12px',
  1533. height: '10px',
  1534. color: '#ff0000',
  1535. fontSize: '8px',
  1536. position: 'relative',
  1537. top: '-1px',
  1538. lineHeight: '14px'
  1539. };
  1540. }
  1541. this.recordeTextStyle = style;
  1542. // 设置刻度样式
  1543. this.setScaleStyles(screenWidth, screenHeight);
  1544. },
  1545. // 设置刻度样式
  1546. setScaleStyles(screenWidth, screenHeight) {
  1547. this.applyConditionalPrintAdjustment()
  1548. // 默认刻度样式
  1549. let pulseStyle = {
  1550. titleMarginTop: '0px',
  1551. firstRowMarginTop: '32px',
  1552. normalRowMarginTop: '55px',
  1553. lastRowMarginTop: '56px'
  1554. };
  1555. let temperatureStyle = {
  1556. titleMarginTop: '0px',
  1557. firstRowMarginTop: '32px',
  1558. normalRowMarginTop: '55px',
  1559. lastRowMarginTop: '56px'
  1560. };
  1561. let legendStyle = {
  1562. marginTop: '476px'
  1563. };
  1564. let containerStyle = {
  1565. marginTop: '-12px',
  1566. left: '28px'
  1567. };
  1568. // 可以根据不同分辨率设置不同样式
  1569. // 例如:1920x1080
  1570. if (screenWidth === 1920 && screenHeight === 1080) {
  1571. if(this.marginTop > 0) {//marginTop:48
  1572. pulseStyle = {
  1573. titleMarginTop: '0px',
  1574. firstRowMarginTop: '32px',
  1575. normalRowMarginTop: '55px',
  1576. lastRowMarginTop: '56px'
  1577. };
  1578. temperatureStyle = {
  1579. titleMarginTop: '0px',
  1580. firstRowMarginTop: '32px',
  1581. normalRowMarginTop: '55px',
  1582. lastRowMarginTop: '56px'
  1583. };
  1584. legendStyle = {
  1585. marginTop: '476px'
  1586. };
  1587. if(window.devicePixelRatio > 1) {
  1588. containerStyle = {
  1589. marginTop: this.marginTop + 'px',
  1590. left: '28px'
  1591. };
  1592. }else {
  1593. containerStyle = {
  1594. marginTop: (this.marginTop + 14) + 'px', //2楼儿科01 /3楼左1 /3楼左4
  1595. left: '28px'
  1596. };
  1597. }
  1598. }else {//marginTop:-2
  1599. pulseStyle = {
  1600. titleMarginTop: '0px',
  1601. firstRowMarginTop: '44px',
  1602. normalRowMarginTop: '61px',
  1603. lastRowMarginTop: '61px'
  1604. };
  1605. temperatureStyle = {
  1606. titleMarginTop: '0px',
  1607. firstRowMarginTop: '44px',
  1608. normalRowMarginTop: '61px',
  1609. lastRowMarginTop: '61px'
  1610. };
  1611. legendStyle = {
  1612. marginTop: '476px'
  1613. };
  1614. containerStyle = {
  1615. marginTop: '22px',
  1616. left: '28px'
  1617. };
  1618. if(this.chromeMatch && (this.chromeMatch == 'Chrome/139.0.0.0')) {//11病区,手推车电脑
  1619. this.removeConditionalPrintCSS()
  1620. console.log('removeConditionalPrintCSS')
  1621. }
  1622. }
  1623. }
  1624. // 例如:1366x768
  1625. else if (screenWidth === 1366 && screenHeight === 768) {
  1626. pulseStyle = {
  1627. titleMarginTop: '0px',
  1628. firstRowMarginTop: '32px',
  1629. normalRowMarginTop: '55px',
  1630. lastRowMarginTop: '56px'
  1631. };
  1632. temperatureStyle = {
  1633. titleMarginTop: '0px',
  1634. firstRowMarginTop: '32px',
  1635. normalRowMarginTop: '55px',
  1636. lastRowMarginTop: '56px'
  1637. };
  1638. legendStyle = {
  1639. marginTop: '476px'
  1640. };
  1641. if(this.marginTop > 38) {
  1642. if(this.marginTop < 58) {
  1643. containerStyle = {
  1644. marginTop: (this.marginTop + 15) + 'px',//5楼左2 /8楼左1 /十楼左2 /11楼左2 /12楼左2 /15楼左2 /
  1645. left: '28px'
  1646. };
  1647. }else {
  1648. if(window.devicePixelRatio < 1) {
  1649. containerStyle = {
  1650. marginTop: (this.marginTop + 5) + 'px',
  1651. left: '28px'
  1652. };
  1653. }else {
  1654. containerStyle = {
  1655. marginTop: (14 - 12) + 'px',//13楼左2
  1656. left: '28px'
  1657. };
  1658. }
  1659. }
  1660. console.log("this.marginTop > 38",containerStyle.marginTop)
  1661. }else {
  1662. if(window.devicePixelRatio < 1) {
  1663. if(this.marginTop > 18) {
  1664. containerStyle = {
  1665. marginTop: (this.marginTop + 10 + 14) + 'px',
  1666. left: '28px'
  1667. };
  1668. }else {
  1669. containerStyle = {
  1670. marginTop: (this.marginTop + 10 + 28) + 'px',
  1671. left: '28px'
  1672. };
  1673. }
  1674. }else { //6楼左1 /3楼左2 /5楼左1 /9楼左一 /8楼左2 /15楼左1
  1675. this.applyConditionalPrintAdjustment(37)
  1676. containerStyle = {
  1677. marginTop: (this.marginTop + 10 + 14) + 'px',
  1678. left: '35px'
  1679. };
  1680. }
  1681. console.log("this.marginTop <= 38",containerStyle.marginTop)
  1682. }
  1683. console.log("this.marginTop0000000000000000000000",this.marginTop)
  1684. console.log("marginTop.containerStyle",containerStyle.marginTop)
  1685. }
  1686. // 例如:1536x864
  1687. else if (screenWidth === 1536 && screenHeight === 864) {
  1688. if(this.chromeMatch && (this.chromeMatch == 'Chrome/139.0.0.0')) {
  1689. this.removeConditionalPrintCSS()
  1690. console.log("Chrome版本111111111111111111111",this.chromeMatch)
  1691. }
  1692. pulseStyle = {
  1693. titleMarginTop: '0px',
  1694. firstRowMarginTop: '40px',
  1695. normalRowMarginTop: '60px',
  1696. lastRowMarginTop: '60px'
  1697. };
  1698. temperatureStyle = {
  1699. titleMarginTop: '0px',
  1700. firstRowMarginTop: '40px',
  1701. normalRowMarginTop: '60px',
  1702. lastRowMarginTop: '60px'
  1703. };
  1704. legendStyle = {
  1705. marginTop: '476px'
  1706. };
  1707. containerStyle = {
  1708. marginTop: '23px',
  1709. left: '28px'
  1710. };
  1711. }
  1712. // 例如:1360x768
  1713. else if (screenWidth === 1360 && screenHeight === 768) {
  1714. pulseStyle = {
  1715. titleMarginTop: '0px',
  1716. firstRowMarginTop: '44px',
  1717. normalRowMarginTop: '61px',
  1718. lastRowMarginTop: '61px'
  1719. };
  1720. temperatureStyle = {
  1721. titleMarginTop: '0px',
  1722. firstRowMarginTop: '44px',
  1723. normalRowMarginTop: '61px',
  1724. lastRowMarginTop: '61px'
  1725. };
  1726. legendStyle = {
  1727. marginTop: '476px'
  1728. };
  1729. containerStyle = {
  1730. marginTop: '22px',
  1731. left: '28px'
  1732. };
  1733. }
  1734. // 例如:1600x900
  1735. else if (screenWidth === 1600 && screenHeight === 900) {
  1736. pulseStyle = {
  1737. titleMarginTop: '0px',
  1738. firstRowMarginTop: '32px',
  1739. normalRowMarginTop: '55px',
  1740. lastRowMarginTop: '56px'
  1741. };
  1742. temperatureStyle = {
  1743. titleMarginTop: '0px',
  1744. firstRowMarginTop: '32px',
  1745. normalRowMarginTop: '55px',
  1746. lastRowMarginTop: '56px'
  1747. };
  1748. legendStyle = {
  1749. marginTop: '476px'
  1750. };
  1751. if((this.marginTop == 48) && (window.devicePixelRatio == 1) && (window.innerHeight == 789)) {//2楼左2 /7楼左2
  1752. containerStyle = {
  1753. marginTop: (this.marginTop + 14) + 'px',
  1754. left: '28px'
  1755. };
  1756. }else if((this.marginTop == 48) && (window.devicePixelRatio == 1) && (window.innerHeight == 799)) {//11楼左1
  1757. this.applyConditionalPrintAdjustment(26)
  1758. containerStyle = {
  1759. marginTop: (this.marginTop + 14 + 2) + 'px',
  1760. left: '28px'
  1761. };
  1762. }else {
  1763. containerStyle = {
  1764. marginTop: this.marginTop + 'px',
  1765. left: '28px'
  1766. };
  1767. }
  1768. console.log('1600x900分辨率','marginTop:',this.marginTop,'window.devicePixelRatio',window.devicePixelRatio,'window.innerHeight',window.innerHeight)
  1769. }
  1770. // 例如:1440x900
  1771. else if (screenWidth === 1440 && screenHeight === 900) {
  1772. if(this.marginTop > 38) {
  1773. if(this.marginTop < 58) {
  1774. if((window.innerHeight == 712) || (window.innerHeight == 757)) {//九楼左2 (打印偏右半格)有俩个,怀疑是不同版本的谷歌
  1775. this.removeConditionalPrintCSS()
  1776. }
  1777. if(window.innerHeight == 789) {//6楼左2 /3楼左3 /3楼左5 /10楼左1 /12楼左1
  1778. if(this.chromeMatch && (this.chromeMatch == 'Chrome/109.0.0.0')) {
  1779. this.removeConditionalPrintCSS() //6楼左2
  1780. }
  1781. }
  1782. pulseStyle = {
  1783. titleMarginTop: '0px',
  1784. firstRowMarginTop: '32px',
  1785. normalRowMarginTop: '55px',
  1786. lastRowMarginTop: '56px'
  1787. };
  1788. temperatureStyle = {
  1789. titleMarginTop: '0px',
  1790. firstRowMarginTop: '32px',
  1791. normalRowMarginTop: '55px',
  1792. lastRowMarginTop: '56px'
  1793. };
  1794. legendStyle = {
  1795. marginTop: '476px'
  1796. };
  1797. containerStyle = {
  1798. marginTop: (this.marginTop + 14 + 2) + 'px',//加上2是因为偏上一点点
  1799. left: '28px'
  1800. };
  1801. console.log("window.innerHeight2222222222",window.innerHeight);
  1802. }else {
  1803. if((this.marginTop == 58) && (window.devicePixelRatio == 1) && (window.innerHeight == 785) && (this.chromeMatch && (this.chromeMatch == 'Chrome/95.0.4638.69'))) {//13楼左1
  1804. pulseStyle = {
  1805. titleMarginTop: '0px',
  1806. firstRowMarginTop: '32px',
  1807. normalRowMarginTop: '55px',
  1808. lastRowMarginTop: '56px'
  1809. };
  1810. temperatureStyle = {
  1811. titleMarginTop: '0px',
  1812. firstRowMarginTop: '32px',
  1813. normalRowMarginTop: '55px',
  1814. lastRowMarginTop: '56px'
  1815. };
  1816. legendStyle = {
  1817. marginTop: '476px'
  1818. };
  1819. containerStyle = {
  1820. marginTop: (this.marginTop + 14) + 'px',
  1821. left: '28px'
  1822. };
  1823. }else {
  1824. pulseStyle = {
  1825. titleMarginTop: '0px',
  1826. firstRowMarginTop: '32px',
  1827. normalRowMarginTop: '55px',
  1828. lastRowMarginTop: '56px'
  1829. };
  1830. temperatureStyle = {
  1831. titleMarginTop: '0px',
  1832. firstRowMarginTop: '32px',
  1833. normalRowMarginTop: '55px',
  1834. lastRowMarginTop: '56px'
  1835. };
  1836. legendStyle = {
  1837. marginTop: '476px'
  1838. };
  1839. containerStyle = {
  1840. marginTop: this.marginTop + 'px',
  1841. left: '28px'
  1842. };
  1843. }
  1844. }
  1845. }else {
  1846. if(window.devicePixelRatio < 1) {
  1847. if(window.innerHeight == 876) {//十楼左第一台
  1848. pulseStyle = {
  1849. titleMarginTop: '0px',
  1850. firstRowMarginTop: '32px',
  1851. normalRowMarginTop: '55px',
  1852. lastRowMarginTop: '56px'
  1853. };
  1854. temperatureStyle = {
  1855. titleMarginTop: '0px',
  1856. firstRowMarginTop: '32px',
  1857. normalRowMarginTop: '55px',
  1858. lastRowMarginTop: '56px'
  1859. };
  1860. legendStyle = {
  1861. marginTop: '476px'
  1862. };
  1863. containerStyle = {
  1864. marginTop: (this.marginTop + 10) + 'px',
  1865. left: '28px'
  1866. };
  1867. }else {
  1868. pulseStyle = {
  1869. titleMarginTop: '0px',
  1870. firstRowMarginTop: '32px',
  1871. normalRowMarginTop: '55px',
  1872. lastRowMarginTop: '56px'
  1873. };
  1874. temperatureStyle = {
  1875. titleMarginTop: '0px',
  1876. firstRowMarginTop: '32px',
  1877. normalRowMarginTop: '55px',
  1878. lastRowMarginTop: '56px'
  1879. };
  1880. legendStyle = {
  1881. marginTop: '476px'
  1882. };
  1883. containerStyle = {
  1884. marginTop: (this.marginTop + 7) + 'px',
  1885. left: '28px'
  1886. };
  1887. }
  1888. }else {
  1889. if(window.innerHeight == 757) {//7楼左1
  1890. pulseStyle = {
  1891. titleMarginTop: '0px',
  1892. firstRowMarginTop: '32px',
  1893. normalRowMarginTop: '55px',
  1894. lastRowMarginTop: '56px'
  1895. };
  1896. temperatureStyle = {
  1897. titleMarginTop: '0px',
  1898. firstRowMarginTop: '32px',
  1899. normalRowMarginTop: '55px',
  1900. lastRowMarginTop: '56px'
  1901. };
  1902. legendStyle = {
  1903. marginTop: '476px'
  1904. };
  1905. containerStyle = {
  1906. marginTop: (this.marginTop + 28) + 'px',
  1907. left: '28px'
  1908. };
  1909. }else {
  1910. pulseStyle = {
  1911. titleMarginTop: '0px',
  1912. firstRowMarginTop: '32px',
  1913. normalRowMarginTop: '55px',
  1914. lastRowMarginTop: '56px'
  1915. };
  1916. temperatureStyle = {
  1917. titleMarginTop: '0px',
  1918. firstRowMarginTop: '32px',
  1919. normalRowMarginTop: '55px',
  1920. lastRowMarginTop: '56px'
  1921. };
  1922. legendStyle = {
  1923. marginTop: '476px'
  1924. };
  1925. containerStyle = {
  1926. marginTop: this.marginTop + 'px',
  1927. left: '28px'
  1928. };
  1929. }
  1930. }
  1931. }
  1932. }
  1933. // 其他分辨率使用默认样式
  1934. else {
  1935. pulseStyle = {
  1936. titleMarginTop: '0px',
  1937. firstRowMarginTop: '32px',
  1938. normalRowMarginTop: '55px',
  1939. lastRowMarginTop: '56px'
  1940. };
  1941. temperatureStyle = {
  1942. titleMarginTop: '0px',
  1943. firstRowMarginTop: '32px',
  1944. normalRowMarginTop: '55px',
  1945. lastRowMarginTop: '56px'
  1946. };
  1947. legendStyle = {
  1948. marginTop: '476px'
  1949. };
  1950. containerStyle = {
  1951. marginTop: this.marginTop + 'px',
  1952. left: '28px'
  1953. };
  1954. }
  1955. console.log("this.marginTop11111111111111111111",this.marginTop)
  1956. this.pulseScaleStyle = pulseStyle;
  1957. this.temperatureScaleStyle = temperatureStyle;
  1958. this.legendStyle = legendStyle;
  1959. this.containerStyle = containerStyle;
  1960. },
  1961. // 打印位置调整已通过CSS媒体查询处理,无需JavaScript逻辑
  1962. // 条件化打印位置调整方法 - 可在需要时调用
  1963. applyConditionalPrintAdjustment(leftOffset) {
  1964. try {
  1965. console.log('🔧 应用条件化打印位置调整');
  1966. // 解析参数:支持 35 / '35' / '35px',默认 35px
  1967. const parsed = leftOffset == null
  1968. ? 35
  1969. : Number(String(leftOffset).replace(/px$/i, ''));
  1970. const leftPx = Number.isFinite(parsed) ? `${parsed}px` : '35px';
  1971. // 先移除旧样式
  1972. this.removeConditionalPrintCSS();
  1973. // 创建并注入新样式
  1974. const style = document.createElement('style');
  1975. style.id = 'conditional-print-adjustment';
  1976. style.textContent = `
  1977. @media print {
  1978. .container {
  1979. left: ${leftPx} !important;
  1980. }
  1981. }
  1982. `;
  1983. // 添加到页面头部
  1984. document.head.appendChild(style);
  1985. console.log('✅ 条件化打印CSS样式已添加,left =', leftPx);
  1986. } catch (error) {
  1987. console.error('❌ 条件化打印位置调整失败:', error);
  1988. }
  1989. },
  1990. // 移除条件化打印CSS样式
  1991. removeConditionalPrintCSS() {
  1992. const style = document.getElementById('conditional-print-adjustment');
  1993. if (style) {
  1994. style.remove();
  1995. console.log('✅ 条件化打印CSS样式已移除');
  1996. }
  1997. },
  1998. },
  1999. beforeUnmount() {
  2000. console.log('🧹 组件卸载,清理打印调整功能');
  2001. // 清理条件化打印CSS样式
  2002. this.removeConditionalPrintCSS();
  2003. },
  2004. };
  2005. function getTypeData(type, allData = [], isNumber = true) {
  2006. return allData
  2007. .map((rowBOSItem, index) => {
  2008. const rowBOS = rowBOSItem.rowBOS;
  2009. const cur =
  2010. rowBOS.find(item => {
  2011. return item.typeCode === type;
  2012. }) || {};
  2013. return { x: index, y: (isNumber ? +cur.typeValue : cur.typeValue) || "" };
  2014. })
  2015. .filter(item => {
  2016. return item.y !== "";
  2017. });
  2018. }
  2019. </script>
  2020. <style scoped>
  2021. .table_wrap {
  2022. line-height: normal;
  2023. }
  2024. table {
  2025. font-weight: normal;
  2026. border-collapse: collapse;
  2027. font-size: 8px;
  2028. text-align: center;
  2029. width: 100%;
  2030. table-layout: fixed;
  2031. border: 2px #2f4f4f solid;
  2032. }
  2033. td {
  2034. border: 1px solid #ccc;
  2035. width: 12px;
  2036. height: 11px;
  2037. }
  2038. .redLineTd {
  2039. border-right: 1px solid #ff6e71;
  2040. }
  2041. .recorde-text {
  2042. /* 样式现在通过动态计算设置 */
  2043. color: #ff0000;
  2044. position: relative;
  2045. }
  2046. .table_wrap {
  2047. position: relative;
  2048. margin: 0 auto;
  2049. width: 835px;
  2050. }
  2051. .container {
  2052. /* 高度最好动态计算,不然很容易错位*/
  2053. margin: 30px auto;
  2054. margin-top: 28px;
  2055. width: 805px;
  2056. height: 758px;
  2057. position: absolute;
  2058. top: 142px;
  2059. left: 28px;
  2060. }
  2061. .temperature_mark td p {
  2062. position: relative;
  2063. top: 0;
  2064. margin-top: 58px;
  2065. }
  2066. .num_wrapper {
  2067. width: 35px;
  2068. height: 636px;
  2069. position: relative;
  2070. }
  2071. .pain_wrapper {
  2072. position: absolute;
  2073. width: 100%;
  2074. height: 70px;
  2075. right: 0;
  2076. bottom: -3px;
  2077. border: 1px solid #ccc;
  2078. }
  2079. .zeroline {
  2080. fill: none;
  2081. stroke: red;
  2082. stroke-width: 0.5px;
  2083. stroke-dasharray: 5 5;
  2084. }
  2085. .zerolinetext {
  2086. fill: red;
  2087. }
  2088. .overlay {
  2089. fill: none;
  2090. stroke: none;
  2091. pointer-events: all;
  2092. }
  2093. .tooltip {
  2094. font-family: "宋体";
  2095. font-size: 10px;
  2096. line-height: 16px;
  2097. color: #736269;
  2098. width: auto;
  2099. height: auto;
  2100. padding: 4px;
  2101. position: absolute;
  2102. text-align: left;
  2103. border: 1px solid #736269;
  2104. background-color: #e7e9f3;
  2105. border-radius: 2px;
  2106. background: linear-gradient(#fefdff, #e5e5f1);
  2107. /* 标准的语法(必须放在最后) */
  2108. }
  2109. </style>
  2110. <style>
  2111. .table_wrap {
  2112. font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  2113. }
  2114. .table_wrap .tick,
  2115. .table_wrap .domain {
  2116. display: none;
  2117. }
  2118. .table_wrap .tbale-label {
  2119. font-weight: 700;
  2120. }
  2121. .table_wrap .focusLine {
  2122. fill: none;
  2123. stroke: red;
  2124. stroke-width: 0.5px;
  2125. }
  2126. .table_wrap .focusText {
  2127. color: red;
  2128. }
  2129. .table_wrap .breath_td_odd {
  2130. vertical-align: top;
  2131. font-size: 10px;
  2132. }
  2133. .table_wrap .breath_td_even {
  2134. vertical-align: bottom;
  2135. font-size: 10px;
  2136. }
  2137. .table_wrap .line {
  2138. fill: none;
  2139. stroke: black;
  2140. stroke-width: 2px;
  2141. }
  2142. .table_wrap .line.tiwenline {
  2143. stroke: blue;
  2144. fill: none;
  2145. }
  2146. .table_wrap .line.redColor {
  2147. stroke: red;
  2148. fill: none;
  2149. }
  2150. .table_wrap .axis path,
  2151. .table_wrap .axis line,
  2152. .table_wrap .line {
  2153. stroke: #000;
  2154. fill: none;
  2155. }
  2156. .table_wrap .legend {
  2157. display: flex;
  2158. }
  2159. .table_wrap .legend .legend-text {
  2160. display: flex;
  2161. }
  2162. .table_wrap .legend .legend-item {
  2163. margin-right: 20px;
  2164. }
  2165. </style>