<template>
  <div class="device-list-container" v-if="isShow">
    
    <el-dropdown @command="handleCommand">
      <el-button link type='primary' class='table-operate'>
        <div class='table-operate-text'>更多...</div>
      </el-button>
      <!-- <span class="el-dropdown-link">
        更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
      </span> -->
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item command="高精度设备-PQV520-2">高精度设备-PQV520-2</el-dropdown-item>
          <el-dropdown-item command="高精度设备-PQV520-3">高精度设备-PQV520-3</el-dropdown-item>
          <el-dropdown-item command="高精度设备-PQV520-4">高精度设备-PQV520-4</el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>

          <!-- 查看误差体系详细信息 -->
          <ErrorStandardDialog
        :visible='detail_dialogFormVisible'
        :formData='detail_dialogForm'
        :dialogTitle='detail_dialogTitle'
        @update:visible='detail_dialogFormVisible = $event'
    />
  </div>

</template>
  
  <script lang="ts" setup>
  import { ElMessage } from 'element-plus'
  import { ArrowDown } from '@element-plus/icons-vue'
  import ErrorStandardDialog from '@/views/machine/errorSystem/components/ErrorStandardDialog.vue' // 导入子组件
import type { ErrorSystem } from '@/api/error/interface'
  
  const detail_dialogFormVisible = ref(false)
  const detail_dialogTitle = ref('Q/GDW 10650.2-2021 误差体系')
  const detail_dialogForm = ref<ErrorSystem.Error_detail>({
  measured: '',//被测量
  deviceLevel: '',//检测装置级别
  measurementType: '',
  condition: '',//测量条件
  maxErrorValue: '',//最大误差
})


const props = defineProps<{
  isShow: boolean;
 }>();
 console.log(props.isShow,1111)
  const handleCommand = (command: string | number | object) => {
    detail_dialogTitle.value = command as string;
    detail_dialogFormVisible.value = true // 显示对话框
  }
  </script>
  <style scoped>
  .example-showcase .el-dropdown-link {
    cursor: pointer;
    color: var(--el-button-text-color);
    display: flex;
    align-items: center;
  }
  </style>