-
-
- {group.label}
-
-
- ({group.tasks.length})
+
+
{group.label}
+
+ {group.tasks.length}
-
-
+
{group.tasks.map((task) => renderTaskCard(task))}
@@ -927,132 +829,74 @@ const ImageTaskList = ({
tasks={compareTasks}
onClose={() => setCompareOpen(false)}
/>
-
+
);
// ==================== 渲染任务卡 ====================
function renderTaskCard(task) {
- const statusConfig = getStatusConfig(task.status);
const isFailed = task.status === 'failed';
const isSuccess = task.status === 'success';
const isProcessing = task.status === 'processing';
const isFav = favorites.has(task.id);
const isSelected = selectedIds.has(task.id);
-
- // 失败卡片视觉降级:整张红色调,图区变薄
- const failedClass = isFailed
- ? 'border-rose-200/70 dark:border-rose-900/40 bg-rose-50/[0.45] dark:bg-rose-900/10'
- : 'border-white/60 dark:border-white/10 bg-white/[0.62] dark:bg-white/[0.06] backdrop-blur';
-
- const selectedClass = isSelected
- ? 'ring-2 ring-brand ring-offset-1 dark:ring-offset-neutral-900'
- : '';
- const hoverBorderClass = isFailed
- ? 'hover:border-rose-300/80 dark:hover:border-rose-800/60'
- : 'hover:border-brand/25';
-
- // 图区高度:失败和紧凑统一 1:1;舒适模式按真实比例
- const imageBoxStyle = isFailed
- ? { height: '64px' }
- : density === 'comfortable' && task.width && task.height
- ? { aspectRatio: `${task.width} / ${task.height}` }
- : { aspectRatio: '1 / 1' };
-
- const cardClickable = selectMode && isSuccess && task.imageUrl;
+ const canSelect = selectMode && isSuccess && Boolean(task.imageUrl);
+ const hasImage = isSuccess && task.imageUrl && !failedImageIds.has(task.id);
return (
-
{
- e.stopPropagation();
- toggleSelect(task.id);
- }
- : undefined
- }
+ className='image-task-card'
+ data-selected={isSelected}
+ classNames={{ body: 'image-task-card-layout' }}
draggable={isSuccess && !!task.imageUrl && !selectMode}
- onDragStart={(e) => handleDragStart(e, task)}
+ onDragStart={(event) => handleDragStart(event, task)}
>
- {/* 左侧状态彩色条 */}
-
+ {isSuccess && !selectMode && (
+
+ }
+ onClick={() => toggleFavorite(task.id)}
+ aria-label={isFav ? t('取消收藏') : t('收藏')}
+ aria-pressed={isFav}
+ title={isFav ? t('取消收藏') : t('收藏')}
+ />
+ )}
+ {canSelect && (
+
toggleSelect(task.id)}
+ />
+ )}
+ {hasImage ? (
+
+
);
}
};
diff --git a/src/pages/ExperienceCenter/components/AICreation/Video/VideoInputPanel.css b/src/pages/ExperienceCenter/components/AICreation/Video/VideoInputPanel.css
index 0d438d3e..d88777c3 100644
--- a/src/pages/ExperienceCenter/components/AICreation/Video/VideoInputPanel.css
+++ b/src/pages/ExperienceCenter/components/AICreation/Video/VideoInputPanel.css
@@ -7,17 +7,21 @@
--vip-muted: var(--text-secondary);
--vip-line: var(--border-subtle);
--vip-surface: var(--surface-card);
- --vip-accent: var(--ui-color-primary);
- --vip-tint: color-mix(in srgb, var(--ui-color-primary) 10%, transparent);
+ --vip-accent: var(--brand-accent);
+ --vip-tint: var(--brand-selection-bg);
--vip-fill: color-mix(in srgb, var(--text-primary) 4%, var(--surface-card));
--vip-danger: var(--ui-color-danger);
--vip-warning: var(--ui-color-warning);
- --vip-ring: color-mix(in srgb, var(--ui-color-primary) 55%, transparent);
+ --vip-ring: var(--brand-accent);
- position: relative;
- height: 100%;
- overflow: auto;
- padding: 16px;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ max-height: 100%;
+ min-height: 0;
+ border: 1px solid var(--vip-line);
+ border-radius: 12px;
+ background: var(--vip-surface);
}
.video-input-panel button:focus-visible,
@@ -26,36 +30,35 @@
outline-offset: 2px;
}
-.vip-collapse-row {
- display: flex;
- justify-content: flex-end;
- margin-bottom: 12px;
+.vip-fields {
+ flex: 1;
+ min-height: 0;
+ padding: 12px;
+ overflow: auto;
+ scrollbar-width: thin;
}
-.vip-collapse-btn {
- color: var(--vip-accent) !important;
+.vip-fields:not([hidden]) {
+ display: grid;
+ align-content: start;
+ grid-auto-rows: max-content;
+ gap: 12px;
}
-.vip-expand-fab {
- position: fixed;
- left: 0;
- top: 50%;
- transform: translateY(-50%);
- z-index: 100;
+.vip-fields[hidden] {
+ display: none;
}
-.vip-expand-fab .ant-btn {
- border-top-left-radius: 0;
- border-bottom-left-radius: 0;
- color: var(--ui-color-primary);
+.vip-prompt textarea::placeholder,
+textarea.vip-prompt::placeholder {
+ color: var(--vip-muted);
}
.vip-card {
- margin-bottom: 12px;
- padding: 14px 16px;
+ padding: 12px;
border: 1px solid var(--vip-line);
- border-radius: 12px;
- background: var(--vip-surface);
+ border-radius: 10px;
+ background: var(--vip-fill);
min-width: 0;
}
@@ -79,7 +82,7 @@
height: 26px;
border-radius: 8px;
background: var(--vip-tint);
- color: var(--vip-accent);
+ color: var(--brand-selection-text);
}
.vip-card-extra {
@@ -158,6 +161,13 @@
color: var(--vip-danger);
}
+.video-input-panel .cp-option-group {
+ --cp-accent: var(--brand-selection-text);
+ --cp-accent-tint: var(--brand-selection-bg);
+ --cp-accent-line: color-mix(in srgb, var(--brand-accent) 45%, transparent);
+ --cp-ring: var(--brand-accent);
+}
+
.vip-mode-option {
display: inline-flex;
align-items: center;
@@ -198,8 +208,8 @@
.vip-advanced {
border: 1px solid var(--vip-line);
- border-radius: 12px;
- background: var(--vip-surface);
+ border-radius: 10px;
+ background: var(--vip-fill);
overflow: hidden;
}
diff --git a/src/pages/ExperienceCenter/components/AICreation/Video/VideoInputPanel.jsx b/src/pages/ExperienceCenter/components/AICreation/Video/VideoInputPanel.jsx
index deb89374..3a3b507f 100644
--- a/src/pages/ExperienceCenter/components/AICreation/Video/VideoInputPanel.jsx
+++ b/src/pages/ExperienceCenter/components/AICreation/Video/VideoInputPanel.jsx
@@ -1,8 +1,8 @@
import {
- ChevronRight as ActionChevronRight,
- ChevronLeft as ActionChevronLeft,
+ ChevronDown as ActionChevronDown,
+ ChevronUp as ActionChevronUp,
} from '@/components/common/icons/ActionIcons';
-import React from 'react';
+import React, { useId } from 'react';
import {
Button,
Collapse,
@@ -76,13 +76,9 @@ const formatModelPrice = (t, model, resolution) => {
return unit ? `${amount}${t(unit)}` : amount;
};
-const VideoInputPanel = ({
- creation,
- onCollapse,
- collapsed,
- collapsible = true,
-}) => {
+const VideoInputPanel = ({ creation, onCollapse, collapsed, scrollRef }) => {
const { t } = useTranslation();
+ const fieldsId = useId();
const {
formData,
setFormData,
@@ -109,20 +105,6 @@ const VideoInputPanel = ({
setFormData((prev) => ({ ...prev, [field]: value }));
};
- // 单列(手机)布局不提供折叠:没有相邻面板可以让位,收起只会留下一片空白,
- // 而唯一的恢复入口是一个浮在屏幕左侧垂直中央的裸箭头。
- if (collapsed && collapsible) {
- return (
-
- }
- onClick={onCollapse}
- aria-label={t('展开')}
- />
-
- );
- }
-
const advancedParams = visibleParams.filter(
(p) => p.placement === 'advanced',
);
@@ -248,181 +230,200 @@ const VideoInputPanel = ({
entry.labelIndex ? `${t(entry.label)} ${entry.labelIndex}` : t(entry.label);
return (
-
- {collapsible && (
-
-
}
- onClick={onCollapse}
- size='small'
- type='tertiary'
- className='vip-collapse-btn'
- aria-label={t('收起')}
- />
+
+
+
+
+
{t('参数设置')}
- )}
-
-
- {renderModelSection()}
-
-
- {selectedModel && modeOptions.length > 0 ? (
-
- o.mode)}
- value={formData.mode}
- onChange={setMode}
- ariaLabel={t('生成方式')}
- optionDisabledReasons={Object.fromEntries(
- modeOptions
- .filter((o) => o.disabled)
- .map((o) => [o.mode, t(o.reason || '当前不可用')]),
- )}
- renderOption={(mode) => {
- const Icon = MODE_ICONS[mode] || Film;
- return (
-
-
- {t(MODE_LABEL_KEYS[mode] || mode)}
-
- );
- }}
- />
+
+ ) : (
+
+ )
+ }
+ onClick={onCollapse}
+ size='small'
+ type='tertiary'
+ aria-label={collapsed ? t('展开创作台') : t('收起创作台')}
+ aria-expanded={!collapsed}
+ aria-controls={fieldsId}
+ />
+
+
+
- ) : null}
- {selectedModel && imageSlots.length > 0 ? (
-
-
- {imageSlots.map((entry) => {
- const slot = entry.slot;
- const value = slot
- ? {
- previewUrl: slot.previewUrl,
- status: entry.active ? slot.status || 'ready' : 'unused',
- error: slot.error,
- }
- : null;
- return (
-
pickImage(entry.key, entry.index, file)}
- onRemove={() => removeImage(entry.key, entry.index)}
- onRetry={() => retryImage(entry.key, entry.index, slot)}
- disabledReason={
- !cosEnabled && !slot
- ? t('对象存储(COS)未开启,暂不支持上传图片')
+ {selectedModel && modeOptions.length > 0 ? (
+
+ o.mode)}
+ value={formData.mode}
+ onChange={setMode}
+ ariaLabel={t('生成方式')}
+ optionDisabledReasons={Object.fromEntries(
+ modeOptions
+ .filter((o) => o.disabled)
+ .map((o) => [o.mode, t(o.reason || '当前不可用')]),
+ )}
+ renderOption={(mode) => {
+ const Icon = MODE_ICONS[mode] || Film;
+ return (
+
+
+ {t(MODE_LABEL_KEYS[mode] || mode)}
+
+ );
+ }}
+ />
+
+ ) : null}
+
+ {selectedModel && imageSlots.length > 0 ? (
+
+
+ {imageSlots.map((entry) => {
+ const slot = entry.slot;
+ const value = slot
+ ? {
+ previewUrl: slot.previewUrl,
+ status: entry.active ? slot.status || 'ready' : 'unused',
+ error: slot.error,
+ }
+ : null;
+ return (
+ pickImage(entry.key, entry.index, file)}
+ onRemove={() => removeImage(entry.key, entry.index)}
+ onRetry={() => retryImage(entry.key, entry.index, slot)}
+ disabledReason={
+ !cosEnabled && !slot
+ ? t('对象存储(COS)未开启,暂不支持上传图片')
+ : ''
+ }
+ />
+ );
+ })}
+
+ {hasUnusedImage ? (
+
+ {t('置灰的图片当前不会提交,切回支持的模型或模式后自动恢复')}
+
+ ) : null}
+ {firstFrameSlot ? (
+
- {hasUnusedImage ? (
-
- {t('置灰的图片当前不会提交,切回支持的模型或模式后自动恢复')}
-
- ) : null}
- {firstFrameSlot ? (
-
-
- {formData.images?.first_frame?.identityType === 'real_person' ? (
-
- {t('真人人像')}
-
- ) : null}
-
- ) : null}
-
- ) : null}
+ {formData.images?.first_frame?.identityType ===
+ 'real_person' ? (
+
+ {t('真人人像')}
+
+ ) : null}
+
+ ) : null}
+
+ ) : null}
-
-
- {formData.selectedTemplate && (
-
-
- {t('模板内容')}: {formData.selectedTemplate}
-
-
- )}
-
-
-
-
- {selectedModel && dockParams.length > 0 ? (
-
- ) : null}
- {selectedModel && advancedParams.length > 0 ? (
-
-
-
-
-
-
- {t('高级参数')}
-
- }
- >
-
-
-
-
- ) : null}
-
+
+
+ {selectedModel && dockParams.length > 0 ? (
+
+ ) : null}
+
+ {selectedModel && advancedParams.length > 0 ? (
+
+
+
+
+
+
+ {t('高级参数')}
+
+ }
+ >
+
+
+
+
+ ) : null}
+
+
);
};
diff --git a/src/pages/ExperienceCenter/components/AICreation/Video/VideoPreviewPanel.css b/src/pages/ExperienceCenter/components/AICreation/Video/VideoPreviewPanel.css
index c9c53a3f..55137e23 100644
--- a/src/pages/ExperienceCenter/components/AICreation/Video/VideoPreviewPanel.css
+++ b/src/pages/ExperienceCenter/components/AICreation/Video/VideoPreviewPanel.css
@@ -1,66 +1,107 @@
-/* 视频预览面板 - 电影感动画背景(增强版) */
-
-/* 动态光晕1 - 缓慢飘动 */
-@keyframes videoPreviewFloat1 {
- 0%,
- 100% {
- transform: translate3d(0, 0, 0);
- }
- 25% {
- transform: translate3d(50px, -30px, 0);
- }
- 50% {
- transform: translate3d(80px, 20px, 0);
- }
- 75% {
- transform: translate3d(30px, 50px, 0);
- }
+.video-preview-panel.ant-card {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ min-height: 0;
+ border-color: var(--border-subtle);
+ border-radius: 12px;
+ background: var(--surface-card);
}
-/* 动态光晕2 - 反向飘动 */
-@keyframes videoPreviewFloat2 {
- 0%,
- 100% {
- transform: translate3d(0, 0, 0);
- }
- 25% {
- transform: translate3d(-60px, 40px, 0);
- }
- 50% {
- transform: translate3d(-30px, -50px, 0);
- }
- 75% {
- transform: translate3d(-70px, -20px, 0);
- }
+.video-preview-panel > .ant-card-body {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ min-width: 0;
+ min-height: 0;
+ padding: 0;
}
-/* 脉动效果 */
-@keyframes videoPreviewPulse {
- 0%,
- 100% {
- opacity: 0.4;
- transform: scale(1);
+.video-preview-header {
+ flex-wrap: wrap;
+}
+
+.video-preview-actions {
+ display: flex;
+ flex: 1;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: flex-end;
+ gap: 8px 12px;
+ min-width: 0;
+}
+
+.video-preview-actions .ant-typography {
+ overflow-wrap: anywhere;
+}
+
+.video-generate-button {
+ font-weight: 600;
+}
+
+.video-preview-stage {
+ flex: 1;
+ min-height: 0;
+ overflow: auto;
+ border-end-start-radius: 11px;
+ border-end-end-radius: 11px;
+}
+
+.video-preview-empty {
+ --vp-stage: color-mix(in srgb, var(--text-primary) 4%, var(--surface-card));
+ display: grid;
+ align-content: center;
+ justify-items: center;
+ gap: 10px;
+ height: calc(100% - 32px);
+ min-height: 180px;
+ margin: 16px;
+ padding: 24px;
+ border: 1px dashed var(--border-subtle);
+ border-radius: 10px;
+ background: var(--vp-stage);
+ text-align: center;
+}
+
+.video-preview-empty-icon {
+ width: 56px;
+ height: 56px;
+ margin-bottom: 4px;
+}
+
+.video-preview-empty h3 {
+ margin: 0;
+ color: var(--text-primary);
+ font-size: 18px;
+ font-weight: 650;
+}
+
+.video-preview-empty p {
+ margin: 0;
+ color: var(--text-secondary);
+ font-size: 13px;
+ line-height: 20px;
+}
+
+@media (max-width: 767px) {
+ .video-preview-header {
+ align-items: flex-start;
+ flex-direction: column;
}
- 50% {
- opacity: 1;
- transform: scale(1.1);
+
+ .video-preview-actions {
+ justify-content: flex-start;
+ width: 100%;
+ }
+
+ .video-help-button {
+ margin-inline-start: auto;
+ }
+
+ .video-preview-empty {
+ height: auto;
+ min-height: 190px;
+ margin: 12px;
+ padding: 16px;
}
}
-
-/* 动画类 - GPU 加速 */
-.video-preview-glow1 {
- animation: videoPreviewFloat1 12s ease-in-out infinite;
- will-change: transform;
- backface-visibility: hidden;
-}
-
-.video-preview-glow2 {
- animation: videoPreviewFloat2 15s ease-in-out infinite;
- will-change: transform;
- backface-visibility: hidden;
-}
-
-.video-preview-glow3 {
- animation: videoPreviewPulse 6s ease-in-out infinite;
- will-change: opacity, transform;
-}
diff --git a/src/pages/ExperienceCenter/components/AICreation/Video/VideoPreviewPanel.jsx b/src/pages/ExperienceCenter/components/AICreation/Video/VideoPreviewPanel.jsx
index 6f446c54..02a29b06 100644
--- a/src/pages/ExperienceCenter/components/AICreation/Video/VideoPreviewPanel.jsx
+++ b/src/pages/ExperienceCenter/components/AICreation/Video/VideoPreviewPanel.jsx
@@ -91,7 +91,6 @@ const VideoPreviewPanel = ({
videoMaxHeight: '600px',
buttonSize: 'large',
titleSize: 4,
- iconSize: 64,
progressWidth: 120,
};
}
@@ -102,7 +101,6 @@ const VideoPreviewPanel = ({
videoMaxHeight: '500px',
buttonSize: 'default',
titleSize: 5,
- iconSize: 56,
progressWidth: 100,
};
}
@@ -113,7 +111,6 @@ const VideoPreviewPanel = ({
videoMaxHeight: '400px',
buttonSize: 'default',
titleSize: 5,
- iconSize: 48,
progressWidth: 90,
};
}
@@ -124,7 +121,6 @@ const VideoPreviewPanel = ({
videoMaxHeight: '350px',
buttonSize: 'small',
titleSize: 6,
- iconSize: 40,
progressWidth: 80,
};
};
@@ -241,28 +237,8 @@ const VideoPreviewPanel = ({
const renderTopBar = () => {
// 优先显示从任务列表选择的任务
const displayTask = selectedTaskForPlay || currentTask;
- const normalizedStatus = normalizeVideoTaskStatus(displayTask?.status);
- const isCompleted = normalizedStatus === 'success';
-
- // 检查是否有视频URL
- let _hasVideo = false;
- if (displayTask) {
- const videoUrl = getVideoURLFromDetail(displayTask);
- _hasVideo = isCompleted && !!videoUrl;
- }
-
return (
-
768 ? '16px 20px' : '12px 16px',
- display: 'flex',
- alignItems: 'center',
- gap: '12px',
- backgroundColor: 'var(--ui-color-bg-1)',
- borderBottom: '1px solid var(--ui-color-border)',
- flexShrink: 0,
- }}
- >
+
{needTopUp ? (
{submitting
? t('提交中...')
@@ -344,8 +313,6 @@ const VideoPreviewPanel = ({
)}
-
-
@@ -368,11 +335,13 @@ const VideoPreviewPanel = ({
}
position='bottomRight'
- trigger='hover'
+ trigger={['hover', 'focus']}
showArrow={true}
>
}
+ className='video-help-button'
+ aria-label={t('使用提示')}
type='tertiary'
size={windowWidth > 768 ? 'default' : 'small'}
/>
@@ -702,199 +671,31 @@ const VideoPreviewPanel = ({
);
}
- // 默认空状态 - 纯CSS电影感动画背景(无网络资源消耗)
return (
-
- {/* CSS动画背景 - 流动光效(增强版) */}
-
- {/* 动态光晕1 - 紫色 */}
-
- {/* 动态光晕2 - 橙红色 */}
-
- {/* 动态光晕3 - 金色中心 */}
-
-
-
- {/* 电影宽银幕效果 - 上下黑边 */}
-
-
-
- {/* 中央内容区域 */}
-
-
1024 ? '32px' : '24px',
- marginBottom: windowWidth > 768 ? '32px' : '24px',
- border: '1px solid rgba(255, 255, 255, 0.2)',
- boxShadow: '0 8px 32px rgba(0, 0, 0, 0.3)',
- transition: 'transform 0.3s ease',
- }}
- onMouseEnter={(e) => {
- e.currentTarget.style.transform = 'scale(1.05)';
- }}
- onMouseLeave={(e) => {
- e.currentTarget.style.transform = 'scale(1)';
- }}
- >
-
-
-
-
- {t('AI 视频生成')}
-
-
-
768 ? '24px' : '16px',
- textAlign: 'center',
- fontSize: windowWidth > 768 ? '16px' : '14px',
- padding: '0 16px',
- color: 'rgba(255, 255, 255, 0.7)',
- maxWidth: '500px',
- lineHeight: '1.8',
- textShadow: '0 2px 8px rgba(0, 0, 0, 0.5)',
- }}
- >
- {formData.mode === 'text2video'
- ? t('输入提示词,让 AI 为你创造精彩视频')
- : t('上传图片并输入提示词,生成动态视频')}
-
-
+
+
+
+
+
{t('AI 视频生成')}
+
+ {formData.mode === 'text2video'
+ ? t('输入提示词,让 AI 为你创造精彩视频')
+ : t('上传图片并输入提示词,生成动态视频')}
+
);
};
return (
-
- {/* 始终显示的顶部操作栏 */}
- {renderTopBar()}
-
- {/* 内容区域 */}
- {renderPreview()}
+
+
+
+
+
{t('视频预览')}
+
+ {renderTopBar()}
+
+ {renderPreview()}
);
};
diff --git a/src/pages/ExperienceCenter/components/AICreation/Video/VideoTaskQueue.jsx b/src/pages/ExperienceCenter/components/AICreation/Video/VideoTaskQueue.jsx
index 24f5d9d9..5a513108 100644
--- a/src/pages/ExperienceCenter/components/AICreation/Video/VideoTaskQueue.jsx
+++ b/src/pages/ExperienceCenter/components/AICreation/Video/VideoTaskQueue.jsx
@@ -4,8 +4,9 @@ import {
RefreshCw as ActionRefreshCw,
Trash2 as ActionTrash2,
AlertCircle as ActionAlertCircle,
+ ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
-import React, { useState, useEffect } from 'react';
+import React, { useState, useId } from 'react';
import {
Table,
Button,
@@ -17,8 +18,7 @@ import {
Badge,
} from '@/components/ui';
import {
- ChevronUp,
- ChevronDown,
+ ListVideo,
CheckCircle2,
AlertCircle,
Clock,
@@ -47,32 +47,7 @@ const VideoTaskQueue = ({
// 8 列合计 1190px 塞进 ~340px 容器、按钮全带文字,实际完全用不了。
const isCompact = useIsMobile();
const [selectedTasks, setSelectedTasks] = useState([]);
- const [windowHeight, setWindowHeight] = useState(window.innerHeight);
-
- // 监听窗口高度变化
- useEffect(() => {
- const handleResize = () => {
- setWindowHeight(window.innerHeight);
- };
-
- window.addEventListener('resize', handleResize);
- return () => window.removeEventListener('resize', handleResize);
- }, []);
-
- // 计算任务队列高度:不超过屏幕高度的20%(五分之一)
- // 同时设置最小高度150px,最大高度300px
- const getQueueHeight = () => {
- const maxHeightPercent = windowHeight * 0.2; // 屏幕高度的20%
- // 手机端工具栏本身会换行占掉 ~100px,再按 20%(844px 屏上仅 169px)会让表格只剩
- // 不到 70px,连表头带分页都放不下。窄屏改用更宽松的下限。
- const minHeight = isCompact ? 300 : 150;
- const maxHeight = isCompact ? 420 : 300;
-
- // 在最小和最大值之间取适当的高度
- return Math.max(minHeight, Math.min(maxHeightPercent, maxHeight));
- };
-
- const queueHeight = getQueueHeight();
+ const queueId = useId();
// 状态标签映射
const getStatusTag = (status) => {
@@ -303,65 +278,30 @@ const VideoTaskQueue = ({
};
return (
- <>
- {/* 折叠触发器 */}
- setVisible(!visible)}
- >
-
- {visible ? : }
-
- {t('任务队列')} ({taskStats.total})
-
+
+
+ setVisible(!visible)}
+ >
+
+ {t('任务队列')}
+ {taskStats.total}
{taskStats.in_progress > 0 && (
)}
-
-
-
- {/* 任务队列抽屉 */}
-
- {/* 工具栏 */}
-
+
+
+
+
+
{/* 任务表格 */}
-
- >
+
);
};
diff --git a/src/pages/ExperienceCenter/components/AICreation/Video/VideoWorkspace.css b/src/pages/ExperienceCenter/components/AICreation/Video/VideoWorkspace.css
new file mode 100644
index 00000000..3bec40cd
--- /dev/null
+++ b/src/pages/ExperienceCenter/components/AICreation/Video/VideoWorkspace.css
@@ -0,0 +1,211 @@
+.video-workspace {
+ display: flex;
+ flex-direction: column;
+ gap: 20px;
+ height: 100%;
+ padding: 24px;
+ overflow: auto;
+}
+
+.video-workspace-heading,
+.video-panel-heading {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ min-width: 0;
+}
+
+.video-workspace-icon,
+.video-preview-empty-icon {
+ display: grid;
+ flex: none;
+ place-items: center;
+ width: 46px;
+ height: 46px;
+ color: var(--brand-selection-text);
+ background: var(--brand-selection-bg);
+ border-radius: 10px;
+}
+
+.video-workspace-heading h1 {
+ margin: 0;
+ color: var(--text-primary);
+ font-size: 28px;
+ font-weight: 650;
+ line-height: 32px;
+}
+
+.video-workspace-heading p {
+ margin: 4px 0 0;
+ color: var(--text-secondary);
+ font-size: 13px;
+}
+
+.video-workspace-body {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: 16px;
+ height: 100%;
+ min-height: 0;
+ min-width: 0;
+}
+
+.video-workspace-grid {
+ display: grid;
+ flex: 1;
+ grid-template-columns: clamp(312px, 26%, 420px) minmax(0, 1fr);
+ gap: 16px;
+ min-height: 310px;
+}
+
+.video-workspace-composer {
+ display: flex;
+ align-items: flex-start;
+ min-width: 0;
+ min-height: 0;
+}
+
+.video-panel-header {
+ display: flex;
+ flex: none;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ min-height: 57px;
+ padding: 10px 16px;
+ border-bottom: 1px solid var(--border-subtle);
+}
+
+.video-panel-header:last-child {
+ border-bottom: 0;
+}
+
+.video-panel-heading {
+ gap: 8px;
+ color: var(--brand-accent);
+}
+
+.video-panel-heading h2 {
+ margin: 0;
+ color: var(--text-primary);
+ font-size: 15px;
+ font-weight: 600;
+ line-height: 22px;
+}
+
+.video-queue {
+ flex: none;
+ min-width: 0;
+ background: var(--surface-card);
+ border: 1px solid var(--border-subtle);
+ border-radius: 12px;
+}
+
+.video-queue-heading {
+ margin: 0;
+}
+
+.video-queue-toggle {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ width: 100%;
+ min-height: 52px;
+ padding: 8px 16px;
+ border: 0;
+ border-radius: 11px;
+ background: transparent;
+ color: var(--text-primary);
+ text-align: start;
+ font: inherit;
+ font-size: 15px;
+ font-weight: 600;
+ cursor: pointer;
+}
+
+.video-queue-toggle > svg:first-child {
+ color: var(--brand-accent);
+}
+
+.video-queue-toggle:hover {
+ background: var(--surface-bg-base);
+}
+
+.video-queue-toggle:focus-visible {
+ outline: 2px solid var(--brand-accent);
+ outline-offset: -3px;
+}
+
+.video-queue-toggle[aria-expanded='true'] {
+ border-end-start-radius: 0;
+ border-end-end-radius: 0;
+}
+
+.video-queue-count {
+ min-width: 23px;
+ padding: 2px 6px;
+ border-radius: 6px;
+ background: var(--surface-bg-base);
+ color: var(--text-secondary);
+ text-align: center;
+ font-size: 12px;
+ font-variant-numeric: tabular-nums;
+}
+
+.video-queue-chevron {
+ margin-inline-start: auto;
+ color: var(--text-secondary);
+}
+
+.video-queue-toggle[aria-expanded='true'] .video-queue-chevron {
+ transform: rotate(180deg);
+}
+
+.video-queue-content {
+ border-top: 1px solid var(--border-subtle);
+}
+
+.video-queue-toolbar {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: space-between;
+ gap: 8px 16px;
+ padding: 10px 16px;
+ border-bottom: 1px solid var(--border-subtle);
+}
+
+.video-queue-table {
+ min-width: 0;
+ max-height: clamp(120px, 24dvh, 260px);
+ overflow: auto;
+ border-end-start-radius: 11px;
+ border-end-end-radius: 11px;
+}
+
+@media (max-width: 1024px) {
+ .video-workspace {
+ gap: 16px;
+ padding: 16px;
+ }
+
+ .video-workspace-body {
+ flex: none;
+ height: auto;
+ }
+
+ .video-workspace-grid {
+ grid-template-columns: minmax(0, 1fr);
+ min-height: 0;
+ }
+
+ .video-workspace-heading h1 {
+ font-size: 24px;
+ line-height: 28px;
+ }
+
+ .video-queue-table {
+ max-height: 320px;
+ }
+}
diff --git a/src/pages/ExperienceCenter/components/AICreation/VideoGenerationTab.jsx b/src/pages/ExperienceCenter/components/AICreation/VideoGenerationTab.jsx
index e596628a..745627e8 100644
--- a/src/pages/ExperienceCenter/components/AICreation/VideoGenerationTab.jsx
+++ b/src/pages/ExperienceCenter/components/AICreation/VideoGenerationTab.jsx
@@ -1,31 +1,21 @@
-import React, { useState, useEffect, useRef } from 'react';
+import React, { useState, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import VideoInputPanel from './Video/VideoInputPanel';
import VideoPreviewPanel from './Video/VideoPreviewPanel';
import VideoTaskQueue from './Video/VideoTaskQueue';
import { useVideoGeneration } from '../../../../hooks/video/useVideoGeneration';
import { showInfo } from '../../../../helpers';
+import './Video/VideoWorkspace.css';
const VideoGenerationTab = () => {
const { t } = useTranslation();
const [leftPanelCollapsed, setLeftPanelCollapsed] = useState(false);
const [taskQueueVisible, setTaskQueueVisible] = useState(false);
- const [windowWidth, setWindowWidth] = useState(window.innerWidth);
const [selectedTaskForPlay, setSelectedTaskForPlay] = useState(null);
// 输入面板容器:再生成回填后滚动到面板顶部
const inputPanelRef = useRef(null);
const inputScrollRef = useRef(null);
- // 监听窗口大小变化
- useEffect(() => {
- const handleResize = () => {
- setWindowWidth(window.innerWidth);
- };
-
- window.addEventListener('resize', handleResize);
- return () => window.removeEventListener('resize', handleResize);
- }, []);
-
const creation = useVideoGeneration();
const {
// 表单数据
@@ -95,197 +85,52 @@ const VideoGenerationTab = () => {
showInfo(t('已回填原参数,确认后点击生成'));
// 等面板展开渲染后再滚动
requestAnimationFrame(() => {
- inputScrollRef.current?.scrollTo?.({ top: 0, behavior: 'smooth' });
+ inputScrollRef.current?.scrollTo?.({ top: 0 });
inputPanelRef.current?.scrollIntoView?.({
- behavior: 'smooth',
block: 'start',
});
});
};
- // 响应式布局配置 - 两列布局(左侧配置区 + 右侧预览区)
- const getLayoutConfig = () => {
- // 超大屏幕 (>1920px): 25% - 75%
- if (windowWidth > 1920) {
- return {
- leftWidth: '25%',
- centerWidth: '75%',
- minLeftWidth: '350px',
- minCenterWidth: '800px',
- direction: 'row',
- };
- }
- // 大屏幕 (1600-1920px): 28% - 72%
- if (windowWidth > 1600) {
- return {
- leftWidth: '28%',
- centerWidth: '72%',
- minLeftWidth: '320px',
- minCenterWidth: '700px',
- direction: 'row',
- };
- }
- // 中等屏幕 (1280-1600px): 32% - 68%
- if (windowWidth > 1280) {
- return {
- leftWidth: '32%',
- centerWidth: '68%',
- minLeftWidth: '300px',
- minCenterWidth: '600px',
- direction: 'row',
- };
- }
- // 小屏幕 (1024-1280px): 35% - 65%
- if (windowWidth > 1024) {
- return {
- leftWidth: '35%',
- centerWidth: '65%',
- minLeftWidth: '280px',
- minCenterWidth: '500px',
- direction: 'row',
- };
- }
- // 超小屏幕 (<1024px): 单列布局
- return {
- leftWidth: '100%',
- centerWidth: '100%',
- minLeftWidth: '100%',
- minCenterWidth: '100%',
- direction: 'column',
- };
- };
-
- const layoutConfig = getLayoutConfig();
-
return (
-
-
- {/* 左侧:输入区域(区域1) */}
-
-
- setLeftPanelCollapsed(!leftPanelCollapsed)}
- collapsed={leftPanelCollapsed}
- collapsible={layoutConfig.direction === 'row'}
- />
-
+
+
+
+ setLeftPanelCollapsed((current) => !current)}
+ scrollRef={inputScrollRef}
+ />
-
- {/* 右侧:预览+生成区域 */}
-
-
768 ? '16px' : '12px',
- overflow: 'auto',
- }}
- >
-
-
-
-
-
- {/* 底部:任务队列(区域4) - 使用 absolute 定位,相对于父容器 */}
-
-
+
);
};
diff --git a/src/pages/ExperienceCenter/components/VideoGeneration.jsx b/src/pages/ExperienceCenter/components/VideoGeneration.jsx
index ac3ebdc7..6765b83e 100644
--- a/src/pages/ExperienceCenter/components/VideoGeneration.jsx
+++ b/src/pages/ExperienceCenter/components/VideoGeneration.jsx
@@ -1,6 +1,6 @@
import React, { useContext } from 'react';
import { useTranslation } from 'react-i18next';
-import { Video, Sparkles, Clapperboard, Film, Play } from 'lucide-react';
+import { Video } from 'lucide-react';
import VideoGenerationTab from './AICreation/VideoGenerationTab';
import CreationStudio from '../../../components/creation/CreationStudio';
import { StatusContext } from '../../../context/Status';
@@ -16,81 +16,17 @@ const VideoGeneration = () => {
}
return (
-
- {/* 背景由父级 ExperienceCenter 的 PageBackground(rich) 统一提供,此处不再渲染 */}
-
- {/* Header */}
-
-
- {/* 图标容器 */}
-
-
-
-
-
-
-
- {/* 播放动画指示器 */}
-
-
-
- {/* 标题文字 */}
-
-
-
- {t('视频生成')}
-
-
-
- {t('使用 AI 创建令人惊叹的视频内容')}
-
-
-
- {/* 右侧装饰标签 */}
-
-
-
-
- {t('图生视频')}
-
-
-
-
-
- {t('文生视频')}
-
-
-
-
-
- {t('多模型支持')}
-
-
-
+
+
+
+
+
+
+
{t('视频生成')}
+
{t('使用 AI 创建令人惊叹的视频内容')}
-
-
- {/* Content */}
-
- {/* 卡片装饰边框 */}
-
-
- {/* 内容卡片 */}
-
- {/* 顶部装饰线 */}
-
-
- {/* 左侧装饰线 */}
-
-
-
-
-
+
+
);
};
diff --git a/src/pages/ExperienceCenter/index.jsx b/src/pages/ExperienceCenter/index.jsx
index 7b1bb1a3..1f989749 100644
--- a/src/pages/ExperienceCenter/index.jsx
+++ b/src/pages/ExperienceCenter/index.jsx
@@ -190,12 +190,16 @@ const ExperienceCenter = () => {
* 子组件不再各自渲染背景,避免双层叠加。
* text-model 特例:TextModel 自带 via-white 亮底保证聊天可读性,由其自身渲染,此处跳过。
* 沉浸式生成页(视频/图片)用 rich 大光球,密钥管理(Token 列表)用 subtle。 */}
- {!isTextModel && (
-
- )}
+ {!isTextModel &&
+ (!(isVideoGeneration || isImageGeneration) ||
+ creationStudioEnabled) && (
+
+ )}
{/* 内容区域 */}