未找到关联文件时报错

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

View File

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