latest
This commit is contained in:
parent
0f58d9967a
commit
e28c9bce3d
|
|
@ -40,3 +40,12 @@
|
||||||
.read-the-docs {
|
.read-the-docs {
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.completed{
|
||||||
|
background-color: green !important;
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.visited{
|
||||||
|
background-color:rgba(128, 128, 128, 0.5) !important;
|
||||||
|
}
|
||||||
|
|
@ -29,6 +29,7 @@ const DummyDuplicates = () => {
|
||||||
const [currentImagePath, setCurrentImagePath] = useState("");
|
const [currentImagePath, setCurrentImagePath] = useState("");
|
||||||
const [barcode, SetBarcode] = useState(null);
|
const [barcode, SetBarcode] = useState(null);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [isUpdated,setIsUpdated] = useState(false)
|
||||||
|
|
||||||
const { type } = useParams();
|
const { type } = useParams();
|
||||||
console.log("Type ======= ", type);
|
console.log("Type ======= ", type);
|
||||||
|
|
@ -103,10 +104,12 @@ const DummyDuplicates = () => {
|
||||||
{dummyDuplicatesData?.length > 0 &&
|
{dummyDuplicatesData?.length > 0 &&
|
||||||
duplicateBarcodes.map((barcode) => (
|
duplicateBarcodes.map((barcode) => (
|
||||||
<Box
|
<Box
|
||||||
className="p-3 rounded bg-white my-2 w-100 m-3 cursor-pointer overflow-auto"
|
className="p-3 rounded my-2 w-100 m-3 cursor-pointer overflow-auto"
|
||||||
stype={{ cursor: "pointer" }}
|
|
||||||
|
style={{ cursor: "pointer",background:"white" }}
|
||||||
onClick={handleImagePreview}
|
onClick={handleImagePreview}
|
||||||
data-barcode={barcode}
|
data-barcode={barcode}
|
||||||
|
id = {barcode}
|
||||||
>
|
>
|
||||||
<h5 data-barcode={barcode}>{barcode}</h5>
|
<h5 data-barcode={barcode}>{barcode}</h5>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ export default function DummyDuplicatesPreview({
|
||||||
const [partAImageS3Path, setPartAImageS3Path] = useState(null);
|
const [partAImageS3Path, setPartAImageS3Path] = useState(null);
|
||||||
const [partCImageS3Path, setPartCImageS3Path] = useState(null);
|
const [partCImageS3Path, setPartCImageS3Path] = useState(null);
|
||||||
const [loadingText, setLoadingText] = useState(null);
|
const [loadingText, setLoadingText] = useState(null);
|
||||||
|
const [isUpdated, setIsUpdated] = useState(false);
|
||||||
|
|
||||||
const openNotification = (pauseOnHover) => () => {
|
const openNotification = (pauseOnHover) => () => {
|
||||||
api.open({
|
api.open({
|
||||||
|
|
@ -66,6 +67,15 @@ export default function DummyDuplicatesPreview({
|
||||||
setIsDialogOpen(false);
|
setIsDialogOpen(false);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
document.body.style.overflow = "auto";
|
document.body.style.overflow = "auto";
|
||||||
|
const barcodeCardEle = document.getElementById(barcode);
|
||||||
|
console.log("barcodeCardEle ======== ", barcodeCardEle);
|
||||||
|
if (barcodeCardEle) {
|
||||||
|
if (isUpdated) {
|
||||||
|
barcodeCardEle.classList.add("completed");
|
||||||
|
} else {
|
||||||
|
barcodeCardEle.classList.add("visited");
|
||||||
|
}
|
||||||
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -172,32 +182,28 @@ export default function DummyDuplicatesPreview({
|
||||||
setInputRegisterNumber(null);
|
setInputRegisterNumber(null);
|
||||||
setInputSubjectCode(null);
|
setInputSubjectCode(null);
|
||||||
setPartAImageS3Path(null);
|
setPartAImageS3Path(null);
|
||||||
setInputSerialNo(null)
|
setInputSerialNo(null);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setInputBarcode(partAResults[partAImageIndex]?.barcode);
|
setInputBarcode(partAResults[partAImageIndex]?.barcode);
|
||||||
setInputRegisterNumber(partAResults[partAImageIndex]?.register_number);
|
setInputRegisterNumber(partAResults[partAImageIndex]?.register_number);
|
||||||
setInputSubjectCode(partAResults[partAImageIndex]?.subject_code);
|
setInputSubjectCode(partAResults[partAImageIndex]?.subject_code);
|
||||||
setPartAImageS3Path(partAResults[partAImageIndex]?.s3_path);
|
setPartAImageS3Path(partAResults[partAImageIndex]?.s3_path);
|
||||||
setInputSerialNo(partAResults[partAImageIndex]?.serial_no)
|
setInputSerialNo(partAResults[partAImageIndex]?.serial_no);
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}, [dummyDuplicatesData, partAImageIndex]);
|
}, [dummyDuplicatesData, partAImageIndex]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log("part c image index changing ....", partCImageIndex);
|
||||||
useEffect(()=>{
|
if (partCResults.length > 0 && partCImageIndex <= partCResults.length) {
|
||||||
console.log("part c image index changing ....",partCImageIndex)
|
console.log("into if ..");
|
||||||
if(partCResults.length > 0 && partCImageIndex <= partCResults.length){
|
setPartCImageS3Path(null);
|
||||||
console.log("into if ..")
|
setTimeout(() => {
|
||||||
setPartCImageS3Path(null)
|
setPartCImageS3Path(partCResults[partCImageIndex]?.s3_path);
|
||||||
setTimeout(()=>{
|
}, 5000);
|
||||||
setPartCImageS3Path(partCResults[partCImageIndex]?.s3_path)
|
|
||||||
},5000)
|
|
||||||
}
|
}
|
||||||
},[partCImageIndex])
|
}, [partCImageIndex]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (partAImageS3Path) {
|
if (partAImageS3Path) {
|
||||||
|
|
@ -281,6 +287,7 @@ useEffect(()=>{
|
||||||
} else {
|
} else {
|
||||||
console.log("showing notification ...");
|
console.log("showing notification ...");
|
||||||
toast.success("Record updated Successfully ..");
|
toast.success("Record updated Successfully ..");
|
||||||
|
setIsUpdated(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue