babyGraphics.vue 72 KB

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