export.html 11 KB

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