graphics.vue 70 KB

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