| | |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import { |
| | | ListBase, |
| | | DatagridConfigurable, |
| | | SearchInput, |
| | | TopToolbar, |
| | | SelectColumnsButton, |
| | | EditButton, |
| | | FilterButton, |
| | | CreateButton, |
| | | ExportButton, |
| | | BulkDeleteButton, |
| | | WrapperField, |
| | | useRecordContext, |
| | | useTranslate, |
| | | useListContext, |
| | | useCreatePath, |
| | | TextField, |
| | | NumberField, |
| | | DateField, |
| | | BooleanField, |
| | | ReferenceField, |
| | | TextInput, |
| | | DateTimeInput, |
| | | DateInput, |
| | | SelectInput, |
| | | NumberInput, |
| | | ReferenceInput, |
| | | ReferenceArrayInput, |
| | | AutocompleteInput, |
| | | ListToolbar, |
| | | Title, |
| | |
| | | import { matchPath, useLocation } from 'react-router'; |
| | | import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import EmptyData from "../components/EmptyData"; |
| | | import PageDrawer from "../components/PageDrawer"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE } from '@/config/setting'; |
| | | import * as Common from '@/utils/common'; |
| | | import MissionShow from "./MissionShow"; |
| | | import { MissionListContent } from "./MissionListContent"; |
| | |
| | | const MissionLayout = () => { |
| | | const location = useLocation(); |
| | | const matchShow = matchPath('/mission/:id/show', location.pathname); |
| | | console.log(matchShow?.params.id); |
| | | |
| | | const { data, isPending, filterValues } = useListContext(); |
| | | const hasFilters = filterValues && Object.keys(filterValues).length > 0; |
| | |
| | | return () => clearInterval(intervalId); |
| | | }, [refetch]) |
| | | |
| | | useEffect(() => { |
| | | // if (data) { |
| | | // const newDealsByStage = getDealsByStage(unorderedDeals, dealStages); |
| | | // if (!isEqual(newDealsByStage, dealsByStage)) { |
| | | // setDealsByStage(newDealsByStage); |
| | | // } |
| | | // } |
| | | // eslint-disable-next-line react-hooks/exhaustive-deps |
| | | }, [data]); |
| | | |
| | | if (isPending) return <LinearProgress />; |
| | | |
| | | const onDragEnd = result => { |
| | | const { destination, source } = result; |
| | | if (!destination) { |
| | | return; |
| | | } |
| | | const { droppableId: sourceStage, index: sourceIdx } = source; |
| | | const { droppableId: destinationStage, index: destinationIdx } = destination; |
| | | |
| | | // if (!destination) { |
| | | // return; |
| | | // } |
| | | if (destinationStage === sourceStage |
| | | && destinationIdx === sourceIdx) { |
| | | return; |
| | | } |
| | | |
| | | // if ( |
| | | // destination.droppableId === source.droppableId && |
| | | // destination.index === source.index |
| | | // ) { |
| | | // return; |
| | | // } |
| | | |
| | | // const sourceStage = source.droppableId; |
| | | // const destinationStage = destination.droppableId; |
| | | // const sourceDeal = dealsByStage[sourceStage][source.index]; |
| | | // const destinationDeal = dealsByStage[destinationStage][ |
| | | // destination.index |
| | |
| | | const MissionShowContent = ({ handleClose }) => { |
| | | const record = useRecordContext(); |
| | | if (!record) return null; |
| | | console.log(record); |
| | | |
| | | return ( |
| | | <> |