Commit 83790203 authored by 黎博's avatar 黎博

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

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