Merge branch 'dev' of https://gitee.com/justop/hxops into dev

This commit is contained in:
runny committed 2026-05-19 04:23:49 +08:00
commit ac04409e79
12 files changed
+292 -76

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@ export interface ScheduleRun {
total_count: number;
success_count: number;
failed_count: number;
skipped_count: number;
api_request_json?: Record<string, any> | null;
api_response_json?: Record<string, any> | null;
response_summary_json?: Record<string, any> | null;
+21 -9
View File
@@ -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,
@@ -62,12 +62,12 @@ const sidebarItems = computed(() => {
{ id: 'users', icon: UserCog, label: t('admin.nav.users') },
{ id: 'departments', icon: Building, label: t('admin.nav.departments') },
{ id: 'agents', icon: Bot, label: t('admin.nav.agents') },
{ id: 'schedules', icon: Settings2, label: '排程管理' },
{ id: 'announcements', icon: Megaphone, label: t('admin.nav.announcements') },
{ id: 'questions', icon: MessageCircleQuestion, label: t('admin.nav.questions') },
{ id: 'wecom', icon: Link2, label: t('admin.nav.wecom') },
{ id: 'permissions', icon: Users, label: t('admin.nav.permissions') },
{ id: 'requests', icon: ShieldCheck, label: t('admin.nav.requests'), badge: permissionRequests.value.filter(r => r.status === 'pending').length },
{ id: 'schedules', icon: Settings2, label: '排程管理' },
];
return items.filter(item => {
@@ -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>
+2
View File
@@ -1793,6 +1793,7 @@ onMounted(async () => {
<th class="px-4 py-3 text-left font-semibold text-slate-600">处理笔数</th>
<th class="px-4 py-3 text-left font-semibold text-slate-600">成功笔数</th>
<th class="px-4 py-3 text-left font-semibold text-slate-600">失败笔数</th>
<th class="px-4 py-3 text-left font-semibold text-slate-600">明细</th>
</tr>
</thead>
@@ -1814,6 +1815,7 @@ onMounted(async () => {
<td class="px-4 py-3 text-slate-500">{{ r.total_count || 0 }}</td>
<td class="px-4 py-3 text-emerald-600 font-medium">{{ r.success_count ?? 0 }}</td>
<td class="px-4 py-3 text-rose-600 font-medium">{{ r.failed_count ?? 0 }}</td>
<td class="px-4 py-3">
<a
v-if="r.total_count > 0 && r.excel_file_name"