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('');