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
+11 -7
View File
@@ -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 '../common/useEffectEvent';
import { useState, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { Modal } from '@/components/ui';
@@ -190,7 +191,7 @@ export const useLogsData = () => {
};
// Load saved column preferences from localStorage
useEffect(() => {
const onMount = useEffectEvent(() => {
const savedColumns = localStorage.getItem(STORAGE_KEY);
setVisibleColumns(
resolveColumnVisibility(
@@ -201,7 +202,8 @@ export const useLogsData = () => {
: [COLUMN_KEYS.CHANNEL, COLUMN_KEYS.USERNAME, COLUMN_KEYS.RETRY],
),
);
}, []);
});
useEffect(() => onMount(), [onMount]);
// Get default column visibility based on user role
const getDefaultColumnVisibility = () => {
@@ -262,7 +264,7 @@ export const useLogsData = () => {
if (Object.keys(visibleColumns).length > 0) {
localStorage.setItem(STORAGE_KEY, JSON.stringify(visibleColumns));
}
}, [visibleColumns]);
}, [visibleColumns, STORAGE_KEY]);
// 获取表单值的辅助函数,确保所有值都是字符串
const getFormValues = () => {
@@ -659,7 +661,7 @@ export const useLogsData = () => {
};
// Initialize data
useEffect(() => {
const onMount2 = useEffectEvent(() => {
const localPageSize =
parseInt(localStorage.getItem('page-size')) || ITEMS_PER_PAGE;
setPageSize(localPageSize);
@@ -668,14 +670,16 @@ export const useLogsData = () => {
.catch((reason) => {
showError(reason);
});
}, []);
});
useEffect(() => onMount2(), [onMount2]);
// Initialize statistics when formApi is available
useEffect(() => {
const onScopeChange3 = useEffectEvent(() => {
if (formApi) {
handleEyeClick();
}
}, [formApi]);
});
useEffect(() => onScopeChange3(), [onScopeChange3, formApi]);
// 订阅"任务完成"事件:任务转终态时后端会产生消费日志,这里跟随刷新
// 用 ref 保存最新的加载函数,避免依赖数组里塞太多 state 导致频繁重订阅