askbot-dragon 1.7.21-beta → 1.7.22-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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.7.21-beta",
3
+ "version": "1.7.22-beta",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,6 +1,7 @@
1
1
  <!-- 消息记录容器 -->
2
2
  <template>
3
3
  <div id="conversation">
4
+ <qw-feedback :msg="qwFeedbackObj"></qw-feedback>
4
5
  <div v-for="(item, index) in processAction" :key="index">
5
6
  <association-intention :msg="item" :msgType="item.type" :isOpen="isOpen"></association-intention>
6
7
  </div>
@@ -121,6 +122,7 @@ import AnswerDocknowledge from "./AnswerDocknowledge.vue";
121
122
  import WelcomeKnowledgeFile from "./welcomeKnowledgeFile";
122
123
  import WelcomeLlmCard from "./welcomeLlmCard";
123
124
  import welcomeSuggest from "./welcomeSuggest"
125
+ import QwFeedback from './QwFeedback';
124
126
  export default {
125
127
  name: 'ConversationContainer',
126
128
  components: {
@@ -150,7 +152,8 @@ export default {
150
152
  // ChatContent,
151
153
  AnswerDocknowledge,
152
154
  MyEditor,
153
- welcomeSuggest
155
+ welcomeSuggest,
156
+ QwFeedback
154
157
  },
155
158
  props: {
156
159
  messages: Array
@@ -10660,6 +10663,15 @@ export default {
10660
10663
  }
10661
10664
  },
10662
10665
  answerRadios: { "content": { "options": [{ "scope": "KNOWLEDGE", "name": "本文提供了什么内容?", "value": "64915d6e098ec248701da267" }, { "scope": "KNOWLEDGE", "name": "什么是街舞穿搭指南?", "value": "64915d6e098ec248701da267" }, { "scope": "KNOWLEDGE", "name": "为什么街舞爱好者需要关注本文?", "value": "64915d6e098ec248701da267" }], "description": "了解更多", "isKnowledgeSummary": true }, "id": "knowledgeRecdNodeId", "type": "answer_radio", "sessionId": 1687251699065, "keyId": "139480f2-5af1-44fd-a7bd-a73dd7b566b7_________", "isKnowledgeSummary": true },
10666
+ qwFeedbackObj: {
10667
+ "content": {
10668
+ "guideText": "以下问题我已经学会了,感谢您提供的金点子,帮助我更好的成长:",
10669
+ "questionList": [
10670
+ "打印机卡纸怎么办", "打印机打印模糊", "SAP系统输入编码系统显示报错", "合同已经上传影像归档了,但是在CE中还是关联不到合同", "如何查询社保缴费基数", "如何查询公积金缴费基数"
10671
+ ]
10672
+ },
10673
+ "type": "unidentified_feedback"
10674
+ },
10663
10675
  answerRadiosPri: {
10664
10676
  "refAttrId": null,
10665
10677
  "createTime": null,
@@ -0,0 +1,302 @@
1
+ <template>
2
+ <div class="qw-feedback">
3
+ <div class="qw-guide-text" v-if="msg.content.guideText">
4
+ <!-- 不要替换成图片地址或者字体 -->
5
+ <svg
6
+ t="1730450955692"
7
+ class="icon"
8
+ viewBox="0 0 1024 1024"
9
+ version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ p-id="8682"
12
+ width="32"
13
+ height="32"
14
+ >
15
+ <path
16
+ d="M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z"
17
+ fill="#FDB813"
18
+ p-id="8683"
19
+ ></path>
20
+ <path
21
+ d="M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z"
22
+ fill="#FD9B13"
23
+ p-id="8684"
24
+ ></path>
25
+ <path
26
+ d="M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z"
27
+ fill="#F12A3F"
28
+ p-id="8685"
29
+ ></path>
30
+ <path
31
+ d="M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z"
32
+ fill="#2D4375"
33
+ p-id="8686"
34
+ ></path>
35
+ <path
36
+ d="M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z"
37
+ fill="#1E2D4F"
38
+ p-id="8687"
39
+ ></path>
40
+ <path
41
+ d="M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z"
42
+ fill="#FDB813"
43
+ p-id="8688"
44
+ ></path>
45
+ <path
46
+ d="M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z"
47
+ fill="#FDB813"
48
+ p-id="8689"
49
+ ></path>
50
+ <path
51
+ d="M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z"
52
+ fill="#FDB813"
53
+ p-id="8690"
54
+ ></path>
55
+ <path
56
+ d="M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z"
57
+ fill="#CEEFF6"
58
+ p-id="8691"
59
+ ></path>
60
+ <path
61
+ d="M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z"
62
+ fill="#FFFFFF"
63
+ p-id="8692"
64
+ ></path>
65
+ <path
66
+ d="M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z"
67
+ fill="#CEEFF6"
68
+ p-id="8693"
69
+ ></path>
70
+ </svg>
71
+ <!-- 不要替换成图片地址或者字体 -->
72
+ <p class="radio-description" v-html="msg.content.guideText"></p>
73
+ </div>
74
+
75
+ <div class="options-list">
76
+ <div
77
+ v-for="(option, index) in showOptions"
78
+ class="options-item"
79
+ :class="
80
+ index !== msg.content.questionList.length - 1
81
+ ? 'recommend-item'
82
+ : 'last-item'
83
+ "
84
+ :key="'qwfeedback_' + index"
85
+ @click="handleWelcome(option)"
86
+ >
87
+ <span> {{ getFilteredName(option) }}</span>
88
+ <i class="arsenal_icon arsenalangle-right-solid"></i>
89
+ </div>
90
+ </div>
91
+ <div v-if="showPage" class="switch-page">
92
+ <!-- <span @click="changeActivePage" class="switch-page-btn"
93
+ >换一批</span
94
+ > -->
95
+ <span @click="showMore" class="switch-page-btn">查看更多</span>
96
+ </div>
97
+ </div>
98
+ </template>
99
+
100
+ <script>
101
+ export default {
102
+ name: "answerRadio",
103
+ data() {
104
+ return {
105
+ isMobile: false,
106
+ formatOptions: [],
107
+ activeIndex: 0,
108
+ pageSize: 5,
109
+ showPage: false,
110
+ showOptions: [],
111
+ };
112
+ },
113
+ props: ["msg"],
114
+ mounted() {
115
+ console.log(this.msg, "msg");
116
+ // 关键词推荐 前端分页
117
+ if (this.msg.content.questionList.length > this.pageSize) {
118
+ this.formatOptions = this.chunkArray(
119
+ this.msg.content.questionList,
120
+ this.pageSize
121
+ );
122
+ this.activeIndex = 0;
123
+ this.showPage = true;
124
+ } else {
125
+ this.formatOptions = [this.msg.content.questionList];
126
+ this.activeIndex = 0;
127
+ }
128
+ this.showOptions = this.formatOptions[0];
129
+ this.judgeIsMobile();
130
+ },
131
+ methods: {
132
+ getFilteredName(name) {
133
+ if (typeof name === "string") {
134
+ return name.replace(/<\/?p>/g, "");
135
+ } else {
136
+ return name;
137
+ }
138
+ },
139
+ showMore() {
140
+ if (this.activeIndex == this.formatOptions.length - 2) {
141
+ this.activeIndex++;
142
+ this.showPage = false;
143
+ } else {
144
+ this.activeIndex++;
145
+ }
146
+ this.showOptions = [
147
+ ...this.showOptions.concat(
148
+ this.formatOptions[this.activeIndex]
149
+ ),
150
+ ];
151
+ },
152
+ changeActivePage() {
153
+ if (this.activeIndex >= this.formatOptions.length - 1) {
154
+ this.activeIndex = 0;
155
+ } else {
156
+ this.activeIndex++;
157
+ }
158
+ this.showOptions = this.formatOptions[this.activeIndex];
159
+ },
160
+ chunkArray(array, size) {
161
+ let chunks = [];
162
+ for (let i = 0; i < array.length; i += size) {
163
+ let chunk = array.slice(i, i + size);
164
+ chunks.push(chunk);
165
+ }
166
+ return chunks;
167
+ },
168
+ judgeIsMobile() {
169
+ let flag = navigator.userAgent.match(
170
+ /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
171
+ );
172
+ if (flag) {
173
+ this.isMobile = true;
174
+ } else {
175
+ this.isMobile = false;
176
+ }
177
+ console.log(this.isMobile, "this.isMobile");
178
+ },
179
+ handleWelcome (item) {
180
+ console.log(item, 'item');
181
+
182
+ this.$emit('handleWelcome', item)
183
+ },
184
+ radioClick(msg, option, index) {
185
+ let value = option.answerId
186
+ ? msg.id +
187
+ "_" +
188
+ index +
189
+ "_" +
190
+ option.value +
191
+ "_" +
192
+ option.name +
193
+ "_" +
194
+ option.answerId
195
+ : msg.id + "_" + index + "_" + option.value + "_" + option.name;
196
+ this.$emit(
197
+ "onRadioClick",
198
+ value,
199
+ option.name,
200
+ msg.apiKey,
201
+ msg.actionCategory,
202
+ msg.msgId ? msg.msgId : "",
203
+ option.apiKey
204
+ );
205
+ },
206
+ },
207
+ };
208
+ </script>
209
+
210
+ <style scoped lang="less">
211
+ .qw-feedback {
212
+ background-color: white;
213
+ padding-bottom: 16px;
214
+ .qw-guide-text {
215
+ display: flex;
216
+ justify-content: flex-start;
217
+ align-items: center;
218
+ background-color: #f2f5ff;
219
+ padding: 16px 16px 0 16px;
220
+ .radio-description {
221
+ margin-left: 6px;
222
+ }
223
+ }
224
+ .switch-page {
225
+ margin-top: 10px;
226
+ display: flex;
227
+ flex-direction: column;
228
+ align-items: center;
229
+ .switch-page-btn {
230
+ width: 80px;
231
+ height: 24px;
232
+ border-radius: 15px;
233
+ border: solid 1px #366aff;
234
+ color: #366aff;
235
+ line-height: 24px;
236
+ text-align: center;
237
+ cursor: pointer;
238
+ font-size: 12px;
239
+ }
240
+ }
241
+ .radio-description {
242
+ word-wrap: break-word;
243
+ word-break: break-all;
244
+ overflow: hidden;
245
+ /*padding: 8px 10px 10px 0;*/
246
+ padding-bottom: 10px;
247
+ height: auto;
248
+ /* border-bottom: 1px solid #EEEEEE;*/
249
+ }
250
+
251
+ .bottom-link {
252
+ height: 1px;
253
+ background-color: #eeeeee;
254
+ }
255
+
256
+ .options-list {
257
+ padding-top: 4px;
258
+ /* padding-top: 10px;*/
259
+ padding-left: 16px;
260
+ padding-right: 16px;
261
+
262
+ .options-item {
263
+ // height: 25px;
264
+ line-height: 25px;
265
+ background-color: #ffffff;
266
+ color: #366aff;
267
+ cursor: pointer;
268
+ display: flex;
269
+ align-items: center;
270
+ justify-content: space-between;
271
+
272
+ i {
273
+ padding-left: 10px;
274
+ }
275
+
276
+ .options-item-text {
277
+ text-overflow: ellipsis;
278
+ display: -webkit-box; //使用了flex,需要加
279
+ overflow: hidden; //超出隐藏
280
+ word-break: break-all; //纯英文、数字、中文
281
+ text-overflow: ellipsis; //省略号
282
+ -webkit-box-orient: vertical; //垂直
283
+ -webkit-line-clamp: 1; //显示一行
284
+ white-space: pre-line; //
285
+ }
286
+ }
287
+
288
+ .recommend-item {
289
+ padding: 8px 0;
290
+ }
291
+
292
+ .last-item {
293
+ padding-top: 8px;
294
+ }
295
+
296
+ .end {
297
+ border-bottom-left-radius: 25px !important;
298
+ border-bottom-right-radius: 25px !important;
299
+ }
300
+ }
301
+ }
302
+ </style>