自动排程处理笔数逻辑修正
This commit is contained in:
1 parent
3d4b2647ae
commit
f978a8701b
10 files changed
+236
-74
No files matched your search
@@ -20,7 +20,7 @@ import { loadReportLayoutPref, saveReportLayoutPref } from '../composables/useRe
|
||||
import { useGlobalMessageDialog } from '../composables/useGlobalMessageDialog';
|
||||
import { buildWecomAuditMeta, formatWecomAuditReason } from '../utils/wecom';
|
||||
import { getAuthHeaders } from '../utils/auth';
|
||||
import { listAdminSchedules, createAdminSchedule, updateAdminSchedule, deleteAdminSchedule, toggleAdminSchedule, runAdminSchedule, listAdminScheduleRuns, adminRunExcelUrl, type ScheduleTask, type ScheduleRun } from '../api/schedule';
|
||||
import { listAdminSchedules, createAdminSchedule, updateAdminSchedule, deleteAdminSchedule, toggleAdminSchedule, runAdminSchedule, listAdminScheduleRuns, type ScheduleTask, type ScheduleRun } from '../api/schedule';
|
||||
import {
|
||||
ArrowLeft,
|
||||
// Save,
|
||||
@@ -489,11 +489,11 @@ const scheduleNextRunPreview = computed(() => {
|
||||
const parts = expr.trim().split(/\s+/);
|
||||
if (parts.length !== 5) return null;
|
||||
const now = new Date();
|
||||
const minuteRaw = parts[0];
|
||||
const hourRaw = parts[1];
|
||||
const dayOfMonth = parts[2];
|
||||
const month = parts[3];
|
||||
const dayOfWeek = parts[4];
|
||||
const minuteRaw = parts[0]!;
|
||||
const hourRaw = parts[1]!;
|
||||
const dayOfMonth = parts[2]!;
|
||||
const month = parts[3]!;
|
||||
const dayOfWeek = parts[4]!;
|
||||
if (month !== '*') return null;
|
||||
if (dayOfMonth !== '*' && dayOfWeek !== '*') return null;
|
||||
const minute = minuteRaw.startsWith('*/') ? undefined : parseInt(minuteRaw, 10);
|
||||
@@ -800,7 +800,12 @@ const backToScheduleOverview = () => {
|
||||
};
|
||||
|
||||
const runScheduleNow = async (taskId: number) => {
|
||||
await runAdminSchedule(taskId);
|
||||
const res = await runAdminSchedule(taskId);
|
||||
if (!res.ok) {
|
||||
const data = await res.json().catch(() => ({}));
|
||||
showMessageDialog('error', data?.error || '手动执行失败');
|
||||
return;
|
||||
}
|
||||
await viewScheduleRuns(taskId);
|
||||
await loadSchedules();
|
||||
|
||||
@@ -4155,12 +4160,19 @@ const handlePermissionImport = async (event: Event) => {
|
||||
:class="getScheduleRunStatusBadge(r.status).cls">
|
||||
{{ getScheduleRunStatusBadge(r.status).label }}
|
||||
</span>
|
||||
<span v-if="r.error_message" class="ml-1 text-xs text-slate-400" :title="r.error_message">...</span>
|
||||
</td>
|
||||
<td class="px-4 py-3">{{ r.total_count }}</td>
|
||||
<td class="px-4 py-3">{{ r.success_count }}</td>
|
||||
<td class="px-4 py-3">{{ r.failed_count }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<a v-if="r.total_count > 0" class="cursor-pointer text-brand-600 hover:text-brand-700 hover:underline" @click.prevent="downloadScheduleExcel(r.id)">
|
||||
<a
|
||||
v-if="r.total_count > 0"
|
||||
href="#"
|
||||
@click.prevent="downloadScheduleExcel(r.id)"
|
||||
class="inline-flex items-center gap-1 rounded-lg border border-slate-200 px-2 py-1 text-xs font-medium text-slate-600 transition-colors hover:bg-slate-50"
|
||||
>
|
||||
<Download class="h-3 w-3" />
|
||||
下载
|
||||
</a>
|
||||
<span v-else class="text-slate-300">-</span>
|
||||
|
||||
Reference in new issue
Block a user