diff --git a/src/components/ai/AiHelper.tsx b/src/components/ai/AiHelper.tsx index d10e0ca..a886482 100644 --- a/src/components/ai/AiHelper.tsx +++ b/src/components/ai/AiHelper.tsx @@ -188,7 +188,7 @@ export default function AiHelper(props: PropsType) { } ws.current.onmessage = (event) => { // console.log('message', event); - + if (event.data == 'PONE') { return; } @@ -408,23 +408,22 @@ export default function AiHelper(props: PropsType) { setIsProjDescLoading(true) setIsProjModArrayLoading(true) } - if (data.aiSetting.introductionStatus == 'SUCCESS') { - setIsFast(true) - } if (data.aiSetting.descStatus == 'GENERATING') { + setIsFast(true) setIsProjDescLoading(true) } - if (data.aiSetting.modsStatus == 'GENERATING' ) { + if (data.aiSetting.modsStatus == 'GENERATING') { + setIsFast(true) setIsProjModArrayLoading(true) // alert('模块正在生成中') } - if(data.aiSetting.descStatus == 'NONE'&& data.aiSetting.settingStatus == 'GENERATING'){ - setIsProjDescLoading(true) - } - if(data.aiSetting.modsStatus == 'NONE'&& data.aiSetting.settingStatus == 'GENERATING'){ - setIsProjModArrayLoading(true) - } + // if(data.aiSetting.descStatus == 'NONE'&& data.aiSetting.settingStatus == 'GENERATING'){ + // setIsProjDescLoading(true) + // } + // if(data.aiSetting.modsStatus == 'NONE'&& data.aiSetting.settingStatus == 'GENERATING'){ + // setIsProjModArrayLoading(true) + // } } }) }, []) @@ -627,6 +626,9 @@ export default function AiHelper(props: PropsType) {
{ + setIsFast(true) + }} isFast={isFast} title="系统简介" text={projIntroduction} @@ -658,6 +660,9 @@ export default function AiHelper(props: PropsType) { { + setIsFast(true) + }} text={projDesc} projIntroduction={projIntroduction} newText={newProjDesc} @@ -683,6 +688,9 @@ export default function AiHelper(props: PropsType) {
{ + setIsFast(true) + }} isFast={isFast} projIntroduction={projIntroduction} xixi={() => { diff --git a/src/components/ai/mod/AiHelperMod.tsx b/src/components/ai/mod/AiHelperMod.tsx index 54dbff2..2183a1c 100644 --- a/src/components/ai/mod/AiHelperMod.tsx +++ b/src/components/ai/mod/AiHelperMod.tsx @@ -39,6 +39,7 @@ type PropsType = { xixi: any; projIntroduction: string; isFast: boolean; + setisFast:any } type ProjModType = { @@ -495,6 +496,7 @@ export default function AiHelperMod(props: PropsType) { 暂无内容,点击 { + props.setisFast() if (props.isFast) { return } else { @@ -551,6 +553,7 @@ export default function AiHelperMod(props: PropsType) { }} disabled={status == 'SUCCESS' || status == 'GENERATING' || props.isFast ? true : false} onClick={() => { + props.setisFast() if(props.projIntroduction){ props.handleGenerate() }else{ diff --git a/src/components/ai/text/AiHelperText.tsx b/src/components/ai/text/AiHelperText.tsx index b3de8fd..1cb7776 100644 --- a/src/components/ai/text/AiHelperText.tsx +++ b/src/components/ai/text/AiHelperText.tsx @@ -31,9 +31,11 @@ type PropsType = { setActiveTab: (key: string) => void; projIntroduction: string; isFast: boolean; + setisFast:any } export default function AiHelperText(props: PropsType) { + // const [isDisabled, setIsDisabled] = useState(false); //是否禁用一键生成按钮 const height = window.innerHeight - 265; const pathParams = useParams(); const [status, setStatus] = useState('') @@ -42,8 +44,11 @@ export default function AiHelperText(props: PropsType) { messageApi, url: `/api/proj/get/${pathParams.projId}`, onSuccess({ data }) { - // console.log('其他页面状态判断', data); + console.log('其他页面状态判断嘻嘻嘻', data); setStatus(data.generate.generateStatus) + // if(data.aiSetting.introductionStatus == 'GENERATING' || data.aiSetting.descStatus == 'GENERATING' || data.aiSetting.descStatus == 'GENERATING') { + // setIsDisabled(true) + // } } }) @@ -241,6 +246,7 @@ export default function AiHelperText(props: PropsType) { 暂无内容,点击 { + props.setisFast() if (props.isFast) { return } else { @@ -414,13 +420,14 @@ export default function AiHelperText(props: PropsType) { }} >替换