wang_xy 2 роки тому
батько
коміт
e1a37421a2
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

@@ -1,11 +1,14 @@
 import request from '@/utils/request'
 
 // 右侧获取事件列表
-export function getEventList(param) {
+export function getEventList(param,loading) {
   return request({
     url: '/center-village/VisuVillageCloudController/getEventList',
     method: 'post',
-    data: param
+    data: param,
+    headers: {
+      loading: loading
+    },
   })
 }
 
@@ -26,11 +29,14 @@ export function getEventByCalendar(param) {
   })
 }
 // 获取事件分类
-export function getEventByEventType(param) {
+export function getEventByEventType(param,loading) {
   return request({
     url: '/center-village/VisuVillageCloudController/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

@@ -382,14 +382,14 @@ 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
       })
     },
-    getEventList(day,bigEventTypeId,smallEventTypeId) {
+    getEventList(day,bigEventTypeId,smallEventTypeId,loading) {
       this.listCurrentIndex1=smallEventTypeId
       this.bigEventTypeId=bigEventTypeId
       this.smallEventTypeId=smallEventTypeId
@@ -401,7 +401,7 @@ export default {
         day: day,
         eventTypeIdDl: [bigEventTypeId],
         eventTypeId: [smallEventTypeId]
-      }).then(res => {
+      },loading).then(res => {
         this.eventList = res.data
         this.eventListAll = res.data
         that.markersList = []