'update'
This commit is contained in:
@@ -20,11 +20,11 @@ function attachStyle(data) {
|
||||
if (index == arr.length - 1) {
|
||||
return `<div style="display: flex; align-items: center">
|
||||
<span style="box-shadow: 0 0 4px 4px ${
|
||||
item == 1 ? "#2760ff55" : "#a81b2655"
|
||||
item == 1 ? "#2760ff55" : item == 0 ? "#a81b2655" : "#E6A23C55"
|
||||
}; margin-right: 8px; width: 8px; height: 8px; border-radius: 8px; background: ${
|
||||
item == 1 ? "#2760ff" : "#a81b26"
|
||||
}"></span><span style="color: ${item == 1 ? "#2760ff" : "#a81b26"}">${
|
||||
item == 1 ? "正常" : "故障"
|
||||
item == 1 ? "#2760ff" : item == 0 ? "#a81b26" : "#E6A23C"
|
||||
}"></span><span style="color: ${item == 1 ? "#2760ff" : item == 0 ? "#a81b26" : "#E6A23C"}">${
|
||||
item == 1 ? "运行" : item == 0 ? "故障" : "未运行"
|
||||
}</span></div>`;
|
||||
}
|
||||
return `<span style='color: #fffa'>${item}</span>`;
|
||||
@@ -36,10 +36,16 @@ function FanInfo(props) {
|
||||
const rowNum = props.rows || 8;
|
||||
// let data = getRandomRows(100);
|
||||
const fanInfo = useSelector((state) => state.fanInfo.fanInfo);
|
||||
|
||||
console.log(fanInfo)
|
||||
console.log('-------------------------------')
|
||||
|
||||
const data = Object.keys(fanInfo).map((key, index) => {
|
||||
return [index+1, key, fanInfo[key] == "正常" ? 1 : 0];
|
||||
return [index+1, key, fanInfo[key] == "运行" ? 1 : fanInfo[key] == "故障" ? 0 : 2];
|
||||
});
|
||||
|
||||
console.log(data)
|
||||
|
||||
let config = {
|
||||
headerBGC: "rgba(4, 44, 76, 0.3)",
|
||||
header: [
|
||||
|
||||
Reference in New Issue
Block a user