<template>
    <div>
        <n-button @click="showImportModal">曲线生成</n-button>
    </div>
</template>
<script setup>
import {TimeDate} from '@/plugin/timeFun.js'
import { useMessage } from 'naive-ui';
const message = useMessage();
const props = defineProps({
    queryObj: {
        type: Object,
        default: () => ({}),
    },
    pickleveTime: {
        type: Array,
        default: () => ([])
    },
    checkData: {
        type: Array,
        default: () => ([])
    },
})
const showImportModal = () => {
    console.log(props.queryObj)
    console.log(props.pickleveTime)

    console.log(props.classList)

    console.log(props.checkData)
    // return
    if(props.checkData==null){
        message.error('请选择需要生成的设备')
        return
    }else if(props.checkData.length!=1){
        message.error('请选择一项进行曲线生成')
        return
    }else if(props.pickleveTime==null){
        message.error('请选择曲线生成时间')
        return
    }else{
        let a_time = TimeDate(props.pickleveTime[0])
        let b_time = TimeDate(props.pickleveTime[1])
        let T_task_id = props.queryObj.T_task_id
        let T_sn = props.checkData[0].T_sn
        let T_id = props.checkData[0].T_id
        window.open(`http://coldverifylocal.coldbaozhida.com/CurveEditing/index.html?a_time=${a_time}&b_time=${b_time}&T_task_id=${T_task_id}&T_sn=${T_sn}&T_id=${T_id}`, '_blank')
    }
}
</script>
<style></style>