This commit is contained in:
caishi 2021-02-02 10:05:16 +08:00
parent c71d8512df
commit 006ceff8fc
2 changed files with 13 additions and 7 deletions

View File

@ -120,7 +120,7 @@ function Mould(props){
}
function onOk(){
Init(page,"all");
Init(page,stageType);
}
return(
<div>

View File

@ -19,14 +19,17 @@ function MouldNew({ form , visible , onCancel , onOk }, ref){
useImperativeHandle(ref, () => ({
setEditInfo: (info) => {
if(info){
if(info.stage_type === "build"){
setBuildFlag(true);
}else{
removeCate();
}
setFieldsValue({
...info
})
if(info.stage_type === "build"){
setBuildFlag(true);
setFieldsValue({
category:TYPE[0]
})
}else{
removeCate();
}
setValue(info.content);
setId(info.id);
}else{
@ -65,7 +68,7 @@ function MouldNew({ form , visible , onCancel , onOk }, ref){
setIsSpin(true);
const url = `/ci/templates.json`;
axios.post(url,{
...values,id,content:value
...values,id,content:value,category:buildFlag ? values.category:""
}).then(result=>{
if(result && result.data){
setIsSpin(false);
@ -89,6 +92,9 @@ function MouldNew({ form , visible , onCancel , onOk }, ref){
function changeStage(e){
if(e === "build"){
setBuildFlag(true);
setFieldsValue({
category:TYPE[0]
})
}else{
removeCate();
}