Răsfoiți Sursa

Merge branch 'need_report_refresh'

Karsa 11 luni în urmă
părinte
comite
8e7860f7c8

+ 9 - 0
src/api/modules/chartApi.js

@@ -911,6 +911,15 @@ const dataBaseInterface = {
 	 */
 	saveEdbChartImg:(params)=>{
 		return http.post('/datamanage/edb_info/image/set',params)
+	},
+
+	/** 
+	 * 获取图表批量刷新结果
+	 *   Source ReportId ReportChapterId
+	 * 
+	 */
+	getReportrefreshStatus: params => {
+		return http.post('/datamanage/chart_info/batch_refresh/result',params)
 	}
 	
 }

+ 19 - 9
src/views/report_manage/mixins/messagePush.js

@@ -98,24 +98,34 @@ export default {
 
       if(!code_arr.length) return this.$message.warning('请插入图表');
 
-      const loading = this.$loading({
-        lock: true,
-        text: '刷新中..',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.02)'
-      });
+      if(this.$route.query.id) {
+        let res = await dataBaseInterface.getReportrefreshStatus({
+          Source: 'report',
+          ReportId: Number(this.$route.query.id),
+          ReportChapterId: 0
+        });
+        
+        if(!res.Data.RefreshResult) return this.$message.warning('图表正在刷新中,请勿重复操作')
+      }
+
+      // const loading = this.$loading({
+      //   lock: true,
+      //   text: '刷新中..',
+      //   spinner: 'el-icon-loading',
+      //   background: 'rgba(0, 0, 0, 0.02)'
+      // });
 
-      const { Ret } = await dataBaseInterface.reportRefresh({
+      const { Ret,Msg } = await dataBaseInterface.reportRefresh({
         ChartInfoCode: code_arr
       })
   
-      loading.close();
+      // loading.close();
       
       if(Ret === 200) {
         $('iframe').each((k,i) => {
           $(i).attr('src',$(i).attr('src'))
         });
-        this.$message.success('刷新成功');
+        this.$message.success(Msg);
       }
 
     },1000),

+ 19 - 9
src/views/smartReport/editReport.vue

@@ -816,24 +816,34 @@ export default {
 
             if(!code_arr.length) return this.$message.warning('请插入图表');
 
-            const loading = this.$loading({
-                lock: true,
-                text: '刷新中..',
-                spinner: 'el-icon-loading',
-                background: 'rgba(0, 0, 0, 0.02)'
-            });
+            if(this.$route.query.id) {
+                let res = await dataBaseInterface.getReportrefreshStatus({
+                Source: 'report',
+                ReportId: Number(this.$route.query.id),
+                ReportChapterId: 0
+                });
+                
+                if(!res.Data.RefreshResult) return this.$message.warning('图表正在刷新中,请勿重复操作')
+            }
+
+            // const loading = this.$loading({
+            //     lock: true,
+            //     text: '刷新中..',
+            //     spinner: 'el-icon-loading',
+            //     background: 'rgba(0, 0, 0, 0.02)'
+            // });
 
-            const { Ret } = await dataBaseInterface.reportRefresh({
+            const { Ret,Msg } = await dataBaseInterface.reportRefresh({
                 ChartInfoCode: code_arr
             })
         
-            loading.close();
+            // loading.close();
             
             if(Ret === 200) {
                 $('iframe').each((k,i) => {
                     $(i).attr('src',$(i).attr('src'))
                 });
-                this.$message.success('刷新成功');
+                this.$message.success(Msg);
             }
 
         },1000),