管道基础大数据平台系统开发-【前端】-新系統界面
王旭
2023-05-09 93c0e388bc3fe955c223e1b23a1f4257b1d60d11
src/components/Screen/right.vue
@@ -1,27 +1,21 @@
<template>
  <div class="current">
    <div
      class="rightContainer"
      v-if="currentDisplay == '大屏' && ChartDisplay"
    >
      <div class="current1">
    <div class="rightContainer" v-if="currentDisplay == '大屏' && ChartDisplay">
      <div class="current1 current1-1">
        <div class="aside-title">项目统计</div>
        <project-category></project-category>
      </div>
      <div class="current1">
      <div class="current1 current1-2">
        <div class="aside-title">数据统计</div>
        <visit-count></visit-count>
      </div>
      <div class="current1">
      <div class="current1 current1-3">
        <div class="aside-title">服务访问次数</div>
        <Service-Get></Service-Get>
      </div>
    </div>
    <!-- 全球、全国项目 -->
    <div
      class="rightContainer"
      v-if="currentDisplay == '项目'"
    >
    <div class="rightContainer" v-if="currentDisplay == '项目'">
      <div class="current1">
        <div class="aside-title"></div>
        <!-- <country-dimension-bar ref="barRef"></country-dimension-bar> -->
@@ -37,10 +31,7 @@
          v-if="currentProject == '全球项目'"
          ref="pieRef"
        ></country-dimension-pie>
        <province-dimension-pie
          v-else
          ref="pieRef"
        ></province-dimension-pie>
        <province-dimension-pie v-else ref="pieRef"></province-dimension-pie>
      </div>
      <div class="current1">
        <div class="aside-title">数据使用情况</div>
@@ -51,10 +42,7 @@
      </div>
    </div>
    <!-- 全国、全球管网 -->
    <div
      class="rightContainer"
      v-if="currentDisplay == '管网'"
    >
    <div class="rightContainer" v-if="currentDisplay == '管网'">
      <div class="current1">
        <div class="aside-title">站场座数</div>
        <!-- <country-dimension-bar ref="barRef"></country-dimension-bar> -->
@@ -79,10 +67,7 @@
      </div>
    </div>
    <!-- 单个工程 -->
    <div
      class="rightContainer"
      v-if="currentDisplay == '工程'"
    >
    <div class="rightContainer" v-if="currentDisplay == '工程'">
      <div class="current1">
        <div class="aside-title">数据存储量</div>
        <base-line-chart
@@ -101,10 +86,7 @@
      </div>
      <div class="current1">
        <div class="aside-title">管道条数</div>
        <div
          class="content"
          style="height: 30px"
        >
        <div class="content" style="height: 30px">
          <div class="header">
            <div>格式</div>
            <div>数量</div>
@@ -115,35 +97,32 @@
    </div>
    <div class="rightarrow">
      <img
        :src="RightImg"
        @click="ChangeRight"
      />
      <img :src="RightImg" @click="ChangeRight" />
    </div>
  </div>
</template>
<script>
import echart11 from "@/components/echart11.vue"
import echart12 from "@/components/echart12.vue"
import echart13 from "@/components/echart13.vue"
import FileFormat from "@/components/chart/FileFormat.vue"
import ProjectCategory from "../chart/ProjectCategory.vue"
import CountryDimensionBar from "../chart/CountryDimensionBar.vue"
import CountryDimensionPie from "../chart/CountryDimensionPie.vue"
import ProvinceDimensionBar from "../chart/CountryProvinceBar.vue"
import ProvinceDimensionPie from "../chart/CountryProvincePie.vue"
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 echart11 from "@/components/echart11.vue";
import echart12 from "@/components/echart12.vue";
import echart13 from "@/components/echart13.vue";
import FileFormat from "@/components/chart/FileFormat.vue";
import ProjectCategory from "../chart/ProjectCategory.vue";
import CountryDimensionBar from "../chart/CountryDimensionBar.vue";
import CountryDimensionPie from "../chart/CountryDimensionPie.vue";
import ProvinceDimensionBar from "../chart/CountryProvinceBar.vue";
import ProvinceDimensionPie from "../chart/CountryProvincePie.vue";
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"
} from "@/api/screen.js";
export default {
  components: {
@@ -249,44 +228,44 @@
        showValue: true,
      },
      params: {},
    }
    };
  },
  created() {
    this.getZhPipeStations()
    this.getCountDownloads()
    this.getZhPipeStations();
    this.getCountDownloads();
  },
  mounted() {
    this.OpenLeftInit()
    this.$bus.$on("changeProject", name => {
    this.OpenLeftInit();
    this.$bus.$on("changeProject", (name) => {
      if (name.includes("全球管网") || name.includes("全国管网")) {
        this.currentDisplay = "管网"
        this.currentDisplay = "管网";
      } else if (name.includes("全球项目") || name.includes("全国项目")) {
        this.currentDisplay = "项目"
        this.currentDisplay = "项目";
      } else {
        this.currentDisplay = "工程"
        this.currentDisplay = "工程";
      }
      this.currentProject = name
    })
    this.$bus.$on("changeProjectCode", code => {
      this.currentProject = name;
    });
    this.$bus.$on("changeProjectCode", (code) => {
      this.params = {
        projectCode: code,
      }
    })
      };
    });
    this.$bus.$on("closeLeftAndRightMenu", (res) => {
      this.ChartDisplay = res
      this.ChartDisplay = res;
      this.ChangeRight();
    })
    });
  },
  methods: {
    ChangeRight() {
      if (this.leftMessage == "init") {
        if (this.ChartDisplay) {
          this.RightImg = require("../../assets/img/Screen/rightArrow.png")
          this.RightImg = require("../../assets/img/Screen/rightArrow.png");
        } else {
          this.RightImg = require("../../assets/img/Screen/leftArrow.png")
          this.RightImg = require("../../assets/img/Screen/leftArrow.png");
        }
        this.ChartDisplay = !this.ChartDisplay
        this.ChartDisplay = !this.ChartDisplay;
      }
      // if (this.leftMessage == "projectree") {
@@ -299,14 +278,14 @@
      // }
      // this.ChartDisplay = !this.ChartDisplay
      this.$parent.ChangeWidth("right")
      this.$parent.ChangeWidth("right");
    },
    //打开大屏左侧界面
    OpenLeftInit() {
      this.currentDisplay = "大屏"
      this.ChartDisplay = true
      this.CourtyDisplay = false
      this.leftMessage = "init"
      this.currentDisplay = "大屏";
      this.ChartDisplay = true;
      this.CourtyDisplay = false;
      this.leftMessage = "init";
      // this.OpenLeftInitChart();
      // this.$parent.ChangeWidth("leftTree")
    },
@@ -319,46 +298,46 @@
    //   this.$parent.ChangeWidth("leftTree")
    // },
    async getZhPipeStations() {
      const res = await countZhPipeStations()
      const res = await countZhPipeStations();
      if (res.code == 200) {
        const data = res.result
        this.pieconfig.data = res.result.map(item => {
        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 => {
        };
        this.config.data = res.result.map((item) => {
          return {
            name: item.输送介质,
            value: item.管道数量,
          }
        })
          };
        });
        this.config = {
          ...this.config,
        }
        };
      }
    },
    async getCountDownloads() {
      const res = await countDownloads()
      const res = await countDownloads();
      if (res.code == 200) {
        this.barConfig.data = res.result.map(item => {
        this.barConfig.data = res.result.map((item) => {
          return {
            name: item.typename,
            value: item.count,
          }
        })
          };
        });
        this.barConfig = {
          ...this.barConfig,
        }
        };
      }
    },
  },
}
};
</script>
<style lang="less">
.current {
@@ -412,6 +391,7 @@
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }
  }
  .content {
    width: 100%;
@@ -429,4 +409,15 @@
    }
  }
}
@media (max-width: 1400px) {
  .current .rightContainer .current1-1 {
   height: 42%;
  }
  .current .rightContainer .current1-2 {
     height: 28%;
  }
  .current .rightContainer .current1-3 {
   height: 28%;
  }
}
</style>