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

Signed-off-by: andy.lee <andy.lee@suse.com>
(cherry picked from commit d72857f374911ebe7faf70679a59abd89ffc9890)
This commit is contained in:
andy.lee 2025-01-13 16:26:22 +08:00 committed by Mergify
parent 408818904a
commit 1ecac7adf4
2 changed files with 7 additions and 3 deletions

View File

@ -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') }}

View File

@ -120,8 +120,6 @@ export default {
methods: {
changeRows(filteredRows, searchSchedule) {
console.log('🚀 ~ changeRows ~ searchSchedule:', searchSchedule);
console.log('🚀 ~ changeRows ~ filteredRows:', filteredRows);
this['searchSchedule'] = searchSchedule;
this['snapshots'] = filteredRows;
},