mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-02 03:02:19 +08:00
feat: gantt process handle
This commit is contained in:
parent
24cf984191
commit
5328136da2
@ -140,7 +140,6 @@ export const useGanttBlockProps = () => {
|
||||
const ctx = useGanttBlockContext();
|
||||
const [tasks, setTasks] = useState([]);
|
||||
const onExpanderClick = (task: any) => {
|
||||
console.log(tasks, task);
|
||||
setTasks(tasks.map((t) => (t.id === task.id ? task : t)));
|
||||
};
|
||||
useEffect(() => {
|
||||
|
@ -1,6 +1,4 @@
|
||||
import React from 'react';
|
||||
import { cx } from '@emotion/css';
|
||||
import { barHandle } from './style';
|
||||
|
||||
type BarDateHandleProps = {
|
||||
x: number;
|
||||
@ -17,7 +15,7 @@ export const BarDateHandle: React.FC<BarDateHandleProps> = ({ x, y, width, heigh
|
||||
y={y}
|
||||
width={width}
|
||||
height={height}
|
||||
className={cx(barHandle)}
|
||||
className={'barHandle'}
|
||||
ry={barCornerRadius}
|
||||
rx={barCornerRadius}
|
||||
onMouseDown={onMouseDown}
|
||||
|
@ -1,20 +1,9 @@
|
||||
import React from "react";
|
||||
import { cx } from '@emotion/css';
|
||||
import { barHandle } from './style';
|
||||
import React from 'react';
|
||||
|
||||
type BarProgressHandleProps = {
|
||||
progressPoint: string;
|
||||
onMouseDown: (event: React.MouseEvent<SVGPolygonElement, MouseEvent>) => void;
|
||||
};
|
||||
export const BarProgressHandle: React.FC<BarProgressHandleProps> = ({
|
||||
progressPoint,
|
||||
onMouseDown,
|
||||
}) => {
|
||||
return (
|
||||
<polygon
|
||||
className={cx(barHandle)}
|
||||
points={progressPoint}
|
||||
onMouseDown={onMouseDown}
|
||||
/>
|
||||
);
|
||||
export const BarProgressHandle: React.FC<BarProgressHandleProps> = ({ progressPoint, onMouseDown }) => {
|
||||
return <polygon className={'barHandle'} points={progressPoint} onMouseDown={onMouseDown} />;
|
||||
};
|
||||
|
@ -3,18 +3,18 @@ import { css } from '@emotion/css';
|
||||
export const barWrapper = css`
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
.barHandle{
|
||||
fill: #ddd;
|
||||
cursor: ew-resize;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
&:hover .barHandle {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
`;
|
||||
|
||||
export const barHandle = css`
|
||||
fill: #ddd;
|
||||
cursor: ew-resize;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
`;
|
||||
|
||||
export const barBackground = css`
|
||||
user-select: none;
|
||||
|
Loading…
x
Reference in New Issue
Block a user