|
|
@@ -296,14 +296,20 @@ export default {
|
|
|
//获取最新一次部署信息
|
|
|
getLatestDeployInfo() {
|
|
|
this.test.deployInfo = this.projectDetail.deploy.latestTestDeploy;
|
|
|
- this.test.latestDeployId = this.projectDetail.deploy.latestTestDeploy.id;
|
|
|
- this.test.deployStatus = this.projectDetail.deploy.latestTestDeploy.status;
|
|
|
- this.test.isRunning = this.test.deployStatus == "RUNNING" ? true : false;
|
|
|
+ if (this.projectDetail.deploy.latestTestDeploy) {
|
|
|
+ this.test.latestDeployId = this.projectDetail.deploy.latestTestDeploy.id;
|
|
|
+ this.test.deployStatus = this.projectDetail.deploy.latestTestDeploy.status;
|
|
|
+ this.test.isRunning =
|
|
|
+ this.test.deployStatus == "RUNNING" ? true : false;
|
|
|
+ }
|
|
|
|
|
|
this.prod.deployInfo = this.projectDetail.deploy.latestProdDeploy;
|
|
|
- this.prod.latestDeployId = this.projectDetail.deploy.latestProdDeploy.id;
|
|
|
- this.prod.deployStatus = this.projectDetail.deploy.latestProdDeploy.status;
|
|
|
- this.prod.isRunning = this.prod.deployStatus == "RUNNING" ? true : false;
|
|
|
+ if (this.projectDetail.deploy.latestProdDeploy) {
|
|
|
+ this.prod.latestDeployId = this.projectDetail.deploy.latestProdDeploy.id;
|
|
|
+ this.prod.deployStatus = this.projectDetail.deploy.latestProdDeploy.status;
|
|
|
+ this.prod.isRunning =
|
|
|
+ this.prod.deployStatus == "RUNNING" ? true : false;
|
|
|
+ }
|
|
|
},
|
|
|
//处理时间格式
|
|
|
handleTime(time) {
|
|
|
@@ -396,8 +402,12 @@ export default {
|
|
|
getBuildImage(projectId)
|
|
|
.then(res => {
|
|
|
console.log("getBuildImage", res);
|
|
|
- this.test.latestBuildList = [res.data.testBuildRecord];
|
|
|
- this.prod.latestBuildList = [res.data.prodBuildRecord];
|
|
|
+ this.test.latestBuildList = res.data.testBuildRecord
|
|
|
+ ? [res.data.testBuildRecord]
|
|
|
+ : [];
|
|
|
+ this.prod.latestBuildList = res.data.prodBuildRecord
|
|
|
+ ? [res.data.prodBuildRecord]
|
|
|
+ : [];
|
|
|
})
|
|
|
.catch(e => {
|
|
|
this.$toast.open({
|