From cae0d13a48a8de58c1f8716e19f1aa914f14499f Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 07 Jul 2022 17:48:53 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhny-dsjdp
---
src/views/home/index.vue | 11 ++++-
src/views/manage/index.vue | 45 ++++++++++++++++++----
src/api/farm/farmingrecord.js | 20 ++++++++++
3 files changed, 66 insertions(+), 10 deletions(-)
diff --git a/src/api/farm/farmingrecord.js b/src/api/farm/farmingrecord.js
index bb69b14..bd1b740 100644
--- a/src/api/farm/farmingrecord.js
+++ b/src/api/farm/farmingrecord.js
@@ -162,3 +162,23 @@
}
})
}
+
+export const countTaskNum = (params) => {
+ return request({
+ url: '/task/task/countTaskNum',
+ method: 'get',
+ params: {
+ ...params
+ }
+ })
+}
+
+export const farmingRecords = (params) => {
+ return request({
+ url: '/farmingRecord/page',
+ method: 'get',
+ params: {
+ ...params
+ }
+ })
+}
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index ba74b06..97f09d9 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -287,8 +287,6 @@
this.selctSaletZ()
},
mounted () {
- this.initPie('BeingEcharts', 100)
- this.initPie('LeisureEcharts', 0)
this.initRightPie('EquipmentEcharts')
},
methods: {
@@ -663,6 +661,15 @@
selectXCount(deptId).then((res) => {
that.landsnum = res.data.data.snum
that.landwnum = res.data.data.wnum
+
+ var znum = res.data.data.num
+ // 使用率
+ var syl = (that.landsnum / znum * 100).toFixed(1)
+ // 未使用率
+ var wsyl = (that.landwnum / znum * 100).toFixed(1)
+
+ this.initPie('BeingEcharts', syl)
+ this.initPie('LeisureEcharts', wsyl)
})
},
pagePalnt () {
diff --git a/src/views/manage/index.vue b/src/views/manage/index.vue
index 953155e..3a11efb 100644
--- a/src/views/manage/index.vue
+++ b/src/views/manage/index.vue
@@ -265,7 +265,7 @@
<script>
import { selectXCount } from '@/api/land/land'
// eslint-disable-next-line no-unused-vars
- import { page, getStockCount, pagePalnt, statisticsStockAndYield, pageCount, pageCountNz, selectMarketCirculate} from '@/api/farm/farmingrecord'
+ import { page, getStockCount, pagePalnt, statisticsStockAndYield, pageCount, pageCountNz, selectMarketCirculate, countTaskNum, farmingRecords } from '@/api/farm/farmingrecord'
export default {
data () {
@@ -296,6 +296,8 @@
salaNumBN: [],
salaNumBY: [],
salaNumQN: [],
+ // 统计任务总数
+ taskNum: [],
nzOrNcp: 'ncp',
trpOrNcp: 'trp'
}
@@ -312,9 +314,12 @@
this.pageCountNz()
// 统计市场流通/去年流通量/本月流通量
this.selectMarketCirculate()
+ // 统计任务总数
+ this.countTaskNum()
+ // 农事操作
+ this.farmingRecords()
},
mounted () {
- this.initBar('TaskNumEcharts')
// this.initNcpBar('NcpEcharts')
this.initClSyBar('ClSyEcharts')
},
@@ -323,6 +328,13 @@
const that = this
const chartDom = document.getElementById(dom)
const myChart = this.$echarts.init(chartDom)
+
+ var x = []
+ var y = []
+ for (let i = 0; i < that.taskNum.length; i++) {
+ x.push(that.taskNum[i].y)
+ y.push(that.taskNum[i].count)
+ }
const option = {
grid: {
@@ -334,11 +346,7 @@
},
xAxis: {
type: 'category',
- data: [
- '2019-06',
- '2019-07',
- '2019-08'
- ],
+ data: x,
axisLine: {
lineStyle: {
color: 'rgba(153,153,153,.4)'
@@ -381,7 +389,7 @@
{
type: 'bar',
barWidth: 32,
- data: [30, 40, 20],
+ data: y,
label: {
show: true,
position: 'top',
@@ -853,6 +861,27 @@
this.salaNumQN = res.data.data[1].num
this.salaNumBY = res.data.data[2].num
})
+ },
+ // 统计任务总数
+ countTaskNum () {
+ var params = {}
+ params.codes = '000000'
+ params.deptId = '1123598813738675201'
+ params.year = '2022'
+ countTaskNum(Object.assign(params)).then((res) => {
+ this.taskNum = res.data.data
+ this.initBar('TaskNumEcharts')
+ })
+ },
+ // 农事记录
+ farmingRecords () {
+ var params = {}
+ params.codes = '000000'
+ params.deptId = '1123598813738675201'
+ params.year = '2022'
+ farmingRecords(Object.assign(params)).then((res) => {
+
+ })
}
}
}
--
Gitblit v1.9.3