|
|
|
@ -145,7 +145,7 @@ |
|
|
|
</el-form> |
|
|
|
</el-container> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="saveToolInfoFun">{{ buttons.confirmButton }}</el-button> |
|
|
|
<el-button type="primary" @click="saveToolInfoFun" :loading="saveLoading">{{ buttons.confirmButton }}</el-button> |
|
|
|
<el-button type="primary" @click="closeDialog">{{buttons.closeButton}}</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
@ -176,6 +176,7 @@ export default { |
|
|
|
showDefault: false, |
|
|
|
visible: false, |
|
|
|
addFlag: false, |
|
|
|
saveLoading: false, |
|
|
|
pageData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
username: this.$store.state.user.name, |
|
|
|
@ -421,7 +422,8 @@ export default { |
|
|
|
this.$message.error('工具实例描述不能为空!'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
//打开前端loading的显示 |
|
|
|
this.saveLoading = true; |
|
|
|
//判断是否是新增 |
|
|
|
if (this.addFlag){ |
|
|
|
insertToolInstance(this.pageData).then(({data}) =>{ |
|
|
|
@ -431,6 +433,10 @@ export default { |
|
|
|
}else{ |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.$message.error('提交失败,请重试'); |
|
|
|
}).finally(() => { |
|
|
|
this.saveLoading = false; |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
modifyToolInstance(this.pageData).then(({data}) =>{ |
|
|
|
@ -440,6 +446,10 @@ export default { |
|
|
|
}else{ |
|
|
|
this.$message.error(data.msg); |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.$message.error('提交失败,请重试'); |
|
|
|
}).finally(() => { |
|
|
|
this.saveLoading = false; |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|