<template>
    <el-dialog draggable v-model="dialogVisible" :title="title" width="800px" :before-close="handleClose">
        <div style="height: 45vh">
            <vxe-table height="auto" v-bind="defaultAttribute" :data="List">
                <vxe-column field="time" title="日期" width="250px"></vxe-column>
                <vxe-column field="overLimitInfo" title="越限详情"></vxe-column>
            </vxe-table>
        </div>
    </el-dialog>
</template>
<script setup lang="ts">
import { ref, defineEmits } from 'vue'
import { useDictData } from '@/stores/dictData'
import { ElMessage } from 'element-plus'
import { overLimitDetail } from '@/api/process-boot/electricitymanagement'
import { defaultAttribute } from '@/components/table/defaultAttribute'
const emits = defineEmits(['onSubmit'])
const dictData = useDictData()
const dialogVisible = ref(false)
const title: any = ref('')
const List: any = ref([])

const open = (row: any) => {
    dialogVisible.value = true
    title.value = row.text
    overLimitDetail({
        lineId: row.row.lineId,
        targetId: row.row.targetType,
        searchBeginTime: row.list.searchBeginTime,
        searchEndTime: row.list.searchEndTime
    }).then(res => {
        List.value = res.data
    })
}

const handleClose = () => {
    dialogVisible.value = false
}

defineExpose({ open })
</script>
<style lang="scss" scoped></style>
