chore: disable filter button if all rows do not have sourceSchedule

Signed-off-by: andy.lee <andy.lee@suse.com>
This commit is contained in:
andy.lee
2025-01-13 16:29:08 +08:00
parent 57ab9e2830
commit d72857f374
2 changed files with 7 additions and 3 deletions
@@ -25,6 +25,9 @@ export default {
return Array.from(new Set(options));
},
enableFilterButton() {
return this.rows.some((r) => r.sourceSchedule !== undefined);
}
},
methods: {
@@ -63,7 +66,9 @@ export default {
</script>
<template>
<div class="vm-schedule-filter">
<div
class="vm-schedule-filter"
>
<span
v-if="selected"
class="banner-item bg-warning"
@@ -84,6 +89,7 @@ export default {
<button
ref="actionDropDown"
class="btn bg-primary mr-10"
:disabled="!enableFilterButton"
>
<slot name="title">
{{ t('harvester.fields.filterSchedule') }}