<template>

    <TableHeader :showReset="false">
        <!-- <template v-slot:select>
            <el-form-item label="用户状态">
                <el-select v-model="tableStore.table.params.searchState" placeholder="选择用户状态">
                    <el-option v-for="(item, index) in userState" :label="item.label" :key="index"
                        :value="item.value"></el-option>
                </el-select>
            </el-form-item>
           
        </template>
-->
    </TableHeader>
    <Table ref="tableRef" />

</template>
<script setup lang='ts'>
import { ref, provide, onMounted } from 'vue'
import { getEventByItem } from '@/api/cs-device-boot/planData'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
const props = defineProps({
    activeName: String
})
const tableStore = new TableStore({
    url: '/cs-harmonic-boot/data/getEventByItem',
    method: 'POST',
    paramsPOST: true,
    showPage: false,
    column: [
        { title: '项目名称', field: 'projectName', minWidth: '130' },
        { title: '测试项名称', field: 'itemName', minWidth: '130' },
        { title: '装置名称', field: 'devName', minWidth: '130' },
        { title: '发生时刻', field: 'startTime', minWidth: '130' },
        { title: '持续时间', field: 'persistTime', minWidth: '130' },
        { title: '事件描述', field: 'showName', minWidth: '130' },
        { title: '暂降幅值', field: 'featureAmplitude', minWidth: '130' },
        { title: '相别', field: 'phaseType', minWidth: '130' },
     

        {
            title: '操作',
            width: '180',
            render: 'buttons',
            fixed: 'right',
            buttons: [
                {
                    name: 'edit',
                    title: '编辑',
                    type: 'primary',
                    icon: 'el-icon-EditPen',
                    render: 'basicButton',
                    disabled: row => {
                        return row.state !== 1
                    },
                    click: row => {

                    }
                },

            ]
        }
    ],

    loadCallback: () => {

    }
})
provide('tableStore', tableStore)
const init = () => {
    tableStore.table.params.id = props.activeName
    // getEventByItem({ id: props.activeName }).then(res => {

    // })
    tableStore.index()
}
onMounted(() => {

})
defineExpose({ init })

</script>
<style lang="scss" scoped></style>
