refactor: improve Header navigation, enhance data handling in ThroughputSummary and ROISummary, and update styles for better UI responsiveness
This commit is contained in:
parent
d893e695f1
commit
cfa63ff6ed
|
@ -2,19 +2,21 @@ import React from "react";
|
||||||
import { ToggleSidebarIcon } from "../../icons/HeaderIcons";
|
import { ToggleSidebarIcon } from "../../icons/HeaderIcons";
|
||||||
import { LogoIcon } from "../../icons/Logo";
|
import { LogoIcon } from "../../icons/Logo";
|
||||||
import FileMenu from "../../ui/FileMenu";
|
import FileMenu from "../../ui/FileMenu";
|
||||||
import {useToggleStore} from "../../../store/useUIToggleStore";
|
import { useToggleStore } from "../../../store/useUIToggleStore";
|
||||||
import useModuleStore from "../../../store/useModuleStore";
|
import useModuleStore from "../../../store/useModuleStore";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
const Header: React.FC = () => {
|
const Header: React.FC = () => {
|
||||||
const { toggleUILeft, toggleUIRight, setToggleUI } = useToggleStore();
|
const { toggleUILeft, toggleUIRight, setToggleUI } = useToggleStore();
|
||||||
const { activeModule } = useModuleStore();
|
const { activeModule } = useModuleStore();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="header-container">
|
<div className="header-container">
|
||||||
<div className="header-content">
|
<div className="header-content">
|
||||||
<div className="logo-container">
|
<button className="logo-container" onClick={()=>navigate("/dashboard")}>
|
||||||
<LogoIcon />
|
<LogoIcon />
|
||||||
</div>
|
</button>
|
||||||
<div className="header-title">
|
<div className="header-title">
|
||||||
<FileMenu />
|
<FileMenu />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
} from "chart.js";
|
} from "chart.js";
|
||||||
import { PowerIcon, ProductionCapacityIcon } from "../../icons/analysis";
|
import { PowerIcon, ProductionCapacityIcon } from "../../icons/analysis";
|
||||||
import SkeletonUI from "../../templates/SkeletonUI";
|
import SkeletonUI from "../../templates/SkeletonUI";
|
||||||
import { useInputValues, useMachineUptime, useProductionCapacityData } from "../../../store/builder/store";
|
import { useInputValues, useMachineUptime, useProductionCapacityData, useThroughPutData } from "../../../store/builder/store";
|
||||||
|
|
||||||
ChartJS.register(LineElement, CategoryScale, LinearScale, PointElement);
|
ChartJS.register(LineElement, CategoryScale, LinearScale, PointElement);
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ const ThroughputSummary: React.FC = () => {
|
||||||
];
|
];
|
||||||
|
|
||||||
const { productionCapacityData } = useProductionCapacityData()
|
const { productionCapacityData } = useProductionCapacityData()
|
||||||
|
const { throughputData: data } = useThroughPutData()
|
||||||
|
|
||||||
|
|
||||||
const chartOptions = {
|
const chartOptions = {
|
||||||
|
@ -91,14 +92,16 @@ const ThroughputSummary: React.FC = () => {
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (productionCapacityData >= 0) {
|
if (productionCapacityData > 0 && data > 0) {
|
||||||
|
setTimeout(() => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
console.log("productionCapacityData: ", productionCapacityData);
|
}, 5000);
|
||||||
} else {
|
} else {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
}
|
}
|
||||||
}, [productionCapacityData]);
|
}, [productionCapacityData]);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="production analysis-card">
|
<div className="production analysis-card">
|
||||||
<div className="production-wrapper analysis-card-wrapper">
|
<div className="production-wrapper analysis-card-wrapper">
|
||||||
|
|
|
@ -84,8 +84,12 @@ const ROISummary = ({
|
||||||
const { roiSummary } = useROISummaryData();
|
const { roiSummary } = useROISummaryData();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (roiSummary && typeof roiSummary === "object") {
|
console.log('roiSummary: ', roiSummary);
|
||||||
setIsLoading(false); // Data loaded
|
if (roiSummary && typeof roiSummary === "object" && roiSummary.productName !== "") {
|
||||||
|
// setIsLoading(false); // Data loaded
|
||||||
|
setTimeout(() => {
|
||||||
|
setIsLoading(false);
|
||||||
|
}, 5000);
|
||||||
} else {
|
} else {
|
||||||
setIsLoading(true); // Show skeleton while loading
|
setIsLoading(true); // Show skeleton while loading
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ const ProductionCapacity = ({
|
||||||
const { machineActiveTime } = useMachineUptime();
|
const { machineActiveTime } = useMachineUptime();
|
||||||
const { materialCycleTime } = useMaterialCycle();
|
const { materialCycleTime } = useMaterialCycle();
|
||||||
const { throughputData } = useThroughPutData()
|
const { throughputData } = useThroughPutData()
|
||||||
const { productionCapacityData } = useProductionCapacityData()
|
|
||||||
|
|
||||||
const progressPercent = machineActiveTime;
|
const progressPercent = machineActiveTime;
|
||||||
|
|
||||||
|
@ -30,12 +29,15 @@ const ProductionCapacity = ({
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (throughputData >= 0) {
|
if (throughputData > 0) {
|
||||||
// console.log('machineActiveTime: ', machineActiveTime);
|
// console.log('machineActiveTime: ', machineActiveTime);
|
||||||
// console.log('materialCycleTime: ', materialCycleTime);
|
// console.log('materialCycleTime: ', materialCycleTime);
|
||||||
// console.log('throughputData: ', throughputData);
|
// console.log('throughputData: ', throughputData);
|
||||||
// console.log('productionCapacityData: ', productionCapacityData);
|
// console.log('productionCapacityData: ', productionCapacityData);
|
||||||
setIsLoading(true);
|
// setIsLoading(true);
|
||||||
|
setTimeout(() => {
|
||||||
|
setIsLoading(false);
|
||||||
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [throughputData])
|
}, [throughputData])
|
||||||
|
|
|
@ -373,7 +373,7 @@
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, 0);
|
transform: translate(-50%, 0);
|
||||||
color: var(--accent-color);
|
color: var(--accent-color);
|
||||||
z-index: 100;
|
z-index: 2;
|
||||||
isolation: isolate;
|
isolation: isolate;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
animation: slideInFromRight 0.4s ease-out forwards;
|
animation: slideInFromRight 0.4s ease-out forwards;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
border-left: 2px solid var(--border-color);
|
||||||
|
|
||||||
.resizer {
|
.resizer {
|
||||||
width: 32px;
|
width: 32px;
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
|
|
||||||
.logo-container {
|
.logo-container {
|
||||||
@include flex-center;
|
@include flex-center;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-title {
|
.header-title {
|
||||||
|
@ -221,7 +222,7 @@
|
||||||
padding: 13px 5px;
|
padding: 13px 5px;
|
||||||
background: var(--background-color-secondary);
|
background: var(--background-color-secondary);
|
||||||
border-radius: #{$border-radius-medium};
|
border-radius: #{$border-radius-medium};
|
||||||
box-shadow:var(--box-shadow-light);
|
box-shadow: var(--box-shadow-light);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
@ -1360,9 +1361,11 @@
|
||||||
.aisle-properties-container {
|
.aisle-properties-container {
|
||||||
max-height: 65vh;
|
max-height: 65vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.aisle-texture-container {
|
.aisle-texture-container {
|
||||||
max-height: 40vh;
|
max-height: 40vh;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.aisle-list {
|
.aisle-list {
|
||||||
width: calc(100% - 8px);
|
width: calc(100% - 8px);
|
||||||
text-align: start;
|
text-align: start;
|
||||||
|
@ -1372,6 +1375,7 @@
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
border-radius: #{$border-radius-large};
|
border-radius: #{$border-radius-large};
|
||||||
margin: 2px 6px;
|
margin: 2px 6px;
|
||||||
|
|
||||||
.texture-display {
|
.texture-display {
|
||||||
height: 34px;
|
height: 34px;
|
||||||
width: 34px;
|
width: 34px;
|
||||||
|
@ -1380,63 +1384,78 @@
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aisle-color {
|
.aisle-color {
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aisle-brief {
|
.aisle-brief {
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
color: var(--input-text-color);
|
color: var(--input-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.selected {
|
&.selected {
|
||||||
background: var(--background-color-accent);
|
background: var(--background-color-accent);
|
||||||
color: var(--text-button-color);
|
color: var(--text-button-color);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--background-color-accent);
|
background: var(--background-color-accent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: var(--background-color-secondary);
|
background: var(--background-color-secondary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.value-field-container {
|
.value-field-container {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.presets-list-container {
|
.presets-list-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
padding-left: 7px;
|
padding-left: 7px;
|
||||||
|
|
||||||
.preset-list {
|
.preset-list {
|
||||||
background: #444;
|
background: #444;
|
||||||
height: 90px;
|
height: 90px;
|
||||||
width: 90px;
|
width: 90px;
|
||||||
border-radius: #{$border-radius-large};
|
border-radius: #{$border-radius-large};
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.thumbnail {
|
.thumbnail {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: #{$border-radius-large};
|
border-radius: #{$border-radius-large};
|
||||||
outline-offset: -1px;
|
outline-offset: -1px;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.selected {
|
&.selected {
|
||||||
outline: 2px solid var(--border-color-accent);
|
outline: 2px solid var(--border-color-accent);
|
||||||
outline-offset: -2px;
|
outline-offset: -2px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
outline: 2px solid var(--border-color-accent);
|
outline: 2px solid var(--border-color-accent);
|
||||||
|
|
||||||
img {
|
img {
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
outline: 1px solid var(--border-color);
|
outline: 1px solid var(--border-color);
|
||||||
|
|
||||||
img {
|
img {
|
||||||
transform: scale(1.1);
|
transform: scale(1.1);
|
||||||
}
|
}
|
||||||
|
@ -1456,6 +1475,7 @@
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.input-value {
|
.input-value {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
@ -1837,11 +1857,9 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-size: var(--font-size-regular);
|
font-size: var(--font-size-regular);
|
||||||
background: linear-gradient(
|
background: linear-gradient(0deg,
|
||||||
0deg,
|
|
||||||
rgba(37, 24, 51, 0) 0%,
|
rgba(37, 24, 51, 0) 0%,
|
||||||
rgba(52, 41, 61, 0.5) 100%
|
rgba(52, 41, 61, 0.5) 100%);
|
||||||
);
|
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
backdrop-filter: blur(8px);
|
backdrop-filter: blur(8px);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
Loading…
Reference in New Issue