智慧农业大数据平台
shuishen
2022-07-07 cae0d13a48a8de58c1f8716e19f1aa914f14499f
Merge branch 'master' of http://192.168.0.105:10010/r/zhny-dsjdp
3 files modified
76 ■■■■ changed files
src/api/farm/farmingrecord.js 20 ●●●●● patch | view | raw | blame | history
src/views/home/index.vue 11 ●●●● patch | view | raw | blame | history
src/views/manage/index.vue 45 ●●●● patch | view | raw | blame | history
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
        }
    })
}
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 () {
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) => {
                })
            }
        }
    }