Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions ui/src/components/resource_mapping/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,7 @@
<el-option :label="$t('views.model.title')" value="MODEL" />
</el-select>
</div>
<el-radio-group
v-if="supportDependency"
v-model="currentTab"
class="app-radio-button-group"
@change="handleTabChange"
>
<el-radio-group v-model="currentTab" class="app-radio-button-group" @change="handleTabChange">
<el-radio-button
v-for="item in tabList"
:key="item.value"
Expand Down Expand Up @@ -472,16 +467,6 @@ const apiType = computed(() => {
}
})

const supportDependency = computed(() => {
if (currentSourceType.value === 'MODEL') {
return false
}
if (currentSourceType.value === 'TOOL' && currentSource.value.tool_type !== 'WORKFLOW') {
return false
}
return true
})

const showWorkspace = computed(() => (user.isPE() || user.isEE()) && route.path.includes('shared'))

const currentTab = ref('dependency') // 'dependency' 代表“我依赖的”, 'dependent' 代表“依赖我的”
Expand Down Expand Up @@ -593,7 +578,10 @@ const open = (source: string, data: any) => {
currentSourceId.value = data.id
currentSource.value = data

if (!supportDependency.value) {
// 根据资源类型设置默认 tab
if (currentSourceType.value === 'MODEL') {
currentTab.value = 'dependent'
} else if (currentSourceType.value === 'TOOL' && data.tool_type !== 'WORKFLOW') {
currentTab.value = 'dependent'
} else {
currentTab.value = 'dependency'
Expand Down
Loading