Commit f3d38f77 authored by 晓彤's avatar 晓彤

Merge branch 'xiaotong'

parents bd4e4552 1f534c58
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<script> <script>
import { getNamespaceList, getServiceDetail, syncMq } from '@/api/k8s' import { getNamespaceList, getServiceDetail, syncMq } from '@/api/k8s'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import bus from '@/utils/bus'
export default { export default {
data() { data() {
return { return {
...@@ -80,6 +81,8 @@ export default { ...@@ -80,6 +81,8 @@ export default {
// 跳转到详情页面 // 跳转到详情页面
jumpToDetail(name) { jumpToDetail(name) {
window.sessionStorage.setItem('env', name) window.sessionStorage.setItem('env', name)
// 向菜单栏中的下拉框传递环境名称
bus.$emit('TransEnv', name)
this.$router.push({ this.$router.push({
path: `/docker/env` path: `/docker/env`
}) })
......
...@@ -354,6 +354,7 @@ import { ...@@ -354,6 +354,7 @@ import {
syncMq, syncMq,
flushRedis flushRedis
} from '@/api/k8s' } from '@/api/k8s'
import bus from '@/utils/bus'
export default { export default {
data() { data() {
return { return {
...@@ -400,7 +401,11 @@ export default { ...@@ -400,7 +401,11 @@ export default {
} }
}, },
created() { created() {
this.getServiceList() bus.$on('TransEnv', (name) => {
this.namespace = name
this.getServiceList()
})
getDockerProjectType({}).then((resp) => { getDockerProjectType({}).then((resp) => {
this.typeList = resp.data.data this.typeList = resp.data.data
}) })
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
测试环境列表 测试环境列表
</div> </div>
<div> <div>
<el-table :data="tableData" :header-cell-style="{background:'#F3F4F7',color:'#555'}" size="medium" align="center" style="width: 100%;margin-bottom: 30px;"> <el-table :data="tableData" :header-cell-style="{background:'#F3F4F7',color:'#555'}" size="medium" align="center"
style="width: 100%;margin-bottom: 30px;">
<el-table-column :index="indexMethod" label="#" type="index" /> <el-table-column :index="indexMethod" label="#" type="index" />
<el-table-column prop="name" label="名称" width="100"> <el-table-column prop="name" label="名称" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -50,6 +51,8 @@ ...@@ -50,6 +51,8 @@
<script> <script>
import { getNamespaceList, getServiceDetail, syncMq } from '@/api/k8s' import { getNamespaceList, getServiceDetail, syncMq } from '@/api/k8s'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
// 引入组件
import bus from '@/utils/bus'
export default { export default {
data() { data() {
return { return {
...@@ -80,9 +83,13 @@ export default { ...@@ -80,9 +83,13 @@ export default {
// 跳转到详情页面 // 跳转到详情页面
jumpToDetail(name) { jumpToDetail(name) {
window.sessionStorage.setItem('env', name) window.sessionStorage.setItem('env', name)
// 向菜单栏中的下拉框传递环境名称
bus.$emit('TransEnv', name)
this.$router.push({ this.$router.push({
// 环境详情页面
path: `/docker/env` path: `/docker/env`
}) })
// 强制刷新整个页面 // 强制刷新整个页面
// this.$router.go(0) // this.$router.go(0)
}, },
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<Crumbs :crumbs="getCrumbs"></Crumbs> <Crumbs :crumbs="getCrumbs"></Crumbs>
</div> </div>
<div class="right"> <div class="right">
<!-- <el-tag>当前环境:{{ env }}</el-tag> -->
<el-select v-model="env" filterable @change="envChange" placeholder="请选择环境" style="width:110px"> <el-select v-model="env" filterable @change="envChange" placeholder="请选择环境" style="width:110px">
<el-option v-for="item in envList" :key="item.name" :label="item.name" :value="item.name"> <el-option v-for="item in envList" :key="item.name" :label="item.name" :value="item.name">
</el-option> </el-option>
...@@ -63,7 +62,7 @@ export default { ...@@ -63,7 +62,7 @@ export default {
} }
}, },
getEnvList() { getEnvList() {
getNamespaceList({env: 'all'}).then((resp) => { getNamespaceList({ env: 'all' }).then((resp) => {
this.envList = resp.data.data this.envList = resp.data.data
}) })
}, },
...@@ -85,6 +84,9 @@ export default { ...@@ -85,6 +84,9 @@ export default {
} }
}, },
created() { created() {
this.$bus.$on('TransEnv', (name) => {
this.env = name
})
this.getEnvList() this.getEnvList()
}, },
components: { components: {
......
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