瀏覽代碼

Merge branch 'need_report_refresh'

Karsa 1 年之前
父節點
當前提交
2b5f836df7
共有 4 個文件被更改,包括 41 次插入1 次删除
  1. 9 0
      src/api/chart.js
  2. 12 1
      src/views/report/EditReport.vue
  3. 10 0
      src/views/report/chapter/Detail.vue
  4. 10 0
      src/views/reportEn/AddReport.vue

+ 9 - 0
src/api/chart.js

@@ -266,4 +266,13 @@ export default{
     setChartImg(params){
         return post('/datamanage/chart_info/image/set',params)
     },
+
+    /** 
+	 * 获取图表批量刷新结果
+	 *   Source ReportId ReportChapterId
+	 * 
+	 */
+	getReportrefreshStatus: params => {
+		return post('/datamanage/chart_info/batch_refresh/result',params)
+	}
 } 

+ 12 - 1
src/views/report/EditReport.vue

@@ -214,12 +214,23 @@ async function handleRefreshAllChart(){
         }
     });
     if(!code_arr.length) return showToast('请插入图表');
+
+    if(route.query.id) {
+        let res = await apiChart.getReportrefreshStatus({
+            Source: 'report',
+            ReportId: Number(route.query.id),
+            ReportChapterId: 0
+        });
+        
+        if(!res.Data.RefreshResult) return showToast('图表正在刷新中,请勿重复操作')
+    }
+
     const res=await apiChart.refreshChartMultiple({ChartInfoCode:code_arr})
     if(res.Ret===200){
         $('iframe').each((k,i) => {
           $(i).attr('src',$(i).attr('src'))
         });
-        showToast('刷新成功')
+        showToast(res.Msg)
     }
 }
 

+ 10 - 0
src/views/report/chapter/Detail.vue

@@ -317,6 +317,16 @@ async function handleRefreshAllChart(){
         }
     });
     if(!code_arr.length) return showToast('请插入图表');
+    
+    if(route.query.id) {
+        let res = await apiChart.getReportrefreshStatus({
+            Source: 'report',
+            ReportId: Number(route.query.id),
+            ReportChapterId: 0
+        });
+        
+        if(!res.Data.RefreshResult) return showToast('图表正在刷新中,请勿重复操作')
+    }
     const res=await apiChart.refreshChartMultiple({ChartInfoCode:code_arr})
     if(res.Ret===200){
         $('iframe').each((k,i) => {

+ 10 - 0
src/views/reportEn/AddReport.vue

@@ -215,6 +215,16 @@ async function handleRefreshAllChart(){
         }
     });
     if(!code_arr.length) return showToast('请插入图表');
+
+    if(route.query.id) {
+        let res = await apiChart.getReportrefreshStatus({
+            Source: 'report',
+            ReportId: Number(route.query.id),
+            ReportChapterId: 0
+        });
+        
+        if(!res.Data.RefreshResult) return showToast('图表正在刷新中,请勿重复操作')
+    }
     const res=await apiChart.refreshChartMultiple({ChartInfoCode:code_arr})
     if(res.Ret===200){
         $('iframe').each((k,i) => {