未找到关联文件时报错

This commit is contained in:
haifeng414 2020-02-19 11:47:35 +08:00
parent fe87891dab
commit 52b9d0d21e
2 changed files with 11 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="testplan-container">
<div class="testplan-container" v-loading="loading">
<div class="main-content">
<el-card>
<div slot="header">
@ -90,6 +90,7 @@
currentPage: 1,
pageSize: 5,
total: 0,
loading: false,
}
},
created: function () {
@ -97,6 +98,7 @@
},
methods: {
initTableData() {
this.loading = true;
let param = {
name: this.condition
};
@ -105,6 +107,7 @@
let data = response.data;
this.total = data.itemCount;
this.tableData = data.listObject;
this.loading = false;
})
},
search() {

View File

@ -53,6 +53,8 @@
</template>
<script>
import {Message} from "element-ui";
export default {
name: "TestPlanBasicConfig",
props: ["testPlan"],
@ -75,6 +77,11 @@
this.$get(this.getFileMetadataPath + "/" + testPlan.id, response => {
let file = response.data;
if (!file) {
Message.error({message: "未找到关联的测试文件!", showClose: true});
return;
}
this.testPlan.file = file;
this.fileList.push({