askbot-dragon 1.7.41-beta → 1.7.43-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 (35) hide show
  1. package/package.json +14 -13
  2. package/public/index.html +8 -10
  3. package/src/assets/js/AliyunlssUtil.js +49 -25
  4. package/src/assets/js/hammer.js +13 -2
  5. package/src/assets/less/converSationContainer/common.less +7 -0
  6. package/src/components/ActionAlertIframe.vue +24 -1
  7. package/src/components/AiGuide.vue +121 -154
  8. package/src/components/AnswerDocknowledge.vue +11 -7
  9. package/src/components/ConversationContainer.vue +99 -208
  10. package/src/components/MyEditor.vue +2 -1
  11. package/src/components/actionSatisfaction.vue +1 -1
  12. package/src/components/answerRadio.vue +1 -1
  13. package/src/components/askVideo.vue +23 -0
  14. package/src/components/associationIntention.vue +11 -7
  15. package/src/components/formTemplate.vue +54 -50
  16. package/src/components/intelligentSummary.vue +5 -1
  17. package/src/components/message/TextMessage.vue +5 -1
  18. package/src/components/message/swiper/ticketSwiper.vue +1 -1
  19. package/src/components/newPdfPosition.vue +878 -0
  20. package/src/components/pagination.vue +129 -0
  21. package/src/components/pdfPosition.vue +213 -33
  22. package/src/components/preview/docView.vue +107 -0
  23. package/src/components/preview/excelView.vue +177 -0
  24. package/src/components/preview/newPositionPreview.vue +338 -0
  25. package/src/components/preview/pdfView.vue +754 -0
  26. package/src/components/previewDoc.vue +4 -0
  27. package/src/components/previewPdf.vue +220 -127
  28. package/src/components/senderMessagePlatform.vue +4 -4
  29. package/src/components/utils/ckeditor.js +1 -1
  30. package/src/components/welcomeKnowledgeFile.vue +5 -1
  31. package/src/components/welcomeLlmCard.vue +5 -1
  32. package/src/locales/cn.json +72 -0
  33. package/src/locales/en.json +73 -0
  34. package/src/locales/jp.json +73 -0
  35. package/src/main.js +18 -0
@@ -0,0 +1,177 @@
1
+ <template>
2
+ <div class="excelView">
3
+ <table border="1" v-if="false">
4
+ <thead>
5
+ <tr>
6
+ <th v-for="(person2,index2) in headerArray" :key="index2">{{person2}}</th>
7
+ </tr>
8
+ </thead>
9
+ <tbody>
10
+ <tr v-for="(person, index) in rowDataList" :key="index" :id="person.id">
11
+ <td v-for="(person2,index2) in headerArray" :key="index2">
12
+ {{person[person2]}}
13
+ </td>
14
+ </tr>
15
+ </tbody>
16
+ </table>
17
+ <el-table
18
+ :data="pagedData"
19
+ border
20
+ ref="table"
21
+ :row-key="getRowKey"
22
+ :row-class-name="tableRowClassName"
23
+ height="100%"
24
+ style="width: 100%">
25
+ <template v-for="(item,index) in headerArray">
26
+ <el-table-column
27
+ :label="item"
28
+ :key="index"
29
+ min-width="100">
30
+ <template slot-scope="scope">
31
+ {{scope.row[item]}}
32
+ </template>
33
+ </el-table-column>
34
+ </template>
35
+ </el-table>
36
+ <pagination-page :pageSize="pageSize" :currentPage="currentPage" :total="rowDataList.length" @currentChange="handleCurrentChange"></pagination-page>
37
+ </div>
38
+ </template>
39
+
40
+ <script>
41
+
42
+ import PaginationPage from "../pagination";
43
+ export default {
44
+ name: "excelView",
45
+ components: { PaginationPage },
46
+ data(){
47
+ return{
48
+ rowData:[
49
+ {
50
+ "row_id": "659164be-19bd-4fd7-a47d-b04c3dbbfa6f",
51
+ "row_data_md": "| 王明宇 | 27 | 189 |",
52
+ "row_number": 2,
53
+ "table_html": "<table border='1' style='border-collapse:collapse;'><thead><tr><th>姓名1</th><th>年龄</th><th>身高</th></tr></thead><tbody><tr><td>王明宇</td><td>27</td><td>189</td></tr></tbody></table>"
54
+ },
55
+ {
56
+ "row_id": "fac98d6a-2580-4f62-8f50-61521debeeef",
57
+ "row_data_md": "| 老王 | 38 | 178 |",
58
+ "row_number": 3,
59
+ "table_html": "<table border='1' style='border-collapse:collapse;'><thead><tr><th>姓名1</th><th>年龄</th><th>身高</th></tr></thead><tbody><tr><td>老王</td><td>38</td><td>178</td></tr></tbody></table>"
60
+ },
61
+ ],
62
+ rowDataList:[],
63
+ headerArray:[],
64
+ currentPage:1,
65
+ pageSize:20,
66
+ colors: ['#E3EBFF', '#FFF5DC', '#FFE8D8','#D6F3EA','#FFF1C3'],
67
+ }
68
+ },
69
+ props:{
70
+ headerData:{
71
+ type:String,
72
+ default:""
73
+ },
74
+ excelRowList:{
75
+ type:Array,
76
+ default(){
77
+ return []
78
+ }
79
+ },
80
+ tableChunkData:{
81
+ type:Array,
82
+ default(){
83
+ return [{
84
+ "sheet_name": null,
85
+ "table_md": null,
86
+ "tableChunkText": "| 序号 | 电子色片 | 旧色号 | 颜色名称 | R68-Y32 17w77b06c L32-1 | 新 | 色卡页码 | -ICN色号 | R | G | B | C | M | Y | | 154 | 22 | B99-G01 81w11b08c L88-4 | OW060-4 | | 雪蓝 | 蓝色系 | 210 | 218 | 223 | 5.5761039841401502E-2 | 2.08606534553369E-2 | 0 | 0.12603452469972801 |",
87
+ "tableChunkId": "5e80ff30-ea7e-4c47-878b-59d9b1c833ce",
88
+ "tableId": null
89
+ }]
90
+ }
91
+ }
92
+ },
93
+ computed:{
94
+ pagedData() {
95
+ const start = (this.currentPage - 1) * this.pageSize;
96
+ const end = start + this.pageSize;
97
+ return this.rowDataList.slice(start, end);
98
+ }
99
+ },
100
+ methods:{
101
+ tableRowData(){
102
+ const headerString = this.headerData.trim().replace(/^\||\|$/g, '');
103
+
104
+ // 使用竖线作为分隔符来分割字符串
105
+ const headerArray = headerString.split('|').map(item => item.trim());
106
+ this.headerArray = headerArray
107
+ for (let i =0;i<this.excelRowList.length;i++){
108
+ // 去除字符串两端的竖线(如果它们存在的话)
109
+ const trimmedString = this.excelRowList[i].row_data_md.trim().replace(/^\||\|$/g, '');
110
+
111
+ // 使用竖线作为分隔符来分割字符串
112
+ const resultArray = trimmedString.split('|').map(item => item.trim());
113
+ let obj = {}
114
+ for (let j=0;j<headerArray.length;j++){
115
+ this.$set(obj,headerArray[j],resultArray[j])
116
+ this.$set(obj,'id',this.excelRowList[i].row_id)
117
+ }
118
+ this.rowDataList.push(obj);
119
+ }
120
+ this.$nextTick(() => {
121
+ this.setRowColor();
122
+ })
123
+ },
124
+ getRowKey(row){
125
+ return row.id
126
+ },
127
+ setRowColor(){
128
+ this.tableChunkData.forEach((item,index) => {
129
+ const colorIndex = index % this.colors.length;
130
+ let id = item.tableChunkId;
131
+ let dom = document.getElementsByClassName('setBgClass' + id);
132
+ console.log('dom',dom)
133
+ if (dom && dom.length > 0){
134
+ dom.forEach(doms => {
135
+ doms.style.backgroundColor = this.colors[colorIndex];
136
+ })
137
+ }
138
+ })
139
+ if (this.tableChunkData.length > 0){
140
+ this.scrollToRow(this.tableChunkData[0].tableChunkId)
141
+ }
142
+ },
143
+ tableRowClassName({ row }){
144
+ let id = this.tableChunkData.filter(item => item.tableChunkId == row.id);
145
+ if (id && id.length > 0){
146
+ return 'setBgClass' + id[0].tableChunkId
147
+ }
148
+ },
149
+ scrollToRow(rowId) {
150
+ this.$nextTick(() => {
151
+ const row = this.rowDataList.find(row => row.id === rowId);
152
+ if (row) {
153
+ this.$refs.table.setCurrentRow(row);
154
+ }
155
+ });
156
+ },
157
+ handleCurrentChange(val){
158
+ this.currentPage = val;
159
+ this.$nextTick(() => {
160
+ this.setRowColor();
161
+ })
162
+ }
163
+ },
164
+ mounted() {
165
+ this.tableRowData();
166
+ }
167
+ };
168
+ </script>
169
+
170
+ <style scoped lang="less">
171
+ .excelView{
172
+ height: 100%;
173
+ /deep/.setBgClass{
174
+ background-color: #E3EBFF!important;
175
+ }
176
+ }
177
+ </style>
@@ -0,0 +1,338 @@
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
+ ></doc-view>
10
+ <excel-view v-else-if="fileType === 'XLS' || fileType === 'XLSX'"
11
+ ref="excelView"
12
+ :headerData="excelHeaderData"
13
+ :excelRowList="excelRowList"
14
+ :tableChunkData="tableChunkData"
15
+ ></excel-view>
16
+ <pdf-view v-else-if="fileType === 'PDF'" ref="pdfView" :split_paragraphs="splitParagraph" :ossPath="url"></pdf-view>
17
+ </div>
18
+ <template v-if="splitParagraph.length > 1 && fileType !== 'XLS' && fileType !== 'XLSX'">
19
+ <div class="btn_footer" v-if="!isPC">
20
+ <div class="prev" @click="prev">上一段</div>
21
+ <div class="next" @click="next">下一段</div>
22
+ </div>
23
+ <div id="pagination" v-if="isPC">
24
+ <el-pagination :current-page="currentPage + 1" @current-change="currentChange" @prev-click="prev"
25
+ @next-click="next" layout="slot, prev, pager, next" :page-size="1" :total="splitParagraph.length">
26
+ <span class="total-class">答案由{{ splitParagraph.length }}段内容生成</span>
27
+ </el-pagination>
28
+ </div>
29
+ </template>
30
+ </div>
31
+ </template>
32
+
33
+ <script>
34
+ import DocView from "./docView";
35
+ import ExcelView from "./excelView";
36
+ import PdfView from "./pdfView";
37
+ export default {
38
+ name: "newPositionPreview",
39
+ components: { PdfView, ExcelView, DocView },
40
+ data(){
41
+ return{
42
+ tagId:[],
43
+ newVersion:false,
44
+ html_result:"",
45
+ parseInfo:{},
46
+ fileType:"",
47
+ splitParagraph:[],
48
+ isPC:true,
49
+ currentPage:0,
50
+ excelHeaderData:"",
51
+ excelRowList:[],
52
+ tableChunkData:[]
53
+
54
+ }
55
+ },
56
+ props:{
57
+ knowledgeId:{
58
+ type:String,
59
+ default:""
60
+ },
61
+ tagIds:{
62
+ type:Array,
63
+ default(){
64
+ return []
65
+ }
66
+ },
67
+ url:{
68
+ type:String,
69
+ default:""
70
+ }
71
+ },
72
+ methods:{
73
+ getLocationInfo(){
74
+ this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + this.tagIds.join(',')).then(res => {
75
+ if (res.data.code == 0){
76
+ if (res.data.data && res.data.data.length){
77
+ for (let i=0;i<res.data.data.length;i++){
78
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.splitParagraph){
79
+ this.splitParagraph.push(res.data.data[i].paragraphChunkInfo.splitParagraph)
80
+ }
81
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.tableChunkData){
82
+ this.tableChunkData.push(res.data.data[i].paragraphChunkInfo.tableChunkData)
83
+ }
84
+ }
85
+ }
86
+ }
87
+ this.splitParagraph = this.splitParagraph.concat(this.tableChunkData);
88
+ this.getParseInfo();
89
+ })
90
+ },
91
+ getParseInfo(){
92
+ let url = '/knowledge-api/correction/knowledge-parse-info/' + this.knowledgeId;
93
+ this.$http.get(url).then(res => {
94
+ console.log('getParseInfo',res)
95
+ if (res.data.code == 0 && res.data.data){
96
+ this.parseInfo = res.data.data;
97
+ if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.docChunkData){
98
+ this.html_result = res.data.data.extractChunkInfo.docChunkData.html_result;
99
+ }
100
+ if (res.data.data.extractChunkInfo && res.data.data.extractChunkInfo.tableChunkData && res.data.data.extractChunkInfo.tableChunkData.length > 0){
101
+ this.excelHeaderData = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_header;
102
+ this.excelRowList = res.data.data.extractChunkInfo.tableChunkData[0].table_md.table_data;
103
+ }
104
+ this.fileType = res.data.data.fileType
105
+ }
106
+ if (this.fileType === 'XLS' || this.fileType === 'XLSX'){
107
+ let dom = document.getElementById('drawer_content_pre');
108
+ dom.style.height = 'calc(100% - 90px)'
109
+ }
110
+ })
111
+ },
112
+ currentChange (value) {
113
+ this.currentPage = value - 1;
114
+ this.scrollToParagraph()
115
+ },
116
+ prev(){
117
+ this.currentPage--;
118
+ this.scrollToParagraph()
119
+ },
120
+ next(){
121
+ this.currentPage++;
122
+ this.scrollToParagraph()
123
+ },
124
+ scrollToParagraph(type){
125
+ if (this.fileType == 'PDF') {
126
+ this.$refs.pdfView.jumpToHighlight(this.currentPage)
127
+ } else if (this.fileType == 'DOC' || this.fileType == 'DOCX' || this.fileType == 'TXT'){
128
+ if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].original_paragraph){
129
+ const id = this.splitParagraph[this.currentPage].original_paragraph[0].paragraph_id;
130
+ const dom = document.getElementById(id);
131
+ if (dom){
132
+ dom.scrollIntoView({ behavior: 'smooth' });
133
+ }
134
+ if (type === 'first'){
135
+ if (dom){
136
+ dom.classList.add('animation')
137
+ setTimeout(() => {
138
+ dom.classList.remove('animation')
139
+ }, 3000)
140
+ }
141
+ } else {
142
+ for (let i=0;i<this.splitParagraph[this.currentPage].original_paragraph.length;i++){
143
+ const id = this.splitParagraph[this.currentPage].original_paragraph[i].paragraph_id;
144
+ const dom = document.getElementById(id);
145
+ if (dom){
146
+ dom.scrollIntoView({ behavior: 'smooth' });
147
+ dom.classList.add('animation')
148
+ setTimeout(() => {
149
+ dom.classList.remove('animation')
150
+ }, 3000)
151
+ }
152
+ }
153
+ }
154
+ } else if (this.splitParagraph[this.currentPage] && this.splitParagraph[this.currentPage].tableId){
155
+ const id = this.splitParagraph[this.currentPage].tableId;
156
+ const dom = document.getElementById(id);
157
+ if (dom){
158
+ dom.scrollIntoView({ behavior: 'smooth' });
159
+ }
160
+ }
161
+ }
162
+ }
163
+ },
164
+ mounted() {
165
+ this.getLocationInfo();
166
+ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
167
+ this.isPC = false
168
+ } else {
169
+ this.isPC = true
170
+ }
171
+ }
172
+ };
173
+ </script>
174
+
175
+ <style scoped lang="less">
176
+ .positionView{
177
+ height: 100%;
178
+ .has-footer{
179
+ height: calc(100% - 60px);
180
+ }
181
+ .no-footer{
182
+ height: 100%;
183
+ }
184
+ .btn_footer {
185
+ width: 100%;
186
+ height: 60px;
187
+ display: flex;
188
+ align-items: center;
189
+ justify-content: space-around;
190
+ position: absolute;
191
+ bottom: 0px;
192
+ left: 0;
193
+ z-index: 999;
194
+ background: #ffffff;
195
+
196
+ .prev,
197
+ .next {
198
+ width: 35%;
199
+ height: 40px;
200
+ display: flex;
201
+ align-items: center;
202
+ justify-content: center;
203
+ border-radius: 50px;
204
+ cursor: pointer;
205
+ }
206
+
207
+ .prev {
208
+ background: #F2F5FA;
209
+ color: #000;
210
+ }
211
+
212
+ .next {
213
+ background: #366aff;
214
+ color: #ffffff;
215
+ }
216
+ }
217
+ #pagination {
218
+ .total-class {
219
+ margin-right: 13px;
220
+ font-weight: 400;
221
+ }
222
+
223
+ position: absolute;
224
+ bottom: 0px;
225
+ right: 0;
226
+ width: 100%;
227
+ display: flex;
228
+ align-items: center;
229
+ justify-content: center;
230
+ height: 50px;
231
+ background-color: white;
232
+ box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
233
+ border-radius: 5px;
234
+ z-index: 1000;
235
+
236
+
237
+
238
+ /deep/.el-pagination {
239
+ margin-right: 110px;
240
+ }
241
+
242
+ /deep/.el-pager {
243
+ background: #EDF0F6;
244
+ border-radius: 15px;
245
+ }
246
+
247
+ /deep/.el-pagination.is-background .btn-next {
248
+ width: 30px;
249
+ height: 30px;
250
+ background: #EDF0F6;
251
+ border-radius: 50%;
252
+ }
253
+
254
+ /deep/.el-pagination .btn-next {
255
+ width: 30px;
256
+ height: 30px;
257
+ background: #EDF0F6;
258
+ border-radius: 50%;
259
+ padding-left: 0;
260
+ margin-left: 5px;
261
+ }
262
+
263
+ /deep/.el-pagination .btn-prev {
264
+ width: 30px;
265
+ height: 30px;
266
+ background: #EDF0F6;
267
+ border-radius: 50%;
268
+ padding-right: 0;
269
+ margin-right: 5px;
270
+ }
271
+
272
+ /deep/.el-pagination button {
273
+ padding: 0;
274
+ min-width: 30px;
275
+ }
276
+
277
+ /deep/.el-pager li {
278
+ background: #EDF0F6;
279
+ height: 30px;
280
+ min-width: 30px;
281
+ line-height: 30px;
282
+ font-size: 12px;
283
+ color: #717b90;
284
+ }
285
+
286
+ /deep/.el-pager li:first-child {
287
+ border-bottom-left-radius: 15px !important;
288
+ border-top-left-radius: 15px !important;
289
+ }
290
+
291
+ /deep/.el-pager li:last-child {
292
+ border-top-right-radius: 15px !important;
293
+ border-bottom-right-radius: 15px !important;
294
+ }
295
+
296
+ /deep/.el-pager li.active {
297
+ width: 30px;
298
+ height: 30px;
299
+ min-width: 30px;
300
+ background: #366AFF;
301
+ border: 3px solid #A1B9FF;
302
+ border-radius: 50%;
303
+ line-height: 24px;
304
+ color: white;
305
+ }
306
+
307
+ /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
308
+ background: #366AFF;
309
+ }
310
+ }
311
+ }
312
+ .animation {
313
+ animation-name: highlight;
314
+ animation-duration: 4s;
315
+ }
316
+
317
+ @keyframes highlight {
318
+ 0% {
319
+ background: rgba(255, 136, 0, 0.3);
320
+ }
321
+
322
+ 25% {
323
+ background: rgba(255, 136, 0, 0.6);
324
+ }
325
+
326
+ 50% {
327
+ background: rgba(255, 136, 0, 0.3);
328
+ }
329
+
330
+ 75% {
331
+ background: rgba(255, 136, 0, 0.6);
332
+ }
333
+
334
+ 100% {
335
+ background: rgba(255, 136, 0, 0.3);
336
+ }
337
+ }
338
+ </style>