<!--
 * @Author: your name
 * @Date: 2021-10-14 10:11:41
 * @LastEditTime: 2021-11-09 13:16:55
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /data-show/src/views/WeiboDetails/weiboCommunicationTrend/index.vue
-->
<template>
    <div class="wct-outter" v-loading="load">
        <v-label-div title="传播态势">
        </v-label-div>
        <div class="wct-inner">
            <v-echarts :opt="opt"></v-echarts>
        </div>
        <!-- <div class="vshow" v-if="modelShow" :style="modelStyle">
            <vLabel-div title="实时热点事件">
                <a-button @click="closeBox">关闭</a-button>
            </vLabel-div>
            <div class="vshow-item" v-for="(item, index) in urlArr" :key="index">
                <a class="vshow-link" :href="item.url" v-if="item.column == activeCol" target="tar">{{item.title}}</a>
            </div>
        </div> -->
    </div>
</template>

<script>
import {getTimeCount} from "@/api/KeyMediaTheme/index.js"
import {doStr} from "@/utils/gol/dataTool"
import createOpt from "./opt"
export default {
    name: "weibo-communication-trend",
    data() {
        return {
            //弹出框//
            modelStyle:{
                left: '',
                top: ''
            },
            modelShow: false,
            ecbox:{//图表宽高
                width:618,
                height:490
            },
            ecmodel:{//弹框宽高
                width:300,
                height:280
            },
            activeCol: 0,
            //-*-//
            load: false, 
            form: {
                token: "",
                sGuid: '',
                sSeriesName: '',
                ilimitType: 0,
            },
            opt: createOpt(),
            urlArr: []
        }
    },
    created() {
        this.form = this.$route.query
        this.form.token = this.getToken;
        this.form.ilimitType = 0
        if(this.form.sSource == '汽车之家') {
        this.form.ilimitType = 1;
        } else if (this.form.sSource == '懂车帝' && this.getCarCircle == 1) {
        this.form.ilimitType = 2;
        }
        this.getData();
    },
    methods: {
        //--弹出框--//
        // clickMark(data) {
        //     this.activeCol = data.index
        //     this.modelShow = true;
        //     let mw = window.event;
        //     if((this.ecbox.width - mw.offsetX - 20) > this.ecmodel.width) {
        //         this.modelStyle.left = mw.offsetX + 20 + "px"
        //     } else {
        //         this.modelStyle.left = mw.offsetX - this.ecmodel.width - 20 + "px"
        //     }
        //     if((this.ecbox.height - mw.offsetY - 20) > this.ecmodel.height) {
        //         this.modelStyle.top = mw.offsetY + "px"
        //     } else {
        //         this.modelStyle.top = mw.offsetY - this.ecmodel.height + "px"
        //     }
        // },
        // closeBox() {
        //     this.modelShow = false;
        // },
        //----//
        getData() {
            this.load = true;
            let obj = Object.assign({}, this.getCtime2, this.form);
            getTimeCount(obj).then(res => {
                let data = res.data || [];               
                let dx = []; //time
                let ds = []; //value
                data.forEach(ele => {
                    dx.push(ele.Time);
                    ds.push(ele.value);
                })
                this.opt = createOpt(dx, ds)
                this.load = false
            });
        }
    }
};
</script>

<style lang="less" scoped>
.wct-outter {
    width: 1887px;
    height: 460px;
    border: 2px solid #0f2a4d;
    .wct-inner {
        width: 100%;
        height: calc(100% - 48px);
    }
}
.vshow{
  position: absolute;
    width: 300px;
    background: rgb(3, 18, 36);
    border: 4px solid #0f2a4d;
    .vshow-item {
        padding: 11px;
        width: 100%;
        font-size: 15px;
        color: rgb(54, 189, 239);
    }
}
</style>
