🚀 修复构建问题.

This commit is contained in:
lijiahang
2024-03-18 14:58:43 +08:00
parent 127f4df302
commit 2451f4af82
9 changed files with 15 additions and 14 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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());
}
};

View File

@@ -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']);

View File

@@ -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']);

View File

@@ -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']);

View File

@@ -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();

View File

@@ -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

View File

@@ -78,10 +78,7 @@
:bordered="false">
<!-- 配置项 -->
<template #keyName="{ record }">
<span class="copy-left" title="复制" @click="copy(record.keyName)">
<icon-copy />
</span>
<span>{{ record.keyName }}</span>
<span class="text-copy" @click="copy(record.keyName)">{{ record.keyName }}</span>
</template>
<!-- 配置值类型 -->
<template #valueType="{ record }">