Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6080eda584 | |||
| fca6543445 | |||
| 41ce8b5e58 | |||
| b7b19d01f6 |
@@ -10,6 +10,46 @@
|
|||||||
|
|
||||||
## 2026-11-20
|
## 2026-11-20
|
||||||
|
|
||||||
|
### 优化 · 体验中心视频生成工作区
|
||||||
|
|
||||||
|
- **范围**:视频生成页的参数面板、视频预览和任务队列。
|
||||||
|
- **变更**:以图片生成工作区的描边卡片为基准,统一标题、控件和空态;参数面板与任务队列可通过键盘折叠,任务队列不再遮挡预览;表单滚动区保留高级参数的展开高度,避免队列展开或窗口较矮时压缩折叠项。
|
||||||
|
- **影响**:跟随系统主题配置;保持模型、视频生成、计价、任务和灰度开关契约。
|
||||||
|
- **回滚**:仅逆向恢复本条对应的页面结构和样式。
|
||||||
|
- **关联**:`src/pages/ExperienceCenter/components/AICreation/VideoGenerationTab.jsx`、`src/pages/ExperienceCenter/components/AICreation/Video/VideoWorkspace.css`。
|
||||||
|
|
||||||
|
### 修复 · 官网设置品牌名称对齐
|
||||||
|
|
||||||
|
- **范围**:控制台官网设置的关于页签、说明、首页共用提示及校验提示。
|
||||||
|
- **变更**:统一使用“微元算力”,同步九个语言包。
|
||||||
|
- **影响**:不改变配置结构、表单校验或保存逻辑;联调存量文案仅替换实查命中的文章标题和正文。
|
||||||
|
- **回滚**:逆向恢复本条的文案差异;如需回滚联调数据,先比对最新配置与保存前备份,只恢复本次变动的两处,避免覆盖后续编辑。
|
||||||
|
- **关联**:`src/pages/WebsiteSettings/model.js`、`src/i18n/locales/`、`/api/website/page-config`。
|
||||||
|
|
||||||
|
### 优化 · 图片生成创作表单
|
||||||
|
|
||||||
|
- **范围**:体验中心图片生成页左侧创作表单。
|
||||||
|
- **变更**:固定桌面端标题与生成区,归组模型和生成方式,整合提示词工具、模板、参考图与参数的视觉层次;移动端可收起表单并保留生成操作。
|
||||||
|
- **影响**:沿用系统主题色与现有生成、引用、计价流程;右侧历史不变。
|
||||||
|
- **回滚**:仅逆向恢复本条对应的表单结构和局部样式差异。
|
||||||
|
- **关联**:`src/pages/ExperienceCenter/components/AICreation/ImageGenerationForm.jsx`、`src/pages/ExperienceCenter/components/AICreation/Image/ImageGenerationForm.css`、`src/pages/ExperienceCenter/components/AICreation/Image/ImageSizePicker.jsx`。
|
||||||
|
|
||||||
|
### 优化 · 体验中心图片生成工作区
|
||||||
|
|
||||||
|
- **范围**:图片生成页的双栏工作区、创作表单和生成历史。
|
||||||
|
- **变更**:以模型超市的描边卡片为参考,统一缩略图、状态占位和操作区;窄屏堆叠,选中和焦点状态跟随系统主题色。
|
||||||
|
- **影响**:保留任务、模型和计价流程;历史卡片在各显示密度下均可打开详情和操作菜单。
|
||||||
|
- **回滚**:逆向恢复本条的页面布局、表单及历史卡片差异。
|
||||||
|
- **关联**:`src/pages/ExperienceCenter/components/AICreation/ImageGenerationTab.jsx`、`ImageGenerationForm.jsx`、`ImageTaskList.jsx`。
|
||||||
|
|
||||||
|
### 修复 · 风控看板自动封号历史
|
||||||
|
|
||||||
|
- 复用运营看板折叠面板外框,展开时由分隔线连接标题和内容;保留默认展开、筛选、刷新、分页与解封行为。
|
||||||
|
|
||||||
|
### 修复 · 控制台调用质量维度分布
|
||||||
|
|
||||||
|
- 对齐维度页签、数据来源提示和表格间距;表格随内容增高,空态不滚动,仅数据列超宽时支持横向滚动。保留排序、下钻与前 50 项查询规则。
|
||||||
|
|
||||||
### 性能 · 开发预热与公共首屏分包
|
### 性能 · 开发预热与公共首屏分包
|
||||||
|
|
||||||
- **范围**:Vite 开发和生产配置、应用启动、首页和认证页的加载边界。
|
- **范围**:Vite 开发和生产配置、应用启动、首页和认证页的加载边界。
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
import { Select, Table, TabPane, Tabs, Tooltip } from '@/components/ui';
|
import { Select, Table, TabPane, Tabs, Tooltip } from '@/components/ui';
|
||||||
import { Layers } from 'lucide-react';
|
import { Layers } from 'lucide-react';
|
||||||
|
import { useIsMobile } from '@/hooks/common/useIsMobile';
|
||||||
import {
|
import {
|
||||||
ORDER_OPTIONS,
|
ORDER_OPTIONS,
|
||||||
ORG_DIMS,
|
ORG_DIMS,
|
||||||
@@ -27,6 +28,8 @@ export const RateBar = ({ value }) => (
|
|||||||
/** 维度分布:每行可点击,把该维度值加入筛选(下钻) */
|
/** 维度分布:每行可点击,把该维度值加入筛选(下钻) */
|
||||||
const QualityBreakdown = ({ quality, t }) => {
|
const QualityBreakdown = ({ quality, t }) => {
|
||||||
const { scope, get, params, setFilters } = quality;
|
const { scope, get, params, setFilters } = quality;
|
||||||
|
const isPlatform = scope !== 'org';
|
||||||
|
const isMobile = useIsMobile();
|
||||||
const dims = scope === 'org' ? ORG_DIMS : PLATFORM_DIMS;
|
const dims = scope === 'org' ? ORG_DIMS : PLATFORM_DIMS;
|
||||||
const [dim, setDim] = useState('model');
|
const [dim, setDim] = useState('model');
|
||||||
const [orderBy, setOrderBy] = useState('total');
|
const [orderBy, setOrderBy] = useState('total');
|
||||||
@@ -171,6 +174,9 @@ const QualityBreakdown = ({ quality, t }) => {
|
|||||||
setFilters({ [dimSpec.filterKey]: row.key });
|
setFilters({ [dimSpec.filterKey]: row.key });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const rows = data?.rows || [];
|
||||||
|
const isPlatformEmpty = isPlatform && rows.length === 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='quality-card'>
|
<div className='quality-card'>
|
||||||
<div className='quality-card-head'>
|
<div className='quality-card-head'>
|
||||||
@@ -189,7 +195,9 @@ const QualityBreakdown = ({ quality, t }) => {
|
|||||||
onChange={setOrderBy}
|
onChange={setOrderBy}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className='quality-card-body quality-nested-tabs'>
|
<div
|
||||||
|
className={`quality-card-body quality-nested-tabs${isPlatform ? ' quality-breakdown-body' : ''}`}
|
||||||
|
>
|
||||||
<Tabs type='button' size='small' activeKey={dim} onChange={setDim}>
|
<Tabs type='button' size='small' activeKey={dim} onChange={setDim}>
|
||||||
{dims.map((d) => (
|
{dims.map((d) => (
|
||||||
<TabPane key={d.value} itemKey={d.value} tab={t(d.label)} />
|
<TabPane key={d.value} itemKey={d.value} tab={t(d.label)} />
|
||||||
@@ -199,17 +207,37 @@ const QualityBreakdown = ({ quality, t }) => {
|
|||||||
<QualityMetaNotice meta={data.meta} scope={scope} t={t} />
|
<QualityMetaNotice meta={data.meta} scope={scope} t={t} />
|
||||||
)}
|
)}
|
||||||
{error ? (
|
{error ? (
|
||||||
<div className='quality-empty'>{qualityErrorText(t, error)}</div>
|
<div className={isPlatform ? 'quality-breakdown-result' : undefined}>
|
||||||
|
<div className='quality-empty'>{qualityErrorText(t, error)}</div>
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className='overflow-x-auto app-scrollbar mt-2'>
|
<div
|
||||||
|
className={
|
||||||
|
isPlatform
|
||||||
|
? 'quality-breakdown-result'
|
||||||
|
: 'overflow-x-auto app-scrollbar mt-2'
|
||||||
|
}
|
||||||
|
>
|
||||||
<Table
|
<Table
|
||||||
|
className={
|
||||||
|
isPlatformEmpty ? 'quality-breakdown-empty' : undefined
|
||||||
|
}
|
||||||
size='small'
|
size='small'
|
||||||
rowKey={(row) => `${row.key}|${row.key2 || ''}`}
|
rowKey={(row) => `${row.key}|${row.key2 || ''}`}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
columns={columns}
|
columns={
|
||||||
dataSource={data?.rows || []}
|
isPlatformEmpty
|
||||||
|
? (isMobile ? columns.slice(0, 1) : columns).map(
|
||||||
|
(column) => ({
|
||||||
|
...column,
|
||||||
|
width: undefined,
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
: columns
|
||||||
|
}
|
||||||
|
dataSource={rows}
|
||||||
pagination={false}
|
pagination={false}
|
||||||
scroll={{ x: 960 }}
|
scroll={{ x: isPlatformEmpty ? undefined : 960 }}
|
||||||
onRow={(row) =>
|
onRow={(row) =>
|
||||||
canDrill(row)
|
canDrill(row)
|
||||||
? {
|
? {
|
||||||
@@ -224,11 +252,11 @@ const QualityBreakdown = ({ quality, t }) => {
|
|||||||
}
|
}
|
||||||
empty={<div className='quality-empty'>{t('暂无数据')}</div>}
|
empty={<div className='quality-empty'>{t('暂无数据')}</div>}
|
||||||
/>
|
/>
|
||||||
{data && data.total_rows > (data.rows || []).length && (
|
{data && data.total_rows > rows.length && (
|
||||||
<div className='mt-2 text-xs text-[var(--text-secondary)]'>
|
<div className='mt-2 text-xs text-[var(--text-secondary)]'>
|
||||||
{t('共 {{total}} 项,仅展示排序后的前 {{shown}} 项', {
|
{t('共 {{total}} 项,仅展示排序后的前 {{shown}} 项', {
|
||||||
total: data.total_rows,
|
total: data.total_rows,
|
||||||
shown: (data.rows || []).length,
|
shown: rows.length,
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -63,6 +63,32 @@
|
|||||||
padding: 16px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.quality-breakdown-body {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
padding-block-start: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quality-breakdown-body .ant-tabs > .ant-tabs-nav {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quality-breakdown-result {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.quality-breakdown-empty .ant-table-thead > tr > th {
|
||||||
|
white-space: normal;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 680px) {
|
||||||
|
.quality-breakdown-body .ant-tabs .ant-tabs-tab + .ant-tabs-tab {
|
||||||
|
margin-inline-start: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 筛选栏 */
|
/* 筛选栏 */
|
||||||
.quality-filter-grid {
|
.quality-filter-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|||||||
@@ -11356,7 +11356,10 @@
|
|||||||
"官网展示:{{value}}": "Website display: {{value}}",
|
"官网展示:{{value}}": "Website display: {{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · R&D ratio {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · R&D ratio {{ratio}}",
|
||||||
"降幅": "reduction",
|
"降幅": "reduction",
|
||||||
"首页与关于微词元共用": "shared by Home and About",
|
"关于微元算力": "About 微元算力",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "Configure the team and service information shown in the About 微元算力 section.",
|
||||||
|
"首页与关于微元算力共用": "Shared by Home and About 微元算力",
|
||||||
|
"请完善关于微元算力的配置": "Please complete the About 微元算力 configuration",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "All four tabs share one configuration. Saving validates and submits all settings together.",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "All four tabs share one configuration. Saving validates and submits all settings together.",
|
||||||
"富文本工具栏": "Rich text toolbar",
|
"富文本工具栏": "Rich text toolbar",
|
||||||
"正文段落": "Body paragraph",
|
"正文段落": "Body paragraph",
|
||||||
|
|||||||
@@ -10788,7 +10788,10 @@
|
|||||||
"官网展示:{{value}}": "Affichage sur le site : {{value}}",
|
"官网展示:{{value}}": "Affichage sur le site : {{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · part R&D {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · part R&D {{ratio}}",
|
||||||
"降幅": "baisse",
|
"降幅": "baisse",
|
||||||
"首页与关于微词元共用": "partagé entre Accueil et À propos",
|
"关于微元算力": "À propos de 微元算力",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "Configurez les informations sur l’équipe et les services affichées dans la rubrique À propos de 微元算力.",
|
||||||
|
"首页与关于微元算力共用": "Commun à l’accueil et à la rubrique À propos de 微元算力",
|
||||||
|
"请完善关于微元算力的配置": "Veuillez compléter la configuration de la rubrique À propos de 微元算力",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "Les quatre onglets partagent une configuration et sont soumis uniformément à la vérification et à la validation lorsqu 'ils sont sauvegardés.",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "Les quatre onglets partagent une configuration et sont soumis uniformément à la vérification et à la validation lorsqu 'ils sont sauvegardés.",
|
||||||
"结算状态: {{label}}": "Statut du règlement: {{label}}",
|
"结算状态: {{label}}": "Statut du règlement: {{label}}",
|
||||||
"确认未生效:授权、凭据或操作内容已变化,请刷新任务后重试。": "La confirmation n'est pas effective: l'autorisation, les informations d'identification ou le contenu de l'action ont changé, veuillez actualiser la tâche et réessayer.",
|
"确认未生效:授权、凭据或操作内容已变化,请刷新任务后重试。": "La confirmation n'est pas effective: l'autorisation, les informations d'identification ou le contenu de l'action ont changé, veuillez actualiser la tâche et réessayer.",
|
||||||
|
|||||||
@@ -11330,7 +11330,10 @@
|
|||||||
"官网展示:{{value}}": "公式サイト表示:{{value}}",
|
"官网展示:{{value}}": "公式サイト表示:{{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · 研究開発比率 {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · 研究開発比率 {{ratio}}",
|
||||||
"降幅": "削減率",
|
"降幅": "削減率",
|
||||||
"首页与关于微词元共用": "ホームと会社概要で共用",
|
"关于微元算力": "微元算力について",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "公式サイトの「微元算力について」に表示するチームとサービスの情報を設定します。",
|
||||||
|
"首页与关于微元算力共用": "ホームと「微元算力について」で共用",
|
||||||
|
"请完善关于微元算力的配置": "「微元算力について」の設定を完了してください",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "4つのタブは1つの構成を共有し、保存時に均一に検証およびコミットされます。",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "4つのタブは1つの構成を共有し、保存時に均一に検証およびコミットされます。",
|
||||||
"富文本工具栏": "リッチテキストツールバー",
|
"富文本工具栏": "リッチテキストツールバー",
|
||||||
"正文段落": "本文段落",
|
"正文段落": "本文段落",
|
||||||
|
|||||||
@@ -11334,7 +11334,10 @@
|
|||||||
"官网展示:{{value}}": "웹사이트 표시: {{value}}",
|
"官网展示:{{value}}": "웹사이트 표시: {{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · R&D 비율 {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · R&D 비율 {{ratio}}",
|
||||||
"降幅": "감소폭",
|
"降幅": "감소폭",
|
||||||
"首页与关于微词元共用": "홈과 회사 소개에서 공용",
|
"关于微元算力": "미원산력 소개",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "공식 웹사이트의 미원산력 소개에 표시할 팀 및 서비스 정보를 설정합니다.",
|
||||||
|
"首页与关于微元算力共用": "홈과 미원산력 소개에서 공용",
|
||||||
|
"请完善关于微元算力的配置": "미원산력 소개 설정을 완료해 주세요",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "네 개의 탭은 구성을 공유하며, 이 구성은 저장 시 확인되고 제출됩니다.",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "네 개의 탭은 구성을 공유하며, 이 구성은 저장 시 확인되고 제출됩니다.",
|
||||||
"富文本工具栏": "서식 있는 텍스트 도구 모음",
|
"富文本工具栏": "서식 있는 텍스트 도구 모음",
|
||||||
"正文段落": "본문 단락",
|
"正文段落": "본문 단락",
|
||||||
|
|||||||
@@ -10540,7 +10540,10 @@
|
|||||||
"官网展示:{{value}}": "На сайте: {{value}}",
|
"官网展示:{{value}}": "На сайте: {{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · доля R&D {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · доля R&D {{ratio}}",
|
||||||
"降幅": "снижение",
|
"降幅": "снижение",
|
||||||
"首页与关于微词元共用": "общее для главной и раздела «О нас»",
|
"关于微元算力": "О компании 微元算力",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "Настройте сведения о команде и услугах в разделе «О компании 微元算力».",
|
||||||
|
"首页与关于微元算力共用": "Общее для главной и раздела «О компании 微元算力»",
|
||||||
|
"请完善关于微元算力的配置": "Завершите настройку раздела «О компании 微元算力»",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "Четыре страницы совместно используют один экземпляр конфигурации, при сохранении будет проведена единая проверка и отправка.",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "Четыре страницы совместно используют один экземпляр конфигурации, при сохранении будет проведена единая проверка и отправка.",
|
||||||
"{{count}} 处非法输入": "{{count}} неверный вход (ы)",
|
"{{count}} 处非法输入": "{{count}} неверный вход (ы)",
|
||||||
"{{count}} 个已验证渠道": "{{count}} верифицированные каналы",
|
"{{count}} 个已验证渠道": "{{count}} верифицированные каналы",
|
||||||
|
|||||||
@@ -11330,7 +11330,10 @@
|
|||||||
"官网展示:{{value}}": "แสดงบนเว็บไซต์: {{value}}",
|
"官网展示:{{value}}": "แสดงบนเว็บไซต์: {{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · สัดส่วน R&D {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · สัดส่วน R&D {{ratio}}",
|
||||||
"降幅": "ลดลง",
|
"降幅": "ลดลง",
|
||||||
"首页与关于微词元共用": "ใช้ร่วมกันระหว่างหน้าแรกและเกี่ยวกับเรา",
|
"关于微元算力": "เกี่ยวกับ 微元算力",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "กำหนดข้อมูลทีมและบริการที่แสดงในส่วนเกี่ยวกับ 微元算力 บนเว็บไซต์ทางการ",
|
||||||
|
"首页与关于微元算力共用": "ใช้ร่วมกันระหว่างหน้าแรกและส่วนเกี่ยวกับ 微元算力",
|
||||||
|
"请完善关于微元算力的配置": "โปรดกำหนดค่าส่วนเกี่ยวกับ 微元算力 ให้ครบถ้วน",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "แท็บทั้งสี่จะใช้การกําหนดค่าร่วมกันและจะได้รับการตรวจสอบและส่งเมื่อบันทึก",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "แท็บทั้งสี่จะใช้การกําหนดค่าร่วมกันและจะได้รับการตรวจสอบและส่งเมื่อบันทึก",
|
||||||
"富文本工具栏": "แถบเครื่องมือข้อความที่มีรูปแบบ",
|
"富文本工具栏": "แถบเครื่องมือข้อความที่มีรูปแบบ",
|
||||||
"正文段落": "ย่อหน้าเนื้อหา",
|
"正文段落": "ย่อหน้าเนื้อหา",
|
||||||
|
|||||||
@@ -11330,7 +11330,10 @@
|
|||||||
"官网展示:{{value}}": "Hiển thị trên website: {{value}}",
|
"官网展示:{{value}}": "Hiển thị trên website: {{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · tỷ lệ R&D {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · tỷ lệ R&D {{ratio}}",
|
||||||
"降幅": "mức giảm",
|
"降幅": "mức giảm",
|
||||||
"首页与关于微词元共用": "dùng chung cho Trang chủ và Giới thiệu",
|
"关于微元算力": "Giới thiệu 微元算力",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "Cấu hình thông tin đội ngũ và dịch vụ hiển thị trong mục Giới thiệu 微元算力 trên trang web chính thức.",
|
||||||
|
"首页与关于微元算力共用": "Dùng chung cho Trang chủ và Giới thiệu 微元算力",
|
||||||
|
"请完善关于微元算力的配置": "Vui lòng hoàn tất cấu hình mục Giới thiệu 微元算力",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "Bốn tab dùng chung một bản sao của bố trí và được kiểm tra và cam kết thống nhất khi bạn lưu lại.",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "Bốn tab dùng chung một bản sao của bố trí và được kiểm tra và cam kết thống nhất khi bạn lưu lại.",
|
||||||
"富文本工具栏": "Thanh công cụ văn bản có định dạng",
|
"富文本工具栏": "Thanh công cụ văn bản có định dạng",
|
||||||
"正文段落": "Đoạn văn bản",
|
"正文段落": "Đoạn văn bản",
|
||||||
|
|||||||
@@ -11330,7 +11330,10 @@
|
|||||||
"官网展示:{{value}}": "官網展示:{{value}}",
|
"官网展示:{{value}}": "官網展示:{{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · 研發佔比 {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · 研發佔比 {{ratio}}",
|
||||||
"降幅": "降幅",
|
"降幅": "降幅",
|
||||||
"首页与关于微词元共用": "首頁與關於微詞元共用",
|
"关于微元算力": "關於微元算力",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "設定官網關於微元算力區域顯示的團隊與服務資訊。",
|
||||||
|
"首页与关于微元算力共用": "首頁與關於微元算力共用",
|
||||||
|
"请完善关于微元算力的配置": "請完善關於微元算力的設定",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "四個頁籤共用一份配置,保存時將統一校驗並提交。",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "四個頁籤共用一份配置,保存時將統一校驗並提交。",
|
||||||
"富文本工具栏": "富文字工具列",
|
"富文本工具栏": "富文字工具列",
|
||||||
"正文段落": "內文段落",
|
"正文段落": "內文段落",
|
||||||
|
|||||||
@@ -11245,7 +11245,10 @@
|
|||||||
"官网展示:{{value}}": "官网展示:{{value}}",
|
"官网展示:{{value}}": "官网展示:{{value}}",
|
||||||
"{{team}} · 研发占比 {{ratio}}": "{{team}} · 研发占比 {{ratio}}",
|
"{{team}} · 研发占比 {{ratio}}": "{{team}} · 研发占比 {{ratio}}",
|
||||||
"降幅": "降幅",
|
"降幅": "降幅",
|
||||||
"首页与关于微词元共用": "首页与关于微词元共用",
|
"关于微元算力": "关于微元算力",
|
||||||
|
"配置官网关于微元算力区域展示的团队与服务信息。": "配置官网关于微元算力区域展示的团队与服务信息。",
|
||||||
|
"首页与关于微元算力共用": "首页与关于微元算力共用",
|
||||||
|
"请完善关于微元算力的配置": "请完善关于微元算力的配置",
|
||||||
"四个页签共用一份配置,保存时将统一校验并提交。": "四个页签共用一份配置,保存时将统一校验并提交。",
|
"四个页签共用一份配置,保存时将统一校验并提交。": "四个页签共用一份配置,保存时将统一校验并提交。",
|
||||||
"富文本工具栏": "富文本工具栏",
|
"富文本工具栏": "富文本工具栏",
|
||||||
"正文段落": "正文段落",
|
"正文段落": "正文段落",
|
||||||
|
|||||||
@@ -506,12 +506,12 @@ const Analytics = () => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{/* 自动封号历史 */}
|
{/* 自动封号历史 */}
|
||||||
<div className='mt-6 mb-6'>
|
<div className='analytics-fold-panel'>
|
||||||
<CollapsibleHeader
|
<CollapsibleHeader
|
||||||
icon={<History className='w-5 h-5' />}
|
icon={<History className='w-5 h-5' />}
|
||||||
title={t('自动封号历史')}
|
title={t('自动封号历史')}
|
||||||
isOpen={banLogsOpen}
|
isOpen={banLogsOpen}
|
||||||
onToggle={() => setBanLogsOpen(!banLogsOpen)}
|
onToggle={() => setBanLogsOpen((open) => !open)}
|
||||||
t={t}
|
t={t}
|
||||||
extra={
|
extra={
|
||||||
<span className='text-xs text-gray-400 ml-2'>
|
<span className='text-xs text-gray-400 ml-2'>
|
||||||
@@ -520,7 +520,7 @@ const Analytics = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Collapsible isOpen={banLogsOpen} keepDOM>
|
<Collapsible isOpen={banLogsOpen} keepDOM>
|
||||||
<div className='mt-2 px-5 py-4 bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-100 dark:border-gray-700'>
|
<div className='min-w-0 px-5 py-4'>
|
||||||
<RiskControlBanLogs
|
<RiskControlBanLogs
|
||||||
loading={risk.banLogLoading}
|
loading={risk.banLogLoading}
|
||||||
banLogs={risk.banLogs}
|
banLogs={risk.banLogs}
|
||||||
|
|||||||
@@ -7,12 +7,20 @@
|
|||||||
--igf-muted: var(--text-secondary);
|
--igf-muted: var(--text-secondary);
|
||||||
--igf-line: var(--border-subtle);
|
--igf-line: var(--border-subtle);
|
||||||
--igf-surface: var(--surface-card);
|
--igf-surface: var(--surface-card);
|
||||||
--igf-accent: var(--ui-color-primary);
|
--igf-accent: var(--brand-accent);
|
||||||
--igf-fill: color-mix(in srgb, var(--text-primary) 4%, var(--surface-card));
|
--igf-fill: color-mix(in srgb, var(--text-primary) 4%, var(--surface-card));
|
||||||
--igf-danger: var(--ui-color-danger);
|
--igf-danger: var(--ui-color-danger);
|
||||||
--igf-warning: var(--ui-color-warning);
|
--igf-warning: var(--ui-color-warning);
|
||||||
--igf-ring: color-mix(in srgb, var(--ui-color-primary) 55%, transparent);
|
--igf-ring: var(--brand-accent);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid var(--igf-line);
|
||||||
|
border-radius: 12px;
|
||||||
background: var(--igf-surface);
|
background: var(--igf-surface);
|
||||||
|
color: var(--igf-ink);
|
||||||
}
|
}
|
||||||
|
|
||||||
.igf-form-scroll {
|
.igf-form-scroll {
|
||||||
@@ -20,7 +28,182 @@
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 16px;
|
padding: 14px 16px 16px;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-form-scroll[hidden] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-header {
|
||||||
|
display: flex;
|
||||||
|
flex: none;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 15px 16px;
|
||||||
|
border-bottom: 1px solid var(--igf-line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-header-icon {
|
||||||
|
display: grid;
|
||||||
|
flex: none;
|
||||||
|
place-items: center;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 10px;
|
||||||
|
background: var(--brand-selection-bg);
|
||||||
|
color: var(--brand-selection-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-header-copy {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-header-actions {
|
||||||
|
display: flex;
|
||||||
|
flex: none;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 21px;
|
||||||
|
font-weight: 650;
|
||||||
|
line-height: 27px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-description {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
color: var(--igf-muted);
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 18px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-section + .igf-section {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-field-heading {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 650;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-configuration,
|
||||||
|
.igf-parameters {
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid var(--igf-line);
|
||||||
|
border-radius: 10px;
|
||||||
|
background: var(--igf-fill);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-mode-field {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-mode-group.cp-option-group {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
gap: 3px;
|
||||||
|
background: var(--igf-surface);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-mode-group .cp-option {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
padding-inline: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-mode-group .cp-option.is-selected {
|
||||||
|
border-color: var(--igf-accent);
|
||||||
|
background: var(--brand-selection-bg);
|
||||||
|
color: var(--brand-selection-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-editor {
|
||||||
|
border: 1px solid var(--igf-line);
|
||||||
|
border-radius: 10px;
|
||||||
|
background: var(--igf-fill);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-editor:focus-within {
|
||||||
|
border-color: var(--igf-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-editor textarea.ant-input {
|
||||||
|
min-height: 78px;
|
||||||
|
padding: 9px 10px;
|
||||||
|
resize: vertical;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-editor-toolbar,
|
||||||
|
.igf-editor-actions {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-editor-toolbar {
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 4px 6px;
|
||||||
|
border-top: 1px solid var(--igf-line);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-editor-actions .ant-btn {
|
||||||
|
padding-inline: 7px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-shortcut {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 3px;
|
||||||
|
padding: 1px 5px;
|
||||||
|
border: 1px solid var(--igf-line);
|
||||||
|
border-radius: 5px;
|
||||||
|
color: var(--igf-muted);
|
||||||
|
font-size: 11px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-history-item {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
max-width: min(280px, 70vw);
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-templates {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 6px;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-templates .ant-btn {
|
||||||
|
flex: 1 1 27%;
|
||||||
|
min-height: 28px;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-templates-label {
|
||||||
|
flex-basis: 100%;
|
||||||
|
color: var(--igf-muted);
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-generate .igf-submit.ant-btn {
|
||||||
|
height: 42px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Keep disabled generation actions grounded in the same surface and border token. */
|
/* Keep disabled generation actions grounded in the same surface and border token. */
|
||||||
@@ -139,13 +322,36 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.igf-slots {
|
.igf-slots {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-wrap: wrap;
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||||
gap: 10px;
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-slots .cp-slot {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
border-radius: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-reference-hint {
|
||||||
|
margin: 6px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-size .cp-option-group--ratio {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(min(100%, 78px), 1fr));
|
||||||
}
|
}
|
||||||
|
|
||||||
.igf-size .cp-option-group--ratio .cp-option {
|
.igf-size .cp-option-group--ratio .cp-option {
|
||||||
min-width: 64px;
|
gap: 3px;
|
||||||
|
min-width: 0;
|
||||||
|
padding: 6px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-size .cp-option-group--ratio .cp-option-label {
|
||||||
|
white-space: normal;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
}
|
}
|
||||||
|
|
||||||
.igf-size-dims {
|
.igf-size-dims {
|
||||||
@@ -175,6 +381,35 @@
|
|||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.igf-advanced-trigger {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
min-height: 34px;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border: 1px solid var(--igf-line);
|
||||||
|
border-radius: 8px;
|
||||||
|
color: var(--igf-muted);
|
||||||
|
font-size: 13px;
|
||||||
|
text-align: start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-advanced-trigger span {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-advanced-trigger:hover,
|
||||||
|
.igf-advanced-trigger[aria-expanded='true'] {
|
||||||
|
border-color: var(--igf-accent);
|
||||||
|
background: var(--brand-selection-bg);
|
||||||
|
color: var(--brand-selection-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.igf-advanced-content {
|
||||||
|
padding-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.igf-generate {
|
.igf-generate {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -183,11 +418,20 @@
|
|||||||
|
|
||||||
.igf-generate-wrap {
|
.igf-generate-wrap {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
padding: 16px 16px max(16px, env(safe-area-inset-bottom));
|
padding: 12px 16px max(12px, env(safe-area-inset-bottom));
|
||||||
border-top: 1px solid var(--igf-line);
|
border-top: 1px solid var(--igf-line);
|
||||||
background: var(--igf-surface);
|
background: var(--igf-surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.igf-collapsed-summary {
|
||||||
|
overflow: hidden;
|
||||||
|
margin: 0 0 8px;
|
||||||
|
color: var(--igf-muted);
|
||||||
|
font-size: 12px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.igf-quote {
|
.igf-quote {
|
||||||
min-height: 18px;
|
min-height: 18px;
|
||||||
color: var(--igf-muted);
|
color: var(--igf-muted);
|
||||||
|
|||||||
@@ -15,6 +15,20 @@ import {
|
|||||||
|
|
||||||
const CUSTOM = '__custom__';
|
const CUSTOM = '__custom__';
|
||||||
|
|
||||||
|
const formatPreset = ({ width, height, label }) => {
|
||||||
|
const dimensions = `${width}×${height}`;
|
||||||
|
const caption = label
|
||||||
|
.replace(/\s*[((]\s*\d+\s*[x×]\s*\d+\s*[))]\s*$/i, '')
|
||||||
|
.trim();
|
||||||
|
return {
|
||||||
|
dimensions,
|
||||||
|
caption:
|
||||||
|
caption.toLowerCase().replace(/\s/g, '').replace('x', '×') === dimensions
|
||||||
|
? ''
|
||||||
|
: caption,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图像尺寸(schema type = 'size'):预设按宽高比图标展示;仅当 schema 下发 custom_size 时
|
* 图像尺寸(schema type = 'size'):预设按宽高比图标展示;仅当 schema 下发 custom_size 时
|
||||||
* 提供"自定义",宽高输入框失焦 / 回车时按 min / max / step 吸附。
|
* 提供"自定义",宽高输入框失焦 / 回车时按 min / max / step 吸附。
|
||||||
@@ -83,7 +97,9 @@ const ImageSizePicker = ({ param, value, onChange }) => {
|
|||||||
getOptionAriaLabel={(opt) => {
|
getOptionAriaLabel={(opt) => {
|
||||||
if (opt === CUSTOM) return t('自定义尺寸');
|
if (opt === CUSTOM) return t('自定义尺寸');
|
||||||
const p = presets.find((x) => x.value === opt);
|
const p = presets.find((x) => x.value === opt);
|
||||||
return p ? `${p.label || ''} ${p.width}×${p.height}`.trim() : opt;
|
if (!p) return opt;
|
||||||
|
const { caption, dimensions } = formatPreset(p);
|
||||||
|
return caption ? `${caption} ${dimensions}` : dimensions;
|
||||||
}}
|
}}
|
||||||
renderOption={(opt) => {
|
renderOption={(opt) => {
|
||||||
if (opt === CUSTOM) {
|
if (opt === CUSTOM) {
|
||||||
@@ -97,16 +113,16 @@ const ImageSizePicker = ({ param, value, onChange }) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
const p = presets.find((x) => x.value === opt);
|
const p = presets.find((x) => x.value === opt);
|
||||||
|
if (!p) return opt;
|
||||||
|
const { caption, dimensions } = formatPreset(p);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<RatioShape ratio={`${p.width}:${p.height}`} />
|
<RatioShape ratio={`${p.width}:${p.height}`} />
|
||||||
<span className='cp-option-label tabular-nums'>
|
<span className='cp-option-label tabular-nums'>
|
||||||
{p.label || `${p.width}×${p.height}`}
|
{caption || dimensions}
|
||||||
</span>
|
</span>
|
||||||
{p.label ? (
|
{caption ? (
|
||||||
<span className='igf-size-dims tabular-nums'>
|
<span className='igf-size-dims tabular-nums'>{dimensions}</span>
|
||||||
{p.width}×{p.height}
|
|
||||||
</span>
|
|
||||||
) : null}
|
) : null}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import { I18N_TECHNICAL_TEXT } from '../../../../i18n/technicalText.js';
|
import { I18N_TECHNICAL_TEXT } from '../../../../i18n/technicalText.js';
|
||||||
import {
|
import {
|
||||||
Wallet as ActionWallet,
|
Wallet as ActionWallet,
|
||||||
|
Zap as ActionZap,
|
||||||
RotateCcw as ActionRotateCcw,
|
RotateCcw as ActionRotateCcw,
|
||||||
ChevronDown as ActionChevronDown,
|
ChevronDown as ActionChevronDown,
|
||||||
ChevronUp as ActionChevronUp,
|
ChevronUp as ActionChevronUp,
|
||||||
History as ActionHistory,
|
History as ActionHistory,
|
||||||
Settings as ActionSettings,
|
Settings as ActionSettings,
|
||||||
} from '@/components/common/icons/ActionIcons';
|
} from '@/components/common/icons/ActionIcons';
|
||||||
import React, { useEffect, useRef, useState } from 'react';
|
import React, { useEffect, useId, useRef, useState } from 'react';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Collapsible,
|
Collapsible,
|
||||||
@@ -43,7 +44,7 @@ import {
|
|||||||
import ImageSizePicker from './Image/ImageSizePicker';
|
import ImageSizePicker from './Image/ImageSizePicker';
|
||||||
import './Image/ImageGenerationForm.css';
|
import './Image/ImageGenerationForm.css';
|
||||||
|
|
||||||
const { Title, Text } = Typography;
|
const { Text } = Typography;
|
||||||
|
|
||||||
// sessionStorage prompt 历史 key
|
// sessionStorage prompt 历史 key
|
||||||
const PROMPT_HISTORY_KEY = 'expCenter.imageGen.promptHistory.v1';
|
const PROMPT_HISTORY_KEY = 'expCenter.imageGen.promptHistory.v1';
|
||||||
@@ -119,20 +120,9 @@ const hasImageTaskType = (dataTransfer) =>
|
|||||||
Array.from(dataTransfer.types).includes('application/x-image-task'),
|
Array.from(dataTransfer.types).includes('application/x-image-task'),
|
||||||
);
|
);
|
||||||
|
|
||||||
const Section = ({ title, extra, children, className = '' }) => (
|
const Section = ({ title, children, className = '' }) => (
|
||||||
<div
|
<div className={`igf-section ${className}`}>
|
||||||
className={`mb-4 rounded-3xl border border-[var(--igf-line)] bg-white/[0.28] p-3 backdrop-blur-xl dark:bg-white/[0.045] ${className}`}
|
{title && <h2 className='igf-field-heading'>{title}</h2>}
|
||||||
>
|
|
||||||
{title || extra ? (
|
|
||||||
<div className='flex items-center justify-between gap-2 mb-2'>
|
|
||||||
{title ? (
|
|
||||||
<Text strong className='text-sm text-gray-700 dark:text-gray-200'>
|
|
||||||
{title}
|
|
||||||
</Text>
|
|
||||||
) : null}
|
|
||||||
{extra}
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -145,6 +135,10 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
|
const bodyId = useId();
|
||||||
|
const advancedId = useId();
|
||||||
|
const promptId = useId();
|
||||||
|
const quoteId = useId();
|
||||||
const [mobileCollapsed, setMobileCollapsed] = useState(false);
|
const [mobileCollapsed, setMobileCollapsed] = useState(false);
|
||||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||||
const [dropActive, setDropActive] = useState(false);
|
const [dropActive, setDropActive] = useState(false);
|
||||||
@@ -348,10 +342,10 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
theme='solid'
|
theme='solid'
|
||||||
size='large'
|
size='large'
|
||||||
block
|
block
|
||||||
icon={<ActionWallet size={16} />}
|
icon={<ActionWallet size={16} aria-hidden='true' />}
|
||||||
|
aria-describedby={quoteId}
|
||||||
onClick={() => navigate('/console/topup')}
|
onClick={() => navigate('/console/topup')}
|
||||||
className='!rounded-2xl'
|
className='igf-submit'
|
||||||
style={{ height: '48px', fontSize: '15px', fontWeight: 700 }}
|
|
||||||
>
|
>
|
||||||
{t('去充值')}
|
{t('去充值')}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -362,26 +356,17 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
size='large'
|
size='large'
|
||||||
block
|
block
|
||||||
loading={submitting}
|
loading={submitting}
|
||||||
|
icon={<ActionZap size={16} aria-hidden='true' />}
|
||||||
|
aria-describedby={quoteId}
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
disabled={isButtonDisabled}
|
disabled={isButtonDisabled}
|
||||||
className='!rounded-2xl !transition-colors'
|
className='igf-submit'
|
||||||
style={{
|
|
||||||
background: isButtonDisabled
|
|
||||||
? 'var(--ui-color-fill-1)'
|
|
||||||
: 'linear-gradient(135deg, var(--brand-gradient-from) 0%, var(--brand-primary) 52%, var(--brand-gradient-to) 100%)',
|
|
||||||
border: isButtonDisabled
|
|
||||||
? '1px solid var(--igf-line)'
|
|
||||||
: '1px solid transparent',
|
|
||||||
color: isButtonDisabled ? 'var(--ui-color-text-3)' : 'white',
|
|
||||||
height: '48px',
|
|
||||||
fontSize: '15px',
|
|
||||||
fontWeight: '700',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{submitting ? t('提交中...') : t('生成图片')}
|
{submitting ? t('提交中...') : t('生成图片')}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
|
id={quoteId}
|
||||||
className={`igf-quote${needTopUp ? ' is-warning' : ''}`}
|
className={`igf-quote${needTopUp ? ' is-warning' : ''}`}
|
||||||
aria-live='polite'
|
aria-live='polite'
|
||||||
role={isButtonDisabled ? 'note' : undefined}
|
role={isButtonDisabled ? 'note' : undefined}
|
||||||
@@ -521,245 +506,202 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`image-generation-form relative flex h-full min-h-0 flex-col overflow-hidden rounded-[28px] border border-[var(--igf-line)] bg-white/[0.42] shadow-[0_24px_80px_rgba(15,23,42,0.10)] backdrop-blur-2xl backdrop-saturate-150 transition-colors dark:bg-neutral-950/[0.40] dark:shadow-[0_24px_80px_rgba(0,0,0,0.35)]${dropActive ? ' is-drop-active' : ''}`}
|
className={`image-generation-form${dropActive ? ' is-drop-active' : ''}`}
|
||||||
onDragEnter={handleDragEnter}
|
onDragEnter={handleDragEnter}
|
||||||
onDragOver={handleDragOver}
|
onDragOver={handleDragOver}
|
||||||
onDragLeave={handleDragLeave}
|
onDragLeave={handleDragLeave}
|
||||||
onDrop={handleDrop}
|
onDrop={handleDrop}
|
||||||
>
|
>
|
||||||
<div className='igf-form-scroll app-scrollbar'>
|
<header className='igf-header'>
|
||||||
{/* 标题 */}
|
<span className='igf-header-icon' aria-hidden='true'>
|
||||||
<div className='mb-5 rounded-3xl border border-white/60 bg-white/[0.50] p-4 shadow-sm backdrop-blur-xl dark:border-white/10 dark:bg-white/[0.05]'>
|
<Sparkles size={19} />
|
||||||
<div className='flex items-center justify-between gap-2'>
|
</span>
|
||||||
<div className='flex-1 min-w-0'>
|
<div className='igf-header-copy'>
|
||||||
<div className='mb-2 inline-flex items-center gap-2 rounded-full border border-brand/25 bg-brand/10 px-2.5 py-1 text-[11px] font-medium text-brand-deep dark:border-brand/25 dark:bg-brand/15 dark:text-brand-from'>
|
<h1 className='igf-title'>{t('图片生成')}</h1>
|
||||||
<Sparkles size={12} />
|
<span
|
||||||
{t('AI 图片创作')}
|
className='igf-description'
|
||||||
</div>
|
title={
|
||||||
<Title
|
formBodyHidden
|
||||||
heading={4}
|
? selectedModel?.display_name || selectedModel?.model
|
||||||
style={{ margin: 0 }}
|
: undefined
|
||||||
className='text-gray-900 dark:text-white'
|
}
|
||||||
>
|
>
|
||||||
{t('图片生成')}
|
{formBodyHidden && selectedModel
|
||||||
</Title>
|
? selectedModel.display_name || selectedModel.model
|
||||||
<Text
|
: t('输入描述即可生成图片')}
|
||||||
type='secondary'
|
</span>
|
||||||
size='small'
|
|
||||||
className='text-gray-500 dark:text-gray-400 mt-1 block truncate'
|
|
||||||
>
|
|
||||||
{formBodyHidden && selectedModel
|
|
||||||
? selectedModel.display_name || selectedModel.model
|
|
||||||
: t('输入描述即可生成图片')}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
<div className='flex items-center gap-1'>
|
|
||||||
{!formBodyHidden && (
|
|
||||||
<Button
|
|
||||||
icon={<ActionRotateCcw size={12} />}
|
|
||||||
size='small'
|
|
||||||
theme='borderless'
|
|
||||||
onClick={handleReset}
|
|
||||||
className='!text-gray-500 hover:!text-brand-deep dark:hover:!text-brand-from'
|
|
||||||
>
|
|
||||||
{t('重置')}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{isMobile && (
|
|
||||||
<Button
|
|
||||||
icon={
|
|
||||||
mobileCollapsed ? (
|
|
||||||
<ActionChevronDown size={14} />
|
|
||||||
) : (
|
|
||||||
<ActionChevronUp size={14} />
|
|
||||||
)
|
|
||||||
}
|
|
||||||
size='small'
|
|
||||||
theme='borderless'
|
|
||||||
onClick={() => setMobileCollapsed(!mobileCollapsed)}
|
|
||||||
className='!text-gray-500'
|
|
||||||
>
|
|
||||||
{mobileCollapsed ? t('展开') : t('收起')}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div className='igf-header-actions'>
|
||||||
|
{!formBodyHidden && (
|
||||||
|
<Tooltip content={t('重置')}>
|
||||||
|
<Button
|
||||||
|
icon={<ActionRotateCcw size={15} aria-hidden='true' />}
|
||||||
|
theme='outline'
|
||||||
|
aria-label={t('重置')}
|
||||||
|
onClick={handleReset}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
{isMobile && (
|
||||||
|
<Button
|
||||||
|
icon={
|
||||||
|
mobileCollapsed ? (
|
||||||
|
<ActionChevronDown size={15} aria-hidden='true' />
|
||||||
|
) : (
|
||||||
|
<ActionChevronUp size={15} aria-hidden='true' />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
theme='outline'
|
||||||
|
title={mobileCollapsed ? t('展开') : t('收起')}
|
||||||
|
onClick={() => setMobileCollapsed(!mobileCollapsed)}
|
||||||
|
aria-label={mobileCollapsed ? t('展开') : t('收起')}
|
||||||
|
aria-controls={bodyId}
|
||||||
|
aria-expanded={!formBodyHidden}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
{/* 移动端折叠时只显示生成按钮 + 简略 */}
|
<div
|
||||||
{formBodyHidden && (
|
id={bodyId}
|
||||||
<div className='mt-2'>
|
className='igf-form-scroll app-scrollbar'
|
||||||
{renderGenerateArea()}
|
hidden={formBodyHidden}
|
||||||
<Text
|
>
|
||||||
type='tertiary'
|
|
||||||
size='small'
|
|
||||||
className='block mt-2 text-center'
|
|
||||||
>
|
|
||||||
{prompt
|
|
||||||
? prompt.length > 50
|
|
||||||
? prompt.slice(0, 50) + '...'
|
|
||||||
: prompt
|
|
||||||
: t('点击展开编辑参数')}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{!formBodyHidden && (
|
{!formBodyHidden && (
|
||||||
<>
|
<>
|
||||||
{/* 模型选择 */}
|
<Section className='igf-configuration'>
|
||||||
<Section title={t('选择模型')}>{renderModelSection()}</Section>
|
<div className='igf-field-heading'>{t('选择模型')}</div>
|
||||||
|
{renderModelSection()}
|
||||||
|
|
||||||
{/* 生成方式(来自 schema modes) */}
|
{/* 生成方式(来自 schema modes) */}
|
||||||
{selectedModel && modeOptions.length > 1 ? (
|
{selectedModel && modeOptions.length > 1 ? (
|
||||||
<Section title={t('生成方式')}>
|
<div className='igf-mode-field'>
|
||||||
<OptionGroup
|
<div className='igf-field-heading'>{t('生成方式')}</div>
|
||||||
options={modeOptions.map((o) => o.mode)}
|
<OptionGroup
|
||||||
value={formData.mode}
|
variant='segmented'
|
||||||
onChange={setMode}
|
className='igf-mode-group'
|
||||||
ariaLabel={t('生成方式')}
|
options={modeOptions.map((o) => o.mode)}
|
||||||
optionDisabledReasons={Object.fromEntries(
|
value={formData.mode}
|
||||||
modeOptions
|
onChange={setMode}
|
||||||
.filter((o) => o.disabled)
|
ariaLabel={t('生成方式')}
|
||||||
.map((o) => [o.mode, t(o.reason || '当前不可用')]),
|
optionDisabledReasons={Object.fromEntries(
|
||||||
)}
|
modeOptions
|
||||||
renderOption={(mode) => {
|
.filter((o) => o.disabled)
|
||||||
const Icon = MODE_ICONS[mode] || Type;
|
.map((o) => [o.mode, t(o.reason || '当前不可用')]),
|
||||||
return (
|
)}
|
||||||
<span className='igf-mode-option'>
|
renderOption={(mode) => {
|
||||||
<Icon size={14} aria-hidden='true' />
|
const Icon = MODE_ICONS[mode] || Type;
|
||||||
{t(MODE_LABEL_KEYS[mode] || mode)}
|
return (
|
||||||
</span>
|
<span className='igf-mode-option'>
|
||||||
);
|
<Icon size={14} aria-hidden='true' />
|
||||||
}}
|
{t(MODE_LABEL_KEYS[mode] || mode)}
|
||||||
/>
|
</span>
|
||||||
</Section>
|
);
|
||||||
) : null}
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</Section>
|
||||||
|
|
||||||
{/* 提示词 + 模板 + 历史 */}
|
{/* 提示词 + 模板 + 历史 */}
|
||||||
<Section
|
<Section
|
||||||
title={t('提示词')}
|
title={<label htmlFor={promptId}>{t('提示词')}</label>}
|
||||||
extra={
|
className='igf-prompt-section'
|
||||||
<div className='flex items-center gap-2'>
|
>
|
||||||
{/* AI 优化提示词 —— 按钮始终可点击,handler 内判断并 Toast 解释原因 */}
|
<div className='igf-editor'>
|
||||||
<button
|
<TextArea
|
||||||
type='button'
|
id={promptId}
|
||||||
onClick={handleOptimizePrompt}
|
variant='borderless'
|
||||||
aria-label={t('AI 优化提示词')}
|
placeholder={t('描述你想要生成的图片内容...')}
|
||||||
className={[
|
value={prompt}
|
||||||
'app-action-button',
|
onChange={setPrompt}
|
||||||
[
|
onKeyDown={handlePromptKeyDown}
|
||||||
'flex items-center gap-1 text-[10px] transition-colors',
|
rows={3}
|
||||||
optimizing
|
maxCount={2000}
|
||||||
? 'text-brand-from'
|
showClear
|
||||||
: 'text-gray-400 hover:text-brand-deep dark:hover:text-brand-from',
|
/>
|
||||||
].join(' '),
|
<div className='igf-editor-toolbar'>
|
||||||
]
|
<div className='igf-editor-actions'>
|
||||||
.filter(Boolean)
|
<Button
|
||||||
.join(' ')}
|
type='text'
|
||||||
title={
|
size='small'
|
||||||
textModels?.length
|
icon={<ActionZap size={13} aria-hidden='true' />}
|
||||||
? t('AI 优化提示词 (使用 {{m}})', {
|
onClick={handleOptimizePrompt}
|
||||||
m: textModels[0].model_name,
|
aria-label={t('AI 优化提示词')}
|
||||||
})
|
aria-busy={optimizing}
|
||||||
: t('AI 优化提示词')
|
title={
|
||||||
}
|
textModels?.length
|
||||||
>
|
? t('AI 优化提示词 (使用 {{m}})', {
|
||||||
<Sparkles
|
m: textModels[0].model_name,
|
||||||
size={10}
|
})
|
||||||
className={optimizing ? 'animate-pulse' : ''}
|
: t('AI 优化提示词')
|
||||||
/>
|
|
||||||
<span>{optimizing ? t('优化中...') : t('AI 优化')}</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{promptHistory.length > 0 && (
|
|
||||||
<Dropdown
|
|
||||||
trigger='click'
|
|
||||||
position='bottomRight'
|
|
||||||
render={
|
|
||||||
<Dropdown.Menu style={{ maxWidth: 360 }}>
|
|
||||||
{promptHistory.map((p, idx) => (
|
|
||||||
<Dropdown.Item
|
|
||||||
key={idx}
|
|
||||||
onClick={() => setPrompt(p)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
maxWidth: 320,
|
|
||||||
overflow: 'hidden',
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
}}
|
|
||||||
title={p}
|
|
||||||
>
|
|
||||||
{p}
|
|
||||||
</div>
|
|
||||||
</Dropdown.Item>
|
|
||||||
))}
|
|
||||||
</Dropdown.Menu>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<button
|
{optimizing ? t('优化中...') : t('AI 优化')}
|
||||||
type='button'
|
</Button>
|
||||||
className='app-action-button flex items-center gap-1 text-[10px] text-gray-400 hover:text-brand-deep dark:hover:text-brand-from transition-colors'
|
{promptHistory.length > 0 && (
|
||||||
|
<Dropdown
|
||||||
|
trigger='click'
|
||||||
|
position='bottomLeft'
|
||||||
|
render={
|
||||||
|
<Dropdown.Menu style={{ maxWidth: 360 }}>
|
||||||
|
{promptHistory.map((item) => (
|
||||||
|
<Dropdown.Item
|
||||||
|
key={item}
|
||||||
|
onClick={() => setPrompt(item)}
|
||||||
|
>
|
||||||
|
<span className='igf-history-item' title={item}>
|
||||||
|
{item}
|
||||||
|
</span>
|
||||||
|
</Dropdown.Item>
|
||||||
|
))}
|
||||||
|
</Dropdown.Menu>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<ActionHistory size={10} />
|
<Button
|
||||||
<span>{t('历史')}</span>
|
type='text'
|
||||||
</button>
|
size='small'
|
||||||
</Dropdown>
|
icon={<ActionHistory size={13} aria-hidden='true' />}
|
||||||
)}
|
>
|
||||||
<span className='flex items-center gap-1 text-[10px] text-gray-400'>
|
{t('历史')}
|
||||||
{IS_MAC ? (
|
</Button>
|
||||||
<Command size={10} />
|
</Dropdown>
|
||||||
) : (
|
|
||||||
<span>{I18N_TECHNICAL_TEXT.CTRL}</span>
|
|
||||||
)}
|
)}
|
||||||
<span>+</span>
|
</div>
|
||||||
<span>{I18N_TECHNICAL_TEXT.ENTER}</span>
|
{!isMobile && (
|
||||||
<span>{t('生成')}</span>
|
<kbd className='igf-shortcut' title={t('生成图片')}>
|
||||||
</span>
|
{IS_MAC ? (
|
||||||
|
<Command size={11} />
|
||||||
|
) : (
|
||||||
|
I18N_TECHNICAL_TEXT.CTRL
|
||||||
|
)}
|
||||||
|
<span>+</span>
|
||||||
|
{I18N_TECHNICAL_TEXT.ENTER}
|
||||||
|
</kbd>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
>
|
|
||||||
<TextArea
|
|
||||||
placeholder={t('描述你想要生成的图片内容...')}
|
|
||||||
value={prompt}
|
|
||||||
onChange={setPrompt}
|
|
||||||
onKeyDown={handlePromptKeyDown}
|
|
||||||
rows={3}
|
|
||||||
maxCount={2000}
|
|
||||||
showClear
|
|
||||||
className='[&_.ant-input-textarea]:!rounded-2xl [&_.ant-input-textarea]:!border-white/[0.55] [&_.ant-input-textarea]:!bg-white/[0.55] [&_.ant-input-textarea]:!shadow-inner dark:[&_.ant-input-textarea]:!border-white/10 dark:[&_.ant-input-textarea]:!bg-white/[0.06] [&_.ant-input-textarea:hover]:!border-brand/30 [&_.ant-input-textarea:focus]:!border-brand'
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className='flex flex-wrap items-center gap-1.5 mt-2'>
|
<div className='igf-templates'>
|
||||||
<div className='flex items-center gap-1 text-[10px] text-gray-400 mr-1'>
|
<div className='igf-templates-label'>
|
||||||
<Sparkles size={10} />
|
|
||||||
<span>{t('快速模板')}</span>
|
<span>{t('快速模板')}</span>
|
||||||
</div>
|
</div>
|
||||||
{PROMPT_TEMPLATES.map((tpl) => (
|
{PROMPT_TEMPLATES.map((tpl) => (
|
||||||
<Tag
|
<Button
|
||||||
key={tpl.label}
|
key={tpl.label}
|
||||||
|
theme='outline'
|
||||||
size='small'
|
size='small'
|
||||||
color='grey'
|
|
||||||
onClick={() => handleApplyTemplate(tpl)}
|
onClick={() => handleApplyTemplate(tpl)}
|
||||||
className='!cursor-pointer !rounded-full !border-white/50 !bg-white/[0.45] !backdrop-blur hover:!bg-brand/10 dark:!border-white/10 dark:!bg-white/[0.06] dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !transition-colors'
|
|
||||||
>
|
>
|
||||||
{t(tpl.label)}
|
{t(tpl.label)}
|
||||||
</Tag>
|
</Button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
{/* 参考图:编辑模式的带标签槽位;当前模型 / 模式用不到的图片置灰保留 */}
|
{/* 参考图:编辑模式的带标签槽位;当前模型 / 模式用不到的图片置灰保留 */}
|
||||||
{selectedModel && imageSlots.length > 0 ? (
|
{selectedModel && imageSlots.length > 0 ? (
|
||||||
<Section
|
<Section title={t('参考图片')} className='igf-reference'>
|
||||||
title={t('参考图片')}
|
|
||||||
extra={
|
|
||||||
<Text type='tertiary' className='!text-[10px]'>
|
|
||||||
{t('可从右侧历史拖拽图片到这里')}
|
|
||||||
</Text>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className='igf-slots'>
|
<div className='igf-slots'>
|
||||||
{imageSlots.map((entry) => {
|
{imageSlots.map((entry) => {
|
||||||
const slot = entry.slot;
|
const slot = entry.slot;
|
||||||
@@ -784,6 +726,11 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
{!isMobile && (
|
||||||
|
<p className='igf-muted igf-reference-hint'>
|
||||||
|
{t('可从右侧历史拖拽图片到这里')}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
{hasUnusedImage ? (
|
{hasUnusedImage ? (
|
||||||
<div className='igf-muted igf-note' role='note'>
|
<div className='igf-muted igf-note' role='note'>
|
||||||
{t(
|
{t(
|
||||||
@@ -796,7 +743,10 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
|
|
||||||
{/* 尺寸 + 常用参数(画质 / 数量等) */}
|
{/* 尺寸 + 常用参数(画质 / 数量等) */}
|
||||||
{selectedModel && (sizeParam || dockParams.length > 0) ? (
|
{selectedModel && (sizeParam || dockParams.length > 0) ? (
|
||||||
<Section title={sizeParam ? t('尺寸') : t('生成参数')}>
|
<Section
|
||||||
|
className='igf-parameters'
|
||||||
|
title={sizeParam ? t('尺寸') : t('生成参数')}
|
||||||
|
>
|
||||||
{sizeParam ? (
|
{sizeParam ? (
|
||||||
<ImageSizePicker
|
<ImageSizePicker
|
||||||
param={sizeParam}
|
param={sizeParam}
|
||||||
@@ -819,14 +769,15 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
|
|
||||||
{/* 高级选项 */}
|
{/* 高级选项 */}
|
||||||
{selectedModel && advancedParams.length > 0 ? (
|
{selectedModel && advancedParams.length > 0 ? (
|
||||||
<Section>
|
<Section className='igf-advanced'>
|
||||||
<button
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
onClick={() => setShowAdvanced(!showAdvanced)}
|
onClick={() => setShowAdvanced(!showAdvanced)}
|
||||||
aria-expanded={showAdvanced}
|
aria-expanded={showAdvanced}
|
||||||
className='app-action-button flex items-center gap-1.5 text-xs text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from transition-colors'
|
aria-controls={advancedId}
|
||||||
|
className='igf-advanced-trigger'
|
||||||
>
|
>
|
||||||
<ActionSettings size={12} />
|
<ActionSettings size={15} aria-hidden='true' />
|
||||||
<span>{t('高级选项')}</span>
|
<span>{t('高级选项')}</span>
|
||||||
{showAdvanced ? (
|
{showAdvanced ? (
|
||||||
<ActionChevronUp size={12} />
|
<ActionChevronUp size={12} />
|
||||||
@@ -835,7 +786,7 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
<Collapsible isOpen={showAdvanced} keepDOM>
|
<Collapsible isOpen={showAdvanced} keepDOM>
|
||||||
<div className='pt-3'>
|
<div id={advancedId} className='igf-advanced-content'>
|
||||||
<ParamRenderer
|
<ParamRenderer
|
||||||
params={visibleParams}
|
params={visibleParams}
|
||||||
values={formData.params}
|
values={formData.params}
|
||||||
@@ -850,9 +801,14 @@ const ImageGenerationForm = ({ creation }) => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{!formBodyHidden && (
|
<footer className='igf-generate-wrap'>
|
||||||
<div className='igf-generate-wrap'>{renderGenerateArea()}</div>
|
{formBodyHidden && (
|
||||||
)}
|
<p className='igf-collapsed-summary' title={prompt || undefined}>
|
||||||
|
{prompt || t('点击展开编辑参数')}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
{renderGenerateArea()}
|
||||||
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -60,17 +60,15 @@ const ImageGenerationTab = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/*
|
{/*
|
||||||
移动端(< md):Tab 整体允许竖向滚动 —— 表单和任务列表按自然高度堆叠,用户上下滚浏览。
|
窄屏堆叠并整体滚动,宽屏双栏各自滚动。
|
||||||
桌面端(>= md):保持 overflow-hidden,左右两栏各自内部滚动。
|
|
||||||
*/}
|
*/}
|
||||||
<div className='h-full min-h-0 flex flex-col md:flex-row gap-4 p-3 sm:p-4 overflow-y-auto md:overflow-hidden'>
|
<div className='image-generation-workspace h-full min-h-0 flex flex-col lg:flex-row gap-4 p-4 lg:p-6 overflow-y-auto lg:overflow-hidden'>
|
||||||
{/* 左侧:生成参数表单 */}
|
{/* 左侧:生成参数表单 */}
|
||||||
<div className='w-full md:w-[22rem] xl:w-[24rem] md:flex-shrink-0 md:h-full'>
|
<div className='w-full shrink-0 lg:w-[20rem] xl:w-[22rem] lg:h-full'>
|
||||||
<ImageGenerationForm creation={creation} />
|
<ImageGenerationForm creation={creation} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 右侧:任务列表 —— flex-1 只在桌面端生效,移动端按内容高度展开 */}
|
<div className='min-w-0 lg:flex-1 lg:min-h-0 flex flex-col'>
|
||||||
<div className='md:flex-1 md:min-h-0 flex flex-col'>
|
|
||||||
<ImageTaskList
|
<ImageTaskList
|
||||||
tasks={tasks}
|
tasks={tasks}
|
||||||
onRefresh={refreshTasks}
|
onRefresh={refreshTasks}
|
||||||
|
|||||||
@@ -227,22 +227,19 @@ useCallback; // 事件处理函数优化
|
|||||||
### CSS 变量
|
### CSS 变量
|
||||||
|
|
||||||
```css
|
```css
|
||||||
--ui-color-primary // 主色
|
--brand-accent // 聚焦与选中边框
|
||||||
--ui-color-success // 成功色
|
--brand-selection-bg // 筛选和收藏选中底色
|
||||||
--ui-color-warning // 警告色
|
--surface-card // 卡片背景
|
||||||
--ui-color-danger // 危险色
|
--border-subtle // 描边与操作区分隔线
|
||||||
--ui-color-bg-2 // 背景色
|
|
||||||
--ui-color-border // 边框色
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 自定义类
|
### 自定义类
|
||||||
|
|
||||||
```css
|
```css
|
||||||
.task-card-hover // 卡片悬停效果
|
.image-task-grid // 密度与响应式列数
|
||||||
.task-list-scroll // 滚动条样式
|
.image-task-card // 统一描边卡片
|
||||||
.stat-card // 统计卡片样式
|
.image-task-media // 统一 4:3 缩略图与状态占位
|
||||||
.image-preview-container // 图片预览容器
|
.image-task-actions // 各密度均可访问的卡片操作
|
||||||
.progress-pulse // 进度条动画
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 浏览器兼容性
|
## 浏览器兼容性
|
||||||
|
|||||||
@@ -1,155 +1,429 @@
|
|||||||
/* 任务卡片悬停效果 */
|
.image-task-list {
|
||||||
.task-card-hover {
|
--ih-status-warning: var(--ui-color-warning);
|
||||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
--ih-status-error: var(--ui-color-danger);
|
||||||
|
--ih-dimension-bg: rgb(15 23 42 / 0.8);
|
||||||
|
--ih-dimension-text: white;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
|
height: 100%;
|
||||||
|
color: var(--text-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.task-card-hover:hover {
|
.image-history-toolbar {
|
||||||
transform: translateY(-2px);
|
flex: none;
|
||||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
|
padding: 16px;
|
||||||
|
border: 1px solid var(--border-subtle);
|
||||||
|
border-radius: 12px;
|
||||||
|
background: var(--surface-card);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 滚动条样式已统一到 index.css 的 .app-scrollbar */
|
.image-history-heading,
|
||||||
|
.image-history-title-row,
|
||||||
/* 统计卡片悬停效果 */
|
.image-history-tools,
|
||||||
.stat-card {
|
.image-history-status,
|
||||||
transition: all 0.3s ease;
|
.image-history-filters,
|
||||||
|
.image-history-compare {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-card:hover {
|
.image-history-heading {
|
||||||
transform: scale(1.02);
|
justify-content: space-between;
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
gap: 12px 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 图片预览悬停效果 */
|
.image-history-title-row {
|
||||||
.image-preview-container {
|
gap: 12px 16px;
|
||||||
position: relative;
|
}
|
||||||
overflow: hidden;
|
.image-history-title-row h2 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
line-height: 26px;
|
||||||
|
font-weight: 650;
|
||||||
|
}
|
||||||
|
.image-history-status {
|
||||||
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-preview-container::after {
|
.image-history-status-button,
|
||||||
|
.image-history-clear {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
min-height: 34px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 12px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-status-button:hover,
|
||||||
|
.image-history-status-button[aria-pressed='true'],
|
||||||
|
.image-history-clear:hover {
|
||||||
|
background: var(--brand-selection-bg);
|
||||||
|
color: var(--brand-selection-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-status-button[aria-pressed='true'] {
|
||||||
|
border-color: var(--brand-accent);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-count {
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: center;
|
||||||
|
min-width: 18px;
|
||||||
|
padding: 0 4px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: var(--surface-bg-base);
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 18px;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-status-button[aria-pressed='true'] .image-history-count {
|
||||||
|
background: var(--surface-card);
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-filters {
|
||||||
|
margin-top: 12px;
|
||||||
|
padding-top: 12px;
|
||||||
|
border-top: 1px solid var(--border-subtle);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-tools {
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
min-width: 0;
|
||||||
|
max-width: 100%;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
.image-history-tools .image-task-search {
|
||||||
|
width: 180px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.image-history-tools .ant-btn {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.image-task-model-filter {
|
||||||
|
width: min(100%, 190px);
|
||||||
|
}
|
||||||
|
.image-task-size-filter {
|
||||||
|
width: min(100%, 128px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-tools .ant-btn[aria-pressed='true'],
|
||||||
|
.image-task-favorite.ant-btn[aria-pressed='true'] {
|
||||||
|
border-color: var(--brand-accent);
|
||||||
|
background: var(--brand-selection-bg);
|
||||||
|
color: var(--brand-selection-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-compare {
|
||||||
|
margin-top: 12px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--brand-selection-bg);
|
||||||
|
color: var(--brand-selection-text);
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-task-list .task-list-scrollable {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
.image-history-content {
|
||||||
|
padding: 16px 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-empty-description {
|
||||||
|
display: grid;
|
||||||
|
gap: 4px;
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-history-empty-description strong {
|
||||||
|
color: var(--text-primary);
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.image-task-group-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.image-task-group-header h3 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 22px;
|
||||||
|
font-weight: 650;
|
||||||
|
}
|
||||||
|
.image-task-group-header::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
flex: 1;
|
||||||
top: 0;
|
border-top: 1px solid var(--border-subtle);
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background: rgba(0, 0, 0, 0);
|
|
||||||
transition: background 0.3s;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-preview-container:hover::after {
|
.image-task-grid {
|
||||||
background: rgba(0, 0, 0, 0.05);
|
--ih-card-min: 268px;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(
|
||||||
|
auto-fill,
|
||||||
|
minmax(min(100%, var(--ih-card-min)), 1fr)
|
||||||
|
);
|
||||||
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 进度条动画 */
|
.image-task-grid[data-density='compact'] {
|
||||||
@keyframes pulse {
|
--ih-card-min: 208px;
|
||||||
0%,
|
gap: 12px;
|
||||||
100% {
|
}
|
||||||
opacity: 1;
|
.image-task-grid[data-density='grid'] {
|
||||||
}
|
--ih-card-min: 144px;
|
||||||
50% {
|
gap: 12px;
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 处理中状态左侧彩条流光 */
|
.image-task-card.ant-card {
|
||||||
@keyframes brandShimmer {
|
min-width: 0;
|
||||||
0% {
|
border-color: var(--border-subtle);
|
||||||
background-position: 0% 0%;
|
border-radius: 12px;
|
||||||
}
|
background: var(--surface-card);
|
||||||
100% {
|
color: var(--text-primary);
|
||||||
background-position: 0% 200%;
|
box-shadow: none;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* drop target highlight */
|
.image-task-card.ant-card:focus-within,
|
||||||
.image-ref-drop-active {
|
.image-task-card.ant-card[data-selected='true'] {
|
||||||
outline: 2px dashed var(--brand-primary) !important;
|
border-color: var(--brand-accent);
|
||||||
outline-offset: -4px;
|
}
|
||||||
|
|
||||||
|
.image-task-card.ant-card > .image-task-card-layout {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-task-media {
|
||||||
|
position: relative;
|
||||||
|
aspect-ratio: 4 / 3;
|
||||||
|
overflow: hidden;
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--surface-bg-base);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-task-media[data-status='failed'] {
|
||||||
background: color-mix(
|
background: color-mix(
|
||||||
in srgb,
|
in srgb,
|
||||||
var(--brand-primary) 8%,
|
var(--ih-status-error) 5%,
|
||||||
transparent
|
var(--surface-bg-base)
|
||||||
) !important;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-pulse {
|
.image-task-preview {
|
||||||
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
width: 100%;
|
||||||
|
border-radius: inherit;
|
||||||
|
cursor: zoom-in;
|
||||||
|
}
|
||||||
|
.image-task-preview[aria-pressed] {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.image-task-preview img {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 按钮组动画 */
|
.image-task-dimensions {
|
||||||
.action-buttons {
|
position: absolute;
|
||||||
|
right: 8px;
|
||||||
|
bottom: 8px;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: var(--ih-dimension-bg);
|
||||||
|
color: var(--ih-dimension-text);
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 16px;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-task-favorite.ant-btn,
|
||||||
|
.image-task-select.ant-checkbox-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
z-index: 1;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
min-width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
margin: 0;
|
||||||
|
border: 1px solid var(--border-subtle);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--surface-card);
|
||||||
|
color: var(--text-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-task-select.ant-checkbox-wrapper .ant-checkbox {
|
||||||
|
align-self: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-task-placeholder {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
flex-direction: column;
|
||||||
flex-wrap: wrap;
|
align-items: center;
|
||||||
}
|
justify-content: center;
|
||||||
|
gap: 4px;
|
||||||
.action-buttons > * {
|
padding: 8px;
|
||||||
transition: all 0.2s;
|
color: var(--text-secondary);
|
||||||
}
|
|
||||||
|
|
||||||
.action-buttons > *:hover {
|
|
||||||
transform: translateY(-1px);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 空状态样式 */
|
|
||||||
.empty-state {
|
|
||||||
padding: 60px 20px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 搜索框样式增强 */
|
.image-task-placeholder strong {
|
||||||
.search-input-enhanced {
|
color: var(--text-primary);
|
||||||
transition: all 0.3s;
|
font-size: 13px;
|
||||||
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input-enhanced:focus-within {
|
.image-task-status-icon {
|
||||||
box-shadow: 0 0 0 2px rgba(var(--ui-color-primary-rgb), 0.2);
|
display: grid;
|
||||||
|
flex-shrink: 0;
|
||||||
|
place-items: center;
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
margin-bottom: 2px;
|
||||||
|
border: 1px solid var(--border-subtle);
|
||||||
|
border-radius: 9px;
|
||||||
|
background: var(--surface-card);
|
||||||
|
color: var(--brand-accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 标签组样式 */
|
.image-task-media[data-status='failed'] .image-task-status-icon {
|
||||||
.tag-group {
|
color: var(--ih-status-error);
|
||||||
|
}
|
||||||
|
.image-task-media[data-status='success'] .image-task-status-icon {
|
||||||
|
color: var(--ih-status-warning);
|
||||||
|
}
|
||||||
|
.image-task-progress {
|
||||||
|
width: min(100%, 132px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-task-error,
|
||||||
|
.image-task-prompt {
|
||||||
|
display: -webkit-box;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-task-error {
|
||||||
|
max-width: 90%;
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: underline;
|
||||||
|
text-underline-offset: 2px;
|
||||||
|
}
|
||||||
|
.image-task-error-detail {
|
||||||
|
max-width: min(70vw, 300px);
|
||||||
|
max-height: 200px;
|
||||||
|
overflow: auto;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
.image-task-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 10px 3px 2px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.image-task-prompt {
|
||||||
|
min-height: 40px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.image-task-meta {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
justify-content: space-between;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
flex-wrap: wrap;
|
color: var(--text-secondary);
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
.image-task-meta time {
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
.image-task-model {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.image-task-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 6px;
|
||||||
|
margin-top: auto;
|
||||||
|
padding-top: 8px;
|
||||||
|
border-top: 1px solid var(--border-subtle);
|
||||||
|
}
|
||||||
|
.image-task-primary-action {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.image-task-actions .ant-btn {
|
||||||
|
min-height: 30px;
|
||||||
|
}
|
||||||
|
.image-task-list button:focus-visible {
|
||||||
|
outline: 2px solid var(--brand-accent);
|
||||||
|
outline-offset: 1px;
|
||||||
|
}
|
||||||
|
.image-task-list .image-task-preview:focus-visible {
|
||||||
|
outline-offset: -3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 响应式设计 */
|
@media (hover: hover) {
|
||||||
@media (max-width: 768px) {
|
.image-task-card.ant-card:hover {
|
||||||
.task-card-content {
|
border-color: var(--brand-accent);
|
||||||
flex-direction: column !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-preview-container {
|
|
||||||
width: 100% !important;
|
|
||||||
min-height: 200px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-cards-grid {
|
|
||||||
grid-template-columns: 1fr !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Badge 样式覆盖 - 修复默认蓝色圆形背景 */
|
@media (min-width: 1024px) {
|
||||||
|
.image-task-list .task-list-scrollable {
|
||||||
/* 历史标题区域的 Badge 特定样式 */
|
overflow: auto;
|
||||||
|
}
|
||||||
/* 图片生成页局部控件留白:避免搜索/筛选内容贴住玻璃卡片边框 */
|
|
||||||
|
|
||||||
.image-task-list .image-task-group-header {
|
|
||||||
margin-left: -4px;
|
|
||||||
margin-right: -4px;
|
|
||||||
border: 1px solid rgb(255 255 255 / 0.45);
|
|
||||||
border-radius: 14px;
|
|
||||||
box-shadow: 0 10px 26px rgb(15 23 42 / 0.06);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .image-task-list .image-task-group-header {
|
@media (max-width: 599px) {
|
||||||
border-color: rgb(255 255 255 / 0.1);
|
.image-history-toolbar {
|
||||||
box-shadow: 0 10px 26px rgb(0 0 0 / 0.24);
|
padding: 12px;
|
||||||
}
|
}
|
||||||
|
.image-history-tools {
|
||||||
/* ===== 触屏命中区兜底 ===== */
|
width: 100%;
|
||||||
@media (hover: none) {
|
}
|
||||||
|
.image-history-tools .image-task-search {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.image-task-model-filter,
|
||||||
|
.image-task-size-filter {
|
||||||
|
flex: 1 1 110px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -7,17 +7,21 @@
|
|||||||
--vip-muted: var(--text-secondary);
|
--vip-muted: var(--text-secondary);
|
||||||
--vip-line: var(--border-subtle);
|
--vip-line: var(--border-subtle);
|
||||||
--vip-surface: var(--surface-card);
|
--vip-surface: var(--surface-card);
|
||||||
--vip-accent: var(--ui-color-primary);
|
--vip-accent: var(--brand-accent);
|
||||||
--vip-tint: color-mix(in srgb, var(--ui-color-primary) 10%, transparent);
|
--vip-tint: var(--brand-selection-bg);
|
||||||
--vip-fill: color-mix(in srgb, var(--text-primary) 4%, var(--surface-card));
|
--vip-fill: color-mix(in srgb, var(--text-primary) 4%, var(--surface-card));
|
||||||
--vip-danger: var(--ui-color-danger);
|
--vip-danger: var(--ui-color-danger);
|
||||||
--vip-warning: var(--ui-color-warning);
|
--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;
|
display: flex;
|
||||||
height: 100%;
|
flex-direction: column;
|
||||||
overflow: auto;
|
width: 100%;
|
||||||
padding: 16px;
|
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,
|
.video-input-panel button:focus-visible,
|
||||||
@@ -26,36 +30,35 @@
|
|||||||
outline-offset: 2px;
|
outline-offset: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-collapse-row {
|
.vip-fields {
|
||||||
display: flex;
|
flex: 1;
|
||||||
justify-content: flex-end;
|
min-height: 0;
|
||||||
margin-bottom: 12px;
|
padding: 12px;
|
||||||
|
overflow: auto;
|
||||||
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-collapse-btn {
|
.vip-fields:not([hidden]) {
|
||||||
color: var(--vip-accent) !important;
|
display: grid;
|
||||||
|
align-content: start;
|
||||||
|
grid-auto-rows: max-content;
|
||||||
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-expand-fab {
|
.vip-fields[hidden] {
|
||||||
position: fixed;
|
display: none;
|
||||||
left: 0;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
z-index: 100;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-expand-fab .ant-btn {
|
.vip-prompt textarea::placeholder,
|
||||||
border-top-left-radius: 0;
|
textarea.vip-prompt::placeholder {
|
||||||
border-bottom-left-radius: 0;
|
color: var(--vip-muted);
|
||||||
color: var(--ui-color-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-card {
|
.vip-card {
|
||||||
margin-bottom: 12px;
|
padding: 12px;
|
||||||
padding: 14px 16px;
|
|
||||||
border: 1px solid var(--vip-line);
|
border: 1px solid var(--vip-line);
|
||||||
border-radius: 12px;
|
border-radius: 10px;
|
||||||
background: var(--vip-surface);
|
background: var(--vip-fill);
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +82,7 @@
|
|||||||
height: 26px;
|
height: 26px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
background: var(--vip-tint);
|
background: var(--vip-tint);
|
||||||
color: var(--vip-accent);
|
color: var(--brand-selection-text);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-card-extra {
|
.vip-card-extra {
|
||||||
@@ -158,6 +161,13 @@
|
|||||||
color: var(--vip-danger);
|
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 {
|
.vip-mode-option {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -198,8 +208,8 @@
|
|||||||
|
|
||||||
.vip-advanced {
|
.vip-advanced {
|
||||||
border: 1px solid var(--vip-line);
|
border: 1px solid var(--vip-line);
|
||||||
border-radius: 12px;
|
border-radius: 10px;
|
||||||
background: var(--vip-surface);
|
background: var(--vip-fill);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
ChevronRight as ActionChevronRight,
|
ChevronDown as ActionChevronDown,
|
||||||
ChevronLeft as ActionChevronLeft,
|
ChevronUp as ActionChevronUp,
|
||||||
} from '@/components/common/icons/ActionIcons';
|
} from '@/components/common/icons/ActionIcons';
|
||||||
import React from 'react';
|
import React, { useId } from 'react';
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Collapse,
|
Collapse,
|
||||||
@@ -76,13 +76,9 @@ const formatModelPrice = (t, model, resolution) => {
|
|||||||
return unit ? `${amount}${t(unit)}` : amount;
|
return unit ? `${amount}${t(unit)}` : amount;
|
||||||
};
|
};
|
||||||
|
|
||||||
const VideoInputPanel = ({
|
const VideoInputPanel = ({ creation, onCollapse, collapsed, scrollRef }) => {
|
||||||
creation,
|
|
||||||
onCollapse,
|
|
||||||
collapsed,
|
|
||||||
collapsible = true,
|
|
||||||
}) => {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const fieldsId = useId();
|
||||||
const {
|
const {
|
||||||
formData,
|
formData,
|
||||||
setFormData,
|
setFormData,
|
||||||
@@ -109,20 +105,6 @@ const VideoInputPanel = ({
|
|||||||
setFormData((prev) => ({ ...prev, [field]: value }));
|
setFormData((prev) => ({ ...prev, [field]: value }));
|
||||||
};
|
};
|
||||||
|
|
||||||
// 单列(手机)布局不提供折叠:没有相邻面板可以让位,收起只会留下一片空白,
|
|
||||||
// 而唯一的恢复入口是一个浮在屏幕左侧垂直中央的裸箭头。
|
|
||||||
if (collapsed && collapsible) {
|
|
||||||
return (
|
|
||||||
<div className='vip-expand-fab'>
|
|
||||||
<Button
|
|
||||||
icon={<ActionChevronRight size={20} />}
|
|
||||||
onClick={onCollapse}
|
|
||||||
aria-label={t('展开')}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const advancedParams = visibleParams.filter(
|
const advancedParams = visibleParams.filter(
|
||||||
(p) => p.placement === 'advanced',
|
(p) => p.placement === 'advanced',
|
||||||
);
|
);
|
||||||
@@ -248,181 +230,200 @@ const VideoInputPanel = ({
|
|||||||
entry.labelIndex ? `${t(entry.label)} ${entry.labelIndex}` : t(entry.label);
|
entry.labelIndex ? `${t(entry.label)} ${entry.labelIndex}` : t(entry.label);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='video-input-panel'>
|
<section className='video-input-panel'>
|
||||||
{collapsible && (
|
<header className='video-panel-header'>
|
||||||
<div className='vip-collapse-row'>
|
<div className='video-panel-heading'>
|
||||||
<Button
|
<SlidersHorizontal size={17} aria-hidden='true' />
|
||||||
icon={<ActionChevronLeft size={18} />}
|
<h2>{t('参数设置')}</h2>
|
||||||
onClick={onCollapse}
|
|
||||||
size='small'
|
|
||||||
type='tertiary'
|
|
||||||
className='vip-collapse-btn'
|
|
||||||
aria-label={t('收起')}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
<Button
|
||||||
|
icon={
|
||||||
<Section icon={Wand2} title={t('选择模型')}>
|
collapsed ? (
|
||||||
{renderModelSection()}
|
<ActionChevronDown size={16} />
|
||||||
</Section>
|
) : (
|
||||||
|
<ActionChevronUp size={16} />
|
||||||
{selectedModel && modeOptions.length > 0 ? (
|
)
|
||||||
<Section icon={Layers} title={t('生成方式')}>
|
}
|
||||||
<OptionGroup
|
onClick={onCollapse}
|
||||||
options={modeOptions.map((o) => o.mode)}
|
size='small'
|
||||||
value={formData.mode}
|
type='tertiary'
|
||||||
onChange={setMode}
|
aria-label={collapsed ? t('展开创作台') : t('收起创作台')}
|
||||||
ariaLabel={t('生成方式')}
|
aria-expanded={!collapsed}
|
||||||
optionDisabledReasons={Object.fromEntries(
|
aria-controls={fieldsId}
|
||||||
modeOptions
|
/>
|
||||||
.filter((o) => o.disabled)
|
</header>
|
||||||
.map((o) => [o.mode, t(o.reason || '当前不可用')]),
|
<div
|
||||||
)}
|
id={fieldsId}
|
||||||
renderOption={(mode) => {
|
hidden={collapsed}
|
||||||
const Icon = MODE_ICONS[mode] || Film;
|
ref={scrollRef}
|
||||||
return (
|
className='vip-fields app-scrollbar'
|
||||||
<span className='vip-mode-option'>
|
>
|
||||||
<Icon size={14} aria-hidden='true' />
|
<Section icon={Wand2} title={t('选择模型')}>
|
||||||
{t(MODE_LABEL_KEYS[mode] || mode)}
|
{renderModelSection()}
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Section>
|
</Section>
|
||||||
) : null}
|
|
||||||
|
|
||||||
{selectedModel && imageSlots.length > 0 ? (
|
{selectedModel && modeOptions.length > 0 ? (
|
||||||
<Section icon={ImageIcon} title={t('参考图片')}>
|
<Section icon={Layers} title={t('生成方式')}>
|
||||||
<div className='vip-slots'>
|
<OptionGroup
|
||||||
{imageSlots.map((entry) => {
|
options={modeOptions.map((o) => o.mode)}
|
||||||
const slot = entry.slot;
|
value={formData.mode}
|
||||||
const value = slot
|
onChange={setMode}
|
||||||
? {
|
ariaLabel={t('生成方式')}
|
||||||
previewUrl: slot.previewUrl,
|
optionDisabledReasons={Object.fromEntries(
|
||||||
status: entry.active ? slot.status || 'ready' : 'unused',
|
modeOptions
|
||||||
error: slot.error,
|
.filter((o) => o.disabled)
|
||||||
}
|
.map((o) => [o.mode, t(o.reason || '当前不可用')]),
|
||||||
: null;
|
)}
|
||||||
return (
|
renderOption={(mode) => {
|
||||||
<ImageSlot
|
const Icon = MODE_ICONS[mode] || Film;
|
||||||
key={`${entry.key}-${entry.index ?? 0}-${slot?.id || 'empty'}`}
|
return (
|
||||||
label={slotLabel(entry)}
|
<span className='vip-mode-option'>
|
||||||
value={value}
|
<Icon size={14} aria-hidden='true' />
|
||||||
onPick={(file) => pickImage(entry.key, entry.index, file)}
|
{t(MODE_LABEL_KEYS[mode] || mode)}
|
||||||
onRemove={() => removeImage(entry.key, entry.index)}
|
</span>
|
||||||
onRetry={() => retryImage(entry.key, entry.index, slot)}
|
);
|
||||||
disabledReason={
|
}}
|
||||||
!cosEnabled && !slot
|
/>
|
||||||
? t('对象存储(COS)未开启,暂不支持上传图片')
|
</Section>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{selectedModel && imageSlots.length > 0 ? (
|
||||||
|
<Section icon={ImageIcon} title={t('参考图片')}>
|
||||||
|
<div className='vip-slots'>
|
||||||
|
{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 (
|
||||||
|
<ImageSlot
|
||||||
|
key={`${entry.key}-${entry.index ?? 0}-${slot?.id || 'empty'}`}
|
||||||
|
label={slotLabel(entry)}
|
||||||
|
value={value}
|
||||||
|
onPick={(file) => pickImage(entry.key, entry.index, file)}
|
||||||
|
onRemove={() => removeImage(entry.key, entry.index)}
|
||||||
|
onRetry={() => retryImage(entry.key, entry.index, slot)}
|
||||||
|
disabledReason={
|
||||||
|
!cosEnabled && !slot
|
||||||
|
? t('对象存储(COS)未开启,暂不支持上传图片')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
{hasUnusedImage ? (
|
||||||
|
<div className='vip-muted vip-slot-note' role='note'>
|
||||||
|
{t('置灰的图片当前不会提交,切回支持的模型或模式后自动恢复')}
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
{firstFrameSlot ? (
|
||||||
|
<div className='vip-portrait-row'>
|
||||||
|
<PortraitAssetPicker
|
||||||
|
onSelect={selectPortraitAsset}
|
||||||
|
selectedAssetId={
|
||||||
|
firstFrameRef.startsWith('asset://')
|
||||||
|
? firstFrameRef.slice('asset://'.length)
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
|
onClearSelection={clearPortraitAsset}
|
||||||
/>
|
/>
|
||||||
);
|
{formData.images?.first_frame?.identityType ===
|
||||||
})}
|
'real_person' ? (
|
||||||
</div>
|
<Tag color='green' size='small'>
|
||||||
{hasUnusedImage ? (
|
{t('真人人像')}
|
||||||
<div className='vip-muted vip-slot-note' role='note'>
|
</Tag>
|
||||||
{t('置灰的图片当前不会提交,切回支持的模型或模式后自动恢复')}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{firstFrameSlot ? (
|
</Section>
|
||||||
<div className='vip-portrait-row'>
|
) : null}
|
||||||
<PortraitAssetPicker
|
|
||||||
onSelect={selectPortraitAsset}
|
|
||||||
selectedAssetId={
|
|
||||||
firstFrameRef.startsWith('asset://')
|
|
||||||
? firstFrameRef.slice('asset://'.length)
|
|
||||||
: ''
|
|
||||||
}
|
|
||||||
onClearSelection={clearPortraitAsset}
|
|
||||||
/>
|
|
||||||
{formData.images?.first_frame?.identityType === 'real_person' ? (
|
|
||||||
<Tag color='green' size='small'>
|
|
||||||
{t('真人人像')}
|
|
||||||
</Tag>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</Section>
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
<Section icon={Sparkles} title={t('场景模板')}>
|
<Section icon={Sparkles} title={t('场景模板')}>
|
||||||
<Select
|
<Select
|
||||||
placeholder={t('选择场景模板(可选)')}
|
aria-label={t('场景模板')}
|
||||||
value={formData.selectedTemplate}
|
placeholder={t('选择场景模板(可选)')}
|
||||||
onChange={(value) => updateField('selectedTemplate', value)}
|
value={formData.selectedTemplate || undefined}
|
||||||
style={{ width: '100%' }}
|
onChange={(value) => updateField('selectedTemplate', value)}
|
||||||
showClear
|
style={{ width: '100%' }}
|
||||||
>
|
showClear
|
||||||
{PROMPT_TEMPLATES.map((template, index) => (
|
>
|
||||||
<Select.Option key={index} value={template.prompt}>
|
{PROMPT_TEMPLATES.map((template, index) => (
|
||||||
{t(template.label)}
|
<Select.Option key={index} value={template.prompt}>
|
||||||
</Select.Option>
|
{t(template.label)}
|
||||||
))}
|
</Select.Option>
|
||||||
</Select>
|
))}
|
||||||
{formData.selectedTemplate && (
|
</Select>
|
||||||
<div className='vip-template-preview'>
|
{formData.selectedTemplate && (
|
||||||
<Text type='tertiary' size='small'>
|
<div className='vip-template-preview'>
|
||||||
{t('模板内容')}: {formData.selectedTemplate}
|
<Text type='tertiary' size='small'>
|
||||||
</Text>
|
{t('模板内容')}: {formData.selectedTemplate}
|
||||||
</div>
|
</Text>
|
||||||
)}
|
</div>
|
||||||
</Section>
|
|
||||||
|
|
||||||
<Section icon={Video} title={t('提示词')}>
|
|
||||||
<TextArea
|
|
||||||
placeholder={t(
|
|
||||||
'描述你想要生成的视频内容,例如:一只可爱的猫咪在草地上玩耍',
|
|
||||||
)}
|
)}
|
||||||
value={formData.prompt}
|
|
||||||
onChange={(value) => updateField('prompt', value)}
|
|
||||||
autosize={{ minRows: 4, maxRows: 8 }}
|
|
||||||
maxLength={2000}
|
|
||||||
showClear
|
|
||||||
/>
|
|
||||||
<Text type='tertiary' size='small' className='vip-counter'>
|
|
||||||
{formData.prompt?.length || 0} / 2000
|
|
||||||
</Text>
|
|
||||||
</Section>
|
|
||||||
|
|
||||||
{selectedModel && dockParams.length > 0 ? (
|
|
||||||
<Section icon={SlidersHorizontal} title={t('生成参数')}>
|
|
||||||
<ParamRenderer
|
|
||||||
params={visibleParams}
|
|
||||||
values={formData.params}
|
|
||||||
onChange={updateParam}
|
|
||||||
placement='dock'
|
|
||||||
constraints={constraints}
|
|
||||||
/>
|
|
||||||
</Section>
|
</Section>
|
||||||
) : null}
|
|
||||||
|
|
||||||
{selectedModel && advancedParams.length > 0 ? (
|
<Section icon={Video} title={t('提示词')}>
|
||||||
<div className='vip-advanced'>
|
<TextArea
|
||||||
<Collapse defaultActiveKey={[]}>
|
aria-label={t('提示词')}
|
||||||
<Collapse.Panel
|
placeholder={t(
|
||||||
itemKey='advanced'
|
'描述你想要生成的视频内容,例如:一只可爱的猫咪在草地上玩耍',
|
||||||
header={
|
)}
|
||||||
<div className='vip-card-head' style={{ margin: 0 }}>
|
value={formData.prompt}
|
||||||
<span className='vip-card-icon' aria-hidden='true'>
|
onChange={(value) => updateField('prompt', value)}
|
||||||
<Settings2 size={14} />
|
autosize={{ minRows: 4, maxRows: 8 }}
|
||||||
</span>
|
maxLength={2000}
|
||||||
<span>{t('高级参数')}</span>
|
showClear
|
||||||
</div>
|
className='vip-prompt'
|
||||||
}
|
/>
|
||||||
>
|
<Text type='tertiary' size='small' className='vip-counter'>
|
||||||
<ParamRenderer
|
{formData.prompt?.length || 0} / 2000
|
||||||
params={visibleParams}
|
</Text>
|
||||||
values={formData.params}
|
</Section>
|
||||||
onChange={updateParam}
|
|
||||||
placement='advanced'
|
{selectedModel && dockParams.length > 0 ? (
|
||||||
constraints={constraints}
|
<Section icon={SlidersHorizontal} title={t('生成参数')}>
|
||||||
/>
|
<ParamRenderer
|
||||||
</Collapse.Panel>
|
params={visibleParams}
|
||||||
</Collapse>
|
values={formData.params}
|
||||||
</div>
|
onChange={updateParam}
|
||||||
) : null}
|
placement='dock'
|
||||||
</div>
|
constraints={constraints}
|
||||||
|
/>
|
||||||
|
</Section>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{selectedModel && advancedParams.length > 0 ? (
|
||||||
|
<div className='vip-advanced'>
|
||||||
|
<Collapse defaultActiveKey={[]}>
|
||||||
|
<Collapse.Panel
|
||||||
|
itemKey='advanced'
|
||||||
|
header={
|
||||||
|
<div className='vip-card-head' style={{ margin: 0 }}>
|
||||||
|
<span className='vip-card-icon' aria-hidden='true'>
|
||||||
|
<Settings2 size={14} />
|
||||||
|
</span>
|
||||||
|
<span>{t('高级参数')}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<ParamRenderer
|
||||||
|
params={visibleParams}
|
||||||
|
values={formData.params}
|
||||||
|
onChange={updateParam}
|
||||||
|
placement='advanced'
|
||||||
|
constraints={constraints}
|
||||||
|
/>
|
||||||
|
</Collapse.Panel>
|
||||||
|
</Collapse>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,66 +1,107 @@
|
|||||||
/* 视频预览面板 - 电影感动画背景(增强版) */
|
.video-preview-panel.ant-card {
|
||||||
|
display: flex;
|
||||||
/* 动态光晕1 - 缓慢飘动 */
|
flex-direction: column;
|
||||||
@keyframes videoPreviewFloat1 {
|
min-width: 0;
|
||||||
0%,
|
min-height: 0;
|
||||||
100% {
|
border-color: var(--border-subtle);
|
||||||
transform: translate3d(0, 0, 0);
|
border-radius: 12px;
|
||||||
}
|
background: var(--surface-card);
|
||||||
25% {
|
|
||||||
transform: translate3d(50px, -30px, 0);
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
transform: translate3d(80px, 20px, 0);
|
|
||||||
}
|
|
||||||
75% {
|
|
||||||
transform: translate3d(30px, 50px, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 动态光晕2 - 反向飘动 */
|
.video-preview-panel > .ant-card-body {
|
||||||
@keyframes videoPreviewFloat2 {
|
display: flex;
|
||||||
0%,
|
flex: 1;
|
||||||
100% {
|
flex-direction: column;
|
||||||
transform: translate3d(0, 0, 0);
|
min-width: 0;
|
||||||
}
|
min-height: 0;
|
||||||
25% {
|
padding: 0;
|
||||||
transform: translate3d(-60px, 40px, 0);
|
|
||||||
}
|
|
||||||
50% {
|
|
||||||
transform: translate3d(-30px, -50px, 0);
|
|
||||||
}
|
|
||||||
75% {
|
|
||||||
transform: translate3d(-70px, -20px, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 脉动效果 */
|
.video-preview-header {
|
||||||
@keyframes videoPreviewPulse {
|
flex-wrap: wrap;
|
||||||
0%,
|
}
|
||||||
100% {
|
|
||||||
opacity: 0.4;
|
.video-preview-actions {
|
||||||
transform: scale(1);
|
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;
|
.video-preview-actions {
|
||||||
transform: scale(1.1);
|
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;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ const VideoPreviewPanel = ({
|
|||||||
videoMaxHeight: '600px',
|
videoMaxHeight: '600px',
|
||||||
buttonSize: 'large',
|
buttonSize: 'large',
|
||||||
titleSize: 4,
|
titleSize: 4,
|
||||||
iconSize: 64,
|
|
||||||
progressWidth: 120,
|
progressWidth: 120,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -102,7 +101,6 @@ const VideoPreviewPanel = ({
|
|||||||
videoMaxHeight: '500px',
|
videoMaxHeight: '500px',
|
||||||
buttonSize: 'default',
|
buttonSize: 'default',
|
||||||
titleSize: 5,
|
titleSize: 5,
|
||||||
iconSize: 56,
|
|
||||||
progressWidth: 100,
|
progressWidth: 100,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -113,7 +111,6 @@ const VideoPreviewPanel = ({
|
|||||||
videoMaxHeight: '400px',
|
videoMaxHeight: '400px',
|
||||||
buttonSize: 'default',
|
buttonSize: 'default',
|
||||||
titleSize: 5,
|
titleSize: 5,
|
||||||
iconSize: 48,
|
|
||||||
progressWidth: 90,
|
progressWidth: 90,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -124,7 +121,6 @@ const VideoPreviewPanel = ({
|
|||||||
videoMaxHeight: '350px',
|
videoMaxHeight: '350px',
|
||||||
buttonSize: 'small',
|
buttonSize: 'small',
|
||||||
titleSize: 6,
|
titleSize: 6,
|
||||||
iconSize: 40,
|
|
||||||
progressWidth: 80,
|
progressWidth: 80,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -241,28 +237,8 @@ const VideoPreviewPanel = ({
|
|||||||
const renderTopBar = () => {
|
const renderTopBar = () => {
|
||||||
// 优先显示从任务列表选择的任务
|
// 优先显示从任务列表选择的任务
|
||||||
const displayTask = selectedTaskForPlay || currentTask;
|
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 (
|
return (
|
||||||
<div
|
<div className='video-preview-actions'>
|
||||||
style={{
|
|
||||||
padding: windowWidth > 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 ? (
|
{needTopUp ? (
|
||||||
<Button
|
<Button
|
||||||
type='warning'
|
type='warning'
|
||||||
@@ -283,14 +259,7 @@ const VideoPreviewPanel = ({
|
|||||||
onClick={isButtonDisabled ? undefined : handleGenerate}
|
onClick={isButtonDisabled ? undefined : handleGenerate}
|
||||||
disabled={isButtonDisabled || submitting}
|
disabled={isButtonDisabled || submitting}
|
||||||
loading={submitting}
|
loading={submitting}
|
||||||
style={{
|
className='video-generate-button'
|
||||||
fontWeight: 600,
|
|
||||||
background:
|
|
||||||
isButtonDisabled || submitting
|
|
||||||
? undefined
|
|
||||||
: 'linear-gradient(135deg, var(--ui-color-primary) 0%, var(--ui-color-primary-active, var(--ui-color-primary)) 100%)',
|
|
||||||
border: 'none',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{submitting
|
{submitting
|
||||||
? t('提交中...')
|
? t('提交中...')
|
||||||
@@ -344,8 +313,6 @@ const VideoPreviewPanel = ({
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div style={{ flex: 1 }} />
|
|
||||||
|
|
||||||
<Tooltip
|
<Tooltip
|
||||||
content={
|
content={
|
||||||
<div style={{ padding: '12px', maxWidth: '300px' }}>
|
<div style={{ padding: '12px', maxWidth: '300px' }}>
|
||||||
@@ -368,11 +335,13 @@ const VideoPreviewPanel = ({
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
position='bottomRight'
|
position='bottomRight'
|
||||||
trigger='hover'
|
trigger={['hover', 'focus']}
|
||||||
showArrow={true}
|
showArrow={true}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
icon={<ActionHelpCircle size={18} />}
|
icon={<ActionHelpCircle size={18} />}
|
||||||
|
className='video-help-button'
|
||||||
|
aria-label={t('使用提示')}
|
||||||
type='tertiary'
|
type='tertiary'
|
||||||
size={windowWidth > 768 ? 'default' : 'small'}
|
size={windowWidth > 768 ? 'default' : 'small'}
|
||||||
/>
|
/>
|
||||||
@@ -702,199 +671,31 @@ const VideoPreviewPanel = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 默认空状态 - 纯CSS电影感动画背景(无网络资源消耗)
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div className='video-preview-empty'>
|
||||||
style={{
|
<span className='video-preview-empty-icon' aria-hidden='true'>
|
||||||
display: 'flex',
|
<Film size={28} />
|
||||||
flexDirection: 'column',
|
</span>
|
||||||
minHeight: config.minHeight,
|
<h3>{t('AI 视频生成')}</h3>
|
||||||
height: '100%',
|
<p>
|
||||||
position: 'relative',
|
{formData.mode === 'text2video'
|
||||||
borderRadius: '12px',
|
? t('输入提示词,让 AI 为你创造精彩视频')
|
||||||
overflow: 'hidden',
|
: t('上传图片并输入提示词,生成动态视频')}
|
||||||
margin: '16px',
|
</p>
|
||||||
background:
|
|
||||||
'linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%)',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* CSS动画背景 - 流动光效(增强版) */}
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0,
|
|
||||||
overflow: 'hidden',
|
|
||||||
pointerEvents: 'none',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* 动态光晕1 - 紫色 */}
|
|
||||||
<div
|
|
||||||
className='video-preview-glow1'
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
width: '60%',
|
|
||||||
height: '60%',
|
|
||||||
top: '10%',
|
|
||||||
left: '5%',
|
|
||||||
background:
|
|
||||||
'radial-gradient(ellipse at center, color-mix(in srgb, var(--brand-gradient-via) 35%, transparent) 0%, color-mix(in srgb, var(--brand-gradient-via) 10%, transparent) 40%, transparent 70%)',
|
|
||||||
borderRadius: '50%',
|
|
||||||
filter: 'blur(40px)',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{/* 动态光晕2 - 橙红色 */}
|
|
||||||
<div
|
|
||||||
className='video-preview-glow2'
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
width: '50%',
|
|
||||||
height: '50%',
|
|
||||||
bottom: '10%',
|
|
||||||
right: '5%',
|
|
||||||
background:
|
|
||||||
'radial-gradient(ellipse at center, rgba(251, 146, 60, 0.3) 0%, rgba(251, 146, 60, 0.1) 40%, transparent 70%)',
|
|
||||||
borderRadius: '50%',
|
|
||||||
filter: 'blur(40px)',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{/* 动态光晕3 - 金色中心 */}
|
|
||||||
<div
|
|
||||||
className='video-preview-glow3'
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
width: '40%',
|
|
||||||
height: '40%',
|
|
||||||
top: '30%',
|
|
||||||
left: '30%',
|
|
||||||
background:
|
|
||||||
'radial-gradient(ellipse at center, rgba(251, 191, 36, 0.25) 0%, transparent 60%)',
|
|
||||||
borderRadius: '50%',
|
|
||||||
filter: 'blur(30px)',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 电影宽银幕效果 - 上下黑边 */}
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
height: '6%',
|
|
||||||
background:
|
|
||||||
'linear-gradient(180deg, rgba(0,0,0,0.95) 0%, transparent 100%)',
|
|
||||||
zIndex: 2,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
bottom: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
height: '6%',
|
|
||||||
background:
|
|
||||||
'linear-gradient(0deg, rgba(0,0,0,0.95) 0%, transparent 100%)',
|
|
||||||
zIndex: 2,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* 中央内容区域 */}
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
flex: 1,
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
padding: config.padding,
|
|
||||||
color: 'white',
|
|
||||||
position: 'relative',
|
|
||||||
zIndex: 3,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
|
||||||
borderRadius: '50%',
|
|
||||||
padding: windowWidth > 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)';
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Film
|
|
||||||
size={config.iconSize}
|
|
||||||
style={{
|
|
||||||
color: 'rgba(255, 220, 180, 0.9)',
|
|
||||||
filter: 'drop-shadow(0 2px 12px rgba(255,200,150,0.4))',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Title
|
|
||||||
heading={config.titleSize}
|
|
||||||
style={{
|
|
||||||
marginBottom: '12px',
|
|
||||||
color: 'rgba(255, 250, 245, 0.95)',
|
|
||||||
fontWeight: 700,
|
|
||||||
textShadow: '0 4px 20px rgba(0, 0, 0, 0.6)',
|
|
||||||
letterSpacing: '3px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t('AI 视频生成')}
|
|
||||||
</Title>
|
|
||||||
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
marginBottom: windowWidth > 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('上传图片并输入提示词,生成动态视频')}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card className='video-preview-panel'>
|
||||||
style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
|
<header className='video-panel-header video-preview-header'>
|
||||||
styles={{
|
<div className='video-panel-heading'>
|
||||||
body: {
|
<Film size={17} aria-hidden='true' />
|
||||||
flex: 1,
|
<h2>{t('视频预览')}</h2>
|
||||||
display: 'flex',
|
</div>
|
||||||
flexDirection: 'column',
|
{renderTopBar()}
|
||||||
overflow: 'hidden',
|
</header>
|
||||||
padding: 0,
|
<div className='video-preview-stage app-scrollbar'>{renderPreview()}</div>
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* 始终显示的顶部操作栏 */}
|
|
||||||
{renderTopBar()}
|
|
||||||
|
|
||||||
{/* 内容区域 */}
|
|
||||||
<div style={{ flex: 1, overflow: 'auto' }}>{renderPreview()}</div>
|
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import {
|
|||||||
RefreshCw as ActionRefreshCw,
|
RefreshCw as ActionRefreshCw,
|
||||||
Trash2 as ActionTrash2,
|
Trash2 as ActionTrash2,
|
||||||
AlertCircle as ActionAlertCircle,
|
AlertCircle as ActionAlertCircle,
|
||||||
|
ChevronDown as ActionChevronDown,
|
||||||
} from '@/components/common/icons/ActionIcons';
|
} from '@/components/common/icons/ActionIcons';
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useId } from 'react';
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
Button,
|
Button,
|
||||||
@@ -17,8 +18,7 @@ import {
|
|||||||
Badge,
|
Badge,
|
||||||
} from '@/components/ui';
|
} from '@/components/ui';
|
||||||
import {
|
import {
|
||||||
ChevronUp,
|
ListVideo,
|
||||||
ChevronDown,
|
|
||||||
CheckCircle2,
|
CheckCircle2,
|
||||||
AlertCircle,
|
AlertCircle,
|
||||||
Clock,
|
Clock,
|
||||||
@@ -47,32 +47,7 @@ const VideoTaskQueue = ({
|
|||||||
// 8 列合计 1190px 塞进 ~340px 容器、按钮全带文字,实际完全用不了。
|
// 8 列合计 1190px 塞进 ~340px 容器、按钮全带文字,实际完全用不了。
|
||||||
const isCompact = useIsMobile();
|
const isCompact = useIsMobile();
|
||||||
const [selectedTasks, setSelectedTasks] = useState([]);
|
const [selectedTasks, setSelectedTasks] = useState([]);
|
||||||
const [windowHeight, setWindowHeight] = useState(window.innerHeight);
|
const queueId = useId();
|
||||||
|
|
||||||
// 监听窗口高度变化
|
|
||||||
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 getStatusTag = (status) => {
|
const getStatusTag = (status) => {
|
||||||
@@ -303,65 +278,30 @@ const VideoTaskQueue = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<section className='video-queue'>
|
||||||
{/* 折叠触发器 */}
|
<h2 className='video-queue-heading'>
|
||||||
<div
|
<button
|
||||||
style={{
|
type='button'
|
||||||
position: 'absolute',
|
className='video-queue-toggle'
|
||||||
bottom: visible ? `${queueHeight}px` : '0',
|
aria-expanded={visible}
|
||||||
left: 0,
|
aria-controls={queueId}
|
||||||
right: 0,
|
onClick={() => setVisible(!visible)}
|
||||||
height: '40px',
|
>
|
||||||
backgroundColor: 'var(--ui-color-bg-1)',
|
<ListVideo size={19} aria-hidden='true' />
|
||||||
borderTop: '1px solid var(--ui-color-border)',
|
<span>{t('任务队列')}</span>
|
||||||
display: 'flex',
|
<span className='video-queue-count'>{taskStats.total}</span>
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
cursor: 'pointer',
|
|
||||||
transition: 'bottom 0.3s',
|
|
||||||
zIndex: 10,
|
|
||||||
}}
|
|
||||||
onClick={() => setVisible(!visible)}
|
|
||||||
>
|
|
||||||
<Space>
|
|
||||||
{visible ? <ChevronDown size={16} /> : <ChevronUp size={16} />}
|
|
||||||
<span style={{ fontSize: !isCompact ? '14px' : '12px' }}>
|
|
||||||
{t('任务队列')} ({taskStats.total})
|
|
||||||
</span>
|
|
||||||
{taskStats.in_progress > 0 && (
|
{taskStats.in_progress > 0 && (
|
||||||
<Badge count={taskStats.in_progress} type='danger' />
|
<Badge count={taskStats.in_progress} type='danger' />
|
||||||
)}
|
)}
|
||||||
</Space>
|
<ActionChevronDown
|
||||||
</div>
|
size={16}
|
||||||
|
className='video-queue-chevron'
|
||||||
{/* 任务队列抽屉 */}
|
aria-hidden='true'
|
||||||
<div
|
/>
|
||||||
style={{
|
</button>
|
||||||
position: 'absolute',
|
</h2>
|
||||||
bottom: visible ? '0' : `-${queueHeight}px`,
|
<div id={queueId} className='video-queue-content' hidden={!visible}>
|
||||||
left: 0,
|
<div className='video-queue-toolbar'>
|
||||||
right: 0,
|
|
||||||
height: `${queueHeight}px`,
|
|
||||||
backgroundColor: 'var(--ui-color-bg-0)',
|
|
||||||
borderTop: '1px solid var(--ui-color-border)',
|
|
||||||
transition: 'bottom 0.3s',
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
zIndex: 9,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* 工具栏 */}
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
padding: !isCompact ? '12px 16px' : '8px 12px',
|
|
||||||
borderBottom: '1px solid var(--ui-color-border)',
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
alignItems: 'center',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
gap: '8px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<Button
|
<Button
|
||||||
size={!isCompact ? 'default' : 'small'}
|
size={!isCompact ? 'default' : 'small'}
|
||||||
@@ -427,7 +367,7 @@ const VideoTaskQueue = ({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 任务表格 */}
|
{/* 任务表格 */}
|
||||||
<div style={{ flex: 1, overflow: 'auto' }}>
|
<div className='video-queue-table app-scrollbar'>
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={tasks}
|
dataSource={tasks}
|
||||||
@@ -446,7 +386,7 @@ const VideoTaskQueue = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,31 +1,21 @@
|
|||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useRef } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import VideoInputPanel from './Video/VideoInputPanel';
|
import VideoInputPanel from './Video/VideoInputPanel';
|
||||||
import VideoPreviewPanel from './Video/VideoPreviewPanel';
|
import VideoPreviewPanel from './Video/VideoPreviewPanel';
|
||||||
import VideoTaskQueue from './Video/VideoTaskQueue';
|
import VideoTaskQueue from './Video/VideoTaskQueue';
|
||||||
import { useVideoGeneration } from '../../../../hooks/video/useVideoGeneration';
|
import { useVideoGeneration } from '../../../../hooks/video/useVideoGeneration';
|
||||||
import { showInfo } from '../../../../helpers';
|
import { showInfo } from '../../../../helpers';
|
||||||
|
import './Video/VideoWorkspace.css';
|
||||||
|
|
||||||
const VideoGenerationTab = () => {
|
const VideoGenerationTab = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [leftPanelCollapsed, setLeftPanelCollapsed] = useState(false);
|
const [leftPanelCollapsed, setLeftPanelCollapsed] = useState(false);
|
||||||
const [taskQueueVisible, setTaskQueueVisible] = useState(false);
|
const [taskQueueVisible, setTaskQueueVisible] = useState(false);
|
||||||
const [windowWidth, setWindowWidth] = useState(window.innerWidth);
|
|
||||||
const [selectedTaskForPlay, setSelectedTaskForPlay] = useState(null);
|
const [selectedTaskForPlay, setSelectedTaskForPlay] = useState(null);
|
||||||
// 输入面板容器:再生成回填后滚动到面板顶部
|
// 输入面板容器:再生成回填后滚动到面板顶部
|
||||||
const inputPanelRef = useRef(null);
|
const inputPanelRef = useRef(null);
|
||||||
const inputScrollRef = 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 creation = useVideoGeneration();
|
||||||
const {
|
const {
|
||||||
// 表单数据
|
// 表单数据
|
||||||
@@ -95,197 +85,52 @@ const VideoGenerationTab = () => {
|
|||||||
showInfo(t('已回填原参数,确认后点击生成'));
|
showInfo(t('已回填原参数,确认后点击生成'));
|
||||||
// 等面板展开渲染后再滚动
|
// 等面板展开渲染后再滚动
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
inputScrollRef.current?.scrollTo?.({ top: 0, behavior: 'smooth' });
|
inputScrollRef.current?.scrollTo?.({ top: 0 });
|
||||||
inputPanelRef.current?.scrollIntoView?.({
|
inputPanelRef.current?.scrollIntoView?.({
|
||||||
behavior: 'smooth',
|
|
||||||
block: 'start',
|
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 (
|
return (
|
||||||
<div
|
<div className='video-workspace-body'>
|
||||||
style={{
|
<div className='video-workspace-grid'>
|
||||||
height: '100%',
|
<div ref={inputPanelRef} className='video-workspace-composer'>
|
||||||
display: 'flex',
|
<VideoInputPanel
|
||||||
flexDirection: 'column',
|
creation={creation}
|
||||||
position: 'relative',
|
collapsed={leftPanelCollapsed}
|
||||||
overflow: 'hidden',
|
onCollapse={() => setLeftPanelCollapsed((current) => !current)}
|
||||||
}}
|
scrollRef={inputScrollRef}
|
||||||
>
|
/>
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
flex: 1,
|
|
||||||
overflow: layoutConfig.direction === 'row' ? 'hidden' : 'auto',
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: layoutConfig.direction === 'row' ? 'row' : 'column',
|
|
||||||
gap: layoutConfig.direction === 'column' ? '16px' : '0',
|
|
||||||
position: 'relative',
|
|
||||||
paddingBottom: '40px', // 为任务队列触发器留出空间
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* 左侧:输入区域(区域1) */}
|
|
||||||
<div
|
|
||||||
ref={inputPanelRef}
|
|
||||||
style={{
|
|
||||||
width:
|
|
||||||
layoutConfig.direction === 'row'
|
|
||||||
? layoutConfig.leftWidth
|
|
||||||
: '100%',
|
|
||||||
minWidth: layoutConfig.minLeftWidth,
|
|
||||||
height: layoutConfig.direction === 'row' ? '100%' : 'auto',
|
|
||||||
// 折叠态不能再预留 500px:面板收起后只剩一个 fixed 定位的浮动箭头,
|
|
||||||
// 这 500px 会变成页面顶部一整块空白
|
|
||||||
minHeight:
|
|
||||||
layoutConfig.direction === 'column' && !leftPanelCollapsed
|
|
||||||
? '500px'
|
|
||||||
: 'auto',
|
|
||||||
flexShrink: layoutConfig.direction === 'row' ? 0 : 1,
|
|
||||||
backgroundColor: 'var(--ui-color-bg-1)',
|
|
||||||
borderRight:
|
|
||||||
layoutConfig.direction === 'row'
|
|
||||||
? '1px solid var(--ui-color-border)'
|
|
||||||
: 'none',
|
|
||||||
borderBottom:
|
|
||||||
layoutConfig.direction === 'column'
|
|
||||||
? '1px solid var(--ui-color-border)'
|
|
||||||
: 'none',
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'column',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
ref={inputScrollRef}
|
|
||||||
className='app-scrollbar'
|
|
||||||
style={{
|
|
||||||
height: '100%',
|
|
||||||
overflow: 'auto',
|
|
||||||
paddingBottom: layoutConfig.direction === 'row' ? '16px' : '16px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<VideoInputPanel
|
|
||||||
creation={creation}
|
|
||||||
onCollapse={() => setLeftPanelCollapsed(!leftPanelCollapsed)}
|
|
||||||
collapsed={leftPanelCollapsed}
|
|
||||||
collapsible={layoutConfig.direction === 'row'}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<VideoPreviewPanel
|
||||||
{/* 右侧:预览+生成区域 */}
|
formData={formData}
|
||||||
<div
|
generating={generating}
|
||||||
style={{
|
currentTask={currentTask}
|
||||||
flex: 1,
|
onGenerate={handleGenerate}
|
||||||
height: layoutConfig.direction === 'row' ? '100%' : 'auto',
|
onCancel={handleCancel}
|
||||||
minHeight: layoutConfig.direction === 'column' ? '600px' : 'auto',
|
selectedModel={selectedModel}
|
||||||
minWidth: 0,
|
submitBlock={submitBlock}
|
||||||
}}
|
submitting={submitting}
|
||||||
>
|
quote={quote}
|
||||||
<div
|
quoteLoading={quoteLoading}
|
||||||
className='app-scrollbar'
|
quoteFailed={quoteFailed}
|
||||||
style={{
|
estSeconds={estSeconds}
|
||||||
height: '100%',
|
selectedTaskForPlay={selectedTaskForPlay}
|
||||||
backgroundColor: 'var(--ui-color-bg-0)',
|
|
||||||
padding: windowWidth > 768 ? '16px' : '12px',
|
|
||||||
overflow: 'auto',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<VideoPreviewPanel
|
|
||||||
formData={formData}
|
|
||||||
generating={generating}
|
|
||||||
currentTask={currentTask}
|
|
||||||
onGenerate={handleGenerate}
|
|
||||||
onCancel={handleCancel}
|
|
||||||
selectedModel={selectedModel}
|
|
||||||
submitBlock={submitBlock}
|
|
||||||
submitting={submitting}
|
|
||||||
quote={quote}
|
|
||||||
quoteLoading={quoteLoading}
|
|
||||||
quoteFailed={quoteFailed}
|
|
||||||
estSeconds={estSeconds}
|
|
||||||
selectedTaskForPlay={selectedTaskForPlay}
|
|
||||||
onRegenerate={handleRegenerate}
|
|
||||||
onClearSelectedTask={handleClearSelectedTask}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 底部:任务队列(区域4) - 使用 absolute 定位,相对于父容器 */}
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
bottom: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
zIndex: 1000,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<VideoTaskQueue
|
|
||||||
visible={taskQueueVisible}
|
|
||||||
setVisible={setTaskQueueVisible}
|
|
||||||
tasks={tasks}
|
|
||||||
onRefresh={refreshTasks}
|
|
||||||
onDelete={deleteTask}
|
|
||||||
onDownload={downloadTask}
|
|
||||||
onPlay={handlePlayTask}
|
|
||||||
onRegenerate={handleRegenerate}
|
onRegenerate={handleRegenerate}
|
||||||
|
onClearSelectedTask={handleClearSelectedTask}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<VideoTaskQueue
|
||||||
|
visible={taskQueueVisible}
|
||||||
|
setVisible={setTaskQueueVisible}
|
||||||
|
tasks={tasks}
|
||||||
|
onRefresh={refreshTasks}
|
||||||
|
onDelete={deleteTask}
|
||||||
|
onDownload={downloadTask}
|
||||||
|
onPlay={handlePlayTask}
|
||||||
|
onRegenerate={handleRegenerate}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useContext } from 'react';
|
import React, { useContext } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
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 VideoGenerationTab from './AICreation/VideoGenerationTab';
|
||||||
import CreationStudio from '../../../components/creation/CreationStudio';
|
import CreationStudio from '../../../components/creation/CreationStudio';
|
||||||
import { StatusContext } from '../../../context/Status';
|
import { StatusContext } from '../../../context/Status';
|
||||||
@@ -16,81 +16,17 @@ const VideoGeneration = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='h-full flex flex-col p-6 relative overflow-hidden'>
|
<div className='video-workspace app-scrollbar'>
|
||||||
{/* 背景由父级 ExperienceCenter 的 PageBackground(rich) 统一提供,此处不再渲染 */}
|
<header className='video-workspace-heading'>
|
||||||
|
<span className='video-workspace-icon' aria-hidden='true'>
|
||||||
{/* Header */}
|
<Video size={22} />
|
||||||
<div className='relative z-10 flex-shrink-0 mb-6'>
|
</span>
|
||||||
<div className='flex items-center gap-4'>
|
<div>
|
||||||
{/* 图标容器 */}
|
<h1>{t('视频生成')}</h1>
|
||||||
<div className='relative'>
|
<p>{t('使用 AI 创建令人惊叹的视频内容')}</p>
|
||||||
<div className='absolute -inset-2 bg-gradient-to-r from-cyan-500/30 to-blue-500/30 rounded-2xl blur-lg opacity-60' />
|
|
||||||
<div className='relative p-3 bg-gradient-to-br from-cyan-500 via-blue-500 to-brand-to rounded-2xl shadow-xl shadow-cyan-500/30'>
|
|
||||||
<Video size={26} className='text-white' />
|
|
||||||
</div>
|
|
||||||
<Sparkles
|
|
||||||
size={16}
|
|
||||||
className='absolute -top-1 -right-1 text-amber-400 animate-pulse'
|
|
||||||
/>
|
|
||||||
|
|
||||||
{/* 播放动画指示器 */}
|
|
||||||
<div className='absolute -bottom-1 -left-1 w-5 h-5 rounded-full bg-green-500 flex items-center justify-center shadow-lg shadow-green-500/50'>
|
|
||||||
<Play size={10} className='text-white ml-0.5' fill='white' />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 标题文字 */}
|
|
||||||
<div>
|
|
||||||
<h1 className='text-2xl md:text-3xl font-bold flex items-center gap-2'>
|
|
||||||
<span className='bg-clip-text text-transparent bg-gradient-to-r from-cyan-600 via-blue-600 to-brand-to dark:from-cyan-400 dark:via-blue-400 dark:to-brand-to'>
|
|
||||||
{t('视频生成')}
|
|
||||||
</span>
|
|
||||||
</h1>
|
|
||||||
<p className='text-sm text-gray-500 dark:text-gray-400 mt-1'>
|
|
||||||
{t('使用 AI 创建令人惊叹的视频内容')}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* 右侧装饰标签 */}
|
|
||||||
<div className='hidden md:flex items-center gap-2 ml-auto'>
|
|
||||||
<div className='flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-gradient-to-r from-cyan-50 to-teal-50 dark:from-cyan-950/30 dark:to-teal-950/30 border border-cyan-200/50 dark:border-cyan-800/30'>
|
|
||||||
<Clapperboard size={14} className='text-cyan-500' />
|
|
||||||
<span className='text-xs font-medium text-cyan-600 dark:text-cyan-400'>
|
|
||||||
{t('图生视频')}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className='flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-gradient-to-r from-blue-50 to-brand-to/5 dark:from-blue-950/30 dark:to-brand-to/30 border border-blue-200/50 dark:border-blue-800/30'>
|
|
||||||
<Film size={14} className='text-blue-500' />
|
|
||||||
<span className='text-xs font-medium text-blue-600 dark:text-blue-400'>
|
|
||||||
{t('文生视频')}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className='flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-gradient-to-r from-brand-from/5 to-brand-to/5 dark:from-brand-from/30 dark:to-brand-to/30 border border-brand/50 dark:border-brand-deep/30'>
|
|
||||||
<Sparkles size={14} className='text-brand' />
|
|
||||||
<span className='text-xs font-medium text-brand-deep dark:text-brand-from'>
|
|
||||||
{t('多模型支持')}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</header>
|
||||||
|
<VideoGenerationTab />
|
||||||
{/* Content */}
|
|
||||||
<div className='relative z-10 flex-1 min-h-0'>
|
|
||||||
{/* 卡片装饰边框 */}
|
|
||||||
<div className='absolute -inset-0.5 bg-gradient-to-r from-cyan-500/20 via-blue-500/20 to-brand-to/20 rounded-[20px] blur-sm opacity-60' />
|
|
||||||
|
|
||||||
{/* 内容卡片 */}
|
|
||||||
<div className='relative h-full bg-white/70 dark:bg-neutral-900/70 backdrop-blur-xl rounded-2xl border border-white/50 dark:border-neutral-800/50 shadow-xl shadow-cyan-500/5 overflow-hidden'>
|
|
||||||
{/* 顶部装饰线 */}
|
|
||||||
<div className='absolute top-0 left-0 right-0 h-[2px] bg-gradient-to-r from-transparent via-cyan-500/50 to-transparent' />
|
|
||||||
|
|
||||||
{/* 左侧装饰线 */}
|
|
||||||
<div className='absolute top-0 bottom-0 left-0 w-[2px] bg-gradient-to-b from-transparent via-blue-500/30 to-transparent' />
|
|
||||||
|
|
||||||
<VideoGenerationTab />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -190,12 +190,16 @@ const ExperienceCenter = () => {
|
|||||||
* 子组件不再各自渲染背景,避免双层叠加。
|
* 子组件不再各自渲染背景,避免双层叠加。
|
||||||
* text-model 特例:TextModel 自带 via-white 亮底保证聊天可读性,由其自身渲染,此处跳过。
|
* text-model 特例:TextModel 自带 via-white 亮底保证聊天可读性,由其自身渲染,此处跳过。
|
||||||
* 沉浸式生成页(视频/图片)用 rich 大光球,密钥管理(Token 列表)用 subtle。 */}
|
* 沉浸式生成页(视频/图片)用 rich 大光球,密钥管理(Token 列表)用 subtle。 */}
|
||||||
{!isTextModel && (
|
{!isTextModel &&
|
||||||
<PageBackground
|
(!(isVideoGeneration || isImageGeneration) ||
|
||||||
variant={isVideoGeneration || isImageGeneration ? 'rich' : 'subtle'}
|
creationStudioEnabled) && (
|
||||||
animate
|
<PageBackground
|
||||||
/>
|
variant={
|
||||||
)}
|
isVideoGeneration || isImageGeneration ? 'rich' : 'subtle'
|
||||||
|
}
|
||||||
|
animate
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* 内容区域 */}
|
{/* 内容区域 */}
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
## 单一表单数据
|
## 单一表单数据
|
||||||
|
|
||||||
首页、关于微词元、预约演示、动态与洞察共用一个配置对象,切换页签保留输入。
|
首页、关于微元算力、预约演示、动态与洞察共用一个配置对象,切换页签保留输入。
|
||||||
teamMembers 在两个页签共用,不生成不同的副本。原有 11 个字段均必填。
|
teamMembers 在两个页签共用,不生成不同的副本。原有 11 个字段均必填。
|
||||||
动态与洞察绑定 insights 对象,包含 categories 和 articles,不按页签拆分保存。
|
动态与洞察绑定 insights 对象,包含 categories 和 articles,不按页签拆分保存。
|
||||||
model.js 定义字段、页签、初始化、标准化和校验规则。
|
model.js 定义字段、页签、初始化、标准化和校验规则。
|
||||||
|
|
||||||
保存按首页、关于微词元、预约演示、动态与洞察顺序校验全部字段,错误保存在各表单项内。
|
保存按首页、关于微元算力、预约演示、动态与洞察顺序校验全部字段,错误保存在各表单项内。
|
||||||
空输入框提示“请输入中文字段名”,选择框提示“请选择中文字段名”,二维码提示“请上传企业微信二维码”。
|
空输入框提示“请输入中文字段名”,选择框提示“请选择中文字段名”,二维码提示“请上传企业微信二维码”。
|
||||||
每个非当前页签有错误时只显示一条“请完善某页签的配置”警告,不列出全部字段,不自动切换页签。
|
每个非当前页签有错误时只显示一条“请完善某页签的配置”警告,不列出全部字段,不自动切换页签。
|
||||||
当前页签只显示表单项错误;切换页签后,其他页签的错误状态仍会显示。
|
当前页签只显示表单项错误;切换页签后,其他页签的错误状态仍会显示。
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ export const TABS = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'about',
|
key: 'about',
|
||||||
label: '关于微词元',
|
label: '关于微元算力',
|
||||||
description: '配置官网关于微词元区域展示的团队与服务信息。',
|
description: '配置官网关于微元算力区域展示的团队与服务信息。',
|
||||||
fields: ['teamMembers', 'researchRatio', 'headquarters', 'serviceNetwork'],
|
fields: ['teamMembers', 'researchRatio', 'headquarters', 'serviceNetwork'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ export const FIELDS = {
|
|||||||
},
|
},
|
||||||
teamMembers: {
|
teamMembers: {
|
||||||
label: '团队成员',
|
label: '团队成员',
|
||||||
note: '首页与关于微词元共用',
|
note: '首页与关于微元算力共用',
|
||||||
placeholder: '请输入团队成员数量,例如 50',
|
placeholder: '请输入团队成员数量,例如 50',
|
||||||
metric: { kind: 'integer', suffix: '+' },
|
metric: { kind: 'integer', suffix: '+' },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ test('saving marks all fields inline and emits one ordered summary per hidden in
|
|||||||
assert.equal(page.warnings.length, 0);
|
assert.equal(page.warnings.length, 0);
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
page.messages.map((item) => item.message),
|
page.messages.map((item) => item.message),
|
||||||
['请完善首页的配置', '请完善关于微词元的配置', '请完善预约演示的配置'],
|
['请完善首页的配置', '请完善关于微元算力的配置', '请完善预约演示的配置'],
|
||||||
);
|
);
|
||||||
page.switchTab('home');
|
page.switchTab('home');
|
||||||
assert.equal(page.field('paidCustomers').props.error, '请输入付费企业客户');
|
assert.equal(page.field('paidCustomers').props.error, '请输入付费企业客户');
|
||||||
@@ -408,7 +408,7 @@ test('a shared invalid field still flags its hidden tab exactly once', async ()
|
|||||||
await page.save();
|
await page.save();
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
page.messages.map((item) => item.message),
|
page.messages.map((item) => item.message),
|
||||||
['请完善关于微词元的配置'],
|
['请完善关于微元算力的配置'],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user