forked from github/dataease
feat(查询组件): 过滤组件优化 #11696
This commit is contained in:
parent
8d86317391
commit
9e652696d2
@ -18,7 +18,8 @@ import {
|
|||||||
onBeforeMount,
|
onBeforeMount,
|
||||||
CSSProperties,
|
CSSProperties,
|
||||||
shallowRef,
|
shallowRef,
|
||||||
provide
|
provide,
|
||||||
|
nextTick
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
@ -57,6 +58,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
const { element, view, scale } = toRefs(props)
|
const { element, view, scale } = toRefs(props)
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
const vQueryRef = ref()
|
||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { curComponent, canvasViewInfo, mobileInPc, firstLoadMap } = storeToRefs(dvMainStore)
|
const { curComponent, canvasViewInfo, mobileInPc, firstLoadMap } = storeToRefs(dvMainStore)
|
||||||
const canEdit = ref(false)
|
const canEdit = ref(false)
|
||||||
@ -64,6 +66,7 @@ const queryConfig = ref()
|
|||||||
const defaultStyle = {
|
const defaultStyle = {
|
||||||
border: '',
|
border: '',
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
|
placeholderSize: 14,
|
||||||
placeholderShow: true,
|
placeholderShow: true,
|
||||||
background: '',
|
background: '',
|
||||||
text: '',
|
text: '',
|
||||||
@ -166,6 +169,7 @@ const setCustomStyle = val => {
|
|||||||
labelColorBtn,
|
labelColorBtn,
|
||||||
btnColor,
|
btnColor,
|
||||||
placeholder,
|
placeholder,
|
||||||
|
placeholderSize,
|
||||||
placeholderShow,
|
placeholderShow,
|
||||||
labelShow
|
labelShow
|
||||||
} = val
|
} = val
|
||||||
@ -174,6 +178,14 @@ const setCustomStyle = val => {
|
|||||||
customStyle.btnList = [...btnList]
|
customStyle.btnList = [...btnList]
|
||||||
customStyle.layout = layout
|
customStyle.layout = layout
|
||||||
customStyle.placeholderShow = placeholderShow ?? true
|
customStyle.placeholderShow = placeholderShow ?? true
|
||||||
|
customStyle.placeholderSize = placeholderSize ?? 14
|
||||||
|
nextTick(() => {
|
||||||
|
vQueryRef.value.style.setProperty('--ed-font-size-base', `${customStyle.placeholderSize}px`)
|
||||||
|
vQueryRef.value.style.setProperty(
|
||||||
|
'--ed-component-size',
|
||||||
|
`${customStyle.placeholderSize + 18}px`
|
||||||
|
)
|
||||||
|
})
|
||||||
customStyle.placeholder = placeholder ?? '请选择'
|
customStyle.placeholder = placeholder ?? '请选择'
|
||||||
customStyle.titleShow = titleShow
|
customStyle.titleShow = titleShow
|
||||||
customStyle.titleColor = titleColor
|
customStyle.titleColor = titleColor
|
||||||
@ -577,7 +589,7 @@ const autoStyle = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="v-query-container" :style="autoStyle" @keydown.stop @keyup.stop>
|
<div class="v-query-container" ref="vQueryRef" :style="autoStyle" @keydown.stop @keyup.stop>
|
||||||
<p v-if="customStyle.titleShow" class="title" :style="titleStyle">
|
<p v-if="customStyle.titleShow" class="title" :style="titleStyle">
|
||||||
{{ customStyle.title }}
|
{{ customStyle.title }}
|
||||||
</p>
|
</p>
|
||||||
@ -697,6 +709,7 @@ const autoStyle = computed(() => {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
--ed-font-size-base: 14px;
|
||||||
|
|
||||||
.no-list-label {
|
.no-list-label {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -484,6 +484,7 @@ export const dvMainStore = defineStore('dataVisualization', {
|
|||||||
nameboxSpacing: 8,
|
nameboxSpacing: 8,
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
placeholderShow: true,
|
placeholderShow: true,
|
||||||
|
placeholderSize: 14,
|
||||||
queryConditionSpacing: 16,
|
queryConditionSpacing: 16,
|
||||||
labelColorBtn: '#ffffff',
|
labelColorBtn: '#ffffff',
|
||||||
btnColor: '#3370ff'
|
btnColor: '#3370ff'
|
||||||
|
@ -74,7 +74,8 @@ if (!chart.value.customStyle.component.hasOwnProperty('placeholderShow')) {
|
|||||||
chart.value.customStyle.component = {
|
chart.value.customStyle.component = {
|
||||||
...chart.value.customStyle.component,
|
...chart.value.customStyle.component,
|
||||||
placeholderShow: true,
|
placeholderShow: true,
|
||||||
placeholder: '请选择'
|
placeholder: '请选择',
|
||||||
|
placeholderSize: 14
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -192,19 +193,30 @@ if (!chart.value.customStyle.component.hasOwnProperty('placeholderShow')) {
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="提示词颜色"
|
label="文本"
|
||||||
class="form-item"
|
class="form-item"
|
||||||
style="padding-left: 20px"
|
style="padding-left: 20px"
|
||||||
:class="'form-item-' + themes"
|
:class="'form-item-' + themes"
|
||||||
>
|
>
|
||||||
<el-color-picker
|
<div style="display: flex; align-items: center; width: 100%">
|
||||||
:effect="themes"
|
<el-color-picker
|
||||||
:trigger-width="108"
|
:effect="themes"
|
||||||
is-custom
|
:trigger-width="56"
|
||||||
v-model="chart.customStyle.component.text"
|
is-custom
|
||||||
:disabled="!chart.customStyle.component.placeholderShow"
|
v-model="chart.customStyle.component.text"
|
||||||
:predefine="predefineColors"
|
:disabled="!chart.customStyle.component.placeholderShow"
|
||||||
/>
|
:predefine="predefineColors"
|
||||||
|
/>
|
||||||
|
<el-input-number
|
||||||
|
v-model="chart.customStyle.component.placeholderSize"
|
||||||
|
:min="10"
|
||||||
|
:max="20"
|
||||||
|
style="margin-left: 8px"
|
||||||
|
step-strictly
|
||||||
|
:effect="themes"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="form-item margin-bottom-8" :class="'form-item-' + themes">
|
<el-form-item class="form-item margin-bottom-8" :class="'form-item-' + themes">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
|
Loading…
Reference in New Issue
Block a user