feat: 1.统一右侧抽屉关闭按钮布局 2.统一 UI 组件为 Ant Design 移除 radix-ui、floating-ui 组件 3. 修复 ESLint 文件格式错误的问题
This commit is contained in:
@@ -17,16 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useEffectEvent } from '../../../hooks/common/useEffectEvent';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Card,
|
||||
Row,
|
||||
Col,
|
||||
Typography,
|
||||
Tag,
|
||||
Spin,
|
||||
Empty,
|
||||
} from '@/components/ui';
|
||||
import { Card, Row, Col, Typography, Tag, Spin, Empty } from '@/components/ui';
|
||||
import { API, showError } from '../../../helpers';
|
||||
import { MODEL_CATEGORY_NAMES } from '../../../constants';
|
||||
|
||||
@@ -53,9 +46,10 @@ const ModelsCategoryStats = ({ t }) => {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const onMount = useEffectEvent(() => {
|
||||
loadStats();
|
||||
}, []);
|
||||
});
|
||||
useEffect(() => onMount(), [onMount]);
|
||||
|
||||
const getCategoryColor = (category) => {
|
||||
const colorMap = {
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useEffectEvent } from '../../../../hooks/common/useEffectEvent';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Modal, Select, Typography, Spin } from '@/components/ui';
|
||||
import { API, showError } from '../../../../helpers';
|
||||
@@ -66,11 +67,12 @@ const BatchCategoryModal = ({
|
||||
};
|
||||
|
||||
// 当弹窗打开时加载分类
|
||||
useEffect(() => {
|
||||
const onVisibilityChange = useEffectEvent(() => {
|
||||
if (visible) {
|
||||
loadCategories();
|
||||
}
|
||||
}, [visible]);
|
||||
});
|
||||
useEffect(() => onVisibilityChange(), [onVisibilityChange, visible]);
|
||||
|
||||
const handleConfirm = async () => {
|
||||
if (selectedCategories.length === 0) return;
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useEffectEvent } from '../../../../hooks/common/useEffectEvent';
|
||||
import '../../../console/module-alignment.css';
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import JSONEditor from '../../../common/ui/JSONEditor';
|
||||
@@ -228,7 +229,7 @@ const EditModelModal = (props) => {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const onScopeChange = useEffectEvent(() => {
|
||||
if (formApiRef.current) {
|
||||
if (!isEdit) {
|
||||
formApiRef.current.setValues({
|
||||
@@ -237,9 +238,13 @@ const EditModelModal = (props) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [props.editingModel?.id, props.editingModel?.model_name]);
|
||||
});
|
||||
useEffect(
|
||||
() => onScopeChange(),
|
||||
[onScopeChange, props.editingModel?.id, props.editingModel?.model_name],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const onVisibilityChange2 = useEffectEvent(() => {
|
||||
if (props.visiable) {
|
||||
if (isEdit) {
|
||||
loadModel();
|
||||
@@ -252,7 +257,16 @@ const EditModelModal = (props) => {
|
||||
} else {
|
||||
formApiRef.current?.reset();
|
||||
}
|
||||
}, [props.visiable, props.editingModel?.id, props.editingModel?.model_name]);
|
||||
});
|
||||
useEffect(
|
||||
() => onVisibilityChange2(),
|
||||
[
|
||||
onVisibilityChange2,
|
||||
props.visiable,
|
||||
props.editingModel?.id,
|
||||
props.editingModel?.model_name,
|
||||
],
|
||||
);
|
||||
|
||||
const submit = async (values) => {
|
||||
setLoading(true);
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useEffectEvent } from '../../../../hooks/common/useEffectEvent';
|
||||
import React, { useState, useRef, useEffect } from 'react';
|
||||
import { Modal, Form, Col, Row } from '@/components/ui';
|
||||
import { API, showError, showSuccess } from '../../../../helpers';
|
||||
@@ -67,7 +68,7 @@ const EditVendorModal = ({ visible, handleClose, refresh, editingVendor }) => {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const onVisibilityChange = useEffectEvent(() => {
|
||||
if (visible) {
|
||||
if (isEdit) {
|
||||
loadVendor();
|
||||
@@ -77,7 +78,11 @@ const EditVendorModal = ({ visible, handleClose, refresh, editingVendor }) => {
|
||||
} else {
|
||||
formApiRef.current?.reset();
|
||||
}
|
||||
}, [visible, editingVendor?.id]);
|
||||
});
|
||||
useEffect(
|
||||
() => onVisibilityChange(),
|
||||
[onVisibilityChange, visible, editingVendor?.id],
|
||||
);
|
||||
|
||||
const submit = async (values) => {
|
||||
setLoading(true);
|
||||
|
||||
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import { useEffectEvent } from '../../../../hooks/common/useEffectEvent';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
Modal,
|
||||
@@ -59,7 +60,7 @@ const MissingModelsModal = ({ visible, onClose, onConfigureModel, t }) => {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const onVisibilityChange = useEffectEvent(() => {
|
||||
if (visible) {
|
||||
fetchMissing();
|
||||
setSearchKeyword('');
|
||||
@@ -67,7 +68,8 @@ const MissingModelsModal = ({ visible, onClose, onConfigureModel, t }) => {
|
||||
} else {
|
||||
setMissingModels([]);
|
||||
}
|
||||
}, [visible]);
|
||||
});
|
||||
useEffect(() => onVisibilityChange(), [onVisibilityChange, visible]);
|
||||
|
||||
// 过滤和分页逻辑
|
||||
const filteredModels = missingModels.filter((model) =>
|
||||
|
||||
@@ -238,14 +238,7 @@ const UpstreamConflictModal = ({
|
||||
});
|
||||
|
||||
return [...base, ...cols.filter(Boolean)];
|
||||
}, [
|
||||
t,
|
||||
selections,
|
||||
filteredDataSource,
|
||||
getHeaderState,
|
||||
applyHeaderChange,
|
||||
toggleField,
|
||||
]);
|
||||
}, [t, selections, getHeaderState, applyHeaderChange, toggleField]);
|
||||
|
||||
const pagedDataSource = useMemo(() => {
|
||||
const start = (currentPage - 1) * paginationSize;
|
||||
|
||||
Reference in New Issue
Block a user