refactor(性能测试): 项目文件管理页面重构

This commit is contained in:
Captain.B 2021-03-24 13:29:27 +08:00
parent a72fcd71ea
commit 50c71ac1f9
2 changed files with 10 additions and 8 deletions

View File

@ -84,11 +84,13 @@ export default {
fileList: [],
uploadList: [],
fileNumLimit: 10,
condition: {}
condition: {},
projectId: getCurrentProjectID(),
}
},
methods: {
open() {
open(project) {
this.projectId = project.id;
this.loadFileVisible = true;
this.getProjectFiles();
},
@ -97,7 +99,7 @@ export default {
this.selectIds.clear();
},
getProjectFiles() {
this.projectLoadingResult = this.$post('/performance/project/all/' + getCurrentProjectID() + "/" + this.currentPage + "/" + this.pageSize, this.condition, res => {
this.projectLoadingResult = this.$post('/performance/project/all/' + this.projectId + "/" + this.currentPage + "/" + this.pageSize, this.condition, res => {
let data = res.data;
this.total = data.itemCount;
this.existFiles = data.listObject;
@ -118,7 +120,7 @@ export default {
handleUpload(uploadResources) {
let file = uploadResources.file;
let formData = new FormData();
let url = '/project/upload/files/' + getCurrentProjectID()
let url = '/project/upload/files/' + this.projectId
formData.append("file", file);
let options = {
method: 'POST',

View File

@ -7,8 +7,6 @@
<template v-slot:button>
<ms-table-button :is-tester-permission="true" icon="el-icon-box"
:content="$t('api_test.jar_config.title')" @click="openJarConfig"/>
<ms-table-button :is-tester-permission="true" icon="el-icon-files"
:content="$t('load_test.other_resource')" @click="openFiles"/>
</template>
</ms-table-header>
</template>
@ -45,6 +43,8 @@
<template v-slot:behind>
<ms-table-operator-button :is-tester-permission="true" :tip="$t('api_test.environment.environment_config')" icon="el-icon-setting"
type="info" @exec="openEnvironmentConfig(scope.row)"/>
<ms-table-operator-button :is-tester-permission="true" :tip="$t('load_test.other_resource')" icon="el-icon-files"
type="success" @exec="openFiles(scope.row)"/>
</template>
</ms-table-operator>
</template>
@ -228,8 +228,8 @@ export default {
openJarConfig() {
this.$refs.jarConfig.open();
},
openFiles() {
this.$refs.resourceFiles.open();
openFiles(project) {
this.$refs.resourceFiles.open(project);
},
handleDelete(project) {
this.$refs.deleteConfirm.open(project);