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

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

parent 8b7fedb8
...@@ -12,6 +12,7 @@ import { ChannelType } from '@/enums/channel' ...@@ -12,6 +12,7 @@ import { ChannelType } from '@/enums/channel'
import { UploadStatus } from '@/enums/upload-status' import { UploadStatus } from '@/enums/upload-status'
import { useUploadImage } from '@/composables/useUploadImage' import { useUploadImage } from '@/composables/useUploadImage'
import { useSystemLanguageStore } from '@/store/modules/system-language' import { useSystemLanguageStore } from '@/store/modules/system-language'
import { PluginType } from '@/enums/plugin'
interface Props { interface Props {
currentSessionId: string currentSessionId: string
...@@ -73,6 +74,8 @@ const isHasUploadImage = computed(() => { ...@@ -73,6 +74,8 @@ const isHasUploadImage = computed(() => {
const isEnglishLanguage = computed(() => systemLanguageStore.currentLanguageInfo.key === 'en') const isEnglishLanguage = computed(() => systemLanguageStore.currentLanguageInfo.key === 'en')
const isEnableUploadImage = computed(() => currentAgentApplication.value.unitIds.includes(PluginType.IMAGE_OCR))
;(function () { ;(function () {
getAgentApplicationSelectList() getAgentApplicationSelectList()
})() })()
...@@ -446,6 +449,7 @@ defineExpose({ ...@@ -446,6 +449,7 @@ defineExpose({
<n-popover trigger="hover"> <n-popover trigger="hover">
<template #trigger> <template #trigger>
<n-button <n-button
v-show="currentAgentApplication.isDocumentParsing === 'Y'"
class="application-select-btn !mr-[14px] !h-[34px] !rounded-[10px] !p-0" class="application-select-btn !mr-[14px] !h-[34px] !rounded-[10px] !p-0"
@click="handleFileUploadPopup" @click="handleFileUploadPopup"
> >
...@@ -464,7 +468,14 @@ defineExpose({ ...@@ -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" 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>
<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 }"> <n-ellipsis :tooltip="{ width: 400 }">
{{ currentInputFileInfo.fileName }} {{ currentInputFileInfo.fileName }}
</n-ellipsis> </n-ellipsis>
...@@ -507,6 +518,7 @@ defineExpose({ ...@@ -507,6 +518,7 @@ defineExpose({
<n-popover style="width: 210px" trigger="hover"> <n-popover style="width: 210px" trigger="hover">
<template #trigger> <template #trigger>
<n-button <n-button
v-show="isEnableUploadImage"
class="upload-image-btn !mr-[14px] !h-[34px] !rounded-[10px] !p-0" class="upload-image-btn !mr-[14px] !h-[34px] !rounded-[10px] !p-0"
@click="handleSelectImage(handleClick)" @click="handleSelectImage(handleClick)"
> >
......
...@@ -31,6 +31,8 @@ const currentAgentApplication = ref<AgentApplicationRecordItem>({ ...@@ -31,6 +31,8 @@ const currentAgentApplication = ref<AgentApplicationRecordItem>({
creator: '', creator: '',
publishedTime: '', publishedTime: '',
points: 0, points: 0,
isDocumentParsing: 'N',
unitIds: [],
}) })
const currentSessionId = ref('') const currentSessionId = ref('')
......
...@@ -6,6 +6,8 @@ export interface AgentApplicationRecordItem { ...@@ -6,6 +6,8 @@ export interface AgentApplicationRecordItem {
creator: string creator: string
publishedTime: string publishedTime: string
points: number points: number
isDocumentParsing: 'Y' | 'N'
unitIds: string[]
} }
export interface MessageItemInterface { 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