Commit 83790203 authored by 黎博's avatar 黎博

修复BUG以及同步数据库新增loading

parent 3002fe0c
......@@ -49,6 +49,7 @@
<script>
import { getNamespaceList, getServiceDetail, syncMq } from '@/api/k8s'
import { mapGetters } from 'vuex'
export default {
data() {
return {
......@@ -59,6 +60,13 @@ export default {
mqUrl: ''
}
},
computed: {
...mapGetters({
getNavs: 'header/Navs',
getAsideTitle: 'header/AsideTitle',
getCount: 'header/Count'
})
},
methods: {
// 获取环境列表
getNamespaceList() {
......@@ -76,7 +84,7 @@ export default {
path: `/docker/env`
})
// 强制刷新整个页面
this.$router.go(0)
// this.$router.go(0)
},
handleSyncMysql() {
this.$router.push('/effect/dbsync')
......
......@@ -49,6 +49,7 @@
<script>
import { getNamespaceList, getServiceDetail, syncMq } from '@/api/k8s'
import { mapGetters } from 'vuex'
export default {
data() {
return {
......@@ -59,6 +60,13 @@ export default {
mqUrl: ''
}
},
computed: {
...mapGetters({
getNavs: 'header/Navs',
getAsideTitle: 'header/AsideTitle',
getCount: 'header/Count'
})
},
methods: {
// 获取环境列表
getNamespaceList() {
......@@ -76,7 +84,7 @@ export default {
path: `/docker/env`
})
// 强制刷新整个页面
this.$router.go(0)
// this.$router.go(0)
},
// 跳转到数据库同步页面
handleSyncMysql() {
......
......@@ -77,7 +77,14 @@ export default {
},
buildNum: undefined,
descVisible: false,
timer: undefined
timer: undefined,
tLoading: undefined,
loadingOptions: {
text: '数据库同步中...',
lock: true,
spinner: 'el-icon-loading',
background: 'rgba(0,0,0,0.7)'
}
}
},
created() {
......@@ -117,6 +124,7 @@ export default {
if (resp.data.data !== 0) {
this.buildNum = resp.data.data
this.$message.success(resp.data.msg)
this.tLoading = this.$loading.service(this.loadingOptions)
// 查询结果
this.timer = window.setInterval(this.syncQuery, 3000)
} else {
......@@ -141,6 +149,7 @@ export default {
this.desc = resp.data.data.text
// 清除定时器
window.clearInterval(this.timer)
this.tLoading.close()
} else if (resp.data.data.status === 'BUILDING') {
this.desc = resp.data.data.text
this.$message.success('数据库同步中...')
......
......@@ -136,7 +136,7 @@ export default {
}
} else {
this.$store.commit('header/setActiveIndex', 0)
this.setCrumbs('测试平台', '主页')
this.setCrumbs('测试平台', '导航页面列表')
}
},
setCrumbs(pt, ct) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment