能源分析
This commit is contained in:
		@@ -4,16 +4,16 @@
 | 
			
		||||
    <search-area @submit="getList"/>
 | 
			
		||||
    <el-tabs v-model="activeName" @tab-click="switchChart">
 | 
			
		||||
      <el-tab-pane label="柱状图" name="bar">
 | 
			
		||||
        <bar-chart ref="contrastBarChart" :chartData="chartData" />
 | 
			
		||||
        <bar-chart ref="analysisBarChart" :chartData="chartData" />
 | 
			
		||||
      </el-tab-pane>
 | 
			
		||||
      <el-tab-pane label="折线图" name="line">
 | 
			
		||||
        <line-chart ref="contrastLineChart" :chartData="chartData"/>
 | 
			
		||||
        <line-chart ref="analysisLineChart" :chartData="chartData"/>
 | 
			
		||||
      </el-tab-pane>
 | 
			
		||||
    </el-tabs>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getEnergyTrend } from "@/api/analysis/energyAnalysis"
 | 
			
		||||
import { getCompare } from "@/api/analysis/energyAnalysis"
 | 
			
		||||
import SearchArea from "./components/searchArea"
 | 
			
		||||
import BarChart from "./components/barChart"
 | 
			
		||||
import LineChart from "./components/lineChart"
 | 
			
		||||
@@ -30,23 +30,14 @@ export default {
 | 
			
		||||
  mounted() {},
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList(params) {
 | 
			
		||||
      getEnergyTrend({ ...params }).then((res) => {
 | 
			
		||||
      getCompare({ ...params }).then((res) => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        if (res.code === 0) {
 | 
			
		||||
          this.chartData = res.data
 | 
			
		||||
          this.chartData = res.data || []
 | 
			
		||||
        } else {
 | 
			
		||||
          this.chartData = []
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      // getEnergyTrend({
 | 
			
		||||
      //   energyTypeId: "1681183397517406210",
 | 
			
		||||
      //   objId: "1679031282510532610",
 | 
			
		||||
      //   timeDim: "2",
 | 
			
		||||
      //   startTime: "1690732800000",
 | 
			
		||||
      //   endTime: "1690992000000"
 | 
			
		||||
      // }).then((res) => {
 | 
			
		||||
      //   console.log(res)
 | 
			
		||||
      //   this.chartData = res.data
 | 
			
		||||
      // })
 | 
			
		||||
    },
 | 
			
		||||
    switchChart() {
 | 
			
		||||
      if (this.activeName === 'bar') {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user