From 0175cda6150656bc74b34c6f6c71edd1e1fc653c Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期四, 04 二月 2021 18:22:54 +0800
Subject: [PATCH] treee, 修复tab切换时树的选中状态.添加区域

---
 src/pages/shuohuangMonitorAnalyze/components/guideIndex.vue |  699 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 657 insertions(+), 42 deletions(-)

diff --git a/src/pages/shuohuangMonitorAnalyze/components/guideIndex.vue b/src/pages/shuohuangMonitorAnalyze/components/guideIndex.vue
index 8007458..f018f93 100644
--- a/src/pages/shuohuangMonitorAnalyze/components/guideIndex.vue
+++ b/src/pages/shuohuangMonitorAnalyze/components/guideIndex.vue
@@ -4,7 +4,7 @@
       <el-tab-pane label="鏁版嵁缁熻鍒嗘瀽" name="dataStatistic"></el-tab-pane>
       <el-tab-pane label="浠诲姟缁熻鍒嗘瀽" name="taskStatistic"></el-tab-pane>
     </el-tabs>
-    <div class="tab-content">
+    <div class="tab-content" v-if="actCardTab=='dataStatistic'">
       <div class="card-view">
         <el-card>
           <div class="title">
@@ -39,8 +39,10 @@
               <i class="el-icon-warning-outline"></i>
             </span>
           </div>
-          <div class="val">8846</div>
-          <div class="trend"></div>
+          <div class="val">{{$numberFormat(8846)}}</div>
+          <div class="trend">
+            <line-chart :options="optionsOfWeekAnalyze" style="height:50px"></line-chart>
+          </div>
           <div class="devide"></div>
           <div class="detail">
             <div class="name">鏃ュ潎鍒嗘瀽閲�</div>
@@ -95,7 +97,7 @@
           <div class="rt">
             <time-shortcut @actPickerChange="timeShortChange"></time-shortcut>
             <el-date-picker
-              v-model="searchTime"
+              v-model="searchHidDanderTime"
               type="datetimerange"
               size="small"
               range-separator="鑷�"
@@ -122,36 +124,211 @@
               </el-select>
             </div>
             <div class="rank-list">
-              <div class="rank-item">
-                <span class="rank-index">1</span>
-                <span class="name">鏈鸿締鍒嗗叕鍙�</span>
-                <span class="val">323,234</span>
+              <div class="rank-item" v-for="(rankItem,index) in rankList" :key="rankItem.id">
+                <span
+                  class="rank-index"
+                  :class="{'first':index==0,'second':index==1,'third':index==2}"
+                >{{index+1}}</span>
+                <span class="name">{{rankItem.name}}</span>
+                <span class="val">{{rankItem.val}}</span>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="statics flex-box">
+          <div class="lt">
+            <div class="statics-part">
+              <div class="statics-header">
+                <span class="title">涔樺姟鍛樿繚瑙勭粺璁�</span>
+                <time-shortcut @actPickerChange="irregularMenStatistic"></time-shortcut>
+              </div>
+              <div class="statics-content">
+                <div class="chart-area flex-box">
+                  <div class="lt">
+                    <div class="chart-theme">涔樺姟鍛樻�讳汉鏁�</div>
+                    <div class="sum">
+                      <span class="val">8846</span>
+                      <span class="ratio">17.1%</span>
+                    </div>
+                    <line-chart :options="optionsOfIrregularSum" style="height:70px"></line-chart>
+                  </div>
+                  <div class="gt">
+                    <div class="chart-theme">浜哄潎杩濊娆℃暟</div>
+                    <div class="sum">
+                      <span class="val">8846</span>
+                    </div>
+                    <line-chart :options="optionsOfIrregularPer" style="height:70px"></line-chart>
+                  </div>
+                </div>
+                <el-table class="thbg" :data="irregularTableData">
+                  <el-table-column label="鎺掑悕"></el-table-column>
+                  <el-table-column label="濮撳悕"></el-table-column>
+                  <el-table-column label="杩濊娆℃暟"></el-table-column>
+                  <el-table-column label="鍛ㄦ定骞�"></el-table-column>
+                </el-table>
+                <el-pagination
+                  @size-change="handleTableSizeChange"
+                  @current-change="renderIrregularMenTable"
+                  :current-page.sync="PageIndex"
+                  :page-size="PageSize"
+                  :page-sizes="pageSizes"
+                  layout="total,sizes, prev, pager, next"
+                  :total="tableTotal"
+                ></el-pagination>
+              </div>
+            </div>
+          </div>
+          <div class="rt">
+            <div class="statics-part">
+              <div class="statics-header">
+                <span class="title">閲嶇偣鍦版杩濊浜嬩欢缁熻</span>
+                <time-shortcut @actPickerChange="irregularEventStatistic"></time-shortcut>
+              </div>
+              <div class="statics-content">
+                <el-radio-group
+                  v-model="irregularEventType"
+                  @change="checkIrregularEventType"
+                  size="small"
+                >
+                  <el-radio-button label="fhdd">闃叉姢鍦版</el-radio-button>
+                  <el-radio-button label="jcz">杩涘嚭绔�</el-radio-button>
+                  <el-radio-button label="gfx">杩囧垎鐩�</el-radio-button>
+                  <el-radio-button label="hc">浼氳溅</el-radio-button>
+                  <el-radio-button label="lsmx">涓存椂鎱㈡��</el-radio-button>
+                </el-radio-group>
+                <!-- <Pie :options="optionsOfIrregularEventPie"></Pie> -->
+                <Pie :options="optionsOfHidDangerPie" style="padding-top:20px;"></Pie>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="part">
+          <div class="tab-swiper">
+            <swipe-tabs @checkTab="checkTabInSwipe"></swipe-tabs>
+          </div>
+          <div class="tab-detail">
+            <dataset-chart style="width:100%"></dataset-chart>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="tab-content" v-if="actCardTab=='taskStatistic'">
+      <div class="general-view">
+        <div class="indicator">
+          <div class="icon">
+            <i class="iconfont iconrenwuzhipai" style="color:#3399ff"></i>
+          </div>
+          <div class="content">
+            <div class="indicator-title">鏈懆浠诲姟鎸囨淳閲�</div>
+            <div class="indicator-val">8000</div>
+          </div>
+        </div>
+        <div class="indicator">
+          <div class="icon">
+            <i class="iconfont iconfenxi" style="color:#4c76ff"></i>
+          </div>
+          <div class="content">
+            <div class="indicator-title">鍒嗘瀽閲�</div>
+            <div class="indicator-val">8000</div>
+          </div>
+        </div>
+        <div class="indicator lastOne">
+          <div class="icon">
+            <i class="iconfont iconweigui" style="color:#fdd476"></i>
+          </div>
+          <div class="content">
+            <div class="indicator-title">杩濊閲�</div>
+            <div class="indicator-val">8000</div>
+          </div>
+        </div>
+      </div>
+      <div class="part">
+        <div class="statics flex-box">
+          <div class="lt">
+            <div class="statics-part">
+              <div class="statics-header">
+                <span class="title">浠诲姟鎸囨淳缁熻</span>
+              </div>
+              <div class="statics-content">
+                <div class="flex-end">
+                  <time-shortcut @actPickerChange="taskAssignStatics"></time-shortcut>
+                  <el-date-picker
+                    v-model="searchTaskAssignTime"
+                    type="datetimerange"
+                    size="small"
+                    range-separator="鑷�"
+                    start-placeholder="寮�濮嬫棩鏈�"
+                    end-placeholder="缁撴潫鏃ユ湡"
+                    align="right"
+                  ></el-date-picker>
+                </div>
+                <line-chart :options="optionsOfTaskAssign" style="height: 300px;"></line-chart>
+              </div>
+            </div>
+          </div>
+          <div class="rt">
+            <div class="statics-part">
+              <div class="statics-header">
+                <span class="title">閮ㄩ棬鎸囨淳浠诲姟鍗犳瘮</span>
+                <time-shortcut @actPickerChange="partAssignstatics"></time-shortcut>
+              </div>
+              <div class="statics-content">
+                <Pie :options="optionsOfHidDangerPie"></Pie>
               </div>
             </div>
           </div>
         </div>
         <div class="statics">
-          <div class="lt">
-            <div class="statics-part">
-              <div class="statics-header">
-                <span class="title">涔樺姟鍛樿繚瑙勭粺璁�</span>
-                <time-shortcut @actPickerChange="irregularStatistic"></time-shortcut>
+          <div class="statics-part">
+            <div class="statics-header">
+              <span class="title">浠诲姟鍒嗘瀽缁熻</span>
+            </div>
+            <div class="statics-content">
+              <div class="flex-end">
+                <time-shortcut @actPickerChange="taskAnalyzeStatics"></time-shortcut>
+                <el-date-picker
+                  v-model="searchTaskAnalyzeTime"
+                  type="datetimerange"
+                  size="small"
+                  range-separator="鑷�"
+                  start-placeholder="寮�濮嬫棩鏈�"
+                  end-placeholder="缁撴潫鏃ユ湡"
+                  align="right"
+                ></el-date-picker>
               </div>
-              <div class="chart-area flex-box">
-                <div class="lt">
-                  <div class="chart-theme">涔樺姟鍛樻�讳汉鏁�</div>
-                  <div class="sum">
-                    <span class="val">8846</span>
-                    <span class="ratio">17.1%</span>
-                  </div>
-                  <Line :options="optionsOfIrregularSum"></Line>
-                </div>
-                <div class="gt">
-                  <div class="chart-theme">浜哄潎杩濊娆℃暟</div>
-                  <div class="sum">
-                    <span class="val">8846</span>
-                  </div>
-                </div>
+              <Bar :options="optionsOfTaskAnalyzeBar" style="height: 300px;"></Bar>
+            </div>
+          </div>
+        </div>
+        <div class="statics">
+          <div class="statics-part">
+            <div class="statics-header">
+              <span class="title">浠诲姟鍒嗘瀽鎯呭喌</span>
+              <time-shortcut @actPickerChange="taskAnalyzeCase"></time-shortcut>
+            </div>
+            <div class="statics-content">
+              <div class="table-area">
+                <el-table class="thbg" :data="taskAnalyzeCaseTableData">
+                  <el-table-column type="index" label="搴忓彿"></el-table-column>
+                  <el-table-column prop="name" label="濮撳悕"></el-table-column>
+                  <el-table-column prop="rwl" label="浠诲姟閲�"></el-table-column>
+                  <el-table-column prop="fxl" label="鍒嗘瀽閲�"></el-table-column>
+                  <el-table-column prop="pdwgl" label="鍒ゅ畾杩濊閲�"></el-table-column>
+                  <el-table-column prop="wgl" label="鍒ゅ畾杩濊鐜�"></el-table-column>
+                  <el-table-column prop="wcl" label="瀹屾垚鐜�"></el-table-column>
+                </el-table>
+              </div>
+
+              <div class="flex-end">
+                <el-pagination
+                  @size-change="handleTableSizeChange"
+                  @current-change="renderIrregularMenTable"
+                  :current-page.sync="PageIndex"
+                  :page-size="PageSize"
+                  :page-sizes="pageSizes"
+                  layout="total,sizes, prev, pager, next"
+                  :total="tableTotal"
+                ></el-pagination>
               </div>
             </div>
           </div>
@@ -165,14 +342,91 @@
 import timeShortcut from './timeShortcut';
 import Bar from './charts/bar';
 import Pie from './charts/pie';
-import Line from './charts/line';
+import LineChart from './charts/line';
+import SwipeTabs from './swipeTabs';
+import DatasetChart from './charts/dataset';
 export default {
-  components: { timeShortcut, Bar, Pie, Line },
+  components: { timeShortcut, Bar, Pie, LineChart, SwipeTabs, DatasetChart },
+  mounted () {
+    let tempArr = [{
+      "text": "Same but with checkboxes",
+      "children": [
+        {
+          "text": "initially selected",
+          "selected": true
+        }
+      ]
+    }];
+    for (var i = 0; i < 20; i++) {
+      tempArr[0].children.push({
+        "text": "initially open",
+        "icon": "fa fa-folder icon-state-default",
+        "opened": true,
+        "children": [
+          {
+            "text": "Another node"
+          }
+        ]
+      })
+    }
+    tempArr.forEach(node=>{
+      //if(node.children.length)
+      
+    })
+    this.jsTreeNodes = tempArr
+  },
   data () {
     return {
-      actCardTab: 'dataStatistic',
+      //actCardTab: 'dataStatistic',
+      actCardTab: 'taskStatistic',
       hidDangerTab: 'hidDanderStatistic',
-      searchTime: [],
+      optionsOfWeekAnalyze: {
+        animation: false,
+        grid: {
+          top: 0,
+          left: 0,
+          right: 0,
+          bottom: 10,
+          //containLabel: true
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross',
+            label: {
+              backgroundColor: '#6a7985'
+            }
+          }
+        },
+        xAxis: {
+          show: false,
+          type: 'category',
+          boundaryGap: false,
+          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+          label: {
+            show: false
+          }
+        },
+        yAxis: {
+          type: 'value',
+          show: false,
+          label: {
+            show: false
+          }
+        },
+        series: [
+          {
+            data: [820, 932, 901, 934, 1290, 1330, 1320],
+            type: 'line',
+            smooth: true,
+            areaStyle: {
+              opacity: 0.7
+            },
+            color: '#975fe3'
+          }
+        ]
+      },
+      searchHidDanderTime: [],
       actHidDanderChart: 'bar',
       optionsOfHidDangerBar: {
         color: ['#9ed2f5'],
@@ -194,11 +448,24 @@
             data: ['鏈福绗�', '鏈墜姣�', '鏈懠鍞�', '杩愯涓潯瑙�', '鏈鏌�', '鏈簲绛�'],
             axisTick: {
               alignWithLabel: true
-            }
+            },
+            // axisLine: {
+            //   lineStyle: {
+            //     color: '#ccc'
+            //   }
+            // },
+            // nameTextStyle: {
+            //   color: "#333"
+            // }
           }
         ],
         yAxis: [
-          { type: 'value' }
+          {
+            type: 'value',
+            axisLine: {
+              show: false
+            }
+          }
         ],
         series: [
           {
@@ -212,7 +479,7 @@
       optionsOfHidDangerPie: {
         tooltip: {
           trigger: 'item',
-          formatter: '{a}<br/>{b}:{c} ({d}%)'
+          formatter: '{a}<br>{b}:{c} ({d}%)'
         },
         legend: {
           orient: 'vertical',
@@ -230,7 +497,8 @@
             avoidLabelOverlap: false,
             label: {
               show: false,
-              position: 'center'
+              position: 'center',
+              formatter: '{b}\n{c} '
             },
             emphasis: {
               label: {
@@ -253,8 +521,131 @@
           }
         ]
       },
+      rankList: [{
+        id: 'jl',
+        name: '鏈鸿締鍒嗗叕鍙�',
+        val: 324456
+      }, {
+        id: 'jg',
+        name: '浜珮閾佽矾',
+        val: 328356
+      }, {
+        id: 'ztyj',
+        name: '涓搧涓�灞�',
+        val: 4563356
+      }, {
+        id: 'ztsj',
+        name: '涓搧涓夊眬',
+        val: 4563856
+      }],
       optionsOfIrregularSum: {
         animation: false,
+        grid: {
+          top: 0,
+          left: 0,
+          bottom: 10,
+          containLabel: true
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross',
+            label: {
+              backgroundColor: '#6a7985'
+            }
+          }
+        },
+        xAxis: {
+          show: false,
+          type: 'category',
+          boundaryGap: false,
+          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+          label: {
+            show: false
+          }
+        },
+        yAxis: {
+          type: 'value',
+          show: false,
+          boundaryGap: [0, '30%'],
+          label: {
+            show: false
+          }
+        },
+        series: [
+          {
+            data: [820, 932, 901, 934, 1290, 1330, 1320],
+            type: 'line',
+            smooth: true,
+            areaStyle: {
+              opacity: 0.3
+            },
+            color: '#5dbafd'
+          }
+        ]
+      },
+      optionsOfIrregularPer: {
+        animation: false,
+        grid: {
+          top: 0,
+          left: 0,
+          bottom: 10,
+          containLabel: true
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            type: 'cross',
+            label: {
+              backgroundColor: '#6a7985'
+            }
+          }
+        },
+        xAxis: {
+          show: false,
+          type: 'category',
+          boundaryGap: false,
+          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+          label: {
+            show: false
+          }
+        },
+        yAxis: {
+          type: 'value',
+          show: false,
+          label: {
+            show: false
+          }
+        },
+        series: [
+          {
+            data: [820, 932, 901, 934, 1290, 1330, 1320],
+            type: 'line',
+            smooth: true,
+            areaStyle: {
+              opacity: 0.3
+            },
+            color: '#8adee6'
+          }
+        ]
+      },
+      irregularTableData: [],
+      PageIndex: 1,
+      PageSize: 5,
+      pageSizes: [5, 10],
+      tableTotal: 0,
+      irregularEventType: 'fhdd',
+      optionsOfIrregularEventPie: {
+
+      },
+      searchTaskAssignTime: [],
+      optionsOfTaskAssign: {
+        grid: {
+          top: 40,
+          left: 10,
+          right: 10,
+          containLabel: true,
+        },
         tooltip: {
           trigger: 'axis',
           axisPointer: {
@@ -274,6 +665,9 @@
         },
         yAxis: {
           type: 'value',
+          axisLine: {
+            show: false
+          },
           label: {
             show: false
           }
@@ -282,20 +676,125 @@
           {
             data: [820, 932, 901, 934, 1290, 1330, 1320],
             type: 'line',
-
+            smooth: true,
+            areaStyle: {
+              opacity: 0.3
+            },
+            color: '#5dbafd'
           }
         ]
-      }
+      },
+      searchTaskAnalyzeTime: [],
+      optionsOfTaskAnalyzeBar: {
+        color: ['#fbd438', '#4fcb74'],
+        dataset: {
+          source: [
+            ['mon', 70, 30],
+            ['tue', 30, 50],
+            ['wed', 30, 60],
+            ['thu', 40, 50],
+            ['fri', 20, 30],
+            ['sat', 30, 20],
+            ['sun', 20, 40],
+          ]
+        },
+        legend: {
+          left: 0
+        },
+        tooltip: {
+          trigger: 'axis',
+          axisPointer: {
+            //type: 'shadow'
+          },
+        },
+        grid: {
+          left: 10,
+          right: 10,
+          bottom: '3%',
+          containLabel: true
+        },
+        xAxis: [
+          {
+            type: 'category',
+            //data: ['鏈福绗�', '鏈墜姣�', '鏈懠鍞�', '杩愯涓潯瑙�', '鏈鏌�', '鏈簲绛�'],
+            axisTick: {
+              alignWithLabel: true
+            },
+            // axisLine: {
+            //   lineStyle: {
+            //     color: '#ccc'
+            //   }
+            // },
+            // nameTextStyle: {
+            //   color: "#333"
+            // }
+          }
+        ],
+        yAxis: [
+          {
+            type: 'value',
+            axisLine: {
+              show: false
+            }
+          }
+        ],
+        series: [
+          {
+            name: '鏈夊紓甯�',
+            type: 'bar',
+            stack: '寮傚父',
+            barWidth: 20,
+            //data: [270, 500, 300, 430, 620, 540]
+          },
+          {
+            name: '鏃犲紓甯�',
+            type: 'bar',
+            stack: '寮傚父',
+            barWidth: 20,
+            //data: [270, 500, 300, 430, 620, 540]
+          }
+        ]
+      },
+      taskAnalyzeCaseTableData: [],
+      jsTreeNodes: [],
     }
   },
   methods: {
+    checkTabInSwipe (tab) {
+      debugger
+    },
+    checkIrregularEventType (type) {
+      debugger
+    },
+    taskAnalyzeCase (time) {
+
+    },
+    taskAnalyzeStatics (time) {
+
+    },
+    partAssignstatics (time) {
+
+    },
+    taskAssignStatics (time) {
+
+    },
+    renderIrregularMenTable () {
+
+    },
+    handleTableSizeChange () {
+
+    },
     timeShortChange (time) {
 
     },
-    irregularStatistic (time) {
+    irregularMenStatistic (time) {
+
+    },
+    irregularEventStatistic (time) {
 
     }
-  }
+  },
+
 }
 </script>
 
@@ -359,6 +858,15 @@
           .day-ratio {
             display: flex;
             align-items: center;
+            & > span {
+              margin-right: 6px;
+            }
+            .triangle.green {
+              margin-top: -6px;
+            }
+            .triangle.red {
+              margin-top: 6px;
+            }
           }
         }
         .devide {
@@ -368,11 +876,17 @@
         }
         .detail {
           display: flex;
+          align-items: center;
+          color: #777;
+          .name {
+            margin-right: 20px;
+          }
         }
       }
     }
     .part {
-      padding: 10px 0;
+      padding: 20px 0;
+      margin-bottom: 20px;
       .header-width-tab {
         display: flex;
         justify-content: space-between;
@@ -385,10 +899,48 @@
         display: flex;
         padding: 0 10px;
         min-height: 400px;
+        margin-bottom: 30px;
+        .statics-header {
+          height: 50px;
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+          border-bottom: 1px solid #eee;
+          // padding-bottom: 10px;
+          margin-bottom: 20px;
+          .title {
+            font-size: 16px;
+            font-weight: bold;
+          }
+        }
+        .statics-part {
+          flex: 1;
+          .statics-content {
+            padding: 0 20px;
+            .chart-area {
+              .chart-theme {
+                font-size: 14px;
+                color: #999;
+              }
+              .sum {
+                padding: 14px 0 10px;
+                .val {
+                  font-size: 24px;
+                  padding-left: 10px;
+                  margin-right: 20px;
+                }
+                .ratio {
+                  font-size: 14px;
+                  color: #999;
+                }
+              }
+            }
+          }
+        }
         .lt {
           text-align: left;
           flex: 1;
-          padding-right: 20px;
+          padding-right: 40px;
         }
         .rt {
           text-align: left;
@@ -403,6 +955,8 @@
           }
           .rank-list {
             padding: 10px 0;
+            max-height: 380px;
+            overflow-y: auto;
             .rank-item {
               height: 36px;
               display: flex;
@@ -418,14 +972,75 @@
                 color: #666;
                 border-radius: 50%;
                 text-align: center;
+                &.first {
+                  background-color: red;
+                  color: #fff;
+                }
+                &.second {
+                  background-color: rgb(248, 126, 45);
+                  color: #fff;
+                }
+                &.third {
+                  background-color: #0b3c29;
+                  color: #fff;
+                }
               }
               .name {
                 width: 200px;
               }
+              .val {
+                width: 100px;
+              }
             }
           }
         }
       }
+      .flex-box {
+        .lt,
+        .rt,
+        .gt {
+          flex: 1;
+          width: auto;
+          //padding: 0 20px;
+        }
+      }
+      .tab-swiper {
+        width: calc(100vw - 340px);
+        margin-bottom: 20px;
+      }
+    }
+    .general-view {
+      display: flex;
+      padding: 20px 50px;
+      .indicator {
+        flex: 1;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        position: relative;
+        &:not(.lastOne):after {
+          content: '';
+          width: 1px;
+          height: 57px;
+          background: #e9e9e9;
+          position: absolute;
+          right: 0;
+          top: 50%;
+          transform: translateY(-50%);
+        }
+        .icon .iconfont {
+          font-size: 40px;
+          margin-right: 24px;
+        }
+        .indicator-title {
+          font-size: 14px;
+          color: #999;
+          margin-bottom: 15px;
+        }
+        .indicator-val {
+          font-size: 24px;
+        }
+      }
     }
   }
 }

--
Gitblit v1.8.0