From 28bd61701bb409257ea0dd3c78f32bd0b45ebbd5 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期一, 06 三月 2023 09:16:35 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.20.39:8989/r/LFWEB_NEW

---
 src/components/Screen/right.vue |  330 ++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 269 insertions(+), 61 deletions(-)

diff --git a/src/components/Screen/right.vue b/src/components/Screen/right.vue
index bb7186f..4ecbb25 100644
--- a/src/components/Screen/right.vue
+++ b/src/components/Screen/right.vue
@@ -1,44 +1,101 @@
 <template>
   <div class="current">
-    <div class="rightContainer" v-if="ChartDisplay">
+    <div class="rightContainer" v-if="currentDisplay == '澶у睆' && ChartDisplay">
       <div class="current1">
-        <div class="aside-title">宸ョ▼绉嶇被</div>
+        <div class="aside-title">椤圭洰缁熻</div>
         <project-category></project-category>
       </div>
-      <div class="" style="width: 100%;height: 60%">
-        <div class="aside-title">鏂囦欢鏍煎紡</div>
-        <div class="content" style="height: calc(100% - 30px)">
+      <div class="current1">
+        <div class="aside-title">鏁版嵁缁熻</div>
+        <visit-count></visit-count>
+      </div>
+      <div class="current1">
+        <div class="aside-title">鏈嶅姟璁块棶娆℃暟</div>
+        <Service-Get></Service-Get>
+      </div>
+    </div>
+    <!-- 鍏ㄧ悆銆佸叏鍥介」鐩� -->
+    <div class="rightContainer" v-if="currentDisplay == '椤圭洰'">
+      <div class="current1">
+        <div class="aside-title"></div>
+        <!-- <country-dimension-bar ref="barRef"></country-dimension-bar> -->
+        <base-bar-chart
+          title="椤圭洰涓暟"
+          :project="currentProject"
+        ></base-bar-chart>
+      </div>
+      <div class="current1">
+        <div class="aside-title">椤圭洰楗肩姸鍥�</div>
+        <!-- <base-pie-chart :project="currentProject"></base-pie-chart> -->
+        <country-dimension-pie
+          v-if="currentProject == '鍏ㄧ悆椤圭洰'"
+          ref="pieRef"
+        ></country-dimension-pie>
+        <province-dimension-pie v-else ref="pieRef"></province-dimension-pie>
+      </div>
+      <div class="current1">
+        <div class="aside-title">鏁版嵁浣跨敤鎯呭喌</div>
+        <dv-capsule-chart
+          :config="barConfig"
+          style="width: 360px; height: 85%"
+        />
+      </div>
+    </div>
+    <!-- 鍏ㄥ浗銆佸叏鐞冪缃� -->
+    <div class="rightContainer" v-if="currentDisplay == '绠$綉'">
+      <div class="current1">
+        <div class="aside-title">绔欏満搴ф暟</div>
+        <!-- <country-dimension-bar ref="barRef"></country-dimension-bar> -->
+        <base-bar-chart
+          title="绔欏満搴ф暟"
+          :project="currentProject"
+        ></base-bar-chart>
+      </div>
+      <div class="current1">
+        <div class="aside-title">闃�瀹ゅ骇鏁�</div>
+        <dv-active-ring-chart
+          :config="pieconfig"
+          style="width: 377px; height: 85%"
+        />
+      </div>
+      <div class="current1">
+        <div class="aside-title">绠¢亾鏉℃暟</div>
+        <dv-conical-column-chart
+          :config="config"
+          style="width: 377px; height: 85%"
+        />
+      </div>
+    </div>
+    <!-- 鍗曚釜宸ョ▼ -->
+    <div class="rightContainer" v-if="currentDisplay == '宸ョ▼'">
+      <div class="current1">
+        <div class="aside-title">鏁版嵁瀛樺偍閲�</div>
+        <base-line-chart
+          title="鏁版嵁瀛樺偍閲�"
+          :project="currentProject"
+          :params="params"
+        ></base-line-chart>
+      </div>
+      <div class="current1">
+        <div class="aside-title">鏁版嵁涓嬭浇娆℃暟</div>
+        <base-pie-chart
+          height="90%"
+          :project="currentProject"
+          :params="params"
+        ></base-pie-chart>
+      </div>
+      <div class="current1">
+        <div class="aside-title">绠¢亾鏉℃暟</div>
+        <div class="content" style="height: 30px">
           <div class="header">
             <div>鏍煎紡</div>
             <div>鏁伴噺</div>
           </div>
-          <file-format></file-format>
         </div>
+        <file-format :params="params"></file-format>
       </div>
     </div>
-    <div
-      class="rightContainer2"
-      v-if="CourtyDisplay && currentProject =='鍏ㄧ悆椤圭洰'"
-    >
-      <div class="current1">
-        <div class="aside-title">椤圭洰鏁伴噺鏌辩姸鍥�</div>
-        <country-dimension-bar ref="barRef"></country-dimension-bar>
-      </div>
-      <div class="current1">
-        <div class="aside-title">椤圭洰鏁伴噺楗肩姸鍥�</div>
-        <country-dimension-pie ref="pieRef"></country-dimension-pie>
-      </div>
-    </div>
-    <div class="rightContainer2" v-if="CourtyDisplay && currentProject =='鍏ㄥ浗椤圭洰'">
-      <div class="current1">
-        <div class="aside-title">椤圭洰鏁伴噺鏌辩姸鍥�</div>
-        <province-dimension-bar ref="barRef"></province-dimension-bar>
-      </div>
-      <div class="current1">
-        <div class="aside-title">椤圭洰鏁伴噺楗肩姸鍥�</div>
-        <province-dimension-pie ref="pieRef"></province-dimension-pie>
-      </div>
-    </div>
+
     <div class="rightarrow">
       <img :src="RightImg" @click="ChangeRight" />
     </div>
@@ -54,7 +111,18 @@
 import CountryDimensionPie from "../chart/CountryDimensionPie.vue"
 import ProvinceDimensionBar from "../chart/CountryProvinceBar.vue"
 import ProvinceDimensionPie from "../chart/CountryProvincePie.vue"
-import { countCountryDimension, countProvinceDimension } from "@/api/screen.js"
+import ServiceGet from "../chart/ServiceGet.vue"
+import BaseBarChart from "../chart/BaseBarChart.vue"
+import BaseLineChart from "../chart/BaseLineChart.vue"
+import BasePieChart from "../chart/BasePieChart .vue"
+import VisitCount from "../chart/VisitCount.vue"
+
+import {
+  countCountryDimension,
+  countProvinceDimension,
+  countZhPipeStations,
+  countDownloads,
+} from "@/api/screen.js"
 
 export default {
   components: {
@@ -66,25 +134,125 @@
     CountryDimensionBar,
     CountryDimensionPie,
     ProvinceDimensionBar,
-    ProvinceDimensionPie
+    ProvinceDimensionPie,
+    ServiceGet,
+    BaseBarChart,
+    BaseLineChart,
+    BasePieChart,
+    VisitCount,
   },
   data() {
     return {
       ChartDisplay: true,
       CourtyDisplay: false,
+      PipeDisPlay: false,
       RightImg: require("../../assets/img/Screen/leftArrow.png"),
       leftMessage: "init",
       currentProject: "鍏ㄧ悆椤圭洰",
+      currentDisplay: "澶у睆",
       countryData: [],
       provinceData: [],
+      config: {
+        data: [
+          {
+            name: "鍗楅槼",
+            value: 167,
+          },
+          {
+            name: "鍛ㄥ彛",
+            value: 123,
+          },
+          {
+            name: "婕渤",
+            value: 98,
+          },
+          {
+            name: "閮戝窞",
+            value: 75,
+          },
+          {
+            name: "瑗垮场",
+            value: 66,
+          },
+        ],
+        showValue: true,
+      },
+      pieconfig: {
+        data: [
+          {
+            name: "鍛ㄥ彛",
+            value: 55,
+          },
+          {
+            name: "鍗楅槼",
+            value: 120,
+          },
+          {
+            name: "瑗垮场",
+            value: 78,
+          },
+          {
+            name: "椹婚┈搴�",
+            value: 66,
+          },
+          {
+            name: "鏂颁埂",
+            value: 80,
+          },
+        ],
+        lineWidth: 10,
+      },
+      barConfig: {
+        data: [
+          {
+            name: "鍗楅槼",
+            value: 167,
+          },
+          {
+            name: "鍛ㄥ彛",
+            value: 123,
+          },
+          {
+            name: "婕渤",
+            value: 98,
+          },
+          {
+            name: "閮戝窞",
+            value: 75,
+          },
+          {
+            name: "瑗垮场",
+            value: 66,
+          },
+        ],
+        showValue: true,
+      },
+      params: {},
     }
   },
-
+  created() {
+    this.getZhPipeStations()
+    this.getCountDownloads()
+  },
   mounted() {
+    this.OpenLeftInit()
     this.$bus.$on("changeProject", name => {
+      if (name.includes("鍏ㄧ悆绠$綉") || name.includes("鍏ㄥ浗绠$綉")) {
+        this.currentDisplay = "绠$綉"
+      } else if (name.includes("鍏ㄧ悆椤圭洰") || name.includes("鍏ㄥ浗椤圭洰")) {
+        this.currentDisplay = "椤圭洰"
+      } else {
+        this.currentDisplay = "宸ョ▼"
+      }
       this.currentProject = name
     })
+    this.$bus.$on("changeProjectCode", code => {
+      this.params = {
+        projectCode: code,
+      }
+    })
   },
+
   methods: {
     ChangeRight() {
       if (this.leftMessage == "init") {
@@ -96,20 +264,21 @@
         this.ChartDisplay = !this.ChartDisplay
       }
 
-      if (this.leftMessage == "projectree") {
-        if (this.CourtyDisplay) {
-          this.RightImg = require("../../assets/img/Screen/leftArrow.png")
-        } else {
-          this.RightImg = require("../../assets/img/Screen/rightArrow.png")
-        }
-        this.CourtyDisplay = !this.CourtyDisplay
-      }
+      // if (this.leftMessage == "projectree") {
+      //   if (this.CourtyDisplay) {
+      //     this.RightImg = require("../../assets/img/Screen/leftArrow.png")
+      //   } else {
+      //     this.RightImg = require("../../assets/img/Screen/rightArrow.png")
+      //   }
+      //   this.CourtyDisplay = !this.CourtyDisplay
+      // }
 
       // this.ChartDisplay = !this.ChartDisplay
       this.$parent.ChangeWidth("right")
     },
     //鎵撳紑澶у睆宸︿晶鐣岄潰
     OpenLeftInit() {
+      this.currentDisplay = "澶у睆"
       this.ChartDisplay = true
       this.CourtyDisplay = false
       this.leftMessage = "init"
@@ -118,11 +287,50 @@
     },
 
     //鎵撳紑宸ョ▼鏍�
-    OpenLeftProjectTree() {
-      this.ChartDisplay = false
-      this.CourtyDisplay = true
-      this.leftMessage = "projectree"
-      this.$parent.ChangeWidth("leftTree")
+    // OpenLeftProjectTree() {
+    //   this.ChartDisplay = false
+    //   this.CourtyDisplay = true
+    //   this.leftMessage = "projectree"
+    //   this.$parent.ChangeWidth("leftTree")
+    // },
+    async getZhPipeStations() {
+      const res = await countZhPipeStations()
+      if (res.code == 200) {
+        const data = res.result
+        this.pieconfig.data = res.result.map(item => {
+          return {
+            name: item.杈撻�佷粙璐�,
+            value: item.绠¢亾鏁伴噺,
+          }
+        })
+
+        this.pieconfig = {
+          ...this.pieconfig,
+        }
+        this.config.data = res.result.map(item => {
+          return {
+            name: item.杈撻�佷粙璐�,
+            value: item.绠¢亾鏁伴噺,
+          }
+        })
+        this.config = {
+          ...this.config,
+        }
+      }
+    },
+    async getCountDownloads() {
+      const res = await countDownloads()
+      if (res.code == 200) {
+        this.barConfig.data = res.result.map(item => {
+          return {
+            name: item.typename,
+            value: item.count,
+          }
+        })
+        this.barConfig = {
+          ...this.barConfig,
+        }
+      }
     },
   },
 }
@@ -135,6 +343,7 @@
   flex-direction: row;
   align-items: center;
   justify-content: center;
+
   .rightarrow {
     width: 36px;
     height: 100%;
@@ -150,7 +359,6 @@
   .rightContainer {
     height: 100%;
     width: calc(100% - 45px);
-
     display: flex;
     flex-direction: column;
     align-items: center;
@@ -173,27 +381,27 @@
     .current1 {
       margin-top: 10px;
       margin-bottom: 30px;
-      height: 32%;
+      height: 30%;
       width: 100%;
       background: url(../../assets/img/Screen/chartbg.png);
       background-size: 100% 100%;
       background-repeat: no-repeat;
     }
   }
-}
-.content {
-  width: 100%;
-  background: url(../../assets/img/Screen/contentBg.png);
-  background-size: 100% 100%;
-  background-repeat: no-repeat;
-  .header {
-    margin: 0px auto;
-    padding: 10px 0;
-    width: 80%;
-    display: flex;
-    justify-content: space-between;
-    color: #fff;
-    font-size: 13px;
+  .content {
+    width: 100%;
+    background: url(../../assets/img/Screen/contentBg.png);
+    background-size: 100% 100%;
+    background-repeat: no-repeat;
+    .header {
+      margin: 0px auto;
+      padding: 10px 0;
+      width: 80%;
+      display: flex;
+      justify-content: space-between;
+      color: #fff;
+      font-size: 13px;
+    }
   }
 }
 </style>

--
Gitblit v1.9.3