表头传入tasks,方便表头显示项目名称;修复按键和样式问题;

This commit is contained in:
suntao 2022-12-16 15:08:58 +08:00
parent fabcdfb732
commit 9417ee6e11
5 changed files with 10722 additions and 2 deletions

View File

@ -3,6 +3,8 @@
font-size: 0; font-size: 0;
margin: 0; margin: 0;
padding: 0; padding: 0;
display: flex;
flex-direction: column;
} }
.horizontalContainer { .horizontalContainer {

View File

@ -322,6 +322,12 @@ export const Gantt: React.FunctionComponent<GanttProps> = ({
* Handles arrow keys events and transform it to new scroll * Handles arrow keys events and transform it to new scroll
*/ */
const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => { const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {
// console.log(event);
//console.log((event.target as HTMLElement).nodeName);
if(event.code === 'F5') return;
if(event.code === 'ControlLeft' || event.code === "KeyR") return;
if((event.target as HTMLElement).nodeName === 'INPUT') return;
event.preventDefault(); event.preventDefault();
let newScrollY = scrollY; let newScrollY = scrollY;
let newScrollX = scrollX; let newScrollX = scrollX;

View File

@ -1,7 +1,8 @@
.barLabel { .barLabel {
fill: #fff; fill: #fff;
text-anchor: middle; text-anchor: middle;
font-weight: lighter; /* font-weight: lighter; */
font-weight: 400;
dominant-baseline: central; dominant-baseline: central;
-webkit-touch-callout: none; -webkit-touch-callout: none;
-webkit-user-select: none; -webkit-user-select: none;

View File

@ -22,6 +22,7 @@ export type TaskListProps = {
rowWidth: string; rowWidth: string;
fontFamily: string; fontFamily: string;
fontSize: string; fontSize: string;
tasks: Task[];
}>; }>;
TaskListTable: React.FC<{ TaskListTable: React.FC<{
rowHeight: number; rowHeight: number;
@ -60,12 +61,13 @@ export const TaskList: React.FC<TaskListProps> = ({
horizontalContainerRef.current.scrollTop = scrollY; horizontalContainerRef.current.scrollTop = scrollY;
} }
}, [scrollY]); }, [scrollY]);
const headerProps = { const headerProps = {
headerHeight, headerHeight,
fontFamily, fontFamily,
fontSize, fontSize,
rowWidth, rowWidth,
tasks,
}; };
const selectedTaskId = selectedTask ? selectedTask.id : ""; const selectedTaskId = selectedTask ? selectedTask.id : "";
const tableProps = { const tableProps = {

10709
yarn.lock Normal file

File diff suppressed because it is too large Load Diff