refactor: 优化列表删除时的提示
This commit is contained in:
parent
f92c67fe84
commit
6f4d99323f
|
@ -563,6 +563,7 @@ export default {
|
||||||
envGroupId: "",
|
envGroupId: "",
|
||||||
apiscenariofilters: {},
|
apiscenariofilters: {},
|
||||||
runRequest: {},
|
runRequest: {},
|
||||||
|
versionEnable: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -843,6 +844,7 @@ export default {
|
||||||
}
|
}
|
||||||
if (hasLicense()) {
|
if (hasLicense()) {
|
||||||
this.$get('/project/version/enable/' + projectId, response => {
|
this.$get('/project/version/enable/' + projectId, response => {
|
||||||
|
this.versionEnable = response.data;
|
||||||
if (!response.data) {
|
if (!response.data) {
|
||||||
this.fields = this.fields.filter(f => f.id !== 'versionId');
|
this.fields = this.fields.filter(f => f.id !== 'versionId');
|
||||||
}
|
}
|
||||||
|
@ -1147,7 +1149,8 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (hasLicense()) {
|
this.$get('/api/automation/versions/' + row.id, response => {
|
||||||
|
if (hasLicense() && this.versionEnable && response.data.length > 1) {
|
||||||
// 删除提供列表删除和全部版本删除
|
// 删除提供列表删除和全部版本删除
|
||||||
this.$refs.apiDeleteConfirm.open(row, alertMsg);
|
this.$refs.apiDeleteConfirm.open(row, alertMsg);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1162,6 +1165,7 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
_handleDelete(api, deleteCurrentVersion) {
|
_handleDelete(api, deleteCurrentVersion) {
|
||||||
|
|
|
@ -430,6 +430,7 @@ export default {
|
||||||
environmentId: undefined,
|
environmentId: undefined,
|
||||||
selectDataCounts: 0,
|
selectDataCounts: 0,
|
||||||
projectName: "",
|
projectName: "",
|
||||||
|
versionEnable: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -814,7 +815,9 @@ export default {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (hasLicense()) {
|
// 检查api有几个版本
|
||||||
|
this.$get('/api/definition/versions/' + api.id, response => {
|
||||||
|
if (hasLicense() && this.versionEnable && response.data.length > 1) {
|
||||||
// 删除提供列表删除和全部版本删除
|
// 删除提供列表删除和全部版本删除
|
||||||
this.$refs.apiDeleteConfirm.open(api, this.$t('api_test.definition.request.delete_confirm'));
|
this.$refs.apiDeleteConfirm.open(api, this.$t('api_test.definition.request.delete_confirm'));
|
||||||
} else {
|
} else {
|
||||||
|
@ -827,6 +830,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
_handleDelete(api, deleteCurrentVersion) {
|
_handleDelete(api, deleteCurrentVersion) {
|
||||||
// 删除指定版本
|
// 删除指定版本
|
||||||
|
@ -927,6 +931,7 @@ export default {
|
||||||
}
|
}
|
||||||
if (hasLicense()) {
|
if (hasLicense()) {
|
||||||
this.$get('/project/version/enable/' + this.projectId, response => {
|
this.$get('/project/version/enable/' + this.projectId, response => {
|
||||||
|
this.versionEnable = response.data;
|
||||||
if (!response.data) {
|
if (!response.data) {
|
||||||
this.fields = this.fields.filter(f => f.id !== 'versionId');
|
this.fields = this.fields.filter(f => f.id !== 'versionId');
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,8 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleDelete(test) {
|
handleDelete(test) {
|
||||||
if (hasLicense()) {
|
this.$get('/performance/versions/' + test.id, response => {
|
||||||
|
if (hasLicense() && this.versionEnable && response.data.length > 1) {
|
||||||
// 删除提供列表删除和全部版本删除
|
// 删除提供列表删除和全部版本删除
|
||||||
this.$refs.apiDeleteConfirm.open(test, this.$t('load_test.delete_confirm'));
|
this.$refs.apiDeleteConfirm.open(test, this.$t('load_test.delete_confirm'));
|
||||||
} else {
|
} else {
|
||||||
|
@ -269,6 +270,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
_handleDelete(test, deleteCurrentVersion) {
|
_handleDelete(test, deleteCurrentVersion) {
|
||||||
if (deleteCurrentVersion) {
|
if (deleteCurrentVersion) {
|
||||||
|
|
|
@ -897,7 +897,8 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleDeleteToGc(testCase) {
|
handleDeleteToGc(testCase) {
|
||||||
if (hasLicense()) {
|
this.$get('/test/case/versions/' + testCase.id, response => {
|
||||||
|
if (hasLicense() && this.versionEnable && response.data.length > 1) {
|
||||||
// 删除提供列表删除和全部版本删除
|
// 删除提供列表删除和全部版本删除
|
||||||
this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm'));
|
this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm'));
|
||||||
} else {
|
} else {
|
||||||
|
@ -910,6 +911,7 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
batchReduction() {
|
batchReduction() {
|
||||||
let param = buildBatchParam(this, this.$refs.table.selectIds);
|
let param = buildBatchParam(this, this.$refs.table.selectIds);
|
||||||
|
|
Loading…
Reference in New Issue