fix: 1、搜索组件有关枚举的添加国际化;2、修复tag模式下切换key,value还保留上次选择的问题;3、修复切换语言环境,搜索参数包含其他语言导致不能识别转换的问题
This commit is contained in:
@@ -273,6 +273,25 @@ export default {
|
||||
if (!meta.operator.value) {
|
||||
meta.operator.isEditing = true
|
||||
meta.operator.show = true
|
||||
} else {
|
||||
// 切换column,清除上次column选择的value,包含枚举的则删除,in操作符的让类型回归array
|
||||
meta.value.value = ''
|
||||
meta.value.label = ''
|
||||
meta.value.isEditing = true
|
||||
meta.value.show = true
|
||||
const obj = enumerateData.find(d => d.name === meta.column.label)
|
||||
if (obj) {
|
||||
meta.doc = obj
|
||||
if (this.$refs.valuesSelect) {
|
||||
// 触发focus后,select弹窗并没有生效
|
||||
this.$refs.valuesSelect[0].focus(meta)
|
||||
}
|
||||
} else {
|
||||
delete meta.doc
|
||||
}
|
||||
if (meta.operator.value.toLowerCase() === 'in') {
|
||||
meta.column.type = columnType.array
|
||||
}
|
||||
}
|
||||
}, 200)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import ParserError, { errorDesc, errorTypes } from '@/components/advancedSearch/
|
||||
import _ from 'lodash'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import i18n from '@/i18n'
|
||||
import store from '@/store'
|
||||
|
||||
const strReg = {
|
||||
// 需要不限制语言,正则过滤中英日俄语出错实现语言都通过。留个记录观察,后续校验
|
||||
@@ -1500,11 +1501,22 @@ export default class Parser {
|
||||
searchList.forEach((item, index) => {
|
||||
const obj = this.columnList.find(d => item.indexOf(d.label) > -1)
|
||||
if (obj && obj.doc.data) {
|
||||
obj.doc.data.forEach(item1 => {
|
||||
for (let i = 0; i < obj.doc.data.length; i++) {
|
||||
const item1 = obj.doc.data[i]
|
||||
if (item.indexOf(item1.code) > -1) {
|
||||
searchList[index] = searchList[index].replace(new RegExp(item1.code, 'g'), item1.value)
|
||||
// 匹配到code,终止匹配
|
||||
break
|
||||
} else {
|
||||
// 该操作是避免中文参数切换到英文环境时,code经i18n转为英文,匹配不到中文参数的情况
|
||||
Object.keys(store.state.i18nObj).forEach(lang => {
|
||||
const i18nCode = store.state.i18nObj[lang][item1.code1]
|
||||
if (item.indexOf(i18nCode) > -1) {
|
||||
searchList[index] = searchList[index].replace(new RegExp(i18nCode, 'g'), item1.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
key = searchList.join(' AND ')
|
||||
|
||||
@@ -82,21 +82,21 @@ export default {
|
||||
|
||||
let searchKey = hintSearch.toUpperCase() || ''
|
||||
searchKey = searchKey.trim()
|
||||
if (functionTips[searchKey]) {
|
||||
return functionTips[searchKey].description
|
||||
}
|
||||
// if (functionTips[searchKey]) {
|
||||
// return functionTips[searchKey].description
|
||||
// }
|
||||
if (operatorTips[searchKey]) {
|
||||
return operatorTips[searchKey].description
|
||||
}
|
||||
if (sqlTips[searchKey]) {
|
||||
return sqlTips[searchKey].description
|
||||
}
|
||||
// if (sqlTips[searchKey]) {
|
||||
// return sqlTips[searchKey].description
|
||||
// }
|
||||
if (filterTips[searchKey]) {
|
||||
return filterTips[searchKey].description
|
||||
}
|
||||
if (varTips[searchKey]) {
|
||||
return varTips[searchKey].description
|
||||
}
|
||||
// if (varTips[searchKey]) {
|
||||
// return varTips[searchKey].description
|
||||
// }
|
||||
|
||||
// 完整的匹配关键字
|
||||
if (this.getDataset()) {
|
||||
|
||||
Reference in New Issue
Block a user