|
@@ -2,7 +2,8 @@
|
|
|
<el-dialog
|
|
|
:title="'猪只耳标:' + eartag"
|
|
|
:visible.sync="visible"
|
|
|
- :fullscreen="true">
|
|
|
+ :fullscreen="true"
|
|
|
+ @close="close">
|
|
|
<div style="height: 90vh">
|
|
|
<div id="line1" style="height: 20%;"></div>
|
|
|
<div id="line2" style="height: 20%; margin-top: 30px"></div>
|
|
@@ -18,7 +19,8 @@ export default {
|
|
|
return {
|
|
|
visible: false,
|
|
|
eartag: '',
|
|
|
- data: null
|
|
|
+ data: null,
|
|
|
+ load: null
|
|
|
}
|
|
|
},
|
|
|
props: ['time'],
|
|
@@ -125,7 +127,7 @@ export default {
|
|
|
} else {
|
|
|
options = {
|
|
|
title: {
|
|
|
- text: '暂无数据',
|
|
|
+ text: '温度 - 暂无数据',
|
|
|
x: 'center',
|
|
|
y: 'center',
|
|
|
textStyle: {
|
|
@@ -249,7 +251,7 @@ export default {
|
|
|
} else {
|
|
|
options1 = {
|
|
|
title: {
|
|
|
- text: '暂无数据',
|
|
|
+ text: '耳标电量 - 暂无数据',
|
|
|
x: 'center',
|
|
|
y: 'center',
|
|
|
textStyle: {
|
|
@@ -375,7 +377,7 @@ export default {
|
|
|
} else {
|
|
|
options2 = {
|
|
|
title: {
|
|
|
- text: '暂无数据',
|
|
|
+ text: '运动量 - 暂无数据',
|
|
|
x: 'center',
|
|
|
y: 'center',
|
|
|
textStyle: {
|
|
@@ -428,7 +430,7 @@ export default {
|
|
|
};
|
|
|
}
|
|
|
// 睡眠
|
|
|
- if (this.data.temp.length > 0) {
|
|
|
+ if (this.data.sleeptime.length > 0) {
|
|
|
options3 = {
|
|
|
title: {
|
|
|
text: '睡眠',
|
|
@@ -521,7 +523,7 @@ export default {
|
|
|
} else {
|
|
|
options3 = {
|
|
|
title: {
|
|
|
- text: '暂无数据',
|
|
|
+ text: '睡眠 - 暂无数据',
|
|
|
x: 'center',
|
|
|
y: 'center',
|
|
|
textStyle: {
|
|
@@ -582,7 +584,7 @@ export default {
|
|
|
init (eartag) {
|
|
|
console.log(this.time);
|
|
|
this.visible = true
|
|
|
- const load = this.$loading({
|
|
|
+ this.load = this.$loading({
|
|
|
lock: true,
|
|
|
text: '加载中...',
|
|
|
spinner: 'el-icon-loading',
|
|
@@ -590,7 +592,7 @@ export default {
|
|
|
})
|
|
|
this.eartag = eartag
|
|
|
this.$http({
|
|
|
- url: this.$http.adornUrl('/management/eartagdate/searchDateByCondition'),
|
|
|
+ url: this.$http.adornUrl('/management/eartagdata/searchDataByCondition'),
|
|
|
method: 'get',
|
|
|
params: this.$http.adornParams({
|
|
|
'eartag': this.eartag,
|
|
@@ -600,10 +602,24 @@ export default {
|
|
|
}).then(({data}) => {
|
|
|
if (data && data.code === 0) {
|
|
|
this.data = data.page
|
|
|
+ this.load.close()
|
|
|
+ } else {
|
|
|
+ this.data = {
|
|
|
+ temp: [],
|
|
|
+ electric: [],
|
|
|
+ sports: [],
|
|
|
+ sleeptime: []
|
|
|
+ }
|
|
|
this.drawChart()
|
|
|
- load.close()
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ // 点击关闭图标
|
|
|
+ close () {
|
|
|
+ this.visible = false
|
|
|
+ if (this.load) {
|
|
|
+ this.load.close()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
}
|