업데이트
This commit is contained in:
parent
03baa76f6f
commit
e02942786f
@ -15,7 +15,6 @@ import SubCategory from 'src/components/table/rows/subCategory';
|
||||
|
||||
const TABLE_HEAD = [
|
||||
{ id: 'name', label: 'Category', alignRight: false, sort: true },
|
||||
{ id: 'description', label: 'Description', alignRight: false },
|
||||
{ id: 'status', label: 'Status', alignRight: false },
|
||||
{ id: 'createdAt', label: 'Date', alignRight: false, sort: true },
|
||||
{ id: '', label: 'Actions', alignRight: true }
|
||||
|
@ -79,6 +79,11 @@ export default function ProductForm({
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('currentProduct', currentProduct)
|
||||
}, [currentProduct])
|
||||
|
||||
const NewProductSchema = Yup.object().shape({
|
||||
name: Yup.string().required('Product name is required'),
|
||||
code: Yup.string().required('Product code is required'),
|
||||
@ -117,9 +122,9 @@ export default function ProductForm({
|
||||
brand: currentProduct?.brand || brands[0]?._id || 'brand',
|
||||
tags: currentProduct?.tags || [],
|
||||
gender: currentProduct?.gender || '',
|
||||
category: currentProduct?.category || (categories.length && categories[0]?._id) || '',
|
||||
category: currentProduct?.category || '',
|
||||
shop: isVendor ? null : currentProduct?.shop || (shops?.length && shops[0]?._id) || '',
|
||||
subCategory: currentProduct?.subCategory || (categories.length && categories[0].subCategories[0]?._id) || '',
|
||||
subCategory: currentProduct?.subCategory || '',
|
||||
status: currentProduct?.status || STATUS_OPTIONS[0],
|
||||
blob: currentProduct?.blob || [],
|
||||
isFeatured: currentProduct?.isFeatured || true,
|
||||
@ -208,10 +213,6 @@ export default function ProductForm({
|
||||
formik.handleChange(event); // handle the change in formik
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log('this Value', values)
|
||||
}, [values])
|
||||
|
||||
return (
|
||||
<Stack spacing={3}>
|
||||
<FormikProvider value={formik}>
|
||||
|
@ -109,7 +109,7 @@ export default function SubCategoryForm({
|
||||
file: currentCategory?.cover || '',
|
||||
slug: currentCategory?.slug || '',
|
||||
status: currentCategory?.status || STATUS_OPTIONS[0],
|
||||
parentCategory: currentCategory?.parentCategory || (categories && categories[0]?._id) || ''
|
||||
parentCategory: currentCategory?.parentCategory || ''
|
||||
},
|
||||
enableReinitialize: true,
|
||||
validationSchema: NewCategorySchema,
|
||||
|
@ -46,6 +46,7 @@ const ThumbImgStyle = styled(Box)(({ theme }) => ({
|
||||
export default function Category({ isLoading, row, handleClickOpen }) {
|
||||
const router = useRouter();
|
||||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<TableRow hover key={Math.random()}>
|
||||
<TableCell component="th" scope="row">
|
||||
@ -64,7 +65,6 @@ export default function Category({ isLoading, row, handleClickOpen }) {
|
||||
fill
|
||||
alt={row?.name}
|
||||
src={row?.cover?.url}
|
||||
|
||||
blurDataURL={row?.cover.blurDataURL}
|
||||
objectFit="cover"
|
||||
/>
|
||||
@ -75,7 +75,7 @@ export default function Category({ isLoading, row, handleClickOpen }) {
|
||||
</Typography>
|
||||
</Box>
|
||||
</TableCell>
|
||||
<TableCell>{isLoading ? <Skeleton variant="text" /> : row.description.slice(0, 50)}</TableCell>
|
||||
{/* <TableCell>{row.parentCategory}</TableCell> */}
|
||||
<TableCell>
|
||||
{isLoading ? (
|
||||
<Skeleton variant="text" />
|
||||
|
@ -105,13 +105,13 @@ export default function UploadMultiFile({ onAnnotationsChange, ...props }) {
|
||||
|
||||
// 바운딩 박스
|
||||
ctx.strokeStyle = 'red';
|
||||
ctx.lineWidth = 2;
|
||||
ctx.strokeRect(x, y, width, height);
|
||||
ctx.lineWidth = 1;
|
||||
ctx.strokeRect(x - 50, y - 80, width, height);
|
||||
|
||||
// 라벨
|
||||
ctx.fillStyle = 'red';
|
||||
ctx.font = '16px Arial';
|
||||
ctx.fillText(`${label} (${(confidence * 100).toFixed(2)}%)`, x, y > 10 ? y - 5 : 10);
|
||||
ctx.fillText(`${label} (${(confidence * 100).toFixed(2)}%)`, x - 50, y - 80 > 10 ? y - 5 : 10);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user