新增创建时输入版本

This commit is contained in:
lyp 2024-12-23 10:35:32 +08:00
parent 8f9a2743b1
commit 4e31ab1f55
8 changed files with 83 additions and 25 deletions

View File

@ -4,7 +4,7 @@ import { GlobalContext } from "../../context/GlobalContext.ts";
import { del, get, post, put, websocketUrl, Axios } from "../../util/AjaxUtils.ts";
import {
// Col, Divider, Row,
Spin, Image, Pagination
Spin, Image, Pagination,Modal
} from "antd";
import { AxiosResponse } from "axios";
import useMessage from "antd/es/message/useMessage";
@ -51,6 +51,7 @@ export default function AiHelper(props: PropsType) {
}
})
}
// const [selectedImg,setSelectedImg] = useState('')
// 获取页面样式图片等信息
const getPageImgData = (page: number) => {
@ -70,8 +71,10 @@ export default function AiHelper(props: PropsType) {
}
})
}
const height = window.innerHeight - 265;
const height = window.innerHeight - 265;
// 提示是否可以生成模块
const [modal, setModal] = useState(false)
// const pathParams = useParams();
// const [openModal ,setOpenModal] = useState(false) //是提示替换弹框
// const height = window.innerHeight - 280;
@ -228,7 +231,21 @@ export default function AiHelper(props: PropsType) {
}
})
}
const getProjDesc = () => {
get<any>({
messageApi: messageApi,
url: `/api/proj/get/${props.projId}`,
onSuccess({ data }) {
console.log(data.projDesc);
if(data.projDesc) {
generateProjModArray();
}else{
setModal(true)
}
}
})
}
const generateProjIntroduction = () => {
ws.current?.send(JSON.stringify({
@ -531,7 +548,8 @@ export default function AiHelper(props: PropsType) {
<AiHelperMod mods={projModArray}
newMods={newProjModArray}
handleGenerate={() => {
generateProjModArray();
getProjDesc()
// generateProjModArray();
}}
handleSave={(index, mod) => {
if (projModArray.length > MAX_MOD_SIZE) {
@ -746,7 +764,32 @@ export default function AiHelper(props: PropsType) {
</div> */}
<Modal
title={'提示'}
destroyOnClose={true}
open={modal}
okText="确认"
// cancelText="取消"
cancelButtonProps={{ style: { display: 'none' } }} // 隐藏取消按钮
onCancel={() => {
setModal(false);
}}
onOk={() => {
setModal(false);
}}
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: `${height}px`,
}}
>
<div style={{ }}>
</div>
</Modal>
</div>
)
}

View File

@ -48,6 +48,7 @@ export default function AiHelperMod(props: PropsType) {
const [editModal, setEditModal] = useState(false)
const [updata, setUpdata] = useState<any[]>([])
const [status, setStatus] = useState('')
// const [items, setItems] = useState<any[]>([])
const pathParams = useParams();
useEffect(() => {

View File

@ -150,7 +150,7 @@ export default function ProjEdit() {
desc: '完善软件简称、版本号、软件所属者及联系人等信息',
step: 2,
btnName: !isGenerateSuccess ? '设置' : '查看',
status: data.apply.projDevCompleteDate ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT,
status: data.apply.projVersion ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT,
handleEdit() {
// if (generateStatus != GenerateStatus.SUCCESS) {
if (!isGenerateSuccess) {

View File

@ -202,7 +202,7 @@ export default function ProjEditAll() {
step: 2,
// btnName: !isGenerateSuccess ? '设置' : '查看',
btnName: '查看',
status: data.apply.projDevCompleteDate ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT,
status: data.apply.projVersion ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT,
handleEdit() {
// if (generateStatus != GenerateStatus.SUCCESS) {
// if (!isGenerateSuccess) {

View File

@ -227,7 +227,7 @@ export default function ProjEdit() {
desc: '完善软件简称、版本号、软件所属者及联系人等信息',
step: 2,
btnName: !isGenerateSuccess ? '设置' : '查看',
status: data.apply.projDevCompleteDate ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT,
status: data.apply.projVersion ? EditStepEnum.EDITED : EditStepEnum.UN_EDIT,
// canBtnClick: false,
handleEdit() {
if (generateStatus != GenerateStatus.SUCCESS) {

View File

@ -21,7 +21,8 @@ type ProjInfo = {
belongPeople: string;
contacts: string;
projDevCompleteDate: string;
coupon?: string
coupon?: string;
projVersion: string;
};
export default function ProjNew() {
@ -49,6 +50,7 @@ export default function ProjNew() {
belongPeople: '',
contacts: '',
projDevCompleteDate: '',
projVersion: '',
});
const [form] = Form.useForm<ProjInfo>();
// 所属者弹窗
@ -221,17 +223,13 @@ export default function ProjNew() {
<Form
name="basic"
form={form}
initialValues={{ projVersion: 'v1.0' }} // 添加 initialValues 属性
layout={'vertical'}
labelCol={{ span: 24 }}
wrapperCol={{ span: 24 }}
style={{ width: '100%' }}
onFinish={(formData) => {
// if(isEndsWithKeywords(formData.projName)){
// setIsCreateModalOpen(true);
// }else{
// setHasKeywords(true);
// }
// console.log('formData', formData);
setIsCreateModalOpen(true);
setProjInfo({
projName: formData.projName,
@ -239,6 +237,7 @@ export default function ProjNew() {
belongPeople: formData.belongPeople,
contacts: formData.contacts,
projDevCompleteDate: formData.projDevCompleteDate,
projVersion: formData.projVersion?formData.projVersion:'v1.0',
})
}}
autoComplete="off"
@ -261,7 +260,7 @@ export default function ProjNew() {
} else {
setShowTip(true)
}
}else{
} else {
setShowTip(false)
}
@ -277,6 +276,19 @@ export default function ProjNew() {
color: 'green',
}}>APP</div>
</div>
<div className='formItemOne' style={{ marginTop: 20 }}>
<div className='formItem-title oneTitle'>*</div>
<Form.Item<ProjInfo>
name="projVersion"
>
<Input
style={{ background: '#eeeeee', width: '800px', height: '50px', fontSize: '16px' }} placeholder="请输入系统版本 (注默认版本为v1.0)" />
</Form.Item>
</div>
<div className='formItemOne' style={{ marginTop: 20, position: 'relative' }}>
<div className='formItem-title '>
*
@ -309,12 +321,12 @@ export default function ProjNew() {
</div>
<div className='formItemOne' style={{ marginTop: 20 }}>
<div className='formItem-title '>
*
</div>
<Form.Item<ProjInfo>
// label="开发完成时间"
name="projDevCompleteDate"
rules={[{ required: true, message: '请输入开发完成时间' }]}
// rules={[{ required: true, message: '请输入开发完成时间' }]}
>
<DatePicker placeholder="请选择开发完成日期"
format={dateFormat}
@ -325,6 +337,7 @@ export default function ProjNew() {
/>
</Form.Item>
</div>
<div style={{ display: couponShow ? 'unset' : 'none' }}>
<div className='formItemOne' style={{ marginTop: 20, position: 'relative' }}>
<div className='formItem-title '>
@ -421,10 +434,12 @@ export default function ProjNew() {
url: '/api/proj/create',
body: {
projName: projInfo.projName,
projVersion: projInfo.projVersion,
projChargeType: pathParams.projChargeType,
listProjChargeAdditional: listProjChargeAdditional,
// dayjs(formInfo.getFieldValue('projDevCompleteDate')).format(dateFormat),
projDevCompleteDate: dayjs(projInfo.projDevCompleteDate).format(dateFormat),
projDevCompleteDate:projInfo.projDevCompleteDate? dayjs(projInfo.projDevCompleteDate).format(dateFormat):'',
authorCrcAccount: belongPeopleInfo.authorCrcAccount,
authorId: belongPeopleInfo.authorId,
authorIdCard: belongPeopleInfo.authorIdCard,
@ -439,7 +454,6 @@ export default function ProjNew() {
applyContactId: concatPeopleInfo.applyConcatId,
applyContactName: concatPeopleInfo.applyContactName,
applyContactPhone: concatPeopleInfo.applyContactPhone,
projVersion: 'v1.0',
couponId: couponId ? couponId : '',
},

View File

@ -626,12 +626,12 @@ export default function ProjEditStep2(props: any) {
</Form.Item>
</div>
<div style={{ display: 'flex' }}>
<div className='projTitle ' style={{ marginLeft: '112px' }}><span className='redicon'>*</span> :</div>
<div className='projTitle ' style={{ marginLeft: '112px' }}> :</div>
<Form.Item<FieldType>
// label="开发完成时间"
name="projDevCompleteDate"
rules={[{ required: true, message: '请输入开发完成时间' }]}
// rules={[{ required: true, message: '请输入开发完成时间' }]}
>
<DatePicker placeholder="请选择开发完成日期"
format={dateFormat}

View File

@ -533,12 +533,12 @@ export default function ProjEditStep2() {
</Form.Item>
</div>
<div style={{ display: 'flex' }}>
<div className='projTitle ' style={{ marginLeft: '112px' }}><span className='redicon'>*</span> :</div>
<div className='projTitle ' style={{ marginLeft: '112px' }}> :</div>
<Form.Item<FieldType>
// label="开发完成时间"
name="projDevCompleteDate"
rules={[{ required: true, message: '请输入开发完成时间' }]}
// rules={[{ required: true, message: '请输入开发完成时间' }]}
>
<DatePicker placeholder="请选择开发完成日期"
format={dateFormat}