|
|
@ -10,6 +10,8 @@ import { MENU_ADD, MENU_SEARCH, MENU_EDIT, MENU_DELETE, MENU_LIST, MENU_COMPANY_ |
|
|
|
import { NotificationContainer, NotificationManager } from 'react-notifications'; |
|
|
|
import { NotificationContainer, NotificationManager } from 'react-notifications'; |
|
|
|
import { Pagination, Tooltip, Table } from 'antd'; |
|
|
|
import { Pagination, Tooltip, Table } from 'antd'; |
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
|
|
|
|
import { checkActMenup } from '../../../const/CustomFunc.js'; |
|
|
|
|
|
|
|
import { useLocation } from "react-router-dom"; |
|
|
|
const token = window.localStorage.getItem('token'); |
|
|
|
const token = window.localStorage.getItem('token'); |
|
|
|
const column = [ |
|
|
|
const column = [ |
|
|
|
{ name: "Nama" }, |
|
|
|
{ name: "Nama" }, |
|
|
@ -34,6 +36,7 @@ const Index = ({ params, ...props }) => { |
|
|
|
hierarchy = props.hierarchy; |
|
|
|
hierarchy = props.hierarchy; |
|
|
|
user_name = props.user_name; |
|
|
|
user_name = props.user_name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const location = useLocation() |
|
|
|
const [alertDelete, setAlertDelete] = useState(false) |
|
|
|
const [alertDelete, setAlertDelete] = useState(false) |
|
|
|
const [allDataMenu, setAllDataMenu] = useState([]) |
|
|
|
const [allDataMenu, setAllDataMenu] = useState([]) |
|
|
|
const [clickOpenModal, setClickOpenModal] = useState(false) |
|
|
|
const [clickOpenModal, setClickOpenModal] = useState(false) |
|
|
@ -340,10 +343,20 @@ const Index = ({ params, ...props }) => { |
|
|
|
key: 'x', |
|
|
|
key: 'x', |
|
|
|
render: (text, record) => <> |
|
|
|
render: (text, record) => <> |
|
|
|
<Tooltip title={t('delete')}> |
|
|
|
<Tooltip title={t('delete')}> |
|
|
|
<i id="TooltipDelete" className="fa fa-trash" style={{ color: 'red', marginRight: '10px', cursor: "pointer" }} onClick={() => handleDelete(text.id)}></i> |
|
|
|
{ |
|
|
|
|
|
|
|
checkActMenup(location.pathname, 'delete') ? |
|
|
|
|
|
|
|
<i id="TooltipDelete" className="fa fa-trash" style={{ color: 'red', marginRight: '10px', cursor: "pointer" }} onClick={() => handleDelete(text.id)}></i> |
|
|
|
|
|
|
|
: |
|
|
|
|
|
|
|
null |
|
|
|
|
|
|
|
} |
|
|
|
</Tooltip> |
|
|
|
</Tooltip> |
|
|
|
<Tooltip title={t('edit')}> |
|
|
|
<Tooltip title={t('edit')}> |
|
|
|
<i id="TooltipEdit" className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(text)}></i> |
|
|
|
{ |
|
|
|
|
|
|
|
checkActMenup(location.pathname, 'update') ? |
|
|
|
|
|
|
|
<i id="TooltipEdit" className="fa fa-edit" style={{ color: 'green', cursor: "pointer" }} onClick={() => handleEdit(text)}></i> |
|
|
|
|
|
|
|
: |
|
|
|
|
|
|
|
null |
|
|
|
|
|
|
|
} |
|
|
|
</Tooltip> |
|
|
|
</Tooltip> |
|
|
|
</>, |
|
|
|
</>, |
|
|
|
}, |
|
|
|
}, |
|
|
|