forked from Gitlink/forgeplus-react
bug
This commit is contained in:
parent
c71d8512df
commit
006ceff8fc
|
@ -120,7 +120,7 @@ function Mould(props){
|
|||
}
|
||||
|
||||
function onOk(){
|
||||
Init(page,"all");
|
||||
Init(page,stageType);
|
||||
}
|
||||
return(
|
||||
<div>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue