From 215ba53ade8a9f83339d406cd8a9a3e194462a8f Mon Sep 17 00:00:00 2001 From: dataeaseShu <106045316+dataeaseShu@users.noreply.github.com> Date: Wed, 2 Nov 2022 14:28:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E5=9B=BEtitle=E7=9B=B8?= =?UTF-8?q?=E5=85=B3bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/deCustomCm/deBtn.vue | 1 + .../chart/components/ChartComponentG2.vue | 5 +- .../chart/components/ChartComponentS2.vue | 5 +- .../chart/components/ChartTitleUpdate.vue | 124 ++++++++++++------ .../chart/components/normal/LabelNormal.vue | 5 +- .../components/normal/LabelNormalText.vue | 5 +- frontend/src/views/chart/view/ChartEdit.vue | 10 +- .../views/dataset/common/DatasetDetail.vue | 4 +- .../src/views/dataset/data/TabDataPreview.vue | 1 + frontend/src/views/dataset/data/ViewTable.vue | 6 + frontend/src/views/system/log/FilterUser.vue | 13 +- 11 files changed, 124 insertions(+), 55 deletions(-) diff --git a/frontend/src/components/deCustomCm/deBtn.vue b/frontend/src/components/deCustomCm/deBtn.vue index f950e9f85d..55df2934bb 100644 --- a/frontend/src/components/deCustomCm/deBtn.vue +++ b/frontend/src/components/deCustomCm/deBtn.vue @@ -1,6 +1,7 @@ @@ -32,13 +48,18 @@ export default { chartInfo: { type: Object, default: () => {} + }, + titleClass: { + type: Object, + default: () => {} } }, data() { return { chartTitleEditer: false, chartTitleUpdate: '', - chart: {} + chart: {}, + showClose: false } }, computed: { @@ -48,6 +69,10 @@ export default { ...mapState(['mobileLayoutStatus', 'previewVisible']), panelInfo() { return this.$store.state.panel.panelInfo + }, + inputStyle() { + const { fontSize, color, fontWeight, fontStyle, fontFamily } = this.titleClass + return { fontSize, color, fontWeight, fontStyle, fontFamily, height: fontSize } } }, watch: { @@ -58,6 +83,9 @@ export default { }, immediate: true, deep: true + }, + chartTitleUpdate(val) { + this.showClose = !!val } }, methods: { @@ -274,13 +302,17 @@ export default { }, lostFocus() { this.chartTitleEditer = false + this.showClose = false }, handleTitleEditer() { if ( this.mainActiveName !== 'PanelEdit' || this.mobileLayoutStatus || this.previewVisible - ) { return } + ) { + return + } + this.showClose = true this.chartTitleEditer = true this.chartTitleUpdate = this.chart.title this.$nextTick(() => { @@ -322,15 +354,38 @@ export default { ? JSON.parse(chartView.customFilter) : {} chartView.senior = chartView.senior ? JSON.parse(chartView.senior) : {} + chartView.customStyle.text.title = this.chartTitleUpdate + + this.$store.commit('recordViewEdit', { + viewId: this.chart.id, + hasEdit: true + }) + const view = JSON.parse(JSON.stringify(chartView)) + view.xaxis = JSON.stringify(chartView.xaxis) + view.viewFields = JSON.stringify(chartView.viewFields) + view.xaxisExt = JSON.stringify(chartView.xaxisExt) + view.yaxis = JSON.stringify(chartView.yaxis) + view.yaxisExt = JSON.stringify(chartView.yaxisExt) + view.extStack = JSON.stringify(chartView.extStack) + view.drillFields = JSON.stringify(chartView.drillFields) + view.extBubble = JSON.stringify(chartView.extBubble) + view.customAttr = JSON.stringify(chartView.customAttr) + view.customStyle = JSON.stringify(chartView.customStyle) + view.customFilter = JSON.stringify(chartView.customFilter) + view.senior = JSON.stringify(chartView.senior) + view.title = this.chartTitleUpdate + view.name = this.chartTitleUpdate + view.stylePriority = chartView.stylePriority const viewSave = this.buildParam(chartView, true, 'chart', false, false) if (!viewSave) return viewEditSave(this.panelInfo.id, viewSave).then(() => { this.chart.title = this.chartTitleUpdate bus.$emit('aside-set-title', this.chart.title) }) - this.$store.commit('recordViewEdit', { - viewId: this.chart.id, - hasEdit: true + bus.$emit('view-in-cache', { + type: 'styleChange', + viewId: chartView.id, + viewInfo: view }) }) } @@ -339,7 +394,17 @@ export default { diff --git a/frontend/src/views/chart/components/normal/LabelNormal.vue b/frontend/src/views/chart/components/normal/LabelNormal.vue index 0ebe162b6a..08881845ae 100644 --- a/frontend/src/views/chart/components/normal/LabelNormal.vue +++ b/frontend/src/views/chart/components/normal/LabelNormal.vue @@ -11,7 +11,10 @@ style="cursor: default;display: block;" >
- +
- + {{ table.name }} @@ -396,6 +397,11 @@ export default { font-weight: 500; margin-right: 8px; color: var(--deTextPrimary, #1f2329); + display: inline-block; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + max-width: 50%; } .de-tag { diff --git a/frontend/src/views/system/log/FilterUser.vue b/frontend/src/views/system/log/FilterUser.vue index 512098c640..494e64d8b6 100644 --- a/frontend/src/views/system/log/FilterUser.vue +++ b/frontend/src/views/system/log/FilterUser.vue @@ -67,20 +67,19 @@
-
- + {{ $t("commons.reset") - }} - + {{ $t("commons.adv_search.search") - }} + }}