Merge pull request #30 from jumpserver/orange_dev

[hotfix]修改搜索组件
This commit is contained in:
Orange 2020-04-23 17:19:00 +08:00 committed by GitHub
commit 336242dd07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
</div>
<div class="table-action-right-side">
<!-- <el-input v-if="hasSearch" v-model="keyword" suffix-icon="el-icon-search" :placeholder="$tc('Search')" class="right-side-item action-search" size="small" clearable @change="handleSearch" @input="handleSearch" />-->
<TagSearch v-if="hasSearch" class="right-side-item action-search" :filter-fields="tagSearch" @tagSearch="handleTagSearch" />
<TagSearch v-if="hasSearch" class="right-side-item action-search" :tag-search="tagSearch" @tagSearch="handleTagSearch" />
<ActionsGroup :is-fa="true" :actions="defaultRightSideActions" class="right-side-actions right-side-item" @actionClick="handleActionClick" />
</div>
</slot>

View File

@ -5,7 +5,7 @@
<i class="el-icon-arrow-down el-icon--right" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="option in filterFields" :key="option.key" :command="option.key" :value="option.label" :name="option.key">{{ option.label }}</el-dropdown-item>
<el-dropdown-item v-for="option in tagSearch" :key="option.key" :command="option.key" :value="option.label" :name="option.key">{{ option.label }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-tag v-for="(v, k) in filterTags" :key="k" :name="k" closable size="small" class="fieldtag" type="info" @close="handleTagClose(k)">
@ -20,7 +20,7 @@
export default {
name: 'TagSearch',
props: {
filterFields: {
tagSearch: {
type: Array,
default() {
return [
@ -48,7 +48,7 @@ export default {
computed: {
// eslint-disable-next-line vue/return-in-computed-property
filterLabel() {
for (const field of this.filterFields) {
for (const field of this.tagSearch) {
if (field.key === this.filterKey) {
return field.label
}