feat: integrate learning module
This commit is contained in:
@@ -149,6 +149,11 @@ type GenerationQuoteDraft = {
|
||||
generationParameters: DesignGenerationParameters;
|
||||
};
|
||||
|
||||
type EditableGenerationParameters = Partial<Pick<
|
||||
DesignGenerationParameters,
|
||||
'resolution' | 'aspectRatio' | 'durationSeconds'
|
||||
>>;
|
||||
|
||||
function quoteDraftFromQuote(quote: DesignGenerationQuote): GenerationQuoteDraft {
|
||||
return {
|
||||
quoteId: quote.quoteId,
|
||||
@@ -611,11 +616,10 @@ function QuoteCard({
|
||||
onRetry: () => void;
|
||||
onConfirm: () => void;
|
||||
}) {
|
||||
const availableModels = quote.generationOptions.models.filter((option) => !option.disabled);
|
||||
const availableResolutions = quote.generationOptions.resolutions.filter((option) => !option.disabled);
|
||||
const availableDurations = quote.generationOptions.durations.filter((option) => !option.disabled);
|
||||
const availableAspectRatios = quote.generationOptions.aspectRatios.filter((option) => !option.disabled);
|
||||
const updateParameters = (next: Partial<DesignGenerationParameters>) => {
|
||||
const updateParameters = (next: EditableGenerationParameters) => {
|
||||
onDraftChange({
|
||||
...draft,
|
||||
generationParameters: {
|
||||
@@ -631,7 +635,10 @@ function QuoteCard({
|
||||
className="mt-3 rounded-2xl border border-brand/25 bg-brand-soft/60 p-3"
|
||||
>
|
||||
<div className="flex justify-end">
|
||||
<span className="rounded-full bg-background px-2 py-1 text-[10px] font-semibold text-muted-foreground">
|
||||
<span
|
||||
data-testid="design-quote-points"
|
||||
className="rounded-full bg-background px-2 py-1 text-[10px] font-semibold text-muted-foreground"
|
||||
>
|
||||
报价 {quote.quotedDesignPoints} 设计点
|
||||
</span>
|
||||
</div>
|
||||
@@ -651,25 +658,6 @@ function QuoteCard({
|
||||
/>
|
||||
</div>
|
||||
<div className="grid gap-2 sm:grid-cols-[repeat(auto-fit,minmax(12rem,1fr))]">
|
||||
{availableModels.length > 0 ? (
|
||||
<label className="text-[11px] font-semibold text-foreground">
|
||||
生图/生视频模型
|
||||
<Select
|
||||
aria-label="生图/生视频模型"
|
||||
data-testid="design-quote-model"
|
||||
className="mt-1.5 h-9 bg-background text-xs"
|
||||
value={draft.generationParameters.model}
|
||||
disabled={busy}
|
||||
onChange={(event) => updateParameters({ model: event.target.value })}
|
||||
>
|
||||
{availableModels.map((option) => (
|
||||
<option key={option.value} value={option.value} disabled={option.disabled}>
|
||||
{option.label}
|
||||
</option>
|
||||
))}
|
||||
</Select>
|
||||
</label>
|
||||
) : null}
|
||||
{availableResolutions.length > 0 ? (
|
||||
<label className="text-[11px] font-semibold text-foreground">
|
||||
清晰度
|
||||
|
||||
Reference in New Issue
Block a user