From 09050c2958f504ede3c43052aeff39468e69ac03 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 8 Oct 2024 10:16:05 +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 | 4 -- .../src/custom-component/v-query/Select.vue | 3 +- .../src/custom-component/v-query/Time.vue | 3 +- .../src/custom-component/v-query/Tree.vue | 3 +- .../modules/data-visualization/dvMain.ts | 1 - .../editor/editor-style/VQueryChartStyle.vue | 60 +++++++++++++++---- 6 files changed, 53 insertions(+), 21 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 234e3ee497..10170dc402 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -65,7 +65,6 @@ const canEdit = ref(false) const queryConfig = ref() const defaultStyle = { border: '', - placeholder: '请选择', placeholderSize: 14, placeholderShow: true, background: '', @@ -168,7 +167,6 @@ const setCustomStyle = val => { queryConditionSpacing, labelColorBtn, btnColor, - placeholder, placeholderSize, placeholderShow, labelShow @@ -185,7 +183,6 @@ const setCustomStyle = val => { `${customStyle.placeholderSize + 18}px` ) }) - customStyle.placeholder = placeholder ?? '请选择' customStyle.titleShow = titleShow customStyle.titleColor = titleColor customStyle.labelColor = labelShow ? labelColor || '' : '' @@ -310,7 +307,6 @@ const getCascadeList = () => { const getPlaceholder = computed(() => { return { - placeholder: customStyle.placeholder, placeholderShow: customStyle.placeholderShow } }) 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 f4bd4a34e5..35722c1edc 100644 --- a/core/core-frontend/src/custom-component/v-query/Select.vue +++ b/core/core-frontend/src/custom-component/v-query/Select.vue @@ -25,6 +25,7 @@ interface SelectConfig { displayType: string showEmpty: boolean id: string + placeholder: string resultMode: number displayId: string sort: string @@ -83,7 +84,7 @@ const setCascadeDefault = inject('set-cascade-default', Function, true) const placeholderText = computed(() => { if (placeholder.value.placeholderShow) { - return placeholder.value.placeholder + return props.config.placeholder } return ' ' }) diff --git a/core/core-frontend/src/custom-component/v-query/Time.vue b/core/core-frontend/src/custom-component/v-query/Time.vue index a58f6274e2..403b54a9fc 100644 --- a/core/core-frontend/src/custom-component/v-query/Time.vue +++ b/core/core-frontend/src/custom-component/v-query/Time.vue @@ -25,6 +25,7 @@ interface SelectConfig { timeGranularity: DatePickType timeGranularityMultiple: DatePickType timeRange: TimeRange + placeholder: string setTimeRange: boolean } @@ -65,7 +66,7 @@ const props = defineProps({ const placeholder: Ref = inject('placeholder') const placeholderText = computed(() => { if (placeholder.value.placeholderShow) { - return placeholder.value.placeholder + return props.config.placeholder } return ' ' }) 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 22e6c68aaf..be9d89f5f3 100644 --- a/core/core-frontend/src/custom-component/v-query/Tree.vue +++ b/core/core-frontend/src/custom-component/v-query/Tree.vue @@ -21,6 +21,7 @@ interface SelectConfig { checkedFieldsMap: object displayType: string id: string + placeholder: string checkedFields: string[] treeFieldList: Array dataset: { @@ -58,7 +59,7 @@ const props = defineProps({ const placeholder: Ref = inject('placeholder') const placeholderText = computed(() => { if (placeholder.value.placeholderShow) { - return placeholder.value.placeholder + return props.config.placeholder } return ' ' }) diff --git a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts index c2bcea53b4..778f9eea0c 100644 --- a/core/core-frontend/src/store/modules/data-visualization/dvMain.ts +++ b/core/core-frontend/src/store/modules/data-visualization/dvMain.ts @@ -482,7 +482,6 @@ export const dvMainStore = defineStore('dataVisualization', { fontStyleBtn: '', queryConditionWidth: 227, nameboxSpacing: 8, - placeholder: '请选择', placeholderShow: true, placeholderSize: 14, queryConditionSpacing: 16, diff --git a/core/core-frontend/src/views/chart/components/editor/editor-style/VQueryChartStyle.vue b/core/core-frontend/src/views/chart/components/editor/editor-style/VQueryChartStyle.vue index e7ce985f10..6e9cc9f1d3 100644 --- a/core/core-frontend/src/views/chart/components/editor/editor-style/VQueryChartStyle.vue +++ b/core/core-frontend/src/views/chart/components/editor/editor-style/VQueryChartStyle.vue @@ -61,6 +61,23 @@ watch( } ) +const currentPlaceholder = ref() +const currentSearch = ref({ + placeholder: '' +}) + +const handleCurrentPlaceholder = val => { + const obj = props.element.propValue.find(ele => { + return ele.id === val + }) || { + placeholder: '' + } + if (obj.placeholder === undefined) { + obj.placeholder = '' + } + currentSearch.value = obj +} + const init = () => { state.commonBackground = cloneDeep(props.commonBackgroundPop) if (state.commonBackground['outerImage']) { @@ -142,10 +159,13 @@ if (!chart.value.customStyle.component.hasOwnProperty('placeholderShow')) { chart.value.customStyle.component = { ...chart.value.customStyle.component, placeholderShow: true, - placeholder: '请选择', placeholderSize: 14 } } + +if (props.element.propValue.length) { + handleCurrentPlaceholder(props.element.propValue[0].id) +}