Browse Source

图表预览功能

chenlei 3 months ago
parent
commit
f8ad0f48d3
3 changed files with 8 additions and 12 deletions
  1. 1 1
      src/api/modules/chart.js
  2. 2 2
      src/api/modules/common.js
  3. 5 9
      src/views/chart/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)
   }
   
 }

+ 5 - 9
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