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
8d2b166b
Commit
8d2b166b
authored
Mar 04, 2021
by
shangtx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'shang' into dev
parents
1a3a8156
21cf3069
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
390 additions
and
1 deletion
+390
-1
.eslintrc.js
.eslintrc.js
+2
-1
project.js
src/api/project/project.js
+18
-0
task.js
src/api/task/task.js
+30
-0
TaskEstimateList.vue
src/views/task/taskEstimate/TaskEstimateList.vue
+323
-0
TaskEstimateRouteView.vue
src/views/task/taskEstimate/TaskEstimateRouteView.vue
+17
-0
No files found.
.eslintrc.js
View file @
8d2b166b
...
...
@@ -40,6 +40,7 @@ module.exports = {
"vue/no-use-v-if-with-v-for"
:
0
,
"vue/html-closing-bracket-newline"
:
0
,
"vue/no-parsing-error"
:
0
,
"no-console"
:
0
"no-console"
:
0
,
"vue/max-attributes-per-line"
:
4
}
}
\ No newline at end of file
src/api/project/project.js
0 → 100644
View file @
8d2b166b
import
{
axios
}
from
'@/util/axios/request'
;
const
baseUrl
=
{
// 项目
project
:
'/projects'
,
};
/**
* 可供选择的项目
* @param {*} parameter
*/
export
function
getSelectableProjects
()
{
return
axios
({
url
:
`
${
baseUrl
.
project
}
/selectable`
,
method
:
'get'
})
}
src/api/task/task.js
0 → 100644
View file @
8d2b166b
import
{
axios
}
from
'@/util/axios/request'
;
const
baseUrl
=
{
// 工时
taskEstimate
:
'/task-estimate'
,
};
/**
* 工时列表
* @param {*} parameter
*/
export
function
getPage
(
parameter
)
{
return
axios
({
url
:
`
${
baseUrl
.
taskEstimate
}
/consumed-page`
,
method
:
'post'
,
data
:
parameter
,
useFullLoading
:
true
})
}
/**
* 工时辅助信息
*/
export
function
getAuxiliaryInfo
(
month
)
{
return
axios
({
url
:
`
${
baseUrl
.
taskEstimate
}
/auxiliary-info/
${
month
}
`
,
method
:
'get'
});
}
\ No newline at end of file
src/views/task/taskEstimate/TaskEstimateList.vue
0 → 100644
View file @
8d2b166b
<
template
>
<a-card
class=
"cust-list-cart"
>
<div>
<a-form
layout=
"horizontal"
class=
"ant-advanced-search-form"
>
<div>
<a-row>
<a-col
:span=
"6"
>
<a-form-item
label=
"用户名"
:labelCol=
"
{ span: 8 }"
:wrapperCol="{ span: 16 }"
>
<a-input
@
pressEnter=
"search"
style=
"width: 100%"
v-model=
"query.userName"
placeholder=
"请输入"
/>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
label=
"月份"
:labelCol=
"
{ span: 8 }"
:wrapperCol="{ span: 16 }"
>
<a-month-picker
style=
"width: 100%"
@
change=
"onMonthChange"
:defaultValue=
"moment()"
/>
</a-form-item>
</a-col>
<a-col
:span=
"6"
>
<a-form-item
label=
"项目"
:labelCol=
"
{ span: 8 }"
:wrapperCol="{ span: 16 }"
>
<a-select
show-search
:filter-option=
"projectFilterOption"
:allowClear=
"true"
v-model=
"query.projectId"
:options=
"projectOptions"
@
change=
"projectChange"
/>
</a-form-item>
</a-col>
</a-row>
</div>
</a-form>
</div>
<div>
<a-table
size=
"middle"
@
change=
"sortChange"
:columns=
"reactiveColumns"
:dataSource=
"dataSource"
:pagination=
"false"
rowKey=
"rowKey"
:loading=
"loading"
bordered
class=
"task-consume-table"
>
<div
slot=
"title"
slot-scope=
"data"
>
<span
class=
"cust-title"
>
<a-icon
type=
"hdd"
/>
工时列表
{{
data
.
none
}}
</span>
<div
class=
"cust-table-operator"
>
<a-button-group>
<a-button
type=
"primary"
@
click=
"search"
>
查询
</a-button>
<a-button
@
click=
"reset"
>
重置
</a-button>
</a-button-group>
</div>
</div>
<div
slot=
"footer"
slot-scope=
"data"
>
{{
data
.
none
}}
<a-pagination
@
change=
"pageChange"
:current=
"query.page"
:defaultPageSize=
"defaultPageSize"
:pageSizeOptions=
"$pageSizeOptions"
@
showSizeChange=
"sizeChange"
class=
"cust-pagination"
size=
"small"
:total=
"total"
showSizeChanger
showQuickJumper
:showTotal=
"$showTotal"
/>
</div>
</a-table>
</div>
</a-card>
</
template
>
<
script
>
import
{
getPage
,
getAuxiliaryInfo
}
from
"@/api/task/task"
;
import
{
getSelectableProjects
}
from
"@/api/project/project"
;
import
{
humpToLine
,
setOrder
}
from
"@/util/util"
;
import
moment
from
"moment"
;
import
_
from
"lodash"
;
const
dataSource
=
[];
const
columns
=
[
{
title
:
"姓名"
,
dataIndex
:
"realName"
,
width
:
80
,
customRender
:
(
value
,
row
)
=>
{
const
obj
=
{
children
:
value
,
attrs
:
{},
};
obj
.
attrs
.
rowSpan
=
row
.
rowspan
;
return
obj
;
},
},
{
title
:
"项目"
,
dataIndex
:
"projectName"
,
width
:
200
,
customRender
:
(
value
,
record
)
=>
{
const
obj
=
{
children
:
value
,
attrs
:
{},
};
if
(
record
.
rowKey
.
startsWith
(
"total"
))
{
obj
.
attrs
.
style
=
"font-weight: 600;"
;
}
return
obj
;
},
},
];
const
totalCol
=
{
title
:
"合计"
,
dataIndex
:
"total"
,
align
:
"right"
,
width
:
45
,
customRender
:
(
text
)
=>
({
children
:
_
.
round
(
text
||
0
,
1
),
attrs
:
{
style
:
"font-weight: 500;"
},
}),
};
export
default
{
name
:
"TaskEstimateList"
,
data
()
{
return
{
isFirstLoad
:
true
,
query
:
{
userName
:
""
,
projectId
:
null
,
month
:
moment
().
format
(
"YYYY-MM"
),
sort
:
""
,
page
:
1
,
size
:
10
,
},
month
:
null
,
dayOfTheMonth
:
31
,
total
:
0
,
isEdit
:
false
,
rowKey
:
"id"
,
index
:
-
1
,
loading
:
false
,
columns
:
columns
,
dataSource
:
dataSource
,
moment
,
fixedColums
:
[],
restDays
:
[],
standardConsume
:
8
,
projectOptions
:
[],
};
},
computed
:
{
defaultPageSize
:
function
()
{
return
this
.
$defaultPageSize
();
},
reactiveColumns
()
{
const
dateColumns
=
[];
for
(
let
i
=
1
;
i
<=
this
.
dayOfTheMonth
;
i
++
)
{
dateColumns
.
push
({
title
:
i
,
dataIndex
:
`d
${
i
}
`
,
width
:
40
,
align
:
"right"
,
customRender
:
(
text
,
record
)
=>
{
const
value
=
_
.
round
(
text
||
0
,
1
);
const
obj
=
{
children
:
value
,
attrs
:
{
style
:
"text-align: right;"
,
},
};
if
(
record
.
rowKey
.
startsWith
(
"total"
))
{
obj
.
attrs
.
style
+=
"font-weight: 500;"
;
if
(
!
this
.
restDays
.
includes
(
i
))
{
if
(
value
>
this
.
standardConsume
)
{
obj
.
attrs
.
style
=
obj
.
attrs
.
style
+
"color: blue;"
;
}
if
(
value
<
this
.
standardConsume
)
{
obj
.
attrs
.
style
=
obj
.
attrs
.
style
+
"color: red;"
;
}
}
}
if
(
this
.
restDays
.
includes
(
i
))
{
obj
.
attrs
.
style
=
obj
.
attrs
.
style
+
"background: #9aefb8;"
;
}
return
obj
;
},
});
}
return
columns
.
concat
(
dateColumns
.
concat
(
totalCol
));
},
},
methods
:
{
search
()
{
this
.
query
.
page
=
1
;
this
.
loadData
();
},
reset
()
{
this
.
query
.
userName
=
""
;
this
.
query
.
projectId
=
null
;
this
.
query
.
month
=
moment
().
format
(
"YYYY-MM"
);
this
.
loadData
();
},
projectChange
()
{
this
.
loadData
();
},
pageChange
(
page
)
{
this
.
query
.
page
=
page
;
this
.
loadData
();
},
sizeChange
(
current
,
size
)
{
this
.
query
.
size
=
size
;
this
.
loadData
();
},
loadData
(
pageSize
)
{
if
(
pageSize
&&
!
isNaN
(
pageSize
))
{
this
.
query
.
size
=
pageSize
;
}
this
.
loading
=
true
;
getPage
(
this
.
query
).
then
((
res
)
=>
{
if
(
res
&&
res
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
)
{
this
.
total
=
res
.
data
.
total
;
this
.
dataSource
=
res
.
data
.
list
;
}
this
.
loading
=
false
;
});
getAuxiliaryInfo
(
this
.
query
.
month
).
then
(
({
data
:
[
restDays
,
standardConsume
]
})
=>
{
this
.
restDays
=
restDays
;
this
.
standardConsume
=
standardConsume
;
}
);
},
sortChange
(
pagination
,
filters
,
sorter
)
{
this
.
query
.
sort
=
humpToLine
(
sorter
.
field
);
this
.
query
.
order
=
setOrder
(
sorter
.
order
);
this
.
loadData
();
},
/**
* 筛选项目
*/
projectFilterOption
(
input
,
option
)
{
return
(
option
.
componentOptions
.
children
[
0
].
text
.
toLowerCase
()
.
indexOf
(
input
.
toLowerCase
())
>=
0
);
},
/**
* 月份输入框change事件
*/
onMonthChange
(
date
,
dateString
)
{
// 重新查询数据
this
.
query
.
page
=
1
;
this
.
month
=
date
;
this
.
query
.
month
=
dateString
;
this
.
loadData
();
// 重新计算当月天数
this
.
dayOfTheMonth
=
date
.
daysInMonth
();
},
},
mounted
()
{
getSelectableProjects
().
then
(({
data
})
=>
{
if
(
data
&&
data
.
length
)
{
this
.
projectOptions
=
data
.
map
((
d
)
=>
({
title
:
d
.
name
,
value
:
d
.
id
,
}));
}
});
},
activated
()
{
if
(
this
.
isFirstLoad
==
true
)
{
this
.
loadData
(
this
.
defaultPageSize
);
this
.
isFirstLoad
=
false
;
}
else
{
let
isModify
=
this
.
$route
.
query
.
isModify
;
if
(
isModify
==
true
)
{
this
.
loadData
();
}
else
if
(
isModify
!=
undefined
)
{
this
.
loadData
();
}
}
},
};
</
script
>
<
style
scoped
>
</
style
>
\ No newline at end of file
src/views/task/taskEstimate/TaskEstimateRouteView.vue
0 → 100644
View file @
8d2b166b
<
template
>
<keep-alive
v-if=
"keepAlive"
>
<router-view
/>
</keep-alive>
<router-view
v-else
/>
</
template
>
<
script
>
export
default
{
name
:
"TaskEstimateRouteView"
,
computed
:
{
keepAlive
()
{
return
this
.
$route
.
meta
.
keepAlive
}
},
}
</
script
>
\ No newline at end of file
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