feat:做完了准备搞编辑

This commit is contained in:
许永平
2025-07-09 20:35:59 +08:00
parent 6d417dae2a
commit 0abfd5fc83
4 changed files with 20 additions and 20 deletions

View File

@@ -152,7 +152,7 @@ export default function MomentsSync() {
};
const handleEdit = (taskId: string) => {
navigate(`/workspace/moments-sync/${taskId}/edit`);
navigate(`/workspace/moments-sync/edit/${taskId}`);
};
const handleView = (taskId: string) => {

View File

@@ -92,14 +92,15 @@ export default function EditMomentsSyncTask() {
id,
name: form.name,
devices: form.deviceIds.split(',').map(s => s.trim()).filter(Boolean),
contentLib: form.contentLib,
syncMode: form.syncMode as 'auto' | 'manual',
interval: Number(form.syncInterval),
maxSync: Number(form.maxSyncPerDay),
contentLibraries: form.contentLib.split(',').map(s => s.trim()).filter(Boolean),
syncInterval: Number(form.syncInterval),
syncCount: Number(form.maxSyncPerDay),
syncType: form.syncMode === 'auto' ? 1 : 2,
startTime: form.timeStart,
endTime: form.timeEnd,
targetTags: form.targetTags.split(',').map(s => s.trim()).filter(Boolean),
accountType: 1, // 默认为业务号
contentTypes: form.contentTypes.split(',').map(s => s.trim()).filter(Boolean) as ('text' | 'image' | 'video' | 'link')[],
targetTags: form.targetTags.split(',').map(s => s.trim()).filter(Boolean),
filterKeywords: form.filterKeywords.split(',').map(s => s.trim()).filter(Boolean),
});
toast({ title: '更新成功' });

View File

@@ -141,7 +141,7 @@ function BasicSettings({ formData, onChange, onNext }: BasicSettingsProps) {
</div>
<div>
<div className="text-base font-medium mb-2"></div>
<div className="text-base font-medium mb-2"></div>
<div className="flex items-center space-x-5">
<Button
variant="outline"
@@ -254,7 +254,7 @@ export default function NewMomentsSyncTask() {
startTime: '06:00',
endTime: '23:59',
syncCount: 5,
interval: 30, // 时间间隔,单位:分钟
interval: 30, // 同步间隔,单位:分钟
accountType: 'business' as 'business' | 'personal',
enabled: true,
selectedDevices: [] as string[],
@@ -295,16 +295,16 @@ export default function NewMomentsSyncTask() {
await createMomentsSyncTask({
name: formData.taskName,
devices: formData.selectedDevices,
contentLib: formData.selectedLibraries.join(','),
syncMode: formData.accountType === 'business' ? 'auto' : 'manual',
interval: formData.interval,
maxSync: formData.syncCount,
contentLibraries: formData.selectedLibraries,
syncInterval: formData.interval,
syncCount: formData.syncCount,
syncType: formData.accountType === 'business' ? 1 : 2,
startTime: formData.startTime,
endTime: formData.endTime,
targetTags: formData.targetTags,
accountType: formData.accountType === 'business' ? 1 : 2,
contentTypes: formData.contentTypes,
targetTags: formData.targetTags,
filterKeywords: formData.filterKeywords,
friends: [],
});
toast({ title: '创建成功' });
navigate('/workspace/moments-sync');
@@ -327,7 +327,6 @@ export default function NewMomentsSyncTask() {
</div>
</div>
}
footer={<BottomNav />}
>
<div className="bg-gray-50">
<div className="p-4 space-y-6">

View File

@@ -36,17 +36,17 @@ export interface MomentsSyncTask {
// 创建任务数据
export interface CreateMomentsSyncData {
name: string;
interval: number;
maxSync: number;
syncInterval: number;
syncCount: number;
syncType: number;
startTime: string;
endTime: string;
accountType: number;
contentTypes: ContentType[];
devices: string[];
friends?: string[];
syncMode: SyncMode;
contentLibraries: string[];
targetTags: string[];
filterKeywords: string[];
contentLib?: string;
}
// 更新任务数据