<template>
    <div class="wrapper">
        <LHeader :text="text"></LHeader>
        <div class="section">
            <p>该次测评风险值为：</p>
                <div>
                    <p style="font-weight: bold;font-size: 20px;">{{ score }}</p>
                </div>
            <p>本次评估结果评定为：{{ level }}</p>
            <van-divider></van-divider>
            <van-field readonly label="所属模型：" placeholder="ls风险矩阵评估模型" />
            <van-field readonly label="风险发生可能性:" placeholder="一般情况不会发生" />
            <van-field readonly label="后果严重程度" placeholder="轻微影响" />
            <van-field readonly label="判定标准：" placeholder="见下图" />
        </div>
        <div style="display: flex;margin: 10px 16px 0px; padding-bottom: 16px">
            <van-button block type="info" @click="sureClose">确认本次测评结果</van-button>
            <van-button block plain type="info" @click="resetClose">取消</van-button>
        </div>

    </div>
</template>

<script>
import { getFun, postFun } from "@/service/table.js";
import LHeader from "@/components/header.vue";
    export default {
        name:'resultPage',
        components:{
            LHeader
        },
        data(){
            return{
                text:'测评结果',
                score:0,
                level:''
            }
        },
        created(){
            this.getResult()
        },
        methods:{
            getResult(){
                getFun(`/risk/plan/matrix/score/${this.$route.params.score}`).then(res=>{
                    this.level = res.data.level
                    this.score  = res.data.max
                })
            },
            resetClose(){
                this.$router.push({
                    name:'addInherent',
                    params:{
                        level:''
                    }
                })
            },
            sureClose(){
                this.$router.push({
                    name:'addInherent',
                    params:{
                        level:this.level
                    }
                })
            }
        }
    }
</script>

<style lang="less" scoped>
.wrapper{
    width: 100%;
    height: 100%;
    .section{
        width: 100%;
        height: 100%;
        padding: 10px;
        box-sizing: border-box;
        background: #fff;
        font-size: 14px;
    }
}
</style>