Skip to content

Commit 27aeba4

Browse files
feat: chat upload input style (#3898)
Co-authored-by: wangdan-fit2cloud <[email protected]>
1 parent e9434b6 commit 27aeba4

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

ui/src/components/dynamics-form/items/upload/UploadInput.vue

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<el-upload
3-
style="width: 80%"
3+
style="width: 100%"
44
v-loading="loading"
55
action="#"
66
v-bind="$attrs"
@@ -10,26 +10,26 @@
1010
multiple
1111
>
1212
<el-button type="primary">{{ $t('chat.uploadFile.label') }}</el-button>
13-
<template #file="{ file, index }"
14-
><el-card style="--el-card-padding: 0" shadow="never">
13+
<template #file="{ file }">
14+
<el-card style="--el-card-padding: 0" shadow="never">
1515
<div
16+
class="flex-between"
1617
:class="[inputDisabled ? 'is-disabled' : '']"
17-
style="
18-
padding: 0 8px 0 8px;
19-
display: flex;
20-
justify-content: space-between;
21-
align-items: center;
22-
align-content: center;
23-
"
18+
style="padding: 0 8px 0 8px"
2419
>
25-
<el-tooltip class="box-item" effect="dark" :content="file.name" placement="top-start">
26-
<div style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 40%">
20+
<div class="flex align-center" style="width: 70%">
21+
<img :src="getImgUrl(file && file?.name)" alt="" width="24" class="mr-4" />
22+
<span class="ellipsis-1" :title="file.name">
2723
{{ file.name }}
28-
</div></el-tooltip
29-
>
24+
</span>
25+
</div>
26+
<div class="flex align-center">
27+
<div>{{ formatSize(file.size) }}</div>
3028

31-
<div>{{ formatSize(file.size) }}</div>
32-
<el-icon @click="deleteFile(file)" style="cursor: pointer"><DeleteFilled /></el-icon>
29+
<el-button link class="ml-8" @click="deleteFile(file)">
30+
<AppIcon iconName="app-delete"></AppIcon>
31+
</el-button>
32+
</div>
3333
</div>
3434
</el-card>
3535
</template>
@@ -39,6 +39,7 @@
3939
import { computed, inject, ref, useAttrs } from 'vue'
4040
import { ElMessage } from 'element-plus'
4141
import type { FormField } from '@/components/dynamics-form/type'
42+
import { getImgUrl } from '@/utils/common'
4243
import { t } from '@/locales'
4344
import { useFormDisabled } from 'element-plus'
4445
const inputDisabled = useFormDisabled()
@@ -71,7 +72,7 @@ const deleteFile = (file: any) => {
7172
7273
const model_value = computed({
7374
get: () => {
74-
if (!model_value) {
75+
if (!model_value.value) {
7576
emit('update:modelValue', [])
7677
}
7778
return props.modelValue

ui/src/views/tool/component/ToolListContainer.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
{{ $t('common.edit') }}
236236
</el-dropdown-item>
237237
<el-dropdown-item
238-
v-if="!item.template_id && permissionPrecise.copy(item.id)"
238+
v-if="!item.template_id && permissionPrecise.copy(item.id) && item.tool_type!== 'MCP'"
239239
@click.stop="copyTool(item)"
240240
>
241241
<AppIcon iconName="app-copy" class="color-secondary"></AppIcon>
@@ -275,7 +275,7 @@
275275
{{ $t('views.shared.authorized_workspace') }}</el-dropdown-item
276276
>
277277
<el-dropdown-item
278-
v-if="!item.template_id && permissionPrecise.export(item.id)"
278+
v-if="!item.template_id && permissionPrecise.export(item.id) && item.tool_type!== 'MCP'"
279279
@click.stop="exportTool(item)"
280280
>
281281
<AppIcon iconName="app-export" class="color-secondary"></AppIcon>

0 commit comments

Comments
 (0)