-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
466 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from drf_yasg.inspectors import SwaggerAutoSchema | ||
|
||
|
||
class CustomSwaggerAutoSchema(SwaggerAutoSchema): | ||
def get_tags(self, operation_keys=None): | ||
if hasattr(self.view, 'swagger_tag'): | ||
return [self.view.swagger_tag] | ||
return super().get_tags(operation_keys) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<div class="layout"> | ||
<main> | ||
<router-view></router-view> <!-- 子路由在这里渲染 --> | ||
</main> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'CommonLayout', | ||
// ... | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<template> | ||
<div> | ||
<el-menu-item | ||
v-if="!item.children" | ||
:index="item.url" | ||
:disabled="isDisabled" | ||
> | ||
<i :class="item.icon"></i> {{ item.name }} | ||
|
||
</el-menu-item> | ||
<el-submenu | ||
v-else | ||
:index="item.url" | ||
> | ||
<template slot="title"> | ||
<i :class="item.icon"></i> {{ item.name }} | ||
</template> | ||
<sidebar-item | ||
v-for="child in item.children" | ||
:key="child.url" | ||
:item="child" | ||
/> | ||
</el-submenu> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'SidebarItem', | ||
props: ['item'], | ||
computed: { | ||
isDisabled() { | ||
const routerName = this.$store.state.routerName; | ||
// 适当调整路径逻辑以匹配你的需求 | ||
const pathCondition = this.$route.path === '/fastrunner/project_list'; | ||
// 根据你的全局状态或路由条件设置 disabled 状态 | ||
return routerName === 'ProjectList' || pathCondition; | ||
} | ||
}, | ||
components: { | ||
SidebarItem: () => import('./SidebarItem') // 注意递归引用自身 | ||
} | ||
}; | ||
</script> |
Oops, something went wrong.