askbot-dragon 1.6.43-beta → 1.6.45-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -27,14 +27,12 @@
|
|
|
27
27
|
<span>{{ typedContent }}</span>
|
|
28
28
|
</div>
|
|
29
29
|
<div class="intelligentBottom" v-if="recommendQuestions.length > 0">
|
|
30
|
-
<div class="
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{{ item }}
|
|
37
|
-
</div>
|
|
30
|
+
<div class="intelligentQues"
|
|
31
|
+
v-for="(item,index) in recommendQuestions"
|
|
32
|
+
:key="index"
|
|
33
|
+
@click="recommendQues(item)"
|
|
34
|
+
>
|
|
35
|
+
{{ item }}
|
|
38
36
|
</div>
|
|
39
37
|
</div>
|
|
40
38
|
</div>
|
|
@@ -60,18 +58,22 @@ export default {
|
|
|
60
58
|
methods:{
|
|
61
59
|
getKnowledgeSummary() {
|
|
62
60
|
let url = "/knowledge-api/knowledge/detail/" + this.knowledgeId;
|
|
61
|
+
this.typedContent = "";
|
|
62
|
+
this.summary = "";
|
|
63
63
|
this.$http.get(url).then(res => {
|
|
64
64
|
console.log('res',res)
|
|
65
65
|
if (res.data.data){
|
|
66
66
|
this.summary = res.data.data.summary;
|
|
67
|
-
this.recommendQuestions = res.data.data.recommendQuestions ? res.data.data.recommendQuestions : [];
|
|
67
|
+
this.recommendQuestions = res.data.data.recommendQuestions ? res.data.data.recommendQuestions.splice(0,5) : [];
|
|
68
68
|
if (!this.summary){
|
|
69
69
|
this.regeneration();
|
|
70
70
|
} else {
|
|
71
|
-
this
|
|
72
|
-
this.startTypingEffect();
|
|
71
|
+
this.typedContent = this.summary;
|
|
73
72
|
}
|
|
74
73
|
}
|
|
74
|
+
this.$nextTick(() => {
|
|
75
|
+
this.$emit('getSummarySuccess')
|
|
76
|
+
})
|
|
75
77
|
})
|
|
76
78
|
},
|
|
77
79
|
regeneration(){
|
|
@@ -83,13 +85,18 @@ export default {
|
|
|
83
85
|
"async": false
|
|
84
86
|
}
|
|
85
87
|
this.isLoading = true;
|
|
88
|
+
this.typedContent = "";
|
|
89
|
+
this.summary = "";
|
|
86
90
|
this.$http.post(url,obj).then(res => {
|
|
87
91
|
console.log('regeneration',res)
|
|
88
92
|
if (res.data.data){
|
|
89
93
|
this.summary = res.data.data.summary;
|
|
90
|
-
this.recommendQuestions = res.data.data.recommendQuestions ? res.data.data.recommendQuestions : [];
|
|
91
|
-
this.$emit('getSummarySuccess')
|
|
94
|
+
this.recommendQuestions = res.data.data.recommendQuestions ? res.data.data.recommendQuestions.splice(0,5) : [];
|
|
92
95
|
this.startTypingEffect();
|
|
96
|
+
} else {
|
|
97
|
+
this.$nextTick(() => {
|
|
98
|
+
this.$emit('getSummarySuccess')
|
|
99
|
+
})
|
|
93
100
|
}
|
|
94
101
|
this.isLoading = false;
|
|
95
102
|
})
|
|
@@ -108,6 +115,9 @@ export default {
|
|
|
108
115
|
i++;
|
|
109
116
|
} else {
|
|
110
117
|
clearInterval(interval);
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
this.$emit('getSummarySuccess')
|
|
120
|
+
},240)
|
|
111
121
|
}
|
|
112
122
|
}, this.typingSpeed);
|
|
113
123
|
},
|
|
@@ -169,17 +179,12 @@ export default {
|
|
|
169
179
|
}
|
|
170
180
|
.intelligentBottom{
|
|
171
181
|
background: #F9FAFD;
|
|
172
|
-
padding: 0
|
|
173
|
-
height: 50px;
|
|
182
|
+
padding: 0 20px;
|
|
174
183
|
border-bottom-left-radius: 20px;
|
|
175
184
|
border-bottom-right-radius: 20px;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
display: flex;
|
|
180
|
-
align-items: center;
|
|
181
|
-
height: 50px;
|
|
182
|
-
}
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
flex-wrap: wrap;
|
|
183
188
|
.intelligentQues{
|
|
184
189
|
height: 26px;
|
|
185
190
|
display: flex;
|
|
@@ -189,7 +194,9 @@ export default {
|
|
|
189
194
|
background: #E5EBFF;
|
|
190
195
|
color: #366AFF;
|
|
191
196
|
border-radius: 10px;
|
|
192
|
-
margin-right:
|
|
197
|
+
margin-right: 5px;
|
|
198
|
+
margin-top: 5px;
|
|
199
|
+
margin-bottom: 5px;
|
|
193
200
|
font-size: 12px;
|
|
194
201
|
cursor: pointer;
|
|
195
202
|
white-space: nowrap;
|
|
@@ -77,6 +77,8 @@
|
|
|
77
77
|
:knowledgeId="knowledgeId"
|
|
78
78
|
@closeSummary="closeSummary"
|
|
79
79
|
@recommendQues="recommendQues"
|
|
80
|
+
@getSummarySuccess="getSummarySuccess"
|
|
81
|
+
:style="{marginTop:tagIds && tagIds.length != 0 ? '50px' : ''}"
|
|
80
82
|
></intelligent-summary>
|
|
81
83
|
<template v-if="tagIds && tagIds.length != 0 && drawer">
|
|
82
84
|
<pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :fileName="fileName" :knowledgeItem="watermark" ref="pdfPosition"></pdfPosition>
|
|
@@ -187,6 +189,20 @@ export default {
|
|
|
187
189
|
}
|
|
188
190
|
})
|
|
189
191
|
})
|
|
192
|
+
},
|
|
193
|
+
showSummary:{
|
|
194
|
+
handler(val){
|
|
195
|
+
if (!val){
|
|
196
|
+
this.$nextTick(() => {
|
|
197
|
+
let preCon = document.querySelector('.pdf_view');
|
|
198
|
+
if (preCon){
|
|
199
|
+
preCon.style.height = 'calc(100% - ' + 50 + 'px)'
|
|
200
|
+
}
|
|
201
|
+
})
|
|
202
|
+
} else {
|
|
203
|
+
this.getSummarySuccess();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
190
206
|
}
|
|
191
207
|
},
|
|
192
208
|
computed:{
|
|
@@ -283,7 +299,23 @@ export default {
|
|
|
283
299
|
if (this.showSummary){
|
|
284
300
|
document.getElementById('drawer_content_pre').scrollTop = 0;
|
|
285
301
|
}
|
|
286
|
-
}
|
|
302
|
+
},
|
|
303
|
+
getSummarySuccess(){
|
|
304
|
+
this.$nextTick(() => {
|
|
305
|
+
if (this.tagIds.length > 0){
|
|
306
|
+
let intelligentSummary = document.getElementById('intelligentSummary');
|
|
307
|
+
let preCon = document.querySelector('.pdf_view')
|
|
308
|
+
console.log('intelligentSummary',preCon,intelligentSummary)
|
|
309
|
+
if (intelligentSummary){
|
|
310
|
+
let height = intelligentSummary.offsetHeight + 100;
|
|
311
|
+
if (preCon){
|
|
312
|
+
preCon.style.height = 'calc(100% - ' + height + 'px)'
|
|
313
|
+
}
|
|
314
|
+
console.log('height',height,preCon)
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
})
|
|
318
|
+
},
|
|
287
319
|
},
|
|
288
320
|
beforeDestroy() {
|
|
289
321
|
window.removeEventListener('message', this.handleIframeMessage);
|