Commit a7167881 authored by W_Y's avatar W_Y

Merge remote-tracking branch 'origin/project9-8' into project9-8

parents 25bc4229 d91a1eb2
......@@ -221,12 +221,13 @@ import * as echarts from 'echarts'
import judgeLeaveMessage from 'svg-sprite-loader/examples/custom-runtime-generator/build/main'
// import { controlData } from './apis'
// import { judgeLeaveMessage } from '@/views/judgeMessageManage/apis'
import {findCountIdByUpdateDate, findCountIdByFqYy} from '@/api/controlPlatform'
import { findCountIdByUpdateDate, findCountIdByFqYy } from '@/api/controlPlatform'
export default {
name: 'Control',
data() {
return {
stopTimer: false,
sumUpdateList: [],
dataList: [],
numList: [],
......@@ -296,11 +297,11 @@ export default {
}
],
options: [
{value: 1, label: '审判立案'},
{value: 2, label: '执行立案'},
{value: 3, label: '保全立案'},
{value: 4, label: '调解立案'},
{value: 5, label: '信访立案'}
{ value: 1, label: '审判立案' },
{ value: 2, label: '执行立案' },
{ value: 3, label: '保全立案' },
{ value: 4, label: '调解立案' },
{ value: 5, label: '信访立案' }
]
}
},
......@@ -312,51 +313,74 @@ export default {
this.getVisitorDate()
this.handleGetJudgeMessageData()
this.handleGetStatisticsData()
this.getSumUpdateList()
this.getSumList()
this.startInterval()
// 通过监听内容部分的宽度让图表resize
var elementResizeDetectorMaker = require('element-resize-detector')
var erd = elementResizeDetectorMaker()
var that = this
erd.listenTo(document.getElementById('echarts-data'), function (element) {
erd.listenTo(document.getElementById('echarts-data'), function(element) {
var width = element.offsetWidth
var height = element.offsetHeight
self.tableHeight = height // 将监听到的宽高进行赋值
self.tableWidth = width
that.$nextTick(function () {
that.$nextTick(function() {
console.log('Size: ' + width + 'x' + height)
// 使echarts尺寸重置
echarts.init(document.getElementById('dataCharts_data')).resize()
})
})
erd.listenTo(document.getElementById('echarts-leaveMessage'), function (element) {
erd.listenTo(document.getElementById('echarts-leaveMessage'), function(element) {
var width = element.offsetWidth
var height = element.offsetHeight
self.tableHeight = height // 将监听到的宽高进行赋值
self.tableWidth = width
that.$nextTick(function () {
that.$nextTick(function() {
console.log('Size: ' + width + 'x' + height)
// 使echarts尺寸重置
echarts.init(document.getElementById('dataCharts_leaveMessage')).resize()
})
})
erd.listenTo(document.getElementById('echarts-visitor'), function (element) {
erd.listenTo(document.getElementById('echarts-visitor'), function(element) {
var width = element.offsetWidth
var height = element.offsetHeight
self.tableHeight = height // 将监听到的宽高进行赋值
self.tableWidth = width
that.$nextTick(function () {
that.$nextTick(function() {
console.log('Size: ' + width + 'x' + height)
// 使echarts尺寸重置
echarts.init(document.getElementById('dataCharts_visitor')).resize()
})
})
},
beforeRouteLeave(to, from, next) {
setTimeout(() => {
this.stopTimer = true
next()
}, 0)
},
methods: {
// 开始循环调用
startInterval() {
this.getSumUpdateList() // 先立刻执行一次
this.getSumList()
this.intervalId = setInterval(() => {
if (this.stopTimer === true) {
clearInterval(this.intervalId)
} else {
this.getSumUpdateList()
this.getSumList()
}
}, 2000) // 间隔 2 秒调用一次,根据实际需求调整间隔时间
},
stopInterval() {
clearInterval(this.intervalId) // 清除计时器
},
getSumUpdateList() {
findCountIdByUpdateDate().then(res => {
this.sumUpdateList = res.data
console.log('res', res)
this.numList = []
this.dataList = []
this.sumUpdateList.forEach(item => {
this.numList.push(item.sum)
this.dataList.push(item.updateDate)
......@@ -369,6 +393,8 @@ export default {
getSumList() {
findCountIdByFqYy().then(res => {
this.sumFqYyList = res.data
this.YyList = []
this.FqNumList = []
this.sumFqYyList.forEach(item => {
this.YyList.push(item.fqYy)
this.FqNumList.push(item.sum)
......@@ -590,7 +616,7 @@ export default {
data: this.FqNumList,
barWidth: '10%'
}
],
]
// radar: {
// // shape: 'circle',
// radius: '53%',
......@@ -726,8 +752,8 @@ export default {
type: 'pie',
radius: '50%',
data: [
{value: '10', name: '离院'},
{value: '30', name: '来访'}
{ value: '10', name: '离院' },
{ value: '30', name: '来访' }
],
emphasis: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment