Browse Source

全局发布loading

szdq
wangxy 3 years ago
parent
commit
ea09f60973
3 changed files with 32 additions and 4 deletions
  1. +7
    -1
      src/components/queryComponent/index.vue
  2. +6
    -2
      src/store/homePage/homePage.js
  3. +19
    -1
      src/views/plan/workbench/homePage/index.vue

+ 7
- 1
src/components/queryComponent/index.vue View File

@ -85,6 +85,7 @@ import { put, post } from "@/server/api.js";
// isShowAddButton:
import uploadTemplate from "./upload.vue";
import lookError from "./lookError.vue";
import {mapMutations} from 'vuex'
export default {
name: "QueryComponent",
components: {
@ -125,6 +126,7 @@ export default {
})
.catch(() => { });
},
...mapMutations("homePageStore", ["getReleaseAllLoading"]),
//
releaseAllHandle() {
this.$confirm('是否确认全局发布?', "警告", {
@ -133,13 +135,17 @@ export default {
type: "warning",
})
.then(() => {
this.getReleaseAllLoading(true)
return put('/admin/ap/custdemandverhead/issueglobalallversion')
})
.then(() => {
this.msgSuccess("全局发布成功");
this.$emit('batchReleaseEmit', true)
this.getReleaseAllLoading(false)
})
.catch(() => { });
.catch(() => {
this.getReleaseAllLoading(false)
});
},
//
contraryReleaseAll() {


+ 6
- 2
src/store/homePage/homePage.js View File

@ -1,11 +1,15 @@
export default {
namespaced: true,
state: {
withTheRing: {}
withTheRing: {},
releaseAllLoading: false,
},
mutations: {
getWithRingStatus (state, componentData) {
state.withTheRing = componentData
}
},
getReleaseAllLoading (state, componentData) {
state.releaseAllLoading = componentData
},
}
};

+ 19
- 1
src/views/plan/workbench/homePage/index.vue View File

@ -1,5 +1,5 @@
<template>
<ContentContainer class="homepage-wrapper" id="box">
<ContentContainer class="homepage-wrapper" id="box" v-loading="isLoading">
<!-- 上面模块 -->
<div class="homepage-top-wrap clearfix" id="top">
<!-- 左侧客户树 -->
@ -22,6 +22,7 @@
import Customer from './customer'
import Beta from './beta'
import Formal from './formal'
import { mapState } from "vuex"
export default {
components:{
Customer,
@ -35,6 +36,23 @@ export default {
customerId: "",
CreateModel: "",
currentCustomId: '',
isLoading: false, // loading
}
},
computed: {
...mapState('homePageStore',['releaseAllLoading'])
},
watch: {
// ID
releaseAllLoading: {
handler (data) {
if (data) {
this.isLoading = true
} else {
this.isLoading = false
}
},
deep: true
}
},
methods: {


Loading…
Cancel
Save