|
|
@ -140,30 +140,31 @@ |
|
|
|
.then((res) => { |
|
|
|
if (res.msg === 'success') { |
|
|
|
logList.value = res.data; |
|
|
|
infoObject.value = { ...logList.value[0] }; |
|
|
|
infoObject.value.state = infoObject.value.state.value; |
|
|
|
let colorMap = { |
|
|
|
1: 'rgba(255, 188, 70, 1)', |
|
|
|
2: 'rgba(67, 136, 251, 1)', |
|
|
|
3: 'rgba(41, 196, 154, 1)', |
|
|
|
4: 'rgba(243, 97, 99, 1)', |
|
|
|
5: 'rgba(141, 150, 163, 1)', |
|
|
|
}; |
|
|
|
let bgColorMap = { |
|
|
|
1: 'rgba(255, 188, 70, 0.1)', |
|
|
|
2: 'rgba(67, 136, 251, 0.1)', |
|
|
|
3: 'rgba(41, 196, 154, 0.1)', |
|
|
|
4: 'rgba(243, 97, 99, 0.1)', |
|
|
|
5: 'rgba(141, 150, 163, 0.1)', |
|
|
|
}; |
|
|
|
logList.value.forEach((item) => { |
|
|
|
item.stateName = item.state.label; |
|
|
|
item.color = colorMap[item.state.value]; |
|
|
|
item.bgColor = bgColorMap[item.state.value]; |
|
|
|
item.src = 'state-' + item.state.value; |
|
|
|
}); |
|
|
|
console.log(logList.value); |
|
|
|
config.value.dataSource = logList.value; |
|
|
|
if (logList.value.length > 0) { |
|
|
|
infoObject.value = { ...logList.value[0] }; |
|
|
|
infoObject.value.state = infoObject.value.state.value; |
|
|
|
let colorMap = { |
|
|
|
1: 'rgba(255, 188, 70, 1)', |
|
|
|
2: 'rgba(67, 136, 251, 1)', |
|
|
|
3: 'rgba(41, 196, 154, 1)', |
|
|
|
4: 'rgba(243, 97, 99, 1)', |
|
|
|
5: 'rgba(141, 150, 163, 1)', |
|
|
|
}; |
|
|
|
let bgColorMap = { |
|
|
|
1: 'rgba(255, 188, 70, 0.1)', |
|
|
|
2: 'rgba(67, 136, 251, 0.1)', |
|
|
|
3: 'rgba(41, 196, 154, 0.1)', |
|
|
|
4: 'rgba(243, 97, 99, 0.1)', |
|
|
|
5: 'rgba(141, 150, 163, 0.1)', |
|
|
|
}; |
|
|
|
logList.value.forEach((item) => { |
|
|
|
item.stateName = item.state.label; |
|
|
|
item.color = colorMap[item.state.value]; |
|
|
|
item.bgColor = bgColorMap[item.state.value]; |
|
|
|
item.src = 'state-' + item.state.value; |
|
|
|
}); |
|
|
|
config.value.dataSource = logList.value; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|