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 a036a0bfef..4c60c55fce 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -228,7 +228,17 @@ const queryDataForId = id => { requiredName = next.name } - if ( + if (next.displayType === '8') { + const { conditionValueF, conditionValueS, conditionType } = next + if (conditionType === 0) { + requiredName = conditionValueF === '' ? next.name : '' + } else { + requiredName = [conditionValueF || '', conditionValueS || ''].filter(ele => ele !== '') + .length + ? next.name + : '' + } + } else if ( (Array.isArray(next.selectValue) && !next.selectValue.length) || (next.selectValue !== 0 && !next.selectValue) ) { @@ -258,6 +268,13 @@ const getQueryConditionWidth = () => { const getCascadeList = () => { return props.element.cascade } + +const isConfirmSearch = id => { + if (componentWithSure.value) return + queryDataForId(id) +} + +provide('is-confirm-search', isConfirmSearch) provide('unmount-select', unMountSelect) provide('release-unmount-select', releaseSelect) provide('query-data-for-id', queryDataForId) @@ -415,6 +432,22 @@ const listVisible = computed(() => { return list.value.filter(itx => itx.visible) }) +const componentWithSure = computed(() => { + return customStyle.btnList.includes('sure') +}) + +watch( + () => componentWithSure.value, + (val, oldVal) => { + if (!val && oldVal) { + queryData() + } + }, + { + immediate: false + } +) + const queryData = () => { let requiredName = '' const emitterList = (element.value.propValue || []).reduce((pre, next) => { @@ -574,7 +607,7 @@ const autoStyle = computed(() => { @click.stop="queryData" style="margin-right: 7px" :style="btnStyle" - v-if="customStyle.btnList.includes('sure')" + v-if="componentWithSure" type="primary" > {{ t('commons.adv_search.search') }} diff --git a/core/core-frontend/src/custom-component/v-query/Select.vue b/core/core-frontend/src/custom-component/v-query/Select.vue index f0728dfaf8..34052b285f 100644 --- a/core/core-frontend/src/custom-component/v-query/Select.vue +++ b/core/core-frontend/src/custom-component/v-query/Select.vue @@ -75,6 +75,7 @@ const options = shallowRef([]) const unMountSelect: Ref = inject('unmount-select') const releaseSelect = inject('release-unmount-select', Function, true) const queryDataForId = inject('query-data-for-id', Function, true) +const isConfirmSearch = inject('is-confirm-search', Function, true) const queryConditionWidth = inject('com-width', Function, true) const cascadeList = inject('cascade-list', Function, true) const setCascadeDefault = inject('set-cascade-default', Function, true) @@ -198,6 +199,9 @@ const handleValueChange = () => { ) setCascadeValueBack(config.value.mapValue) emitCascade() + nextTick(() => { + isConfirmSearch(config.value.id) + }) return } diff --git a/core/core-frontend/src/custom-component/v-query/TextSearch.vue b/core/core-frontend/src/custom-component/v-query/TextSearch.vue index fc21e05582..3f448c0d22 100644 --- a/core/core-frontend/src/custom-component/v-query/TextSearch.vue +++ b/core/core-frontend/src/custom-component/v-query/TextSearch.vue @@ -1,8 +1,9 @@