wahyun
12 months ago
22 changed files with 1338 additions and 1317 deletions
@ -1,397 +1,394 @@ |
|||||||
import * as XLSX from 'xlsx'; |
import * as XLSX from 'xlsx'; |
||||||
import DialogForm from './DialogForm'; |
import DialogForm from './DialogForm'; |
||||||
import React, { useState, useEffect, useMemo } from 'react'; |
import React, { useState, useEffect, useMemo } from 'react'; |
||||||
import SweetAlert from 'react-bootstrap-sweetalert'; |
import SweetAlert from 'react-bootstrap-sweetalert'; |
||||||
import axios from "../../../const/interceptorApi" |
import axios from "../../../const/interceptorApi" |
||||||
import moment from 'moment' |
import moment from 'moment' |
||||||
import { Card, CardBody, CardHeader, Col, Row, Input } from 'reactstrap'; |
import { Card, CardBody, CardHeader, Col, Row, Input } from 'reactstrap'; |
||||||
import { NotificationContainer, NotificationManager } from 'react-notifications'; |
import { NotificationContainer, NotificationManager } from 'react-notifications'; |
||||||
import { PROJECT_PHASE_ADD, PROJECT_PHASE_EDIT, PROJECT_PHASE_DELETE, PROJECT_PHASE_SEARCH, PROJECT_PHASE_LIST, BASE_OSPRO } from '../../../const/ApiConst'; |
import { PROJECT_PHASE_ADD, PROJECT_PHASE_EDIT, PROJECT_PHASE_DELETE, PROJECT_PHASE_SEARCH, PROJECT_PHASE_LIST, BASE_OSPRO } from '../../../const/ApiConst'; |
||||||
import { Pagination, Button, Tooltip, Table } from 'antd'; |
import { Pagination, Button, Tooltip, Table } from 'antd'; |
||||||
import { useTranslation } from 'react-i18next'; |
import { useTranslation } from 'react-i18next'; |
||||||
|
|
||||||
|
|
||||||
const ProjectPhase = ({ params, ...props }) => { |
const ProjectPhase = ({ params, ...props }) => { |
||||||
let role_id = '', user_id = '', proyek_id = '', isLogin = '', token = '', company_id = 0, role_name = ''; |
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name='', hierarchy=[], user_name=''; |
||||||
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
if (props && props.role_id && props.user_id) { |
||||||
role_id = props.location.state.role_id; |
role_id = props.role_id; |
||||||
user_id = props.location.state.user_id; |
user_id = props.user_id; |
||||||
token = props.location.state.token; |
token = props.token; |
||||||
isLogin = props.location.state.isLogin; |
isLogin = props.isLogin; |
||||||
role_name = props.location.state.role_name; |
company_id = props.company_id; |
||||||
} else { |
all_project = props.all_project; |
||||||
role_id = localStorage.getItem("role_id"); |
role_name = props.role_name; |
||||||
proyek_id = localStorage.getItem("proyek_id"); |
isLogin = props.isLogin; |
||||||
user_id = localStorage.getItem("user_id"); |
hierarchy = props.hierarchy; |
||||||
token = localStorage.getItem("token"); |
user_name = props.user_name; |
||||||
isLogin = localStorage.getItem("isLogin"); |
} |
||||||
company_id = localStorage.getItem('company_id'); |
|
||||||
role_name = localStorage.getItem('role_name'); |
const HEADER = { |
||||||
} |
headers: { |
||||||
|
"Content-Type": "application/json", |
||||||
const HEADER = { |
"Authorization": `Bearer ${token}` |
||||||
headers: { |
} |
||||||
"Content-Type": "application/json", |
} |
||||||
"Authorization": `Bearer ${token}` |
const pageName = params.name; |
||||||
} |
|
||||||
} |
const [alertDelete, setAlertDelete] = useState(false) |
||||||
const pageName = params.name; |
const [allDataMenu, setAllDataMenu] = useState([]) |
||||||
|
const [clickOpenModal, setClickOpenModal] = useState(false) |
||||||
const [alertDelete, setAlertDelete] = useState(false) |
const [currentPage, setCurrentPage] = useState(1) |
||||||
const [allDataMenu, setAllDataMenu] = useState([]) |
const [dataEdit, setDataEdit] = useState([]) |
||||||
const [clickOpenModal, setClickOpenModal] = useState(false) |
const [dataExport, setDataExport] = useState([]) |
||||||
const [currentPage, setCurrentPage] = useState(1) |
const [dataTable, setDatatable] = useState([]) |
||||||
const [dataEdit, setDataEdit] = useState([]) |
const [idDelete, setIdDelete] = useState(0) |
||||||
const [dataExport, setDataExport] = useState([]) |
const [idPhaseProject, setIdPhaseProject] = useState(0) |
||||||
const [dataTable, setDatatable] = useState([]) |
const [openDialog, setOpenDialog] = useState(false) |
||||||
const [idDelete, setIdDelete] = useState(0) |
const [openDialogIG, setOpenDialogIG] = useState(false) |
||||||
const [idPhaseProject, setIdPhaseProject] = useState(0) |
const [rowsPerPage, setRowsPerPage] = useState(10) |
||||||
const [openDialog, setOpenDialog] = useState(false) |
const [search, setSearch] = useState('') |
||||||
const [openDialogIG, setOpenDialogIG] = useState(false) |
const [totalPage, setTotalPage] = useState(0) |
||||||
const [rowsPerPage, setRowsPerPage] = useState(10) |
const [typeDialog, setTypeDialog] = useState('Save') |
||||||
const [search, setSearch] = useState('') |
const { t } = useTranslation() |
||||||
const [totalPage, setTotalPage] = useState(0) |
useEffect(() => { |
||||||
const [typeDialog, setTypeDialog] = useState('Save') |
getDataProjectPhase() |
||||||
const { t } = useTranslation() |
}, [currentPage, rowsPerPage, search]) |
||||||
useEffect(() => { |
|
||||||
getDataProjectPhase() |
useEffect(() => { |
||||||
}, [currentPage, rowsPerPage, search]) |
const cekData = dataExport || [] |
||||||
|
if (cekData.length > 0) { |
||||||
useEffect(() => { |
exportExcel() |
||||||
const cekData = dataExport || [] |
} |
||||||
if (cekData.length > 0) { |
}, [dataExport]) |
||||||
exportExcel() |
|
||||||
} |
const getDataProjectPhase = async () => { |
||||||
}, [dataExport]) |
let start = 0; |
||||||
|
if (currentPage !== 1 && currentPage > 1) { |
||||||
const getDataProjectPhase = async () => { |
start = (currentPage * rowsPerPage) - rowsPerPage |
||||||
let start = 0; |
} |
||||||
if (currentPage !== 1 && currentPage > 1) { |
const payload = { |
||||||
start = (currentPage * rowsPerPage) - rowsPerPage |
"columns": [ |
||||||
} |
{ |
||||||
const payload = { |
"name": "name", |
||||||
"columns": [ |
"logic_operator": "ilike", |
||||||
{ |
"value": search, |
||||||
"name": "name", |
"operator": "AND" |
||||||
"logic_operator": "ilike", |
} |
||||||
"value": search, |
], |
||||||
"operator": "AND" |
"orders": { |
||||||
} |
"ascending": true, |
||||||
], |
"columns": [ |
||||||
"orders": { |
'id' |
||||||
"ascending": true, |
] |
||||||
"columns": [ |
}, |
||||||
'id' |
"paging": { |
||||||
] |
"length": rowsPerPage, |
||||||
}, |
"start": start |
||||||
"paging": { |
} |
||||||
"length": rowsPerPage, |
} |
||||||
"start": start |
if (role_name !== "Super Admin") { |
||||||
} |
payload.columns.push( |
||||||
} |
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, |
||||||
if (role_name !== "Super Admin") { |
) |
||||||
payload.columns.push( |
} else { |
||||||
{ "name": "company_id", "logic_operator": "=", "value": company_id, "operator": "AND" }, |
payload.columns.push( |
||||||
) |
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" }, |
||||||
} else { |
) |
||||||
payload.columns.push( |
} |
||||||
{ "name": "company_id", "logic_operator": "is null", "value": "", "operator": "AND" }, |
const result = await axios |
||||||
) |
.post(PROJECT_PHASE_SEARCH, payload, HEADER) |
||||||
} |
.then((res) => res) |
||||||
const result = await axios |
.catch((err) => err.response); |
||||||
.post(PROJECT_PHASE_SEARCH, payload, HEADER) |
|
||||||
.then((res) => res) |
if (result && result.data && result.data.code == 200) { |
||||||
.catch((err) => err.response); |
result.data.data.map((res) => { |
||||||
|
res.key = res.id.toString() |
||||||
if (result && result.data && result.data.code == 200) { |
}); |
||||||
result.data.data.map((res) => { |
setDatatable(result.data.data); |
||||||
res.key = res.id.toString() |
setTotalPage(result.data.totalRecord); |
||||||
}); |
} else { |
||||||
setDatatable(result.data.data); |
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); |
||||||
setTotalPage(result.data.totalRecord); |
} |
||||||
} else { |
} |
||||||
NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); |
|
||||||
} |
const handleSearch = e => { |
||||||
} |
const value = e.target.value |
||||||
|
setSearch(value); |
||||||
const handleSearch = e => { |
setCurrentPage(1) |
||||||
const value = e.target.value |
}; |
||||||
setSearch(value); |
const handleOpenDialog = (type) => { |
||||||
setCurrentPage(1) |
setOpenDialog(true) |
||||||
}; |
setTypeDialog(type) |
||||||
const handleOpenDialog = (type) => { |
} |
||||||
setOpenDialog(true) |
|
||||||
setTypeDialog(type) |
const handleExportExcel = async () => { |
||||||
} |
let start = 0; |
||||||
|
|
||||||
const handleExportExcel = async () => { |
if (currentPage !== 1 && currentPage > 1) { |
||||||
let start = 0; |
start = (currentPage * rowsPerPage) - rowsPerPage |
||||||
|
} |
||||||
if (currentPage !== 1 && currentPage > 1) { |
|
||||||
start = (currentPage * rowsPerPage) - rowsPerPage |
const payload = { |
||||||
} |
"columns": [ |
||||||
|
{ |
||||||
const payload = { |
"name": "name", |
||||||
"columns": [ |
"logic_operator": "like", |
||||||
{ |
"value": search, |
||||||
"name": "name", |
"operator": "AND" |
||||||
"logic_operator": "like", |
} |
||||||
"value": search, |
], |
||||||
"operator": "AND" |
"orders": { |
||||||
} |
"ascending": true, |
||||||
], |
"columns": [ |
||||||
"orders": { |
'id' |
||||||
"ascending": true, |
] |
||||||
"columns": [ |
}, |
||||||
'id' |
"paging": { |
||||||
] |
"length": rowsPerPage, |
||||||
}, |
"start": start |
||||||
"paging": { |
} |
||||||
"length": rowsPerPage, |
} |
||||||
"start": start |
|
||||||
} |
const result = await axios |
||||||
} |
.post(PROJECT_PHASE_SEARCH, payload, HEADER) |
||||||
|
.then(res => res) |
||||||
const result = await axios |
.catch((error) => error.response); |
||||||
.post(PROJECT_PHASE_SEARCH, payload, HEADER) |
if (result && result.data && result.data.code == 200) { |
||||||
.then(res => res) |
let resData = result.data.data; |
||||||
.catch((error) => error.response); |
const excelData = []; |
||||||
if (result && result.data && result.data.code == 200) { |
resData.map((val, index) => { |
||||||
let resData = result.data.data; |
let dataRow = { |
||||||
const excelData = []; |
"Nama": val.name, |
||||||
resData.map((val, index) => { |
"Color": val.color, |
||||||
let dataRow = { |
} |
||||||
"Nama": val.name, |
excelData.push(dataRow) |
||||||
"Color": val.color, |
}) |
||||||
} |
await setDataExport(excelData) |
||||||
excelData.push(dataRow) |
} else { |
||||||
}) |
NotificationManager.error('Gagal Export Data!!', 'Failed'); |
||||||
await setDataExport(excelData) |
} |
||||||
} else { |
} |
||||||
NotificationManager.error('Gagal Export Data!!', 'Failed'); |
|
||||||
} |
const exportExcel = () => { |
||||||
} |
const dataExcel = dataExport || []; |
||||||
|
const fileName = `Data ${pageName}.xlsx`; |
||||||
const exportExcel = () => { |
const ws = XLSX.utils.json_to_sheet(dataExcel); |
||||||
const dataExcel = dataExport || []; |
const wb = XLSX.utils.book_new(); |
||||||
const fileName = `Data ${pageName}.xlsx`; |
XLSX.utils.book_append_sheet(wb, ws, `Data ${pageName}`); |
||||||
const ws = XLSX.utils.json_to_sheet(dataExcel); |
XLSX.writeFile(wb, fileName); |
||||||
const wb = XLSX.utils.book_new(); |
setDataExport([]) |
||||||
XLSX.utils.book_append_sheet(wb, ws, `Data ${pageName}`); |
} |
||||||
XLSX.writeFile(wb, fileName); |
|
||||||
setDataExport([]) |
const handleEdit = (data) => { |
||||||
} |
setDataEdit(data) |
||||||
|
handleOpenDialog('Edit'); |
||||||
const handleEdit = (data) => { |
} |
||||||
setDataEdit(data) |
|
||||||
handleOpenDialog('Edit'); |
const handleDelete = async (id) => { |
||||||
} |
await setAlertDelete(true) |
||||||
|
await setIdDelete(id) |
||||||
const handleDelete = async (id) => { |
} |
||||||
await setAlertDelete(true) |
|
||||||
await setIdDelete(id) |
const handleCloseDialog = (type, data) => { |
||||||
} |
if (type === "save") { |
||||||
|
saveProjectPhase(data); |
||||||
const handleCloseDialog = (type, data) => { |
} else if (type === "edit") { |
||||||
if (type === "save") { |
editProjectPhase(data); |
||||||
saveProjectPhase(data); |
} |
||||||
} else if (type === "edit") { |
setDataEdit([]) |
||||||
editMaterialR(data); |
setOpenDialog(false) |
||||||
} |
} |
||||||
setDataEdit([]) |
|
||||||
setOpenDialog(false) |
const saveProjectPhase = async (data) => { |
||||||
} |
const formData = data |
||||||
|
const result = await axios.post(PROJECT_PHASE_ADD, formData, HEADER) |
||||||
const saveProjectPhase = async (data) => { |
.then(res => res) |
||||||
const formData = data |
.catch((error) => error.response); |
||||||
const result = await axios.post(PROJECT_PHASE_ADD, formData, HEADER) |
|
||||||
.then(res => res) |
if (result && result.data && result.data.code === 200) { |
||||||
.catch((error) => error.response); |
getDataProjectPhase() |
||||||
|
NotificationManager.success(`Data project type berhasil ditambah`, 'Success!!'); |
||||||
if (result && result.data && result.data.code === 200) { |
} else { |
||||||
getDataProjectPhase() |
NotificationManager.error(`${result.data.message}`, 'Failed!!'); |
||||||
NotificationManager.success(`Data project type berhasil ditambah`, 'Success!!'); |
} |
||||||
} else { |
} |
||||||
NotificationManager.error(`${result.data.message}`, 'Failed!!'); |
|
||||||
} |
const editProjectPhase = async (data) => { |
||||||
} |
let urlEdit = PROJECT_PHASE_EDIT(data.id) |
||||||
|
const formData = data |
||||||
const editMaterialR = async (data) => { |
|
||||||
let urlEdit = PROJECT_PHASE_EDIT(data.id) |
const result = await axios.put(urlEdit, formData, HEADER) |
||||||
const formData = data |
.then(res => res) |
||||||
|
.catch((error) => error.response); |
||||||
const result = await axios.put(urlEdit, formData, HEADER) |
|
||||||
.then(res => res) |
if (result && result.data && result.data.code === 200) { |
||||||
.catch((error) => error.response); |
getDataProjectPhase(); |
||||||
|
NotificationManager.success(`Data project phase berhasil diedit`, 'Success!!'); |
||||||
if (result && result.data && result.data.code === 200) { |
} else { |
||||||
getDataProjectPhase(); |
NotificationManager.error(`Data project phase gagal di edit`, `Failed!!`); |
||||||
NotificationManager.success(`Data project phase berhasil diedit`, 'Success!!'); |
} |
||||||
} else { |
} |
||||||
NotificationManager.error(`Data project phase gagal di edit`, `Failed!!`); |
|
||||||
} |
const toggleAddDialog = () => { |
||||||
} |
setOpenDialog(!openDialog) |
||||||
|
} |
||||||
const toggleAddDialog = () => { |
|
||||||
setOpenDialog(!openDialog) |
const handleDialogIg = (id) => { |
||||||
} |
setIdPhaseProject(id) |
||||||
|
setOpenDialogIG(true) |
||||||
const handleDialogIg = (id) => { |
} |
||||||
setIdPhaseProject(id) |
|
||||||
setOpenDialogIG(true) |
const closeDialogIG = () => { |
||||||
} |
setIdPhaseProject(0) |
||||||
|
setOpenDialogIG(false) |
||||||
const closeDialogIG = () => { |
} |
||||||
setIdPhaseProject(0) |
|
||||||
setOpenDialogIG(false) |
const toggleDialogIG = () => { |
||||||
} |
if (openDialogIG) { |
||||||
|
setIdPhaseProject(0) |
||||||
const toggleDialogIG = () => { |
} |
||||||
if (openDialogIG) { |
setOpenDialogIG(!openDialogIG); |
||||||
setIdPhaseProject(0) |
} |
||||||
} |
|
||||||
setOpenDialogIG(!openDialogIG); |
const onConfirmDelete = async () => { |
||||||
} |
let url = PROJECT_PHASE_DELETE(idDelete); |
||||||
|
|
||||||
const onConfirmDelete = async () => { |
const result = await axios.delete(url, HEADER) |
||||||
let url = PROJECT_PHASE_DELETE(idDelete); |
.then(res => res) |
||||||
|
.catch((error) => error.response); |
||||||
const result = await axios.delete(url, HEADER) |
|
||||||
.then(res => res) |
if (result && result.data && result.data.code === 200) { |
||||||
.catch((error) => error.response); |
getDataProjectPhase() |
||||||
|
setIdDelete(0) |
||||||
if (result && result.data && result.data.code === 200) { |
setAlertDelete(false) |
||||||
getDataProjectPhase() |
NotificationManager.success(`Data project phase berhasil dihapus!`, 'Success!!'); |
||||||
setIdDelete(0) |
} else { |
||||||
setAlertDelete(false) |
setIdDelete(0) |
||||||
NotificationManager.success(`Data project phase berhasil dihapus!`, 'Success!!'); |
setAlertDelete(false) |
||||||
} else { |
NotificationManager.error(`Data project phase gagal dihapus!}`, 'Failed!!'); |
||||||
setIdDelete(0) |
} |
||||||
setAlertDelete(false) |
} |
||||||
NotificationManager.error(`Data project phase gagal dihapus!}`, 'Failed!!'); |
|
||||||
} |
const cancelDelete = () => { |
||||||
} |
setAlertDelete(false) |
||||||
|
setIdDelete(0) |
||||||
const cancelDelete = () => { |
} |
||||||
setAlertDelete(false) |
|
||||||
setIdDelete(0) |
const onShowSizeChange = (current, pageSize) => { |
||||||
} |
setRowsPerPage(pageSize) |
||||||
|
} |
||||||
const onShowSizeChange = (current, pageSize) => { |
|
||||||
setRowsPerPage(pageSize) |
const onPagination = (current, pageSize) => { |
||||||
} |
setCurrentPage(current) |
||||||
|
} |
||||||
const onPagination = (current, pageSize) => { |
|
||||||
setCurrentPage(current) |
const dataNotAvailable = () => { |
||||||
} |
if (dataTable.length === 0) { |
||||||
|
return ( |
||||||
const dataNotAvailable = () => { |
<tr> |
||||||
if (dataTable.length === 0) { |
<td align="center" colSpan="3">{t('noData')}</td> |
||||||
return ( |
</tr> |
||||||
<tr> |
) |
||||||
<td align="center" colSpan="3">{t('noData')}</td> |
} |
||||||
</tr> |
} |
||||||
) |
|
||||||
} |
const renderTable = useMemo(() => { |
||||||
} |
const columns = [ |
||||||
|
{ |
||||||
const renderTable = useMemo(() => { |
title: t('action'), |
||||||
const columns = [ |
dataIndex: '', |
||||||
{ |
key: 'x', |
||||||
title: t('action'), |
className: 'nowrap', |
||||||
dataIndex: '', |
render: (text, record) => <> |
||||||
key: 'x', |
<Tooltip title={t('delete')}> |
||||||
className: 'nowrap', |
<i className="fa fa-trash" style={{ color: 'red', marginRight: '10px', cursor: "pointer" }} onClick={() => handleDelete(text.id)}></i> |
||||||
render: (text, record) => <> |
</Tooltip> |
||||||
<Tooltip title={t('delete')}> |
<Tooltip title={t('Edit')}> |
||||||
<i className="fa fa-trash" style={{ color: 'red', marginRight: '10px', cursor: "pointer" }} onClick={() => handleDelete(text.id)}></i> |
<i className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(text)}></i> |
||||||
</Tooltip> |
</Tooltip>{" "} |
||||||
<Tooltip title={t('Edit')}> |
</>, |
||||||
<i className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(text)}></i> |
}, |
||||||
</Tooltip>{" "} |
{ title: t('phase'), dataIndex: 'name', key: 'name', className: "nowrap" }, |
||||||
</>, |
{ |
||||||
}, |
title: t('color'), |
||||||
{ title: t('phase'), dataIndex: 'name', key: 'name', className: "nowrap" }, |
dataIndex: 'color', |
||||||
{ |
key: 'color', |
||||||
title: t('color'), |
render: (text) => <> |
||||||
dataIndex: 'color', |
<Tooltip title={text}> |
||||||
key: 'color', |
<i className="fa fa-square" style={{ color: text }} ></i> |
||||||
render: (text) => <> |
</Tooltip> |
||||||
<Tooltip title={text}> |
</>, |
||||||
<i className="fa fa-square" style={{ color: text }} ></i> |
}, |
||||||
</Tooltip> |
]; |
||||||
</>, |
return ( |
||||||
}, |
<Table |
||||||
]; |
rowKey="id" |
||||||
return ( |
size="small" |
||||||
<Table |
columns={columns} |
||||||
rowKey="id" |
dataSource={dataTable} |
||||||
size="small" |
pagination={false} |
||||||
columns={columns} |
/> |
||||||
dataSource={dataTable} |
) |
||||||
pagination={false} |
}, [dataTable]) |
||||||
/> |
|
||||||
) |
return ( |
||||||
}, [dataTable]) |
<div> |
||||||
|
<NotificationContainer /> |
||||||
return ( |
<SweetAlert |
||||||
<div> |
show={alertDelete} |
||||||
<NotificationContainer /> |
warning |
||||||
<SweetAlert |
showCancel |
||||||
show={alertDelete} |
confirmBtnText="Delete" |
||||||
warning |
confirmBtnBsStyle="danger" |
||||||
showCancel |
title={t('deleteConfirm')} |
||||||
confirmBtnText="Delete" |
onConfirm={onConfirmDelete} |
||||||
confirmBtnBsStyle="danger" |
onCancel={cancelDelete} |
||||||
title={t('deleteConfirm')} |
focusCancelBtn |
||||||
onConfirm={onConfirmDelete} |
> |
||||||
onCancel={cancelDelete} |
{t('deleteMsg')} |
||||||
focusCancelBtn |
</SweetAlert> |
||||||
> |
<DialogForm |
||||||
{t('deleteMsg')} |
openDialog={openDialog} |
||||||
</SweetAlert> |
closeDialog={handleCloseDialog} |
||||||
<DialogForm |
toggleDialog={() => toggleAddDialog} |
||||||
openDialog={openDialog} |
typeDialog={typeDialog} |
||||||
closeDialog={handleCloseDialog} |
dataEdit={dataEdit} |
||||||
toggleDialog={() => toggleAddDialog} |
clickOpenModal={clickOpenModal} |
||||||
typeDialog={typeDialog} |
dataParent={allDataMenu} |
||||||
dataEdit={dataEdit} |
/> |
||||||
clickOpenModal={clickOpenModal} |
<Card> |
||||||
dataParent={allDataMenu} |
<CardHeader style={{ display: "flex", justifyContent: "space-between" }}> |
||||||
/> |
<h4 className="capitalize">{pageName}</h4> |
||||||
<Card> |
<Row> |
||||||
<CardHeader style={{ display: "flex", justifyContent: "space-between" }}> |
<Col> |
||||||
<h4 className="capitalize">{pageName}</h4> |
<Input onChange={handleSearch} value={search} type="text" name="search" id="search" placeholder={t('searchPhase')} /> |
||||||
<Row> |
</Col> |
||||||
<Col> |
<Col> |
||||||
<Input onChange={handleSearch} value={search} type="text" name="search" id="search" placeholder={t('searchPhase')} /> |
<Tooltip title={t('projectPhase')}> |
||||||
</Col> |
<Button style={{ background: "#4caf50", color: "#fff" }} onClick={() => handleOpenDialog('Save')}><i className="fa fa-plus"></i></Button> |
||||||
<Col> |
</Tooltip> |
||||||
<Tooltip title={t('projectPhase')}> |
<Tooltip title={t('exportExcel')}> |
||||||
<Button style={{ background: "#4caf50", color: "#fff" }} onClick={() => handleOpenDialog('Save')}><i className="fa fa-plus"></i></Button> |
<Button style={{ marginLeft: "5px" }} onClick={() => handleExportExcel()}><i className="fa fa-print"></i></Button> |
||||||
</Tooltip> |
</Tooltip> |
||||||
<Tooltip title={t('exportExcel')}> |
</Col> |
||||||
<Button style={{ marginLeft: "5px" }} onClick={() => handleExportExcel()}><i className="fa fa-print"></i></Button> |
</Row> |
||||||
</Tooltip> |
</CardHeader> |
||||||
</Col> |
<CardBody> |
||||||
</Row> |
{renderTable} |
||||||
</CardHeader> |
<Pagination |
||||||
<CardBody> |
style={{ marginTop: "25px" }} |
||||||
{renderTable} |
showSizeChanger |
||||||
<Pagination |
onShowSizeChange={onShowSizeChange} |
||||||
style={{ marginTop: "25px" }} |
onChange={onPagination} |
||||||
showSizeChanger |
defaultCurrent={currentPage} |
||||||
onShowSizeChange={onShowSizeChange} |
pageSize={rowsPerPage} |
||||||
onChange={onPagination} |
total={totalPage} |
||||||
defaultCurrent={currentPage} |
pageSizeOptions={["10", "15", "20", "25", "30", "35", "40"]} |
||||||
pageSize={rowsPerPage} |
/> |
||||||
total={totalPage} |
</CardBody> |
||||||
pageSizeOptions={["10", "15", "20", "25", "30", "35", "40"]} |
</Card> |
||||||
/> |
</div> |
||||||
</CardBody> |
) |
||||||
</Card> |
} |
||||||
</div> |
|
||||||
) |
export default ProjectPhase; |
||||||
} |
|
||||||
|
|
||||||
export default ProjectPhase; |
|
||||||
|
Loading…
Reference in new issue