Browse Source

报表请求图表styleConfig

zhuth 6 years ago
parent
commit
411d55b8eb
2 changed files with 4 additions and 4 deletions
  1. 3 3
      src/models/dashboardDesigner.js
  2. 1 1
      src/models/parseChartOption.js

+ 3 - 3
src/models/dashboardDesigner.js

@@ -528,10 +528,10 @@ export default {
                         ] });
                         return false;
                     }
-                    let styleConfig = resData.styleConfig ? JSON.parse(resData.styleConfig) || {} : {};
-                    const { chartType : ctype, chartConfig: cfg } = resData.chartsColumnConfig;
+                    const { chartType : ctype, chartConfig: chartConfigStr, chartStyle: styleConfigStr  } = resData.chartsColumnConfig;
                     const chartType = CHART_TYPE[ctype];
-                    const chartConfig = JSON.parse(cfg);
+                    const chartConfig = JSON.parse(chartConfigStr);
+                    const styleConfig = JSON.parse(styleConfigStr);
                     let chartOption = parseChartOption(chartType, resData, chartConfig, theme, styleConfig[chartType] || {});
                     
                     yield put({ type: 'setItemFields', code: chartCode, fields: [

+ 1 - 1
src/models/parseChartOption.js

@@ -8,7 +8,7 @@ import STATISTICS_OPTION from '../components/chartDesigner/sections/statisticsOp
 import themes from '../components/chartDesigner/sections/style/theme/index'
 import EChartsMedia from './EChartsMedia'
 
-export default function(viewType, data, chartConfig, themeName, styleConfig, chartDesigner) {
+export default function(viewType, data, chartConfig, themeName, styleConfig) {
     if(!data) {
         return {};
     }