Browse Source

图表信息收藏

chenlei 5 months ago
parent
commit
fa9e420854
2 changed files with 8 additions and 2 deletions
  1. 1 1
      src/views/chart/Detail.vue
  2. 7 1
      src/views/report/Detail.vue

+ 1 - 1
src/views/chart/Detail.vue

@@ -58,7 +58,7 @@ async function handleCollect() {
 }
 
 const chartRenderUrl = computed(() => {
-  return `${chartBaseUrl.value}/chart/preview?code=${chartInfo.value.UniqueCode}&source=etamini&token=${route.query.token}`
+  return `${chartBaseUrl.value}/chart/previewHT?code=${chartInfo.value.UniqueCode}&token=${route.query.token}`
 })
 
 

+ 7 - 1
src/views/report/Detail.vue

@@ -94,11 +94,17 @@ async function getReportInfo() {
       }
     });
 
-    reportContent.value = reportInfo.value.content
+    reportContent.value = formatIframeData(reportInfo.value.content)
     splitReportContent(reportContent.value)
   }
 }
 getReportInfo()
+
+// 给报告详情中图表加参数
+function formatIframeData(str) {
+  return str.replace(/\/chartshow\?code=/g, `/chartshow?source=ht_chart&token=${localStorage.getItem('token')}&reportId=${reportId}&code=`)
+}
+
 function getAuthorFollowState() {
   apiUser.getFollowState({
     names: reportInfo.value.author