From 41125192fb5b8923c02995c378d361514d9ca0c4 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 26 Sep 2024 15:28:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6):=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=20placeholder=20=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=20#11881?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom-component/v-query/Component.vue | 17 ++++++++++-- .../src/custom-component/v-query/Select.vue | 9 +++++++ .../custom-component/v-query/TextSearch.vue | 12 ++++++++- .../src/custom-component/v-query/Time.vue | 15 ++++++++--- .../src/custom-component/v-query/Tree.vue | 12 +++++++++ .../modules/data-visualization/dvMain.ts | 2 ++ .../editor/editor-style/VQueryChartStyle.vue | 27 ++++++++++++++++--- 7 files changed, 84 insertions(+), 10 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 c95240831a..ad74d6b265 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -63,6 +63,8 @@ const canEdit = ref(false) const queryConfig = ref() const defaultStyle = { border: '', + placeholder: '请选择', + placeholderShow: true, background: '', text: '', layout: 'horizontal', @@ -151,7 +153,6 @@ const setCustomStyle = val => { layout, titleShow, titleColor, - textColorShow, title, fontSize, fontWeight, @@ -164,12 +165,16 @@ const setCustomStyle = val => { queryConditionSpacing, labelColorBtn, btnColor, + placeholder, + placeholderShow, labelShow } = val customStyle.background = bgColorShow ? bgColor || '' : '' customStyle.border = borderShow ? borderColor || '' : '' customStyle.btnList = [...btnList] customStyle.layout = layout + customStyle.placeholderShow = placeholderShow ?? true + customStyle.placeholder = placeholder ?? '请选择' customStyle.titleShow = titleShow customStyle.titleColor = titleColor customStyle.labelColor = labelShow ? labelColor || '' : '' @@ -177,7 +182,7 @@ const setCustomStyle = val => { customStyle.fontWeight = labelShow ? fontWeight || '' : '' customStyle.fontStyle = labelShow ? fontStyle || '' : '' customStyle.title = title - customStyle.text = textColorShow ? text || '' : '' + customStyle.text = customStyle.placeholderShow ? text || '' : '' customStyle.titleLayout = titleLayout customStyle.fontSizeBtn = fontSizeBtn || '14' customStyle.fontWeightBtn = fontWeightBtn @@ -292,6 +297,13 @@ const getCascadeList = () => { return props.element.cascade } +const getPlaceholder = computed(() => { + return { + placeholder: customStyle.placeholder, + placeholderShow: customStyle.placeholderShow + } +}) + const isConfirmSearch = id => { if (componentWithSure.value) return queryDataForId(id) @@ -303,6 +315,7 @@ provide('release-unmount-select', releaseSelect) provide('query-data-for-id', queryDataForId) provide('com-width', getQueryConditionWidth) provide('cascade-list', getCascadeList) +provide('placeholder', getPlaceholder) onBeforeUnmount(() => { emitter.off(`addQueryCriteria${element.value.id}`) 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 b031cdb7c6..f4bd4a34e5 100644 --- a/core/core-frontend/src/custom-component/v-query/Select.vue +++ b/core/core-frontend/src/custom-component/v-query/Select.vue @@ -73,6 +73,7 @@ const loading = ref(false) const multiple = ref(false) const options = shallowRef([]) const unMountSelect: Ref = inject('unmount-select') +const placeholder: Ref = inject('placeholder') 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) @@ -80,6 +81,12 @@ const queryConditionWidth = inject('com-width', Function, true) const cascadeList = inject('cascade-list', Function, true) const setCascadeDefault = inject('set-cascade-default', Function, true) +const placeholderText = computed(() => { + if (placeholder.value.placeholderShow) { + return placeholder.value.placeholder + } + return ' ' +}) const cascade = computed(() => { return cascadeList() || [] }) @@ -583,6 +590,7 @@ defineExpose({ key="multiple" ref="mult" v-model="selectValue" + :placeholder="placeholderText" v-loading="loading" filterable @change="handleValueChange" @@ -604,6 +612,7 @@ defineExpose({ v-else v-model="selectValue" key="single" + :placeholder="placeholderText" v-loading="loading" @change="handleValueChange" clearable 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 5a6e1c706f..b058bafc0b 100644 --- a/core/core-frontend/src/custom-component/v-query/TextSearch.vue +++ b/core/core-frontend/src/custom-component/v-query/TextSearch.vue @@ -1,5 +1,5 @@