فهرست منبع

云图页面警报刷新

wang_xy 2 سال پیش
والد
کامیت
b44c4f6db9
3فایلهای تغییر یافته به همراه17 افزوده شده و 9 حذف شده
  1. 10 4
      src/api/forest.js
  2. 3 1
      src/utils/request.js
  3. 4 4
      src/views/forest.vue

+ 10 - 4
src/api/forest.js

@@ -32,11 +32,14 @@ export function getWeather(param) {
   })
 }
 // 右侧获取事件列表
-export function getEventList(param) {
+export function getEventList(param,loading) {
   return request({
     url: '/center-traffic/traffic/getEventList',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
 }
 // 获取事件详情
@@ -57,11 +60,14 @@ export function getEventByCalendar(param) {
 }
 
 // 获取事件分类
-export function getEventByEventType(param) {
+export function getEventByEventType(param,loading) {
   return request({
     url: '/center-traffic/traffic/getEventByEventType',
     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
   // 是否需要防止数据重复提交

+ 4 - 4
src/views/forest.vue

@@ -371,10 +371,10 @@ export default {
     selectTaskList() {
       this.$refs.bottomMenu.selectTaskList()
     },
-    getEventByEventType(day) {
+    getEventByEventType(day,loading) {
       let that = this
       //左侧获取事件部门数量
-      getEventByEventType({ day: day }).then(res => {
+      getEventByEventType({ day: day },loading).then(res => {
         this.villageTypeXlList = res.data
       })
     },
@@ -382,7 +382,7 @@ export default {
       this.$refs.up.pause();//停止播放音乐
       this.$refs.up.currentTime = 0;
     },
-    getEventList(day,eventTypeIdDl,eventTypeId) {
+    getEventList(day,eventTypeIdDl,eventTypeId,loading) {
       let that = this
       this.eventList = []
       this.eventListAll = []
@@ -391,7 +391,7 @@ export default {
         day: day,
         eventTypeIdDl: [eventTypeIdDl],
         eventTypeId: [eventTypeId]
-      }).then(res => {
+      },loading).then(res => {
         this.eventList = res.data
         this.eventListAll = res.data
         that.markersList = []