You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ch...@apache.org on 2020/09/24 03:13:14 UTC

[incubator-dolphinscheduler] branch 1.3.3-release updated: [fixBug-3792][ui]Click on the sidebar to adapt the width of the pie chart on the project homepage

This is an automated email from the ASF dual-hosted git repository.

chenxingchun pushed a commit to branch 1.3.3-release
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/1.3.3-release by this push:
     new 387437a  [fixBug-3792][ui]Click on the sidebar to adapt the width of the pie chart on the project homepage
     new 2838254  Merge pull request #3803 from break60/1.3.3-release
387437a is described below

commit 387437a669e94dd04d34cc3ad0a9920796ad7bf3
Author: break60 <79...@qq.com>
AuthorDate: Thu Sep 24 10:04:28 2020 +0800

    [fixBug-3792][ui]Click on the sidebar to adapt the width of the pie chart on the project homepage
---
 .../pages/projects/pages/index/_source/processStateCount.vue     | 9 +++++++--
 .../home/pages/projects/pages/index/_source/taskCtatusCount.vue  | 7 ++++++-
 dolphinscheduler-ui/src/js/conf/home/store/projects/mutations.js | 6 ++++++
 dolphinscheduler-ui/src/js/conf/home/store/projects/state.js     | 2 +-
 .../src/js/module/components/secondaryMenu/secondaryMenu.vue     | 4 +++-
 5 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue
index 1b06c49..974d57f 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue
@@ -19,7 +19,7 @@
     <div v-show="!msg">
       <div class="data-area" v-spin="isSpin" style="height: 430px;">
         <div class="col-md-7">
-          <div id="process-state-pie" style="height:260px;margin-top: 100px;"></div>
+          <div id="process-state-pie" style="width:100%;height:260px;margin-top: 100px;"></div>
         </div>
         <div class="col-md-5">
           <div class="table-small-model">
@@ -52,6 +52,8 @@
   import { mapActions } from 'vuex'
   import { pie } from './chartConfig'
   import Chart from '@/module/ana-charts'
+  import echarts from 'echarts'
+  import store from '@/conf/home/store'
   import mNoData from '@/module/components/noData/noData'
   import { stateType } from '@/conf/home/pages/projects/pages/_source/instanceConditions/common'
   export default {
@@ -87,7 +89,7 @@
             value: v.count
           }
         })
-        const myChart = Chart.pie('#process-state-pie', this.processStateList, { title: '' })
+        const myChart = Chart.pie('#process-state-pie', this.processStateList, { title: '' })  
         myChart.echart.setOption(pie)
         // 首页不允许跳转
         if (this.searchParams.projectId) {
@@ -112,6 +114,9 @@
             this.isSpin = false
           })
         }
+      },
+      '$store.state.projects.sideBar': function() {
+        echarts.init(document.getElementById('process-state-pie')).resize()
       }
     },
     beforeCreate () {
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue
index 68aa997..60e9413 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue
@@ -19,7 +19,7 @@
     <div v-show="!msg">
       <div class="data-area" v-spin="isSpin" style="height: 430px;">
         <div class="col-md-7">
-          <div id="task-status-pie" style="height:260px;margin-top: 100px;"></div>
+          <div id="task-status-pie" style="width:100%;height:260px;margin-top: 100px;"></div>
         </div>
         <div class="col-md-5">
           <div class="table-small-model">
@@ -54,6 +54,8 @@
   import { mapActions } from 'vuex'
   import { pie } from './chartConfig'
   import Chart from '@/module/ana-charts'
+  import echarts from 'echarts'
+  import store from '@/conf/home/store'
   import mNoData from '@/module/components/noData/noData'
   import { stateType } from '@/conf/home/pages/projects/pages/_source/instanceConditions/common'
 
@@ -117,6 +119,9 @@
             this.isSpin = false
           })
         }
+      },
+      '$store.state.projects.sideBar': function() {
+        echarts.init(document.getElementById('task-status-pie')).resize()
       }
     },
     beforeCreate () {
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/projects/mutations.js b/dolphinscheduler-ui/src/js/conf/home/store/projects/mutations.js
index e84c864..17e92fd 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/projects/mutations.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/projects/mutations.js
@@ -16,4 +16,10 @@
  */
 
 export default {
+    /**
+   * set sideBar
+   * */
+  setSideBar (state, payload) {
+    state.sideBar = payload
+  },
 }
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/projects/state.js b/dolphinscheduler-ui/src/js/conf/home/store/projects/state.js
index ddcb8e2..40b7b38 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/projects/state.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/projects/state.js
@@ -15,5 +15,5 @@
  * limitations under the License.
  */
 export default {
-
+    sideBar: 1
 }
diff --git a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/secondaryMenu.vue b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/secondaryMenu.vue
index 5336555..36050bb 100644
--- a/dolphinscheduler-ui/src/js/module/components/secondaryMenu/secondaryMenu.vue
+++ b/dolphinscheduler-ui/src/js/module/components/secondaryMenu/secondaryMenu.vue
@@ -55,7 +55,7 @@
 </template>
 <script>
   import menu from './_source/menu'
-
+  import store from '@/conf/home/store'
   export default {
     name: 'secondary-menu',
     data () {
@@ -85,8 +85,10 @@
         this.isTogHide = !this.isTogHide
         if(this.isTogHide) {
           sessionStorage.setItem('isLeft',0)
+          store.commit('projects/setSideBar',0)
         } else {
           sessionStorage.setItem('isLeft',1)
+          store.commit('projects/setSideBar',1)
         }
       }
     },