forked from verdnatura/salix-front
refs #6280: remove related code to filter-rules
This commit is contained in:
parent
45dc9c355f
commit
9f9835b7ab
|
@ -12,15 +12,11 @@ const $props = defineProps({
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
optionLabel: {
|
optionLabel: {
|
||||||
type: [String, Function],
|
type: [String],
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
filterOptions: {
|
filterOptions: {
|
||||||
type: [Array, Function],
|
type: [Array],
|
||||||
default: () => [],
|
|
||||||
},
|
|
||||||
filterRules: {
|
|
||||||
type: [Array, Function],
|
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
isClearable: {
|
isClearable: {
|
||||||
|
@ -57,13 +53,6 @@ const filter = (val, options) => {
|
||||||
const search = val.toString().toLowerCase();
|
const search = val.toString().toLowerCase();
|
||||||
|
|
||||||
if (!search) return options;
|
if (!search) return options;
|
||||||
if($props.filterRules.length) {
|
|
||||||
const passSomeRule = $props.filterRules.some((rule) => {
|
|
||||||
const cond = eval(rule)
|
|
||||||
return cond;
|
|
||||||
});
|
|
||||||
if(!passSomeRule) return options
|
|
||||||
}
|
|
||||||
|
|
||||||
return options.filter((row) => {
|
return options.filter((row) => {
|
||||||
if ($props.filterOptions.length) {
|
if ($props.filterOptions.length) {
|
||||||
|
|
Loading…
Reference in New Issue