feat: 定位到组件异常渲染的问题

This commit is contained in:
2025-11-15 20:23:15 +08:00
parent d427b9323c
commit 2a8c337b72
6 changed files with 251 additions and 160 deletions

View File

@@ -10,21 +10,25 @@ export enum EvaluateScene {
}
export interface EvaluateCallback {
type: EvaluateScene | ''
type: EvaluateScene | "";
// flag是用来区分跳转ntrp测试后的操作和直接修改ntrp水平成功后的操作
// score是用在加入球局前判断是否满足球局要求的返回值限定为必传
// next有两个地方调用ntrp结果页handleGoon、ntrp弹窗NTRPEvaluatePopup直接修改点击保存按钮时
next: ({ flag, score }: { flag?: boolean, score: string }) => void,
onCancel: () => void,
next: ({ flag, score }: { flag?: boolean; score: string }) => void;
onCancel: () => void;
}
export interface EvaluateCallbackType extends EvaluateCallback {
setCallback: (options: { type: EvaluateScene | '', next: () => void, onCancel: () => void }) => void,
clear: () => void,
setCallback: (options: {
type: EvaluateScene | "";
next: ({ flag, score }: { flag?: boolean; score: string }) => void;
onCancel: () => void;
}) => void;
clear: () => void;
}
export const useEvaluateCallback = create<EvaluateCallbackType>()((set) => ({
type: '',
type: "",
next: () => { },
onCancel: () => { },
setCallback: ({ type, next, onCancel }) => {
@@ -32,15 +36,18 @@ export const useEvaluateCallback = create<EvaluateCallbackType>()((set) => ({
type,
next,
onCancel,
})
});
},
clear: () => {
set({ type: "", next: () => { }, onCancel: () => { } });
},
clear: () => { set({ type: '', next: () => { }, onCancel: () => { } }) }
}));
export const useEvaluate = () => useEvaluateCallback(({ type, next, onCancel, setCallback, clear }) => ({
type,
next,
onCancel,
setCallback,
clear,
}))
export const useEvaluate = () =>
useEvaluateCallback(({ type, next, onCancel, setCallback, clear }) => ({
type,
next,
onCancel,
setCallback,
clear,
}));