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
02673992
Commit
02673992
authored
Dec 04, 2019
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跳转详情
parent
414a0598
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
15 deletions
+74
-15
tasksapi.py
src/inspect_report/api/tasksapi.py
+7
-2
rule.html
src/inspect_report/templates/inspect/rule.html
+18
-0
all.js
static/inspect/js/all.js
+49
-13
No files found.
src/inspect_report/api/tasksapi.py
View file @
02673992
...
...
@@ -100,10 +100,14 @@ class TasksApi(viewsets.ViewSet):
session_condition
=
{
'taskId__in'
:
v
}
if
agent_name
:
session_condition
[
'agentName'
]
=
agent_name
checks
=
tn
.
objects
.
filter
(
**
session_condition
)
.
values
(
'id'
,
'checkResult'
)
checks
=
tn
.
objects
.
filter
(
**
session_condition
)
.
values
(
'id'
,
'checkResult'
,
'agentName'
,
'customName'
,
'remainTime'
,
'score'
,
'sessionId'
,
'taskId'
)
# checks = tn.objects.filter(**session_condition).values('id', 'checkResult')
for
check
in
checks
:
result
=
check
[
'checkResult'
]
detail
=
{
'agentName'
:
check
[
'agentName'
],
'customName'
:
check
[
'customName'
],
'remainTime'
:
check
[
'remainTime'
],
'score'
:
check
[
'score'
],
'sessionId'
:
check
[
'sessionId'
],
'sessionCollectionId'
:
k
,
'taskId'
:
check
[
'taskId'
]}
# session_id = check['id']
if
result
:
data
=
json
.
loads
(
result
)
...
...
@@ -112,9 +116,10 @@ class TasksApi(viewsets.ViewSet):
name
=
d
[
'rule'
][
'name'
]
if
name
in
return_data
.
keys
():
return_data
[
name
][
'count'
]
+=
1
return_data
[
name
][
'details'
]
.
append
(
detail
)
# return_data[name]['ids'].append(session_id)
else
:
return_data
[
name
]
=
{
'count'
:
1
}
return_data
[
name
]
=
{
'count'
:
1
,
'details'
:
[
detail
,
]
}
# return_data[name] = {'count': 1, 'ids': [session_id, ]}
data_sort
=
[]
for
k
,
v
in
return_data
.
items
():
...
...
src/inspect_report/templates/inspect/rule.html
View file @
02673992
...
...
@@ -50,6 +50,24 @@
</el-select>
</div>
<div
id=
'main'
style=
'width:80%;height:600px'
v-loading=
'true'
></div>
<el-dialog
title=
"详情"
:visible.sync=
"dialogTableVisible"
>
<el-table
style=
'margin-top:-20px'
:data=
"tableData"
max-height=
'500'
>
<el-table-column
prop=
"agentName"
label=
"坐席id"
></el-table-column>
<el-table-column
prop=
"customName"
label=
"客户"
></el-table-column>
<el-table-column
prop=
"remainTime"
label=
"通话时间(秒)"
>
{#
<template
slot-scope=
'scope'
>
#}
{#
<span>
{{scope.row.remainTime}}秒
</span>
#}
{#
</template>
#}
</el-table-column>
<el-table-column
prop=
"score"
label=
"分数"
></el-table-column>
<el-table-column
label=
"操作"
>
<template
slot-scope=
'scope'
>
<el-button
type=
'text'
size=
"mini"
@
click=
"handleTableDetail(scope.$index, scope.row)"
>
详情
</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
<script
type=
"text/javascript"
>
window
.
onload
=
function
(){
...
...
static/inspect/js/all.js
View file @
02673992
...
...
@@ -8,20 +8,20 @@ new Vue({
taskvalue
:
''
,
start_date
:
''
,
end_date
:
''
,
dialogTableVisible
:
false
,
takeList
:[],
takevalue
:
''
,
loading
:
true
,
tableData
:
[],
}
},
methods
:
{
changeRange
(
dateRange
){
console
.
log
(
dateRange
);
this
.
start_date
=
dateRange
[
0
];
this
.
end_date
=
dateRange
[
1
];
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
},
changeTask
(
msg
){
console
.
log
(
msg
);
this
.
taskvalue
=
msg
;
this
.
getTake
()
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
...
...
@@ -29,7 +29,6 @@ new Vue({
changeTake
(
msg
){
this
.
takevalue
=
msg
;
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
console
.
log
(
msg
);
},
getTask
(){
let
that
=
this
;
...
...
@@ -79,13 +78,12 @@ new Vue({
Charts
(
msg
){
let
msgLen
=
msg
.
length
;
let
msgArr
=
[];
let
that
=
this
;
for
(
let
key
in
msg
){
console
.
log
(
key
)
;
console
.
log
(
msg
[
key
])
;
msgArr
.
unshift
([
msg
[
key
].
rule
,
msg
[
key
].
count
])
msgArr
.
unshift
([
msg
[
key
].
rule
,
msg
[
key
].
count
,
msg
[
key
].
details
])
}
let
sourceArr
=
[
[
'
product
'
,
'
amount
'
],
[
'
product
'
,
'
amount
'
,
'
detail
'
],
].
concat
(
msgArr
);
var
option
=
{
dataZoom
:
[
...
...
@@ -162,7 +160,11 @@ new Vue({
};
var
myChart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
));
myChart
.
setOption
(
option
)
myChart
.
setOption
(
option
);
myChart
.
on
(
'
click
'
,
function
(
msg
){
that
.
tableData
=
msg
.
data
[
2
];
that
.
dialogTableVisible
=
true
;
})
if
(
msg
.
length
==
0
){
myChart
.
showLoading
({
text
:
'
暂无数据
'
,
...
...
@@ -185,7 +187,6 @@ new Vue({
let
arr
=
[];
this
.
$loading
({
text
:
'
数据加载中...
'
});
RquestsPost
(
'
api/v1/tasks/rule/
'
,{
task
,
start_date
,
end_date
,
agentName
}).
then
(
data
=>
{
console
.
log
(
data
.
data
);
if
(
data
.
code
!=
0
){
that
.
$message
(
data
.
msg
);
if
(
data
.
msg
){
...
...
@@ -206,9 +207,45 @@ new Vue({
that
.
Charts
(
data
.
data
);
this
.
$loading
().
close
();
})
},
formatSeconds
(
value
)
{
var
theTime
=
parseInt
(
value
);
// 秒
var
middle
=
0
;
// 分
var
hour
=
0
;
// 小时
if
(
theTime
>
60
)
{
middle
=
parseInt
(
theTime
/
60
);
theTime
=
parseInt
(
theTime
%
60
);
if
(
middle
>
60
)
{
hour
=
parseInt
(
middle
/
60
);
middle
=
parseInt
(
middle
%
60
);
}
}
var
result
=
""
+
parseInt
(
theTime
)
+
"
秒
"
;
if
(
middle
>
0
)
{
result
=
""
+
parseInt
(
middle
)
+
"
分
"
+
result
;
}
if
(
hour
>
0
)
{
result
=
""
+
parseInt
(
hour
)
+
"
小时
"
+
result
;
}
return
result
;
},
dateFormat
(
date
){
return
date
.
getFullYear
()
+
"
-
"
+
(
date
.
getMonth
()
+
1
)
+
"
-
"
+
date
.
getDate
();
},
handleTableDetail
(
index
,
msg
){
console
.
log
(
'
hehhe
'
)
console
.
log
(
msg
);
let
url
=
"
/quality/audio/check-detail/
"
+
msg
.
sessionCollectionId
+
"
/
"
+
msg
.
taskId
+
"
?from=checkTask&sessionId=
"
+
msg
.
sessionId
;
let
autoMessage
=
{
//id: msg.id
// sessionCollectionId: msg.sessionCollectionId,
// sessionId: msg.sessionId,
// taskId: msg.taskId
jumplink
:
url
};
console
.
log
(
autoMessage
)
window
.
parent
.
postMessage
(
autoMessage
,
'
*
'
);
},
init
(){
this
.
dateRange
=
[
new
Date
(
new
Date
()
-
24
*
60
*
60
*
1000
),
new
Date
()];
...
...
@@ -217,7 +254,6 @@ new Vue({
this
.
getTask
();
// 获取任务
//this.getTake(); // 获取坐席
console
.
log
(
this
.
dateRange
);
this
.
getRule
(
this
.
taskvalue
,
this
.
start_date
,
this
.
end_date
,
this
.
takevalue
);
// 获取统计数据
}
...
...
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