import './proj-edit-step.css';
import { message } from "antd";
import { useParams } from "react-router-dom";
import { useEffect, useState } from "react";
import { get } from "../../../util/AjaxUtils.ts";
// import {Button, Form, Input} from 'antd';
import { AxiosResponse } from "axios";
// import { useNavigate } from 'react-router-dom';



export default function ProjEditStep3() {
    // const navigate = useNavigate()
    const pathParams = useParams();
    const [messageApi, contextHolder] = message.useMessage();


    const [envHardDev, setenvHardDev] = useState('')
    const [envHardProd, setenvHardProd] = useState('')
    const [envIndustry, setenvIndustry] = useState('')
    // const [envLang, setenvLang] = useState('')
    const [envSoftDev, setenvSoftDev] = useState('')
    const [envSoftProd, setenvSoftProd] = useState('')
    const [envSystemDev, setenvSystemDev] = useState('')
    const [envSystemProd, seenvSystemProd] = useState('')
    const [envTechnical, setenvTechnical] = useState('')
    const height = window.innerHeight - 210;
    // const [defaultData, setDefaultData] = useState<any[]>([])
    // 

    const getData = () => {

        get({
            messageApi,
            url: `/api/proj/get/edit-step3/${pathParams.projId}`,
            onSuccess({ data }: AxiosResponse) {
                // resolve(data);
                console.log('获取页面信息', data);
                setenvHardDev(data.envHardDev)
                setenvHardProd(data.envHardProd)
                setenvIndustry(data.envIndustry)
                setenvSoftDev(data.envSoftDev)
                setenvSoftProd(data.envSoftProd)
                setenvSystemDev(data.envSystemDev)
                seenvSystemProd(data.envSystemProd)
                setenvTechnical(data.envTechnical)
            }
        })

    }
   
    useEffect(() => {
        // render();
        getData()
    }, [])

    return (
        <div style={{ height: `${height}px`, overflow: 'auto', marginTop: '18px' }}>
            {contextHolder}

            <div className="form-container" style={{height: `${height}px`}}>
                <div className='Step-title'>
                    <div className='Step-titlel'></div>
                    <div className='Step-titler'>软件功能特点</div>
                </div>
                <div className='step-software'>
                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            开发的硬件环境
                        </div>
                        <div className='step-software-text'>
                            {envHardDev}
                        </div>
                      
                    </div>

                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            运行的硬件环境
                        </div>
                        <div className='step-software-text'>
                            {envHardProd}
                        </div>
                       
                    </div>

                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            开发软件的操作系统
                        </div>
                        <div className='step-software-text'>
                            {envSystemDev}
                        </div>
                      
                    </div>

                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            该软件的运行平台/操作系统
                        </div>
                        <div className='step-software-text'>
                            {envSystemProd}
                        </div>
                       
                    </div>

                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            软件开发环境/开发工具
                        </div>
                        <div className='step-software-text'>
                            {envSoftDev}
                        </div>
                      
                    </div>
                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            软件运行支撑环境/支持软件
                        </div>
                        <div className='step-software-text'>
                            {envSoftProd}
                        </div>
                      
                    </div>

                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            编程语言
                        </div>
                        <div className='step-software-text'>
                            Java
                        </div>

                    </div>

                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            面向领域/行业
                        </div>
                        <div className='step-software-text'>
                            {envIndustry}
                        </div>
                      
                    </div>

                    <div className='step-software-context'>
                        <div className='step-software-title'>
                            技术特点
                        </div>
                        <div className='step-software-text'>
                            {envTechnical}
                        </div>
                      
                    </div>

                </div>
                <div className='software-btn'>
                {/* <Button className='software-back'
                        type="default"
                        size='large'
                    onClick={()=>{navigate(-1)}}>
                        返回
                    </Button> */}
                  
                </div>

            </div>

         
        </div>
    )

}