优化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 favorite = columnIndex.favorite !== -1 ? row.getCell(columnIndex.favorite) : null
|
||||||
let customFields = columnIndex.customFields !== -1 ? row.getCell(columnIndex.customFields) : 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 === '是'
|
let favoriteValue = favorite && favorite.value === '是'
|
||||||
|
|
||||||
|
@ -51,13 +51,18 @@ export const searchStr = (searchText: string, value: string): boolean => {
|
|||||||
if (!value) return false;
|
if (!value) return false;
|
||||||
if (!searchText) return false;
|
if (!searchText) return false;
|
||||||
|
|
||||||
const lowerSearchText = searchText.toLowerCase();
|
try {
|
||||||
const lowerValue = value.toLowerCase();
|
const lowerSearchText = searchText.toLowerCase();
|
||||||
|
const lowerValue = value.toLowerCase();
|
||||||
|
|
||||||
// 普通大小写忽略搜索
|
// 普通大小写忽略搜索
|
||||||
if (lowerValue.includes(lowerSearchText)) {
|
if (lowerValue.includes(lowerSearchText)) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -121,7 +126,7 @@ export function randomPassword(generateRule: GenerateRule) {
|
|||||||
|
|
||||||
pool = pool.filter(Boolean)
|
pool = pool.filter(Boolean)
|
||||||
if (!pool.length) {
|
if (!pool.length) {
|
||||||
ElNotification.error({title: '生成失败',message: '请检查易混淆字符配置'})
|
ElNotification.error({title: '生成失败', message: '请检查易混淆字符配置'})
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -425,13 +430,13 @@ const joinPassword = (password: Password) => {
|
|||||||
|
|
||||||
// 比较密码
|
// 比较密码
|
||||||
export const comparePassword = (a: Password, b: Password): boolean => {
|
export const comparePassword = (a: Password, b: Password): boolean => {
|
||||||
return joinPassword(a) ===joinPassword(b)
|
return joinPassword(a) === joinPassword(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前域名地址
|
// 获取当前域名地址
|
||||||
export const getLocationUrl = () => {
|
export const getLocationUrl = () => {
|
||||||
let url = location.origin
|
let url = location.origin
|
||||||
if(url.startsWith('file://')){
|
if (url.startsWith('file://')) {
|
||||||
url += location.pathname
|
url += location.pathname
|
||||||
}
|
}
|
||||||
return url
|
return url
|
||||||
|
Loading…
x
Reference in New Issue
Block a user