<template>
    <div>
        <el-row>
            <el-form ref="form">
                <el-col :span="6">
                    <el-form-item label-width="80px" label="数据类型">
                        <el-select style="width: 180px" v-model="valueType" placeholder="请选择">
                            <el-option
                                v-for="item in [
                                    { value: 'MAX', label: '最大值' },
                                    { value: 'MIN', label: '最小值' },
                                    { value: 'AVG', label: '平均值' },
                                    { value: 'CP95', label: 'CP95值' }
                                ]"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            ></el-option>
                        </el-select>
                        <el-button type="primary" size="mini" @click="initData">获取</el-button>
                    </el-form-item>
                </el-col>

                <el-col :span="14">
                    <el-form-item label-width="120px" label="数据刷新时间">
                        <el-tag>{{ timeId }}</el-tag>
                    </el-form-item>
                </el-col>

                <el-col :span="4" style="text-align: right">
                    <el-button type="primary" size="small" class="flag" icon="el-icon-close" @click="$emit('close')">
                        返回
                    </el-button>
                </el-col>
            </el-form>
        </el-row>

        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="基本电能质量数据" name="0">
                <el-table
                    :data="energyQualityData"
                    border
                    highlight-current-row
                    :height="rowvh"
                    header-cell-class-name="table_header"
                    stripe
                    style="width: 100%"
                >
                    <el-table-column prop="name" align="center" label="数据名称"></el-table-column>
                    <el-table-column prop="A" align="center" label="A/AB/0"></el-table-column>
                    <el-table-column prop="B" align="center" label="B/BC/+"></el-table-column>
                    <el-table-column prop="C" align="center" label="C/CA/-"></el-table-column>
                    <el-table-column prop="D" align="center" label="Total"></el-table-column>
                </el-table>
                <!-- <div :style="'height:' + rowvh + '; overflow-y:auto'">
                    <table id="areaTable">
                        <thead>
                            <tr>
                                <th class="table-middle">数据名称</th>
                                <th class="table-middle">A/AB/0</th>
                                <th class="table-middle">B/BC/+</th>
                                <th class="table-middle">C/CA/-</th>
                                <th class="table-middle">Total</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>相电压总有效值(V)</td>
                                <td>{{ data.PhV_phsA }}</td>
                                <td>{{ data.PhV_phsB }}</td>
                                <td>{{ data.PhV_phsC }}</td>
                                <td>-</td>
                            </tr>

                            <tr>
                                <td>电流总有效值(A)</td>
                                <td>{{ data.A_phsA }}</td>
                                <td>{{ data.A_phsB }}</td>
                                <td>{{ data.A_phsC }}</td>
                                <td>-</td>
                            </tr>

                            <tr>
                                <td>线电压总有效值(V)</td>
                                <td>{{ data.PPV_phsAB }}</td>
                                <td>{{ data.PPV_phsBC }}</td>
                                <td>{{ data.PPV_phsCA }}</td>
                                <td>-</td>
                            </tr>

                            <tr>
                                <td>相电压偏差(%)</td>
                                <td>{{ data.PhVDev_phsA }}</td>
                                <td>{{ data.PhVDev_phsB }}</td>
                                <td>{{ data.PhVDev_phsC }}</td>
                                <td>-</td>
                            </tr>

                            <tr>
                                <td>线电压偏差(%)</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                            </tr>

                            <tr>
                                <td>频率(Hz)</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>{{ data.Freq }}</td>
                            </tr>

                            <tr>
                                <td>频率偏差(Hz)</td>
                                <td>-</td>
                                <td>-</td>
                                <td>-</td>
                                <td>{{ data.FreqDev }}</td>
                            </tr>

                            <tr>
                                <td>电压序分量(V)</td>
                                <td>{{ data.SeqV_C0 }}</td>
                                <td>{{ data.SeqV_C1 }}</td>
                                <td>{{ data.SeqV_C2 }}</td>
                                <td>-</td>
                            </tr>

                            <tr>
                                <td>电流序分量(A)</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                            </tr>

                            <tr>
                                <td>总有功功率(W)</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>{{ data.TotW }}</td>
                            </tr>

                            <tr>
                                <td>总无功功率(Var)</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>{{ data.TotVar }}</td>
                            </tr>

                            <tr>
                                <td>总视在功率(VA)</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>{{ data.TotVA }}</td>
                            </tr>

                            <tr>
                                <td>视在功率因数</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>{{ data.TotPF }}</td>
                            </tr>

                            <tr>
                                <td>位移功率因数</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                            </tr>

                            <tr>
                                <td>电压波动</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                            </tr>

                            <tr>
                                <td>短时闪变</td>
                                <td>{{ data.PstPhV_phsA }}</td>
                                <td>{{ data.PstPhV_phsB }}</td>
                                <td>{{ data.PstPhV_phsC }}</td>
                                <td>-</td>
                            </tr>

                            <tr>
                                <td>长时闪变</td>
                                <td>{{ data.PltPhV_phsA }}</td>
                                <td>{{ data.PltPhV_phsB }}</td>
                                <td>{{ data.PltPhV_phsC }}</td>
                                <td>-</td>
                            </tr>

                            <tr>
                                <td>电压谐波畸变率(%)</td>
                                <td>{{ data.ThdPhV_phsA }}</td>
                                <td>{{ data.ThdPhV_phsB }}</td>
                                <td>{{ data.ThdPhV_phsC }}</td>
                                <td>-</td>
                            </tr>

                            <tr>
                                <td>电流谐波畸变率(%)</td>
                                <td>/</td>
                                <td>/</td>
                                <td>/</td>
                                <td>-</td>
                            </tr>
                        </tbody>
                    </table>
                </div> -->
            </el-tab-pane>
            <el-tab-pane label="谐波电压含有率" name="1">
              <el-table
                    :data="containmentRate"
                    border
                    highlight-current-row
                    :height="rowvh"
                    header-cell-class-name="table_header"
                    stripe
                    style="width: 100%"
                >
                    <el-table-column prop="name" align="center" label="谐波次数"></el-table-column>
                    <el-table-column prop="A" align="center" label="A/AB"></el-table-column>
                    <el-table-column prop="B" align="center" label="B/BC"></el-table-column>
                    <el-table-column prop="C" align="center" label="C/CA"></el-table-column>

                </el-table>
                <!-- <div :style="'height:' + rowvh + '; overflow-y:auto'">
                    <table :style="'height:' + rowvh">
                        <thead>
                            <tr>
                                <th>谐波次数</th>
                                <th>A/AB</th>
                                <th>B/BC</th>
                                <th>C/CA</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>基波 (%)</td>
                                <td>100.000</td>
                                <td>100.000</td>
                                <td>100.000</td>
                            </tr>
                            <tr>
                                <td>2次 (%)</td>
                                <td>{{ data.HRPhV_H2_phsA ? data.HRPhV_H2_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H2_phsB ? data.HRPhV_H2_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H2_phsC ? data.HRPhV_H2_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>3次 (%)</td>
                                <td>{{ data.HRPhV_H3_phsA ? data.HRPhV_H3_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H3_phsB ? data.HRPhV_H3_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H3_phsC ? data.HRPhV_H3_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>4次 (%)</td>
                                <td>{{ data.HRPhV_H4_phsA ? data.HRPhV_H4_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H4_phsB ? data.HRPhV_H4_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H4_phsC ? data.HRPhV_H4_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>5次 (%)</td>
                                <td>{{ data.HRPhV_H5_phsA ? data.HRPhV_H5_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H5_phsB ? data.HRPhV_H5_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H5_phsC ? data.HRPhV_H5_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>6次 (%)</td>
                                <td>{{ data.HRPhV_H6_phsA ? data.HRPhV_H6_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H6_phsB ? data.HRPhV_H6_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H6_phsC ? data.HRPhV_H6_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>7次 (%)</td>
                                <td>{{ data.HRPhV_H7_phsA ? data.HRPhV_H7_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H7_phsB ? data.HRPhV_H7_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H7_phsC ? data.HRPhV_H7_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>8次 (%)</td>
                                <td>{{ data.HRPhV_H8_phsA ? data.HRPhV_H8_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H8_phsB ? data.HRPhV_H8_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H8_phsC ? data.HRPhV_H8_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>9次 (%)</td>
                                <td>{{ data.HRPhV_H9_phsA ? data.HRPhV_H9_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H9_phsB ? data.HRPhV_H9_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H9_phsC ? data.HRPhV_H9_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>10次 (%)</td>
                                <td>{{ data.HRPhV_H10_phsA ? data.HRPhV_H10_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H10_phsB ? data.HRPhV_H10_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H10_phsC ? data.HRPhV_H10_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>11次 (%)</td>
                                <td>{{ data.HRPhV_H11_phsA ? data.HRPhV_H11_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H11_phsB ? data.HRPhV_H11_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H11_phsC ? data.HRPhV_H11_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>12次 (%)</td>
                                <td>{{ data.HRPhV_H12_phsA ? data.HRPhV_H12_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H12_phsB ? data.HRPhV_H12_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H12_phsC ? data.HRPhV_H12_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>13次 (%)</td>
                                <td>{{ data.HRPhV_H13_phsA ? data.HRPhV_H13_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H13_phsB ? data.HRPhV_H13_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H13_phsC ? data.HRPhV_H13_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>14次 (%)</td>
                                <td>{{ data.HRPhV_H14_phsA ? data.HRPhV_H14_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H14_phsB ? data.HRPhV_H14_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H14_phsC ? data.HRPhV_H14_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>15次 (%)</td>
                                <td>{{ data.HRPhV_H15_phsA ? data.HRPhV_H15_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H15_phsB ? data.HRPhV_H15_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H15_phsC ? data.HRPhV_H15_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>16次 (%)</td>
                                <td>{{ data.HRPhV_H16_phsA ? data.HRPhV_H16_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H16_phsB ? data.HRPhV_H16_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H16_phsC ? data.HRPhV_H16_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>17次 (%)</td>
                                <td>{{ data.HRPhV_H17_phsA ? data.HRPhV_H17_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H17_phsB ? data.HRPhV_H17_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H17_phsC ? data.HRPhV_H17_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>18次 (%)</td>
                                <td>{{ data.HRPhV_H18_phsA ? data.HRPhV_H18_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H18_phsB ? data.HRPhV_H18_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H18_phsC ? data.HRPhV_H18_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>19次 (%)</td>
                                <td>{{ data.HRPhV_H19_phsA ? data.HRPhV_H19_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H19_phsB ? data.HRPhV_H19_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H19_phsC ? data.HRPhV_H19_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>20次 (%)</td>
                                <td>{{ data.HRPhV_H20_phsA ? data.HRPhV_H20_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H20_phsB ? data.HRPhV_H20_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H20_phsC ? data.HRPhV_H20_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>21次 (%)</td>
                                <td>{{ data.HRPhV_H21_phsA ? data.HRPhV_H21_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H21_phsB ? data.HRPhV_H21_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H21_phsC ? data.HRPhV_H21_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>22次 (%)</td>
                                <td>{{ data.HRPhV_H22_phsA ? data.HRPhV_H22_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H22_phsB ? data.HRPhV_H22_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H22_phsC ? data.HRPhV_H22_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>23次 (%)</td>
                                <td>{{ data.HRPhV_H23_phsA ? data.HRPhV_H23_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H23_phsB ? data.HRPhV_H23_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H23_phsC ? data.HRPhV_H23_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>24次 (%)</td>
                                <td>{{ data.HRPhV_H24_phsA ? data.HRPhV_H24_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H24_phsB ? data.HRPhV_H24_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H24_phsC ? data.HRPhV_H24_phsC : '/' }}</td>
                            </tr>
                            <tr>
                                <td>25次 (%)</td>
                                <td>{{ data.HRPhV_H25_phsA ? data.HRPhV_H25_phsA : '/' }}</td>
                                <td>{{ data.HRPhV_H25_phsB ? data.HRPhV_H25_phsB : '/' }}</td>
                                <td>{{ data.HRPhV_H25_phsC ? data.HRPhV_H25_phsC : '/' }}</td>
                            </tr>
                        </tbody>
                    </table>
                </div> -->
            </el-tab-pane>

            <el-tab-pane label="谐波频谱" name="2">
                <div style="width: 100%">
                    <div id="pinPuChar" :style="'height:' + rowvh + ';width:' + rowvw + ';'"></div>
                </div>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
import {
  getMonitorOverLimit,
  getPmsInfo
} from '@/api/Distributionnetwork-analysis/IndicatorClassification/IndicatorClassification.js'
export default {
    name: 'RealDataPms',
    props: {
        reportID: {
            type: String,
            required: true
        }
    },
    data() {
        return {
            data: {},
            activeName: 0,
            rowvh: '',
            rowvw: '',
            timeId: '',
            energyQualityData: [],
            containmentRate: [],
            vEchar: null,
            serviseV: [],
            message: {},
            valueType: 'AVG',
            overLimitData:[]
        }
    },
    created() {
        this.rowvw = window.sessionStorage.getItem('appwidth') - 100 + 'px'
        this.setHeight()
        this.initData()
    },
    mounted() {
        window.addEventListener('resize', this.setHeight)
    },
    methods: {
        setHeight() {
            this.rowvh = window.sessionStorage.getItem('appheight') - 100 + 'px'
        },

        handleClick(tab, event) {
            console.log(tab, event)
            if (tab.name == 2) {
                this.initVEchart()
            }
        },
        thStyleFun() {
            return 'text-align:center'
        },
        cellStyleFun() {
            return 'text-align:center'
        },
        initVEchart() {
            var pinPuX = []
            for (let i = 2; i < 26; i++) {
                pinPuX.push(i + '次')
            }
            this.serviseV = []
            for (let i = 2; i < 26; i++) {
                let temValV =
                    (Number(this.data['HRPhV_H' + i + '_phsA']) +
                        Number(this.data['HRPhV_H' + i + '_phsB']) +
                        Number(this.data['HRPhV_H' + i + '_phsC'])) /
                    3
                this.serviseV.push(temValV.toFixed(3))
            }
            const echarts = require('echarts')
            // 基于准备好的dom，初始化echarts实例
            this.vEchar = echarts.init(document.getElementById('pinPuChar'))
            this.vEchar.clear()

            // 指定图表的配置项和数据
            let option = {
                title: {
                    left: 'center',
                    text: '2~25次谐波电压含有率',
                    textStyle: {
                        color: 'black'
                    }
                },
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'cross',
                        label: {
                            backgroundColor: '#283b56'
                        }
                    }
                },
                legend: {
                    left: '80px',
                    verticalAlign: 'top',
                    enabled: true,
                    itemDistance: 5,
                    textStyle: {
                        rich: {
                            a: {
                                verticalAlign: 'middle'
                            }
                        },

                        padding: [0, 0, 0, 0] //[上、右、下、左]
                    }
                },
                xAxis: {
                    name: '次数',
                    data: pinPuX,
                    boundaryGap: true,
                    axisLine: {
                        show: true,
                        onZero: false,
                        lineStyle: {
                            color: '#000000'
                        }
                    },
                    axisLabel: {
                        textStyle: {
                            fontFamily: 'dinproRegular',
                            color: '#000000'
                        }
                    }
                },
                yAxis: {
                    name: '%',
                    boundaryGap: true,
                    axisLine: {
                        show: true,
                        onZero: false,
                        lineStyle: {
                            color: '#000000'
                        }
                    },
                    axisLabel: {
                        textStyle: {
                            fontFamily: 'dinproRegular',
                            color: '#000000'
                        }
                    }
                },
                series: [
                    {
                        name: '谐波电压含有率',
                        type: 'bar',
                        data: this.serviseV,
                        color: '#339966'
                    },
                        {
            color: '#FF9900',
            name: '限值',
            type: 'bar',
            data: this.overLimitData
          }
                ]
            }

            // 使用刚指定的配置项和数据显示图表。
            this.vEchar.setOption(option)
            this.vEchar.resize()
        },

        initData() {
            let params = {
                valueType: this.valueType,
                monitorId: this.reportID
            }
            getPmsInfo(params).then(res => {
                let obj = res.data
                this.data = JSON.parse(obj.pmsContent)
                this.timeId = obj.timeId
                this.energyQualityData = [
                    {
                        name: '相电压总有效值',
                        A: this.data.PhV_phsA,
                        B: this.data.PhV_phsB,
                        C: this.data.PhV_phsC,
                        D: '-'
                    },
                    {
                        name: '电流总有效值(A)',
                        A: this.data.A_phsA,
                        B: this.data.A_phsB,
                        C: this.data.A_phsC,
                        D: '-'
                    },
                    {
                        name: '线电压总有效值(V)',
                        A: this.data.PPV_phsAB,
                        B: this.data.PPV_phsBC,
                        C: this.data.PPV_phsCA,
                        D: '-'
                    },
                    {
                        name: '相电压偏差(%)',
                        A: this.data.PhVDev_phsA,
                        B: this.data.PhVDev_phsB,
                        C: this.data.PhVDev_phsC,
                        D: '-'
                    },
                    {
                        name: '线电压偏差(%)',
                        A: '/',
                        B: '/',
                        C: '/',
                        D: '/'
                    },
                    {
                        name: '频率(Hz)',
                        A: '-',
                        B: '-',
                        C: '-',
                        D: this.data.Freq
                    },
                    {
                        name: '频率偏差(Hz)',
                        A: '-',
                        B: '-',
                        C: '-',
                        D: this.data.FreqDev
                    },
                    {
                        name: '电压序分量(V)',
                        A: this.data.SeqV_C0,
                        B: this.data.SeqV_C1,
                        C: this.data.SeqV_C2,
                        D: '-'
                    },
                    {
                        name: '电流序分量(A)',
                        A: '/',
                        B: '/',
                        C: '/',
                        D: '/'
                    },
                    {
                        name: '总有功功率(W)',
                        A: '/',
                        B: '/',
                        C: '/',
                        D: this.data.TotW
                    },
                    {
                        name: '总无功功率(Var)',
                        A: '/',
                        B: '/',
                        C: '/',
                        D: this.data.TotVar
                    },
                    {
                        name: '总视在功率(VA)',
                        A: '/',
                        B: '/',
                        C: '/',
                        D: this.data.TotVA
                    },
                    {
                        name: '视在功率因数',
                        A: '/',
                        B: '/',
                        C: '/',
                        D: this.data.TotPF
                    },
                    { name: '位移功率因数', A: '/', B: '/', C: '/', D: '/' },
                    { name: '电压波动', A: '/', B: '/', C: '/', D: '/' },
                    {
                        name: '短时闪变',
                        A: this.data.PstPhV_phsA,
                        B: this.data.PstPhV_phsB,
                        C: this.data.PstPhV_phsC,
                        D: '-'
                    },
                    {
                        name: '长时闪变',
                        A: this.data.PltPhV_phsA,
                        B: this.data.PltPhV_phsB,
                        C: this.data.PltPhV_phsC,
                        D: '-'
                    },
                    {
                        name: '电压谐波畸变率(%)',
                        A: this.data.ThdPhV_phsA,
                        B: this.data.ThdPhV_phsB,
                        C: this.data.ThdPhV_phsC,
                        D: '-'
                    },
                    {
                        name: '电流谐波畸变率(%)',
                        A: '/',
                        B: '/',
                        C: '/',
                        D: '/'
                    }
                ]
                this.containmentRate = [
                    {
                        name: '基波 (%)',
                        A: '100.000',
                        B: '100.000',
                        C: '100.000'
                    },
                    {
                        name: '2次 (%)',
                        A: this.data.HRPhV_H2_phsA ? this.data.HRPhV_H2_phsA : '/',
                        B: this.data.HRPhV_H2_phsB ? this.data.HRPhV_H2_phsB : '/',
                        C: this.data.HRPhV_H2_phsC ? this.data.HRPhV_H2_phsC : '/'
                    },
                    {
                        name: '3次 (%)',
                        A: this.data.HRPhV_H3_phsA ? this.data.HRPhV_H3_phsA : '/',
                        B: this.data.HRPhV_H3_phsB ? this.data.HRPhV_H3_phsB : '/',
                        C: this.data.HRPhV_H3_phsC ? this.data.HRPhV_H3_phsC : '/'
                    },
                    {
                        name: '4次 (%)',
                        A: this.data.HRPhV_H4_phsA ? this.data.HRPhV_H4_phsA : '/',
                        B: this.data.HRPhV_H4_phsB ? this.data.HRPhV_H4_phsB : '/',
                        C: this.data.HRPhV_H4_phsC ? this.data.HRPhV_H4_phsC : '/'
                    },
                    {
                        name: '5次 (%)',
                        A: this.data.HRPhV_H5_phsA ? this.data.HRPhV_H5_phsA : '/',
                        B: this.data.HRPhV_H5_phsB ? this.data.HRPhV_H5_phsB : '/',
                        C: this.data.HRPhV_H5_phsC ? this.data.HRPhV_H5_phsC : '/'
                    },
                    {
                        name: '6次 (%)',
                        A: this.data.HRPhV_H6_phsA ? this.data.HRPhV_H6_phsA : '/',
                        B: this.data.HRPhV_H6_phsB ? this.data.HRPhV_H6_phsB : '/',
                        C: this.data.HRPhV_H6_phsC ? this.data.HRPhV_H6_phsC : '/'
                    },
                    {
                        name: '7次 (%)',
                        A: this.data.HRPhV_H7_phsA ? this.data.HRPhV_H7_phsA : '/',
                        B: this.data.HRPhV_H7_phsB ? this.data.HRPhV_H7_phsB : '/',
                        C: this.data.HRPhV_H7_phsC ? this.data.HRPhV_H7_phsC : '/'
                    },
                    {
                        name: '8次 (%)',
                        A: this.data.HRPhV_H8_phsA ? this.data.HRPhV_H8_phsA : '/',
                        B: this.data.HRPhV_H8_phsB ? this.data.HRPhV_H8_phsB : '/',
                        C: this.data.HRPhV_H8_phsC ? this.data.HRPhV_H8_phsC : '/'
                    },
                    {
                        name: '9次 (%)',
                        A: this.data.HRPhV_H9_phsA ? this.data.HRPhV_H9_phsA : '/',
                        B: this.data.HRPhV_H9_phsB ? this.data.HRPhV_H9_phsB : '/',
                        C: this.data.HRPhV_H9_phsC ? this.data.HRPhV_H9_phsC : '/'
                    },
                    {
                        name: '10次 (%)',
                        A: this.data.HRPhV_H10_phsA ? this.data.HRPhV_H10_phsA : '/',
                        B: this.data.HRPhV_H10_phsB ? this.data.HRPhV_H10_phsB : '/',
                        C: this.data.HRPhV_H10_phsC ? this.data.HRPhV_H10_phsC : '/'
                    },
                    {
                        name: '11次 (%)',
                        A: this.data.HRPhV_H11_phsA ? this.data.HRPhV_H11_phsA : '/',
                        B: this.data.HRPhV_H11_phsB ? this.data.HRPhV_H11_phsB : '/',
                        C: this.data.HRPhV_H11_phsC ? this.data.HRPhV_H11_phsC : '/'
                    },
                    {
                        name: '12次 (%)',
                        A: this.data.HRPhV_H12_phsA ? this.data.HRPhV_H12_phsA : '/',
                        B: this.data.HRPhV_H12_phsB ? this.data.HRPhV_H12_phsB : '/',
                        C: this.data.HRPhV_H12_phsC ? this.data.HRPhV_H12_phsC : '/'
                    },
                    {
                        name: '13次 (%)',
                        A: this.data.HRPhV_H13_phsA ? this.data.HRPhV_H13_phsA : '/',
                        B: this.data.HRPhV_H13_phsB ? this.data.HRPhV_H13_phsB : '/',
                        C: this.data.HRPhV_H13_phsC ? this.data.HRPhV_H13_phsC : '/'
                    },
                    {
                        name: '14次 (%)',
                        A: this.data.HRPhV_H14_phsA ? this.data.HRPhV_H14_phsA : '/',
                        B: this.data.HRPhV_H14_phsB ? this.data.HRPhV_H14_phsB : '/',
                        C: this.data.HRPhV_H14_phsC ? this.data.HRPhV_H14_phsC : '/'
                    },
                    {
                        name: '15次 (%)',
                        A: this.data.HRPhV_H15_phsA ? this.data.HRPhV_H15_phsA : '/',
                        B: this.data.HRPhV_H15_phsB ? this.data.HRPhV_H15_phsB : '/',
                        C: this.data.HRPhV_H15_phsC ? this.data.HRPhV_H15_phsC : '/'
                    },
                    {
                        name: '16次 (%)',
                        A: this.data.HRPhV_H16_phsA ? this.data.HRPhV_H16_phsA : '/',
                        B: this.data.HRPhV_H16_phsB ? this.data.HRPhV_H16_phsB : '/',
                        C: this.data.HRPhV_H16_phsC ? this.data.HRPhV_H16_phsC : '/'
                    },
                    {
                        name: '17次 (%)',
                        A: this.data.HRPhV_H17_phsA ? this.data.HRPhV_H17_phsA : '/',
                        B: this.data.HRPhV_H17_phsB ? this.data.HRPhV_H17_phsB : '/',
                        C: this.data.HRPhV_H17_phsC ? this.data.HRPhV_H17_phsC : '/'
                    },
                    {
                        name: '18次 (%)',
                        A: this.data.HRPhV_H18_phsA ? this.data.HRPhV_H18_phsA : '/',
                        B: this.data.HRPhV_H18_phsB ? this.data.HRPhV_H18_phsB : '/',
                        C: this.data.HRPhV_H18_phsC ? this.data.HRPhV_H18_phsC : '/'
                    },
                    {
                        name: '19次 (%)',
                        A: this.data.HRPhV_H19_phsA ? this.data.HRPhV_H19_phsA : '/',
                        B: this.data.HRPhV_H19_phsB ? this.data.HRPhV_H19_phsB : '/',
                        C: this.data.HRPhV_H19_phsC ? this.data.HRPhV_H19_phsC : '/'
                    },
                    {
                        name: '20次 (%)',
                        A: this.data.HRPhV_H20_phsA ? this.data.HRPhV_H20_phsA : '/',
                        B: this.data.HRPhV_H20_phsB ? this.data.HRPhV_H20_phsB : '/',
                        C: this.data.HRPhV_H20_phsC ? this.data.HRPhV_H20_phsC : '/'
                    },
                    {
                        name: '21次 (%)',
                        A: this.data.HRPhV_H21_phsA ? this.data.HRPhV_H21_phsA : '/',
                        B: this.data.HRPhV_H21_phsB ? this.data.HRPhV_H21_phsB : '/',
                        C: this.data.HRPhV_H21_phsC ? this.data.HRPhV_H21_phsC : '/'
                    },
                    {
                        name: '22次 (%)',
                        A: this.data.HRPhV_H22_phsA ? this.data.HRPhV_H22_phsA : '/',
                        B: this.data.HRPhV_H22_phsB ? this.data.HRPhV_H22_phsB : '/',
                        C: this.data.HRPhV_H22_phsC ? this.data.HRPhV_H22_phsC : '/'
                    },
                    {
                        name: '23次 (%)',
                        A: this.data.HRPhV_H23_phsA ? this.data.HRPhV_H23_phsA : '/',
                        B: this.data.HRPhV_H23_phsB ? this.data.HRPhV_H23_phsB : '/',
                        C: this.data.HRPhV_H23_phsC ? this.data.HRPhV_H23_phsC : '/'
                    },
                    {
                        name: '24次 (%)',
                        A: this.data.HRPhV_H24_phsA ? this.data.HRPhV_H24_phsA : '/',
                        B: this.data.HRPhV_H24_phsB ? this.data.HRPhV_H24_phsB : '/',
                        C: this.data.HRPhV_H24_phsC ? this.data.HRPhV_H24_phsC : '/'
                    },
                    {
                        name: '25次 (%)',
                        A: this.data.HRPhV_H25_phsA ? this.data.HRPhV_H25_phsA : '/',
                        B: this.data.HRPhV_H25_phsB ? this.data.HRPhV_H25_phsB : '/',
                        C: this.data.HRPhV_H25_phsC ? this.data.HRPhV_H25_phsC : '/'
                    }
                ]
            })

          let  overLimit = {
            id: this.reportID
          }
          getMonitorOverLimit(overLimit).then(res => {
            let data = res.data
            this.overLimitData =[]
            for(let i =2;i<26;i++){
              let tem ='uharm'+i;
              this.overLimitData.push(data[tem])
            }

          })
        }
    }
}
</script>

<style scoped>
table {
    width: 100%;
    border-collapse: collapse;
    overflow-y: auto; /* 启用竖向滚动 */
}

table caption {
    font-size: 2em;
    font-weight: bold;
    margin: 1em 0;
}

th,
td {
    border: 1px solid #999;
    text-align: center;
    padding: 4px 0;
}

table thead tr {
    background-color: #008c8c;
    color: #fff;
}

table tbody tr:nth-child(odd) {
    background-color: #eee;
}

table tbody tr:hover {
    background-color: #ccc;
}

table tbody tr td:first-child {
    color: #3d34fc;
}

table tfoot tr td {
    text-align: right;
    padding-right: 20px;
}
</style>
