Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
inspect_report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
zhengjinlei
inspect_report
Commits
be522eb1
Commit
be522eb1
authored
Apr 23, 2020
by
lvshibao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
group页面修改
parent
fb1cff9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
dataapi.py
src/inspect_report/api/dataapi.py
+8
-6
group.js
static/inspect/js/group.js
+1
-1
No files found.
src/inspect_report/api/dataapi.py
View file @
be522eb1
...
...
@@ -5,6 +5,7 @@ from rest_framework.decorators import action
from
rest_framework.request
import
Request
from
before_request
import
before_request
from
inspect_report.agency
import
get_team_names
from
inspect_report.models
import
Tasks
,
CheckSession
,
RulesStat
,
SeatStat
,
ScoreStat
,
Round
import
json
from
datetime
import
datetime
,
timedelta
...
...
@@ -31,14 +32,15 @@ class DataApi(viewsets.ViewSet):
:param req:
:return:
"""
username
=
req
.
data
.
get
(
'username'
,
''
)
task_id
=
req
.
GET
.
get
(
'task'
,
''
)
city_id
=
req
.
data
.
get
(
'city'
,
None
)
country_id
=
req
.
data
.
get
(
'country'
,
None
)
sort
=
req
.
GET
.
get
(
'sort'
,
'-avg_score'
)
task_condition
=
req
.
data
.
get
(
'date_condition'
,
{})
if
task_id
:
task_condition
[
'task'
]
=
task_id
if
username
in
name_list
:
task_condition
[
'task'
]
=
username
team_names
=
get_team_names
(
city_id
,
country_id
)
task_condition
[
'task__in'
]
=
team_names
rules
=
ScoreStat
.
objects
.
filter
(
**
task_condition
)
.
extra
(
select
=
{
'area'
:
"task"
})
\
.
values
(
'area'
)
.
annotate
(
avg_score_svc
=
Round
(
Avg
(
'service_score'
),
2
),
avg_score_bus
=
Round
(
Avg
(
'business_score'
),
2
),
...
...
static/inspect/js/group.js
View file @
be522eb1
...
...
@@ -70,7 +70,7 @@ new Vue({
name
:
item
.
prop
,
sort
:
order
}
this
.
getRule
(
this
.
task
value
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
this
.
getRule
(
this
.
cityvalue
,
this
.
country
value
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
},
changeRange
(
dateRange
){
this
.
start_date
=
dateRange
[
0
];
...
...
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