diff --git a/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue b/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue
index 3c35afc8..0a7df6c6 100644
--- a/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue
+++ b/orion-ops-ui/src/components/asset/host/authorized-host-modal/index.vue
@@ -168,7 +168,7 @@
if (filterVal) {
list = filterVal.startsWith('@')
// tag 过滤
- ? list.filter(item => item.tags.some(tag => (tag.name as string).toLowerCase().startsWith(filterVal.substring(1, filterVal.length))))
+ ? list.filter(item => item.tags.some(tag => tag.name?.toLowerCase().startsWith(filterVal.substring(1, filterVal.length))))
// 名称/编码/地址 过滤
: list.filter(item => {
return (item.name as string)?.toLowerCase().indexOf(filterVal) > -1
diff --git a/orion-ops-ui/src/store/modules/tab-bar/index.ts b/orion-ops-ui/src/store/modules/tab-bar/index.ts
index 03a44028..fa65a912 100644
--- a/orion-ops-ui/src/store/modules/tab-bar/index.ts
+++ b/orion-ops-ui/src/store/modules/tab-bar/index.ts
@@ -23,7 +23,7 @@ export default defineStore('tabBar', {
addTab(tag: TagProps, ignoreCache: boolean) {
this.tagList.push(tag);
if (!ignoreCache) {
- this.cacheTabList.add(tag.name as string);
+ this.cacheTabList.add(tag.name);
}
},
@@ -49,8 +49,8 @@ export default defineStore('tabBar', {
this.cacheTabList.clear();
// 要先判断 ignoreCache
this.tagList.filter((el) => !el.ignoreCache)
- .map((el) => el.name)
- .forEach((x) => this.cacheTabList.add(x));
+ .map((el) => el.name)
+ .forEach((x) => this.cacheTabList.add(x));
},
// 重设 tab
diff --git a/orion-ops-ui/src/types/form.ts b/orion-ops-ui/src/types/form.ts
index 78341a8b..e1395a2e 100644
--- a/orion-ops-ui/src/types/form.ts
+++ b/orion-ops-ui/src/types/form.ts
@@ -2,21 +2,21 @@ import type { SelectOptionData, TreeNodeData } from '@arco-design/web-vue';
// 通过 label 进行过滤
export const labelFilter = (searchValue: string, option: { label: string }) => {
- return option.label.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
+ return option.label.toLowerCase().includes(searchValue.toLowerCase());
};
// 通过 title 进行过滤
export const titleFilter = (searchValue: string, option: TreeNodeData) => {
- return (option.title as string).toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
+ return (option.title as string)?.toLowerCase().includes(searchValue.toLowerCase());
};
// 通过 tag label 进行过滤
export const tagLabelFilter = (searchValue: string, option: SelectOptionData) => {
- if (searchValue.startsWith('@')) {
+ if (searchValue.startsWith('@') && option.isTag) {
// tag 过滤
- return option.isTag && (option.label as string).toLowerCase().startsWith(searchValue.substring(1, searchValue.length).toLowerCase());
+ return (option.label as string)?.toLowerCase().startsWith(searchValue.substring(1, searchValue.length).toLowerCase());
} else {
// 文本过滤
- return !option.isTag && (option.label as string).toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
+ return (option.label as string)?.toLowerCase().includes(searchValue.toLowerCase());
}
};
diff --git a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-card-list.vue b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-card-list.vue
index 1212b338..10562f32 100644
--- a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-card-list.vue
+++ b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-card-list.vue
@@ -152,6 +152,7 @@
import { Message, Modal } from '@arco-design/web-vue';
import usePermission from '@/hooks/permission';
import { copy } from '@/hooks/copy';
+ import { GrantKey, GrantRouteName } from '@/views/asset/grant/types/const';
import HostKeySelector from '@/components/asset/host-key/selector/index.vue';
const emits = defineEmits(['openAdd', 'openUpdate', 'openKeyView']);
diff --git a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
index 87276883..c5ee97ca 100644
--- a/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
+++ b/orion-ops-ui/src/views/asset/host-identity/components/host-identity-table.vue
@@ -148,6 +148,7 @@
import usePermission from '@/hooks/permission';
import { copy } from '@/hooks/copy';
import { usePagination } from '@/types/table';
+ import { GrantKey, GrantRouteName } from '@/views/asset/grant/types/const';
import HostKeySelector from '@/components/asset/host-key/selector/index.vue';
const emits = defineEmits(['openAdd', 'openUpdate', 'openKeyView']);
diff --git a/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue b/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
index 408a16b5..6826b9f1 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/host-card-list.vue
@@ -178,6 +178,7 @@
import { Message, Modal } from '@arco-design/web-vue';
import { tagColor } from '../types/const';
import { copy } from '@/hooks/copy';
+ import { GrantKey, GrantRouteName } from '@/views/asset/grant/types/const';
import TagMultiSelector from '@/components/meta/tag/multi-selector/index.vue';
const emits = defineEmits(['openAdd', 'openUpdate', 'openUpdateConfig', 'openHostGroup']);
diff --git a/orion-ops-ui/src/views/asset/host-list/components/host-table.vue b/orion-ops-ui/src/views/asset/host-list/components/host-table.vue
index f9c50d6e..9d8372c2 100644
--- a/orion-ops-ui/src/views/asset/host-list/components/host-table.vue
+++ b/orion-ops-ui/src/views/asset/host-list/components/host-table.vue
@@ -175,6 +175,7 @@
import { copy } from '@/hooks/copy';
import columns from '../types/table.columns';
import { dataColor } from '@/utils';
+ import { GrantKey, GrantRouteName } from '@/views/asset/grant/types/const';
import TagMultiSelector from '@/components/meta/tag/multi-selector/index.vue';
const tagSelector = ref();
diff --git a/orion-ops-ui/src/views/host/terminal/components/new-connection/hosts-view.vue b/orion-ops-ui/src/views/host/terminal/components/new-connection/hosts-view.vue
index f50689da..d248415e 100644
--- a/orion-ops-ui/src/views/host/terminal/components/new-connection/hosts-view.vue
+++ b/orion-ops-ui/src/views/host/terminal/components/new-connection/hosts-view.vue
@@ -73,7 +73,7 @@
if (filterVal) {
list = filterVal.startsWith('@')
// tag 过滤
- ? list.filter(item => item.tags.some(tag => (tag.name as string).toLowerCase().startsWith(filterVal.substring(1, filterVal.length))))
+ ? list.filter(item => item.tags.some(tag => tag.name?.toLowerCase().startsWith(filterVal.substring(1, filterVal.length))))
// 名称/编码/地址 过滤
: list.filter(item => {
return (item.name as string)?.toLowerCase().indexOf(filterVal) > -1
diff --git a/orion-ops-ui/src/views/system/dict-key/components/dict-key-table.vue b/orion-ops-ui/src/views/system/dict-key/components/dict-key-table.vue
index 869ccd9c..ec74522b 100644
--- a/orion-ops-ui/src/views/system/dict-key/components/dict-key-table.vue
+++ b/orion-ops-ui/src/views/system/dict-key/components/dict-key-table.vue
@@ -78,10 +78,7 @@
:bordered="false">
-
-
-
- {{ record.keyName }}
+ {{ record.keyName }}