|
@@ -62,7 +62,8 @@
|
|
|
ifMonth: true,
|
|
|
form: {
|
|
|
time: []
|
|
|
- }
|
|
|
+ },
|
|
|
+ subtext: ''
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
@@ -90,18 +91,27 @@
|
|
|
this.date.push(item.date)
|
|
|
this.total.push(item.total)
|
|
|
})
|
|
|
+ if (data.data.length === 0) {
|
|
|
+ this.subtext = '暂无数据'
|
|
|
+ this.$notify.error({
|
|
|
+ title: '注意',
|
|
|
+ message: '这段时间内没有猪只出栏',
|
|
|
+ duration: 0
|
|
|
+ })
|
|
|
+ }
|
|
|
var option = {
|
|
|
// backgroundColor: '#2c343c',
|
|
|
'title': {
|
|
|
'text': '出栏统计折线图',
|
|
|
'x': 'center',
|
|
|
- 'subtext': '暂无数据'
|
|
|
+ 'subtext': this.subtext
|
|
|
},
|
|
|
'tooltip': {
|
|
|
'trigger': 'axis'
|
|
|
},
|
|
|
'legend': {
|
|
|
'data': [ '出栏猪只数量'],
|
|
|
+ 'x': '100',
|
|
|
'y': '30px'
|
|
|
},
|
|
|
'grid': {
|
|
@@ -145,16 +155,16 @@
|
|
|
},
|
|
|
// 获取起始与结束时间
|
|
|
timeChange (val) {
|
|
|
- console.log(val);
|
|
|
- let start = new Date(val[0])
|
|
|
- let end = new Date(val[1])
|
|
|
- let now = new Date()
|
|
|
- console.log(start);
|
|
|
- if (start > now || end > now) {
|
|
|
- this.form.time = []
|
|
|
- this.$message.error('请勿选择超出现在的时刻')
|
|
|
- return
|
|
|
- }
|
|
|
+ // console.log(val);
|
|
|
+ // let start = new Date(val[0])
|
|
|
+ // let end = new Date(val[1])
|
|
|
+ // let now = new Date()
|
|
|
+ // console.log(start);
|
|
|
+ // if (start > now || end > now) {
|
|
|
+ // this.form.time = []
|
|
|
+ // this.$message.error('请勿选择超出现在的时刻')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
this.initChartLine()
|
|
|
},
|
|
|
clickChange () {
|