block when checking
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
:class="{
|
||||
'installed-mode': software.status === 'installed',
|
||||
'is-selected': isSelected && software.status !== 'installed',
|
||||
'is-busy': software.status === 'pending' || software.status === 'installing'
|
||||
'is-busy': software.status === 'pending' || software.status === 'installing',
|
||||
'is-disabled': disabled && software.status === 'idle'
|
||||
}"
|
||||
@click="handleCardClick"
|
||||
>
|
||||
@@ -14,7 +15,7 @@
|
||||
class="checkbox"
|
||||
:class="{
|
||||
'checked': isSelected,
|
||||
'disabled': software.status === 'installed' || software.status === 'pending' || software.status === 'installing'
|
||||
'disabled': disabled || software.status === 'installed' || software.status === 'pending' || software.status === 'installing'
|
||||
}"
|
||||
>
|
||||
<span v-if="isSelected">✓</span>
|
||||
@@ -64,6 +65,7 @@
|
||||
v-if="software.status === 'idle'"
|
||||
@click.stop="$emit('install', software.id, (software as any).targetVersion)"
|
||||
class="action-btn install-btn"
|
||||
:disabled="disabled"
|
||||
>
|
||||
{{ actionLabel }}
|
||||
</button>
|
||||
@@ -103,6 +105,7 @@
|
||||
v-else-if="software.status === 'error'"
|
||||
@click.stop="$emit('install', software.id, (software as any).targetVersion)"
|
||||
class="action-btn retry-btn"
|
||||
:disabled="disabled"
|
||||
>
|
||||
重试
|
||||
</button>
|
||||
@@ -130,7 +133,8 @@ const props = defineProps<{
|
||||
},
|
||||
actionLabel?: string,
|
||||
selectable?: boolean,
|
||||
isSelected?: boolean
|
||||
isSelected?: boolean,
|
||||
disabled?: boolean
|
||||
}>();
|
||||
|
||||
const emit = defineEmits(['install', 'toggleSelect']);
|
||||
@@ -186,6 +190,11 @@ const handleCardClick = () => {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.software-card.is-disabled {
|
||||
opacity: 0.6;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.selection-area {
|
||||
margin-right: 16px;
|
||||
flex-shrink: 0;
|
||||
|
||||
@@ -105,7 +105,7 @@ export const useSoftwareStore = defineStore('software', {
|
||||
}).sort(sortByName);
|
||||
},
|
||||
isBusy: (state) => {
|
||||
return Object.values(state.activeTasks).some(task =>
|
||||
return state.loading || Object.values(state.activeTasks).some(task =>
|
||||
task.status === 'pending' || task.status === 'installing'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
:action-label="item.actionLabel"
|
||||
:selectable="true"
|
||||
:is-selected="store.selectedEssentialIds.includes(item.id)"
|
||||
:disabled="store.isBusy"
|
||||
@install="store.install"
|
||||
@toggle-select="id => store.toggleSelection(id, 'essential')"
|
||||
/>
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
action-label="更新"
|
||||
:selectable="true"
|
||||
:is-selected="store.selectedUpdateIds.includes(item.id)"
|
||||
:disabled="store.isBusy"
|
||||
@install="store.install"
|
||||
@toggle-select="id => store.toggleSelection(id, 'update')"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user