Browse Source

云图页面警报刷新

wang_xy 2 years ago
parent
commit
e51cc4f8fa
3 changed files with 45 additions and 25 deletions
  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({
   return request({
     url: '/center-agriculture/fire/getTodayEvents',
     url: '/center-agriculture/fire/getTodayEvents',
     method: 'post',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
   })
 }
 }
 // 左侧获取事件部门数量
 // 左侧获取事件部门数量
-export function getDeptEventCount(param) {
+export function getDeptEventCount(param,loading) {
   return request({
   return request({
     url: '/center-agriculture/fire/getDeptEventCount',
     url: '/center-agriculture/fire/getDeptEventCount',
     method: 'post',
     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({
   return request({
     url: '/center-agriculture/fire/getEventList',
     url: '/center-agriculture/fire/getEventList',
     method: 'post',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
   })
 }
 }
 // 右侧获取曝光台列表
 // 右侧获取曝光台列表
-export function getExposureStage(param) {
+export function getExposureStage(param,loading) {
   return request({
   return request({
     url: 'center-agriculture/fire/getExposureStage',
     url: 'center-agriculture/fire/getExposureStage',
     method: 'post',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
   })
 }
 }
 
 
@@ -69,19 +81,25 @@ export function getEventByCalendar(param) {
   })
   })
 }
 }
 // 获取事件分类
 // 获取事件分类
-export function getEventByEventType(param) {
+export function getEventByEventType(param,loading) {
   return request({
   return request({
     url: '/center-agriculture/fire/getEventByEventType',
     url: '/center-agriculture/fire/getEventByEventType',
     method: 'post',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
   })
 }
 }
 // 获取上报排名
 // 获取上报排名
-export function getEventByReportorOrder(param) {
+export function getEventByReportorOrder(param,loading) {
   return request({
   return request({
     url: '/center-agriculture/fire/getEventByReportorOrder',
     url: '/center-agriculture/fire/getEventByReportorOrder',
     method: 'post',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
   })
 }
 }
 // 日志文件上传
 // 日志文件上传

+ 3 - 1
src/utils/request.js

@@ -25,7 +25,9 @@ const service = axios.create({
 
 
 // request拦截器
 // request拦截器
 service.interceptors.request.use(config => {
 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
   // 是否需要设置 token
   const isToken = (config.headers || {}).isToken === false
   const isToken = (config.headers || {}).isToken === false
   // 是否需要防止数据重复提交
   // 是否需要防止数据重复提交

+ 12 - 12
src/views/forest.vue

@@ -869,10 +869,10 @@ export default {
         }
         }
       })
       })
     },
     },
-    getTodayEvents(day) {
+    getTodayEvents(day,loading) {
       let that = this
       let that = this
       //左侧获取事件信息统计
       //左侧获取事件信息统计
-      getTodayEvents({ day: day }).then(res => {
+      getTodayEvents({ day: day },loading).then(res => {
         this.aiTotal = res.data.aiTotal
         this.aiTotal = res.data.aiTotal
         this.aiTotal_pre = res.data.aiTotal_pre
         this.aiTotal_pre = res.data.aiTotal_pre
         this.newReport = res.data.newReport
         this.newReport = res.data.newReport
@@ -888,10 +888,10 @@ export default {
         this.eventChartAi(this.aiTotal_pre, this.otherTotal_pre)
         this.eventChartAi(this.aiTotal_pre, this.otherTotal_pre)
       })
       })
     },
     },
-    getDeptEventCount(day) {
+    getDeptEventCount(day,loading) {
       let that = this
       let that = this
       //左侧获取事件部门数量
       //左侧获取事件部门数量
-      getDeptEventCount({ day: day }).then(res => {
+      getDeptEventCount({ day: day },loading).then(res => {
         this.forestFarm = res.data
         this.forestFarm = res.data
       })
       })
     },
     },
@@ -919,12 +919,12 @@ export default {
         }
         }
       })
       })
     },
     },
-    getEventList(day) {
+    getEventList(day,loading) {
       let that = this
       let that = this
       this.eventList = []
       this.eventList = []
       this.eventListAll = []
       this.eventListAll = []
       //右侧获取事件列表
       //右侧获取事件列表
-      getEventList({ day: day }).then(res => {
+      getEventList({ day: day },loading).then(res => {
         this.eventList = res.data;
         this.eventList = res.data;
         console.log(res.data);
         console.log(res.data);
         this.eventListAll = res.data
         this.eventListAll = res.data
@@ -1030,10 +1030,10 @@ export default {
       let aa = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].indexOf(ext.toLowerCase()) !== -1
       let aa = ['png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff'].indexOf(ext.toLowerCase()) !== -1
       return aa
       return aa
     },
     },
-    getEventByEventType(day) {
+    getEventByEventType(day,loading) {
       let that = this
       let that = this
       //右侧获取事件分类
       //右侧获取事件分类
-      getEventByEventType({ day: day }).then(res => {
+      getEventByEventType({ day: day },loading).then(res => {
         if (res.data != null && res.data.length > 0) {
         if (res.data != null && res.data.length > 0) {
           this.showEventKind = true
           this.showEventKind = true
           this.eventKind.data = res.data
           this.eventKind.data = res.data
@@ -1047,10 +1047,10 @@ export default {
         }
         }
       })
       })
     },
     },
-    getEventByReportorOrder(day) {
+    getEventByReportorOrder(day,loading) {
       let that = this
       let that = this
       //右侧获取上报排名
       //右侧获取上报排名
-      getEventByReportorOrder({ day: day }).then(res => {
+      getEventByReportorOrder({ day: day },loading).then(res => {
         if (res.data != null && res.data.length > 0) {
         if (res.data != null && res.data.length > 0) {
           this.reportList.data = res.data
           this.reportList.data = res.data
           this.reportList = { ...this.reportList }
           this.reportList = { ...this.reportList }
@@ -1060,10 +1060,10 @@ export default {
         }
         }
       })
       })
     },
     },
-    getExposureStage(day) {
+    getExposureStage(day,loading) {
       let that = this
       let that = this
       //右侧获取曝光台
       //右侧获取曝光台
-      getExposureStage({ day: day }).then(res => {
+      getExposureStage({ day: day },loading).then(res => {
         this.exposureStageList = res.data
         this.exposureStageList = res.data
       })
       })
     },
     },