|
|
|
@ -8,11 +8,19 @@ import moment from 'moment'
|
|
|
|
|
import { Card, CardBody, CardHeader, Col, Row, Input } from 'reactstrap'; |
|
|
|
|
import { DownloadOutlined } from '@ant-design/icons'; |
|
|
|
|
import { NotificationContainer, NotificationManager } from 'react-notifications'; |
|
|
|
|
import { useLocation } from "react-router-dom"; |
|
|
|
|
import { Pagination, Table, Button, Tooltip, Spin } from 'antd'; |
|
|
|
|
import { |
|
|
|
|
USER_ADD, USER_SEARCH, USER_EDIT, USER_DELETE, ROLE_SEARCH, DIVISI_SEARCH, USER_SHIFT_ADD, COMPANY_MANAGEMENT_LIST |
|
|
|
|
} from '../../../const/ApiConst'; |
|
|
|
|
import { useTranslation } from 'react-i18next'; |
|
|
|
|
import { |
|
|
|
|
formatNumber, |
|
|
|
|
formatRupiah, |
|
|
|
|
formatThousand, |
|
|
|
|
renderFormatRupiah, |
|
|
|
|
checkActMenup, |
|
|
|
|
} from "../../../const/CustomFunc"; |
|
|
|
|
|
|
|
|
|
const ResourceWorker = ({ params, ...props }) => { |
|
|
|
|
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = ''; |
|
|
|
@ -28,7 +36,7 @@ const ResourceWorker = ({ params, ...props }) => {
|
|
|
|
|
hierarchy = props.hierarchy; |
|
|
|
|
user_name = props.user_name; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const location = useLocation(); |
|
|
|
|
const HEADER = { |
|
|
|
|
headers: { |
|
|
|
|
"Content-Type": "application/json", |
|
|
|
@ -547,14 +555,29 @@ const ResourceWorker = ({ params, ...props }) => {
|
|
|
|
|
key: 'x', |
|
|
|
|
render: (text, record) => <> |
|
|
|
|
<Tooltip title={t('edit')}> |
|
|
|
|
<Button size="small" type="link" style={{ color: 'orange' }} onClick={() => handleEdit(text)}><i className="fa fa-edit"></i></Button> |
|
|
|
|
{ |
|
|
|
|
checkActMenup(location.pathname, 'update') ? |
|
|
|
|
<i size="small" type="link" style={{ color: 'green', marginRight: '5px', cursor: "pointer" }} onClick={() => handleEdit(text)} className="fa fa-edit"></i> |
|
|
|
|
: |
|
|
|
|
null |
|
|
|
|
} |
|
|
|
|
</Tooltip> |
|
|
|
|
|
|
|
|
|
<Tooltip title={t('delete')}> |
|
|
|
|
<Button size="small" type="link" style={{ color: 'red' }} onClick={() => handleDelete(text.id)}><i className="fa fa-trash"></i></Button> |
|
|
|
|
{ |
|
|
|
|
checkActMenup(location.pathname, 'delete') ? |
|
|
|
|
<i size="small" type="link" style={{ color: 'red', marginRight: '5px', cursor: "pointer" }} onClick={() => handleDelete(text.id)} className="fa fa-trash"></i> |
|
|
|
|
: |
|
|
|
|
null |
|
|
|
|
} |
|
|
|
|
</Tooltip> |
|
|
|
|
<Tooltip title="Set User"> |
|
|
|
|
<Button size="small" type="link" style={{ color: 'lightblue' }} onClick={() => handleSetWorker(text)}><i className="fa fa-key"></i></Button> |
|
|
|
|
{ |
|
|
|
|
checkActMenup(location.pathname, 'update') ? |
|
|
|
|
<i Button size="small" type="link" style={{ color: 'blue', marginRight: '4px', cursor: "pointer" }} onClick={() => handleSetWorker(text)} className="fa fa-key"></i> |
|
|
|
|
: |
|
|
|
|
null |
|
|
|
|
} |
|
|
|
|
</Tooltip> |
|
|
|
|
</>, |
|
|
|
|
}, |
|
|
|
@ -638,7 +661,12 @@ const ResourceWorker = ({ params, ...props }) => {
|
|
|
|
|
</Col> |
|
|
|
|
<Col> |
|
|
|
|
<Tooltip title={t('hradd')}> |
|
|
|
|
{ |
|
|
|
|
checkActMenup(location.pathname, 'create') ? |
|
|
|
|
<Button style={{ background: "#4caf50", color: "#fff" }} onClick={() => handleOpenDialog('Save')}><i className="fa fa-plus"></i></Button> |
|
|
|
|
: |
|
|
|
|
null |
|
|
|
|
} |
|
|
|
|
</Tooltip> |
|
|
|
|
<Tooltip title={t('exportExcel')}> |
|
|
|
|
<Button style={{ marginLeft: "5px" }} onClick={() => handleExportExcel()}><i className="fa fa-print"></i></Button> |
|
|
|
|