<!-- 体验分析页面 -->
<template>
    <div class="testAnalysis">
        <div class="labContent">
            <div class="labContent-title">
                <p >XC环境验证系统</p>
            </div>
            <div class="themeContent">
                <div class="themeName"> <i></i> xx体验分析 </div>
                <div class="">
                    <div class="testAnalysis-first">
                        <p>
                            体验项：
                            <span>
                                <el-select style="margin-left: 10px;width:200px;" v-model="testType" placeholder="请选择">
											<el-option
                                                    v-for="item in options"
                                                    :key="item.value"
                                                    :label="item.label"
                                                    :value="item.value">
											</el-option>
										</el-select>
                            </span>
                        </p>
                        <p>
                            时间：
                            <span>
                                <el-date-picker
                                        v-model="valueDate"
                                        type="daterange"
                                        start-placeholder="开始日期"
                                        end-placeholder="结束日期"
                                        :default-time="['00:00:00', '23:59:59']">
                                </el-date-picker>
                            </span>
                        </p>
                    </div>
                    <div class="testAnalysis-second">
                        <p class="secondP" >
                            路线选择：
                            <span>
                                <ul class="secondUl" style="height: 100%;">
                                    <li @click="allCheckClick" class="allCheck"> <i :class="{ allcheckImg:allCheck === true}" ></i> 全选</li>
									<li class="testLi" style="height: 50px;" v-for="(item, index) in checkList" :key="index">
										<div class="testLi-text">
											<span :class="{'checkImg': checkImg === index,}" class="tickCheck" @click="tickClick(item,index)"></span>
											<span class="" :title="item.name">{{item.name}}</span>
										</div>
									</li>
								</ul>
                            </span>
                        </p>
                    </div>
                    <div class="testAnalysis-third" id="charts">
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
// 这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
// 例如：import 《组件名称》 from '《组件路径》';
import echarts from 'echarts';
export default {
    name: 'testAnalysis',
    // import引入的组件需要注入到对象中才能使用
    components: {},
    props: {},
    data () {
        // 这里存放数据
        return {
            testType: '',
            options: [{
                value: '选项1',
                label: '黄金糕'
            }, {
                value: '选项2',
                label: '双皮奶'
            }],
            valueDate: '',
            checkList: [ // 全选 选择
                {name: '技术路线1'},
                {name: '技术路线2'},
                {name: '技术路线3'},
                {name: '技术路线4'},
                {name: '技术路线5'},
            ],
            checkImg: -1,
            allCheck: false
        };
    },
    // 方法集合
    methods: {
        tickClick(item,index) {
            console.log(item,index)
            this.checkImg = index
        },
        allCheckClick() {
            this.allCheck = !this.allCheck;
        },
        Echarts() {
            let charts = echarts.init(document.getElementById('charts'));
            charts.setOption({
                legend: {
                    data: ['邮件营销', '联盟广告']
                },
                toolbox: {
                    feature: {
                        saveAsImage: {}
                    }
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: [
                    {
                        type: 'category',
                        boundaryGap: false,
                        data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
                    }
                ],
                yAxis: [
                    {
                        type: 'value'
                    }
                ],
                series: [
                    {
                        name: '邮件营销',
                        type: 'line',
                        stack: '总量',
                        areaStyle: {},
                        data: [120, 132, 101, 134, 90, 230, 210]
                    },
                    {
                        name: '联盟广告',
                        type: 'line',
                        stack: '总量',
                        areaStyle: {},
                        data: [220, 182, 191, 234, 290, 330, 310]
                    }
                ]
            })
        }
    },
    // 监听属性 类似于data概念
    computed: {},
    // 监控data中的数据变化
    watch: {},
    //生命周期 - 创建完成（可以访问当前this实例）
    created () {},
    // 生命周期 - 挂载完成（可以访问DOM元素）
    mounted () {
        this.Echarts();
    },
    // 生命周期 - 创建之前
    beforeCreate () {},
    // 生命周期 - 挂载之前
    beforeMount () {},
    // 生命周期 - 更新之前
    beforeUpdate () {},
    // 生命周期 - 更新之后
    updated () {},
    // 生命周期 - 销毁之前
    beforeDestroy () {},
    // 生命周期 - 销毁完成
    destroyed () {},
    // 如果页面有keep-alive缓存功能，这个函数会触发
    activated () {},
}
</script>

<style scoped>
    .testAnalysis {
        background: #ebf0f8;
        padding: 30px 45px ;
        height: 96vh;
        overflow-y: scroll;
    }
    .labContent {
        width: 100%;
        background: #fff;
        height: 163vh;
    }
    .labContent-title p {
        font-size: 24px;
        color: #233b6e;
        padding: 30px;
        text-align: center;
    }
    .themeContent {
        padding: 0 64px;
    }
    .themeName {
        text-align: left;
        position: relative;
        background-color: #ecf1fc;
        height: 40px;
        margin-top: 40px;
        width: 100%;
        line-height: 40px;
        font-weight: bold;
        font-size: 20px
    }
    .themeName i {
        display: block;
        float: left;
        background-color: #4877e6;
        height: 40px;
        width: 4px;
        margin-right: 10px;
    }
    .testAnalysis-first {
        padding: 32px 0;
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    /*全选*/
    .allCheck i,.tickCheck {
        display: inline-block;
        width: 16px;
        height: 16px;
        vertical-align: middle;
        background: url("../assets/img/testAn/check.png") no-repeat;
        background-size: 100% 100%;
        margin-right: 8px;
    }
    .tickCheck:hover {
        /*background: blue;*/
        /*border-radius: 5px;*/
    }
    .checkImg {
        background: url("../assets/img/testAn/ischeck.png") no-repeat;
    }
    .allCheck .allcheckImg {
        background: url("../assets/img/testAn/ischeck.png") no-repeat;
    }
    .secondUl {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    .secondP {
        padding-left: 60px;
    }
    .secondP span {
    }
    .secondUl li {
        height: 50px;
    }
    .testAnalysis .testAnalysis-third{
        height: 400px;
    }
</style>