|
|
@ -42,10 +42,8 @@ export default defineComponent({ |
|
|
|
let arr = [] |
|
|
|
if (weightOfInLists && weightOfInLists.length) { |
|
|
|
weightOfInLists.forEach((item) => { |
|
|
|
arr.push(item.temp) |
|
|
|
arr.push(item.weightOfIn) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
arr = [45, 55, 56, 73, 76, 95, 98] |
|
|
|
} |
|
|
|
return arr |
|
|
|
}, |
|
|
@ -56,10 +54,8 @@ export default defineComponent({ |
|
|
|
let arr = [] |
|
|
|
if (weightOfOutLists && weightOfOutLists.length) { |
|
|
|
weightOfOutLists.forEach((item) => { |
|
|
|
arr.push(item.temp) |
|
|
|
arr.push(item.weightOfOut) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
arr = [15, 25, 26, 33, 46, 55, 68] |
|
|
|
} |
|
|
|
return arr |
|
|
|
}, |
|
|
@ -72,36 +68,19 @@ export default defineComponent({ |
|
|
|
weightOfInLists.forEach((item) => { |
|
|
|
arr.push(item.time) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
arr = ['10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00'] |
|
|
|
} |
|
|
|
return arr |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
weightOfInLists: { |
|
|
|
deep: true, |
|
|
|
handler(value) { |
|
|
|
if (value) { |
|
|
|
this.getOptions() |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
weightOfOutLists: { |
|
|
|
deep: true, |
|
|
|
handler(value) { |
|
|
|
if (value) { |
|
|
|
this.getOptions() |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
setInterval(() => { |
|
|
|
// 获取数据 |
|
|
|
this.getMbpsByTime(this.currentIndex) |
|
|
|
}, 4000) |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
// 获取数据 |
|
|
|
// this.getMbpsByTime() |
|
|
|
// 绘制图表 |
|
|
|
this.getOptions() |
|
|
|
}, |
|
|
@ -118,7 +97,7 @@ export default defineComponent({ |
|
|
|
* @param {number} startTime 开始时间 |
|
|
|
* @param {number} queryType 查询类型(0-按天,1-按周,2-按月,3-按年) |
|
|
|
*/ |
|
|
|
async getMbpsByTime(queryType = 0) { |
|
|
|
async getMbpsByTime(queryType) { |
|
|
|
try { |
|
|
|
const { parkId, warehouseId } = this.$route.query |
|
|
|
const param = { parkId: parkId || 2, warehouseId: warehouseId || 7, queryType } |
|
|
@ -138,14 +117,6 @@ export default defineComponent({ |
|
|
|
const comparisonChart = document.getElementById('comparisonChart') |
|
|
|
this.myCharts = echarts.init(comparisonChart) |
|
|
|
this.myCharts.setOption({ |
|
|
|
// title: { |
|
|
|
// text: '吞吐量曲线对比', |
|
|
|
// textStyle: { |
|
|
|
// color: '#03D7FA', |
|
|
|
// fontWeight: 'normal', |
|
|
|
// fontSize: '16rem', |
|
|
|
// }, |
|
|
|
// }, |
|
|
|
tooltip: { |
|
|
|
trigger: 'axis', |
|
|
|
axisPointer: { |
|
|
@ -156,10 +127,10 @@ export default defineComponent({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
grid: { |
|
|
|
x: 30, |
|
|
|
y: 50, |
|
|
|
x2: 0, |
|
|
|
y2: 30, |
|
|
|
left: '0', |
|
|
|
right: '6%', |
|
|
|
bottom: '15%', |
|
|
|
containLabel: true, |
|
|
|
}, |
|
|
|
xAxis: { |
|
|
|
type: 'category', |
|
|
@ -170,26 +141,13 @@ export default defineComponent({ |
|
|
|
type: 'value', |
|
|
|
name: '重量(吨)', |
|
|
|
min: 0, |
|
|
|
splitNumber: 4, |
|
|
|
// splitNumber: 4, |
|
|
|
splitLine: { |
|
|
|
show: true, |
|
|
|
lineStyle: { |
|
|
|
color: 'rgba(255,255,255,0.1)', |
|
|
|
}, |
|
|
|
}, |
|
|
|
axisLine: { |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
axisLabel: { |
|
|
|
show: false, |
|
|
|
margin: 20, |
|
|
|
textStyle: { |
|
|
|
color: '#d1e6eb', |
|
|
|
}, |
|
|
|
}, |
|
|
|
axisTick: { |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
}, |
|
|
|
series: [ |
|
|
|
{ |
|
|
|