From 70fc358d72a77238e34d231609399d9c52b914a7 Mon Sep 17 00:00:00 2001 From: Admin Date: Wed, 28 Jan 2026 17:27:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=EF=BC=8C=E8=AF=B4=E6=98=8E=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=B7=B2=E5=86=85=E7=BD=AE=E6=97=A0=E9=9C=80=20import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/scheduled-tasks/index.vue | 21 ++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/scheduled-tasks/index.vue b/frontend/src/views/scheduled-tasks/index.vue index 9f57dba..a0074d9 100644 --- a/frontend/src/views/scheduled-tasks/index.vue +++ b/frontend/src/views/scheduled-tasks/index.vue @@ -36,14 +36,19 @@ const form = reactive({ webhook_method: 'POST', webhook_headers: {}, script_content: `# 示例脚本 -# 可用函数: log, print, ai, dingtalk, wecom, http_get, http_post, db_query -# 可用函数: get_var, set_var, del_var, get_param, get_params -# 可用函数: get_tenants, get_tenant_config, get_all_tenant_configs, get_secret -# 可用变量: task_id, tenant_id, trace_id -# 可用库: json, re, math, random, datetime, timedelta +# 注意:不需要 import!以下模块已内置可直接使用 +# 内置函数: log, print, ai, dingtalk, wecom, http_get, http_post, db_query +# 内置函数: get_var, set_var, del_var, get_param, get_params +# 内置函数: get_tenants, get_tenant_config, get_all_tenant_configs, get_secret +# 内置变量: task_id, tenant_id, trace_id +# 内置模块: json, re, math, random, hashlib, base64, datetime, date, timedelta log('任务开始执行') +# 获取当前时间(datetime 已内置,无需 import) +now = datetime.now().strftime('%Y-%m-%d %H:%M:%S') +log(f'执行时间: {now}') + # 获取参数 prompt = get_param('prompt', '默认提示词') log(f'参数: {prompt}') @@ -173,9 +178,13 @@ function handleCreate() { webhook_url: '', webhook_method: 'POST', webhook_headers: {}, - script_content: `# 示例脚本 + script_content: `# 示例脚本(无需 import,模块已内置) log('任务开始执行') +# 获取当前时间 +now = datetime.now().strftime('%H:%M:%S') +log(f'执行时间: {now}') + # 获取参数 prompt = get_param('prompt', '默认提示词')