Browse Source

Merge branch 'http_mock' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into wangzi_dev

PrinceLee 5 years ago
parent
commit
18a9416ede

+ 41 - 10
src/views/Platform/presentation/DailyNewsAdded.vue

@@ -15,10 +15,9 @@
       <div class="backStyle" style="margin-top: 10px;">三. bug情况</div>
       <div class="backStyle" style="margin-top: 10px;">三. bug情况</div>
       <div style="border: 1px,solid #ccc;">
       <div style="border: 1px,solid #ccc;">
         <div style="color: #606266">1、bug统计</div>
         <div style="color: #606266">1、bug统计</div>
-        <div style="display:flex;">
-          <div id="lineShow" style="flex:2; width: 400px;height:430px;" />
-          <div style="flex:1; width: 200px;height:400px;" />
-          <div id="barShow" style="flex:2; width: 400px;height:400px;" />
+        <div :class="{'space-between' : xaxisTotal < 7} ">
+          <div id="lineShow" :class="{'backTop' : xaxisTotal < 7,'backLeft' : xaxisTotal > 6}" />
+          <div id="barShow" :class="{'backTop' : xaxisTotal < 7, 'backLeft' : xaxisTotal > 6}" />
         </div>
         </div>
         <div style="color: #606266; margin: 1% 0;">2、bug说明</div>
         <div style="color: #606266; margin: 1% 0;">2、bug说明</div>
         <el-row>
         <el-row>
@@ -26,7 +25,6 @@
         </el-row>
         </el-row>
       </div>
       </div>
     </el-form>
     </el-form>
-
   </div>
   </div>
 </template>
 </template>
 
 
@@ -76,6 +74,7 @@ export default {
       statusMap: [],
       statusMap: [],
       statusList: [],
       statusList: [],
       dailys: '',
       dailys: '',
+      xaxisTotal: 0,
       setHeight: 500
       setHeight: 500
     }
     }
   },
   },
@@ -83,7 +82,14 @@ export default {
     this.getRouterData()
     this.getRouterData()
   },
   },
   mounted() {
   mounted() {
-
+    const myChart = echarts.init(document.getElementById('lineShow'))
+    const myChartA = echarts.init(document.getElementById('barShow'))
+    window.addEventListener('resize', () => {
+      if (myChart) {
+        myChart.resize()
+        myChartA.resize()
+      }
+    })
   },
   },
   methods: {
   methods: {
     getRouterData() {
     getRouterData() {
@@ -97,6 +103,11 @@ export default {
         this.statusMap = res.data.statusMap
         this.statusMap = res.data.statusMap
         this.statusList = res.data.statusList
         this.statusList = res.data.statusList
         this.numList = res.data.bugMap
         this.numList = res.data.bugMap
+        if (this.dateList.length >= 6 || this.statusList.length >= 6) {
+          this.xaxisTotal = 7
+        } else {
+          this.xaxisTotal = 1
+        }
         for (var ele of this.numList) {
         for (var ele of this.numList) {
           this.bugName.push(ele.name)
           this.bugName.push(ele.name)
         }
         }
@@ -106,24 +117,27 @@ export default {
             color: ['#2F54EB', '#13C2C2', '#F78B16', '#9254DE'],
             color: ['#2F54EB', '#13C2C2', '#F78B16', '#9254DE'],
             tooltip: { trigger: 'axis' },
             tooltip: { trigger: 'axis' },
             legend: { top: 30, data: this.bugName },
             legend: { top: 30, data: this.bugName },
-            grid: { left: '5%', right: '10%', bottom: '12%', containLabel: true },
+            grid: { left: '5%', right: '5%', bottom: '12%', containLabel: true },
             xAxis: { type: 'category', boundaryGap: true, data: this.dateList, axisLabel: { interval: 0, rotate: 30 }},
             xAxis: { type: 'category', boundaryGap: true, data: this.dateList, axisLabel: { interval: 0, rotate: 30 }},
             yAxis: { type: 'value' },
             yAxis: { type: 'value' },
             series: this.numList
             series: this.numList
           })
           })
-        }, 500)
+          echarts.init(document.getElementById('lineShow')).resize()
+        }, 1000)
         setTimeout(item => {
         setTimeout(item => {
           echarts.init(document.getElementById('barShow')).setOption({
           echarts.init(document.getElementById('barShow')).setOption({
             title: { text: 'bug状态汇总', x: 'center' },
             title: { text: 'bug状态汇总', x: 'center' },
             color: ['#2F54EB', '#13C2C2', '#F78B16', '#9254DE'],
             color: ['#2F54EB', '#13C2C2', '#F78B16', '#9254DE'],
             tooltip: { trigger: 'axis' },
             tooltip: { trigger: 'axis' },
             legend: { top: 30, data: this.statusMap },
             legend: { top: 30, data: this.statusMap },
+            grid: { left: '5%', right: '5%', bottom: '12%', containLabel: true },
             xAxis: [{ data: this.statusList, axisLabel: { interval: 0, rotate: 45 }}],
             xAxis: [{ data: this.statusList, axisLabel: { interval: 0, rotate: 45 }}],
             yAxis: [{}],
             yAxis: [{}],
             series: this.statusMap
             series: this.statusMap
           })
           })
-        })
-      }, 500)
+          echarts.init(document.getElementById('barShow')).resize()
+        }, 500)
+      })
     },
     },
     parentHandleclick(e, task, id) {
     parentHandleclick(e, task, id) {
       if (e === 1) {
       if (e === 1) {
@@ -189,4 +203,21 @@ export default {
     border-radius: 4px;
     border-radius: 4px;
     margin: 1% 0;
     margin: 1% 0;
   }
   }
+
+  .space-between {
+    display:flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+
+  .backTop {
+    flex:1.5;
+    width: 400px;
+    height:400px;
+  }
+
+  .backLeft {
+    width: 100%;
+    height:400px;
+  }
 </style>
 </style>

+ 38 - 6
src/views/Platform/presentation/testPresenyL.vue

@@ -10,10 +10,9 @@
       <div class="titleStyle" style="margin-top: 10px;">三. bug情况</div>
       <div class="titleStyle" style="margin-top: 10px;">三. bug情况</div>
       <div style="border: 1px,solid #ccc;font-size:14px;color:#606266;padding-bottom: 20px;">
       <div style="border: 1px,solid #ccc;font-size:14px;color:#606266;padding-bottom: 20px;">
         <div style="margin: 1%;">1、bug统计</div>
         <div style="margin: 1%;">1、bug统计</div>
-        <div style="display:flex;">
-          <div id="lineShow" style="flex:2;width: 400px;height:400px;" />
-          <div style="flex:1; width: 200px;height:400px;" />
-          <div id="barShow" style="flex:2; width: 400px;height:400px;" />
+        <div :class="{'space-between' : xaxisTotal < 7} ">
+          <div id="lineShow" :class="{'backTop' : xaxisTotal < 7,'backLeft' : xaxisTotal > 6}" />
+          <div id="barShow" :class="{'backTop' : xaxisTotal < 7, 'backLeft' : xaxisTotal > 6}" />
         </div>
         </div>
         <div style="margin: 1%;">2、bug说明:</div>
         <div style="margin: 1%;">2、bug说明:</div>
         <div class="pre-line">{{ bugshow }}</div>
         <div class="pre-line">{{ bugshow }}</div>
@@ -49,11 +48,20 @@ export default {
       statusMap: [],
       statusMap: [],
       statusList: [],
       statusList: [],
       pro: '',
       pro: '',
+      xaxisTotal: 0,
       name: ''
       name: ''
     }
     }
   },
   },
   mounted() {
   mounted() {
     this.idGet()
     this.idGet()
+    const myChart = echarts.init(document.getElementById('lineShow'))
+    const myChartA = echarts.init(document.getElementById('barShow'))
+    window.addEventListener('resize', () => {
+      if (myChart) {
+        myChart.resize()
+        myChartA.resize()
+      }
+    })
   },
   },
   methods: {
   methods: {
     idGet() {
     idGet() {
@@ -71,26 +79,33 @@ export default {
         for (var ele of this.numList) {
         for (var ele of this.numList) {
           this.bugName.push(ele.name)
           this.bugName.push(ele.name)
         }
         }
+        if (this.dateList.length >= 6 || this.statusList.length >= 6) {
+          this.xaxisTotal = 7
+        } else {
+          this.xaxisTotal = 1
+        }
         this.$nextTick(() => {
         this.$nextTick(() => {
           echarts.init(document.getElementById('lineShow')).setOption({
           echarts.init(document.getElementById('lineShow')).setOption({
             title: { left: 'center', text: 'bug数量汇总' },
             title: { left: 'center', text: 'bug数量汇总' },
             tooltip: { trigger: 'axis' },
             tooltip: { trigger: 'axis' },
             legend: { top: 30, data: this.bugName },
             legend: { top: 30, data: this.bugName },
-            grid: { left: '5%', right: '25%', bottom: '12%', containLabel: true },
+            grid: { left: '5%', right: '5%', bottom: '12%', containLabel: true },
             xAxis: { type: 'category', boundaryGap: true, data: this.dateList, axisLabel: { interval: 0, rotate: 30 }},
             xAxis: { type: 'category', boundaryGap: true, data: this.dateList, axisLabel: { interval: 0, rotate: 30 }},
             yAxis: { type: 'value' },
             yAxis: { type: 'value' },
             series: this.numList
             series: this.numList
           })
           })
+          echarts.init(document.getElementById('lineShow')).resize()
           echarts.init(document.getElementById('barShow')).setOption({
           echarts.init(document.getElementById('barShow')).setOption({
             title: { text: 'bug状态汇总', x: 'center' },
             title: { text: 'bug状态汇总', x: 'center' },
             color: ['#003366', '#006699', '#4cabce', '#e5323e'],
             color: ['#003366', '#006699', '#4cabce', '#e5323e'],
             tooltip: { trigger: 'axis' },
             tooltip: { trigger: 'axis' },
             legend: { top: 30, data: this.statusMap },
             legend: { top: 30, data: this.statusMap },
-            grid: { left: '5%', right: '25%', bottom: '12%', containLabel: true },
+            grid: { left: '5%', right: '5%', bottom: '12%', containLabel: true },
             xAxis: [{ data: this.statusList, axisLabel: { interval: 0, rotate: 30 }}],
             xAxis: [{ data: this.statusList, axisLabel: { interval: 0, rotate: 30 }}],
             yAxis: [{}],
             yAxis: [{}],
             series: this.statusMap
             series: this.statusMap
           })
           })
+          echarts.init(document.getElementById('barShow')).resize()
         })
         })
       })
       })
     }
     }
@@ -110,6 +125,23 @@ export default {
     font-size: 17px;
     font-size: 17px;
     font-weight: bold;
     font-weight: bold;
   }
   }
+
+  .space-between {
+    display:flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+
+  .backTop {
+    flex:1.5;
+    width: 400px;
+    height:400px;
+  }
+
+  .backLeft {
+    width: 100%;
+    height:400px;
+  }
   #app .hideSidebar .sidebar-container {
   #app .hideSidebar .sidebar-container {
     display: none;
     display: none;
   }
   }

+ 1 - 1
src/views/ToConfigure/configure.vue

@@ -500,7 +500,7 @@ export default {
         this.teamRoleEnum = res.data.teamRoleEnum // 团队属性
         this.teamRoleEnum = res.data.teamRoleEnum // 团队属性
         this.memberRoleEnum = res.data.memberRoleEnum // lerader
         this.memberRoleEnum = res.data.memberRoleEnum // lerader
         this.arr_team = this.teamRoleEnum.filter(item => {
         this.arr_team = this.teamRoleEnum.filter(item => {
-          return item.code <= 3
+          return item.code <= 4
         })
         })
       })
       })
     },
     },