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