|
@@ -15,7 +15,21 @@
|
|
|
<el-popover class="table-header-cell-popover" placement="bottom" trigger="click" @show="expand = true" @hide="expand = false">
|
|
|
<span v-if="filterStyle === 'underline'" slot="reference" :class="['btn-filter', { 'btn-filter-active': active }]">{{ label }}</span>
|
|
|
<i v-if="filterStyle === 'arrow'" slot="reference" :class="['filter-arrow', 'el-icon-arrow-down', { 'arrow-active': active, 'arrow-expand': expand }]" />
|
|
|
- <el-form>
|
|
|
+ <el-form v-if="newFilters" inline label-position="top">
|
|
|
+ <el-form-item label="比较符" style="width: 60px;">
|
|
|
+ <el-select v-model="newFilters[0]" size="small" @change="$emit('update:new-filters', newFilters)">
|
|
|
+ <el-option label="<" value="<" />
|
|
|
+ <el-option label="=" value="=" />
|
|
|
+ <el-option label=">" value=">" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="label">
|
|
|
+ <el-select v-model="newFilters[1]" size="small" placeholder="筛选" filterable allow-create default-first-option collapse-tags clearable @change="$emit('update:new-filters', newFilters)">
|
|
|
+ <el-option v-for="(option, optionIndex) in filterOptions" :key="option.value + optionIndex" :value="option.value" :label="option.text" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form v-else>
|
|
|
<el-form-item :label="label">
|
|
|
<el-select v-model="selections" size="small" placeholder="筛选" multiple filterable default-first-option collapse-tags clearable @change="newVal => { $emit('update:filter-values', newVal) }">
|
|
|
<el-option v-for="(option, optionIndex) in filterOptions" :key="option.value + optionIndex" :value="option.value" :label="option.text" />
|
|
@@ -51,6 +65,9 @@ export default {
|
|
|
filterValues: {
|
|
|
type: Array
|
|
|
},
|
|
|
+ newFilters: {
|
|
|
+ type: Array
|
|
|
+ },
|
|
|
sortable: {
|
|
|
type: [Boolean, Number],
|
|
|
},
|
|
@@ -67,7 +84,7 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
active () {
|
|
|
- return this.filterValues?.length
|
|
|
+ return this.filterValues?.length || this.newFilters?.[1]
|
|
|
},
|
|
|
filterable () {
|
|
|
return !!this.filterOptions
|
|
@@ -128,4 +145,7 @@ export default {
|
|
|
.el-select-dropdown__item.hover {
|
|
|
background: #d2d6df;
|
|
|
}
|
|
|
+::v-deep .el-input--small .el-input__icon {
|
|
|
+ line-height: 40px;
|
|
|
+}
|
|
|
</style>
|