askbot-dragon 1.6.42-beta → 1.6.44-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
|
@@ -24,15 +24,17 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
</div>
|
|
26
26
|
<div class="summaryContent">
|
|
27
|
-
<span>{{
|
|
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
|
-
|
|
30
|
+
<div class="intelligentList">
|
|
31
|
+
<div class="intelligentQues"
|
|
32
|
+
v-for="(item,index) in recommendQuestions"
|
|
33
|
+
:key="index"
|
|
34
|
+
@click="recommendQues(item)"
|
|
35
|
+
>
|
|
36
|
+
{{ item }}
|
|
37
|
+
</div>
|
|
36
38
|
</div>
|
|
37
39
|
</div>
|
|
38
40
|
</div>
|
|
@@ -45,7 +47,9 @@ export default {
|
|
|
45
47
|
return{
|
|
46
48
|
summary:"",
|
|
47
49
|
recommendQuestions:[],
|
|
48
|
-
isLoading:false
|
|
50
|
+
isLoading:false,
|
|
51
|
+
typedContent:"",
|
|
52
|
+
typingSpeed:20
|
|
49
53
|
}
|
|
50
54
|
},
|
|
51
55
|
props:{
|
|
@@ -56,6 +60,8 @@ export default {
|
|
|
56
60
|
methods:{
|
|
57
61
|
getKnowledgeSummary() {
|
|
58
62
|
let url = "/knowledge-api/knowledge/detail/" + this.knowledgeId;
|
|
63
|
+
this.typedContent = "";
|
|
64
|
+
this.summary = "";
|
|
59
65
|
this.$http.get(url).then(res => {
|
|
60
66
|
console.log('res',res)
|
|
61
67
|
if (res.data.data){
|
|
@@ -63,6 +69,9 @@ export default {
|
|
|
63
69
|
this.recommendQuestions = res.data.data.recommendQuestions ? res.data.data.recommendQuestions : [];
|
|
64
70
|
if (!this.summary){
|
|
65
71
|
this.regeneration();
|
|
72
|
+
} else {
|
|
73
|
+
this.$emit('getSummarySuccess')
|
|
74
|
+
this.startTypingEffect();
|
|
66
75
|
}
|
|
67
76
|
}
|
|
68
77
|
})
|
|
@@ -76,12 +85,15 @@ export default {
|
|
|
76
85
|
"async": false
|
|
77
86
|
}
|
|
78
87
|
this.isLoading = true;
|
|
88
|
+
this.typedContent = "";
|
|
89
|
+
this.summary = "";
|
|
79
90
|
this.$http.post(url,obj).then(res => {
|
|
80
91
|
console.log('regeneration',res)
|
|
81
92
|
if (res.data.data){
|
|
82
93
|
this.summary = res.data.data.summary;
|
|
83
94
|
this.recommendQuestions = res.data.data.recommendQuestions ? res.data.data.recommendQuestions : [];
|
|
84
95
|
this.$emit('getSummarySuccess')
|
|
96
|
+
this.startTypingEffect();
|
|
85
97
|
}
|
|
86
98
|
this.isLoading = false;
|
|
87
99
|
})
|
|
@@ -91,7 +103,18 @@ export default {
|
|
|
91
103
|
},
|
|
92
104
|
recommendQues(item){
|
|
93
105
|
this.$emit('recommendQues',item,this.knowledgeId)
|
|
94
|
-
}
|
|
106
|
+
},
|
|
107
|
+
startTypingEffect() {
|
|
108
|
+
let i = 0;
|
|
109
|
+
const interval = setInterval(() => {
|
|
110
|
+
if (i < this.summary.length) {
|
|
111
|
+
this.typedContent += this.summary.charAt(i);
|
|
112
|
+
i++;
|
|
113
|
+
} else {
|
|
114
|
+
clearInterval(interval);
|
|
115
|
+
}
|
|
116
|
+
}, this.typingSpeed);
|
|
117
|
+
},
|
|
95
118
|
},
|
|
96
119
|
mounted() {
|
|
97
120
|
this.getKnowledgeSummary();
|
|
@@ -150,14 +173,17 @@ export default {
|
|
|
150
173
|
}
|
|
151
174
|
.intelligentBottom{
|
|
152
175
|
background: #F9FAFD;
|
|
176
|
+
padding: 0 10px;
|
|
153
177
|
height: 50px;
|
|
154
|
-
display: flex;
|
|
155
|
-
align-items: center;
|
|
156
|
-
padding: 0 20px;
|
|
157
178
|
border-bottom-left-radius: 20px;
|
|
158
179
|
border-bottom-right-radius: 20px;
|
|
159
|
-
|
|
160
|
-
|
|
180
|
+
.intelligentList{
|
|
181
|
+
overflow-x: scroll;
|
|
182
|
+
overflow-y: hidden;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
height: 50px;
|
|
186
|
+
}
|
|
161
187
|
.intelligentQues{
|
|
162
188
|
height: 26px;
|
|
163
189
|
display: flex;
|