fix: bug#11328
This commit is contained in:
parent
e9f255ca3c
commit
f5a125df65
|
@ -159,6 +159,7 @@ const paramsValue = reactive<TermsType>({
|
|||
const formItemContext = Form.useInjectFormItemContext()
|
||||
const showDelete = ref(false)
|
||||
const columnOptions: any = inject('filter-params') //
|
||||
const columnType = ref<string>()
|
||||
const termTypeOptions = ref<Array<{ id: string, name: string}>>([]) // 条件值
|
||||
const valueOptions = ref<any[]>([]) // 默认手动输入下拉
|
||||
const arrayParamsKey = ['nbtw', 'btw', 'in', 'nin', 'contains_all', 'contains_any', 'not_contains']
|
||||
|
@ -175,6 +176,7 @@ const handOptionByColumn = (option: any) => {
|
|||
if (option) {
|
||||
termTypeOptions.value = option.termTypes || []
|
||||
tabsOptions.value[0].component = option.type
|
||||
columnType.value = option.type
|
||||
const _options = isArray(option.options) ? option.options : []
|
||||
if (option.type === 'boolean') {
|
||||
valueOptions.value = _options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [
|
||||
|
@ -289,14 +291,16 @@ const termsTypeSelect = (e: { key: string, name: string }) => {
|
|||
let value = arrayParamsKey.includes(e.key) ? [ oldValue, undefined ] : oldValue
|
||||
|
||||
// 如果上次的值 在 timeTypeKeys中 则不变
|
||||
if (timeTypeKeys.includes(e.key)) {
|
||||
if (tabsOptions.value[0].component !== 'int') {
|
||||
if (columnType.value ==='date') {
|
||||
if (timeTypeKeys.includes(e.key)) {
|
||||
if (tabsOptions.value[0].component !== 'int') {
|
||||
value = undefined
|
||||
}
|
||||
tabsOptions.value[0].component = 'int'
|
||||
} else if (!timeTypeKeys.includes(e.key) && tabsOptions.value[0].component == 'int') {
|
||||
value = undefined
|
||||
tabsOptions.value[0].component = 'date'
|
||||
}
|
||||
tabsOptions.value[0].component = 'int'
|
||||
} else if (!timeTypeKeys.includes(e.key) && tabsOptions.value[0].component == 'int') {
|
||||
value = undefined
|
||||
tabsOptions.value[0].component = 'date'
|
||||
}
|
||||
|
||||
paramsValue.value = {
|
||||
|
|
|
@ -152,6 +152,7 @@ const paramsValue = reactive<TermsType>({
|
|||
|
||||
const showDelete = ref(false)
|
||||
const columnOptions: any = inject(ContextKey) //
|
||||
const columnType = ref<string>()
|
||||
const termTypeOptions = ref<Array<{ id: string, name: string}>>([]) // 条件值
|
||||
const valueOptions = ref<any[]>([]) // 默认手动输入下拉
|
||||
const metricOption = ref<any[]>([]) // 根据termType获取对应指标值
|
||||
|
@ -165,7 +166,7 @@ const handOptionByColumn = (option: any) => {
|
|||
metricsCacheOption.value = option.metrics?.map((item: any) => ({...item, label: item.name})) || []
|
||||
tabsOptions.value.length = 1
|
||||
tabsOptions.value[0].component = option.dataType
|
||||
|
||||
columnType.value = option.dataType
|
||||
if (option.metrics && option.metrics.length) {
|
||||
|
||||
tabsOptions.value.push(
|
||||
|
@ -281,14 +282,16 @@ const termsTypeSelect = (e: { key: string, name: string }) => {
|
|||
const oldValue = isArray(paramsValue.value!.value) ? paramsValue.value!.value[0] : paramsValue.value!.value
|
||||
let value = arrayParamsKey.includes(e.key) ? [ oldValue, undefined ] : oldValue
|
||||
// 如果上次的值 在 timeTypeKeys中 则不变
|
||||
if (timeTypeKeys.includes(e.key)) {
|
||||
if (tabsOptions.value[0].component !== 'int') {
|
||||
if (columnType.value === 'date') {
|
||||
if (timeTypeKeys.includes(e.key)) {
|
||||
if (tabsOptions.value[0].component !== 'int') {
|
||||
value = undefined
|
||||
}
|
||||
tabsOptions.value[0].component = 'int'
|
||||
} else if (!timeTypeKeys.includes(e.key) && tabsOptions.value[0].component == 'int') {
|
||||
value = undefined
|
||||
tabsOptions.value[0].component = 'date'
|
||||
}
|
||||
tabsOptions.value[0].component = 'int'
|
||||
} else if (!timeTypeKeys.includes(e.key) && tabsOptions.value[0].component == 'int') {
|
||||
value = undefined
|
||||
tabsOptions.value[0].component = 'date'
|
||||
}
|
||||
|
||||
paramsValue.value = {
|
||||
|
|
|
@ -3700,8 +3700,8 @@ jetlinks-store@^0.0.3:
|
|||
|
||||
jetlinks-ui-components@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#c71ecae61776bff738f43efe46aac7264f092736"
|
||||
integrity sha512-+1a/4nA5RCiInRFyyaVCMEWSBzNU8lzxOYTTpY0GiNhuJuhGE5AbBsVp9CXXF0lFECK2iqaAElY+QN4Wjms1Dw==
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#8cbd59900e692dd931d289f3d5a6f4541485fd9f"
|
||||
integrity sha512-ytX39qMt3kkEisURoIKlv2rAhGSvI74/WLLqkP6dJdz4q1k3UpANDtcnrz9rGRwTAKszVQ6kCga6VL6kGJiteQ==
|
||||
dependencies:
|
||||
"@vueuse/core" "^9.12.0"
|
||||
ant-design-vue "^3.2.15"
|
||||
|
|
Loading…
Reference in New Issue