<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" 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="xxb" :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 style="margin-left: 0%; font-weight: bold; font-size: 14px">超标占比:</span> -->
                <el-tag style="background: #339966; color: #fff" size="mini">优</el-tag>
                <span style="color: #339966">:优秀≤60%</span>
                <el-tag style="background: #ffcc33; color: #fff" size="mini">良</el-tag>
                <span style="color: #ffcc33">:60%<良好<90%</span>
                <el-tag style="background: #cc0000; color: #fff" size="mini">差</el-tag>
                <span style="color: #cc0000">:极差≥90%</span>
                <!-- <el-tag style="background: #999999; color: #fff" circle>无</el-tag><span style="color:#999999">:无数据</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" style="margin-top: 5px">
                            <el-card
                                class="box-card3"
                                :style="
                                    'height:25vh;background-image: linear-gradient(' +
                                    settings.themeColor +
                                    ',#ccc);color:#fff;opacity:0.8;'
                                "
                            >
                                <div
                                    slot="header"
                                    class="clearfix"
                                    :style="
                                        'height:30px;background:' +
                                        settings.themeColor +
                                        ';padding:5px;cursor: pointer;'
                                    "
                                    @click="queryStation(item)"
                                >
                                    <span
                                        style="
                                            line-height: 15px;
                                            color: #fff;
                                            font-weight: bold;
                                            float: right;
                                            font-size: 14px;
                                        "
                                    >
                                        {{ item.name }}
                                    </span>
                                    <el-tag
                                        v-if="item.data < 60 && item.data > 0"
                                        style="color: #fff; background: #339966"
                                        size="mini"
                                    >
                                        优
                                    </el-tag>
                                    <el-tag
                                        v-if="60 <= item.data && item.data < 90"
                                        style="color: #fff; background: #ffcc33"
                                        size="mini"
                                    >
                                        良
                                    </el-tag>
                                    <el-tag
                                        v-if="90 <= item.data && item.data"
                                        style="color: #fff; background: #cc0000"
                                        size="mini"
                                    >
                                        差
                                    </el-tag>
                                    <el-tag
                                        v-if="item.data == 3.14159 || item.data == 0"
                                        style="color: #fff; background: #ccc"
                                        size="mini"
                                    >
                                        无
                                    </el-tag>
                                </div>
                                <div style="height: 20vh; overflow-y: auto; overflow-x: hidden">
                                    <el-col
                                        :span="12"
                                        v-for="(item1, index1) in item.children"
                                        :key="index1"
                                        style="height: 5vh"
                                    >
                                        <div
                                            style="height: 30px; margin-top: 5px; cursor: pointer"
                                            @click="queryline(item1.id, item1.pid, item1.name)"
                                        >
                                            <!-- <span
                            style="
                              line-height: 30px;
                              color: #000;
                              font-weight: bold;
                              margin-left: 2%;
                              font-size: 12px;
                            "
                          >
                            <el-tooltip
                              class="item"
                              effect="light"
                              :open-delay="500"
                              :content="item1.name"
                               popper-class="atooltip"
                               placement="bottom-start"  :visible-arrow="false"
                            >
                              <el-tag
                                size="mini"
                                type="text"
                                style="color: #000; font-weight: bold"
                                >{{ item1.name.substr(0, 6) }}</el-tag
                              >
                            </el-tooltip>
                          </span> -->
                                            <el-tag
                                                v-if="item1.data < 60 && item1.data > 0"
                                                style="color: #fff; background: #339966"
                                                size="mini"
                                            >
                                                优
                                            </el-tag>
                                            <el-tag
                                                v-if="60 <= item1.data && item1.data < 90"
                                                style="color: #fff; background: #ffcc33"
                                                size="mini"
                                            >
                                                良
                                            </el-tag>
                                            <el-tag
                                                v-if="90 <= item1.data && item1.data"
                                                style="color: #fff; background: #cc0000"
                                                size="mini"
                                            >
                                                差
                                            </el-tag>
                                            <el-tag
                                                v-if="item1.data == 3.14159 || item1.data == 0"
                                                style="color: #fff; background: #ccc"
                                                size="mini"
                                            >
                                                无
                                            </el-tag>
                                            <span class="xdf" style="color: #000">
                                                <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" :style="`height:${vhh};overflow: hidden;`">
                        <harmonictjechart :title="title" :xdata="xdata1" :ydata="ydata1" ref="child"></harmonictjechart>
                    </el-col>
                    <el-col :span="24">
                        <el-table
                            stripe
                            :data="tableData"
                            border
                            class="xshou mt10"
                            highlight-current-row
                            header-cell-class-name="table_header"
                            :height="vvh"
                            :style="'width: 100%'"
                        >
                            <el-table-column align="center" prop="name" label="名称" min-width="60"></el-table-column>
                            <el-table-column align="center" sortable prop="onlineCount" label="在线监测点数（个）">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.onlineCount == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.onlineCount !== 3.14159 && scope.row.onlineCount !== 0">
                                        {{ scope.row.onlineCount }}
                                    </span>
                                    <span v-if="scope.row.onlineCount == 0">/</span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" sortable prop="overLineCount" label="超标监测点数（个）">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.overLineCount == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.overLineCount !== 3.14159 && scope.row.overLineCount !== 0">
                                        {{ scope.row.overLineCount }}
                                    </span>
                                    <span v-if="scope.row.overLineCount == 0">/</span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" sortable prop="averageOverDay" label="平均超标天数（天）">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.averageOverDay == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.averageOverDay !== 4.14159 && scope.row.averageOverDay !== 0">
                                        {{ scope.row.averageOverDay }}
                                    </span>
                                    <span v-if="scope.row.averageOverDay == 0">/</span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" sortable prop="ratio" label="监测点超标占比(%)">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.lineRatio == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.lineRatio !== 3.14159 && scope.row.lineRatio !== 0">
                                        {{ scope.row.lineRatio }}
                                    </span>
                                    <span v-if="scope.row.lineRatio == 0">/</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
                        height="60vh"
                        highlight-current-row
                        header-cell-class-name="table_header"
                        :header-cell-style="{
                            height: '25px',
                            padding: '0px'
                        }"
                        :row-style="{ height: '28px' }"
                        :cell-style="{ padding: '0px' }"
                        v-loading="konzhi"
                        element-loading-text="数据加载中"
                    >
                        <el-table-column
                            align="center"
                            prop="name"
                            label="名称"
                            min-width="180"
                            :show-overflow-tooltip="true"
                        ></el-table-column>
                        <el-table-column align="center" prop="onlineCount" label="在线监测点数" min-width="120">
                            <template slot-scope="scope">
                                <span v-if="scope.row.onlineCount == 3.14159">暂无数据</span>
                                <span v-if="scope.row.onlineCount !== 3.14159">{{ scope.row.onlineCount }}</span>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" prop="overLineCount" min-width="120" label="超标监测点数">
                            <template slot-scope="scope">
                                <span v-if="scope.row.overLineCount == 3.14159">暂无数据</span>
                                <span v-if="scope.row.overLineCount !== 3.14159">{{ scope.row.overLineCount }}</span>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" prop="averageOverDay" min-width="120" label="平均超标天数">
                            <template slot-scope="scope">
                                <span v-if="scope.row.averageOverDay == 3.14159">暂无数据</span>
                                <span v-if="scope.row.averageOverDay !== 3.14159">{{ scope.row.averageOverDay }}</span>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" prop="ratio" label="超标占比(%)">
                            <template slot-scope="scope">
                                <span v-if="scope.row.ratio == 3.14159">暂无数据</span>
                                <span v-if="scope.row.ratio !== 3.14159">{{ scope.row.ratio }}</span>
                            </template>
                        </el-table-column>
                        <el-table-column align="center" prop="warningFreq" label="告警频次">
                            <template slot-scope="scope">
                                <span v-if="scope.row.warningFreq == 3.14159">暂无数据</span>
                                <span v-if="scope.row.warningFreq !== 3.14159">{{ scope.row.warningFreq }}</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"
                        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="数据加载中"
                    >
                        <el-table-column
                            align="center"
                            prop="name"
                            label="名称"
                            :show-overflow-tooltip="true"
                        ></el-table-column>
                        <!-- <el-table-column align="center" prop="count" label="超限监测点数" ></el-table-column> -->
                        <el-table-column align="center" prop="overDays" label="超标天数"></el-table-column>
                        <el-table-column align="center" prop="" label="各指标超标次数">
                            <el-table-column align="center" prop="overThreeTimes" label="3次">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.overThreeTimes == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.overThreeTimes !== 3.14159">
                                        {{ scope.row.overThreeTimes }}
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" prop="overFiveTimes" label="5次">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.overFiveTimes == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.overFiveTimes !== 3.14159">
                                        {{ scope.row.overFiveTimes }}
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" prop="overSevenTimes" label="7次">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.overSevenTimes == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.overSevenTimes !== 3.14159">
                                        {{ scope.row.overSevenTimes }}
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" prop="overElevenTimes" label="11次">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.overElevenTimes == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.overElevenTimes !== 3.14159">
                                        {{ scope.row.overElevenTimes }}
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" prop="overThirteenTimes" label="13次">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.overThirteenTimes == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.overThirteenTimes !== 3.14159">
                                        {{ scope.row.overThirteenTimes }}
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" prop="overTwentyThreeTimes" label="23次">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.overTwentyThreeTimes == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.overTwentyThreeTimes !== 3.14159">
                                        {{ scope.row.overTwentyThreeTimes }}
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" prop="overTwentyFiveTimes" label="25次">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.overTwentyFiveTimes == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.overTwentyFiveTimes !== 3.14159">
                                        {{ scope.row.overTwentyFiveTimes }}
                                    </span>
                                </template>
                            </el-table-column>
                            <el-table-column align="center" prop="otherTimes" label="其他次">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.otherTimes == 3.14159">暂无数据</span>
                                    <span v-if="scope.row.otherTimes !== 3.14159">{{ scope.row.otherTimes }}</span>
                                </template>
                            </el-table-column>
                        </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="tenline" :style="'width:100%;height:calc(100vh - 400px);zoom:' + device"></div>
                </el-dialog>
            </el-col>
        </el-row>
    </div>
</template>
<script>
import { mapActions } from 'vuex'
import defaultSettings from '@/settings'
import timepicker from '../../components/TimePicker/index4'
import { dicData } from '../../../assets/commjs/dictypeData'
import harmonictjechart from '@/views/components/echarts/harmonictjechart'
import api from '@/api/harmonic/harmonic'
export default {
    name: 'harmonicstatistics',
    components: {
        timepicker,
        harmonictjechart
    },
    watch: {},
    computed: {
        settings() {
            return this.$store.state.settings
        },
        ...mapActions({
            changeSetting: 'settings/changeSetting'
        })
    },
    data() {
        return {
            vh: null,
            vvh: null,
            vhh: null,
            tenheight: undefined,
            h: undefined,
            view3: false,
            konzhi: false,
            zdname: '',
            stationData: [],
            lineData: [],
            tenlineData: [],
            tableheight: undefined,
            echartsheight: undefined,
            dialogTableVisible: false,
            dialogTableVisible1: false,
            dialogTableVisible2: false,
            interval: 3,
            path: '/harmonic-boot/qydetailedAnalysis/pollutionqy',
            name: 'wtzhpg',
            asideheight: undefined,
            rightheight: undefined,
            changeName: '谐波电压',
            voltage: 0,
            voltageoption: [],
            classvalue: 0,
            fanwei: 0,
            fanweioption: [],
            copent: 0,
            copentoption: [],
            id: 1,
            title: '部门',
            activeName: 'tab1',
            classificationData: [],
            flag: false,
            stationNmae: '',
            lineName: '',
            formData: {
                deptIndex: '',
                id: '',
                monitorFlag: 2,
                powerFlag: 2,
                searchBeginTime: '',
                searchEndTime: '',
                statisticalType: []
            },
            device: 1,
            listcard: [],
            tableData: [],
            //eachartfalg:false,
            xdata: [],
            ydata: [],
            xdata1: [],
            ydata1: []
        }
    },
    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'
            }
        },

        //获取指标类型
        //字典获取数据指标类型
        getIndexType() {
            var code = 'Indicator_Type'
            this.classificationData = dicData(code, ['PLPC', 'DYPC', 'SXDYBPHD', 'CSSB', 'FXDL', 'JXBDY'])
            this.formData.statisticalType = this.classificationData[0]
        },
        //变电站详情
        queryStation(i) {
            this.stationData = []
            this.formData.deptIndex = i.id
            this.stationNmae = i.name
            this.flag = true
            this.dialogTableVisible = true
            this.konzhi = true
            api.getxbSubInfoById(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.lineData = []
            this.formData.deptIndex = pid
            this.formData.serverName = 'harmonic-boot'
            this.formData.statFlag = true
            this.formData.id = id
            this.flag = false
            this.lineName = name
            this.dialogTableVisible1 = true
            this.konzhi = true
            api.getXbLineInfoById(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.overDays)
                    })
                    this.xdata = xarr
                    this.ydata = yarr
                }
                this.tenline()
            })
        },
        //时间格式转化
        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.startTime)
            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.endTime)
            return timearr
        },
        //查询触发//获取部门变电站数据
        querfromdata() {
            this.konzhi = true
            this.interval = this.$refs.xxb.intervald
            this.tableData = []
            this.timeValue = this.$refs.xxb.timeValue
            this.dateFormat(this.timeValue[0], this.timeValue[1])

            var data = window.sessionStorage.getItem('Info')
            data = eval('(' + data + ')')
            this.formData.deptIndex = data.deptId

            api.deptSubstationRelations(this.formData).then(res => {
                if (res.code == 'A0000') {
                    this.listcard = res.data

                    // var xarr = [];
                    // var yarr = [];
                    // res.data.forEach((element) => {
                    //   // let name = element.name+'\n('+element.overLineCount+')'
                    //   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) {
                    //     yarr[i] = 1;
                    //   }
                    // }
                    // this.ydata = yarr;
                    this.konzhi = false
                }
            })
            api.deptInfolins(this.formData).then(res => {
                if (res.code === 'A0000') {
                    this.tableData = res.data
                    var xarr = []
                    var yarr = []
                    res.data.forEach(element => {
                        // let name = element.name+'\n('+element.overLineCount+')'
                        xarr.push(element.name)
                        yarr.push(element.lineRatio)
                    })
                    this.xdata1 = xarr

                    for (var i = 0; i < yarr.length; i++) {
                        if (yarr[i] == 3.14159 || yarr[i] == 0) {
                            yarr[i] = 1
                        }
                    }
                    this.ydata1 = yarr
                    this.$nextTick(() => {
                        this.$refs.child.qualifiedechart()
                    })
                    this.konzhi = false
                }
            })

            //alert('父组件条件查询触发方法'+ data)
        },
        tenline() {
            const echarts = require('echarts')
            var myChartes = echarts.init(document.getElementById('tenline'))
            let echartsColor = JSON.parse(window.localStorage.echartsColor)
            var option = {
                title: {
                    //text: this.title,
                    //  subtext: '单位(污染值)'
                },
                tooltip: {
                    trigger: 'axis',
                    formatter: function (params) {
                        var tips = ''
                        tips += params[0].name + '<br/>'
                        for (var i = 0; i < params.length; i++) {
                            tips += params[i].seriesName + ':' + params[i].value + '天<br/>'
                            // }
                        }
                        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.xdata,
                        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
                            },
                            formatter(value) {
                                return `${value.slice(0, 6)}...`
                            },
                            rotate: 39
                        }
                    }
                ],
                toolbox: {
                    show: true
                    // feature: {
                    //   saveAsImage: { show: true },
                    //   //restore: {},
                    //   mark: { show: true },
                    // },
                },
                yAxis: {
                    name: '天',
                    nameTextStyle: {
                        color: echartsColor.WordColor,
                        verticalAlign: 'top', //标题位置
                        padding: [-22, 0, 10, 0]
                    },
                    type: 'value',
                    min: 0,
                    //max:500,
                    //interval: 20,
                    axisLabel: {
                        show: true,
                        textStyle: {
                            color: echartsColor.WordColor
                        }
                    },
                    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: true,
                                position: 'top'
                            }
                        },
                        itemStyle: {
                            normal: {
                                color: '#0099CC'
                            }
                        },

                        data: this.ydata
                    }
                ]
            }
            myChartes.setOption(option)
            window.echartsArr.push(myChartes)
            setTimeout(() => {
                myChartes.resize()
            }, 100)
        }
    }
}
</script>
<style lang="less" scoped>
@import url('../../../styles/comStyle.less');
@import url('../../../styles/common.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: 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;
    }
}
.coless {
    position: absolute;
    right: 0;
    font-size: 20px;
    cursor: pointer;
}
::v-deep .el-form-item--small.el-form-item {
    margin-bottom: 0px;
}
::v-deep .el-card__header {
    padding: 5px 5px;
    border-bottom: 1px solid #ebeef5;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}
::v-deep .el-table__body-wrapper {
    height: calc(100% - 30px) !important;
    //overflow-x: scroll !important;
}
.ll {
    color: #000;
    font-weight: bold;
}
.wr {
    margin-left: 0%;
    font-weight: bold;
    font-size: 14px;
}
.zd {
    background: #cc0000;
    color: #fff;
}
.zzd {
    background: #ffcc33;
    color: #fff;
}
.qd {
    background: #ffcc33;
    color: #fff;
}
.qw {
    background: #3399ff;
    color: #fff;
}
.wd {
    background: #339966;
    color: #fff;
}
.ws {
    background: #999999;
    color: #fff;
}
::v-deep.xdf {
    line-height: 0.6rem;
    color: #000 !important;
    font-weight: bold;
    margin-left: 2%;
    font-size: 12px;
}

.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.el-table--enable-row-hover .el-table__body tr:hover > td {
//   cursor: pointer;
// }
// ::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;
}
::v-deep.el-tree .is-leaf {
    visibility: hidden !important;
}
</style>
<style></style>
