|
@@ -4,10 +4,12 @@
|
|
|
style="position: absolute; top: 115px; left: 50px"
|
|
|
title="实时统计"
|
|
|
:data="statisticsData"
|
|
|
+ class="animated fadeInLeft"
|
|
|
v-if="isCake"
|
|
|
/>
|
|
|
<cylindricalHistogram
|
|
|
style="position: absolute; left: 50px; top: 430px"
|
|
|
+ class="animated fadeInLeft"
|
|
|
v-if="isGetData"
|
|
|
:unit="`公斤/产量`"
|
|
|
title="各区域移栽产量分析"
|
|
@@ -17,6 +19,7 @@
|
|
|
<weatherForecast
|
|
|
:unit="`摄氏度`"
|
|
|
style="position: absolute; left: 50px; top: 760px"
|
|
|
+ class="animated fadeInLeft"
|
|
|
v-if="isWeather"
|
|
|
title="天气预报"
|
|
|
:area="Weatherarea"
|
|
@@ -27,6 +30,7 @@
|
|
|
:unit="`平方米/面积`"
|
|
|
id="`wavyLineChart`"
|
|
|
style="position: absolute; right: 50px; top: 115px"
|
|
|
+ class="animated fadeInRight"
|
|
|
v-if="isWavyLine"
|
|
|
title="各区域移栽面积"
|
|
|
:area.sync="wavyLineArea"
|
|
@@ -35,6 +39,7 @@
|
|
|
/>
|
|
|
<HorizontalHistogram
|
|
|
style="position: absolute; right: 50px; top: 430px"
|
|
|
+ class="animated fadeInRight"
|
|
|
v-if="isHorizontal"
|
|
|
id="`移栽情况分析`"
|
|
|
title="移栽情况分析"
|
|
@@ -44,6 +49,7 @@
|
|
|
<wavyLineChart
|
|
|
id="`移栽趋势分析`"
|
|
|
style="position: absolute; right: 50px; top: 760px"
|
|
|
+ class="animated fadeInRight"
|
|
|
v-if="isWavyLine"
|
|
|
title="移栽趋势分析"
|
|
|
:area.sync="trendarea"
|
|
@@ -85,6 +91,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ autoVueFnInit: false,
|
|
|
statisticsData: {
|
|
|
title: `目标完成率`,
|
|
|
value: 0,
|
|
@@ -155,14 +162,17 @@ export default {
|
|
|
fn: this.getTrendAnalysis,
|
|
|
},
|
|
|
],
|
|
|
- this
|
|
|
+ {
|
|
|
+ vm: this,
|
|
|
+ batEnd() {
|
|
|
+ this.autoVueFnInit = true
|
|
|
+ },
|
|
|
+ }
|
|
|
)
|
|
|
this.getJSON()
|
|
|
// this.$http.get(`https://httpbin.org/get`)
|
|
|
},
|
|
|
- mounted() {
|
|
|
- screenSize(this.$refs.editor)
|
|
|
- },
|
|
|
+ mounted() {},
|
|
|
methods: {
|
|
|
tabChange(val) {
|
|
|
if (val === 0) {
|
|
@@ -173,7 +183,7 @@ export default {
|
|
|
console.log(`val`, val)
|
|
|
},
|
|
|
getAnalysisOfTransplantYieldInVariousRegions() {
|
|
|
- this.$http
|
|
|
+ return this.$http
|
|
|
.get(`/api/analysisOfTransplantYieldInVariousRegions`)
|
|
|
.then((res) => {
|
|
|
const area = []
|
|
@@ -188,7 +198,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getWeatherForecast() {
|
|
|
- this.$http.get(`/api/weatherForecast`).then((res) => {
|
|
|
+ return this.$http.get(`/api/weatherForecast`).then((res) => {
|
|
|
const area = []
|
|
|
const dataArray = []
|
|
|
res.forEach((element) => {
|
|
@@ -201,7 +211,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getTransplantAreaInEachRegion() {
|
|
|
- this.$http.get(`/api/transplantAreaInEachRegion`).then((res) => {
|
|
|
+ return this.$http.get(`/api/transplantAreaInEachRegion`).then((res) => {
|
|
|
const area = []
|
|
|
const dataArray = {
|
|
|
LastYear: [],
|
|
@@ -218,26 +228,28 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getAnalysisOfTransplantingSituation() {
|
|
|
- this.$http.get(`/api/analysisOfTransplantingSituation`).then((res) => {
|
|
|
- const area = []
|
|
|
- const dataArray = {
|
|
|
- Done: [],
|
|
|
- Percentage: [],
|
|
|
- }
|
|
|
- const date = res.sort((a, b) => b.已移载 - a.已移载)
|
|
|
- date.forEach((element) => {
|
|
|
- area.push(element.名称.slice(0, 2))
|
|
|
- dataArray.Done.push(element.已移载)
|
|
|
- dataArray.Percentage.push(element.比率.toFixed(0))
|
|
|
- })
|
|
|
- this.HorizontalArea = area
|
|
|
- this.HorizontalArray = dataArray
|
|
|
+ return this.$http
|
|
|
+ .get(`/api/analysisOfTransplantingSituation`)
|
|
|
+ .then((res) => {
|
|
|
+ const area = []
|
|
|
+ const dataArray = {
|
|
|
+ Done: [],
|
|
|
+ Percentage: [],
|
|
|
+ }
|
|
|
+ const date = res.sort((a, b) => b.已移载 - a.已移载)
|
|
|
+ date.forEach((element) => {
|
|
|
+ area.push(element.名称.slice(0, 2))
|
|
|
+ dataArray.Done.push(element.已移载)
|
|
|
+ dataArray.Percentage.push(element.比率.toFixed(0))
|
|
|
+ })
|
|
|
+ this.HorizontalArea = area
|
|
|
+ this.HorizontalArray = dataArray
|
|
|
|
|
|
- this.isHorizontal = true
|
|
|
- })
|
|
|
+ this.isHorizontal = true
|
|
|
+ })
|
|
|
},
|
|
|
getStatistics() {
|
|
|
- this.$http.get(`/api/realTimeStatistics`).then((res) => {
|
|
|
+ return this.$http.get(`/api/realTimeStatistics`).then((res) => {
|
|
|
const obj = this.statisticsData
|
|
|
// eslint-disable-next-line no-prototype-builtins
|
|
|
if (res.hasOwnProperty(obj.title)) {
|
|
@@ -263,7 +275,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getTrendAnalysis() {
|
|
|
- this.$http.get(`/api/transplantTrendAnalysis`).then((res) => {
|
|
|
+ return this.$http.get(`/api/transplantTrendAnalysis`).then((res) => {
|
|
|
const area = []
|
|
|
const dataArray = {
|
|
|
LastYear: [],
|