|
|
|
@ -11,18 +11,30 @@ import { Fab, Action } from "react-tiny-fab";
|
|
|
|
|
import "react-tiny-fab/dist/styles.css"; |
|
|
|
|
import { useHistory } from "react-router-dom"; |
|
|
|
|
import GanttFrame from "./GanttFrame"; |
|
|
|
|
const token = localStorage.getItem("token"); |
|
|
|
|
const userId = parseInt(localStorage.getItem("user_id")); |
|
|
|
|
|
|
|
|
|
let roCount = 0; |
|
|
|
|
|
|
|
|
|
const Gantt = (props) => { |
|
|
|
|
let role_id = '', userId='',isLogin='',token=''; |
|
|
|
|
if (props.location.state && props.location.state.role_id && props.location.state.user_id) { |
|
|
|
|
role_id = props.location.state.role_id; |
|
|
|
|
userId = props.location.state.user_id; |
|
|
|
|
token = props.location.state.token; |
|
|
|
|
isLogin = props.location.state.isLogin; |
|
|
|
|
console.log('props.location.state success'); |
|
|
|
|
} else { |
|
|
|
|
role_id = localStorage.getItem("role_id"); |
|
|
|
|
userId = localStorage.getItem("user_id"); |
|
|
|
|
token = localStorage.getItem("token"); |
|
|
|
|
isLogin = localStorage.getItem("isLogin"); |
|
|
|
|
console.error('Undefined in props.location.state'); |
|
|
|
|
} |
|
|
|
|
const HEADER = { |
|
|
|
|
headers: { |
|
|
|
|
"Content-Type": "application/json", |
|
|
|
|
Authorization: `Bearer ${token}`, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
let roCount = 0; |
|
|
|
|
|
|
|
|
|
const Gantt = (props) => { |
|
|
|
|
const versionGanttId = props.match.params ? props.match.params.id : 0; |
|
|
|
|
const idProject = props.match.params.project ? props.match.params.project : 0; |
|
|
|
|
const timestamp = props.match.params.timestamp |
|
|
|
|