perf: Optimize the folder to enter the second level page and retain records and the first conversation does not display the previous record (#3917)

v3.2
wangdan-fit2cloud 2025-08-22 16:27:13 +08:00 committed by GitHub
parent 600cd73d2d
commit 1f5544b13e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 232 additions and 116 deletions

View File

@ -11,7 +11,7 @@
> >
<el-button type="primary">{{ $t('chat.uploadFile.label') }}</el-button> <el-button type="primary">{{ $t('chat.uploadFile.label') }}</el-button>
<template #file="{ file }"> <template #file="{ file }">
<el-card style="--el-card-padding: 0" shadow="never"> <el-card style="--el-card-padding: 0" shadow="never" class="upload_content">
<div <div
class="flex-between" class="flex-between"
:class="[inputDisabled ? 'is-disabled' : '']" :class="[inputDisabled ? 'is-disabled' : '']"
@ -112,13 +112,15 @@ const uploadFile = async (file: any, fileList: Array<any>) => {
}) })
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.is-disabled { .upload_content {
background-color: var(--el-fill-color-light); .is-disabled {
color: var(--el-text-color-placeholder); background-color: var(--el-fill-color-light);
cursor: not-allowed; color: var(--el-text-color-placeholder);
&:hover {
cursor: not-allowed; cursor: not-allowed;
&:hover {
cursor: not-allowed;
}
} }
} }
</style> </style>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="breadcrumb ml-4 mt-4 mb-12 flex"> <div class="breadcrumb ml-4 mt-4 mb-12 flex">
<back-button :to="toBackPath" class="mt-4"></back-button> <back-button @click="toBack"></back-button>
<div class="flex align-center"> <div class="flex align-center">
<el-avatar <el-avatar
v-if="isApplication" v-if="isApplication"
@ -30,8 +30,9 @@ import { onBeforeRouteLeave, useRouter, useRoute } from 'vue-router'
import { resetUrl } from '@/utils/common' import { resetUrl } from '@/utils/common'
import { loadSharedApi } from '@/utils/dynamics-api/shared-api' import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
import useStore from '@/stores' import useStore from '@/stores'
const { common, application } = useStore() const { common, folder } = useStore()
const route = useRoute() const route = useRoute()
const router = useRouter()
const { const {
meta: { activeMenu }, meta: { activeMenu },
@ -104,6 +105,20 @@ function getApplicationDetail() {
}) })
} }
function toBack() {
if (isKnowledge.value) {
folder.setCurrentFolder({
id: folderId,
})
} else if (isApplication.value) {
folder.setCurrentFolder({
id: current.value.folder,
})
}
router.push({ path: toBackPath.value })
}
onMounted(() => { onMounted(() => {
if (isKnowledge.value) { if (isKnowledge.value) {
getKnowledgeDetail() getKnowledgeDetail()

View File

@ -3,8 +3,13 @@
<template #left> <template #left>
<h4 class="p-12-16 pb-0 mt-12">{{ $t('views.application.title') }}</h4> <h4 class="p-12-16 pb-0 mt-12">{{ $t('views.application.title') }}</h4>
<div class="p-8"> <div class="p-8">
<folder-tree :source="SourceTypeEnum.APPLICATION" :data="folderList" :currentNodeKey="folder.currentFolder?.id" <folder-tree
@handleNodeClick="folderClickHandle" @refreshTree="refreshFolder" /> :source="SourceTypeEnum.APPLICATION"
:data="folderList"
:currentNodeKey="folder.currentFolder?.id"
@handleNodeClick="folderClickHandle"
@refreshTree="refreshFolder"
/>
</div> </div>
</template> </template>
<ContentContainer> <ContentContainer>
@ -14,22 +19,44 @@
<template #search> <template #search>
<div class="flex"> <div class="flex">
<div class="flex-between complex-search"> <div class="flex-between complex-search">
<el-select class="complex-search__left" v-model="search_type" style="width: 120px" <el-select
@change="search_type_change"> class="complex-search__left"
v-model="search_type"
style="width: 120px"
@change="search_type_change"
>
<el-option :label="$t('common.creator')" value="create_user" /> <el-option :label="$t('common.creator')" value="create_user" />
<el-option :label="$t('common.name')" value="name" /> <el-option :label="$t('common.name')" value="name" />
<el-option :label="$t('common.publishStatus')" value="publish_status" /> <el-option :label="$t('common.publishStatus')" value="publish_status" />
</el-select> </el-select>
<el-input v-if="search_type === 'name'" v-model="search_form.name" @change="searchHandle" <el-input
:placeholder="$t('common.searchBar.placeholder')" style="width: 220px" clearable /> v-if="search_type === 'name'"
<el-select v-else-if="search_type === 'create_user'" v-model="search_form.create_user" v-model="search_form.name"
@change="searchHandle" filterable clearable style="width: 220px"> @change="searchHandle"
:placeholder="$t('common.searchBar.placeholder')"
style="width: 220px"
clearable
/>
<el-select
v-else-if="search_type === 'create_user'"
v-model="search_form.create_user"
@change="searchHandle"
filterable
clearable
style="width: 220px"
>
<el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.nick_name" /> <el-option v-for="u in user_options" :key="u.id" :value="u.id" :label="u.nick_name" />
</el-select> </el-select>
<el-select v-else-if="search_type === 'publish_status'" v-model="search_form.publish_status" <el-select
@change="searchHandle" filterable clearable style="width: 220px"> v-else-if="search_type === 'publish_status'"
v-model="search_form.publish_status"
@change="searchHandle"
filterable
clearable
style="width: 220px"
>
<el-option :label="$t('common.published')" value="published" /> <el-option :label="$t('common.published')" value="published" />
<el-option :label="$t('common.unpublished')" value="unpublished" /> <el-option :label="$t('common.unpublished')" value="unpublished" />
</el-select> </el-select>
@ -46,11 +73,16 @@
<el-dropdown-item @click="openCreateDialog('SIMPLE')"> <el-dropdown-item @click="openCreateDialog('SIMPLE')">
<div class="flex"> <div class="flex">
<el-avatar shape="square" class="avatar-blue mt-4" :size="36"> <el-avatar shape="square" class="avatar-blue mt-4" :size="36">
<img src="@/assets/application/icon_simple_application.svg" style="width: 65%" alt="" /> <img
src="@/assets/application/icon_simple_application.svg"
style="width: 65%"
alt=""
/>
</el-avatar> </el-avatar>
<div class="pre-wrap ml-8"> <div class="pre-wrap ml-8">
<div class="lighter">{{ $t('views.application.simple') }}</div> <div class="lighter">{{ $t('views.application.simple') }}</div>
<el-text type="info" size="small">{{ $t('views.application.simplePlaceholder') }} <el-text type="info" size="small"
>{{ $t('views.application.simplePlaceholder') }}
</el-text> </el-text>
</div> </div>
</div> </div>
@ -58,18 +90,31 @@
<el-dropdown-item @click="openCreateDialog('WORK_FLOW')"> <el-dropdown-item @click="openCreateDialog('WORK_FLOW')">
<div class="flex"> <div class="flex">
<el-avatar shape="square" class="avatar-purple mt-4" :size="36"> <el-avatar shape="square" class="avatar-purple mt-4" :size="36">
<img src="@/assets/application/icon_workflow_application.svg" style="width: 65%" alt="" /> <img
src="@/assets/application/icon_workflow_application.svg"
style="width: 65%"
alt=""
/>
</el-avatar> </el-avatar>
<div class="pre-wrap ml-8"> <div class="pre-wrap ml-8">
<div class="lighter">{{ $t('views.application.workflow') }}</div> <div class="lighter">{{ $t('views.application.workflow') }}</div>
<el-text type="info" size="small">{{ $t('views.application.workflowPlaceholder') }} <el-text type="info" size="small"
>{{ $t('views.application.workflowPlaceholder') }}
</el-text> </el-text>
</div> </div>
</div> </div>
</el-dropdown-item> </el-dropdown-item>
<el-upload class="import-button" ref="elUploadRef" :file-list="[]" action="#" multiple <el-upload
:auto-upload="false" :show-file-list="false" :limit="1" class="import-button"
:on-change="(file: any, fileList: any) => importApplication(file)"> ref="elUploadRef"
:file-list="[]"
action="#"
multiple
:auto-upload="false"
:show-file-list="false"
:limit="1"
:on-change="(file: any, fileList: any) => importApplication(file)"
>
<el-dropdown-item> <el-dropdown-item>
<div class="flex align-center w-full"> <div class="flex align-center w-full">
<el-avatar shape="square" class="mt-4" :size="36" style="background: none"> <el-avatar shape="square" class="mt-4" :size="36" style="background: none">
@ -96,16 +141,35 @@
</el-dropdown> </el-dropdown>
</div> </div>
</template> </template>
<div v-loading.fullscreen.lock="paginationConfig.current_page === 1 && loading" <div
style="max-height: calc(100vh - 120px)"> v-loading.fullscreen.lock="paginationConfig.current_page === 1 && loading"
<InfiniteScroll :size="applicationList.length" :total="paginationConfig.total" style="max-height: calc(100vh - 120px)"
:page_size="paginationConfig.page_size" v-model:current_page="paginationConfig.current_page" @load="getList" >
:loading="loading"> <InfiniteScroll
:size="applicationList.length"
:total="paginationConfig.total"
:page_size="paginationConfig.page_size"
v-model:current_page="paginationConfig.current_page"
@load="getList"
:loading="loading"
>
<el-row v-if="applicationList.length > 0" :gutter="15" class="w-full"> <el-row v-if="applicationList.length > 0" :gutter="15" class="w-full">
<template v-for="(item, index) in applicationList" :key="index"> <template v-for="(item, index) in applicationList" :key="index">
<el-col v-if="item.resource_type === 'folder'" :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="mb-16"> <el-col
<CardBox :title="item.name" :description="item.desc || $t('components.noDesc')" class="cursor" v-if="item.resource_type === 'folder'"
@click="clickFolder(item)"> :xs="24"
:sm="12"
:md="12"
:lg="8"
:xl="6"
class="mb-16"
>
<CardBox
:title="item.name"
:description="item.desc || $t('components.noDesc')"
class="cursor"
@click="clickFolder(item)"
>
<template #icon> <template #icon>
<el-avatar shape="square" :size="32" style="background: none"> <el-avatar shape="square" :size="32" style="background: none">
<AppIcon iconName="app-folder" style="font-size: 32px"></AppIcon> <AppIcon iconName="app-folder" style="font-size: 32px"></AppIcon>
@ -119,7 +183,12 @@
</CardBox> </CardBox>
</el-col> </el-col>
<el-col v-else :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="mb-16"> <el-col v-else :xs="24" :sm="12" :md="12" :lg="8" :xl="6" class="mb-16">
<CardBox :title="item.name" :description="item.desc" class="cursor" @click="goApp(item)"> <CardBox
:title="item.name"
:description="item.desc"
class="cursor"
@click="goApp(item)"
>
<template #icon> <template #icon>
<el-avatar shape="square" :size="32" style="background: none"> <el-avatar shape="square" :size="32" style="background: none">
<img :src="resetUrl(item?.icon, resetUrl('./favicon.ico'))" alt="" /> <img :src="resetUrl(item?.icon, resetUrl('./favicon.ico'))" alt="" />
@ -173,33 +242,51 @@
<AppIcon iconName="app-create-chat" class="color-secondary"></AppIcon> <AppIcon iconName="app-create-chat" class="color-secondary"></AppIcon>
{{ $t('views.application.operation.toChat') }} {{ $t('views.application.operation.toChat') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.stop="settingApplication(item)" <el-dropdown-item
v-if="permissionPrecise.edit(item.id)"> @click.stop="settingApplication(item)"
v-if="permissionPrecise.edit(item.id)"
>
<AppIcon iconName="app-setting" class="color-secondary"></AppIcon> <AppIcon iconName="app-setting" class="color-secondary"></AppIcon>
{{ $t('common.setting') }} {{ $t('common.setting') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.stop="openAuthorization(item)" <el-dropdown-item
v-if="permissionPrecise.auth(item.id)"> @click.stop="openAuthorization(item)"
<AppIcon iconName="app-resource-authorization" class="color-secondary"></AppIcon> v-if="permissionPrecise.auth(item.id)"
>
<AppIcon
iconName="app-resource-authorization"
class="color-secondary"
></AppIcon>
{{ $t('views.system.resourceAuthorization.title') }} {{ $t('views.system.resourceAuthorization.title') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click.stop="openMoveToDialog(item)" <el-dropdown-item
v-if="permissionPrecise.edit(item.id) && apiType === 'workspace'"> @click.stop="openMoveToDialog(item)"
v-if="permissionPrecise.edit(item.id) && apiType === 'workspace'"
>
<AppIcon iconName="app-migrate" class="color-secondary"></AppIcon> <AppIcon iconName="app-migrate" class="color-secondary"></AppIcon>
{{ $t('common.moveTo') }} {{ $t('common.moveTo') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item @click="copyApplication(item)" v-if="permissionPrecise.create()"> <el-dropdown-item
@click="copyApplication(item)"
v-if="permissionPrecise.create()"
>
<AppIcon iconName="app-copy" class="color-secondary"></AppIcon> <AppIcon iconName="app-copy" class="color-secondary"></AppIcon>
{{ $t('common.copy') }} {{ $t('common.copy') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided @click.stop="exportApplication(item)" <el-dropdown-item
v-if="permissionPrecise.export(item.id)"> divided
@click.stop="exportApplication(item)"
v-if="permissionPrecise.export(item.id)"
>
<AppIcon iconName="app-export" class="color-secondary"></AppIcon> <AppIcon iconName="app-export" class="color-secondary"></AppIcon>
{{ $t('common.export') }} {{ $t('common.export') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item divided @click.stop="deleteApplication(item)" <el-dropdown-item
v-if="permissionPrecise.delete(item.id)"> divided
@click.stop="deleteApplication(item)"
v-if="permissionPrecise.delete(item.id)"
>
<AppIcon iconName="app-delete" class="color-secondary"></AppIcon> <AppIcon iconName="app-delete" class="color-secondary"></AppIcon>
{{ $t('common.delete') }} {{ $t('common.delete') }}
</el-dropdown-item> </el-dropdown-item>
@ -219,9 +306,16 @@
<CreateApplicationDialog ref="CreateApplicationDialogRef" /> <CreateApplicationDialog ref="CreateApplicationDialogRef" />
<CopyApplicationDialog ref="CopyApplicationDialogRef" /> <CopyApplicationDialog ref="CopyApplicationDialogRef" />
<CreateFolderDialog ref="CreateFolderDialogRef" @refresh="refreshFolder" /> <CreateFolderDialog ref="CreateFolderDialogRef" @refresh="refreshFolder" />
<MoveToDialog ref="MoveToDialogRef" :source="SourceTypeEnum.APPLICATION" @refresh="refreshApplicationList" <MoveToDialog
v-if="apiType === 'workspace'" /> ref="MoveToDialogRef"
<ResourceAuthorizationDrawer :type="SourceTypeEnum.APPLICATION" ref="ResourceAuthorizationDrawerRef" /> :source="SourceTypeEnum.APPLICATION"
@refresh="refreshApplicationList"
v-if="apiType === 'workspace'"
/>
<ResourceAuthorizationDrawer
:type="SourceTypeEnum.APPLICATION"
ref="ResourceAuthorizationDrawerRef"
/>
</LayoutContainer> </LayoutContainer>
</template> </template>
@ -248,7 +342,6 @@ import { ComplexPermission } from '@/utils/permission/type'
import { EditionConst, PermissionConst, RoleConst } from '@/utils/permission/data' import { EditionConst, PermissionConst, RoleConst } from '@/utils/permission/data'
const router = useRouter() const router = useRouter()
const route = useRoute()
const apiType = computed<'workspace'>(() => { const apiType = computed<'workspace'>(() => {
return 'workspace' return 'workspace'
@ -257,7 +350,7 @@ const permissionPrecise = computed(() => {
return permissionMap['application'][apiType.value] return permissionMap['application'][apiType.value]
}) })
const { folder, application, user, common } = useStore() const { folder, application, user } = useStore()
const loading = ref(false) const loading = ref(false)
@ -444,20 +537,20 @@ function toChat(row: any) {
.map((v: any) => { .map((v: any) => {
apiInputParams.value = v.properties.api_input_field_list apiInputParams.value = v.properties.api_input_field_list
? v.properties.api_input_field_list.map((v: any) => { ? v.properties.api_input_field_list.map((v: any) => {
return { return {
name: v.variable, name: v.variable,
value: v.default_value, value: v.default_value,
} }
}) })
: v.properties.input_field_list : v.properties.input_field_list
? v.properties.input_field_list ? v.properties.input_field_list
.filter((v: any) => v.assignment_method === 'api_input') .filter((v: any) => v.assignment_method === 'api_input')
.map((v: any) => { .map((v: any) => {
return { return {
name: v.variable, name: v.variable,
value: v.default_value, value: v.default_value,
} }
}) })
: [] : []
}) })
const apiParams = mapToUrlParams(apiInputParams.value) const apiParams = mapToUrlParams(apiInputParams.value)
@ -499,7 +592,6 @@ function settingApplication(row: any) {
function deleteApplication(row: any) { function deleteApplication(row: any) {
MsgConfirm( MsgConfirm(
// @ts-ignore
`${t('views.application.delete.confirmTitle')}${row.name} ?`, `${t('views.application.delete.confirmTitle')}${row.name} ?`,
t('views.application.delete.confirmMessage'), t('views.application.delete.confirmMessage'),
{ {
@ -515,7 +607,7 @@ function deleteApplication(row: any) {
MsgSuccess(t('common.deleteSuccess')) MsgSuccess(t('common.deleteSuccess'))
}) })
}) })
.catch(() => { }) .catch(() => {})
} }
const exportApplication = (application: any) => { const exportApplication = (application: any) => {
@ -617,7 +709,7 @@ function getList() {
} }
onMounted(() => { onMounted(() => {
getFolder(true) getFolder(folder.currentFolder?.id ? false : true)
WorkspaceApi.getAllMemberList(user.getWorkspaceId(), loading).then((res) => { WorkspaceApi.getAllMemberList(user.getWorkspaceId(), loading).then((res) => {
user_options.value = res.data user_options.value = res.data
}) })

View File

@ -176,7 +176,7 @@ function newChat() {
show.value = false show.value = false
} }
function getChatLog(id: string) { function getChatLog(refresh?: boolean) {
const page = { const page = {
current_page: 1, current_page: 1,
page_size: 20, page_size: 20,
@ -184,12 +184,11 @@ function getChatLog(id: string) {
chatAPI.pageChat(page.current_page, page.page_size, left_loading).then((res: any) => { chatAPI.pageChat(page.current_page, page.page_size, left_loading).then((res: any) => {
chatLogData.value = res.data.records chatLogData.value = res.data.records
paginationConfig.current_page = 1 if (!refresh) {
paginationConfig.total = 0 paginationConfig.current_page = 1
currentRecordList.value = [] paginationConfig.total = 0
currentChatId.value = chatLogData.value?.[0]?.id || 'new' currentRecordList.value = []
if (currentChatId.value !== 'new') { currentChatId.value = 'new'
getChatRecord()
} }
}) })
} }
@ -241,14 +240,14 @@ function refreshFieldTitle(chatId: string, abstract: string) {
} }
function refresh(id: string) { function refresh(id: string) {
getChatLog(applicationDetail.value.id)
currentChatId.value = id currentChatId.value = id
getChatLog(true)
} }
/** /**
*初始化历史对话记录 *初始化历史对话记录
*/ */
const init = () => { const init = () => {
getChatLog(applicationDetail.value.id) getChatLog()
} }
onMounted(() => { onMounted(() => {

View File

@ -182,7 +182,7 @@ function newChat() {
show.value = false show.value = false
} }
function getChatLog(id: string) { function getChatLog(refresh?: boolean) {
const page = { const page = {
current_page: 1, current_page: 1,
page_size: 20, page_size: 20,
@ -190,12 +190,11 @@ function getChatLog(id: string) {
chatAPI.pageChat(page.current_page, page.page_size, left_loading).then((res: any) => { chatAPI.pageChat(page.current_page, page.page_size, left_loading).then((res: any) => {
chatLogData.value = res.data.records chatLogData.value = res.data.records
paginationConfig.current_page = 1 if (!refresh) {
paginationConfig.total = 0 paginationConfig.current_page = 1
currentRecordList.value = [] paginationConfig.total = 0
currentChatId.value = chatLogData.value?.[0]?.id || 'new' currentRecordList.value = []
if (currentChatId.value !== 'new') { currentChatId.value = 'new'
getChatRecord()
} }
}) })
} }
@ -247,14 +246,14 @@ function refreshFieldTitle(chatId: string, abstract: string) {
} }
function refresh(id: string) { function refresh(id: string) {
getChatLog(applicationDetail.value.id)
currentChatId.value = id currentChatId.value = id
getChatLog(true)
} }
/** /**
*初始化历史对话记录 *初始化历史对话记录
*/ */
const init = () => { const init = () => {
getChatLog(applicationDetail.value.id) getChatLog()
} }
onMounted(() => { onMounted(() => {

View File

@ -324,7 +324,7 @@ function deleteLog(row: any) {
paginationConfig.value.total = 0 paginationConfig.value.total = 0
currentRecordList.value = [] currentRecordList.value = []
} }
getChatLog(applicationDetail.value.id) getChatLog()
}) })
} }
@ -335,7 +335,7 @@ function clearChat() {
paginationConfig.value.current_page = 1 paginationConfig.value.current_page = 1
paginationConfig.value.total = 0 paginationConfig.value.total = 0
currentRecordList.value = [] currentRecordList.value = []
getChatLog(applicationDetail.value.id) getChatLog()
}) })
} }
@ -372,7 +372,7 @@ function newChat() {
} }
} }
function getChatLog(id: string, refresh?: boolean) { function getChatLog(refresh?: boolean) {
const page = { const page = {
current_page: 1, current_page: 1,
page_size: 20, page_size: 20,
@ -386,11 +386,8 @@ function getChatLog(id: string, refresh?: boolean) {
paginationConfig.value.current_page = 1 paginationConfig.value.current_page = 1
paginationConfig.value.total = 0 paginationConfig.value.total = 0
currentRecordList.value = [] currentRecordList.value = []
currentChatId.value = chatLogData.value?.[0]?.id || 'new' currentChatId.value = 'new'
currentChatName.value = chatLogData.value?.[0]?.abstract || t('chat.createChat') currentChatName.value = t('chat.createChat')
if (currentChatId.value !== 'new') {
getChatRecord()
}
} }
}) })
} }
@ -449,7 +446,7 @@ const clickListHandle = (item: any) => {
function refresh(id: string) { function refresh(id: string) {
currentChatId.value = id currentChatId.value = id
getChatLog(applicationDetail.value.id, true) getChatLog(true)
} }
async function exportMarkdown(): Promise<void> { async function exportMarkdown(): Promise<void> {
@ -477,7 +474,7 @@ async function exportHTML(): Promise<void> {
*初始化历史对话记录 *初始化历史对话记录
*/ */
const init = () => { const init = () => {
getChatLog(applicationDetail.value?.id) getChatLog()
} }
onMounted(() => { onMounted(() => {
init() init()

View File

@ -74,7 +74,7 @@ function refreshFolder() {
} }
onMounted(() => { onMounted(() => {
getFolder(true) getFolder(folder.currentFolder?.id ? false : true)
}) })
</script> </script>

View File

@ -81,9 +81,7 @@
<!--  应用 icon --> <!--  应用 icon -->
<LogoIcon v-else-if="isApplication" height="20px" /> <LogoIcon v-else-if="isApplication" height="20px" />
<!-- 工具 icon --> <!-- 工具 icon -->
<el-avatar v-else-if="isTool" class="avatar-green" shape="square" :size="20"> <ToolIcon v-else-if="isTool" :size="20" :type="row?.tool_type" />
<img src="@/assets/workflow/icon_tool.svg" style="width: 58%" alt="" />
</el-avatar>
<!-- 模型 icon --> <!-- 模型 icon -->
<span <span
v-else-if="isModel" v-else-if="isModel"

View File

@ -89,7 +89,7 @@ function refreshFolder() {
} }
onMounted(() => { onMounted(() => {
getFolder(true) getFolder(folder.currentFolder?.id ? false : true)
}) })
</script> </script>

View File

@ -130,16 +130,24 @@
<el-switch size="small" v-model="chat_data.mcp_enable" /> <el-switch size="small" v-model="chat_data.mcp_enable" />
</div> </div>
</div> </div>
<div class="w-full" v-if=" <div
(chat_data.mcp_tool_id) || class="w-full mb-16"
(chat_data.mcp_servers && chat_data.mcp_servers.length > 0)" v-if="
chat_data.mcp_tool_id || (chat_data.mcp_servers && chat_data.mcp_servers.length > 0)
"
> >
<div class="flex-between border border-r-6 white-bg mb-4" style="padding: 5px 8px"> <div class="flex-between border border-r-6 white-bg mb-4" style="padding: 5px 8px">
<div class="flex align-center" style="line-height: 20px"> <div class="flex align-center" style="line-height: 20px">
<ToolIcon type="MCP" class="mr-8" :size="20" /> <ToolIcon type="MCP" class="mr-8" :size="20" />
<div class="ellipsis" :title="relatedObject(toolSelectOptions, chat_data.mcp_tool_id, 'id')?.name"> <div
{{ relatedObject(mcpToolSelectOptions, chat_data.mcp_tool_id, 'id')?.name || $t('common.custom') + ' MCP' }} class="ellipsis"
:title="relatedObject(toolSelectOptions, chat_data.mcp_tool_id, 'id')?.name"
>
{{
relatedObject(mcpToolSelectOptions, chat_data.mcp_tool_id, 'id')?.name ||
$t('common.custom') + ' MCP'
}}
</div> </div>
</div> </div>
<el-button text @click="chat_data.mcp_tool_id = ''"> <el-button text @click="chat_data.mcp_tool_id = ''">
@ -163,7 +171,7 @@
<el-switch size="small" v-model="chat_data.tool_enable" /> <el-switch size="small" v-model="chat_data.tool_enable" />
</div> </div>
</div> </div>
<div class="w-full" v-if="chat_data.tool_ids?.length > 0"> <div class="w-full mb-16" v-if="chat_data.tool_ids?.length > 0">
<template v-for="(item, index) in chat_data.tool_ids" :key="index"> <template v-for="(item, index) in chat_data.tool_ids" :key="index">
<div class="flex-between border border-r-6 white-bg mb-4" style="padding: 5px 8px"> <div class="flex-between border border-r-6 white-bg mb-4" style="padding: 5px 8px">
<div class="flex align-center" style="line-height: 20px"> <div class="flex align-center" style="line-height: 20px">
@ -186,17 +194,23 @@
<div> <div>
<span>{{ $t('views.application.form.reasoningContent.label') }}</span> <span>{{ $t('views.application.form.reasoningContent.label') }}</span>
</div> </div>
<el-button <div>
type="primary" <el-button
link type="primary"
@click="openReasoningParamSettingDialog" link
@refreshForm="refreshParam" @click="openReasoningParamSettingDialog"
> @refreshForm="refreshParam"
<AppIcon iconName="app-setting"></AppIcon> class="mr-4"
</el-button> >
<AppIcon iconName="app-setting"></AppIcon>
</el-button>
<el-switch
size="small"
v-model="chat_data.model_setting.reasoning_content_enable"
/>
</div>
</div> </div>
</template> </template>
<el-switch size="small" v-model="chat_data.model_setting.reasoning_content_enable" />
</el-form-item> </el-form-item>
<el-form-item @click.prevent> <el-form-item @click.prevent>
<template #label> <template #label>
@ -241,7 +255,7 @@ import McpServersDialog from '@/views/application/component/McpServersDialog.vue
import { loadSharedApi } from '@/utils/dynamics-api/shared-api' import { loadSharedApi } from '@/utils/dynamics-api/shared-api'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import ToolDialog from '@/views/application/component/ToolDialog.vue' import ToolDialog from '@/views/application/component/ToolDialog.vue'
import {relatedObject} from "@/utils/array.ts"; import { relatedObject } from '@/utils/array.ts'
const getApplicationDetail = inject('getApplicationDetail') as any const getApplicationDetail = inject('getApplicationDetail') as any
const route = useRoute() const route = useRoute()