-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8eac017
commit 36c32c8
Showing
11 changed files
with
128 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { useStore } from '@/store'; | ||
import useGanttWidth from './useGanttWidth'; | ||
import useTableWidth from './useTableWidth'; | ||
|
||
export default () => { | ||
const store = useStore(); | ||
const { ganttColumnWidth } = useGanttWidth(); | ||
const { tableWidth } = useTableWidth(); | ||
|
||
// 设置甘特日期头 | ||
function setGanttHeaders() { | ||
store.ganttHeader.setDate( | ||
// 使用 window 的宽度减去 table 的宽度,就是最小需要的列数,再加一个阈值即可 | ||
(window.innerWidth - tableWidth.value) / ganttColumnWidth.value + 5, | ||
store.$data.start, | ||
store.$data.end, | ||
store.$styleBox.unit | ||
); | ||
} | ||
|
||
return { | ||
setGanttHeaders, | ||
ganttHeader: store.ganttHeader | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
declare type HeaderDateUnit = 'week' | 'day' | 'hour' | 'minute' | 'second'; | ||
declare type HeaderDateUnit = 'week' | 'day' | 'hour' | 'minute'; | ||
|
||
declare type DateUnit = 'year' | 'month' | HeaderDateUnit | 'millisecond'; | ||
declare type DateUnit = | ||
| 'year' | ||
| 'month' | ||
| HeaderDateUnit | ||
| 'millisecond' | ||
| 'second'; |