From 40c26e6d529ea6752f36699f9c6fd2c844eec640 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Thu, 13 Jun 2024 16:11:00 +0800 Subject: [PATCH] =?UTF-8?q?fix(=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=E6=94=AF=E6=8C=81=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=92=8C=E7=BB=84=E4=BB=B6=E9=97=B4=E8=B7=9D=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/package.json | 2 +- .../custom-component/v-query/Component.vue | 72 ++++++++---- .../src/custom-component/v-query/Select.vue | 4 +- .../custom-component/v-query/TextSearch.vue | 31 ++++-- .../src/custom-component/v-query/Time.vue | 105 ++---------------- .../modules/data-visualization/dvMain.ts | 1 - core/core-frontend/src/utils/canvasStyle.ts | 2 +- .../editor/editor-style/VQueryChartStyle.vue | 17 +++ .../views/components/ChartComponentS2.vue | 4 +- 9 files changed, 104 insertions(+), 134 deletions(-) diff --git a/core/core-frontend/package.json b/core/core-frontend/package.json index 57f0d3e610..b70396c3a4 100644 --- a/core/core-frontend/package.json +++ b/core/core-frontend/package.json @@ -27,7 +27,7 @@ "axios": "^1.3.3", "crypto-js": "^4.1.1", "dayjs": "^1.11.9", - "element-plus-secondary": "^0.5.10", + "element-plus-secondary": "^0.5.11", "element-resize-detector": "^1.2.4", "file-saver": "^2.0.5", "flv.js": "^1.6.2", 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 32d255d686..752f4c532c 100644 --- a/core/core-frontend/src/custom-component/v-query/Component.vue +++ b/core/core-frontend/src/custom-component/v-query/Component.vue @@ -24,7 +24,6 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { comInfo } from './com-info' import { useEmitt } from '@/hooks/web/useEmitt' import StyleInject from './StyleInject.vue' -import { backgroundSize } from 'html2canvas/dist/types/css/property-descriptors/background-size' const props = defineProps({ view: { type: Object, @@ -72,7 +71,6 @@ const defaultStyle = { textColorShow: false, bgColorShow: false, borderShow: false, - labelColorShow: false, labelShow: true, title: '', labelColor: '#1f2329', @@ -91,6 +89,26 @@ const defaultStyle = { const customStyle = reactive({ ...defaultStyle }) const snapshotStore = snapshotStoreWithOut() +const btnStyle = computed(() => { + const style = { + backgroundColor: customStyle.btnColor, + borderColor: customStyle.btnColor, + color: customStyle.labelColorBtn + } as CSSProperties + if (customStyle.fontSizeBtn) { + style.fontSize = customStyle.fontSizeBtn + 'px' + } + + if (customStyle.fontWeightBtn) { + style.fontWeight = customStyle.fontWeightBtn + } + + if (customStyle.fontStyleBtn) { + style.fontStyle = customStyle.fontStyleBtn + } + + return style +}) const curComponentView = computed(() => { return (canvasViewInfo.value[element.value.id] || {}).customStyle }) @@ -141,11 +159,11 @@ const setCustomStyle = val => { customStyle.fontSizeBtn = fontSizeBtn || '14' customStyle.fontWeightBtn = fontWeightBtn customStyle.fontStyleBtn = fontStyleBtn - customStyle.queryConditionWidth = queryConditionWidth || 227 - customStyle.nameboxSpacing = nameboxSpacing || 8 - customStyle.queryConditionSpacing = queryConditionSpacing || 16 + customStyle.queryConditionWidth = queryConditionWidth ?? 227 + customStyle.nameboxSpacing = nameboxSpacing ?? 8 + customStyle.queryConditionSpacing = queryConditionSpacing ?? 16 customStyle.labelColorBtn = labelColorBtn || '#ffffff' - customStyle.labelShow = labelShow || true + customStyle.labelShow = labelShow ?? true customStyle.btnColor = btnColor || '#3370ff' } @@ -232,10 +250,14 @@ const queryDataForId = id => { emitter.emit(`query-data-${ele}`) }) } - +const getQueryConditionWidth = () => { + return customStyle.queryConditionWidth +} provide('unmount-select', unMountSelect) provide('release-unmount-select', releaseSelect) provide('query-data-for-id', queryDataForId) +provide('com-width', getQueryConditionWidth) + onBeforeUnmount(() => { emitter.off(`addQueryCriteria${element.value.id}`) emitter.off(`editQueryCriteria${element.value.id}`) @@ -420,9 +442,21 @@ const titleStyle = computed(() => { }) const labelStyle = computed(() => { - return { - color: customStyle.labelColor || '#1f2329' + const style = { + fontSize: customStyle.fontSize + 'px' } as CSSProperties + if (customStyle.fontWeight) { + style.fontWeight = customStyle.fontWeight + } + + if (customStyle.fontStyle) { + style.fontStyle = customStyle.fontStyle + } + + if (customStyle.labelColor) { + style.color = customStyle.labelColor + } + return style }) const autoStyle = computed(() => { return { @@ -464,9 +498,14 @@ const autoStyle = computed(() => {
-
+
-
+
@@ -506,11 +545,7 @@ const autoStyle = computed(() => { @@ -655,15 +690,10 @@ const autoStyle = computed(() => { position: relative; :deep(.ed-date-editor) { - width: 227px; .ed-input__wrapper { width: 100%; } } - - :deep(.ed-select-v2) { - min-width: 170px; - } } } } 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 4cea917edd..e36e79f6ad 100644 --- a/core/core-frontend/src/custom-component/v-query/Select.vue +++ b/core/core-frontend/src/custom-component/v-query/Select.vue @@ -69,6 +69,8 @@ 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 queryConditionWidth = inject('com-width', Function, true) + const setDefaultMapValue = arr => { const { displayId, field } = config.value if (!displayId) { @@ -444,7 +446,7 @@ const init = () => { } const selectStyle = computed(() => { - return props.isConfig ? {} : { width: '227px' } + return props.isConfig ? {} : { width: queryConditionWidth() + 'px' } }) const mult = ref() 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 d14d0c6645..fc21e05582 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 @@ @@ -150,12 +166,7 @@ const customStyle = inject<{ background: string }>('$custom-style-filter') position: absolute; right: 5px; bottom: 3px; - width: 195px; z-index: 10; - - &.next-line { - width: 195px; - } } } } 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 f3003a3eb1..7d6c764299 100644 --- a/core/core-frontend/src/custom-component/v-query/Time.vue +++ b/core/core-frontend/src/custom-component/v-query/Time.vue @@ -1,5 +1,5 @@