askbot-dragon 1.6.34-beta → 1.6.36-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 (82) 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 +55 -55
  5. package/public/index.html +72 -72
  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 +92 -92
  11. package/src/assets/js/Base64Util.js +22 -22
  12. package/src/assets/js/common.js +75 -75
  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 +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 +177 -177
  21. package/src/components/AiGuide.vue +466 -466
  22. package/src/components/AnswerDocknowledge.vue +675 -623
  23. package/src/components/AnswerVoice.vue +285 -285
  24. package/src/components/AskIFrame.vue +15 -15
  25. package/src/components/ConversationContainer.vue +5097 -5039
  26. package/src/components/FileType.vue +86 -86
  27. package/src/components/Message.vue +27 -27
  28. package/src/components/MyEditor.vue +346 -346
  29. package/src/components/actionSatisfaction.vue +107 -107
  30. package/src/components/actionSendToBot.vue +62 -62
  31. package/src/components/answerDissatisfaction.vue +62 -62
  32. package/src/components/answerRadio.vue +186 -186
  33. package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
  34. package/src/components/ask-components/Msgloading.vue +37 -37
  35. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  36. package/src/components/askVideo.vue +162 -162
  37. package/src/components/assetDetails.vue +370 -370
  38. package/src/components/assetMessage.vue +228 -228
  39. package/src/components/associationIntention.vue +355 -355
  40. package/src/components/attachmentPreview.vue +90 -90
  41. package/src/components/botActionSatisfactor.vue +68 -68
  42. package/src/components/chatContent.vue +513 -513
  43. package/src/components/feedBack.vue +136 -136
  44. package/src/components/fielListView.vue +351 -351
  45. package/src/components/file/AliyunOssComponents.vue +108 -108
  46. package/src/components/formTemplate.vue +3572 -3572
  47. package/src/components/kkview.vue +1138 -1138
  48. package/src/components/loadingProcess.vue +164 -164
  49. package/src/components/message/ActionAlertIframe.vue +112 -112
  50. package/src/components/message/ShopMessage.vue +164 -164
  51. package/src/components/message/TextMessage.vue +924 -924
  52. package/src/components/message/TicketMessage.vue +201 -201
  53. package/src/components/message/swiper/index.js +4 -4
  54. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  55. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  56. package/src/components/msgLoading.vue +231 -231
  57. package/src/components/myPopup.vue +70 -70
  58. package/src/components/newPdfPosition.vue +877 -877
  59. package/src/components/pdfPosition.vue +1508 -1508
  60. package/src/components/popup.vue +227 -227
  61. package/src/components/previewDoc.vue +242 -242
  62. package/src/components/previewPdf.vue +370 -366
  63. package/src/components/receiverMessagePlatform.vue +65 -65
  64. package/src/components/recommend.vue +80 -80
  65. package/src/components/selector/hOption.vue +20 -20
  66. package/src/components/selector/hSelector.vue +199 -199
  67. package/src/components/selector/hWrapper.vue +216 -216
  68. package/src/components/senderMessagePlatform.vue +50 -50
  69. package/src/components/source/BotMessage.vue +24 -24
  70. package/src/components/source/CustomMessage.vue +24 -24
  71. package/src/components/test.vue +260 -260
  72. package/src/components/tree.vue +294 -294
  73. package/src/components/utils/AliyunIssUtil.js +81 -81
  74. package/src/components/utils/ckeditor.js +174 -174
  75. package/src/components/utils/format_date.js +25 -25
  76. package/src/components/utils/index.js +6 -6
  77. package/src/components/utils/math_utils.js +29 -29
  78. package/src/components/voiceComponent.vue +119 -119
  79. package/src/components/welcomeKnowledgeFile.vue +309 -307
  80. package/src/components/welcomeLlmCard.vue +134 -134
  81. package/src/main.js +57 -57
  82. package/vue.config.js +54 -54
@@ -1,367 +1,371 @@
1
- <template>
2
- <!-- <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}" v-if="previewShowPopup">
3
- <div class="footer">
4
- <span>查看详情</span>
5
- <section @click="close">
6
- <i class="iconfont guoran-shanchu"></i>
7
- </section>
8
- </div>
9
- <template v-if="tagIds && tagIds.length != 0 && previewShowPopup">
10
- <pdfPosition :tagIds="tagIds" ></pdfPosition>
11
- </template>
12
- <template v-else>
13
- <div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 60px)">
14
- <video :src="url" controls width="100%;" height="98%"></video>
15
- </div>
16
- <div v-else-if="fileType == 'HTML'" style="width: 100%;height: calc(100% - 60px)">
17
- <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
18
- </div>
19
- <template v-else-if="url.includes('https://www') || url.includes('http://www')">
20
- <iframe class="preview_iframe"
21
- :src="url"
22
- width="100%"
23
- height="100%"
24
- scrolling="100%"
25
- frameborder="no"
26
- border="0"></iframe>
27
- </template>
28
- <template v-else>
29
- <iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
30
- </template>
31
- </template>
32
- <div class="loading_img" v-show="loading">
33
- <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
34
- </div>
35
- </van-popup> -->
36
- <el-drawer
37
- title="我是标题"
38
- :visible.sync="drawer"
39
- :with-header="false"
40
- :append-to-body="true"
41
- :destroy-on-close="true"
42
- :model="false"
43
- :direction="previewShowPopup ? 'btt' : 'rtl'"
44
- :size="previewShowPopup ? '90%' : '65%'"
45
- custom-class="pdf-preview-drawer"
46
- v-if="drawer"
47
- >
48
- <!-- v-else-if="drawer" -->
49
- <div class="drawer-footer">
50
- <span>查看详情</span>
51
- <div class="header-right">
52
- <template v-if="isHasChat">
53
- <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
54
- <i class="iconfont guoran-wendapingjia"></i>
55
- 聊一聊
56
- </div>
57
- <div class="chat chat_active" @click="previewToDialog(false)" v-else>
58
- <i class="iconfont guoran-wendapingjia"></i>
59
- 聊一聊
60
- </div>
61
- </template>
62
- <section @click="close">
63
- <i class="iconfont guoran-shanchu"></i>
64
- </section>
65
- </div>
66
- </div>
67
- <div id="drawer_content_pre">
68
- <template v-if="tagIds && tagIds.length != 0 && drawer">
69
- <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :fileName="fileName" :knowledgeItem="watermark" ref="pdfPosition"></pdfPosition>
70
- </template>
71
- <template v-else>
72
- <div v-if="fileType == 'VIDEO'" style="width: 100%;">
73
- <video :src="url" controls width="100%;" height="98%"></video>
74
- </div>
75
- <div v-else-if="fileType == 'HTML'" style="width: 100%;">
76
- <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
77
- </div>
78
- <template v-else-if="url.includes('https://www') || url.includes('http://www')">
79
- <iframe class="preview_iframe"
80
- :src="url"
81
- width="100%"
82
- height="100%"
83
- scrolling="100%"
84
- frameborder="no"
85
- border="0"></iframe>
86
- </template>
87
- <template v-else>
88
- <iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"></iframe>
89
- </template>
90
- </template>
91
- </div>
92
- <div class="loading_img" v-show="loading">
93
- <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
94
- </div>
95
- </el-drawer>
96
- </template>
97
-
98
- <script>
99
- import pdfPosition from './pdfPosition.vue'
100
- import { zoomElement } from '../assets/js/hammer'
101
- export default {
102
- data () {
103
- return {
104
- previewShowPopup: false,
105
- fileText:'',
106
- fileType:"",
107
- isPc:true,
108
- drawer:false,
109
- tagIds: [],
110
- // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
111
- loading:true,
112
- fileName:'',
113
- previewKnowledgeId:""
114
- }
115
- },
116
- mounted() {
117
- },
118
- props:{
119
- url:{
120
- type: String,
121
- required: true,
122
- },
123
- officePreviewType:{
124
- type: String,
125
- default: ''
126
- },
127
- isMessageRecord:{
128
- type: Boolean,
129
- default:false,
130
- },
131
- sourceFileType:{
132
- type: String,
133
- default: '',
134
- },
135
- watermark:{
136
- type: Object
137
- },
138
- isHasChat:{
139
- type:Boolean,
140
- default:false
141
- }
142
- },
143
- components:{
144
- pdfPosition
145
- },
146
- watch:{
147
- drawer(value) {
148
- if(value) {
149
- this.$nextTick(() =>{
150
- if (this.tagIds && this.tagIds.length != 0){
151
- zoomElement(document.getElementById('pdf_container_view'))
152
- }
153
- })
154
- }
155
- setTimeout(() => {
156
- let previewIframe = document.getElementsByClassName('preview_iframe')
157
- Array.from(previewIframe).forEach(item =>{
158
- item.onload = () =>{
159
- console.debug('previewIframe 106',previewIframe,this.drawer)
160
- item.style.backgroundImage = 'none'
161
- }
162
- })
163
- })
164
- }
165
- },
166
- computed:{
167
- previewUrl() {
168
- console.debug('VUE_APP_ENV',process.env.VUE_APP_ENV)
169
- let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
170
- // if(this.url != '') {
171
- // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
172
- // url += btoa(encodeURIComponent(this.url))
173
- // } else {
174
- // url += btoa(this.url)
175
- // }
176
- // }
177
- url = url + this.url
178
- url += '&officePreviewType=pdf'
179
- if(this.watermark) {
180
- url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
181
- url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
182
- }
183
- return url
184
- },
185
- // fileType() {
186
- // const fileType = this.url.substring(this.url.lastIndexOf('.'));
187
- // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
188
- // return 'VIDEO'
189
- // } else {
190
- // return 'OTHER'
191
- // }
192
-
193
- // }
194
- },
195
- methods :{
196
- close() {
197
- setTimeout(() =>{
198
- this.previewShowPopup = false;
199
- this.fileType = ''
200
- }, 300)
201
- this.drawer = false;
202
- },
203
- loadIframe() {
204
-
205
- if(this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0)) {
206
- this.loading = false
207
- } else {
208
- let time = setInterval(() =>{
209
- let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
210
- if(iframe) {
211
- this.loading = false
212
- clearInterval(time)
213
- }
214
- }, 500)
215
- }
216
- },
217
- getBolb() {
218
- this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false',{
219
- fileInOssPath: this.url,
220
- templateId: ''
221
- }).then(res =>{
222
- if (res.data.code == 0) {
223
- this.fileText = res.data.data
224
- this.loading = false
225
- }
226
- })
227
- },
228
- previewToDialog(flag){
229
- this.$emit('previewToDialog',flag)
230
- }
231
- }
232
- }
233
- </script>
234
-
235
- <style lang="less" scoped>
236
- .preview_iframe {
237
- width: 100%;
238
- height: 100%;
239
- box-sizing: border-box;
240
- background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
241
- background-position: center;
242
- background-size: 50px;
243
- background-repeat: no-repeat;
244
- }
245
- .preview_iframe_kk{
246
- width: 100%;
247
- height: 100%;
248
- }
249
- .preview_iframe_html{
250
- width: 100%;
251
- height: 100%;
252
- overflow-y: scroll;
253
- text-align: left;
254
- box-sizing: border-box;
255
- padding: 16px;
256
- /deep/.lake-content{
257
- margin-left: 10px;
258
- }
259
- /deep/a:link {
260
- color: #0000ee!important;
261
- }
262
- /deep/a:visited {
263
- color: #0000ee!important;
264
- }
265
- /deep/a:hover {
266
- color: #0000ee!important;
267
- }
268
- /deep/a:active {
269
- color: #0000ee!important;
270
- }
271
- /deep/li:not(.rich-text-li), ol:not(.list-paddingleft-2), ul:not(.list-paddingleft-2){
272
- list-style-type: auto!important;
273
- }
274
- /deep/img{
275
- width: 100%;
276
- }
277
- /deep/.ne-table{
278
- width: 100% !important;
279
- }
280
- }
281
- .footer {
282
- width: calc(100% - 40px);
283
- height: 50px;
284
- display: flex;
285
- align-items: center;
286
- justify-content: space-between;
287
- cursor: pointer;
288
- padding: 0 20px;
289
- border-bottom: 1px solid #cccccc;
290
- }
291
- .loading_img {
292
- display: flex;
293
- align-items: center;
294
- justify-content: center;
295
- width: 100%;
296
- height: 100%;
297
- position: absolute;
298
- top: 0;
299
- left: 0;
300
- background: #FFF;
301
- img {
302
- width: 50px;
303
- height: 50px;
304
- }
305
- }
306
-
307
- .drawer-footer{
308
- width:100%;
309
- height: 50px;
310
- display: flex;
311
- align-items: center;
312
- justify-content: space-between;
313
- cursor: pointer;
314
- padding: 0 20px;
315
- border-bottom: 1px solid #cccccc;
316
- .header-right{
317
- display: flex;
318
- align-items: center;
319
- .chat {
320
- width: 95px;
321
- height: 26px;
322
- background: #ffffff;
323
- display: flex;
324
- align-items: center;
325
- justify-content: center;
326
- box-sizing: border-box;
327
- border: 1px solid #a1b9ff;
328
- border-radius: 15px 0px 15px 15px;
329
- cursor: pointer;
330
- color: #366aff;
331
- margin-right: 10px;
332
- font-size: 14px;
333
- i {
334
- font-size: 16px;
335
- margin: 0 5px;
336
- }
337
- }
338
- .chat_active {
339
- background: #366aff !important;
340
- color: #FFFFFF !important;
341
- }
342
- }
343
- }
344
- @media screen and (max-width: 767px) {
345
- /* 这里是针对移动设备的css样式设置 */
346
- /deep/.el-drawer__body{
347
- height: 100%;
348
- }
349
- #drawer_content_pre {
350
- overflow: auto;
351
- height: calc(100% - 50px);
352
- background: #FFF;
353
- }
354
- }
355
- @media screen and (min-width: 768px) {
356
- /* 这里是针对pc设备的css样式设置 */
357
- /deep/.el-drawer__body{
358
- height: 100%;
359
- }
360
- #drawer_content_pre {
361
- overflow: auto;
362
- height: calc(100% - 50px);
363
- background: #FFF;
364
- }
365
- }
366
-
1
+ <template>
2
+ <!-- <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}" v-if="previewShowPopup">
3
+ <div class="footer">
4
+ <span>查看详情</span>
5
+ <section @click="close">
6
+ <i class="iconfont guoran-shanchu"></i>
7
+ </section>
8
+ </div>
9
+ <template v-if="tagIds && tagIds.length != 0 && previewShowPopup">
10
+ <pdfPosition :tagIds="tagIds" ></pdfPosition>
11
+ </template>
12
+ <template v-else>
13
+ <div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 60px)">
14
+ <video :src="url" controls width="100%;" height="98%"></video>
15
+ </div>
16
+ <div v-else-if="fileType == 'HTML'" style="width: 100%;height: calc(100% - 60px)">
17
+ <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
18
+ </div>
19
+ <template v-else-if="url.includes('https://www') || url.includes('http://www')">
20
+ <iframe class="preview_iframe"
21
+ :src="url"
22
+ width="100%"
23
+ height="100%"
24
+ scrolling="100%"
25
+ frameborder="no"
26
+ border="0"></iframe>
27
+ </template>
28
+ <template v-else>
29
+ <iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
30
+ </template>
31
+ </template>
32
+ <div class="loading_img" v-show="loading">
33
+ <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
34
+ </div>
35
+ </van-popup> -->
36
+ <el-drawer
37
+ title="我是标题"
38
+ :visible.sync="drawer"
39
+ :with-header="false"
40
+ :append-to-body="true"
41
+ :destroy-on-close="true"
42
+ :model="false"
43
+ :direction="previewShowPopup ? 'btt' : 'rtl'"
44
+ :size="previewShowPopup ? '90%' : '65%'"
45
+ custom-class="pdf-preview-drawer"
46
+ v-if="drawer"
47
+ >
48
+ <!-- v-else-if="drawer" -->
49
+ <div class="drawer-footer">
50
+ <span>{{title ? title : "查看详情"}}</span>
51
+ <div class="header-right">
52
+ <template v-if="isHasChat">
53
+ <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
54
+ <i class="iconfont guoran-wendapingjia"></i>
55
+ 聊一聊
56
+ </div>
57
+ <div class="chat chat_active" @click="previewToDialog(false)" v-else>
58
+ <i class="iconfont guoran-wendapingjia"></i>
59
+ 聊一聊
60
+ </div>
61
+ </template>
62
+ <section @click="close">
63
+ <i class="iconfont guoran-shanchu"></i>
64
+ </section>
65
+ </div>
66
+ </div>
67
+ <div id="drawer_content_pre">
68
+ <template v-if="tagIds && tagIds.length != 0 && drawer">
69
+ <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :fileName="fileName" :knowledgeItem="watermark" ref="pdfPosition"></pdfPosition>
70
+ </template>
71
+ <template v-else>
72
+ <div v-if="fileType == 'VIDEO'" style="width: 100%;">
73
+ <video :src="url" controls width="100%;" height="98%"></video>
74
+ </div>
75
+ <div v-else-if="fileType == 'HTML'" style="width: 100%;">
76
+ <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
77
+ </div>
78
+ <template v-else-if="url.includes('https://www') || url.includes('http://www')">
79
+ <iframe class="preview_iframe"
80
+ :src="url"
81
+ width="100%"
82
+ height="100%"
83
+ scrolling="100%"
84
+ frameborder="no"
85
+ border="0"></iframe>
86
+ </template>
87
+ <template v-else>
88
+ <iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"></iframe>
89
+ </template>
90
+ </template>
91
+ </div>
92
+ <div class="loading_img" v-show="loading">
93
+ <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
94
+ </div>
95
+ </el-drawer>
96
+ </template>
97
+
98
+ <script>
99
+ import pdfPosition from './pdfPosition.vue'
100
+ import { zoomElement } from '../assets/js/hammer'
101
+ export default {
102
+ data () {
103
+ return {
104
+ previewShowPopup: false,
105
+ fileText:'',
106
+ fileType:"",
107
+ isPc:true,
108
+ drawer:false,
109
+ tagIds: [],
110
+ // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
111
+ loading:true,
112
+ fileName:'',
113
+ previewKnowledgeId:""
114
+ }
115
+ },
116
+ mounted() {
117
+ },
118
+ props:{
119
+ url:{
120
+ type: String,
121
+ required: true,
122
+ },
123
+ officePreviewType:{
124
+ type: String,
125
+ default: ''
126
+ },
127
+ isMessageRecord:{
128
+ type: Boolean,
129
+ default:false,
130
+ },
131
+ sourceFileType:{
132
+ type: String,
133
+ default: '',
134
+ },
135
+ watermark:{
136
+ type: Object
137
+ },
138
+ isHasChat:{
139
+ type:Boolean,
140
+ default:false
141
+ },
142
+ title: {
143
+ type: String,
144
+ default: ''
145
+ }
146
+ },
147
+ components:{
148
+ pdfPosition
149
+ },
150
+ watch:{
151
+ drawer(value) {
152
+ if(value) {
153
+ this.$nextTick(() =>{
154
+ if (this.tagIds && this.tagIds.length != 0){
155
+ zoomElement(document.getElementById('pdf_container_view'))
156
+ }
157
+ })
158
+ }
159
+ setTimeout(() => {
160
+ let previewIframe = document.getElementsByClassName('preview_iframe')
161
+ Array.from(previewIframe).forEach(item =>{
162
+ item.onload = () =>{
163
+ console.debug('previewIframe 106',previewIframe,this.drawer)
164
+ item.style.backgroundImage = 'none'
165
+ }
166
+ })
167
+ })
168
+ }
169
+ },
170
+ computed:{
171
+ previewUrl() {
172
+ console.debug('VUE_APP_ENV',process.env.VUE_APP_ENV)
173
+ let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
174
+ // if(this.url != '') {
175
+ // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
176
+ // url += btoa(encodeURIComponent(this.url))
177
+ // } else {
178
+ // url += btoa(this.url)
179
+ // }
180
+ // }
181
+ url = url + this.url
182
+ url += '&officePreviewType=pdf'
183
+ if(this.watermark) {
184
+ url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
185
+ url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
186
+ }
187
+ return url
188
+ },
189
+ // fileType() {
190
+ // const fileType = this.url.substring(this.url.lastIndexOf('.'));
191
+ // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
192
+ // return 'VIDEO'
193
+ // } else {
194
+ // return 'OTHER'
195
+ // }
196
+
197
+ // }
198
+ },
199
+ methods :{
200
+ close() {
201
+ setTimeout(() =>{
202
+ this.previewShowPopup = false;
203
+ this.fileType = ''
204
+ }, 300)
205
+ this.drawer = false;
206
+ },
207
+ loadIframe() {
208
+
209
+ if(this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0)) {
210
+ this.loading = false
211
+ } else {
212
+ let time = setInterval(() =>{
213
+ let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
214
+ if(iframe) {
215
+ this.loading = false
216
+ clearInterval(time)
217
+ }
218
+ }, 500)
219
+ }
220
+ },
221
+ getBolb() {
222
+ this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false',{
223
+ fileInOssPath: this.url,
224
+ templateId: ''
225
+ }).then(res =>{
226
+ if (res.data.code == 0) {
227
+ this.fileText = res.data.data
228
+ this.loading = false
229
+ }
230
+ })
231
+ },
232
+ previewToDialog(flag){
233
+ this.$emit('previewToDialog',flag)
234
+ }
235
+ }
236
+ }
237
+ </script>
238
+
239
+ <style lang="less" scoped>
240
+ .preview_iframe {
241
+ width: 100%;
242
+ height: 100%;
243
+ box-sizing: border-box;
244
+ background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
245
+ background-position: center;
246
+ background-size: 50px;
247
+ background-repeat: no-repeat;
248
+ }
249
+ .preview_iframe_kk{
250
+ width: 100%;
251
+ height: 100%;
252
+ }
253
+ .preview_iframe_html{
254
+ width: 100%;
255
+ height: 100%;
256
+ overflow-y: scroll;
257
+ text-align: left;
258
+ box-sizing: border-box;
259
+ padding: 16px;
260
+ /deep/.lake-content{
261
+ margin-left: 10px;
262
+ }
263
+ /deep/a:link {
264
+ color: #0000ee!important;
265
+ }
266
+ /deep/a:visited {
267
+ color: #0000ee!important;
268
+ }
269
+ /deep/a:hover {
270
+ color: #0000ee!important;
271
+ }
272
+ /deep/a:active {
273
+ color: #0000ee!important;
274
+ }
275
+ /deep/li:not(.rich-text-li), ol:not(.list-paddingleft-2), ul:not(.list-paddingleft-2){
276
+ list-style-type: auto!important;
277
+ }
278
+ /deep/img{
279
+ width: 100%;
280
+ }
281
+ /deep/.ne-table{
282
+ width: 100% !important;
283
+ }
284
+ }
285
+ .footer {
286
+ width: calc(100% - 40px);
287
+ height: 50px;
288
+ display: flex;
289
+ align-items: center;
290
+ justify-content: space-between;
291
+ cursor: pointer;
292
+ padding: 0 20px;
293
+ border-bottom: 1px solid #cccccc;
294
+ }
295
+ .loading_img {
296
+ display: flex;
297
+ align-items: center;
298
+ justify-content: center;
299
+ width: 100%;
300
+ height: 100%;
301
+ position: absolute;
302
+ top: 0;
303
+ left: 0;
304
+ background: #FFF;
305
+ img {
306
+ width: 50px;
307
+ height: 50px;
308
+ }
309
+ }
310
+
311
+ .drawer-footer{
312
+ width:100%;
313
+ height: 50px;
314
+ display: flex;
315
+ align-items: center;
316
+ justify-content: space-between;
317
+ cursor: pointer;
318
+ padding: 0 20px;
319
+ border-bottom: 1px solid #cccccc;
320
+ .header-right{
321
+ display: flex;
322
+ align-items: center;
323
+ .chat {
324
+ width: 95px;
325
+ height: 26px;
326
+ background: #ffffff;
327
+ display: flex;
328
+ align-items: center;
329
+ justify-content: center;
330
+ box-sizing: border-box;
331
+ border: 1px solid #a1b9ff;
332
+ border-radius: 15px 0px 15px 15px;
333
+ cursor: pointer;
334
+ color: #366aff;
335
+ margin-right: 10px;
336
+ font-size: 14px;
337
+ i {
338
+ font-size: 16px;
339
+ margin: 0 5px;
340
+ }
341
+ }
342
+ .chat_active {
343
+ background: #366aff !important;
344
+ color: #FFFFFF !important;
345
+ }
346
+ }
347
+ }
348
+ @media screen and (max-width: 767px) {
349
+ /* 这里是针对移动设备的css样式设置 */
350
+ /deep/.el-drawer__body{
351
+ height: 100%;
352
+ }
353
+ #drawer_content_pre {
354
+ overflow: auto;
355
+ height: calc(100% - 50px);
356
+ background: #FFF;
357
+ }
358
+ }
359
+ @media screen and (min-width: 768px) {
360
+ /* 这里是针对pc设备的css样式设置 */
361
+ /deep/.el-drawer__body{
362
+ height: 100%;
363
+ }
364
+ #drawer_content_pre {
365
+ overflow: auto;
366
+ height: calc(100% - 50px);
367
+ background: #FFF;
368
+ }
369
+ }
370
+
367
371
  </style>