- {/* 左侧:标题和描述骨架 */}
- {rect({
- width: isAllVendors ? 120 : 100,
- height: 24,
- backgroundColor: 'rgba(255, 255, 255, 0.25)',
- borderRadius: 8,
- backdropFilter: 'blur(4px)'
- })}
- {rect({
- width: 80,
- height: 20,
- backgroundColor: 'rgba(255, 255, 255, 0.2)',
- borderRadius: 9999,
- backdropFilter: 'blur(4px)',
- border: '1px solid rgba(255,255,255,0.3)'
- })}
+ {createSkeletonRect({
+ ...SKELETON_STYLES.title,
+ width: isAllVendors ? SIZES.title.width.all : SIZES.title.width.specific,
+ height: SIZES.title.height
+ }, 'title')}
+ {createSkeletonRect({
+ ...SKELETON_STYLES.tag,
+ width: SIZES.tag.width,
+ height: SIZES.tag.height
+ }, 'tag')}
- {rect({
+ {createSkeletonRect({
+ ...SKELETON_STYLES.description,
width: '100%',
- height: 14,
- backgroundColor: 'rgba(255, 255, 255, 0.2)',
- borderRadius: 4,
- backdropFilter: 'blur(4px)'
- })}
- {rect({
- width: '75%',
- height: 14,
+ height: SIZES.description.height
+ }, 'desc1')}
+ {createSkeletonRect({
+ ...SKELETON_STYLES.description,
backgroundColor: 'rgba(255, 255, 255, 0.15)',
- borderRadius: 4,
- backdropFilter: 'blur(4px)'
- })}
+ width: '75%',
+ height: SIZES.description.height
+ }, 'desc2')}
- {/* 右侧:供应商图标骨架 */}
-
- {isAllVendors ? (
-
- {Array.from({ length: 4 }).map((_, index) => (
- rect({
- width: 32,
- height: 32,
- backgroundColor: 'rgba(59, 130, 246, 0.1)',
- borderRadius: 9999,
- border: '1px solid rgba(59, 130, 246, 0.2)'
- }, index)
- ))}
-
- ) : (
- rect({
- width: 40,
- height: 40,
- backgroundColor: 'rgba(16, 185, 129, 0.1)',
- borderRadius: 12,
- border: '1px solid rgba(16, 185, 129, 0.2)'
- })
- )}
+
+ {createSkeletonRect({
+ ...SKELETON_STYLES.avatar(isAllVendors),
+ width: SIZES.avatar.width,
+ height: SIZES.avatar.height
+ }, 'avatar')}
}
>
- {/* 搜索和操作区域骨架 */}
-
- {/* 搜索框骨架 */}
+
- {rect({
+ {createSkeletonRect({
+ ...SKELETON_STYLES.searchInput,
width: '100%',
- height: 32,
- backgroundColor: 'rgba(156, 163, 175, 0.1)',
- borderRadius: 8,
- border: '1px solid rgba(156, 163, 175, 0.2)'
- })}
+ height: SIZES.searchInput.height
+ }, 'search')}
- {/* 操作按钮骨架 */}
- {rect({
- width: 80,
- height: 32,
- backgroundColor: 'rgba(59, 130, 246, 0.1)',
- borderRadius: 8,
- border: '1px solid rgba(59, 130, 246, 0.2)'
- })}
+ {createSkeletonRect({
+ ...SKELETON_STYLES.button,
+ width: SIZES.button.width,
+ height: SIZES.button.height
+ }, 'button')}
);
@@ -138,6 +166,8 @@ const PricingVendorIntroSkeleton = ({
return (
);
-};
+});
+
+PricingVendorIntroSkeleton.displayName = 'PricingVendorIntroSkeleton';
export default PricingVendorIntroSkeleton;
\ No newline at end of file
diff --git a/web/src/components/table/model-pricing/layout/header/PricingVendorIntroWithSkeleton.jsx b/web/src/components/table/model-pricing/layout/header/PricingVendorIntroWithSkeleton.jsx
index 572a9056..15b3392b 100644
--- a/web/src/components/table/model-pricing/layout/header/PricingVendorIntroWithSkeleton.jsx
+++ b/web/src/components/table/model-pricing/layout/header/PricingVendorIntroWithSkeleton.jsx
@@ -17,25 +17,15 @@ along with this program. If not, see
.
For commercial licensing, please contact support@quantumnous.com
*/
-import React from 'react';
+import React, { memo } from 'react';
import PricingVendorIntro from './PricingVendorIntro';
import PricingVendorIntroSkeleton from './PricingVendorIntroSkeleton';
import { useMinimumLoadingTime } from '../../../../../hooks/common/useMinimumLoadingTime';
-const PricingVendorIntroWithSkeleton = ({
+const PricingVendorIntroWithSkeleton = memo(({
loading = false,
filterVendor,
- models,
- allModels,
- t,
- selectedRowKeys,
- copyText,
- handleChange,
- handleCompositionStart,
- handleCompositionEnd,
- isMobile,
- searchValue,
- setShowFilterModal
+ ...restProps
}) => {
const showSkeleton = useMinimumLoadingTime(loading);
@@ -50,19 +40,11 @@ const PricingVendorIntroWithSkeleton = ({
return (
);
-};
+});
+
+PricingVendorIntroWithSkeleton.displayName = 'PricingVendorIntroWithSkeleton';
export default PricingVendorIntroWithSkeleton;
\ No newline at end of file
diff --git a/web/src/components/table/model-pricing/layout/header/SearchActions.jsx b/web/src/components/table/model-pricing/layout/header/SearchActions.jsx
index 390577a1..cfec43e8 100644
--- a/web/src/components/table/model-pricing/layout/header/SearchActions.jsx
+++ b/web/src/components/table/model-pricing/layout/header/SearchActions.jsx
@@ -17,11 +17,11 @@ along with this program. If not, see
.
For commercial licensing, please contact support@quantumnous.com
*/
-import React from 'react';
+import React, { memo, useCallback } from 'react';
import { Input, Button } from '@douyinfe/semi-ui';
import { IconSearch, IconCopy, IconFilter } from '@douyinfe/semi-icons';
-const SearchActions = ({
+const SearchActions = memo(({
selectedRowKeys = [],
copyText,
handleChange,
@@ -32,9 +32,18 @@ const SearchActions = ({
setShowFilterModal,
t
}) => {
+ const handleCopyClick = useCallback(() => {
+ if (copyText && selectedRowKeys.length > 0) {
+ copyText(selectedRowKeys);
+ }
+ }, [copyText, selectedRowKeys]);
+
+ const handleFilterClick = useCallback(() => {
+ setShowFilterModal?.(true);
+ }, [setShowFilterModal]);
+
return (
-
- {/* 搜索框 */}
+
}
@@ -47,33 +56,31 @@ const SearchActions = ({
/>
- {/* 操作按钮 */}
}
- onClick={() => copyText?.(selectedRowKeys)}
+ onClick={handleCopyClick}
disabled={selectedRowKeys.length === 0}
- className="!bg-blue-500 hover:!bg-blue-600 text-white"
+ className="!bg-blue-500 hover:!bg-blue-600 !text-white disabled:!bg-gray-300 disabled:!text-gray-500"
>
{t('复制')}
- {/* 移动端筛选按钮 */}
{isMobile && (
}
- onClick={() => setShowFilterModal?.(true)}
+ onClick={handleFilterClick}
>
{t('筛选')}
)}
);
-};
-
-export default SearchActions;
+});
+SearchActions.displayName = 'SearchActions';
+export default SearchActions;
\ No newline at end of file
diff --git a/web/src/i18n/locales/en.json b/web/src/i18n/locales/en.json
index 234b47fc..ee38bc39 100644
--- a/web/src/i18n/locales/en.json
+++ b/web/src/i18n/locales/en.json
@@ -1814,6 +1814,7 @@
"匹配类型": "Matching type",
"描述": "Description",
"供应商": "Vendor",
+ "供应商介绍": "Vendor introduction",
"端点": "Endpoint",
"已绑定渠道": "Bound channels",
"更新时间": "Update time",