New file |
| | |
| | | import { LinearProgress, Stack, Typography } from '@mui/material'; |
| | | import { CreateButton, useGetList } from 'react-admin'; |
| | | import useAppBarHeight from '../misc/useAppBarHeight'; |
| | | import { matchPath, useLocation } from 'react-router'; |
| | | import { DealCreate } from './DealCreate'; |
| | | import { Contact } from '../types'; |
| | | import { Link } from 'react-router-dom'; |
| | | |
| | | export const MissionEmpty = ({ children }) => { |
| | | const location = useLocation(); |
| | | const matchCreate = matchPath('/deals/create', location.pathname); |
| | | const appbarHeight = useAppBarHeight(); |
| | | |
| | | // get Contact data |
| | | const { data: contacts, isPending: contactsLoading } = useGetList<Contact>( |
| | | 'contacts', |
| | | { |
| | | pagination: { page: 1, perPage: 1 }, |
| | | } |
| | | ); |
| | | |
| | | if (contactsLoading) return <LinearProgress />; |
| | | |
| | | return ( |
| | | <Stack |
| | | justifyContent="center" |
| | | alignItems="center" |
| | | gap={3} |
| | | sx={{ |
| | | height: `calc(100dvh - ${appbarHeight}px)`, |
| | | }} |
| | | > |
| | | <img src="./img/empty.svg" alt="No contacts found" /> |
| | | {contacts && contacts.length > 0 ? ( |
| | | <> |
| | | <Stack gap={0} alignItems="center"> |
| | | <Typography variant="h6" fontWeight="bold"> |
| | | No deals found |
| | | </Typography> |
| | | <Typography |
| | | variant="body2" |
| | | align="center" |
| | | color="text.secondary" |
| | | gutterBottom |
| | | > |
| | | It seems your deal list is empty. |
| | | </Typography> |
| | | </Stack> |
| | | <Stack spacing={2} direction="row"> |
| | | <CreateButton variant="contained" label="Create deal" /> |
| | | </Stack> |
| | | <DealCreate open={!!matchCreate} /> |
| | | {children} |
| | | </> |
| | | ) : ( |
| | | <Stack gap={0} alignItems="center"> |
| | | <Typography variant="h6" fontWeight="bold"> |
| | | No deals found |
| | | </Typography> |
| | | <Typography |
| | | variant="body2" |
| | | align="center" |
| | | color="text.secondary" |
| | | gutterBottom |
| | | > |
| | | It seems your contact list is empty. |
| | | <br /> |
| | | <Link to="/contacts/create"> |
| | | Add your first contact |
| | | </Link>{' '} |
| | | before creating a deal. |
| | | </Typography> |
| | | </Stack> |
| | | )} |
| | | </Stack> |
| | | ); |
| | | }; |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | 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, |
| | | } from 'react-admin'; |
| | | import { matchPath, useLocation } from 'react-router'; |
| | | import { Box, Typography, Card, Stack } 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 { MissionEmpty } from "./MissionEmpty"; |
| | | import MissionShow from "./MissionShow"; |
| | | |
| | | const MissionList = () => { |
| | | |
| | | return ( |
| | | <> |
| | | <h1>Fuck</h1> |
| | | <ListBase |
| | | perPage={100} |
| | | filter={{ |
| | | }} |
| | | > |
| | | <MissionLayout /> |
| | | </ListBase> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | const filters = [ |
| | | <SearchInput source="q" alwaysOn />, |
| | | ]; |
| | | |
| | | const MissionLayout = () => { |
| | | const location = useLocation(); |
| | | const matchShow = matchPath('/mission/:id/show', location.pathname); |
| | | |
| | | const { data, isPending, filterValues } = useListContext(); |
| | | if (isPending) return null; |
| | | console.log(data); |
| | | |
| | | if (!data?.length) { |
| | | return ( |
| | | <> |
| | | {/* <MissionEmpty> */} |
| | | <MissionShow open={!!matchShow} id={matchShow?.params.id} /> |
| | | {/* <DealArchivedList /> */} |
| | | {/* </MissionEmpty> */} |
| | | </> |
| | | ); |
| | | } |
| | | |
| | | return ( |
| | | <Stack component="div" sx={{ width: '100%' }}> |
| | | <Title title={'menu.mission'} /> |
| | | <ListToolbar filters={filters} actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | | <SelectColumnsButton preferenceKey='locSts' /> |
| | | </TopToolbar> |
| | | )} /> |
| | | <Card> |
| | | {/* <DealListContent /> */} |
| | | </Card> |
| | | {/* <DealArchivedList /> */} |
| | | |
| | | <MissionShow open={!!matchShow} id={matchShow?.params.id} /> |
| | | </Stack> |
| | | ); |
| | | } |
| | | |
| | | export default MissionList; |
New file |
| | |
| | | |
| | | |
| | | const MissionShow = () => { |
| | | |
| | | return ( |
| | | <> |
| | | show |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default MissionShow; |
| | |
| | | package com.zy.acs.manager.manager.controller; |
| | | |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.common.R; |
| | | import com.zy.acs.manager.manager.service.MissionService; |
| | | import com.zy.acs.manager.manager.service.SegmentService; |
| | |
| | | @PreAuthorize("hasAuthority('manager:mission:list')") |
| | | @PostMapping("/mission/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(missionService.getList()); |
| | | return R.ok().add(Cools.add("total", Integer.MAX_VALUE).add("records", missionService.getList())); |
| | | } |
| | | |
| | | } |