ioflow.vue 6 KB
<template>
    <div class="base-analysis">
        <el-header height="70px">
            <span class="asis-title">{{ asisName }}&nbsp;{{$t('asis.IoFlow')}}</span>
            <span class="more-option-wrapper" @click="showCollapse">
                <span class="more-option-text">{{$t('asis.moreOp')}}</span>
                <i :class="moreOptVisible ? 'el-icon-arrow-down more-option-arrow' : 'el-icon-arrow-down more-option-arrow more-option-up'"></i>
            </span>
        </el-header>
        <ioflow-option v-show="moreOptVisible" ref="init" @reportTime="reportHandler" @initData="initTab" @childByValue="childByValue"></ioflow-option>
        <div class="element-main ioflow-main">
            <router-view :propparam="propParams"></router-view>
        </div>
    </div> 
</template>

<script>
import ioFlowOption from '../common/option/ioFlowOption'
export default {
    data() {
        return {
            moreOptVisible: false,
            asisName: '',
            propParams: {}
        }
    },
    components: {
        'ioflow-option': ioFlowOption,
    },
    computed: {
    },
    created(){
    },
    mounted() {
        // this.router.push('/analysis/comprehenAnalysis/daily')
        this.getMallOpt();
        this.showCollapse()
    },
    methods: {
        childByValue(childValue) {
            this.animate('.ioflow-main')
        },
        showCollapse() {
            // 获取上面元素的高度
            let headerH = '', titleH = '', collapseH = '', mt = '';
                headerH = this.getStyleFn('.el-header', 'height');
                titleH = this.getStyleFn('.analysis-wrapper .el-header', 'height');
            if(this.moreOptVisible) {
                this.moreOptVisible = false;
                mt = headerH + titleH + 8 + 'px';
                $('.ioflow-main').animate({ marginTop: mt })
            } else {
                this.moreOptVisible = true;
                setTimeout(() => {
                    collapseH = this.getStyleFn('.analysis-option-wrapper', 'height');
                    mt = headerH + titleH + collapseH + 8 + 'px';
                    $('.ioflow-main').animate({ marginTop: mt });
                }, 100);
            }
        },
        getMallOpt() {
            this.getCommonMalls().then(resolveData => {
                let {mallData,localMallId,titleName,multiMallId} = resolveData;
                this.mallData = mallData
                this.$refs.init.initAsis(multiMallId,mallData);
            },(rejectData) => {
            })
        },
        initTab(data) {
            this.asisName = data.asis_tit;
            this.receiveParam(data)
        },
        reportHandler(emitData) {
            this.asisName = emitData.asis_tit;
            this.receiveParam(emitData)
        },
        receiveParam(emitData) {
            let result = this.routerJump('analysis','ioflow',emitData);
            this.$router.push(result.router);
            this.propParams = result.params;
        },
    },
}
</script>
<style scoped>
    .report-type-box {
        font-size: 14px;
        float: right;
        color: #666;
        cursor: pointer;
        position: relative;
        padding-right: 20px;
    }

    .line-type-box {
        position: absolute;
        right: 102px;
        top: 20px;
    }

    .report-item {
        display: inline-block;
        width: 20px;
        height: 18px;
        background: url('~@/assets/img/asis/tab_icon.svg') no-repeat;
        background-size: 100% 100%;
    }

    .report-item + .report-item {
        margin-left: 5px;
    }

    .line-report {
        background: url('~@/assets/img/asis/line_icon.svg') no-repeat;
        background-size: 100% 100%;
    }

    .report-item:hover {
        color: #0069ff;
    }

    .report-item-line {
        background: url('~@/assets/img/asis/active_line_icon.svg') no-repeat;
        background-size: 100% 100%;
    }

    .report-item-tab {
        background: url('~@/assets/img/asis/active_tab_icon.svg') no-repeat;
        background-size: 100% 100%;
    }

    /* .report-item-line,
    .report-item-tab {
        color: #0069ff;
    } */

    .tf-chart-box {
        height: 568px;
    }

    .asis-table-content {
        position: relative;
    }

    .asis-line-content {
        /* margin-top: 46px; */
    }

    /* .tf-table-header {
        margin-top: 46px;
    } */

    .download-text {
        top: 20px;
    }
    .ehcarts-title{
        top: 82px;
    }

    @media only screen and (max-width: 1680px) {
        .asis-line-content {
            /* margin-top: 30px; */
        }
        .tf-chart-box {
            height: 374px;
        }
        .download-text,
        .ehcarts-title,
        .line-type-box {
            top: 20px;
        }
        .report-item {
            display: inline-block;
            width: 20px;
            height: 18px;
        }
    }
    @media only screen and (max-width: 1440px) {
        .asis-line-content {
            /* margin-top: 30px; */
        }
        .tf-chart-box {
            height: 374px;
        }
        .download-text,
        .ehcarts-title,
        .line-type-box {
            top: 20px;
        }
        .report-item {
            display: inline-block;
            width: 16px;
            height: 14px;
        }
    }
    @media only screen and (max-width: 1366px) {
        .asis-line-content {
            /* margin-top: 30px; */
        }
        .tf-chart-box {
            height: 374px;
        }
        .download-text,
        .ehcarts-title,
        .line-type-box {
            top: 20px;
        }
        .report-item {
            display: inline-block;
            width: 16px;
            height: 14px;
        }
    }
    @media only screen and (max-width: 1280px) {
        .asis-line-content {
            /* margin-top: 30px; */
        }
        .tf-chart-box {
            height: 374px;
        }
        .download-text,
        .ehcarts-title,
        .line-type-box {
            top: 20px;
        }
        .report-item {
            display: inline-block;
            width: 16px;
            height: 14px;
        }
    }
</style>