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'