|
1 | 1 | <template> |
2 | | - <el-input v-model.trim="filterText" :placeholder="$t('common.search')" prefix-icon="Search" |
3 | | - clearable |
4 | | - style="padding: 12px 12px 0 12px;"/> |
| 2 | + <el-input |
| 3 | + v-model.trim="filterText" |
| 4 | + :placeholder="$t('common.search')" |
| 5 | + prefix-icon="Search" |
| 6 | + clearable |
| 7 | + style="padding: 12px 12px 0 12px" |
| 8 | + /> |
5 | 9 | <div class="list flex-wrap"> |
6 | 10 | <template v-if="filterList.length"> |
7 | | - <el-popover v-for="item in filterList" :key="item.id" placement="right" :width="280" |
8 | | - :show-after="500"> |
| 11 | + <el-popover |
| 12 | + v-for="item in filterList" |
| 13 | + :key="item.id" |
| 14 | + placement="right" |
| 15 | + :width="280" |
| 16 | + :show-after="500" |
| 17 | + > |
9 | 18 | <template #reference> |
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)"> |
| 19 | + <div |
| 20 | + class="list-item flex align-center border border-r-6 p-8-12 cursor" |
| 21 | + style="width: calc(50% - 6px)" |
| 22 | + @click.stop="emit('clickNodes', item)" |
| 23 | + @mousedown.stop="emit('onmousedown', item)" |
| 24 | + > |
13 | 25 | <!-- <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=""/> |
| 26 | + <el-avatar |
| 27 | + v-if="isAppIcon(item?.icon)" |
| 28 | + shape="square" |
| 29 | + :size="32" |
| 30 | + style="background: none" |
| 31 | + > |
| 32 | + <img :src="resetUrl(item?.icon, resetUrl('./favicon.ico'))" alt="" /> |
17 | 33 | </el-avatar> |
18 | 34 | <el-avatar v-else class="avatar-green" shape="square" :size="32"> |
19 | | - <img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt=""/> |
| 35 | + <img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt="" /> |
20 | 36 | </el-avatar> |
21 | 37 | <span class="ml-8 ellipsis" :title="item.name">{{ item.name }}</span> |
22 | 38 | </div> |
|
26 | 42 | <div class="flex-between"> |
27 | 43 | <div class="flex align-center"> |
28 | 44 | <!-- <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=""/> |
| 45 | + <el-avatar |
| 46 | + v-if="isAppIcon(item?.icon)" |
| 47 | + shape="square" |
| 48 | + :size="32" |
| 49 | + style="background: none" |
| 50 | + > |
| 51 | + <img :src="resetUrl(item?.icon, resetUrl('./favicon.ico'))" alt="" /> |
32 | 52 | </el-avatar> |
33 | 53 | <el-avatar v-else class="avatar-green" shape="square" :size="32"> |
34 | | - <img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt=""/> |
| 54 | + <img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt="" /> |
35 | 55 | </el-avatar> |
36 | 56 | <span class="font-medium ml-8 break-all" :title="item.name">{{ item.name }}</span> |
37 | 57 | </div> |
38 | 58 | <div v-if="item.type" class="status-tag" style="margin-left: auto"> |
39 | | - <el-tag type="warning" v-if="isWorkFlow(item.type)" style="height: 22px"> |
| 59 | + <el-tag class="warning-tag" v-if="isWorkFlow(item.type)"> |
40 | 60 | {{ $t('views.application.workflow') }} |
41 | 61 | </el-tag> |
42 | | - <el-tag class="blue-tag" v-else style="height: 22px"> |
| 62 | + <el-tag class="blue-tag" v-else> |
43 | 63 | {{ $t('views.application.simple') }} |
44 | 64 | </el-tag> |
45 | 65 | </div> |
|
48 | 68 | </template> |
49 | 69 | </el-popover> |
50 | 70 | </template> |
51 | | - <el-empty v-else :description="$t('common.noData')"/> |
| 71 | + <el-empty v-else :description="$t('common.noData')" /> |
52 | 72 | </div> |
53 | 73 | </template> |
54 | 74 |
|
55 | 75 | <script setup lang="ts"> |
56 | | -import {watch, ref} from 'vue' |
57 | | -import {isAppIcon, resetUrl} from '@/utils/common' |
58 | | -import {isWorkFlow} from '@/utils/application' |
| 76 | +import { watch, ref } from 'vue' |
| 77 | +import { isAppIcon, resetUrl } from '@/utils/common' |
| 78 | +import { isWorkFlow } from '@/utils/application' |
59 | 79 |
|
60 | 80 | const props = defineProps<{ |
61 | 81 | list: any[] |
62 | 82 | }>() |
63 | 83 |
|
64 | 84 | const emit = defineEmits<{ |
65 | | - (e: 'clickNodes', item: any): void; |
66 | | - (e: 'onmousedown', item: any): void; |
67 | | -}>(); |
| 85 | + (e: 'clickNodes', item: any): void |
| 86 | + (e: 'onmousedown', item: any): void |
| 87 | +}>() |
68 | 88 |
|
69 | 89 | const filterText = ref('') |
70 | 90 | const filterList = ref<any[]>([]) |
|
0 commit comments