fix: Resource authorization: "Select All" is ineffective (#4274)

This commit is contained in:
shaohuzhang1 2025-10-28 11:29:17 +08:00 committed by GitHub
parent c3acbeff63
commit 871e810918
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,13 +56,14 @@
class="mt-16"
:data="filteredData"
@select="select"
@select-all="selectAll"
:maxTableHeight="260"
:row-key="(row: any) => row.id"
style="min-width: 600px"
:expand-row-keys="defaultExpandKeys"
show-overflow-tooltip
>
<el-table-column type="selection" width="55" :reserve-selection="true" />
<el-table-column type="selection" width="55" :reserve-selection="true"> </el-table-column>
<el-table-column prop="name" :label="$t('common.name')">
<template #default="{ row }">
<span style="vertical-align: sub">
@ -137,7 +138,7 @@
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, watch, computed, reactive } from 'vue'
import { ref, onMounted, computed, nextTick } from 'vue'
import { useRoute } from 'vue-router'
import type { Provider } from '@/api/type/model'
import { SourceTypeEnum } from '@/enums/common'
@ -312,6 +313,9 @@ const filteredData = computed(() => {
const multipleSelection = ref<any[]>([])
const selectObj: any = {}
const selectAll = (selection: any[]) => {
multipleSelection.value = selection
}
const select = (val: any[], active: any) => {
if (active.resource_type === 'folder') {
if (!val.some((item) => item.id == active.id)) {