diff --git a/packages/effects/common-ui/src/ui/ppt/index.ts b/apps/web-antd/src/views/ppt/components/index.ts similarity index 55% rename from packages/effects/common-ui/src/ui/ppt/index.ts rename to apps/web-antd/src/views/ppt/components/index.ts index a63baff..b423b8a 100644 --- a/packages/effects/common-ui/src/ui/ppt/index.ts +++ b/apps/web-antd/src/views/ppt/components/index.ts @@ -1,4 +1,2 @@ -export { default as PptHistoryView } from './ppt-history-view.vue'; export { default as PptListView } from './ppt-list-view.vue'; export { default as PptWorkView } from './ppt-work-view.vue'; -export type * from './typing'; diff --git a/packages/effects/common-ui/src/ui/ppt/ppt-list-view.vue b/apps/web-antd/src/views/ppt/components/ppt-list-view.vue similarity index 78% rename from packages/effects/common-ui/src/ui/ppt/ppt-list-view.vue rename to apps/web-antd/src/views/ppt/components/ppt-list-view.vue index 4a13e08..1c10b93 100644 --- a/packages/effects/common-ui/src/ui/ppt/ppt-list-view.vue +++ b/apps/web-antd/src/views/ppt/components/ppt-list-view.vue @@ -1,22 +1,15 @@ @@ -104,11 +73,8 @@ const openKeys = ref([]); :items="itemsData" @click="handleMenuClick" /> - - -
会话
- +
会话
import type { AttachmentsProps, BubbleListProps } from 'ant-design-x-vue'; -import type { DrawerPlacement } from '@vben-core/popup-ui'; +import type { DrawerPlacement } from '@vben/common-ui'; -import type { PPTTempItem } from './typing'; +import type { PropsWork, ResultItem } from '../typing'; import { h, ref, watch } from 'vue'; -import { useVbenDrawer } from '@vben-core/popup-ui'; +import { useVbenDrawer } from '@vben/common-ui'; +import { useUserStore } from '@vben/stores'; import { CloudUploadOutlined, @@ -17,39 +18,11 @@ import { import { Badge, Button, Flex, Space, Typography } from 'ant-design-vue'; import { Attachments, Bubble, Sender, Welcome } from 'ant-design-x-vue'; -import PptPreview from './ppt-perview.vue'; +import PptPreview from './ppt-preview.vue'; -interface ResultItem { - key: number; - role: 'ai' | 'user'; - content: string; - footer?: any; -} +defineOptions({ name: 'PptWorkView' }); -interface WorkflowContext { - userId: string; - conversationId: string; - files: unknown[]; - inputs: Record; -} - -interface WorkflowResult { - data: { - outputs: { - result: string; - }; - }; -} - -interface Props { - itemMessage?: ResultItem; - item?: PPTTempItem; - runWorkflow?: (context: WorkflowContext) => Promise; -} - -defineOptions({ name: 'PlaygroundIndependentSetup' }); - -const props = withDefaults(defineProps(), { +const props = withDefaults(defineProps(), { itemMessage: () => null, item: () => null, runWorkflow: () => async () => ({ @@ -61,8 +34,7 @@ const props = withDefaults(defineProps(), { }), }); -// const { token } = theme.useToken(); - +const userStore = useUserStore(); const roles: BubbleListProps['roles'] = { user: { placement: 'end', @@ -158,7 +130,7 @@ const startFetching = async () => { try { const res = await props.runWorkflow({ - userId: '1562', + userId: userStore.userInfo?.userId || '', conversationId: '', files: [], inputs: { @@ -232,12 +204,6 @@ watch( resultItems.value = []; if (newVal && newVal.length > 0) { newVal.forEach((msg) => { - // resultItems.value.push({ - // key: resultItems.value.length + 1, - // role: msg.role, // 'user' or 'ai' - // content: msg.content, - // footer: msg.footer, - // }); if (msg.role === 'user') { resultItems.value.push({ key: resultItems.value.length + 1, diff --git a/packages/effects/common-ui/src/ui/spider/spider-list-view.vue b/apps/web-antd/src/views/spider/components/spider-list-view.vue similarity index 100% rename from packages/effects/common-ui/src/ui/spider/spider-list-view.vue rename to apps/web-antd/src/views/spider/components/spider-list-view.vue diff --git a/packages/effects/common-ui/src/ui/spider/spider-preview.vue b/apps/web-antd/src/views/spider/components/spider-preview.vue similarity index 100% rename from packages/effects/common-ui/src/ui/spider/spider-preview.vue rename to apps/web-antd/src/views/spider/components/spider-preview.vue diff --git a/packages/effects/common-ui/src/ui/word/index.ts b/apps/web-antd/src/views/word/components/index.ts similarity index 55% rename from packages/effects/common-ui/src/ui/word/index.ts rename to apps/web-antd/src/views/word/components/index.ts index 4ab39e9..8280a2d 100644 --- a/packages/effects/common-ui/src/ui/word/index.ts +++ b/apps/web-antd/src/views/word/components/index.ts @@ -1,4 +1,2 @@ -export type * from './typing'; -export { default as WordHistoryView } from './word-history-view.vue'; export { default as WordListView } from './word-list-view.vue'; export { default as WordWorkView } from './word-work-view.vue'; diff --git a/packages/effects/common-ui/src/ui/word/word-list-view.vue b/apps/web-antd/src/views/word/components/word-list-view.vue similarity index 95% rename from packages/effects/common-ui/src/ui/word/word-list-view.vue rename to apps/web-antd/src/views/word/components/word-list-view.vue index 8abdd09..3bef95b 100644 --- a/packages/effects/common-ui/src/ui/word/word-list-view.vue +++ b/apps/web-antd/src/views/word/components/word-list-view.vue @@ -1,7 +1,7 @@