Skip to content

Commit 489c7b6

Browse files
fix: Tool store add label
1 parent 63a624d commit 489c7b6

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

ui/src/views/tool/toolStore/ToolCard.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,28 @@
1818
/>
1919
</template>
2020
<template #title>
21-
<div>
22-
{{ props.tool?.name }}
21+
<div class="flex align-center">
22+
<span :title="props.tool?.name" class="ellipsis"> {{ props.tool?.name }}</span>
2323
<el-tag v-if="props.tool?.version" class="ml-4" type="info" effect="plain">
2424
{{ props.tool?.version }}
2525
</el-tag>
2626
</div>
2727
</template>
28+
<template #tag>
29+
<el-tag type="info" v-if="props.tool?.label === 'data_source'" class="info-tag">
30+
{{ $t('views.tool.dataSource.title') }}
31+
</el-tag>
32+
<el-tag type="info" class="info-tag">
33+
{{ $t('views.tool.title') }}
34+
</el-tag>
35+
</template>
2836
<template #subTitle>
2937
<el-text class="color-secondary" size="small">
3038
{{ getSubTitle(props.tool) }}
3139
</el-text>
3240
</template>
3341
<template #footer>
34-
<span class="card-footer-left color-secondary" v-if="props.tool?.downloads!= undefined">
42+
<span class="card-footer-left color-secondary" v-if="props.tool?.downloads != undefined">
3543
{{ `${$t('views.document.upload.download')}: ${numberFormat(props.tool.downloads || 0)} ` }}
3644
</span>
3745
<div class="card-footer-operation mb-8" @click.stop>

ui/src/views/tool/toolStore/ToolStoreDialog.vue

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929
</template>
3030

31-
<LayoutContainer v-loading="loading" :minLeftWidth="204">
31+
<LayoutContainer v-loading="loading" :minLeftWidth="204">
3232
<template #left>
3333
<el-anchor
3434
direction="vertical"
@@ -63,7 +63,8 @@
6363
:get-sub-title="getSubTitle"
6464
@handleAdd="handleOpenAdd(tool)"
6565
@handleDetail="handleDetail(tool)"
66-
/>
66+
>
67+
</ToolCard>
6768
</el-col>
6869
</el-row>
6970
</div>
@@ -151,17 +152,14 @@ function open(id: string) {
151152
152153
async function getList() {
153154
filterList.value = null
154-
const [v1, v2] = await Promise.all([
155-
getInternalToolList(),
156-
getStoreToolList()
157-
])
155+
const [v1, v2] = await Promise.all([getInternalToolList(), getStoreToolList()])
158156
159157
const merged = [...v1, ...v2].reduce((acc, category) => {
160158
const existing = acc.find((item: any) => item.id === category.id)
161159
if (existing) {
162160
existing.tools = [...existing.tools, ...category.tools]
163161
} else {
164-
acc.push({...category})
162+
acc.push({ ...category })
165163
}
166164
return acc
167165
}, [] as ToolCategory[])
@@ -174,7 +172,7 @@ async function getInternalToolList() {
174172
const categories = defaultCategories.value
175173
const res = await ToolStoreApi.getInternalToolList({ name: searchValue.value }, loading)
176174
if (searchValue.value.length) {
177-
filterList.value = [...res.data, ...filterList.value || []]
175+
filterList.value = [...res.data, ...(filterList.value || [])]
178176
} else {
179177
filterList.value = null
180178
categories.forEach((category) => {
@@ -203,7 +201,7 @@ async function getStoreToolList() {
203201
tool.desc = tool.description
204202
})
205203
if (searchValue.value.length) {
206-
filterList.value = [...res.data.apps, ...filterList.value || []]
204+
filterList.value = [...res.data.apps, ...(filterList.value || [])]
207205
} else {
208206
filterList.value = null
209207
categories = tags.map((tag: any) => ({

0 commit comments

Comments
 (0)