Explorar o código

修改绘图功能

cl hai 1 ano
pai
achega
ef46a55c4f
Modificáronse 1 ficheiros con 16 adicións e 9 borrados
  1. 16 9
      src/views/dataProcessing/manualCalculation.vue

+ 16 - 9
src/views/dataProcessing/manualCalculation.vue

@@ -52,7 +52,7 @@
           size="middle" :dataSource="dataCenter.dataSource" :columns="dataCenter.columns" />
       </div>
     </div>
-    <BasicModal :maskClosable="false" :footer="null" @cancel="cancel" :visible="showModal" :width="1200" :title="'绘制数据'">
+    <BasicModal :maskClosable="false" :footer="null" :canFullscreen="false" @cancel="cancel" :visible="showModal" :width="1200" :title="drawTitle">
       <div>
         <div id="visible-id" style="width: 100%;height: 500px;"></div>
       </div>
@@ -181,9 +181,12 @@ const handleTree = () => {
     }
   }
 }
+let drawTitle = ref('')
 const drawBtn = () => {
   let timeArr = []
   let valueArr = []
+  // 获取名称
+  drawTitle.value = dataCenter.columns[1].title
   dataCenter.dataSource.forEach(element => {
     if (element.time != '最大值' && element.time != '最小值') {
       timeArr.push(element.time)
@@ -219,14 +222,18 @@ const setChartsFn = (timeArr, valueArr, yl) => {
   var option
   // if (yl) {
   option = {
-
-    // toolbox: {
-    //   feature: {
-    //     saveAsImage: {
-    //       name: dataCenter.basicModalTitle
-    //     }
-    //   }
-    // },
+    grid: {
+      left: '5%',
+      right: '3%',
+      bottom: '7%',
+    },
+    toolbox: {
+      feature: {
+        saveAsImage: {
+          name: drawTitle.value
+        }
+      }
+    },
     tooltip: {
       trigger: 'axis',
       axisPointer: {