优化excel导入,支持链接等特殊类型
This commit is contained in:
parent
3e1093b78a
commit
5e16a105a5
@ -150,6 +150,19 @@ const importData = async (buffer: Buffer) => {
|
||||
let favorite = columnIndex.favorite !== -1 ? row.getCell(columnIndex.favorite) : null
|
||||
let customFields = columnIndex.customFields !== -1 ? row.getCell(columnIndex.customFields) : null
|
||||
|
||||
if (address && typeof address.value === 'object') {
|
||||
address.value = address.value.text
|
||||
}
|
||||
if (username && typeof username.value === 'object') {
|
||||
username.value = username.value.text
|
||||
}
|
||||
if (passwordValue && typeof passwordValue.value === 'object') {
|
||||
passwordValue.value = passwordValue.value.text
|
||||
}
|
||||
if (remark && typeof remark.value === 'object') {
|
||||
remark.value = remark.value.text
|
||||
}
|
||||
|
||||
// 收藏
|
||||
let favoriteValue = favorite && favorite.value === '是'
|
||||
|
||||
|
@ -51,6 +51,7 @@ export const searchStr = (searchText: string, value: string): boolean => {
|
||||
if (!value) return false;
|
||||
if (!searchText) return false;
|
||||
|
||||
try {
|
||||
const lowerSearchText = searchText.toLowerCase();
|
||||
const lowerValue = value.toLowerCase();
|
||||
|
||||
@ -58,6 +59,10 @@ export const searchStr = (searchText: string, value: string): boolean => {
|
||||
if (lowerValue.includes(lowerSearchText)) {
|
||||
return true;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user