Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zentao-view
Project
Project
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
zentao
zentao-view
Commits
642d62e4
Commit
642d62e4
authored
Mar 04, 2021
by
王鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 进程管理数据接入
parent
8d2b166b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
64 deletions
+75
-64
progress.js
src/api/progress/progress.js
+15
-0
TaskProgress.vue
src/views/progress/TaskProgress.vue
+60
-64
No files found.
src/api/progress/progress.js
0 → 100644
View file @
642d62e4
import
{
axios
}
from
'@/util/axios/request'
const
api
=
{
getList
:
'/progress/list'
,
}
export
default
api
export
function
getList
()
{
return
axios
({
url
:
api
.
getList
,
method
:
'get'
,
useFullLoading
:
true
})
}
\ No newline at end of file
src/views/progress/TaskProgress.vue
View file @
642d62e4
<
template
>
<
template
>
<a-card
class=
"cust-list-cart"
>
<a-card
class=
"cust-list-cart"
>
<q-page
class=
"q-pa-sm"
>
<!--
<q-page
class=
"q-pa-sm"
>
--
>
<gantt-elastic
<gantt-elastic
:options=
"options"
:options=
"options"
:tasks=
"tasks"
:tasks=
"tasks"
...
@@ -12,13 +12,14 @@
...
@@ -12,13 +12,14 @@
</gantt-elastic>
</gantt-elastic>
<!--
<div
class=
"q-mt-md"
/>
-->
<!--
<div
class=
"q-mt-md"
/>
-->
<!--
<q-btn
@
click=
"addTask"
icon=
"mdi-plus"
label=
"Add tas k"
/>
-->
<!--
<q-btn
@
click=
"addTask"
icon=
"mdi-plus"
label=
"Add tas k"
/>
-->
</q-page
>
<!--
</q-page>
--
>
</a-card>
</a-card>
</
template
>
</
template
>
<
script
>
<
script
>
import
GanttElastic
from
"gantt-elastic"
;
import
GanttElastic
from
"gantt-elastic"
;
import
GanttHeader
from
"gantt-elastic-header"
;
import
GanttHeader
from
"gantt-elastic-header"
;
import
{
getList
}
from
"@api/progress/progress"
;
// just helper to get current dates
// just helper to get current dates
function
getDate
(
hours
)
{
function
getDate
(
hours
)
{
...
@@ -39,7 +40,7 @@ function getDate(hours) {
...
@@ -39,7 +40,7 @@ function getDate(hours) {
let
tasks
=
[
let
tasks
=
[
{
{
id
:
1
,
id
:
1
,
name
:
"任务
1
"
,
name
:
"任务"
,
user
:
''
,
user
:
''
,
start
:
getDate
(
-
24
*
5
),
start
:
getDate
(
-
24
*
5
),
duration
:
15
*
24
*
60
*
60
*
1000
,
duration
:
15
*
24
*
60
*
60
*
1000
,
...
@@ -64,67 +65,7 @@ let tasks = [
...
@@ -64,67 +65,7 @@ let tasks = [
}
}
}
}
},
},
{
id
:
3
,
name
:
""
,
user
:
'<span style=
\'
color:#1eb0bc
\'
>商天翔</span>'
,
parentId
:
1
,
start
:
getDate
(
4
),
duration
:
4
*
24
*
60
*
60
*
1000
,
percent
:
50
,
type
:
"milestone"
,
collapsed
:
true
,
style
:
{
base
:
{
fill
:
"#1EBC61"
,
stroke
:
"#0EAC51"
}
}
},
{
id
:
4
,
name
:
"任务2"
,
user
:
''
,
start
:
getDate
(
-
24
*
30
),
duration
:
15
*
24
*
60
*
60
*
1000
,
percent
:
85
,
type
:
"project"
//collapsed: true,
},
{
id
:
5
,
name
:
""
,
user
:
'<span style=
\'
color:#1eb0bc
\'
>王鑫</span>'
,
parentId
:
4
,
start
:
getDate
(
-
24
*
30
),
duration
:
4
*
24
*
60
*
60
*
1000
,
percent
:
50
,
type
:
"milestone"
,
collapsed
:
true
,
style
:
{
base
:
{
fill
:
"#1EBC61"
,
stroke
:
"#0EAC51"
}
}
},
{
id
:
6
,
name
:
""
,
user
:
'<span style=
\'
color:#1eb0bc
\'
>商天翔</span>'
,
parentId
:
4
,
start
:
getDate
(
-
24
*
25
),
duration
:
4
*
24
*
60
*
60
*
1000
,
percent
:
50
,
type
:
"milestone"
,
collapsed
:
true
,
style
:
{
base
:
{
fill
:
"#1EBC61"
,
stroke
:
"#0EAC51"
}
}
},
];
];
let
options
=
{
let
options
=
{
taskMapping
:
{
taskMapping
:
{
...
@@ -219,7 +160,62 @@ export default {
...
@@ -219,7 +160,62 @@ export default {
},
},
styleUpdate
(
style
)
{
styleUpdate
(
style
)
{
this
.
dynamicStyle
=
style
;
this
.
dynamicStyle
=
style
;
},
loadData
(){
getList
().
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
let
respData
=
response
.
data
;
let
taskList
=
[];
console
.
log
(
respData
)
// for (const respDataKey in respData) {
// let day = this.GetNumberOfDays(new Date(),respDataKey.begin);
// let duration = this.GetNumberOfDays(respDataKey.begin,respDataKey.end);
// // 父元素
// if(respDataKey.parentId == null){
// taskList.push({
// id: respDataKey.id,
// name: respDataKey.name,
// user: '',
// start: getDate(24 * day),
// duration: duration * 24 * 60 * 60 * 1000,
// percent: 85,
// type: "project"
// })
// // 子元素
// }else {
// taskList.push({
// id: respDataKey.id,
// name: "",
// user:'
<
span
style
=
\
'color:#1eb0bc
\'
>'
+
respDataKey
.
name
+
'</span>'
,
// parentId: respDataKey.parentId,
// start: getDate(24 * day),
// duration: duration * 24 * 60 * 60 * 1000,
// percent: 50,
// type: "milestone",
// collapsed: true,
// style: {
// base: {
// fill: "#1EBC61",
// stroke: "#0EAC51"
// }
// }
// })
// }
//
// }
}
}
});
},
GetNumberOfDays
(
date1
,
date2
){
// date1:开始日期,date2结束日期
let
a1
=
Date
.
parse
(
new
Date
(
date1
));
let
a2
=
Date
.
parse
(
new
Date
(
date2
));
let
day
=
parseInt
((
a2
-
a1
)
/
(
1000
*
60
*
60
*
24
));
//核心:时间戳相减,然后除以天数
return
day
}
},
mounted
()
{
this
.
loadData
()
}
}
}
}
</
script
>
</
script
>
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