浏览代码

Merge branch 'ch/ht_3.1' into debug_ht

chenlei 3 月之前
父节点
当前提交
6f5fbcadec
共有 4 个文件被更改,包括 16 次插入14 次删除
  1. 1 1
      src/api/modules/chart.js
  2. 2 2
      src/api/modules/common.js
  3. 6 10
      src/views/chart/Detail.vue
  4. 7 1
      src/views/report/Detail.vue

+ 1 - 1
src/api/modules/chart.js

@@ -3,7 +3,7 @@ import {get,post} from '@/api/index'
 export default{
   // 获取图表详情
   getChartDetail:params=>{
-    return get('/detail',params)
+    return get('v1/chart/detail',params)
   },
   // 收藏图表
   chartCollect:params=>{

+ 2 - 2
src/api/modules/common.js

@@ -2,8 +2,8 @@ import {get,post} from '@/api/index'
 
 export default{
   // 系统配置
-  systemConfig:()=>{
-    return get('/system/config',{})
+  systemConfig:params=>{
+    return get('/system/config',params)
   }
   
 }

+ 6 - 10
src/views/chart/Detail.vue

@@ -11,15 +11,10 @@ let chartId=route.query.chartId
 // 获取配置
 const chartBaseUrl = ref('')
 function getSystemConfig() {
-  apiCommon.systemConfig().then(res => {
+  apiCommon.systemConfig({config:'ChartLibUrlPrefix'}).then(res => {
     if (res.Ret === 200) {
-      const arr = res.Data || []
-      console.log(arr);
-      arr.forEach(item => {
-        if (item.ConfKey === 'ChartViewUrl') {
-          chartBaseUrl.value = item.ConfVal
-        }
-      });
+      const ConfVal = res.data.Value || ''
+      chartBaseUrl.value = ConfVal
     }
   })
 }
@@ -29,7 +24,8 @@ const chartInfo = ref(null)
 function getChartDetail() {
   chartInfo.value=null
   apiChart.getChartDetail({
-    ChartInfoId:Number(chartId)
+    UniqueCode: route.query.UniqueCode,
+    MiniSource: 'ht'
   }).then(res => {
     if (res.Ret === 200) {
       chartInfo.value = res.Data
@@ -58,7 +54,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