Commit 3ed509bd authored by nick zheng's avatar nick zheng

fix: 首页模型未开启上传文件或图片,不展示其按钮

parent 8b7fedb8
......@@ -12,6 +12,7 @@ import { ChannelType } from '@/enums/channel'
import { UploadStatus } from '@/enums/upload-status'
import { useUploadImage } from '@/composables/useUploadImage'
import { useSystemLanguageStore } from '@/store/modules/system-language'
import { PluginType } from '@/enums/plugin'
interface Props {
currentSessionId: string
......@@ -73,6 +74,8 @@ const isHasUploadImage = computed(() => {
const isEnglishLanguage = computed(() => systemLanguageStore.currentLanguageInfo.key === 'en')
const isEnableUploadImage = computed(() => currentAgentApplication.value.unitIds.includes(PluginType.IMAGE_OCR))
;(function () {
getAgentApplicationSelectList()
})()
......@@ -446,6 +449,7 @@ defineExpose({
<n-popover trigger="hover">
<template #trigger>
<n-button
v-show="currentAgentApplication.isDocumentParsing === 'Y'"
class="application-select-btn !mr-[14px] !h-[34px] !rounded-[10px] !p-0"
@click="handleFileUploadPopup"
>
......@@ -464,7 +468,14 @@ defineExpose({
class="mr-[5px] h-[18px] w-[18px] bg-[url('https://gsst-poe-sit.gz.bcebos.com/icon/doc.svg')] bg-contain bg-no-repeat"
></div>
<div class="text-[14px]" :class="isEnglishLanguage ? 'w-[110px]' : 'w-[210px]'">
<div
class="text-[14px]"
:class="{
'w-[110px]': isEnglishLanguage && isEnableUploadImage,
'w-[210px]': !isEnglishLanguage && isEnableUploadImage,
'w-[260px]': !isEnableUploadImage,
}"
>
<n-ellipsis :tooltip="{ width: 400 }">
{{ currentInputFileInfo.fileName }}
</n-ellipsis>
......@@ -507,6 +518,7 @@ defineExpose({
<n-popover style="width: 210px" trigger="hover">
<template #trigger>
<n-button
v-show="isEnableUploadImage"
class="upload-image-btn !mr-[14px] !h-[34px] !rounded-[10px] !p-0"
@click="handleSelectImage(handleClick)"
>
......
......@@ -31,6 +31,8 @@ const currentAgentApplication = ref<AgentApplicationRecordItem>({
creator: '',
publishedTime: '',
points: 0,
isDocumentParsing: 'N',
unitIds: [],
})
const currentSessionId = ref('')
......
......@@ -6,6 +6,8 @@ export interface AgentApplicationRecordItem {
creator: string
publishedTime: string
points: number
isDocumentParsing: 'Y' | 'N'
unitIds: string[]
}
export interface MessageItemInterface {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment