|
@@ -1,166 +1,269 @@
|
|
|
<template>
|
|
|
- <div>
|
|
|
- <bgBox class="bgBox" bgType="g-bg2" :tabChange="tabChange" :tabIndex="1">
|
|
|
- <leftBox
|
|
|
- class="lefBox animated fadeInLeft"
|
|
|
- :listCb="(data) => (baseList = data)"
|
|
|
- />
|
|
|
- <cmap :baseList="baseList" />
|
|
|
- <HorizontalHistogram
|
|
|
- style="position: absolute; right: 50px; top: 115px; z-index: 10"
|
|
|
- v-if="isHorizontal"
|
|
|
- id="`各区域移栽面积1`"
|
|
|
- title="各区域移栽面积"
|
|
|
- :area="HorizontalArea"
|
|
|
- :dataArray="HorizontalArray"
|
|
|
+ <bgBox :tabChange="tabChange" class="bgBox" :tabIndex="1">
|
|
|
+ <histogram
|
|
|
+ style="position: absolute; left: 20px; top: 98px"
|
|
|
+ class="animated fadeInLeft"
|
|
|
+ title="各区域移栽产量分析"
|
|
|
+ :barHeight="'316px'"
|
|
|
+ total="2700"
|
|
|
+ :area="Transplantarea"
|
|
|
+ :dataArray="TransplantdataArray"
|
|
|
+ />
|
|
|
+ <weatherForecast
|
|
|
+ id="平台订单总量趋势(月)"
|
|
|
+ :barHeight="'312px'"
|
|
|
+ style="position: absolute; left: 20px; top: 426px"
|
|
|
+ class="animated fadeInLeft"
|
|
|
+ title="平台订单总量趋势(月)"
|
|
|
+ :area="trendarea"
|
|
|
+ :dataArray="trendDataArray"
|
|
|
+ ></weatherForecast>
|
|
|
+ <ComplexHistograms
|
|
|
+ :barHeight="'312px'"
|
|
|
+ id="平台订单总交易额趋势(月)"
|
|
|
+ style="position: absolute; left: 20px; top: 750px"
|
|
|
+ class="animated fadeInLeft"
|
|
|
+ title="平台订单总交易额趋势(月)"
|
|
|
+ >
|
|
|
+ </ComplexHistograms>
|
|
|
+ <threeMap
|
|
|
+ @toView="toView"
|
|
|
+ class="animated zoomIn"
|
|
|
+ style="
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%,15%);
|
|
|
+ "
|
|
|
+ v-if="hasGetJson"
|
|
|
+ :getJson="getJson"
|
|
|
+ ></threeMap>
|
|
|
+ <weatherForecast
|
|
|
+ :barHeight="'254px'"
|
|
|
+ id="订单总量"
|
|
|
+ style="position: absolute; right: 20px; top: 98px"
|
|
|
class="animated fadeInRight"
|
|
|
- />
|
|
|
- <wavyLineChart
|
|
|
- id="`本月移栽数量趋势`"
|
|
|
- style="position: absolute; right: 50px; top: 460px; z-index: 10"
|
|
|
- v-if="isMonthTrend"
|
|
|
- title="本月移栽数量趋势"
|
|
|
- :max="max"
|
|
|
- :area.sync="monthTrendarea"
|
|
|
- :dataArray.sync="monthTrendDataArray"
|
|
|
- :lineName="monthName"
|
|
|
+ title="订单总量"
|
|
|
+ :area="trendarea"
|
|
|
+ :dataArray="trendDataArray"
|
|
|
+ ></weatherForecast>
|
|
|
+ <weatherForecast
|
|
|
+ id="订单总量2"
|
|
|
+ :barHeight="'254px'"
|
|
|
+ style="position: absolute; right: 20px; top: 364px"
|
|
|
class="animated fadeInRight"
|
|
|
- />
|
|
|
- <wavyLineChart
|
|
|
- id="`本年移栽数量趋势`"
|
|
|
- :lineName="yearName"
|
|
|
- style="position: absolute; right: 50px; top: 760px; z-index: 10"
|
|
|
- title="本年移栽数据趋势"
|
|
|
- :area.sync="yearTrendarea"
|
|
|
+ title="订单总量"
|
|
|
+ :area="Weatherarea"
|
|
|
+ :dataArray="WeatherdataArray"
|
|
|
+ ></weatherForecast>
|
|
|
+ <HybridCharts
|
|
|
class="animated fadeInRight"
|
|
|
- :dataArray.sync="yearTrendDataArray"
|
|
|
- v-if="isYearTrend"
|
|
|
- />
|
|
|
- </bgBox>
|
|
|
- </div>
|
|
|
+ title="平台订单来源类型分布"
|
|
|
+ style="position: absolute; right: 20px; top: 630px">
|
|
|
+ </HybridCharts>
|
|
|
+ </bgBox>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import mapOfTongren from '@/http/mapOfTongren.json'
|
|
|
import bgBox from '@/components/bgBox/index.vue'
|
|
|
-import cmap from './cmap.vue'
|
|
|
-import leftBox from './leftBox.vue'
|
|
|
+import cake from '@/components/Customize/cake'
|
|
|
+import HybridCharts from '@/components/Customize/HybridCharts'
|
|
|
+import slotCake from '@/components/Customize/slotCake'
|
|
|
+import histogram from '@/components/Customize/histogram'
|
|
|
+import ComplexHistograms from '@/components/Customize/Complex histograms'
|
|
|
+import weatherForecast from '@/components/Customize/weatherForecast'
|
|
|
import HorizontalHistogram from '@/components/Customize/HorizontalHistogram'
|
|
|
-import wavyLineChart from '@/components/Customize/wavyLineChart'
|
|
|
-window.map = {}
|
|
|
+import statisticsPanel from '@/components/statisticsPanel/index.vue'
|
|
|
+import threeMap from '@/components/Customize/map/index'
|
|
|
+
|
|
|
export default {
|
|
|
+ name: `Home`,
|
|
|
components: {
|
|
|
- bgBox,
|
|
|
- leftBox,
|
|
|
- cmap,
|
|
|
- wavyLineChart,
|
|
|
+ histogram,
|
|
|
+ HybridCharts,
|
|
|
+ slotCake,
|
|
|
+ weatherForecast,
|
|
|
HorizontalHistogram,
|
|
|
+ ComplexHistograms,
|
|
|
+ statisticsPanel,
|
|
|
+ bgBox,
|
|
|
+ threeMap,
|
|
|
+ cake,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- baseList: [],
|
|
|
+ tabs: {
|
|
|
+ index: 0,
|
|
|
+ list: [`订单总量`, `订单交易额`],
|
|
|
+ },
|
|
|
max: 100,
|
|
|
- HorizontalArea: [],
|
|
|
- HorizontalArray: {
|
|
|
- Done: [],
|
|
|
+ autoVueFnInit: false,
|
|
|
+ statisticsData: {
|
|
|
+ title: `目标完成率`,
|
|
|
+ value: 0,
|
|
|
+ acrossList: [
|
|
|
+ {name: `年移栽数量`, value: undefined},
|
|
|
+ {name: `年移栽面积`, value: undefined},
|
|
|
+ ],
|
|
|
+ verticalList: [
|
|
|
+ {name: `移栽区域数`, value: undefined},
|
|
|
+ {name: `烟农数量`, value: undefined},
|
|
|
+ ],
|
|
|
},
|
|
|
yearName: {
|
|
|
lastName: `去年`,
|
|
|
thisName: `今年`,
|
|
|
},
|
|
|
- isHorizontal: true,
|
|
|
- monthTrendarea: [],
|
|
|
- monthTrendDataArray: {
|
|
|
+ TransplantdataArray: [],
|
|
|
+ Transplantarea: [],
|
|
|
+ Weatherarea: [],
|
|
|
+ WeatherdataArray: {
|
|
|
+ temperature: [],
|
|
|
+ Weather: [],
|
|
|
+ },
|
|
|
+ wavyLineArea: [],
|
|
|
+ wavyLinedataArray: {
|
|
|
LastYear: [],
|
|
|
thisYear: [],
|
|
|
},
|
|
|
- monthName: {
|
|
|
- lastName: `上月`,
|
|
|
- thisName: `本月`,
|
|
|
- },
|
|
|
- yearTrendarea: [],
|
|
|
- yearTrendDataArray: {
|
|
|
+ trendarea: [],
|
|
|
+ trendDataArray: {
|
|
|
LastYear: [],
|
|
|
thisYear: [],
|
|
|
},
|
|
|
- isMonthTrend: false,
|
|
|
- isYearTrend: false,
|
|
|
+ HorizontalArea: [],
|
|
|
+ HorizontalArray: {
|
|
|
+ Done: [],
|
|
|
+ Percentage: [],
|
|
|
+ },
|
|
|
+ getJson: {},
|
|
|
+ isGetData: false,
|
|
|
+ isWeather: false,
|
|
|
+ isWavyLine: false,
|
|
|
+ isHorizontal: false,
|
|
|
+ isTrend: false,
|
|
|
+ hasGetJson: false,
|
|
|
+ isCake: false,
|
|
|
}
|
|
|
},
|
|
|
computed: {},
|
|
|
- async created() {
|
|
|
- this.$util.autoVueFn(
|
|
|
- [
|
|
|
- {
|
|
|
- time: 1000 * 60,
|
|
|
- fn: this.getAnalysisOfTransplantingSituation,
|
|
|
- },
|
|
|
- {
|
|
|
- time: 1000 * 60,
|
|
|
- fn: this.getTrendOfTransplantQuantityThisMonth,
|
|
|
- },
|
|
|
- {
|
|
|
- time: 1000 * 60,
|
|
|
- fn: this.getThisYearsTransplantingDataTrend,
|
|
|
- },
|
|
|
- ],
|
|
|
- this
|
|
|
- )
|
|
|
+ created() {
|
|
|
+ this.getJSON()
|
|
|
+ // this.$util.autoVueFn(
|
|
|
+ // [
|
|
|
+ // {
|
|
|
+ // time: 1000 * 60,
|
|
|
+ // fn: this.getWeatherForecast,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // time: 1000 * 60,
|
|
|
+ // fn: this.getAnalysisOfTransplantYieldInVariousRegions,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // time: 1000 * 60,
|
|
|
+ // fn: this.getTransplantAreaInEachRegion,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // time: 1000 * 60,
|
|
|
+ // fn: this.getAnalysisOfTransplantingSituation,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // time: 1000 * 60,
|
|
|
+ // fn: this.getStatistics,
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // time: 1000 * 60,
|
|
|
+ // fn: this.getTrendAnalysis,
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // {
|
|
|
+ // vm: this,
|
|
|
+ // batEnd() {
|
|
|
+ // this.autoVueFnInit = true
|
|
|
+ // },
|
|
|
+ // }
|
|
|
+ // )
|
|
|
},
|
|
|
- mounted() {},
|
|
|
- unmounted() {
|
|
|
- window.map.destroy()
|
|
|
+ mounted() {
|
|
|
},
|
|
|
methods: {
|
|
|
+ async toView(code) {
|
|
|
+ console.log(code)
|
|
|
+
|
|
|
+ const {id, 区域编码} = (await this.$util.code2base(this, code)) || {}
|
|
|
+ this.$router.push({
|
|
|
+ path: `/page3`,
|
|
|
+ query: {
|
|
|
+ id,
|
|
|
+ code: 区域编码,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ },
|
|
|
tabChange(val) {
|
|
|
if (val === 0) {
|
|
|
this.$router.push(`/page1`)
|
|
|
+ } else if (val === 1) {
|
|
|
+ this.$router.push(`/page2`)
|
|
|
}
|
|
|
console.log(`val`, val)
|
|
|
},
|
|
|
- getTrendOfTransplantQuantityThisMonth() {
|
|
|
- this.$http.get(`/api/transplantTrendAnalysis`).then((res) => {
|
|
|
- const area = []
|
|
|
- const dataArray = {
|
|
|
- LastYear: [],
|
|
|
- thisYear: [],
|
|
|
- comparisonLastDay: [],
|
|
|
- comparisonLastYear: [],
|
|
|
- }
|
|
|
- res.forEach((element) => {
|
|
|
- area.push(element.时间)
|
|
|
- dataArray.LastYear.push(element.去年)
|
|
|
- dataArray.thisYear.push(element.今年)
|
|
|
- dataArray.comparisonLastDay.push(element.较上日)
|
|
|
- dataArray.comparisonLastYear.push(element.较去年)
|
|
|
- })
|
|
|
- this.monthTrendarea = area
|
|
|
- this.monthTrendDataArray = dataArray
|
|
|
- this.isMonthTrend = true
|
|
|
- })
|
|
|
+ getAnalysisOfTransplantYieldInVariousRegions() {
|
|
|
+ return this.$http
|
|
|
+ .get(`/api/analysisOfTransplantYieldInVariousRegions`)
|
|
|
+ .then((res) => {
|
|
|
+ const area = []
|
|
|
+ const dataArray = []
|
|
|
+ res.forEach((element) => {
|
|
|
+ area.push(element.名称.slice(0, 2))
|
|
|
+ dataArray.push(element.值)
|
|
|
+ })
|
|
|
+ this.Transplantarea = area
|
|
|
+ this.TransplantdataArray = dataArray
|
|
|
+ this.isGetData = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getWeatherForecast() {
|
|
|
+ return this.$http
|
|
|
+ .get(`/api/weatherForecast`, {
|
|
|
+ params: {
|
|
|
+ districtId: 0,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ const area = []
|
|
|
+ const dataArray = {
|
|
|
+ temperature: [],
|
|
|
+ Weather: [],
|
|
|
+ }
|
|
|
+ res.forEach((element) => {
|
|
|
+ area.push(element.时间)
|
|
|
+ dataArray.temperature.push(element.温度)
|
|
|
+ dataArray.Weather.push(element.天气)
|
|
|
+ })
|
|
|
+ this.Weatherarea = area
|
|
|
+ this.WeatherdataArray = dataArray
|
|
|
+ this.isWeather = true
|
|
|
+ })
|
|
|
},
|
|
|
- getThisYearsTransplantingDataTrend() {
|
|
|
- this.$http.get(`/api/thisYearsTransplantingDataTrend`).then((res) => {
|
|
|
+ getTransplantAreaInEachRegion() {
|
|
|
+ return this.$http.get(`/api/transplantAreaInEachRegion`).then((res) => {
|
|
|
const area = []
|
|
|
const dataArray = {
|
|
|
LastYear: [],
|
|
|
thisYear: [],
|
|
|
- comparisonLastDay: [],
|
|
|
- comparisonLastYear: [],
|
|
|
}
|
|
|
res.forEach((element) => {
|
|
|
- area.push(element.时间)
|
|
|
+ area.push(element.名称.slice(0, 2))
|
|
|
dataArray.LastYear.push(element.去年)
|
|
|
dataArray.thisYear.push(element.今年)
|
|
|
- dataArray.comparisonLastDay.push(element.较上日)
|
|
|
- dataArray.comparisonLastYear.push(element.较去年)
|
|
|
})
|
|
|
- this.yearTrendarea = area
|
|
|
- this.yearTrendDataArray = dataArray
|
|
|
- this.isYearTrend = true
|
|
|
+ this.wavyLineArea = area
|
|
|
+ this.wavyLinedataArray = dataArray
|
|
|
+ this.isWavyLine = true
|
|
|
})
|
|
|
},
|
|
|
getAnalysisOfTransplantingSituation() {
|
|
|
- this.$http.get(`/api/transplantAreaInEachRegion2`).then((res) => {
|
|
|
+ this.$http.get(`/api/analysisOfTransplantingSituation`).then((res) => {
|
|
|
const area = []
|
|
|
const dataArray = {
|
|
|
Done: [],
|
|
@@ -169,7 +272,7 @@ export default {
|
|
|
const date = res
|
|
|
date.forEach((element) => {
|
|
|
area.push(element.名称.slice(0, 2))
|
|
|
- dataArray.Done.push(element.已移栽)
|
|
|
+ dataArray.Done.push(element.已移载)
|
|
|
dataArray.Percentage.push(element.比率.toFixed(0))
|
|
|
})
|
|
|
this.HorizontalArea = area
|
|
@@ -177,22 +280,88 @@ export default {
|
|
|
this.isHorizontal = true
|
|
|
})
|
|
|
},
|
|
|
+ getStatistics() {
|
|
|
+ return this.$http.get(`/api/realTimeStatistics`).then((res) => {
|
|
|
+ const obj = this.statisticsData
|
|
|
+ // eslint-disable-next-line no-prototype-builtins
|
|
|
+ if (res.hasOwnProperty(obj.title)) {
|
|
|
+ obj.value = res[obj.title]
|
|
|
+ }
|
|
|
+ const list1 = this.statisticsData.acrossList
|
|
|
+ this.statisticsData.acrossList = list1.map((item) => {
|
|
|
+ // eslint-disable-next-line no-prototype-builtins
|
|
|
+ if (res.hasOwnProperty(item.name)) {
|
|
|
+ return {...item, value: res[item.name]}
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ const list2 = this.statisticsData.verticalList
|
|
|
+ this.statisticsData.verticalList = list2.map((item) => {
|
|
|
+ // eslint-disable-next-line no-prototype-builtins
|
|
|
+ if (res.hasOwnProperty(item.name)) {
|
|
|
+ return {...item, value: res[item.name]}
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ this.isCake = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTrendAnalysis() {
|
|
|
+ return this.$http.get(`/api/transplantTrendAnalysis`).then((res) => {
|
|
|
+ const area = []
|
|
|
+ const dataArray = {
|
|
|
+ LastYear: [],
|
|
|
+ thisYear: [],
|
|
|
+ }
|
|
|
+ res.forEach((element) => {
|
|
|
+ area.push(element.时间)
|
|
|
+ dataArray.LastYear.push(element.去年)
|
|
|
+ dataArray.thisYear.push(element.今年)
|
|
|
+ })
|
|
|
+ this.trendarea = area
|
|
|
+ this.trendDataArray = dataArray
|
|
|
+ this.isTrend = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getJSON() {
|
|
|
+ this.getJson = mapOfTongren
|
|
|
+ this.hasGetJson = true
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
+<style lang="less">
|
|
|
+.tabbotton {
|
|
|
+ text-align: center;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ background-image: url('~@/assets/img2/综合总览/编组 9.png');
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center bottom;
|
|
|
+ width: 460px;
|
|
|
|
|
|
-<style lang="less" scoped>
|
|
|
-.bgBox {
|
|
|
- .lefBox {
|
|
|
- position: absolute;
|
|
|
- z-index: 10;
|
|
|
- left: 47px;
|
|
|
- top: 120px;
|
|
|
- }
|
|
|
- ::v-deep {
|
|
|
- .bg {
|
|
|
- position: absolute;
|
|
|
- z-index: 9;
|
|
|
+ .tab-item {
|
|
|
+ width: 220px;
|
|
|
+ height: 40px;
|
|
|
+ line-height: 40px;
|
|
|
+ font-family: YouSheBiaoTiHei;
|
|
|
+ font-size: 22px;
|
|
|
+ color: #bababa;
|
|
|
+ text-align: center;
|
|
|
+ position: relative;
|
|
|
+ cursor: pointer;
|
|
|
+ background-image: url("~@/assets/img/rectangle.png");
|
|
|
+ background-size: contain;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center;
|
|
|
+
|
|
|
+
|
|
|
+ &.cur {
|
|
|
+ color: rgba(77, 255, 251, .9);
|
|
|
+ background-image: url("~@/assets/img/rectangleing.png");
|
|
|
+ background-size: contain;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-position: center;
|
|
|
}
|
|
|
}
|
|
|
}
|