派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-13 04ed9679adccde76c00bb9648124326de54719d6
src/components/BaseNav/PublicBounced/GasComponents/PublicChart.vue
@@ -4,73 +4,148 @@
        <div class="border_corner border_corner_right_top"></div>
        <div class="border_corner border_corner_left_bottom"></div>
        <div class="border_corner border_corner_right_bottom"></div>
        <el-tabs type="card" v-model="activeName">
            <el-tab-pane label="实试数据" name="first"></el-tab-pane>
            <el-tab-pane label="日数据" name="second">
                <ECharts></ECharts>
            </el-tab-pane>
            <el-tab-pane label="月数据" name="third"></el-tab-pane>
            <el-tab-pane label="人工数据" name="fourth"></el-tab-pane>
        </el-tabs>
        <ul class="tab">
<!--            <li @click='tabTaggle("ECharts")'>实时数据</li>-->
<!--            <li @click='tabTaggle("EChartsHour")'>小时数据</li>-->
<!--            <li @click='tabTaggle("EChartsDate")'>日数据</li>-->
<!--            <li @click='tabTaggle("EChartsDate")'>人工数据</li>-->
            <li :class="active==0?'hover':''" @click='tabTaggle("ECharts",0)'>实时数据</li>
            <li :class="active==1?'hover':''" @click='tabTaggle("EChartsHour",1)'>小时数据</li>
            <li :class="active==2?'hover':''" @click='tabTaggle("EChartsDate",2)'>日数据</li>
            <li :class="active==3?'hover':''" @click='tabTaggle("EChartsTable",3)'>人工数据</li>
        </ul>
        <div class="legend" >
            <span >正常</span>
            <i style=" background: #4ec99c;"></i>
            <span >预警</span>
            <i style=" background: red;"></i>
            <span >超标</span>
            <i style=" background: orange;"></i>
        </div>
        <component :is="currentTab" v-bind="$attrs" ref="Echatrs"></component>
    </div>
</template>
<script>
import ECharts from './ECharts'
import EChartsHour from './EChartsHour'
import EChartsDate from './EChartsDate'
import ECharts from './Echarts'
// import EChartsDate from './EChartsDate'
import EChartsHourWasteWater from './EChartsHourWasteWater'
import EChartsTable from '@components/BaseNav/PublicBounced/GasComponents/EChartsTable'
export default {
  name: 'PublicChart',
  components: {
    ECharts
    EChartsHour,
    EChartsDate,
    ECharts,
    // EChartsDate
    EChartsHourWasteWater,
    EChartsTable
  },
  mounted () {
    this.$refs.Echatrs.CreateChart()
  },
  data () {
    return {
      activeName: 'second'
      currentTab: 'EChartsHour',
      active: '1'
    }
  },
  methods: {
    tabTaggle (taggleMenu, num) {
      this.currentTab = taggleMenu
      this.active = num
      // debugger
    }
  }
}
</script>
<style scoped>
    .win {
        position: relative;
        margin-bottom: 13px;
        background-color: rgba(33, 41, 69,0.9);
        border: 0.8px solid #396d83;
    }
    .border_corner{
        z-index: 999;
        position: absolute;
        width: 10px;
        height: 10px;
        background: rgba(0,0,0,0);
        border: 1.5px solid #47d5ea;
    }
    .border_corner_left_top{
        top: 0;
        left: 0;
        border-right: none;
        border-bottom: none;
    }
    .border_corner_right_top{
        top: 0;
        right: 0;
        border-left: none;
        border-bottom: none;
    }
    .border_corner_left_bottom{
        bottom: 0;
        left: 0;
        border-right: none;
        border-top: none;
    }
    .border_corner_right_bottom{
        bottom: 0;
        right: 0;
        border-left: none;
        border-top: none;
    }
<style scoped lang="less">
.win {
  position: relative;
  /*margin-bottom: 13px;*/
  background:@background-color;
  border: 0.8px solid #396d83;
  /*height: 1.5rem;*/
}
.border_corner {
  z-index: 999;
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(0, 0, 0, 0);
  border: 1.5px solid #47d5ea;
}
.border_corner_left_top {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
}
.border_corner_right_top {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
}
.border_corner_left_bottom {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
}
.border_corner_right_bottom {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
}
.tab {
  display: flex;
  border-bottom: 1px solid #396d83;
    padding:5px 10px
}
.tab li {
  background-color: #243a55;
  line-height: 25px;
  text-align: center;
  border-radius: 5px;
    margin-right: 10px;
    padding:0 15px
}
.tab li.hover,
.tab li:hover {
  background-color: #0e639e;
  color: #fff;
  cursor: pointer;
}
.legend{
    position: absolute;
    top:10px;
    right: 0;
    display: flex;
    justify-items: center;
}
.legend i {
    display: block;
    width: 35px;
    height: 15px;
    margin:0 10px 0 3px;
    border-radius: 3px;
}
.legend span{
    line-height: 15px;
}
</style>