Compare commits

..

No commits in common. "d3de840af15c1059aa9c5ce71b299e61311d1606" and "6237b3a8f3e58ec4ccecf410848652d8969cde7c" have entirely different histories.

3 changed files with 43 additions and 76 deletions

View File

@ -64,20 +64,18 @@ export default {
} }
}, },
methods: { methods: {
init() {
console.log('init')
},
selectLine(val) { selectLine(val) {
this.form.proLineId = val this.form.proLineId = val
setAlarmValueGet({ id: val }).then((res) => { setAlarmValueGet({ id: val }).then((res) => {
if (res.code === 0 && res.data) { this.form.adsorptionPadCeiling = res.data.adsorptionPadCeiling
this.form.adsorptionPadCeiling = res.data.adsorptionPadCeiling ? res.data.adsorptionPadCeiling
? res.data.adsorptionPadCeiling : null
: 0 this.form.auxiliaryFrameCeiling = res.data.auxiliaryFrameCeiling
this.form.auxiliaryFrameCeiling = res.data.auxiliaryFrameCeiling ? res.data.auxiliaryFrameCeiling
? res.data.auxiliaryFrameCeiling : null
: 0
} else {
this.form.adsorptionPadCeiling = 0
this.form.auxiliaryFrameCeiling = 0
}
}) })
}, },
submitForm() { submitForm() {

View File

@ -141,6 +141,9 @@ export default {
this.getList() this.getList()
} else { } else {
this.centervisible = true this.centervisible = true
this.$nextTick(() => {
this.$refs.alarmAdd.init()
})
} }
}, },
tableRowClassName({ row }) { tableRowClassName({ row }) {

View File

@ -79,12 +79,12 @@ export default {
let xlList = [] let xlList = []
let sumList = [] let sumList = []
let msg = {} let msg = {}
for (let i = 0; i < 1000; i++) { for (let i = 0; i < 100; i++) {
time.push(moment().add(i, 'days').format('YYYY-MM-DD HH:mm:ss')) time.push(moment().add(1, 'days').format('YYYY-MM-DD HH:mm:ss'))
sList.push(Math.floor(Math.random() * 80 + 10)) sList.push(Math.floor(Math.random() * 80 + 10))
mList.push(Math.floor(Math.random() * 100 + 20)) mList.push(Math.floor(Math.random() * 80 + 20))
lList.push(Math.floor(Math.random() * 130 + 30)) lList.push(Math.floor(Math.random() * 80 + 30))
xlList.push(Math.floor(Math.random() * 150 + 40)) xlList.push(Math.floor(Math.random() * 80 + 40))
sumList.push(sList[i] + mList[i] + lList[i] + xlList[i]) sumList.push(sList[i] + mList[i] + lList[i] + xlList[i])
} }
msg.time = time msg.time = time
@ -194,84 +194,50 @@ export default {
getChart(msg) { getChart(msg) {
console.log(msg) console.log(msg)
var option = { var option = {
color: ['#5AD8A6', '#5B8FF9', '#5D7092', '#F6BD16', '#E8684A'],
title: { title: {
text: '时间段玻璃颗粒数', text: 'Beijing AQI',
left: '1%' left: '1%'
}, },
tooltip: { tooltip: {
trigger: 'axis' trigger: 'axis'
}, },
legend: {
data: ['Total', 'M', 'L', 'S', 'XL'],
right: '4%'
},
grid: { grid: {
left: '4%', left: '5%',
right: '4%', right: '15%',
bottom: '10%' bottom: '10%'
}, },
xAxis: { xAxis: msg.time,
type: 'category', yAxis: {},
boundaryGap: false, toolbox: {
data: msg.time right: 10,
}, feature: {
yAxis: { dataZoom: {
type: 'value' yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
}, },
dataZoom: [ dataZoom: [
{ {
startValue: '2023-02-014' startValue: '2014-06-01'
}, },
{ {
type: 'inside' type: 'inside'
} }
], ],
series: [ visualMap: {
{ top: 50,
name: 'Total', right: 10,
type: 'line', outOfRange: {
data: msg.sumList, color: '#999'
markLine: {
show: false,
Symbol: 'none',
label: {
position: 'end',
formatter: '合格线\n' + this.maxLine
},
data: [
{
silent: false,
lineStyle: {
type: 'dashed',
color: '#0B58FF'
},
yAxis: this.maxLine
}
]
}
},
{
name: 'M',
type: 'line',
data: msg.mList
},
{
name: 'L',
type: 'line',
data: msg.lList
},
{
name: 'S',
type: 'line',
data: msg.sList
},
{
name: 'XL',
type: 'line',
data: msg.xlList
} }
] },
series: {
name: 'Beijing AQI',
type: 'line',
data: msg.sList
}
} }
option && this.chart.setOption(option) option && this.chart.setOption(option)