<template>
    <div class="content">
        <div class="content-title">
            <img src="../../../../../assets/cityScreen/equiQuantityBg.png" style="width: 100%;height: 100%;" />
            <div class="title">
                装备数量价值
            </div> 
        </div>
        <div class="content-view">
            <div class="content-view-item">
                <div style="width: 20%;height: 90%;display: flex;align-items: center;justify-content: center;">
                    <img src="../../../../../assets/cityScreen/quantityIcon1.png" style="width: 90%;height: 80%;" />
                </div>
                <div style="width: 80%;height: 90%;display: flex;flex-direction: column;">
                    <div class="item-title">
                        <span class="title2">线路装备</span>
                    </div> 
                    <div style="width: 100%;height: 40%;display: flex;justify-content: space-between;align-items: center;">
                        <div class="num">
                            <span style="font-weight: 700;">50</span>
                            <span class="unit">台</span>
                        </div>
                        <div class="num">
                            <span style="font-weight: 700;">0.027</span>
                            <span class="unit">亿元</span>
                        </div>
                    </div>
                    <div id="lineChartOne" style="width: 100%;height: 20%;"></div>
                    <div style="width: 100%;height: 40%;display: flex;justify-content: space-between;align-items: center;">
                        <div class="num2">
                            <span class="unit2">5年</span>
                            <span style="font-weight: 700;">30</span>
                            <span class="unit2">73%</span>
                        </div>
                        <div class="num2" style="color: #00FEFC;">
                            <span class="unit2" style="color: #00FEFC;">5-10年</span>
                            <span style="font-weight: 700;">15</span>
                            <span class="unit2" style="color: #00FEFC;">23%</span>
                        </div>
                        <div class="num2" style="color: #00FEFC;">
                            <span class="unit2" style="color: #1E8DFF;">10年以上</span>
                            <span style="font-weight: 700;">15</span>
                            <span class="unit2" style="color: #1E8DFF;">0%</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="content-view-item">
                <div style="width: 20%;height: 90%;display: flex;align-items: center;justify-content: center;">
                    <img src="../../../../../assets/cityScreen/quantityIcon2.png" style="width: 90%;height: 80%;" />
                </div>
                <div style="width: 80%;height: 90%;display: flex;flex-direction: column;">
                    <div class="item-title">
                        <span class="title2">变电装备</span>
                    </div> 
                    <div style="width: 100%;height: 40%;display: flex;justify-content: space-between;align-items: center;">
                        <div class="num">
                            <span style="font-weight: 700;">50</span>
                            <span class="unit">台</span>
                        </div>
                        <div class="num">
                            <span style="font-weight: 700;">0.027</span>
                            <span class="unit">亿元</span>
                        </div>
                    </div>
                    <div id="lineChartTwo" style="width: 100%;height: 20%;"></div>
                    <div style="width: 100%;height: 40%;display: flex;justify-content: space-between;align-items: center;">
                        <div class="num2">
                            <span class="unit2">5年</span>
                            <span style="font-weight: 700;">30</span>
                            <span class="unit2">73%</span>
                        </div>
                        <div class="num2" style="color: #00FEFC;">
                            <span class="unit2" style="color: #00FEFC;">5-10年</span>
                            <span style="font-weight: 700;">15</span>
                            <span class="unit2" style="color: #00FEFC;">23%</span>
                        </div>
                        <div class="num2" style="color: #00FEFC;">
                            <span class="unit2" style="color: #1E8DFF;">10年以上</span>
                            <span style="font-weight: 700;">15</span>
                            <span class="unit2" style="color: #1E8DFF;">0%</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="content-view-item">
                <div style="width: 20%;height: 90%;display: flex;align-items: center;justify-content: center;">
                    <img src="../../../../../assets/cityScreen/quantityIcon3.png" style="width: 90%;height: 80%;" />
                </div>
                <div style="width: 80%;height: 90%;display: flex;flex-direction: column;">
                    <div class="item-title">
                        <span class="title2">电缆装备</span>
                    </div> 
                    <div style="width: 100%;height: 40%;display: flex;justify-content: space-between;align-items: center;">
                        <div class="num">
                            <span style="font-weight: 700;">50</span>
                            <span class="unit">台</span>
                        </div>
                        <div class="num">
                            <span style="font-weight: 700;">0.027</span>
                            <span class="unit">亿元</span>
                        </div>
                    </div>
                    <div id="lineChartThree" style="width: 100%;height: 20%;"></div>
                    <div style="width: 100%;height: 40%;display: flex;justify-content: space-between;align-items: center;">
                        <div class="num2">
                            <span class="unit2">5年</span>
                            <span style="font-weight: 700;">30</span>
                            <span class="unit2">73%</span>
                        </div>
                        <div class="num2" style="color: #00FEFC;">
                            <span class="unit2" style="color: #00FEFC;">5-10年</span>
                            <span style="font-weight: 700;">15</span>
                            <span class="unit2" style="color: #00FEFC;">23%</span>
                        </div>
                        <div class="num2" style="color: #00FEFC;">
                            <span class="unit2" style="color: #1E8DFF;">10年以上</span>
                            <span style="font-weight: 700;">15</span>
                            <span class="unit2" style="color: #1E8DFF;">0%</span>
                        </div>
                    </div>


                </div>
            </div>

        </div>
    </div>
</template>

<script> 
import * as echarts from 'echarts' 
export default {
    data() {
        return { 
        }
    },
    created() {

    },
    mounted() {
        this.InitEChartsOne()
        this.InitEChartsTwo()
        this.lineChartThree()
    },
    methods: {
        InitEChartsOne() {
            // getCanteenOrdersAndSalesTrendsApi({type:this.type1}).then((response) => {
                var legendData = [
                    { name: '5年', data: 30 },
                    { name: '5-10年', data: 15 },
                    { name: '10年以上', data: 15 }
                ];
                var colorList = ['#83D3F8', '#00FEFC', '#1E8DFF'];
                var seriesList = [];
                for (var i = 0; i < legendData.length; i++) {
                    seriesList.push({
                        type: 'bar',
                        stack: '2',
                        legendHoverLink: false,
                        barWidth: 6,
                        data: [
                            {
                                value: legendData[i].data,
                                itemStyle: {
                                    color: colorList[i],
                                },
                            },
                        ],
                    });
                }
                var option = {
                    grid: {
                        show: true,
                        left: '0%',
                        right: '0%',
                        top: '0%',
                        bottom: '0%', 
                        borderColor: "transparent"
                    },
                    // backgroundColor: '#fff',
                    xAxis: {
                        show: false,
                    },
                    yAxis: [
                        {
                            inverse: true,
                            data: [''],
                            axisLine: {
                                show: false,
                            },
                        },
                    ],
                    series: seriesList,
                }; 
                this.myCharts1 = echarts.init(document.querySelector('#lineChartOne'));
                this.myCharts1.setOption(option)   
            // }); 
        },
        InitEChartsTwo() {
            // getCanteenOrdersAndSalesTrendsApi({type:this.type1}).then((response) => {
                var legendData = [
                    { name: '5年', data: 30 },
                    { name: '5-10年', data: 15 },
                    { name: '10年以上', data: 15 }
                ];
                var colorList = ['#83D3F8', '#00FEFC', '#1E8DFF'];
                var seriesList = [];
                for (var i = 0; i < legendData.length; i++) {
                    seriesList.push({
                        type: 'bar',
                        stack: '2',
                        legendHoverLink: false,
                        barWidth: 6,
                        data: [
                            {
                                value: legendData[i].data,
                                itemStyle: {
                                    color: colorList[i],
                                },
                            },
                        ],
                    });
                }
                var option = {
                    grid: {
                        show: true,
                        left: '0%',
                        right: '0%',
                        top: '0%',
                        bottom: '0%', 
                        borderColor: "transparent"
                    },
                    // backgroundColor: '#fff',
                    xAxis: {
                        show: false,
                    },
                    yAxis: [
                        {
                            inverse: true,
                            data: [''],
                            axisLine: {
                                show: false,
                            },
                        },
                    ],
                    series: seriesList,
                }; 
                this.myCharts1 = echarts.init(document.querySelector('#lineChartTwo'));
                this.myCharts1.setOption(option)   
            // }); 
        },
        lineChartThree() {
            // getCanteenOrdersAndSalesTrendsApi({type:this.type1}).then((response) => {
                var legendData = [
                    { name: '5年', data: 30 },
                    { name: '5-10年', data: 15 },
                    { name: '10年以上', data: 15 }
                ];
                var colorList = ['#83D3F8', '#00FEFC', '#1E8DFF'];
                var seriesList = [];
                for (var i = 0; i < legendData.length; i++) {
                    seriesList.push({
                        type: 'bar',
                        stack: '2',
                        legendHoverLink: false,
                        barWidth: 6,
                        data: [
                            {
                                value: legendData[i].data,
                                itemStyle: {
                                    color: colorList[i],
                                },
                            },
                        ],
                    });
                }
                var option = {
                    grid: {
                        show: true,
                        left: '0%',
                        right: '0%',
                        top: '0%',
                        bottom: '0%', 
                        borderColor: "transparent"
                    },
                    // backgroundColor: '#fff',
                    xAxis: {
                        show: false,
                    },
                    yAxis: [
                        {
                            inverse: true,
                            data: [''],
                            axisLine: {
                                show: false,
                            },
                        },
                    ],
                    series: seriesList,
                }; 
                this.myCharts1 = echarts.init(document.querySelector('#lineChartThree'));
                this.myCharts1.setOption(option)   
            // }); 
        },
    },
}
</script>
<style lang="scss" scoped>
.content{
    width: 100%;
    height: 100%; 
}   
.content-title{
    width: 100%;
    height: 18%; 
    position: relative;
    color: #78D6FF;
}
.title{
    font-size: 24px;
    position: absolute;
    top: 42%;
    left: 15%;
}
.content-view{
    width: 100%;
    height: 80%; 
    padding-left: 8%;
}
.content-view-item{
    width: 100%;
    height: 32%;
    margin-bottom: 1%; 
 
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-title{
    width: 100%;
    height: 30%;
    background-image: url("../../../../../assets/cityScreen/equiQuantityTitle.png");
    background-size: 100% 100%;
    display: flex;
    align-items: center;
    padding-left: 10px;
}
.title2{
     font-size: 20px;
     color: #fff;
}
.num{
    color: #83D3F8;
    font-size: 26px;
}
.unit{
    font-size: 20px;
    color: #ccc;
    margin-left: 10px;
}
.num2{
    color: #83D3F8;
    font-size: 24px;
}
.unit2{
    font-size: 16px;
    color: #ccc;
    margin-right: 8px;
    margin-left: 8px;
}
@media screen and (min-width: 1920px) { 
    .title{
        font-size: 10px; 
    }
    .title2{
        font-size: 10px; 
    }
    .num{ 
        font-size: 12px; 
    }
    .unit{
        font-size: 10px; 
        margin-left: 2px;
    }
    .num2{
        color: #83D3F8;
        font-size: 10px;
    }
    .unit2{
        font-size: 8px;
        color: #ccc;
        margin-right: 2px;
        margin-left: 2px;
    }
    
}
@media screen and (min-width: 3000px) { 
    .title{
        font-size: 24px;
    }
    .title2{
        font-size: 20px; 
    }
    .num{ 
        font-size: 26px;
    }
    .unit{
        font-size: 20px; 
        margin-left: 10px;
    }
    .num2{
        color: #83D3F8;
        font-size: 24px;
    }
    .unit2{
        font-size: 16px;
        color: #ccc;
        margin-right: 8px;
        margin-left: 8px;
    }
}


</style>
