<template>
    <el-tabs v-model="tabActiveName" @tab-click="handleTabClick">
        <el-tab-pane label="转归" name="lapseto"></el-tab-pane>
        <el-tab-pane label="体重" name="weight"></el-tab-pane>
        <el-tab-pane label="血压" name="bloodpressure"></el-tab-pane>
        <el-tab-pane label="指标控制" name="indicators"></el-tab-pane>
        <el-tab-pane label="口服药" name="oralmedicine"></el-tab-pane>
    </el-tabs>
</template>
<script>
export default {
    props:{
        activeName:{
            type:String,
            default: 'total'
        },
        patientID:{
            type:Number,
            default:0,
        },
    },
    data(){
        return{
            tabActiveName:'lapseto',
        }
    }, 
    methods:{
        handleTabClick(tab, event) {
            if(typeof(this.patientID) == "undefined" || !this.patientID || this.patientID <=0) {
                this.$message.error('参数错误，无法请求');
                return false;
            }
            this.$router.push({ path: "/qcd/pa/person/"+this.tabActiveName +'?id='+this.patientID });
        }
    },
    created(){
        this.tabActiveName = this.activeName
    },
}
</script>

