<template>
    <div class="default-main">
        <el-tabs type="border-card" v-model="activeName">
            <el-tab-pane label="评估用户维护" name="1"><User v-if="activeName == '1'" /></el-tab-pane>
            <el-tab-pane label="用户二级评估" name="2"><Assess ref="AssessRef" v-if="activeName == '2'" /></el-tab-pane>
            <el-tab-pane label="参数字典维护" name="3"><Dictionary v-if="activeName == '3'" /></el-tab-pane>
        </el-tabs>
    </div>
</template>
<script setup lang="ts">
import { ref, reactive, watch } from 'vue'
import User from '@/views/pqs/runManage/assessment/components/uese/index.vue'
import Assess from '@/views/pqs/runManage/assessment/components/assess/index.vue'
import Dictionary from '@/views/pqs/runManage/assessment/components/dictionary/index.vue'
import { useRoute } from 'vue-router'
const route = useRoute()
defineOptions({
    name: 'runManage/assessment'
})
const AssessRef = ref()
const activeName = ref('1')
watch(
    () => route.query.t,
    async (newValue, oldValue) => {
        if (route.fullPath.includes('runManage/assessment')) {
            let type = (route.query.type as string) || 'null'
            if (type == 'null') {
            } else if (type == '2') {
                activeName.value = '2'
                setTimeout(() => {
                    AssessRef.value.setId((route.query.secondAssessmentId as string) || '')
                }, 500)
            }
        }
    },
    { deep: true, immediate: true }
)
</script>
<style lang="scss" scoped></style>
