From 903ced1c5f66908bd0c45f96c515f1c0b4c4be1a Mon Sep 17 00:00:00 2001 From: wangjinpeng <17600579508@163.com> Date: Thu, 29 Aug 2024 09:27:38 +0800 Subject: [PATCH 1/5] tableDemo --- docs/TableDemo.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/TableDemo.vue b/docs/TableDemo.vue index a884c90..c1689fc 100644 --- a/docs/TableDemo.vue +++ b/docs/TableDemo.vue @@ -605,8 +605,8 @@ const events: IwProps.TableEventProps = { }, getMicroAppOffset() { return { - left: -20, - top: -20, + left: 0, + top: 0, } }, } From b9e8f98efe6eb2a5827aca43a8707059e9177d37 Mon Sep 17 00:00:00 2001 From: wangjinpeng <17600579508@163.com> Date: Thu, 29 Aug 2024 09:27:56 +0800 Subject: [PATCH 2/5] table head hover --- src/components/layout/list/ListHeader.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/layout/list/ListHeader.vue b/src/components/layout/list/ListHeader.vue index 442c88d..8bbace4 100644 --- a/src/components/layout/list/ListHeader.vue +++ b/src/components/layout/list/ListHeader.vue @@ -210,7 +210,7 @@ function handleSort(column: ColumnConfWithSort) {
Date: Thu, 29 Aug 2024 10:48:38 +0800 Subject: [PATCH 3/5] fiterSetting Minput height --- src/components/function/FilterSetting.vue | 37 +++++++++++------------ 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/components/function/FilterSetting.vue b/src/components/function/FilterSetting.vue index 38420fc..d8f1616 100644 --- a/src/components/function/FilterSetting.vue +++ b/src/components/function/FilterSetting.vue @@ -82,18 +82,18 @@ const selectedFilterItemIdx = ref() const cachedAllSelectedDictItems = ref<{ [key: string | number]: DictItemProps }>({}) //可过滤的列 // Filterable columns -const filterColumnOptions = computed(()=> props.columnsConf.filter(col => props.filter.enabledColumnNames.includes(col.name)).map(e=> { +const filterColumnOptions = computed(() => props.columnsConf.filter(col => props.filter.enabledColumnNames.includes(col.name)).map(e => { return { - ...e, + ...e, value: e.name } })) // 选中过滤单项 // Selected filter item -const selectedFilterItem = computed(()=> selectedFilterItems.value?.[selectedFilterItemIdx.value!]) +const selectedFilterItem = computed(() => selectedFilterItems.value?.[selectedFilterItemIdx.value!]) //操作符 operator -const operatorOptions = computed(()=> { - return getOperatorKindsByDataKind(selectedFilterItem.value?.dataKind).map(e=> { +const operatorOptions = computed(() => { + return getOperatorKindsByDataKind(selectedFilterItem.value?.dataKind).map(e => { return { title: translateOperatorKind(e), value: e, @@ -310,7 +310,7 @@ function setFilterColumn(e: Event) { // 存在已选中的过滤项,重置过滤项到初始状态 // There is a selected filter item, reset the filter item to the initial state const currFilterItem = selectedFilterItems.value?.[selectedFilterItemIdx.value] - if(currFilterItem!.columnName === currColumnName) return + if (currFilterItem!.columnName === currColumnName) return currFilterItem!.columnName = currColumnName currFilterItem!.operator = OperatorKind.EQ currFilterItem!.values = [] @@ -567,9 +567,7 @@ onMounted(() => { @@ -614,7 +612,8 @@ onMounted(() => { @@ -627,7 +626,7 @@ onMounted(() => { class="iw-input iw-input-bordered iw-input-xs w-full" :type="getInputTypeByDataKind(filterItem.dataKind)" :value="filterItem.values" @change="e => { setFilterAValue((e.target as HTMLInputElement).value, filterItemIdx) }"> - @@ -648,12 +647,12 @@ onMounted(() => { {{ $t('function.filter.note') }} - - - - + + + + From 58aca805159b7cb3931fb19ce35dbf00f673fa9a Mon Sep 17 00:00:00 2001 From: wangjinpeng <17600579508@163.com> Date: Thu, 29 Aug 2024 10:50:56 +0800 Subject: [PATCH 4/5] filter debounce --- src/components/base/MInput/index.vue | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/components/base/MInput/index.vue b/src/components/base/MInput/index.vue index e964f47..2eee116 100644 --- a/src/components/base/MInput/index.vue +++ b/src/components/base/MInput/index.vue @@ -33,6 +33,7 @@ const breviaryCount = computed(() => props.options.length - breviaryShowCount.va // 字典值输入框引用 // Dictionary value input box reference const inputRef = ref>() +const isComposing = ref(false); onMounted(() => { selectedObserver.value = new ResizeObserver(() => { @@ -49,6 +50,14 @@ onMounted(() => { } }) selectedObserver.value?.observe(selectedBoxRef.value) + + inputRef.value?.addEventListener('compositionstart', e => { + isComposing.value = true + }) + inputRef.value?.addEventListener('compositionend', e => { + isComposing.value = false + + }) }) onBeforeUnmount(() => { @@ -63,6 +72,15 @@ function handleInputClick() { function clearInput() { inputRef.value!.value = '' } + +function handleChange(e: Event) { + setTimeout(() => { + if (!isComposing.value) { + props.showDictItems((e.target as HTMLInputElement).value, props.filterItemIdx, e) + } + }, 0) + +} defineExpose({ inputRef, clearInput, @@ -95,10 +113,11 @@ defineExpose({
+ + @input="handleChange">