整理代码
This commit is contained in:
@@ -101,7 +101,35 @@ export const constantRoutes = [
|
||||
meta: { title: '添加接口', activeMenu: '/api' }
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/api/edit',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/test/api/edit'),
|
||||
name: 'ApiEdit',
|
||||
noCache: true,
|
||||
meta: { title: '修改接口', activeMenu: '/api' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/api/import',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/test/api/import'),
|
||||
name: 'ApiImport',
|
||||
noCache: true,
|
||||
meta: { title: '导入接口', activeMenu: '/api' }
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
|
||||
// 动态路由,基于用户权限动态去加载
|
||||
|
||||
27
test-ui/src/views/test/api/edit.vue
Normal file
27
test-ui/src/views/test/api/edit.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
edit
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ApiEdit",
|
||||
dicts: ['http_method'],
|
||||
created () {
|
||||
console.log(this.$route.query.id)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
27
test-ui/src/views/test/api/import.vue
Normal file
27
test-ui/src/views/test/api/import.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
import
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ApiImport",
|
||||
dicts: ['http_method'],
|
||||
created () {
|
||||
console.log(this.$route.query.groupId)
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
@@ -20,6 +20,7 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleImport">导入</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -112,9 +113,12 @@ export default {
|
||||
handleAdd() {
|
||||
this.$tab.openPage("添加接口", "/api/add", {groupId: this.queryParams.groupId});
|
||||
},
|
||||
handleImport() {
|
||||
this.$tab.openPage("导入接口", "/api/import", {groupId: this.queryParams.groupId});
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.$tab.openPage("修改接口", "/api/add", {id: row.id || this.ids});
|
||||
this.$tab.openPage("修改接口", "/api/edit", {id: row.id});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
|
||||
Reference in New Issue
Block a user