style: reformat Step2MaterialSelect.tsx with repo prettier config (#1899 #1900)
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Has been cancelled
CI/CD Pipeline / Check if frontend-only change (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / PR Build API Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
AI Code Review / AI Code Review (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled

This commit is contained in:
2026-09-14 21:37:27 +08:00
parent 763dee6fb9
commit a42310215e
@@ -2,30 +2,30 @@
* Step 1 素材选择组件(#1899 原 Step2 前移)
* 新增片段数量输入,系统按片段数智能匹配素材
*/
import React from "react";
import type { EditPlanClip } from "@/api/template-editor";
import { useStep2Materials } from "../hooks/useStep2Materials";
import MaterialModeTabs from "./material/MaterialModeTabs";
import ManualMaterialList from "./material/ManualMaterialList";
import SmartMatchInput from "./material/SmartMatchInput";
import SmartMatchResults from "./material/SmartMatchResults";
import React from "react"
import type { EditPlanClip } from "@/api/template-editor"
import { useStep2Materials } from "../hooks/useStep2Materials"
import MaterialModeTabs from "./material/MaterialModeTabs"
import ManualMaterialList from "./material/ManualMaterialList"
import SmartMatchInput from "./material/SmartMatchInput"
import SmartMatchResults from "./material/SmartMatchResults"
interface Step2MaterialSelectProps {
materialMode: "manual" | "auto";
onMaterialModeChange: (mode: "manual" | "auto") => void;
selectedMaterials: string[];
onSelectedMaterialsChange: (ids: string[]) => void;
smartSelectedIds: string[];
onSmartSelectedIdsChange: (ids: string[]) => void;
materialMode: "manual" | "auto"
onMaterialModeChange: (mode: "manual" | "auto") => void
selectedMaterials: string[]
onSelectedMaterialsChange: (ids: string[]) => void
smartSelectedIds: string[]
onSmartSelectedIdsChange: (ids: string[]) => void
/** 片段数量(#1899) */
clipCount: number;
onClipCountChange: (n: number) => void;
clipCount: number
onClipCountChange: (n: number) => void
/** 服务端 clips 创建成功后的回调 */
onServerClipsChange?: (clips: EditPlanClip[]) => void;
onServerClipsChange?: (clips: EditPlanClip[]) => void
}
const Step2MaterialSelect: React.FC<Step2MaterialSelectProps> = (props) => {
const m = useStep2Materials(props);
const m = useStep2Materials(props)
return (
<div className="xx-form-section">
@@ -42,9 +42,8 @@ const Step2MaterialSelect: React.FC<Step2MaterialSelectProps> = (props) => {
step={1}
value={props.clipCount}
onChange={(e) => {
const v = parseInt(e.target.value, 10);
if (!isNaN(v))
props.onClipCountChange(Math.max(1, Math.min(10, v)));
const v = parseInt(e.target.value, 10)
if (!isNaN(v)) props.onClipCountChange(Math.max(1, Math.min(10, v)))
}}
style={{
width: 80,
@@ -56,18 +55,13 @@ const Step2MaterialSelect: React.FC<Step2MaterialSelectProps> = (props) => {
fontSize: 14,
}}
/>
<span
style={{ fontSize: 12, color: "var(--text-secondary, #6b7280)" }}
>
<span style={{ fontSize: 12, color: "var(--text-secondary, #6b7280)" }}>
系统将按片段数量智能匹配素材(1-10,默认3)
</span>
</div>
</div>
<MaterialModeTabs
mode={m.materialMode}
onModeChange={m.onMaterialModeChange}
/>
<MaterialModeTabs mode={m.materialMode} onModeChange={m.onMaterialModeChange} />
<div className="xx-form-field" style={{ marginTop: 12 }}>
<label>选择视频库</label>
@@ -102,9 +96,7 @@ const Step2MaterialSelect: React.FC<Step2MaterialSelectProps> = (props) => {
gap: 10,
}}
>
<span className="xx-pill xx-pill-ok">
已选 {m.selectedMaterials.length} 个素材
</span>
<span className="xx-pill xx-pill-ok">已选 {m.selectedMaterials.length} 个素材</span>
</div>
<ManualMaterialList
@@ -128,14 +120,11 @@ const Step2MaterialSelect: React.FC<Step2MaterialSelectProps> = (props) => {
loading={m.materialsLoading}
/>
<SmartMatchResults
matching={m.smartMatching}
hasMatched={m.hasMatched}
/>
<SmartMatchResults matching={m.smartMatching} hasMatched={m.hasMatched} />
</div>
)}
</div>
);
};
)
}
export default Step2MaterialSelect;
export default Step2MaterialSelect