Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gantt
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨子
vue-gantt
Commits
81746952
Commit
81746952
authored
Jun 17, 2022
by
杨子
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
472d2f46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
GanttView.vue
src/components/GanttView.vue
+16
-15
No files found.
src/components/GanttView.vue
View file @
81746952
...
@@ -10,9 +10,10 @@
...
@@ -10,9 +10,10 @@
:placeholder="['开始时间', '结束时间']" allowClear @change="onRangeChange" />
:placeholder="['开始时间', '结束时间']" allowClear @change="onRangeChange" />
</div>
</div>
<div
style=
"padding: 0 24px;"
>
<div
style=
"padding: 0 24px;"
>
<el-slider
v-model=
"sliderValue"
:min=
"minSliderValue"
:max=
"maxSliderValue"
:format-tooltip=
"formatTooltip"
range
@
change=
"onSliderChange"
></el-slider>
<el-slider
v-model=
"sliderValue"
:min=
"minSliderValue"
:max=
"maxSliderValue"
:format-tooltip=
"formatTooltip"
range
@
change=
"onSliderChange"
></el-slider>
</div>
</div>
<g-gantt-chart
:chart-start=
"chartStart"
:chart-end=
"chartEnd"
precision=
"minute"
:minuteInterval=
"interval"
<g-gantt-chart
:chart-start=
"chartStart"
:chart-end=
"chartEnd"
precision=
"minute"
:minuteInterval=
"interval"
:row-height=
"40"
grid
width=
"100%"
bar-start=
"beginProcessDate"
bar-end=
"endProcessDate"
:date-format=
"format"
>
:row-height=
"40"
grid
width=
"100%"
bar-start=
"beginProcessDate"
bar-end=
"endProcessDate"
:date-format=
"format"
>
<template
v-for=
"item in contree"
:key=
"item.helicopterInfoDTO.id"
>
<template
v-for=
"item in contree"
:key=
"item.helicopterInfoDTO.id"
>
...
@@ -35,18 +36,18 @@ import { ElSelect, ElMessage, ElSelectV2, ElButton, ElSlider } from "element-plu
...
@@ -35,18 +36,18 @@ import { ElSelect, ElMessage, ElSelectV2, ElButton, ElSlider } from "element-plu
import
httpRequest
from
'@/utils/httpRequest.js'
import
httpRequest
from
'@/utils/httpRequest.js'
import
dayjs
,
{
Dayjs
}
from
'dayjs'
;
import
dayjs
,
{
Dayjs
}
from
'dayjs'
;
import
{
computed
}
from
"@vue/reactivity"
;
import
{
computed
}
from
"@vue/reactivity"
;
const
sliderValue
=
ref
<
[
number
,
number
]
>
([
0
,
100
])
const
sliderValue
=
ref
<
[
number
,
number
]
>
([
0
,
100
])
const
minSliderValue
=
ref
()
const
minSliderValue
=
ref
()
const
maxSliderValue
=
ref
()
const
maxSliderValue
=
ref
()
const
onSliderChange
=
()
=>
{
const
onSliderChange
=
()
=>
{
const
[
min
,
max
]
=
sliderValue
.
value
const
[
min
,
max
]
=
sliderValue
.
value
chartStart
.
value
=
dayjs
(
min
).
format
(
'YYYY-MM-DD HH:mm'
)
chartStart
.
value
=
dayjs
(
min
).
format
(
'YYYY-MM-DD HH:mm'
)
chartEnd
.
value
=
dayjs
(
max
).
format
(
'YYYY-MM-DD HH:mm'
)
chartEnd
.
value
=
dayjs
(
max
).
format
(
'YYYY-MM-DD HH:mm'
)
}
}
const
formatTooltip
=
(
value
:
number
)
=>
{
const
formatTooltip
=
(
value
:
number
)
=>
{
return
dayjs
(
value
).
format
(
'YYYY-MM-DD HH:mm'
)
return
dayjs
(
value
).
format
(
'YYYY-MM-DD HH:mm'
)
}
}
const
optionList
=
[
const
optionList
=
[
...
@@ -84,10 +85,10 @@ const onRangeChange = (value: [Dayjs, Dayjs], dateString: [string, string]) => {
...
@@ -84,10 +85,10 @@ const onRangeChange = (value: [Dayjs, Dayjs], dateString: [string, string]) => {
}
}
};
};
const
getRandomColor
=
function
()
{
const
getRandomColor
=
function
()
{
return
'#'
+
(
function
(
color
)
{
const
r
=
Math
.
floor
(
Math
.
random
()
*
255
);
return
(
color
+=
'0123456789abcdef'
[
Math
.
floor
(
Math
.
random
()
*
16
)])
const
g
=
Math
.
floor
(
Math
.
random
()
*
255
);
&&
(
color
.
length
==
6
)
?
color
:
arguments
.
callee
(
color
);
const
b
=
Math
.
floor
(
Math
.
random
()
*
255
);
})(
''
)
;
return
'rgba('
+
r
+
','
+
g
+
','
+
b
+
', 1)'
;
}
}
const
baseUrl
=
'/task/helicopterTask/getGanttInfo?id='
+
sessionStorage
.
getItem
(
'taskResultId'
)
+
"&token="
+
sessionStorage
.
getItem
(
'token'
)
const
baseUrl
=
'/task/helicopterTask/getGanttInfo?id='
+
sessionStorage
.
getItem
(
'taskResultId'
)
+
"&token="
+
sessionStorage
.
getItem
(
'token'
)
...
@@ -158,9 +159,9 @@ const formatter = (processesList: any[]) => {
...
@@ -158,9 +159,9 @@ const formatter = (processesList: any[]) => {
const
filterValues
=
processesList
.
filter
((
v
,
i
)
=>
i
!=
index
)
const
filterValues
=
processesList
.
filter
((
v
,
i
)
=>
i
!=
index
)
for
(
const
value
of
filterValues
)
{
for
(
const
value
of
filterValues
)
{
if
(
current
.
begin
>=
value
.
begin
&&
current
.
begin
<
value
.
end
)
{
if
(
current
.
begin
>=
value
.
begin
&&
current
.
begin
<
value
.
end
)
{
if
(
!
value
.
ganttBarConfig
.
isCover
)
{
if
(
!
value
.
ganttBarConfig
.
isCover
)
{
top
=
0
top
=
0
}
}
top
++
top
++
current
.
ganttBarConfig
.
isCover
=
true
current
.
ganttBarConfig
.
isCover
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment