Przeglądaj źródła

Merge branch 'master' of http://192.168.0.115:3000/shaogen1995/jiangxiSZ

DR/4DAGE 3 lat temu
rodzic
commit
76ac1eaf94

+ 46 - 28
shuzhixiangzheng/src/App.vue

@@ -1,40 +1,58 @@
 <template>
   <div id="container">
-    <router-view/>
+    <router-view />
   </div>
 </template>
 
 <script>
-import './assets/base.css'
-   import Map from "./assets/api/Map.js"
-   import {SZZSY_httpGet,SZZSQSY_httpGet,SZZXQ_httpGet} from "./assets/api/loadData.js"
+import "./assets/base.css";
+import Map from "./assets/api/Map.js";
+import {
+  SZZSY_httpGet,
+  SZZSQSY_httpGet,
+  SZZXQ_httpGet,
+} from "./assets/api/loadData.js";
 export default {
-  name: 'container',
-  mounted(){
-    window.cesiumMap=new Map();
-    SZZSY_httpGet(result=>{
-        this.$store.commit('setSzdata',result.data);   
-      },reuslt=>{})
-    SZZSQSY_httpGet("大中社区",result=>{
-      console.log("大中社区",result);
-      this.$store.commit('setDaZhongdata',result.data); 
-    },result=>{})
-    SZZXQ_httpGet("金湖国际",result=>{
-      this.$store.commit('setJinghuguoji',result.data);
-      // console.log("金湖国际",result);
-    },result=>{})
-    },
-}
+  name: "container",
+  mounted() {
+    window.cesiumMap = new Map();
+    SZZSY_httpGet(
+      (result) => {
+        console.log("首页", result);
+        this.$store.commit("setSzdata", result.data);
+      },
+      (reuslt) => {}
+    );
+    SZZSQSY_httpGet(
+      "大中社区",
+      (result) => {
+        console.log("大中社区", result);
+        this.$store.commit("setDaZhongdata", result.data);
+      },
+      (result) => {}
+    );
+    SZZXQ_httpGet(
+      "金湖国际",
+      (result) => {
+        this.$store.commit("setJinghuguoji", result.data);
+        // console.log("金湖国际",result);
+      },
+      (result) => {}
+    );
+  },
+};
 </script>
 
 <style>
-  html,body,#container {
-            width: 100%;
-            height: 100%;
-            margin: 0;
-            padding: 0;
-            overflow: hidden;
-            z-index: 1;
-            position: absolute;
+html,
+body,
+#container {
+  width: 100%;
+  height: 100%;
+  margin: 0;
+  padding: 0;
+  overflow: hidden;
+  z-index: 1;
+  position: absolute;
 }
 </style>

+ 18 - 2
shuzhixiangzheng/src/components/DaZhongPage.vue

@@ -6,7 +6,7 @@
     <img class="img" id="img1" src="../assets/png/footer.png" />
     <img class="img" id="img2" src="../assets/png/title.png" />
     <!-- <img class="img" id="img3" :src="leftPng_url" /> -->
-    <LeftPage></LeftPage>
+    <LeftPage :dataAll='dataAll'></LeftPage>
     <RightPage></RightPage>
     <!-- <img class="img" id="img5" :src="rightPng_url" /> -->
     <img class="img" id="img4" src="../assets/png/pop.png" />
@@ -128,6 +128,8 @@
     },
     data() {
       return {
+        // 传给左侧的总数据
+        dataAll:{},
         msg: '',
         form_show: false,
         housePng_url: housePng,
@@ -149,12 +151,26 @@
       }
     },
     mounted() {
+      // 拿到大中社区的数据,传给左侧的组件
+      let clear = setInterval(() => {
+        if (
+          this.$store.getters.getDaZhongdata.code === 10000 &&
+          this.$store.getters.getDaZhongdata.data.index
+        ) {
+          this.dataAll=this.$store.getters.getDaZhongdata.data
+          console.log('--------',this.dataAll);
+          clearInterval(clear);
+        }
+      }, 500);
+
+
       window.cesiumMap.removeGaode();
       this.addEvent();
       this.initTable();
       this.jhgj_changeHouse();
       this.lxw_changeHouse();
-    },
+
+   },
     methods: {
       addEvent() {
         window.cesiumMap.left_clickFun(this.clickjinghuguojiShowFun, this.jinghuguojiShowFun, this

+ 23 - 2
shuzhixiangzheng/src/components/MainPage.vue

@@ -10,7 +10,7 @@
 
     <div id="left_div">
       <img class="menu" src="../assets/png/1.png" />
-      <ViewPage></ViewPage>
+      <ViewPage :szdata='szdata'></ViewPage>
       <img class="menu" id="peopleStatus" src="../assets/png/2.png" />
       <img id="person_status" src="../assets/png/people_status.png" />
       <PersonStatusPage></PersonStatusPage>
@@ -78,11 +78,32 @@ export default {
     VaccinationPage,
   },
   data() {
-    return {};
+    return {
+      szdata: {
+        // -- 概况
+        peoples: 0, //在籍人数
+        villages: 0, //小区数量
+        villagesWithCompany: 0, //由物业小区
+        buildings: 0, //建筑数量
+        households: 0, //户数
+        villagesWithoutCompany: 0, //无物业小区
+      }
+    };
   },
   created() {},
   mounted() {
     this.change();
+    // 拿到首页数据,传给左侧的组件
+    let clear = setInterval(() => {
+      if (
+        this.$store.getters.getSzdata.code === 10000 &&
+        this.$store.getters.getSzdata.data.index
+      ) {
+        this.szdata = this.$store.getters.getSzdata.data.index;
+        console.log("this.szdata", this.szdata);
+        clearInterval(clear);
+      }
+    }, 500);
   },
   methods: {
     change() {

+ 3 - 21
shuzhixiangzheng/src/components/MainPageChild/ViewPage.vue

@@ -49,33 +49,15 @@
     <script>
 export default {
   name: "View",
-  // props: ['szdata'],
+  props: ['szdata'],
   components: {},
   data() {
     return {
-      szdata: {
-        // -- 概况
-        peoples: 0, //在籍人数
-        villages: 42, //小区数量
-        villagesWithCompany: 33, //由物业小区
-        buildings: 8049, //建筑数量
-        households: 23653, //户数
-        villagesWithoutCompany: 8, //无物业小区
-      },
+
     };
   },
   mounted() {
-    let clear = setInterval(() => {
-      console.log(1111);
-      if (
-        this.$store.getters.getSzdata.code === 10000 &&
-        this.$store.getters.getSzdata.data.index
-      ) {
-        this.szdata = this.$store.getters.getSzdata.data.index;
-        console.log("this.szdata", this.szdata);
-        clearInterval(clear);
-      }
-    }, 500);
+
   },
   methods: {},
 };

+ 2 - 30
shuzhixiangzheng/src/components/OtherChilds/Dezhizhaihai.vue

@@ -32,40 +32,12 @@
   
   <script>
 export default {
+  props: ["data"],
   name: "dezhizhaihaiPage",
   components: {},
   data() {
     return {
-      data: [
-        {
-          id: 1,
-          name: "月亮山东路水务局宿舍等13户屋后滑坡",
-          type: "滑坡",
-          num: 48.0,
-        },
-        { id: 2, name: "金湾666666666", type: "滑坡隐患点", num: 32.0 },
-        {
-          id: 3,
-          name: "月亮山东路水务局宿舍等13户屋后滑坡",
-          type: "滑坡",
-          num: 48.0,
-        },
-        { id: 4, name: "金湾666666666", type: "滑坡隐患点", num: 32.0 },
-        {
-          id: 5,
-          name: "月亮山东路水务局宿舍等13户屋后滑坡",
-          type: "滑坡",
-          num: 48.0,
-        },
-        { id: 6, name: "金湾666666666", type: "滑坡隐患点", num: 32.0 },
-        {
-          id: 7,
-          name: "月亮山东路水务局宿舍等13户屋后滑坡",
-          type: "滑坡",
-          num: 48.0,
-        },
-        { id: 8, name: "金湾666666666", type: "滑坡隐患点", num: 32.0 },
-      ],
+
     };
   },
   mounted() {},

+ 6 - 3
shuzhixiangzheng/src/components/OtherChilds/LeftPage.vue

@@ -2,12 +2,12 @@
   <div id="leftPage">
     <img id="dazhong_img" src="../../assets/png/dazhong.png" />
     <div id="viewPage_f">
-      <ViewPage></ViewPage>
+      <ViewPage :szdata="dataAll.index"></ViewPage>
     </div>
     <img id="person_status_img" src="../../assets/png/2.png" />
     <PepoleStatus></PepoleStatus>
     <img id="dizhizaihai_img" src="../../assets/png/dizhizaihai.png" />
-    <Dezhizhaihai></Dezhizhaihai>
+    <Dezhizhaihai :data='dataAll.damage'></Dezhizhaihai>
   </div>
 </template>
   
@@ -16,6 +16,7 @@ import ViewPage from "../MainPageChild/ViewPage.vue";
 import PepoleStatus from "../OtherChilds/PepoleStatus.vue";
 import Dezhizhaihai from "./Dezhizhaihai.vue";
 export default {
+  props: ["dataAll"],
   name: "",
   components: {
     ViewPage,
@@ -25,7 +26,9 @@ export default {
   data() {
     return {};
   },
-  mounted() {},
+  mounted() {
+    console.log('拿到数据',this.dataAll);
+  },
   methods: {},
 };
 </script>

+ 2 - 2
shuzhixiangzheng/src/components/OtherChilds/PepoleStatus.vue

@@ -1,9 +1,9 @@
 <template>
   <div id="pepoleStatusPage">
-    <img src="../../assets/png/yq_background.png" class="yq_background_img"></img>
+    <img src="../../assets/png/yq_background.png" class="yq_background_img" />
     <div class="czrk_name">常住人口</div>
     <div class="czrk_num">{{czrk.num}}</div>
-    <img src="../../assets/png/yq_background.png" class="yq_background_img1"></img>
+    <img src="../../assets/png/yq_background.png" class="yq_background_img1" />
     <div class="ldrk_name">流动人口</div>
     <div class="ldrk_num">{{ldrk.num}}</div>
     <ThreeDCharts3></ThreeDCharts3>