<template>
    <div>
        <TableHeader datePicker ref="TableHeaderRef" >
            <template v-slot:select>
                <el-form-item label="超标指标">
                    <el-select
                        v-model="tableStore.table.params.targetId"
                        clearable
                        filterable
                        collapse-tags
                        collapse-tags-tooltip
                        placeholder="请选择超标指标"
                    >
                        <el-option v-for="item in exceeded" :key="item.id" :label="item.name" :value="item.id" />
                    </el-select>
                </el-form-item>
            </template>
        </TableHeader>
        <Table ref="tableRef" />
    </div>
</template>
<script setup lang="ts">
import { nextTick, onMounted, reactive, ref } from 'vue'
import DatePicker from '@/components/form/datePicker/index.vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { useMonitoringPoint } from '@/stores/monitoringPoint'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import TableStore from '@/utils/tableStore'
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const exceeded = dictData.getBasicData('Steady_Statis')
const monitoringPoint = useMonitoringPoint()

const tableStore = new TableStore({
    url: '/supervision-boot/onlineMonitor/overLimitDetail',
    publicHeight: 80,
    isWebPaging: true,
    method: 'POST',
    filename: '监测点台账',
    column: [
        {
            title: '序号',
            width: 70,
            formatter: (row: any) => {
                return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
            }
        },

        {
            field: 'time',
            title: '日期',
            width: '140px'
        },
        {
            field: 'overLimitInfo',
            title: '越限详情'
        }
    ],

    beforeSearchFun: () => {
        tableStore.table.params.lineId = monitoringPoint.state.lineId
    }
})
tableStore.table.params.targetId = exceeded.filter(item => item.code == 'Total_Indicator')[0].id
    ? exceeded.filter(item => item.code == 'Total_Indicator')[0].id
    : ''
onMounted(() => {
    tableStore.index()
})

provide('tableStore', tableStore)
</script>
<style></style>
