From 43489d63f15081412a519b66efb9574a67a0e453 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 27 Apr 2021 10:28:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=81=A2=E5=A4=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=EF=BC=8C=E4=BB=AA=E8=A1=A8=E7=9B=98=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=AE=BE=E7=BD=AE=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/commonAjax.js | 38 +++ frontend/src/components/RightPanel/index.vue | 1 + .../components/canvas/components/Toolbar.vue | 12 +- .../SubjectSetting/BackgroundSelector.vue | 75 ++++++ .../src/views/panel/SubjectSetting/Slider.vue | 251 ++++++++++++++++++ .../SubjectSetting/SubjectTemplateItem.vue | 157 +++++++++++ .../src/views/panel/SubjectSetting/index.vue | 90 +++++++ frontend/src/views/panel/edit/index.vue | 25 +- frontend/src/views/panel/panel.js | 4 + frontend/src/views/panel/preview/index.vue | 4 +- .../systemParamSettings/BaseSetting.vue | 201 -------------- .../systemParamSettings/EmailSetting.vue | 8 +- .../system/systemParamSettings/UiSetting.vue | 23 +- .../system/systemParamSettings/index.vue | 12 +- 14 files changed, 660 insertions(+), 241 deletions(-) create mode 100644 frontend/src/api/commonAjax.js create mode 100644 frontend/src/views/panel/SubjectSetting/BackgroundSelector.vue create mode 100644 frontend/src/views/panel/SubjectSetting/Slider.vue create mode 100644 frontend/src/views/panel/SubjectSetting/SubjectTemplateItem.vue create mode 100644 frontend/src/views/panel/SubjectSetting/index.vue create mode 100644 frontend/src/views/panel/panel.js delete mode 100644 frontend/src/views/system/systemParamSettings/BaseSetting.vue diff --git a/frontend/src/api/commonAjax.js b/frontend/src/api/commonAjax.js new file mode 100644 index 0000000000..ea149fb020 --- /dev/null +++ b/frontend/src/api/commonAjax.js @@ -0,0 +1,38 @@ +import request from '@/utils/request' + +export function post(url, data) { + return request({ + url: url, + method: 'post', + loading: true, + data + }) +} + +export function get(url) { + return request({ + url: url, + method: 'get', + loading: true + }) +} + +export function fileUpload(url, file, files, param) { + const formData = new FormData() + if (file) { + formData.append('file', file) + } + if (files) { + files.forEach(f => { + formData.append('files', f) + }) + } + formData.append('request', new Blob([JSON.stringify(param)], { type: 'application/json' })) + return request({ + method: 'POST', + loading: true, + url: url, + data: formData + }) +} +export default { fileUpload } diff --git a/frontend/src/components/RightPanel/index.vue b/frontend/src/components/RightPanel/index.vue index 55e8c1e5c0..9f555c5871 100644 --- a/frontend/src/components/RightPanel/index.vue +++ b/frontend/src/components/RightPanel/index.vue @@ -63,6 +63,7 @@ export default { closeSidebar(evt) { const parent = evt.target.closest('.rightPanel') if (!parent) { + debugger this.show = false window.removeEventListener('click', this.closeSidebar) } diff --git a/frontend/src/components/canvas/components/Toolbar.vue b/frontend/src/components/canvas/components/Toolbar.vue index 9342e441e7..15665d8499 100644 --- a/frontend/src/components/canvas/components/Toolbar.vue +++ b/frontend/src/components/canvas/components/Toolbar.vue @@ -12,6 +12,10 @@ 画布比例 % + + + + @@ -38,16 +42,12 @@ - - - + + diff --git a/frontend/src/views/panel/SubjectSetting/Slider.vue b/frontend/src/views/panel/SubjectSetting/Slider.vue new file mode 100644 index 0000000000..ad1b694fbe --- /dev/null +++ b/frontend/src/views/panel/SubjectSetting/Slider.vue @@ -0,0 +1,251 @@ + + + + diff --git a/frontend/src/views/panel/SubjectSetting/SubjectTemplateItem.vue b/frontend/src/views/panel/SubjectSetting/SubjectTemplateItem.vue new file mode 100644 index 0000000000..b1d5398989 --- /dev/null +++ b/frontend/src/views/panel/SubjectSetting/SubjectTemplateItem.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/frontend/src/views/panel/SubjectSetting/index.vue b/frontend/src/views/panel/SubjectSetting/index.vue new file mode 100644 index 0000000000..2daf7bcf69 --- /dev/null +++ b/frontend/src/views/panel/SubjectSetting/index.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index 037ff93909..8769dfb7f4 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -6,7 +6,7 @@ 名称:{{ panelInfo.name || '测试仪表板' }} - + @@ -47,8 +47,9 @@
- - + + +
@@ -112,6 +113,7 @@ import DeAsideContainer from '@/components/dataease/DeAsideContainer' import { addClass, removeClass } from '@/utils' import FilterGroup from '../filter' import ViewSelect from '../ViewSelect' +import SubjectSetting from '../SubjectSetting' import bus from '@/utils/bus' import Editor from '@/components/canvas/components/Editor/index' import { deepCopy } from '@/components/canvas/utils/utils' @@ -139,7 +141,8 @@ export default { ViewSelect, Editor, Toolbar, - FilterDialog + FilterDialog, + SubjectSetting }, data() { return { @@ -192,6 +195,7 @@ export default { mounted() { this.insertToBody() bus.$on('component-on-drag', () => { + debugger this.show = false }) @@ -225,6 +229,7 @@ export default { this.$router.replace('/panel/index') }, showPanel(type) { + debugger this.show = !this.show this.showIndex = type }, @@ -234,7 +239,10 @@ export default { closeSidebar(evt) { const parent = evt.target.closest('.button-div-class') const self = evt.target.closest('.leftPanel') - if (!parent && !self) { + // 点击样式按钮 排除 + const stick = evt.target.closest('.el-icon-magic-stick') + if (!parent && !self && !stick) { + debugger this.show = false window.removeEventListener('click', this.closeSidebar) this.showIndex = -1 @@ -283,6 +291,7 @@ export default { this.currentFilterCom.style.left = e.offsetX this.currentFilterCom.id = newComponentId if (this.currentWidget.filterDialog) { + debugger this.show = false this.openFilterDiolog() return @@ -392,7 +401,7 @@ export default { .leftPanel { width: 100%; - max-width: 240px; + max-width: 300px; height: calc(100vh - 91px); position: fixed; top: 91px; @@ -401,14 +410,14 @@ export default { transition: all .25s cubic-bezier(.7, .3, .1, 1); transform: translate(100%); background: #fff; - z-index: 40000; + z-index: 1003; } .show { transition: all .3s cubic-bezier(.7, .3, .1, 1); .leftPanel-background { - z-index: 20000; + z-index: 1002; opacity: 1; width: 100%; height: 100%; diff --git a/frontend/src/views/panel/panel.js b/frontend/src/views/panel/panel.js new file mode 100644 index 0000000000..f021c608d7 --- /dev/null +++ b/frontend/src/views/panel/panel.js @@ -0,0 +1,4 @@ +export const DEFAULT_BACKGROUND_COLOR = { + color: '#ffffff', + image: null +} diff --git a/frontend/src/views/panel/preview/index.vue b/frontend/src/views/panel/preview/index.vue index 7fd9a045f7..1af7b339e3 100644 --- a/frontend/src/views/panel/preview/index.vue +++ b/frontend/src/views/panel/preview/index.vue @@ -88,14 +88,14 @@ export default { transition: all .25s cubic-bezier(.7, .3, .1, 1); transform: translate(100%); background: #fff; - z-index: 40000; + z-index: 1003; } .show { transition: all .3s cubic-bezier(.7, .3, .1, 1); .leftPanel-background { - z-index: 20000; + z-index: 1002; opacity: 1; width: 100%; height: 100%; diff --git a/frontend/src/views/system/systemParamSettings/BaseSetting.vue b/frontend/src/views/system/systemParamSettings/BaseSetting.vue deleted file mode 100644 index c57a9e9edc..0000000000 --- a/frontend/src/views/system/systemParamSettings/BaseSetting.vue +++ /dev/null @@ -1,201 +0,0 @@ - - - - - diff --git a/frontend/src/views/system/systemParamSettings/EmailSetting.vue b/frontend/src/views/system/systemParamSettings/EmailSetting.vue index 8917a10545..7ec25228fa 100644 --- a/frontend/src/views/system/systemParamSettings/EmailSetting.vue +++ b/frontend/src/views/system/systemParamSettings/EmailSetting.vue @@ -98,6 +98,8 @@