Merge remote-tracking branch 'origin/feature/v1.3_主agent_rxd' into test

This commit is contained in:
rd
2025-08-29 15:49:59 +08:00
15 changed files with 94 additions and 68 deletions

View File

@ -11,12 +11,16 @@ import { FILE_TYPE } from '@/components/xt-chat/chat-view/constants';
export default { export default {
emits: ['close'], emits: ['close'],
props: { props: {
rightViewData: { dataSource: {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
previewData: {
type: Object,
default: () => {},
},
}, },
setup(props: { rightViewData: any[] }, { emit, expose }) { setup(props: { dataSource: any[]; previewData: any }, { emit, expose }) {
const bubbleRef = ref(null); const bubbleRef = ref(null);
const md = markdownit({ const md = markdownit({
@ -26,21 +30,15 @@ export default {
typographer: true, typographer: true,
}); });
console.log(props.rightViewData)
const dataSource = computed(() => {
return props.rightViewData.find((v) => v.task_type === '任务管理') ?? {};
});
const tasks = computed(() => { const tasks = computed(() => {
return dataSource.value.payload?.tasks ?? []; return props.previewData.payload?.tasks ?? [];
}); });
const isTaskManage = computed(() => { const isTaskManage = computed(() => {
return dataSource.value.task_type === '任务管理'; return props.previewData.task_type === '任务管理';
}); });
const hasMediaCenter = computed(() => { const hasMediaCenter = computed(() => {
return props.rightViewData.some((v) => v.task_type === '素材中心') return props.dataSource.some((v) => v.task_type === '素材中心');
}); });
const onDownload = () => { const onDownload = () => {
@ -48,10 +46,11 @@ export default {
message.success('下载成功!'); message.success('下载成功!');
}; };
const onAddMediaCenter = () => { const onAddMediaCenter = () => {
const _data = props.dataSource.find((v) => v.task_type === '素材中心');
const { const {
api: { endpoint, method }, api: { endpoint, method },
payload, payload,
} = dataSource.value; } = _data;
Http[method.toLowerCase()]?.(endpoint, payload).then((res) => { Http[method.toLowerCase()]?.(endpoint, payload).then((res) => {
const { code } = res; const { code } = res;
if (code === 200) { if (code === 200) {
@ -60,10 +59,11 @@ export default {
}); });
}; };
const onAddTaskManage = () => { const onAddTaskManage = () => {
const _data = props.dataSource.find((v) => v.task_type === '任务管理');
const { const {
api: { endpoint, method }, api: { endpoint, method },
payload, payload,
} = dataSource.value; } = _data;
Http[method.toLowerCase()]?.(endpoint, payload).then((res) => { Http[method.toLowerCase()]?.(endpoint, payload).then((res) => {
const { code } = res; const { code } = res;
if (code === 200) { if (code === 200) {
@ -113,7 +113,7 @@ export default {
); );
}; };
const renderTaskManage = () => { const renderTaskManage = () => {
const { file_type } = dataSource.value; const { file_type } = props.previewData;
return tasks.value.map((item) => { return tasks.value.map((item) => {
const { params, execution_time, name } = item; const { params, execution_time, name } = item;
if (file_type === FILE_TYPE.topic_only) { if (file_type === FILE_TYPE.topic_only) {

View File

@ -9,7 +9,8 @@ export interface UseChatHandlerReturn {
generateLoading?: Ref<boolean>; generateLoading?: Ref<boolean>;
conversationList?: Ref<any[]>; conversationList?: Ref<any[]>;
showRightView?: Ref<boolean>; showRightView?: Ref<boolean>;
rightViewData?: Ref<any>; rightViewDataSource?: Ref<any>;
rightPreviewData?: Ref<any>;
senderRef?: Ref<null> senderRef?: Ref<null>
} }
export enum EnumTeamRunStatus { export enum EnumTeamRunStatus {
@ -39,7 +40,7 @@ export const ROLE_STYLE = {
export const ANSWER_STYLE = { export const ANSWER_STYLE = {
...ROLE_STYLE, ...ROLE_STYLE,
paddingLeft: '12px', paddingLeft: '14px',
borderLeft: '1px solid #E6E6E8', borderLeft: '1px solid #E6E6E8',
position: 'relative', position: 'relative',
left: '6px', left: '6px',

View File

@ -108,7 +108,8 @@ export default {
const { const {
roles, roles,
showRightView, showRightView,
rightViewData, rightViewDataSource,
rightPreviewData,
generateTeamRunTaskId, generateTeamRunTaskId,
handleMessage, handleMessage,
conversationList, conversationList,
@ -149,7 +150,7 @@ export default {
return () => ( return () => (
<div class="chat-view-wrap w-full h-full flex"> <div class="chat-view-wrap w-full h-full flex">
<section class="flex-1 flex flex-col pt-20px justify-center relative px-16px"> <section class="flex-1 flex flex-col pt-20px justify-center relative pl-16px pr-2px">
<div class="flex-1 overflow-hidden pb-20px"> <div class="flex-1 overflow-hidden pb-20px">
<BubbleList <BubbleList
ref={bubbleListRef} ref={bubbleListRef}
@ -178,7 +179,8 @@ export default {
{showRightView.value && ( {showRightView.value && (
<RightView <RightView
ref={rightViewRef} ref={rightViewRef}
rightViewData={rightViewData.value} dataSource={rightViewDataSource.value}
previewData={rightPreviewData.value}
showRightView={showRightView.value} showRightView={showRightView.value}
onClose={() => (showRightView.value = false)} onClose={() => (showRightView.value = false)}
/> />

View File

@ -48,7 +48,8 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH
const generateTeamRunTaskId = ref<string | null>(null); const generateTeamRunTaskId = ref<string | null>(null);
const showRightView = ref(false); const showRightView = ref(false);
const rightViewData = ref<any>({}); const rightViewDataSource = ref<any>([]);
const rightPreviewData = ref<any>([]);
// 初始化markdown // 初始化markdown
const md = markdownit({ const md = markdownit({
@ -63,7 +64,7 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH
[LOADING_ROLE]: { [LOADING_ROLE]: {
placement: 'start', placement: 'start',
variant: 'borderless', variant: 'borderless',
style: { ...ROLE_STYLE, paddingLeft: '12px' }, style: { ...ROLE_STYLE, paddingLeft: '20px' },
}, },
[INTELLECTUAL_THINKING_ROLE]: { [INTELLECTUAL_THINKING_ROLE]: {
placement: 'start', placement: 'start',
@ -84,18 +85,28 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH
placement: 'end', placement: 'end',
shape: 'round', shape: 'round',
style: ROLE_STYLE, style: ROLE_STYLE,
messageRender: (message: string) => {
return <div class="max-w-400px">
{message}
</div>;
},
}, },
[REMOTE_USER_ROLE]: { [REMOTE_USER_ROLE]: {
placement: 'end', placement: 'end',
shape: 'round', shape: 'round',
style: ROLE_STYLE, style: ROLE_STYLE,
messageRender: (message: string) => {
return <div class="max-w-400px">
{message}
</div>;
},
}, },
[REMOTE_ASSISTANT_ROLE]: { [REMOTE_ASSISTANT_ROLE]: {
placement: 'start', placement: 'start',
variant: 'borderless', variant: 'borderless',
style: ROLE_STYLE, style: ROLE_STYLE,
messageRender: (message: string) => { messageRender: (message: string) => {
return <div v-html={md.render(message)} />; return <div class="max-w-400px" v-html={md.render(message)} />;
}, },
footer: (params) => { footer: (params) => {
const { content, item } = params as { content: string; item: MESSAGE.Answer }; const { content, item } = params as { content: string; item: MESSAGE.Answer };
@ -118,7 +129,7 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH
// 下载处理 // 下载处理
const onDownload = () => { const onDownload = () => {
console.log('onDownload', rightViewData.value); console.log('onDownload', rightViewDataSource.value);
}; };
const onCopy = (content: string) => { const onCopy = (content: string) => {
@ -208,7 +219,7 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH
const { node, output, runStatus, isCollapse = true, customRender, teamRunTaskId } = data; const { node, output, runStatus, isCollapse = true, customRender, teamRunTaskId } = data;
const isRulCompleted = runStatus === EnumTeamRunStatus.RunCompleted; const isRulCompleted = runStatus === EnumTeamRunStatus.RunCompleted;
let outputEleClass: string = `thought-chain-output border-l-#E6E6E8 border-l-1px pl-12px relative left-6px mb-4px`; let outputEleClass: string = `thought-chain-output border-l-#E6E6E8 border-l-1px pl-12px relative left-8px mb-4px`;
!isLastRunTask(data) && (outputEleClass += ' hasLine pb-12px pt-4px'); !isLastRunTask(data) && (outputEleClass += ' hasLine pb-12px pt-4px');
return ( return (
@ -303,30 +314,35 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH
// 含有思考过程,折叠思考过程,展示结果 // 含有思考过程,折叠思考过程,展示结果
if (_hasRunTask) { if (_hasRunTask) {
setRunTaskCollapse(teamRunTaskId, false); setRunTaskCollapse(teamRunTaskId, false);
if (extra_data) { const _targetData = extra_data?.data?.find((item: any) => item.task_type === '任务管理')
if (_targetData) {
showRightView.value = true; showRightView.value = true;
rightViewData.value = extra_data.data; rightViewDataSource.value = extra_data.data;
rightPreviewData.value = _targetData;
} }
_targetTask.content.customRender = () => ( _targetTask.content.customRender = () => {
<> return (
<div v-html={md.render(output)} /> <>
{extra_data && ( <div v-html={md.render(output)} />
<div class="file-card mt-10px"> {_targetData && (
<IconFile class="w-24px h-24px mr-16px color-#6D4CFE" /> <div class="file-card mt-10px">
<div> <IconFile class="w-24px h-24px mr-16px color-#6D4CFE" />
<TextOverTips <div>
context={FILE_TYPE_MAP?.[extra_data.data?.file_type] ?? '-'} <TextOverTips
class="font-family-medium color-#211F24 text-14px font-400 lh-22px mb-4px" context={FILE_TYPE_MAP?.[_targetData.file_type] ?? '-'}
/> class="font-family-medium color-#211F24 text-14px font-400 lh-22px mb-4px"
<span class="color-#939499 font-family-regular text-12px font-400 lh-22px"> />
{exactFormatTime(dayjs().unix())} <span class="color-#939499 font-family-regular text-12px font-400 lh-22px">
</span> {exactFormatTime(dayjs().unix())}
</span>
</div>
</div> </div>
</div> )}
)} </>
</> );
); }
} else { } else {
_targetTask.content.teamRunStatus = EnumTeamRunStatus.TeamRunCompleted; _targetTask.content.teamRunStatus = EnumTeamRunStatus.TeamRunCompleted;
} }
@ -391,6 +407,7 @@ export default function useChatHandler(options: UseChatHandlerOptions): UseChatH
generateLoading, generateLoading,
conversationList, conversationList,
showRightView, showRightView,
rightViewData, rightViewDataSource,
rightPreviewData
}; };
} }

View File

@ -44,7 +44,7 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-left: 1px solid #E6E6E8; border-left: 1px solid #e6e6e8;
} }
} }
} }
@ -59,6 +59,8 @@
align-items: flex-start; align-items: flex-start;
min-width: 0; min-width: 0;
max-width: 100%; max-width: 100%;
min-height: 36px;
word-break: break-all;
@include cts; @include cts;
&-filled { &-filled {
background-color: #f2f3f5; background-color: #f2f3f5;
@ -101,7 +103,7 @@
&-corner { &-corner {
border-radius: 4px; border-radius: 4px;
} }
:deep(table) { :deep(table) {
border-collapse: collapse; border-collapse: collapse;
thead { thead {
@ -109,9 +111,8 @@
th { th {
@include cts; @include cts;
padding: 6px 8px; padding: 6px 8px;
border: 1px solid #E6E6E8; border: 1px solid #e6e6e8;
text-align: left; text-align: left;
} }
} }
} }
@ -119,7 +120,7 @@
tr { tr {
td { td {
@include cts; @include cts;
border: 1px solid #E6E6E8; border: 1px solid #e6e6e8;
padding: 16px 8px; padding: 16px 8px;
text-align: left; text-align: left;
} }
@ -142,5 +143,4 @@
display: inline-block; display: inline-block;
min-width: 36px; min-width: 36px;
} }
} }

View File

@ -103,7 +103,7 @@ const checkHasInviteCode = () => {
.layout-wrap { .layout-wrap {
font-family: inherit; font-family: inherit;
background: transparent; background: transparent;
min-width: 1200px; min-width: $layout-min-width;
.layout-header-wrap { .layout-header-wrap {
background: transparent; background: transparent;
height: $navbar-height; height: $navbar-height;
@ -115,6 +115,7 @@ const checkHasInviteCode = () => {
left: 0; left: 0;
z-index: 1000; z-index: 1000;
width: 100%; width: 100%;
min-width: $layout-min-width;
} }
.layout-content-wrap { .layout-content-wrap {
width: 100%; width: 100%;

View File

@ -14,7 +14,7 @@ export default {
keyWord.value = ''; keyWord.value = '';
}; };
return () => ( return () => (
<div class="middle-wrap h-100% flex-1 flex items-center justify-center px-24px"> <div class="middle-wrap h-100% flex items-center justify-center">
<Input <Input
v-model:value={keyWord.value} v-model:value={keyWord.value}
onPressEnter={handleSearch} onPressEnter={handleSearch}

View File

@ -1,4 +1,7 @@
.middle-wrap { .middle-wrap {
position: absolute;
left: 50%;
transform: translateX(-50%);
display: flex; display: flex;
align-items: center; align-items: center;
:deep(.ant-input-affix-wrapper) { :deep(.ant-input-affix-wrapper) {

View File

@ -1,13 +1,17 @@
<template> <template>
<div class="navbar-wrap px-24px"> <div class="navbar-wrap px-24px">
<div class="w-full h-full relative flex justify-between">
<div class="left-wrap flex items-center cursor-pointer" @click="handleUserHome"> <div class="left-wrap flex items-center cursor-pointer" @click="handleUserHome">
<img src="@/assets/img/icon-logo.png" alt="" width="96" height="24" /> <img src="@/assets/img/icon-logo.png" alt="" width="96" height="24" />
</div> </div>
<div class="flex-1"> <!-- <div class="flex-1"> -->
<MiddleSide v-if="!isHomeRoute" /> <MiddleSide v-if="!isHomeRoute" />
</div> <!-- </div> -->
<RightSide :isAgentRoute="isAgentRoute" v-if="userStore.isLogin" /> <RightSide :isAgentRoute="isAgentRoute" v-if="userStore.isLogin" />
</div> </div>
</div>
</template> </template>
<script setup> <script setup>
@ -32,8 +36,6 @@ const isHomeRoute = computed(() => {
<style scoped lang="scss"> <style scoped lang="scss">
.navbar-wrap { .navbar-wrap {
position: relative; position: relative;
display: flex;
justify-content: space-between;
height: 100%; height: 100%;
&::before { &::before {
width: 100%; width: 100%;

View File

@ -1,3 +1,4 @@
$layout-min-width: 1200px;
$navbar-height: 52px; // 头部高度 $navbar-height: 52px; // 头部高度
$sidebar-width: 138px; // 侧边栏菜单宽度 $sidebar-width: 138px; // 侧边栏菜单宽度
$sidebar-width-collapse: 74px; // 折叠侧边栏菜单宽度 $sidebar-width-collapse: 74px; // 折叠侧边栏菜单宽度

View File

@ -1,6 +1,6 @@
.explore-page { .explore-page {
position: relative; position: relative;
min-width: 1200px; min-width: $layout-min-width;
min-height: 100vh; min-height: 100vh;
background: #fff; background: #fff;
display: flex; display: flex;
@ -35,7 +35,7 @@
right: 0; right: 0;
top: 0; top: 0;
z-index: 1000; z-index: 1000;
min-width: 1200px; min-width: $layout-min-width;
.content { .content {
height: $navbar-height; height: $navbar-height;
// border-bottom: 1px solid var(--Border-1, #d7d7d9); // border-bottom: 1px solid var(--Border-1, #d7d7d9);

View File

@ -1,7 +1,7 @@
.explore-page { .explore-page {
position: relative; position: relative;
padding-top: $navbar-height; padding-top: $navbar-height;
min-width: 1200px; min-width: $layout-min-width;
.cts { .cts {
font-family: $font-family-regular; font-family: $font-family-regular;
font-size: 14px; font-size: 14px;
@ -18,7 +18,7 @@
right: 0; right: 0;
top: 0; top: 0;
z-index: 1000; z-index: 1000;
min-width: 1200px; min-width: $layout-min-width;
.content { .content {
height: $navbar-height; height: $navbar-height;
// border-bottom: 1px solid var(--Border-1, #d7d7d9); // border-bottom: 1px solid var(--Border-1, #d7d7d9);
@ -41,7 +41,7 @@
.page-wrapper { .page-wrapper {
min-height: calc(100vh - $navbar-height); min-height: calc(100vh - $navbar-height);
.explore-container { .explore-container {
width: 1200px; width: $layout-min-width;
.explore-list-wrap { .explore-list-wrap {
:deep(.overflow-text) { :deep(.overflow-text) {
color: var(--Text-1, #211f24); color: var(--Text-1, #211f24);

View File

@ -35,7 +35,6 @@ export default {
watch( watch(
() => props.modelValue, () => props.modelValue,
(newValue) => { (newValue) => {
console.log(newValue);
localSearchValue.value = newValue || ''; localSearchValue.value = newValue || '';
}, },
); );

View File

@ -1,6 +1,6 @@
.explore-page { .explore-page {
position: relative; position: relative;
min-width: 1200px; min-width: $layout-min-width;
min-height: 100vh; min-height: 100vh;
// background: #fff; // background: #fff;
display: flex; display: flex;
@ -35,7 +35,7 @@
right: 0; right: 0;
top: 0; top: 0;
z-index: 1000; z-index: 1000;
min-width: 1200px; min-width: $layout-min-width;
.content { .content {
height: $navbar-height; height: $navbar-height;
// border-bottom: 1px solid var(--Border-1, #d7d7d9); // border-bottom: 1px solid var(--Border-1, #d7d7d9);

View File

@ -1,7 +1,7 @@
.explore-page { .explore-page {
position: relative; position: relative;
padding-top: $navbar-height; padding-top: $navbar-height;
min-width: 1200px; min-width: $layout-min-width;
.cts { .cts {
font-family: $font-family-regular; font-family: $font-family-regular;
font-size: 14px; font-size: 14px;
@ -18,7 +18,7 @@
right: 0; right: 0;
top: 0; top: 0;
z-index: 1000; z-index: 1000;
min-width: 1200px; min-width: $layout-min-width;
.content { .content {
height: $navbar-height; height: $navbar-height;
// border-bottom: 1px solid var(--Border-1, #d7d7d9); // border-bottom: 1px solid var(--Border-1, #d7d7d9);
@ -41,7 +41,7 @@
.page-wrapper { .page-wrapper {
min-height: calc(100vh - $navbar-height); min-height: calc(100vh - $navbar-height);
.explore-container { .explore-container {
width: 1200px; width: $layout-min-width;
.explore-list-wrap { .explore-list-wrap {
:deep(.overflow-text) { :deep(.overflow-text) {
color: var(--Text-1, #211f24); color: var(--Text-1, #211f24);