生成中无法更换页面样式
This commit is contained in:
parent
28426205c4
commit
593995455d
@ -391,6 +391,7 @@ export default function AiHelper(props: PropsType) {
|
|||||||
websocket();
|
websocket();
|
||||||
|
|
||||||
}, [globalContext.user.userId, props.projId]);
|
}, [globalContext.user.userId, props.projId]);
|
||||||
|
// const [aiStatus, setAiStatus] = useState(false)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// getLoginPageInfo()
|
// getLoginPageInfo()
|
||||||
getlistLoginpage(1)
|
getlistLoginpage(1)
|
||||||
@ -400,7 +401,8 @@ export default function AiHelper(props: PropsType) {
|
|||||||
messageApi,
|
messageApi,
|
||||||
url: `/api/proj/get/${props.projId}`,
|
url: `/api/proj/get/${props.projId}`,
|
||||||
onSuccess({ data }) {
|
onSuccess({ data }) {
|
||||||
// console.log('其他页面状态判断', data);
|
// setAiStatus(data.aiSetting.settingStatus)
|
||||||
|
|
||||||
setStatus(data.generate.generateStatus)
|
setStatus(data.generate.generateStatus)
|
||||||
if (data.aiSetting.introductionStatus == 'GENERATING') {
|
if (data.aiSetting.introductionStatus == 'GENERATING') {
|
||||||
setIsFast(true)
|
setIsFast(true)
|
||||||
@ -578,6 +580,16 @@ export default function AiHelper(props: PropsType) {
|
|||||||
</div>
|
</div>
|
||||||
<div className={activeTab == '登录' ? 'tabActive' : "aiTabBtn"}
|
<div className={activeTab == '登录' ? 'tabActive' : "aiTabBtn"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
// if(isFast){
|
||||||
|
// // alert('无法点击')
|
||||||
|
// messageApi.open({
|
||||||
|
// type: 'error',
|
||||||
|
// content: 'AI正在生成,无法更换登陆页面',
|
||||||
|
// });
|
||||||
|
// }else{
|
||||||
|
// setActiveTab('登录')
|
||||||
|
// getLoginPageInfo()
|
||||||
|
// }
|
||||||
setActiveTab('登录')
|
setActiveTab('登录')
|
||||||
getLoginPageInfo()
|
getLoginPageInfo()
|
||||||
}}
|
}}
|
||||||
@ -586,6 +598,15 @@ export default function AiHelper(props: PropsType) {
|
|||||||
</div>
|
</div>
|
||||||
<div className={activeTab == '页面' ? 'tabActive' : "aiTabBtn"}
|
<div className={activeTab == '页面' ? 'tabActive' : "aiTabBtn"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
// if(isFast){
|
||||||
|
// messageApi.open({
|
||||||
|
// type: 'error',
|
||||||
|
// content: 'AI正在生成,无法更换页面样式',
|
||||||
|
// })
|
||||||
|
// }else{
|
||||||
|
// setActiveTab('页面')
|
||||||
|
// getData()
|
||||||
|
// }
|
||||||
setActiveTab('页面')
|
setActiveTab('页面')
|
||||||
getData()
|
getData()
|
||||||
|
|
||||||
@ -822,26 +843,43 @@ export default function AiHelper(props: PropsType) {
|
|||||||
style={{ marginRight: '10px', marginBottom: '10px', width: 210, height: 120, borderRadius: 15 }}
|
style={{ marginRight: '10px', marginBottom: '10px', width: 210, height: 120, borderRadius: 15 }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (status == 'SUCCESS') {
|
if (status == 'SUCCESS') {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
}else if(isFast){
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: 'AI正在生成,无法更换登录页面',
|
||||||
|
});
|
||||||
|
}else {
|
||||||
setloginpageId(item.loginpageId)
|
setloginpageId(item.loginpageId)
|
||||||
put({
|
put({
|
||||||
messageApi,
|
messageApi,
|
||||||
url: `/api/proj/update-loginpage-id/proj-id/${props.projId}/loginpage-id/${item.loginpageId}`,
|
url: `/api/proj/update-loginpage-id/proj-id/${props.projId}/loginpage-id/${item.loginpageId}`,
|
||||||
|
// 请求前
|
||||||
|
onBefore() {
|
||||||
|
// setIsProjModArrayLoading(true);
|
||||||
|
},
|
||||||
|
|
||||||
onSuccess() {
|
onSuccess() {
|
||||||
messageApi.open({
|
messageApi.open({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
content: '已更改'
|
content: '已更改'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getLoginPageInfo()
|
getLoginPageInfo()
|
||||||
// props.closeModal()
|
// props.closeModal()
|
||||||
// props.closeModal()
|
// props.closeModal()
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 请求结束
|
||||||
|
onFinally() {
|
||||||
|
// setIsProjModArrayLoading(false);
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -895,6 +933,11 @@ export default function AiHelper(props: PropsType) {
|
|||||||
if (status == 'SUCCESS') {
|
if (status == 'SUCCESS') {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}else if(isFast){
|
||||||
|
messageApi.open({
|
||||||
|
type: 'error',
|
||||||
|
content: 'AI正在生成,无法更换页面样式',
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
setcodeTypePageId(item.codeTypePageId)
|
setcodeTypePageId(item.codeTypePageId)
|
||||||
put({
|
put({
|
||||||
|
@ -150,6 +150,8 @@ export function put<T>(req: Req<T>) {
|
|||||||
req.onSuccess(res);
|
req.onSuccess(res);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
|
// console.log(error.response.data);
|
||||||
|
|
||||||
const data = error.response.data;
|
const data = error.response.data;
|
||||||
req.messageApi.open({
|
req.messageApi.open({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
Loading…
Reference in New Issue
Block a user