askbot-dragon 1.6.21-beta → 1.6.21

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.
Files changed (72) hide show
  1. package/package.json +8 -11
  2. package/public/index.html +9 -8
  3. package/src/assets/image/default_avt_ui.png +0 -0
  4. package/src/assets/image/filtType/audio.png +0 -0
  5. package/src/assets/image/filtType/excel1.png +0 -0
  6. package/src/assets/image/filtType/general.png +0 -0
  7. package/src/assets/image/filtType/image1.png +0 -0
  8. package/src/assets/image/filtType/link.png +0 -0
  9. package/src/assets/image/filtType/md2.png +0 -0
  10. package/src/assets/image/filtType/mode.png +0 -0
  11. package/src/assets/image/filtType/news.png +0 -0
  12. package/src/assets/image/filtType/pdf1.png +0 -0
  13. package/src/assets/image/filtType/ppt1.png +0 -0
  14. package/src/assets/image/filtType/selfadd1.png +0 -0
  15. package/src/assets/image/filtType/txt1.png +0 -0
  16. package/src/assets/image/filtType/video.png +0 -0
  17. package/src/assets/image/filtType/wechat.png +0 -0
  18. package/src/assets/image/filtType/word1.png +0 -0
  19. package/src/assets/image/loading.gif +0 -0
  20. package/src/assets/js/AliyunlssUtil.js +35 -10
  21. package/src/assets/js/common.js +241 -0
  22. package/src/components/ActionAlertIframe.vue +1 -0
  23. package/src/components/AiGuide.vue +7 -4
  24. package/src/components/AnswerDocknowledge.vue +930 -389
  25. package/src/components/ConversationContainer.vue +7111 -1058
  26. package/src/components/MyEditor.vue +342 -0
  27. package/src/components/QwFeedback.vue +303 -0
  28. package/src/components/actionSatisfaction.vue +2 -2
  29. package/src/components/actionSendToBot.vue +2 -2
  30. package/src/components/answerRadio.vue +145 -64
  31. package/src/components/askVideo.vue +3 -6
  32. package/src/components/assetDetails.vue +14 -6
  33. package/src/components/assetMessage.vue +14 -13
  34. package/src/components/associationIntention.vue +31 -6
  35. package/src/components/fielListView.vue +1 -1
  36. package/src/components/file/AliyunOssComponents.vue +1 -1
  37. package/src/components/formTemplate.vue +1590 -1674
  38. package/src/components/imgView.vue +32 -0
  39. package/src/components/intelligentSummary.vue +231 -0
  40. package/src/components/markDownText.vue +198 -0
  41. package/src/components/myPopup.vue +14 -11
  42. package/src/components/pagination.vue +129 -0
  43. package/src/components/pdfPosition.vue +112 -90
  44. package/src/components/popup.vue +8 -7
  45. package/src/components/preview/docView.vue +114 -0
  46. package/src/components/preview/excelView.vue +187 -0
  47. package/src/components/preview/newPositionPreview.vue +370 -0
  48. package/src/components/preview/pdfView.vue +824 -0
  49. package/src/components/previewDoc.vue +6 -0
  50. package/src/components/previewPdf.vue +963 -200
  51. package/src/components/receiverMessagePlatform.vue +25 -21
  52. package/src/components/recommend.vue +2 -2
  53. package/src/components/senderMessagePlatform.vue +21 -13
  54. package/src/components/tree.vue +116 -103
  55. package/src/components/utils/AliyunIssUtil.js +35 -13
  56. package/src/components/utils/ckeditor.js +64 -56
  57. package/src/components/welcomeKnowledgeFile.vue +344 -0
  58. package/src/components/welcomeLlmCard.vue +141 -0
  59. package/src/components/welcomeSuggest.vue +98 -0
  60. package/src/locales/cn.json +62 -0
  61. package/src/locales/en.json +62 -0
  62. package/src/main.js +19 -3
  63. package/vue.config.js +0 -1
  64. package/src/assets/js/obsBrowser.js +0 -63
  65. package/src/components/utils/ckeditorImageUpload/command.js +0 -112
  66. package/src/components/utils/ckeditorImageUpload/editing.js +0 -12
  67. package/src/components/utils/ckeditorImageUpload/plugin-image.js +0 -12
  68. package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +0 -41
  69. package/src/components/utils/ckeditorfileUpload/common.js +0 -175
  70. package/src/components/utils/ckeditorfileUpload/editing.js +0 -12
  71. package/src/components/utils/ckeditorfileUpload/plugin_file.js +0 -12
  72. package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +0 -35
@@ -0,0 +1,370 @@
1
+ <template>
2
+ <div class="positionView">
3
+ <div class="positionContainer" :class="splitParagraph.length > 1 && fileType !== 'XLS' && fileType !== 'XLSX' ? 'has-footer' : 'no-footer'">
4
+ <doc-view
5
+ v-if="fileType === 'TXT' || fileType === 'DOCX' || fileType === 'DOC'"
6
+ :html_result="html_result"
7
+ :split_paragraphs="splitParagraph"
8
+ ref="docView"
9
+ :fileSuffix="fileType"
10
+ ></doc-view>
11
+ <excel-view v-else-if="fileType === 'XLS' || fileType === 'XLSX'"
12
+ ref="excelView"
13
+ :headerData="excelHeaderData"
14
+ :excelRowList="excelRowList"
15
+ :tableChunkData="tableChunkData"
16
+ ></excel-view>
17
+ <pdf-view v-else-if="fileType === 'PDF'" ref="pdfView" :split_paragraphs="splitParagraph" :ossPath="url" :isPC="isPC"></pdf-view>
18
+ </div>
19
+ <template v-if="splitParagraph.length > 1 && fileType !== 'XLS' && fileType !== 'XLSX'">
20
+ <div class="btn_footer" v-if="!isPC">
21
+ <div class="prev" @click="prev">上一段</div>
22
+ <div class="next" @click="next">下一段</div>
23
+ </div>
24
+ <div id="pagination" v-if="isPC">
25
+ <el-pagination :current-page="currentPage + 1" @current-change="currentChange" @prev-click="prev"
26
+ @next-click="next" layout="slot, prev, pager, next" :page-size="1" :total="splitParagraph.length">
27
+ <span class="total-class">答案由{{ splitParagraph.length }}段内容生成</span>
28
+ </el-pagination>
29
+ </div>
30
+ </template>
31
+ </div>
32
+ </template>
33
+
34
+ <script>
35
+ import DocView from "./docView";
36
+ import ExcelView from "./excelView";
37
+ import PdfView from "./pdfView";
38
+ export default {
39
+ name: "newPositionPreview",
40
+ components: { PdfView, ExcelView, DocView },
41
+ data(){
42
+ return{
43
+ tagId:[],
44
+ newVersion:false,
45
+ html_result:"",
46
+ parseInfo:{},
47
+ fileType:"",
48
+ splitParagraph:[],
49
+ isPC:true,
50
+ currentPage:0,
51
+ excelHeaderData:"",
52
+ excelRowList:[],
53
+ tableChunkData:[]
54
+
55
+ }
56
+ },
57
+ props:{
58
+ knowledgeId:{
59
+ type:String,
60
+ default:""
61
+ },
62
+ tagIds:{
63
+ type:Array,
64
+ default(){
65
+ return []
66
+ }
67
+ },
68
+ url:{
69
+ type:String,
70
+ default:""
71
+ }
72
+ },
73
+ methods:{
74
+ getLocationInfo(){
75
+ this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + this.tagIds.join(',')).then(res => {
76
+ if (res.data.code == 0){
77
+ if (res.data.data && res.data.data.length){
78
+ for (let i=0;i<res.data.data.length;i++){
79
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.splitParagraph){
80
+ this.splitParagraph.push(res.data.data[i].paragraphChunkInfo.splitParagraph)
81
+ }
82
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.tableChunkData){
83
+ this.tableChunkData.push(res.data.data[i].paragraphChunkInfo.tableChunkData)
84
+ }
85
+ }
86
+ }
87
+ }
88
+ this.splitParagraph = this.splitParagraph.concat(this.tableChunkData);
89
+ this.getParseInfo();
90
+ })
91
+ },
92
+ getParseInfo(){
93
+ let url = '/knowledge-api/correction/knowledge-parse-info/' + this.knowledgeId;
94
+ this.$http.get(url).then(res => {
95
+ console.log('getParseInfo',res)
96
+ if (res.data.code == 0 && res.data.data){
97
+ this.parseInfo = res.data.data;
98
+ if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.docChunkData){
99
+ this.html_result = res.data.data.extractChunkInfo.docChunkData.html_result;
100
+ }
101
+ if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.tableChunkData && res.data.data.extractChunkInfo.tableChunkData.length > 0){
102
+ this.excelHeaderData = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_header;
103
+ this.excelRowList = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_data;
104
+ }
105
+ this.fileType = res.data.data.fileType
106
+ }
107
+ this.$nextTick(() => {
108
+ if (this.fileType === 'XLS' || this.fileType === 'XLSX'){
109
+ let dom = document.getElementById('drawer_content_pre');
110
+ if (dom){
111
+ dom.style.height = 'calc(100% - 90px)'
112
+ }
113
+ }
114
+ })
115
+ })
116
+ },
117
+ currentChange (value) {
118
+ this.currentPage = value - 1;
119
+ this.scrollToParagraph()
120
+ },
121
+ prev(){
122
+ if (this.currentPage == 0){
123
+ return
124
+ }
125
+ this.currentPage--;
126
+ this.scrollToParagraph()
127
+ },
128
+ next(){
129
+ if (this.currentPage === (this.splitParagraph.length - 1)){
130
+ return
131
+ }
132
+ this.currentPage++;
133
+ this.scrollToParagraph()
134
+ },
135
+ async scrollToParagraph(type){
136
+ if (this.fileType == 'PDF') {
137
+ let currentPage = this.splitParagraph[this.currentPage];
138
+ let page = 1;
139
+ if (currentPage){
140
+ page = currentPage.original_paragraph[0].page
141
+ }
142
+ await this.$refs.pdfView.loadPage(page);
143
+ this.$refs.pdfView.jumpToHighlight(this.currentPage)
144
+ } else if (this.fileType == 'DOC' || this.fileType == 'DOCX' || this.fileType == 'TXT'){
145
+ if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].original_paragraph){
146
+ const id = this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id;
147
+ let dom = document.getElementById(id);
148
+ const paragraphs = this.$el.querySelectorAll(`[paragraph-id="${this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id}"]`);
149
+ if (dom){
150
+ dom.scrollIntoView({ behavior: 'smooth' });
151
+ }
152
+ if (paragraphs && paragraphs.length > 0){
153
+ paragraphs[0].scrollIntoView({ behavior: 'smooth' })
154
+ }
155
+ if (type === 'first'){
156
+ if (dom){
157
+ dom.classList.add('animation')
158
+ setTimeout(() => {
159
+ dom.classList.remove('animation')
160
+ }, 3000)
161
+ }
162
+ if (paragraphs && paragraphs.length > 0){
163
+ paragraphs[0].classList.add('animation')
164
+ setTimeout(() => {
165
+ paragraphs[0].classList.remove('animation')
166
+ }, 3000)
167
+ }
168
+ } else {
169
+ for (let i=0;i<this.splitParagraph[this.currentPage].original_paragraph.length;i++){
170
+ const id = this.splitParagraph[this.currentPage].original_paragraph[i].paragraph_id;
171
+ const dom = document.getElementById(id);
172
+ if (dom){
173
+ dom.classList.add('animation')
174
+ setTimeout(() => {
175
+ dom.classList.remove('animation')
176
+ }, 3000)
177
+ }
178
+ if (paragraphs && paragraphs.length > 0){
179
+ paragraphs[0].classList.add('animation')
180
+ setTimeout(() => {
181
+ paragraphs[0].classList.remove('animation')
182
+ }, 3000)
183
+ }
184
+ }
185
+ }
186
+ } else if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].tableId){
187
+ const id = this.splitParagraph[this.currentPage].tableId;
188
+ const dom = document.getElementById(id);
189
+ if (dom){
190
+ dom.scrollIntoView({ behavior: 'smooth' });
191
+ }
192
+ }
193
+ }
194
+ }
195
+ },
196
+ mounted() {
197
+ this.getLocationInfo();
198
+ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
199
+ this.isPC = false
200
+ } else {
201
+ this.isPC = true
202
+ }
203
+ }
204
+ };
205
+ </script>
206
+
207
+ <style scoped lang="less">
208
+ .positionView{
209
+ height: 100%;
210
+ .has-footer{
211
+ height: calc(100% - 60px);
212
+ }
213
+ .no-footer{
214
+ height: 100%;
215
+ }
216
+ .btn_footer {
217
+ width: 100%;
218
+ height: 60px;
219
+ display: flex;
220
+ align-items: center;
221
+ justify-content: space-around;
222
+ position: absolute;
223
+ bottom: 0px;
224
+ left: 0;
225
+ z-index: 999;
226
+ background: #ffffff;
227
+
228
+ .prev,
229
+ .next {
230
+ width: 35%;
231
+ height: 40px;
232
+ display: flex;
233
+ align-items: center;
234
+ justify-content: center;
235
+ border-radius: 50px;
236
+ cursor: pointer;
237
+ }
238
+
239
+ .prev {
240
+ background: #F2F5FA;
241
+ color: #000;
242
+ }
243
+
244
+ .next {
245
+ background: #366aff;
246
+ color: #ffffff;
247
+ }
248
+ }
249
+ #pagination {
250
+ .total-class {
251
+ margin-right: 13px;
252
+ font-weight: 400;
253
+ }
254
+
255
+ position: absolute;
256
+ bottom: 0px;
257
+ right: 0;
258
+ width: 100%;
259
+ display: flex;
260
+ align-items: center;
261
+ justify-content: center;
262
+ height: 50px;
263
+ background-color: white;
264
+ box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
265
+ border-radius: 5px;
266
+ z-index: 1000;
267
+
268
+
269
+
270
+ /deep/.el-pagination {
271
+ margin-right: 110px;
272
+ }
273
+
274
+ /deep/.el-pager {
275
+ background: #EDF0F6;
276
+ border-radius: 15px;
277
+ }
278
+
279
+ /deep/.el-pagination.is-background .btn-next {
280
+ width: 30px;
281
+ height: 30px;
282
+ background: #EDF0F6;
283
+ border-radius: 50%;
284
+ }
285
+
286
+ /deep/.el-pagination .btn-next {
287
+ width: 30px;
288
+ height: 30px;
289
+ background: #EDF0F6;
290
+ border-radius: 50%;
291
+ padding-left: 0;
292
+ margin-left: 5px;
293
+ }
294
+
295
+ /deep/.el-pagination .btn-prev {
296
+ width: 30px;
297
+ height: 30px;
298
+ background: #EDF0F6;
299
+ border-radius: 50%;
300
+ padding-right: 0;
301
+ margin-right: 5px;
302
+ }
303
+
304
+ /deep/.el-pagination button {
305
+ padding: 0;
306
+ min-width: 30px;
307
+ }
308
+
309
+ /deep/.el-pager li {
310
+ background: #EDF0F6;
311
+ height: 30px;
312
+ min-width: 30px;
313
+ line-height: 30px;
314
+ font-size: 12px;
315
+ color: #717b90;
316
+ }
317
+
318
+ /deep/.el-pager li:first-child {
319
+ border-bottom-left-radius: 15px !important;
320
+ border-top-left-radius: 15px !important;
321
+ }
322
+
323
+ /deep/.el-pager li:last-child {
324
+ border-top-right-radius: 15px !important;
325
+ border-bottom-right-radius: 15px !important;
326
+ }
327
+
328
+ /deep/.el-pager li.active {
329
+ width: 30px;
330
+ height: 30px;
331
+ min-width: 30px;
332
+ background: #366AFF;
333
+ border: 3px solid #A1B9FF;
334
+ border-radius: 50%;
335
+ line-height: 24px;
336
+ color: white;
337
+ }
338
+
339
+ /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
340
+ background: #366AFF;
341
+ }
342
+ }
343
+ }
344
+ .animation {
345
+ animation-name: highlight;
346
+ animation-duration: 4s;
347
+ }
348
+
349
+ @keyframes highlight {
350
+ 0% {
351
+ background: rgba(255, 136, 0, 0.3);
352
+ }
353
+
354
+ 25% {
355
+ background: rgba(255, 136, 0, 0.6);
356
+ }
357
+
358
+ 50% {
359
+ background: rgba(255, 136, 0, 0.3);
360
+ }
361
+
362
+ 75% {
363
+ background: rgba(255, 136, 0, 0.6);
364
+ }
365
+
366
+ 100% {
367
+ background: rgba(255, 136, 0, 0.3);
368
+ }
369
+ }
370
+ </style>