Skip to content

Commit

Permalink
feat: 项目成员管理 TencentBlueKing#9620
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 10583
  • Loading branch information
vhwweng committed Jun 26, 2024
1 parent 069593b commit 37f4979
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
@page-value-change="pageValueChange"
>
<template #prepend>
<div v-if="isShowOperation && selectedData[groupType]?.length" class="prepend">
<div v-if="isCurrentAll" class="prepend">
已选择全量数据 {{ groupTotal }} 条,
<span @click="handleClear">清除选择</span>
</div>
<div v-else-if="isShowOperation && selectedData[groupType]?.length" class="prepend">
已选择 {{ selectedData[groupType].length }} 条数据,
<span @click="handleSelectAllData"> 选择全量数据 {{ groupTotal }} 条 </span>
&nbsp; | &nbsp;
Expand Down Expand Up @@ -132,33 +136,33 @@ const isCurrentAll = ref(false);
* 当前页全选事件
*/
function handleSelectAll({ checked, data }) {
isCurrentAll.value = checked;
emit('getSelectList', refTable.value.getSelection(), groupType.value);
isCurrentAll.value = false;
}
/**
* 多选事件
* @param val
*/
function handleSelectionChange({data}) {
console.log(data, 123)
isCurrentAll.value = refTable.value.getSelection() === selectedData[groupType]?.length;
function handleSelectionChange({checked}) {
emit('getSelectList', refTable.value.getSelection(), groupType.value);
isCurrentAll.value = props.data.length === refTable.value.getSelection()
};
/**
* 全量数据选择
*/
function handleSelectAllData() {
const selectLength = refTable.value.getSelection().length
if(!isCurrentAll.value && selectLength != groupTotal.value) {
if (selectLength != props.data.length) {
refTable.value.toggleAllSelection();
}
emit('handleSelectAllData', groupType.value)
isCurrentAll.value = true;
}
/**
* 清除选择
*/
function handleClear() {
refTable.value.clearSelection();
isCurrentAll.value = false;
emit('handleClear', refTable.value.getSelection(), groupType.value);
}
/**
Expand Down

0 comments on commit 37f4979

Please sign in to comment.