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
1f6b94fd
Commit
1f6b94fd
authored
Mar 10, 2021
by
shangtx
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'shang' into dev
parents
8c358717
2c20e125
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
154 additions
and
3 deletions
+154
-3
task.js
src/api/task/task.js
+10
-0
AnnualConsume.vue
src/views/task/annualConsume/AnnualConsume.vue
+126
-0
AnnualConsumeRouteView.vue
src/views/task/annualConsume/AnnualConsumeRouteView.vue
+17
-0
TaskEstimateList.vue
src/views/task/taskEstimate/TaskEstimateList.vue
+1
-3
No files found.
src/api/task/task.js
View file @
1f6b94fd
...
@@ -40,4 +40,14 @@ export function exportExcel(parameter) {
...
@@ -40,4 +40,14 @@ export function exportExcel(parameter) {
method
:
'post'
,
method
:
'post'
,
data
:
parameter
,
data
:
parameter
,
})
})
}
/**
* 年度工时统计
*/
export
function
getAnnualConsume
(
year
)
{
return
axios
({
url
:
`
${
baseUrl
.
taskEstimate
}
/annual-consume/
${
year
}
`
,
method
:
'get'
});
}
}
\ No newline at end of file
src/views/task/annualConsume/AnnualConsume.vue
0 → 100644
View file @
1f6b94fd
<
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-select
@
change=
"yearChange"
:options=
"yearOptions"
v-model=
"year"
/>
</a-form-item>
</a-col>
</a-row>
</div>
</a-form>
</div>
<div
class=
"annual-consume-chart-container"
>
<v-chart
:forceFit=
"true"
:height=
"height"
:data=
"data"
>
<v-coord
type=
"rect"
direction=
"LB"
/>
<!--
<v-tooltip
/>
-->
<v-legend
:itemFormatter=
"itemFormatter"
/>
<v-axis
dataKey=
"name"
:label=
"label"
/>
<v-stack-bar
position=
"name*工时"
color=
"类型"
/>
<v-guide
type=
"line"
:top=
"true"
:start=
"['max', standard]"
:end=
"['min', standard]"
:lineStyle=
"
{
fill: '#8c8c8c',
fontSize: 12,
fontWeight: 500,
lineWidth: 2,
lineDash: [5,1]
}"
:text="{
position: 'start',
style: {
fill: '#5d5d5d',
fontSize: 16,
fontWeight: 600,
},
offsetX: 5,
content: `基准工时: ${this.standard}小时`,
}"
/>
</v-chart>
</div>
</a-card>
</
template
>
<
script
>
import
{
getAnnualConsume
}
from
"@/api/task/task"
;
import
moment
from
"moment"
;
const
DataSet
=
require
(
"@antv/data-set"
);
const
label
=
{
offset
:
12
};
export
default
{
name
:
"AnnualConsume"
,
data
()
{
return
{
year
:
parseInt
(
moment
().
format
(
"YYYY"
)),
data
:
[],
standard
:
0
,
height
:
800
,
label
,
legendMap
:
{
beforeJoin
:
'入职前标准工时'
,
value
:
'已消耗工时'
}
};
},
methods
:
{
loadData
()
{
getAnnualConsume
(
this
.
year
).
then
(({
data
})
=>
{
console
.
info
(
data
);
const
dv
=
new
DataSet
.
View
().
source
(
data
[
1
]);
this
.
standard
=
data
[
0
];
dv
.
transform
({
type
:
"fold"
,
fields
:
[
"beforeJoin"
,
"value"
],
key
:
"类型"
,
value
:
"工时"
,
retains
:
[
"name"
],
});
this
.
data
=
dv
.
rows
;
});
},
itemFormatter
(
text
)
{
return
this
.
legendMap
[
text
];
},
yearChange
(
value
)
{
console
.
info
(
"year"
,
value
);
this
.
loadData
();
},
},
computed
:
{
yearOptions
()
{
const
currentYear
=
parseInt
(
moment
().
format
(
"YYYY"
));
const
startYear
=
2018
;
const
yearOptions
=
[];
for
(
let
i
=
currentYear
;
i
>=
startYear
;
i
--
)
{
yearOptions
.
push
({
value
:
i
,
title
:
i
});
}
return
yearOptions
;
},
},
activated
()
{
this
.
loadData
();
},
};
</
script
>
<
style
scoped
>
.annual-consume-chart-container
{
width
:
85%
;
}
</
style
>
\ No newline at end of file
src/views/task/annualConsume/AnnualConsumeRouteView.vue
0 → 100644
View file @
1f6b94fd
<
template
>
<keep-alive
v-if=
"keepAlive"
>
<router-view
/>
</keep-alive>
<router-view
v-else
/>
</
template
>
<
script
>
export
default
{
name
:
"AnnualConsumeRouteView"
,
computed
:
{
keepAlive
()
{
return
this
.
$route
.
meta
.
keepAlive
}
},
}
</
script
>
\ No newline at end of file
src/views/task/taskEstimate/TaskEstimateList.vue
View file @
1f6b94fd
...
@@ -171,6 +171,7 @@ export default {
...
@@ -171,6 +171,7 @@ export default {
page
:
1
,
page
:
1
,
size
:
10
,
size
:
10
,
},
},
defaultPageSize
:
50
,
month
:
null
,
month
:
null
,
dayOfTheMonth
:
31
,
dayOfTheMonth
:
31
,
total
:
0
,
total
:
0
,
...
@@ -188,9 +189,6 @@ export default {
...
@@ -188,9 +189,6 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
defaultPageSize
:
function
()
{
return
this
.
$defaultPageSize
();
},
reactiveColumns
()
{
reactiveColumns
()
{
const
dateColumns
=
[];
const
dateColumns
=
[];
...
...
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