askbot-dragon 1.8.17-beta → 1.8.19-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.
Files changed (101) hide show
  1. package/README.md +27 -27
  2. package/babel.config.js +6 -6
  3. package/dragon.iml +7 -7
  4. package/package.json +60 -60
  5. package/public/index.html +73 -73
  6. package/src/App.vue +31 -31
  7. package/src/api/index.js +1 -1
  8. package/src/api/mock.http +2 -2
  9. package/src/api/requestUrl.js +185 -185
  10. package/src/assets/js/AliyunlssUtil.js +141 -141
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/common.js +265 -261
  13. package/src/assets/js/hammer.js +100 -100
  14. package/src/assets/js/script.js +36 -36
  15. package/src/assets/less/common.css +6773 -6773
  16. package/src/assets/less/converSationContainer/common.less +199 -199
  17. package/src/assets/less/converSationContainer/converSatonContainer.less +486 -486
  18. package/src/assets/less/iconfont.css +37 -37
  19. package/src/assets/less/ticketMessage.less +294 -294
  20. package/src/assets/less/variables.less +122 -122
  21. package/src/components/ActionAlertIframe.vue +178 -178
  22. package/src/components/AiGuide.vue +435 -435
  23. package/src/components/AnswerDocknowledge.vue +1205 -1205
  24. package/src/components/AnswerVoice.vue +286 -286
  25. package/src/components/AskIFrame.vue +15 -15
  26. package/src/components/ConversationContainer.vue +10684 -10684
  27. package/src/components/FileType.vue +86 -86
  28. package/src/components/Message.vue +27 -27
  29. package/src/components/MyEditor.vue +344 -344
  30. package/src/components/QwFeedback.vue +303 -303
  31. package/src/components/actionSatisfaction.vue +109 -109
  32. package/src/components/actionSendToBot.vue +64 -64
  33. package/src/components/answerDissatisfaction.vue +64 -64
  34. package/src/components/answerRadio.vue +261 -261
  35. package/src/components/ask-components/DissatisfactionOptions.vue +58 -58
  36. package/src/components/ask-components/Msgloading.vue +38 -38
  37. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  38. package/src/components/askVideo.vue +264 -264
  39. package/src/components/assetDetails.vue +379 -379
  40. package/src/components/assetMessage.vue +231 -231
  41. package/src/components/associationIntention.vue +418 -418
  42. package/src/components/attachmentPreview.vue +92 -92
  43. package/src/components/botActionSatisfactor.vue +70 -70
  44. package/src/components/chatContent.vue +514 -514
  45. package/src/components/feedBack.vue +138 -138
  46. package/src/components/fielListView.vue +352 -352
  47. package/src/components/file/AliyunOssComponents.vue +108 -108
  48. package/src/components/formTemplate.vue +3522 -3522
  49. package/src/components/imgView.vue +31 -31
  50. package/src/components/intelligentSummary.vue +236 -236
  51. package/src/components/interruptComponents/imageSelectionAnswer.vue +202 -202
  52. package/src/components/interruptComponents/multipleChoiceAnswer.vue +133 -133
  53. package/src/components/interruptComponents/singleChoiceAnswer.vue +81 -81
  54. package/src/components/kkview.vue +1130 -1130
  55. package/src/components/loadingProcess.vue +164 -164
  56. package/src/components/markDownText.vue +961 -961
  57. package/src/components/message/ActionAlertIframe.vue +112 -112
  58. package/src/components/message/ShopMessage.vue +164 -164
  59. package/src/components/message/TextMessage.vue +930 -930
  60. package/src/components/message/TicketMessage.vue +201 -201
  61. package/src/components/message/swiper/index.js +4 -4
  62. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  63. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  64. package/src/components/msgLoading.vue +231 -231
  65. package/src/components/myPopup.vue +75 -75
  66. package/src/components/newPdfPosition.vue +877 -877
  67. package/src/components/outputComponents/outputCom.vue +148 -148
  68. package/src/components/pagination.vue +129 -129
  69. package/src/components/pdfPosition.vue +1514 -1514
  70. package/src/components/popup.vue +230 -230
  71. package/src/components/preview/docView.vue +132 -132
  72. package/src/components/preview/excelView.vue +213 -213
  73. package/src/components/preview/newPositionPreview.vue +392 -392
  74. package/src/components/preview/pdfView.vue +833 -833
  75. package/src/components/previewDoc.vue +257 -257
  76. package/src/components/previewPdf.vue +1123 -1123
  77. package/src/components/previewWisdom.vue +251 -251
  78. package/src/components/receiverMessagePlatform.vue +71 -71
  79. package/src/components/recommend.vue +82 -82
  80. package/src/components/selector/hOption.vue +20 -20
  81. package/src/components/selector/hSelector.vue +199 -199
  82. package/src/components/selector/hWrapper.vue +216 -216
  83. package/src/components/senderMessagePlatform.vue +60 -60
  84. package/src/components/source/BotMessage.vue +24 -24
  85. package/src/components/source/CustomMessage.vue +24 -24
  86. package/src/components/test.vue +260 -260
  87. package/src/components/tree.vue +309 -309
  88. package/src/components/utils/AliyunIssUtil.js +103 -103
  89. package/src/components/utils/ckeditor.js +185 -185
  90. package/src/components/utils/format_date.js +25 -25
  91. package/src/components/utils/index.js +6 -6
  92. package/src/components/utils/math_utils.js +29 -29
  93. package/src/components/voiceComponent.vue +122 -122
  94. package/src/components/welcomeKnowledgeFile.vue +350 -350
  95. package/src/components/welcomeLlmCard.vue +146 -146
  96. package/src/components/welcomeSuggest.vue +99 -99
  97. package/src/locales/cn.json +99 -99
  98. package/src/locales/en.json +98 -98
  99. package/src/locales/jp.json +72 -72
  100. package/src/main.js +76 -76
  101. package/vue.config.js +54 -54
@@ -1,393 +1,393 @@
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' || fileType === 'HTML'"
6
- :html_result="html_result"
7
- :split_paragraphs="splitParagraph"
8
- ref="docView"
9
- :fileSuffix="fileType"
10
- :textWatermarkStr="textWatermarkStr"
11
- ></doc-view>
12
- <excel-view v-else-if="fileType === 'XLS' || fileType === 'XLSX'"
13
- ref="excelView"
14
- :headerData="excelHeaderData"
15
- :excelRowList="excelRowList"
16
- :tableChunkData="tableChunkData"
17
- :textWatermarkStr="textWatermarkStr"
18
- ></excel-view>
19
- <pdf-view v-else-if="fileType === 'PDF'" ref="pdfView" :split_paragraphs="splitParagraph" :ossPath="url" :isPC="isPC" :textWatermarkStr="textWatermarkStr"></pdf-view>
20
- </div>
21
- <template v-if="splitParagraph.length > 1 && fileType !== 'XLS' && fileType !== 'XLSX'">
22
- <div class="btn_footer" v-if="!isPC">
23
- <div class="prev" @click="prev">{{$t('dragonCommon.previous')}}</div>
24
- <div class="next" @click="next">{{$t('dragonCommon.next')}}</div>
25
- </div>
26
- <div id="pagination" v-if="isPC">
27
- <el-pagination :current-page="currentPage + 1" @current-change="currentChange" @prev-click="prev"
28
- @next-click="next" layout="slot, prev, pager, next" :page-size="1" :total="splitParagraph.length">
29
- <span class="total-class">{{$t('dragonCommon.answersGeneratedByPre')}} {{ splitParagraph.length }} {{$t('dragonCommon.answersGeneratedByAfter')}}</span>
30
- </el-pagination>
31
- </div>
32
- </template>
33
- </div>
34
- </template>
35
-
36
- <script>
37
- import DocView from "./docView";
38
- import ExcelView from "./excelView";
39
- import PdfView from "./pdfView";
40
- export default {
41
- name: "newPositionPreview",
42
- components: { PdfView, ExcelView, DocView },
43
- data(){
44
- return{
45
- tagId:[],
46
- newVersion:false,
47
- html_result:"",
48
- parseInfo:{},
49
- fileType:"",
50
- splitParagraph:[],
51
- isPC:true,
52
- currentPage:0,
53
- excelHeaderData:"",
54
- excelRowList:[],
55
- tableChunkData:[]
56
-
57
- }
58
- },
59
- props:{
60
- knowledgeId:{
61
- type:String,
62
- default:""
63
- },
64
- tagIds:{
65
- type:Array,
66
- default(){
67
- return []
68
- }
69
- },
70
- url:{
71
- type:String,
72
- default:""
73
- },
74
- textWatermarkStr: {
75
- type: String,
76
- default: ''
77
- }
78
- },
79
- methods:{
80
- getLocationInfo(){
81
- this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + this.tagIds.join(',')).then(res => {
82
- if (res.data.code == 0){
83
- if (res.data.data && res.data.data.length){
84
- let original_paragraph = []
85
- for (let i=0;i<res.data.data.length;i++){
86
- if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.splitParagraph){
87
- this.splitParagraph.push(res.data.data[i].paragraphChunkInfo.splitParagraph)
88
- }
89
- if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.tableChunkData){
90
- if (res.data.data[i].paragraphChunkInfo.tableChunkData.bbox && res.data.data[i].paragraphChunkInfo.tableChunkData.bbox.length > 0){
91
- let obj = {
92
- page:res.data.data[i].paragraphChunkInfo.tableChunkData.page,
93
- position:res.data.data[i].paragraphChunkInfo.tableChunkData.bbox
94
- }
95
- original_paragraph.push(obj)
96
- } else {
97
- this.tableChunkData.push(res.data.data[i].paragraphChunkInfo.tableChunkData)
98
- }
99
- }
100
- }
101
- if (original_paragraph.length > 0){
102
- this.splitParagraph.push({
103
- original_paragraph
104
- })
105
- }
106
- }
107
- }
108
- this.splitParagraph = this.splitParagraph.concat(this.tableChunkData);
109
- console.log('splitParagraph',this.splitParagraph,this.tableChunkData)
110
- this.getParseInfo();
111
- })
112
- },
113
- getParseInfo(){
114
- let url = '/knowledge-api/correction/knowledge-parse-info/' + this.knowledgeId;
115
- this.$http.get(url).then(res => {
116
- console.log('getParseInfo',res)
117
- if (res.data.code == 0 && res.data.data){
118
- this.parseInfo = res.data.data;
119
- if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.docChunkData){
120
- this.html_result = res.data.data.extractChunkInfo.docChunkData.html_result;
121
- }
122
- if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.tableChunkData && res.data.data.extractChunkInfo.tableChunkData.length > 0){
123
- this.excelHeaderData = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_header;
124
- this.excelRowList = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_data;
125
- }
126
- this.fileType = res.data.data.fileType
127
- }
128
- this.$nextTick(() => {
129
- if (this.fileType === 'XLS' || this.fileType === 'XLSX'){
130
- let dom = document.getElementById('drawer_content_pre');
131
- if (dom){
132
- dom.style.height = 'calc(100% - 90px)'
133
- }
134
- }
135
- })
136
- })
137
- },
138
- currentChange (value) {
139
- this.currentPage = value - 1;
140
- this.scrollToParagraph()
141
- },
142
- prev(){
143
- if (this.currentPage == 0){
144
- return
145
- }
146
- this.currentPage--;
147
- this.scrollToParagraph()
148
- },
149
- next(){
150
- if (this.currentPage === (this.splitParagraph.length - 1)){
151
- return
152
- }
153
- this.currentPage++;
154
- this.scrollToParagraph()
155
- },
156
- async scrollToParagraph(type){
157
- if (this.fileType == 'PDF') {
158
- let currentPage = this.splitParagraph[this.currentPage];
159
- let page = 1;
160
- if (currentPage){
161
- page = currentPage.original_paragraph[0].page
162
- }
163
- await this.$refs.pdfView.loadPage(page);
164
- this.$refs.pdfView.jumpToHighlight(this.currentPage)
165
- } else if (this.fileType == 'DOC' || this.fileType == 'DOCX' || this.fileType == 'TXT'){
166
- if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].original_paragraph){
167
- const id = this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id;
168
- let dom = document.getElementById(id);
169
- const paragraphs = this.$el.querySelectorAll(`[paragraph-id="${this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id}"]`);
170
- if (dom){
171
- dom.scrollIntoView({ behavior: 'smooth' });
172
- }
173
- if (paragraphs && paragraphs.length > 0){
174
- paragraphs[0].scrollIntoView({ behavior: 'smooth' })
175
- }
176
- if (type === 'first'){
177
- if (dom){
178
- dom.classList.add('animation')
179
- setTimeout(() => {
180
- dom.classList.remove('animation')
181
- }, 3000)
182
- }
183
- if (paragraphs && paragraphs.length > 0){
184
- paragraphs[0].classList.add('animation')
185
- setTimeout(() => {
186
- paragraphs[0].classList.remove('animation')
187
- }, 3000)
188
- }
189
- } else {
190
- for (let i=0;i<this.splitParagraph[this.currentPage].original_paragraph.length;i++){
191
- const id = this.splitParagraph[this.currentPage].original_paragraph[i].paragraph_id;
192
- const dom = document.getElementById(id);
193
- if (dom){
194
- dom.classList.add('animation')
195
- setTimeout(() => {
196
- dom.classList.remove('animation')
197
- }, 3000)
198
- }
199
- if (paragraphs && paragraphs.length > 0){
200
- paragraphs[0].classList.add('animation')
201
- setTimeout(() => {
202
- paragraphs[0].classList.remove('animation')
203
- }, 3000)
204
- }
205
- }
206
- }
207
- } else if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].tableId){
208
- const id = this.splitParagraph[this.currentPage].tableId;
209
- const dom = document.getElementById(id);
210
- if (dom){
211
- dom.scrollIntoView({ behavior: 'smooth' });
212
- }
213
- }
214
- }
215
- }
216
- },
217
- mounted() {
218
- this.getLocationInfo();
219
- if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
220
- this.isPC = false
221
- } else {
222
- this.isPC = true
223
- }
224
- }
225
- };
226
- </script>
227
-
228
- <style scoped lang="less">
229
- @import "../../assets/less/variables.less";
230
-
231
- .positionView{
232
- height: 100%;
233
- .has-footer{
234
- height: calc(100% - 60px);
235
- }
236
- .no-footer{
237
- height: 100%;
238
- }
239
- .btn_footer {
240
- width: 100%;
241
- height: 60px;
242
- display: flex;
243
- align-items: center;
244
- justify-content: space-around;
245
- position: absolute;
246
- bottom: 0px;
247
- left: 0;
248
- z-index: 999;
249
- background: @background-color-light;
250
-
251
- .prev,
252
- .next {
253
- width: 35%;
254
- height: 40px;
255
- display: flex;
256
- align-items: center;
257
- justify-content: center;
258
- border-radius: 50px;
259
- cursor: pointer;
260
- }
261
-
262
- .prev {
263
- background: @background-color-custom;
264
- color: @font-primary-color;
265
- }
266
-
267
- .next {
268
- background: @primary-color;
269
- color: @font-primary-light-color;
270
- }
271
- }
272
- #pagination {
273
- .total-class {
274
- margin-right: 13px;
275
- font-weight: 400;
276
- }
277
-
278
- position: absolute;
279
- bottom: 0px;
280
- right: 0;
281
- width: 100%;
282
- display: flex;
283
- align-items: center;
284
- justify-content: center;
285
- height: 50px;
286
- background-color: @background-color-light;
287
- box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
288
- border-radius: 5px;
289
- z-index: 1000;
290
-
291
-
292
-
293
- /deep/.el-pagination {
294
- margin-right: 110px;
295
- }
296
-
297
- /deep/.el-pager {
298
- background: @background-color-pagination;
299
- border-radius: 15px;
300
- }
301
-
302
- /deep/.el-pagination.is-background .btn-next {
303
- width: 30px;
304
- height: 30px;
305
- background: @background-color-pagination;
306
- border-radius: 50%;
307
- }
308
-
309
- /deep/.el-pagination .btn-next {
310
- width: 30px;
311
- height: 30px;
312
- background: @background-color-pagination;
313
- border-radius: 50%;
314
- padding-left: 0;
315
- margin-left: 5px;
316
- }
317
-
318
- /deep/.el-pagination .btn-prev {
319
- width: 30px;
320
- height: 30px;
321
- background: @background-color-pagination;
322
- border-radius: 50%;
323
- padding-right: 0;
324
- margin-right: 5px;
325
- }
326
-
327
- /deep/.el-pagination button {
328
- padding: 0;
329
- min-width: 30px;
330
- }
331
-
332
- /deep/.el-pager li {
333
- background: @background-color-pagination;
334
- height: 30px;
335
- min-width: 30px;
336
- line-height: 30px;
337
- font-size: 12px;
338
- color: @font-pagination-color;
339
- }
340
-
341
- /deep/.el-pager li:first-child {
342
- border-bottom-left-radius: 15px !important;
343
- border-top-left-radius: 15px !important;
344
- }
345
-
346
- /deep/.el-pager li:last-child {
347
- border-top-right-radius: 15px !important;
348
- border-bottom-right-radius: 15px !important;
349
- }
350
-
351
- /deep/.el-pager li.active {
352
- width: 30px;
353
- height: 30px;
354
- min-width: 30px;
355
- background: @primary-color;
356
- border: 3px solid @border-color-copy;
357
- border-radius: 50%;
358
- line-height: 24px;
359
- color: @font-primary-light-color;
360
- }
361
-
362
- /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
363
- background: @primary-color;
364
- }
365
- }
366
- }
367
- .animation {
368
- animation-name: highlight;
369
- animation-duration: 4s;
370
- }
371
-
372
- @keyframes highlight {
373
- 0% {
374
- background: rgba(255, 136, 0, 0.3);
375
- }
376
-
377
- 25% {
378
- background: rgba(255, 136, 0, 0.6);
379
- }
380
-
381
- 50% {
382
- background: rgba(255, 136, 0, 0.3);
383
- }
384
-
385
- 75% {
386
- background: rgba(255, 136, 0, 0.6);
387
- }
388
-
389
- 100% {
390
- background: rgba(255, 136, 0, 0.3);
391
- }
392
- }
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' || fileType === 'HTML'"
6
+ :html_result="html_result"
7
+ :split_paragraphs="splitParagraph"
8
+ ref="docView"
9
+ :fileSuffix="fileType"
10
+ :textWatermarkStr="textWatermarkStr"
11
+ ></doc-view>
12
+ <excel-view v-else-if="fileType === 'XLS' || fileType === 'XLSX'"
13
+ ref="excelView"
14
+ :headerData="excelHeaderData"
15
+ :excelRowList="excelRowList"
16
+ :tableChunkData="tableChunkData"
17
+ :textWatermarkStr="textWatermarkStr"
18
+ ></excel-view>
19
+ <pdf-view v-else-if="fileType === 'PDF'" ref="pdfView" :split_paragraphs="splitParagraph" :ossPath="url" :isPC="isPC" :textWatermarkStr="textWatermarkStr"></pdf-view>
20
+ </div>
21
+ <template v-if="splitParagraph.length > 1 && fileType !== 'XLS' && fileType !== 'XLSX'">
22
+ <div class="btn_footer" v-if="!isPC">
23
+ <div class="prev" @click="prev">{{$t('dragonCommon.previous')}}</div>
24
+ <div class="next" @click="next">{{$t('dragonCommon.next')}}</div>
25
+ </div>
26
+ <div id="pagination" v-if="isPC">
27
+ <el-pagination :current-page="currentPage + 1" @current-change="currentChange" @prev-click="prev"
28
+ @next-click="next" layout="slot, prev, pager, next" :page-size="1" :total="splitParagraph.length">
29
+ <span class="total-class">{{$t('dragonCommon.answersGeneratedByPre')}} {{ splitParagraph.length }} {{$t('dragonCommon.answersGeneratedByAfter')}}</span>
30
+ </el-pagination>
31
+ </div>
32
+ </template>
33
+ </div>
34
+ </template>
35
+
36
+ <script>
37
+ import DocView from "./docView";
38
+ import ExcelView from "./excelView";
39
+ import PdfView from "./pdfView";
40
+ export default {
41
+ name: "newPositionPreview",
42
+ components: { PdfView, ExcelView, DocView },
43
+ data(){
44
+ return{
45
+ tagId:[],
46
+ newVersion:false,
47
+ html_result:"",
48
+ parseInfo:{},
49
+ fileType:"",
50
+ splitParagraph:[],
51
+ isPC:true,
52
+ currentPage:0,
53
+ excelHeaderData:"",
54
+ excelRowList:[],
55
+ tableChunkData:[]
56
+
57
+ }
58
+ },
59
+ props:{
60
+ knowledgeId:{
61
+ type:String,
62
+ default:""
63
+ },
64
+ tagIds:{
65
+ type:Array,
66
+ default(){
67
+ return []
68
+ }
69
+ },
70
+ url:{
71
+ type:String,
72
+ default:""
73
+ },
74
+ textWatermarkStr: {
75
+ type: String,
76
+ default: ''
77
+ }
78
+ },
79
+ methods:{
80
+ getLocationInfo(){
81
+ this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + this.tagIds.join(',')).then(res => {
82
+ if (res.data.code == 0){
83
+ if (res.data.data && res.data.data.length){
84
+ let original_paragraph = []
85
+ for (let i=0;i<res.data.data.length;i++){
86
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.splitParagraph){
87
+ this.splitParagraph.push(res.data.data[i].paragraphChunkInfo.splitParagraph)
88
+ }
89
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.tableChunkData){
90
+ if (res.data.data[i].paragraphChunkInfo.tableChunkData.bbox && res.data.data[i].paragraphChunkInfo.tableChunkData.bbox.length > 0){
91
+ let obj = {
92
+ page:res.data.data[i].paragraphChunkInfo.tableChunkData.page,
93
+ position:res.data.data[i].paragraphChunkInfo.tableChunkData.bbox
94
+ }
95
+ original_paragraph.push(obj)
96
+ } else {
97
+ this.tableChunkData.push(res.data.data[i].paragraphChunkInfo.tableChunkData)
98
+ }
99
+ }
100
+ }
101
+ if (original_paragraph.length > 0){
102
+ this.splitParagraph.push({
103
+ original_paragraph
104
+ })
105
+ }
106
+ }
107
+ }
108
+ this.splitParagraph = this.splitParagraph.concat(this.tableChunkData);
109
+ console.log('splitParagraph',this.splitParagraph,this.tableChunkData)
110
+ this.getParseInfo();
111
+ })
112
+ },
113
+ getParseInfo(){
114
+ let url = '/knowledge-api/correction/knowledge-parse-info/' + this.knowledgeId;
115
+ this.$http.get(url).then(res => {
116
+ console.log('getParseInfo',res)
117
+ if (res.data.code == 0 && res.data.data){
118
+ this.parseInfo = res.data.data;
119
+ if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.docChunkData){
120
+ this.html_result = res.data.data.extractChunkInfo.docChunkData.html_result;
121
+ }
122
+ if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.tableChunkData && res.data.data.extractChunkInfo.tableChunkData.length > 0){
123
+ this.excelHeaderData = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_header;
124
+ this.excelRowList = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_data;
125
+ }
126
+ this.fileType = res.data.data.fileType
127
+ }
128
+ this.$nextTick(() => {
129
+ if (this.fileType === 'XLS' || this.fileType === 'XLSX'){
130
+ let dom = document.getElementById('drawer_content_pre');
131
+ if (dom){
132
+ dom.style.height = 'calc(100% - 90px)'
133
+ }
134
+ }
135
+ })
136
+ })
137
+ },
138
+ currentChange (value) {
139
+ this.currentPage = value - 1;
140
+ this.scrollToParagraph()
141
+ },
142
+ prev(){
143
+ if (this.currentPage == 0){
144
+ return
145
+ }
146
+ this.currentPage--;
147
+ this.scrollToParagraph()
148
+ },
149
+ next(){
150
+ if (this.currentPage === (this.splitParagraph.length - 1)){
151
+ return
152
+ }
153
+ this.currentPage++;
154
+ this.scrollToParagraph()
155
+ },
156
+ async scrollToParagraph(type){
157
+ if (this.fileType == 'PDF') {
158
+ let currentPage = this.splitParagraph[this.currentPage];
159
+ let page = 1;
160
+ if (currentPage){
161
+ page = currentPage.original_paragraph[0].page
162
+ }
163
+ await this.$refs.pdfView.loadPage(page);
164
+ this.$refs.pdfView.jumpToHighlight(this.currentPage)
165
+ } else if (this.fileType == 'DOC' || this.fileType == 'DOCX' || this.fileType == 'TXT'){
166
+ if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].original_paragraph){
167
+ const id = this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id;
168
+ let dom = document.getElementById(id);
169
+ const paragraphs = this.$el.querySelectorAll(`[paragraph-id="${this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id}"]`);
170
+ if (dom){
171
+ dom.scrollIntoView({ behavior: 'smooth' });
172
+ }
173
+ if (paragraphs && paragraphs.length > 0){
174
+ paragraphs[0].scrollIntoView({ behavior: 'smooth' })
175
+ }
176
+ if (type === 'first'){
177
+ if (dom){
178
+ dom.classList.add('animation')
179
+ setTimeout(() => {
180
+ dom.classList.remove('animation')
181
+ }, 3000)
182
+ }
183
+ if (paragraphs && paragraphs.length > 0){
184
+ paragraphs[0].classList.add('animation')
185
+ setTimeout(() => {
186
+ paragraphs[0].classList.remove('animation')
187
+ }, 3000)
188
+ }
189
+ } else {
190
+ for (let i=0;i<this.splitParagraph[this.currentPage].original_paragraph.length;i++){
191
+ const id = this.splitParagraph[this.currentPage].original_paragraph[i].paragraph_id;
192
+ const dom = document.getElementById(id);
193
+ if (dom){
194
+ dom.classList.add('animation')
195
+ setTimeout(() => {
196
+ dom.classList.remove('animation')
197
+ }, 3000)
198
+ }
199
+ if (paragraphs && paragraphs.length > 0){
200
+ paragraphs[0].classList.add('animation')
201
+ setTimeout(() => {
202
+ paragraphs[0].classList.remove('animation')
203
+ }, 3000)
204
+ }
205
+ }
206
+ }
207
+ } else if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].tableId){
208
+ const id = this.splitParagraph[this.currentPage].tableId;
209
+ const dom = document.getElementById(id);
210
+ if (dom){
211
+ dom.scrollIntoView({ behavior: 'smooth' });
212
+ }
213
+ }
214
+ }
215
+ }
216
+ },
217
+ mounted() {
218
+ this.getLocationInfo();
219
+ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
220
+ this.isPC = false
221
+ } else {
222
+ this.isPC = true
223
+ }
224
+ }
225
+ };
226
+ </script>
227
+
228
+ <style scoped lang="less">
229
+ @import "../../assets/less/variables.less";
230
+
231
+ .positionView{
232
+ height: 100%;
233
+ .has-footer{
234
+ height: calc(100% - 60px);
235
+ }
236
+ .no-footer{
237
+ height: 100%;
238
+ }
239
+ .btn_footer {
240
+ width: 100%;
241
+ height: 60px;
242
+ display: flex;
243
+ align-items: center;
244
+ justify-content: space-around;
245
+ position: absolute;
246
+ bottom: 0px;
247
+ left: 0;
248
+ z-index: 999;
249
+ background: @background-color-light;
250
+
251
+ .prev,
252
+ .next {
253
+ width: 35%;
254
+ height: 40px;
255
+ display: flex;
256
+ align-items: center;
257
+ justify-content: center;
258
+ border-radius: 50px;
259
+ cursor: pointer;
260
+ }
261
+
262
+ .prev {
263
+ background: @background-color-custom;
264
+ color: @font-primary-color;
265
+ }
266
+
267
+ .next {
268
+ background: @primary-color;
269
+ color: @font-primary-light-color;
270
+ }
271
+ }
272
+ #pagination {
273
+ .total-class {
274
+ margin-right: 13px;
275
+ font-weight: 400;
276
+ }
277
+
278
+ position: absolute;
279
+ bottom: 0px;
280
+ right: 0;
281
+ width: 100%;
282
+ display: flex;
283
+ align-items: center;
284
+ justify-content: center;
285
+ height: 50px;
286
+ background-color: @background-color-light;
287
+ box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
288
+ border-radius: 5px;
289
+ z-index: 1000;
290
+
291
+
292
+
293
+ /deep/.el-pagination {
294
+ margin-right: 110px;
295
+ }
296
+
297
+ /deep/.el-pager {
298
+ background: @background-color-pagination;
299
+ border-radius: 15px;
300
+ }
301
+
302
+ /deep/.el-pagination.is-background .btn-next {
303
+ width: 30px;
304
+ height: 30px;
305
+ background: @background-color-pagination;
306
+ border-radius: 50%;
307
+ }
308
+
309
+ /deep/.el-pagination .btn-next {
310
+ width: 30px;
311
+ height: 30px;
312
+ background: @background-color-pagination;
313
+ border-radius: 50%;
314
+ padding-left: 0;
315
+ margin-left: 5px;
316
+ }
317
+
318
+ /deep/.el-pagination .btn-prev {
319
+ width: 30px;
320
+ height: 30px;
321
+ background: @background-color-pagination;
322
+ border-radius: 50%;
323
+ padding-right: 0;
324
+ margin-right: 5px;
325
+ }
326
+
327
+ /deep/.el-pagination button {
328
+ padding: 0;
329
+ min-width: 30px;
330
+ }
331
+
332
+ /deep/.el-pager li {
333
+ background: @background-color-pagination;
334
+ height: 30px;
335
+ min-width: 30px;
336
+ line-height: 30px;
337
+ font-size: 12px;
338
+ color: @font-pagination-color;
339
+ }
340
+
341
+ /deep/.el-pager li:first-child {
342
+ border-bottom-left-radius: 15px !important;
343
+ border-top-left-radius: 15px !important;
344
+ }
345
+
346
+ /deep/.el-pager li:last-child {
347
+ border-top-right-radius: 15px !important;
348
+ border-bottom-right-radius: 15px !important;
349
+ }
350
+
351
+ /deep/.el-pager li.active {
352
+ width: 30px;
353
+ height: 30px;
354
+ min-width: 30px;
355
+ background: @primary-color;
356
+ border: 3px solid @border-color-copy;
357
+ border-radius: 50%;
358
+ line-height: 24px;
359
+ color: @font-primary-light-color;
360
+ }
361
+
362
+ /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
363
+ background: @primary-color;
364
+ }
365
+ }
366
+ }
367
+ .animation {
368
+ animation-name: highlight;
369
+ animation-duration: 4s;
370
+ }
371
+
372
+ @keyframes highlight {
373
+ 0% {
374
+ background: rgba(255, 136, 0, 0.3);
375
+ }
376
+
377
+ 25% {
378
+ background: rgba(255, 136, 0, 0.6);
379
+ }
380
+
381
+ 50% {
382
+ background: rgba(255, 136, 0, 0.3);
383
+ }
384
+
385
+ 75% {
386
+ background: rgba(255, 136, 0, 0.6);
387
+ }
388
+
389
+ 100% {
390
+ background: rgba(255, 136, 0, 0.3);
391
+ }
392
+ }
393
393
  </style>