123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>测试报告</title>
- <style>
- * {
- margin: 0;
- padding: 0;
- }
- .resultReport {
- width: 727px;
- margin: 0 auto;
- position: relative;
- }
- .head {
- width: 727px;
- height: 88px;
- margin: 0 auto;
- }
- .head .title {
- width: 80%;
- line-height: 48px;
- font-size: 22px;
- font-family: PingFang SC;
- font-weight: bold;
- color: #000;
- text-align: center;
- margin: 0 auto;
- }
- .content {
- box-sizing: border-box;
- width: 730px;
- padding: 15px 30px 40px;
- background: #ffffff;
- margin: 0 auto;
- }
- .base_info {
- /*box-sizing: border-box;*/
- width: 100%;
- height: 30px;
- text-align: left;
- font-size: 14px;
- font-weight: bold;
- color: #000;
- border-bottom: 1px solid #8c939d;
- }
- .base_info p {
- width: 100%;
- height: 100%;
- line-height: 30px;
- text-align: left;
- /*padding-bottom: 5px;*/
- }
- .user_info {
- width: 100%;
- height: 30px;
- font-size: 14px;
- font-family: PingFang SC;
- /*font-weight: 500;*/
- color: #000;
- border-bottom: 1px solid #8c939d;
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- align-items: center;
- margin-top: 20px;
- }
- .user_info_item {
- text-align: left;
- /*padding-bottom: 5px;*/
- }
- .user_info_item_second {
- margin: 0 150px;
- }
- .user_info_item span:first-child{
- font-weight: bold;
- color: #000;
- margin-right: 10px;
- }
- .test_content {
- width: 100%;
- margin-top: 30px;
- }
- .test_result_first,.test_result_second {
- width: 100%;
- }
- .test_result_first_title,.test_result_second_title {
- width: 100%;
- height: 30px;
- text-align: left;
- font-size: 14px;
- font-weight: bold;
- color: #000;
- }
- .table_content {
- width: 100%;
- }
- .table_content table{
- width: 100%;
- border-left: 1px solid #000;
- border-top: 1px solid #000;
- margin: 0;
- padding: 0;
- border-spacing: unset;
- }
- .table_content table th {
- background: #e4e4e4;
- }
- .table_content table th,.table_content table td{
- border-right: 1px solid #000;
- border-bottom: 1px solid #000;
- width: 50%;
- line-height: 35px;
- text-align: left;
- font-size: 14px;
- }
- .table_content table tr td:first-child {
- font-weight: bold;
- }
- .desc_content {
- width: 100%;
- margin-top: 30px;
- }
- .desc_content_item {
- width: 100%;
- margin-bottom: 20px;
- }
- .desc_content_list {
- width: 100%;
- line-height: 22px;
- text-align: left;
- font-size: 14px;
- margin-bottom: 10px;
- }
- .desc_content_list span:first-child {
- font-weight: bold;
- }
- .pl {
- padding-left: 10px;
- }
- .mr {
- margin-right: 10px;
- }
- .footer {
- width: 100%;
- font-size: 14px;
- font-family: PingFang SC;
- box-sizing: border-box;
- padding: 0 30px;
- position: absolute;
- bottom: -150px;
- }
- .footer_info {
- width: 100%;
- display: flex;
- flex-direction: row;
- justify-content: flex-end;
- align-items: center;
- border-bottom: 1px solid #8c939d;
- padding: 10px 0;
- }
- .footer_info_title {
- font-weight: bold;
- }
- .footer_info_sign {
- width: 150px;
- height: 20px;
- margin: 0 20px 0 10px;
- border-bottom: 1px solid #000;
- }
- .footer_desc {
- text-align: center;
- margin-top: 10px;
- }
- </style>
- <!-- <script src="./js/echarts.js"></script>-->
- <script src="./js/vue@2"></script>
- <!-- 引入样式 -->
- <link rel="stylesheet" href="./css/index.css">
- <!-- 引入组件库 -->
- <script src="./js/index.js"></script>
- </head>
- <body>
- <div class="resultReport" id="app">
- <div class="head">
- <div class="title">测评报告</div>
- <div class="title">{{testResult.name}}</div>
- </div>
- <div class="content">
- <div class="base_info">
- <p>【基本信息】</p>
- </div>
- <div class="user_info">
- <div class="user_info_item user_info_item_first"><span>姓名:</span><span>{{testResult.userEntity.petName}}</span></div>
- <div class="user_info_item user_info_item_second"><span>性别:</span><span>{{testResult.userEntity.gender == 0 ? '男' : '女'}}</span></div>
- <div class="user_info_item user_info_item_third"><span>出生日期:</span><span>{{testResult.userEntity.birthday}}</span></div>
- </div>
- <div class="test_content">
- <div v-if="showTable" class="test_result_first">
- <p class="test_result_first_title">【测试结果】</p>
- <div class="table_content">
- <table>
- <tr>
- <th class="pl">项目</th>
- <th class="pl">结果</th>
- </tr>
- <tr v-for="(item ,index) in tableContext" :key="index">
- <td class="pl">{{ item.name }}</td>
- <td class="pl">{{ item.value[0] }}</td>
- </tr>
- </table>
- </div>
- </div>
- <div v-else class="test_result_second">
- <p class="test_result_second_title">【测试结果】</p>
- <div class="table_content">
- <table>
- <tr>
- <th class="pl">项目</th>
- <th class="pl">结果</th>
- </tr>
- <tr v-for="(item ,index) in result" :key="index">
- <td class="pl">{{ item.name }}</td>
- <td class="pl">{{ item.score }}</td>
- </tr>
- </table>
- </div>
- <div class="desc_content">
- <div class="desc_content_item" v-for="(item ,index) in result" :key="index">
- <div class="desc_content_list">
- <span class="desc_content_item_title">【维度名称】</span>
- <span class="desc_content_item_desc">{{ item.name }}</span>
- </div>
- <div class="desc_content_list">
- <span class="desc_content_item_title mr">得    分:</span>
- <span class="desc_content_item_desc">{{ item.score }}</span>
- </div>
- <div v-if="item.symptom && item.symptom != '无'" class="desc_content_list">
- <span class="desc_content_item_title mr">症    状:</span>
- <span class="desc_content_item_desc">{{ item.symptom }}</span>
- </div>
- <div v-if="item.improvementSuggestions && item.improvementSuggestions != '无'" class="desc_content_list">
- <span class="desc_content_item_title mr">维度说明:</span>
- <span class="desc_content_item_desc"> {{ item.improvementSuggestions }}</span>
- </div>
- <div v-if="item.nameExplain && item.nameExplain != '无'" class="desc_content_list">
- <span class="desc_content_item_title mr">维度解读:</span>
- <span class="desc_content_item_desc">{{ item.nameExplain }}</span>
- </div>
- <div v-if="item.suggestion && item.suggestion != '无'" class="desc_content_list">
- <span class="desc_content_item_title mr">建    议:</span>
- <span class="desc_content_item_desc">{{ item.suggestion }}</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="footer">
- <div class="footer_info">
- <p class="footer_info_title">签名:</p>
- <p class="footer_info_sign"></p>
- <p class="footer_info_title">报告日期:</p>
- <p class="pl">{{testResult.reportTime}}</p>
- </div>
- <div class="footer_desc">(本报告仅供临床参考,不做诊断证明之用)</div>
- </div>
- </div>
- <!-- <script src="./js/vue@2"></script>-->
- <script>
- var app = new Vue({
- el: '#app',
- data() {
- return {
- id: "",
- userName: "",
- testDetail: ReplaceData,
- testResult: {},
- tableContext: [], //旧数据结构
- result: [], //新数据结构
- showTable: false, //显示旧数据还是新数据
- };
- },
- created() {
- this.getDetail();
- },
- computed: {
- },
- mounted() { },
- methods: {
- getDetail() {
- this.testResult = this.testDetail;
- console.log(this.testResult,'数据')
- this.tableContext = this.testResult?.tableContext ? this.testResult.tableContext : [];
- this.showTable = this.testResult?.tableContext ? true : false;
- this.result = this.testResult?.result ? this.testResult.result : [];
- },
- }
- })
- </script>
- </body>
- </html>
|