🔨 优化主机逻辑.
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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[]>;
|
||||
|
||||
Reference in New Issue
Block a user