Browse Source

云图页面警报刷新

wang_xy 2 năm trước cách đây
mục cha
commit
3989e7b2dc
3 tập tin đã thay đổi với 45 bổ sung25 xóa
  1. 30 12
      src/api/forest.js
  2. 3 1
      src/utils/request.js
  3. 12 12
      src/views/forest.vue

+ 30 - 12
src/api/forest.js

@@ -8,19 +8,25 @@ export function getBaseInfo() {
   })
 }
 // 左侧获取事件信息统计
-export function getTodayEvents(param) {
+export function getTodayEvents(param,loading) {
   return request({
     url: '/center-firecontrol/VisuForestCloudMapController/getTodayEvents',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
 }
 // 左侧获取事件部门数量
-export function getDeptEventCount(param) {
+export function getDeptEventCount(param,loading) {
   return request({
     url: '/center-firecontrol/VisuForestCloudMapController/getDeptEventCount',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
 }
 // 右侧获取天气
@@ -34,19 +40,25 @@ export function getWeather(param) {
 
 
 // 右侧获取事件列表
-export function getEventList(param) {
+export function getEventList(param,loading) {
   return request({
     url: '/center-firecontrol/VisuForestCloudMapController/getEventList',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
 }
 // 右侧获取曝光台列表
-export function getExposureStage(param) {
+export function getExposureStage(param,loading) {
   return request({
     url: 'center-firecontrol/VisuForestCloudMapController/getExposureStage',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
 }
 
@@ -67,19 +79,25 @@ export function getEventByCalendar(param) {
   })
 }
 // 获取事件分类
-export function getEventByEventType(param) {
+export function getEventByEventType(param,loading) {
   return request({
     url: '/center-firecontrol/VisuForestCloudMapController/getEventByEventType',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
 }
 // 获取上报排名
-export function getEventByReportorOrder(param) {
+export function getEventByReportorOrder(param,loading) {
   return request({
     url: '/center-firecontrol/VisuForestCloudMapController/getEventByReportorOrder',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
 }
 // 日志文件上传

+ 3 - 1
src/utils/request.js

@@ -25,7 +25,9 @@ const service = axios.create({
 
 // request拦截器
 service.interceptors.request.use(config => {
-  downloadLoadingInstance = Loading.service({ text: "请稍候...", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
+  if(config.headers.loading == undefined){
+    downloadLoadingInstance = Loading.service({ text: "请稍候...", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
+  }
   // 是否需要设置 token
   const isToken = (config.headers || {}).isToken === false
   // 是否需要防止数据重复提交

+ 12 - 12
src/views/forest.vue

@@ -868,10 +868,10 @@ export default {
         }
       })
     },
-    getTodayEvents(day) {
+    getTodayEvents(day,loading) {
       let that = this
       //左侧获取事件信息统计
-      getTodayEvents({ day: day }).then(res => {
+      getTodayEvents({ day: day },loading).then(res => {
         this.aiTotal = res.data.aiTotal
         this.aiTotal_pre = res.data.aiTotal_pre
         this.newReport = res.data.newReport
@@ -887,10 +887,10 @@ export default {
         this.eventChartAi(this.aiTotal_pre, this.otherTotal_pre)
       })
     },
-    getDeptEventCount(day) {
+    getDeptEventCount(day,loading) {
       let that = this
       //左侧获取事件部门数量
-      getDeptEventCount({ day: day }).then(res => {
+      getDeptEventCount({ day: day },loading).then(res => {
         this.forestFarm = res.data
       })
     },
@@ -918,12 +918,12 @@ export default {
         }
       })
     },
-    getEventList(day) {
+    getEventList(day,loading) {
       let that = this
       this.eventList = []
       this.eventListAll = []
       //右侧获取事件列表
-      getEventList({ day: day }).then(res => {
+      getEventList({ day: day },loading).then(res => {
         this.eventList = res.data
         this.eventListAll = res.data
         that.markersList = []
@@ -1019,10 +1019,10 @@ export default {
       this.$refs.up.pause();//停止播放音乐
       this.$refs.up.currentTime = 0;
     },
-    getEventByEventType(day) {
+    getEventByEventType(day,loading) {
       let that = this
       //右侧获取事件分类
-      getEventByEventType({ day: day }).then(res => {
+      getEventByEventType({ day: day },loading).then(res => {
         if (res.data != null && res.data.length > 0) {
           this.showEventKind = true
           this.eventKind.data = res.data
@@ -1036,10 +1036,10 @@ export default {
         }
       })
     },
-    getEventByReportorOrder(day) {
+    getEventByReportorOrder(day,loading) {
       let that = this
       //右侧获取上报排名
-      getEventByReportorOrder({ day: day }).then(res => {
+      getEventByReportorOrder({ day: day },loading).then(res => {
         if (res.data != null && res.data.length > 0) {
           this.reportList.data = res.data
           this.reportList = { ...this.reportList }
@@ -1049,10 +1049,10 @@ export default {
         }
       })
     },
-    getExposureStage(day) {
+    getExposureStage(day,loading) {
       let that = this
       //右侧获取曝光台
-      getExposureStage({ day: day }).then(res => {
+      getExposureStage({ day: day },loading).then(res => {
         this.exposureStageList = res.data
       })
     },