complete all 4 pages with their table and make a adapter for datatable
This commit is contained in:
7
src/app/api/fake-data/route.js
Normal file
7
src/app/api/fake-data/route.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const data = [
|
||||
// put your fake data here
|
||||
];
|
||||
|
||||
export async function GET() {
|
||||
return Response.json({ data });
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo } from "react";
|
||||
import { Box, IconButton, Tooltip } from "@mui/material";
|
||||
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
||||
import AssignmentIcon from "@mui/icons-material/Assignment";
|
||||
|
||||
const TaskList = () => {
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
{
|
||||
accessorKey: "aplication_number",
|
||||
header: "شماره درخواست",
|
||||
id: "aplication_number",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "notEquals",
|
||||
},
|
||||
{
|
||||
accessorKey: "application_date",
|
||||
header: "تاریخ درخواست",
|
||||
id: "application_date",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "province",
|
||||
header: "استان",
|
||||
id: "province",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "city",
|
||||
header: "شهر",
|
||||
id: "city",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "county",
|
||||
header: "بخش",
|
||||
id: "county",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "village",
|
||||
header: "روستا",
|
||||
id: "village",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "land_area",
|
||||
header: "مساحت زمین",
|
||||
id: "land_area",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_area",
|
||||
header: "مساحت طرح",
|
||||
id: "design_area",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "organization",
|
||||
header: "سازمان",
|
||||
id: "organization",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_group",
|
||||
header: "گروه طرح",
|
||||
id: "design_group",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_title",
|
||||
header: "عنوان طرح",
|
||||
id: "design_title",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
],
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box sx={{ p: 1, border: 1, borderColor: "divider", borderRadius: 1 }}>
|
||||
<DataTableWithAuth
|
||||
table_title={"لیست استعلام ها"}
|
||||
need_filter={false}
|
||||
columns={columns}
|
||||
table_url={"/v3/api/fake-data"}
|
||||
page_name={"assistantZaminGov"}
|
||||
table_name={"assistantZaminGovList"}
|
||||
enableRowActions
|
||||
positionActionsColumn={"last"}
|
||||
renderRowActions={({ row, table }) => (
|
||||
<Tooltip arrow title="نمایش جزئیات" placement="right">
|
||||
<IconButton
|
||||
color="success"
|
||||
onClick={() => console.log("next part")}
|
||||
>
|
||||
<AssignmentIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
/>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default TaskList;
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
import PageTitle from "@/core/components/PageTitle";
|
||||
import { Stack } from "@mui/material";
|
||||
import TaskList from "./TaskList";
|
||||
|
||||
const AssistantZaminGovComponent = () => {
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"استعلام حرائم پنجره واحد"} />
|
||||
<TaskList />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo } from "react";
|
||||
import { Box, IconButton, Tooltip } from "@mui/material";
|
||||
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
||||
import AssignmentIcon from "@mui/icons-material/Assignment";
|
||||
|
||||
const TaskList = () => {
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
{
|
||||
accessorKey: "aplication_number",
|
||||
header: "شماره درخواست",
|
||||
id: "aplication_number",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "notEquals",
|
||||
},
|
||||
{
|
||||
accessorKey: "application_date",
|
||||
header: "تاریخ درخواست",
|
||||
id: "application_date",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "province",
|
||||
header: "استان",
|
||||
id: "province",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "city",
|
||||
header: "شهر",
|
||||
id: "city",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "county",
|
||||
header: "بخش",
|
||||
id: "county",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "village",
|
||||
header: "روستا",
|
||||
id: "village",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "land_area",
|
||||
header: "مساحت زمین",
|
||||
id: "land_area",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_area",
|
||||
header: "مساحت طرح",
|
||||
id: "design_area",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "organization",
|
||||
header: "سازمان",
|
||||
id: "organization",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_group",
|
||||
header: "گروه طرح",
|
||||
id: "design_group",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_title",
|
||||
header: "عنوان طرح",
|
||||
id: "design_title",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
],
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box sx={{ p: 1, border: 1, borderColor: "divider", borderRadius: 1 }}>
|
||||
<DataTableWithAuth
|
||||
table_title={"لیست استعلام ها"}
|
||||
need_filter={false}
|
||||
columns={columns}
|
||||
table_url={"/v3/api/fake-data"}
|
||||
page_name={"cityAdminZaminGov"}
|
||||
table_name={"cityAdminZaminGovList"}
|
||||
enableRowActions
|
||||
positionActionsColumn={"last"}
|
||||
renderRowActions={({ row, table }) => (
|
||||
<Tooltip arrow title="نمایش جزئیات" placement="right">
|
||||
<IconButton
|
||||
color="success"
|
||||
onClick={() => console.log("next part")}
|
||||
>
|
||||
<AssignmentIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
/>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default TaskList;
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
import PageTitle from "@/core/components/PageTitle";
|
||||
import { Stack } from "@mui/material";
|
||||
import TaskList from "./TaskList";
|
||||
|
||||
const CityAdminZaminGovComponent = () => {
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"استعلام حرائم پنجره واحد"} />
|
||||
<TaskList />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo } from "react";
|
||||
import { Box, IconButton, Tooltip } from "@mui/material";
|
||||
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
||||
import AssignmentIcon from "@mui/icons-material/Assignment";
|
||||
|
||||
const TaskList = () => {
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
{
|
||||
accessorKey: "aplication_number",
|
||||
header: "شماره درخواست",
|
||||
id: "aplication_number",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "notEquals",
|
||||
},
|
||||
{
|
||||
accessorKey: "application_date",
|
||||
header: "تاریخ درخواست",
|
||||
id: "application_date",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "province",
|
||||
header: "استان",
|
||||
id: "province",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "city",
|
||||
header: "شهر",
|
||||
id: "city",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "county",
|
||||
header: "بخش",
|
||||
id: "county",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "village",
|
||||
header: "روستا",
|
||||
id: "village",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "land_area",
|
||||
header: "مساحت زمین",
|
||||
id: "land_area",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_area",
|
||||
header: "مساحت طرح",
|
||||
id: "design_area",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "organization",
|
||||
header: "سازمان",
|
||||
id: "organization",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_group",
|
||||
header: "گروه طرح",
|
||||
id: "design_group",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_title",
|
||||
header: "عنوان طرح",
|
||||
id: "design_title",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
],
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box sx={{ p: 1, border: 1, borderColor: "divider", borderRadius: 1 }}>
|
||||
<DataTableWithAuth
|
||||
table_title={"لیست استعلام ها"}
|
||||
need_filter={false}
|
||||
columns={columns}
|
||||
table_url={"/v3/api/fake-data"}
|
||||
page_name={"generalManagerZaminGov"}
|
||||
table_name={"generalManagerZaminGovList"}
|
||||
enableRowActions
|
||||
positionActionsColumn={"last"}
|
||||
renderRowActions={({ row, table }) => (
|
||||
<Tooltip arrow title="نمایش جزئیات" placement="right">
|
||||
<IconButton
|
||||
color="success"
|
||||
onClick={() => console.log("next part")}
|
||||
>
|
||||
<AssignmentIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
/>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default TaskList;
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
import PageTitle from "@/core/components/PageTitle";
|
||||
import { Stack } from "@mui/material";
|
||||
import TaskList from "./TaskList";
|
||||
|
||||
const GeneralManagerZaminGovComponent = () => {
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"استعلام حرائم پنجره واحد"} />
|
||||
<TaskList />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo } from "react";
|
||||
import { Box, IconButton, Tooltip } from "@mui/material";
|
||||
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
|
||||
import AssignmentIcon from "@mui/icons-material/Assignment";
|
||||
|
||||
const TaskList = () => {
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
{
|
||||
accessorKey: "aplication_number",
|
||||
header: "شماره درخواست",
|
||||
id: "aplication_number",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "notEquals",
|
||||
},
|
||||
{
|
||||
accessorKey: "application_date",
|
||||
header: "تاریخ درخواست",
|
||||
id: "application_date",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "province",
|
||||
header: "استان",
|
||||
id: "province",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "city",
|
||||
header: "شهر",
|
||||
id: "city",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "county",
|
||||
header: "بخش",
|
||||
id: "county",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "village",
|
||||
header: "روستا",
|
||||
id: "village",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "land_area",
|
||||
header: "مساحت زمین",
|
||||
id: "land_area",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_area",
|
||||
header: "مساحت طرح",
|
||||
id: "design_area",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "organization",
|
||||
header: "سازمان",
|
||||
id: "organization",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_group",
|
||||
header: "گروه طرح",
|
||||
id: "design_group",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
{
|
||||
accessorKey: "design_title",
|
||||
header: "عنوان طرح",
|
||||
id: "design_title",
|
||||
enableColumnFilter: false,
|
||||
datatype: "text",
|
||||
filterFn: "equals",
|
||||
},
|
||||
],
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Box sx={{ p: 1, border: 1, borderColor: "divider", borderRadius: 1 }}>
|
||||
<DataTableWithAuth
|
||||
table_title={"لیست استعلام ها"}
|
||||
need_filter={false}
|
||||
columns={columns}
|
||||
table_url={"/v3/api/fake-data"}
|
||||
page_name={"provinceAdminZaminGov"}
|
||||
table_name={"provinceAdminZaminGovList"}
|
||||
enableRowActions
|
||||
positionActionsColumn={"last"}
|
||||
renderRowActions={({ row, table }) => (
|
||||
<Tooltip arrow title="نمایش جزئیات" placement="right">
|
||||
<IconButton
|
||||
color="success"
|
||||
onClick={() => console.log("next part")}
|
||||
>
|
||||
<AssignmentIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
)}
|
||||
/>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default TaskList;
|
||||
@@ -2,11 +2,13 @@
|
||||
|
||||
import PageTitle from "@/core/components/PageTitle";
|
||||
import { Stack } from "@mui/material";
|
||||
import TaskList from "./TaskList";
|
||||
|
||||
const ProvinceAdminZaminGovComponent = () => {
|
||||
return (
|
||||
<Stack spacing={1}>
|
||||
<PageTitle title={"استعلام حرائم پنجره واحد"} />
|
||||
<TaskList />
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -108,7 +108,7 @@ const DataTable_Main = (props) => {
|
||||
onSortingChange: onSortingChange,
|
||||
renderTopToolbarCustomActions: ({ table }) => (
|
||||
<>
|
||||
<TableToolbar mutate={mutate} />
|
||||
{TableToolbar && <TableToolbar mutate={mutate} />}
|
||||
</>
|
||||
),
|
||||
...props,
|
||||
|
||||
13
src/core/components/DataTableWithAuth.jsx
Normal file
13
src/core/components/DataTableWithAuth.jsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import DataTable from "@/core/components/DataTable";
|
||||
import { useAuth } from "@/lib/contexts/auth";
|
||||
|
||||
const DataTableWithAuth = (props) => {
|
||||
const { user } = useAuth();
|
||||
return (
|
||||
<DataTable
|
||||
user_id={user.username}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
export default DataTableWithAuth;
|
||||
Reference in New Issue
Block a user