refactor: 重构菜单结构,配置列表改为应用维度管理
This commit is contained in:
@@ -6,9 +6,6 @@
|
||||
<el-select v-model="query.env" placeholder="环境" clearable style="width: 160px; margin-right: 10px" @change="loadData">
|
||||
<el-option v-for="p in profiles" :key="p.value" :label="p.label" :value="p.value"></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="query.appId" placeholder="应用" clearable filterable style="width: 200px; margin-right: 10px" @change="loadData">
|
||||
<el-option v-for="app in apps" :key="app.value" :label="app.label" :value="app.value"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="$router.push('/config/add')">新建配置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -221,9 +218,8 @@ export default {
|
||||
list: [],
|
||||
loading: false,
|
||||
total: 0,
|
||||
query: { pageNo: 1, pageSize: 20, env: '', appId: null },
|
||||
query: { pageNo: 1, pageSize: 20, env: '' },
|
||||
profiles: [],
|
||||
apps: [],
|
||||
historyVisible: false,
|
||||
historyList: [],
|
||||
currentConfig: null,
|
||||
@@ -238,7 +234,6 @@ export default {
|
||||
created() {
|
||||
this.loadData()
|
||||
this.loadProfiles()
|
||||
this.loadApps()
|
||||
},
|
||||
methods: {
|
||||
async loadData() {
|
||||
@@ -246,14 +241,12 @@ export default {
|
||||
try {
|
||||
const params = {
|
||||
pageNo: this.query.pageNo,
|
||||
pageSize: this.query.pageSize
|
||||
pageSize: this.query.pageSize,
|
||||
appId: this.$route.params.appId
|
||||
}
|
||||
if (this.query.env) {
|
||||
params.env = this.query.env
|
||||
}
|
||||
if (this.query.appId) {
|
||||
params.appId = this.query.appId
|
||||
}
|
||||
const res = await getConfigList(params)
|
||||
this.list = res.data || []
|
||||
this.total = res.total || 0
|
||||
@@ -267,12 +260,6 @@ export default {
|
||||
this.profiles = res.data || []
|
||||
} catch (e) {}
|
||||
},
|
||||
async loadApps() {
|
||||
try {
|
||||
const res = await request({ url: '/admin/app/options', method: 'get' })
|
||||
this.apps = res.data || []
|
||||
} catch (e) {}
|
||||
},
|
||||
handlePageChange(page) {
|
||||
this.query.pageNo = page
|
||||
this.loadData()
|
||||
|
||||
Reference in New Issue
Block a user