From 0fecbfe2057119d996098b801d4cd992387e6fde Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 29 Jun 2022 16:46:11 +0800 Subject: [PATCH 01/18] =?UTF-8?q?fix:=20=E4=B8=8B=E6=8B=89=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8D=A1=E5=85=B6=E8=99=9A=E6=8B=9F=E5=8C=96=E5=90=8E?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1=E9=80=89=E6=8B=A9=E5=87=BA=E7=8E=B0=E7=A9=BA?= =?UTF-8?q?=E7=99=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/ElVisualSelect/index.vue | 10 +++++++--- frontend/src/components/widget/DeWidget/DeSelect.vue | 9 ++++++++- frontend/src/utils/index.js | 8 ++++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/ElVisualSelect/index.vue b/frontend/src/components/ElVisualSelect/index.vue index 3799166a96..e97ac20409 100644 --- a/frontend/src/components/ElVisualSelect/index.vue +++ b/frontend/src/components/ElVisualSelect/index.vue @@ -69,12 +69,16 @@ export default { }, list() { this.resetList() - this.init() + this.$nextTick(() => { + this.init() + }) } }, mounted() { this.resetList() - this.init() + this.$nextTick(() => { + this.init() + }) }, methods: { addScrollDiv(selectDom) { @@ -101,13 +105,13 @@ export default { if (this.defaultFirst && this.list.length > 0) { this.selectValue = this.list[0].value } + if (!this.list || !this.list.length) return const selectDom = document.querySelector( `.${this.classId} .el-select-dropdown .el-select-dropdown__wrap` ) this.scrollbar = document.querySelector(`.${this.classId} .el-select-dropdown .el-scrollbar`) this.slectBoxDom = document.querySelector(`.${this.classId} .el-select-dropdown__wrap`) - if (!this.slectBoxDom || !this.slectBoxDom.style) return this.slectBoxDom.style.display = 'flex' this.slectBoxDom.style.flexDirection = 'row' this.domList = selectDom.querySelector( diff --git a/frontend/src/components/widget/DeWidget/DeSelect.vue b/frontend/src/components/widget/DeWidget/DeSelect.vue index 1cbdf5a8da..fb655c29b1 100644 --- a/frontend/src/components/widget/DeWidget/DeSelect.vue +++ b/frontend/src/components/widget/DeWidget/DeSelect.vue @@ -36,6 +36,7 @@ import ElVisualSelect from '@/components/ElVisualSelect' import { multFieldValues, linkMultFieldValues } from '@/api/dataset/dataset' import bus from '@/utils/bus' +import { isSameVueObj } from '@/utils' import { getLinkToken, getToken } from '@/utils/auth' import customInput from '@/components/widget/DeWidget/customInput' import { textSelectWidget } from '@/components/widget/DeWidget/serviceNameFn.js' @@ -143,7 +144,9 @@ export default { }) }, 'element.options.attrs.sort': function(value, old) { - if (value === null || typeof value === 'undefined' || value === old) return + if (value === null || typeof value === 'undefined' || value === old || isSameVueObj(value, old)) return + this.show = false + this.datas = [] let method = multFieldValues @@ -160,6 +163,10 @@ export default { this.element.options.attrs.fieldId.length > 0 && method(param).then(res => { this.datas = this.optionDatas(res.data) + this.$nextTick(() => { + this.show = true + this.handleCoustomStyle() + }) }) || (this.element.options.value = '') } diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index 7c4a9510f1..e6db4df3c2 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -278,3 +278,11 @@ export function isMobile() { const flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) return flag } + +export const isSameVueObj = (source, target) => { + if (!source && !target) return true + if (!!source && !!target) { + return JSON.stringify(source) === JSON.stringify(target) + } + return false +} From d0ecfd12892bf3873c91c59e40ffdfb3498ce4a9 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 29 Jun 2022 18:02:47 +0800 Subject: [PATCH 02/18] =?UTF-8?q?refator:=20=E8=B0=83=E6=95=B4=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E6=9D=BF=E6=A0=B7=E5=BC=8F=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/AssistButton/ColorButton.vue | 98 +++++ .../PanelStyle/OverallSetting.vue | 248 ++++++++++--- .../SubjectSetting/PreSubject/Slider.vue | 211 +++++++---- .../PreSubject/SubjectTemplateItem.vue | 278 ++++++++------ .../PreSubjectHistory/Slider.vue | 278 ++++++++++++++ .../PreSubjectHistory/SubjectTemplateItem.vue | 339 ++++++++++++++++++ .../SubjectTemplateItemback.vue | 235 ++++++++++++ .../src/views/panel/SubjectSetting/index.vue | 11 +- 8 files changed, 1458 insertions(+), 240 deletions(-) create mode 100644 frontend/src/components/AssistButton/ColorButton.vue create mode 100644 frontend/src/views/panel/SubjectSetting/PreSubjectHistory/Slider.vue create mode 100644 frontend/src/views/panel/SubjectSetting/PreSubjectHistory/SubjectTemplateItem.vue create mode 100644 frontend/src/views/panel/SubjectSetting/PreSubjectHistory/SubjectTemplateItemback.vue diff --git a/frontend/src/components/AssistButton/ColorButton.vue b/frontend/src/components/AssistButton/ColorButton.vue new file mode 100644 index 0000000000..c4273ce710 --- /dev/null +++ b/frontend/src/components/AssistButton/ColorButton.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/frontend/src/views/panel/SubjectSetting/PanelStyle/OverallSetting.vue b/frontend/src/views/panel/SubjectSetting/PanelStyle/OverallSetting.vue index 694edac30b..c1ca5b3b81 100644 --- a/frontend/src/views/panel/SubjectSetting/PanelStyle/OverallSetting.vue +++ b/frontend/src/views/panel/SubjectSetting/PanelStyle/OverallSetting.vue @@ -1,56 +1,115 @@ @@ -65,20 +124,26 @@ import { LIGHT_THEME_PANEL_BACKGROUND } from '@/components/canvas/utils/style' import bus from '@/utils/bus' -import { DEFAULT_COLOR_CASE_DARK, DEFAULT_TITLE_STYLE_DARK, DEFAULT_COLOR_CASE, DEFAULT_TITLE_STYLE } from '@/views/chart/chart/chart' +import { + DEFAULT_COLOR_CASE_DARK, + DEFAULT_TITLE_STYLE_DARK, + DEFAULT_COLOR_CASE, + DEFAULT_TITLE_STYLE +} from '@/views/chart/chart/chart' import { FILTER_COMMON_STYLE, FILTER_COMMON_STYLE_DARK } from '@/views/panel/panel' import { deepCopy } from '@/components/canvas/utils/utils' +import ColorButton from '@/components/AssistButton/ColorButton' export default { name: 'OverallSetting', + components: { ColorButton }, data() { return { colorIndex: 0, overallSettingForm: {} } }, - watch: { - }, + watch: {}, computed: { ...mapState([ 'canvasStyleData' @@ -113,6 +178,14 @@ export default { bus.$emit('onThemeColorChange') } this.$store.commit('recordSnapshot') + }, + colorButtonClick(val) { + if (val !== this.overallSettingForm.panel.themeColor) { + this.overallSettingForm.panel.themeColor = val + this.themeChange('themeColor') + } else { + this.overallSettingForm.panel.themeColor = val + } } } } @@ -120,35 +193,42 @@ export default { diff --git a/frontend/src/views/panel/SubjectSetting/PreSubject/Slider.vue b/frontend/src/views/panel/SubjectSetting/PreSubject/Slider.vue index 390fc68563..b2f9c8fa02 100644 --- a/frontend/src/views/panel/SubjectSetting/PreSubject/Slider.vue +++ b/frontend/src/views/panel/SubjectSetting/PreSubject/Slider.vue @@ -1,20 +1,32 @@