feat: 过滤别名.
This commit is contained in:
@@ -212,7 +212,6 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// FIXME 测试
|
|
||||||
// 保存节点
|
// 保存节点
|
||||||
const saveNode = async (node: TreeNodeData) => {
|
const saveNode = async (node: TreeNodeData) => {
|
||||||
const key = node.key
|
const key = node.key
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-drawer v-model:visible="visible"
|
<a-drawer v-model:visible="visible"
|
||||||
class="host-group-drawer"
|
class="host-group-drawer"
|
||||||
width="70%"
|
:width="1120"
|
||||||
title="主机分组配置"
|
title="主机分组配置"
|
||||||
:esc-to-close="false"
|
:esc-to-close="false"
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
|
|||||||
@@ -34,7 +34,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<template #item="{ label }">
|
<template #item="{ label }">
|
||||||
<span v-html="renderLabel(label)" />
|
<a-tooltip position="top"
|
||||||
|
:mini="true"
|
||||||
|
:content="label">
|
||||||
|
<span v-html="renderLabel(label)" />
|
||||||
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</a-transfer>
|
</a-transfer>
|
||||||
</div>
|
</div>
|
||||||
@@ -86,7 +90,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// FIXME 省略和tooltip
|
|
||||||
// 渲染 label
|
// 渲染 label
|
||||||
const renderLabel = (label: string) => {
|
const renderLabel = (label: string) => {
|
||||||
const last = label.lastIndexOf('-');
|
const last = label.lastIndexOf('-');
|
||||||
@@ -142,10 +145,21 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.arco-transfer-view-source {
|
||||||
|
|
||||||
|
.arco-transfer-list-item .arco-checkbox {
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.arco-transfer-view-target {
|
.arco-transfer-view-target {
|
||||||
|
|
||||||
.arco-transfer-list-item-content {
|
.arco-transfer-list-item-content {
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
|
position: absolute;
|
||||||
|
width: calc(100% - 52px);
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arco-transfer-list-item-remove-btn {
|
.arco-transfer-list-item-remove-btn {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
: list.filter(item => {
|
: list.filter(item => {
|
||||||
return (item.name as string)?.toLowerCase().indexOf(filterVal) > -1
|
return (item.name as string)?.toLowerCase().indexOf(filterVal) > -1
|
||||||
|| (item.code as string)?.toLowerCase().indexOf(filterVal) > -1
|
|| (item.code as string)?.toLowerCase().indexOf(filterVal) > -1
|
||||||
|
|| (item.alias as string)?.toLowerCase().indexOf(filterVal) > -1
|
||||||
|| (item.address as string)?.toLowerCase().indexOf(filterVal) > -1;
|
|| (item.address as string)?.toLowerCase().indexOf(filterVal) > -1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<!-- 过滤 -->
|
<!-- 过滤 -->
|
||||||
<a-auto-complete v-model="filterValue"
|
<a-auto-complete v-model="filterValue"
|
||||||
class="host-filter"
|
class="host-filter"
|
||||||
placeholder="输入名称/编码/IP @标签"
|
placeholder="别名/名称/编码/IP @标签"
|
||||||
:allow-clear="true"
|
:allow-clear="true"
|
||||||
:data="filterOptions"
|
:data="filterOptions"
|
||||||
:filter-option="searchFilter">
|
:filter-option="searchFilter">
|
||||||
@@ -118,8 +118,8 @@
|
|||||||
}).forEach(s => filterOptions.value.push(s));
|
}).forEach(s => filterOptions.value.push(s));
|
||||||
// 添加主机信息
|
// 添加主机信息
|
||||||
const hostMeta = hosts.value.hostList?.map(s => {
|
const hostMeta = hosts.value.hostList?.map(s => {
|
||||||
return [s.name, s.code, s.address];
|
return [s.name, s.code, s.address, s.alias];
|
||||||
}).flat(1);
|
}).filter(Boolean).flat(1);
|
||||||
[...new Set(hostMeta)].map(value => {
|
[...new Set(hostMeta)].map(value => {
|
||||||
return { label: value, value };
|
return { label: value, value };
|
||||||
}).forEach(s => filterOptions.value.push(s));
|
}).forEach(s => filterOptions.value.push(s));
|
||||||
|
|||||||
Reference in New Issue
Block a user