<template>
    <div element-loading-text="数据加载中" v-loading="loading">
        <div class="container" id="container">
            <!-- <Muentree ref="treem" v-show="false"></Muentree> -->
            <i @click="closeHandle" class="el-icon-circle-close coles"></i>
            <el-form :inline="true" label-width="90px" class="">
                <el-form-item label="指标类型:">
                    <el-select
                        v-model="condition"
                        multiple
                        collapse-tags
                        :multiple-limit="limit"
                        filterable
                        placeholder="请选择指标"
                    >
                        <el-option-group v-for="group in options" :key="group.label" :label="group.label">
                            <el-option
                                v-for="item in group.options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            ></el-option>
                        </el-option-group>
                    </el-select>
                </el-form-item>
                <el-form-item label="值类型:">
                    <el-select v-model="formData.valueType" placeholder="请选择类型">
                        <el-option
                            v-for="item in typeoptions"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="谐波次数:" v-show="xb">
                    <el-select v-model="formData.harmonic" placeholder="请选择谐波">
                        <el-option
                            v-for="item in harmonicoptions"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="CVT型号:" v-show="condition.includes('40')">
                    <!-- <el-cascader
                        v-model="cvt"
                        :options="cvtList"
                        :props="{ expandTrigger: 'hover' }"
                        clearable
                        filterable
                    ></el-cascader> -->
                    <el-select v-model="cvt" value-key="value" clearable filterable placeholder="请选择CVT型号">
                        <el-option
                            v-for="item in cvtList"
                            :key="item.value"
                            :label="item.label"
                            :value="item"
                        ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item v-show="jxb" label="间谐波次数:">
                    <el-select v-model="formData.inHarmonic" placeholder="请选择间谐波">
                        <el-option
                            v-for="item in inharmonicoptions"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        ></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
        </div>
        <el-form :inline="true" :model="formData" class="demo-form-inline">
            <el-form-item>
                <timeindex
                    ref="chilenform"
                    @querfromdata="querfromdata"
                    :interval="interval"
                    :treenode="treenode"
                    :dataTree="dataTree"
                ></timeindex>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="querfromdatad" icon="el-icon-search">查询</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="text" @click="closeHandle">
                    条件筛选
                    <i :class="!view ? 'el-icon-arrow-down' : 'el-icon-arrow-right'"></i>
                </el-button>
            </el-form-item>
            <!-- <el-form-item>
        <el-button type="primary" size="" @click="timechange" icon="el-icon-caret-bottom" round plain>条件筛选</el-button>
      </el-form-item> -->
        </el-form>
        <el-row
            ref="tubiao"
            id="tubiao"
            :gutter="10"
            style="overflow:scroll;height:calc(100vh - 195px);cursor:pointer;scrollbar-arrow-color:#302D30;'"
        >
            <el-col :span="24" v-for="(item, index) in list" :key="index" style="margin-top: 10px">
                <div ref="kk" :id="item.id" style="'width:100%;background:#fff;height:calc(100vh - 100px);"></div>
            </el-col>
        </el-row>
    </div>
</template>
<script>
import Muentree from '@/views/cgy-components/menuTree/index1'
import timeindex from '@/views/cgy-components/TimePicker/timeindext'
import api from '@/api/harmonic/onlineData'
import yan from '@/assets/commjs/color'
import { cvtList } from './cvtList.js'

//import qsdata from "@/views/components/data1";
export default {
    components: {
        timeindex,
        Muentree
    },
    data() {
        return {
            cvtList: cvtList,
            //指标
            node: [],
            arr: [],
            view: false,
            activeNames: ['0'],
            loading: false,
            Traceability: [],
            url: require('@/assets/point.png'),
            cvt: {},
            options: [
                {
                    label: '电压趋势',
                    options: [
                        {
                            value: '10',
                            label: '相电压有效值'
                        },
                        {
                            value: '11',
                            label: '线电压有效值'
                        },
                        {
                            value: '12',
                            label: '电压偏差'
                        },
                        {
                            value: '13',
                            label: '三相电压不平衡'
                        },
                        {
                            value: '14',
                            label: '电压不平衡'
                        },
                        {
                            value: '15',
                            label: '电压总谐波畸变率'
                        }
                    ]
                },
                {
                    label: '电流趋势',
                    options: [
                        {
                            value: '20',
                            label: '电流有效值'
                        },
                        {
                            value: '21',
                            label: '电流总谐波畸变率'
                        },
                        {
                            value: '22',
                            label: '负序电流'
                        }
                    ]
                },
                {
                    label: '频率趋势',
                    options: [
                        {
                            value: '30',
                            label: '频率'
                        }
                    ]
                },
                {
                    label: '谐波趋势',
                    options: [
                        { value: '39', label: '谐波电流定位' },
                        {
                            value: '40',
                            label: '谐波电压含有率'
                        },
                        {
                            value: '43',
                            label: '谐波电流幅值'
                        },
                        {
                            value: '44',
                            label: '谐波电压相角'
                        },
                        {
                            value: '45',
                            label: '谐波电流相角'
                        },
                        {
                            value: '46',
                            label: '间谐波电压含有率'
                        },
                        // {
                        //     value: '47',
                        //     label: '间谐波电流含有率'
                        // },
                        // {
                        //     value: '48',
                        //     label: '间谐波电压幅值'
                        // },
                        {
                            value: '49',
                            label: '间谐波电流幅值'
                        }
                    ]
                },
                {
                    label: '功率趋势',
                    options: [
                        {
                            value: '50',
                            label: '谐波有功功率'
                        },
                        {
                            value: '51',
                            label: '谐波无功功率'
                        },
                        {
                            value: '52',
                            label: '谐波视在功率'
                        },
                        {
                            value: '53',
                            label: '三相有功功率'
                        },
                        {
                            value: '54',
                            label: '三相无功功率'
                        },
                        {
                            value: '55',
                            label: '三相视在功率'
                        },
                        {
                            value: '56',
                            label: '三相总有功功率'
                        },
                        {
                            value: '57',
                            label: '三相总无功功率'
                        },
                        {
                            value: '58',
                            label: '三相总视在功率'
                        },
                        {
                            value: '59',
                            label: '视在功率因数'
                        },
                        {
                            value: '591',
                            label: '位移功率因数'
                        },
                        {
                            value: '592',
                            label: '总视在功率因数'
                        },
                        {
                            value: '593',
                            label: '总位移功率因数'
                        }
                    ]
                },
                {
                    label: '闪变趋势',
                    options: [
                        {
                            value: '60',
                            label: '短时电压闪变'
                        },
                        {
                            value: '61',
                            label: '长时电压闪变'
                        },
                        {
                            value: '62',
                            label: '电压波动'
                        }
                    ]
                }
            ],
            options1: [
                {
                    label: '电压趋势',
                    options: [
                        {
                            value: '11',
                            label: '线电压有效值'
                        },
                        {
                            value: '12',
                            label: '电压偏差'
                        },
                        {
                            value: '15',
                            label: '电压总谐波畸变率'
                        }
                    ]
                },
                {
                    label: '电流趋势',
                    options: [
                        {
                            value: '20',
                            label: '电流有效值'
                        },
                        {
                            value: '21',
                            label: '电流总谐波畸变率'
                        },
                        {
                            value: '22',
                            label: '负序电流'
                        }
                    ]
                },
                {
                    label: '频率趋势',
                    options: [
                        {
                            value: '30',
                            label: '频率'
                        }
                    ]
                },
                {
                    label: '谐波趋势',
                    options: [
                        { value: '39', label: '谐波电流定位' },
                        {
                            value: '40',
                            label: '谐波电压含有率'
                        },
                        {
                            value: '43',
                            label: '谐波电流幅值'
                        },
                        {
                            value: '46',
                            label: '间谐波电压含有率'
                        }
                    ]
                },
                {
                    label: '功率趋势',
                    options: [
                        {
                            value: '56',
                            label: '三相总有功功率'
                        },
                        {
                            value: '57',
                            label: '三相总无功功率'
                        },
                        {
                            value: '58',
                            label: '三相总视在功率'
                        },
                        {
                            value: '59',
                            label: '视在功率因数'
                        },
                        {
                            value: '591',
                            label: '位移功率因数'
                        },
                        {
                            value: '592',
                            label: '总视在功率因数'
                        },
                        {
                            value: '593',
                            label: '总位移功率因数'
                        }
                    ]
                },
                {
                    label: '闪变趋势',
                    options: [
                        {
                            value: '60',
                            label: '短时电压闪变'
                        },
                        {
                            value: '61',
                            label: '长时电压闪变'
                        },
                        {
                            value: '62',
                            label: '电压波动'
                        }
                    ]
                }
            ],
            options2: [
                {
                    label: '电压趋势',
                    options: [
                        {
                            value: '11',
                            label: '线电压有效值'
                        },
                        {
                            value: '12',
                            label: '电压偏差'
                        },
                        {
                            value: '15',
                            label: '电压总谐波畸变率'
                        }
                    ]
                },
                {
                    label: '电流趋势',
                    options: [
                        {
                            value: '20',
                            label: '电流有效值'
                        },
                        {
                            value: '21',
                            label: '电流总谐波畸变率'
                        },
                        {
                            value: '22',
                            label: '负序电流'
                        }
                    ]
                },
                {
                    label: '频率趋势',
                    options: [
                        {
                            value: '30',
                            label: '频率'
                        }
                    ]
                },
                {
                    label: '谐波趋势',
                    options: [
                        { value: '39', label: '谐波电流定位' },
                        {
                            value: '40',
                            label: '谐波电压含有率'
                        },
                        {
                            value: '43',
                            label: '谐波电流幅值'
                        },

                        {
                            value: '46',
                            label: '间谐波电压含有率'
                        }
                    ]
                },
                {
                    label: '功率趋势',
                    options: [
                        {
                            value: '56',
                            label: '三相总有功功率'
                        },
                        {
                            value: '57',
                            label: '三相总无功功率'
                        },
                        {
                            value: '58',
                            label: '三相总视在功率'
                        },
                        {
                            value: '59',
                            label: '视在功率因数'
                        },
                        {
                            value: '591',
                            label: '位移功率因数'
                        },
                        {
                            value: '592',
                            label: '总视在功率因数'
                        },
                        {
                            value: '593',
                            label: '总位移功率因数'
                        }
                    ]
                },
                {
                    label: '闪变趋势',
                    options: [
                        {
                            value: '60',
                            label: '短时电压闪变'
                        },
                        {
                            value: '61',
                            label: '长时电压闪变'
                        },
                        {
                            value: '62',
                            label: '电压波动'
                        }
                    ]
                }
            ],
            options3: [
                {
                    label: '电压趋势',
                    options: [
                        {
                            value: '10',
                            label: '相电压有效值'
                        },
                        {
                            value: '11',
                            label: '线电压有效值'
                        },
                        {
                            value: '12',
                            label: '电压偏差'
                        },
                        {
                            value: '13',
                            label: '三相电压不平衡'
                        },
                        {
                            value: '14',
                            label: '电压不平衡'
                        },
                        {
                            value: '15',
                            label: '电压总谐波畸变率'
                        }
                    ]
                },
                {
                    label: '电流趋势',
                    options: [
                        {
                            value: '20',
                            label: '电流有效值'
                        },
                        {
                            value: '21',
                            label: '电流总谐波畸变率'
                        },
                        {
                            value: '22',
                            label: '负序电流'
                        }
                    ]
                },
                {
                    label: '频率趋势',
                    options: [
                        {
                            value: '30',
                            label: '频率'
                        }
                    ]
                },
                {
                    label: '谐波趋势',
                    options: [
                        { value: '39', label: '谐波电流定位' },
                        {
                            value: '40',
                            label: '谐波电压含有率'
                        },
                        {
                            value: '43',
                            label: '谐波电流幅值'
                        },
                        {
                            value: '44',
                            label: '谐波电压相角'
                        },
                        {
                            value: '45',
                            label: '谐波电流相角'
                        },
                        {
                            value: '46',
                            label: '间谐波电压含有率'
                        },
                        // {
                        //     value: '47',
                        //     label: '间谐波电流含有率'
                        // },
                        // {
                        //     value: '48',
                        //     label: '间谐波电压幅值'
                        // },
                        {
                            value: '49',
                            label: '间谐波电流幅值'
                        }
                    ]
                },
                {
                    label: '功率趋势',
                    options: [
                        {
                            value: '50',
                            label: '谐波有功功率'
                        },
                        {
                            value: '51',
                            label: '谐波无功功率'
                        },
                        {
                            value: '52',
                            label: '谐波视在功率'
                        },
                        {
                            value: '53',
                            label: '三相有功功率'
                        },
                        {
                            value: '54',
                            label: '三相无功功率'
                        },
                        {
                            value: '55',
                            label: '三相视在功率'
                        },
                        {
                            value: '56',
                            label: '三相总有功功率'
                        },
                        {
                            value: '57',
                            label: '三相总无功功率'
                        },
                        {
                            value: '58',
                            label: '三相总视在功率'
                        },
                        {
                            value: '59',
                            label: '视在功率因数'
                        },
                        {
                            value: '591',
                            label: '位移功率因数'
                        },
                        {
                            value: '592',
                            label: '总视在功率因数'
                        },
                        {
                            value: '593',
                            label: '总位移功率因数'
                        }
                    ]
                },
                {
                    label: '闪变趋势',
                    options: [
                        {
                            value: '60',
                            label: '短时电压闪变'
                        },
                        {
                            value: '61',
                            label: '长时电压闪变'
                        },
                        {
                            value: '62',
                            label: '电压波动'
                        }
                    ]
                }
            ],
            vh: null,
            vhh: null,
            //时间间隔
            interval: 4,
            //限制指标个数
            limit: 3,
            condition: ['10', '11', '12'],
            formData: {
                valueType: 1,
                harmonic: 2,
                inHarmonic: 1
            },
            //值类型
            typeoptions: [
                { label: '平均值', value: 1 },
                { label: '最小值', value: 2 },
                { label: '最大值', value: 3 },
                { label: 'cp95值', value: 4 }
            ],
            typeoptions1: [
                { label: '平均值', value: 1 },
                { label: '最小值', value: 2 },
                { label: '最大值', value: 3 },
                { label: 'cp95值', value: 4 }
            ],
            typeoptions2: [{ label: '平均值', value: 1 }],
            //谐波次数
            harmonicoptions: [
                { label: '2次', value: 2 },
                { label: '3次', value: 3 },
                { label: '4次', value: 4 },
                { label: '5次', value: 5 },
                { label: '6次', value: 6 },
                { label: '7次', value: 7 },
                { label: '8次', value: 8 },
                { label: '9次', value: 9 },
                { label: '10次', value: 10 },
                { label: '11次', value: 11 },
                { label: '12次', value: 12 },
                { label: '13次', value: 13 },
                { label: '14次', value: 14 },
                { label: '15次', value: 15 },
                { label: '16次', value: 16 },
                { label: '17次', value: 17 },
                { label: '18次', value: 18 },
                { label: '19次', value: 19 },
                { label: '20次', value: 20 },
                { label: '21次', value: 21 },
                { label: '22次', value: 22 },
                { label: '23次', value: 23 },
                { label: '24次', value: 24 },
                { label: '25次', value: 25 },
                { label: '26次', value: 26 },
                { label: '27次', value: 27 },
                { label: '28次', value: 28 },
                { label: '29次', value: 29 },
                { label: '30次', value: 30 },
                { label: '31次', value: 31 },
                { label: '32次', value: 32 },
                { label: '33次', value: 33 },
                { label: '34次', value: 34 },
                { label: '35次', value: 35 },
                { label: '36次', value: 36 },
                { label: '37次', value: 37 },
                { label: '38次', value: 38 },
                { label: '39次', value: 39 },
                { label: '40次', value: 40 },
                { label: '41次', value: 41 },
                { label: '42次', value: 42 },
                { label: '43次', value: 43 },
                { label: '44次', value: 44 },
                { label: '45次', value: 45 },
                { label: '46次', value: 46 },
                { label: '47次', value: 47 },
                { label: '48次', value: 48 },
                { label: '49次', value: 49 },
                { label: '50次', value: 50 }
            ],
            //简谐波次数
            inharmonicoptions: [
                { label: '0.5次', value: 1 },
                { label: '1.5次', value: 2 },
                { label: '2.5次', value: 3 },
                { label: '3.5次', value: 4 },
                { label: '4.5次', value: 5 },
                { label: '5.5次', value: 6 },
                { label: '6.5次', value: 7 },
                { label: '7.5次', value: 8 },
                { label: '8.5次', value: 9 },
                { label: '9.5次', value: 10 },
                { label: '10.5次', value: 11 },
                { label: '11.5次', value: 12 },
                { label: '12.5次', value: 13 },
                { label: '13.5次', value: 14 },
                { label: '14.5次', value: 15 },
                { label: '15.5次', value: 16 }
            ],
            //谐波简谐波控制
            xb: false,
            jxb: false,
            list: [],
            echartlist: [],
            formData: {
                condition: ['10', '11', '12'],
                harmonic: 2,
                inHarmonic: 1,
                lineId: window.sessionStorage.getItem('fist'),
                ptType: 0,
                searchBeginTime: '',
                searchEndTime: '',
                valueType: 1
            },
            interval: 4,
            nodeid: this.linelist,
            deptIndex: ''
        }
    },
    props: {
        treenode: {
            type: Object,
            default: undefined
        },
        dataTree: {
            type: Array,
            default: undefined
        },
        linelist: {
            type: Array,
            default: undefined
        },
        ptType: {
            type: Number,
            default: undefined
        }
        // views: {
        //   type: Boolean,
        //   default: undefined,
        // },
    },
    watch: {
        ptType(newVal) {
            if (newVal == 0) {
                this.options = this.options3
                this.condition = ['10', '11', '12']
            } else if (newVal == 1) {
                this.options = this.options1
                this.condition = ['11', '12', '15']
            } else if (newVal == 2) {
                this.options = this.options2
                this.condition = ['11', '12', '15']
            }
        },
        //监听指标变化
        condition(newVal, oldval) {
            //console.log("🚀 ~ file: wtqsfenew.vue:885 ~ condition ~ newVal:", newVal)
            //判断一个指标时
            if (newVal.length == 1) {
                if (
                    newVal.includes('40') ||
                    newVal.includes('43') ||
                    newVal.includes('44') ||
                    newVal.includes('50') ||
                    newVal.includes('39') ||
                    newVal.includes('51') ||
                    newVal.includes('52') ||
                    newVal.includes('45')
                ) {
                    this.xb = true
                } else {
                    this.xb = false
                }
                if (newVal.includes('46') || newVal.includes('47') || newVal.includes('48') || newVal.includes('49')) {
                    this.jxb = true
                } else {
                    this.jxb = false
                }
            }
            //判断2个指标时
            if (newVal.length == 2) {
                if (
                    newVal.includes('40') ||
                    newVal.includes('43') ||
                    newVal.includes('44') ||
                    (newVal.includes('45') && newVal.includes('46')) ||
                    newVal.includes('47') ||
                    newVal.includes('48') ||
                    newVal.includes('49') ||
                    newVal.includes('50') ||
                    newVal.includes('39') ||
                    newVal.includes('51') ||
                    newVal.includes('52')
                ) {
                    this.xb = true
                    this.jxb = true
                }
                if (
                    newVal.includes('40') ||
                    newVal.includes('43') ||
                    newVal.includes('44') ||
                    newVal.includes('45') ||
                    newVal.includes('50') ||
                    newVal.includes('39') ||
                    newVal.includes('51') ||
                    newVal.includes('52')
                ) {
                    this.xb = true
                } else {
                    this.xb = false
                }
                if (newVal.includes('46') || newVal.includes('47') || newVal.includes('48') || newVal.includes('49')) {
                    this.jxb = true
                } else {
                    this.jxb = false
                }
            }
            //判断3个指标时
            if (newVal.length == 3) {
                if (
                    (newVal.includes('40') ||
                        newVal.includes('43') ||
                        newVal.includes('44') ||
                        newVal.includes('50') ||
                        newVal.includes('39') ||
                        newVal.includes('51') ||
                        newVal.includes('52') ||
                        newVal.includes('45')) &&
                    (newVal.includes('46') || newVal.includes('47') || newVal.includes('48') || newVal.includes('49'))
                ) {
                    this.xb = true
                    this.jxb = true
                } else {
                    this.xb = false
                    this.jxb = false
                }
                if (newVal.includes('46') || newVal.includes('47') || newVal.includes('48') || newVal.includes('49')) {
                    this.jxb = true
                } else {
                    this.jxb = false
                }
                if (
                    newVal.includes('40') ||
                    newVal.includes('43') ||
                    newVal.includes('44') ||
                    newVal.includes('45') ||
                    newVal.includes('50') ||
                    newVal.includes('39') ||
                    newVal.includes('51') ||
                    newVal.includes('52')
                ) {
                    this.xb = true
                } else {
                    this.xb = false
                }
            }
            //判断无指标时
            if (newVal.length == 0) {
                this.jxb = false
                this.xb = false
            }
            //根据指标判断值类型
            if (newVal.includes('60') || newVal.includes('61') || newVal.includes('62')) {
                this.typeoptions = this.typeoptions2
            } else {
                this.typeoptions = this.typeoptions1
            }
        },
        checked: function (a, b) {
            if (!a) {
                this.panindexOptions.forEach(m => {
                    m.children.forEach(n => {
                        n.disabled = false
                    })
                })
            }
        },
        linelist(val) {
            if (val.length > 0 && val[0] == null) {
                this.querfromdatad()
            } else {
                this.node.push(window.sessionStorage.getItem('fist'))
                this.querfromdatad()
            }
        }
    },
    created() {
        var info = window.sessionStorage.getItem('Info')
        info = eval('(' + info + ')')
        this.deptIndex = info.deptId
        //this.fiveTreeData()
    },
    mounted() {
        this.vhh = window.sessionStorage.getItem('appheight') - 180 + 'px'
        this.vh = window.sessionStorage.getItem('appheight') / 2.5 + 'px'

        //this.queryData();
    },
    methods: {
        querfromdata(a, b, c) {},
        //获取5层树
        async fiveTreeData() {
            var data = {
                deptIndex: this.deptIndex,
                monitorFlag: 2,
                powerFlag: 2,
                loadType: null,
                manufacturer: null,
                serverName: 'harmonic-boot',
                statisticalType: '',
                scale: null
            }
            await api.getTerminalTreeForFive(data).then(res => {
                if (res.code === 'A0000') {
                    this.arr = res.data
                }
            })
        },
        // 算法
        algorithm(name) {
            let pathInfo = this.$router.resolve({
                path: '/algorithm/algorithm',
                query: {
                    name: name
                }
            })
            window.open(pathInfo.href, '算法帮助')
        },
        handleChange(val) {
            //console.log(val);
        },
        closeHandle() {
            if (this.view) {
                this.view = false
            } else {
                this.view = true
            }
            //console.log('关闭和展开');
            const dom = document.getElementById('container')
            const closeDom = document.getElementsByClassName('close')[0]
            if (!dom.className.match(/(?:^|\s)expend(?!\S)/)) {
                dom.className = 'container expend'
            } else {
                dom.className = 'container close-container'
            }
        },
        //日期组件触发事件
        querfromdatad() {
            this.loading = true
            this.interval = this.$refs.chilenform.intervald
            //监测点赋值

            //this.timeValue = data;
            this.formData.searchBeginTime = this.$refs.chilenform.timeValue[0]
            this.formData.searchEndTime = this.$refs.chilenform.timeValue[1]
            this.formData.condition = JSON.parse(JSON.stringify(this.condition))
            console.log('🚀 ~ querfromdatad ~ this.formData.condition:', this.condition, this.formData.condition)

            setTimeout(() => {
                this.node.push(window.sessionStorage.getItem('fist'))
                let datanode = { lineId: this.linelist.length == 0 ? this.node : this.linelist }
                this.formData.lineId = datanode.lineId
                // this.formData.lineId = datanode.lineId==null?this.linelist.push(this.arr[0].children[0].children[0].children[0].id):datanode.lineId
            }, 800)
            let directionValue = -1
            for (let i = 0; i < this.formData.condition.length; i++) {
                if (this.formData.condition[i] == '39') {
                    this.formData.condition[i] = '50'
                    directionValue = i
                }
            }
            setTimeout(() => {
                this.Traceability = []
                // if (this.formData.condition.includes('39')) {
                //     api.getHistoryResult({
                //         ...this.formData,
                //         condition: ['50', '50']
                //     }).then(res => {
                //         if (res.code == 'A0000') {
                //             this.Traceability = res.data
                //         }
                //     })
                // }
               
                api.getHistoryResult(this.formData).then(res => {
                    if (res.code == 'A0000') {
                        this.list = []
                        if (directionValue >= 0) {
                            res.data[directionValue].targetName = '谐波电流方向'
                            this.Traceability = [res.data[directionValue]]
                            console.log('🚀 ~ api.getHistoryResult ~  this.Traceability :', this.Traceability)
                        }
                        this.shujuchuli(res)
                    }
                })
            }, 1500)
        },
        // queryData() {
        //   console.log("数据源", qsdata);
        //   this.shujuchuli(qsdata);
        // },
        //处理数据
        //处理数据
        shujuchuli(res) {
            this.loading = true
            var shujuData = res.data
            shujuData.forEach((item, i) => {
                let keyNum=1
                //判断是否存在暂降点
                if(item.targetName=='谐波电压含有率'){
                    keyNum=this.cvt.children != undefined? this.cvt.children[0].children[this.formData.harmonic-2].children[0].label:1
                }
                console.log("🚀 ~ shujuData.forEach ~ keyNum:", keyNum)

                if (item.eventDetail !== null || item.eventDetail == []) {
                    //向项别中添加暂降点
                    var chufa = []
                    item.phaiscType.push('暂态触发点')
                    //判断是否有限值(有上下限)
                    if (item.topLimit !== 0 && item.lowerLimit !== 0) {
                        item.phaiscType.push('上限')
                        item.phaiscType.push('下限')
                        if (item.minValue !== null && item.maxValue !== null) {
                            //最小值等于下限值

                            //图列为A,B,C,暂降,上限,下限
                            if (item.phaiscType.length == 6) {
                                let avalue = []
                                let bvalue = []
                                let cvalue = []
                                let topLimit = []
                                let lowerLimit = []
                                item.maxValue = item.topLimit
                                item.minValue = item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            avalue.push([item.value[j][0], (item.value[j][1]/keyNum).toFixed(2)])
                                        } else {
                                            avalue.push([])
                                        }
                                        //判断存在缺失值b
                                        if (item.value[j][2] != undefined) {
                                            bvalue.push([item.value[j][0], (item.value[j][2]/keyNum).toFixed(2)])
                                        } else {
                                            bvalue.push([])
                                        }
                                        //判断存在缺失值c
                                        if (item.value[j][3] != undefined) {
                                            cvalue.push([item.value[j][0], (item.value[j][3]/keyNum).toFixed(2)])
                                        } else {
                                            cvalue.push([])
                                        }
                                        //上下限值
                                        topLimit.push([item.value[j][0], item.topLimit])
                                        lowerLimit.push([item.value[j][0], item.lowerLimit])
                                    }
                                    //数据为空
                                } else {
                                    avalue = []
                                    bvalue = []
                                    cvalue = []
                                }
                                //不存在一个暂降点或1个 //处理暂降点
                                if (item.eventDetail.length > 0) {
                                    for (var k = 0; k < item.eventDetail.length; k++) {
                                        chufa.push([
                                            item.eventDetail[k].time,
                                            item.minValue.toFixed(2),
                                            item.eventDetail[k].id,
                                            99
                                        ])
                                    }
                                }
                                let shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    avalue: avalue,
                                    bvalue: bvalue,
                                    cvalue: cvalue,
                                    topLimit: topLimit,
                                    lowerLimit: lowerLimit,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                            //图列为频率等,暂降,上限,下限
                            if (item.phaiscType.length == 4) {
                                let gvalue = []
                                let topLimit = []
                                let lowerLimit = []
                                item.maxValue = item.topLimit
                                item.minValue = item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            gvalue.push([item.value[j][0], item.value[j][1].toFixed(2)])
                                        } else {
                                            gvalue.push([])
                                        }
                                        //上下限值
                                        topLimit.push([item.value[j][0], item.topLimit])
                                        lowerLimit.push([item.value[j][0], item.lowerLimit])
                                    }
                                    //数据为空
                                } else {
                                    gvalue = []
                                }
                                //不存在一个暂降点或1个 //处理暂降点
                                if (item.eventDetail.length > 0) {
                                    for (var k = 0; k < item.eventDetail.length; k++) {
                                        chufa.push([
                                            item.eventDetail[k].time,
                                            item.minValue.toFixed(2),
                                            item.eventDetail[k].id,
                                            99
                                        ])
                                    }
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    gvalue: gvalue,
                                    topLimit: topLimit,
                                    lowerLimit: lowerLimit,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                        } else {
                            var shuju = {
                                id: 'qushifenx' + i,
                                title: item.lineName + '--' + item.targetName,
                                targetName: item.targetName,
                                legend: item.phaiscType,
                                valueName: item.unit[0],
                                minValue: null,
                                avalue: [],
                                bvalue: [],
                                cvalue: [],
                                topLimit: [],
                                lowerLimit: [],
                                chufa: []
                            }
                            this.list.push(shuju)
                        }
                    }
                    //有上限值
                    if (item.topLimit !== 0 && item.lowerLimit == 0) {
                        item.phaiscType.push('上限')
                        if (item.minValue !== null && item.maxValue !== null) {
                            //最小值等于下限值
                            //图列为A,B,C,暂降,上限
                            if (item.phaiscType.length == 5) {
                                let avalue = []
                                let bvalue = []
                                let cvalue = []
                                let topLimit = []
                                item.maxValue = item.topLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            avalue.push([item.value[j][0], (item.value[j][1]/keyNum).toFixed(2)])
                                        } else {
                                            avalue.push([])
                                        }
                                        //判断存在缺失值b
                                        if (item.value[j][2] != undefined) {
                                            bvalue.push([item.value[j][0], (item.value[j][2]/keyNum).toFixed(2)])
                                        } else {
                                            bvalue.push([])
                                        }
                                        //判断存在缺失值c
                                        if (item.value[j][3] != undefined) {
                                            cvalue.push([item.value[j][0], (item.value[j][3]/keyNum).toFixed(2)])
                                        } else {
                                            cvalue.push([])
                                        }
                                        //上限值
                                        topLimit.push([item.value[j][0], item.topLimit])
                                    }
                                    //数据为空
                                } else {
                                    avalue = []
                                    bvalue = []
                                    cvalue = []
                                }
                                //不存在一个暂降点或1个 //处理暂降点
                                if (item.eventDetail.length > 0) {
                                    for (var k = 0; k < item.eventDetail.length; k++) {
                                        chufa.push([
                                            item.eventDetail[k].time,
                                            item.minValue.toFixed(2),
                                            item.eventDetail[k].id,
                                            99
                                        ])
                                    }
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    avalue: avalue,
                                    bvalue: bvalue,
                                    cvalue: cvalue,
                                    topLimit: topLimit,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                            //图列为频率等,暂降,上限
                            if (item.phaiscType.length == 3) {
                                let gvalue = []
                                let topLimit = []
                                item.maxValue = item.topLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            gvalue.push([item.value[j][0], item.value[j][1].toFixed(2)])
                                        } else {
                                            gvalue.push([])
                                        }
                                        //上限值
                                        topLimit.push([item.value[j][0], item.topLimit])
                                    }
                                    //数据为空
                                } else {
                                    gvalue = []
                                }
                                //不存在一个暂降点或1个 //处理暂降点
                                if (item.eventDetail.length > 0) {
                                    for (var k = 0; k < item.eventDetail.length; k++) {
                                        chufa.push([item.eventDetail[k].time, item.minValue.toFixed(2)])
                                    }
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    gvalue: gvalue,
                                    topLimit: topLimit,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                        } else {
                            var shuju = {
                                id: 'qushifenx' + i,
                                title: item.lineName + '--' + item.targetName,
                                targetName: item.targetName,
                                legend: item.phaiscType,
                                valueName: item.unit[0],
                                minValue: null,
                                avalue: [],
                                bvalue: [],
                                cvalue: [],
                                topLimit: [],
                                lowerLimit: [],
                                chufa: []
                            }
                            this.list.push(shuju)
                        }
                    }
                    //有下限值
                    if (item.topLimit == 0 && item.lowerLimit !== 0) {
                        item.phaiscType.push('下限')
                        if (item.minValue !== null && item.maxValue !== null) {
                            //最小值等于下限值
                            //图列为A,B,C,暂降,下限
                            if (item.phaiscType.length == 5) {
                                let avalue = []
                                let bvalue = []
                                let cvalue = []
                                let lowerLimit = []
                                item.minValue = item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            avalue.push([item.value[j][0], (item.value[j][1]/keyNum).toFixed(2)])
                                        } else {
                                            avalue.push([])
                                        }
                                        //判断存在缺失值b
                                        if (item.value[j][2] != undefined) {
                                            bvalue.push([item.value[j][0], (item.value[j][2]/keyNum).toFixed(2)])
                                        } else {
                                            bvalue.push([])
                                        }
                                        //判断存在缺失值c
                                        if (item.value[j][3] != undefined) {
                                            cvalue.push([item.value[j][0], (item.value[j][3]/keyNum).toFixed(2)])
                                        } else {
                                            cvalue.push([])
                                        }
                                        //下限值
                                        lowerLimit.push([item.value[j][0], item.lowerLimit.toFixed(2)])
                                    }
                                    //数据为空
                                } else {
                                    avalue = []
                                    bvalue = []
                                    cvalue = []
                                }
                                //不存在一个暂降点或1个 //处理暂降点
                                if (item.eventDetail.length > 0) {
                                    for (var k = 0; k < item.eventDetail.length; k++) {
                                        chufa.push([item.eventDetail[k].time, item.minValue.toFixed(2)])
                                    }
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    avalue: avalue,
                                    bvalue: bvalue,
                                    cvalue: cvalue,
                                    lowerLimit: lowerLimit,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                            //图列为频率等,暂降,下限
                            if (item.phaiscType.length == 3) {
                                let gvalue = []
                                let lowerLimit = []
                                item.minValue = item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            gvalue.push([item.value[j][0], item.value[j][1].toFixed(2)])
                                        } else {
                                            gvalue.push([])
                                        }
                                        //下限值
                                        lowerLimit.push([item.value[j][0], item.lowerLimit.toFixed(2)])
                                    }
                                    //数据为空
                                } else {
                                    gvalue = []
                                }
                                //不存在一个暂降点或1个 //处理暂降点
                                if (item.eventDetail.length > 0) {
                                    for (var k = 0; k < item.eventDetail.length; k++) {
                                        chufa.push([item.eventDetail[k].time, item.minValue.toFixed(2)])
                                    }
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    gvalue: gvalue,
                                    lowerLimit: lowerLimit,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                        } else {
                            var shuju = {
                                id: 'qushifenx' + i,
                                title: item.lineName + '--' + item.targetName,
                                targetName: item.targetName,
                                legend: item.phaiscType,
                                valueName: item.unit[0],
                                minValue: null,
                                avalue: [],
                                bvalue: [],
                                cvalue: [],
                                topLimit: [],
                                lowerLimit: [],
                                chufa: []
                            }
                            this.list.push(shuju)
                        }
                    }
                    //无限值
                    if (item.topLimit == 0 && item.lowerLimit == 0) {
                        if (item.minValue !== null && item.maxValue !== null) {
                            //最小值等于下限值
                            //图列为A,B,C,暂降
                            if (item.phaiscType.length == 4) {
                                let avalue = []
                                let bvalue = []
                                let cvalue = []
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            avalue.push([item.value[j][0], (item.value[j][1]/keyNum).toFixed(2)])
                                        } else {
                                            avalue.push([])
                                        }
                                        //判断存在缺失值b
                                        if (item.value[j][2] != undefined) {
                                            bvalue.push([item.value[j][0], (item.value[j][2]/keyNum).toFixed(2)])
                                        } else {
                                            bvalue.push([])
                                        }
                                        //判断存在缺失值c
                                        if (item.value[j][3] != undefined) {
                                            cvalue.push([item.value[j][0], (item.value[j][3]/keyNum).toFixed(2)])
                                        } else {
                                            cvalue.push([])
                                        }
                                    }
                                    //数据为空
                                } else {
                                    avalue = []
                                    bvalue = []
                                    cvalue = []
                                }
                                //不存在一个暂降点或1个 //处理暂降点
                                if (item.eventDetail.length > 0) {
                                    for (var k = 0; k < item.eventDetail.length; k++) {
                                        chufa.push([
                                            item.eventDetail[k].time,
                                            item.minValue.toFixed(2),
                                            item.eventDetail[k].id,
                                            99
                                        ])
                                    }
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    minValue:
                                        item.minValue > 1 ? (item.minValue - 0.5).toFixed(2) : item.minValue.toFixed(2),
                                    maxValue: item.maxValue.toFixed(3),
                                    avalue: avalue,
                                    bvalue: bvalue,
                                    cvalue: cvalue,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                            //图列为频率等,暂降
                            if (item.phaiscType.length == 2) {
                                let gvalue = []
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            gvalue.push([item.value[j][0], item.value[j][1].toFixed(2)])
                                        } else {
                                            gvalue.push([])
                                        }
                                    }
                                    //数据为空
                                } else {
                                    gvalue = []
                                }
                                //不存在一个暂降点或1个 //处理暂降点
                                if (item.eventDetail.length > 0) {
                                    for (var k = 0; k < item.eventDetail.length; k++) {
                                        chufa.push([
                                            item.eventDetail[k].time,
                                            item.minValue.toFixed(2),
                                            item.eventDetail[k].id,
                                            99
                                        ])
                                    }
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    minValue: item.minValue.toFixed(3),
                                    maxValue: item.maxValue.toFixed(3),
                                    gvalue: gvalue,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                        } else {
                            var shuju = {
                                id: 'qushifenx' + i,
                                title: item.lineName + '--' + item.targetName,
                                targetName: item.targetName,
                                legend: item.phaiscType,
                                valueName: item.unit[0],
                                minValue: null,
                                avalue: [],
                                bvalue: [],
                                cvalue: [],
                                topLimit: [],
                                lowerLimit: [],
                                chufa: []
                            }
                            this.list.push(shuju)
                        }
                    }
                } else if (item.eventDetail == null) {
                    //判断是否有限值(有上下限)
                    if (item.topLimit !== 0 && item.lowerLimit !== 0) {
                        item.phaiscType.push('上限')
                        item.phaiscType.push('下限')
                        if (item.minValue !== null && item.maxValue !== null) {
                            //最小值等于下限值
                            //图列为A,B,C,上限,下限
                            if (item.phaiscType.length == 5) {
                                let avalue = []
                                let bvalue = []
                                let cvalue = []
                                let topLimit = []
                                let lowerLimit = []
                                item.maxValue = item.topLimit
                                item.minValue = item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            avalue.push([item.value[j][0], (item.value[j][1]/keyNum).toFixed(2)])
                                        } else {
                                            avalue.push([])
                                        }
                                        //判断存在缺失值b
                                        if (item.value[j][2] != undefined) {
                                            bvalue.push([item.value[j][0], (item.value[j][2]/keyNum).toFixed(2)])
                                        } else {
                                            bvalue.push([])
                                        }
                                        //判断存在缺失值c
                                        if (item.value[j][3] != undefined) {
                                            cvalue.push([item.value[j][0], (item.value[j][3]/keyNum).toFixed(2)])
                                        } else {
                                            cvalue.push([])
                                        }
                                        //上下限值
                                        topLimit.push([item.value[j][0], item.topLimit.toFixed(2)])
                                        lowerLimit.push([item.value[j][0], item.lowerLimit.toFixed(2)])
                                    }
                                    //数据为空
                                } else {
                                    avalue = []
                                    bvalue = []
                                    cvalue = []
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    avalue: avalue,
                                    bvalue: bvalue,
                                    cvalue: cvalue,
                                    topLimit: topLimit,
                                    lowerLimit: lowerLimit
                                }
                                this.list.push(shuju)
                            }
                            //图列为频率等,上限,下限
                            if (item.phaiscType.length == 3) {
                                let gvalue = []
                                let topLimit = []
                                let lowerLimit = []
                                item.maxValue = item.topLimit
                                item.minValue = item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            gvalue.push([item.value[j][0], item.value[j][1].toFixed(2)])
                                        } else {
                                            gvalue.push([])
                                        }
                                        //上下限值
                                        topLimit.push([item.value[j][0], item.topLimit.toFixed(2)])
                                        lowerLimit.push([item.value[j][0], item.lowerLimit.toFixed(2)])
                                    }
                                    //数据为空
                                } else {
                                    gvalue = []
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    gvalue: gvalue,
                                    topLimit: topLimit,
                                    lowerLimit: lowerLimit,
                                    chufa: chufa
                                }
                                this.list.push(shuju)
                            }
                        } else {
                            var shuju = {
                                id: 'qushifenx' + i,
                                title: item.lineName + '--' + item.targetName,
                                targetName: item.targetName,
                                legend: item.phaiscType,
                                valueName: item.unit[0],
                                minValue: null,
                                avalue: [],
                                bvalue: [],
                                cvalue: [],
                                topLimit: [],
                                lowerLimit: [],
                                chufa: []
                            }
                            this.list.push(shuju)
                        }
                    }
                    //有上限值
                    if (item.topLimit !== 0 && item.lowerLimit == 0) {
                        item.phaiscType.push('上限')
                        if (item.minValue !== null) {
                            //最小值等于下限值
                            //图列为A,B,C,上限
                            if (item.phaiscType.length == 4) {
                                let avalue = []
                                let bvalue = []
                                let cvalue = []
                                let topLimit = []
                                item.maxValue = item.topLimit
                                // item.minValue=item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            avalue.push([item.value[j][0], (item.value[j][1]/keyNum).toFixed(2)])
                                        } else {
                                            avalue.push([])
                                        }
                                        //判断存在缺失值b
                                        if (item.value[j][2] != undefined) {
                                            bvalue.push([item.value[j][0], (item.value[j][2]/keyNum).toFixed(2)])
                                        } else {
                                            bvalue.push([])
                                        }
                                        //判断存在缺失值c
                                        if (item.value[j][3] != undefined) {
                                            cvalue.push([item.value[j][0], (item.value[j][3]/keyNum).toFixed(2)])
                                        } else {
                                            cvalue.push([])
                                        }
                                        //上限值
                                        topLimit.push([item.value[j][0], item.topLimit.toFixed(2)])
                                    }
                                    //数据为空
                                } else {
                                    avalue = []
                                    bvalue = []
                                    cvalue = []
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    maxValue: item.maxValue.toFixed(3),
                                    minValue: item.minValue.toFixed(3),
                                    avalue: avalue,
                                    bvalue: bvalue,
                                    cvalue: cvalue,
                                    topLimit: topLimit
                                }
                                this.list.push(shuju)
                            }
                            //图列为频率等,上限
                            if (item.phaiscType.length == 2) {
                                let gvalue = []
                                let topLimit = []
                                item.maxValue = item.topLimit
                                // item.minValue=item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            gvalue.push([item.value[j][0], item.value[j][1].toFixed(2)])
                                        } else {
                                            gvalue.push([])
                                        }
                                        //上限值
                                        topLimit.push([item.value[j][0], item.topLimit.toFixed(2)])
                                    }
                                    //数据为空
                                } else {
                                    gvalue = []
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    minValue: item.minValue.toFixed(3),
                                    maxValue: item.maxValue.toFixed(3),
                                    gvalue: gvalue,
                                    topLimit: topLimit
                                }
                                this.list.push(shuju)
                            }
                        } else {
                            var shuju = {
                                id: 'qushifenx' + i,
                                title: item.lineName + '--' + item.targetName,
                                targetName: item.targetName,
                                legend: item.phaiscType,
                                valueName: item.unit[0],
                                minValue: null,
                                avalue: [],
                                bvalue: [],
                                cvalue: [],
                                topLimit: [],
                                lowerLimit: [],
                                chufa: []
                            }
                            this.list.push(shuju)
                        }
                    }
                    //有下限值
                    if (item.topLimit == 0 && item.lowerLimit !== 0) {
                        item.phaiscType.push('下限')
                        if (item.minValue !== null) {
                            //最小值等于下限值
                            //图列为A,B,C,下限
                            if (item.phaiscType.length == 4) {
                                let avalue = []
                                let bvalue = []
                                let cvalue = []
                                let lowerLimit = []
                                // item.maxValue=item.topLimit
                                item.minValue = item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            avalue.push([item.value[j][0], (item.value[j][1]/keyNum).toFixed(2)])
                                        } else {
                                            avalue.push([])
                                        }
                                        //判断存在缺失值b
                                        if (item.value[j][2] != undefined) {
                                            bvalue.push([item.value[j][0], (item.value[j][2]/keyNum).toFixed(2)])
                                        } else {
                                            bvalue.push([])
                                        }
                                        //判断存在缺失值c
                                        if (item.value[j][3] != undefined) {
                                            cvalue.push([item.value[j][0], (item.value[j][3]/keyNum).toFixed(2)])
                                        } else {
                                            cvalue.push([])
                                        }
                                        //下限值
                                        lowerLimit.push([item.value[j][0], item.lowerLimit.toFixed(2)])
                                    }
                                    //数据为空
                                } else {
                                    avalue = []
                                    bvalue = []
                                    cvalue = []
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    minValue: item.minValue.toFixed(3),
                                    maxValue: item.maxValue.toFixed(3),
                                    avalue: avalue,
                                    bvalue: bvalue,
                                    cvalue: cvalue,
                                    lowerLimit: lowerLimit
                                }
                                this.list.push(shuju)
                            }
                            //图列为频率等,下限
                            if (item.phaiscType.length == 2) {
                                let gvalue = []
                                let lowerLimit = []
                                // item.maxValue=item.topLimit
                                item.minValue = item.lowerLimit
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            gvalue.push([item.value[j][0], item.value[j][1].toFixed(2)])
                                        } else {
                                            gvalue.push([])
                                        }
                                        //下限值
                                        lowerLimit.push([item.value[j][0], item.lowerLimit.toFixed(2)])
                                    }
                                    //数据为空
                                } else {
                                    gvalue = []
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    minValue: item.minValue.toFixed(3),
                                    maxValue: item.maxValue.toFixed(3),
                                    gvalue: gvalue,
                                    lowerLimit: lowerLimit
                                }
                                this.list.push(shuju)
                            }
                        } else {
                            var shuju = {
                                id: 'qushifenx' + i,
                                title: item.lineName + '--' + item.targetName,
                                targetName: item.targetName,
                                legend: item.phaiscType,
                                valueName: item.unit[0],
                                minValue: null,
                                avalue: [],
                                bvalue: [],
                                cvalue: [],
                                topLimit: [],
                                lowerLimit: [],
                                chufa: []
                            }
                            this.list.push(shuju)
                        }
                    }
                    //无限值
                    if (item.topLimit == 0 && item.lowerLimit == 0) {
                        if (item.minValue !== null) {
                            //最小值等于下限值
                            //图列为A,B,C
                            if (item.phaiscType.length == 3) {
                                let avalue = []
                                let bvalue = []
                                let cvalue = []
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            avalue.push([item.value[j][0], (item.value[j][1]/keyNum).toFixed(2)])
                                        } else {
                                            avalue.push([])
                                        }
                                        //判断存在缺失值b
                                        if (item.value[j][2] != undefined) {
                                            bvalue.push([item.value[j][0], (item.value[j][2]/keyNum).toFixed(2)])
                                        } else {
                                            bvalue.push([])
                                        }
                                        //判断存在缺失值c
                                        if (item.value[j][3] != undefined) {
                                            cvalue.push([item.value[j][0], (item.value[j][3]/keyNum).toFixed(2)])
                                        } else {
                                            cvalue.push([])
                                        }
                                    }
                                    //数据为空
                                } else {
                                    avalue = []
                                    bvalue = []
                                    cvalue = []
                                }

                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    minValue: item.minValue.toFixed(3),
                                    maxValue: item.maxValue.toFixed(3),
                                    avalue: avalue,
                                    bvalue: bvalue,
                                    cvalue: cvalue
                                }
                                this.list.push(shuju)
                            }
                            //图列为频率等
                            if (item.phaiscType.length == 1) {
                                let gvalue = []
                                //判断数据是否存在
                                if (item.value !== null) {
                                    for (var j = 0; j < item.value.length; j++) {
                                        //判断存在缺失值a
                                        if (item.value[j][1] != undefined) {
                                            gvalue.push([item.value[j][0], item.value[j][1].toFixed(2)])
                                        } else {
                                            gvalue.push([])
                                        }
                                    }
                                    //数据为空
                                } else {
                                    gvalue = []
                                }
                                var shuju = {
                                    id: 'qushifenx' + i,
                                    title: item.lineName + '--' + item.targetName,
                                    targetName: item.targetName,
                                    legend: item.phaiscType,
                                    valueName: item.unit[0],
                                    minValue: item.minValue.toFixed(3),
                                    maxValue: item.maxValue.toFixed(3),
                                    gvalue: gvalue
                                }
                                this.list.push(shuju)
                            }
                        } else {
                            var shuju = {
                                id: 'qushifenx' + i,
                                title: item.lineName + '--' + item.targetName,
                                targetName: item.targetName,
                                legend: item.phaiscType,
                                valueName: item.unit[0],
                                minValue: null,
                                avalue: [],
                                bvalue: [],
                                cvalue: [],
                                topLimit: [],
                                lowerLimit: [],
                                chufa: []
                            }
                            this.list.push(shuju)
                        }
                    }
                }
            })

            this.Rendering()
        },

        Rendering() {
            this.loading = true
            this.list.forEach(item => {
                var opitonserise = []
                item.legend.forEach(item2 => {
                    if (item.avalue !== undefined && (item2 == 'A相' || item2 == 'AB相' || item2 == '零序电压')) {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            smooth: true,
                            itemStyle: {
                                normal: {
                                    color: '#FFCC00'
                                }
                            },

                            data: item.avalue
                        }
                        opitonserise.push(data)
                    } else if (
                        item.bvalue !== undefined &&
                        (item2 == 'B相' || item2 == 'BC相' || item2 == '正序电压')
                    ) {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            smooth: true,
                            itemStyle: {
                                normal: {
                                    color: '#339900'
                                }
                            },

                            data: item.bvalue
                        }
                        opitonserise.push(data)
                    } else if (
                        item.cvalue !== undefined &&
                        (item2 == 'C相' || item2 == 'CA相' || item2 == '负序电压')
                    ) {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            smooth: true,
                            barWidth: 22,
                            itemStyle: {
                                normal: {
                                    color: '#FF3300'
                                }
                            },
                            data: item.cvalue
                        }
                        opitonserise.push(data)
                    } else if (item.topLimit !== undefined && item2 == '上限') {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            smooth: true,
                            itemStyle: {
                                normal: {
                                    color: '#FF33FF',
                                    lineStyle: {
                                        width: 2,
                                        color: '#FF33FF',
                                        type: 'dotted' //'dotted'虚线 'solid'实线
                                    }
                                }
                            },
                            data: item.topLimit
                        }
                        opitonserise.push(data)
                    } else if (item.lowerLimit !== undefined && item2 == '下限') {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            smooth: true,
                            barWidth: 22,
                            itemStyle: {
                                normal: {
                                    color: '#3399FF',
                                    lineStyle: {
                                        width: 2,
                                        color: '#3399FF',
                                        type: 'dotted' //'dotted'虚线 'solid'实线
                                    }
                                }
                            },
                            data: item.lowerLimit
                        }
                        opitonserise.push(data)
                    } else if (item.chufa !== undefined && item2 == '暂态触发点') {
                        var data = {
                            name: item2,
                            type: 'scatter',
                            symbol: 'image://' + this.url,
                            symbolSize: 16,
                            itemStyle: {
                                width: '22px',
                                height: '22px'
                            },
                            data: item.chufa
                        }
                        opitonserise.push(data)
                    } else if (item.gvalue !== undefined && item2 == '频率') {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            smooth: true,
                            itemStyle: {
                                normal: {
                                    color: '#990099',
                                    lineStyle: {
                                        width: 2,
                                        color: '#990099',
                                        type: 'solid' //'dotted'虚线 'solid'实线
                                    }
                                }
                            },
                            data: item.gvalue
                        }
                        opitonserise.push(data)
                    } else if (item.gvalue !== undefined && item2 == '负序电流') {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            barWidth: 22,
                            itemStyle: {
                                normal: {
                                    color: '#999933'
                                }
                            },
                            data: item.gvalue
                        }
                        opitonserise.push(data)
                    } else if (item.gvalue !== undefined && item2 == '三相电压不平衡度') {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            barWidth: 22,
                            itemStyle: {
                                normal: {
                                    color: '#FF6600'
                                }
                            },
                            data: item.gvalue
                        }
                        opitonserise.push(data)
                    } else if (
                        item.gvalue !== undefined &&
                        (item2 == '三相总有功功率' || item2 == '三相总无功功率' || item2 == '三相总视在功率')
                    ) {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            barWidth: 22,
                            itemStyle: {
                                normal: {
                                    color: '#0033ff'
                                }
                            },
                            data: item.gvalue
                        }
                        opitonserise.push(data)
                    } else if (item.gvalue !== undefined && (item2 == '总视在功率因数' || item2 == '总位移功率因数')) {
                        var data = {
                            name: item2,
                            symbol: 'none',
                            symbolSize: 5,
                            type: 'line',
                            barWidth: 22,
                            itemStyle: {
                                normal: {
                                    color: '#00FF00'
                                }
                            },

                            data: item.gvalue
                        }
                        opitonserise.push(data)
                    } else {
                        opitonserise.push([])
                    }
                })
                if (item.valueName == undefined) {
                    item.valueName = '无'
                }
                //console.log('渲染数据体',opitonserise)
                item.serise = opitonserise
            })

            this.$nextTick(() => {
                this.getEcharts()
            })
        },
        getEcharts() {
            this.loading = true
            var arr = []
            const echarts = require('echarts')
            let index = ''
            // console.log(123123, this.list)
            this.list.forEach((item, i) => {
                index = i
                let domeId = document.getElementById(item.id)
                setTimeout(() => {
                    domeId.style.width = document.getElementById('tubiao').offsetWidth - 20 + 'px'
                    if (this.list.length == 1) {
                        domeId.style.height = window.sessionStorage.getItem('appheight') - 130 + 'px'
                    } else {
                        domeId.style.height = window.sessionStorage.getItem('appheight') / 2.3 + 'px'
                    }
                }, 0)
                var myChartes = echarts.init(domeId)
                this.myChartes = myChartes
                let echartsColor = JSON.parse(window.localStorage.echartsColor)
                myChartes.clear()
                var option = {
                    backgroundColor: '#fff',
                    title: {
                        left: 'center',
                        text: item.title,
                        textStyle: {
                            fontSize: yan.EchartObject.xNamefontSize,
                            color: echartsColor.WordColor
                        }
                    },
                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            //type: "shadow",
                            type: 'cross', // 默认为直线，可选为：'line' | 'shadow'
                            label: {
                                color: '#fff',
                                fontSize: 16
                            }
                        },
                        textStyle: {
                            color: '#fff',
                            fontStyle: 'normal',
                            opacity: 0.35,
                            fontSize: 14
                        },
                        backgroundColor: 'rgba(0,0,0,0.35)',

                        formatter: function (params) {
                            var tips = ''
                            tips += '时刻:' + params[0].data[0] + '</br/>'
                            for (var i = 0; i < params.length; i++) {
                                if (params[i].seriesName == '暂态触发点') {
                                    tips += ''
                                    return tips
                                }
                                if (params[i].seriesName == 'A相谐波电流方向') {
                                    tips +=
                                        params[i].value[1] > 0
                                            ? 'A相谐波电流方向:流入<br/>'
                                            : params[i].value[1] == 0
                                            ? 'A相谐波电流方向:无<br/>'
                                            : 'A相谐波电流方向:流出<br/>'
                                } else if (params[i].seriesName == 'B相谐波电流方向') {
                                    tips +=
                                        params[i].value[1] > 0
                                            ? 'B相谐波电流方向:流入<br/>'
                                            : params[i].value[1] == 0
                                            ? 'B相谐波电流方向:无<br/>'
                                            : 'B相谐波电流方向:流出<br/>'
                                } else if (params[i].seriesName == 'C相谐波电流方向') {
                                    tips +=
                                        params[i].value[1] > 0
                                            ? 'C相谐波电流方向:流入<br/>'
                                            : params[i].value[1] == 0
                                            ? 'C相谐波电流方向:无<br/>'
                                            : 'C相谐波电流方向:流出<br/>'
                                } else if (params[i].seriesName == '总谐波电流方向') {
                                    tips +=
                                        params[i].value[1] > 0
                                            ? '总谐波电流方向:流入<br/>'
                                            : params[i].value[1] == 0
                                            ? '总谐波电流方向:无<br/>'
                                            : '总谐波电流方向:流出<br/>'
                                } else if (params[i].seriesName == '正序电压') {
                                    let str = (params[i].value[1] * 1).toString()
                                    let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
                                    let str1 = str.replace(reg, '$1,')
                                    tips += params[i].seriesName + ':' + str1 + 'kV<br/>'
                                } else if (params[i].seriesName == '零序电压' || params[i].seriesName == '负序电压') {
                                    let str = (params[i].value[1] * 1).toString()
                                    let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
                                    let str1 = str.replace(reg, '$1,')
                                    tips += params[i].seriesName + ':' + str1 + 'V<br/>'
                                } else if (params[i].seriesName !== '正序电压') {
                                    let str = (params[i].value[1] * 1).toString()
                                    let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
                                    let str1 = str.replace(reg, '$1,')
                                    tips += params[i].seriesName + ':' + str1 + '<br/>'
                                } else {
                                    let str = (params[i].value[2] * 1).toString()
                                    let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
                                    let str1 = str.replace(reg, '$1,')
                                    tips += params[i].seriesName + ':' + str1 + '<br/>'

                                    let str2 = (params[i].value[3] * 1).toString()
                                    let reg2 = str2.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g
                                    let str12 = str.replace(reg2, '$1,')
                                    // if(params[i].seriesName){

                                    // }
                                    tips += params[i].seriesName + ':' + str12 + '<br/>'
                                }
                            }

                            return tips
                        }
                    },
                    grid: yan.EchartObject.grid8,
                    legend: {
                        left: '140px',
                        verticalAlign: 'top',
                        enabled: true,
                        itemDistance: 5,
                        textStyle: {
                            color: echartsColor.WordColor,
                            rich: {
                                a: {
                                    verticalAlign: 'middle'
                                }
                            },

                            padding: [0, 0, 0, 0] //[上、右、下、左]
                        }

                        // itemHeight: 14,
                        // itemWidth: 14,
                        // data: item.legend,
                        // textStyle: {
                        //   color:  echartsColor.WordColor
                        // }
                    },

                    dataZoom: yan.EchartObject.dataZoom,
                    xAxis: [
                        {
                            name: yan.EchartObject.time,
                            nameTextStyle: {
                                color: echartsColor.WordColor
                            },
                            type: 'time',
                            axisLine: {
                                show: true,
                                onZero: false,
                                lineStyle: {
                                    color: echartsColor.thread
                                }
                            },
                            axisLabel: {
                                textStyle: {
                                    fontFamily: 'dinproRegular',
                                    color: echartsColor.WordColor
                                }
                            }
                        }
                    ],
                    toolbox: {
                        show: true,
                        feature: {
                            dataZoom: {
                                // bottom: '10px',
                                yAxisIndex: 'none'
                            },
                            //saveAsImage: {},
                            myFull: {
                                show: true,
                                title: '全屏查看',
                                id: item.id,
                                icon: 'path://M432.45,595.444c0,2.177-4.661,6.82-11.305,6.82c-6.475,0-11.306-4.567-11.306-6.82s4.852-6.812,11.306-6.812C427.841,588.632,432.452,593.191,432.45,595.444L432.45,595.444z M421.155,589.876c-3.009,0-5.448,2.495-5.448,5.572s2.439,5.572,5.448,5.572c3.01,0,5.449-2.495,5.449-5.572C426.604,592.371,424.165,589.876,421.155,589.876L421.155,589.876z M421.146,591.891c-1.916,0-3.47,1.589-3.47,3.549c0,1.959,1.554,3.548,3.47,3.548s3.469-1.589,3.469-3.548C424.614,593.479,423.062,591.891,421.146,591.891L421.146,591.891zM421.146,591.891',
                                onclick: e => {
                                    let element = document.getElementById(item.id)
                                    if (element.requestFullScreen) {
                                        // HTML W3C 提议
                                        element.requestFullScreen()
                                    } else if (element.msRequestFullscreen) {
                                        // IE11
                                        element.msRequestFullScreen()
                                    } else if (element.webkitRequestFullScreen) {
                                        // Webkit (works in Safari5.1 and Chrome 15)
                                        element.webkitRequestFullScreen()
                                    } else if (element.mozRequestFullScreen) {
                                        // Firefox (works in nightly)
                                        element.mozRequestFullScreen()
                                    }
                                    // 退出全屏
                                    if (element.requestFullScreen) {
                                        document.exitFullscreen()
                                    } else if (element.msRequestFullScreen) {
                                    } else if (element.webkitRequestFullScreen) {
                                        document.webkitCancelFullScreen()
                                    } else if (element.mozRequestFullScreen) {
                                        document.mozCancelFullScreen()
                                    }
                                }
                            }
                        }
                    },
                    yAxis: [
                        // (item.minValue - 0.5).toFixed(2)
                        {
                            type: 'value',
                            // nameGap:5,
                            // boundaryGap: [0.2, 0.2],
                            // min:item.minValue>0?(item.minValue>50?Number(item.minValue)-Number(item.minValue*0.01):Number(item.minValue)-Number(item.minValue*0.05)):(item.minValue<-1?Number(item.minValue)+Number(item.minValue*0.01):Number(item.minValue)-Number(item.minValue*0.01)),
                            // max:item.maxValue>50?
                            //     (item.maxValue<100?
                            //       Number(item.maxValue)+Number(item.maxValue*0.3)
                            //       :Number(item.maxValue)+Number(item.maxValue*0.1))
                            //     :(item.maxValue<10?
                            //       (item.maxValue>0&&item.maxValue<1?
                            //        (Number(item.maxValue)+Number(item.maxValue*0.002))
                            //        :(Number(item.maxValue)+Number(item.maxValue*0.005))
                            //        ):(Number(item.maxValue)+Number(item.maxValue*0.01))),
                            min: item.minValue,
                            //max: Number(item.maxValue)+Number(item.maxValue*0.05),
                            // splitNumber : 1,
                            name: item.valueName,
                            axisLabel: {
                                interval: 0,
                                formatter: function (value, index) {
                                    return value.toFixed(3)
                                },
                                left: '20px',
                                color: echartsColor.WordColor
                            },

                            axisLine: {
                                show: true,
                                onZero: false, //-----------重点
                                lineStyle: {
                                    color: echartsColor.thread
                                }
                            },
                            splitLine: {
                                lineStyle: {
                                    // 使用深浅的间隔色
                                    color: [echartsColor.thread],
                                    type: 'dashed',
                                    opacity: 0.5
                                }
                            }
                        }
                    ],
                    series: item.serise
                }
                let aValues = []
                let bValues = []
                let CValues = []
                let ZValues = []

                if (
                    this.Traceability.length > 0 &&
                    this.Traceability[0].value != null &&
                    this.Traceability[0].value.length > 0
                ) {
                    this.Traceability[0].value.forEach(val50 => {})
                    for (let i = 0; i < this.Traceability[0].value.length; i++) {
                        let T = this.Traceability[0].value[i][0]
                        let A = this.Traceability[0].value[i][1]
                        let B = this.Traceability[0].value[i][2]
                        let C = this.Traceability[0].value[i][3]
                        let Z = A + B + C
                        aValues.push([T, A > 0 ? 1 : A == 0 ? 0 : -1])
                        bValues.push([T, B > 0 ? 1 : B == 0 ? 0 : -1])
                        CValues.push([T, C > 0 ? 1 : C == 0 ? 0 : -1])
                        ZValues.push([T, Z > 0 ? 1 : Z == 0 ? 0 : -1])
                    }
                }

                if (item.targetName == '谐波电流方向') {
                    option.tooltip.axisPointer = null
                    option.yAxis[0] = {
                        type: 'value',
                        interval: 1,
                        min: -2, //最小值
                        max: 2,
                        axisLine: {
                            show: true,
                            onZero: false, //-----------重点
                            lineStyle: {
                                color: echartsColor.thread
                            }
                        },
                        splitLine: {
                            lineStyle: {
                                // 使用深浅的间隔色
                                color: [echartsColor.thread],
                                type: 'dashed',
                                opacity: 0.5
                            }
                        },
                        axisLabel: {
                            formatter: function (value) {
                                if (value == 0) {
                                    return '无'
                                } else if (value == -1) {
                                    return '流出'
                                } else if (value == 1) {
                                    return '流入'
                                }
                            }
                        }
                    }
                    option.series = [
                        {
                            name: 'A相谐波电流方向',
                            type: 'line',

                            data: aValues,
                            symbol: 'none',
                            symbolSize: 0,
                            itemStyle: {
                                normal: {
                                    color: '#FFCC00'
                                }
                            }
                        },
                        {
                            name: 'B相谐波电流方向',
                            type: 'line',

                            data: bValues,
                            symbol: 'none',
                            symbolSize: 0,
                            itemStyle: {
                                normal: {
                                    color: '#339900'
                                }
                            }
                        },
                        {
                            name: 'C相谐波电流方向',
                            type: 'line',

                            data: CValues,
                            symbol: 'none',
                            symbolSize: 0,
                            itemStyle: {
                                normal: {
                                    color: '#FF3300'
                                }
                            }
                        },
                        {
                            name: '总谐波电流方向',
                            type: 'line',

                            data: ZValues,
                            symbol: 'none',
                            symbolSize: 0,
                            itemStyle: {
                                normal: {
                                    color: '#0033ff'
                                }
                            }
                        }
                    ]
                }
                myChartes.setOption(option)
                window.echartsArr.push(myChartes)
                setTimeout(() => {
                    this.loading = false
                }, 100)
                myChartes.on('click', function (params) {
                    if (_this.boxFlg) {
                        _this.boxFlg = false
                        return
                    }
                    if (params.data[3] == 99) {
                        _this.$emit('BoXi', params.data[2])
                        _this.boxFlg = true
                    }
                })

                arr.push(myChartes)
            })
            echarts.connect(arr)
            this.arrtu = arr

            let _this = this
            _this.$erd.listenTo(_this.$refs.kk, element => {
                _this.$nextTick(() => {
                    for (var i = 0; i < arr.length; i++) {
                        // domeId.style.width = document.getElementById("quntu").offsetWidth - 0 + 'px'
                        arr[i].resize()
                    }
                })
            })

            //let c = Date.now();
            //  console.log("渲染完", c);
        }
    }
}
</script>
<style lang="less" scoped>
// .myDIV {
//    width:42%;height:100px;background:#fff;position:absolute;z-index:100;opacity:0.9;
//     right: 0;
//     top:-100px;
//     overflow: hidden;
//     -webkit-animation: mymove 0.5s infinite; /* Chrome, Safari, Opera */
//     animation: mymove 0.5s infinite;
// }
// @-webkit-keyframes mymove {
//     50% {top: 0px;}
// }

// /* Standard syntax */
// @keyframes mymove {
//     50% {top: 0px;}
// }

.el-button--text {
    color: #003078;
    font-size: px;
    font-weight: bold;
}
</style>
<style lang="scss" scoped>
.container {
    /* margin: auto; */
    top: 0px;
    right: 0;
    width: 46%;
    height: 0px;
    z-index: 2000;
    position: absolute;
    background-color: #e4e7ebb9;
    overflow: auto;
    scroll-behavior: smooth;
    -radius: 20px;
}
/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: block;
    width: 8px !important;
}
.expend {
    animation: expend ease 5s forwards;
}
.close-container {
    animation: no-expend ease 1s forwards;
}
@keyframes expend {
    from {
        top: 0px;
        height: auto;
    }
    to {
        height: auto;
        top: 0px;
    }
}
@keyframes no-expend {
    from {
        height: 20%;
        top: 0px;
    }
    to {
        top: 0px;
        height: 0px;
    }
}
.coles {
    position: absolute;
    right: 0;
    font-size: 20px;
    cursor: pointer;
}
</style>
