import { useRouter, useCallback } from "next/router";
import "antd/dist/antd.css";
import { Image } from "antd";
import React, { useEffect, useMemo, useState } from "react";
import {
getShotImgByProductBatchNo,
getShotImg,
} from "../../../reportUtils/getQueryData";
const { config: { mesUrl } = {} } = global;
import _ from "lodash";
const ListItem = React.memo((props) => {
const { itemData } = props;
return (
);
});
function Imag(props) {
const { imgurls } = props;
const [imglist, setImgList] = useState([]);
useEffect(() => {
setImgList([]);
imgurls.map((imgsrc) => {
getShotImg(mesUrl + imgsrc).then((rep) => {
setImgList((prev) => {
return [...prev, URL.createObjectURL(rep)];
});
});
});
}, []);
return imglist.map((imgsrc) => {
return (
);
});
}
const List = React.memo((props) => {
const { dataSource } = props;
return (
{dataSource?.map((item) => {
return ;
})}
);
});
const Header = React.memo((props) => {
const { productBatchNo } = props;
return (
);
});
const getQueryVariable = (name) => {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return null;
};
export default function PicView() {
const [data, setData] = useState([]);
const [productBatchNo, setProductBatchNo] = useState([]);
useEffect(() => {
setProductBatchNo(getQueryVariable("productBatchNo"));
}, []);
useEffect(() => {
getShotImgByProductBatchNo(productBatchNo).then((json) => {
setData(json);
});
}, [productBatchNo]);
return (
);
}