merge: 同步 origin/ui-optimization(d224d5b6),保留 weiyuan 功能与 Semi 迁移

- 冲突以 weiyuan 功能(小程序登录、i18n 文案)为准,并保留远端 lint 重构与依赖收敛
- 删除 weiyuan 已移除、远端仅做 lint 修正的 3 个图片相关文件
- 适配远端零警告 ESLint:Monitoring/Subscription 改用 useEffectEvent,EditChannelModal 注明 t 依赖
- effect-events 单测补充 react-i18next mock
- 对合并后仍不符合 Prettier 的文件做纯格式化
This commit is contained in:
qiubaishen
2026-11-10 14:59:34 +08:00
211 changed files with 29252 additions and 12724 deletions
@@ -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;