<template>
  <Dialog
    v-model="visible"
    diaTitle="指标详情"
    :width="'80%'"
    :height="'80%'"
    :zIndex="100"
    @close="handleCloseFun"
    show-footer
  >

    <div class="performance-page">
      <taskPerformance ref="taskPerformanceRef" :task-info="currentNodeInfo" :run-info="currentNodeInfo" :param-type="currentNodeInfo?.nodeType"></taskPerformance>
    </div>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="handleCloseFun">取消</el-button>
        <el-button type="primary" @click="createSuccessFun">确认</el-button>
      </span>
    </template>
  </Dialog>
</template>

<script setup lang="ts">
import { ref, defineProps, defineEmits } from 'vue';
import taskPerformance from '@/components/taskDetail/taskPerformance.vue';
import Dialog from '@/components/common/dialog/index.vue';

const props = defineProps({
  currentNodeInfo: {
    type: Object,
    default: () => {},
  },
});

const emits = defineEmits(['close']);

const visible = ref(true);
const taskPerformanceRef = ref();

const handleCloseFun = () => {
  emits('close');
};

const createSuccessFun = async () => {
  console.log(props.currentNodeInfo);

  await taskPerformanceRef.value.saveFun();

  emits('close');

};

</script>

<style lang="scss" scoped>

.performance-page{
    width: 100%;
    height: 100%;
    min-height: 500px;
}
</style>
