Browse Source

update cluster directory

pull/1/head
wahyun 7 months ago
parent
commit
a06e4d2f22
  1. 8
      src/views/MapMonitoring/index.js
  2. 8
      src/views/Report/k3/DialogForm.js
  3. 7
      src/views/Report/k3/index.js
  4. 9
      src/views/SimproV2/CreatedProyek/ImportActivity/index.js
  5. 13
      src/views/SimproV2/Presence/DialogFoto.js
  6. 8
      src/views/SimproV2/Presence/index.js

8
src/views/MapMonitoring/index.js

@ -15,7 +15,7 @@ import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import './MapMonitoring.css';
import { BASE_SIMPRO_LUMEN_IMAGE, PROYEK_SEARCH } from '../../const/ApiConst';
import { BASE_SIMPRO_LUMEN_IMAGE_COMPANY } from '../../const/ApiConst';
import DEFAULT_USER_ICON from '../../assets/img/avatars/user.png';
import pinRouteStart from '../../assets/img/map/pin_route_green.png';
import pinRouteEnd from '../../assets/img/map/pin_route_red.png';
@ -27,8 +27,9 @@ import 'leaflet-control-geocoder/dist/Control.Geocoder.css'
import 'leaflet-control-geocoder/dist/Control.Geocoder.js'
import moment from 'moment';
import axios from "../../const/interceptorApi";
const MapMonitoring = ({ ...props }) => {
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name='', hierarchy=[], user_name='';
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name='', hierarchy=[], user_name='', configApp={};
if (props && props.role_id && props.user_id) {
role_id = props.role_id;
user_id = props.user_id;
@ -40,6 +41,7 @@ const MapMonitoring = ({ ...props }) => {
isLogin = props.isLogin;
hierarchy = props.hierarchy;
user_name = props.user_name;
configApp = props.configApp;
}
const HEADER = {
headers: {
@ -223,7 +225,7 @@ const MapMonitoring = ({ ...props }) => {
const pointToLayerUserPoints = (feature, latlng) => {
let imgSrc = DEFAULT_USER_ICON;
if (feature && feature.properties && feature.properties.image && feature.properties.image !== '') {
imgSrc = `${BASE_SIMPRO_LUMEN_IMAGE}/${feature.properties.image}`
imgSrc = `${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(feature.properties.image, JSON.parse(configApp).company_name, moment(feature.properties.created_at).format('YYYY-MM'))}`
}
let img = `<img src="${imgSrc}" />`
let logoMarker = L.divIcon({

8
src/views/Report/k3/DialogForm.js

@ -3,7 +3,9 @@ import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { Button, Form, FormGroup, Label, Input } from 'reactstrap';
import { Image, Col, Row } from 'antd';
import 'antd/dist/antd.css';
import { BASE_SIMPRO_LUMEN_IMAGE } from '../../../const/ApiConst.js';
import { BASE_SIMPRO_LUMEN_IMAGE_COMPANY } from '../../../const/ApiConst.js';
import moment from 'moment';
export default class DialogForm extends Component {
constructor(props) {
super(props)
@ -43,7 +45,7 @@ export default class DialogForm extends Component {
}
renderForm = () => {
const { dataImage } = this.props;
const { dataImage, companyName } = this.props;
return(
<div style={{justifyContent:'center'}}>
<Row gutter={[16, 16]}>
@ -53,7 +55,7 @@ export default class DialogForm extends Component {
<Col span={8}>
<Image
style={{width: 150, height: 200}}
src={`${BASE_SIMPRO_LUMEN_IMAGE}/${item.image}`}
src={`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(item?.image, companyName, moment(item?.created_at).format('YYYY-MM'))}`}
/>
</Col>
)

7
src/views/Report/k3/index.js

@ -9,7 +9,7 @@ import { NotificationContainer, NotificationManager } from 'react-notifications'
import { Pagination, Tooltip } from 'antd';
import { DatePicker, Select } from 'antd';
import * as XLSX from 'xlsx';
import { PRESENSI_SEARCH, PROYEK_SEARCH, USERPROYEK_SEARCH, K3_SEARCH, SIMPRO_BASE_IMAGE } from '../../../const/ApiConst.js';
import { PROYEK_SEARCH, K3_SEARCH } from '../../../const/ApiConst.js';
import { withTranslation } from 'react-i18next';
const { RangePicker } = DatePicker;
const { Option } = Select
@ -26,7 +26,7 @@ const LENGTH_DATA = 10
class index extends Component {
constructor(props) {
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '';
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '', configApp={};
if (props && props.role_id && props.user_id) {
role_id = props.role_id;
user_id = props.user_id;
@ -38,6 +38,7 @@ class index extends Component {
isLogin = props.isLogin;
hierarchy = props.hierarchy;
user_name = props.user_name;
configApp = props.configApp;
}
super(props)
this.config = {
@ -77,6 +78,7 @@ class index extends Component {
finishSetupOption: false,
company_id: company_id,
role_name: role_name,
companyName: JSON.parse(configApp).company_name,
role_id: role_id,
hierarchy: hierarchy
}
@ -583,6 +585,7 @@ class index extends Component {
closeDialog={this.handleCloseDialog}
toggleDialog={() => this.toggleAddDialog}
dataImage={this.state.dataImage}
companyName={this.state.companyName}
showDialog={showDialog => this.showChildDialog = showDialog}
/>
<Card>

9
src/views/SimproV2/CreatedProyek/ImportActivity/index.js

@ -150,9 +150,6 @@ const ImportActivity = ({ params }) => {
setLoading(false)
NotificationManager.error('file harus dalam format .xlsx', 'Failed');
}
// else{
// errorHandler()
// }
return false
}
@ -234,7 +231,7 @@ const ImportActivity = ({ params }) => {
const saveHandler = async (e) => {
setIsMovePage(true);
setLoading(true);
let url = window.location.href;
let urlSplitted = url.split('/')
const ganttId = urlSplitted[5]
@ -254,9 +251,9 @@ const ImportActivity = ({ params }) => {
if (result.data.code == 200) {
const timestamp = Date.now();
const newTimestamp = timestamp + 60000;
window.location = urlSplitted[0] + '//' + urlSplitted[2] + `/#/projects/` + ganttId + '/' + result.data.projectId + '/' + newTimestamp + '/gantt'
setLoading(false)
}else{
window.location = urlSplitted[0] + '//' + urlSplitted[2] + `/#/projects/` + ganttId + '/' + result.data.projectId + '/' + newTimestamp + '/gantt'
} else {
setLoading(false)
}
setLoading(false)

13
src/views/SimproV2/Presence/DialogFoto.js

@ -2,20 +2,25 @@ import React, { useEffect, useState } from 'react'
import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { Button } from 'reactstrap';
import { Image } from 'antd'
import { BASE_SIMPRO_LUMEN_IMAGE } from '../../../const/ApiConst';
import { BASE_SIMPRO_LUMEN_IMAGE_COMPANY } from '../../../const/ApiConst';
import 'antd/dist/antd.css';
import { useTranslation } from 'react-i18next';
import moment from 'moment';
const DialogFoto = ({ openDialog, closeDialog, toggleDialog, dataImage }) => {
const DialogFoto = ({ openDialog, closeDialog, toggleDialog, dataImage, configApp, role_name }) => {
const [urlImage, setUrlImage] = useState("")
const [dateImage, setDateImage] = useState("")
const [companyName, setCompanyName] = useState("")
const [dataReady, setDataReady] = useState(false)
const [hrName, setHrName] = useState(false)
const { t } = useTranslation()
useEffect(() => {
if (dataImage && dataImage != null) {
setCompanyName(role_name !== "Super Admin" ? JSON.parse(configApp).company_name : "undifined");
setUrlImage(dataImage.url);
setDateImage(dataImage.date);
setHrName(dataImage.name);
setDataReady(true)
}
@ -35,7 +40,7 @@ const DialogFoto = ({ openDialog, closeDialog, toggleDialog, dataImage }) => {
<div style={{ width: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<Image
width={200}
src={`${BASE_SIMPRO_LUMEN_IMAGE}/${urlImage}`}
src={`${BASE_SIMPRO_LUMEN_IMAGE_COMPANY(urlImage, companyName, moment(dateImage).format('YYYY-MM'))}`}
/>
</div>
</div>

8
src/views/SimproV2/Presence/index.js

@ -12,7 +12,7 @@ import { useTranslation } from 'react-i18next';
const { RangePicker } = DatePicker;
const Index = ({ params, ...props }) => {
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '';
let role_id = 0, user_id = 0, isLogin = false, token = '', company_id = 0, all_project = null, role_name = '', hierarchy = [], user_name = '', configApp = {};
if (props && props.role_id && props.user_id) {
role_id = props.role_id;
user_id = props.user_id;
@ -24,6 +24,7 @@ const Index = ({ params, ...props }) => {
isLogin = props.isLogin;
hierarchy = props.hierarchy;
user_name = props.user_name;
configApp = props.configApp;
}
const [dataTable, setDatatable] = useState([])
@ -129,7 +130,8 @@ const Index = ({ params, ...props }) => {
let dataRes = result.data.data
let dataImage = {
name,
url: dataRes.image
url: dataRes.image,
date: dataRes.created_at
}
await setDataImage(dataImage)
setOpenImage(true)
@ -321,6 +323,8 @@ const Index = ({ params, ...props }) => {
closeDialog={closeDialogImage}
toggleDialog={toggleDialogImage}
dataImage={dataImage}
configApp={configApp}
role_name={role_name}
/>
<Card>
<CardHeader style={{ display: "flex", justifyContent: "space-between" }}>

Loading…
Cancel
Save