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
@@ -1,18 +1,18 @@
1
1
  <template>
2
2
  <div class="container">
3
3
  <div class="top-container">
4
- <div class="close">取消</div>
5
- <div class="sure">确定</div>
4
+ <div class="close" @click="handleClose">{{ $t('dragonCommon.cancel') }}</div>
5
+ <div class="sure" @click="handleConfirm">{{ $t('dragonCommon.confirm') }}</div>
6
6
  </div>
7
- <van-list v-model="loading" :finished="finished" finished-text="没有更多了" :offset="1" @load="onload" class="list-container">
7
+ <van-list
8
+ v-model="loading"
9
+ :finished="finished"
10
+ :finished-text="$t('dragonCommon.noMore')"
11
+ :offset="1"
12
+ @load="onLoad"
13
+ class="list-container"
14
+ >
8
15
  <van-cell v-for="item in list" :key="item.id" :title="item.name" />
9
- <!-- <van-cell title="123" />
10
- <van-cell title="asdasd" />
11
- <van-cell title="adszx" />
12
- <van-cell title="zxc zc" />
13
- <van-cell title="asdasd" />
14
- <van-cell title="wqeqweqwe" />
15
- <van-cell title="icvbncvbn" /> -->
16
16
  </van-list>
17
17
  </div>
18
18
  </template>
@@ -40,7 +40,10 @@ export default {
40
40
  onload() {
41
41
  this.$emit('onload')
42
42
  }
43
- }
43
+ },
44
+ mounted() {
45
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
46
+ },
44
47
  }
45
48
  </script>
46
49
 
@@ -0,0 +1,129 @@
1
+ <template>
2
+ <div id="pagination">
3
+ <el-pagination
4
+ @size-change="handleSizeChange"
5
+ @current-change="currentChange"
6
+ :current-page.sync="currentPages"
7
+ :page-size="pageSize"
8
+ layout="slot, prev, pager, next"
9
+ :total="total">
10
+ <span class="total-class">共 {{total}} 条数据</span>
11
+ </el-pagination>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ export default {
17
+ name: "paginationPage",
18
+ data(){
19
+ return{
20
+ currentPages:1
21
+ }
22
+ },
23
+ props:['pageSize','currentPage','total',"isReportForm"],
24
+ watch:{
25
+ currentPage: {
26
+ handler(val){
27
+ this.currentPages = val
28
+ },
29
+ },
30
+
31
+ },
32
+ mounted() {
33
+ this.currentPages = this.currentPage
34
+ },
35
+ methods:{
36
+ handleSizeChange(value){
37
+ this.$emit('handleSizeChange',value)
38
+ },
39
+ currentChange(value){
40
+ this.$emit('currentChange',value)
41
+ },
42
+ }
43
+ }
44
+ </script>
45
+
46
+ <style scoped lang="less">
47
+ #pagination{
48
+ .total-class{
49
+ margin-right: 13px;
50
+ font-weight: 400;
51
+ }
52
+ position: absolute;
53
+ bottom: 0px;
54
+ right: 0;
55
+ width: 100%;
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ height: 50px;
60
+ background-color: white;
61
+ box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
62
+ border-radius: 5px;
63
+ /deep/.el-pager{
64
+ background: #EDF0F6;
65
+ border-radius: 15px;
66
+ }
67
+ /deep/.el-pagination.is-background .btn-next{
68
+ width: 30px;
69
+ height: 30px;
70
+ background: #EDF0F6;
71
+ border-radius: 50%;
72
+ }
73
+ /deep/.el-pagination .btn-next{
74
+ width: 30px;
75
+ height: 30px;
76
+ background: #EDF0F6;
77
+ border-radius: 50%;
78
+ padding-left: 0;
79
+ margin-left:5px ;
80
+ }
81
+ /deep/.el-pagination .btn-prev{
82
+ width: 30px;
83
+ height: 30px;
84
+ background: #EDF0F6;
85
+ border-radius: 50%;
86
+ padding-right: 0;
87
+ margin-right:5px ;
88
+ }
89
+ /deep/.el-pagination button{
90
+ padding: 0;
91
+ min-width: 30px;
92
+ }
93
+ /deep/.el-pager li{
94
+ background: #EDF0F6;
95
+ height: 30px;
96
+ min-width: 30px;
97
+ line-height: 30px;
98
+ font-size: 12px;
99
+ color: #717b90;
100
+ }
101
+ /deep/.el-pager li:first-child{
102
+ border-bottom-left-radius: 15px!important;
103
+ border-top-left-radius: 15px!important;
104
+ }
105
+ /deep/.el-pager li:last-child{
106
+ border-top-right-radius: 15px!important;
107
+ border-bottom-right-radius: 15px!important;
108
+ }
109
+ /deep/.el-pager li.active{
110
+ width: 30px;
111
+ height: 30px;
112
+ min-width: 30px;
113
+ background: #366AFF;
114
+ border: 3px solid #A1B9FF;
115
+ border-radius: 50%;
116
+ line-height: 24px;
117
+ color: white;
118
+ }
119
+ /deep/.el-pagination.is-background .el-pager li:not(.disabled).active{
120
+ background: #366AFF;
121
+
122
+ }
123
+ /deep/.el-pagination button:disabled{
124
+ i{
125
+ cursor: no-drop;
126
+ }
127
+ }
128
+ }
129
+ </style>
@@ -1,29 +1,36 @@
1
1
  <template>
2
2
  <div class="pdf_view" id="pdf_view">
3
- <div class="change_scale" v-if="isPC">
4
- <section @click="changeScale('reduce')">
5
- <i class="el-icon-minus"></i>
6
- </section>
7
- <el-divider direction="vertical"></el-divider>
8
- <section @click="changeScale('zoom')">
9
- <i class="el-icon-plus"></i>
10
- </section>
11
- <el-select size="small" v-model="handScale" @change="changeScale" placeholder="请选择">
12
- <el-option v-for="item in scaleList" :key="item.value" :label="item.label" :value="item.value">
13
- </el-option>
14
- </el-select>
15
- </div>
16
- <div class="pdf_container_view" id="pdf_container_view" @scroll="pdfScroll" ref="pdfView"></div>
17
- <div class="btn_footer" v-if="tagIds.length > 1 && !isPC">
18
- <div class="prev" @click="prev">上一段</div>
19
- <div class="next" @click="next">下一段</div>
20
- </div>
21
- <div id="pagination" v-if="tagIds.length > 1 && isPC">
22
- <el-pagination :current-page="currentPage + 1" @current-change="currentChange" @prev-click="prev"
23
- @next-click="next" layout="slot, prev, pager, next" :page-size="1" :total="tagIds.length">
24
- <span class="total-class">答案由{{ tagIds.length }}段内容生成</span>
25
- </el-pagination>
26
- </div>
3
+ <div class="change_scale" v-if="isPC">
4
+ <section @click="changeScale('reduce')">
5
+ <i class="el-icon-minus"></i>
6
+ </section>
7
+ <el-divider direction="vertical"></el-divider>
8
+ <section @click="changeScale('zoom')">
9
+ <i class="el-icon-plus"></i>
10
+ </section>
11
+ <el-select size="small" v-model="handScale" @change="changeScale" :placeholder="$t('dragonCommon.selectScale')">
12
+ <el-option v-for="item in scaleList" :key="item.value" :label="item.label" :value="item.value">
13
+ </el-option>
14
+ </el-select>
15
+ </div>
16
+ <div class="pdf_container_view" id="pdf_container_view" @scroll="pdfScroll" ref="pdfView"></div>
17
+ <div class="btn_footer" v-if="tagIds.length > 1 && !isPC">
18
+ <div class="prev" @click="prev">{{ $t('dragonCommon.previous') }}</div>
19
+ <div class="next" @click="next">{{ $t('dragonCommon.next') }}</div>
20
+ </div>
21
+ <div id="pagination" v-if="tagIds.length > 1 && isPC">
22
+ <el-pagination
23
+ :current-page="currentPage + 1"
24
+ @current-change="currentChange"
25
+ @prev-click="prev"
26
+ @next-click="next"
27
+ layout="slot, prev, pager, next"
28
+ :page-size="1"
29
+ :total="tagIds.length"
30
+ >
31
+ <span class="total-class">{{ $t('dragonCommon.answersGeneratedByPre') }}{{tagIds.length}}{{ $t('dragonCommon.answersGeneratedByAfter') }}</span>
32
+ </el-pagination>
33
+ </div>
27
34
  </div>
28
35
  </template>
29
36
  <script>
@@ -97,37 +104,7 @@ export default {
97
104
  transformSalce: null,
98
105
  isPC: false,
99
106
  handScale: 'auto',
100
- scaleList: [
101
- {
102
- label: '自动缩放',
103
- value: 'auto'
104
- },
105
- {
106
- label: '实际比例',
107
- value: 'reality'
108
- },
109
- {
110
- label: '100%',
111
- value: 1
112
- },
113
- {
114
- label: '120%',
115
- value: 1.2
116
- },
117
- {
118
- label: '150%',
119
- value: 1.5
120
- },
121
- {
122
- label: '170%',
123
- value: 1.7
124
- }
125
- ,
126
- {
127
- label: '200%',
128
- value: 2
129
- }
130
- ],
107
+ scaleList: [],
131
108
  scrollTop: 0,
132
109
  scrollLeft: 0
133
110
  }
@@ -554,7 +531,7 @@ export default {
554
531
  this.currentPage = 0
555
532
  if (!this.isPC) {
556
533
  this.$toast({
557
- message: '当前已经是第一段了',
534
+ message: this.$t('dragonCommon.firstParagraph'),
558
535
  duration: 2000,
559
536
  })
560
537
  return
@@ -573,7 +550,7 @@ export default {
573
550
  this.currentPage = this.tagIds.length - 1
574
551
  if (!this.isPC) {
575
552
  this.$toast({
576
- message: '当前已经是最后一段了',
553
+ message: this.$t('dragonCommon.lastParagraph'),
577
554
  duration: 2000,
578
555
  })
579
556
  return
@@ -818,15 +795,6 @@ export default {
818
795
  // Math.hypot()计算参数的平方根
819
796
  return Math.hypot(stop.x - start.x, stop.y - start.y);
820
797
  },
821
- setupCanvas (canvas, width, height) {
822
- const dpr = 1;
823
- // const rect = canvas.getBoundingClientRect();
824
- canvas.width = width
825
- canvas.height = height
826
- const ctx = canvas.getContext('2d');
827
- ctx?.scale(dpr, dpr);
828
- return ctx;
829
- },
830
798
  changeScale (value) {
831
799
  if (value == 'zoom') {
832
800
  this.handScale = 'auto'
@@ -1089,7 +1057,7 @@ export default {
1089
1057
  }
1090
1058
  } else {
1091
1059
  let div = document.createElement('div')
1092
- div.innerText = '文件加载异常'
1060
+ div.innerText = this.$t('dragonCommon.fileloadException')
1093
1061
  this.contentView.appendChild(div)
1094
1062
  this.$refs.pdfView.appendChild(this.contentView)
1095
1063
  }
@@ -1101,6 +1069,38 @@ export default {
1101
1069
  }
1102
1070
  },
1103
1071
  mounted () {
1072
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
1073
+ this.scaleList = [
1074
+ {
1075
+ label: this.$t('dragonCommon.scaleAuto'),
1076
+ value: 'auto'
1077
+ },
1078
+ {
1079
+ label: this.$t('dragonCommon.scaleReality'),
1080
+ value: 'reality'
1081
+ },
1082
+ {
1083
+ label: '100%',
1084
+ value: 1
1085
+ },
1086
+ {
1087
+ label: '120%',
1088
+ value: 1.2
1089
+ },
1090
+ {
1091
+ label: '150%',
1092
+ value: 1.5
1093
+ },
1094
+ {
1095
+ label: '170%',
1096
+ value: 1.7
1097
+ }
1098
+ ,
1099
+ {
1100
+ label: '200%',
1101
+ value: 2
1102
+ }
1103
+ ]
1104
1104
  if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
1105
1105
  this.isPC = false
1106
1106
  } else {
@@ -1,18 +1,18 @@
1
1
  <template>
2
2
  <div class="popUp">
3
3
  <div class="topBtn">
4
- <span class="cancel" @click="closeBtn">取消</span>
5
- <span class="sure" @click="sure">确定</span>
4
+ <span class="cancel" @click="closeBtn">{{ $t('dragonCommon.cancel') }}</span>
5
+ <span class="sure" @click="sure">{{ $t('dragonCommon.confirm') }}</span>
6
6
  </div>
7
7
  <slot name="popup-header" class="popup-header"></slot>
8
8
  <div class="popup-content">
9
9
  <div
10
- class="filter-item"
11
- v-for="(item,index) in options"
12
- :key="index"
13
- @click="checked(item,index)"
10
+ class="filter-item"
11
+ v-for="(item, index) in options"
12
+ :key="index"
13
+ @click="checked(item, index)"
14
14
  >
15
- <div :class="[checkIdList.includes(item[props.value]) && 'setColor', 'label']">{{item[props.label]}}</div>
15
+ <div :class="[checkIdList.includes(item[props.value]) && 'setColor', 'label']">{{ item[props.label] }}</div>
16
16
  </div>
17
17
  </div>
18
18
  <div class="popup-footer">
@@ -164,6 +164,7 @@ export default {
164
164
  },
165
165
  },
166
166
  mounted() {
167
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
167
168
  console.debug('options',this.options)
168
169
 
169
170
  }
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <div class="docView">
3
+ <div class="docHtml"
4
+ ref="docHtml"
5
+ v-html="html"
6
+ @click="selectDiv"
7
+ >
8
+ </div>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: "docView",
15
+ data(){
16
+ return{
17
+ colors: ['#E3EBFF', '#FFF5DC', '#FFE8D8','#D6F3EA','#FFF1C3'],
18
+ html:"",
19
+ }
20
+ },
21
+ props:{
22
+ html_result:{
23
+ type:String,
24
+ default:""
25
+ },
26
+ split_paragraphs:{
27
+ type:Array,
28
+ default(){
29
+ return []
30
+ }
31
+ },
32
+ fileSuffix:{
33
+ type:String,
34
+ default:""
35
+ }
36
+ },
37
+ methods:{
38
+ selectDiv(e){
39
+ this.$emit('selectDiv',e)
40
+ },
41
+ getHtml(){
42
+ // let url = 'https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/123/2024/12/09/14/18/17/123/%E5%85%AC%E5%8F%B8%E5%91%98%E5%B7%A5%E6%89%8B%E5%86%8C_1733725097.html'
43
+ let url = this.html_result
44
+ this.$http.get(url).then(res => {
45
+ this.html = res.data;
46
+ let drawer = document.getElementById('drawer_content_pre')
47
+ if (drawer){
48
+ drawer.style.backgroundImage = 'none';
49
+ drawer.style.overflowX = 'hidden'
50
+ }
51
+ this.$nextTick(() => {
52
+ this.setColor()
53
+ })
54
+ })
55
+ },
56
+ setColor(){
57
+ this.split_paragraphs.forEach((item,index) => {
58
+ const colorIndex = index % this.colors.length;
59
+ if (item.original_paragraph){
60
+ item.original_paragraph.forEach(items => {
61
+ let dom = document.getElementById(items.paragraph_id);
62
+ if (this.fileSuffix === 'TXT'){
63
+ const paragraphs = this.$el.querySelectorAll(`[paragraph-id="${items.paragraph_id}"]`);
64
+ paragraphs.forEach(paragraph => {
65
+ paragraph.style.background = this.colors[colorIndex]
66
+ })
67
+ } else if (dom){
68
+ dom.style.background = this.colors[colorIndex];
69
+ }
70
+ })
71
+ let newOriginal = item.original_paragraph.filter(items => !items.type)
72
+ let dom = document.getElementById(newOriginal[newOriginal.length - 1].paragraph_id);
73
+ if (dom){
74
+ dom.style.marginBottom = '8px';
75
+ }
76
+ }
77
+ if (item.tableId){
78
+ let dom = document.getElementById(item.tableId);
79
+ if (dom){
80
+ dom.style.backgroundColor = this.colors[colorIndex]
81
+ }
82
+ }
83
+ })
84
+ setTimeout(() => {
85
+ this.$parent.scrollToParagraph('first')
86
+ },500)
87
+ },
88
+ },
89
+ watch:{
90
+ html_result:{
91
+ handler(){
92
+ if (this.html_result){
93
+ this.getHtml();
94
+ }
95
+ },
96
+ immediate:true
97
+ }
98
+ }
99
+ };
100
+ </script>
101
+
102
+ <style scoped lang="less">
103
+ .docView{
104
+ width: 100%;
105
+ flex: none;
106
+ box-sizing: border-box;
107
+ div{
108
+ position: relative;
109
+ }
110
+ /deep/img{
111
+ max-width: 100%;
112
+ }
113
+ }
114
+ </style>
@@ -0,0 +1,191 @@
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('first');
122
+ })
123
+ },
124
+ getRowKey(row){
125
+ return row.id
126
+ },
127
+ setRowColor(type){
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
+ if (dom && dom.length > 0){
133
+ let newDom = Array.from(dom)
134
+ newDom.forEach(doms => {
135
+ doms.style.backgroundColor = this.colors[colorIndex];
136
+ })
137
+ }
138
+ })
139
+ this.$nextTick(() => {
140
+ if (this.tableChunkData.length > 0 && type === 'first'){
141
+ this.scrollToRow(this.tableChunkData[0].tableChunkId)
142
+ }
143
+ })
144
+ },
145
+ tableRowClassName({ row }){
146
+ let id = this.tableChunkData.filter(item => item.tableChunkId == row.id);
147
+ if (id && id.length > 0){
148
+ return 'setBgClass' + id[0].tableChunkId
149
+ }
150
+ },
151
+ scrollToRow(rowId) {
152
+ this.$nextTick(() => {
153
+ // const row = this.rowDataList.find(row => row.id === rowId);
154
+ const rowIndex = this.rowDataList.findIndex(row => row.id === rowId);
155
+ let index = Math.ceil(rowIndex / 20)
156
+ if (index > 0){
157
+ this.currentPage = index;
158
+ }
159
+ setTimeout(() => {
160
+ let dom = document.getElementsByClassName('setBgClass' + rowId);
161
+ if (dom && dom.length > 0){
162
+ let newDom = Array.from(dom)
163
+ newDom.forEach(doms => {
164
+ doms.style.backgroundColor = this.colors[0];
165
+ })
166
+ newDom[0].scrollIntoView({ behavior: "smooth"})
167
+ }
168
+ },500)
169
+ });
170
+ },
171
+ handleCurrentChange(val){
172
+ this.currentPage = val;
173
+ this.$nextTick(() => {
174
+ this.setRowColor();
175
+ })
176
+ }
177
+ },
178
+ mounted() {
179
+ this.tableRowData();
180
+ }
181
+ };
182
+ </script>
183
+
184
+ <style scoped lang="less">
185
+ .excelView{
186
+ height: 100%;
187
+ /deep/.setBgClass{
188
+ background-color: #E3EBFF!important;
189
+ }
190
+ }
191
+ </style>