图标功能修改
continuous-integration/drone/push Build is pending
Details
continuous-integration/drone/push Build is pending
Details
parent
4a17946598
commit
159a36cd70
|
|
@ -62,7 +62,8 @@ export default {
|
||||||
zIndex: 9,
|
zIndex: 9,
|
||||||
chart: null,
|
chart: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
key: 'readingChart'
|
key: 'readingChart',
|
||||||
|
isInteger: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -101,12 +102,13 @@ export default {
|
||||||
let res = await getReportsChartData(params)
|
let res = await getReportsChartData(params)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
|
this.isInteger = res.Result.Type === 'number' && res.Result.ValueType === 0
|
||||||
let LatestScanDateList = res.Result.LatestScanDateList.map(item => item.split(" ")[0])
|
let LatestScanDateList = res.Result.LatestScanDateList.map(item => item.split(" ")[0])
|
||||||
let obj = {
|
let obj = {
|
||||||
title: QuestionName,
|
title: QuestionName,
|
||||||
xAxisData: LatestScanDateList || [],
|
xAxisData: LatestScanDateList || [],
|
||||||
series: [],
|
series: [],
|
||||||
unit: this.$fd("ValueUnit", res.Result.Unit),
|
unit: res.Result.Unit === 0 ? '' : res.Result.Unit === 4 ? res.Result.CustomUnit : this.$fd("ValueUnit", res.Result.Unit),
|
||||||
visitName: res.Result.VisitTaskNameList,
|
visitName: res.Result.VisitTaskNameList,
|
||||||
min: null,
|
min: null,
|
||||||
max: null
|
max: null
|
||||||
|
|
@ -123,43 +125,6 @@ export default {
|
||||||
type: 'line'
|
type: 'line'
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
// if (Array.isArray(res.Result.LatestScanDateList) && res.Result.LatestScanDateList.length >= 2) {
|
|
||||||
// let hours = moment(res.Result.LatestScanDateList[res.Result.LatestScanDateList.length - 1]).diff(moment(res.Result.LatestScanDateList[0]), 'hours');
|
|
||||||
// let days = moment(res.Result.LatestScanDateList[res.Result.LatestScanDateList.length - 1]).diff(moment(res.Result.LatestScanDateList[0]), 'days');
|
|
||||||
// let months = moment(res.Result.LatestScanDateList[res.Result.LatestScanDateList.length - 1]).diff(moment(res.Result.LatestScanDateList[0]), 'months');
|
|
||||||
// console.log(hours, 'hours')
|
|
||||||
// console.log(days, 'days')
|
|
||||||
// console.log(months, 'months')
|
|
||||||
// if (hours < 24) {
|
|
||||||
// obj.min = moment(res.Result.LatestScanDateList[0]).format('YYYY-MM-DD') + ' 00:00:00'
|
|
||||||
// obj.max = moment(res.Result.LatestScanDateList[0]).format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
// }
|
|
||||||
// if (days >= 1 && days <= 7) {
|
|
||||||
// obj.min = moment(res.Result.LatestScanDateList[0]).format('YYYY-MM-DD') + ' 00:00:00'
|
|
||||||
// obj.max = moment(res.Result.LatestScanDateList[0]).add(7, 'days').format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
// }
|
|
||||||
// if (days > 7 && days < 30) {
|
|
||||||
// obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
|
||||||
// obj.max = moment(res.Result.LatestScanDateList[0]).endOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
// }
|
|
||||||
// if (months >= 1 && months <= 3) {
|
|
||||||
// obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
|
||||||
// obj.max = moment(res.Result.LatestScanDateList[0]).add(4, 'months').startOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
// }
|
|
||||||
// if (months > 3 && months <= 6) {
|
|
||||||
// obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
|
||||||
// obj.max = moment(res.Result.LatestScanDateList[0]).add(7, 'months').startOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
// }
|
|
||||||
// if (months > 6 && months <= 12) {
|
|
||||||
// obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
|
||||||
// obj.max = moment(res.Result.LatestScanDateList[0]).add(13, 'months').startOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
// }
|
|
||||||
// if (months > 12) {
|
|
||||||
// obj.min = moment(res.Result.LatestScanDateList[0]).startOf('month').format('YYYY-MM-DD') + ' 00:00:00'
|
|
||||||
// obj.max = moment(res.Result.LatestScanDateList[res.Result.LatestScanDateList.length - 1]).add(1, 'months').startOf('month').format('YYYY-MM-DD') + ' 23:59:59'
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// console.log(obj)
|
|
||||||
this.initChart(obj)
|
this.initChart(obj)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -236,6 +201,9 @@ export default {
|
||||||
},
|
},
|
||||||
series: obj.series
|
series: obj.series
|
||||||
};
|
};
|
||||||
|
if (this.isInteger) {
|
||||||
|
option.yAxis.minInterval = 1
|
||||||
|
}
|
||||||
// 4. 使用配置项渲染图表
|
// 4. 使用配置项渲染图表
|
||||||
this.chart.setOption(option);
|
this.chart.setOption(option);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue