whychdw
2020-07-13 d51f736b92dc099c7528d9ede75a5eba3ba29465
提交日期相同选择开始时间
2个文件已修改
47 ■■■■ 已修改文件
src/components/chart/LineChart.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/batt-list/history-page.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chart/LineChart.vue
@@ -1,6 +1,8 @@
<template>
    <div class="chart-container" :style="getStyle" >
        <div class="chart-content-container"
    <div class="chart-container" :style="getStyle">
        <div class="chart-content-container"
        @mouseenter="mouseEnter"
        @mouseleave="mouseLeave"
        :class="{'chart-content-fixed':isFull}">
            <div class="chart-content" :id="id"></div>
            <!-- <div class="chart-tools">
@@ -145,12 +147,15 @@
                        end: dataZoom.end,
                        xAxisIndex: [0],
                        realtime: false,
                        left: '0',
                        right: '8px',
                        dataBackground: {
                            lineStyle: {
                                color: '#15E3F3'
                            },
                            areaStyle: {
                                color: '#15E3F3'
                                color: '#15E3F3',
                                opacity: 0,
                            }
                        },
                    },
@@ -205,6 +210,35 @@
                this.chart.resize();
            });
        },
        mouseEnter() {
            if(!this.showZoom) {
                return false;
            }
            // 绘制图表
            this.chart.setOption({
                grid: {
                    bottom: '40px',
                },
                dataZoom: [{
                    show: true,
                }]
            });
        },
        mouseLeave() {
            if(!this.showZoom) {
                return false;
            }
            this.dataZoom.show = false;
            // 绘制图表
            this.chart.setOption({
                grid: {
                    bottom: '1',
                },
                dataZoom: [{
                    show: false,
                }]
            });
        },
    },
    computed: {
        getStyle(){
src/pages/batt-list/history-page.vue
@@ -54,7 +54,7 @@
                :title="option.title" 
                :height="option.height"
                :zoom="false"
                :show-zoom="option.showZoom"
                :show-zoom="true"
                :end="4"></line-chart>
                </div>
            </template>
@@ -478,8 +478,9 @@
            return this.showChartTitle.join(',');
        },
        getTableName() {
            return new Date(this.record_time).format("yyyy-MM-dd")+'-'
            +new Date(this.record_time1).format("yyyy-MM-dd");
            let start = new Date(this.record_time).format("yyyy-MM-dd");
            let end = new Date(this.record_time1).format("yyyy-MM-dd");
            return start==end?start:start+'-'+end;
        },
    },
    mounted() {