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
6e47c439
Commit
6e47c439
authored
Dec 11, 2019
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
概览详情
parent
419ea0f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
13 deletions
+75
-13
tasksapi.py
src/inspect_report/api/tasksapi.py
+14
-7
group.html
src/inspect_report/templates/inspect/group.html
+18
-3
groupOverview.js
static/inspect/js/groupOverview.js
+43
-3
No files found.
src/inspect_report/api/tasksapi.py
View file @
6e47c439
# coding: utf-8
from
django.shortcuts
import
render
from
django.db.models
import
Count
from
django.db.models
import
Count
,
Sum
from
rest_framework
import
viewsets
from
rest_framework.decorators
import
action
from
rest_framework.request
import
Request
...
...
@@ -299,12 +299,19 @@ class TasksApi(viewsets.ViewSet):
table_name
=
TABLE_PRE
+
k
tn
=
CheckSession
.
set_table
(
table_name
)
session_condition
=
{
'taskId__in'
:
v
}
checks
=
tn
.
objects
.
filter
(
**
session_condition
)
.
values
(
'violationRuleCount'
,
'score'
)
for
check
in
checks
:
total_score
+=
check
[
'score'
]
return_data
[
'total_session'
]
+=
1
if
check
[
'violationRuleCount'
]
>
0
:
return_data
[
'validate_session'
]
+=
1
# checks = tn.objects.filter(**session_condition).values('violationRuleCount', 'score')
# for check in checks:
# total_score += check['score']
# return_data['total_session'] += 1
# if check['violationRuleCount'] > 0:
# return_data['validate_session'] += 1
session_all
=
tn
.
objects
.
filter
(
**
session_condition
)
.
aggregate
(
Count
(
"id"
))
score_all
=
tn
.
objects
.
filter
(
**
session_condition
)
.
aggregate
(
Sum
(
"score"
))
session_condition
[
'violationRuleCount__gt'
]
=
0
validate_all
=
tn
.
objects
.
filter
(
**
session_condition
)
.
aggregate
(
Count
(
"id"
))
return_data
[
'total_session'
]
+=
session_all
[
'id__count'
]
return_data
[
'validate_session'
]
+=
validate_all
[
'id__count'
]
total_score
+=
score_all
[
'score__sum'
]
if
return_data
[
'total_session'
]:
return_data
[
'ratio'
]
=
round
(
return_data
[
'validate_session'
]
/
return_data
[
'total_session'
],
2
)
return_data
[
'avg_score'
]
=
round
(
total_score
/
return_data
[
'total_session'
],
2
)
...
...
src/inspect_report/templates/inspect/group.html
View file @
6e47c439
...
...
@@ -61,6 +61,13 @@
.el-dialog
{
width
:
700px
}
.is-fullscreen
{
//
z-index
:
2222
!important
;
}
#dialogDetail
.el-table
{
min-height
:
500px
;
}
</style>
</head>
<body
style=
'height:100%'
>
...
...
@@ -209,17 +216,15 @@
:total=
"total"
>
</el-pagination>
</div>
<el-dialog
title=
"详情"
:visible.sync=
"dialogTableVisible"
>
<el-dialog
id=
'dialogDetail'
v-loading=
'poploading'
title=
"详情"
:visible.sync=
"dialogTableVisible"
>
<el-table
style=
'margin-top:-20px'
:data=
"poptableData"
max-height=
'500'
>
<el-table-column
prop=
"agentName"
label=
"坐席id"
width=
'190'
></el-table-column>
<el-table-column
prop=
"customName"
label=
"客户"
width=
'190'
></el-table-column>
<el-table-column
prop=
"remainTime"
label=
"通话时间(秒)"
>
{#
<template
slot-scope=
'scope'
>
#}
{#
<span>
{{formatSeconds(scope.row.remainTime)}}
</span>
#}
{#
</template>
#}
</el-table-column>
<el-table-column
prop=
"score"
label=
"分数"
></el-table-column>
<el-table-column
label=
"操作"
>
...
...
@@ -228,6 +233,16 @@
</template>
</el-table-column>
</el-table>
<el-pagination
@
current-change=
'popCurrentChange'
style=
'margin: 0 auto;text-align:center;margin-bottom:20px;'
layout=
"prev, pager, next"
:current-page.sync=
'popcurrentPage'
background
:page-size=
"poppagesize"
:total=
"poptotal"
>
</el-pagination>
</el-dialog>
<el-button
v-if=
'isscrollTop'
@
click=
'backTop'
id=
'backTop'
type=
"warning"
icon=
"el-icon-upload2"
circle
></el-button>
</div>
...
...
static/inspect/js/groupOverview.js
View file @
6e47c439
...
...
@@ -11,9 +11,16 @@ new Vue({
currentPage
:
1
,
pagesize
:
10
,
total
:
10
,
poppage
:
1
,
poppagesize
:
10
,
poptotal
:
10
,
poprule
:
''
,
poptables
:
''
,
popcurrentPage
:
1
,
isHidePage
:
true
,
scrollTop
:
0
,
end_date
:
''
,
poploading
:
false
,
dialogTableVisible
:
false
,
takeList
:[],
dateRange
:[
new
Date
(),
new
Date
()],
...
...
@@ -98,6 +105,10 @@ new Vue({
},
CurrentChange
(
page
){
this
.
currentPage
=
page
;
},
popCurrentChange
(
page
){
this
.
poppage
=
page
;
this
.
getDetail
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
poptables
,
this
.
poprule
,
this
.
poppage
,
this
.
poppagesize
);
},
getRule
(
task
,
start_date
,
end_date
,
agentName
){
let
that
=
this
;
...
...
@@ -151,10 +162,39 @@ new Vue({
return
date
.
getFullYear
()
+
"
-
"
+
(
date
.
getMonth
()
+
1
)
+
"
-
"
+
date
.
getDate
();
},
rowDetail
(
index
,
tableData
){
console
.
log
(
tableData
[
index
]);
//console.log(tableData);
this
.
poptableData
=
tableData
[
index
].
details
;
let
data
=
tableData
[
index
+
(
this
.
currentPage
-
1
)
*
this
.
pagesize
];
console
.
log
(
data
);
//this.poptableData = tableData[index].details;
this
.
poptables
=
data
.
tables
;
this
.
poprule
=
data
.
rule
;
this
.
popcurrentPage
=
1
;
this
.
poppage
=
1
;
this
.
getDetail
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
poptables
,
this
.
poprule
,
this
.
poppage
,
this
.
poppagesize
);
this
.
dialogTableVisible
=
true
;
},
getDetail
(
task
,
start_date
,
end_date
,
tables
,
rule
,
page
,
page_size
){
//this.getRule(this.taskvalue,this.start_date,this.end_date,this.takevalue); // 获取统计数据
let
that
=
this
;
//this.$loading({text:'数据加载中...'});
this
.
poploading
=
true
;
RquestsPost
(
'
api/v1/tasks/rule_detail/
'
,{
task
,
end_date
,
start_date
,
tables
,
rule
,
page
,
page_size
}).
then
(
data
=>
{
console
.
log
(
data
.
data
);
if
(
data
.
code
!=
0
){
that
.
$message
(
data
.
msg
);
if
(
data
.
msg
){
that
.
$message
(
data
.
msg
);
}
else
{
that
.
$message
(
'
服务器错误
'
)
}
}
//that.titleInfo = data.data;
that
.
poptotal
=
data
.
count
;
that
.
poptableData
=
data
.
data
;
//this.$loading().close();
this
.
poploading
=
false
;
})
},
handleTableDetail
(
index
,
msg
){
let
url
=
"
/quality/audio/check-detail/
"
+
msg
.
sessionCollectionId
+
"
/
"
+
msg
.
taskId
+
"
?from=checkTask&sessionId=
"
+
msg
.
sessionId
;
...
...
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