|
|
@@ -499,8 +499,20 @@
|
|
|
:row-selection="{
|
|
|
selectedRowKeys: Array.from(selectedBoundSteamUsernames),
|
|
|
onChange: (keys: string[]) => {
|
|
|
- selectedBoundSteamUsernames.clear()
|
|
|
- keys.forEach((k: string) => selectedBoundSteamUsernames.add(k))
|
|
|
+ const newKeys = new Set(keys)
|
|
|
+ // 找出新增的(勾选)和移除的(取消勾选)
|
|
|
+ const addedKeys = keys.filter((k: string) => !prevSelectedBoundSteamKeys.value.has(k))
|
|
|
+ const removedKeys = Array.from(prevSelectedBoundSteamKeys.value).filter(k => !newKeys.has(k))
|
|
|
+ // 更新选中状态
|
|
|
+ selectedBoundSteamUsernames.value = newKeys
|
|
|
+ prevSelectedBoundSteamKeys.value = newKeys
|
|
|
+ // 显示提示
|
|
|
+ if (addedKeys.length > 0) {
|
|
|
+ message.success(`已勾选 ${addedKeys.length} 个账号`)
|
|
|
+ }
|
|
|
+ if (removedKeys.length > 0) {
|
|
|
+ message.info(`已取消勾选 ${removedKeys.length} 个账号`)
|
|
|
+ }
|
|
|
}
|
|
|
}"
|
|
|
size="small"
|
|
|
@@ -1562,6 +1574,9 @@ const boundSteamColumns = [
|
|
|
/** 已绑定 Steam 账号勾选状态 */
|
|
|
const selectedBoundSteamUsernames = ref<Set<string>>(new Set())
|
|
|
|
|
|
+/** 上一次已绑定 Steam 账号选中的 keys(用于对比勾选/取消勾选) */
|
|
|
+const prevSelectedBoundSteamKeys = ref<Set<string>>(new Set())
|
|
|
+
|
|
|
/** 全部已绑定 Steam 账号是否已勾选 */
|
|
|
const allBoundSteamSelected = computed(() => {
|
|
|
if (boundSteamAccounts.value.length === 0) return false
|
|
|
@@ -1606,6 +1621,8 @@ function toggleSelectBoundSteam(username: string, checked: boolean) {
|
|
|
function initSelectedBoundSteamAccounts() {
|
|
|
selectedBoundSteamUsernames.value.clear()
|
|
|
boundSteamAccounts.value.forEach(a => selectedBoundSteamUsernames.value.add(a.steam_username))
|
|
|
+ // 同步更新 prevSelectedBoundSteamKeys
|
|
|
+ prevSelectedBoundSteamKeys.value = new Set(selectedBoundSteamUsernames.value)
|
|
|
}
|
|
|
|
|
|
/** 配置中的排除/指定 id 可能为字符串或数组,统一为换行分隔字符串 */
|