askbot-dragon 88.0.43 → 88.1.1

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 (38) hide show
  1. package/npminstall-debug.log +208 -0
  2. package/package.json +14 -14
  3. package/public/index.html +2 -2
  4. package/src/assets/js/obsBrowser.js +3 -2
  5. package/src/components/ActionAlertIframe.vue +1 -0
  6. package/src/components/AiGuide.vue +1 -1
  7. package/src/components/AnswerDocknowledge.vue +167 -54
  8. package/src/components/ConversationContainer.vue +16 -9
  9. package/src/components/MyEditor.vue +1 -1
  10. package/src/components/QwFeedback.vue +2 -1
  11. package/src/components/actionSatisfaction.vue +2 -2
  12. package/src/components/answerRadio.vue +59 -4
  13. package/src/components/assetDetails.vue +1 -1
  14. package/src/components/assetMessage.vue +14 -13
  15. package/src/components/associationIntention.vue +2 -2
  16. package/src/components/fielListView.vue +1 -1
  17. package/src/components/formTemplate.vue +24 -3
  18. package/src/components/intelligentSummary.vue +15 -12
  19. package/src/components/kkview.vue +0 -10
  20. package/src/components/markDownText.vue +798 -55
  21. package/src/components/myPopup.vue +14 -11
  22. package/src/components/pagination.vue +129 -0
  23. package/src/components/pdfPosition.vue +67 -67
  24. package/src/components/popup.vue +8 -7
  25. package/src/components/preview/docView.vue +114 -0
  26. package/src/components/preview/excelView.vue +191 -0
  27. package/src/components/preview/newPositionPreview.vue +385 -0
  28. package/src/components/preview/pdfView.vue +824 -0
  29. package/src/components/previewDoc.vue +1 -0
  30. package/src/components/previewPdf.vue +343 -65
  31. package/src/components/receiverMessagePlatform.vue +24 -20
  32. package/src/components/senderMessagePlatform.vue +19 -11
  33. package/src/components/tree.vue +2 -2
  34. package/src/components/welcomeKnowledgeFile.vue +5 -2
  35. package/src/components/welcomeSuggest.vue +1 -1
  36. package/src/locales/cn.json +99 -0
  37. package/src/locales/en.json +99 -0
  38. package/src/main.js +19 -0
@@ -0,0 +1,385 @@
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
+ let original_paragraph = []
79
+ for (let i=0;i<res.data.data.length;i++){
80
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.splitParagraph){
81
+ this.splitParagraph.push(res.data.data[i].paragraphChunkInfo.splitParagraph)
82
+ }
83
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.tableChunkData){
84
+ if (res.data.data[i].paragraphChunkInfo.tableChunkData.bbox && res.data.data[i].paragraphChunkInfo.tableChunkData.bbox.length > 0){
85
+ let obj = {
86
+ page:res.data.data[i].paragraphChunkInfo.tableChunkData.page,
87
+ position:res.data.data[i].paragraphChunkInfo.tableChunkData.bbox
88
+ }
89
+ original_paragraph.push(obj)
90
+ } else {
91
+ this.tableChunkData.push(res.data.data[i].paragraphChunkInfo.tableChunkData)
92
+ }
93
+ }
94
+ }
95
+ if (original_paragraph.length > 0){
96
+ this.splitParagraph.push({
97
+ original_paragraph
98
+ })
99
+ }
100
+ }
101
+ }
102
+ this.splitParagraph = this.splitParagraph.concat(this.tableChunkData);
103
+ console.log('splitParagraph',this.splitParagraph,this.tableChunkData)
104
+ this.getParseInfo();
105
+ })
106
+ },
107
+ getParseInfo(){
108
+ let url = '/knowledge-api/correction/knowledge-parse-info/' + this.knowledgeId;
109
+ this.$http.get(url).then(res => {
110
+ console.log('getParseInfo',res)
111
+ if (res.data.code == 0 && res.data.data){
112
+ this.parseInfo = res.data.data;
113
+ if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.docChunkData){
114
+ this.html_result = res.data.data.extractChunkInfo.docChunkData.html_result;
115
+ }
116
+ if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.tableChunkData && res.data.data.extractChunkInfo.tableChunkData.length > 0){
117
+ this.excelHeaderData = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_header;
118
+ this.excelRowList = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_data;
119
+ }
120
+ this.fileType = res.data.data.fileType
121
+ }
122
+ this.$nextTick(() => {
123
+ if (this.fileType === 'XLS' || this.fileType === 'XLSX'){
124
+ let dom = document.getElementById('drawer_content_pre');
125
+ if (dom){
126
+ dom.style.height = 'calc(100% - 90px)'
127
+ }
128
+ }
129
+ })
130
+ })
131
+ },
132
+ currentChange (value) {
133
+ this.currentPage = value - 1;
134
+ this.scrollToParagraph()
135
+ },
136
+ prev(){
137
+ if (this.currentPage == 0){
138
+ return
139
+ }
140
+ this.currentPage--;
141
+ this.scrollToParagraph()
142
+ },
143
+ next(){
144
+ if (this.currentPage === (this.splitParagraph.length - 1)){
145
+ return
146
+ }
147
+ this.currentPage++;
148
+ this.scrollToParagraph()
149
+ },
150
+ async scrollToParagraph(type){
151
+ if (this.fileType == 'PDF') {
152
+ let currentPage = this.splitParagraph[this.currentPage];
153
+ let page = 1;
154
+ if (currentPage){
155
+ page = currentPage.original_paragraph[0].page
156
+ }
157
+ await this.$refs.pdfView.loadPage(page);
158
+ this.$refs.pdfView.jumpToHighlight(this.currentPage)
159
+ } else if (this.fileType == 'DOC' || this.fileType == 'DOCX' || this.fileType == 'TXT'){
160
+ if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].original_paragraph){
161
+ const id = this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id;
162
+ let dom = document.getElementById(id);
163
+ const paragraphs = this.$el.querySelectorAll(`[paragraph-id="${this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id}"]`);
164
+ if (dom){
165
+ dom.scrollIntoView({ behavior: 'smooth' });
166
+ }
167
+ if (paragraphs && paragraphs.length > 0){
168
+ paragraphs[0].scrollIntoView({ behavior: 'smooth' })
169
+ }
170
+ if (type === 'first'){
171
+ if (dom){
172
+ dom.classList.add('animation')
173
+ setTimeout(() => {
174
+ dom.classList.remove('animation')
175
+ }, 3000)
176
+ }
177
+ if (paragraphs && paragraphs.length > 0){
178
+ paragraphs[0].classList.add('animation')
179
+ setTimeout(() => {
180
+ paragraphs[0].classList.remove('animation')
181
+ }, 3000)
182
+ }
183
+ } else {
184
+ for (let i=0;i<this.splitParagraph[this.currentPage].original_paragraph.length;i++){
185
+ const id = this.splitParagraph[this.currentPage].original_paragraph[i].paragraph_id;
186
+ const dom = document.getElementById(id);
187
+ if (dom){
188
+ dom.classList.add('animation')
189
+ setTimeout(() => {
190
+ dom.classList.remove('animation')
191
+ }, 3000)
192
+ }
193
+ if (paragraphs && paragraphs.length > 0){
194
+ paragraphs[0].classList.add('animation')
195
+ setTimeout(() => {
196
+ paragraphs[0].classList.remove('animation')
197
+ }, 3000)
198
+ }
199
+ }
200
+ }
201
+ } else if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].tableId){
202
+ const id = this.splitParagraph[this.currentPage].tableId;
203
+ const dom = document.getElementById(id);
204
+ if (dom){
205
+ dom.scrollIntoView({ behavior: 'smooth' });
206
+ }
207
+ }
208
+ }
209
+ }
210
+ },
211
+ mounted() {
212
+ this.getLocationInfo();
213
+ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
214
+ this.isPC = false
215
+ } else {
216
+ this.isPC = true
217
+ }
218
+ }
219
+ };
220
+ </script>
221
+
222
+ <style scoped lang="less">
223
+ .positionView{
224
+ height: 100%;
225
+ .has-footer{
226
+ height: calc(100% - 60px);
227
+ }
228
+ .no-footer{
229
+ height: 100%;
230
+ }
231
+ .btn_footer {
232
+ width: 100%;
233
+ height: 60px;
234
+ display: flex;
235
+ align-items: center;
236
+ justify-content: space-around;
237
+ position: absolute;
238
+ bottom: 0px;
239
+ left: 0;
240
+ z-index: 999;
241
+ background: #ffffff;
242
+
243
+ .prev,
244
+ .next {
245
+ width: 35%;
246
+ height: 40px;
247
+ display: flex;
248
+ align-items: center;
249
+ justify-content: center;
250
+ border-radius: 50px;
251
+ cursor: pointer;
252
+ }
253
+
254
+ .prev {
255
+ background: #F2F5FA;
256
+ color: #000;
257
+ }
258
+
259
+ .next {
260
+ background: #366aff;
261
+ color: #ffffff;
262
+ }
263
+ }
264
+ #pagination {
265
+ .total-class {
266
+ margin-right: 13px;
267
+ font-weight: 400;
268
+ }
269
+
270
+ position: absolute;
271
+ bottom: 0px;
272
+ right: 0;
273
+ width: 100%;
274
+ display: flex;
275
+ align-items: center;
276
+ justify-content: center;
277
+ height: 50px;
278
+ background-color: white;
279
+ box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
280
+ border-radius: 5px;
281
+ z-index: 1000;
282
+
283
+
284
+
285
+ /deep/.el-pagination {
286
+ margin-right: 110px;
287
+ }
288
+
289
+ /deep/.el-pager {
290
+ background: #EDF0F6;
291
+ border-radius: 15px;
292
+ }
293
+
294
+ /deep/.el-pagination.is-background .btn-next {
295
+ width: 30px;
296
+ height: 30px;
297
+ background: #EDF0F6;
298
+ border-radius: 50%;
299
+ }
300
+
301
+ /deep/.el-pagination .btn-next {
302
+ width: 30px;
303
+ height: 30px;
304
+ background: #EDF0F6;
305
+ border-radius: 50%;
306
+ padding-left: 0;
307
+ margin-left: 5px;
308
+ }
309
+
310
+ /deep/.el-pagination .btn-prev {
311
+ width: 30px;
312
+ height: 30px;
313
+ background: #EDF0F6;
314
+ border-radius: 50%;
315
+ padding-right: 0;
316
+ margin-right: 5px;
317
+ }
318
+
319
+ /deep/.el-pagination button {
320
+ padding: 0;
321
+ min-width: 30px;
322
+ }
323
+
324
+ /deep/.el-pager li {
325
+ background: #EDF0F6;
326
+ height: 30px;
327
+ min-width: 30px;
328
+ line-height: 30px;
329
+ font-size: 12px;
330
+ color: #717b90;
331
+ }
332
+
333
+ /deep/.el-pager li:first-child {
334
+ border-bottom-left-radius: 15px !important;
335
+ border-top-left-radius: 15px !important;
336
+ }
337
+
338
+ /deep/.el-pager li:last-child {
339
+ border-top-right-radius: 15px !important;
340
+ border-bottom-right-radius: 15px !important;
341
+ }
342
+
343
+ /deep/.el-pager li.active {
344
+ width: 30px;
345
+ height: 30px;
346
+ min-width: 30px;
347
+ background: #366AFF;
348
+ border: 3px solid #A1B9FF;
349
+ border-radius: 50%;
350
+ line-height: 24px;
351
+ color: white;
352
+ }
353
+
354
+ /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
355
+ background: #366AFF;
356
+ }
357
+ }
358
+ }
359
+ .animation {
360
+ animation-name: highlight;
361
+ animation-duration: 4s;
362
+ }
363
+
364
+ @keyframes highlight {
365
+ 0% {
366
+ background: rgba(255, 136, 0, 0.3);
367
+ }
368
+
369
+ 25% {
370
+ background: rgba(255, 136, 0, 0.6);
371
+ }
372
+
373
+ 50% {
374
+ background: rgba(255, 136, 0, 0.3);
375
+ }
376
+
377
+ 75% {
378
+ background: rgba(255, 136, 0, 0.6);
379
+ }
380
+
381
+ 100% {
382
+ background: rgba(255, 136, 0, 0.3);
383
+ }
384
+ }
385
+ </style>