feat: chat upload input style (#3898)
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

Co-authored-by: wangdan-fit2cloud <dan.wang@fit2cloud.com>
This commit is contained in:
shaohuzhang1 2025-08-20 17:45:58 +08:00 committed by GitHub
parent e9434b6ba6
commit 27aeba47c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 19 deletions

View File

@ -1,6 +1,6 @@
<template>
<el-upload
style="width: 80%"
style="width: 100%"
v-loading="loading"
action="#"
v-bind="$attrs"
@ -10,26 +10,26 @@
multiple
>
<el-button type="primary">{{ $t('chat.uploadFile.label') }}</el-button>
<template #file="{ file, index }"
><el-card style="--el-card-padding: 0" shadow="never">
<template #file="{ file }">
<el-card style="--el-card-padding: 0" shadow="never">
<div
class="flex-between"
:class="[inputDisabled ? 'is-disabled' : '']"
style="
padding: 0 8px 0 8px;
display: flex;
justify-content: space-between;
align-items: center;
align-content: center;
"
style="padding: 0 8px 0 8px"
>
<el-tooltip class="box-item" effect="dark" :content="file.name" placement="top-start">
<div style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 40%">
<div class="flex align-center" style="width: 70%">
<img :src="getImgUrl(file && file?.name)" alt="" width="24" class="mr-4" />
<span class="ellipsis-1" :title="file.name">
{{ file.name }}
</div></el-tooltip
>
</span>
</div>
<div class="flex align-center">
<div>{{ formatSize(file.size) }}</div>
<div>{{ formatSize(file.size) }}</div>
<el-icon @click="deleteFile(file)" style="cursor: pointer"><DeleteFilled /></el-icon>
<el-button link class="ml-8" @click="deleteFile(file)">
<AppIcon iconName="app-delete"></AppIcon>
</el-button>
</div>
</div>
</el-card>
</template>
@ -39,6 +39,7 @@
import { computed, inject, ref, useAttrs } from 'vue'
import { ElMessage } from 'element-plus'
import type { FormField } from '@/components/dynamics-form/type'
import { getImgUrl } from '@/utils/common'
import { t } from '@/locales'
import { useFormDisabled } from 'element-plus'
const inputDisabled = useFormDisabled()
@ -71,7 +72,7 @@ const deleteFile = (file: any) => {
const model_value = computed({
get: () => {
if (!model_value) {
if (!model_value.value) {
emit('update:modelValue', [])
}
return props.modelValue

View File

@ -235,7 +235,7 @@
{{ $t('common.edit') }}
</el-dropdown-item>
<el-dropdown-item
v-if="!item.template_id && permissionPrecise.copy(item.id)"
v-if="!item.template_id && permissionPrecise.copy(item.id) && item.tool_type!== 'MCP'"
@click.stop="copyTool(item)"
>
<AppIcon iconName="app-copy" class="color-secondary"></AppIcon>
@ -275,7 +275,7 @@
{{ $t('views.shared.authorized_workspace') }}</el-dropdown-item
>
<el-dropdown-item
v-if="!item.template_id && permissionPrecise.export(item.id)"
v-if="!item.template_id && permissionPrecise.export(item.id) && item.tool_type!== 'MCP'"
@click.stop="exportTool(item)"
>
<AppIcon iconName="app-export" class="color-secondary"></AppIcon>