🔨 优化主机逻辑.

This commit is contained in:
lijiahangmax
2025-03-16 00:20:18 +08:00
parent d071ef64d8
commit 0db732fc19
12 changed files with 21 additions and 76 deletions

View File

@@ -151,7 +151,7 @@
// 全选
const selectAll = async () => {
// 从缓存中查询全部分组
const groups = await cacheStore.loadHostGroups();
const groups = await cacheStore.loadHostGroupTree();
const groupKeys: number[] = [];
flatNodeKeys(groups, groupKeys);
checkedGroups.value = groupKeys;
@@ -160,7 +160,7 @@
// 反选
const reverseSelect = async () => {
// 从缓存中查询全部分组
const groups = await cacheStore.loadHostGroups();
const groups = await cacheStore.loadHostGroupTree();
const groupKeys: number[] = [];
flatNodeKeys(groups, groupKeys);
checkedGroups.value = groupKeys.filter(s => !checkedGroups.value.includes(s));

View File

@@ -44,6 +44,11 @@ export const port = [{
message: '输入的端口不合法'
}] as FieldRule[];
export const groupIdList = [{
required: true,
message: '请选择主机分组'
}] as FieldRule[];
export const tags = [{
maxLength: 5,
message: '最多选择5个标签'
@@ -61,6 +66,7 @@ export default {
code,
address,
port,
groupIdList,
tags,
description,
} as Record<string, FieldRule | FieldRule[]>;