ai窗口状态判断
This commit is contained in:
parent
5229b5d906
commit
c124031c70
@ -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) {
|
||||
<div className='masksmall' style={{ display: activeTab == '简介' ? 'block' : 'none' }}>
|
||||
<Spin tip="正在处理,请稍后..." size="small" spinning={isProjIntroductionLoading}>
|
||||
<AiHelperText
|
||||
setisFast={() => {
|
||||
setIsFast(true)
|
||||
}}
|
||||
isFast={isFast}
|
||||
title="系统简介"
|
||||
text={projIntroduction}
|
||||
@ -658,6 +660,9 @@ export default function AiHelper(props: PropsType) {
|
||||
<Spin tip="正在处理,请稍后..." size="small" spinning={isProjDescLoading}>
|
||||
<AiHelperText title="系统详情"
|
||||
isFast={isFast}
|
||||
setisFast={() => {
|
||||
setIsFast(true)
|
||||
}}
|
||||
text={projDesc}
|
||||
projIntroduction={projIntroduction}
|
||||
newText={newProjDesc}
|
||||
@ -683,6 +688,9 @@ export default function AiHelper(props: PropsType) {
|
||||
<div className='masksmall' style={{ display: activeTab == '模块' ? 'block' : 'none' }}>
|
||||
<Spin tip="正在处理,请稍后..." size="small" spinning={isProjModArrayLoading}>
|
||||
<AiHelperMod mods={projModArray}
|
||||
setisFast={() => {
|
||||
setIsFast(true)
|
||||
}}
|
||||
isFast={isFast}
|
||||
projIntroduction={projIntroduction}
|
||||
xixi={() => {
|
||||
|
@ -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) {
|
||||
暂无内容,点击
|
||||
<span style={{ color: '#FF9D00', cursor: 'pointer' }}
|
||||
onClick={() => {
|
||||
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{
|
||||
|
@ -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) {
|
||||
暂无内容,点击
|
||||
<span style={{ color: '#FF9D00', cursor: 'pointer' }}
|
||||
onClick={() => {
|
||||
props.setisFast()
|
||||
if (props.isFast) {
|
||||
return
|
||||
} else {
|
||||
@ -414,13 +420,14 @@ export default function AiHelperText(props: PropsType) {
|
||||
}}
|
||||
>替换</Button>
|
||||
<Button
|
||||
disabled={status == 'SUCCESS' || status == 'GENERATING' || props.isFast ? true : false}
|
||||
disabled={status == 'SUCCESS' || status == 'GENERATING' || props.isFast ? true : false }
|
||||
// size="large"
|
||||
type="primary" style={{
|
||||
width: 109,
|
||||
marginLeft: 15,
|
||||
}}
|
||||
onClick={() => {
|
||||
props.setisFast()
|
||||
if (props.title == '系统简介') {
|
||||
props.xixi()
|
||||
}
|
||||
|
@ -46,9 +46,10 @@ import green from '../../static/projBox/green.png'
|
||||
import red from '../../static/projBox/red.png'
|
||||
import blue from '../../static/projBox/blue.png'
|
||||
import black from '../../static/projBox/black.png'
|
||||
import { useNavigate } from "react-router-dom";
|
||||
export default function Correction() {
|
||||
// 标签变量
|
||||
|
||||
const nav = useNavigate();
|
||||
// const [tagDataIds, setTagDataIds] = useState<any[]>([])
|
||||
const height = window.innerHeight - 180;
|
||||
const [messageApi, contextHolder] = message.useMessage();
|
||||
@ -57,7 +58,7 @@ export default function Correction() {
|
||||
// const MenuActive = getMenuActive() == 'Correction-PENDING' ? 'PENDING' : getMenuActive() == 'Correction-APPROVED' ? 'APPROVED' : getMenuActive() == 'Correction-REJECTED' ? 'REJECTED' : getMenuActive() == 'Correction-CANCELED' ? 'CANCELED' : ''
|
||||
// const [type, setType] = useState<string | null>(null)
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
|
||||
|
||||
const [revokeModal, setRevokeModal] = useState(false) //撤销弹窗
|
||||
// const [numtype, setnumtype] = useState<string | null>(null) //类型 一次 二次
|
||||
// const [correctionType, setcorrectionType] = useState<string | null>(null) //补正种类
|
||||
@ -878,7 +879,7 @@ export default function Correction() {
|
||||
|
||||
useEffect(() => {
|
||||
// getData(1)
|
||||
|
||||
|
||||
getData(1)
|
||||
setPage(1)
|
||||
// console.log(tagCor);
|
||||
@ -927,7 +928,7 @@ export default function Correction() {
|
||||
: <>
|
||||
|
||||
{correctionArray.map((item: any, index: any) => {
|
||||
// setBack(item.tagDataIds.includes(part1)?true:false)
|
||||
// setBack(item.tagDataIds.includes(part1)?true:false)
|
||||
const downCode = [
|
||||
{
|
||||
key: 'downword',
|
||||
@ -935,6 +936,13 @@ export default function Correction() {
|
||||
<div
|
||||
style={{ width: 100, display: 'flex', justifyContent: 'center', alignItems: 'center' }}
|
||||
onClick={() => {
|
||||
// alert(item.correctionType);
|
||||
|
||||
// if (item.correctionType == 'ALL') {
|
||||
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/${item.projId}`)
|
||||
// } else {
|
||||
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/${item.projId}`)
|
||||
// }
|
||||
window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/${item.projId}`)
|
||||
}}
|
||||
>
|
||||
@ -949,6 +957,12 @@ export default function Correction() {
|
||||
style={{ width: 100, display: 'flex', justifyContent: 'center', alignItems: 'center' }}
|
||||
|
||||
onClick={() => {
|
||||
// if (item.correctionType == 'ALL') {
|
||||
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/pdf/${item.projId}`)
|
||||
// } else {
|
||||
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/pdf/${item.projId}`)
|
||||
|
||||
// }
|
||||
window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/correction/pdf/${item.projId}`)
|
||||
}}
|
||||
>
|
||||
@ -966,7 +980,15 @@ export default function Correction() {
|
||||
style={{ width: 100, display: 'flex', justifyContent: 'center', alignItems: 'center' }}
|
||||
|
||||
onClick={() => {
|
||||
// if (item.correctionType == 'ALL') {
|
||||
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/${item.projId}`)
|
||||
// } else {
|
||||
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${item.projId}`)
|
||||
|
||||
// }
|
||||
window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/${item.projId}`)
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
Word
|
||||
@ -980,6 +1002,12 @@ export default function Correction() {
|
||||
style={{ width: 100, display: 'flex', justifyContent: 'center', alignItems: 'center' }}
|
||||
|
||||
onClick={() => {
|
||||
// if (item.correctionType == 'ALL') {
|
||||
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/pdf/${item.projId}`)
|
||||
// } else {
|
||||
// window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/pdf/${item.projId}`)
|
||||
|
||||
// }
|
||||
window.open(`${Axios.defaults?.baseURL}/route/proj/download/manual/correction/pdf/${item.projId}`)
|
||||
}}
|
||||
>
|
||||
@ -1013,7 +1041,11 @@ export default function Correction() {
|
||||
</div>
|
||||
|
||||
<div className='projBoxTop'>
|
||||
<div className='projName' title={item.projName}>
|
||||
<div className='projName' onClick={() => {
|
||||
nav(`/proj-edit/${item.projId}`);
|
||||
sessionStorage.setItem('projName', item.projName);
|
||||
sessionStorage.setItem('projStatus', item.generate.generateStatus == 'SUCCESS' ? '查看' : '编辑');
|
||||
}} title={item.projName}>
|
||||
{item.projName}
|
||||
</div>
|
||||
<div className='correctionType'>
|
||||
@ -1029,7 +1061,7 @@ export default function Correction() {
|
||||
}}>
|
||||
{
|
||||
tagCorArray.map((tagitem: any) => {
|
||||
|
||||
|
||||
const [part1, part2] = tagitem.value.split(':');
|
||||
// setTagDataIds(tagitem.tagDataIds)
|
||||
if (part2 !== 'TAG_NOT') {
|
||||
@ -1040,13 +1072,13 @@ export default function Correction() {
|
||||
color: item.tagDataIds.includes(part1) ? '#ffffff' : '#5a5a5a',
|
||||
border: item.tagDataIds.includes(part1) ? ' 1px solid #ff7b00' : ' 1px solid #5a5a5a',
|
||||
// background: back?'#ff7b00':'',
|
||||
|
||||
|
||||
}}
|
||||
onClick={
|
||||
(e:any) => {
|
||||
(e: any) => {
|
||||
// 获取点击的这个盒子的背景色
|
||||
|
||||
|
||||
|
||||
|
||||
post<any>({
|
||||
messageApi,
|
||||
url: `/api/proj/correction/apply/tag/save-or-delete`,
|
||||
@ -1062,18 +1094,18 @@ export default function Correction() {
|
||||
|
||||
|
||||
if (data.data.data === 'SAVE') {
|
||||
|
||||
|
||||
e.target.style.background = '#ff7b00';
|
||||
e.target.style.color = '#ffffff';
|
||||
e.target.style.border = '1px solid #ff7b00';
|
||||
|
||||
|
||||
|
||||
} else if (data.data.data === 'DELETE') {
|
||||
|
||||
|
||||
e.target.style.background = '';
|
||||
e.target.style.color = '#5a5a5a';
|
||||
e.target.style.border = '1px solid #5a5a5a';
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user