<!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;
        }
        .head {
            width: 727px;
            height: 88px;
            margin: 0 auto;
        }
        .head .title {
            width: 251px;
            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%;
            margin: 50px 0 20px;
            font-size: 14px;
            font-family: PingFang SC;
            box-sizing: border-box;
            padding: 0 30px;
        }
        .footer_info {
            width: 100%;
            border-bottom: 1px solid #8c939d;
            padding: 10px 0 50px;
            text-align: right;
        }
        .footer_info_title {
            font-weight: bold;
        }
        .footer_info_title span {
            color: #666666;
            font-weight: 500;
            margin: 0 10px 0 0;
        }
        .footer_info_sign {
            margin-top: 16px;
            font-size: 14px;
            font-weight: bold;
            color: #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.subject.type == '0' ? '量表评估报告单' : '认知评估报告单'}}</div>
        </div>
        <div class="content">
            <div class="base_info">
                <p><span>【基本信息】</span><span style="margin-left: 10px;">{{testResult.name}}</span></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">得&ensp;&ensp;&ensp;&ensp;分:</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">症&ensp;&ensp;&ensp;&ensp;状:</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">建&ensp;&ensp;&ensp;&ensp;议:</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">
                    测试者:<span>{{testResult.userEntity.petName}}</span>日期:<span>{{testResult.reportTime}}</span></p>
                <p class="footer_info_sign">儿童行为发育评定室</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() {
                    debugger
                    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>