export2.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>测试报告</title>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. .resultReport {
  14. width: 727px;
  15. margin: 0 auto;
  16. position: relative;
  17. }
  18. .head {
  19. width: 727px;
  20. height: 88px;
  21. margin: 0 auto;
  22. }
  23. .head .title {
  24. width: 80%;
  25. line-height: 48px;
  26. font-size: 22px;
  27. font-family: PingFang SC;
  28. font-weight: bold;
  29. color: #000;
  30. text-align: center;
  31. margin: 0 auto;
  32. }
  33. .content {
  34. box-sizing: border-box;
  35. width: 730px;
  36. padding: 15px 30px 40px;
  37. background: #ffffff;
  38. margin: 0 auto;
  39. }
  40. .base_info {
  41. /*box-sizing: border-box;*/
  42. width: 100%;
  43. height: 30px;
  44. text-align: left;
  45. font-size: 14px;
  46. font-weight: bold;
  47. color: #000;
  48. border-bottom: 1px solid #8c939d;
  49. }
  50. .base_info p {
  51. width: 100%;
  52. height: 100%;
  53. line-height: 30px;
  54. text-align: left;
  55. /*padding-bottom: 5px;*/
  56. }
  57. .user_info {
  58. width: 100%;
  59. height: 30px;
  60. font-size: 14px;
  61. font-family: PingFang SC;
  62. /*font-weight: 500;*/
  63. color: #000;
  64. border-bottom: 1px solid #8c939d;
  65. display: flex;
  66. flex-direction: row;
  67. justify-content: flex-start;
  68. align-items: center;
  69. margin-top: 20px;
  70. }
  71. .user_info_item {
  72. text-align: left;
  73. /*padding-bottom: 5px;*/
  74. }
  75. .user_info_item_second {
  76. margin: 0 150px;
  77. }
  78. .user_info_item span:first-child{
  79. font-weight: bold;
  80. color: #000;
  81. margin-right: 10px;
  82. }
  83. .test_content {
  84. width: 100%;
  85. margin-top: 30px;
  86. }
  87. .test_result_first,.test_result_second {
  88. width: 100%;
  89. }
  90. .test_result_first_title,.test_result_second_title {
  91. width: 100%;
  92. height: 30px;
  93. text-align: left;
  94. font-size: 14px;
  95. font-weight: bold;
  96. color: #000;
  97. }
  98. .table_content {
  99. width: 100%;
  100. }
  101. .table_content table{
  102. width: 100%;
  103. border-left: 1px solid #000;
  104. border-top: 1px solid #000;
  105. margin: 0;
  106. padding: 0;
  107. border-spacing: unset;
  108. }
  109. .table_content table th {
  110. background: #e4e4e4;
  111. }
  112. .table_content table th,.table_content table td{
  113. border-right: 1px solid #000;
  114. border-bottom: 1px solid #000;
  115. width: 50%;
  116. line-height: 35px;
  117. text-align: left;
  118. font-size: 14px;
  119. }
  120. .table_content table tr td:first-child {
  121. font-weight: bold;
  122. }
  123. .desc_content {
  124. width: 100%;
  125. margin-top: 30px;
  126. }
  127. .desc_content_item {
  128. width: 100%;
  129. margin-bottom: 20px;
  130. }
  131. .desc_content_list {
  132. width: 100%;
  133. line-height: 22px;
  134. text-align: left;
  135. font-size: 14px;
  136. margin-bottom: 10px;
  137. }
  138. .desc_content_list span:first-child {
  139. font-weight: bold;
  140. }
  141. .pl {
  142. padding-left: 10px;
  143. }
  144. .mr {
  145. margin-right: 10px;
  146. }
  147. .footer {
  148. width: 100%;
  149. font-size: 14px;
  150. font-family: PingFang SC;
  151. box-sizing: border-box;
  152. padding: 0 30px;
  153. position: absolute;
  154. bottom: -150px;
  155. }
  156. .footer_info {
  157. width: 100%;
  158. display: flex;
  159. flex-direction: row;
  160. justify-content: flex-end;
  161. align-items: center;
  162. border-bottom: 1px solid #8c939d;
  163. padding: 10px 0;
  164. }
  165. .footer_info_title {
  166. font-weight: bold;
  167. }
  168. .footer_info_sign {
  169. width: 150px;
  170. height: 20px;
  171. margin: 0 20px 0 10px;
  172. border-bottom: 1px solid #000;
  173. }
  174. .footer_desc {
  175. text-align: center;
  176. margin-top: 10px;
  177. }
  178. </style>
  179. <!-- <script src="./js/echarts.js"></script>-->
  180. <script src="./js/vue@2"></script>
  181. <!-- 引入样式 -->
  182. <link rel="stylesheet" href="./css/index.css">
  183. <!-- 引入组件库 -->
  184. <script src="./js/index.js"></script>
  185. </head>
  186. <body>
  187. <div class="resultReport" id="app">
  188. <div class="head">
  189. <div class="title">测评报告</div>
  190. <div class="title">{{testResult.name}}</div>
  191. </div>
  192. <div class="content">
  193. <div class="base_info">
  194. <p>【基本信息】</p>
  195. </div>
  196. <div class="user_info">
  197. <div class="user_info_item user_info_item_first"><span>姓名:</span><span>{{testResult.userEntity.petName}}</span></div>
  198. <div class="user_info_item user_info_item_second"><span>性别:</span><span>{{testResult.userEntity.gender == 0 ? '男' : '女'}}</span></div>
  199. <div class="user_info_item user_info_item_third"><span>出生日期:</span><span>{{testResult.userEntity.birthday}}</span></div>
  200. </div>
  201. <div class="test_content">
  202. <div v-if="showTable" class="test_result_first">
  203. <p class="test_result_first_title">【测试结果】</p>
  204. <div class="table_content">
  205. <table>
  206. <tr>
  207. <th class="pl">项目</th>
  208. <th class="pl">结果</th>
  209. </tr>
  210. <tr v-for="(item ,index) in tableContext" :key="index">
  211. <td class="pl">{{ item.name }}</td>
  212. <td class="pl">{{ item.value[0] }}</td>
  213. </tr>
  214. </table>
  215. </div>
  216. </div>
  217. <div v-else class="test_result_second">
  218. <p class="test_result_second_title">【测试结果】</p>
  219. <div class="table_content">
  220. <table>
  221. <tr>
  222. <th class="pl">项目</th>
  223. <th class="pl">结果</th>
  224. </tr>
  225. <tr v-for="(item ,index) in result" :key="index">
  226. <td class="pl">{{ item.name }}</td>
  227. <td class="pl">{{ item.score }}</td>
  228. </tr>
  229. </table>
  230. </div>
  231. <div class="desc_content">
  232. <div class="desc_content_item" v-for="(item ,index) in result" :key="index">
  233. <div class="desc_content_list">
  234. <span class="desc_content_item_title">【维度名称】</span>
  235. <span class="desc_content_item_desc">{{ item.name }}</span>
  236. </div>
  237. <div class="desc_content_list">
  238. <span class="desc_content_item_title mr">得&ensp;&ensp;&ensp;&ensp;分:</span>
  239. <span class="desc_content_item_desc">{{ item.score }}</span>
  240. </div>
  241. <div v-if="item.symptom && item.symptom != '无'" class="desc_content_list">
  242. <span class="desc_content_item_title mr">症&ensp;&ensp;&ensp;&ensp;状:</span>
  243. <span class="desc_content_item_desc">{{ item.symptom }}</span>
  244. </div>
  245. <div v-if="item.improvementSuggestions && item.improvementSuggestions != '无'" class="desc_content_list">
  246. <span class="desc_content_item_title mr">维度说明:</span>
  247. <span class="desc_content_item_desc"> {{ item.improvementSuggestions }}</span>
  248. </div>
  249. <div v-if="item.nameExplain && item.nameExplain != '无'" class="desc_content_list">
  250. <span class="desc_content_item_title mr">维度解读:</span>
  251. <span class="desc_content_item_desc">{{ item.nameExplain }}</span>
  252. </div>
  253. <div v-if="item.suggestion && item.suggestion != '无'" class="desc_content_list">
  254. <span class="desc_content_item_title mr">建&ensp;&ensp;&ensp;&ensp;议:</span>
  255. <span class="desc_content_item_desc">{{ item.suggestion }}</span>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. <div class="footer">
  263. <div class="footer_info">
  264. <p class="footer_info_title">签名:</p>
  265. <p class="footer_info_sign"></p>
  266. <p class="footer_info_title">报告日期:</p>
  267. <p class="pl">{{testResult.reportTime}}</p>
  268. </div>
  269. <div class="footer_desc">(本报告仅供临床参考,不做诊断证明之用)</div>
  270. </div>
  271. </div>
  272. <!-- <script src="./js/vue@2"></script>-->
  273. <script>
  274. var app = new Vue({
  275. el: '#app',
  276. data() {
  277. return {
  278. id: "",
  279. userName: "",
  280. testDetail: ReplaceData,
  281. testResult: {},
  282. tableContext: [], //旧数据结构
  283. result: [], //新数据结构
  284. showTable: false, //显示旧数据还是新数据
  285. };
  286. },
  287. created() {
  288. this.getDetail();
  289. },
  290. computed: {
  291. },
  292. mounted() { },
  293. methods: {
  294. getDetail() {
  295. this.testResult = this.testDetail;
  296. console.log(this.testResult,'数据')
  297. this.tableContext = this.testResult?.tableContext ? this.testResult.tableContext : [];
  298. this.showTable = this.testResult?.tableContext ? true : false;
  299. this.result = this.testResult?.result ? this.testResult.result : [];
  300. },
  301. }
  302. })
  303. </script>
  304. </body>
  305. </html>