ViewSolar.vue 1.67 KB
<!--
 * @Description: 1.0 太阳膜内容页面
 * @Author: huyue
 * @Date: 2023-07-04 13:56:33
 * @LastEditors: huyue
 * @LastEditTime: 2023-07-19 14:47:48
-->
<template>
  <div class="view-content">
    <ViewDate :defaultYear="defaultYear" :dataList="yearList" :businessTime="businessTime"></ViewDate>
    <div class="content">
      <ContentLeft></ContentLeft>
      <ContentRight></ContentRight>
    </div>
  </div>
</template>
<script>
import ContentLeft from '../../solar/ContentLeft'
import ContentRight from '../../solar/ContentRight.vue'
export default {
  name: 'ViewSolar',
  components: {
    ContentLeft,
    ContentRight
  },
  props: {
  },
  computed: {
  },
  data() {
    return {
      businessTime: '',
      yearList: [{
        label: '全部',
        value: ''
      }],
      defaultYear: ''
    }
  },
  created() {
    this.$bus.$on('businessstarttime', data => {
      this.businessTime = data
    })
    this.getYears()
  },
  methods: {
    async getYears() {
      const _data = await this.api.solar.getYears({})
      const _yearList = _data.data.dataList[0].year.reverse()
      _yearList.forEach(item => {
        this.yearList.push({
          label: item,
          value: item + ''
        })
      })
      this.defaultYear = this.yearList[0].value
    }
  }
}
</script>
<style scoped lang='scss'>
.view-content {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  position: relative;
  padding: 1.78vh 24px;
  gap: 0 16px;
}
.content {
  display: flex;
  justify-content: space-between;
  // padding: 1.78vh 0 0;
  margin-top: 1.78vh;
  > div {
    // height: 100%;
  }
}
</style>