iusseDetail.vue
5.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<template>
<div>
<div class="container">
<div class="title flex">用户详情</div>
<div class="user-box flex">
<div class="item flex">
<div class="label">用户企微名:</div>
{{staffDetail.staffName}}
</div>
<div class="item flex">
<div class="label">登录商户:</div>
{{ staffDetail.merchantName }}{{ staffDetail.merchantId }}
</div>
</div>
<div class="title flex">提问记录</div>
<div class="table-box">
<div class="date-box flex">
<div class="label">日期搜索:</div>
<el-date-picker
v-model="searchDate"
type="daterange"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="beforeRangePickerOptions"
@change="changeDate"
>
</el-date-picker>
</div>
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="searchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
>
<div
slot-scope="scope"
slot="content"
>
<el-tooltip
placement="bottom"
:content="scope.scope.content"
effect="light"
:tabindex="100868"
popper-class="popper-class"
>
<div class="tooltip-content flex">
<div :class="['icon flex',scope.scope.contentType == 0?'question':'answering']">{{ scope.scope.contentType == 0?'问':'答'}}</div>
<div class="text"> {{ scope.scope.content }}</div>
</div>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<GLFooter class="gl-footer">
<el-button
@click="$router.back()"
type="primary"
>返回</el-button>
</GLFooter>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
import * as dayjs from 'dayjs'
export default {
name: '',
data () {
return {
url,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
searchForm: {
beginDate: '',
endDate: '',
staffUuid: this.$route.query.id
},
searchDate: '',
getListApi: this.$apis.chatLibrary.getStaffChatRecordPage,
tableParams: {
listName: 'data',
tableColumns: [
{
label: '更新时间',
width: 210,
prop: 'chatTime'
// formatter: cellVal => {
// return dayjs(cellVal.chatTime).format('YYYY-MM-DD HH:mm')
// }
},
{
label: '用户问题及AI答复',
addHtml: 'content',
},
]
},
beforeRangePickerOptions: {},
staffDetail: {
staffName: '',
merchantName: '',
merchantId: ''
}
}
},
mounted () {
this.getStaffChatRecordDetail()
},
methods: {
changeDate (e) {
let beginDate = '',
endDate = ''
if (e) {
beginDate = dayjs(e[0]).format('YYYY-MM-DD')
endDate = dayjs(e[1]).format('YYYY-MM-DD')
}
this.searchForm.beginDate = beginDate
this.searchForm.endDate = endDate
this.$refs.listRef.refreshTable()
},
async getStaffChatRecordDetail () {
const res = await this.$apis.chatLibrary.getStaffChatRecordDetail({
staffUuid: this.$route.query.id
})
this.staffDetail = res || {}
this.beforeRangePickerOptions = {
disabledDate (date) {
let disabled = true
try {
res.dateList.map(e => {
if (dayjs(date).format('YYYY-MM-DD') == e) throw false
})
} catch (error) {
disabled = false
}
return disabled
}
}
}
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.container {
background: #ffffff;
min-height: calc(100vh - 136px);
margin-bottom: 16px;
.title {
height: 58px;
padding: 0 20px;
font-weight: 700;
font-size: 16px;
color: #333333;
border-bottom: 1px solid #e5e5e5;
}
.user-box {
min-height: 84px;
padding: 0 20px;
gap: 0 192px;
.item {
font-size: 14px;
color: #333333;
line-height: 20px;
.label {
color: #666666;
width: 154px;
text-align: right;
}
}
}
.table-box {
padding: 0 20px 78px;
.date-box {
height: 64px;
padding-left: 16px;
}
.el-date-editor--daterange.el-input__inner {
width: 232px;
}
.el-range-editor.is-active:hover {
border-color: #5850ff;
width: 232px;
}
.tooltip-content {
.icon {
width: 22px;
height: 22px;
border: 1px solid transparent;
border-radius: 4px;
font-weight: 600;
font-size: 14px;
justify-content: center;
letter-spacing: 0;
margin-right: 9px;
}
.question {
border-color: #fdb7574d;
color: #fdb757;
background: #fdb7571a;
}
.answering {
border-color: #5850ff4d;
color: #5850ff;
background: #5850ff1a;
}
.text {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 90%;
}
}
}
}
</style>