优化新建模型等待

This commit is contained in:
zhal 2022-07-26 16:41:34 +08:00
parent a49aef600d
commit 55b9e7d72c

View File

@ -269,7 +269,7 @@
</awsui-form> </awsui-form>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<awsui-button class="button-general-color" type="primary" @click="createSystemSave('systemForm')" :disabled="isDisabled">确定</awsui-button> <awsui-button class="button-general-color" type="primary" @click="createSystemSave('systemForm')" :loading="isLoading">确定</awsui-button>
<awsui-button @click="clearSystemDlg">取消</awsui-button> <awsui-button @click="clearSystemDlg">取消</awsui-button>
</span> </span>
</el-dialog> </el-dialog>
@ -321,7 +321,7 @@
} }
}; };
return { return {
isDisabled:false, isLoading:false,
multiple: true, multiple: true,
// //
currentUserCheck: true, currentUserCheck: true,
@ -1081,10 +1081,9 @@
}); });
}, },
// //
createSystemSave(formName) {// createSystemSave(formName) {//
const that = this; const that = this;
that.$refs[formName].validate((valid) => { that.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
const checkdata = { const checkdata = {
@ -1097,9 +1096,8 @@
}; };
// //
awsuiAxios.post(checkdata).then(function (ro) { awsuiAxios.post(checkdata).then(function (ro) {
if (ro.data.result == 'ok') { if (ro.data.result == 'ok') {
that.isDisabled = true; that.isLoading = true;
const nodeData = that.$refs.tree.getCurrentNode(); const nodeData = that.$refs.tree.getCurrentNode();
const parentId = nodeData.id; const parentId = nodeData.id;
const wsId = that.$store.getters.getWsIdFn; const wsId = that.$store.getters.getWsIdFn;
@ -1122,34 +1120,44 @@
if (ro.result == 'ok') { if (ro.result == 'ok') {
that.ModelsetUpDialog.systemForm.uuid=ro.data.id; that.ModelsetUpDialog.systemForm.uuid=ro.data.id;
that.ModelsetUpDialog.systemForm.parentId=parentId; that.ModelsetUpDialog.systemForm.parentId=parentId;
const data = { if(that.ModelsetUpDialog.systemForm.method == "control.policy"){
url:'jd', const data = {
data:{ url:'jd',
cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_CreateSystemModelBySelectType', data:{
title: that.ModelsetUpDialog.systemForm.name, cmd: 'com.actionsoft.apps.coe.pal_pl_repository_designer_CreateSystemModelBySelectType',
type: that.ModelsetUpDialog.systemForm.systemType, title: that.ModelsetUpDialog.systemForm.name,
method:that.ModelsetUpDialog.systemForm.method, type: that.ModelsetUpDialog.systemForm.systemType,
uuid:that.ModelsetUpDialog.systemForm.uuid, method:that.ModelsetUpDialog.systemForm.method,
parentId:that.ModelsetUpDialog.systemForm.parentId uuid:that.ModelsetUpDialog.systemForm.uuid,
} parentId:that.ModelsetUpDialog.systemForm.parentId
}; }
// };
awsuiAxios.post(data).then(function (ro) { //
if (ro.result == 'ok') { awsuiAxios.post(data).then(function (ro) {
that.isDisabled = false; if (ro.result == 'ok') {
that.ModelsetUpDialog.dialogVisible = false; that.isLoading = false;
that.openRepositoryList(that.ModelsetUpDialog.systemForm.parentId); that.ModelsetUpDialog.dialogVisible = false;
// id that.openRepositoryList(that.ModelsetUpDialog.systemForm.parentId);
openDesigner(that.$store.getters.getTeamIdFn, that.ModelsetUpDialog.systemForm.uuid, that.$store.state.sessionId); // id
openDesigner(that.$store.getters.getTeamIdFn, that.ModelsetUpDialog.systemForm.uuid, that.$store.state.sessionId);
//
that.$refs['systemForm'].resetFields();
} else {
that.$message.error(ro.msg);
}
}).catch(error=>{
console.log(error);
})
}else{
that.isLoading = false;
that.ModelsetUpDialog.dialogVisible = false;
that.openRepositoryList(that.ModelsetUpDialog.systemForm.parentId);
// id
openDesigner(that.$store.getters.getTeamIdFn, that.ModelsetUpDialog.systemForm.uuid, that.$store.state.sessionId);
//
that.$refs['systemForm'].resetFields();
}
//
that.$refs['systemForm'].resetFields();
} else {
that.$message.error(ro.msg);
}
}).catch(error=>{
console.log(error);
})
} }
}).catch(error => { }).catch(error => {