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


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

@ -1,11 +1,15 @@
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
withTheRing: {}
withTheRing: {},
releaseAllLoading: false,
}, },
mutations: { mutations: {
getWithRingStatus (state, componentData) { getWithRingStatus (state, componentData) {
state.withTheRing = 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> <template>
<ContentContainer class="homepage-wrapper" id="box">
<ContentContainer class="homepage-wrapper" id="box" v-loading="isLoading">
<!-- 上面模块 --> <!-- 上面模块 -->
<div class="homepage-top-wrap clearfix" id="top"> <div class="homepage-top-wrap clearfix" id="top">
<!-- 左侧客户树 --> <!-- 左侧客户树 -->
@ -22,6 +22,7 @@
import Customer from './customer' import Customer from './customer'
import Beta from './beta' import Beta from './beta'
import Formal from './formal' import Formal from './formal'
import { mapState } from "vuex"
export default { export default {
components:{ components:{
Customer, Customer,
@ -35,6 +36,23 @@ export default {
customerId: "", customerId: "",
CreateModel: "", CreateModel: "",
currentCustomId: '', 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: { methods: {


Loading…
Cancel
Save