<script lang="ts" setup name="qualityFile">
import CNASfile from './components/CNASfile.vue' // casn文件
import homeworkFile from './components/homeworkFile.vue' // 作业文件
import statute from './components/statute.vue'// 计量法规
import programFile from './components/programFile.vue' // 程序文件
import qualityManual from './components/qualityManual.vue'// 质量手册
import technicalCapability from './components/technicalCapability.vue' // 技术能力
export interface menuType {
  name: string
  comp: any
}
const menu = shallowRef<menuType[]>([
  { name: '计量法规', comp: statute },
  { name: '质量手册', comp: qualityManual },
  { name: '程序文件', comp: programFile },
  { name: '作业文件', comp: homeworkFile },
  { name: '技术能力', comp: technicalCapability },
  { name: 'CNAS文件', comp: CNASfile },
])
const current = ref('计量法规')
const currentComp = shallowRef(statute)
watch(current, (newValue) => {
  currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp
})
</script>

<template>
  <div class="container">
    <div class="btns">
      <!-- 三级菜单 -->
      <el-radio-group v-model="current">
        <el-radio-button v-for="item in menu" :key="item.name" :label="item.name">
          {{ item.name }}
        </el-radio-button>
      </el-radio-group>
    </div>
    <!-- 展示区域 -->
    <component :is="currentComp" />
  </div>
</template>

<style lang="scss" scoped>
.container {
  position: relative;

  .btns {
    position: fixed;
    top: 67px;
    right: 15px;
    z-index: 999;
  }
}
</style>
