askbot-dragon 1.6.76-beta → 1.6.76

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 (308) 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 +58 -55
  5. package/public/index.html +75 -72
  6. package/public/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  7. package/public/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  8. package/public/pdfjs/cmaps/78-H.bcmap +0 -0
  9. package/public/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  10. package/public/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  11. package/public/pdfjs/cmaps/78-V.bcmap +0 -0
  12. package/public/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  13. package/public/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  14. package/public/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  15. package/public/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  16. package/public/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  17. package/public/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  18. package/public/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  19. package/public/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  20. package/public/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  21. package/public/pdfjs/cmaps/Add-H.bcmap +0 -0
  22. package/public/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  23. package/public/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  24. package/public/pdfjs/cmaps/Add-V.bcmap +0 -0
  25. package/public/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  26. package/public/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  27. package/public/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  28. package/public/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  29. package/public/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  30. package/public/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  31. package/public/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  32. package/public/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  33. package/public/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  34. package/public/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  35. package/public/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  36. package/public/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  37. package/public/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  38. package/public/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  39. package/public/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  40. package/public/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  41. package/public/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  42. package/public/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  43. package/public/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  44. package/public/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  45. package/public/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  46. package/public/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  47. package/public/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  48. package/public/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  49. package/public/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  50. package/public/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  51. package/public/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  52. package/public/pdfjs/cmaps/B5-H.bcmap +0 -0
  53. package/public/pdfjs/cmaps/B5-V.bcmap +0 -0
  54. package/public/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  55. package/public/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  56. package/public/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  57. package/public/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  58. package/public/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  59. package/public/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  60. package/public/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  61. package/public/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  62. package/public/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  63. package/public/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  64. package/public/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  65. package/public/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  66. package/public/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  67. package/public/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  68. package/public/pdfjs/cmaps/EUC-H.bcmap +0 -0
  69. package/public/pdfjs/cmaps/EUC-V.bcmap +0 -0
  70. package/public/pdfjs/cmaps/Ext-H.bcmap +0 -0
  71. package/public/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  72. package/public/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  73. package/public/pdfjs/cmaps/Ext-V.bcmap +0 -0
  74. package/public/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  75. package/public/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  76. package/public/pdfjs/cmaps/GB-H.bcmap +4 -0
  77. package/public/pdfjs/cmaps/GB-V.bcmap +0 -0
  78. package/public/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  79. package/public/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  80. package/public/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  81. package/public/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  82. package/public/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  83. package/public/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  84. package/public/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  85. package/public/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  86. package/public/pdfjs/cmaps/GBT-H.bcmap +0 -0
  87. package/public/pdfjs/cmaps/GBT-V.bcmap +0 -0
  88. package/public/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  89. package/public/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  90. package/public/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  91. package/public/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  92. package/public/pdfjs/cmaps/H.bcmap +0 -0
  93. package/public/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  94. package/public/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  95. package/public/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  96. package/public/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  97. package/public/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  98. package/public/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  99. package/public/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  100. package/public/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  101. package/public/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  102. package/public/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  103. package/public/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  104. package/public/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  105. package/public/pdfjs/cmaps/Hankaku.bcmap +0 -0
  106. package/public/pdfjs/cmaps/Hiragana.bcmap +0 -0
  107. package/public/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  108. package/public/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  109. package/public/pdfjs/cmaps/KSC-H.bcmap +0 -0
  110. package/public/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  111. package/public/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  112. package/public/pdfjs/cmaps/KSC-V.bcmap +0 -0
  113. package/public/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  114. package/public/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  115. package/public/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  116. package/public/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  117. package/public/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  118. package/public/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  119. package/public/pdfjs/cmaps/Katakana.bcmap +0 -0
  120. package/public/pdfjs/cmaps/LICENSE +36 -0
  121. package/public/pdfjs/cmaps/NWP-H.bcmap +0 -0
  122. package/public/pdfjs/cmaps/NWP-V.bcmap +0 -0
  123. package/public/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  124. package/public/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  125. package/public/pdfjs/cmaps/Roman.bcmap +0 -0
  126. package/public/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  127. package/public/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  128. package/public/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  129. package/public/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  130. package/public/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  131. package/public/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  132. package/public/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  133. package/public/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  134. package/public/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  135. package/public/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  136. package/public/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  137. package/public/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  138. package/public/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  139. package/public/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  140. package/public/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  141. package/public/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  142. package/public/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  143. package/public/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  144. package/public/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  145. package/public/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  146. package/public/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  147. package/public/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  148. package/public/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  149. package/public/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  150. package/public/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  151. package/public/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  152. package/public/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  153. package/public/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  154. package/public/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  155. package/public/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  156. package/public/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  157. package/public/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  158. package/public/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  159. package/public/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  160. package/public/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  161. package/public/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  162. package/public/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  163. package/public/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  164. package/public/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  165. package/public/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  166. package/public/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  167. package/public/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  168. package/public/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  169. package/public/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  170. package/public/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  171. package/public/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  172. package/public/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  173. package/public/pdfjs/cmaps/V.bcmap +0 -0
  174. package/public/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  175. package/public/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  176. package/public/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  177. package/public/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  178. package/public/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  179. package/public/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  180. package/public/pdfjs/standard_fonts/FoxitSans.pfb +0 -0
  181. package/public/pdfjs/standard_fonts/FoxitSansBold.pfb +0 -0
  182. package/public/pdfjs/standard_fonts/FoxitSansBoldItalic.pfb +0 -0
  183. package/public/pdfjs/standard_fonts/FoxitSansItalic.pfb +0 -0
  184. package/public/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  185. package/public/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  186. package/public/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  187. package/public/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  188. package/public/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  189. package/public/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  190. package/public/pdfjs/standard_fonts/LICENSE_LIBERATION +102 -0
  191. package/public/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  192. package/public/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  193. package/public/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  194. package/public/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  195. package/src/App.vue +31 -31
  196. package/src/api/index.js +1 -1
  197. package/src/api/mock.http +2 -2
  198. package/src/api/requestUrl.js +185 -185
  199. package/src/assets/image/default_avt_ui.png +0 -0
  200. package/src/assets/image/filtType/audio.png +0 -0
  201. package/src/assets/image/filtType/excel1.png +0 -0
  202. package/src/assets/image/filtType/general.png +0 -0
  203. package/src/assets/image/filtType/html.png +0 -0
  204. package/src/assets/image/filtType/image1.png +0 -0
  205. package/src/assets/image/filtType/link.png +0 -0
  206. package/src/assets/image/filtType/md2.png +0 -0
  207. package/src/assets/image/filtType/mode.png +0 -0
  208. package/src/assets/image/filtType/news.png +0 -0
  209. package/src/assets/image/filtType/pdf1.png +0 -0
  210. package/src/assets/image/filtType/ppt1.png +0 -0
  211. package/src/assets/image/filtType/selfadd1.png +0 -0
  212. package/src/assets/image/filtType/txt1.png +0 -0
  213. package/src/assets/image/filtType/video.png +0 -0
  214. package/src/assets/image/filtType/wechat.png +0 -0
  215. package/src/assets/image/filtType/word1.png +0 -0
  216. package/src/assets/image/loading.gif +0 -0
  217. package/src/assets/js/AliyunlssUtil.js +117 -92
  218. package/src/assets/js/Base64Util.js +22 -22
  219. package/src/assets/js/common.js +287 -252
  220. package/src/assets/js/hammer.js +89 -100
  221. package/src/assets/js/script.js +36 -36
  222. package/src/assets/less/common.css +6773 -6773
  223. package/src/assets/less/converSationContainer/common.less +192 -199
  224. package/src/assets/less/converSationContainer/converSatonContainer.less +486 -493
  225. package/src/assets/less/iconfont.css +37 -37
  226. package/src/assets/less/ticketMessage.less +294 -294
  227. package/src/assets/less/variables.less +122 -0
  228. package/src/components/ActionAlertIframe.vue +155 -177
  229. package/src/components/AiGuide.vue +473 -466
  230. package/src/components/AnswerDocknowledge.vue +1207 -1059
  231. package/src/components/AnswerVoice.vue +286 -285
  232. package/src/components/AskIFrame.vue +15 -15
  233. package/src/components/ConversationContainer.vue +10880 -4934
  234. package/src/components/FileType.vue +86 -86
  235. package/src/components/Message.vue +27 -27
  236. package/src/components/MyEditor.vue +343 -351
  237. package/src/components/QwFeedback.vue +304 -0
  238. package/src/components/actionSatisfaction.vue +109 -107
  239. package/src/components/actionSendToBot.vue +64 -62
  240. package/src/components/answerDissatisfaction.vue +64 -62
  241. package/src/components/answerRadio.vue +261 -186
  242. package/src/components/ask-components/DissatisfactionOptions.vue +58 -57
  243. package/src/components/ask-components/Msgloading.vue +38 -37
  244. package/src/components/ask-components/SatisfactionV2.vue +15 -15
  245. package/src/components/askVideo.vue +214 -162
  246. package/src/components/assetDetails.vue +379 -378
  247. package/src/components/assetMessage.vue +231 -228
  248. package/src/components/associationIntention.vue +414 -355
  249. package/src/components/attachmentPreview.vue +92 -90
  250. package/src/components/botActionSatisfactor.vue +70 -68
  251. package/src/components/chatContent.vue +514 -513
  252. package/src/components/feedBack.vue +138 -136
  253. package/src/components/fielListView.vue +352 -351
  254. package/src/components/file/AliyunOssComponents.vue +108 -108
  255. package/src/components/formTemplate.vue +3517 -3572
  256. package/src/components/imgView.vue +32 -0
  257. package/src/components/intelligentSummary.vue +232 -227
  258. package/src/components/interruptComponents/imageSelectionAnswer.vue +203 -0
  259. package/src/components/interruptComponents/multipleChoiceAnswer.vue +134 -0
  260. package/src/components/interruptComponents/singleChoiceAnswer.vue +82 -0
  261. package/src/components/kkview.vue +1130 -1138
  262. package/src/components/loadingProcess.vue +164 -164
  263. package/src/components/markDownText.vue +961 -0
  264. package/src/components/message/ActionAlertIframe.vue +112 -112
  265. package/src/components/message/ShopMessage.vue +164 -164
  266. package/src/components/message/TextMessage.vue +926 -924
  267. package/src/components/message/TicketMessage.vue +201 -201
  268. package/src/components/message/swiper/index.js +4 -4
  269. package/src/components/message/swiper/ticketSwiper.vue +503 -503
  270. package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
  271. package/src/components/msgLoading.vue +231 -231
  272. package/src/components/myPopup.vue +75 -70
  273. package/src/components/outputComponents/outputCom.vue +149 -0
  274. package/src/components/pagination.vue +130 -0
  275. package/src/components/pdfPosition.vue +1337 -1506
  276. package/src/components/popup.vue +230 -227
  277. package/src/components/preview/docView.vue +263 -0
  278. package/src/components/preview/excelView.vue +260 -0
  279. package/src/components/preview/markDownView.vue +70 -0
  280. package/src/components/preview/newPositionPreview.vue +601 -0
  281. package/src/components/preview/pdfView.vue +973 -0
  282. package/src/components/previewDoc.vue +253 -247
  283. package/src/components/previewPdf.vue +1106 -757
  284. package/src/components/previewWisdom.vue +252 -0
  285. package/src/components/receiverMessagePlatform.vue +71 -65
  286. package/src/components/recommend.vue +82 -80
  287. package/src/components/selector/hOption.vue +20 -20
  288. package/src/components/selector/hSelector.vue +199 -199
  289. package/src/components/selector/hWrapper.vue +216 -216
  290. package/src/components/senderMessagePlatform.vue +60 -50
  291. package/src/components/source/BotMessage.vue +24 -24
  292. package/src/components/source/CustomMessage.vue +24 -24
  293. package/src/components/test.vue +260 -260
  294. package/src/components/tree.vue +310 -295
  295. package/src/components/utils/AliyunIssUtil.js +103 -81
  296. package/src/components/utils/ckeditor.js +185 -174
  297. package/src/components/utils/format_date.js +25 -25
  298. package/src/components/utils/index.js +6 -6
  299. package/src/components/utils/math_utils.js +29 -29
  300. package/src/components/voiceComponent.vue +122 -119
  301. package/src/components/welcomeKnowledgeFile.vue +346 -340
  302. package/src/components/welcomeLlmCard.vue +142 -140
  303. package/src/components/welcomeSuggest.vue +99 -97
  304. package/src/locales/cn.json +100 -0
  305. package/src/locales/en.json +99 -0
  306. package/src/main.js +76 -57
  307. package/vue.config.js +54 -54
  308. package/src/components/newPdfPosition.vue +0 -878
@@ -1,757 +1,1106 @@
1
-
2
- <!-- preview-pdf
3
- 组件主要负责 知识项目中 文件的预览,携带定位信息参数 tagIds tagId 的会解析文件增加定位功能
4
- 不携带定位信息的 也是走 kkview项目预览
5
- 另外增加了在知识项目中预览当前文件的一些功能
6
- -->
7
- <template>
8
- <el-drawer title="我是标题" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
9
- :modal="false" :direction="previewShowPopup ? 'btt' : 'rtl'" :size="previewShowPopup ? '90%' : '65%'"
10
- custom-class="pdf-preview-drawer" v-if="drawer">
11
- <!-- v-else-if="drawer" -->
12
- <div class="drawer-header" :class="isLiBang ? 'libang_head' : ''" v-if="!isPc">
13
- <div class="header-btn btn_position">
14
- <div class="onload_btn" v-if="isDownload || true" @click="downLoad">
15
- 下载
16
- </div>
17
- <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
18
- v-if="isHasChat || true">
19
- <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
20
- <span>智能摘要</span>
21
- </div>
22
- <template v-if="isHasChat || true">
23
- <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
24
- <i class="iconfont guoran-wendapingjia"></i>
25
- 聊一聊
26
- </div>
27
- <div class="chat chat_active" @click="previewToDialog(false)" v-else>
28
- <i class="iconfont guoran-wendapingjia"></i>
29
- 聊一聊
30
- </div>
31
- </template>
32
- </div>
33
- <div class="header_title">
34
- <div class="header_close">
35
- <span>
36
- {{ title ? title : "查看详情" }}
37
- </span>
38
- <section @click="close">
39
- <i class="iconfont guoran-shanchu"></i>
40
- </section>
41
- </div>
42
- <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
43
- <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
44
- {{ folderName }}
45
- <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
46
- </p>
47
- </div>
48
- </div>
49
- <div class="drawer-header" :class="isLiBang && folderName ? 'libang_head' : ''" v-else>
50
- <div class="header_title">
51
- <div :class="isLiBang && folderName ? 'header_close' : 'header_top'">
52
- <span>
53
- {{ title ? title : "查看详情" }}
54
- </span>
55
- <div class="header-btn">
56
- <div class="onload_btn" v-if="isDownload || true" @click="downLoad">
57
- 下载
58
- </div>
59
- <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
60
- v-if="isHasChat || true">
61
- <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
62
- <span>智能摘要</span>
63
- </div>
64
- <template v-if="isHasChat || true">
65
- <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
66
- <i class="iconfont guoran-wendapingjia"></i>
67
- 聊一聊
68
- </div>
69
- <div class="chat chat_active" @click="previewToDialog(false)" v-else>
70
- <i class="iconfont guoran-wendapingjia"></i>
71
- 聊一聊
72
- </div>
73
- </template>
74
- <section @click="close">
75
- <i class="iconfont guoran-shanchu"></i>
76
- </section>
77
- </div>
78
- </div>
79
- <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
80
- <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
81
- {{ folderName }}
82
- <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
83
- </p>
84
- </div>
85
- </div>
86
- <div id="drawer_content_pre" :class="isLiBang && folderName ? 'libang_content_pre' : ''">
87
- <!-- :style="{marginTop:tagIds && tagIds.length != 0 && isPc ? '50px' : ''}" -->
88
- <intelligent-summary v-show="showSummary && isHasChat" :tagIds="tagIds" :knowledgeId="knowledgeId"
89
- @closeSummary="closeSummary" @recommendQues="recommendQues"
90
- @getSummarySuccess="getSummarySuccess"></intelligent-summary>
91
- <div class="pdf_positon" :style="pdfStyle" v-if="tagIds && tagIds.length != 0 && drawer">
92
- <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :textWatermarkStr="textWatermarkStr">
93
- </pdfPosition>
94
- </div>
95
- <template v-else>
96
- <div v-if="fileType == 'VIDEO'" style="width: 100%;">
97
- <video :src="url" controls width="100%;" height="98%"></video>
98
- </div>
99
- <div v-else-if="fileType == 'HTML'" style="width: 100%;">
100
- <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
101
- </div>
102
- <template v-else-if="url.includes('https://www') || url.includes('http://www')">
103
- <iframe class="preview_iframe" :src="url" width="100%" height="100%" scrolling="100%" frameborder="no"
104
- border="0"></iframe>
105
- </template>
106
- <template v-else>
107
- <iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"
108
- :style="{ height: iframeHeight }"></iframe>
109
- </template>
110
- </template>
111
- <!-- <div class="mobile_onload_btn" v-if="isDownload && !isPc" @click="downLoad">
112
- 下载
113
- </div> -->
114
- </div>
115
- <div class="loading_img" v-show="loading">
116
- <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
117
- </div>
118
- </el-drawer>
119
- </template>
120
-
121
- <script>
122
- import pdfPosition from './pdfPosition.vue'
123
- import { zoomElement } from '../assets/js/hammer'
124
- import IntelligentSummary from "./intelligentSummary";
125
- import { isMobile } from "../assets/js/common";
126
- // import { Toast } from 'vant';
127
- export default {
128
- data () {
129
- return {
130
- previewShowPopup: false,
131
- fileText: '',
132
- fileType: "",
133
- isPc: false,
134
- drawer: false,
135
- tagIds: [],
136
- // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
137
- loading: true,
138
- fileName:'',
139
- previewKnowledgeId:"",
140
- showSummary:true,
141
- iframeHeight:"100%",
142
- isDownload: false,
143
- textWatermarkStr:""
144
- }
145
- },
146
- mounted() {
147
- window.addEventListener('message',this.handleIframeMessage,false);
148
- this.isPcFun();
149
- },
150
- props:{
151
- url:{
152
- type: String,
153
- required: true,
154
- },
155
- officePreviewType:{
156
- type: String,
157
- default: ''
158
- },
159
- isMessageRecord:{
160
- type: Boolean,
161
- default:false,
162
- },
163
- sourceFileType:{
164
- type: String,
165
- default: '',
166
- },
167
- title: {
168
- type: String,
169
- default: ''
170
- },
171
- isHasChat:{
172
- type:Boolean,
173
- default:false
174
- },
175
- knowledgeId:{
176
- type: String,
177
- default: '',
178
- },
179
- previewOssPath:{
180
- type: String,
181
- default: '',
182
- },
183
- folderName: {
184
- type: String,
185
- default: '',
186
- },
187
- folderUrl: {
188
- type: String,
189
- default: '',
190
- },
191
- isLiBang: {
192
- type: Boolean,
193
- default: false
194
- }
195
- },
196
- components: {
197
- IntelligentSummary,
198
- pdfPosition
199
- },
200
- watch: {
201
- drawer (value) {
202
- if (value) {
203
- this.$emit('open')
204
- this.$nextTick(() => {
205
- if (this.tagIds && this.tagIds.length != 0){
206
- zoomElement(document.getElementById('pdf_container_view'))
207
- }
208
- })
209
- } else {
210
- this.$emit('close')
211
- }
212
- setTimeout(() => {
213
- let previewIframe = document.getElementsByClassName('preview_iframe')
214
- Array.from(previewIframe).forEach(item =>{
215
- item.onload = () =>{
216
- console.debug('previewIframe 106',previewIframe,this.drawer)
217
- item.style.backgroundImage = 'none'
218
- }
219
- })
220
- })
221
- },
222
- showSummary:{
223
- handler(val){
224
- // if (!val){
225
- // this.$nextTick(() => {
226
- // let preCon = document.querySelector('.pdf_view');
227
- // if (preCon){
228
- // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
229
- // }
230
- // })
231
- // } else {
232
- // this.getSummarySuccess();
233
- // }
234
- if(val) {
235
- this.getSummarySuccess();
236
- }
237
- }
238
- },
239
- knowledgeId:{
240
- handler(val){
241
- if (val){
242
- this.getTextWatermark();
243
- }
244
- }
245
- }
246
- },
247
- computed:{
248
- pdfStyle() {
249
- return {
250
- paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
251
- paddingBottom: this.tagIds > 1 ? '60px' : '0',
252
- height: '100%'
253
- }
254
- },
255
- previewUrl() {
256
- console.debug('VUE_APP_ENV',process.env.VUE_APP_ENV)
257
- let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
258
- // if(this.url != '') {
259
- // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
260
- // url += btoa(encodeURIComponent(this.url))
261
- // } else {
262
- // url += btoa(this.url)
263
- // }
264
- // }
265
- url = url + this.url
266
- url += '&officePreviewType=pdf'
267
- if(this.watermark) {
268
- url = this.watermark.textWatermarkValue ? (url += '&textWatermarkValue=' + this.watermark.textWatermarkValue) : url
269
- url = this.watermark.visitorWatermarkValue ? (url += '&visitorWatermarkValue=' + this.watermark.visitorWatermarkValue) : url
270
- }
271
- console.log('textWatermarkStr 216', this.textWatermarkStr)
272
- if (this.textWatermarkStr) {
273
- url += '&textWatermarkValue=' + this.textWatermarkStr
274
- }
275
- return url
276
- },
277
- // fileType() {
278
- // const fileType = this.url.substring(this.url.lastIndexOf('.'));
279
- // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
280
- // return 'VIDEO'
281
- // } else {
282
- // return 'OTHER'
283
- // }
284
-
285
- // }
286
- },
287
- methods: {
288
- close () {
289
- setTimeout(() => {
290
- this.previewShowPopup = false;
291
- this.fileType = ''
292
- }, 300)
293
- this.drawer = false;
294
- this.showSummary = false;
295
- },
296
- loadIframe () {
297
-
298
- if (this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0)) {
299
- this.loading = false
300
- } else {
301
- let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
302
- if (iframe) {
303
- iframe.onload = () => {
304
- this.loading = false;
305
- document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
306
- }
307
- }
308
- // let time = setInterval(() =>{
309
- //
310
- // if(iframe) {
311
- // this.loading = false
312
- // clearInterval(time)
313
- // }
314
- // }, 500)
315
- }
316
- },
317
- getBolb () {
318
- this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false', {
319
- fileInOssPath: this.url,
320
- templateId: ''
321
- }).then(res => {
322
- if (res.data.code == 0) {
323
- this.fileText = res.data.data
324
- this.loading = false
325
- }
326
- })
327
- },
328
- previewToDialog (flag) {
329
- this.$emit('previewToDialog', flag)
330
- },
331
- closeSummary () {
332
- this.showSummary = false;
333
- },
334
- recommendQues (item, knowledgeId) {
335
- console.log('recommendQues', item, knowledgeId);
336
- this.$emit('recommendQues', item, knowledgeId)
337
- },
338
- handleIframeMessage (res) {
339
- console.log('handleIframeMessage', res)
340
- if (res.data.type == 'getViewerHeight') {
341
- let iframeHeight = this.iframeHeight.replace('px', '')
342
- if (res.data.data && iframeHeight != (res.data.data + 50)) {
343
- this.iframeHeight = res.data.data + 50 + 'px'
344
- }
345
- }
346
- },
347
- summaryFun () {
348
- this.showSummary = !this.showSummary;
349
- if (this.showSummary) {
350
- document.getElementById('drawer_content_pre').scrollTop = 0;
351
- }
352
- },
353
- getSummarySuccess () {
354
- this.$nextTick(() => {
355
- // if (this.tagIds.length > 0){
356
- // let intelligentSummary = document.getElementById('intelligentSummary');
357
- // let preCon = document.querySelector('.pdf_view')
358
- // if (intelligentSummary){
359
- // let height = intelligentSummary.offsetHeight + (this.isPc ? 100 : 50 );
360
- // if (preCon){
361
- // preCon.style.height = 'calc(100% - ' + height + 'px)'
362
- // }
363
- // console.log('height',height,preCon)
364
- // }
365
- // }
366
- // let intelligentSummary = document.getElementById('intelligentSummary');
367
- // let height = intelligentSummary.offsetHeight
368
- // this.pdfStyle.height = 'calc(100% - ' + height + 'px)'
369
- })
370
- },
371
- getTextWatermark () {
372
- let url = '/knowledge-api/open/knowledge/getPermissionInfo';
373
- let obj = {
374
- "knowledgeId": this.knowledgeId,
375
- "userId": sessionStorage.getItem('_currentUserId'),
376
- "mainId": sessionStorage.getItem('_mainId'),
377
- "corpId": sessionStorage.getItem('_corpid')
378
- }
379
- this.$http.post(url, obj).then(res => {
380
- console.log('getTextWatermark', res.data.data)
381
- if (res.data.data) {
382
- this.textWatermarkStr = res.data.data.textWatermarkStr;
383
- this.isDownload = res.data.data.showDownloadBtn;
384
- }
385
- })
386
- },
387
- downLoad () {
388
- let url = this.previewOssPath
389
- if (decodeURIComponent(url) != url) {
390
- url = decodeURIComponent(url)
391
- }
392
- const fileType = url.substring(url.lastIndexOf('.'));
393
- this.$http.post('/knowledge-api/temporary-certificate/or-origin?expired=10', url, {
394
- headers: {
395
- "Content-Type": "application/json",
396
- }
397
- }).then(res => {
398
- console.log('downLoad 341', res)
399
- if (res.data|| res.bodyText) {
400
- if (isMobile()) {
401
-
402
- const iframe = document.createElement("iframe");
403
- iframe.setAttribute("hidden", "hidden");
404
- iframe.onload = () => {
405
- if (iframe) {
406
- console.log("iframe onload....")
407
- iframe.setAttribute('src', 'about:blank');
408
- }
409
- };
410
- document.body.insertBefore(iframe, null);
411
- iframe.setAttribute("src", res.data || res.bodyText);
412
- } else {
413
- let a = document.createElement('a')
414
- a.href = res.data|| res.bodyText
415
- a.download = (this.title) + fileType
416
- a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
417
- }
418
- this.close()
419
-
420
- }
421
- })
422
- },
423
- isPcFun () {
424
- if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
425
- this.isPc = false
426
- } else {
427
- this.isPc = true
428
- }
429
- },
430
- clickFloder() {
431
- this.$emit('previewClickFloder')
432
- }
433
- },
434
- beforeDestroy () {
435
- window.removeEventListener('message', this.handleIframeMessage);
436
- }
437
- }
438
- </script>
439
-
440
- <style lang="less" scoped>
441
- #drawer_content_pre {
442
- padding: 20px;
443
- scroll-behavior: smooth;
444
-
445
- .mobile_onload_btn {
446
- position: absolute;
447
- right: 0;
448
- bottom: 10%;
449
- width: 20px;
450
- height: 60px;
451
- display: flex;
452
- align-items: center;
453
- justify-content: center;
454
- cursor: pointer;
455
- border-top-left-radius: 10px;
456
- border-bottom-left-radius: 10px;
457
- color: #366aff;
458
- background: #ffffff;
459
- border: 1px solid #a1b9ff;
460
- font-size: 12px;
461
- border-right: none;
462
- text-align: center;
463
- }
464
-
465
- .pdf_positon {
466
- width: 100%;
467
- box-sizing: border-box;
468
- }
469
- }
470
-
471
- .onload_btn {
472
- width: 76px;
473
- height: 26px;
474
- display: flex;
475
- align-items: center;
476
- justify-content: center;
477
- cursor: pointer;
478
- margin-right: 10px;
479
- border-radius: 15px;
480
- color: #366aff;
481
- background: #ffffff;
482
- border: 1px solid #a1b9ff;
483
- box-sizing: border-box;
484
- }
485
-
486
- .preview_iframe {
487
- width: 100%;
488
- height: 100%;
489
- box-sizing: border-box;
490
- background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
491
- background-position: center;
492
- background-size: 50px;
493
- background-repeat: no-repeat;
494
- }
495
-
496
- .preview_iframe_kk {
497
- width: 100%;
498
- height: 100%;
499
- }
500
-
501
-
502
- .preview_iframe_html {
503
- width: 100%;
504
- height: 100%;
505
- overflow-y: scroll;
506
- text-align: left;
507
- box-sizing: border-box;
508
- padding: 16px;
509
-
510
- /deep/.lake-content {
511
- margin-left: 10px;
512
- }
513
-
514
- /deep/a:link {
515
- color: #0000ee !important;
516
- }
517
-
518
- /deep/a:visited {
519
- color: #0000ee !important;
520
- }
521
-
522
- /deep/a:hover {
523
- color: #0000ee !important;
524
- }
525
-
526
- /deep/a:active {
527
- color: #0000ee !important;
528
- }
529
-
530
- /deep/li:not(.rich-text-li),
531
- ol:not(.list-paddingleft-2),
532
- ul:not(.list-paddingleft-2) {
533
- list-style-type: auto !important;
534
- }
535
-
536
- /deep/img {
537
- width: 100%;
538
- }
539
-
540
- /deep/.ne-table {
541
- width: 100% !important;
542
- }
543
- }
544
-
545
- .footer {
546
- width: calc(100% - 40px);
547
- height: 50px;
548
- display: flex;
549
- align-items: center;
550
- justify-content: space-between;
551
- cursor: pointer;
552
- padding: 0 20px;
553
- border-bottom: 1px solid #cccccc;
554
- }
555
-
556
- .loading_img {
557
- display: flex;
558
- align-items: center;
559
- justify-content: center;
560
- width: 100%;
561
- height: 100%;
562
- position: absolute;
563
- top: 0;
564
- left: 0;
565
- background: #FFF;
566
-
567
- img {
568
- width: 50px;
569
- height: 50px;
570
- }
571
- }
572
-
573
- .libang_head {
574
- height: 64px !important;
575
- }
576
-
577
- .drawer-header {
578
- width: 100%;
579
- height: 50px;
580
- cursor: pointer;
581
- padding: 6px 20px;
582
- border-bottom: 1px solid #cccccc;
583
- .btn_position {
584
- position: absolute;
585
- top: -34px;
586
- left: 12px;
587
- }
588
-
589
- .header-btn {
590
- display: flex;
591
- align-items: center;
592
- justify-content: space-between;
593
-
594
- .header-right {
595
- display: flex;
596
- }
597
-
598
- .summaryBtn {
599
- flex: none;
600
- //width: 95px;
601
- height: 26px;
602
- padding: 0 8px;
603
- background: #ffffff;
604
- display: flex;
605
- align-items: center;
606
- justify-content: center;
607
- box-sizing: border-box;
608
- border: 1px solid #a1b9ff;
609
- border-radius: 15px;
610
- cursor: pointer;
611
- color: #366aff;
612
- margin-right: 10px;
613
- font-size: 14px;
614
-
615
- i {
616
- font-size: 14px;
617
- margin-right: 5px;
618
- }
619
- }
620
-
621
- .summaryActiveBtn {
622
- background: #366aff !important;
623
- color: #ffffff !important;
624
- }
625
-
626
- .chat {
627
- flex: none;
628
- height: 26px;
629
- padding: 0 8px;
630
- background: #ffffff;
631
- display: flex;
632
- align-items: center;
633
- justify-content: center;
634
- box-sizing: border-box;
635
- border: 1px solid #a1b9ff;
636
- border-radius: 15px 0px 15px 15px;
637
- cursor: pointer;
638
- color: #366aff;
639
- margin-right: 10px;
640
- font-size: 14px;
641
-
642
- i {
643
- font-size: 14px;
644
- margin-right: 5px;
645
- margin-top: 2px;
646
- }
647
- }
648
-
649
- .chat_active {
650
- background: #366aff !important;
651
- color: #FFFFFF !important;
652
- }
653
- }
654
-
655
- .header_title {
656
- font-size: 14px;
657
- height: 100%;
658
- .header_close {
659
- display: flex;
660
- align-items: center;
661
- justify-content: space-between;
662
- line-height: 26px;
663
- }
664
- .header_floder {
665
- display: flex;
666
- align-items: center;
667
- line-height: 26px;
668
- i {
669
- margin: 0 5px;
670
- color: #366aff;
671
- }
672
- }
673
- .header_top {
674
- height: 100%;
675
- display: flex;
676
- align-items: center;
677
- justify-content: space-between;
678
- }
679
- }
680
- }
681
-
682
- @media screen and (max-width: 767px) {
683
-
684
- /* 这里是针对移动设备的css样式设置 */
685
- /deep/.el-drawer__body {
686
- height: 100%;
687
- }
688
-
689
- #drawer_content_pre {
690
- overflow: auto;
691
- height: calc(100% - 50px);
692
- background: #FFF;
693
- }
694
-
695
- .libang_content_pre {
696
- height: calc(100% - 64px) !important;
697
- }
698
- }
699
-
700
- @media screen and (min-width: 768px) {
701
-
702
- /* 这里是针对pc设备的css样式设置 */
703
- /deep/.el-drawer__body {
704
- height: 100%;
705
- }
706
-
707
- #drawer_content_pre {
708
- overflow: auto;
709
- height: calc(100% - 50px);
710
- background: #FFF;
711
- }
712
-
713
- .libang_content_pre {
714
- height: calc(100% - 64px) !important;
715
- }
716
- }
717
-
718
- @media screen and (min-width: 1200px) {
719
-
720
- /* 这里是针对pc设备的css样式设置 */
721
- .el-drawer__wrapper {
722
- width: 55%;
723
- left: calc(100vw - 55%);
724
- right: 0;
725
-
726
- /deep/.pdf-preview-drawer {
727
- width: 100% !important;
728
- }
729
- }
730
-
731
- /deep/.el-drawer__body {
732
- height: 100%;
733
- }
734
-
735
- #drawer_content_pre {
736
- overflow: auto;
737
- height: calc(100% - 50px);
738
- background: #FFF;
739
- }
740
-
741
- .libang_content_pre {
742
- height: calc(100% - 64px) !important;
743
- }
744
- }
745
- </style><style lang="less">
746
- .pdf-preview-drawer {
747
- overflow: visible !important;
748
- }
749
- .libang_content_pre {
750
- .change_scale {
751
- top: 64px !important;
752
- }
753
- .float_intelligentSummary {
754
- top: 74px !important;
755
- }
756
- }
757
- </style>
1
+
2
+ <!-- preview-pdf
3
+ 组件主要负责 知识项目中 文件的预览,携带定位信息参数 tagIds tagId 的会解析文件增加定位功能
4
+ 不携带定位信息的 也是走 kkview项目预览
5
+ 另外增加了在知识项目中预览当前文件的一些功能
6
+ -->
7
+ <template>
8
+ <el-drawer title="" :visible.sync="drawer" :with-header="false" :append-to-body="true" :destroy-on-close="true"
9
+ :modal="false" :direction="!isPc ? 'btt' : 'rtl'" :size="!isPc ? '90%' : '65%'"
10
+ custom-class="pdf-preview-drawer" v-if="drawer">
11
+ <div class="drawer-header" :class="(isDownload || (isHasChat && fileType != 'IMAGE')) && isLiBang ? 'has_btn_libang_head' : (isLiBang ? 'libang_head' : (isDownload || (isHasChat && fileType != 'IMAGE') ? 'has_btn_head' : ''))" v-if="!isPc">
12
+ <div class="header_title">
13
+ <template v-if="isDownload || (isHasChat && fileType != 'IMAGE')">
14
+ <div class="top-header">
15
+ <div class="header-btn">
16
+ <div class="onload_btn" v-if="isDownload" @click="downLoad">
17
+ {{ $t('dragonCommon.download') }}
18
+ </div>
19
+ <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun" v-if="isHasChat && fileType != 'IMAGE'">
20
+ <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
21
+ <span>{{ $t('dragonCommon.smartSummary') }}</span>
22
+ </div>
23
+ <template v-if="isHasChat && fileType != 'IMAGE'">
24
+ <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
25
+ <i class="iconfont guoran-wendapingjia"></i>
26
+ {{ $t('dragonCommon.chat') }}
27
+ </div>
28
+ <div class="chat chat_active" @click="previewToDialog(false)" v-else>
29
+ <i class="iconfont guoran-wendapingjia"></i>
30
+ {{ $t('dragonCommon.chat') }}
31
+ </div>
32
+ </template>
33
+ </div>
34
+ <section @click="close">
35
+ <i class="iconfont guoran-shanchu"></i>
36
+ </section>
37
+ </div>
38
+ <span class="title_left">
39
+ {{ title ? title : $t('dragonCommon.viewDetails') }}
40
+ </span>
41
+ </template>
42
+ <div class="header_close" v-else>
43
+ <span class="title_left">
44
+ {{ title ? title : $t('dragonCommon.viewDetails') }}
45
+ </span>
46
+ <section @click="close">
47
+ <i class="iconfont guoran-shanchu"></i>
48
+ </section>
49
+ </div>
50
+ <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
51
+ <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
52
+ {{ folderName }}
53
+ <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
54
+ </p>
55
+ </div>
56
+ </div>
57
+ <div class="drawer-header" :class="isLiBang && folderName ? 'libang_head' : ''" v-else>
58
+ <div class="header_title">
59
+ <div :class="isLiBang && folderName ? 'header_close' : 'header_top'">
60
+ <span class="title_left">
61
+ {{ title ? title : $t('dragonCommon.viewDetails') }}
62
+ </span>
63
+ <div class="header-btn">
64
+ <div class="onload_btn" v-if="isDownload" @click="downLoad">
65
+ {{ $t('dragonCommon.download') }}
66
+ </div>
67
+ <div class="summaryBtn" :class="showSummary ? 'summaryActiveBtn' : ''" @click="summaryFun"
68
+ v-if="isHasChat && fileType != 'IMAGE'">
69
+ <i class="iconfont guoran-tongyichicun-write-29-jiqiren"></i>
70
+ <span>{{ $t('dragonCommon.smartSummary') }}</span>
71
+ </div>
72
+ <template v-if="isHasChat && fileType != 'IMAGE'">
73
+ <div class="chat" @click="previewToDialog(true)" v-if="!previewKnowledgeId">
74
+ <i class="iconfont guoran-wendapingjia"></i>
75
+ {{ $t('dragonCommon.chat') }}
76
+ </div>
77
+ <div class="chat chat_active" @click="previewToDialog(false)" v-else>
78
+ <i class="iconfont guoran-wendapingjia"></i>
79
+ {{ $t('dragonCommon.chat') }}
80
+ </div>
81
+ </template>
82
+ <section @click="close">
83
+ <i class="iconfont guoran-shanchu"></i>
84
+ </section>
85
+ </div>
86
+ </div>
87
+ <p v-if="folderName && isLiBang" class="header_floder" @click="clickFloder">
88
+ <i class="iconfont guoran-tongyichicun-wenjianjia-zhankaizhuangtai--folderOpen"></i>
89
+ {{ folderName }}
90
+ <i v-if="folderUrl" class="iconfont guoran-tongyichicun-dianjichakantuli"></i>
91
+ </p>
92
+ </div>
93
+ </div>
94
+ <div id="drawer_content_pre" :class="(isDownload || (isHasChat && fileType != 'IMAGE')) && !isPc && isLiBang && folderName ? 'has_btn_libang_content_pre' : (isLiBang && folderName ? 'libang_content_pre' : '')">
95
+ <intelligent-summary v-show="showSummary && (isHasChat && fileType != 'IMAGE')" :tagIds="tagIds" :knowledgeId="knowledgeId"
96
+ @closeSummary="closeSummary" @recommendQues="recommendQues"
97
+ @getSummarySuccess="getSummarySuccess"></intelligent-summary>
98
+ <div class="pdf_positon" :style="pdfStyle" v-if="tagIds && tagIds.length != 0 && drawer && newVersion === false && newFileType !== 'PPT' && newFileType !== 'PPTX' && newFileType !== 'IMAGE'">
99
+ <pdfPosition :tagIds="tagIds" :isMessageRecord="isMessageRecord" :textWatermarkStr="textWatermarkStr">
100
+ </pdfPosition>
101
+ </div>
102
+ <new-position-preview
103
+ ref="newPositionPreview"
104
+ v-else-if="tagIds && tagIds.length!= 0 && newVersion && newFileType !== 'PPT' && newFileType !== 'PPTX' && newFileType !== 'IMAGE'"
105
+ :knowledgeId="knowledgeId"
106
+ :tagIds="tagIds"
107
+ :url="previewHref"
108
+ :textWatermarkStr="textWatermarkStr"
109
+ :previewOssPath="previewOssPath"
110
+ :isLining="isLining"
111
+ ></new-position-preview>
112
+ <template v-else>
113
+ <div v-if="fileType == 'VIDEO'" style="width: 100%;">
114
+ <video :src="url" controls width="100%;" height="98%"></video>
115
+ </div>
116
+ <div v-else-if="fileType == 'HTML'" style="width: 100%;">
117
+ <div class="preview_iframe_html" style="text-align:left" v-html="fileText"></div>
118
+ </div>
119
+ <template v-else-if="url.includes('https://www') || url.includes('http://www')">
120
+ <iframe class="preview_iframe" :src="url" width="100%" height="100%" scrolling="100%" frameborder="no"
121
+ border="0"></iframe>
122
+ </template>
123
+ <template v-else>
124
+ <iframe class="preview_iframe_kk" :src="previewUrl" style="border:none;"
125
+ :style="{ height: iframeHeight }"></iframe>
126
+ <template v-if="!loading && ((newFileType === 'PPT' || newFileType === 'PPTX') && pageChunkData.length > 1)">
127
+ <div class="btn_footer" v-if="!isPc">
128
+ <div class="prev" @click="prev">{{$t('dragonCommon.previous')}}</div>
129
+ <div class="next" @click="next">{{$t('dragonCommon.next')}}</div>
130
+ </div>
131
+ <div id="pagination" v-if="isPc">
132
+ <el-pagination :current-page="currentPage + 1" @current-change="currentChange" @prev-click="prev"
133
+ @next-click="next" layout="slot, prev, pager, next" :page-size="1" :total="pageChunkData.length">
134
+ <span class="total-class">{{$t('dragonCommon.answersGeneratedByPre')}} {{ pageChunkData.length }} {{$t('dragonCommon.answersGeneratedByAfter')}}</span>
135
+ </el-pagination>
136
+ </div>
137
+ </template>
138
+ </template>
139
+ </template>
140
+ </div>
141
+ <div class="loading_img" v-show="loading">
142
+ <img src="https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif" alt="">
143
+ </div>
144
+ <div id="text">
145
+ {{ copy }}
146
+ </div>
147
+ </el-drawer>
148
+ </template>
149
+
150
+ <script>
151
+ import pdfPosition from './pdfPosition.vue'
152
+ import { zoomElement } from '../assets/js/hammer'
153
+ import IntelligentSummary from "./intelligentSummary";
154
+ import { isMobile } from "../assets/js/common";
155
+ import { Toast } from 'vant';
156
+ import NewPositionPreview from "./preview/newPositionPreview";
157
+ export default {
158
+ data () {
159
+ return {
160
+ previewShowPopup: false,
161
+ fileText: '',
162
+ fileType: "",
163
+ isPc: false,
164
+ drawer: false,
165
+ tagIds: [],
166
+ // '6454aa1a70573a6ead6f0f7d', '6454aa1a70573a6ead6f0f81',
167
+ loading: true,
168
+ previewKnowledgeId: "",
169
+ showSummary: false,
170
+ iframeHeight: "100%",
171
+ isDownload: false,
172
+ textWatermarkStr: "",
173
+ copy:'',
174
+ newVersion:'',
175
+ previewHref:"",
176
+ newFileType:"",
177
+ numberPage:0,
178
+ pageChunkData:[],
179
+ currentPage:0
180
+ }
181
+ },
182
+ mounted () {
183
+ this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
184
+ window.addEventListener('message', this.handleIframeMessage, false);
185
+ this.isPcFun();
186
+ },
187
+ props: {
188
+ url: {
189
+ type: String,
190
+ required: true,
191
+ },
192
+ officePreviewType: {
193
+ type: String,
194
+ default: ''
195
+ },
196
+ isMessageRecord: {
197
+ type: Boolean,
198
+ default: false,
199
+ },
200
+ sourceFileType: {
201
+ type: String,
202
+ default: '',
203
+ },
204
+ title: {
205
+ type: String,
206
+ default: ''
207
+ },
208
+ isHasChat: {
209
+ type: Boolean,
210
+ default: false
211
+ },
212
+ knowledgeId: {
213
+ type: String,
214
+ default: '',
215
+ },
216
+ previewOssPath: {
217
+ type: String,
218
+ default: '',
219
+ },
220
+ folderName: {
221
+ type: String,
222
+ default: '',
223
+ },
224
+ folderUrl: {
225
+ type: String,
226
+ default: '',
227
+ },
228
+ isLiBang: {
229
+ type: Boolean,
230
+ default: false
231
+ },
232
+ isLining:{
233
+ type: Boolean,
234
+ default: false
235
+ },
236
+ processEnvUrl:{
237
+ type: String,
238
+ default: ''
239
+ },
240
+ isProduction:{
241
+ type: Boolean,
242
+ default: false
243
+ }
244
+ },
245
+ components: {
246
+ NewPositionPreview,
247
+ IntelligentSummary,
248
+ pdfPosition
249
+ },
250
+ watch: {
251
+ drawer (value) {
252
+ if (value) {
253
+ this.$emit('open')
254
+ this.$nextTick(() => {
255
+ zoomElement(document.getElementById('drawer_content_pre'))
256
+ })
257
+ } else {
258
+ this.$emit('close')
259
+ }
260
+ },
261
+ showSummary: {
262
+ handler (val) {
263
+ // if (!val){
264
+ // this.$nextTick(() => {
265
+ // let preCon = document.querySelector('.pdf_view');
266
+ // if (preCon){
267
+ // preCon.style.height = 'calc(100% - ' + 50 + 'px)'
268
+ // }
269
+ // })
270
+ // } else {
271
+ // this.getSummarySuccess();
272
+ // }
273
+ if (val) {
274
+ this.getSummarySuccess();
275
+ }
276
+ }
277
+ },
278
+ knowledgeId: {
279
+ handler (val) {
280
+ if (val) {
281
+ this.getTextWatermark();
282
+ }
283
+ }
284
+ }
285
+ },
286
+ computed: {
287
+ pdfStyle () {
288
+ return {
289
+ paddingTop: this.isPc ? '30px' : '0', // 30px 是 加上外层的 20 流出 50的上边距展示 放大缩小操作栏
290
+ paddingBottom: this.tagIds > 1 ? '60px' : '0',
291
+ height: '100%'
292
+ }
293
+ },
294
+ previewUrl () {
295
+ let url = ""
296
+ if (process.env.VUE_APP_ENV == 'production'){
297
+ url = "https://kkfileview.askbot.cn/onlinePreview?url="
298
+ } else {
299
+ url = "https://test.open.askbot.cn/kkfileview/onlinePreview?url="
300
+ }
301
+ if (this.processEnvUrl){
302
+ url = this.processEnvUrl
303
+ }
304
+ if(process.env.VUE_APP_SOURCE == 'lining_test') {
305
+ url = 'https://wxgw.lining.com/askbot/kkfileview/onlinePreview?url='
306
+ }
307
+ console.debug('VUE_APP_ENV', process.env.VUE_APP_ENV,process.env.VUE_APP_SOURCE,url)
308
+ // if(this.url != '') {
309
+ // if(/[\u4E00-\u9FA5]+/g.test(this.url)) {
310
+ // url += btoa(encodeURIComponent(this.url))
311
+ // } else {
312
+ // url += btoa(this.url)
313
+ // }
314
+ // }
315
+ url = url + this.url
316
+ if (this.sourceFileType == '.ppt' || this.sourceFileType == '.pptx' || this.sourceFileType == '.pdf') {
317
+ url += '&officePreviewType=pdf'
318
+ }
319
+ console.log('textWatermarkStr 216', this.textWatermarkStr)
320
+ if (this.textWatermarkStr) {
321
+ url += '&textWatermarkValue=' + this.textWatermarkStr
322
+ }
323
+ if (this.isLining){
324
+ url += '&isLining=true'
325
+ }
326
+ return url
327
+ },
328
+ // fileType() {
329
+ // const fileType = this.url.substring(this.url.lastIndexOf('.'));
330
+ // if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.mov') {
331
+ // return 'VIDEO'
332
+ // } else {
333
+ // return 'OTHER'
334
+ // }
335
+
336
+ // }
337
+ },
338
+ methods: {
339
+ close () {
340
+ setTimeout(() => {
341
+ this.previewShowPopup = false;
342
+ this.fileType = ''
343
+ }, 300)
344
+ this.drawer = false;
345
+ this.showSummary = false;
346
+ },
347
+ loadIframe () {
348
+
349
+ if (this.fileType == 'VIDEO' || this.fileType == 'WECHAT' || (this.tagIds && this.tagIds.length != 0 && this.newFileType !== 'PPT' && this.newFileType !== 'PPTX' && this.newFileType !== 'IMAGE')) {
350
+ this.loading = false
351
+ } else {
352
+ let iframe = document.getElementsByClassName('preview_iframe')[0] || document.getElementsByClassName('preview_iframe_kk')[0];
353
+ if (iframe) {
354
+ iframe.onload = () => {
355
+ this.loading = false;
356
+ document.getElementById('drawer_content_pre').style.backgroundImage = 'none'
357
+ }
358
+ }
359
+ // let time = setInterval(() =>{
360
+ //
361
+ // if(iframe) {
362
+ // this.loading = false
363
+ // clearInterval(time)
364
+ // }
365
+ // }, 500)
366
+ }
367
+ },
368
+ getBolb () {
369
+ this.$http.post('/knowledge-api/knowledge/htmlTextDeal?onlyText=false', {
370
+ fileInOssPath: this.url,
371
+ templateId: ''
372
+ }).then(res => {
373
+ if (res.data.code == 0) {
374
+ this.fileText = res.data.data
375
+ this.loading = false
376
+ }
377
+ })
378
+ },
379
+ previewToDialog (flag) {
380
+ this.$emit('previewToDialog', flag)
381
+ },
382
+ closeSummary () {
383
+ this.showSummary = false;
384
+ },
385
+ recommendQues (item, knowledgeId) {
386
+ console.log('recommendQues', item, knowledgeId);
387
+ this.$emit('recommendQues', item, knowledgeId)
388
+ },
389
+ handleIframeMessage (res) {
390
+ if (res.data.type == 'getViewerHeight') {
391
+ let iframeHeight = this.iframeHeight.replace('px', '')
392
+ if (res.data.data && iframeHeight != (res.data.data + 50)) {
393
+ this.iframeHeight = res.data.data + 50 + 'px'
394
+ }
395
+ }
396
+ if (res.data.type == 'getViewPage' && res.data.data){
397
+ this.numberPage = Number(res.data.data);
398
+ if (this.pageChunkData.length > 0){
399
+ this.scrollPPTPage(this.pageChunkData[0])
400
+ }
401
+ }
402
+ if (res.data.type == 'getViewerHeight' || res.data.type == 'getViewPage'){
403
+ if (this.pageChunkData.length > 0){
404
+ this.scrollPPTPage(this.pageChunkData[0])
405
+ }
406
+ }
407
+ },
408
+ summaryFun () {
409
+ this.showSummary = !this.showSummary;
410
+ if (this.showSummary) {
411
+ document.getElementById('drawer_content_pre').scrollTop = 0;
412
+ }
413
+ },
414
+ getSummarySuccess () {
415
+ this.$nextTick(() => {
416
+ // if (this.tagIds.length > 0){
417
+ // let intelligentSummary = document.getElementById('intelligentSummary');
418
+ // let preCon = document.querySelector('.pdf_view')
419
+ // if (intelligentSummary){
420
+ // let height = intelligentSummary.offsetHeight + (this.isPc ? 100 : 50 );
421
+ // if (preCon){
422
+ // preCon.style.height = 'calc(100% - ' + height + 'px)'
423
+ // }
424
+ // console.log('height',height,preCon)
425
+ // }
426
+ // }
427
+ // let intelligentSummary = document.getElementById('intelligentSummary');
428
+ // let height = intelligentSummary.offsetHeight
429
+ // this.pdfStyle.height = 'calc(100% - ' + height + 'px)'
430
+ })
431
+ },
432
+ getTextWatermark () {
433
+ let url = '/knowledge-api/open/knowledge/getPermissionInfo';
434
+ let obj = {
435
+ "knowledgeId": this.knowledgeId,
436
+ "userId": sessionStorage.getItem('_currentUserId'),
437
+ "mainId": sessionStorage.getItem('_mainId'),
438
+ "corpId": sessionStorage.getItem('_corpid')
439
+ }
440
+ this.$http.post(url, obj).then(res => {
441
+ console.log('getTextWatermark', res.data.data)
442
+ if (res.data.data) {
443
+ this.textWatermarkStr = res.data.data.textWatermarkStr;
444
+ this.isDownload = res.data.data.showDownloadBtn;
445
+ }
446
+ })
447
+ },
448
+ downLoad () {
449
+ let url = this.previewOssPath
450
+ if (decodeURIComponent(url) != url) {
451
+ url = decodeURIComponent(url)
452
+ }
453
+ const fileType = url.substring(url.lastIndexOf('.'));
454
+ this.$http.post('/knowledge-api/temporary-certificate/or-origin?expired=10', url, {
455
+ headers: {
456
+ "Content-Type": "application/json",
457
+ }
458
+ }).then(res => {
459
+ console.log('downLoad 341', res)
460
+ if (res.data || res.bodyText) {
461
+ if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
462
+ this.copy = res.data
463
+ if (isMobile()) {
464
+ setTimeout(() =>{
465
+ const range = document.createRange();
466
+ range.selectNode(document.getElementById('text'));
467
+ const selection = window.getSelection();
468
+ //移除之前选中内容
469
+ if (selection.rangeCount > 0) selection.removeAllRanges();
470
+ selection.addRange(range);
471
+ document.execCommand('copy');
472
+ selection.removeAllRanges()
473
+ Toast(this.$t('dragonCommon.Safaridownload'));
474
+ this.close()
475
+ },100)
476
+ } else {
477
+ let a = document.createElement('a')
478
+ a.href = res.data
479
+ a.download = (this.title) + fileType
480
+ a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
481
+ }
482
+ return
483
+ } else {
484
+ // setTimeout(() =>{
485
+ // window.open(res.data,'下载', 'noopener')
486
+ // }, 2000)
487
+ // window.open(res.data,'下载', 'noopener')
488
+ if (isMobile()) {
489
+ const iframe = document.createElement("iframe");
490
+ iframe.setAttribute("hidden", "hidden");
491
+ iframe.onload = () => {
492
+ if (iframe) {
493
+ console.log("iframe onload....")
494
+ iframe.setAttribute('src', 'about:blank');
495
+ }
496
+ };
497
+ document.body.insertBefore(iframe, null);
498
+ iframe.setAttribute("src", res.data);
499
+ } else {
500
+ let a = document.createElement('a')
501
+ a.href = res.data
502
+ a.download = (this.title) + fileType
503
+ a.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true, view: window }))
504
+ }
505
+ this.close()
506
+ }
507
+ }
508
+ })
509
+ },
510
+ isPcFun () {
511
+ if (/(iPhone|iPad|iPod|iOS|Android)/i.test(navigator.userAgent)) {
512
+ this.isPc = false
513
+ } else {
514
+ let documentWidth = document.documentElement.clientWidth;
515
+ if(documentWidth < 750) {
516
+ this.isPc = false
517
+ } else {
518
+ this.isPc = true
519
+ }
520
+ }
521
+ },
522
+ clickFloder() {
523
+ this.$emit('previewClickFloder')
524
+ },
525
+ getOssPath(url){
526
+ let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate';
527
+ let type = this.getFileType(url)
528
+ this.newFileType = type;
529
+ console.log('type',type)
530
+ if (type === 'VIDEO' || type === 'PDF' || type === 'EXCEL' || type === 'TXT' || type === 'DOC' || type === 'MD') {
531
+ httpUrl += '?needEncrypt=false'
532
+ } else {
533
+ httpUrl += '?needEncrypt=true'
534
+ }
535
+ this.$http.post(httpUrl, {
536
+ "fileInOssPath": url
537
+ }).then(res => {
538
+ console.log('getOssPath',res)
539
+ if (res.data.code == '0'){
540
+ this.previewHref = res.data.data;
541
+ }
542
+ })
543
+ },
544
+ getFileType(url){
545
+ let index = url.lastIndexOf('?')
546
+ let newFileInOssPath = url.substring(0, url.indexOf("?"))
547
+ if (index == -1){
548
+ newFileInOssPath = url
549
+ }
550
+ const fileType = newFileInOssPath.substring(newFileInOssPath.lastIndexOf('.'));
551
+ if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc') {
552
+ return 'VIDEO'
553
+ } else if (fileType === '.html') {
554
+ return 'HTML'
555
+ } else if (fileType === '.png' || fileType === '.jpg' || fileType === '.jpeg' || fileType === '.PNG' || fileType === '.JPG' || fileType === '.JPEG') {
556
+ return 'IMAGE'
557
+ } else if (fileType === '.docx' || fileType === '.doc'){
558
+ return 'DOC'
559
+ } else if (fileType === '.ppt' || fileType === '.pptx'){
560
+ return 'PPT'
561
+ } else if (fileType === '.pdf'){
562
+ return 'PDF'
563
+ } else if (fileType === '.txt'){
564
+ return 'TXT'
565
+ } else if (fileType === '.md'){
566
+ return 'MD'
567
+ } else {
568
+ return 'OTHER'
569
+ }
570
+ },
571
+ //判断是否使用新定位组件
572
+ getLocationInfo(){
573
+ this.newVersion = "";
574
+ this.$http.get('/knowledge-api/knowledge/knowledge-part-location-info/list?ids=' + this.tagIds.join(',')).then(res => {
575
+ console.log('getLocationInfo',res)
576
+ this.pageChunkData = [];
577
+ if (res.data.code == 0){
578
+ if (res.data.data && res.data.data.length > 0 && res.data.data[0].extractVersion == 'v3'){
579
+ this.newVersion = true;
580
+ if (this.newFileType !== 'PPT' && this.newFileType !== 'PPTX' && this.newFileType !== 'IMAGE'){
581
+ this.loading = false;
582
+ }
583
+ for (let i=0;i<res.data.data.length;i++){
584
+ if (res.data.data[i].paragraphChunkInfo && res.data.data[i].paragraphChunkInfo.pageChunkData){
585
+ this.pageChunkData.push(res.data.data[i].paragraphChunkInfo.pageChunkData.page_number)
586
+ }
587
+ }
588
+ if (this.pageChunkData.length > 1){
589
+ let iframe = document.getElementsByClassName('preview_iframe_kk')
590
+ if (iframe && iframe.length > 0){
591
+ iframe[0].style.paddingBottom = '50px'
592
+ }
593
+ }
594
+ } else {
595
+ this.newVersion = false;
596
+ }
597
+ }
598
+ })
599
+ },
600
+ currentChange (value) {
601
+ this.currentPage = value - 1;
602
+ this.scrollPPTPage()
603
+ },
604
+ prev(){
605
+ if (this.currentPage == 0){
606
+ return
607
+ }
608
+ this.currentPage--;
609
+ this.scrollPPTPage()
610
+ },
611
+ next(){
612
+ if (this.currentPage === (this.pageChunkData.length - 1)){
613
+ return;
614
+ }
615
+ this.currentPage++;
616
+ this.scrollPPTPage()
617
+ },
618
+ scrollPPTPage(){
619
+ if (this.numberPage > 0){
620
+ let pageNumber = this.pageChunkData[this.currentPage];
621
+ let height = Math.floor(Number(this.iframeHeight.replace('px',"")));
622
+ let pageHeight = Math.floor(height / this.numberPage);
623
+ let scrollHeight = (pageNumber - 1) * pageHeight;
624
+ let dom = document.getElementById('drawer_content_pre');
625
+ if (dom){
626
+ dom.scrollTo(0,scrollHeight)
627
+ }
628
+ }
629
+ }
630
+ },
631
+ beforeDestroy () {
632
+ window.removeEventListener('message', this.handleIframeMessage);
633
+ }
634
+ }
635
+ </script>
636
+
637
+ <style lang="less" scoped>
638
+ @import "../assets/less/variables.less";
639
+
640
+ #drawer_content_pre {
641
+ padding: 20px;
642
+ scroll-behavior: smooth;
643
+
644
+ .mobile_onload_btn {
645
+ position: absolute;
646
+ right: 0;
647
+ bottom: 10%;
648
+ width: 20px;
649
+ height: 60px;
650
+ display: flex;
651
+ align-items: center;
652
+ justify-content: center;
653
+ cursor: pointer;
654
+ border-top-left-radius: 10px;
655
+ border-bottom-left-radius: 10px;
656
+ color: @font-primary-accent-color;
657
+ background: @background-color-light;
658
+ border: 1px solid @border-color-copy;
659
+ font-size: 12px;
660
+ border-right: none;
661
+ text-align: center;
662
+ }
663
+
664
+ .pdf_positon {
665
+ width: 100%;
666
+ box-sizing: border-box;
667
+ }
668
+ }
669
+
670
+ .onload_btn {
671
+ width: 76px;
672
+ height: 26px;
673
+ display: flex;
674
+ align-items: center;
675
+ justify-content: center;
676
+ cursor: pointer;
677
+ margin-right: 10px;
678
+ border-radius: 15px;
679
+ color: @font-primary-accent-color;
680
+ background: @background-color-light;
681
+ border: 1px solid @border-color-copy;
682
+ box-sizing: border-box;
683
+ }
684
+
685
+ .preview_iframe {
686
+ width: 100%;
687
+ height: 100%;
688
+ box-sizing: border-box;
689
+ background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
690
+ background-position: center;
691
+ background-size: 50px;
692
+ background-repeat: no-repeat;
693
+ }
694
+
695
+ .preview_iframe_kk {
696
+ width: 100%;
697
+ height: 100%;
698
+ }
699
+ .btn_footer {
700
+ width: 100%;
701
+ height: 60px;
702
+ display: flex;
703
+ align-items: center;
704
+ justify-content: space-around;
705
+ position: absolute;
706
+ bottom: 0px;
707
+ left: 0;
708
+ z-index: 999;
709
+ background: @background-color-light;
710
+
711
+ .prev,
712
+ .next {
713
+ width: 35%;
714
+ height: 40px;
715
+ display: flex;
716
+ align-items: center;
717
+ justify-content: center;
718
+ border-radius: 50px;
719
+ cursor: pointer;
720
+ }
721
+
722
+ .prev {
723
+ background: @background-color-prev;
724
+ color: @font-primary-color;
725
+ }
726
+
727
+ .next {
728
+ background: @primary-color;
729
+ color: @font-primary-light-color;
730
+ }
731
+ }
732
+ #pagination {
733
+ .total-class {
734
+ margin-right: 13px;
735
+ font-weight: 400;
736
+ }
737
+
738
+ position: absolute;
739
+ bottom: 0px;
740
+ right: 0;
741
+ width: 100%;
742
+ display: flex;
743
+ align-items: center;
744
+ justify-content: center;
745
+ height: 50px;
746
+ background-color: @background-color-light;
747
+ box-shadow: 0px 0px 18px 0px rgba(29, 55, 129, 0.07);
748
+ border-radius: 5px;
749
+ z-index: 1000;
750
+
751
+
752
+
753
+ /deep/.el-pagination {
754
+ margin-right: 110px;
755
+ }
756
+
757
+ /deep/.el-pager {
758
+ background: @background-color-pagination;
759
+ border-radius: 15px;
760
+ }
761
+
762
+ /deep/.el-pagination.is-background .btn-next {
763
+ width: 30px;
764
+ height: 30px;
765
+ background: @background-color-pagination;
766
+ border-radius: 50%;
767
+ }
768
+
769
+ /deep/.el-pagination .btn-next {
770
+ width: 30px;
771
+ height: 30px;
772
+ background: @background-color-pagination;
773
+ border-radius: 50%;
774
+ padding-left: 0;
775
+ margin-left: 5px;
776
+ }
777
+
778
+ /deep/.el-pagination .btn-prev {
779
+ width: 30px;
780
+ height: 30px;
781
+ background: @background-color-pagination;
782
+ border-radius: 50%;
783
+ padding-right: 0;
784
+ margin-right: 5px;
785
+ }
786
+
787
+ /deep/.el-pagination button {
788
+ padding: 0;
789
+ min-width: 30px;
790
+ }
791
+
792
+ /deep/.el-pager li {
793
+ background: @background-color-pagination;
794
+ height: 30px;
795
+ min-width: 30px;
796
+ line-height: 30px;
797
+ font-size: 12px;
798
+ color: @font-pagination-color;
799
+ }
800
+
801
+ /deep/.el-pager li:first-child {
802
+ border-bottom-left-radius: 15px !important;
803
+ border-top-left-radius: 15px !important;
804
+ }
805
+
806
+ /deep/.el-pager li:last-child {
807
+ border-top-right-radius: 15px !important;
808
+ border-bottom-right-radius: 15px !important;
809
+ }
810
+
811
+ /deep/.el-pager li.active {
812
+ width: 30px;
813
+ height: 30px;
814
+ min-width: 30px;
815
+ background: @primary-color;
816
+ border: 3px solid @border-color-copy;
817
+ border-radius: 50%;
818
+ line-height: 24px;
819
+ color: @font-primary-light-color;
820
+ }
821
+
822
+ /deep/.el-pagination.is-background .el-pager li:not(.disabled).active {
823
+ background: @primary-color;
824
+ }
825
+ }
826
+ .preview_iframe_html {
827
+ width: 100%;
828
+ height: 100%;
829
+ overflow-y: scroll;
830
+ text-align: left;
831
+ box-sizing: border-box;
832
+ padding: 16px;
833
+
834
+ /deep/.lake-content {
835
+ margin-left: 10px;
836
+ }
837
+
838
+ /deep/a:link {
839
+ color: #0000ee !important;
840
+ }
841
+
842
+ /deep/a:visited {
843
+ color: #0000ee !important;
844
+ }
845
+
846
+ /deep/a:hover {
847
+ color: #0000ee !important;
848
+ }
849
+
850
+ /deep/a:active {
851
+ color: #0000ee !important;
852
+ }
853
+
854
+ /deep/li:not(.rich-text-li),
855
+ ol:not(.list-paddingleft-2),
856
+ ul:not(.list-paddingleft-2) {
857
+ list-style-type: auto !important;
858
+ }
859
+
860
+ /deep/img {
861
+ width: 100%;
862
+ }
863
+
864
+ /deep/.ne-table {
865
+ width: 100% !important;
866
+ }
867
+ }
868
+
869
+ .footer {
870
+ width: calc(100% - 40px);
871
+ height: 50px;
872
+ display: flex;
873
+ align-items: center;
874
+ justify-content: space-between;
875
+ cursor: pointer;
876
+ padding: 0 20px;
877
+ border-bottom: 1px solid @border-color-r5;
878
+ }
879
+
880
+ .loading_img {
881
+ display: flex;
882
+ align-items: center;
883
+ justify-content: center;
884
+ width: 100%;
885
+ height: 100%;
886
+ position: absolute;
887
+ top: 0;
888
+ left: 0;
889
+ background: @background-color-light;
890
+
891
+ img {
892
+ width: 50px;
893
+ height: 50px;
894
+ }
895
+ }
896
+
897
+ .libang_head {
898
+ height: 64px !important;
899
+ }
900
+ .has_btn_libang_head{
901
+ height: 85px!important;
902
+ }
903
+ .has_btn_head{
904
+ height: 60px!important;
905
+ }
906
+ .drawer-header {
907
+ width: 100%;
908
+ height: 50px;
909
+ cursor: pointer;
910
+ padding: 6px 20px;
911
+ border-bottom: 1px solid @border-color-r5;
912
+ .btn_position {
913
+ position: absolute;
914
+ top: -34px;
915
+ left: 12px;
916
+ }
917
+
918
+ .header-btn {
919
+ display: flex;
920
+ align-items: center;
921
+ justify-content: space-between;
922
+ flex: none;
923
+ .header-right {
924
+ display: flex;
925
+ }
926
+ .summaryBtn {
927
+ flex: none;
928
+ //width: 95px;
929
+ height: 26px;
930
+ padding: 0 8px;
931
+ background: @background-color-light;
932
+ display: flex;
933
+ align-items: center;
934
+ justify-content: center;
935
+ box-sizing: border-box;
936
+ border: 1px solid @border-color-copy;
937
+ border-radius: 15px;
938
+ cursor: pointer;
939
+ color: @font-primary-accent-color;
940
+ margin-right: 10px;
941
+ font-size: 14px;
942
+
943
+ i {
944
+ font-size: 14px;
945
+ margin-right: 5px;
946
+ }
947
+ }
948
+
949
+ .summaryActiveBtn {
950
+ background: @primary-color !important;
951
+ color: @font-primary-light-color !important;
952
+ }
953
+
954
+ .chat {
955
+ flex: none;
956
+ height: 26px;
957
+ padding: 0 8px;
958
+ background: @background-color-light;
959
+ display: flex;
960
+ align-items: center;
961
+ justify-content: center;
962
+ box-sizing: border-box;
963
+ border: 1px solid @border-color-copy;
964
+ border-radius: 15px 0px 15px 15px;
965
+ cursor: pointer;
966
+ color: @font-primary-accent-color;
967
+ margin-right: 10px;
968
+ font-size: 14px;
969
+
970
+ i {
971
+ font-size: 14px;
972
+ margin-right: 5px;
973
+ margin-top: 2px;
974
+ }
975
+ }
976
+
977
+ .chat_active {
978
+ background: @primary-color !important;
979
+ color: @font-primary-light-color !important;
980
+ }
981
+ }
982
+
983
+ .header_title {
984
+ font-size: 14px;
985
+ height: 100%;
986
+ .header_close {
987
+ display: flex;
988
+ align-items: center;
989
+ justify-content: space-between;
990
+ line-height: 26px;
991
+ }
992
+ .title_left {
993
+ white-space: nowrap; /* 确保文本不会换行 */
994
+ overflow: hidden; /* 隐藏超出容器的文本 */
995
+ text-overflow: ellipsis; /* 当文本超出容器时显示省略号 */
996
+ margin-right: 8px;
997
+ text-align: left;
998
+ }
999
+ .top-header{
1000
+ display: flex;
1001
+ align-items: center;
1002
+ justify-content: flex-end;
1003
+ margin-bottom: 6px;
1004
+ }
1005
+ .header_floder {
1006
+ display: flex;
1007
+ align-items: center;
1008
+ line-height: 26px;
1009
+ text-align: left;
1010
+ i {
1011
+ margin: 0 5px;
1012
+ color: @font-primary-accent-color;
1013
+ }
1014
+ }
1015
+ .header_top {
1016
+ height: 100%;
1017
+ display: flex;
1018
+ align-items: center;
1019
+ justify-content: space-between;
1020
+ }
1021
+ }
1022
+ }
1023
+ .has_btn_libang_content_pre{
1024
+ height: calc(100% - 85px) !important;
1025
+ }
1026
+ @media screen and (max-width: 767px) {
1027
+
1028
+ /* 这里是针对移动设备的css样式设置 */
1029
+ /deep/.el-drawer__body {
1030
+ height: 100%;
1031
+ }
1032
+
1033
+ #drawer_content_pre {
1034
+ overflow: auto;
1035
+ height: calc(100% - 50px);
1036
+ background: @background-color-light;
1037
+ background-image: url('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/cdn-common/images/loading.gif');
1038
+ background-position: center;
1039
+ background-size: 50px;
1040
+ background-repeat: no-repeat;
1041
+ }
1042
+
1043
+ .libang_content_pre {
1044
+ height: calc(100% - 64px) !important;
1045
+ }
1046
+ }
1047
+
1048
+ @media screen and (min-width: 768px) {
1049
+
1050
+ /* 这里是针对pc设备的css样式设置 */
1051
+ /deep/.el-drawer__body {
1052
+ height: 100%;
1053
+ }
1054
+
1055
+ #drawer_content_pre {
1056
+ overflow: auto;
1057
+ height: calc(100% - 50px);
1058
+ background: @background-color-light;
1059
+ }
1060
+
1061
+ .libang_content_pre {
1062
+ height: calc(100% - 64px) !important;
1063
+ }
1064
+ }
1065
+
1066
+ @media screen and (min-width: 1200px) {
1067
+
1068
+ /* 这里是针对pc设备的css样式设置 */
1069
+ .el-drawer__wrapper {
1070
+ width: 55%;
1071
+ left: calc(100vw - 55%);
1072
+ right: 0;
1073
+
1074
+ /deep/.pdf-preview-drawer {
1075
+ width: 100% !important;
1076
+ }
1077
+ }
1078
+
1079
+ /deep/.el-drawer__body {
1080
+ height: 100%;
1081
+ }
1082
+
1083
+ #drawer_content_pre {
1084
+ overflow: auto;
1085
+ height: calc(100% - 50px);
1086
+ background: @background-color-light;
1087
+ }
1088
+
1089
+ .libang_content_pre {
1090
+ height: calc(100% - 64px) !important;
1091
+ }
1092
+ }
1093
+ </style>
1094
+ <style lang="less">
1095
+ .pdf-preview-drawer {
1096
+ overflow: visible !important;
1097
+ }
1098
+ .libang_content_pre {
1099
+ .change_scale {
1100
+ top: 64px !important;
1101
+ }
1102
+ .float_intelligentSummary {
1103
+ top: 74px !important;
1104
+ }
1105
+ }
1106
+ </style>