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
@@ -0,0 +1,961 @@
1
+ <template>
2
+ <div @click="lookImage">
3
+ <div class="think" v-if="hasThinkValue">
4
+ <p class="think_title" :style="{ height: showThink ? '32px' : '20px' }" @click="showThink = !showThink">
5
+ <span class="think_title_left">
6
+ <i class="iconfont guoran-icon-deepseek"></i>
7
+ {{ $t('dragonCommon.deeplyPondered') }}
8
+ <span v-if="!isHistory">({{ $t('dragonCommon.time') }} {{ filterTime(thinkTimeNum) }})</span>
9
+ </span>
10
+ <span class="think_title_right" :class="showThink ? '' : 'hide_think_title'">
11
+ <i class="iconfont guoran-jiantouxiangshang"></i>
12
+ </span>
13
+ </p>
14
+ <div class="think_content" :class="showThink ? '' : 'hide_think'" v-html="parseThinkVal">
15
+ </div>
16
+ </div>
17
+ <!-- <vue-markdown
18
+ class="mark_down"
19
+ :source="typedContent"
20
+ :ref="'markdown' + msgId"
21
+ @click.native="clickMarkDown"
22
+ :plugins="plugins"
23
+ >
24
+ </vue-markdown> -->
25
+ <!-- v-show="hasContent" -->
26
+ <div
27
+ class="mark_down"
28
+ v-html="markParseText"
29
+ ref="markDown"
30
+ @click="clickMarkDown">
31
+ </div>
32
+ <!-- <div v-show="!hasThinkValue && !hasContent" class="blinking-cursor"></div> -->
33
+ <div v-if="showPreview">
34
+ <img-view :url-list="imgList" @closeViewer="closeViewer"></img-view>
35
+ </div>
36
+ </div>
37
+
38
+ </template>
39
+
40
+ <script>
41
+ /* eslint-disable */
42
+ // import VueMarkdown from 'vue-markdown';
43
+ import ImgView from "./imgView.vue";
44
+ // import Typed from "typed.js";
45
+ import hljs from 'highlight.js';
46
+ import 'highlight.js/styles/default.css';
47
+ import { v4 as uuidv4 } from "uuid";
48
+ const marked = require("marked")
49
+ export default {
50
+ name: "markDownText",
51
+ data() {
52
+ return {
53
+ eventSource: null,
54
+ plugins: [
55
+
56
+ ],
57
+ typedContent: "",
58
+ typingSpeed: 15,
59
+ showPreview: false,
60
+ imgList: [],
61
+ isManualScroll: false,
62
+ hasThinkValue: false,
63
+ chainThinkValue: "",
64
+ showThink: true,
65
+ streamThinkValueAddFlag: false,
66
+ timer: null,
67
+ generatingString: "",
68
+ generatingThinkString: "",
69
+ streamEnd: false,
70
+ thinkCount: 0,
71
+ thinkTimer: null,
72
+ thinkTimeNum: 0,
73
+ thinkEnd: true,
74
+ signSetFlag: false,
75
+ // 重试地址
76
+ retryUrl: "",
77
+ }
78
+ },
79
+ props: {
80
+ chainValues: {
81
+ type: String,
82
+ default: ""
83
+ },
84
+ msgId: {
85
+ type: String,
86
+ default: ""
87
+ },
88
+ isHistory: {
89
+ type: Boolean,
90
+ default: false
91
+ },
92
+ streamRequestUrl: {
93
+ type: String,
94
+ default: ""
95
+ },
96
+ whetherRequestStream: {
97
+ type: Boolean,
98
+ default: false
99
+ }
100
+ },
101
+ computed: {
102
+ hasContent() {
103
+ if (!this.markParseText) return false; // 如果 markParseText 为空,返回 false
104
+ const tempDiv = document.createElement("div");
105
+ tempDiv.innerHTML = this.markParseText;
106
+ const textContent = tempDiv.textContent || tempDiv.innerText || "";
107
+ return textContent.trim() !== ""; // 如果文本内容不为空,返回 true
108
+ },
109
+ markParseText() {
110
+ const regex = /```json\n{"content":"/g
111
+ const regex2 = /```json\n{\n "content": "/g
112
+ let str = this.typedContent
113
+ str = str.replace(regex, "")
114
+ str = str.replace(regex2, "")
115
+ str = str.replaceAll("\\n", "\n")
116
+ // 处理特殊情况,标题前的多个换行符补充一个空行
117
+ str = str.replaceAll("\n\n ###", "<p> <p/>\n ###")
118
+ let markdown = marked.marked(str, {
119
+ breaks: true
120
+ })
121
+ return this.parseCode(markdown)
122
+ },
123
+ parseThinkVal() {
124
+ let str = this.chainThinkValue;
125
+ str = str.replaceAll("\\n", "\n")
126
+ str = str.replaceAll("\n", "<br>")
127
+ return this.parseCode(str)
128
+ }
129
+ },
130
+ components: {
131
+ ImgView
132
+ },
133
+ mounted() {
134
+ this.$nextTick(() => {
135
+ console.log("this.askMassageStream: ", this.askMassageStream);
136
+ console.log("this.whetherRequestStream: ", this.whetherRequestStream);
137
+ console.log("this.streamRequestUrl: ", this.streamRequestUrl);
138
+ console.log("this.isHistory: ", this.isHistory);
139
+ if (this.isHistory) {
140
+ if (this.whetherRequestStream) {
141
+ console.log("71 新版 真 流 打字 效果");
142
+ window.addEventListener('wheel', this.handleScroll, true);
143
+ this.streamInfo(this.streamRequestUrl);
144
+ } else {
145
+ this.typedContent = this.filterThinkVal(this.chainValues);
146
+ this.$nextTick(() =>{
147
+ this.appendCopyBtn()
148
+ })
149
+ }
150
+ } else {
151
+ console.log("78 pre 新版 真 流 打字 效果");
152
+ // 新版 真 流 打字 效果
153
+ if (this.askMassageStream && this.whetherRequestStream && this.streamRequestUrl) {
154
+ console.log("81 新版 真 流 打字 效果");
155
+ window.addEventListener('wheel', this.handleScroll, true);
156
+ this.streamInfo(this.streamRequestUrl);
157
+ } else {
158
+ console.log("markdowncopy 旧版 模拟 流 打字 效果 sseOtherInfo");
159
+ this.$emit("sseOtherInfo", this.msgId, "start", "");
160
+ this.$emit("sseOtherInfo", this.msgId, "hideloading", "");
161
+ // 旧版 模拟 流 打字 效果
162
+ this.typedContent = this.filterThinkVal(this.chainValues);
163
+ this.$nextTick(() =>{
164
+ this.appendCopyBtn()
165
+ })
166
+ }
167
+ }
168
+ })
169
+ },
170
+ methods: {
171
+ closeMessageStream() {
172
+ this.eventSource.close();
173
+ setTimeout(() => {
174
+ let str = this.typedContent + this.generatingString
175
+ this.$set(this, "typedContent", str)
176
+ this.generatingString = "";
177
+ let str2 = this.filterText(this.chainThinkValue + this.generatingThinkString)
178
+ this.$set(this, "chainThinkValue", str2)
179
+ this.generatingThinkString = "";
180
+ this.closeTimeOut()
181
+ clearInterval(this.thinkTimer)
182
+ this.thinkTimer = null
183
+ this.thinkEnd = true
184
+ setTimeout(() => {
185
+ this.removeLoadingNode()
186
+ }, 200)
187
+ this.$emit("streamCallback", this.typedContent)
188
+ this.$emit("sseOtherInfo", this.msgId, "start", "");
189
+ }, 200);
190
+ },
191
+ filterTime(time) {
192
+ if (time < 60) {
193
+ return time + " 秒";
194
+ } else {
195
+ return Math.floor(time / 60) + " 分 " + time % 60 + " 秒";
196
+ }
197
+ },
198
+ // 处理历史记录中的 <think> 标签
199
+ filterThinkVal(text) {
200
+ // 用于匹配 <think> 标签的正则表达式
201
+ this.hasThinkValue = false;
202
+ this.chainThinkValue = "";
203
+ const thinkStartRegex = /<think>/;
204
+ // const thinkEndRegex = /<\/think>/;
205
+ const thinkEndRegex = /<\/think>/g;
206
+ // 查找第一个 <think> 标签的位置
207
+ const startIndex = text.search(thinkStartRegex);
208
+ if (startIndex === -1) {
209
+ // 如果没有找到 <think> 标签,直接返回原始文本和空内容
210
+ return text.replaceAll("\\n", "\n")
211
+ }
212
+ // 从第一个 <think> 标签之后开始查找最后一个 </think> 标签
213
+ let endIndex = -1;
214
+ let match;
215
+ // 循环查找所有匹配项
216
+ while ((match = thinkEndRegex.exec(text)) !== null) {
217
+ endIndex = match.index;
218
+ }
219
+ if (endIndex !== -1) {
220
+ console.log(`最后一个 </think> 的起始位置是: ${endIndex}`);
221
+ // 提取 <think> 标签中的内容
222
+ let thinkVal = text.slice(startIndex + '<think>'.length, endIndex);
223
+ // 从原始文本中剔除 <think> 标签及其中的内容
224
+ let typedContent = text.slice(0, startIndex) + text.slice(endIndex);
225
+ this.hasThinkValue = true;
226
+ this.chainThinkValue = thinkVal.replaceAll("<think>", "").replaceAll("</think>", "<br/>");
227
+ this.chainThinkValue = this.filterText(this.chainThinkValue)
228
+ return typedContent.replaceAll("\\n", "\n");
229
+ } else {
230
+ // text.replaceAll("\\n", "\n")
231
+ this.hasThinkValue = true;
232
+ this.chainThinkValue = text.replaceAll("<think>", "").replaceAll("</think>", "<br/>");
233
+ return ""
234
+ }
235
+ },
236
+ filterText(str) {
237
+ /* eslint-disable */
238
+ const regex = /\{\n "functionCall": \{/s
239
+ str = str.replace(regex, "")
240
+ str = str.replaceAll("```json", "")
241
+ return str
242
+ },
243
+ // 处理流式消息中的 <think> 标签
244
+ streamFilterThinkValue() {
245
+
246
+ },
247
+ // 打字效果已在MarkdownText文件中处理
248
+ typeNewWriter(text, keyId, msg) {
249
+ // setTimeout(() => {
250
+ // let ref = 'msgTyped' + keyId;
251
+ // const el = this.$refs[ref][0];
252
+ // new Typed(el, {
253
+ // strings: [text],
254
+ // typeSpeed: 15,
255
+ // showCursor: false,
256
+ // onComplete: () => {
257
+ // msg.isHistory = true
258
+ // this.$emit('openFirstPreview', msg)
259
+ // this.typingSuccess()
260
+ // },
261
+ // })
262
+ // }, 500)
263
+ },
264
+ handleScroll() {
265
+ console.log("this.isManualScroll = true;");
266
+ this.isManualScroll = true;
267
+ window.removeEventListener('wheel', this.handleScroll, true);
268
+ },
269
+ scrollMarkdown() {
270
+ !this.isManualScroll && this.$nextTick(() => {
271
+ let container = document.getElementById("list");
272
+ if (container) {
273
+ let scrollHeight = container.scrollHeight;
274
+ container.scrollTop = scrollHeight;
275
+ }
276
+ });
277
+ },
278
+ streamInfo(url) {
279
+ // 通知消息列表,当前还未建立sse,先不出空消息
280
+ if(this.retryUrl == ""){
281
+ this.$emit("sseOtherInfo", this.msgId, "init", "");
282
+ }
283
+ this.$emit("answerDocKnowledgeFn");
284
+ this.eventSource = new EventSource(url);
285
+ this.$emit("streamStatus", true, this.msgId);
286
+ // this.$set(this, 'showThink', true);
287
+ this.signSetFlag = false;
288
+ this.thinkEnd = false
289
+ let tempString = "";
290
+ // let generatingString = "";
291
+ // let timer = null;
292
+ let images = [];
293
+ let matched = [];
294
+ let recommendItems = [];
295
+ let isFirstStr = true;
296
+ const backslashOrNRegex = /[\\n]/; // 不能替换为 /\n/,会导致格式解析错误,在处理方法末尾做了修改
297
+ // 如果只有一次推送、并且推送字符串中带有 n
298
+ let isOnlyOnce = 0; // 标记是否只有一次推送
299
+ let hasN = false; // 标记是否有 n
300
+ const thinkStartRegex = /<think>/;
301
+ const thinkEndRegex = /<\/think>/
302
+ this.eventSource.onmessage = (event) => {
303
+ const data = JSON.parse(event.data);
304
+ if (event.lastEventId === 'finish') { // 不能删除 finish
305
+ console.log("finish+++++");
306
+ } else if (event.lastEventId === '[DONE]') {
307
+ this.streamEnd = true;
308
+ // 只有一次推送,且推送字符串中带有 n
309
+ // 用于特殊情况(只有一次内容推送 且 含有 n)
310
+ if (isOnlyOnce == 1 && hasN) {
311
+ this.$emit("answerDocKnowledgeFn");
312
+ let repStr = tempString.replace(/\\n/g, '\n');
313
+ this.$set(this, "typedContent", repStr);
314
+ this.scrollMarkdown();
315
+ }
316
+ let DONETmier = setInterval(() => {
317
+ // 在所有文本内容打字效果完毕后 展示底部图片 文件 推荐等
318
+ if (this.generatingString == "") {
319
+ if (images.length != 0) {
320
+ setTimeout(() => {
321
+ this.$emit("sseOtherInfo", this.msgId, "images", images);
322
+ this.scrollMarkdown();
323
+ }, 50);
324
+ }
325
+ if (matched.length != 0) {
326
+ setTimeout(() => {
327
+ this.$emit("sseOtherInfo", this.msgId, "matched", matched);
328
+ this.scrollMarkdown();
329
+ }, 100);
330
+ }
331
+ if (recommendItems.length != 0) {
332
+ setTimeout(() => {
333
+ this.$emit("sseOtherInfo", this.msgId, "recommendItems", recommendItems);
334
+ this.scrollMarkdown();
335
+ }, 150);
336
+ }
337
+ this.closeTimeOut()
338
+ clearInterval(DONETmier);
339
+ if(this.thinkTimer != null) {
340
+ clearInterval(this.thinkTimer)
341
+ this.thinkTimer = null
342
+ this.thinkEnd = true
343
+ }
344
+ this.$emit("streamCallback", this.typedContent)
345
+ this.$emit("streamStatus", false, this.msgId);
346
+ this.appendCopyBtn()
347
+ setTimeout(() => {
348
+ this.removeLoadingNode()
349
+ }, 200);
350
+ this.$emit("sseOtherInfo", this.msgId, "start", "");
351
+ }
352
+
353
+ }, 100);
354
+ this.eventSource.close();
355
+ // 重试地址不为空,说明需要重试
356
+ console.log("需要重试 this.retryUrl: ", this.retryUrl);
357
+ if (this.retryUrl != "") {
358
+ console.log("this.retryUrl: ", this.retryUrl);
359
+ this.streamInfo(this.retryUrl);
360
+ // 将重试地址清空,用于在收到结束标识并结束后 判断是否需要重试
361
+ this.retryUrl = "";
362
+ this.$emit("sseOtherInfo", this.msgId, "changeHeaderStyleValue", this.$t('common.modelgeneration'));
363
+ }
364
+ } else if (event.lastEventId === 'matched') {
365
+ matched = data;
366
+ } else if (event.lastEventId === 'images') {
367
+ images = data;
368
+ } else if (event.lastEventId === 'recommendItems') {
369
+ recommendItems = data;
370
+ } else if (event.lastEventId === 'retry') {
371
+ this.retryUrl = data.content;
372
+ } else if (event.lastEventId === 'generated_image') {
373
+ let imgs = JSON.parse(data.content);
374
+ let imgsStr = "";
375
+ for (let i = 0; i < imgs.length; i++) {
376
+ imgsStr += `![](${imgs[i].oss_url})`;
377
+ }
378
+ this.$set(this, "typedContent", this.typedContent + imgsStr);
379
+
380
+ // 模拟图片推送
381
+ // let imgs = JSON.parse('[{"oss_url":"https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/generated-img/generated_img_865652a94b374337b2ac703466cdea94.png"}]');
382
+ // let imgsStr = "";
383
+ // for (let i = 0; i < imgs.length; i++) {
384
+ // imgsStr += `![](${imgs[i].oss_url})`;
385
+ // }
386
+ // this.$set(this, "typedContent", this.typedContent + imgsStr);
387
+
388
+ } else if (event.lastEventId === 'source') {
389
+ this.$emit("changedHeadStatusValue", this.msgId, data);
390
+ } else {
391
+ // console.log("start event.lastEventId: ", event.lastEventId);
392
+ // 设置当前知识答案id,用于loading取消和展示
393
+ this.$emit("sseOtherInfo", this.msgId, "start", "");
394
+ if(thinkStartRegex.test(data.content) && thinkEndRegex.test(data.content)) {
395
+ this.hasThinkValue = true;
396
+ this.thinkCount = 0
397
+ this.ThinkTime()
398
+ } else {
399
+ // 最终根据规则是以最后一个 </think> 标识当前深度思考结束,开始正常添加数据到 typedContent
400
+ if (thinkStartRegex.test(data.content)) {
401
+ if (this.thinkCount == 0) {
402
+ this.thinkCount = 0
403
+ } else {
404
+ this.thinkCount += 1;
405
+ }
406
+ this.hasThinkValue = true;
407
+ this.ThinkTime()
408
+ // this.streamThinkValueAddFlag = true;
409
+ }
410
+ if (thinkEndRegex.test(data.content)) {
411
+ this.thinkCount -= 1;
412
+ // this.streamThinkValueAddFlag = false;
413
+ }
414
+ }
415
+ // 字符串中存在特定字符,本次接收消息暂不展示
416
+ if (backslashOrNRegex.test(data.content) && !this.hasThinkValue) {
417
+ tempString += data.content;
418
+ // 用于特殊情况(只有一次内容推送 且 含有 n)
419
+ isOnlyOnce++;
420
+ hasN = true;
421
+ } else {
422
+ if (data.content.trim() != "") {
423
+ isOnlyOnce++;
424
+ }
425
+ // 此处判断的逻辑是识别到了深度思考 结束,开始处理回复的内容数据,关闭掉深度思考的手动计时,并收起深度思考的内容
426
+ let repStr = tempString.replace(/\\n/g, '\n');
427
+ if (this.hasThinkValue && this.thinkCount == 0) {
428
+ this.generatingThinkString = this.generatingThinkString + repStr + data.content;
429
+ this.thinkEnd = false
430
+ this.ThinkTime()
431
+ } else {
432
+ let str = data.content
433
+ if (thinkEndRegex.test(data.content)) {
434
+ let arr = data.content.split("</think>")
435
+ this.generatingThinkString = this.generatingThinkString + arr[0]
436
+ str = arr[1]
437
+ }
438
+ this.generatingString = this.generatingString + repStr + str;
439
+ }
440
+ tempString = "";
441
+ if (isFirstStr) {
442
+ isFirstStr = false;
443
+ this.timer = 0;
444
+ this.openTimeOutSetVal()
445
+ }
446
+ }
447
+ }
448
+ };
449
+ this.eventSource.onerror = (err) => {
450
+ this.typedContent += `\n${this.$t("dragonCommon.eventSourceError")}\n`;
451
+ this.closeTimeOut()
452
+ this.$emit("streamStatus", false, this.msgId);
453
+ this.$emit("streamErrorCallBack", this.msgId);
454
+ this.$emit("streamCallback", this.typedContent)
455
+ if(this.eventSource) {
456
+ try {
457
+ this.eventSource.close();
458
+ } catch (e) {
459
+ console.error('EventSource close failed:', e);
460
+ }
461
+ }
462
+ setTimeout(() => {
463
+ this.removeLoadingNode()
464
+ }, 200);
465
+ };
466
+ },
467
+ openTimeOutSetVal() {
468
+ if (this.timer != null) {
469
+ this.timer = setTimeout(() => {
470
+ this.closeThinkContent(this)
471
+ // 先把深度思考的值 push 完成后再执行正常内容的 push,最终以正常内容的值为空判断为本轮打字效果结束
472
+ if (this.generatingThinkString != "") {
473
+ let str = this.filterText(this.chainThinkValue + this.generatingThinkString.charAt(0))
474
+ this.$set(this, "chainThinkValue", str)
475
+ this.generatingThinkString = this.generatingThinkString.slice(1)
476
+ this.scrollMarkdown();
477
+ } else if (this.generatingString != "") {
478
+ this.$set(this, "typedContent", this.typedContent + this.generatingString.charAt(0))
479
+ this.generatingString = this.generatingString.slice(1)
480
+ this.scrollMarkdown();
481
+ if(this.thinkTimer != null) {
482
+ clearInterval(this.thinkTimer)
483
+ this.thinkTimer = null
484
+ this.thinkEnd = true
485
+ }
486
+ }
487
+ this.openTimeOutSetVal()
488
+ }, 20);
489
+ }
490
+ },
491
+ closeTimeOut() {
492
+ clearTimeout(this.timer);
493
+ this.timer = null;
494
+ },
495
+ ThinkTime() {
496
+ if(this.thinkTimer == null) {
497
+ this.thinkTimer = setInterval(() => {
498
+ this.thinkTimeNum += 1;
499
+ }, 1000)
500
+ }
501
+ },
502
+ startTypingEffect() {
503
+ // 使用正则表达式将 HTML 内容按 <table> 标签分割
504
+ const segments = this.chainValues.split(/(<\/?table[\s\S]*?>[\s\S]*?<\/table>)/i);
505
+ console.log("segments: ", segments);
506
+
507
+ let segmentIndex = 0;
508
+ let i = 0;
509
+ const processNextSegment = () => {
510
+ if (segmentIndex >= segments.length) {
511
+ this.$emit('openFirstPreview')
512
+ this.$emit('typingSuccess');
513
+ return;
514
+ }
515
+ const segment = segments[segmentIndex];
516
+ if (/^<\/?table[\s\S]*?>[\s\S]*?<\/table>$/i.test(segment)) {
517
+ // 如果当前段是 <table> 标签,直接添加到 typedContent 中
518
+ this.typedContent += segment;
519
+ segmentIndex++;
520
+ processNextSegment();
521
+ } else {
522
+ i = 0;
523
+ const updateContent = () => {
524
+ if (i < segment.length) {
525
+ this.typedContent += segment.charAt(i);
526
+ i++;
527
+ // 使用 requestAnimationFrame 替代 setInterval,防止卡顿
528
+ requestAnimationFrame(updateContent);
529
+ } else {
530
+ segmentIndex++;
531
+ processNextSegment();
532
+ }
533
+ };
534
+ updateContent();
535
+ }
536
+ };
537
+ processNextSegment();
538
+ },
539
+
540
+ lookImage(e) {
541
+ let previewImageUrl = ""
542
+ console.log('e.target', e.target)
543
+ if (e.target.localName == 'img') {
544
+ previewImageUrl = e.target.currentSrc;
545
+ this.showPreview = true;
546
+ let richtext = JSON.parse(JSON.stringify(this.typedContent))
547
+ this.imgList = [];
548
+ richtext.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, (match, capture) => {
549
+ this.imgList.push(capture);
550
+ });
551
+ /*当前点击的图片作为第一个图片*/
552
+ let index = this.imgList.indexOf(previewImageUrl);
553
+ this.imgList.splice(index, 1);
554
+ this.imgList.unshift(previewImageUrl);
555
+ }
556
+
557
+ },
558
+ closeViewer() {
559
+ this.showPreview = false;
560
+ },
561
+ clickMarkDown(e) {
562
+ if (e.target.tagName == "A") {
563
+ window.open(e.target.href, "_blank")
564
+ e.stopPropagation()
565
+ e.preventDefault()
566
+ return false
567
+ }
568
+ },
569
+ closeThinkContent: _.debounce(function (that) {
570
+ if (that.thinkEnd && that.generatingThinkString == "" && !that.signSetFlag) {
571
+ that.showThink = false;
572
+ // 标识已经自动关闭过一次深度思考内容,不再影响手动打开的效果
573
+ that.signSetFlag = true;
574
+ }
575
+ }, 500),
576
+ parseCode(markDownText) {
577
+ const parser = new DOMParser();
578
+ const doc = parser.parseFromString(markDownText, 'text/html');
579
+ doc.querySelectorAll('pre code').forEach((block) => {
580
+ hljs.highlightBlock(block);
581
+ });
582
+ doc.querySelectorAll('a').forEach((block) => {
583
+ block.setAttribute('target', '_blank');
584
+ block.setAttribute('rel', 'noopener noreferrer');
585
+ });
586
+ let node = this.getLastNode(doc)
587
+ if (node && !this.isHistory) {
588
+ let loading = document.createElement('span')
589
+ loading.classList.add("loading-circle")
590
+ loading.id = "loading-circle"
591
+ this.removeLoadingNode()
592
+ node.appendChild(loading)
593
+ }
594
+ return doc.documentElement.outerHTML
595
+ },
596
+ removeLoadingNode() {
597
+ let old = document.getElementById("loading-circle")
598
+ if(old) old.remove()
599
+ },
600
+ getLastNode(node) {
601
+ let filterList = ["STRONG", "BR", "SPAN", "I", "EM", "B", "A"]
602
+ if(node.lastElementChild && !filterList.includes(node.lastElementChild.tagName)) {
603
+ return this.getLastNode(node.lastElementChild)
604
+ } else {
605
+ return node
606
+ }
607
+ },
608
+ appendCopyBtn() {
609
+ let doc = this.$refs.markDown.$el ? this.$refs.markDown.$el : this.$refs.markDown
610
+ let codeList = doc.querySelectorAll('pre code')
611
+ codeList.forEach(ele =>{
612
+ let list = ele.getElementsByClassName("code_copy_btn")
613
+ if(list.length == 0 && ele.classList.contains("hljs") && !ele.classList.contains("hljs-undefined")) {
614
+ let text = ele.innerText
615
+ let btnId = uuidv4();
616
+ let copy = document.createElement('div')
617
+ copy.classList.add("code_copy_btn")
618
+ copy.setAttribute('id', btnId)
619
+ copy.style.display = 'flex'
620
+ let i = document.createElement('i')
621
+ i.classList.add("iconfont")
622
+ i.classList.add("guoran-tongyichicun-fuzhi")
623
+ let span = document.createElement('span')
624
+ span.innerText = this.$t("dragonCommon.copy")
625
+ copy.append(i)
626
+ copy.append(span)
627
+ copy.onclick = () =>{
628
+ let fn = () =>{
629
+ let id = copy.getAttribute("id")
630
+ copy.style.display = "none"
631
+ let cs = document.getElementById(id + "success")
632
+ if(cs) {
633
+ cs.style.display = "flex"
634
+ }
635
+ setTimeout(() =>{
636
+ cs && (cs.style.display = "none")
637
+ copy.style.display = "flex"
638
+ }, 2000)
639
+ }
640
+ if (navigator.clipboard) {
641
+ // 使用 Clipboard API 进行复制
642
+ navigator.clipboard.writeText(text).then(() => { fn()})
643
+ .catch((error) => {
644
+ // 如果 Clipboard API 失败,尝试使用传统方法
645
+ this.fallbackCopyTextToClipboard(text, fn, () =>{
646
+ this.$message.error(this.$t("dragonCommon.copyError"))
647
+ });
648
+ });
649
+ } else {
650
+ this.fallbackCopyTextToClipboard(text, fn, () =>{
651
+ this.$message.error(this.$t("dragonCommon.copyError"))
652
+ });
653
+ }
654
+ }
655
+ ele.append(copy)
656
+ let copySuccess = document.createElement('div')
657
+ copySuccess.classList.add("code_copy_btn")
658
+ copySuccess.setAttribute('id', btnId + 'success')
659
+ copySuccess.style.display = 'none'
660
+ let csI = document.createElement('i')
661
+ csI.classList.add("el-icon-check")
662
+ let csSpan = document.createElement('span')
663
+ csSpan.innerText = this.$t("dragonCommon.copySuccess")
664
+ copySuccess.append(csI)
665
+ copySuccess.append(csSpan)
666
+ ele.append(copySuccess)
667
+ }
668
+ })
669
+ },
670
+ fallbackCopyTextToClipboard(text, success, fail) {
671
+ // 创建一个临时的 input 元素
672
+ const textArea = document.createElement('textarea');
673
+ textArea.value = text;
674
+ // 使 textarea 不在屏幕上显示
675
+ textArea.style.position = 'fixed';
676
+ textArea.style.top = 0;
677
+ textArea.style.left = 0;
678
+ textArea.style.width = '2em';
679
+ textArea.style.height = '2em';
680
+ textArea.style.padding = 0;
681
+ textArea.style.border = 'none';
682
+ textArea.style.outline = 'none';
683
+ textArea.style.boxShadow = 'none';
684
+ textArea.style.background = 'transparent';
685
+
686
+ // 将 textarea 添加到文档中
687
+ document.body.appendChild(textArea);
688
+ textArea.focus();
689
+ textArea.select();
690
+
691
+ try {
692
+ // 执行复制命令
693
+ const successful = document.execCommand('copy');
694
+ if (successful) {
695
+ success()
696
+ } else {
697
+ fail()
698
+ }
699
+ } catch (err) {
700
+ fail()
701
+ }
702
+ // 移除临时的 textarea
703
+ document.body.removeChild(textArea);
704
+ },
705
+ },
706
+ beforeDestroy() {
707
+ if (this.eventSource) {
708
+ this.eventSource.close();
709
+ }
710
+ }
711
+ };
712
+ </script>
713
+
714
+ <style scoped lang="less">
715
+ @import "../assets/less/variables.less";
716
+
717
+ .blinking-cursor {
718
+ display: inline-block;
719
+ width: 2px;
720
+ height: 1em;
721
+ background-color: @background-color-black;
722
+ animation: blink 1s steps(2, start) infinite;
723
+ }
724
+
725
+ @keyframes blink {
726
+ 0%, 100% {
727
+ opacity: 1;
728
+ }
729
+ 50% {
730
+ opacity: 0;
731
+ }
732
+ }
733
+ .think {
734
+ padding: 10px;
735
+ background: @background-color-bubble;
736
+ border-radius: 8px;
737
+ margin-bottom: 12px;
738
+
739
+ .think_content {
740
+ height: auto;
741
+ white-space: pre-wrap;
742
+ transition: all 2s ease;
743
+
744
+ /deep/ br {
745
+ line-height: 10px !important;
746
+ }
747
+ }
748
+
749
+ .hide_think {
750
+ height: 0px;
751
+ overflow: hidden;
752
+ transition: all 2s ease;
753
+ }
754
+
755
+ .think_title {
756
+ width: 100%;
757
+ height: 20px;
758
+ display: flex;
759
+ align-items: center;
760
+ justify-content: space-between;
761
+ cursor: pointer;
762
+
763
+ .think_title_left {
764
+ display: flex;
765
+ align-items: center;
766
+
767
+ i {
768
+ font-size: 18px;
769
+ }
770
+
771
+ .guoran-icon-deepseek {
772
+ font-size: 18px;
773
+ }
774
+ }
775
+
776
+ .think_title_right {
777
+ font-size: 18px;
778
+ color: @font-primary-accent-color;
779
+ }
780
+
781
+ .hide_think_title {
782
+ transform: rotate(180deg);
783
+ }
784
+ }
785
+ }
786
+
787
+ .mark_down {
788
+ line-height: 24px;
789
+ overflow-x: auto;
790
+
791
+ /deep/code {
792
+ font-family: Microsoft Yahei, Helvetica Neue, Helvetica, Arial, sans-serif !important;
793
+ white-space: pre-wrap;
794
+ font-size: 16px;
795
+ position: relative;
796
+ .code_copy_btn {
797
+ position: absolute;
798
+ right: 10px;
799
+ top: 10px;
800
+ display: flex;
801
+ align-items: center;
802
+ padding: 3px 12px;
803
+ background: @background-color-summary;
804
+ cursor: pointer;
805
+ font-size: 14px;
806
+ border-radius: 25px;
807
+ i {
808
+ font-size: 14px;
809
+ margin-right: 6px;
810
+ }
811
+ }
812
+ }
813
+
814
+ /deep/ pre {
815
+ // code {
816
+ // background: #F3F3F3 !important;
817
+ // color: #444 !important;
818
+ // }
819
+ .language-undefined {
820
+ background: @background-color-light;
821
+ color: @background-color-black;
822
+ }
823
+ }
824
+
825
+ /deep/p {
826
+ margin-bottom: 7px;
827
+ font-size: 16px;
828
+ }
829
+
830
+ /deep/p:only-child {
831
+ margin: 0 !important;
832
+ }
833
+
834
+ /deep/p:last-child {
835
+ margin-bottom: 0 !important;
836
+ }
837
+
838
+ /deep/ul {
839
+ margin-bottom: 7px;
840
+ list-style: disc;
841
+ padding-left: 40px;
842
+
843
+ li {
844
+ margin: 7px 0 !important;
845
+ font-size: 16px;
846
+ // padding-left: 40px;
847
+ }
848
+ }
849
+
850
+ /deep/ ol {
851
+ list-style: auto;
852
+ padding-left: 40px;
853
+
854
+ li {
855
+ margin: 7px 0 !important;
856
+ font-size: 16px;
857
+ // padding-left: 40px;
858
+ }
859
+ }
860
+
861
+ /deep/img {
862
+ max-width: 400px;
863
+ }
864
+
865
+ /deep/h3,
866
+ /deep/h2,
867
+ /deep/h1,
868
+ /deep/h4,
869
+ /deep/h5,
870
+ /deep/h6 {
871
+ color: @font-primary-color;
872
+ font-weight: 500;
873
+ line-height: 26px;
874
+ margin: 7px 0;
875
+ }
876
+
877
+ /deep/h6 {
878
+ font-size: 12px;
879
+ }
880
+
881
+ /deep/h5 {
882
+ font-size: 14px;
883
+ }
884
+
885
+ /deep/h4 {
886
+ font-size: 16px;
887
+ }
888
+
889
+ /deep/h3 {
890
+ font-size: 20px;
891
+ }
892
+
893
+ /deep/h2 {
894
+ font-size: 22px;
895
+ }
896
+
897
+ /deep/h1 {
898
+ font-size: 24px;
899
+ }
900
+
901
+ // /deep/h3 {
902
+ // font-size: 20px;
903
+ // }
904
+
905
+ /deep/hr {
906
+ margin: 16px 0;
907
+ }
908
+
909
+ /deep/ table {
910
+ border-spacing: 0;
911
+ // border-radius: 8px;
912
+ // overflow: hidden;
913
+ border: solid 1px @border-color-table;
914
+ min-width: 800px;
915
+ overflow-x: auto;
916
+ margin: 16px 0;
917
+ }
918
+
919
+ /deep/ th {
920
+ background: @background-color-summary;
921
+ border: solid 1px @border-color-table;
922
+ padding: 8px;
923
+ height: 38px;
924
+ min-width: 100px;
925
+ }
926
+
927
+ /deep/ td {
928
+ border: solid 1px @border-color-table;
929
+ padding: 8px;
930
+ height: 28px;
931
+ min-width: 100px;
932
+ }
933
+ }
934
+
935
+ /* 圆圈的样式 */
936
+ /deep/.loading-circle {
937
+ width: 8px;
938
+ height: 8px;
939
+ display: inline-block;
940
+ border-radius: 50%;
941
+ background-color: @primary-color;
942
+ animation: loading 2s infinite ease-in-out;
943
+ margin: 0 8px;
944
+ /* 动画控制 */
945
+ }
946
+
947
+ /* 放大缩小的动画 */
948
+ @keyframes loading {
949
+
950
+ 0%,
951
+ 100% {
952
+ transform: scale(1);
953
+ /* 原始大小 */
954
+ }
955
+
956
+ 50% {
957
+ transform: scale(1.5);
958
+ /* 放大 */
959
+ }
960
+ }
961
+ </style>