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 (
@ -589,7 +611,7 @@ export default function ProjEdit() {
projIntroduction={aiHelper.projIntroduction} projIntroduction={aiHelper.projIntroduction}
projDesc={aiHelper.projDesc} projDesc={aiHelper.projDesc}
isFree={false} isFree={false}
renderData={()=>{ renderData={() => {
renderData() renderData()
}} }}
/> />
@ -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,9 +699,10 @@ export default function ProjEdit() {
}} }}
footer={null} footer={null}
> >
<SoftwareFeatures closeModal={() => { setSoftwareFeaturesOpen(false) <SoftwareFeatures closeModal={() => {
setSoftwareFeaturesOpen(false)
renderData() renderData()
}}></SoftwareFeatures> }}></SoftwareFeatures>
</Modal> </Modal>
{/* 第三步 查看 */} {/* 第三步 查看 */}
<Modal open={softwareFeaturesShowOpen} <Modal open={softwareFeaturesShowOpen}
@ -707,9 +732,10 @@ export default function ProjEdit() {
}} }}
footer={null} footer={null}
> >
<LoginPage closeModal={() => { setLoginPageOpne(false) <LoginPage closeModal={() => {
setLoginPageOpne(false)
renderData() renderData()
}}></LoginPage> }}></LoginPage>
</Modal> </Modal>
{/* 第四步 查看 */} {/* 第四步 查看 */}
<Modal open={loginPageShowOpne} <Modal open={loginPageShowOpne}

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 (
@ -314,7 +333,7 @@ export default function ProjEdit() {
{ title: '编辑项目' }, { title: '编辑项目' },
]} ]}
/> */} /> */}
<div className="proj-edit" style={{ }}> <div className="proj-edit" style={{}}>
<StepProjEdit step={1} process={isEditStepEdited ? Process.COMPLETE : Process.PROCESSING} <StepProjEdit step={1} process={isEditStepEdited ? Process.COMPLETE : Process.PROCESSING}
descTitle="完善信息" descTitle="完善信息"
descDetail="完善项目的基本信息" descDetail="完善项目的基本信息"
@ -551,7 +570,7 @@ export default function ProjEdit() {
projIntroduction={aiHelper.projIntroduction} projIntroduction={aiHelper.projIntroduction}
projDesc={aiHelper.projDesc} projDesc={aiHelper.projDesc}
isFree={false} isFree={false}
renderData={()=>{ renderData={() => {
renderData() renderData()
}} }}
/> />