refactor(测试跟踪): 下拉列表组件中增加输入筛选功能
This commit is contained in:
parent
1d23ce38a9
commit
bb8711025a
|
@ -1,53 +1,56 @@
|
||||||
<template>
|
<template>
|
||||||
<el-menu :unique-opened="true" mode="horizontal" active-text-color="write"
|
<div>
|
||||||
class="project_menu">
|
<span class="menu-title">{{'[' + title + ']'}}</span>
|
||||||
<el-submenu index="1" popper-class="submenu">
|
<el-select filterable slot="prepend" v-model="value" @change="changeData" class="project_menu"
|
||||||
<template v-slot:title>
|
size="small">
|
||||||
<span class="menu-title">{{'[' + title + ']'}}</span>
|
<el-option v-for="(item,index) in data" :key="index" :label="item.name" :value="index"/>
|
||||||
<span> {{currentData == null ? '' : currentData.name}} </span>
|
</el-select>
|
||||||
</template>
|
</div>
|
||||||
<template v-slot:default>
|
|
||||||
<div style="height:400px;">
|
|
||||||
<el-scrollbar style="height:100%">
|
|
||||||
<label v-for="(item,index) in data" :key="index">
|
|
||||||
<el-menu-item @click="changeData(item)">
|
|
||||||
{{item.name}}
|
|
||||||
<i class="el-icon-check" v-if="currentData && item.id === currentData.id"></i>
|
|
||||||
</el-menu-item>
|
|
||||||
</label>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-submenu>
|
|
||||||
</el-menu>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "SelectMenu",
|
name: "SelectMenu",
|
||||||
props: {
|
props: {
|
||||||
data: {
|
data: {
|
||||||
type: Array
|
type: Array
|
||||||
},
|
|
||||||
currentData: {
|
|
||||||
type: Object
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
type: String
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
currentData: {
|
||||||
changeData(data) {
|
type: Object
|
||||||
this.$emit("dataChange", data);
|
},
|
||||||
|
title: {
|
||||||
|
type: String
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
value: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
currentData(data) {
|
||||||
|
if (data != undefined && data != null) {
|
||||||
|
this.value = data.name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeData(index) {
|
||||||
|
this.$emit("dataChange", this.data[index]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.project_menu {
|
||||||
|
width: 214px;
|
||||||
|
}
|
||||||
|
|
||||||
.menu-title {
|
.menu-title {
|
||||||
color: darkgrey;
|
color: darkgrey;
|
||||||
|
margin-left: 10px;
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -180,6 +180,7 @@
|
||||||
:disabled="isReadOnly"
|
:disabled="isReadOnly"
|
||||||
v-model="scope.row.executeResult"
|
v-model="scope.row.executeResult"
|
||||||
@change="stepResultChange()"
|
@change="stepResultChange()"
|
||||||
|
filterable
|
||||||
size="mini">
|
size="mini">
|
||||||
<el-option :label="$t('test_track.plan_view.pass')" value="Pass"
|
<el-option :label="$t('test_track.plan_view.pass')" value="Pass"
|
||||||
style="color: #7ebf50;"></el-option>
|
style="color: #7ebf50;"></el-option>
|
||||||
|
@ -227,6 +228,7 @@
|
||||||
{{ $t('test_track.issue.please_choose_current_owner') }}
|
{{ $t('test_track.issue.please_choose_current_owner') }}
|
||||||
<el-select v-model="testCase.tapdUsers"
|
<el-select v-model="testCase.tapdUsers"
|
||||||
multiple
|
multiple
|
||||||
|
filterable
|
||||||
style="width: 20%"
|
style="width: 20%"
|
||||||
:placeholder="$t('test_track.issue.please_choose_current_owner')"
|
:placeholder="$t('test_track.issue.please_choose_current_owner')"
|
||||||
collapse-tags>
|
collapse-tags>
|
||||||
|
|
Loading…
Reference in New Issue