<template>
    <div>
        <el-card style="width: 80%; margin: auto; height: 600px">
            <div style="margin-top: 10px;">
                <div style=" display: inline-block; margin-left: 10px; margin-right: 10px; width: 8px; height: 30px; background: #2a7eec"></div>
                <b style="line-height: 30px; vertical-align: top">成绩查询</b>
                <el-divider></el-divider>
            </div>

            <div v-if="!haveScore">
                <el-image :src="noScore" style="width: 200px; height: 180px" alt="图片加载失败"/>
            </div>
            <div v-else style="width: 850px; margin: auto">
                <br/> <br/>
                <h1 style="text-align: center;color: #416af1; letter-spacing: 5px">
                    {{ todayYear }}年{{ form.examName }}考试成绩查询结果
                </h1>
                <br/><br/>

                <el-form :model="form" label-width="130px" style="margin: auto;">
                    <el-row :gutter="20">
                        <el-col :span="12">
                            <el-form-item label="姓名：">
                                <el-input v-model="form.studentName"></el-input>
                            </el-form-item>
                            <el-form-item label="学籍号：">
                                <el-input v-model="form.studentNumber"></el-input>
                            </el-form-item>
                            <el-form-item label="准考证号：">
                                <el-input v-model="form.examNumber"></el-input>
                            </el-form-item>
                            <el-form-item label="证件号：">
                                <el-input v-model="form.idCard"></el-input>
                            </el-form-item>
                            <el-form-item label="考试类别：">
                                <el-input v-model="form.examSort"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="考试项目：">
                                <el-input v-model="form.examProject"></el-input>
                            </el-form-item>
                            <el-form-item label="成绩：">
                                <el-input v-model="form.score"></el-input>
                            </el-form-item>
                            <el-form-item label="专业测试结果：">
                                <el-input v-model="form.examNumber"></el-input>
                            </el-form-item>
                            <el-form-item label="专业录取资格线：">
                                <el-input v-model="form.passScore"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>


                <!--            <el-button type="primary" @click="handleReturn">返 回</el-button>-->
            </div>
        </el-card>
    </div>
</template>

<script>
import {allInfo, scoreView} from '@/api/student';
import noScore from '@/assets/image/noScore.png';

export default {
    name: 'Score',
    props: ['PropTestId'],
    computed: {
        todayYear() {
            const time = new Date()
            return time.getFullYear()
        }
    },
    created() {
        this.studentId = this.$store.state.user.studentId
        this.getAllInfo()
    },
    data() {
        return {
            studentId: undefined,
            noScore: undefined,
            haveScore: undefined,
            form: [],
            isView: true,// 是否可查看
        }
    },
    methods: {
        getAllInfo() {
            allInfo(this.PropTestId, this.studentId).then(res => {
                if (res.node == 4) {
                    /** 允许查看成绩 */
                    this.form = res.data
                    this.haveScore = true
                } else {
                    this.haveScore = false
                }
            })
        },
        getScore() {
            scoreView().then(res => {

            })
        },
        handleReturn() {
            this.$router.push({
                path: '/entry'
            })
        }
    }
}
</script>

<style scoped lang="less">
* {
  margin: 0;
  padding: 0;
}

.el-divider--horizontal {
  margin: 15px 0;
}

.el-form-item {
  margin: 10px;
}


</style>