askbot-dragon 1.7.84-beta → 1.7.86-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 (95) 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 -58
  5. package/public/index.html +73 -76
  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 -117
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/common.js +261 -261
  13. package/src/assets/js/hammer.js +100 -89
  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 -192
  17. package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
  18. package/src/assets/less/iconfont.css +37 -37
  19. package/src/assets/less/ticketMessage.less +294 -294
  20. package/src/components/ActionAlertIframe.vue +178 -155
  21. package/src/components/AiGuide.vue +434 -471
  22. package/src/components/AnswerDocknowledge.vue +1203 -1203
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +10684 -10880
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/MyEditor.vue +342 -341
  29. package/src/components/QwFeedback.vue +302 -302
  30. package/src/components/actionSatisfaction.vue +107 -107
  31. package/src/components/actionSendToBot.vue +62 -62
  32. package/src/components/answerDissatisfaction.vue +62 -62
  33. package/src/components/answerRadio.vue +259 -259
  34. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  35. package/src/components/ask-components/Msgloading.vue +37 -37
  36. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  37. package/src/components/askVideo.vue +162 -139
  38. package/src/components/assetDetails.vue +378 -378
  39. package/src/components/assetMessage.vue +229 -229
  40. package/src/components/associationIntention.vue +378 -374
  41. package/src/components/attachmentPreview.vue +90 -90
  42. package/src/components/botActionSatisfactor.vue +68 -68
  43. package/src/components/chatContent.vue +513 -513
  44. package/src/components/feedBack.vue +136 -136
  45. package/src/components/fielListView.vue +351 -351
  46. package/src/components/file/AliyunOssComponents.vue +108 -108
  47. package/src/components/formTemplate.vue +3522 -3518
  48. package/src/components/imgView.vue +31 -31
  49. package/src/components/intelligentSummary.vue +234 -230
  50. package/src/components/kkview.vue +1128 -1128
  51. package/src/components/loadingProcess.vue +164 -164
  52. package/src/components/markDownText.vue +959 -960
  53. package/src/components/message/ActionAlertIframe.vue +112 -112
  54. package/src/components/message/ShopMessage.vue +164 -164
  55. package/src/components/message/TextMessage.vue +928 -924
  56. package/src/components/message/TicketMessage.vue +201 -201
  57. package/src/components/message/swiper/index.js +4 -4
  58. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  59. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  60. package/src/components/msgLoading.vue +231 -231
  61. package/src/components/myPopup.vue +73 -73
  62. package/src/components/newPdfPosition.vue +878 -0
  63. package/src/components/pagination.vue +128 -128
  64. package/src/components/pdfPosition.vue +1514 -1336
  65. package/src/components/popup.vue +228 -228
  66. package/src/components/preview/docView.vue +123 -113
  67. package/src/components/preview/excelView.vue +210 -198
  68. package/src/components/preview/newPositionPreview.vue +390 -388
  69. package/src/components/preview/pdfView.vue +831 -831
  70. package/src/components/previewDoc.vue +252 -248
  71. package/src/components/previewPdf.vue +1119 -1119
  72. package/src/components/receiverMessagePlatform.vue +69 -69
  73. package/src/components/recommend.vue +80 -80
  74. package/src/components/selector/hOption.vue +20 -20
  75. package/src/components/selector/hSelector.vue +199 -199
  76. package/src/components/selector/hWrapper.vue +216 -216
  77. package/src/components/senderMessagePlatform.vue +58 -58
  78. package/src/components/source/BotMessage.vue +24 -24
  79. package/src/components/source/CustomMessage.vue +24 -24
  80. package/src/components/test.vue +260 -260
  81. package/src/components/tree.vue +307 -307
  82. package/src/components/utils/AliyunIssUtil.js +103 -103
  83. package/src/components/utils/ckeditor.js +185 -185
  84. package/src/components/utils/format_date.js +25 -25
  85. package/src/components/utils/index.js +6 -6
  86. package/src/components/utils/math_utils.js +29 -29
  87. package/src/components/voiceComponent.vue +119 -119
  88. package/src/components/welcomeKnowledgeFile.vue +347 -343
  89. package/src/components/welcomeLlmCard.vue +144 -140
  90. package/src/components/welcomeSuggest.vue +97 -97
  91. package/src/locales/cn.json +98 -98
  92. package/src/locales/en.json +98 -98
  93. package/src/locales/jp.json +73 -0
  94. package/src/main.js +76 -76
  95. package/vue.config.js +54 -54
@@ -1,114 +1,124 @@
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
- }
1
+ <template>
2
+ <div class="docView" id="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
+ import { newInitWaterMark } from "../../assets/js/common";
14
+
15
+ export default {
16
+ name: "docView",
17
+ data(){
18
+ return{
19
+ colors: ['#E3EBFF', '#FFF5DC', '#FFE8D8','#D6F3EA','#FFF1C3'],
20
+ html:"",
21
+ }
22
+ },
23
+ props:{
24
+ html_result:{
25
+ type:String,
26
+ default:""
27
+ },
28
+ split_paragraphs:{
29
+ type:Array,
30
+ default(){
31
+ return []
32
+ }
33
+ },
34
+ fileSuffix:{
35
+ type:String,
36
+ default:""
37
+ },
38
+ textWatermarkStr:{
39
+ type:String,
40
+ default:""
41
+ }
42
+ },
43
+ methods:{
44
+ selectDiv(e){
45
+ this.$emit('selectDiv',e)
46
+ },
47
+ getHtml(){
48
+ // 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'
49
+ let url = this.html_result
50
+ this.$http.get(url).then(res => {
51
+ this.html = res.data;
52
+ let drawer = document.getElementById('drawer_content_pre')
53
+ if (drawer){
54
+ drawer.style.backgroundImage = 'none';
55
+ drawer.style.overflowX = 'hidden';
56
+ drawer.style.position ='relative'
57
+ }
58
+ this.$nextTick(() => {
59
+ this.setColor();
60
+ if (this.textWatermarkStr){
61
+ newInitWaterMark('drawer_content_pre',this.textWatermarkStr)
62
+ }
63
+ })
64
+ })
65
+ },
66
+ setColor(){
67
+ this.split_paragraphs.forEach((item,index) => {
68
+ const colorIndex = index % this.colors.length;
69
+ if (item.original_paragraph){
70
+ item.original_paragraph.forEach(items => {
71
+ let dom = document.getElementById(items.paragraph_id);
72
+ if (this.fileSuffix === 'TXT'){
73
+ const paragraphs = this.$el.querySelectorAll(`[paragraph-id="${items.paragraph_id}"]`);
74
+ paragraphs.forEach(paragraph => {
75
+ paragraph.style.background = this.colors[colorIndex]
76
+ })
77
+ } else if (dom){
78
+ dom.style.background = this.colors[colorIndex];
79
+ }
80
+ })
81
+ let newOriginal = item.original_paragraph.filter(items => !items.type)
82
+ let dom = document.getElementById(newOriginal[newOriginal.length - 1].paragraph_id);
83
+ if (dom){
84
+ dom.style.marginBottom = '8px';
85
+ }
86
+ }
87
+ if (item.tableId){
88
+ let dom = document.getElementById(item.tableId);
89
+ if (dom){
90
+ dom.style.backgroundColor = this.colors[colorIndex]
91
+ }
92
+ }
93
+ })
94
+ setTimeout(() => {
95
+ this.$parent.scrollToParagraph('first')
96
+ },500)
97
+ },
98
+ },
99
+ watch:{
100
+ html_result:{
101
+ handler(){
102
+ if (this.html_result){
103
+ this.getHtml();
104
+ }
105
+ },
106
+ immediate:true
107
+ }
108
+ }
109
+ };
110
+ </script>
111
+
112
+ <style scoped lang="less">
113
+ .docView{
114
+ width: 100%;
115
+ flex: none;
116
+ box-sizing: border-box;
117
+ div{
118
+ position: relative;
119
+ }
120
+ /deep/img{
121
+ max-width: 100%;
122
+ }
123
+ }
114
124
  </style>
@@ -1,199 +1,211 @@
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
- const bodyWrapper = this.$refs.table.$el.querySelector('.el-table__body-wrapper');
167
- const targetRow = this.$refs.table.$el.querySelector('.setBgClass' + rowId); // 获取目标行元素
168
- const targetHeight = targetRow.offsetTop; // 目标行的高度(从上到下的距离)
169
- bodyWrapper.scroll({
170
- top:targetHeight,
171
- behavior:"smooth"
172
- }); // 滚动到目标行位置
173
-
174
- // newDom[0].scrollIntoView({ behavior: "smooth"})
175
- }
176
- },800)
177
- });
178
- },
179
- handleCurrentChange(val){
180
- this.currentPage = val;
181
- this.$nextTick(() => {
182
- this.setRowColor();
183
- })
184
- }
185
- },
186
- mounted() {
187
- this.tableRowData();
188
- }
189
- };
190
- </script>
191
-
192
- <style scoped lang="less">
193
- .excelView{
194
- height: 100%;
195
- /deep/.setBgClass{
196
- background-color: #E3EBFF!important;
197
- }
198
- }
1
+ <template>
2
+ <div class="excelView" id="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
+ import { newInitWaterMark } from "../../assets/js/common";
44
+ export default {
45
+ name: "excelView",
46
+ components: { PaginationPage },
47
+ data(){
48
+ return{
49
+ rowData:[
50
+ {
51
+ "row_id": "659164be-19bd-4fd7-a47d-b04c3dbbfa6f",
52
+ "row_data_md": "| 王明宇 | 27 | 189 |",
53
+ "row_number": 2,
54
+ "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>"
55
+ },
56
+ {
57
+ "row_id": "fac98d6a-2580-4f62-8f50-61521debeeef",
58
+ "row_data_md": "| 老王 | 38 | 178 |",
59
+ "row_number": 3,
60
+ "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>"
61
+ },
62
+ ],
63
+ rowDataList:[],
64
+ headerArray:[],
65
+ currentPage:1,
66
+ pageSize:20,
67
+ colors: ['#E3EBFF', '#FFF5DC', '#FFE8D8','#D6F3EA','#FFF1C3'],
68
+ }
69
+ },
70
+ props:{
71
+ headerData:{
72
+ type:String,
73
+ default:""
74
+ },
75
+ excelRowList:{
76
+ type:Array,
77
+ default(){
78
+ return []
79
+ }
80
+ },
81
+ tableChunkData:{
82
+ type:Array,
83
+ default(){
84
+ return [{
85
+ "sheet_name": null,
86
+ "table_md": null,
87
+ "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 |",
88
+ "tableChunkId": "5e80ff30-ea7e-4c47-878b-59d9b1c833ce",
89
+ "tableId": null
90
+ }]
91
+ }
92
+ },
93
+ textWatermarkStr:{
94
+ type:String,
95
+ default:""
96
+ }
97
+ },
98
+ computed:{
99
+ pagedData() {
100
+ const start = (this.currentPage - 1) * this.pageSize;
101
+ const end = start + this.pageSize;
102
+ return this.rowDataList.slice(start, end);
103
+ }
104
+ },
105
+ methods:{
106
+ tableRowData(){
107
+ const headerString = this.headerData.trim().replace(/^\||\|$/g, '');
108
+
109
+ // 使用竖线作为分隔符来分割字符串
110
+ const headerArray = headerString.split('|').map(item => item.trim());
111
+ this.headerArray = headerArray
112
+ for (let i =0;i<this.excelRowList.length;i++){
113
+ // 去除字符串两端的竖线(如果它们存在的话)
114
+ const trimmedString = this.excelRowList[i].row_data_md.trim().replace(/^\||\|$/g, '');
115
+
116
+ // 使用竖线作为分隔符来分割字符串
117
+ const resultArray = trimmedString.split('|').map(item => item.trim());
118
+ let obj = {}
119
+ for (let j=0;j<headerArray.length;j++){
120
+ this.$set(obj,headerArray[j],resultArray[j])
121
+ this.$set(obj,'id',this.excelRowList[i].row_id)
122
+ }
123
+ this.rowDataList.push(obj);
124
+ }
125
+ this.$nextTick(() => {
126
+ this.setRowColor('first');
127
+ })
128
+ },
129
+ getRowKey(row){
130
+ return row.id
131
+ },
132
+ setRowColor(type){
133
+ this.tableChunkData.forEach((item,index) => {
134
+ const colorIndex = index % this.colors.length;
135
+ let id = item.tableChunkId;
136
+ let dom = document.getElementsByClassName('setBgClass' + id);
137
+ if (dom && dom.length > 0){
138
+ let newDom = Array.from(dom)
139
+ newDom.forEach(doms => {
140
+ doms.style.backgroundColor = this.colors[colorIndex];
141
+ })
142
+ }
143
+ })
144
+ this.$nextTick(() => {
145
+ if (this.tableChunkData.length > 0 && type === 'first'){
146
+ this.scrollToRow(this.tableChunkData[0].tableChunkId)
147
+ let drawer = document.getElementById('drawer_content_pre')
148
+ if (drawer){
149
+ drawer.style.position ='relative'
150
+ }
151
+ if (this.textWatermarkStr){
152
+ newInitWaterMark('drawer_content_pre',this.textWatermarkStr)
153
+ }
154
+ }
155
+ })
156
+ },
157
+ tableRowClassName({ row }){
158
+ let id = this.tableChunkData.filter(item => item.tableChunkId == row.id);
159
+ if (id && id.length > 0){
160
+ return 'setBgClass' + id[0].tableChunkId
161
+ }
162
+ },
163
+ scrollToRow(rowId) {
164
+ this.$nextTick(() => {
165
+ // const row = this.rowDataList.find(row => row.id === rowId);
166
+ const rowIndex = this.rowDataList.findIndex(row => row.id === rowId);
167
+ let index = Math.ceil(rowIndex / 20)
168
+ if (index > 0){
169
+ this.currentPage = index;
170
+ }
171
+ setTimeout(() => {
172
+ let dom = document.getElementsByClassName('setBgClass' + rowId);
173
+ if (dom && dom.length > 0){
174
+ let newDom = Array.from(dom)
175
+ newDom.forEach(doms => {
176
+ doms.style.backgroundColor = this.colors[0];
177
+ })
178
+ const bodyWrapper = this.$refs.table.$el.querySelector('.el-table__body-wrapper');
179
+ const targetRow = this.$refs.table.$el.querySelector('.setBgClass' + rowId); // 获取目标行元素
180
+ const targetHeight = targetRow.offsetTop; // 目标行的高度(从上到下的距离)
181
+ bodyWrapper.scroll({
182
+ top:targetHeight,
183
+ behavior:"smooth"
184
+ }); // 滚动到目标行位置
185
+
186
+ // newDom[0].scrollIntoView({ behavior: "smooth"})
187
+ }
188
+ },800)
189
+ });
190
+ },
191
+ handleCurrentChange(val){
192
+ this.currentPage = val;
193
+ this.$nextTick(() => {
194
+ this.setRowColor();
195
+ })
196
+ }
197
+ },
198
+ mounted() {
199
+ this.tableRowData();
200
+ }
201
+ };
202
+ </script>
203
+
204
+ <style scoped lang="less">
205
+ .excelView{
206
+ height: 100%;
207
+ /deep/.setBgClass{
208
+ background-color: #E3EBFF!important;
209
+ }
210
+ }
199
211
  </style>