From b66c5fefc218acf9d81ba8211b57a762e28028c8 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 22 Oct 2024 17:56:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6):=20?= =?UTF-8?q?=E6=95=B0=E5=80=BC=E5=8C=BA=E9=97=B4=E5=BC=80=E5=90=AF=E5=BF=85?= =?UTF-8?q?=E5=A1=AB=E9=A1=B9=E5=B9=B6=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E4=BE=9D=E7=84=B6=E6=8F=90=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/custom-component/v-query/Component.vue | 14 ++++++++++++++ .../v-query/QueryConditionConfiguration.vue | 11 +++++++++++ .../src/custom-component/v-query/Tree.vue | 7 +++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/custom-component/v-query/Component.vue b/core/core-frontend/src/custom-component/v-query/Component.vue index f5d65e4d5e..2ec329205c 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -274,6 +274,13 @@ const queryDataForId = id => { ? next.name : '' } + } else if (next.displayType === '22') { + if ( + (next.numValueStart !== 0 && !next.numValueStart) || + (next.numValueEnd !== 0 && !next.numValueEnd) + ) { + requiredName = next.name + } } else if ( (Array.isArray(next.selectValue) && !next.selectValue.length) || (next.selectValue !== 0 && !next.selectValue) @@ -512,6 +519,13 @@ const queryData = () => { ? next.name : '' } + } else if (next.displayType === '22') { + if ( + (next.numValueEnd !== 0 && !next.numValueEnd) || + (next.numValueStart !== 0 && !next.numValueStart) + ) { + requiredName = next.name + } } else if ( (Array.isArray(next.selectValue) && !next.selectValue.length) || (next.selectValue !== 0 && !next.selectValue) diff --git a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue index 939f6f1942..542daa524d 100644 --- a/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue +++ b/core/core-frontend/src/custom-component/v-query/QueryConditionConfiguration.vue @@ -1253,6 +1253,17 @@ const validate = () => { return true } + if (ele.displayType === '22') { + if ( + (ele.defaultNumValueEnd !== 0 && !ele.defaultNumValueEnd) || + (ele.defaultNumValueStart !== 0 && !ele.defaultNumValueStart) + ) { + ElMessage.error('查询条件为必填项,默认值不能为空') + return true + } + return false + } + if ( (Array.isArray(ele.defaultValue) && !ele.defaultValue.length) || (ele.defaultValue !== 0 && !ele.defaultValue) diff --git a/core/core-frontend/src/custom-component/v-query/Tree.vue b/core/core-frontend/src/custom-component/v-query/Tree.vue index be9d89f5f3..77ffb8235a 100644 --- a/core/core-frontend/src/custom-component/v-query/Tree.vue +++ b/core/core-frontend/src/custom-component/v-query/Tree.vue @@ -59,7 +59,7 @@ const props = defineProps({ const placeholder: Ref = inject('placeholder') const placeholderText = computed(() => { if (placeholder.value.placeholderShow) { - return props.config.placeholder + return ['', undefined].includes(props.config.placeholder) ? ' ' : props.config.placeholder } return ' ' }) @@ -186,7 +186,8 @@ watch( ) let cacheId = '' let treeOptionList = shallowRef([]) - +const filterMethod = (value, data) => + (data.label ?? '').toLowerCase().includes((value ?? '').toLowerCase()) const dfs = arr => { return (arr || []).map(ele => { let children = [] @@ -243,6 +244,7 @@ const selectStyle = computed(() => { showBtn :placeholder="placeholderText" collapse-tags + :filter-node-method="filterMethod" :showWholePath="showWholePath" collapse-tags-tooltip key="multipleTree" @@ -256,6 +258,7 @@ const selectStyle = computed(() => { :data="treeOptionList" check-strictly clearable + :filter-node-method="filterMethod" :placeholder="placeholderText" :render-after-expand="false" v-else-if="!multiple && !loading"