管道基础大数据平台系统开发-【前端】-新系統界面
王旭
2023-05-09 93c0e388bc3fe955c223e1b23a1f4257b1d60d11
src/components/Screen/right.vue
@@ -1,15 +1,15 @@
<template>
  <div class="current">
    <div class="rightContainer" v-if="currentDisplay == '大屏' && ChartDisplay">
      <div class="current1">
      <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>
@@ -102,27 +102,27 @@
  </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: {
@@ -228,40 +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.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") {
@@ -274,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")
    },
@@ -294,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 {
@@ -387,6 +391,7 @@
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }
  }
  .content {
    width: 100%;
@@ -404,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>