This commit is contained in:
lyp 2025-01-20 18:53:41 +08:00
parent 593995455d
commit 00a2c4597a
2 changed files with 33 additions and 38 deletions

View File

@ -188,6 +188,7 @@ export default function AiHelper(props: PropsType) {
}
ws.current.onmessage = (event) => {
// console.log('message', event);
// console.log(event.data);
if (event.data == 'PONE') {
return;
@ -244,6 +245,7 @@ export default function AiHelper(props: PropsType) {
projMods.forEach(projMod => projMod.id = uuid())
setNewProjModArray(projMods);
} else if (data.type == 'REFRESH_PROJ_MOD_FIELDS') {
// setIsProjModArrayLoading(true);
listMods();
}
}
@ -709,6 +711,11 @@ export default function AiHelper(props: PropsType) {
<div className='masksmall' style={{ display: activeTab == '模块' ? 'block' : 'none' }}>
<Spin tip="正在处理,请稍后..." size="small" spinning={isProjModArrayLoading}>
<AiHelperMod mods={projModArray}
setIsProjModArrayLoading={
() => {
setIsProjModArrayLoading(true);
}
}
setisFast={() => {
setIsFast(true)
}}
@ -986,7 +993,7 @@ export default function AiHelper(props: PropsType) {
<Pagination
showSizeChanger={false}
defaultCurrent={1} total={pageTotal} defaultPageSize={20} onChange={(page) => {
console.log(page);
// console.log(page);
// setPage(page)
setpageImgArray([])
getPageImgData(page)

View File

@ -39,7 +39,8 @@ type PropsType = {
xixi: any;
projIntroduction: string;
isFast: boolean;
setisFast:any
setisFast:any;
setIsProjModArrayLoading:any;
}
type ProjModType = {
@ -72,37 +73,24 @@ export default function AiHelperMod(props: PropsType) {
// }, [modArray, newModArray]);
// const key = `open${Date.now()}`;
useEffect(() => {
// console.log('mods', props.mods);
setModArray(props.mods);
setNewModArray(props.newMods);
// if (props.newMods.length > 0 ) {
// notification.open({
// message: '提示',
// description:
// `功能列表已生成完毕,是否前去查看?`,
// btn: (
// <div>
// <Button size="small" type="primary" onClick={() => {
// notification.destroy(key)
// props.setActiveTab('模块')
// }}>
// 确定
// </Button>
// </div>
get<any>({
messageApi,
url: `/api/proj/get/${pathParams.projId}`,
onSuccess({ data }) {
// console.log('其他页面状态判断', data);
// setStatus(data.generate.generateStatus)
if(data.aiSetting.modsStatus=='GENERATING'){
// console.log('嘻嘻');
props.setIsProjModArrayLoading()
// ),
// key,
// onClose: close,
// // duration: null,
// placement: 'bottomRight', // 设置通知框显示在右下角
// style: {
// width: 300, // 设置通知框的宽度
// height: 150, // 设置通知框的高度
// },
}
}
})
// });
// }
}, [props.mods, props.newMods]);
// useEffect(() => {
// // console.log('mods', props.mods);