feat: UI前后置操作
This commit is contained in:
parent
30b5066fcb
commit
a4f5eab58d
|
@ -0,0 +1,34 @@
|
|||
import HashTreeElement from "@/business/components/api/definition/components/jmeter/hashtree";
|
||||
|
||||
export default class MsUiCommand extends HashTreeElement {
|
||||
constructor(options = {}) {
|
||||
super(options);
|
||||
this.type = "MsUiCommand";
|
||||
this.clazzName = "io.metersphere.xpack.ui.hashtree.MsUiCommand";
|
||||
|
||||
this.enable = true;
|
||||
this.resourceId = null;
|
||||
this.index = null;
|
||||
|
||||
this.value = null;
|
||||
this.target = null;
|
||||
this.targets = null;
|
||||
this.valueVO = {};
|
||||
this.targetVO = {};
|
||||
|
||||
this.command = null;
|
||||
this.comment = null;
|
||||
this.description = null;
|
||||
|
||||
this.commandConfig = null;
|
||||
this.hashTree = [];
|
||||
this.coreCommands = [];
|
||||
this.preCommands = [];
|
||||
this.postCommands = [];
|
||||
}
|
||||
}
|
||||
|
||||
export const schema = {
|
||||
MsUiCommand: MsUiCommand
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<template>
|
||||
<div>
|
||||
<p>
|
||||
<el-select v-model="operateModel" size="mini" class="ms-select-step">
|
||||
<el-option
|
||||
v-for="item in operates"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="add">
|
||||
{{ $t('api_test.request.assertions.add') }}
|
||||
</el-button>
|
||||
</p>
|
||||
|
||||
<slot></slot>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "addStepContainer",
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
showButton: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
operates: Array,
|
||||
operate: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
operateModel: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.operateModel = this.operate;
|
||||
},
|
||||
watch: {
|
||||
operateModel() {
|
||||
this.$emit('update:operate', this.operateModel);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
add() {
|
||||
this.$emit('add');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ms-select-step {
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue