<template>
    <div class="pd10" v-loading="konzhi" element-loading-text="数据加载中">
        <el-form :inline="true" class="demo-form-inline">
            <el-form-item label="指标类型:">
                <el-select
                    v-model="formData.statisticalType"
                    @change="gbName"
                    placeholder="请选择指标类型"
                    style="width: 100%"
                >
                    <el-option
                        v-for="item in classificationData"
                        :key="item.id"
                        :label="item.name"
                        :value="{
                            label: item.name,
                            value: item.id,
                            name: item.name,
                            id: item.id,
                            code: item.code,
                            sort: item.sort
                        }"
                    ></el-option>
                </el-select>
            </el-form-item>
            <el-form-item>
                <timepicker :id="id" ref="wqt" :interval="interval" :name="name" :path="path"></timepicker>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" size="small" @click="tensort">排名前10监测点</el-button>
                <el-button @click="querfromdata" type="primary" icon="el-icon-search">查询</el-button>
            </el-form-item>
            <!-- <el-form-item>
             <el-button type="text"  @click="closeHandle">条件筛选<i :class="!view3?'el-icon-arrow-down':'el-icon-arrow-right'"></i></el-button>
      </el-form-item> -->
        </el-form>

        <div class="container" id="container">
            <i @click="closeHandle" class="el-icon-circle-close coless"></i>
            <el-form :inline="true" :model="formData" label-width="90px" class=""></el-form>
        </div>

        <el-row>
            <el-col :span="12">
                <!-- <span class="wr">污染预警:</span> -->
                <el-tag style="background: #339966; color: #fff; border: #fff" size="mini">1级</el-tag>
                <span style="color: #339966; font-weight: bold">:无污染(0,1]</span>
                <el-tag style="background: #3399ff; color: #fff; border: #fff" size="mini">2级</el-tag>
                <span style="color: #3399ff; font-weight: bold">:轻微污染(1,1.2]</span>
                <el-tag style="background: #ffcc33; color: #fff; border: #fff" size="mini">3级</el-tag>
                <span style="color: #ffcc33; font-weight: bold">:轻度污染(1.2,1.6]</span>
                <el-tag style="background: #ff9900; color: #fff; border: #fff" size="mini">4级</el-tag>
                <span style="color: #ff9900; font-weight: bold">:中度污染(1.6,2]</span>
                <el-tag style="background: #cc0000; color: #fff; border: #fff" size="mini">5级</el-tag>
                <span style="color: #cc0000; font-weight: bold">:重度污染(2,+∞)</span>

                <!-- <el-tag style="background: #999999; color: #fff" circle>无</el-tag
        > -->
                <!-- <span style="color:#999999;font-weight:bold">:无数据</span> -->

                <div :style="`height:${vh};overflow-y:auto;overflow-x:hidden;cursor:pointer;`">
                    <el-row :gutter="5">
                        <el-col v-for="(item, index) in listcard" :key="index" :span="8" class="qwe">
                            <el-card
                                class="box-card3"
                                :style="
                                    'height:25vh;color:#fff;opacity:0.8;background-image:linear-gradient(' +
                                    settings.themeColor +
                                    ',#ccc);'
                                "
                            >
                                <div
                                    slot="header"
                                    class="clearfix"
                                    :style="
                                        'height:30px;background:' + settings.themeColor + ';padding:2%;cursor: pointer;'
                                    "
                                    @click="queryStation(item)"
                                >
                                    <span class="asd" style="">{{ item.name }}</span>
                                    <el-tag
                                        v-if="item.data == 3.14159 || item.data == 0"
                                        style="background: #ccc; color: #fff"
                                        size="mini"
                                    >
                                        无
                                    </el-tag>
                                    <el-tag
                                        v-if="0 < item.data && item.data < 1 && item.data !== 3.14159"
                                        style="background: #339966; color: #fff"
                                        size="mini"
                                    >
                                        1级
                                    </el-tag>
                                    <el-tag
                                        v-if="1 <= item.data && item.data < 1.2 && item.data !== 3.14159"
                                        style="background: #3399ff; color: #fff"
                                        size="mini"
                                    >
                                        2级
                                    </el-tag>
                                    <el-tag
                                        v-if="1.2 <= item.data && item.data < 1.6 && item.data !== 3.14159"
                                        style="background: #ffcc33; color: #fff"
                                        size="mini"
                                    >
                                        3级
                                    </el-tag>
                                    <el-tag
                                        v-if="1.6 <= item.data && item.data < 2 && item.data !== 3.14159"
                                        style="background: #ff9900; color: #fff"
                                        size="mini"
                                    >
                                        4级
                                    </el-tag>
                                    <el-tag
                                        v-if="2 <= item.data && item.data && item.data !== 3.14159"
                                        style="background: #cc0000; color: #fff"
                                        size="mini"
                                    >
                                        5级
                                    </el-tag>
                                </div>
                                <div class="cvb">
                                    <el-col
                                        :span="12"
                                        v-for="(item1, index1) in item.children"
                                        :key="index1"
                                        class="fgh"
                                    >
                                        <div class="jkl" @click="queryline(item1.id, item1.pid, item1.name)">
                                            <el-tag
                                                v-if="item1.data == 3.14159 || item1.data == 0"
                                                style="background: #ccc; color: #fff"
                                                size="mini"
                                            >
                                                无
                                            </el-tag>
                                            <el-tag
                                                v-if="0 < item1.data && item1.data < 1 && item1.data !== 3.14159"
                                                style="background: #339966; color: #fff"
                                                size="mini"
                                            >
                                                1级
                                            </el-tag>
                                            <el-tag
                                                v-if="1 <= item1.data && item1.data < 1.2 && item1.data !== 3.14159"
                                                style="background: #3399ff; color: #fff"
                                                size="mini"
                                            >
                                                2级
                                            </el-tag>
                                            <el-tag
                                                v-if="1.2 <= item1.data && item1.data < 1.6 && item1.data !== 3.14159"
                                                style="background: #ffcc33; color: #fff"
                                                size="mini"
                                            >
                                                3级
                                            </el-tag>
                                            <el-tag
                                                v-if="1.6 <= item1.data && item1.data < 2 && item1.data !== 3.14159"
                                                style="background: #ff9900; color: #fff"
                                                size="mini"
                                            >
                                                4级
                                            </el-tag>
                                            <el-tag
                                                v-if="2 <= item1.data && item1.data && item1.data !== 3.14159"
                                                style="background: #cc0000; color: #fff"
                                                size="mini"
                                            >
                                                5级
                                            </el-tag>
                                            <span class="xdf">
                                                <el-tooltip
                                                    :open-delay="500"
                                                    effect="light"
                                                    :visible-arrow="false"
                                                    :content="item1.name"
                                                    popper-class="atooltip"
                                                    placement="bottom-start"
                                                >
                                                    <el-button size="mini" type="text" class="ll">
                                                        {{ item1.name.substr(0, 6) }}
                                                    </el-button>
                                                </el-tooltip>
                                            </span>
                                        </div>
                                    </el-col>
                                </div>
                            </el-card>
                        </el-col>
                    </el-row>
                </div>
            </el-col>
            <el-col :span="12">
                <el-row>
                    <el-col :span="24" id="wqtb" :style="`height:${vhh};overflow: hidden;`">
                        <qypowerpollution :xdata="xdata" :ydata="ydata" :title="title" ref="child"></qypowerpollution>
                    </el-col>
                    <el-col :span="24">
                        <el-table
                            stripe
                            :data="tableData"
                            class="xshou mt10"
                            border
                            highlight-current-row
                            header-cell-class-name="table_header"
                            :height="vvh"
                            :style="'width: 100%'"
                        >
                            <el-table-column align="center" prop="name" label="名称"></el-table-column>
                            <el-table-column align="center" prop="data" sortable :label="changeName">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无数据</span>
                                    <span
                                        v-if="scope.row.data !== 3.14159 && scope.row.data !== 0"
                                        type="primary"
                                        size="small"
                                    >
                                        {{ scope.row.data }}
                                    </span>
                                    <span v-if="scope.row.data == 0" type="primary" size="small">/</span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" prop="data" sortable label="污区严重度评估">
                                <template slot-scope="scope">
                                    <span
                                        v-if="0 < scope.row.data && scope.row.data < 1 && scope.row.data !== 3.14159"
                                        type="primary"
                                        size="small"
                                    >
                                        无污染
                                    </span>
                                    <span
                                        v-if="1 <= scope.row.data && scope.row.data < 1.2 && scope.row.data !== 3.14159"
                                        type="success"
                                        size="small"
                                    >
                                        轻微污染
                                    </span>
                                    <span
                                        v-if="
                                            1.2 <= scope.row.data && scope.row.data < 1.6 && scope.row.data !== 3.14159
                                        "
                                        type="primary"
                                        size="small"
                                    >
                                        轻度污染
                                    </span>
                                    <span
                                        v-if="1.6 <= scope.row.data && scope.row.data < 2 && scope.row.data !== 3.14159"
                                        type="success"
                                        size="small"
                                    >
                                        中度污染
                                    </span>
                                    <span
                                        v-if="2 <= scope.row.data && scope.row.data && scope.row.data !== 3.14159"
                                        type="primary"
                                        size="small"
                                    >
                                        重度污染
                                    </span>
                                    <span
                                        v-if="scope.row.data == 3.14159 || scope.row.data == 0"
                                        type="primary"
                                        size="small"
                                    >
                                        暂无评估
                                    </span>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                </el-row>

                <!--变电站-->
                <el-dialog
                    class="eldialot"
                    :close-on-click-modal="false"
                    :title="stationNmae + '详情'"
                    width="70%"
                    :visible.sync="dialogTableVisible"
                >
                    <el-table
                        stripe
                        :data="stationData"
                        border
                        highlight-current-row
                        header-cell-class-name="table_header"
                        :header-cell-style="{
                            height: '25px',
                            padding: '0px'
                        }"
                        :row-style="{ height: '28px' }"
                        :cell-style="{ padding: '0px' }"
                        height="60vh"
                        v-loading="konzhi"
                        element-loading-text="数据加载中"
                        style="width: 100%"
                    >
                        <el-table-column
                            align="center"
                            property="name"
                            label="名称"
                            min-width="180"
                            :show-overflow-tooltip="true"
                        ></el-table-column>
                        <el-table-column
                            align="center"
                            property="voltageLevel"
                            v-if="flag"
                            :label="zdname"
                        ></el-table-column>
                        <el-table-column align="center" property="data" :label="changeName">
                            <template slot-scope="scope">
                                <span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无数据</span>
                                <span v-if="scope.row.data !== 3.14159" type="primary" size="small">
                                    {{ scope.row.data }}
                                </span>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" property="data" label="评估">
                            <template slot-scope="scope">
                                <span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无评估</span>
                                <span
                                    v-if="0 <= scope.row.data && scope.row.data < 1 && scope.row.data !== 3.14159"
                                    type="primary"
                                    size="small"
                                >
                                    无污染
                                </span>
                                <span
                                    v-if="1 <= scope.row.data && scope.row.data < 1.2 && scope.row.data !== 3.14159"
                                    type="success"
                                    size="small"
                                >
                                    轻微污染
                                </span>
                                <span
                                    v-if="1.2 <= scope.row.data && scope.row.data < 1.6 && scope.row.data !== 3.14159"
                                    type="primary"
                                    size="small"
                                >
                                    轻度污染
                                </span>
                                <span
                                    v-if="1.6 <= scope.row.data && scope.row.data < 2 && scope.row.data !== 3.14159"
                                    type="success"
                                    size="small"
                                >
                                    中度污染
                                </span>
                                <span
                                    v-if="2 <= scope.row.data && scope.row.data && scope.row.data !== 3.14159"
                                    type="primary"
                                    size="small"
                                >
                                    重度污染
                                </span>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-dialog>
                <!--监测点-->
                <el-dialog
                    class="eldialot"
                    :close-on-click-modal="false"
                    :title="lineName + '所属监测点详情'"
                    width="70%"
                    :visible.sync="dialogTableVisible1"
                >
                    <el-table
                        stripe
                        :data="lineData"
                        v-loading="konzhi"
                        element-loading-text="数据加载中"
                        highlight-current-row
                        header-cell-class-name="table_header"
                        :header-cell-style="{
                            height: '25px',
                            padding: '0px'
                        }"
                        :row-style="{ height: '28px' }"
                        :cell-style="{ padding: '0px' }"
                        border
                        height="60vh"
                        style="width: 100%"
                    >
                        <el-table-column
                            align="center"
                            property="name"
                            label="名称"
                            :show-overflow-tooltip="true"
                        ></el-table-column>
                        <el-table-column align="center" property="powerCompany" label="供电公司"></el-table-column>
                        <el-table-column
                            align="center"
                            property="substation"
                            label="变电站"
                            :show-overflow-tooltip="true"
                        ></el-table-column>
                        <el-table-column align="center" property="busBar" label="母线"></el-table-column>
                        <el-table-column align="center" property="data" :label="changeName">
                            <template slot-scope="scope">
                                <span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无数据</span>
                                <span v-if="scope.row.data !== 3.14159" type="primary" size="small">
                                    {{ scope.row.data }}
                                </span>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" property="data" label="评估">
                            <template slot-scope="scope">
                                <span v-if="scope.row.data == 3.14159" type="primary" size="small">暂无评估</span>
                                <span
                                    v-if="0 <= scope.row.data && scope.row.data < 1 && scope.row.data !== 3.14159"
                                    type="primary"
                                    size="small"
                                >
                                    无污染
                                </span>
                                <span
                                    v-if="1 <= scope.row.data && scope.row.data < 1.2 && scope.row.data !== 3.14159"
                                    type="success"
                                    size="small"
                                >
                                    轻微污染
                                </span>
                                <span
                                    v-if="1.2 <= scope.row.data && scope.row.data < 1.6 && scope.row.data !== 3.14159"
                                    type="primary"
                                    size="small"
                                >
                                    轻度污染
                                </span>
                                <span
                                    v-if="1.6 <= scope.row.data && scope.row.data < 2 && scope.row.data !== 3.14159"
                                    type="success"
                                    size="small"
                                >
                                    中度污染
                                </span>
                                <span
                                    v-if="2 <= scope.row.data && scope.row.data && scope.row.data !== 3.14159"
                                    type="primary"
                                    size="small"
                                >
                                    重度污染
                                </span>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-dialog>
                <!--排名前十监测点-->
                <el-dialog
                    class="eldialot"
                    :close-on-click-modal="false"
                    title="排名前10的监测点"
                    width="70%"
                    :visible.sync="dialogTableVisible2"
                >
                    <div id="tenlineechart" :style="'width:100%;height:calc(100vh - 400px);zoom:' + device"></div>
                </el-dialog>
            </el-col>
        </el-row>
    </div>
</template>
<script>
import api from '@/api/pollution/pollution'
import yan from '@/assets/commjs/color'
import { mapActions } from 'vuex'
import store from '@/store'
import defaultSettings from '@/settings'
import { dicData } from '../../../assets/commjs/dictypeData'
import timepicker from '../../components/TimePicker/index4'
import qypowerpollution from '../../components/echarts/qypowerpollution'
import { color } from 'echarts'
export default {
    name: 'pollutionareamap',
    components: {
        timepicker,
        qypowerpollution
    },
    computed: {
        settings() {
            return this.$store.state.settings
        }
        // ...mapActions({
        //   changeSetting: 'settings/changeSetting'
        // }),
    },
    watch: {
        interval(a, b) {
            if (a == 1) {
                this.formData.reportFlag = 1
            } else if (a == 2) {
                this.formData.reportFlag = 2
            } else if (a == 3) {
                this.formData.reportFlag = 3
            } else if (a == 4) {
                this.formData.reportFlag = 4
            } else if (a == 5) {
                this.formData.reportFlag = 5
            }
        }
    },
    data() {
        return {
            vh: null,
            vhh: null,
            vvh: null,
            color: window.localStorage.CUSTOM_SETTINGS.themeColor,
            h: undefined,
            loading: true,
            echartsheight: undefined,
            tenheight: undefined,
            konzhi: true,
            pickerOptions: {
                shortcuts: [
                    {
                        text: '最近一周',
                        onClick(picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
                            picker.$emit('pick', [start, end])
                        }
                    },
                    {
                        text: '最近一个月',
                        onClick(picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
                            picker.$emit('pick', [start, end])
                        }
                    },
                    {
                        text: '最近三个月',
                        onClick(picker) {
                            const end = new Date()
                            const start = new Date()
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
                            picker.$emit('pick', [start, end])
                        }
                    }
                ]
            },
            timevalue: [],
            view3: false,
            zdname: '',
            Indextype: undefined,
            interval: 3,
            stationData: [],
            lineData: [],
            //  tenlineData:[],
            dialogTableVisible: false,
            dialogTableVisible1: false,
            dialogTableVisible2: false,
            path: '/harmonic-boot/qydetailedAnalysis/pollutionqy',
            name: 'wtzhpg',
            asideheight: undefined,
            rightheight: undefined,
            tableheight: undefined,
            changeName: '谐波电压(%)',
            voltage: 0,
            voltageoption: [],
            fanwei: 0,
            fanweioption: [],
            copent: 0,
            copentoption: [],
            id: 1,
            title: '部门',
            xdata: [],
            ydata: [],
            dataList: [],
            activeName: 'tab1',
            panindexOptions: [],
            classvalue: '',
            classificationData: [],
            flag: false,
            stationNmae: '',
            lineName: '',
            formData: {
                deptIndex: '',
                id: '',
                //loadType:null,
                //manufacturer:null,
                monitorFlag: 2,
                powerFlag: 2,
                reportFlag: 3,
                //scale:null,
                searchBeginTime: '',
                searchEndTime: '',
                //serverName:'',
                statisticalType: []
            },
            device: 1,
            listcard: [],
            tableData: [],
            eachartfalg: false,
            xdata1: [],
            ydata1: [],
            vacode: 'V_Harmonic'
        }
    },
    created() {
        var data = window.sessionStorage.getItem('Info')
        data = eval('(' + data + ')')
        this.formData.deptIndex = data.deptId
        this.getIndexType()
    },
    mounted() {  this.setHeight()
        window.addEventListener('resize', this.setHeight)
     
        this.querfromdata()
    },
    beforeDestroy() {
        window.removeEventListener('resize', this.setHeight)
    },
    methods: {
        setHeight() {
            this.vh = window.sessionStorage.getItem('appheight') - 80 + 'px'
        this.vvh = window.sessionStorage.getItem('appheight') / 2 - 25 + 'px'
        this.vhh = (window.sessionStorage.getItem('appheight') - 80) / 2 + 'px'
     
        },
        closeHandle() {
            if (this.view3) {
                this.view3 = false
            } else {
                this.view3 = 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'
            }
        },
        ...mapActions({
            changeSetting: 'settings/changeSetting'
        }),
        //切换指标类型
        gbName(val) {
            if (val.code == 'V_Harmonic') {
                this.vacode = 'V_Harmonic'
                // this.changeName = "谐波电压(%)";
            }
            if (val.code == 'I_All') {
                this.vacode = 'I_All'
                // this.changeName = "谐波电流(%)";
            }
        },
        //字典获取数据指标类型
        getIndexType() {
            var code = 'Pollution_Statis'
            this.classificationData = dicData(code, ['I_Neg', 'V_Inharm', 'V_Dev', 'V_Unbalance', 'Plt', 'Freq_Dev'])
            this.formData.statisticalType = this.classificationData[0]
        },
        //变电站详情
        queryStation(i) {
            this.konzhi = true
            this.formData.deptIndex = i.id
            this.zdname = '电压等级'
            this.stationNmae = i.name
            this.flag = true
            this.dialogTableVisible = true
            api.getSubstation(this.formData).then(res => {
                if (res.code == 'A0000') {
                    this.stationData = res.data
                    this.konzhi = false
                    // var msg = new SpeechSynthesisUtterance(res.message);
                    // window.speechSynthesis.speak(msg);
                } else {
                    this.stationData = []
                    this.konzhi = false
                }
            })
        },
        //监测点详情
        queryline(id, pid, name) {
            this.konzhi = true
            this.lineData = []
            this.formData.deptIndex = pid
            this.formData.id = id
            this.flag = false
            this.lineName = name
            this.dialogTableVisible1 = true
            api.getLineInfo(this.formData).then(res => {
                if (res.code == 'A0000') {
                    this.lineData = res.data
                    this.konzhi = false
                }
            })
        },
        //排名前十监测点
        tensort() {
            this.dialogTableVisible2 = true
            api.getLineRank(this.formData).then(res => {
                if (res.code == 'A0000') {
                    var data = res.data
                    var xarr = []
                    var yarr = []
                    data.forEach(element => {
                        xarr.push(element.name)
                        yarr.push(element.data)
                    })
                    this.xdata1 = xarr
                    for (var i = 0; i < yarr.length; i++) {
                        if (yarr[i] == 3.14159) {
                            yarr[i] = 0.05
                        }
                    }
                    this.ydata1 = yarr
                }
                //    this.$nextTick(()=> {

                //  })
                this.tenlineData1()
            })
        },
        //时间格式转化
        dateFormat(dateData1, dateData2) {
            var timearr = []
            var date = new Date(dateData1)
            var y = date.getFullYear()
            var m = date.getMonth() + 1
            m = m < 10 ? '0' + m : m
            var d = date.getDate()
            d = d < 10 ? '0' + d : d
            var h = date.getHours()
            h = h < 10 ? '0' + h : h
            var f = date.getMinutes()
            f = f < 10 ? '0' + f : f
            var s = date.getSeconds()
            s = s < 10 ? '0' + s : s
            this.formData.searchBeginTime = y + '-' + m + '-' + d
            timearr.push(this.formData.searchBeginTime)
            var date = new Date(dateData2)
            var y = date.getFullYear()
            var m = date.getMonth() + 1
            m = m < 10 ? '0' + m : m
            var d = date.getDate()
            d = d < 10 ? '0' + d : d
            var h = date.getHours()
            h = h < 10 ? '0' + h : h
            var f = date.getMinutes()
            f = f < 10 ? '0' + f : f
            var s = date.getSeconds()
            s = s < 10 ? '0' + s : s
            this.formData.searchEndTime = y + '-' + m + '-' + d
            timearr.push(this.formData.searchEndTime)
            return timearr
        },
        //查询触发//获取部门变电站数据
        querfromdata() {
            this.interval = this.$refs.wqt.intervald
            if (this.$refs.wqt.intervald == 1) {
                this.formData.reportFlag = 1
            } else if (this.$refs.wqt.intervald == 2) {
                this.formData.reportFlag = 2
            } else if (this.$refs.wqt.intervald == 3) {
                this.formData.reportFlag = 3
            } else if (this.$refs.wqt.intervald == 4) {
                this.formData.reportFlag = 4
            } else if (this.$refs.wqt.intervald == 5) {
                this.formData.reportFlag = 5
            }
            this.konzhi = true
            this.tableData = []
            if (this.vacode == 'V_Harmonic') {
                this.changeName = '谐波电压(%)'
            } else {
                this.changeName = '谐波电流(%)'
            }
            this.timeValue = this.$refs.wqt.timeValue
            this.dateFormat(this.timeValue[0], this.timeValue[1])

            var data = window.sessionStorage.getItem('Info')
            data = eval('(' + data + ')')
            this.formData.deptIndex = data.deptId
            //this.eachartfalg = false
            //this.formData.type = this.Indextype
            api.deptSubstationRelations(this.formData).then(res => {
                if (res.code == 'A0000') {
                    this.listcard = res.data
                    this.tableData = res.data
                    this.konzhi = false
                    var xarr = []
                    var yarr = []
                    res.data.forEach(element => {
                        xarr.push(element.name)

                        yarr.push(element.data)
                    })
                    this.xdata = xarr

                    for (var i = 0; i < yarr.length; i++) {
                        if (yarr[i] == 3.14159) {
                            yarr[i] = 0.05
                        }
                    }
                    this.ydata = yarr

                    // this.eachartfalg = true
                }
                this.$nextTick(() => {
                    this.$refs.child.evaluation()
                })
            })

            //alert('父组件条件查询触发方法'+ data)
        },
        handleClick(tab, event) {
            //  this.$nextTick(()=> {
            //    this.$refs.child.dataintegrity()
            //    })
        },
        tenlineData1() {
            const echarts = require('echarts')
            var myChartes = echarts.init(document.getElementById('tenlineechart'))
            let echartsColor = JSON.parse(window.localStorage.echartsColor)
            var option = {
                title: {
                    //text: this.title,
                    //subtext: "等级",
                },
                tooltip: {
                    trigger: 'axis',
                    formatter: function (params) {
                        var tips = ''
                        tips += '<span style="">' + params[0].name + '</br>'
                        ;('</span>')
                        for (var i = 0; i < params.length; i++) {
                            if (params[i].value == 0.05) {
                                tips += params[i].seriesName + ':暂无数据<br/>'
                            } else {
                                tips += params[i].seriesName + ':' + params[i].value
                            }
                        }
                        return tips
                    }
                },
                grid: {
                    left: '10px',
                    right: '55px',
                    bottom: '20px',
                    containLabel: true
                },
                xAxis: [
                    {
                        name: '监测点',
                        nameTextStyle: {
                            color: echartsColor.WordColor,
                            verticalAlign: 'top', //标题位置
                            padding: [-5, 0, 0, 5]
                        },
                        type: 'category',
                        data: this.xdata1,
                        splitLine: {
                            show: false,
                            lineStyle: {
                                color: echartsColor.thread
                            }
                        },
                        axisTick: {
                            alignWithLabel: true
                        },
                        axisLine: {
                            show: true,
                            symbol: ['none', 'arrow'],
                            symbolOffset: 20, //箭头距离x轴末端距离
                            lineStyle: {
                                shadowOffsetX: 20,
                                color: echartsColor.thread,
                                shadowColor: echartsColor.thread //设置阴影的颜色
                            }
                        },
                        axisLabel: {
                            textStyle: {
                                fontFamily: 'dinproRegular',
                                color: echartsColor.WordColor
                            },
                            rotate: 39
                        }
                    }
                ],
                // toolbox: {
                //   show: true,
                //   // feature: {
                //   //   saveAsImage: { show: true },
                //   //   //restore: {},
                //   //   mark: { show: true },
                //   // },
                // },
                yAxis: {
                    name: '等级',
                    type: 'value',
                    nameTextStyle: {
                        color: echartsColor.WordColor,
                        verticalAlign: 'top', //标题位置
                        padding: [-22, 0, 10, 0]
                    },
                    min: 0,
                    max: 2,
                    interval: 0.2,
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: echartsColor.WordColor
                        },
                        // 这里重新定义就可以
                        formatter: function (value, index) {
                            var texts = []
                            if (value === 1) {
                                texts.push('1级')
                            } else if (value === 1.2) {
                                texts.push('2级')
                            } else if (value === 1.4) {
                                texts.push('3级')
                            } else if (value === 1.6) {
                                texts.push('4级')
                            } else if (value === 2) {
                                texts.push('5级')
                            }
                            return texts
                        }
                    },
                    axisLine: {
                        show: true,
                        symbolOffset: 25, //箭头距离x轴末端距离
                        lineStyle: {
                            shadowOffsetY: -25,
                            color: echartsColor.thread,
                            shadowColor: echartsColor.thread //设置阴影的颜色
                        },
                        symbol: ['none', 'arrow']
                    }
                },
                series: [
                    {
                        name: '数值',
                        barMaxWidth: 30,
                        type: 'bar',
                        label: {
                            normal: {
                                show: false,
                                position: 'top'
                            }
                        },
                        itemStyle: {
                            normal: {
                                // 随机显示
                                //color:function(d){return "#"+Math.floor(Math.random()*(256*256*256-1)).toString(16);}

                                // 定制显示（按顺序）
                                color: function (params) {
                                    if (params.value > 2) {
                                        return new echarts.graphic.LinearGradient(
                                            0,
                                            1,
                                            0,
                                            0,
                                            [
                                                {
                                                    offset: 1,
                                                    color: yan.ColorObject.zdContaminated
                                                }
                                            ],
                                            false
                                        )
                                    } else if (1.6 < params.value && params.value <= 2) {
                                        return new echarts.graphic.LinearGradient(
                                            0,
                                            1,
                                            0,
                                            0,
                                            [
                                                {
                                                    offset: 1,
                                                    color: yan.ColorObject.centerContaminated
                                                }
                                            ],
                                            false
                                        )
                                    } else if (1.2 < params.value && params.value <= 1.6) {
                                        return new echarts.graphic.LinearGradient(
                                            0,
                                            1,
                                            0,
                                            0,
                                            [
                                                {
                                                    offset: 1,
                                                    color: yan.ColorObject.qdContaminated
                                                }
                                            ],
                                            false
                                        )
                                    } else if (1 < params.value && params.value <= 1.2) {
                                        return new echarts.graphic.LinearGradient(
                                            0,
                                            1,
                                            0,
                                            0,
                                            [
                                                {
                                                    offset: 1,
                                                    color: yan.ColorObject.qwContaminated
                                                }
                                            ],
                                            false
                                        )
                                    } else if (
                                        0 < params.value &&
                                        params.value <= 1 &&
                                        params.value >= 0 &&
                                        params.value !== 0.05
                                    ) {
                                        return new echarts.graphic.LinearGradient(
                                            0,
                                            1,
                                            0,
                                            0,
                                            [
                                                {
                                                    offset: 1,
                                                    color: yan.ColorObject.noContaminated
                                                }
                                            ],
                                            false
                                        )
                                    } else if (params.value == 0.05) {
                                        return new echarts.graphic.LinearGradient(
                                            0,
                                            1,
                                            0,
                                            0,
                                            [
                                                {
                                                    offset: 1,
                                                    color: '#999999'
                                                }
                                            ],
                                            false
                                        )
                                    }
                                }
                            }
                        },
                        markLine: {
                            silent: false,
                            symbol: 'circle',
                            lineStyle: {
                                color: 'red',
                                width: 1
                            },
                            emphasis: {
                                lineStyle: {
                                    width: 1
                                }
                            },
                            data: [
                                {
                                    name: '',
                                    yAxis: 1,
                                    lineStyle: {
                                        color: yan.ColorObject.noContaminated
                                    },
                                    label: {
                                        //position: "middle",
                                        formatter: '{b}',
                                        textStyle: {
                                            color: yan.ColorObject.noContaminated
                                        }
                                    }
                                },
                                {
                                    name: '',
                                    yAxis: 1.2,
                                    lineStyle: {
                                        color: yan.ColorObject.qwContaminated
                                    },
                                    label: {
                                        // position: "middle",
                                        formatter: '{b}',
                                        textStyle: {
                                            color: yan.ColorObject.qwContaminated
                                        }
                                    }
                                },
                                {
                                    name: '',
                                    yAxis: 1.4,
                                    lineStyle: {
                                        color: yan.ColorObject.qdContaminated
                                    },
                                    label: {
                                        // position: "middle",
                                        formatter: '{b}',
                                        textStyle: {
                                            color: yan.ColorObject.qdContaminated
                                        }
                                    }
                                },
                                {
                                    name: '',
                                    yAxis: 1.6,
                                    lineStyle: {
                                        color: yan.ColorObject.centerContaminated
                                    },
                                    label: {
                                        // position: "middle",
                                        formatter: '{b}',
                                        textStyle: {
                                            color: yan.ColorObject.centerContaminated
                                        }
                                    }
                                },
                                {
                                    name: '',
                                    yAxis: 2,
                                    lineStyle: {
                                        color: yan.ColorObject.zdContaminated
                                    },
                                    label: {
                                        // position: "middle",
                                        formatter: '{b}',
                                        textStyle: {
                                            color: yan.ColorObject.zdContaminated
                                        }
                                    }
                                }
                            ]
                        },
                        data: this.ydata1
                    }
                ]
            }
            myChartes.setOption(option)
            window.echartsArr.push(myChartes)
            setTimeout(() => {
                myChartes.resize()
            }, 100)
        }
    }
}
</script>
<style lang="less" scoped>
@import url('../../../styles/comStyle.less');

.container {
    /* margin: auto; */
    top: 0px;
    right: 0;
    width: 40%;
    height: 0px;
    z-index: 2000000000;
    position: absolute;
    background-color: #e4e7ebb9;
    overflow: auto;
    scroll-behavior: smooth;
    -radius: 20px;
}
/* 隐藏滚动条 */
::-webkit-scrollbar {
    display: block;
    width: 5px !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;
    }
}
.coless {
    position: absolute;
    right: 0;
    font-size: 20px;
    cursor: pointer;
}

::v-deep .el-card__header {
    padding: 5px 5px;
    border-bottom: 1px solid #ebeef5;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
@import url('../../../styles/common.less');
::v-deep .el-form-item--small.el-form-item {
    margin-bottom: 0px;
}
::v-deep .el-table__body-wrapper {
    height: calc(100% - 30px) !important;
    //overflow-x: scroll !important;
}

.jkl {
    height: 0.3%;
    background: ;
    margin-top: 1%;
    cursor: pointer;
}
.cvb {
    height: 20vh;
    overflow-y: auto;
    overflow-x: hidden;
}
.ll {
    color: #000;
    font-weight: bold;
}
.d1 {
    line-height: 10px;
    padding: 1.5%;
    color: #fff;
    background: #999999;
}
.d2 {
    line-height: 10px;
    padding: 1.5%;
    color: #fff;
    background: #339966;
}
.asd {
    line-height: 15px;
    color: #fff;
    font-weight: bold;
    float: right;
    font-size: 14px;
}
.d3 {
    line-height: 10px;
    padding: 1.5%;
    color: #fff;
    background: #3399ff;
}
.d4 {
    line-height: 10px;
    padding: 1.5%;
    color: #fff;
    background: #ffcc33;
}
.d5 {
    line-height: 10px;
    padding: 1.5%;
    color: #fff;
    background: #ff9900;
}
.d6 {
    line-height: 10px;
    padding: 1.5%;
    color: #fff;
    background: #cc0000;
}
.qwe {
    margin-top: 5px;
}
.fgh {
    height: 5vh;
}
.lf {
    float: left;
}

.l1 {
    color: #fff;
    background: #ccc;
}
.l2 {
    color: #fff;
    background: #339966;
}
.l3 {
    color: #fff;
    background: #3399ff;
}
.l4 {
    color: #fff;
    background: #ff9900;
}
.l5 {
    color: #fff;
    background: #ffcc33;
}
.l6 {
    color: #fff;
    background: #cc0000;
}

.xdf {
    line-height: 0.6rem;
    color: #000;
    font-weight: bold;
    margin-left: 2%;
    font-size: 12px;
}
.wr {
    margin-left: 0%;
    font-weight: bold;
    font-size: 14px;
}
.zd {
    background: #ff3300;
    color: #fff;
}
.zzd {
    background: #ff9900;
    color: #fff;
}
.qd {
    background: #ffcc00;
    color: #fff;
}
.qw {
    background: #3399ff;
    color: #fff;
}
.wd {
    background: #339933;
    color: #fff;
}
.ws {
    background: #999999;
    color: #fff;
}

.main {
    overflow: hidden;
}
.box-car3 {
    /* height: 80vh; */
}

.conent {
    padding: 5px;
}
.bg-purple-dark {
    background: #d3dce6;
}
.bg-purple {
    background: #d3dce6;
}
.bg-purple-light {
    /* background: #e5e9f2; */
}
.grid-content {
    border-radius: 4px;
    min-height: 36px;
}
.right-top {
    border-style: solid hidden hidden hidden;
    color: rgb(7, 131, 161);
    border: 1.5px solid rgb(7, 131, 161);
}
.el-card__header {
    padding: 0px 0px;
    border-bottom: 1px solid #ebeef5;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
::-webkit-scrollbar {
    display: block;
    width: 8px !important;
    height: 14px;
}
</style>
<style lang="less" scoped>
::v-deep .el-table__body-wrapper::-webkit-scrollbar-track {
    background-color: #79878769;
}
::v-deep .el-tabs--border-card > .el-tabs__content {
    padding: 10px;
}
::v-deep .el-button--text:hover {
    color: #000;
    //background-color: #000 !important;
    //border-color: #000 !important;
}
.xshou {
    cursor: pointer;
}
</style>
<style lang="scss" scoped>
::v-deep .eldialotabledd.el-dialog .el-dialog__body {
    height: 100% !important;
    padding: 10px !important;
    //overflow-y: auto;
}
::v-deep.el-tree .is-leaf {
    visibility: hidden !important;
}
</style>
<style scoped></style>
