<template>
    <div class="default-main">

        <TableHeader datePicker area showExport showCustomColumn>
            <template #select>
                <!-- <el-form-item label="统计类型:">
                    <el-select v-model="tableStore.table.params.statisticalType" placeholder="请选择统计类型" value-key="id">
                        <el-option v-for="item in classificationData" :key="item.id" :label="item.name" :value="item">
                        </el-option>
                    </el-select>
                </el-form-item> -->
                <el-form-item label="电压等级">
                    <el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
                        placeholder="请选择电压等级" value-key="id">
                        <el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name" :value="item">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="终端厂家">
                    <el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
                        clearable placeholder="请选择终端厂家" value-key="id">
                        <el-option v-for="item in terminaloption" :key="item.id" :label="item.name" :value="item">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="干扰源类型">
                    <el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
                        placeholder="请选择干扰源类型" value-key="id">
                        <el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
                        </el-option>
                    </el-select>

                </el-form-item>
                <el-form-item label="筛选数据">
                    <el-input v-model="tableStore.table.params.searchValue" clearable style="width: 240px;"
                        placeholder="请输入变电站、监测点、监测对象" />
                </el-form-item>
            </template>

        </TableHeader>
        <Table ref="tableRef" isGroup />



    </div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { useDictData } from '@/stores/dictData'
import TableHeader from '@/components/table/header/index.vue'
const dictData = useDictData()
defineOptions({
    name: 'harmonic-boot/detailedAnalysis/details'
})
const view = ref(true)
const classificationData = dictData.getBasicData('Statistical_Type', ["Report_Type"])
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
const interfereoption = dictData.getBasicData('Interference_Source')


const tableStore = new TableStore({
    url: '/harmonic-boot/detailAnalysis/lineOverLimit',
    method: 'POST',

    column: [
        { field: 'index', title: '序号', width: '80', formatter: (row: any) => { return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 } },
        { field: 'provinceCompany', title: '地级市', minWidth: "150px", },
      /*  { field: 'cityCompany', title: '供电公司', minWidth: "150px", },*/
        { field: 'subName', title: '变电站', minWidth: "150px", },
        { field: 'lineObjectName', title: '监测点对象名称', minWidth: "180px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
        { field: 'lineName', title: '监测点名称', minWidth: "150px", },
        { field: 'lineScale', title: '电压等级', minWidth: "120px", },
        { field: 'loadType', title: '干扰源类型', minWidth: "150px", },
        { field: 'overDay', title: '超标天数', minWidth: "80px", },
        { field: 'freqOverDay', title: '频率偏差', minWidth: "100px", },
        { field: 'volDevOverDay', title: '电压偏差', minWidth: "100px", },
        { field: 'volDisOverDay', title: '电压总畸变率', minWidth: "100px", },
        { field: 'volContainOverDay', title: '谐波电压含有率', minWidth: "100px", },
        { field: 'harmVolOverDay', title: '谐波电压', minWidth: "100px", },
        { field: 'harmCurOverDay', title: '谐波电流', minWidth: "100px", },
        {
            title: '各次谐波电压含有率超标天数',
            children: [
                { field: 'overVolThreeTimes', title: '3次', minWidth: "70px", },
                { field: 'overVolFiveTimes', title: '5次', minWidth: "70px", },
                { field: 'overVolSevenTimes', title: '7次', minWidth: "70px", },
                { field: 'overVolElevenTimes', title: '11次', minWidth: "70px", },
                { field: 'overVolThirteenTimes', title: '13次', minWidth: "70px", },
                { field: 'overVolTwentyThreeTimes', title: '23次', minWidth: "70px", },
                { field: 'overVolTwentyFiveTimes', title: '25次', minWidth: "70px", },
                { field: 'overVolOtherTimes', title: '其他次', minWidth: "70px", },

            ],
        },
        {
            title: '各次谐波电流幅值超标天数',
            children: [
                { field: 'overCurThreeTimes', title: '3次', minWidth: "70px", },
                { field: 'overCurFiveTimes', title: '5次', minWidth: "70px", },
                { field: 'overCurSevenTimes', title: '7次', minWidth: "70px", },
                { field: 'overCurElevenTimes', title: '11次', minWidth: "70px", },
                { field: 'overCurThirteenTimes', title: '13次', minWidth: "70px", },
                { field: 'overCurTwentyThreeTimes', title: '23次', minWidth: "70px", },
                { field: 'overCurTwentyFiveTimes', title: '25次', minWidth: "70px", },
                { field: 'overCurOtherTimes', title: '其他次', minWidth: "70px", },

            ],
        },
        { field: 'intHarmOverDay', title: '间谐波电压含有率', minWidth: "100px", },
        { field: 'threeUnbalance', title: '三相电压不平衡度', minWidth: "100px", },
        { field: 'negativeOverDay', title: '负序电流', minWidth: "100px", },
        { field: 'flickerOverDay', title: '闪变', minWidth: "100px", },
        { field: 'monitorNumber', title: '监测点编号', minWidth: "100px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },





    ],
    beforeSearchFun: () => {
    },

})
tableStore.table.params.statisticalType = classificationData[0]
tableStore.table.params.serverName = "harmonic-boot"
tableStore.table.params.powerFlag = 2
tableStore.table.params.monitorFlag = 2
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
tableStore.table.params.searchValue = ''
const wp = ref({})

provide('tableStore', tableStore)
onMounted(() => {
    tableStore.index()
})





</script>
