Skip to content

Commit 86675e9

Browse files
committed
fix: replace LogoIcon with el-avatar for improved icon rendering in index.vue and NodeContent.vue
1 parent bd1f75a commit 86675e9

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

ui/src/views/application-workflow/component/NodeContent.vue

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
<template>
2-
<el-input v-model.trim="filterText" :placeholder="$t('common.search')" prefix-icon="Search" clearable
3-
style="padding: 12px 12px 0 12px;" />
2+
<el-input v-model.trim="filterText" :placeholder="$t('common.search')" prefix-icon="Search"
3+
clearable
4+
style="padding: 12px 12px 0 12px;"/>
45
<div class="list flex-wrap">
56
<template v-if="filterList.length">
6-
<el-popover v-for="item in filterList" :key="item.id" placement="right" :width="280" :show-after="500">
7+
<el-popover v-for="item in filterList" :key="item.id" placement="right" :width="280"
8+
:show-after="500">
79
<template #reference>
8-
<div class="list-item flex align-center border border-r-6 p-8-12 cursor" style="width: calc(50% - 6px)"
9-
@click.stop="emit('clickNodes', item)" @mousedown.stop="emit('onmousedown', item)">
10-
<LogoIcon v-if="item.resource_type === 'application'" height="32px" />
11-
<el-avatar v-else-if="isAppIcon(item?.icon)" shape="square" :size="32" style="background: none">
12-
<img :src="resetUrl(item?.icon)" alt="" />
10+
<div class="list-item flex align-center border border-r-6 p-8-12 cursor"
11+
style="width: calc(50% - 6px)"
12+
@click.stop="emit('clickNodes', item)" @mousedown.stop="emit('onmousedown', item)">
13+
<!-- <LogoIcon v-if="item.resource_type === 'application'" height="32px" />-->
14+
<el-avatar v-if="isAppIcon(item?.icon)" shape="square" :size="32"
15+
style="background: none">
16+
<img :src="resetUrl(item?.icon,resetUrl('./favicon.ico'))" alt=""/>
1317
</el-avatar>
1418
<el-avatar v-else class="avatar-green" shape="square" :size="32">
15-
<img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt="" />
19+
<img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt=""/>
1620
</el-avatar>
1721
<span class="ml-8 ellipsis" :title="item.name">{{ item.name }}</span>
1822
</div>
@@ -21,12 +25,13 @@
2125
<template #default>
2226
<div class="flex-between">
2327
<div class="flex align-center">
24-
<LogoIcon v-if="item.resource_type === 'application'" height="32px" />
25-
<el-avatar v-else-if="isAppIcon(item?.icon)" shape="square" :size="32" style="background: none">
26-
<img :src="resetUrl(item?.icon)" alt="" />
28+
<!-- <LogoIcon v-if="item.resource_type === 'application'" height="32px"/>-->
29+
<el-avatar v-if="isAppIcon(item?.icon)" shape="square" :size="32"
30+
style="background: none">
31+
<img :src="resetUrl(item?.icon,resetUrl('./favicon.ico'))" alt=""/>
2732
</el-avatar>
2833
<el-avatar v-else class="avatar-green" shape="square" :size="32">
29-
<img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt="" />
34+
<img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt=""/>
3035
</el-avatar>
3136
<span class="font-medium ml-8 break-all" :title="item.name">{{ item.name }}</span>
3237
</div>
@@ -43,14 +48,14 @@
4348
</template>
4449
</el-popover>
4550
</template>
46-
<el-empty v-else :description="$t('common.noData')" />
51+
<el-empty v-else :description="$t('common.noData')"/>
4752
</div>
4853
</template>
4954

5055
<script setup lang="ts">
51-
import { watch, ref } from 'vue'
52-
import { isAppIcon, resetUrl } from '@/utils/common'
53-
import { isWorkFlow } from '@/utils/application'
56+
import {watch, ref} from 'vue'
57+
import {isAppIcon, resetUrl} from '@/utils/common'
58+
import {isWorkFlow} from '@/utils/application'
5459
5560
const props = defineProps<{
5661
list: any[]
@@ -63,6 +68,7 @@ const emit = defineEmits<{
6368
6469
const filterText = ref('')
6570
const filterList = ref<any[]>([])
71+
6672
function filter(list: any[], filterText: string) {
6773
if (!filterText.length) {
6874
return list

ui/src/views/application/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@
176176
@click="goApp(item)"
177177
>
178178
<template #icon>
179-
<LogoIcon height="32px" />
179+
<el-avatar shape="square" :size="32" style="background: none">
180+
<img :src="resetUrl(item?.icon, resetUrl('./favicon.ico'))" alt="" />
181+
</el-avatar>
180182
</template>
181183
<template #subTitle>
182184
<el-text class="color-secondary" size="small">

0 commit comments

Comments
 (0)