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
b52cf1a6
Commit
b52cf1a6
authored
Mar 05, 2021
by
王鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 任务进度优化
parent
77e3ad9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
38 deletions
+59
-38
TaskProgress.vue
src/views/progress/TaskProgress.vue
+59
-38
No files found.
src/views/progress/TaskProgress.vue
View file @
b52cf1a6
...
@@ -13,6 +13,19 @@
...
@@ -13,6 +13,19 @@
<!--
<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>
-->
<div
style=
"margin-top: 20px"
>
<a-pagination
@
change=
"pageChange"
:defaultPageSize=
"defaultPageSize"
@
showSizeChange=
"sizeChange"
class=
"cust-pagination"
size=
"small"
:total=
"total"
showSizeChanger
showQuickJumper
:showTotal=
"$showTotal"
/>
</div>
</a-card>
</a-card>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -148,7 +161,9 @@ export default {
...
@@ -148,7 +161,9 @@ export default {
tasks
,
tasks
,
options
,
options
,
dynamicStyle
:
{},
dynamicStyle
:
{},
lastId
:
16
lastId
:
16
,
defaultPageSize
:
10
,
total
:
20
}
}
},
},
methods
:
{
methods
:
{
...
@@ -166,43 +181,43 @@ export default {
...
@@ -166,43 +181,43 @@ export default {
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
let
respData
=
response
.
data
;
let
respData
=
response
.
data
;
let
taskList
=
[];
let
taskList
=
[];
console
.
log
(
respData
)
for
(
const
respDataKey
in
respData
)
{
// for (const respDataKey in respData) {
let
day
=
this
.
GetNumberOfDays
(
new
Date
(),
respData
[
respDataKey
].
begin
);
// let day = this.GetNumberOfDays(new Date(),respDataKey.begin
);
let
duration
=
this
.
GetNumberOfDays
(
respData
[
respDataKey
].
begin
,
respData
[
respDataKey
].
end
);
// let duration = this.GetNumberOfDays(respDataKey.begin,respDataKey.end);
// 父元素
// // 父元素
if
(
respData
[
respDataKey
].
parentId
===
null
){
// if(respDataKey.parentId == null)
{
taskList
.
push
(
{
// taskList.push({
id
:
respData
[
respDataKey
].
id
,
// id: respDataKey.id
,
name
:
respData
[
respDataKey
].
name
,
// name: respDataKey.name
,
user
:
''
,
// user: ''
,
start
:
getDate
(
24
*
day
)
,
// start: getDate(24 * day)
,
duration
:
duration
*
24
*
60
*
60
*
1000
,
// duration: duration * 24 * 60 * 60 * 1000
,
percent
:
85
,
// percent: 85,
type
:
"project"
// type: "project"
})
// })
// 子元素
// // 子元素
}
else
{
// }else
{
taskList
.
push
(
{
// taskList.push({
id
:
respData
[
respDataKey
].
id
,
// id: respDataKey.id
,
name
:
""
,
// name: ""
,
user
:
'<span style=
\'
color:#1eb0bc
\'
>'
+
respData
[
respDataKey
].
name
+
'</span>'
,
// user:'
<
span
style
=
\
'color:#1eb0bc
\'
>'
+
respDataKey
.
name
+
'</span>'
,
parentId
:
respData
[
respDataKey
].
parentId
,
// parentId: respDataKey.parentId
,
start
:
getDate
(
24
*
day
)
,
// start: getDate(24 * day)
,
duration
:
duration
*
24
*
60
*
60
*
1000
,
// duration: duration * 24 * 60 * 60 * 100
0,
percent
:
5
0
,
// percent: 50
,
type
:
"milestone"
,
// type: "milestone"
,
collapsed
:
true
,
// collapsed: true,
style
:
{
// styl
e: {
bas
e
:
{
// base: {
fill
:
"#1EBC61"
,
// fill: "#1EBC61",
stroke
:
"#0EAC51"
// stroke: "#0EAC51"
}
//
}
}
// }
})
// })
}
// }
//
}
// }
this
.
tasks
=
taskList
}
}
});
});
},
},
...
@@ -212,6 +227,12 @@ export default {
...
@@ -212,6 +227,12 @@ export default {
let
a2
=
Date
.
parse
(
new
Date
(
date2
));
let
a2
=
Date
.
parse
(
new
Date
(
date2
));
let
day
=
parseInt
((
a2
-
a1
)
/
(
1000
*
60
*
60
*
24
));
//核心:时间戳相减,然后除以天数
let
day
=
parseInt
((
a2
-
a1
)
/
(
1000
*
60
*
60
*
24
));
//核心:时间戳相减,然后除以天数
return
day
return
day
},
pageChange
(){
},
sizeChange
(){
}
}
},
},
mounted
()
{
mounted
()
{
...
...
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