From c8c6fd2ce2226be15f793b97c186f4d12369e4fd Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 28 Feb 2024 18:12:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=20=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E5=8D=A1/=E6=96=87=E6=9C=AC=E5=8D=A1=E5=9C=A8=E9=9D=9E?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=8A=B6=E6=80=81=E4=B8=8B=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E5=B9=B6=E5=A4=8D=E5=88=B6=E5=86=85=E5=AE=B9?= =?UTF-8?q?=20#7726?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/editor/ComponentWrapper.vue | 8 +++++++- .../canvas/customComponent/UserView.vue | 4 +++- .../views/chart/components/normal/LabelNormal.vue | 15 +++++++++++++-- .../chart/components/normal/LabelNormalText.vue | 15 +++++++++++++-- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/core/frontend/src/components/canvas/components/editor/ComponentWrapper.vue b/core/frontend/src/components/canvas/components/editor/ComponentWrapper.vue index fe3cae66e6..fa096cd0f8 100644 --- a/core/frontend/src/components/canvas/components/editor/ComponentWrapper.vue +++ b/core/frontend/src/components/canvas/components/editor/ComponentWrapper.vue @@ -332,7 +332,13 @@ export default { elementMouseDown(e) { // // private 设置当前组件数据及状态 this.$store.commit('setClickComponentStatus', true) - if (this.config.component !== 'v-text' && this.config.component !== 'rect-shape' && this.config.component !== 'de-input-search' && this.config.component !== 'de-select-grid' && this.config.component !== 'de-number-range' && this.config.component !== 'de-date') { + if (this.config.component !== 'v-text' && + this.config.component !== 'rect-shape' && + this.config.component !== 'de-input-search' && + this.config.component !== 'de-select-grid' && + this.config.component !== 'de-number-range' && + this.config.component !== 'de-date' && + (this.config.component === 'user-view' && !['label', 'text'].includes(this.config.propValue?.innerType))) { e.preventDefault() } // 阻止冒泡事件 diff --git a/core/frontend/src/components/canvas/customComponent/UserView.vue b/core/frontend/src/components/canvas/customComponent/UserView.vue index d02def0477..c7ed1be4c5 100644 --- a/core/frontend/src/components/canvas/customComponent/UserView.vue +++ b/core/frontend/src/components/canvas/customComponent/UserView.vue @@ -120,15 +120,17 @@ v-else-if="labelShowFlag" :ref="element.propValue.id" :chart="chart" + :in-screen="inScreen" class="table-class" /> diff --git a/core/frontend/src/views/chart/components/normal/LabelNormal.vue b/core/frontend/src/views/chart/components/normal/LabelNormal.vue index 7d356bcad9..14028123e4 100644 --- a/core/frontend/src/views/chart/components/normal/LabelNormal.vue +++ b/core/frontend/src/views/chart/components/normal/LabelNormal.vue @@ -54,6 +54,7 @@ import { formatterItem, valueFormatter } from '@/views/chart/chart/formatter' import TitleRemark from '@/views/chart/view/TitleRemark' import { CHART_CONT_FAMILY_MAP, DEFAULT_COLOR_CASE, DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' import ChartTitleUpdate from '../ChartTitleUpdate.vue' +import { mapState } from 'vuex' export default { name: 'LabelNormal', @@ -69,6 +70,10 @@ export default { default: function() { return {} } + }, + inScreen: { + type: Boolean, + default: false } }, data() { @@ -92,7 +97,8 @@ export default { flexDirection: 'column', alignItems: 'center', justifyContent: 'center', - height: 'auto' + height: 'auto', + userSelect: 'none' }, label_class: { margin: 0 @@ -124,7 +130,9 @@ export default { chartInfo() { const { id, title } = this.chart return { id, title } - } + }, + ...mapState(['editMode']), + ...mapState('panel', ['mainActiveName']) }, watch: { chart() { @@ -203,6 +211,9 @@ export default { this.content_class.alignItems = customAttr.size.hPosition ? customAttr.size.hPosition : DEFAULT_SIZE.hPosition this.content_class.justifyContent = customAttr.size.vPosition ? customAttr.size.vPosition : DEFAULT_SIZE.vPosition + if (!this.inScreen || this.editMode === 'preview' || this.mainActiveName === 'PanelMain') { + this.content_class.userSelect = 'text' + } this.suffix = customAttr.size.quotaSuffix if (this.suffix) { this.label_suffix_class.fontSize = (customAttr.size.quotaSuffixFontSize ?? DEFAULT_SIZE.quotaSuffixFontSize) + 'px' diff --git a/core/frontend/src/views/chart/components/normal/LabelNormalText.vue b/core/frontend/src/views/chart/components/normal/LabelNormalText.vue index ded7de5146..55b3357687 100644 --- a/core/frontend/src/views/chart/components/normal/LabelNormalText.vue +++ b/core/frontend/src/views/chart/components/normal/LabelNormalText.vue @@ -63,6 +63,7 @@ import ViewTrackBar from '@/components/canvas/components/editor/ViewTrackBar' import TitleRemark from '@/views/chart/view/TitleRemark' import { CHART_CONT_FAMILY_MAP, DEFAULT_SIZE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' import ChartTitleUpdate from '../ChartTitleUpdate.vue' +import { mapState } from 'vuex' export default { name: 'LabelNormalText', @@ -85,6 +86,10 @@ export default { default: function() { return [] } + }, + inScreen: { + type: Boolean, + default: false } }, data() { @@ -108,7 +113,8 @@ export default { flexDirection: 'column', alignItems: 'center', justifyContent: 'center', - height: 'auto' + height: 'auto', + userSelect: 'none' }, label_class: { margin: 0 @@ -145,7 +151,9 @@ export default { chartInfo() { const { id, title } = this.chart return { id, title } - } + }, + ...mapState(['editMode']), + ...mapState('panel', ['mainActiveName']) }, watch: { chart() { @@ -220,6 +228,9 @@ export default { this.content_class.alignItems = customAttr.size.hPosition ? customAttr.size.hPosition : DEFAULT_SIZE.hPosition this.content_class.justifyContent = customAttr.size.vPosition ? customAttr.size.vPosition : DEFAULT_SIZE.vPosition + if (!this.inScreen || this.editMode === 'preview' || this.mainActiveName === 'PanelMain') { + this.content_class.userSelect = 'text' + } if (!this.dimensionShow) { this.label_space.marginTop = '0px'