This commit is contained in:
2026-08-06 13:55:51 +08:00
parent 1e54e3f7f4
commit 4766bab453
13 changed files with 1306 additions and 394 deletions
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import {
Button, Card, Form, InputNumber, message, Modal, Popconfirm, Select, Space, Table, Tag, Typography,
} from 'antd';
import type { ColumnsType } from 'antd/es/table';
import {
PlusOutlined, EditOutlined, DeleteOutlined, DollarOutlined,
} from '@ant-design/icons';
@@ -69,9 +70,9 @@ const AdminApiModelPricings: React.FC = () => {
const filteredEngines = engines.filter(e => e.genType === genType);
const selectedEngine = engines.find(e => e.id === selectedEngineId);
const resolutions = genType === 'video'
const resolutions: string[] = genType === 'video'
? (selectedEngine?.supportedResolutions?.length ? selectedEngine.supportedResolutions : DEFAULT_VIDEO_RESOLUTIONS)
: (selectedEngine?.supportedSizes?.length ? selectedEngine.supportedSizes : DEFAULT_IMAGE_SIZES);
: (selectedEngine?.supportedSizes?.length ? Object.keys(selectedEngine.supportedSizes) : DEFAULT_IMAGE_SIZES);
const openEdit = (pricing: ApiModelPricing | null = null) => {
if (pricing) {
@@ -146,7 +147,7 @@ const AdminApiModelPricings: React.FC = () => {
}
};
const columns = [
const columns: ColumnsType<ApiModelPricing> = [
{
title: '类型',
dataIndex: 'genType',