ai自动打开

This commit is contained in:
xixi 2024-07-16 10:16:24 +08:00
parent 4f5ad40fbf
commit b4725e24d9
2 changed files with 60 additions and 15 deletions

View File

@ -92,7 +92,7 @@ export default function ProjEdit() {
projDesc: '', projDesc: '',
projMods: [], projMods: [],
}); });
// 判断状态
// const height = window.innerHeight - 240; // const height = window.innerHeight - 240;
@ -311,15 +311,37 @@ export default function ProjEdit() {
projDesc: data.projDesc, projDesc: data.projDesc,
projMods: data.projMods projMods: data.projMods
}) })
// setAiHelperModalOpen(!data.projIntroduction || !data.projDesc) // setAiHelperModalOpen(!data.projIntroduction || !data.projDesc)
} }
}) })
} }
const getAiData = () => {
get<any>({
messageApi: messageApi,
url: `/api/proj/get/${pathParams.projId}`,
onSuccess({ data }) {
setAiHelper({
projId: data.projId,
projIntroduction: data.projIntroduction,
projDesc: data.projDesc,
projMods: data.projMods
})
setAiHelperModalOpen(true)
// setAiHelperModalOpen(!data.projIntroduction || !data.projDesc)
}
})
}
useEffect(() => { useEffect(() => {
renderData(); renderData();
// setAiHelperModalOpen(true)
getAiData()
}, []) }, [])
return ( return (
@ -611,7 +633,8 @@ export default function ProjEdit() {
}} }}
footer={null} footer={null}
> >
<TitleIntroduction closeModal={() => { setTitleIntroductionOpen(false) <TitleIntroduction closeModal={() => {
setTitleIntroductionOpen(false)
renderData() renderData()
}}></TitleIntroduction> }}></TitleIntroduction>
</Modal> </Modal>
@ -645,7 +668,8 @@ export default function ProjEdit() {
}} }}
footer={null} footer={null}
> >
<SoftwareInfo closeModal={() => { setSoftwareOpen(false) <SoftwareInfo closeModal={() => {
setSoftwareOpen(false)
renderData() renderData()
}}></SoftwareInfo> }}></SoftwareInfo>
</Modal> </Modal>
@ -675,7 +699,8 @@ export default function ProjEdit() {
}} }}
footer={null} footer={null}
> >
<SoftwareFeatures closeModal={() => { setSoftwareFeaturesOpen(false) <SoftwareFeatures closeModal={() => {
setSoftwareFeaturesOpen(false)
renderData() renderData()
}}></SoftwareFeatures> }}></SoftwareFeatures>
</Modal> </Modal>
@ -707,7 +732,8 @@ export default function ProjEdit() {
}} }}
footer={null} footer={null}
> >
<LoginPage closeModal={() => { setLoginPageOpne(false) <LoginPage closeModal={() => {
setLoginPageOpne(false)
renderData() renderData()
}}></LoginPage> }}></LoginPage>
</Modal> </Modal>

View File

@ -299,9 +299,28 @@ export default function ProjEdit() {
} }
}) })
} }
const getAiData = () => {
get<any>({
messageApi: messageApi,
url: `/api/proj/get/${pathParams.projId}`,
onSuccess({ data }) {
setAiHelper({
projId: data.projId,
projIntroduction: data.projIntroduction,
projDesc: data.projDesc,
projMods: data.projMods
})
setAiHelperModalOpen(true)
// setAiHelperModalOpen(!data.projIntroduction || !data.projDesc)
}
})
}
useEffect(() => { useEffect(() => {
renderData(); renderData();
getAiData()
}, []) }, [])
return ( return (