diff --git a/apps/web-antd/src/views/word/components/word-work-view.vue b/apps/web-antd/src/views/word/components/word-work-view.vue index f763b21..8de4c98 100644 --- a/apps/web-antd/src/views/word/components/word-work-view.vue +++ b/apps/web-antd/src/views/word/components/word-work-view.vue @@ -7,7 +7,7 @@ import type { import type { DrawerPlacement } from '@vben/common-ui'; -import type { Props, ResultItem, WordTempItem } from '../typing'; +import type { Props, ResultItem } from '../typing'; import { computed, h, ref, watch } from 'vue'; @@ -42,26 +42,32 @@ import WordPreview from './word-preview.vue'; defineOptions({ name: 'WordWorkView' }); const props = withDefaults(defineProps(), { - item: { - id: '', - name: '', - } as WordTempItem, + item: () => { + return { + id: '', + name: '', + }; + }, itemMessage: Array, paramsData: Array, - runChatFlow: () => async () => ({ - event: '', - conversationId: '', - messageFiles: [], - messageId: '', - taskId: '', - id: '', - answer: '', - }), - projectInfo: { - projectName: '', - projectContext: '', - projectKeyAvoidTechOrKeyword: '', - userInitialInnovationPoint: '', + runChatFlow: () => { + return { + event: '', + conversationId: '', + messageFiles: [], + messageId: '', + taskId: '', + id: '', + answer: '', + }; + }, + projectInfo: () => { + return { + projectContext: '', + projectKeyAvoidTechOrKeyword: '', + projectName: '', + userInitialInnovationPoint: '', + }; }, }); @@ -182,7 +188,7 @@ function openPreviewDrawer( // ==================== Event ==================== function extractDocxInfo( markdownLink: string, -): null | { filename: string; url: string } { +): null | { filename: string | undefined; url: string } { const fileRegex = /\[(.*?)\]/; const urlRegex = /\((.*?)\)/; const fileMatch = markdownLink.match(fileRegex); @@ -254,7 +260,6 @@ const startFetching = async () => { h( Button, { - size: 'normal', type: 'primary', onClick: () => { openPreviewDrawer('right', url); @@ -265,13 +270,12 @@ const startFetching = async () => { h( Button, { - size: 'normal', type: 'primary', style: { marginLeft: '10px' }, onClick: () => { const link = document.createElement('a'); link.href = url; - link.download = filename; + link.download = filename as string; document.body.append(link); link.click(); link.remove(); @@ -321,7 +325,6 @@ watch( h( Button, { - size: 'normal', type: 'primary', onClick: () => { openPreviewDrawer('right', url); @@ -332,7 +335,6 @@ watch( h( Button, { - size: 'normal', type: 'primary', style: { marginLeft: '10px' }, onClick: () => { diff --git a/apps/web-antd/src/views/word/typing.ts b/apps/web-antd/src/views/word/typing.ts index 6f4c9d5..0a6b7ce 100644 --- a/apps/web-antd/src/views/word/typing.ts +++ b/apps/web-antd/src/views/word/typing.ts @@ -48,7 +48,7 @@ interface WorkflowResult { } interface Props { itemMessage?: ResultItem[]; - item?: null | WordTempItem; + item?: WordTempItem; paramsData?: string[]; runChatFlow?: ( appId: null | string,