refactor(接口测试): 删除无用代码
This commit is contained in:
parent
bd43116ff4
commit
764567d5f8
|
@ -10,10 +10,4 @@ CREATE TABLE IF NOT EXISTS `jar_config` (
|
|||
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
|
||||
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
||||
|
||||
-- CREATE TABLE IF NOT EXISTS `jar_config_resource` ( todo1
|
||||
-- `resource_id` varchar(64) NOT NULL,
|
||||
-- `jar_config_id` varchar(64) NOT NULL,
|
||||
-- UNIQUE KEY `jar_config_resource_unique_key` (`resource_id`, `jar_config_id`)
|
||||
-- ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT ='Jar config relevance table';
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
|
|
@ -32,11 +32,6 @@ export default {
|
|||
component: () => import('@/business/components/settings/system/SystemParameterSetting'),
|
||||
meta: {system: true, title: 'commons.system_parameter_setting'}
|
||||
},
|
||||
// todo1 {
|
||||
// path: 'systemjarsetting',
|
||||
// component: () => import('@/business/components/settings/system/JarConfigSetting'),
|
||||
// meta: {system: true, title: 'api_test.jar_config.title'}
|
||||
// },
|
||||
...requireContext.keys().map(key => requireContext(key).system),...requireContext.keys().map(key => requireContext(key).license),
|
||||
{
|
||||
path: 'organizationmember',
|
||||
|
|
|
@ -1,119 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="table-card" v-loading="result.loading">
|
||||
<template v-slot:header>
|
||||
<ms-table-header :condition.sync="condition" @search="list" @create="create" :title="$t('api_test.jar_config.title')"/>
|
||||
</template>
|
||||
|
||||
<el-table border :data="items"
|
||||
class="adjust-table table-content"
|
||||
highlight-current-row>
|
||||
|
||||
<el-table-column prop="name" :label="$t('commons.name')" show-overflow-tooltip/>
|
||||
<el-table-column prop="fileName" :label="$t('api_test.jar_config.jar_file')" show-overflow-tooltip/>
|
||||
<el-table-column prop="description" :label="$t('commons.description')" show-overflow-tooltip/>
|
||||
<el-table-column prop="updateTime" :label="$t('commons.update_time')" show-overflow-tooltip/>
|
||||
<el-table-column prop="owner" :label="$t('report.user_name')" show-overflow-tooltip/>
|
||||
|
||||
<el-table-column :label="$t('commons.operating')" min-width="100">
|
||||
|
||||
<template v-slot:default="scope">
|
||||
<ms-table-operator :is-tester-permission="true" @editClick="edit(scope.row)"
|
||||
@deleteClick="handleDelete(scope.row.id)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
|
||||
<ms-table-pagination :change="list" :current-page.sync="currentPage" :page-size.sync="pageSize"
|
||||
:total="total"/>
|
||||
|
||||
<ms-jar-config-edit @refresh="list" ref="jarConfigFrom"/>
|
||||
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MsCreateBox from "../CreateBox";
|
||||
import MsTablePagination from "../../common/pagination/TablePagination";
|
||||
import MsTableHeader from "../../common/components/MsTableHeader";
|
||||
import MsTableOperator from "../../common/components/MsTableOperator";
|
||||
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
|
||||
import MsDialogFooter from "../../common/components/MsDialogFooter";
|
||||
import {
|
||||
listenGoBack,removeGoBackListener
|
||||
} from "@/common/js/utils";
|
||||
import {DEFAULT, WORKSPACE} from "@/common/js/constants";
|
||||
import MsJarConfigEdit from "./edit/JarConfigEdit";
|
||||
|
||||
export default {
|
||||
name: "MsJarConfigSetting",
|
||||
components: {
|
||||
MsJarConfigEdit,
|
||||
MsCreateBox,
|
||||
MsTablePagination,
|
||||
MsTableHeader,
|
||||
MsTableOperator,
|
||||
MsDialogFooter,
|
||||
MsTableOperatorButton
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
result: {},
|
||||
condition: {},
|
||||
items: [],
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
activated() {
|
||||
this.list();
|
||||
},
|
||||
methods: {
|
||||
create() {
|
||||
this.$refs.jarConfigFrom.open();
|
||||
},
|
||||
getJarConfigs() {
|
||||
this.result = this.$get("/jar/list/" + this.projectId, response => {
|
||||
this.configs = response.data;
|
||||
})
|
||||
},
|
||||
edit(row) {
|
||||
this.$refs.jarConfigFrom.open(row);
|
||||
},
|
||||
list() {
|
||||
let url = '/jar/list/' + this.currentPage + '/' + this.pageSize;
|
||||
this.result = this.$post(url, this.condition, response => {
|
||||
let data = response.data;
|
||||
this.items = data.listObject;
|
||||
this.total = data.itemCount;
|
||||
});
|
||||
},
|
||||
handleDelete(id) {
|
||||
this.$confirm(this.$t('删除需重启服务后生效'), '', {
|
||||
confirmButtonText: this.$t('commons.confirm'),
|
||||
cancelButtonText: this.$t('commons.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.result = this.$get("/jar/delete/" + id, () => {
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
this.list();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: this.$t('commons.delete_cancelled')
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
<template>
|
||||
<el-dialog width="50%" :close-on-click-modal="false" :title="$t('api_test.jar_config.title')" :visible.sync="visible" class="jar-import" @close="close">
|
||||
<div v-loading="result.loading">
|
||||
<el-form :model="currentConfig" :rules="rules" label-width="100px" v-loading="result.loading" ref="form">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('commons.name')" prop="name">
|
||||
<el-input size="small" v-model="currentConfig.name" clearable show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.project')" prop="description">
|
||||
<el-input :disabled="readOnly" v-model="currentConfig.description"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 2, maxRows: 4}"
|
||||
:rows="2"
|
||||
:placeholder="$t('commons.input_content')"/>
|
||||
</el-form-item>
|
||||
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1">
|
||||
<el-divider direction="vertical"/>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="11">
|
||||
<el-upload
|
||||
class="jar-upload"
|
||||
drag
|
||||
action="#"
|
||||
:http-request="upload"
|
||||
:limit="1"
|
||||
:beforeUpload="uploadValidate"
|
||||
:on-remove="handleRemove"
|
||||
:on-exceed="handleExceed"
|
||||
:file-list="fileList"
|
||||
ref="fileUpload">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text" v-html="$t('load_test.upload_tips')"></div>
|
||||
<div class="el-upload__tip" slot="tip">{{$t('api_test.api_import.file_size_limit')}}</div>
|
||||
</el-upload>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<template v-slot:footer>
|
||||
<div class="dialog-footer">
|
||||
<ms-dialog-footer @cancel="close" @confirm="save"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listenGoBack, removeGoBackListener} from "../../../../../common/js/utils";
|
||||
import MsDialogFooter from "../../../common/components/MsDialogFooter";
|
||||
// todo
|
||||
export default {
|
||||
name: "MsJarConfigEdit",
|
||||
components: {MsDialogFooter},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
result: {},
|
||||
currentConfig: {
|
||||
name: '',
|
||||
description: '',
|
||||
fileName: '',
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: this.$t('commons.input_name'), trigger: 'blur'},
|
||||
{max: 60, message: this.$t('commons.input_limit', [1, 60]), trigger: 'blur'}
|
||||
],
|
||||
description: [
|
||||
{max: 250, message: this.$t('commons.input_limit', [1, 250]), trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
fileList: []
|
||||
}
|
||||
},
|
||||
props: {
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
open(config) {
|
||||
this.currentConfig = {
|
||||
name: '',
|
||||
description: '',
|
||||
fileName: '',
|
||||
};
|
||||
if (config) {
|
||||
if (config.fileName) {
|
||||
this.fileList = [{name: config.fileName}];
|
||||
} else {
|
||||
this.fileList = [];
|
||||
}
|
||||
Object.assign(this.currentConfig, config);
|
||||
}
|
||||
this.visible = true;
|
||||
listenGoBack(this.close);
|
||||
},
|
||||
upload(file) {
|
||||
this.fileList.push(file.file)
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$warning(this.$t('test_track.case.import.upload_limit_count'));
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.fileList = [];
|
||||
},
|
||||
uploadValidate(file, fileList) {
|
||||
let suffix = file.name.substring(file.name.lastIndexOf('.') + 1);
|
||||
if (suffix != 'jar') {
|
||||
this.$warning(this.$t('api_test.api_import.suffixFormatErr'));
|
||||
return false;
|
||||
}
|
||||
if (file.size / 1024 / 1024 > 30) {
|
||||
this.$warning(this.$t('jar_config.upload_limit_size'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
save() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.fileList <= 0) {
|
||||
this.$warning(this.$t('commons.please_upload'));
|
||||
return false;
|
||||
}
|
||||
this._save();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
_save() {
|
||||
let url = this.currentConfig.id ? "/jar/update" : "/jar/add";
|
||||
this.result = this.$fileUpload(url, this.fileList[0], null, this.currentConfig, () => {
|
||||
this.$success(this.$t('commons.save_success'));
|
||||
this.$emit("refresh");
|
||||
this.close();
|
||||
});
|
||||
},
|
||||
clear() {
|
||||
this.$refs['form'].clearValidate();
|
||||
this.fileList = [];
|
||||
},
|
||||
close() {
|
||||
this.clear();
|
||||
removeGoBackListener(this.close);
|
||||
this.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.el-divider {
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.jar-upload {
|
||||
text-align: center;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.jar-upload >>> .el-upload {
|
||||
width: 100%;
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
.jar-upload >>> .el-upload-dragger {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-form {
|
||||
border: solid #E1E1E1 1px;
|
||||
margin: 10px 0;
|
||||
padding: 30px 10px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
margin-top: 10px;
|
||||
margin-bottom: -10px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue