From 71cd4b7363bc4ba869761ebeba4694e10749415e Mon Sep 17 00:00:00 2001 From: Kven <2955163637@qq.com> Date: Tue, 13 May 2025 16:51:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(@vben/web-antd):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=88=AC=E8=99=AB=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/effects/common-ui/package.json | 1 + .../src/ui/spider/spider-work-view.vue | 29 ++++++++++++------- pnpm-lock.yaml | 3 ++ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/packages/effects/common-ui/package.json b/packages/effects/common-ui/package.json index 1dec79f..1f64b47 100644 --- a/packages/effects/common-ui/package.json +++ b/packages/effects/common-ui/package.json @@ -45,6 +45,7 @@ "@vueuse/integrations": "catalog:", "ant-design-vue": "catalog:", "ant-design-x-vue": "^1.1.2", + "dayjs": "^1.11.13", "markdown-it": "^14.1.0", "qrcode": "catalog:", "tippy.js": "catalog:", diff --git a/packages/effects/common-ui/src/ui/spider/spider-work-view.vue b/packages/effects/common-ui/src/ui/spider/spider-work-view.vue index ace589d..3f41f7f 100644 --- a/packages/effects/common-ui/src/ui/spider/spider-work-view.vue +++ b/packages/effects/common-ui/src/ui/spider/spider-work-view.vue @@ -12,7 +12,8 @@ import { CardTitle, } from '@vben-core/shadcn-ui'; -import { RangePicker } from 'ant-design-vue'; +import { message, RangePicker } from 'ant-design-vue'; +import dayjs from 'dayjs'; interface SpiderParams { appid: string; @@ -66,12 +67,14 @@ const startFetching = async () => { isFetching.value = true; fetchStatus.value = 'fetching'; - let publishStartTime = ''; // 默认值 - let publishEndTime = ''; // 默认值 + let publish_start_time = ''; // 默认值 + let publish_end_time = ''; // 默认值 if (selectedDateRange.value && selectedDateRange.value.length === 2) { - publishStartTime = selectedDateRange.value[0] || ''; - publishEndTime = selectedDateRange.value[1] || ''; + publish_start_time = + dayjs(selectedDateRange.value[0]).format('YYYYMMDDhhmmss') || ''; + publish_end_time = + dayjs(selectedDateRange.value[1]).format('YYYYMMDDhhmmss') || ''; } try { @@ -84,13 +87,19 @@ const startFetching = async () => { conversationId: '', files: [], inputs: { - publishStartTime, - publishEndTime, + publish_start_time, + publish_end_time, }, }, ); - // 保存抓取结果 - fetchResult.value = res.data.outputs.result; + if (res.data.outputs.result) { + // 保存抓取结果 + fetchResult.value = res.data.outputs.result; + message.success('抓取成功'); + } else { + fetchResult.value = ''; + message.error('抓取无结果'); + } } catch (error) { console.error(error); } @@ -141,7 +150,7 @@ const fetchStatus = ref('');