Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-fe
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-fe
Commits
4766c052
Commit
4766c052
authored
Jan 21, 2025
by
nick zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 应用没有添加图片ocr插件,不展示上传图片
parent
7b3a284e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
0 deletions
+37
-0
plugin.ts
src/enums/plugin.ts
+9
-0
footer-operation.vue
...iews/multi-model-dialogue/components/footer-operation.vue
+2
-0
multi-model-dialogue.vue
src/views/multi-model-dialogue/multi-model-dialogue.vue
+6
-0
footer-input.vue
...ts/agent-config/agent-preview/components/footer-input.vue
+6
-0
footer-input.vue
src/views/share/components/footer-input.vue
+2
-0
share-application-mobile.vue
src/views/share/share-application-mobile.vue
+6
-0
share-application-web.vue
src/views/share/share-application-web.vue
+6
-0
No files found.
src/enums/plugin.ts
0 → 100644
View file @
4766c052
export
enum
PluginType
{
IMAGE_OCR
=
'image_ocr'
,
HTML_READER
=
'html_reader'
,
NOTIFICATION_REMINDER
=
'notification_reminder'
,
WEB_SEARCH
=
'web_search'
,
WEIBO_SEARCH_TOP
=
'weibo_search_top'
,
TOUTIAO_SEARCH_TOP
=
'toutiao_search_top'
,
DOUYIN_SEARCH_TOP
=
'douyin_search_top'
,
}
src/views/multi-model-dialogue/components/footer-operation.vue
View file @
4766c052
...
...
@@ -19,6 +19,7 @@ interface Props {
agentId
:
string
isAnswerResponseWait
:
boolean
isEnableDocumentParse
:
boolean
isEnableUploadImage
:
boolean
}
const
props
=
defineProps
<
Props
>
()
...
...
@@ -282,6 +283,7 @@ function handleSelectUploadImage(cb: () => void) {
<n-popover
style=
"width: 210px"
trigger=
"hover"
>
<
template
#
trigger
>
<div
v-show=
"isEnableUploadImage"
class=
"border-inactive-border-color text-font-color hover:text-theme-color flex h-[54px] w-[54px] shrink-0 cursor-pointer items-center justify-center rounded-full border bg-white"
@
click=
"handleSelectUploadImage(handleClick)"
>
...
...
src/views/multi-model-dialogue/multi-model-dialogue.vue
View file @
4766c052
...
...
@@ -20,6 +20,7 @@ import { PersonalAppConfigState } from '@/store/types/personal-app-config'
import
{
defaultPersonalAppConfigState
}
from
'@/store/modules/personal-app-config'
import
{
useThrottleFn
}
from
'@vueuse/core'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
PluginType
}
from
'@/enums/plugin'
const
{
t
}
=
useI18n
()
...
...
@@ -49,6 +50,10 @@ const isEnableDocumentParse = computed(() => {
return
agentApplicationConfig
.
value
.
knowledgeConfig
.
isDocumentParsing
===
'Y'
})
const
isEnableUploadImage
=
computed
(()
=>
{
return
agentApplicationConfig
.
value
.
unitIds
.
includes
(
PluginType
.
IMAGE_OCR
)
})
onMounted
(
async
()
=>
{
if
(
!
currentRoute
.
params
.
agentId
)
{
window
.
$message
.
warning
(
t
(
'multi_model_dialogue_module.not_find_agent'
))
...
...
@@ -332,6 +337,7 @@ function handleBlockMessageResponse() {
:agent-id=
"agentId"
:is-answer-response-wait=
"isAnswerResponseWait"
:is-enable-document-parse=
"isEnableDocumentParse"
:is-enable-upload-image=
"isEnableUploadImage"
@
add-question-message-item=
"handleAddQuestionMessageItem"
@
add-answer-message-item=
"handleAddAnswerMessageItem"
@
update-message-item=
"handleUpdateSpecifyMessageItem"
...
...
src/views/personal-space/personal-app-setting/components/agent-config/agent-preview/components/footer-input.vue
View file @
4766c052
...
...
@@ -14,6 +14,7 @@ import WebSocketCtr from '@/utils/web-socket-ctr'
import
{
ChannelType
}
from
'@/enums/channel'
import
{
useUserStore
}
from
'@/store/modules/user'
import
{
useUploadImage
}
from
'@/composables/useUploadImage'
import
{
PluginType
}
from
'@/enums/plugin'
interface
Props
{
messageList
:
Map
<
string
,
ConversationMessageItem
>
...
...
@@ -99,6 +100,10 @@ const isUploadFileDisabled = computed(() => {
return
uploadFileList
.
value
.
length
===
1
})
const
isEnableUploadImage
=
computed
(()
=>
{
return
personalAppConfigStore
.
unitIds
.
includes
(
PluginType
.
IMAGE_OCR
)
})
const
uploadFileIcon
=
(
type
:
string
)
=>
{
return
`https://gsst-poe-sit.gz.bcebos.com/icon/
${
type
}
.svg`
}
...
...
@@ -595,6 +600,7 @@ defineExpose({
<n-popover
style=
"width: 210px"
trigger=
"hover"
>
<
template
#
trigger
>
<div
v-show=
"isEnableUploadImage"
class=
"h-7.5 w-7.5 hover:text-theme-color text-font-color mb-1 flex cursor-pointer items-center justify-center rounded-full bg-white"
@
click=
"handleSelectImage(handleClick)"
>
...
...
src/views/share/components/footer-input.vue
View file @
4766c052
...
...
@@ -21,6 +21,7 @@ interface Props {
messageList
:
Map
<
string
,
ConversationMessageItem
>
continuousQuestionStatus
:
'default'
|
'close'
isEnableDocumentParse
:
boolean
isEnableUploadImage
:
boolean
isEnableVoice
:
boolean
answerAudioAutoPlay
:
boolean
answerAudioPlaying
:
boolean
...
...
@@ -585,6 +586,7 @@ defineExpose({
<n-popover
style=
"width: 210px"
trigger=
"hover"
>
<
template
#
trigger
>
<div
v-show=
"isEnableDocumentParse"
class=
"h-7.5 w-7.5 hover:text-theme-color text-font-color mb-1 flex cursor-pointer items-center justify-center rounded-full bg-white"
@
click=
"handleSelectImage(handleClick)"
>
...
...
src/views/share/share-application-mobile.vue
View file @
4766c052
...
...
@@ -20,6 +20,7 @@ import {
}
from
'@/apis/agent-application'
import
{
useLayoutConfig
}
from
'@/composables/useLayoutConfig'
import
{
validBrowser
}
from
'@/utils/browser-detection'
import
{
PluginType
}
from
'@/enums/plugin'
const
{
t
}
=
useI18n
()
...
...
@@ -55,6 +56,10 @@ const isEnableDocumentParse = computed(() => {
return
agentApplicationConfig
.
value
.
knowledgeConfig
.
isDocumentParsing
===
'Y'
})
const
isEnableUploadImage
=
computed
(()
=>
{
return
agentApplicationConfig
.
value
.
unitIds
.
includes
(
PluginType
.
IMAGE_OCR
)
})
const
isEnableVoice
=
computed
(()
=>
{
return
!!
agentApplicationConfig
.
value
.
voiceConfig
.
timbreId
})
...
...
@@ -341,6 +346,7 @@ function handleAudioPause(isClearMessageList = false) {
:agent-id=
"agentApplicationConfig.baseInfo.agentId"
:continuous-question-status=
"continuousQuestionStatus"
:is-enable-document-parse=
"isEnableDocumentParse"
:is-enable-upload-image=
"isEnableUploadImage"
:is-enable-voice=
"isEnableVoice"
:answer-audio-auto-play=
"answerAudioAutoPlay"
:answer-audio-playing=
"answerAudioPlaying"
...
...
src/views/share/share-application-web.vue
View file @
4766c052
...
...
@@ -22,6 +22,7 @@ import { useLayoutConfig } from '@/composables/useLayoutConfig'
import
{
fetchGetMemberInfoById
}
from
'@/apis/user'
import
{
UserInfo
}
from
'@/store/types/user'
import
{
validBrowser
}
from
'@/utils/browser-detection'
import
{
PluginType
}
from
'@/enums/plugin'
const
{
t
}
=
useI18n
()
...
...
@@ -58,6 +59,10 @@ const isEnableDocumentParse = computed(() => {
return
agentApplicationConfig
.
value
.
knowledgeConfig
.
isDocumentParsing
===
'Y'
})
const
isEnableUploadImage
=
computed
(()
=>
{
return
agentApplicationConfig
.
value
.
unitIds
.
includes
(
PluginType
.
IMAGE_OCR
)
})
const
isEnableVoice
=
computed
(()
=>
{
return
!!
agentApplicationConfig
.
value
.
voiceConfig
.
timbreId
})
...
...
@@ -364,6 +369,7 @@ function handleAudioPause(isClearMessageList = false) {
:agent-id=
"agentApplicationConfig.baseInfo.agentId"
:continuous-question-status=
"continuousQuestionStatus"
:is-enable-document-parse=
"isEnableDocumentParse"
:is-enable-upload-image=
"isEnableUploadImage"
:is-enable-voice=
"isEnableVoice"
:answer-audio-auto-play=
"answerAudioAutoPlay"
:answer-audio-playing=
"answerAudioPlaying"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment