feat: chat upload input style (#3898)
Co-authored-by: wangdan-fit2cloud <dan.wang@fit2cloud.com>
This commit is contained in:
parent
faf6f47c97
commit
9d10df5c78
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-upload
|
<el-upload
|
||||||
style="width: 80%"
|
style="width: 100%"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
action="#"
|
action="#"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
@ -10,26 +10,26 @@
|
|||||||
multiple
|
multiple
|
||||||
>
|
>
|
||||||
<el-button type="primary">{{ $t('chat.uploadFile.label') }}</el-button>
|
<el-button type="primary">{{ $t('chat.uploadFile.label') }}</el-button>
|
||||||
<template #file="{ file, index }"
|
<template #file="{ file }">
|
||||||
><el-card style="--el-card-padding: 0" shadow="never">
|
<el-card style="--el-card-padding: 0" shadow="never">
|
||||||
<div
|
<div
|
||||||
|
class="flex-between"
|
||||||
:class="[inputDisabled ? 'is-disabled' : '']"
|
:class="[inputDisabled ? 'is-disabled' : '']"
|
||||||
style="
|
style="padding: 0 8px 0 8px"
|
||||||
padding: 0 8px 0 8px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
align-content: center;
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<el-tooltip class="box-item" effect="dark" :content="file.name" placement="top-start">
|
<div class="flex align-center" style="width: 70%">
|
||||||
<div style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 40%">
|
<img :src="getImgUrl(file && file?.name)" alt="" width="24" class="mr-4" />
|
||||||
|
<span class="ellipsis-1" :title="file.name">
|
||||||
{{ 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-button link class="ml-8" @click="deleteFile(file)">
|
||||||
<el-icon @click="deleteFile(file)" style="cursor: pointer"><DeleteFilled /></el-icon>
|
<AppIcon iconName="app-delete"></AppIcon>
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
@ -39,6 +39,7 @@
|
|||||||
import { computed, inject, ref, useAttrs } from 'vue'
|
import { computed, inject, ref, useAttrs } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import type { FormField } from '@/components/dynamics-form/type'
|
import type { FormField } from '@/components/dynamics-form/type'
|
||||||
|
import { getImgUrl } from '@/utils/common'
|
||||||
import { t } from '@/locales'
|
import { t } from '@/locales'
|
||||||
import { useFormDisabled } from 'element-plus'
|
import { useFormDisabled } from 'element-plus'
|
||||||
const inputDisabled = useFormDisabled()
|
const inputDisabled = useFormDisabled()
|
||||||
@ -71,7 +72,7 @@ const deleteFile = (file: any) => {
|
|||||||
|
|
||||||
const model_value = computed({
|
const model_value = computed({
|
||||||
get: () => {
|
get: () => {
|
||||||
if (!model_value) {
|
if (!model_value.value) {
|
||||||
emit('update:modelValue', [])
|
emit('update:modelValue', [])
|
||||||
}
|
}
|
||||||
return props.modelValue
|
return props.modelValue
|
||||||
|
|||||||
@ -235,7 +235,7 @@
|
|||||||
{{ $t('common.edit') }}
|
{{ $t('common.edit') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<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)"
|
@click.stop="copyTool(item)"
|
||||||
>
|
>
|
||||||
<AppIcon iconName="app-copy" class="color-secondary"></AppIcon>
|
<AppIcon iconName="app-copy" class="color-secondary"></AppIcon>
|
||||||
@ -275,7 +275,7 @@
|
|||||||
{{ $t('views.shared.authorized_workspace') }}</el-dropdown-item
|
{{ $t('views.shared.authorized_workspace') }}</el-dropdown-item
|
||||||
>
|
>
|
||||||
<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)"
|
@click.stop="exportTool(item)"
|
||||||
>
|
>
|
||||||
<AppIcon iconName="app-export" class="color-secondary"></AppIcon>
|
<AppIcon iconName="app-export" class="color-secondary"></AppIcon>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user