Pārlūkot izejas kodu

表格初始化来源

hbchen 9 mēneši atpakaļ
vecāks
revīzija
1462d513a0
2 mainītis faili ar 20 papildinājumiem un 6 dzēšanām
  1. 6 6
      src/hooks/chart/useChartRender.ts
  2. 14 0
      src/views/sheetShow/index.vue

+ 6 - 6
src/hooks/chart/useChartRender.ts

@@ -241,12 +241,12 @@ const setDefaultLineOptions = () => {
       name,
       color: item.ChartColor,
       lineWidth: Number(item.ChartWidth)||(chartTheme&&chartTheme.lineOptionList[index].lineWidth)||1,
-      marker: {
-        enabled:chartTheme.lineOptionList[index].dataMark && chartTheme.lineOptionList[index].dataMark!='none',
+      marker:chartTheme && chartTheme.lineOptionList[index].dataMark && chartTheme.lineOptionList[index].dataMark!='none'?{
+        enabled:true,
         symbol: chartTheme.lineOptionList[index].markType || 'circle',
         fillColor:chartTheme.lineOptionList[index].markColor,
         radius: chartTheme.lineOptionList[index].markSize
-      },
+      }:{},
       ...predict_params
     };
     item.DataList = item.DataList || []
@@ -361,12 +361,12 @@ const setSeasonOptions = () => {
       yAxis: 0,
       name: j.ChartLegend,
       lineWidth: (chartTheme&&chartTheme.lineOptionList[index].lineWidth) || 1,
-      marker: {
-        enabled:chartTheme.lineOptionList[index].dataMark && chartTheme.lineOptionList[index].dataMark!='none',
+      marker:chartTheme && chartTheme.lineOptionList[index].dataMark && chartTheme.lineOptionList[index].dataMark!='none'?{
+        enabled:true,
         symbol: chartTheme.lineOptionList[index].markType || 'circle',
         fillColor:chartTheme.lineOptionList[index].markColor,
         radius: chartTheme.lineOptionList[index].markSize
-      },
+      }:{},
       ...predict_params
     };
     const data_array = _.cloneDeep(j.DataList);

+ 14 - 0
src/views/sheetShow/index.vue

@@ -20,6 +20,17 @@ interface InfoType extends IUnknowObject {
 const showData = ref(false);
 const info = ref<InfoType|any>({});
 const loading = ref(false);
+
+
+const setDefaultSource=(sourceText:string)=>{
+  return JSON.stringify({
+    isShow: true,
+    text: sourceText,
+    color: "#606266",
+    fontSize: 9
+  })
+}
+
 const getInfo = async(type='') => {
   loading.value = true;
   const { Data,Ret } = await SheetApi.getInfo({  UniqueCode: code.value, FromScene: Number(route.query.fromScene||'') });
@@ -28,6 +39,9 @@ const getInfo = async(type='') => {
   if(Ret !== 200) return
 
   info.value = Data;
+  if(!info.value.SourcesFrom){
+    info.value.SourcesFrom = setDefaultSource(Data.ExcelSource||'')
+  }
   showData.value = true; 
   type==='refresh'&&ElMessage.success('刷新成功')
   nextTick(() => {